repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.setDouble | @PublicEvolving
public void setDouble(ConfigOption<Double> key, double value) {
"""
Adds the given value to the configuration object.
The main key of the config option will be used to map the value.
@param key
the option specifying the key to be added
@param value
the value of the key/value pair to be adde... | java | @PublicEvolving
public void setDouble(ConfigOption<Double> key, double value) {
setValueInternal(key.key(), value);
} | [
"@",
"PublicEvolving",
"public",
"void",
"setDouble",
"(",
"ConfigOption",
"<",
"Double",
">",
"key",
",",
"double",
"value",
")",
"{",
"setValueInternal",
"(",
"key",
".",
"key",
"(",
")",
",",
"value",
")",
";",
"}"
] | Adds the given value to the configuration object.
The main key of the config option will be used to map the value.
@param key
the option specifying the key to be added
@param value
the value of the key/value pair to be added | [
"Adds",
"the",
"given",
"value",
"to",
"the",
"configuration",
"object",
".",
"The",
"main",
"key",
"of",
"the",
"config",
"option",
"will",
"be",
"used",
"to",
"map",
"the",
"value",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L560-L563 |
autermann/yaml | src/main/java/com/github/autermann/yaml/Yaml.java | Yaml.dumpAll | public void dumpAll(Iterator<? extends YamlNode> data, OutputStream output) {
"""
Dumps {@code data} into a {@code OutputStream} using a {@code UTF-8}
encoding.
@param data the data
@param output the output stream
"""
getDelegate().dumpAll(data, new OutputStreamWriter(output, Charset
... | java | public void dumpAll(Iterator<? extends YamlNode> data, OutputStream output) {
getDelegate().dumpAll(data, new OutputStreamWriter(output, Charset
.forName("UTF-8")));
} | [
"public",
"void",
"dumpAll",
"(",
"Iterator",
"<",
"?",
"extends",
"YamlNode",
">",
"data",
",",
"OutputStream",
"output",
")",
"{",
"getDelegate",
"(",
")",
".",
"dumpAll",
"(",
"data",
",",
"new",
"OutputStreamWriter",
"(",
"output",
",",
"Charset",
".",... | Dumps {@code data} into a {@code OutputStream} using a {@code UTF-8}
encoding.
@param data the data
@param output the output stream | [
"Dumps",
"{",
"@code",
"data",
"}",
"into",
"a",
"{",
"@code",
"OutputStream",
"}",
"using",
"a",
"{",
"@code",
"UTF",
"-",
"8",
"}",
"encoding",
"."
] | train | https://github.com/autermann/yaml/blob/5f8ab03e4fec3a2abe72c03561cdaa3a3936634d/src/main/java/com/github/autermann/yaml/Yaml.java#L160-L163 |
knowm/XChange | xchange-bitflyer/src/main/java/org/knowm/xchange/bitflyer/BitflyerAdapters.java | BitflyerAdapters.adaptTicker | public static Ticker adaptTicker(BitflyerTicker ticker, CurrencyPair currencyPair) {
"""
Adapts a BitflyerTicker to a Ticker Object
@param ticker The exchange specific ticker
@param currencyPair (e.g. BTC/USD)
@return The ticker
"""
BigDecimal bid = ticker.getBestBid();
BigDecimal ask = ticker.ge... | java | public static Ticker adaptTicker(BitflyerTicker ticker, CurrencyPair currencyPair) {
BigDecimal bid = ticker.getBestBid();
BigDecimal ask = ticker.getBestAsk();
BigDecimal volume = ticker.getVolume();
BigDecimal last = ticker.getLtp();
Date timestamp =
ticker.getTimestamp() != null ? Bitfly... | [
"public",
"static",
"Ticker",
"adaptTicker",
"(",
"BitflyerTicker",
"ticker",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"BigDecimal",
"bid",
"=",
"ticker",
".",
"getBestBid",
"(",
")",
";",
"BigDecimal",
"ask",
"=",
"ticker",
".",
"getBestAsk",
"(",
")",
... | Adapts a BitflyerTicker to a Ticker Object
@param ticker The exchange specific ticker
@param currencyPair (e.g. BTC/USD)
@return The ticker | [
"Adapts",
"a",
"BitflyerTicker",
"to",
"a",
"Ticker",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-bitflyer/src/main/java/org/knowm/xchange/bitflyer/BitflyerAdapters.java#L85-L102 |
finmath/finmath-lib | src/main/java/net/finmath/time/FloatingpointDate.java | FloatingpointDate.getDateFromFloatingPointDate | public static LocalDateTime getDateFromFloatingPointDate(LocalDateTime referenceDate, double floatingPointDate) {
"""
Convert a floating point date to a LocalDateTime.
Note: This method currently performs a rounding to the next second.
If referenceDate is null, the method returns null.
@param referenceDat... | java | public static LocalDateTime getDateFromFloatingPointDate(LocalDateTime referenceDate, double floatingPointDate) {
if(referenceDate == null) {
return null;
}
Duration duration = Duration.ofSeconds(Math.round(floatingPointDate * SECONDS_PER_DAY));
return referenceDate.plus(duration);
} | [
"public",
"static",
"LocalDateTime",
"getDateFromFloatingPointDate",
"(",
"LocalDateTime",
"referenceDate",
",",
"double",
"floatingPointDate",
")",
"{",
"if",
"(",
"referenceDate",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Duration",
"duration",
"=",
"... | Convert a floating point date to a LocalDateTime.
Note: This method currently performs a rounding to the next second.
If referenceDate is null, the method returns null.
@param referenceDate The reference date associated with \( t=0 \).
@param floatingPointDate The value to the time offset \( t \).
@return The date r... | [
"Convert",
"a",
"floating",
"point",
"date",
"to",
"a",
"LocalDateTime",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/time/FloatingpointDate.java#L67-L74 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/stylers/AbstractFieldStyler.java | AbstractFieldStyler.makeField | @Override
public PdfFormField makeField() throws IOException, DocumentException, VectorPrintException {
"""
Create the PdfFormField that will be used to add a form field to the pdf.
@return
@throws IOException
@throws DocumentException
@throws VectorPrintException
"""
switch (getFieldtype()) {
... | java | @Override
public PdfFormField makeField() throws IOException, DocumentException, VectorPrintException {
switch (getFieldtype()) {
case TEXT:
return ((TextField) bf).getTextField();
case COMBO:
return ((TextField) bf).getComboField();
case LIST:
re... | [
"@",
"Override",
"public",
"PdfFormField",
"makeField",
"(",
")",
"throws",
"IOException",
",",
"DocumentException",
",",
"VectorPrintException",
"{",
"switch",
"(",
"getFieldtype",
"(",
")",
")",
"{",
"case",
"TEXT",
":",
"return",
"(",
"(",
"TextField",
")",... | Create the PdfFormField that will be used to add a form field to the pdf.
@return
@throws IOException
@throws DocumentException
@throws VectorPrintException | [
"Create",
"the",
"PdfFormField",
"that",
"will",
"be",
"used",
"to",
"add",
"a",
"form",
"field",
"to",
"the",
"pdf",
"."
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/AbstractFieldStyler.java#L222-L240 |
h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/vals/ValRow.java | ValRow.slice | public ValRow slice(int[] cols) {
"""
Creates a new ValRow by selecting elements at the specified indices.
@param cols array of indices to select. We do not check for AIOOB errors.
@return new ValRow object
"""
double[] ds = new double[cols.length];
String[] ns = new String[cols.length];
for (int... | java | public ValRow slice(int[] cols) {
double[] ds = new double[cols.length];
String[] ns = new String[cols.length];
for (int i = 0; i < cols.length; ++i) {
ds[i] = _ds[cols[i]];
ns[i] = _names[cols[i]];
}
return new ValRow(ds, ns);
} | [
"public",
"ValRow",
"slice",
"(",
"int",
"[",
"]",
"cols",
")",
"{",
"double",
"[",
"]",
"ds",
"=",
"new",
"double",
"[",
"cols",
".",
"length",
"]",
";",
"String",
"[",
"]",
"ns",
"=",
"new",
"String",
"[",
"cols",
".",
"length",
"]",
";",
"fo... | Creates a new ValRow by selecting elements at the specified indices.
@param cols array of indices to select. We do not check for AIOOB errors.
@return new ValRow object | [
"Creates",
"a",
"new",
"ValRow",
"by",
"selecting",
"elements",
"at",
"the",
"specified",
"indices",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/vals/ValRow.java#L37-L45 |
pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/config/JsonConfigReader.java | JsonConfigReader.readObject | public Object readObject(String correlationId, ConfigParams parameters) throws ApplicationException {
"""
Reads configuration file, parameterizes its content and converts it into JSON
object.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param parameters values to ... | java | public Object readObject(String correlationId, ConfigParams parameters) throws ApplicationException {
if (_path == null)
throw new ConfigException(correlationId, "NO_PATH", "Missing config file path");
try {
Path path = Paths.get(_path);
String json = new String(Files.readAllBytes(path));
json = param... | [
"public",
"Object",
"readObject",
"(",
"String",
"correlationId",
",",
"ConfigParams",
"parameters",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"_path",
"==",
"null",
")",
"throw",
"new",
"ConfigException",
"(",
"correlationId",
",",
"\"NO_PATH\"",
","... | Reads configuration file, parameterizes its content and converts it into JSON
object.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param parameters values to parameters the configuration.
@return a JSON object with configuration.
@throws ApplicationException when error occu... | [
"Reads",
"configuration",
"file",
"parameterizes",
"its",
"content",
"and",
"converts",
"it",
"into",
"JSON",
"object",
"."
] | train | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/config/JsonConfigReader.java#L72-L87 |
datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.authorize | public Request authorize(String name, String password) {
"""
method to set authorization header after computing digest from user and pasword
@param name : username
@param password : password
@return : Request Object with authorization header value set
"""
String authString = name + ":" + password;... | java | public Request authorize(String name, String password){
String authString = name + ":" + password;
System.out.println("auth string: " + authString);
byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
String authStringEnc = new String(authEncBytes);
System.out.print... | [
"public",
"Request",
"authorize",
"(",
"String",
"name",
",",
"String",
"password",
")",
"{",
"String",
"authString",
"=",
"name",
"+",
"\":\"",
"+",
"password",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"auth string: \"",
"+",
"authString",
")",
"... | method to set authorization header after computing digest from user and pasword
@param name : username
@param password : password
@return : Request Object with authorization header value set | [
"method",
"to",
"set",
"authorization",
"header",
"after",
"computing",
"digest",
"from",
"user",
"and",
"pasword"
] | train | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L278-L286 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/xml/hints/HintParser.java | HintParser.parseHints | public void parseHints(InputStream inputStream) throws HintParseException, SAXException {
"""
Parses the given XML stream and returns a list of the hint rules
contained.
@param inputStream an InputStream containing hint rules
@throws HintParseException thrown if the XML cannot be parsed
@throws SAXException ... | java | public void parseHints(InputStream inputStream) throws HintParseException, SAXException {
try (
InputStream schemaStream13 = FileUtils.getResourceAsStream(HINT_SCHEMA_1_3);
InputStream schemaStream12 = FileUtils.getResourceAsStream(HINT_SCHEMA_1_2);
InputStream sc... | [
"public",
"void",
"parseHints",
"(",
"InputStream",
"inputStream",
")",
"throws",
"HintParseException",
",",
"SAXException",
"{",
"try",
"(",
"InputStream",
"schemaStream13",
"=",
"FileUtils",
".",
"getResourceAsStream",
"(",
"HINT_SCHEMA_1_3",
")",
";",
"InputStream"... | Parses the given XML stream and returns a list of the hint rules
contained.
@param inputStream an InputStream containing hint rules
@throws HintParseException thrown if the XML cannot be parsed
@throws SAXException thrown if the XML cannot be parsed | [
"Parses",
"the",
"given",
"XML",
"stream",
"and",
"returns",
"a",
"list",
"of",
"the",
"hint",
"rules",
"contained",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintParser.java#L138-L168 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/InheritDocTaglet.java | InheritDocTaglet.getTagletOutput | public Content getTagletOutput(Tag tag, TagletWriter tagletWriter) {
"""
Given the <code>Tag</code> representation of this custom
tag, return its string representation, which is output
to the generated page.
@param tag the <code>Tag</code> representation of this custom tag.
@param tagletWriter the taglet write... | java | public Content getTagletOutput(Tag tag, TagletWriter tagletWriter) {
if (! (tag.holder() instanceof ProgramElementDoc)) {
return tagletWriter.getOutputInstance();
}
return tag.name().equals("@inheritDoc") ?
retrieveInheritedDocumentation(tagletWriter, (ProgramElementD... | [
"public",
"Content",
"getTagletOutput",
"(",
"Tag",
"tag",
",",
"TagletWriter",
"tagletWriter",
")",
"{",
"if",
"(",
"!",
"(",
"tag",
".",
"holder",
"(",
")",
"instanceof",
"ProgramElementDoc",
")",
")",
"{",
"return",
"tagletWriter",
".",
"getOutputInstance",... | Given the <code>Tag</code> representation of this custom
tag, return its string representation, which is output
to the generated page.
@param tag the <code>Tag</code> representation of this custom tag.
@param tagletWriter the taglet writer for output.
@return the Content representation of this <code>Tag</code>. | [
"Given",
"the",
"<code",
">",
"Tag<",
"/",
"code",
">",
"representation",
"of",
"this",
"custom",
"tag",
"return",
"its",
"string",
"representation",
"which",
"is",
"output",
"to",
"the",
"generated",
"page",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/InheritDocTaglet.java#L163-L170 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/util/Util.java | Util.decodeLTPAToken | @Sensitive
public static byte[] decodeLTPAToken(Codec codec, @Sensitive byte[] token_arr) throws SASException {
"""
WAS classic encodes the GSSToken containing the encoded LTPA token inside another GSSToken.
This code detects if there is another GSSToken inside the GSSToken,
obtains the internal LTPA token b... | java | @Sensitive
public static byte[] decodeLTPAToken(Codec codec, @Sensitive byte[] token_arr) throws SASException {
byte[] ltpaTokenBytes = null;
try {
byte[] data = readGSSTokenData(LTPAMech.LTPA_OID.substring(4), token_arr);
if (data != null) {
// Check if it i... | [
"@",
"Sensitive",
"public",
"static",
"byte",
"[",
"]",
"decodeLTPAToken",
"(",
"Codec",
"codec",
",",
"@",
"Sensitive",
"byte",
"[",
"]",
"token_arr",
")",
"throws",
"SASException",
"{",
"byte",
"[",
"]",
"ltpaTokenBytes",
"=",
"null",
";",
"try",
"{",
... | WAS classic encodes the GSSToken containing the encoded LTPA token inside another GSSToken.
This code detects if there is another GSSToken inside the GSSToken,
obtains the internal LTPA token bytes, and decodes them.
@param codec The codec to do the encoding of the Any.
@param token_arr the bytes of the GSS token to d... | [
"WAS",
"classic",
"encodes",
"the",
"GSSToken",
"containing",
"the",
"encoded",
"LTPA",
"token",
"inside",
"another",
"GSSToken",
".",
"This",
"code",
"detects",
"if",
"there",
"is",
"another",
"GSSToken",
"inside",
"the",
"GSSToken",
"obtains",
"the",
"internal... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/util/Util.java#L556-L579 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/ItemRule.java | ItemRule.setValue | public void setValue(Set<Token[]> tokensSet) {
"""
Sets a value to this Set type item.
@param tokensSet the tokens set
"""
if (tokensSet == null) {
throw new IllegalArgumentException("tokensSet must not be null");
}
if (type == null) {
type = ItemType.SET;
... | java | public void setValue(Set<Token[]> tokensSet) {
if (tokensSet == null) {
throw new IllegalArgumentException("tokensSet must not be null");
}
if (type == null) {
type = ItemType.SET;
}
if (!isListableType()) {
throw new IllegalArgumentException("... | [
"public",
"void",
"setValue",
"(",
"Set",
"<",
"Token",
"[",
"]",
">",
"tokensSet",
")",
"{",
"if",
"(",
"tokensSet",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"tokensSet must not be null\"",
")",
";",
"}",
"if",
"(",
"type... | Sets a value to this Set type item.
@param tokensSet the tokens set | [
"Sets",
"a",
"value",
"to",
"this",
"Set",
"type",
"item",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/ItemRule.java#L357-L368 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java | GVRPicker.setPickRay | public void setPickRay(float ox, float oy, float oz, float dx, float dy, float dz) {
"""
Sets the origin and direction of the pick ray.
@param ox X coordinate of origin.
@param oy Y coordinate of origin.
@param oz Z coordinate of origin.
@param dx X coordinate of ray direction.
@param dy Y co... | java | public void setPickRay(float ox, float oy, float oz, float dx, float dy, float dz)
{
synchronized (this)
{
mRayOrigin.x = ox;
mRayOrigin.y = oy;
mRayOrigin.z = oz;
mRayDirection.x = dx;
mRayDirection.y = dy;
mRayDirection.z = dz... | [
"public",
"void",
"setPickRay",
"(",
"float",
"ox",
",",
"float",
"oy",
",",
"float",
"oz",
",",
"float",
"dx",
",",
"float",
"dy",
",",
"float",
"dz",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"mRayOrigin",
".",
"x",
"=",
"ox",
";",
"mRayOr... | Sets the origin and direction of the pick ray.
@param ox X coordinate of origin.
@param oy Y coordinate of origin.
@param oz Z coordinate of origin.
@param dx X coordinate of ray direction.
@param dy Y coordinate of ray direction.
@param dz Z coordinate of ray direction.
The coordinate system of the... | [
"Sets",
"the",
"origin",
"and",
"direction",
"of",
"the",
"pick",
"ray",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L418-L429 |
cdk/cdk | descriptor/fingerprint/src/main/java/org/openscience/cdk/similarity/Tanimoto.java | Tanimoto.calculate | public static float calculate(BitSet bitset1, BitSet bitset2) throws CDKException {
"""
Evaluates Tanimoto coefficient for two bit sets.
<p>
@param bitset1 A bitset (such as a fingerprint) for the first molecule
@param bitset2 A bitset (such as a fingerprint) for the second molecule
@return The Tanimoto coeffi... | java | public static float calculate(BitSet bitset1, BitSet bitset2) throws CDKException {
float _bitset1_cardinality = bitset1.cardinality();
float _bitset2_cardinality = bitset2.cardinality();
if (bitset1.size() != bitset2.size()) {
throw new CDKException("Bitsets must have the same bit l... | [
"public",
"static",
"float",
"calculate",
"(",
"BitSet",
"bitset1",
",",
"BitSet",
"bitset2",
")",
"throws",
"CDKException",
"{",
"float",
"_bitset1_cardinality",
"=",
"bitset1",
".",
"cardinality",
"(",
")",
";",
"float",
"_bitset2_cardinality",
"=",
"bitset2",
... | Evaluates Tanimoto coefficient for two bit sets.
<p>
@param bitset1 A bitset (such as a fingerprint) for the first molecule
@param bitset2 A bitset (such as a fingerprint) for the second molecule
@return The Tanimoto coefficient
@throws org.openscience.cdk.exception.CDKException if bitsets are not of the same length | [
"Evaluates",
"Tanimoto",
"coefficient",
"for",
"two",
"bit",
"sets",
".",
"<p",
">"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/fingerprint/src/main/java/org/openscience/cdk/similarity/Tanimoto.java#L78-L88 |
openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/fxml/FXMLProcessor.java | FXMLProcessor.loadFxmlPaneAndControllerPair | public static <CONTROLLER extends AbstractFXController> Pair<Pane, CONTROLLER> loadFxmlPaneAndControllerPair(final String fxmlFileUri, final Class<CONTROLLER> controllerClass, final Class clazz) throws CouldNotPerformException {
"""
Method load the pane and controller of the given fxml file.
@param fxmlFileUri ... | java | public static <CONTROLLER extends AbstractFXController> Pair<Pane, CONTROLLER> loadFxmlPaneAndControllerPair(final String fxmlFileUri, final Class<CONTROLLER> controllerClass, final Class clazz) throws CouldNotPerformException {
return loadFxmlPaneAndControllerPair(fxmlFileUri, controllerClass, clazz, null);
... | [
"public",
"static",
"<",
"CONTROLLER",
"extends",
"AbstractFXController",
">",
"Pair",
"<",
"Pane",
",",
"CONTROLLER",
">",
"loadFxmlPaneAndControllerPair",
"(",
"final",
"String",
"fxmlFileUri",
",",
"final",
"Class",
"<",
"CONTROLLER",
">",
"controllerClass",
",",... | Method load the pane and controller of the given fxml file.
@param fxmlFileUri the uri pointing to the fxml file within the classpath.
@param controllerClass the class of the controller.
@param clazz the responsible class which is used for class path resolution.
@param <CONTROLLER> the type of control... | [
"Method",
"load",
"the",
"pane",
"and",
"controller",
"of",
"the",
"given",
"fxml",
"file",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/fxml/FXMLProcessor.java#L152-L154 |
infinispan/infinispan | server/hotrod/src/main/java/org/infinispan/server/hotrod/TransactionRequestProcessor.java | TransactionRequestProcessor.validateConfiguration | private void validateConfiguration(AdvancedCache<byte[], byte[]> cache) {
"""
Checks if the configuration (and the transaction manager) is able to handle client transactions.
"""
Configuration configuration = cache.getCacheConfiguration();
if (!configuration.transaction().transactionMode().isTransa... | java | private void validateConfiguration(AdvancedCache<byte[], byte[]> cache) {
Configuration configuration = cache.getCacheConfiguration();
if (!configuration.transaction().transactionMode().isTransactional()) {
throw log.expectedTransactionalCache(cache.getName());
}
if (configuration.locki... | [
"private",
"void",
"validateConfiguration",
"(",
"AdvancedCache",
"<",
"byte",
"[",
"]",
",",
"byte",
"[",
"]",
">",
"cache",
")",
"{",
"Configuration",
"configuration",
"=",
"cache",
".",
"getCacheConfiguration",
"(",
")",
";",
"if",
"(",
"!",
"configuratio... | Checks if the configuration (and the transaction manager) is able to handle client transactions. | [
"Checks",
"if",
"the",
"configuration",
"(",
"and",
"the",
"transaction",
"manager",
")",
"is",
"able",
"to",
"handle",
"client",
"transactions",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/TransactionRequestProcessor.java#L172-L188 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/EntityUtils.java | EntityUtils.isEquipped | public static boolean isEquipped(EntityPlayer player, ItemStack itemStack, EnumHand hand) {
"""
Checks if is the {@link Item} contained in the {@link ItemStack} is equipped for the player.
@param player the player
@param itemStack the item stack
@return true, if is equipped
"""
return isEquipped(player,... | java | public static boolean isEquipped(EntityPlayer player, ItemStack itemStack, EnumHand hand)
{
return isEquipped(player, itemStack != null ? itemStack.getItem() : null, hand);
} | [
"public",
"static",
"boolean",
"isEquipped",
"(",
"EntityPlayer",
"player",
",",
"ItemStack",
"itemStack",
",",
"EnumHand",
"hand",
")",
"{",
"return",
"isEquipped",
"(",
"player",
",",
"itemStack",
"!=",
"null",
"?",
"itemStack",
".",
"getItem",
"(",
")",
"... | Checks if is the {@link Item} contained in the {@link ItemStack} is equipped for the player.
@param player the player
@param itemStack the item stack
@return true, if is equipped | [
"Checks",
"if",
"is",
"the",
"{",
"@link",
"Item",
"}",
"contained",
"in",
"the",
"{",
"@link",
"ItemStack",
"}",
"is",
"equipped",
"for",
"the",
"player",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/EntityUtils.java#L213-L216 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/searchindex/CmsSearchResultView.java | CmsSearchResultView.getSearchPageLink | private String getSearchPageLink(String link, CmsSearch search) {
"""
Returns the resource uri to the search page with respect to the
optionally configured value <code>{@link #setSearchRessourceUrl(String)}</code>
with the request parameters of the given argument.<p>
This is a workaround for Tomcat bug 35775
... | java | private String getSearchPageLink(String link, CmsSearch search) {
if (m_searchRessourceUrl != null) {
// for the form to generate we need params.
String pageParams = "";
int paramIndex = link.indexOf('?');
if (paramIndex > 0) {
pageParams = link.s... | [
"private",
"String",
"getSearchPageLink",
"(",
"String",
"link",
",",
"CmsSearch",
"search",
")",
"{",
"if",
"(",
"m_searchRessourceUrl",
"!=",
"null",
")",
"{",
"// for the form to generate we need params.",
"String",
"pageParams",
"=",
"\"\"",
";",
"int",
"paramIn... | Returns the resource uri to the search page with respect to the
optionally configured value <code>{@link #setSearchRessourceUrl(String)}</code>
with the request parameters of the given argument.<p>
This is a workaround for Tomcat bug 35775
(http://issues.apache.org/bugzilla/show_bug.cgi?id=35775). After it has been
fi... | [
"Returns",
"the",
"resource",
"uri",
"to",
"the",
"search",
"page",
"with",
"respect",
"to",
"the",
"optionally",
"configured",
"value",
"<code",
">",
"{",
"@link",
"#setSearchRessourceUrl",
"(",
"String",
")",
"}",
"<",
"/",
"code",
">",
"with",
"the",
"r... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/searchindex/CmsSearchResultView.java#L378-L399 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/CredentialsInner.java | CredentialsInner.get | public CredentialInner get(String resourceGroupName, String automationAccountName, String credentialName) {
"""
Retrieve the credential identified by credential name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param credentialNam... | java | public CredentialInner get(String resourceGroupName, String automationAccountName, String credentialName) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, credentialName).toBlocking().single().body();
} | [
"public",
"CredentialInner",
"get",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"credentialName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
",",
"credentialName",... | Retrieve the credential identified by credential name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param credentialName The name of credential.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponse... | [
"Retrieve",
"the",
"credential",
"identified",
"by",
"credential",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/CredentialsInner.java#L195-L197 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/rest/JsonXmlRestService.java | JsonXmlRestService.getXml | @Override
public String getXml(XmlObject xml, Map<String, String> metaInfo) throws ServiceException {
"""
If the expected response back from the getJson() method is not null, then need to override getXml() in
concrete service class to convert to XML response. Steps would include calling super.getXml(), then ... | java | @Override
public String getXml(XmlObject xml, Map<String, String> metaInfo) throws ServiceException {
try {
Package pkg = getPkg(metaInfo);
JSONObject jsonObj = null;
if (xml != null)
jsonObj = ((Jsonable)getJaxbTranslator(pkg).realToObject(xml.xmlText()))... | [
"@",
"Override",
"public",
"String",
"getXml",
"(",
"XmlObject",
"xml",
",",
"Map",
"<",
"String",
",",
"String",
">",
"metaInfo",
")",
"throws",
"ServiceException",
"{",
"try",
"{",
"Package",
"pkg",
"=",
"getPkg",
"(",
"metaInfo",
")",
";",
"JSONObject",... | If the expected response back from the getJson() method is not null, then need to override getXml() in
concrete service class to convert to XML response. Steps would include calling super.getXml(), then creating
new JSON object specific to the expected Jsonable class for the response, and then calling
JaxbTranslator.r... | [
"If",
"the",
"expected",
"response",
"back",
"from",
"the",
"getJson",
"()",
"method",
"is",
"not",
"null",
"then",
"need",
"to",
"override",
"getXml",
"()",
"in",
"concrete",
"service",
"class",
"to",
"convert",
"to",
"XML",
"response",
".",
"Steps",
"wou... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/rest/JsonXmlRestService.java#L55-L68 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/MultipleIdsMessageAcknowledgingSourceBase.java | MultipleIdsMessageAcknowledgingSourceBase.acknowledgeIDs | @Override
protected final void acknowledgeIDs(long checkpointId, Set<UId> uniqueIds) {
"""
Acknowledges the session ids.
@param checkpointId The id of the current checkout to acknowledge ids for.
@param uniqueIds The checkpointed unique ids which are ignored here. They only serve as a
means of de-duplicating m... | java | @Override
protected final void acknowledgeIDs(long checkpointId, Set<UId> uniqueIds) {
LOG.debug("Acknowledging ids for checkpoint {}", checkpointId);
Iterator<Tuple2<Long, List<SessionId>>> iterator = sessionIdsPerSnapshot.iterator();
while (iterator.hasNext()) {
final Tuple2<Long, List<SessionId>> next = it... | [
"@",
"Override",
"protected",
"final",
"void",
"acknowledgeIDs",
"(",
"long",
"checkpointId",
",",
"Set",
"<",
"UId",
">",
"uniqueIds",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Acknowledging ids for checkpoint {}\"",
",",
"checkpointId",
")",
";",
"Iterator",
"<",... | Acknowledges the session ids.
@param checkpointId The id of the current checkout to acknowledge ids for.
@param uniqueIds The checkpointed unique ids which are ignored here. They only serve as a
means of de-duplicating messages when the acknowledgment after a checkpoint
fails. | [
"Acknowledges",
"the",
"session",
"ids",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/MultipleIdsMessageAcknowledgingSourceBase.java#L114-L127 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java | InvocationWriter.castToNonPrimitiveIfNecessary | public void castToNonPrimitiveIfNecessary(final ClassNode sourceType, final ClassNode targetType) {
"""
This converts sourceType to a non primitive by using Groovy casting.
sourceType might be a primitive
This might be done using SBA#castToType
"""
OperandStack os = controller.getOperandStack();
... | java | public void castToNonPrimitiveIfNecessary(final ClassNode sourceType, final ClassNode targetType) {
OperandStack os = controller.getOperandStack();
ClassNode boxedType = os.box();
if (WideningCategories.implementsInterfaceOrSubclassOf(boxedType, targetType)) return;
MethodVisitor mv = co... | [
"public",
"void",
"castToNonPrimitiveIfNecessary",
"(",
"final",
"ClassNode",
"sourceType",
",",
"final",
"ClassNode",
"targetType",
")",
"{",
"OperandStack",
"os",
"=",
"controller",
".",
"getOperandStack",
"(",
")",
";",
"ClassNode",
"boxedType",
"=",
"os",
".",... | This converts sourceType to a non primitive by using Groovy casting.
sourceType might be a primitive
This might be done using SBA#castToType | [
"This",
"converts",
"sourceType",
"to",
"a",
"non",
"primitive",
"by",
"using",
"Groovy",
"casting",
".",
"sourceType",
"might",
"be",
"a",
"primitive",
"This",
"might",
"be",
"done",
"using",
"SBA#castToType"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java#L932-L951 |
Inbot/inbot-utils | src/main/java/io/inbot/utils/Math.java | Math.normalize | public static double normalize(double i, double factor) {
"""
Useful for normalizing integer or double values to a number between 0 and 1.
This uses a simple logistic function: https://en.wikipedia.org/wiki/Logistic_function
with some small adaptations:
<pre>
(1 / (1 + java.lang.Math.exp(-1 * (factor * i))) - ... | java | public static double normalize(double i, double factor) {
Validate.isTrue(i >= 0, "should be positive value");
return (1 / (1 + java.lang.Math.exp(-1 * (factor * i))) - 0.5) * 2;
} | [
"public",
"static",
"double",
"normalize",
"(",
"double",
"i",
",",
"double",
"factor",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"i",
">=",
"0",
",",
"\"should be positive value\"",
")",
";",
"return",
"(",
"1",
"/",
"(",
"1",
"+",
"java",
".",
"lang"... | Useful for normalizing integer or double values to a number between 0 and 1.
This uses a simple logistic function: https://en.wikipedia.org/wiki/Logistic_function
with some small adaptations:
<pre>
(1 / (1 + java.lang.Math.exp(-1 * (factor * i))) - 0.5) * 2
</pre>
@param i
any positive long
@param factor
allows you to... | [
"Useful",
"for",
"normalizing",
"integer",
"or",
"double",
"values",
"to",
"a",
"number",
"between",
"0",
"and",
"1",
".",
"This",
"uses",
"a",
"simple",
"logistic",
"function",
":",
"https",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
... | train | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/Math.java#L75-L78 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java | LogFaxClientSpiInterceptor.preMethodInvocation | public final void preMethodInvocation(Method method,Object[] arguments) {
"""
This function is invoked by the fax client SPI proxy before invoking
the method in the fax client SPI itself.
@param method
The method invoked
@param arguments
The method arguments
"""
this.logEvent(FaxClientSpiPro... | java | public final void preMethodInvocation(Method method,Object[] arguments)
{
this.logEvent(FaxClientSpiProxyEventType.PRE_EVENT_TYPE,method,arguments,null,null);
} | [
"public",
"final",
"void",
"preMethodInvocation",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"arguments",
")",
"{",
"this",
".",
"logEvent",
"(",
"FaxClientSpiProxyEventType",
".",
"PRE_EVENT_TYPE",
",",
"method",
",",
"arguments",
",",
"null",
",",
"nu... | This function is invoked by the fax client SPI proxy before invoking
the method in the fax client SPI itself.
@param method
The method invoked
@param arguments
The method arguments | [
"This",
"function",
"is",
"invoked",
"by",
"the",
"fax",
"client",
"SPI",
"proxy",
"before",
"invoking",
"the",
"method",
"in",
"the",
"fax",
"client",
"SPI",
"itself",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java#L159-L162 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateCertificateOperation | public CertificateOperation updateCertificateOperation(String vaultBaseUrl, String certificateName, boolean cancellationRequested) {
"""
Updates a certificate operation.
Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission.
@param vaul... | java | public CertificateOperation updateCertificateOperation(String vaultBaseUrl, String certificateName, boolean cancellationRequested) {
return updateCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName, cancellationRequested).toBlocking().single().body();
} | [
"public",
"CertificateOperation",
"updateCertificateOperation",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"boolean",
"cancellationRequested",
")",
"{",
"return",
"updateCertificateOperationWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certifi... | Updates a certificate operation.
Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateName The name of the certificate.
@param cancellationRequ... | [
"Updates",
"a",
"certificate",
"operation",
".",
"Updates",
"a",
"certificate",
"creation",
"operation",
"that",
"is",
"already",
"in",
"progress",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"update",
"permission",
"."
] | 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#L7641-L7643 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/parameters/Parameters.java | Parameters.getStringList | public List<String> getStringList(final String param) {
"""
Gets a parameter whose value is a (possibly empty) comma-separated list of Strings.
"""
return get(param, new StringToStringList(","),
new AlwaysValid<List<String>>(),
"comma-separated list of strings");
} | java | public List<String> getStringList(final String param) {
return get(param, new StringToStringList(","),
new AlwaysValid<List<String>>(),
"comma-separated list of strings");
} | [
"public",
"List",
"<",
"String",
">",
"getStringList",
"(",
"final",
"String",
"param",
")",
"{",
"return",
"get",
"(",
"param",
",",
"new",
"StringToStringList",
"(",
"\",\"",
")",
",",
"new",
"AlwaysValid",
"<",
"List",
"<",
"String",
">",
">",
"(",
... | Gets a parameter whose value is a (possibly empty) comma-separated list of Strings. | [
"Gets",
"a",
"parameter",
"whose",
"value",
"is",
"a",
"(",
"possibly",
"empty",
")",
"comma",
"-",
"separated",
"list",
"of",
"Strings",
"."
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/parameters/Parameters.java#L884-L888 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/PagedWidget.java | PagedWidget.displayPage | public void displayPage (final int page, boolean forceRefresh) {
"""
Displays the specified page. Does nothing if we are already displaying
that page unless forceRefresh is true.
"""
if (_page == page && !forceRefresh) {
return; // NOOP!
}
// Display the now loading widget... | java | public void displayPage (final int page, boolean forceRefresh)
{
if (_page == page && !forceRefresh) {
return; // NOOP!
}
// Display the now loading widget, if necessary.
configureLoadingNavi(_controls, 0, _infoCol);
_page = Math.max(page, 0);
final boo... | [
"public",
"void",
"displayPage",
"(",
"final",
"int",
"page",
",",
"boolean",
"forceRefresh",
")",
"{",
"if",
"(",
"_page",
"==",
"page",
"&&",
"!",
"forceRefresh",
")",
"{",
"return",
";",
"// NOOP!",
"}",
"// Display the now loading widget, if necessary.",
"co... | Displays the specified page. Does nothing if we are already displaying
that page unless forceRefresh is true. | [
"Displays",
"the",
"specified",
"page",
".",
"Does",
"nothing",
"if",
"we",
"are",
"already",
"displaying",
"that",
"page",
"unless",
"forceRefresh",
"is",
"true",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/PagedWidget.java#L160-L196 |
m-m-m/util | text/src/main/java/net/sf/mmm/util/text/base/HyphenationState.java | HyphenationState.apply | private void apply(HyphenationPattern pattern, int pos) {
"""
This method applies the {@link HyphenationPattern pattern} matching at the given {@code offset}.
@param pattern is the matching {@link HyphenationPattern pattern}.
@param pos is the offset in the word to hyphenate.
"""
int internalOffset ... | java | private void apply(HyphenationPattern pattern, int pos) {
int internalOffset = pos - 2;
HyphenationPatternPosition[] positions = pattern.getHyphenationPositions();
for (HyphenationPatternPosition hyphenationPosition : positions) {
int i = hyphenationPosition.index + internalOffset;
if ((i... | [
"private",
"void",
"apply",
"(",
"HyphenationPattern",
"pattern",
",",
"int",
"pos",
")",
"{",
"int",
"internalOffset",
"=",
"pos",
"-",
"2",
";",
"HyphenationPatternPosition",
"[",
"]",
"positions",
"=",
"pattern",
".",
"getHyphenationPositions",
"(",
")",
";... | This method applies the {@link HyphenationPattern pattern} matching at the given {@code offset}.
@param pattern is the matching {@link HyphenationPattern pattern}.
@param pos is the offset in the word to hyphenate. | [
"This",
"method",
"applies",
"the",
"{",
"@link",
"HyphenationPattern",
"pattern",
"}",
"matching",
"at",
"the",
"given",
"{",
"@code",
"offset",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/text/src/main/java/net/sf/mmm/util/text/base/HyphenationState.java#L146-L156 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.getTempFile | public File getTempFile(@NotNull final String prefix, @NotNull final String extension) throws IOException {
"""
Generates a new temporary file name that is guaranteed to be unique.
@param prefix the prefix for the file name to generate
@param extension the extension of the generated file name
@return a tempor... | java | public File getTempFile(@NotNull final String prefix, @NotNull final String extension) throws IOException {
final File dir = getTempDirectory();
final String tempFileName = String.format("%s%s.%s", prefix, UUID.randomUUID().toString(), extension);
final File tempFile = new File(dir, tempFileName... | [
"public",
"File",
"getTempFile",
"(",
"@",
"NotNull",
"final",
"String",
"prefix",
",",
"@",
"NotNull",
"final",
"String",
"extension",
")",
"throws",
"IOException",
"{",
"final",
"File",
"dir",
"=",
"getTempDirectory",
"(",
")",
";",
"final",
"String",
"tem... | Generates a new temporary file name that is guaranteed to be unique.
@param prefix the prefix for the file name to generate
@param extension the extension of the generated file name
@return a temporary File
@throws java.io.IOException if any. | [
"Generates",
"a",
"new",
"temporary",
"file",
"name",
"that",
"is",
"guaranteed",
"to",
"be",
"unique",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L1174-L1182 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java | RedisJobStore.storeTrigger | @Override
public void storeTrigger(final OperableTrigger newTrigger, final boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException {
"""
Store the given <code>{@link org.quartz.Trigger}</code>.
@param newTrigger The <code>Trigger</code> to be stored.
@param replaceExistin... | java | @Override
public void storeTrigger(final OperableTrigger newTrigger, final boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException {
doWithLock(new LockCallbackWithoutResult() {
@Override
public Void doWithLock(JedisCommands jedis) throws JobPersistenceE... | [
"@",
"Override",
"public",
"void",
"storeTrigger",
"(",
"final",
"OperableTrigger",
"newTrigger",
",",
"final",
"boolean",
"replaceExisting",
")",
"throws",
"ObjectAlreadyExistsException",
",",
"JobPersistenceException",
"{",
"doWithLock",
"(",
"new",
"LockCallbackWithout... | Store the given <code>{@link org.quartz.Trigger}</code>.
@param newTrigger The <code>Trigger</code> to be stored.
@param replaceExisting If <code>true</code>, any <code>Trigger</code> existing in
the <code>JobStore</code> with the same name & group should
be over-written.
@throws org.quartz.ObjectAlreadyExistsExc... | [
"Store",
"the",
"given",
"<code",
">",
"{",
"@link",
"org",
".",
"quartz",
".",
"Trigger",
"}",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java#L393-L402 |
joniles/mpxj | src/main/java/net/sf/mpxj/planner/PlannerReader.java | PlannerReader.setWorkingDay | private void setWorkingDay(ProjectCalendar mpxjCalendar, Day mpxjDay, String plannerDay) {
"""
Set the working/non-working status of a weekday.
@param mpxjCalendar MPXJ calendar
@param mpxjDay day of the week
@param plannerDay planner day type
"""
DayType dayType = DayType.DEFAULT;
if (planne... | java | private void setWorkingDay(ProjectCalendar mpxjCalendar, Day mpxjDay, String plannerDay)
{
DayType dayType = DayType.DEFAULT;
if (plannerDay != null)
{
switch (getInt(plannerDay))
{
case 0:
{
dayType = DayType.WORKING;
break;
... | [
"private",
"void",
"setWorkingDay",
"(",
"ProjectCalendar",
"mpxjCalendar",
",",
"Day",
"mpxjDay",
",",
"String",
"plannerDay",
")",
"{",
"DayType",
"dayType",
"=",
"DayType",
".",
"DEFAULT",
";",
"if",
"(",
"plannerDay",
"!=",
"null",
")",
"{",
"switch",
"(... | Set the working/non-working status of a weekday.
@param mpxjCalendar MPXJ calendar
@param mpxjDay day of the week
@param plannerDay planner day type | [
"Set",
"the",
"working",
"/",
"non",
"-",
"working",
"status",
"of",
"a",
"weekday",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/planner/PlannerReader.java#L284-L307 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosApi.java | PhotosApi.setMeta | public Response setMeta(String photoId, String title, String description) throws JinxException {
"""
Set the meta information for a photo.
<br>
This method requires authentication with 'write' permission.
@param photoId Required. The id of the photo to set metadata for.
@param title Required. Title... | java | public Response setMeta(String photoId, String title, String description) throws JinxException {
JinxUtils.validateParams(photoId, title, description);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photos.setMeta");
params.put("photo_id", photoId);
params.put("title", ti... | [
"public",
"Response",
"setMeta",
"(",
"String",
"photoId",
",",
"String",
"title",
",",
"String",
"description",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photoId",
",",
"title",
",",
"description",
")",
";",
"Map",
"<",
... | Set the meta information for a photo.
<br>
This method requires authentication with 'write' permission.
@param photoId Required. The id of the photo to set metadata for.
@param title Required. Title for the photo.
@param description Required. Description for the photo.
@return response object with the result... | [
"Set",
"the",
"meta",
"information",
"for",
"a",
"photo",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosApi.java#L948-L956 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java | CpeMemoryIndex.parseQuery | public synchronized Query parseQuery(String searchString) throws ParseException, IndexException {
"""
Parses the given string into a Lucene Query.
@param searchString the search text
@return the Query object
@throws ParseException thrown if the search text cannot be parsed
@throws IndexException thrown if th... | java | public synchronized Query parseQuery(String searchString) throws ParseException, IndexException {
if (searchString == null || searchString.trim().isEmpty()) {
throw new ParseException("Query is null or empty");
}
LOGGER.debug(searchString);
final Query query = queryParser.pa... | [
"public",
"synchronized",
"Query",
"parseQuery",
"(",
"String",
"searchString",
")",
"throws",
"ParseException",
",",
"IndexException",
"{",
"if",
"(",
"searchString",
"==",
"null",
"||",
"searchString",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
... | Parses the given string into a Lucene Query.
@param searchString the search text
@return the Query object
@throws ParseException thrown if the search text cannot be parsed
@throws IndexException thrown if there is an error resetting the
analyzers | [
"Parses",
"the",
"given",
"string",
"into",
"a",
"Lucene",
"Query",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java#L280-L293 |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/convert/Converter.java | Converter.toDomain | public T toDomain(RiakObject obj, Location location) {
"""
Converts from a RiakObject to a domain object.
@param obj the RiakObject to be converted
@param location The location of this RiakObject in Riak
@return an instance of the domain type T
"""
T domainObject;
if (obj.isDeleted())
... | java | public T toDomain(RiakObject obj, Location location)
{
T domainObject;
if (obj.isDeleted())
{
domainObject = newDomainInstance();
}
else
{
domainObject = toDomain(obj.getValue(), obj.getContentType());
AnnotationUtil.populateIndexe... | [
"public",
"T",
"toDomain",
"(",
"RiakObject",
"obj",
",",
"Location",
"location",
")",
"{",
"T",
"domainObject",
";",
"if",
"(",
"obj",
".",
"isDeleted",
"(",
")",
")",
"{",
"domainObject",
"=",
"newDomainInstance",
"(",
")",
";",
"}",
"else",
"{",
"do... | Converts from a RiakObject to a domain object.
@param obj the RiakObject to be converted
@param location The location of this RiakObject in Riak
@return an instance of the domain type T | [
"Converts",
"from",
"a",
"RiakObject",
"to",
"a",
"domain",
"object",
"."
] | train | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/convert/Converter.java#L74-L101 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/parsing/CommonXml.java | CommonXml.writeInterfaces | protected void writeInterfaces(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
"""
Write the interfaces including the criteria elements.
@param writer the xml stream writer
@param modelNode the model
@throws XMLStreamException
"""
interfacesXml.write... | java | protected void writeInterfaces(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
interfacesXml.writeInterfaces(writer, modelNode);
} | [
"protected",
"void",
"writeInterfaces",
"(",
"final",
"XMLExtendedStreamWriter",
"writer",
",",
"final",
"ModelNode",
"modelNode",
")",
"throws",
"XMLStreamException",
"{",
"interfacesXml",
".",
"writeInterfaces",
"(",
"writer",
",",
"modelNode",
")",
";",
"}"
] | Write the interfaces including the criteria elements.
@param writer the xml stream writer
@param modelNode the model
@throws XMLStreamException | [
"Write",
"the",
"interfaces",
"including",
"the",
"criteria",
"elements",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/parsing/CommonXml.java#L245-L247 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java | CommerceNotificationTemplatePersistenceImpl.findByUUID_G | @Override
public CommerceNotificationTemplate findByUUID_G(String uuid, long groupId)
throws NoSuchNotificationTemplateException {
"""
Returns the commerce notification template where uuid = ? and groupId = ? or throws a {@link NoSuchNotificationTemplateException} if it could not be found.
@param uui... | java | @Override
public CommerceNotificationTemplate findByUUID_G(String uuid, long groupId)
throws NoSuchNotificationTemplateException {
CommerceNotificationTemplate commerceNotificationTemplate = fetchByUUID_G(uuid,
groupId);
if (commerceNotificationTemplate == null) {
StringBundler msg = new StringBundler(6)... | [
"@",
"Override",
"public",
"CommerceNotificationTemplate",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchNotificationTemplateException",
"{",
"CommerceNotificationTemplate",
"commerceNotificationTemplate",
"=",
"fetchByUUID_G",
"(",
"uui... | Returns the commerce notification template where uuid = ? and groupId = ? or throws a {@link NoSuchNotificationTemplateException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce notification template
@throws NoSuchNotificationTemplateException if a match... | [
"Returns",
"the",
"commerce",
"notification",
"template",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchNotificationTemplateException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java#L680-L707 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/CachedRemoteTable.java | CachedRemoteTable.remove | public void remove(Object data, int iOpenMode) throws DBException, RemoteException {
"""
Delete the current record.
@param - This is a dummy param, because this call conflicts with a call in EJBHome.
@exception Exception File exception.
"""
this.checkCurrentCacheIsPhysical(null);
m_tableRemot... | java | public void remove(Object data, int iOpenMode) throws DBException, RemoteException
{
this.checkCurrentCacheIsPhysical(null);
m_tableRemote.remove(data, iOpenMode);
if (m_objCurrentCacheRecord != null)
{
if (m_mapCache != null)
m_mapCache.set(((Integer)m_ob... | [
"public",
"void",
"remove",
"(",
"Object",
"data",
",",
"int",
"iOpenMode",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"this",
".",
"checkCurrentCacheIsPhysical",
"(",
"null",
")",
";",
"m_tableRemote",
".",
"remove",
"(",
"data",
",",
"iOpenMo... | Delete the current record.
@param - This is a dummy param, because this call conflicts with a call in EJBHome.
@exception Exception File exception. | [
"Delete",
"the",
"current",
"record",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/CachedRemoteTable.java#L265-L279 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/model/beans/Application.java | Application.bindWithApplication | public void bindWithApplication( String externalExportPrefix, String applicationName ) {
"""
Binds an external export prefix with an application name.
<p>
No error is thrown if the bound already existed.
</p>
@param externalExportPrefix an external export prefix (not null)
@param applicationName an applicat... | java | public void bindWithApplication( String externalExportPrefix, String applicationName ) {
Set<String> bounds = this.applicationBindings.get( externalExportPrefix );
if( bounds == null ) {
bounds = new LinkedHashSet<> ();
this.applicationBindings.put( externalExportPrefix, bounds );
}
bounds.add( applicat... | [
"public",
"void",
"bindWithApplication",
"(",
"String",
"externalExportPrefix",
",",
"String",
"applicationName",
")",
"{",
"Set",
"<",
"String",
">",
"bounds",
"=",
"this",
".",
"applicationBindings",
".",
"get",
"(",
"externalExportPrefix",
")",
";",
"if",
"("... | Binds an external export prefix with an application name.
<p>
No error is thrown if the bound already existed.
</p>
@param externalExportPrefix an external export prefix (not null)
@param applicationName an application name (not null) | [
"Binds",
"an",
"external",
"export",
"prefix",
"with",
"an",
"application",
"name",
".",
"<p",
">",
"No",
"error",
"is",
"thrown",
"if",
"the",
"bound",
"already",
"existed",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/beans/Application.java#L150-L159 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseRequestSmugglingProtection | private void parseRequestSmugglingProtection(Map<Object, Object> props) {
"""
Check whether or not the request smuggling protection has been changed.
@param props
"""
// PK53193 - allow this to be disabled
Object value = props.get(HttpConfigConstants.PROPNAME_ENABLE_SMUGGLING_PROTECTION);
... | java | private void parseRequestSmugglingProtection(Map<Object, Object> props) {
// PK53193 - allow this to be disabled
Object value = props.get(HttpConfigConstants.PROPNAME_ENABLE_SMUGGLING_PROTECTION);
if (null != value) {
this.bEnableSmugglingProtection = convertBoolean(value);
... | [
"private",
"void",
"parseRequestSmugglingProtection",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"// PK53193 - allow this to be disabled",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_ENABLE_SMUGGLING_PRO... | Check whether or not the request smuggling protection has been changed.
@param props | [
"Check",
"whether",
"or",
"not",
"the",
"request",
"smuggling",
"protection",
"has",
"been",
"changed",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L1169-L1178 |
twilio/twilio-java | src/main/java/com/twilio/rest/authy/v1/service/entity/FactorReader.java | FactorReader.nextPage | @Override
public Page<Factor> nextPage(final Page<Factor> page,
final TwilioRestClient client) {
"""
Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page
"""
Reques... | java | @Override
public Page<Factor> nextPage(final Page<Factor> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.AUTHY.toString(),
client.getRegion()
... | [
"@",
"Override",
"public",
"Page",
"<",
"Factor",
">",
"nextPage",
"(",
"final",
"Page",
"<",
"Factor",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
",",
"p... | Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page | [
"Retrieve",
"the",
"next",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/authy/v1/service/entity/FactorReader.java#L99-L110 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SpecializedOps_DDRM.java | SpecializedOps_DDRM.createReflector | public static DMatrixRMaj createReflector(DMatrixRMaj u , double gamma) {
"""
<p>
Creates a reflector from the provided vector and gamma.<br>
<br>
Q = I - γ u u<sup>T</sup><br>
</p>
<p>
In practice {@link VectorVectorMult_DDRM#householder(double, DMatrixD1, DMatrixD1, DMatrixD1)} multHouseholder}
s... | java | public static DMatrixRMaj createReflector(DMatrixRMaj u , double gamma) {
if( !MatrixFeatures_DDRM.isVector(u))
throw new IllegalArgumentException("u must be a vector");
DMatrixRMaj Q = CommonOps_DDRM.identity(u.getNumElements());
CommonOps_DDRM.multAddTransB(-gamma,u,u,Q);
... | [
"public",
"static",
"DMatrixRMaj",
"createReflector",
"(",
"DMatrixRMaj",
"u",
",",
"double",
"gamma",
")",
"{",
"if",
"(",
"!",
"MatrixFeatures_DDRM",
".",
"isVector",
"(",
"u",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"u must be a vector\"",
... | <p>
Creates a reflector from the provided vector and gamma.<br>
<br>
Q = I - γ u u<sup>T</sup><br>
</p>
<p>
In practice {@link VectorVectorMult_DDRM#householder(double, DMatrixD1, DMatrixD1, DMatrixD1)} multHouseholder}
should be used for performance reasons since there is no need to calculate Q explicitly.
</p... | [
"<p",
">",
"Creates",
"a",
"reflector",
"from",
"the",
"provided",
"vector",
"and",
"gamma",
".",
"<br",
">",
"<br",
">",
"Q",
"=",
"I",
"-",
"&gamma",
";",
"u",
"u<sup",
">",
"T<",
"/",
"sup",
">",
"<br",
">",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SpecializedOps_DDRM.java#L80-L88 |
jclawson/hazeltask | hazeltask-core/src/main/java/com/hazeltask/executor/HazelcastExecutorTopologyService.java | HazelcastExecutorTopologyService.addPendingTask | public boolean addPendingTask(HazeltaskTask<GROUP> task, boolean replaceIfExists) {
"""
Add to the write ahead log (hazelcast IMap) that tracks all the outstanding tasks
"""
if(!replaceIfExists)
return pendingTask.putIfAbsent(task.getId(), task) == null;
pendingTask.put(tas... | java | public boolean addPendingTask(HazeltaskTask<GROUP> task, boolean replaceIfExists) {
if(!replaceIfExists)
return pendingTask.putIfAbsent(task.getId(), task) == null;
pendingTask.put(task.getId(), task);
return true;
} | [
"public",
"boolean",
"addPendingTask",
"(",
"HazeltaskTask",
"<",
"GROUP",
">",
"task",
",",
"boolean",
"replaceIfExists",
")",
"{",
"if",
"(",
"!",
"replaceIfExists",
")",
"return",
"pendingTask",
".",
"putIfAbsent",
"(",
"task",
".",
"getId",
"(",
")",
","... | Add to the write ahead log (hazelcast IMap) that tracks all the outstanding tasks | [
"Add",
"to",
"the",
"write",
"ahead",
"log",
"(",
"hazelcast",
"IMap",
")",
"that",
"tracks",
"all",
"the",
"outstanding",
"tasks"
] | train | https://github.com/jclawson/hazeltask/blob/801162bc54c5f1d5744a28a2844b24289d9495d7/hazeltask-core/src/main/java/com/hazeltask/executor/HazelcastExecutorTopologyService.java#L140-L146 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/AnimatedDialog.java | AnimatedDialog.slideOpen | private void slideOpen() {
"""
</p> Opens the dialog with a translation animation to the content view </p>
"""
TranslateAnimation slideUp = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 1.0f, Animation.RELATIVE_TO_SELF, 0f);
sli... | java | private void slideOpen() {
TranslateAnimation slideUp = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 1.0f, Animation.RELATIVE_TO_SELF, 0f);
slideUp.setDuration(500);
slideUp.setInterpolator(new AccelerateInterpolator());
... | [
"private",
"void",
"slideOpen",
"(",
")",
"{",
"TranslateAnimation",
"slideUp",
"=",
"new",
"TranslateAnimation",
"(",
"Animation",
".",
"RELATIVE_TO_SELF",
",",
"0",
",",
"Animation",
".",
"RELATIVE_TO_SELF",
",",
"0",
",",
"Animation",
".",
"RELATIVE_TO_SELF",
... | </p> Opens the dialog with a translation animation to the content view </p> | [
"<",
"/",
"p",
">",
"Opens",
"the",
"dialog",
"with",
"a",
"translation",
"animation",
"to",
"the",
"content",
"view",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/AnimatedDialog.java#L111-L117 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/IncludeActionRule.java | IncludeActionRule.newInstance | public static IncludeActionRule newInstance(String id, String transletName, String method, Boolean hidden)
throws IllegalRuleException {
"""
Returns a new instance of IncludeActionRule.
@param id the action id
@param transletName the translet name
@param method the request method type
@param hidd... | java | public static IncludeActionRule newInstance(String id, String transletName, String method, Boolean hidden)
throws IllegalRuleException {
if (transletName == null) {
throw new IllegalRuleException("The 'include' element requires a 'translet' attribute");
}
MethodType meth... | [
"public",
"static",
"IncludeActionRule",
"newInstance",
"(",
"String",
"id",
",",
"String",
"transletName",
",",
"String",
"method",
",",
"Boolean",
"hidden",
")",
"throws",
"IllegalRuleException",
"{",
"if",
"(",
"transletName",
"==",
"null",
")",
"{",
"throw",... | Returns a new instance of IncludeActionRule.
@param id the action id
@param transletName the translet name
@param method the request method type
@param hidden whether to hide result of the action
@return the include action rule
@throws IllegalRuleException if an illegal rule is found | [
"Returns",
"a",
"new",
"instance",
"of",
"IncludeActionRule",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/IncludeActionRule.java#L223-L240 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/SecurityPINsInner.java | SecurityPINsInner.getAsync | public Observable<TokenInformationInner> getAsync(String vaultName, String resourceGroupName) {
"""
Get the security PIN.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@throws IllegalArgumentExcep... | java | public Observable<TokenInformationInner> getAsync(String vaultName, String resourceGroupName) {
return getWithServiceResponseAsync(vaultName, resourceGroupName).map(new Func1<ServiceResponse<TokenInformationInner>, TokenInformationInner>() {
@Override
public TokenInformationInner call(Se... | [
"public",
"Observable",
"<",
"TokenInformationInner",
">",
"getAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"vaultName",
",",
"resourceGroupName",
")",
".",
"map",
"(",
"new",
"Func1"... | Get the security PIN.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the TokenInformationInner object | [
"Get",
"the",
"security",
"PIN",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/SecurityPINsInner.java#L95-L102 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java | DatasetInfo.newBuilder | public static Builder newBuilder(String projectId, String datasetId) {
"""
Returns a builder for the DatasetInfo object given it's user-defined project and dataset ids.
"""
return newBuilder(DatasetId.of(projectId, datasetId));
} | java | public static Builder newBuilder(String projectId, String datasetId) {
return newBuilder(DatasetId.of(projectId, datasetId));
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"String",
"projectId",
",",
"String",
"datasetId",
")",
"{",
"return",
"newBuilder",
"(",
"DatasetId",
".",
"of",
"(",
"projectId",
",",
"datasetId",
")",
")",
";",
"}"
] | Returns a builder for the DatasetInfo object given it's user-defined project and dataset ids. | [
"Returns",
"a",
"builder",
"for",
"the",
"DatasetInfo",
"object",
"given",
"it",
"s",
"user",
"-",
"defined",
"project",
"and",
"dataset",
"ids",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java#L502-L504 |
aol/cyclops | cyclops/src/main/java/cyclops/control/Future.java | Future.fold | public <R> R fold(Function<? super T,? extends R> success, Function<? super Throwable,? extends R> failure) {
"""
Blocking analogue to visitAsync. Visit the state of this Future, block until ready.
<pre>
{@code
Future.ofResult(10)
.visit(i->i*2, e->-1);
20
Future.<Integer>ofError(new RuntimeException())
... | java | public <R> R fold(Function<? super T,? extends R> success, Function<? super Throwable,? extends R> failure){
try {
return success.apply(future.join());
}catch(Throwable t){
return failure.apply(t);
}
} | [
"public",
"<",
"R",
">",
"R",
"fold",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"R",
">",
"success",
",",
"Function",
"<",
"?",
"super",
"Throwable",
",",
"?",
"extends",
"R",
">",
"failure",
")",
"{",
"try",
"{",
"return",
"s... | Blocking analogue to visitAsync. Visit the state of this Future, block until ready.
<pre>
{@code
Future.ofResult(10)
.visit(i->i*2, e->-1);
20
Future.<Integer>ofError(new RuntimeException())
.visit(i->i*2, e->-1)
[-1]
}
</pre>
@param success Function to execute if the previous stage completes successfully
@param fai... | [
"Blocking",
"analogue",
"to",
"visitAsync",
".",
"Visit",
"the",
"state",
"of",
"this",
"Future",
"block",
"until",
"ready",
"."
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/control/Future.java#L788-L795 |
grpc/grpc-java | api/src/main/java/io/grpc/ConnectivityStateInfo.java | ConnectivityStateInfo.forNonError | public static ConnectivityStateInfo forNonError(ConnectivityState state) {
"""
Returns an instance for a state that is not {@code TRANSIENT_FAILURE}.
@throws IllegalArgumentException if {@code state} is {@code TRANSIENT_FAILURE}.
"""
Preconditions.checkArgument(
state != TRANSIENT_FAILURE,
... | java | public static ConnectivityStateInfo forNonError(ConnectivityState state) {
Preconditions.checkArgument(
state != TRANSIENT_FAILURE,
"state is TRANSIENT_ERROR. Use forError() instead");
return new ConnectivityStateInfo(state, Status.OK);
} | [
"public",
"static",
"ConnectivityStateInfo",
"forNonError",
"(",
"ConnectivityState",
"state",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"state",
"!=",
"TRANSIENT_FAILURE",
",",
"\"state is TRANSIENT_ERROR. Use forError() instead\"",
")",
";",
"return",
"new",
... | Returns an instance for a state that is not {@code TRANSIENT_FAILURE}.
@throws IllegalArgumentException if {@code state} is {@code TRANSIENT_FAILURE}. | [
"Returns",
"an",
"instance",
"for",
"a",
"state",
"that",
"is",
"not",
"{",
"@code",
"TRANSIENT_FAILURE",
"}",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/api/src/main/java/io/grpc/ConnectivityStateInfo.java#L39-L44 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/context/filter/ContextFilterFactory.java | ContextFilterFactory.setContextFilterClass | public static Config setContextFilterClass(Config config, Class<? extends ContextFilter> klazz) {
"""
Modify the configuration to set the {@link ContextFilter} class.
@param config Input {@link Config}.
@param klazz Class of desired {@link ContextFilter}.
@return Modified {@link Config}.
"""
return conf... | java | public static Config setContextFilterClass(Config config, Class<? extends ContextFilter> klazz) {
return config.withValue(CONTEXT_FILTER_CLASS, ConfigValueFactory.fromAnyRef(klazz.getCanonicalName()));
} | [
"public",
"static",
"Config",
"setContextFilterClass",
"(",
"Config",
"config",
",",
"Class",
"<",
"?",
"extends",
"ContextFilter",
">",
"klazz",
")",
"{",
"return",
"config",
".",
"withValue",
"(",
"CONTEXT_FILTER_CLASS",
",",
"ConfigValueFactory",
".",
"fromAnyR... | Modify the configuration to set the {@link ContextFilter} class.
@param config Input {@link Config}.
@param klazz Class of desired {@link ContextFilter}.
@return Modified {@link Config}. | [
"Modify",
"the",
"configuration",
"to",
"set",
"the",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/context/filter/ContextFilterFactory.java#L42-L44 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java | DirectoryServiceClient.createUser | public void createUser(User user, String password) {
"""
Create a User.
@param user
the User.
@param password
the user password.
"""
ProtocolHeader header = new ProtocolHeader();
header.setType(ProtocolType.CreateUser);
byte[] secret = null;
if(password != null && ! passwo... | java | public void createUser(User user, String password){
ProtocolHeader header = new ProtocolHeader();
header.setType(ProtocolType.CreateUser);
byte[] secret = null;
if(password != null && ! password.isEmpty()){
secret = ObfuscatUtil.base64Encode(password.getBytes());
}
... | [
"public",
"void",
"createUser",
"(",
"User",
"user",
",",
"String",
"password",
")",
"{",
"ProtocolHeader",
"header",
"=",
"new",
"ProtocolHeader",
"(",
")",
";",
"header",
".",
"setType",
"(",
"ProtocolType",
".",
"CreateUser",
")",
";",
"byte",
"[",
"]",... | Create a User.
@param user
the User.
@param password
the user password. | [
"Create",
"a",
"User",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L212-L222 |
classgraph/classgraph | src/main/java/io/github/classgraph/ResourceList.java | ResourceList.forEachInputStream | public void forEachInputStream(final InputStreamConsumer inputStreamConsumer,
final boolean ignoreIOExceptions) {
"""
Fetch an {@link InputStream} for each {@link Resource} in this {@link ResourceList}, pass the
{@link InputStream} to the given {@link InputStreamConsumer}, then close the {@link InputS... | java | public void forEachInputStream(final InputStreamConsumer inputStreamConsumer,
final boolean ignoreIOExceptions) {
for (final Resource resource : this) {
try {
inputStreamConsumer.accept(resource, resource.open());
} catch (final IOException e) {
... | [
"public",
"void",
"forEachInputStream",
"(",
"final",
"InputStreamConsumer",
"inputStreamConsumer",
",",
"final",
"boolean",
"ignoreIOExceptions",
")",
"{",
"for",
"(",
"final",
"Resource",
"resource",
":",
"this",
")",
"{",
"try",
"{",
"inputStreamConsumer",
".",
... | Fetch an {@link InputStream} for each {@link Resource} in this {@link ResourceList}, pass the
{@link InputStream} to the given {@link InputStreamConsumer}, then close the {@link InputStream} after the
{@link InputStreamConsumer} returns, by calling {@link Resource#close()}.
@param inputStreamConsumer
The {@link InputS... | [
"Fetch",
"an",
"{",
"@link",
"InputStream",
"}",
"for",
"each",
"{",
"@link",
"Resource",
"}",
"in",
"this",
"{",
"@link",
"ResourceList",
"}",
"pass",
"the",
"{",
"@link",
"InputStream",
"}",
"to",
"the",
"given",
"{",
"@link",
"InputStreamConsumer",
"}",... | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ResourceList.java#L388-L401 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/manager/ChallengeInfo.java | ChallengeInfo.applyParams | public void applyParams(AbstractHBCIJob task, AbstractHBCIJob hktan, HBCITwoStepMechanism hbciTwoStepMechanism) {
"""
Uebernimmt die Challenge-Parameter in den HKTAN-Geschaeftsvorfall.
@param task der Job, zu dem die Challenge-Parameter ermittelt werden sollen.
@param hktan der H... | java | public void applyParams(AbstractHBCIJob task, AbstractHBCIJob hktan, HBCITwoStepMechanism hbciTwoStepMechanism) {
String code = task.getHBCICode(); // Code des Geschaeftsvorfalls
// Job-Parameter holen
Job job = this.getData(code);
// Den Geschaeftsvorfall kennen wir nicht. Dann brauch... | [
"public",
"void",
"applyParams",
"(",
"AbstractHBCIJob",
"task",
",",
"AbstractHBCIJob",
"hktan",
",",
"HBCITwoStepMechanism",
"hbciTwoStepMechanism",
")",
"{",
"String",
"code",
"=",
"task",
".",
"getHBCICode",
"(",
")",
";",
"// Code des Geschaeftsvorfalls",
"// Job... | Uebernimmt die Challenge-Parameter in den HKTAN-Geschaeftsvorfall.
@param task der Job, zu dem die Challenge-Parameter ermittelt werden sollen.
@param hktan der HKTAN-Geschaeftsvorfall, in dem die Parameter gesetzt werden sollen.
@param hbciTwoStepMechanism die BPD-Informationen zum TAN-... | [
"Uebernimmt",
"die",
"Challenge",
"-",
"Parameter",
"in",
"den",
"HKTAN",
"-",
"Geschaeftsvorfall",
"."
] | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/ChallengeInfo.java#L131-L185 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/service/pager/QueryPagers.java | QueryPagers.countPaged | public static int countPaged(String keyspace,
String columnFamily,
ByteBuffer key,
SliceQueryFilter filter,
ConsistencyLevel consistencyLevel,
ClientState ... | java | public static int countPaged(String keyspace,
String columnFamily,
ByteBuffer key,
SliceQueryFilter filter,
ConsistencyLevel consistencyLevel,
ClientState ... | [
"public",
"static",
"int",
"countPaged",
"(",
"String",
"keyspace",
",",
"String",
"columnFamily",
",",
"ByteBuffer",
"key",
",",
"SliceQueryFilter",
"filter",
",",
"ConsistencyLevel",
"consistencyLevel",
",",
"ClientState",
"cState",
",",
"final",
"int",
"pageSize"... | Convenience method that count (live) cells/rows for a given slice of a row, but page underneath. | [
"Convenience",
"method",
"that",
"count",
"(",
"live",
")",
"cells",
"/",
"rows",
"for",
"a",
"given",
"slice",
"of",
"a",
"row",
"but",
"page",
"underneath",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/service/pager/QueryPagers.java#L175-L195 |
shrinkwrap/resolver | maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/SettingsManager.java | SettingsManager.configureSettingsFromFile | public void configureSettingsFromFile(File globalSettings, File userSettings)
throws InvalidConfigurationFileException {
"""
Crates an instance of {@link Settings} and configures it from the given file.
@param globalSettings path to global settings file
@param userSettings path to user settings file
... | java | public void configureSettingsFromFile(File globalSettings, File userSettings)
throws InvalidConfigurationFileException {
SettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
if (globalSettings != null) {
request.setGlobalSettingsFile(globalSettings);
}
... | [
"public",
"void",
"configureSettingsFromFile",
"(",
"File",
"globalSettings",
",",
"File",
"userSettings",
")",
"throws",
"InvalidConfigurationFileException",
"{",
"SettingsBuildingRequest",
"request",
"=",
"new",
"DefaultSettingsBuildingRequest",
"(",
")",
";",
"if",
"("... | Crates an instance of {@link Settings} and configures it from the given file.
@param globalSettings path to global settings file
@param userSettings path to user settings file | [
"Crates",
"an",
"instance",
"of",
"{",
"@link",
"Settings",
"}",
"and",
"configures",
"it",
"from",
"the",
"given",
"file",
"."
] | train | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/SettingsManager.java#L49-L66 |
dropwizard/dropwizard | dropwizard-auth/src/main/java/io/dropwizard/auth/basic/BasicCredentialAuthFilter.java | BasicCredentialAuthFilter.getCredentials | @Nullable
private BasicCredentials getCredentials(String header) {
"""
Parses a Base64-encoded value of the `Authorization` header
in the form of `Basic dXNlcm5hbWU6cGFzc3dvcmQ=`.
@param header the value of the `Authorization` header
@return a username and a password as {@link BasicCredentials}
"""
... | java | @Nullable
private BasicCredentials getCredentials(String header) {
if (header == null) {
return null;
}
final int space = header.indexOf(' ');
if (space <= 0) {
return null;
}
final String method = header.substring(0, space);
if (!pre... | [
"@",
"Nullable",
"private",
"BasicCredentials",
"getCredentials",
"(",
"String",
"header",
")",
"{",
"if",
"(",
"header",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"int",
"space",
"=",
"header",
".",
"indexOf",
"(",
"'",
"'",
")",
";... | Parses a Base64-encoded value of the `Authorization` header
in the form of `Basic dXNlcm5hbWU6cGFzc3dvcmQ=`.
@param header the value of the `Authorization` header
@return a username and a password as {@link BasicCredentials} | [
"Parses",
"a",
"Base64",
"-",
"encoded",
"value",
"of",
"the",
"Authorization",
"header",
"in",
"the",
"form",
"of",
"Basic",
"dXNlcm5hbWU6cGFzc3dvcmQ",
"=",
"."
] | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-auth/src/main/java/io/dropwizard/auth/basic/BasicCredentialAuthFilter.java#L40-L73 |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java | DbsUtilities.createPolygonFromEnvelope | public static Polygon createPolygonFromEnvelope( Envelope env ) {
"""
Create a polygon using an envelope.
@param env the envelope to use.
@return the created geomerty.
"""
double minX = env.getMinX();
double minY = env.getMinY();
double maxY = env.getMaxY();
double maxX = en... | java | public static Polygon createPolygonFromEnvelope( Envelope env ) {
double minX = env.getMinX();
double minY = env.getMinY();
double maxY = env.getMaxY();
double maxX = env.getMaxX();
Coordinate[] c = new Coordinate[]{new Coordinate(minX, minY), new Coordinate(minX, maxY), new Coor... | [
"public",
"static",
"Polygon",
"createPolygonFromEnvelope",
"(",
"Envelope",
"env",
")",
"{",
"double",
"minX",
"=",
"env",
".",
"getMinX",
"(",
")",
";",
"double",
"minY",
"=",
"env",
".",
"getMinY",
"(",
")",
";",
"double",
"maxY",
"=",
"env",
".",
"... | Create a polygon using an envelope.
@param env the envelope to use.
@return the created geomerty. | [
"Create",
"a",
"polygon",
"using",
"an",
"envelope",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java#L117-L125 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/CertificatesImpl.java | CertificatesImpl.listNext | public PagedList<Certificate> listNext(final String nextPageLink) {
"""
Lists all of the certificates that have been added to the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | java | public PagedList<Certificate> listNext(final String nextPageLink) {
ServiceResponseWithHeaders<Page<Certificate>, CertificateListHeaders> response = listNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<Certificate>(response.body()) {
@Override
public ... | [
"public",
"PagedList",
"<",
"Certificate",
">",
"listNext",
"(",
"final",
"String",
"nextPageLink",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"Certificate",
">",
",",
"CertificateListHeaders",
">",
"response",
"=",
"listNextSinglePageAsync",
"(",
"ne... | Lists all of the certificates that have been added to the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws BatchErrorException thrown if the request is rejected by server
@throws Ru... | [
"Lists",
"all",
"of",
"the",
"certificates",
"that",
"have",
"been",
"added",
"to",
"the",
"specified",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/CertificatesImpl.java#L1201-L1209 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/EncryptionProtectorsInner.java | EncryptionProtectorsInner.getAsync | public Observable<EncryptionProtectorInner> getAsync(String resourceGroupName, String serverName) {
"""
Gets a server encryption protector.
@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 ser... | java | public Observable<EncryptionProtectorInner> getAsync(String resourceGroupName, String serverName) {
return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<EncryptionProtectorInner>, EncryptionProtectorInner>() {
@Override
public EncryptionProtecto... | [
"public",
"Observable",
"<",
"EncryptionProtectorInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
".",
"map",
"(",
"new",
"F... | Gets a server encryption protector.
@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
@retur... | [
"Gets",
"a",
"server",
"encryption",
"protector",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/EncryptionProtectorsInner.java#L243-L250 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/swift/Swift.java | Swift.getMultiTagValue | public static String getMultiTagValue(String st, String tag) {
"""
/* Gets a value from the "multi-tag". Codes look like ?20 - a value goes until
the next value-code or until end of data
"""
String ret = null;
int pos = st.indexOf("?" + tag);
if (pos != -1) {
// first poss... | java | public static String getMultiTagValue(String st, String tag) {
String ret = null;
int pos = st.indexOf("?" + tag);
if (pos != -1) {
// first possible endpos
int searchpos = pos + 3;
int endpos = -1;
while (true) {
// search for st... | [
"public",
"static",
"String",
"getMultiTagValue",
"(",
"String",
"st",
",",
"String",
"tag",
")",
"{",
"String",
"ret",
"=",
"null",
";",
"int",
"pos",
"=",
"st",
".",
"indexOf",
"(",
"\"?\"",
"+",
"tag",
")",
";",
"if",
"(",
"pos",
"!=",
"-",
"1",... | /* Gets a value from the "multi-tag". Codes look like ?20 - a value goes until
the next value-code or until end of data | [
"/",
"*",
"Gets",
"a",
"value",
"from",
"the",
"multi",
"-",
"tag",
".",
"Codes",
"look",
"like",
"?20",
"-",
"a",
"value",
"goes",
"until",
"the",
"next",
"value",
"-",
"code",
"or",
"until",
"end",
"of",
"data"
] | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/swift/Swift.java#L95-L137 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java | FastaAFPChainConverter.buildAlignment | private static AFPChain buildAlignment(Atom[] ca1, Atom[] ca2, ResidueNumber[] residues1, ResidueNumber[] residues2)
throws StructureException {
"""
Builds an {@link AFPChain} from already-matched arrays of atoms and residues.
@param ca1
An array of atoms in the first structure
@param ca2
An array of atom... | java | private static AFPChain buildAlignment(Atom[] ca1, Atom[] ca2, ResidueNumber[] residues1, ResidueNumber[] residues2)
throws StructureException {
// remove any gap
// this includes the ones introduced by the nullifying above
List<ResidueNumber> alignedResiduesList1 = new ArrayList<ResidueNumber>();
List<Resi... | [
"private",
"static",
"AFPChain",
"buildAlignment",
"(",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
",",
"ResidueNumber",
"[",
"]",
"residues1",
",",
"ResidueNumber",
"[",
"]",
"residues2",
")",
"throws",
"StructureException",
"{",
"// remove any ga... | Builds an {@link AFPChain} from already-matched arrays of atoms and residues.
@param ca1
An array of atoms in the first structure
@param ca2
An array of atoms in the second structure
@param residues1
An array of {@link ResidueNumber ResidueNumbers} in the first structure that are aligned. Only null ResidueNumbers are ... | [
"Builds",
"an",
"{",
"@link",
"AFPChain",
"}",
"from",
"already",
"-",
"matched",
"arrays",
"of",
"atoms",
"and",
"residues",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java#L347-L375 |
BlueBrain/bluima | modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/FileEventStream.java | FileEventStream.main | public static void main(String[] args) throws IOException {
"""
Trains and writes a model based on the events in the specified event file.
the name of the model created is based on the event file name.
@param args eventfile [iterations cuttoff]
@throws IOException when the eventfile can not be read or the model... | java | public static void main(String[] args) throws IOException {
if (args.length == 0) {
System.err.println("Usage: FileEventStream eventfile [iterations cutoff]");
System.exit(1);
}
int ai=0;
String eventFile = args[ai++];
EventStream es = new FileEventStream(eventFile);
int iterations =... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"Usage: FileEventStream eventfile [iterations cutoff]\""... | Trains and writes a model based on the events in the specified event file.
the name of the model created is based on the event file name.
@param args eventfile [iterations cuttoff]
@throws IOException when the eventfile can not be read or the model file can not be written. | [
"Trains",
"and",
"writes",
"a",
"model",
"based",
"on",
"the",
"events",
"in",
"the",
"specified",
"event",
"file",
".",
"the",
"name",
"of",
"the",
"model",
"created",
"is",
"based",
"on",
"the",
"event",
"file",
"name",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/FileEventStream.java#L101-L117 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.isSubclassOf | public static boolean isSubclassOf(ClassNode classNode, String parentClassName) {
"""
Returns true if the given class name is a parent class of the given class
@param classNode The class node
@param parentClassName the parent class name
@return True if it is a subclass
"""
ClassNode currentSuper =... | java | public static boolean isSubclassOf(ClassNode classNode, String parentClassName) {
ClassNode currentSuper = classNode.getSuperClass();
while (currentSuper != null && !currentSuper.getName().equals(OBJECT_CLASS)) {
if (currentSuper.getName().equals(parentClassName)) return true;
cu... | [
"public",
"static",
"boolean",
"isSubclassOf",
"(",
"ClassNode",
"classNode",
",",
"String",
"parentClassName",
")",
"{",
"ClassNode",
"currentSuper",
"=",
"classNode",
".",
"getSuperClass",
"(",
")",
";",
"while",
"(",
"currentSuper",
"!=",
"null",
"&&",
"!",
... | Returns true if the given class name is a parent class of the given class
@param classNode The class node
@param parentClassName the parent class name
@return True if it is a subclass | [
"Returns",
"true",
"if",
"the",
"given",
"class",
"name",
"is",
"a",
"parent",
"class",
"of",
"the",
"given",
"class"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1148-L1155 |
pravega/pravega | common/src/main/java/io/pravega/common/util/BitConverter.java | BitConverter.writeUnsignedLong | public static int writeUnsignedLong(byte[] target, int offset, long value) {
"""
Writes the given 64-bit Unsigned Long to the given byte array at the given offset. This value can then be
deserialized using {@link #readUnsignedLong}. This method is not interoperable with {@link #readLong}.
The advantage of seri... | java | public static int writeUnsignedLong(byte[] target, int offset, long value) {
return writeLong(target, offset, value ^ Long.MIN_VALUE);
} | [
"public",
"static",
"int",
"writeUnsignedLong",
"(",
"byte",
"[",
"]",
"target",
",",
"int",
"offset",
",",
"long",
"value",
")",
"{",
"return",
"writeLong",
"(",
"target",
",",
"offset",
",",
"value",
"^",
"Long",
".",
"MIN_VALUE",
")",
";",
"}"
] | Writes the given 64-bit Unsigned Long to the given byte array at the given offset. This value can then be
deserialized using {@link #readUnsignedLong}. This method is not interoperable with {@link #readLong}.
The advantage of serializing as Unsigned Long (vs. a normal Signed Long) is that the serialization will have t... | [
"Writes",
"the",
"given",
"64",
"-",
"bit",
"Unsigned",
"Long",
"to",
"the",
"given",
"byte",
"array",
"at",
"the",
"given",
"offset",
".",
"This",
"value",
"can",
"then",
"be",
"deserialized",
"using",
"{",
"@link",
"#readUnsignedLong",
"}",
".",
"This",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L316-L318 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/MorphShape.java | MorphShape.equalShapes | private boolean equalShapes(Shape a, Shape b) {
"""
Check if the shape's points are all equal
@param a The first shape to compare
@param b The second shape to compare
@return True if the shapes are equal
"""
a.checkPoints();
b.checkPoints();
for (int i=0;i<a.points.length;i++) {
if (a.poi... | java | private boolean equalShapes(Shape a, Shape b) {
a.checkPoints();
b.checkPoints();
for (int i=0;i<a.points.length;i++) {
if (a.points[i] != b.points[i]) {
return false;
}
}
return true;
} | [
"private",
"boolean",
"equalShapes",
"(",
"Shape",
"a",
",",
"Shape",
"b",
")",
"{",
"a",
".",
"checkPoints",
"(",
")",
";",
"b",
".",
"checkPoints",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
"points",
".",
"leng... | Check if the shape's points are all equal
@param a The first shape to compare
@param b The second shape to compare
@return True if the shapes are equal | [
"Check",
"if",
"the",
"shape",
"s",
"points",
"are",
"all",
"equal"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/MorphShape.java#L64-L75 |
rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServer.java | JolokiaServer.createHttpServer | private HttpServer createHttpServer(JolokiaServerConfig pConfig) throws IOException {
"""
Create the HttpServer to use. Can be overridden if a custom or already existing HttpServer should be
used
@return HttpServer to use
@throws IOException if something fails during the initialisation
"""
int por... | java | private HttpServer createHttpServer(JolokiaServerConfig pConfig) throws IOException {
int port = pConfig.getPort();
InetAddress address = pConfig.getAddress();
InetSocketAddress socketAddress = new InetSocketAddress(address,port);
HttpServer server = pConfig.useHttps() ?
... | [
"private",
"HttpServer",
"createHttpServer",
"(",
"JolokiaServerConfig",
"pConfig",
")",
"throws",
"IOException",
"{",
"int",
"port",
"=",
"pConfig",
".",
"getPort",
"(",
")",
";",
"InetAddress",
"address",
"=",
"pConfig",
".",
"getAddress",
"(",
")",
";",
"In... | Create the HttpServer to use. Can be overridden if a custom or already existing HttpServer should be
used
@return HttpServer to use
@throws IOException if something fails during the initialisation | [
"Create",
"the",
"HttpServer",
"to",
"use",
".",
"Can",
"be",
"overridden",
"if",
"a",
"custom",
"or",
"already",
"existing",
"HttpServer",
"should",
"be",
"used"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServer.java#L231-L255 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/rule/InequalityRule.java | InequalityRule.getRule | public static Rule getRule(final String inequalitySymbol,
final String field,
final String value) {
"""
Create new instance from top two elements on stack.
@param inequalitySymbol inequality symbol.
@param field field.
@param value comparison value.
@re... | java | public static Rule getRule(final String inequalitySymbol,
final String field,
final String value) {
if (field.equalsIgnoreCase(LoggingEventFieldResolver.LEVEL_FIELD)) {
//push the value back on the stack and
// allow the level-specific rule pop... | [
"public",
"static",
"Rule",
"getRule",
"(",
"final",
"String",
"inequalitySymbol",
",",
"final",
"String",
"field",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"field",
".",
"equalsIgnoreCase",
"(",
"LoggingEventFieldResolver",
".",
"LEVEL_FIELD",
")",... | Create new instance from top two elements on stack.
@param inequalitySymbol inequality symbol.
@param field field.
@param value comparison value.
@return rule. | [
"Create",
"new",
"instance",
"from",
"top",
"two",
"elements",
"on",
"stack",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/InequalityRule.java#L109-L122 |
minio/minio-java | api/src/main/java/io/minio/ServerSideEncryption.java | ServerSideEncryption.copyWithCustomerKey | public static ServerSideEncryption copyWithCustomerKey(SecretKey key)
throws InvalidKeyException, NoSuchAlgorithmException {
"""
Create a new server-side-encryption object for encryption with customer
provided keys (a.k.a. SSE-C).
@param key The secret AES-256 key.
@return An instance of ServerSideEncryp... | java | public static ServerSideEncryption copyWithCustomerKey(SecretKey key)
throws InvalidKeyException, NoSuchAlgorithmException {
if (!isCustomerKeyValid(key)) {
throw new InvalidKeyException("The secret key is not a 256 bit AES key");
}
return new ServerSideEncryptionCopyWithCustomerKey(key, MessageD... | [
"public",
"static",
"ServerSideEncryption",
"copyWithCustomerKey",
"(",
"SecretKey",
"key",
")",
"throws",
"InvalidKeyException",
",",
"NoSuchAlgorithmException",
"{",
"if",
"(",
"!",
"isCustomerKeyValid",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"InvalidKeyExceptio... | Create a new server-side-encryption object for encryption with customer
provided keys (a.k.a. SSE-C).
@param key The secret AES-256 key.
@return An instance of ServerSideEncryption implementing SSE-C.
@throws InvalidKeyException if the provided secret key is not a 256 bit AES key.
@throws NoSuchAlgorithmException if t... | [
"Create",
"a",
"new",
"server",
"-",
"side",
"-",
"encryption",
"object",
"for",
"encryption",
"with",
"customer",
"provided",
"keys",
"(",
"a",
".",
"k",
".",
"a",
".",
"SSE",
"-",
"C",
")",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/ServerSideEncryption.java#L117-L123 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java | MappingUtils.invokeStaticFunction | public static Object invokeStaticFunction(Class clazz, String functionName, Class[] parameters, Object[] values) throws MjdbcException {
"""
Invokes class function using Reflection
@param clazz Class which function would be invoked
@param functionName function name
@param parameters function paramete... | java | public static Object invokeStaticFunction(Class clazz, String functionName, Class[] parameters, Object[] values) throws MjdbcException {
Object result = null;
try {
Method method = clazz.getMethod(functionName, parameters);
method.setAccessible(true);
result = ... | [
"public",
"static",
"Object",
"invokeStaticFunction",
"(",
"Class",
"clazz",
",",
"String",
"functionName",
",",
"Class",
"[",
"]",
"parameters",
",",
"Object",
"[",
"]",
"values",
")",
"throws",
"MjdbcException",
"{",
"Object",
"result",
"=",
"null",
";",
"... | Invokes class function using Reflection
@param clazz Class which function would be invoked
@param functionName function name
@param parameters function parameters (array of Class)
@param values function values (array of Object)
@return function return
@throws org.midao.jdbc.core.exception.MjdbcException... | [
"Invokes",
"class",
"function",
"using",
"Reflection"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java#L285-L297 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/iot/provisioning/IoTProvisioningManager.java | IoTProvisioningManager.isFriend | public boolean isFriend(Jid provisioningServer, BareJid friendInQuestion) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
As the given provisioning server is the given JID is a friend.
@param provisioningServer the provisioning server to ask.
@param friendInQue... | java | public boolean isFriend(Jid provisioningServer, BareJid friendInQuestion) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
LruCache<BareJid, Void> cache = negativeFriendshipRequestCache.lookup(provisioningServer);
if (cache != null && cache.containsKey(friend... | [
"public",
"boolean",
"isFriend",
"(",
"Jid",
"provisioningServer",
",",
"BareJid",
"friendInQuestion",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"LruCache",
"<",
"BareJid",
",",
"Void... | As the given provisioning server is the given JID is a friend.
@param provisioningServer the provisioning server to ask.
@param friendInQuestion the JID to ask about.
@return <code>true</code> if the JID is a friend, <code>false</code> otherwise.
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnec... | [
"As",
"the",
"given",
"provisioning",
"server",
"is",
"the",
"given",
"JID",
"is",
"a",
"friend",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/iot/provisioning/IoTProvisioningManager.java#L334-L355 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.hosting_privateDatabase_new_GET | public ArrayList<String> hosting_privateDatabase_new_GET(OvhDatacenterEnum datacenter, net.minidev.ovh.api.hosting.privatedatabase.OvhOfferEnum offer, OvhAvailableRamSizeEnum ram, OvhOrderableVersionEnum version) throws IOException {
"""
Get allowed durations for 'new' option
REST: GET /order/hosting/privateDat... | java | public ArrayList<String> hosting_privateDatabase_new_GET(OvhDatacenterEnum datacenter, net.minidev.ovh.api.hosting.privatedatabase.OvhOfferEnum offer, OvhAvailableRamSizeEnum ram, OvhOrderableVersionEnum version) throws IOException {
String qPath = "/order/hosting/privateDatabase/new";
StringBuilder sb = path(qPath... | [
"public",
"ArrayList",
"<",
"String",
">",
"hosting_privateDatabase_new_GET",
"(",
"OvhDatacenterEnum",
"datacenter",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"hosting",
".",
"privatedatabase",
".",
"OvhOfferEnum",
"offer",
",",
"OvhAvailableRamSizeE... | Get allowed durations for 'new' option
REST: GET /order/hosting/privateDatabase/new
@param version [required] Private database available versions
@param datacenter [required] Datacenter to deploy this new private database
@param ram [required] Private database ram size
@param offer [required] Type of offer to deploy t... | [
"Get",
"allowed",
"durations",
"for",
"new",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5094-L5103 |
javagl/ND | nd-distance/src/main/java/de/javagl/nd/distance/tuples/d/DoubleTupleDistanceFunctions.java | DoubleTupleDistanceFunctions.byDistanceComparator | public static Comparator<DoubleTuple> byDistanceComparator(
DoubleTuple reference,
final ToDoubleBiFunction<? super DoubleTuple, ? super DoubleTuple>
distanceFunction) {
"""
Returns a new comparator that compares {@link DoubleTuple} instances
by their distance to the given referenc... | java | public static Comparator<DoubleTuple> byDistanceComparator(
DoubleTuple reference,
final ToDoubleBiFunction<? super DoubleTuple, ? super DoubleTuple>
distanceFunction)
{
final DoubleTuple fReference = DoubleTuples.copy(reference);
return new Comparator<DoubleTuple>... | [
"public",
"static",
"Comparator",
"<",
"DoubleTuple",
">",
"byDistanceComparator",
"(",
"DoubleTuple",
"reference",
",",
"final",
"ToDoubleBiFunction",
"<",
"?",
"super",
"DoubleTuple",
",",
"?",
"super",
"DoubleTuple",
">",
"distanceFunction",
")",
"{",
"final",
... | Returns a new comparator that compares {@link DoubleTuple} instances
by their distance to the given reference, according to the given
distance function.
A copy of the given reference point will be stored, so that changes
in the given point will not affect the returned comparator.
@param reference The reference point
@... | [
"Returns",
"a",
"new",
"comparator",
"that",
"compares",
"{",
"@link",
"DoubleTuple",
"}",
"instances",
"by",
"their",
"distance",
"to",
"the",
"given",
"reference",
"according",
"to",
"the",
"given",
"distance",
"function",
".",
"A",
"copy",
"of",
"the",
"g... | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-distance/src/main/java/de/javagl/nd/distance/tuples/d/DoubleTupleDistanceFunctions.java#L55-L71 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateKeyAsync | public Observable<KeyBundle> updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion) {
"""
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 exi... | java | public Observable<KeyBundle> updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion) {
return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).map(new Func1<ServiceResponse<KeyBundle>, KeyBundle>() {
@Override
public KeyBundle call(ServiceResponse<KeyBu... | [
"public",
"Observable",
"<",
"KeyBundle",
">",
"updateKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
")",
"{",
"return",
"updateKeyWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"keyName",
",",
"keyVersion",
")... | 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#L1205-L1212 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_GET | public ArrayList<Long> order_GET(Date date_from, Date date_to) throws IOException {
"""
List of all the orders the logged account has
REST: GET /me/order
@param date_to [required] Filter the value of date property (<=)
@param date_from [required] Filter the value of date property (>=)
"""
String qPath =... | java | public ArrayList<Long> order_GET(Date date_from, Date date_to) throws IOException {
String qPath = "/me/order";
StringBuilder sb = path(qPath);
query(sb, "date.from", date_from);
query(sb, "date.to", date_to);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t2);
} | [
"public",
"ArrayList",
"<",
"Long",
">",
"order_GET",
"(",
"Date",
"date_from",
",",
"Date",
"date_to",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"query",
"(... | List of all the orders the logged account has
REST: GET /me/order
@param date_to [required] Filter the value of date property (<=)
@param date_from [required] Filter the value of date property (>=) | [
"List",
"of",
"all",
"the",
"orders",
"the",
"logged",
"account",
"has"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2112-L2119 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/ClientOptions.java | ClientOptions.getOrElse | public <T> T getOrElse(ClientOption<T> option, T defaultValue) {
"""
Returns the value of the specified {@link ClientOption}.
@return the value of the {@link ClientOption}, or
{@code defaultValue} if the specified {@link ClientOption} is not set.
"""
return getOrElse0(option, defaultValue);
} | java | public <T> T getOrElse(ClientOption<T> option, T defaultValue) {
return getOrElse0(option, defaultValue);
} | [
"public",
"<",
"T",
">",
"T",
"getOrElse",
"(",
"ClientOption",
"<",
"T",
">",
"option",
",",
"T",
"defaultValue",
")",
"{",
"return",
"getOrElse0",
"(",
"option",
",",
"defaultValue",
")",
";",
"}"
] | Returns the value of the specified {@link ClientOption}.
@return the value of the {@link ClientOption}, or
{@code defaultValue} if the specified {@link ClientOption} is not set. | [
"Returns",
"the",
"value",
"of",
"the",
"specified",
"{",
"@link",
"ClientOption",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/ClientOptions.java#L205-L207 |
milaboratory/milib | src/main/java/com/milaboratory/core/motif/BitapPattern.java | BitapPattern.substitutionOnlyMatcherFirst | public BitapMatcher substitutionOnlyMatcherFirst(int substitutions, final Sequence sequence) {
"""
Returns a BitapMatcher preforming a fuzzy search in a whole {@code sequence}. Search allows no more than {@code
substitutions} number of substitutions. Matcher will return positions of first matched letter in the mo... | java | public BitapMatcher substitutionOnlyMatcherFirst(int substitutions, final Sequence sequence) {
return substitutionOnlyMatcherFirst(substitutions, sequence, 0, sequence.size());
} | [
"public",
"BitapMatcher",
"substitutionOnlyMatcherFirst",
"(",
"int",
"substitutions",
",",
"final",
"Sequence",
"sequence",
")",
"{",
"return",
"substitutionOnlyMatcherFirst",
"(",
"substitutions",
",",
"sequence",
",",
"0",
",",
"sequence",
".",
"size",
"(",
")",
... | Returns a BitapMatcher preforming a fuzzy search in a whole {@code sequence}. Search allows no more than {@code
substitutions} number of substitutions. Matcher will return positions of first matched letter in the motif in
ascending order.
@param substitutions maximal number of allowed substitutions
@param sequence ... | [
"Returns",
"a",
"BitapMatcher",
"preforming",
"a",
"fuzzy",
"search",
"in",
"a",
"whole",
"{",
"@code",
"sequence",
"}",
".",
"Search",
"allows",
"no",
"more",
"than",
"{",
"@code",
"substitutions",
"}",
"number",
"of",
"substitutions",
".",
"Matcher",
"will... | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/motif/BitapPattern.java#L100-L102 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.packEntries | public static void packEntries(File[] filesToPack, File destZipFile) {
"""
Compresses the given files into a ZIP file.
<p>
The ZIP file must not be a directory and its parent directory must exist.
@param filesToPack
files that needs to be zipped.
@param destZipFile
ZIP file that will be created or overwrit... | java | public static void packEntries(File[] filesToPack, File destZipFile) {
packEntries(filesToPack, destZipFile, IdentityNameMapper.INSTANCE);
} | [
"public",
"static",
"void",
"packEntries",
"(",
"File",
"[",
"]",
"filesToPack",
",",
"File",
"destZipFile",
")",
"{",
"packEntries",
"(",
"filesToPack",
",",
"destZipFile",
",",
"IdentityNameMapper",
".",
"INSTANCE",
")",
";",
"}"
] | Compresses the given files into a ZIP file.
<p>
The ZIP file must not be a directory and its parent directory must exist.
@param filesToPack
files that needs to be zipped.
@param destZipFile
ZIP file that will be created or overwritten. | [
"Compresses",
"the",
"given",
"files",
"into",
"a",
"ZIP",
"file",
".",
"<p",
">",
"The",
"ZIP",
"file",
"must",
"not",
"be",
"a",
"directory",
"and",
"its",
"parent",
"directory",
"must",
"exist",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1493-L1495 |
apache/incubator-druid | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java | ApproximateHistogram.fromBytesDense | public static ApproximateHistogram fromBytesDense(ByteBuffer buf) {
"""
Constructs an ApproximateHistogram object from the given dense byte-buffer representation
@param buf ByteBuffer to construct an ApproximateHistogram from
@return ApproximateHistogram constructed from the given ByteBuffer
"""
int ... | java | public static ApproximateHistogram fromBytesDense(ByteBuffer buf)
{
int size = buf.getInt();
int binCount = buf.getInt();
float[] positions = new float[size];
long[] bins = new long[size];
buf.asFloatBuffer().get(positions);
buf.position(buf.position() + Float.BYTES * positions.length);
... | [
"public",
"static",
"ApproximateHistogram",
"fromBytesDense",
"(",
"ByteBuffer",
"buf",
")",
"{",
"int",
"size",
"=",
"buf",
".",
"getInt",
"(",
")",
";",
"int",
"binCount",
"=",
"buf",
".",
"getInt",
"(",
")",
";",
"float",
"[",
"]",
"positions",
"=",
... | Constructs an ApproximateHistogram object from the given dense byte-buffer representation
@param buf ByteBuffer to construct an ApproximateHistogram from
@return ApproximateHistogram constructed from the given ByteBuffer | [
"Constructs",
"an",
"ApproximateHistogram",
"object",
"from",
"the",
"given",
"dense",
"byte",
"-",
"buffer",
"representation"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java#L1310-L1327 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java | TopicsInner.listSharedAccessKeysAsync | public Observable<TopicSharedAccessKeysInner> listSharedAccessKeysAsync(String resourceGroupName, String topicName) {
"""
List keys for a topic.
List the two keys used to publish to a topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the to... | java | public Observable<TopicSharedAccessKeysInner> listSharedAccessKeysAsync(String resourceGroupName, String topicName) {
return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1<ServiceResponse<TopicSharedAccessKeysInner>, TopicSharedAccessKeysInner>() {
@Override... | [
"public",
"Observable",
"<",
"TopicSharedAccessKeysInner",
">",
"listSharedAccessKeysAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"topicName",
")",
"{",
"return",
"listSharedAccessKeysWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"topicName",
")",
... | List keys for a topic.
List the two keys used to publish to a topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the topic
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the TopicSharedAccessKeysIn... | [
"List",
"keys",
"for",
"a",
"topic",
".",
"List",
"the",
"two",
"keys",
"used",
"to",
"publish",
"to",
"a",
"topic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java#L1103-L1110 |
BoltsFramework/Bolts-Android | bolts-tasks/src/main/java/bolts/Task.java | Task.onSuccessTask | public <TContinuationResult> Task<TContinuationResult> onSuccessTask(
final Continuation<TResult, Task<TContinuationResult>> continuation) {
"""
Runs a continuation when a task completes successfully, forwarding along
{@link java.lang.Exception}s or cancellation.
"""
return onSuccessTask(continuatio... | java | public <TContinuationResult> Task<TContinuationResult> onSuccessTask(
final Continuation<TResult, Task<TContinuationResult>> continuation) {
return onSuccessTask(continuation, IMMEDIATE_EXECUTOR);
} | [
"public",
"<",
"TContinuationResult",
">",
"Task",
"<",
"TContinuationResult",
">",
"onSuccessTask",
"(",
"final",
"Continuation",
"<",
"TResult",
",",
"Task",
"<",
"TContinuationResult",
">",
">",
"continuation",
")",
"{",
"return",
"onSuccessTask",
"(",
"continu... | Runs a continuation when a task completes successfully, forwarding along
{@link java.lang.Exception}s or cancellation. | [
"Runs",
"a",
"continuation",
"when",
"a",
"task",
"completes",
"successfully",
"forwarding",
"along",
"{"
] | train | https://github.com/BoltsFramework/Bolts-Android/blob/54e9cb8bdd4950aa4d418dcbc0ea65414762aef5/bolts-tasks/src/main/java/bolts/Task.java#L825-L828 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/source/SourceService.java | SourceService.getLinesAsRawText | public Optional<Iterable<String>> getLinesAsRawText(DbSession dbSession, String fileUuid, int from, int toInclusive) {
"""
Returns a range of lines as raw text.
@see #getLines(DbSession, String, int, int)
"""
return getLines(dbSession, fileUuid, from, toInclusive, DbFileSources.Line::getSource);
} | java | public Optional<Iterable<String>> getLinesAsRawText(DbSession dbSession, String fileUuid, int from, int toInclusive) {
return getLines(dbSession, fileUuid, from, toInclusive, DbFileSources.Line::getSource);
} | [
"public",
"Optional",
"<",
"Iterable",
"<",
"String",
">",
">",
"getLinesAsRawText",
"(",
"DbSession",
"dbSession",
",",
"String",
"fileUuid",
",",
"int",
"from",
",",
"int",
"toInclusive",
")",
"{",
"return",
"getLines",
"(",
"dbSession",
",",
"fileUuid",
"... | Returns a range of lines as raw text.
@see #getLines(DbSession, String, int, int) | [
"Returns",
"a",
"range",
"of",
"lines",
"as",
"raw",
"text",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/source/SourceService.java#L57-L59 |
Netflix/netflix-graph | src/main/java/com/netflix/nfgraph/NFGraph.java | NFGraph.getConnectionSet | public OrdinalSet getConnectionSet(String connectionModel, String nodeType, int ordinal, String propertyName) {
"""
Retrieve an {@link OrdinalSet} over all connected ordinals in a given connection model, given the type and ordinal of the originating node, and the property by which this node is connected.
@retur... | java | public OrdinalSet getConnectionSet(String connectionModel, String nodeType, int ordinal, String propertyName) {
int connectionModelIndex = modelHolder.getModelIndex(connectionModel);
return getConnectionSet(connectionModelIndex, nodeType, ordinal, propertyName);
} | [
"public",
"OrdinalSet",
"getConnectionSet",
"(",
"String",
"connectionModel",
",",
"String",
"nodeType",
",",
"int",
"ordinal",
",",
"String",
"propertyName",
")",
"{",
"int",
"connectionModelIndex",
"=",
"modelHolder",
".",
"getModelIndex",
"(",
"connectionModel",
... | Retrieve an {@link OrdinalSet} over all connected ordinals in a given connection model, given the type and ordinal of the originating node, and the property by which this node is connected.
@return an {@link OrdinalSet} over all connected ordinals | [
"Retrieve",
"an",
"{",
"@link",
"OrdinalSet",
"}",
"over",
"all",
"connected",
"ordinals",
"in",
"a",
"given",
"connection",
"model",
"given",
"the",
"type",
"and",
"ordinal",
"of",
"the",
"originating",
"node",
"and",
"the",
"property",
"by",
"which",
"this... | train | https://github.com/Netflix/netflix-graph/blob/ee129252a08a9f51dd296d6fca2f0b28b7be284e/src/main/java/com/netflix/nfgraph/NFGraph.java#L153-L156 |
avast/syringe | src/main/java/com/avast/syringe/aop/AroundInterceptor.java | AroundInterceptor.handleException | public Throwable handleException(T proxy, Method method, Object[] args, Throwable cause, Map<String, Object> context) {
"""
Handle exception caused by:
<ul>
<li>Target method code itself.</li>
<li>Invocation of the original method. These exceptions won't be wrapped into {@link java.lang.reflect.InvocationTarget... | java | public Throwable handleException(T proxy, Method method, Object[] args, Throwable cause, Map<String, Object> context) {
//Just return the cause
return cause;
} | [
"public",
"Throwable",
"handleException",
"(",
"T",
"proxy",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
",",
"Throwable",
"cause",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"context",
")",
"{",
"//Just return the cause",
"return",
"cause"... | Handle exception caused by:
<ul>
<li>Target method code itself.</li>
<li>Invocation of the original method. These exceptions won't be wrapped into {@link java.lang.reflect.InvocationTargetException}.</li>
</ul>
<p>
The implementation is not allowed to throw a checked exception. Exceptional behavior should be expressed ... | [
"Handle",
"exception",
"caused",
"by",
":",
"<ul",
">",
"<li",
">",
"Target",
"method",
"code",
"itself",
".",
"<",
"/",
"li",
">",
"<li",
">",
"Invocation",
"of",
"the",
"original",
"method",
".",
"These",
"exceptions",
"won",
"t",
"be",
"wrapped",
"i... | train | https://github.com/avast/syringe/blob/762da5e50776f2bc028e0cf17eac9bd09b5b6aab/src/main/java/com/avast/syringe/aop/AroundInterceptor.java#L93-L96 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/RangeStatisticImpl.java | RangeStatisticImpl.setWaterMark | public void setWaterMark(long curTime, long val) {
"""
/*
Non-Synchronizable: counter is "replaced" with the input value. Caller should synchronize.
"""
lastSampleTime = curTime;
if (!initWaterMark) {
lowWaterMark = highWaterMark = val;
initWaterMark = true;
} ... | java | public void setWaterMark(long curTime, long val) {
lastSampleTime = curTime;
if (!initWaterMark) {
lowWaterMark = highWaterMark = val;
initWaterMark = true;
} else {
if (val < lowWaterMark)
lowWaterMark = val;
if (val > highWaterM... | [
"public",
"void",
"setWaterMark",
"(",
"long",
"curTime",
",",
"long",
"val",
")",
"{",
"lastSampleTime",
"=",
"curTime",
";",
"if",
"(",
"!",
"initWaterMark",
")",
"{",
"lowWaterMark",
"=",
"highWaterMark",
"=",
"val",
";",
"initWaterMark",
"=",
"true",
"... | /*
Non-Synchronizable: counter is "replaced" with the input value. Caller should synchronize. | [
"/",
"*",
"Non",
"-",
"Synchronizable",
":",
"counter",
"is",
"replaced",
"with",
"the",
"input",
"value",
".",
"Caller",
"should",
"synchronize",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/RangeStatisticImpl.java#L117-L138 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.findNode | public static DefaultMutableTreeNode findNode(
TreeModel treeModel, Object userObject) {
"""
Returns the first node with the given user object in the tree with
the given model. This assumes that the user object is stored
in a DefaultMutableTreeNode.
Returns <code>null</code> if no matching node is foun... | java | public static DefaultMutableTreeNode findNode(
TreeModel treeModel, Object userObject)
{
return findNode(treeModel, treeModel.getRoot(), userObject);
} | [
"public",
"static",
"DefaultMutableTreeNode",
"findNode",
"(",
"TreeModel",
"treeModel",
",",
"Object",
"userObject",
")",
"{",
"return",
"findNode",
"(",
"treeModel",
",",
"treeModel",
".",
"getRoot",
"(",
")",
",",
"userObject",
")",
";",
"}"
] | Returns the first node with the given user object in the tree with
the given model. This assumes that the user object is stored
in a DefaultMutableTreeNode.
Returns <code>null</code> if no matching node is found.
@param treeModel The tree model
@param userObject The user object
@return The node with the given user obj... | [
"Returns",
"the",
"first",
"node",
"with",
"the",
"given",
"user",
"object",
"in",
"the",
"tree",
"with",
"the",
"given",
"model",
".",
"This",
"assumes",
"that",
"the",
"user",
"object",
"is",
"stored",
"in",
"a",
"DefaultMutableTreeNode",
".",
"Returns",
... | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L214-L218 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java | EnvironmentSettingsInner.listAsync | public Observable<Page<EnvironmentSettingInner>> listAsync(final String resourceGroupName, final String labAccountName, final String labName) {
"""
List environment setting in a given lab.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labNam... | java | public Observable<Page<EnvironmentSettingInner>> listAsync(final String resourceGroupName, final String labAccountName, final String labName) {
return listWithServiceResponseAsync(resourceGroupName, labAccountName, labName)
.map(new Func1<ServiceResponse<Page<EnvironmentSettingInner>>, Page<Environm... | [
"public",
"Observable",
"<",
"Page",
"<",
"EnvironmentSettingInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"labAccountName",
",",
"final",
"String",
"labName",
")",
"{",
"return",
"listWithServiceResponseAsync",
... | List environment setting in a given lab.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<EnvironmentSettin... | [
"List",
"environment",
"setting",
"in",
"a",
"given",
"lab",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java#L178-L186 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.orthoSymmetricLH | public Matrix4f orthoSymmetricLH(float width, float height, float zNear, float zFar, boolean zZeroToOne) {
"""
Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using the given NDC z range to this matrix.
<p>
This method is equivalent to calling {@link #orthoLH(float, ... | java | public Matrix4f orthoSymmetricLH(float width, float height, float zNear, float zFar, boolean zZeroToOne) {
return orthoSymmetricLH(width, height, zNear, zFar, zZeroToOne, thisOrNew());
} | [
"public",
"Matrix4f",
"orthoSymmetricLH",
"(",
"float",
"width",
",",
"float",
"height",
",",
"float",
"zNear",
",",
"float",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"return",
"orthoSymmetricLH",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar"... | Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using the given NDC z range to this matrix.
<p>
This method is equivalent to calling {@link #orthoLH(float, float, float, float, float, float, boolean) orthoLH()} with
<code>left=-width/2</code>, <code>right=+width/2</code>, <c... | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
"to",
"this",
"matrix",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L7605-L7607 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.setOrthoSymmetric | public Matrix4x3d setOrthoSymmetric(double width, double height, double zNear, double zFar, boolean zZeroToOne) {
"""
Set this matrix to be a symmetric orthographic projection transformation for a right-handed coordinate system
using the given NDC z range.
<p>
This method is equivalent to calling {@link #setOrt... | java | public Matrix4x3d setOrthoSymmetric(double width, double height, double zNear, double zFar, boolean zZeroToOne) {
m00 = 2.0 / width;
m01 = 0.0;
m02 = 0.0;
m10 = 0.0;
m11 = 2.0 / height;
m12 = 0.0;
m20 = 0.0;
m21 = 0.0;
m22 = (zZeroToOne ? 1.0 : 2.0... | [
"public",
"Matrix4x3d",
"setOrthoSymmetric",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"m00",
"=",
"2.0",
"/",
"width",
";",
"m01",
"=",
"0.0",
";",
"m02",
"=",... | Set this matrix to be a symmetric orthographic projection transformation for a right-handed coordinate system
using the given NDC z range.
<p>
This method is equivalent to calling {@link #setOrtho(double, double, double, double, double, double, boolean) setOrtho()} with
<code>left=-width/2</code>, <code>right=+width/2<... | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
".",
"<p",
">",
"This",
"method",
"is",
"equivale... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L7391-L7406 |
joestelmach/natty | src/main/java/com/joestelmach/natty/Parser.java | Parser.addGroup | private void addGroup(List<Token> group, List<List<Token>> groups) {
"""
Cleans up the given group and adds it to the list of groups if still valid
@param group
@param groups
"""
if(group.isEmpty()) return;
// remove trailing tokens that should be ignored
while(!group.isEmpty() && IGNORED_TRAIL... | java | private void addGroup(List<Token> group, List<List<Token>> groups) {
if(group.isEmpty()) return;
// remove trailing tokens that should be ignored
while(!group.isEmpty() && IGNORED_TRAILING_TOKENS.contains(
group.get(group.size() - 1).getType())) {
group.remove(group.size() - 1);
}
/... | [
"private",
"void",
"addGroup",
"(",
"List",
"<",
"Token",
">",
"group",
",",
"List",
"<",
"List",
"<",
"Token",
">",
">",
"groups",
")",
"{",
"if",
"(",
"group",
".",
"isEmpty",
"(",
")",
")",
"return",
";",
"// remove trailing tokens that should be ignore... | Cleans up the given group and adds it to the list of groups if still valid
@param group
@param groups | [
"Cleans",
"up",
"the",
"given",
"group",
"and",
"adds",
"it",
"to",
"the",
"list",
"of",
"groups",
"if",
"still",
"valid"
] | train | https://github.com/joestelmach/natty/blob/74389feb4c9372e51cd51eb0800a0177fec3e5a0/src/main/java/com/joestelmach/natty/Parser.java#L333-L347 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/Validate.java | Validate.isFalse | public static void isFalse(final boolean expression, final String message, final long value) {
"""
<p>Validate that the argument condition is {@code false}; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean
expression, such as valid... | java | public static void isFalse(final boolean expression, final String message, final long value) {
INSTANCE.isFalse(expression, message, value);
} | [
"public",
"static",
"void",
"isFalse",
"(",
"final",
"boolean",
"expression",
",",
"final",
"String",
"message",
",",
"final",
"long",
"value",
")",
"{",
"INSTANCE",
".",
"isFalse",
"(",
"expression",
",",
"message",
",",
"value",
")",
";",
"}"
] | <p>Validate that the argument condition is {@code false}; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean
expression, such as validating a primitive number or using your own custom validation expression.</p>
<pre>
Validate.isFalse(age &... | [
"<p",
">",
"Validate",
"that",
"the",
"argument",
"condition",
"is",
"{",
"@code",
"false",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"This",
"method",
"is",
"useful",
"when",
"validating",
"according",
... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/Validate.java#L561-L563 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java | P2sVpnGatewaysInner.createOrUpdateAsync | public Observable<P2SVpnGatewayInner> createOrUpdateAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) {
"""
Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway.
@param resourceGroupName The resource group name of the P2SVpnGat... | java | public Observable<P2SVpnGatewayInner> createOrUpdateAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).map(new Func1<ServiceResponse<P2SVpnGatewayInner>, P2SVpnGa... | [
"public",
"Observable",
"<",
"P2SVpnGatewayInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"gatewayName",
",",
"P2SVpnGatewayInner",
"p2SVpnGatewayParameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceG... | Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway.
@param resourceGroupName The resource group name of the P2SVpnGateway.
@param gatewayName The name of the gateway.
@param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway.
@throws I... | [
"Creates",
"a",
"virtual",
"wan",
"p2s",
"vpn",
"gateway",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"gateway",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java#L250-L257 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/UnsavedRevision.java | UnsavedRevision.setAttachment | @InterfaceAudience.Public
public void setAttachment(String name, String contentType, URL contentStreamURL) {
"""
Sets the attachment with the given name. The Attachment data will be written
to the Database when the Revision is saved.
@param name The name of the Attachment to set.
@param conten... | java | @InterfaceAudience.Public
public void setAttachment(String name, String contentType, URL contentStreamURL) {
try {
InputStream inputStream = contentStreamURL.openStream();
setAttachment(name, contentType, inputStream);
} catch (IOException e) {
Log.e(Database.TAG,... | [
"@",
"InterfaceAudience",
".",
"Public",
"public",
"void",
"setAttachment",
"(",
"String",
"name",
",",
"String",
"contentType",
",",
"URL",
"contentStreamURL",
")",
"{",
"try",
"{",
"InputStream",
"inputStream",
"=",
"contentStreamURL",
".",
"openStream",
"(",
... | Sets the attachment with the given name. The Attachment data will be written
to the Database when the Revision is saved.
@param name The name of the Attachment to set.
@param contentType The content-type of the Attachment.
@param contentStreamURL The URL that contains the Attachment content. | [
"Sets",
"the",
"attachment",
"with",
"the",
"given",
"name",
".",
"The",
"Attachment",
"data",
"will",
"be",
"written",
"to",
"the",
"Database",
"when",
"the",
"Revision",
"is",
"saved",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/UnsavedRevision.java#L183-L192 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObjectRef.java | JsiiObjectRef.fromObjId | public static JsiiObjectRef fromObjId(final String objId) {
"""
Creates an object ref from an object ID.
@param objId Object ID.
@return The new object ref.
"""
ObjectNode node = JsonNodeFactory.instance.objectNode();
node.put(TOKEN_REF, objId);
return new JsiiObjectRef(objId, node);
... | java | public static JsiiObjectRef fromObjId(final String objId) {
ObjectNode node = JsonNodeFactory.instance.objectNode();
node.put(TOKEN_REF, objId);
return new JsiiObjectRef(objId, node);
} | [
"public",
"static",
"JsiiObjectRef",
"fromObjId",
"(",
"final",
"String",
"objId",
")",
"{",
"ObjectNode",
"node",
"=",
"JsonNodeFactory",
".",
"instance",
".",
"objectNode",
"(",
")",
";",
"node",
".",
"put",
"(",
"TOKEN_REF",
",",
"objId",
")",
";",
"ret... | Creates an object ref from an object ID.
@param objId Object ID.
@return The new object ref. | [
"Creates",
"an",
"object",
"ref",
"from",
"an",
"object",
"ID",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObjectRef.java#L63-L67 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.translateConstantDeclaration | private void translateConstantDeclaration(WyilFile.Decl.StaticVariable decl) {
"""
Translate a constant declaration into WyAL. At the moment, this does nothing
because constant declarations are not supported in WyAL files.
@param declaration
The type declaration being translated.
@param wyalFile
The WyAL fi... | java | private void translateConstantDeclaration(WyilFile.Decl.StaticVariable decl) {
if (decl.hasInitialiser()) {
// The environments are needed to prevent clashes between variable
// versions across verification conditions, and also to type variables
// used in verification conditions.
GlobalEnvironment global... | [
"private",
"void",
"translateConstantDeclaration",
"(",
"WyilFile",
".",
"Decl",
".",
"StaticVariable",
"decl",
")",
"{",
"if",
"(",
"decl",
".",
"hasInitialiser",
"(",
")",
")",
"{",
"// The environments are needed to prevent clashes between variable",
"// versions acros... | Translate a constant declaration into WyAL. At the moment, this does nothing
because constant declarations are not supported in WyAL files.
@param declaration
The type declaration being translated.
@param wyalFile
The WyAL file being constructed | [
"Translate",
"a",
"constant",
"declaration",
"into",
"WyAL",
".",
"At",
"the",
"moment",
"this",
"does",
"nothing",
"because",
"constant",
"declarations",
"are",
"not",
"supported",
"in",
"WyAL",
"files",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L164-L180 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/util/PdfUtilities.java | PdfUtilities.mergePdf | public static void mergePdf(File[] inputPdfFiles, File outputPdfFile) {
"""
Merges PDF files.
@param inputPdfFiles array of input files
@param outputPdfFile output file
"""
if (PDFBOX.equals(System.getProperty(PDF_LIBRARY))) {
PdfBoxUtilities.mergePdf(inputPdfFiles, outputPdfFile);
... | java | public static void mergePdf(File[] inputPdfFiles, File outputPdfFile) {
if (PDFBOX.equals(System.getProperty(PDF_LIBRARY))) {
PdfBoxUtilities.mergePdf(inputPdfFiles, outputPdfFile);
} else {
try {
PdfGsUtilities.mergePdf(inputPdfFiles, outputPdfFile);
... | [
"public",
"static",
"void",
"mergePdf",
"(",
"File",
"[",
"]",
"inputPdfFiles",
",",
"File",
"outputPdfFile",
")",
"{",
"if",
"(",
"PDFBOX",
".",
"equals",
"(",
"System",
".",
"getProperty",
"(",
"PDF_LIBRARY",
")",
")",
")",
"{",
"PdfBoxUtilities",
".",
... | Merges PDF files.
@param inputPdfFiles array of input files
@param outputPdfFile output file | [
"Merges",
"PDF",
"files",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/PdfUtilities.java#L151-L162 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.getMaxMatchFragment | public static String getMaxMatchFragment(String seq1, String seq2) throws NotationException {
"""
method to get the largest matched fragment between two sequences, replace
T with U before Match
@param seq1
single letter, all upper case nucleotide sequence
@param seq2
single letter, all upper case nucleotide... | java | public static String getMaxMatchFragment(String seq1, String seq2) throws NotationException {
return getMaxMatchFragment(seq1, seq2, MINUMUM_MATCH_FRAGMENT_LENGTH);
} | [
"public",
"static",
"String",
"getMaxMatchFragment",
"(",
"String",
"seq1",
",",
"String",
"seq2",
")",
"throws",
"NotationException",
"{",
"return",
"getMaxMatchFragment",
"(",
"seq1",
",",
"seq2",
",",
"MINUMUM_MATCH_FRAGMENT_LENGTH",
")",
";",
"}"
] | method to get the largest matched fragment between two sequences, replace
T with U before Match
@param seq1
single letter, all upper case nucleotide sequence
@param seq2
single letter, all upper case nucleotide sequence
@return maximal match fragment of seq1 and seq2
@throws NotationException
if the notation is not va... | [
"method",
"to",
"get",
"the",
"largest",
"matched",
"fragment",
"between",
"two",
"sequences",
"replace",
"T",
"with",
"U",
"before",
"Match"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L171-L173 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/EpicsApi.java | EpicsApi.deleteEpic | public void deleteEpic(Object groupIdOrPath, Integer epicIid) throws GitLabApiException {
"""
Deletes an epic.
<pre><code>GitLab Endpoint: DELETE /groups/:id/epics/:epic_iid</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
@param epicIid the... | java | public void deleteEpic(Object groupIdOrPath, Integer epicIid) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null, "groups", getGroupIdOrPath(groupIdOrPath), "epics", epicIid);
} | [
"public",
"void",
"deleteEpic",
"(",
"Object",
"groupIdOrPath",
",",
"Integer",
"epicIid",
")",
"throws",
"GitLabApiException",
"{",
"delete",
"(",
"Response",
".",
"Status",
".",
"NO_CONTENT",
",",
"null",
",",
"\"groups\"",
",",
"getGroupIdOrPath",
"(",
"group... | Deletes an epic.
<pre><code>GitLab Endpoint: DELETE /groups/:id/epics/:epic_iid</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
@param epicIid the IID of the epic to delete
@throws GitLabApiException if any exception occurs | [
"Deletes",
"an",
"epic",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/EpicsApi.java#L339-L341 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/cors/CorsService.java | CorsService.handleCorsPreflight | private HttpResponse handleCorsPreflight(ServiceRequestContext ctx, HttpRequest req) {
"""
Handles CORS preflight by setting the appropriate headers.
@param req the decoded HTTP request
"""
final HttpHeaders headers = HttpHeaders.of(HttpStatus.OK);
final CorsPolicy policy = setCorsOrigin(ctx... | java | private HttpResponse handleCorsPreflight(ServiceRequestContext ctx, HttpRequest req) {
final HttpHeaders headers = HttpHeaders.of(HttpStatus.OK);
final CorsPolicy policy = setCorsOrigin(ctx, req, headers);
if (policy != null) {
policy.setCorsAllowMethods(headers);
policy.... | [
"private",
"HttpResponse",
"handleCorsPreflight",
"(",
"ServiceRequestContext",
"ctx",
",",
"HttpRequest",
"req",
")",
"{",
"final",
"HttpHeaders",
"headers",
"=",
"HttpHeaders",
".",
"of",
"(",
"HttpStatus",
".",
"OK",
")",
";",
"final",
"CorsPolicy",
"policy",
... | Handles CORS preflight by setting the appropriate headers.
@param req the decoded HTTP request | [
"Handles",
"CORS",
"preflight",
"by",
"setting",
"the",
"appropriate",
"headers",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/cors/CorsService.java#L109-L121 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/CmsSitemapTreeItem.java | CmsSitemapTreeItem.addInfo | protected static void addInfo(List<CmsAdditionalInfoBean> infos, String label, String value) {
"""
Helper method to add an additional info bean to a list.<p>
@param infos the list of additional info beans
@param label the label for the new bean
@param value the value for the new bean
"""
infos.ad... | java | protected static void addInfo(List<CmsAdditionalInfoBean> infos, String label, String value) {
infos.add(new CmsAdditionalInfoBean(label, value, null));
} | [
"protected",
"static",
"void",
"addInfo",
"(",
"List",
"<",
"CmsAdditionalInfoBean",
">",
"infos",
",",
"String",
"label",
",",
"String",
"value",
")",
"{",
"infos",
".",
"add",
"(",
"new",
"CmsAdditionalInfoBean",
"(",
"label",
",",
"value",
",",
"null",
... | Helper method to add an additional info bean to a list.<p>
@param infos the list of additional info beans
@param label the label for the new bean
@param value the value for the new bean | [
"Helper",
"method",
"to",
"add",
"an",
"additional",
"info",
"bean",
"to",
"a",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/CmsSitemapTreeItem.java#L280-L283 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java | ArrayFunctions.arrayPrepend | public static Expression arrayPrepend(Expression expression, Expression value) {
"""
Returned expression results in the new array with value pre-pended.
"""
return x("ARRAY_PREPEND(" + value.toString() + ", " + expression.toString() + ")");
} | java | public static Expression arrayPrepend(Expression expression, Expression value) {
return x("ARRAY_PREPEND(" + value.toString() + ", " + expression.toString() + ")");
} | [
"public",
"static",
"Expression",
"arrayPrepend",
"(",
"Expression",
"expression",
",",
"Expression",
"value",
")",
"{",
"return",
"x",
"(",
"\"ARRAY_PREPEND(\"",
"+",
"value",
".",
"toString",
"(",
")",
"+",
"\", \"",
"+",
"expression",
".",
"toString",
"(",
... | Returned expression results in the new array with value pre-pended. | [
"Returned",
"expression",
"results",
"in",
"the",
"new",
"array",
"with",
"value",
"pre",
"-",
"pended",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java#L282-L284 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/QueryParserBase.java | QueryParserBase.appendProjectionOnFields | protected void appendProjectionOnFields(SolrQuery solrQuery, List<Field> fields, @Nullable Class<?> domainType) {
"""
Append field list to {@link SolrQuery}
@param solrQuery
@param fields
"""
if (CollectionUtils.isEmpty(fields)) {
return;
}
List<String> solrReadableFields = new ArrayList<>();
f... | java | protected void appendProjectionOnFields(SolrQuery solrQuery, List<Field> fields, @Nullable Class<?> domainType) {
if (CollectionUtils.isEmpty(fields)) {
return;
}
List<String> solrReadableFields = new ArrayList<>();
for (Field field : fields) {
if (field instanceof CalculatedField) {
solrReadableFiel... | [
"protected",
"void",
"appendProjectionOnFields",
"(",
"SolrQuery",
"solrQuery",
",",
"List",
"<",
"Field",
">",
"fields",
",",
"@",
"Nullable",
"Class",
"<",
"?",
">",
"domainType",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isEmpty",
"(",
"fields",
")",
... | Append field list to {@link SolrQuery}
@param solrQuery
@param fields | [
"Append",
"field",
"list",
"to",
"{",
"@link",
"SolrQuery",
"}"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/QueryParserBase.java#L441-L455 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.