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 |
|---|---|---|---|---|---|---|---|---|---|---|
datacleaner/AnalyzerBeans | env/xml-config/src/main/java/org/eobjects/analyzer/configuration/DatastoreXmlExternalizer.java | DatastoreXmlExternalizer.toElement | public Element toElement(ExcelDatastore datastore, String filename) {
"""
Externalizes a {@link ExcelDatastore} to a XML element.
@param datastore
@param filename
the filename/path to use in the XML element. Since the
appropriate path will depend on the reading application's
environment (supported {@link Re... | java | public Element toElement(ExcelDatastore datastore, String filename) {
final Element ds = getDocument().createElement("excel-datastore");
ds.setAttribute("name", datastore.getName());
if (!StringUtils.isNullOrEmpty(datastore.getDescription())) {
ds.setAttribute("description", datasto... | [
"public",
"Element",
"toElement",
"(",
"ExcelDatastore",
"datastore",
",",
"String",
"filename",
")",
"{",
"final",
"Element",
"ds",
"=",
"getDocument",
"(",
")",
".",
"createElement",
"(",
"\"excel-datastore\"",
")",
";",
"ds",
".",
"setAttribute",
"(",
"\"na... | Externalizes a {@link ExcelDatastore} to a XML element.
@param datastore
@param filename
the filename/path to use in the XML element. Since the
appropriate path will depend on the reading application's
environment (supported {@link Resource} types), this specific
property of the datastore is provided separately.
@retu... | [
"Externalizes",
"a",
"{",
"@link",
"ExcelDatastore",
"}",
"to",
"a",
"XML",
"element",
"."
] | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/env/xml-config/src/main/java/org/eobjects/analyzer/configuration/DatastoreXmlExternalizer.java#L271-L282 |
williamwebb/alogger | BillingHelper/src/main/java/com/jug6ernaut/billing/IabHelper.java | IabHelper.queryInventoryAsync | public void queryInventoryAsync(final boolean querySkuDetails,
final List<String> moreSkus,
final QueryInventoryFinishedListener listener) {
"""
Asynchronous wrapper for inventory query. This will perform an inventory
query as described in {@link #quer... | java | public void queryInventoryAsync(final boolean querySkuDetails,
final List<String> moreSkus,
final QueryInventoryFinishedListener listener) {
final Handler handler = new Handler();
checkNotDisposed();
checkSetupDone("queryInventory");
... | [
"public",
"void",
"queryInventoryAsync",
"(",
"final",
"boolean",
"querySkuDetails",
",",
"final",
"List",
"<",
"String",
">",
"moreSkus",
",",
"final",
"QueryInventoryFinishedListener",
"listener",
")",
"{",
"final",
"Handler",
"handler",
"=",
"new",
"Handler",
"... | Asynchronous wrapper for inventory query. This will perform an inventory
query as described in {@link #queryInventory}, but will do so asynchronously
and call back the specified listener upon completion. This method is safe to
call from a UI thread.
@param querySkuDetails as in {@link #queryInventory}
@param moreSkus ... | [
"Asynchronous",
"wrapper",
"for",
"inventory",
"query",
".",
"This",
"will",
"perform",
"an",
"inventory",
"query",
"as",
"described",
"in",
"{",
"@link",
"#queryInventory",
"}",
"but",
"will",
"do",
"so",
"asynchronously",
"and",
"call",
"back",
"the",
"speci... | train | https://github.com/williamwebb/alogger/blob/61fca49e0b8d9c3a76c40da8883ac354b240351e/BillingHelper/src/main/java/com/jug6ernaut/billing/IabHelper.java#L615-L646 |
emilsjolander/StickyListHeaders | library/src/se/emilsjolander/stickylistheaders/AdapterWrapper.java | AdapterWrapper.configureHeader | private View configureHeader(WrapperView wv, final int position) {
"""
Get a header view. This optionally pulls a header from the supplied
{@link WrapperView} and will also recycle the divider if it exists.
"""
View header = wv.mHeader == null ? popHeader() : wv.mHeader;
header = mDelegate.getHeaderView(p... | java | private View configureHeader(WrapperView wv, final int position) {
View header = wv.mHeader == null ? popHeader() : wv.mHeader;
header = mDelegate.getHeaderView(position, header, wv);
if (header == null) {
throw new NullPointerException("Header view must not be null.");
}
//if the header isn't clickable, t... | [
"private",
"View",
"configureHeader",
"(",
"WrapperView",
"wv",
",",
"final",
"int",
"position",
")",
"{",
"View",
"header",
"=",
"wv",
".",
"mHeader",
"==",
"null",
"?",
"popHeader",
"(",
")",
":",
"wv",
".",
"mHeader",
";",
"header",
"=",
"mDelegate",
... | Get a header view. This optionally pulls a header from the supplied
{@link WrapperView} and will also recycle the divider if it exists. | [
"Get",
"a",
"header",
"view",
".",
"This",
"optionally",
"pulls",
"a",
"header",
"from",
"the",
"supplied",
"{"
] | train | https://github.com/emilsjolander/StickyListHeaders/blob/cec8d6a6ddfc29c530df5864794a5a0a2d2f3675/library/src/se/emilsjolander/stickylistheaders/AdapterWrapper.java#L126-L145 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.loadBalancing_serviceName_backend_backend_PUT | public void loadBalancing_serviceName_backend_backend_PUT(String serviceName, String backend, OvhLoadBalancingBackendIp body) throws IOException {
"""
Alter this object properties
REST: PUT /ip/loadBalancing/{serviceName}/backend/{backend}
@param body [required] New object properties
@param serviceName [requi... | java | public void loadBalancing_serviceName_backend_backend_PUT(String serviceName, String backend, OvhLoadBalancingBackendIp body) throws IOException {
String qPath = "/ip/loadBalancing/{serviceName}/backend/{backend}";
StringBuilder sb = path(qPath, serviceName, backend);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"loadBalancing_serviceName_backend_backend_PUT",
"(",
"String",
"serviceName",
",",
"String",
"backend",
",",
"OvhLoadBalancingBackendIp",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/loadBalancing/{serviceName}/backend/{backend}\"... | Alter this object properties
REST: PUT /ip/loadBalancing/{serviceName}/backend/{backend}
@param body [required] New object properties
@param serviceName [required] The internal name of your IP load balancing
@param backend [required] IP of your backend | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1413-L1417 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java | CommandGroup.createButtonStack | public JComponent createButtonStack(final Size minimumButtonSize) {
"""
Create a button stack with buttons for all the commands. Adds a border
left and right of 2 spaces.
@param minimumButtonSize Minimum size of the buttons (can be null)
@return never null
"""
return createButtonStack(minimumButtonSize,... | java | public JComponent createButtonStack(final Size minimumButtonSize) {
return createButtonStack(minimumButtonSize, GuiStandardUtils.createLeftAndRightBorder(UIConstants.TWO_SPACES));
} | [
"public",
"JComponent",
"createButtonStack",
"(",
"final",
"Size",
"minimumButtonSize",
")",
"{",
"return",
"createButtonStack",
"(",
"minimumButtonSize",
",",
"GuiStandardUtils",
".",
"createLeftAndRightBorder",
"(",
"UIConstants",
".",
"TWO_SPACES",
")",
")",
";",
"... | Create a button stack with buttons for all the commands. Adds a border
left and right of 2 spaces.
@param minimumButtonSize Minimum size of the buttons (can be null)
@return never null | [
"Create",
"a",
"button",
"stack",
"with",
"buttons",
"for",
"all",
"the",
"commands",
".",
"Adds",
"a",
"border",
"left",
"and",
"right",
"of",
"2",
"spaces",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L496-L498 |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.toSeparatedString | public static String toSeparatedString(List<?> values, String separator, String prefix) {
"""
build a single String from a List of objects with a given separator and prefix
@param values
@param separator
@param prefix
@return
"""
StringBuilder result = new StringBuilder();
for (Object e... | java | public static String toSeparatedString(List<?> values, String separator, String prefix) {
StringBuilder result = new StringBuilder();
for (Object each : values) {
if (each == null) {
continue;
}
if (result.length() > 0) {
result.... | [
"public",
"static",
"String",
"toSeparatedString",
"(",
"List",
"<",
"?",
">",
"values",
",",
"String",
"separator",
",",
"String",
"prefix",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Object",
"each",
":"... | build a single String from a List of objects with a given separator and prefix
@param values
@param separator
@param prefix
@return | [
"build",
"a",
"single",
"String",
"from",
"a",
"List",
"of",
"objects",
"with",
"a",
"given",
"separator",
"and",
"prefix"
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L297-L313 |
m-m-m/util | scanner/src/main/java/net/sf/mmm/util/scanner/base/CharSequenceScanner.java | CharSequenceScanner.getReplaced | public String getReplaced(String substitute, int start, int end) {
"""
This method gets the {@link #getOriginalString() original string} where the {@link #substring(int, int)
substring} specified by {@code start} and {@code end} is replaced by {@code substitute}.
@param substitute is the string used as replace... | java | public String getReplaced(String substitute, int start, int end) {
int restLength = this.limit - end;
StringBuilder builder = builder(null);
builder.append(this.buffer, this.initialOffset, start);
builder.append(substitute);
builder.append(this.buffer, this.initialOffset + end, restLength);
... | [
"public",
"String",
"getReplaced",
"(",
"String",
"substitute",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"restLength",
"=",
"this",
".",
"limit",
"-",
"end",
";",
"StringBuilder",
"builder",
"=",
"builder",
"(",
"null",
")",
";",
"builder... | This method gets the {@link #getOriginalString() original string} where the {@link #substring(int, int)
substring} specified by {@code start} and {@code end} is replaced by {@code substitute}.
@param substitute is the string used as replacement.
@param start is the inclusive start index of the substring to replace.
@p... | [
"This",
"method",
"gets",
"the",
"{",
"@link",
"#getOriginalString",
"()",
"original",
"string",
"}",
"where",
"the",
"{",
"@link",
"#substring",
"(",
"int",
"int",
")",
"substring",
"}",
"specified",
"by",
"{",
"@code",
"start",
"}",
"and",
"{",
"@code",
... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/scanner/src/main/java/net/sf/mmm/util/scanner/base/CharSequenceScanner.java#L129-L137 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorLab.java | ColorLab.srgbToLab | public static void srgbToLab( double r , double g , double b , double lab[] ) {
"""
Conversion from normalized RGB into LAB. Normalized RGB values have a range of 0:1
"""
ColorXyz.srgbToXyz(r,g,b,lab);
double X = lab[0];
double Y = lab[1];
double Z = lab[2];
double xr = X/Xr;
double yr = Y/Yr;
... | java | public static void srgbToLab( double r , double g , double b , double lab[] ) {
ColorXyz.srgbToXyz(r,g,b,lab);
double X = lab[0];
double Y = lab[1];
double Z = lab[2];
double xr = X/Xr;
double yr = Y/Yr;
double zr = Z/Zr;
double fx, fy, fz;
if(xr > epsilon) fx = Math.pow(xr, 1.0 / 3.0);
else ... | [
"public",
"static",
"void",
"srgbToLab",
"(",
"double",
"r",
",",
"double",
"g",
",",
"double",
"b",
",",
"double",
"lab",
"[",
"]",
")",
"{",
"ColorXyz",
".",
"srgbToXyz",
"(",
"r",
",",
"g",
",",
"b",
",",
"lab",
")",
";",
"double",
"X",
"=",
... | Conversion from normalized RGB into LAB. Normalized RGB values have a range of 0:1 | [
"Conversion",
"from",
"normalized",
"RGB",
"into",
"LAB",
".",
"Normalized",
"RGB",
"values",
"have",
"a",
"range",
"of",
"0",
":",
"1"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorLab.java#L65-L88 |
OpenTSDB/opentsdb | src/tsd/client/QueryUi.java | QueryUi.makeKeyPanel | private Widget makeKeyPanel() {
"""
Builds the panel containing the customizations for the key of the graph.
"""
final Grid grid = new Grid(5, 5);
addKeyRadioButton(grid, 0, 0, "out left top");
addKeyRadioButton(grid, 0, 2, "out center top");
addKeyRadioButton(grid, 0, 4, "out right top");
... | java | private Widget makeKeyPanel() {
final Grid grid = new Grid(5, 5);
addKeyRadioButton(grid, 0, 0, "out left top");
addKeyRadioButton(grid, 0, 2, "out center top");
addKeyRadioButton(grid, 0, 4, "out right top");
addKeyRadioButton(grid, 1, 1, "top left");
addKeyRadioButton(grid, 1, 2, "top center")... | [
"private",
"Widget",
"makeKeyPanel",
"(",
")",
"{",
"final",
"Grid",
"grid",
"=",
"new",
"Grid",
"(",
"5",
",",
"5",
")",
";",
"addKeyRadioButton",
"(",
"grid",
",",
"0",
",",
"0",
",",
"\"out left top\"",
")",
";",
"addKeyRadioButton",
"(",
"grid",
",... | Builds the panel containing the customizations for the key of the graph. | [
"Builds",
"the",
"panel",
"containing",
"the",
"customizations",
"for",
"the",
"key",
"of",
"the",
"graph",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/QueryUi.java#L574-L614 |
mkolisnyk/cucumber-reports | cucumber-runner/src/main/java/com/github/mkolisnyk/cucumber/assertions/LazyAssert.java | LazyAssert.internalArrayEquals | private static void internalArrayEquals(String message, Object expecteds,
Object actuals) throws ArrayComparisonFailure {
"""
Asserts that two object arrays are equal. If they are not, an
{@link LazyAssertionError} is thrown with the given message. If
<code>expecteds</code> and <code>actuals</code> a... | java | private static void internalArrayEquals(String message, Object expecteds,
Object actuals) throws ArrayComparisonFailure {
try {
new ExactComparisonCriteria().arrayEquals(message, expecteds, actuals);
} catch (AssertionError e) {
throw new LazyAssertionError(message, e... | [
"private",
"static",
"void",
"internalArrayEquals",
"(",
"String",
"message",
",",
"Object",
"expecteds",
",",
"Object",
"actuals",
")",
"throws",
"ArrayComparisonFailure",
"{",
"try",
"{",
"new",
"ExactComparisonCriteria",
"(",
")",
".",
"arrayEquals",
"(",
"mess... | Asserts that two object arrays are equal. If they are not, an
{@link LazyAssertionError} is thrown with the given message. If
<code>expecteds</code> and <code>actuals</code> are <code>null</code>,
they are considered equal.
@param message the identifying message for the {@link LazyAssertionError} (<code>null</code>
ok... | [
"Asserts",
"that",
"two",
"object",
"arrays",
"are",
"equal",
".",
"If",
"they",
"are",
"not",
"an",
"{",
"@link",
"LazyAssertionError",
"}",
"is",
"thrown",
"with",
"the",
"given",
"message",
".",
"If",
"<code",
">",
"expecteds<",
"/",
"code",
">",
"and... | train | https://github.com/mkolisnyk/cucumber-reports/blob/9c9a32f15f0bf1eb1d3d181a11bae9c5eec84a8e/cucumber-runner/src/main/java/com/github/mkolisnyk/cucumber/assertions/LazyAssert.java#L544-L551 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/codec/RTMP.java | RTMP.setLastReadPacket | public void setLastReadPacket(int channelId, Packet packet) {
"""
Setter for last read packet.
@param channelId
Channel id
@param packet
Packet
"""
final ChannelInfo info = getChannelInfo(channelId);
// grab last packet
Packet prevPacket = info.getReadPacket();
// set ... | java | public void setLastReadPacket(int channelId, Packet packet) {
final ChannelInfo info = getChannelInfo(channelId);
// grab last packet
Packet prevPacket = info.getReadPacket();
// set new one
info.setReadPacket(packet);
// free the previous packet
freePacket... | [
"public",
"void",
"setLastReadPacket",
"(",
"int",
"channelId",
",",
"Packet",
"packet",
")",
"{",
"final",
"ChannelInfo",
"info",
"=",
"getChannelInfo",
"(",
"channelId",
")",
";",
"// grab last packet\r",
"Packet",
"prevPacket",
"=",
"info",
".",
"getReadPacket"... | Setter for last read packet.
@param channelId
Channel id
@param packet
Packet | [
"Setter",
"for",
"last",
"read",
"packet",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMP.java#L244-L252 |
Berico-Technologies/CLAVIN | src/main/java/com/bericotech/clavin/gazetteer/FeatureCodeBuilder.java | FeatureCodeBuilder.main | public static void main(String[] args) throws FileNotFoundException, IOException {
"""
Reads-in featureCodes_en.txt file, spits-out
{@link FeatureClass} enum definitions.
@param args the command line arguments
@throws FileNotFoundException if featureCodes_en.txt is not found on the classpath
@throws IOExcept... | java | public static void main(String[] args) throws FileNotFoundException, IOException {
InputStream codeStream = FeatureCodeBuilder.class.getClassLoader().getResourceAsStream("featureCodes_en.txt");
BufferedReader in = new BufferedReader(new InputStreamReader(codeStream, Charset.forName("UTF-8")));
/... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"InputStream",
"codeStream",
"=",
"FeatureCodeBuilder",
".",
"class",
".",
"getClassLoader",
"(",
")",
".",
"getResourceAsStream",... | Reads-in featureCodes_en.txt file, spits-out
{@link FeatureClass} enum definitions.
@param args the command line arguments
@throws FileNotFoundException if featureCodes_en.txt is not found on the classpath
@throws IOException if an error occurs reading the featureCodes file | [
"Reads",
"-",
"in",
"featureCodes_en",
".",
"txt",
"file",
"spits",
"-",
"out",
"{",
"@link",
"FeatureClass",
"}",
"enum",
"definitions",
".",
"@param",
"args",
"the",
"command",
"line",
"arguments"
] | train | https://github.com/Berico-Technologies/CLAVIN/blob/f73c741f33a01b91aa5b06e71860bc354ef3010d/src/main/java/com/bericotech/clavin/gazetteer/FeatureCodeBuilder.java#L56-L77 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneCloseButtonPainter.java | TitlePaneCloseButtonPainter.paintClosePressed | private void paintClosePressed(Graphics2D g, JComponent c, int width, int height) {
"""
Paint the background pressed state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component.
"""
pai... | java | private void paintClosePressed(Graphics2D g, JComponent c, int width, int height) {
paintClose(g, c, width, height, pressed);
} | [
"private",
"void",
"paintClosePressed",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"paintClose",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
",",
"pressed",
")",
";",
"}"
] | Paint the background pressed state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component. | [
"Paint",
"the",
"background",
"pressed",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneCloseButtonPainter.java#L139-L141 |
cdk/cdk | storage/pdb/src/main/java/org/openscience/cdk/protein/data/PDBStrand.java | PDBStrand.addAtom | @Override
public void addAtom(IAtom oAtom, IMonomer oMonomer) {
"""
Adds the atom oAtom to a specified Monomer. Additionally, it keeps
record of the iCode.
@param oAtom The atom to add
@param oMonomer The monomer the atom belongs to
"""
super.addAtom(oAtom, oMonomer);
if (!sequential... | java | @Override
public void addAtom(IAtom oAtom, IMonomer oMonomer) {
super.addAtom(oAtom, oMonomer);
if (!sequentialListOfMonomers.contains(oMonomer.getMonomerName()))
sequentialListOfMonomers.add(oMonomer.getMonomerName());
} | [
"@",
"Override",
"public",
"void",
"addAtom",
"(",
"IAtom",
"oAtom",
",",
"IMonomer",
"oMonomer",
")",
"{",
"super",
".",
"addAtom",
"(",
"oAtom",
",",
"oMonomer",
")",
";",
"if",
"(",
"!",
"sequentialListOfMonomers",
".",
"contains",
"(",
"oMonomer",
".",... | Adds the atom oAtom to a specified Monomer. Additionally, it keeps
record of the iCode.
@param oAtom The atom to add
@param oMonomer The monomer the atom belongs to | [
"Adds",
"the",
"atom",
"oAtom",
"to",
"a",
"specified",
"Monomer",
".",
"Additionally",
"it",
"keeps",
"record",
"of",
"the",
"iCode",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/pdb/src/main/java/org/openscience/cdk/protein/data/PDBStrand.java#L66-L71 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/CriteriaReader.java | CriteriaReader.getPromptValue | private GenericCriteriaPrompt getPromptValue(FieldType field, byte[] block) {
"""
Retrieves a prompt value.
@param field field type
@param block criteria data block
@return prompt value
"""
int textOffset = getPromptOffset(block);
String value = MPPUtility.getUnicodeString(m_criteriaData, m_cr... | java | private GenericCriteriaPrompt getPromptValue(FieldType field, byte[] block)
{
int textOffset = getPromptOffset(block);
String value = MPPUtility.getUnicodeString(m_criteriaData, m_criteriaTextStart + textOffset);
GenericCriteriaPrompt prompt = new GenericCriteriaPrompt(field.getDataType(), value);
... | [
"private",
"GenericCriteriaPrompt",
"getPromptValue",
"(",
"FieldType",
"field",
",",
"byte",
"[",
"]",
"block",
")",
"{",
"int",
"textOffset",
"=",
"getPromptOffset",
"(",
"block",
")",
";",
"String",
"value",
"=",
"MPPUtility",
".",
"getUnicodeString",
"(",
... | Retrieves a prompt value.
@param field field type
@param block criteria data block
@return prompt value | [
"Retrieves",
"a",
"prompt",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L415-L425 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/cluster/ClusterManager.java | ClusterManager.canBeAccommodated | private int canBeAccommodated(int sourceTypeIndex, int targetTypeIndex) {
"""
Returns how many times the instance type stored at index <code>sourceTypeIndex</code> can be accommodated inside
the instance type stored at index <code>targetTypeIndex</code> in the list of available instance types.
@param sourceTyp... | java | private int canBeAccommodated(int sourceTypeIndex, int targetTypeIndex) {
if (sourceTypeIndex >= this.availableInstanceTypes.length
|| targetTypeIndex >= this.availableInstanceTypes.length) {
LOG.error("Cannot determine number of instance accomodations: invalid index");
return 0;
}
return this.instance... | [
"private",
"int",
"canBeAccommodated",
"(",
"int",
"sourceTypeIndex",
",",
"int",
"targetTypeIndex",
")",
"{",
"if",
"(",
"sourceTypeIndex",
">=",
"this",
".",
"availableInstanceTypes",
".",
"length",
"||",
"targetTypeIndex",
">=",
"this",
".",
"availableInstanceTyp... | Returns how many times the instance type stored at index <code>sourceTypeIndex</code> can be accommodated inside
the instance type stored at index <code>targetTypeIndex</code> in the list of available instance types.
@param sourceTypeIndex
the index of the source instance type in the list of available instance types
@... | [
"Returns",
"how",
"many",
"times",
"the",
"instance",
"type",
"stored",
"at",
"index",
"<code",
">",
"sourceTypeIndex<",
"/",
"code",
">",
"can",
"be",
"accommodated",
"inside",
"the",
"instance",
"type",
"stored",
"at",
"index",
"<code",
">",
"targetTypeIndex... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/cluster/ClusterManager.java#L902-L911 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java | Configuration.createImageUrl | public URL createImageUrl(String imagePath, String requiredSize) throws MovieDbException {
"""
Generate the full image URL from the size and image path
@param imagePath
@param requiredSize
@return
@throws MovieDbException
"""
if (!isValidSize(requiredSize)) {
throw new MovieDbExceptio... | java | public URL createImageUrl(String imagePath, String requiredSize) throws MovieDbException {
if (!isValidSize(requiredSize)) {
throw new MovieDbException(ApiExceptionType.INVALID_IMAGE, "Required size '" + requiredSize + "' is not valid");
}
StringBuilder sb = new StringBuilder(getBas... | [
"public",
"URL",
"createImageUrl",
"(",
"String",
"imagePath",
",",
"String",
"requiredSize",
")",
"throws",
"MovieDbException",
"{",
"if",
"(",
"!",
"isValidSize",
"(",
"requiredSize",
")",
")",
"{",
"throw",
"new",
"MovieDbException",
"(",
"ApiExceptionType",
... | Generate the full image URL from the size and image path
@param imagePath
@param requiredSize
@return
@throws MovieDbException | [
"Generate",
"the",
"full",
"image",
"URL",
"from",
"the",
"size",
"and",
"image",
"path"
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java#L196-L209 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/Zips.java | Zips.addTransformer | public Zips addTransformer(String path, ZipEntryTransformer transformer) {
"""
Registers a transformer for a given entry.
@param path entry to transform
@param transformer transformer for the entry
@return this Zips for fluent api
"""
this.transformers.add(new ZipEntryTransformerEntry(path, transforme... | java | public Zips addTransformer(String path, ZipEntryTransformer transformer) {
this.transformers.add(new ZipEntryTransformerEntry(path, transformer));
return this;
} | [
"public",
"Zips",
"addTransformer",
"(",
"String",
"path",
",",
"ZipEntryTransformer",
"transformer",
")",
"{",
"this",
".",
"transformers",
".",
"add",
"(",
"new",
"ZipEntryTransformerEntry",
"(",
"path",
",",
"transformer",
")",
")",
";",
"return",
"this",
"... | Registers a transformer for a given entry.
@param path entry to transform
@param transformer transformer for the entry
@return this Zips for fluent api | [
"Registers",
"a",
"transformer",
"for",
"a",
"given",
"entry",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/Zips.java#L336-L339 |
reinert/requestor | requestor/ext/requestor-oauth2/src/main/java/io/reinert/requestor/oauth2/AuthImpl.java | AuthImpl.doLogin | @Override
void doLogin(String authUrl, final Callback<TokenInfo, Throwable> callback) {
"""
Get the OAuth 2.0 token for which this application may not have already been granted access, by displaying a
popup to the user.
"""
if (window != null && window.isOpen()) {
callback.onFailure(ne... | java | @Override
void doLogin(String authUrl, final Callback<TokenInfo, Throwable> callback) {
if (window != null && window.isOpen()) {
callback.onFailure(new IllegalStateException("Authentication in progress"));
} else {
window = openWindow(authUrl, height, width);
if (... | [
"@",
"Override",
"void",
"doLogin",
"(",
"String",
"authUrl",
",",
"final",
"Callback",
"<",
"TokenInfo",
",",
"Throwable",
">",
"callback",
")",
"{",
"if",
"(",
"window",
"!=",
"null",
"&&",
"window",
".",
"isOpen",
"(",
")",
")",
"{",
"callback",
"."... | Get the OAuth 2.0 token for which this application may not have already been granted access, by displaying a
popup to the user. | [
"Get",
"the",
"OAuth",
"2",
".",
"0",
"token",
"for",
"which",
"this",
"application",
"may",
"not",
"have",
"already",
"been",
"granted",
"access",
"by",
"displaying",
"a",
"popup",
"to",
"the",
"user",
"."
] | train | https://github.com/reinert/requestor/blob/40163a75cd17815d5089935d0dd97b8d652ad6d4/requestor/ext/requestor-oauth2/src/main/java/io/reinert/requestor/oauth2/AuthImpl.java#L71-L97 |
misha/iroh | src/main/java/com/github/msoliter/iroh/container/services/Injector.java | Injector.isNullified | private boolean isNullified(Object target, Field field) {
"""
Checks whether or not the field value object's reference points to one
of our local null object references. If so, this indicates that the
field was nullified during eager injection, and is now eligible for lazy
injection.
@param target The target... | java | private boolean isNullified(Object target, Field field) {
Class<?> type = field.getType();
Object value = null;
try {
value = field.get(target);
} catch (IllegalArgumentException | IllegalAccessException e) {
throw new IrohException(e);
... | [
"private",
"boolean",
"isNullified",
"(",
"Object",
"target",
",",
"Field",
"field",
")",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"field",
".",
"getType",
"(",
")",
";",
"Object",
"value",
"=",
"null",
";",
"try",
"{",
"value",
"=",
"field",
".",
... | Checks whether or not the field value object's reference points to one
of our local null object references. If so, this indicates that the
field was nullified during eager injection, and is now eligible for lazy
injection.
@param target The target object containing the field to be checked.
@param field The target fiel... | [
"Checks",
"whether",
"or",
"not",
"the",
"field",
"value",
"object",
"s",
"reference",
"points",
"to",
"one",
"of",
"our",
"local",
"null",
"object",
"references",
".",
"If",
"so",
"this",
"indicates",
"that",
"the",
"field",
"was",
"nullified",
"during",
... | train | https://github.com/misha/iroh/blob/5dc92a01d3b2f3ba63e8ad1bf9b5fe342d0b679a/src/main/java/com/github/msoliter/iroh/container/services/Injector.java#L152-L177 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_phonebook_bookKey_DELETE | public void billingAccount_phonebook_bookKey_DELETE(String billingAccount, String bookKey) throws IOException {
"""
Delete a phonebook
REST: DELETE /telephony/{billingAccount}/phonebook/{bookKey}
@param billingAccount [required] The name of your billingAccount
@param bookKey [required] Identifier of the phone... | java | public void billingAccount_phonebook_bookKey_DELETE(String billingAccount, String bookKey) throws IOException {
String qPath = "/telephony/{billingAccount}/phonebook/{bookKey}";
StringBuilder sb = path(qPath, billingAccount, bookKey);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"billingAccount_phonebook_bookKey_DELETE",
"(",
"String",
"billingAccount",
",",
"String",
"bookKey",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/phonebook/{bookKey}\"",
";",
"StringBuilder",
"sb",
"=",
"path",... | Delete a phonebook
REST: DELETE /telephony/{billingAccount}/phonebook/{bookKey}
@param billingAccount [required] The name of your billingAccount
@param bookKey [required] Identifier of the phonebook | [
"Delete",
"a",
"phonebook"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5596-L5600 |
carewebframework/carewebframework-vista | org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Security.java | Security.changePassword | public static String changePassword(BrokerSession session, String oldPassword, String newPassword) {
"""
Change a password.
@param session Broker session.
@param oldPassword Old password.
@param newPassword New password.
@return Status message from server.
"""
String cipherKey = session.getServer... | java | public static String changePassword(BrokerSession session, String oldPassword, String newPassword) {
String cipherKey = session.getServerCaps().getCipherKey();
String result = session.callRPC("RGNETBRP CVC", encrypt(oldPassword, cipherKey), encrypt(newPassword, cipherKey));
return result.startsW... | [
"public",
"static",
"String",
"changePassword",
"(",
"BrokerSession",
"session",
",",
"String",
"oldPassword",
",",
"String",
"newPassword",
")",
"{",
"String",
"cipherKey",
"=",
"session",
".",
"getServerCaps",
"(",
")",
".",
"getCipherKey",
"(",
")",
";",
"S... | Change a password.
@param session Broker session.
@param oldPassword Old password.
@param newPassword New password.
@return Status message from server. | [
"Change",
"a",
"password",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Security.java#L82-L86 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.getModuleAncestors | public List<Dependency> getModuleAncestors(final String moduleName, final String moduleVersion) throws GrapesCommunicationException {
"""
Return the list of module ancestors
@param moduleName
@param moduleVersion
@return List<Dependency>
@throws GrapesCommunicationException
"""
final Client clien... | java | public List<Dependency> getModuleAncestors(final String moduleName, final String moduleVersion) throws GrapesCommunicationException {
final Client client = getClient();
final WebResource resource = client.resource(serverURL).path(RequestUtils.getArtifactAncestors(moduleName, moduleVersion));
fin... | [
"public",
"List",
"<",
"Dependency",
">",
"getModuleAncestors",
"(",
"final",
"String",
"moduleName",
",",
"final",
"String",
"moduleVersion",
")",
"throws",
"GrapesCommunicationException",
"{",
"final",
"Client",
"client",
"=",
"getClient",
"(",
")",
";",
"final"... | Return the list of module ancestors
@param moduleName
@param moduleVersion
@return List<Dependency>
@throws GrapesCommunicationException | [
"Return",
"the",
"list",
"of",
"module",
"ancestors"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L760-L779 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java | Transliterator.getBasicInstance | static Transliterator getBasicInstance(String id, String canonID) {
"""
Create a transliterator from a basic ID. This is an ID
containing only the forward direction source, target, and
variant.
@param id a basic ID of the form S-T or S-T/V.
@param canonID canonical ID to apply to the result, or
null to leave... | java | static Transliterator getBasicInstance(String id, String canonID) {
StringBuffer s = new StringBuffer();
Transliterator t = registry.get(id, s);
if (s.length() != 0) {
// assert(t==0);
// Instantiate an alias
t = getInstance(s.toString(), FORWARD);
}
... | [
"static",
"Transliterator",
"getBasicInstance",
"(",
"String",
"id",
",",
"String",
"canonID",
")",
"{",
"StringBuffer",
"s",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"Transliterator",
"t",
"=",
"registry",
".",
"get",
"(",
"id",
",",
"s",
")",
";",
"i... | Create a transliterator from a basic ID. This is an ID
containing only the forward direction source, target, and
variant.
@param id a basic ID of the form S-T or S-T/V.
@param canonID canonical ID to apply to the result, or
null to leave the ID unchanged
@return a newly created Transliterator or null if the ID is
inva... | [
"Create",
"a",
"transliterator",
"from",
"a",
"basic",
"ID",
".",
"This",
"is",
"an",
"ID",
"containing",
"only",
"the",
"forward",
"direction",
"source",
"target",
"and",
"variant",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java#L1357-L1369 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/UnderFileSystemUtils.java | UnderFileSystemUtils.mkdirIfNotExists | public static void mkdirIfNotExists(UnderFileSystem ufs, String path) throws IOException {
"""
Attempts to create the directory if it does not already exist.
@param ufs instance of {@link UnderFileSystem}
@param path path to the directory
"""
if (!ufs.isDirectory(path)) {
if (!ufs.mkdirs(path)) {... | java | public static void mkdirIfNotExists(UnderFileSystem ufs, String path) throws IOException {
if (!ufs.isDirectory(path)) {
if (!ufs.mkdirs(path)) {
throw new IOException("Failed to make folder: " + path);
}
}
} | [
"public",
"static",
"void",
"mkdirIfNotExists",
"(",
"UnderFileSystem",
"ufs",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"ufs",
".",
"isDirectory",
"(",
"path",
")",
")",
"{",
"if",
"(",
"!",
"ufs",
".",
"mkdirs",
"(",
"... | Attempts to create the directory if it does not already exist.
@param ufs instance of {@link UnderFileSystem}
@param path path to the directory | [
"Attempts",
"to",
"create",
"the",
"directory",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/UnderFileSystemUtils.java#L49-L55 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java | HashtableOnDisk.findEntry | private HashtableEntry findEntry(Object key, int hashcode, int retrieveMode, boolean checkExpired, long current, int tableid)
throws IOException,
EOFException,
FileManagerException,
ClassNotFoundException,
HashtableOnDis... | java | private HashtableEntry findEntry(Object key, int hashcode, int retrieveMode, boolean checkExpired, long current, int tableid)
throws IOException,
EOFException,
FileManagerException,
ClassNotFoundException,
HashtableOnDis... | [
"private",
"HashtableEntry",
"findEntry",
"(",
"Object",
"key",
",",
"int",
"hashcode",
",",
"int",
"retrieveMode",
",",
"boolean",
"checkExpired",
",",
"long",
"current",
",",
"int",
"tableid",
")",
"throws",
"IOException",
",",
"EOFException",
",",
"FileManage... | ************************************************************************
Search disk for the indicated entry and return it and its
predecessor if any.
*********************************************************************** | [
"************************************************************************",
"Search",
"disk",
"for",
"the",
"indicated",
"entry",
"and",
"return",
"it",
"and",
"its",
"predecessor",
"if",
"any",
".",
"***********************************************************************"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java#L2198-L2244 |
aws/aws-sdk-java | aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/DescribeRobotResult.java | DescribeRobotResult.withTags | public DescribeRobotResult withTags(java.util.Map<String, String> tags) {
"""
<p>
The list of all tags added to the specified robot.
</p>
@param tags
The list of all tags added to the specified robot.
@return Returns a reference to this object so that method calls can be chained together.
"""
se... | java | public DescribeRobotResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"DescribeRobotResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The list of all tags added to the specified robot.
</p>
@param tags
The list of all tags added to the specified robot.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"list",
"of",
"all",
"tags",
"added",
"to",
"the",
"specified",
"robot",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/DescribeRobotResult.java#L520-L523 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ArabicShaping.java | ArabicShaping.shape | public String shape(String text) throws ArabicShapingException {
"""
Convert a string, returning the new string.
@param text the string to convert
@return the converted string
@throws ArabicShapingException if the string cannot be converted according to the options.
"""
char[] src = text.toCharArr... | java | public String shape(String text) throws ArabicShapingException {
char[] src = text.toCharArray();
char[] dest = src;
if (((options & LAMALEF_MASK) == LAMALEF_RESIZE) &&
((options & LETTERS_MASK) == LETTERS_UNSHAPE)) {
dest = new char[src.length * 2]; // max
}
... | [
"public",
"String",
"shape",
"(",
"String",
"text",
")",
"throws",
"ArabicShapingException",
"{",
"char",
"[",
"]",
"src",
"=",
"text",
".",
"toCharArray",
"(",
")",
";",
"char",
"[",
"]",
"dest",
"=",
"src",
";",
"if",
"(",
"(",
"(",
"options",
"&",... | Convert a string, returning the new string.
@param text the string to convert
@return the converted string
@throws ArabicShapingException if the string cannot be converted according to the options. | [
"Convert",
"a",
"string",
"returning",
"the",
"new",
"string",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ArabicShaping.java#L158-L169 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CustomTopicXMLValidator.java | CustomTopicXMLValidator.doesTopicHaveValidXMLForInitialContent | public static boolean doesTopicHaveValidXMLForInitialContent(final SpecTopic specTopic, final BaseTopicWrapper<?> topic) {
"""
Checks a topics XML to make sure it has content that can be used as front matter for a level.
@param specTopic The SpecTopic of the topic to check the XML for.
@param topic The act... | java | public static boolean doesTopicHaveValidXMLForInitialContent(final SpecTopic specTopic, final BaseTopicWrapper<?> topic) {
boolean valid = true;
final InitialContent initialContent = (InitialContent) specTopic.getParent();
final int numSpecTopics = initialContent.getNumberOfSpecTopics() + initia... | [
"public",
"static",
"boolean",
"doesTopicHaveValidXMLForInitialContent",
"(",
"final",
"SpecTopic",
"specTopic",
",",
"final",
"BaseTopicWrapper",
"<",
"?",
">",
"topic",
")",
"{",
"boolean",
"valid",
"=",
"true",
";",
"final",
"InitialContent",
"initialContent",
"=... | Checks a topics XML to make sure it has content that can be used as front matter for a level.
@param specTopic The SpecTopic of the topic to check the XML for.
@param topic The actual topic to check the XML from.
@return True if the XML can be used, otherwise false. | [
"Checks",
"a",
"topics",
"XML",
"to",
"make",
"sure",
"it",
"has",
"content",
"that",
"can",
"be",
"used",
"as",
"front",
"matter",
"for",
"a",
"level",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CustomTopicXMLValidator.java#L167-L208 |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.insertEntry | public GoogleEntry insertEntry(GoogleEntry entry, GoogleCalendar calendar) throws IOException {
"""
Performs an immediate insert operation on google server by sending the
information provided by the given google entry. The entry is associated
to this calendar.
@param entry The entry to be inserted in a backen... | java | public GoogleEntry insertEntry(GoogleEntry entry, GoogleCalendar calendar) throws IOException {
Event event = converter.convert(entry, Event.class);
event = dao.events().insert(calendar.getId(), event).execute();
entry.setId(event.getId());
entry.setUserObject(event);
return entr... | [
"public",
"GoogleEntry",
"insertEntry",
"(",
"GoogleEntry",
"entry",
",",
"GoogleCalendar",
"calendar",
")",
"throws",
"IOException",
"{",
"Event",
"event",
"=",
"converter",
".",
"convert",
"(",
"entry",
",",
"Event",
".",
"class",
")",
";",
"event",
"=",
"... | Performs an immediate insert operation on google server by sending the
information provided by the given google entry. The entry is associated
to this calendar.
@param entry The entry to be inserted in a backend google calendar.
@param calendar The calendar in which the entry will be inserted.
@return The same instanc... | [
"Performs",
"an",
"immediate",
"insert",
"operation",
"on",
"google",
"server",
"by",
"sending",
"the",
"information",
"provided",
"by",
"the",
"given",
"google",
"entry",
".",
"The",
"entry",
"is",
"associated",
"to",
"this",
"calendar",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L97-L103 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/index/FeatureTableCoreIndex.java | FeatureTableCoreIndex.deleteIndex | public int deleteIndex(long geomId) {
"""
Delete the index for the geometry id
@param geomId
geometry id
@return deleted rows, should be 0 or 1
"""
int deleted = 0;
GeometryIndexKey key = new GeometryIndexKey(tableName, geomId);
try {
deleted = geometryIndexDao.deleteById(key);
} catch (SQLEx... | java | public int deleteIndex(long geomId) {
int deleted = 0;
GeometryIndexKey key = new GeometryIndexKey(tableName, geomId);
try {
deleted = geometryIndexDao.deleteById(key);
} catch (SQLException e) {
throw new GeoPackageException(
"Failed to delete index, GeoPackage: "
+ geoPackage.getName() + ", ... | [
"public",
"int",
"deleteIndex",
"(",
"long",
"geomId",
")",
"{",
"int",
"deleted",
"=",
"0",
";",
"GeometryIndexKey",
"key",
"=",
"new",
"GeometryIndexKey",
"(",
"tableName",
",",
"geomId",
")",
";",
"try",
"{",
"deleted",
"=",
"geometryIndexDao",
".",
"de... | Delete the index for the geometry id
@param geomId
geometry id
@return deleted rows, should be 0 or 1 | [
"Delete",
"the",
"index",
"for",
"the",
"geometry",
"id"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/index/FeatureTableCoreIndex.java#L351-L363 |
square/wire | wire-schema/src/main/java/com/squareup/wire/schema/ProtoFile.java | ProtoFile.retainAll | ProtoFile retainAll(Schema schema, MarkSet markSet) {
"""
Returns a new proto file that omits types and services not in {@code identifiers}.
"""
ImmutableList.Builder<Type> retainedTypes = ImmutableList.builder();
for (Type type : types) {
Type retainedType = type.retainAll(schema, markSet);
... | java | ProtoFile retainAll(Schema schema, MarkSet markSet) {
ImmutableList.Builder<Type> retainedTypes = ImmutableList.builder();
for (Type type : types) {
Type retainedType = type.retainAll(schema, markSet);
if (retainedType != null) {
retainedTypes.add(retainedType);
}
}
ImmutableL... | [
"ProtoFile",
"retainAll",
"(",
"Schema",
"schema",
",",
"MarkSet",
"markSet",
")",
"{",
"ImmutableList",
".",
"Builder",
"<",
"Type",
">",
"retainedTypes",
"=",
"ImmutableList",
".",
"builder",
"(",
")",
";",
"for",
"(",
"Type",
"type",
":",
"types",
")",
... | Returns a new proto file that omits types and services not in {@code identifiers}. | [
"Returns",
"a",
"new",
"proto",
"file",
"that",
"omits",
"types",
"and",
"services",
"not",
"in",
"{"
] | train | https://github.com/square/wire/blob/4a9a00dfadfc14d6a0780b85810418f9cbc78a49/wire-schema/src/main/java/com/squareup/wire/schema/ProtoFile.java#L141-L163 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/query/impl/getters/Getter.java | Getter.getValue | Object getValue(Object obj, String attributePath, Object metadata) throws Exception {
"""
Method for generic getters that can make use of metadata if available. These getters must
gracefully fallback to not using metadata if unavailable.
"""
return getValue(obj, attributePath);
} | java | Object getValue(Object obj, String attributePath, Object metadata) throws Exception {
return getValue(obj, attributePath);
} | [
"Object",
"getValue",
"(",
"Object",
"obj",
",",
"String",
"attributePath",
",",
"Object",
"metadata",
")",
"throws",
"Exception",
"{",
"return",
"getValue",
"(",
"obj",
",",
"attributePath",
")",
";",
"}"
] | Method for generic getters that can make use of metadata if available. These getters must
gracefully fallback to not using metadata if unavailable. | [
"Method",
"for",
"generic",
"getters",
"that",
"can",
"make",
"use",
"of",
"metadata",
"if",
"available",
".",
"These",
"getters",
"must",
"gracefully",
"fallback",
"to",
"not",
"using",
"metadata",
"if",
"unavailable",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/getters/Getter.java#L47-L49 |
Appendium/objectlabkit | utils/src/main/java/net/objectlab/kit/util/ObjectUtil.java | ObjectUtil.equalsValue | public static boolean equalsValue(final BigDecimal bd1, final BigDecimal bd2) {
"""
Return true if bd1 has the same value (according to
{@link BigDecimalUtil#isSameValue(BigDecimal, BigDecimal)}, which takes care of different scales)
as bd2.
Also returns true if bd1 is null and bd2 is null! Is safe on either bd... | java | public static boolean equalsValue(final BigDecimal bd1, final BigDecimal bd2) {
if (bd1 == null) {
return bd2 == null;
}
return BigDecimalUtil.isSameValue(bd1, bd2);
} | [
"public",
"static",
"boolean",
"equalsValue",
"(",
"final",
"BigDecimal",
"bd1",
",",
"final",
"BigDecimal",
"bd2",
")",
"{",
"if",
"(",
"bd1",
"==",
"null",
")",
"{",
"return",
"bd2",
"==",
"null",
";",
"}",
"return",
"BigDecimalUtil",
".",
"isSameValue",... | Return true if bd1 has the same value (according to
{@link BigDecimalUtil#isSameValue(BigDecimal, BigDecimal)}, which takes care of different scales)
as bd2.
Also returns true if bd1 is null and bd2 is null! Is safe on either bd1 or bd2 being null. | [
"Return",
"true",
"if",
"bd1",
"has",
"the",
"same",
"value",
"(",
"according",
"to",
"{"
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/util/ObjectUtil.java#L58-L63 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.unsubscribeAllResourcesFor | public void unsubscribeAllResourcesFor(CmsDbContext dbc, String poolName, CmsPrincipal principal)
throws CmsException {
"""
Unsubscribes the principal from all resources.<p>
@param dbc the database context
@param poolName the name of the database pool to use
@param principal the principal that unsubscribe... | java | public void unsubscribeAllResourcesFor(CmsDbContext dbc, String poolName, CmsPrincipal principal)
throws CmsException {
getSubscriptionDriver().unsubscribeAllResourcesFor(dbc, poolName, principal);
} | [
"public",
"void",
"unsubscribeAllResourcesFor",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"poolName",
",",
"CmsPrincipal",
"principal",
")",
"throws",
"CmsException",
"{",
"getSubscriptionDriver",
"(",
")",
".",
"unsubscribeAllResourcesFor",
"(",
"dbc",
",",
"poolNam... | Unsubscribes the principal from all resources.<p>
@param dbc the database context
@param poolName the name of the database pool to use
@param principal the principal that unsubscribes from all resources
@throws CmsException if something goes wrong | [
"Unsubscribes",
"the",
"principal",
"from",
"all",
"resources",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9262-L9267 |
citiususc/hipster | hipster-examples/src/main/java/es/usc/citius/hipster/examples/problem/NPuzzle.java | NPuzzle.getPrettyPath | public static String getPrettyPath(List<Puzzle> path, int size) {
"""
Prints a search path in a readable form.
@param path List of puzzle states of the path.
@param size Size of the puzzle state (8 for 8-puzzle)
@return String representing all the transitions from initial to goal.
"""
// Print eac... | java | public static String getPrettyPath(List<Puzzle> path, int size) {
// Print each row of all states
StringBuffer output = new StringBuffer();
for (int y = 0; y < size; y++) {
String row = "";
for (Puzzle state : path) {
int[][] board = state.getMatrixBoard()... | [
"public",
"static",
"String",
"getPrettyPath",
"(",
"List",
"<",
"Puzzle",
">",
"path",
",",
"int",
"size",
")",
"{",
"// Print each row of all states",
"StringBuffer",
"output",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"y",
"=",
"0",
... | Prints a search path in a readable form.
@param path List of puzzle states of the path.
@param size Size of the puzzle state (8 for 8-puzzle)
@return String representing all the transitions from initial to goal. | [
"Prints",
"a",
"search",
"path",
"in",
"a",
"readable",
"form",
"."
] | train | https://github.com/citiususc/hipster/blob/9ab1236abb833a27641ae73ba9ca890d5c17598e/hipster-examples/src/main/java/es/usc/citius/hipster/examples/problem/NPuzzle.java#L40-L57 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/KNXAddress.java | KNXAddress.save | public void save(XMLWriter w) throws KNXMLException {
"""
Writes the KNX address in XML format to the supplied writer.
<p>
@param w a XML writer
@throws KNXMLException on output error
"""
final List att = new ArrayList();
att.add(new Attribute(ATTR_TYPE, getType()));
w.writeElement(TAG_ADDRESS, a... | java | public void save(XMLWriter w) throws KNXMLException
{
final List att = new ArrayList();
att.add(new Attribute(ATTR_TYPE, getType()));
w.writeElement(TAG_ADDRESS, att, Integer.toString(address));
w.endElement();
} | [
"public",
"void",
"save",
"(",
"XMLWriter",
"w",
")",
"throws",
"KNXMLException",
"{",
"final",
"List",
"att",
"=",
"new",
"ArrayList",
"(",
")",
";",
"att",
".",
"add",
"(",
"new",
"Attribute",
"(",
"ATTR_TYPE",
",",
"getType",
"(",
")",
")",
")",
"... | Writes the KNX address in XML format to the supplied writer.
<p>
@param w a XML writer
@throws KNXMLException on output error | [
"Writes",
"the",
"KNX",
"address",
"in",
"XML",
"format",
"to",
"the",
"supplied",
"writer",
".",
"<p",
">"
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/KNXAddress.java#L224-L230 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassParameter.java | ClassParameter.canonicalClassName | public static String canonicalClassName(Class<?> c, Package pkg) {
"""
Get the "simple" form of a class name.
@param c Class
@param pkg Package
@return Simplified class name
"""
String name = c.getName();
if(pkg != null) {
final String pkgname = pkg.getName();
if(name.length() > pkgn... | java | public static String canonicalClassName(Class<?> c, Package pkg) {
String name = c.getName();
if(pkg != null) {
final String pkgname = pkg.getName();
if(name.length() > pkgname.length() && name.startsWith(pkgname) && name.charAt(pkgname.length()) == '.') {
name = name.substring(pkgname.lengt... | [
"public",
"static",
"String",
"canonicalClassName",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"Package",
"pkg",
")",
"{",
"String",
"name",
"=",
"c",
".",
"getName",
"(",
")",
";",
"if",
"(",
"pkg",
"!=",
"null",
")",
"{",
"final",
"String",
"pkgname",
... | Get the "simple" form of a class name.
@param c Class
@param pkg Package
@return Simplified class name | [
"Get",
"the",
"simple",
"form",
"of",
"a",
"class",
"name",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassParameter.java#L198-L210 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/OneStepIteratorForward.java | OneStepIteratorForward.setRoot | public void setRoot(int context, Object environment) {
"""
Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation.
"""
super.setRoot(context, environment);
m_traverser = m_cdtm.getAxisTraverser(m_axis);
} | java | public void setRoot(int context, Object environment)
{
super.setRoot(context, environment);
m_traverser = m_cdtm.getAxisTraverser(m_axis);
} | [
"public",
"void",
"setRoot",
"(",
"int",
"context",
",",
"Object",
"environment",
")",
"{",
"super",
".",
"setRoot",
"(",
"context",
",",
"environment",
")",
";",
"m_traverser",
"=",
"m_cdtm",
".",
"getAxisTraverser",
"(",
"m_axis",
")",
";",
"}"
] | Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation. | [
"Initialize",
"the",
"context",
"values",
"for",
"this",
"expression",
"after",
"it",
"is",
"cloned",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/OneStepIteratorForward.java#L88-L93 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.setLookAlong | public Matrix4f setLookAlong(Vector3fc dir, Vector3fc up) {
"""
Set this matrix to a rotation transformation to make <code>-z</code>
point along <code>dir</code>.
<p>
This is equivalent to calling
{@link #setLookAt(Vector3fc, Vector3fc, Vector3fc) setLookAt()}
with <code>eye = (0, 0, 0)</code> and <code>cente... | java | public Matrix4f setLookAlong(Vector3fc dir, Vector3fc up) {
return setLookAlong(dir.x(), dir.y(), dir.z(), up.x(), up.y(), up.z());
} | [
"public",
"Matrix4f",
"setLookAlong",
"(",
"Vector3fc",
"dir",
",",
"Vector3fc",
"up",
")",
"{",
"return",
"setLookAlong",
"(",
"dir",
".",
"x",
"(",
")",
",",
"dir",
".",
"y",
"(",
")",
",",
"dir",
".",
"z",
"(",
")",
",",
"up",
".",
"x",
"(",
... | Set this matrix to a rotation transformation to make <code>-z</code>
point along <code>dir</code>.
<p>
This is equivalent to calling
{@link #setLookAt(Vector3fc, Vector3fc, Vector3fc) setLookAt()}
with <code>eye = (0, 0, 0)</code> and <code>center = dir</code>.
<p>
In order to apply the lookalong transformation to any ... | [
"Set",
"this",
"matrix",
"to",
"a",
"rotation",
"transformation",
"to",
"make",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"point",
"along",
"<code",
">",
"dir<",
"/",
"code",
">",
".",
"<p",
">",
"This",
"is",
"equivalent",
"to",
"calling",
"{",
"@l... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L8260-L8262 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.tagStyleHtmlContent | public static String tagStyleHtmlContent(String tag, String style, String... content) {
"""
Build a String containing a HTML opening tag with given CSS style attribute(s), HTML content and closing tag.
@param tag String name of HTML tag
@param style style for tag (plain CSS)
@param content content string
@re... | java | public static String tagStyleHtmlContent(String tag, String style, String... content) {
return openTagStyleHtmlContent(tag, style, content) + closeTag(tag);
} | [
"public",
"static",
"String",
"tagStyleHtmlContent",
"(",
"String",
"tag",
",",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"openTagStyleHtmlContent",
"(",
"tag",
",",
"style",
",",
"content",
")",
"+",
"closeTag",
"(",
"tag",
")"... | Build a String containing a HTML opening tag with given CSS style attribute(s), HTML content and closing tag.
@param tag String name of HTML tag
@param style style for tag (plain CSS)
@param content content string
@return HTML tag element as string | [
"Build",
"a",
"String",
"containing",
"a",
"HTML",
"opening",
"tag",
"with",
"given",
"CSS",
"style",
"attribute",
"(",
"s",
")",
"HTML",
"content",
"and",
"closing",
"tag",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L313-L315 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java | AbstractCasView.getProxyGrantingTicketIou | protected String getProxyGrantingTicketIou(final Map<String, Object> model) {
"""
Gets the PGT-IOU from the model.
@param model the model
@return the pgt-iou id
"""
return (String) model.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET_IOU);
} | java | protected String getProxyGrantingTicketIou(final Map<String, Object> model) {
return (String) model.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET_IOU);
} | [
"protected",
"String",
"getProxyGrantingTicketIou",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
")",
"{",
"return",
"(",
"String",
")",
"model",
".",
"get",
"(",
"CasViewConstants",
".",
"MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET_IOU",
")",
"... | Gets the PGT-IOU from the model.
@param model the model
@return the pgt-iou id | [
"Gets",
"the",
"PGT",
"-",
"IOU",
"from",
"the",
"model",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java#L107-L109 |
square/tape | tape/src/main/java/com/squareup/tape2/QueueFile.java | QueueFile.writeHeader | private void writeHeader(long fileLength, int elementCount, long firstPosition, long lastPosition)
throws IOException {
"""
Writes header atomically. The arguments contain the updated values. The class member fields
should not have changed yet. This only updates the state in the file. It's up to the caller ... | java | private void writeHeader(long fileLength, int elementCount, long firstPosition, long lastPosition)
throws IOException {
raf.seek(0);
if (versioned) {
writeInt(buffer, 0, VERSIONED_HEADER);
writeLong(buffer, 4, fileLength);
writeInt(buffer, 12, elementCount);
writeLong(buffer, 16, ... | [
"private",
"void",
"writeHeader",
"(",
"long",
"fileLength",
",",
"int",
"elementCount",
",",
"long",
"firstPosition",
",",
"long",
"lastPosition",
")",
"throws",
"IOException",
"{",
"raf",
".",
"seek",
"(",
"0",
")",
";",
"if",
"(",
"versioned",
")",
"{",... | Writes header atomically. The arguments contain the updated values. The class member fields
should not have changed yet. This only updates the state in the file. It's up to the caller to
update the class member variables *after* this call succeeds. Assumes segment writes are
atomic in the underlying file system. | [
"Writes",
"header",
"atomically",
".",
"The",
"arguments",
"contain",
"the",
"updated",
"values",
".",
"The",
"class",
"member",
"fields",
"should",
"not",
"have",
"changed",
"yet",
".",
"This",
"only",
"updates",
"the",
"state",
"in",
"the",
"file",
".",
... | train | https://github.com/square/tape/blob/445cd3fd0a7b3ec48c9ea3e0e86663fe6d3735d8/tape/src/main/java/com/squareup/tape2/QueueFile.java#L265-L285 |
fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/HourRange.java | HourRange.isValid | public static boolean isValid(@Nullable final String hourRange) {
"""
Verifies if the string is a valid hour range.
@param hourRange
Hour range string to test.
@return {@literal true} if the string is a valid range, else {@literal false}.
"""
if (hourRange == null) {
return true;
... | java | public static boolean isValid(@Nullable final String hourRange) {
if (hourRange == null) {
return true;
}
final int p = hourRange.indexOf('-');
if (p != 5) {
return false;
}
final String fromStr = hourRange.substring(0, 5);
final String toS... | [
"public",
"static",
"boolean",
"isValid",
"(",
"@",
"Nullable",
"final",
"String",
"hourRange",
")",
"{",
"if",
"(",
"hourRange",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"final",
"int",
"p",
"=",
"hourRange",
".",
"indexOf",
"(",
"'",
"'",
... | Verifies if the string is a valid hour range.
@param hourRange
Hour range string to test.
@return {@literal true} if the string is a valid range, else {@literal false}. | [
"Verifies",
"if",
"the",
"string",
"is",
"a",
"valid",
"hour",
"range",
"."
] | train | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/HourRange.java#L266-L288 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java | NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots | public static NestedSerializersSnapshotDelegate readNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException {
"""
Reads the composite snapshot of all the contained serializers.
"""
final int magicNumber = in.readInt();
if (magicNumber != MAGIC_NUMBER) {
throw new IOException(Strin... | java | public static NestedSerializersSnapshotDelegate readNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException {
final int magicNumber = in.readInt();
if (magicNumber != MAGIC_NUMBER) {
throw new IOException(String.format("Corrupt data, magic number mismatch. Expected %8x, found %8x",
MA... | [
"public",
"static",
"NestedSerializersSnapshotDelegate",
"readNestedSerializerSnapshots",
"(",
"DataInputView",
"in",
",",
"ClassLoader",
"cl",
")",
"throws",
"IOException",
"{",
"final",
"int",
"magicNumber",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"if",
"(",
"... | Reads the composite snapshot of all the contained serializers. | [
"Reads",
"the",
"composite",
"snapshot",
"of",
"all",
"the",
"contained",
"serializers",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java#L166-L186 |
xvik/dropwizard-guicey | src/main/java/ru/vyarus/dropwizard/guice/module/installer/feature/web/util/WebUtils.java | WebUtils.getFilterName | public static String getFilterName(final WebFilter filter, final Class<? extends Filter> type) {
"""
When filter name not set in annotation, name generates as: . (dot) at the beginning to indicate
generated name, followed by lower-cased class name. If class ends with "filter" then it will be cut off.
For example... | java | public static String getFilterName(final WebFilter filter, final Class<? extends Filter> type) {
final String name = Strings.emptyToNull(filter.filterName());
return name != null ? name : generateName(type, "filter");
} | [
"public",
"static",
"String",
"getFilterName",
"(",
"final",
"WebFilter",
"filter",
",",
"final",
"Class",
"<",
"?",
"extends",
"Filter",
">",
"type",
")",
"{",
"final",
"String",
"name",
"=",
"Strings",
".",
"emptyToNull",
"(",
"filter",
".",
"filterName",
... | When filter name not set in annotation, name generates as: . (dot) at the beginning to indicate
generated name, followed by lower-cased class name. If class ends with "filter" then it will be cut off.
For example, for class "MyCoolFilter" generated name will be ".mycool".
@param filter filter annotation
@param type ... | [
"When",
"filter",
"name",
"not",
"set",
"in",
"annotation",
"name",
"generates",
"as",
":",
".",
"(",
"dot",
")",
"at",
"the",
"beginning",
"to",
"indicate",
"generated",
"name",
"followed",
"by",
"lower",
"-",
"cased",
"class",
"name",
".",
"If",
"class... | train | https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/installer/feature/web/util/WebUtils.java#L31-L34 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/icon/provider/IconProviderBuilder.java | IconProviderBuilder.withValue | public IconProviderBuilder withValue(Object value, String iconName) {
"""
Sets the {@link Icon} to use for the state value.<br>
{@link #forProperty(IProperty)} must be called before with the corresponding {@link IProperty}.
@param value the value
@param iconName the icon name
@return the icon provider builde... | java | public IconProviderBuilder withValue(Object value, String iconName)
{
return withValue(value, icon(iconName));
} | [
"public",
"IconProviderBuilder",
"withValue",
"(",
"Object",
"value",
",",
"String",
"iconName",
")",
"{",
"return",
"withValue",
"(",
"value",
",",
"icon",
"(",
"iconName",
")",
")",
";",
"}"
] | Sets the {@link Icon} to use for the state value.<br>
{@link #forProperty(IProperty)} must be called before with the corresponding {@link IProperty}.
@param value the value
@param iconName the icon name
@return the icon provider builder | [
"Sets",
"the",
"{",
"@link",
"Icon",
"}",
"to",
"use",
"for",
"the",
"state",
"value",
".",
"<br",
">",
"{",
"@link",
"#forProperty",
"(",
"IProperty",
")",
"}",
"must",
"be",
"called",
"before",
"with",
"the",
"corresponding",
"{",
"@link",
"IProperty",... | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/icon/provider/IconProviderBuilder.java#L229-L232 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PrivateKeyReader.java | PrivateKeyReader.readPrivateKey | public static PrivateKey readPrivateKey(final File file, final String algorithm)
throws IOException, NoSuchAlgorithmException, InvalidKeySpecException,
NoSuchProviderException {
"""
Reads the given {@link File}( in *.der format) with the given algorithm and returns the
{@link PrivateKey} object.
@param fil... | java | public static PrivateKey readPrivateKey(final File file, final String algorithm)
throws IOException, NoSuchAlgorithmException, InvalidKeySpecException,
NoSuchProviderException
{
final byte[] keyBytes = Files.readAllBytes(file.toPath());
return readPrivateKey(keyBytes, algorithm);
} | [
"public",
"static",
"PrivateKey",
"readPrivateKey",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"algorithm",
")",
"throws",
"IOException",
",",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"NoSuchProviderException",
"{",
"final",
"byte",
... | Reads the given {@link File}( in *.der format) with the given algorithm and returns the
{@link PrivateKey} object.
@param file
the file( in *.der format) that contains the private key
@param algorithm
the algorithm
@return the {@link PrivateKey} object
@throws IOException
Signals that an I/O exception has occurred.
@t... | [
"Reads",
"the",
"given",
"{",
"@link",
"File",
"}",
"(",
"in",
"*",
".",
"der",
"format",
")",
"with",
"the",
"given",
"algorithm",
"and",
"returns",
"the",
"{",
"@link",
"PrivateKey",
"}",
"object",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PrivateKeyReader.java#L179-L185 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/AttributeProvider.java | AttributeProvider.checkType | protected static <T> T checkType(String view, String attribute, Object value, Class<T> type) {
"""
Checks that the given value is of the given type, returning the value if so and throwing an
exception if not.
"""
checkNotNull(value);
if (type.isInstance(value)) {
return type.cast(value);
}
... | java | protected static <T> T checkType(String view, String attribute, Object value, Class<T> type) {
checkNotNull(value);
if (type.isInstance(value)) {
return type.cast(value);
}
throw invalidType(view, attribute, value, type);
} | [
"protected",
"static",
"<",
"T",
">",
"T",
"checkType",
"(",
"String",
"view",
",",
"String",
"attribute",
",",
"Object",
"value",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"checkNotNull",
"(",
"value",
")",
";",
"if",
"(",
"type",
".",
"isInsta... | Checks that the given value is of the given type, returning the value if so and throwing an
exception if not. | [
"Checks",
"that",
"the",
"given",
"value",
"is",
"of",
"the",
"given",
"type",
"returning",
"the",
"value",
"if",
"so",
"and",
"throwing",
"an",
"exception",
"if",
"not",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeProvider.java#L152-L159 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.exportIterationWithServiceResponseAsync | public Observable<ServiceResponse<Export>> exportIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, String platform, ExportIterationOptionalParameter exportIterationOptionalParameter) {
"""
Export a trained iteration.
@param projectId The project id
@param iterationId The iteration id
@param ... | java | public Observable<ServiceResponse<Export>> exportIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, String platform, ExportIterationOptionalParameter exportIterationOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Export",
">",
">",
"exportIterationWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"UUID",
"iterationId",
",",
"String",
"platform",
",",
"ExportIterationOptionalParameter",
"exportIterationOptionalParameter",
... | Export a trained iteration.
@param projectId The project id
@param iterationId The iteration id
@param platform The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX'
@param exportIterationOptionalParameter the object representing the optional parameters to be... | [
"Export",
"a",
"trained",
"iteration",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L994-L1010 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java | ControlBean.setControlProperty | protected void setControlProperty(PropertyKey key, Object o) {
"""
Sets a property on the ControlBean instance. All generated property setter methods
will delegate down to this method.
"""
AnnotationConstraintValidator.validate(key, o);
_properties.setProperty(key, o);
} | java | protected void setControlProperty(PropertyKey key, Object o)
{
AnnotationConstraintValidator.validate(key, o);
_properties.setProperty(key, o);
} | [
"protected",
"void",
"setControlProperty",
"(",
"PropertyKey",
"key",
",",
"Object",
"o",
")",
"{",
"AnnotationConstraintValidator",
".",
"validate",
"(",
"key",
",",
"o",
")",
";",
"_properties",
".",
"setProperty",
"(",
"key",
",",
"o",
")",
";",
"}"
] | Sets a property on the ControlBean instance. All generated property setter methods
will delegate down to this method. | [
"Sets",
"a",
"property",
"on",
"the",
"ControlBean",
"instance",
".",
"All",
"generated",
"property",
"setter",
"methods",
"will",
"delegate",
"down",
"to",
"this",
"method",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L639-L643 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/Analyze.java | Analyze.deepInstanceOf | public static double deepInstanceOf(@DottedClassName String x, @DottedClassName String y) throws ClassNotFoundException {
"""
Given two JavaClasses, try to estimate the probability that an reference
of type x is also an instance of type y. Will return 0 only if it is
impossible and 1 only if it is guaranteed.
... | java | public static double deepInstanceOf(@DottedClassName String x, @DottedClassName String y) throws ClassNotFoundException {
return deepInstanceOf(AnalysisContext.currentAnalysisContext().lookupClass(x), AnalysisContext.currentAnalysisContext()
.lookupClass(y));
} | [
"public",
"static",
"double",
"deepInstanceOf",
"(",
"@",
"DottedClassName",
"String",
"x",
",",
"@",
"DottedClassName",
"String",
"y",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"deepInstanceOf",
"(",
"AnalysisContext",
".",
"currentAnalysisContext",
"("... | Given two JavaClasses, try to estimate the probability that an reference
of type x is also an instance of type y. Will return 0 only if it is
impossible and 1 only if it is guaranteed.
@param x
Known type of object
@param y
Type queried about
@return 0 - 1 value indicating probablility | [
"Given",
"two",
"JavaClasses",
"try",
"to",
"estimate",
"the",
"probability",
"that",
"an",
"reference",
"of",
"type",
"x",
"is",
"also",
"an",
"instance",
"of",
"type",
"y",
".",
"Will",
"return",
"0",
"only",
"if",
"it",
"is",
"impossible",
"and",
"1",... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/Analyze.java#L160-L163 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.pixelXToLongitudeWithScaleFactor | public static double pixelXToLongitudeWithScaleFactor(double pixelX, double scaleFactor, int tileSize) {
"""
Converts a pixel X coordinate at a certain scale to a longitude coordinate.
@param pixelX the pixel X coordinate that should be converted.
@param scaleFactor the scale factor at which the coordinat... | java | public static double pixelXToLongitudeWithScaleFactor(double pixelX, double scaleFactor, int tileSize) {
long mapSize = getMapSizeWithScaleFactor(scaleFactor, tileSize);
if (pixelX < 0 || pixelX > mapSize) {
throw new IllegalArgumentException("invalid pixelX coordinate at scale " + scaleFact... | [
"public",
"static",
"double",
"pixelXToLongitudeWithScaleFactor",
"(",
"double",
"pixelX",
",",
"double",
"scaleFactor",
",",
"int",
"tileSize",
")",
"{",
"long",
"mapSize",
"=",
"getMapSizeWithScaleFactor",
"(",
"scaleFactor",
",",
"tileSize",
")",
";",
"if",
"("... | Converts a pixel X coordinate at a certain scale to a longitude coordinate.
@param pixelX the pixel X coordinate that should be converted.
@param scaleFactor the scale factor at which the coordinate should be converted.
@return the longitude value of the pixel X coordinate.
@throws IllegalArgumentException if the... | [
"Converts",
"a",
"pixel",
"X",
"coordinate",
"at",
"a",
"certain",
"scale",
"to",
"a",
"longitude",
"coordinate",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L336-L342 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.rotateLocal | public Matrix4f rotateLocal(float ang, float x, float y, float z) {
"""
Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified <code>(x, y, z)</code> axis.
<p>
The axis described by the three components needs to be a unit vector.
<p>
When used with a right-handed co... | java | public Matrix4f rotateLocal(float ang, float x, float y, float z) {
return rotateLocal(ang, x, y, z, thisOrNew());
} | [
"public",
"Matrix4f",
"rotateLocal",
"(",
"float",
"ang",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"return",
"rotateLocal",
"(",
"ang",
",",
"x",
",",
"y",
",",
"z",
",",
"thisOrNew",
"(",
")",
")",
";",
"}"
] | Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified <code>(x, y, z)</code> axis.
<p>
The axis described by the three components needs to be a unit vector.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise arou... | [
"Pre",
"-",
"multiply",
"a",
"rotation",
"to",
"this",
"matrix",
"by",
"rotating",
"the",
"given",
"amount",
"of",
"radians",
"about",
"the",
"specified",
"<code",
">",
"(",
"x",
"y",
"z",
")",
"<",
"/",
"code",
">",
"axis",
".",
"<p",
">",
"The",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L6254-L6256 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Table.java | Table.placeCell | private void placeCell(ArrayList<Row> someRows, Cell aCell, Point aPosition) {
"""
Inserts a Cell in a cell-array and reserves cells defined by row-/colspan.
@param someRows some rows
@param aCell the cell that has to be inserted
@param aPosition the position where the cell has to be placed
... | java | private void placeCell(ArrayList<Row> someRows, Cell aCell, Point aPosition) {
int i;
Row row = null;
int rowCount = aPosition.x + aCell.getRowspan() - someRows.size();
assumeTableDefaults(aCell);
if ( (aPosition.x + aCell.getRowspan()) > someRows.size() ) {
for (i = ... | [
"private",
"void",
"placeCell",
"(",
"ArrayList",
"<",
"Row",
">",
"someRows",
",",
"Cell",
"aCell",
",",
"Point",
"aPosition",
")",
"{",
"int",
"i",
";",
"Row",
"row",
"=",
"null",
";",
"int",
"rowCount",
"=",
"aPosition",
".",
"x",
"+",
"aCell",
".... | Inserts a Cell in a cell-array and reserves cells defined by row-/colspan.
@param someRows some rows
@param aCell the cell that has to be inserted
@param aPosition the position where the cell has to be placed | [
"Inserts",
"a",
"Cell",
"in",
"a",
"cell",
"-",
"array",
"and",
"reserves",
"cells",
"defined",
"by",
"row",
"-",
"/",
"colspan",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Table.java#L1265-L1288 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasMethodAdapter.java | AbstractRasMethodAdapter.visitParameterAnnotation | @Override
public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) {
"""
Visit the method parameter annotations looking for the supported RAS
annotations. The visitors are only used when a {@code MethodInfo} model
object was not provided during construction.
@param de... | java | @Override
public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) {
AnnotationVisitor av = super.visitParameterAnnotation(parameter, desc, visible);
Set<Type> parameterAnnotations = observedParameterAnnotations.get(parameter);
if (parameterAnnotations =... | [
"@",
"Override",
"public",
"AnnotationVisitor",
"visitParameterAnnotation",
"(",
"int",
"parameter",
",",
"String",
"desc",
",",
"boolean",
"visible",
")",
"{",
"AnnotationVisitor",
"av",
"=",
"super",
".",
"visitParameterAnnotation",
"(",
"parameter",
",",
"desc",
... | Visit the method parameter annotations looking for the supported RAS
annotations. The visitors are only used when a {@code MethodInfo} model
object was not provided during construction.
@param desc
the annotation descriptor
@param visible
true if the annotation is a runtime visible annotation | [
"Visit",
"the",
"method",
"parameter",
"annotations",
"looking",
"for",
"the",
"supported",
"RAS",
"annotations",
".",
"The",
"visitors",
"are",
"only",
"used",
"when",
"a",
"{",
"@code",
"MethodInfo",
"}",
"model",
"object",
"was",
"not",
"provided",
"during"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasMethodAdapter.java#L353-L363 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updatePatternAnyEntityModel | public OperationStatus updatePatternAnyEntityModel(UUID appId, String versionId, UUID entityId, PatternAnyModelUpdateObject patternAnyUpdateObject) {
"""
Updates the name and explicit list of a Pattern.Any entity model.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Patt... | java | public OperationStatus updatePatternAnyEntityModel(UUID appId, String versionId, UUID entityId, PatternAnyModelUpdateObject patternAnyUpdateObject) {
return updatePatternAnyEntityModelWithServiceResponseAsync(appId, versionId, entityId, patternAnyUpdateObject).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"updatePatternAnyEntityModel",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"PatternAnyModelUpdateObject",
"patternAnyUpdateObject",
")",
"{",
"return",
"updatePatternAnyEntityModelWithServiceResponseAsync",
"(",
... | Updates the name and explicit list of a Pattern.Any entity model.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pattern.Any entity extractor ID.
@param patternAnyUpdateObject An object containing the explicit list of the Pattern.Any entity.
@throws IllegalArgumentException throw... | [
"Updates",
"the",
"name",
"and",
"explicit",
"list",
"of",
"a",
"Pattern",
".",
"Any",
"entity",
"model",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10552-L10554 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java | ApiOvhHostingprivateDatabase.availableOrderCapacities_GET | public OvhAvailableOrderCapacities availableOrderCapacities_GET(OvhOfferEnum offer) throws IOException {
"""
Get available order capacitie
REST: GET /hosting/privateDatabase/availableOrderCapacities
@param offer [required] Offer available order capacities to choose
"""
String qPath = "/hosting/privateDat... | java | public OvhAvailableOrderCapacities availableOrderCapacities_GET(OvhOfferEnum offer) throws IOException {
String qPath = "/hosting/privateDatabase/availableOrderCapacities";
StringBuilder sb = path(qPath);
query(sb, "offer", offer);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, ... | [
"public",
"OvhAvailableOrderCapacities",
"availableOrderCapacities_GET",
"(",
"OvhOfferEnum",
"offer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/privateDatabase/availableOrderCapacities\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Get available order capacitie
REST: GET /hosting/privateDatabase/availableOrderCapacities
@param offer [required] Offer available order capacities to choose | [
"Get",
"available",
"order",
"capacitie"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java#L913-L919 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/TableLink.java | TableLink.getTableNames | public String getTableNames(boolean bAddQuotes, Map<String, Object> properties) {
"""
Get the SQL table names for this link.
@param bAddQuotes Add quotes to fields with spaces?
@param properties The database properties.
@return The SQL table string.
"""
String strString = "";
strString += th... | java | public String getTableNames(boolean bAddQuotes, Map<String, Object> properties)
{
String strString = "";
strString += this.getLeftRecord().getTableNames(bAddQuotes);
String strOn = "ON";
switch (m_JoinType)
{
case DBConstants.LEFT_INNER:
if (properties.get... | [
"public",
"String",
"getTableNames",
"(",
"boolean",
"bAddQuotes",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strString",
"=",
"\"\"",
";",
"strString",
"+=",
"this",
".",
"getLeftRecord",
"(",
")",
".",
"getTableNames"... | Get the SQL table names for this link.
@param bAddQuotes Add quotes to fields with spaces?
@param properties The database properties.
@return The SQL table string. | [
"Get",
"the",
"SQL",
"table",
"names",
"for",
"this",
"link",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/TableLink.java#L205-L237 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.scoreExamples | public INDArray scoreExamples(DataSetIterator iter, boolean addRegularizationTerms) {
"""
As per {@link #scoreExamples(DataSet, boolean)} - the outputs (example scores) for all DataSets in the iterator are concatenated
"""
List<INDArray> out = new ArrayList<>();
while (iter.hasNext()) {
... | java | public INDArray scoreExamples(DataSetIterator iter, boolean addRegularizationTerms) {
List<INDArray> out = new ArrayList<>();
while (iter.hasNext()) {
out.add(scoreExamples(iter.next(), addRegularizationTerms));
}
return Nd4j.toFlattened('f', out);
} | [
"public",
"INDArray",
"scoreExamples",
"(",
"DataSetIterator",
"iter",
",",
"boolean",
"addRegularizationTerms",
")",
"{",
"List",
"<",
"INDArray",
">",
"out",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")... | As per {@link #scoreExamples(DataSet, boolean)} - the outputs (example scores) for all DataSets in the iterator are concatenated | [
"As",
"per",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L2538-L2545 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java | DefaultMetadataService.deleteTrait | @Override
public void deleteTrait(String guid, String traitNameToBeDeleted) throws AtlasException {
"""
Deletes a given trait from an existing entity represented by a guid.
@param guid globally unique identifier for the entity
@param traitNameToBeDeleted name of the trait
@throws AtlasExce... | java | @Override
public void deleteTrait(String guid, String traitNameToBeDeleted) throws AtlasException {
guid = ParamChecker.notEmpty(guid, "entity id");
traitNameToBeDeleted = ParamChecker.notEmpty(traitNameToBeDeleted, "trait name");
// ensure trait type is already registered w... | [
"@",
"Override",
"public",
"void",
"deleteTrait",
"(",
"String",
"guid",
",",
"String",
"traitNameToBeDeleted",
")",
"throws",
"AtlasException",
"{",
"guid",
"=",
"ParamChecker",
".",
"notEmpty",
"(",
"guid",
",",
"\"entity id\"",
")",
";",
"traitNameToBeDeleted",... | Deletes a given trait from an existing entity represented by a guid.
@param guid globally unique identifier for the entity
@param traitNameToBeDeleted name of the trait
@throws AtlasException | [
"Deletes",
"a",
"given",
"trait",
"from",
"an",
"existing",
"entity",
"represented",
"by",
"a",
"guid",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java#L663-L679 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/filler/sharding/dml/ShardingOrPredicateFiller.java | ShardingOrPredicateFiller.buildCondition | public OrCondition buildCondition(final OrPredicateSegment sqlSegment, final SQLStatement sqlStatement) {
"""
Build condition.
@param sqlSegment SQL segment
@param sqlStatement SQL statement
@return or condition
"""
OrCondition result = createOrCondition(sqlSegment, sqlStatement);
createEn... | java | public OrCondition buildCondition(final OrPredicateSegment sqlSegment, final SQLStatement sqlStatement) {
OrCondition result = createOrCondition(sqlSegment, sqlStatement);
createEncryptOrPredicateFiller().fill(sqlSegment, sqlStatement);
return result;
} | [
"public",
"OrCondition",
"buildCondition",
"(",
"final",
"OrPredicateSegment",
"sqlSegment",
",",
"final",
"SQLStatement",
"sqlStatement",
")",
"{",
"OrCondition",
"result",
"=",
"createOrCondition",
"(",
"sqlSegment",
",",
"sqlStatement",
")",
";",
"createEncryptOrPred... | Build condition.
@param sqlSegment SQL segment
@param sqlStatement SQL statement
@return or condition | [
"Build",
"condition",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/filler/sharding/dml/ShardingOrPredicateFiller.java#L66-L70 |
SonarSource/sonarqube | server/sonar-db-core/src/main/java/org/sonar/db/DatabaseUtils.java | DatabaseUtils.executeLargeInputs | public static <OUTPUT, INPUT extends Comparable<INPUT>> List<OUTPUT> executeLargeInputs(Collection<INPUT> input, Function<List<INPUT>, List<OUTPUT>> function,
IntFunction<Integer> partitionSizeManipulations) {
"""
Partition by 1000 elements a list of input and execute a function on each part.
The goal is to... | java | public static <OUTPUT, INPUT extends Comparable<INPUT>> List<OUTPUT> executeLargeInputs(Collection<INPUT> input, Function<List<INPUT>, List<OUTPUT>> function,
IntFunction<Integer> partitionSizeManipulations) {
return executeLargeInputs(input, function, size -> size == 0 ? Collections.emptyList() : new ArrayList... | [
"public",
"static",
"<",
"OUTPUT",
",",
"INPUT",
"extends",
"Comparable",
"<",
"INPUT",
">",
">",
"List",
"<",
"OUTPUT",
">",
"executeLargeInputs",
"(",
"Collection",
"<",
"INPUT",
">",
"input",
",",
"Function",
"<",
"List",
"<",
"INPUT",
">",
",",
"List... | Partition by 1000 elements a list of input and execute a function on each part.
The goal is to prevent issue with ORACLE when there's more than 1000 elements in a 'in ('X', 'Y', ...)'
and with MsSQL when there's more than 2000 parameters in a query | [
"Partition",
"by",
"1000",
"elements",
"a",
"list",
"of",
"input",
"and",
"execute",
"a",
"function",
"on",
"each",
"part",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseUtils.java#L117-L120 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java | RecommendationsInner.listRecommendedRulesForWebAppWithServiceResponseAsync | public Observable<ServiceResponse<Page<RecommendationInner>>> listRecommendedRulesForWebAppWithServiceResponseAsync(final String resourceGroupName, final String siteName, final Boolean featured, final String filter) {
"""
Get all recommendations for an app.
Get all recommendations for an app.
@param resourceGr... | java | public Observable<ServiceResponse<Page<RecommendationInner>>> listRecommendedRulesForWebAppWithServiceResponseAsync(final String resourceGroupName, final String siteName, final Boolean featured, final String filter) {
return listRecommendedRulesForWebAppSinglePageAsync(resourceGroupName, siteName, featured, fil... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"RecommendationInner",
">",
">",
">",
"listRecommendedRulesForWebAppWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
",",
"final",
"Boolean",
"fe... | Get all recommendations for an app.
Get all recommendations for an app.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Name of the app.
@param featured Specify <code>true</code> to return only the most critical recommendations. The default is <code>... | [
"Get",
"all",
"recommendations",
"for",
"an",
"app",
".",
"Get",
"all",
"recommendations",
"for",
"an",
"app",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java#L961-L973 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassParameter.java | ClassParameter.instantiateClass | public C instantiateClass(Parameterization config) {
"""
Returns a new instance for the value (i.e., the class name) of this class
parameter. The instance has the type of the restriction class of this class
parameter.
<p>
If the Class for the class name is not found, the instantiation is tried
using the packa... | java | public C instantiateClass(Parameterization config) {
if(getValue() == null /* && !optionalParameter */) {
config.reportError(new UnspecifiedParameterException(this));
return null;
}
try {
config = config.descend(this);
return ClassGenericsUtil.tryInstantiate(restrictionClass, getValu... | [
"public",
"C",
"instantiateClass",
"(",
"Parameterization",
"config",
")",
"{",
"if",
"(",
"getValue",
"(",
")",
"==",
"null",
"/* && !optionalParameter */",
")",
"{",
"config",
".",
"reportError",
"(",
"new",
"UnspecifiedParameterException",
"(",
"this",
")",
"... | Returns a new instance for the value (i.e., the class name) of this class
parameter. The instance has the type of the restriction class of this class
parameter.
<p>
If the Class for the class name is not found, the instantiation is tried
using the package of the restriction class as package of the class name.
@param c... | [
"Returns",
"a",
"new",
"instance",
"for",
"the",
"value",
"(",
"i",
".",
"e",
".",
"the",
"class",
"name",
")",
"of",
"this",
"class",
"parameter",
".",
"The",
"instance",
"has",
"the",
"type",
"of",
"the",
"restriction",
"class",
"of",
"this",
"class"... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassParameter.java#L234-L247 |
google/j2objc | jre_emul/android/platform/libcore/json/src/main/java/org/json/JSONObject.java | JSONObject.put | public JSONObject put(String name, Object value) throws JSONException {
"""
Maps {@code name} to {@code value}, clobbering any existing name/value
mapping with the same name. If the value is {@code null}, any existing
mapping for {@code name} is removed.
@param value a {@link JSONObject}, {@link JSONArray}, S... | java | public JSONObject put(String name, Object value) throws JSONException {
if (value == null) {
nameValuePairs.remove(name);
return this;
}
if (value instanceof Number) {
// deviate from the original by checking all Numbers, not just floats & doubles
... | [
"public",
"JSONObject",
"put",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"nameValuePairs",
".",
"remove",
"(",
"name",
")",
";",
"return",
"this",
";",
"}",
"if",
"("... | Maps {@code name} to {@code value}, clobbering any existing name/value
mapping with the same name. If the value is {@code null}, any existing
mapping for {@code name} is removed.
@param value a {@link JSONObject}, {@link JSONArray}, String, Boolean,
Integer, Long, Double, {@link #NULL}, or {@code null}. May not be
{@l... | [
"Maps",
"{",
"@code",
"name",
"}",
"to",
"{",
"@code",
"value",
"}",
"clobbering",
"any",
"existing",
"name",
"/",
"value",
"mapping",
"with",
"the",
"same",
"name",
".",
"If",
"the",
"value",
"is",
"{",
"@code",
"null",
"}",
"any",
"existing",
"mappin... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/json/src/main/java/org/json/JSONObject.java#L255-L266 |
alkacon/opencms-core | src/org/opencms/search/documents/A_CmsVfsDocument.java | A_CmsVfsDocument.logContentExtraction | protected void logContentExtraction(CmsResource resource, I_CmsSearchIndex index) {
"""
Logs content extraction for the specified resource and index.<p>
@param resource the resource to log content extraction for
@param index the search index to log content extraction for
"""
if (LOG.isDebugEnabled... | java | protected void logContentExtraction(CmsResource resource, I_CmsSearchIndex index) {
if (LOG.isDebugEnabled()) {
LOG.debug(
Messages.get().getBundle().key(
Messages.LOG_EXTRACT_CONTENT_2,
resource.getRootPath(),
index.getNam... | [
"protected",
"void",
"logContentExtraction",
"(",
"CmsResource",
"resource",
",",
"I_CmsSearchIndex",
"index",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"Messages",
".",
"get",
"(",
")",
".",
"getBundl... | Logs content extraction for the specified resource and index.<p>
@param resource the resource to log content extraction for
@param index the search index to log content extraction for | [
"Logs",
"content",
"extraction",
"for",
"the",
"specified",
"resource",
"and",
"index",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/documents/A_CmsVfsDocument.java#L228-L237 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java | ClassBuilder.buildClassSignature | public void buildClassSignature(XMLNode node, Content classInfoTree) {
"""
Build the signature of the current class.
@param node the XML element that specifies which components to document
@param classInfoTree the content tree to which the documentation will be added
"""
writer.addClassSignature(ut... | java | public void buildClassSignature(XMLNode node, Content classInfoTree) {
writer.addClassSignature(utils.modifiersToString(typeElement, true), classInfoTree);
} | [
"public",
"void",
"buildClassSignature",
"(",
"XMLNode",
"node",
",",
"Content",
"classInfoTree",
")",
"{",
"writer",
".",
"addClassSignature",
"(",
"utils",
".",
"modifiersToString",
"(",
"typeElement",
",",
"true",
")",
",",
"classInfoTree",
")",
";",
"}"
] | Build the signature of the current class.
@param node the XML element that specifies which components to document
@param classInfoTree the content tree to which the documentation will be added | [
"Build",
"the",
"signature",
"of",
"the",
"current",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java#L299-L301 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/animation/transformation/Scale.java | Scale.to | protected Scale to(float x, float y, float z) {
"""
Sets the target scale.
@param x the x
@param y the y
@param z the z
@return the scale
"""
toX = x;
toY = y;
toZ = z;
return this;
} | java | protected Scale to(float x, float y, float z)
{
toX = x;
toY = y;
toZ = z;
return this;
} | [
"protected",
"Scale",
"to",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"toX",
"=",
"x",
";",
"toY",
"=",
"y",
";",
"toZ",
"=",
"z",
";",
"return",
"this",
";",
"}"
] | Sets the target scale.
@param x the x
@param y the y
@param z the z
@return the scale | [
"Sets",
"the",
"target",
"scale",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/animation/transformation/Scale.java#L105-L111 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/protocol/RedisStateMachine.java | RedisStateMachine.safeMulti | protected void safeMulti(CommandOutput<?, ?, ?> output, int count, RedisCommand<?, ?, ?> command) {
"""
Safely sets {@link CommandOutput#multi(int)}. Completes a command exceptionally in case an exception occurs.
@param output
@param count
@param command
"""
try {
output.multi(count);... | java | protected void safeMulti(CommandOutput<?, ?, ?> output, int count, RedisCommand<?, ?, ?> command) {
try {
output.multi(count);
} catch (Exception e) {
command.completeExceptionally(e);
}
} | [
"protected",
"void",
"safeMulti",
"(",
"CommandOutput",
"<",
"?",
",",
"?",
",",
"?",
">",
"output",
",",
"int",
"count",
",",
"RedisCommand",
"<",
"?",
",",
"?",
",",
"?",
">",
"command",
")",
"{",
"try",
"{",
"output",
".",
"multi",
"(",
"count",... | Safely sets {@link CommandOutput#multi(int)}. Completes a command exceptionally in case an exception occurs.
@param output
@param count
@param command | [
"Safely",
"sets",
"{",
"@link",
"CommandOutput#multi",
"(",
"int",
")",
"}",
".",
"Completes",
"a",
"command",
"exceptionally",
"in",
"case",
"an",
"exception",
"occurs",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/protocol/RedisStateMachine.java#L402-L409 |
beanshell/beanshell | src/main/java/bsh/ClassGenerator.java | ClassGenerator.generateClass | public Class<?> generateClass(String name, Modifiers modifiers, Class<?>[] interfaces, Class<?> superClass, BSHBlock block, Type type, CallStack callstack, Interpreter interpreter) throws EvalError {
"""
Parse the BSHBlock for the class definition and generate the class.
"""
// Delegate to the static m... | java | public Class<?> generateClass(String name, Modifiers modifiers, Class<?>[] interfaces, Class<?> superClass, BSHBlock block, Type type, CallStack callstack, Interpreter interpreter) throws EvalError {
// Delegate to the static method
return generateClassImpl(name, modifiers, interfaces, superClass, block... | [
"public",
"Class",
"<",
"?",
">",
"generateClass",
"(",
"String",
"name",
",",
"Modifiers",
"modifiers",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"interfaces",
",",
"Class",
"<",
"?",
">",
"superClass",
",",
"BSHBlock",
"block",
",",
"Type",
"type",
",",... | Parse the BSHBlock for the class definition and generate the class. | [
"Parse",
"the",
"BSHBlock",
"for",
"the",
"class",
"definition",
"and",
"generate",
"the",
"class",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/ClassGenerator.java#L53-L56 |
alrocar/POIProxy | es.alrocar.poiproxy/src/main/java/es/alrocar/poiproxy/proxy/POIProxy.java | POIProxy.getPOIs | public String getPOIs(String id, double minX, double minY, double maxX, double maxY, List<Param> optionalParams)
throws Exception {
"""
This method is used to get the pois from a service and return a GeoJSON
document with the data retrieved given a bounding box corners
@param id
The id of the service
@par... | java | public String getPOIs(String id, double minX, double minY, double maxX, double maxY, List<Param> optionalParams)
throws Exception {
DescribeService describeService = getDescribeServiceByID(id);
POIProxyEvent beforeEvent = new POIProxyEvent(POIProxyEventEnum.BeforeBrowseExtent, describeService,
new Extent(mi... | [
"public",
"String",
"getPOIs",
"(",
"String",
"id",
",",
"double",
"minX",
",",
"double",
"minY",
",",
"double",
"maxX",
",",
"double",
"maxY",
",",
"List",
"<",
"Param",
">",
"optionalParams",
")",
"throws",
"Exception",
"{",
"DescribeService",
"describeSer... | This method is used to get the pois from a service and return a GeoJSON
document with the data retrieved given a bounding box corners
@param id
The id of the service
@param minX
@param minY
@param maxX
@param maxY
@return The GeoJSON response from the original service response | [
"This",
"method",
"is",
"used",
"to",
"get",
"the",
"pois",
"from",
"a",
"service",
"and",
"return",
"a",
"GeoJSON",
"document",
"with",
"the",
"data",
"retrieved",
"given",
"a",
"bounding",
"box",
"corners"
] | train | https://github.com/alrocar/POIProxy/blob/e1dabe738a862478b2580e90d5fc4209a2997868/es.alrocar.poiproxy/src/main/java/es/alrocar/poiproxy/proxy/POIProxy.java#L430-L458 |
jenkinsci/jenkins | core/src/main/java/hudson/slaves/NodeDescriptor.java | NodeDescriptor.handleNewNodePage | public void handleNewNodePage(ComputerSet computerSet, String name, StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
"""
Handles the form submission from the "/computer/new" page, which is the first form for creating a new node.
By default, it shows the configuration page for enteri... | java | public void handleNewNodePage(ComputerSet computerSet, String name, StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
computerSet.checkName(name);
req.setAttribute("descriptor", this);
req.getView(computerSet,"_new.jelly").forward(req,rsp);
} | [
"public",
"void",
"handleNewNodePage",
"(",
"ComputerSet",
"computerSet",
",",
"String",
"name",
",",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"computerSet",
".",
"checkName",
"(",
"name",
... | Handles the form submission from the "/computer/new" page, which is the first form for creating a new node.
By default, it shows the configuration page for entering details, but subtypes can override this differently.
@param name
Name of the new node. | [
"Handles",
"the",
"form",
"submission",
"from",
"the",
"/",
"computer",
"/",
"new",
"page",
"which",
"is",
"the",
"first",
"form",
"for",
"creating",
"a",
"new",
"node",
".",
"By",
"default",
"it",
"shows",
"the",
"configuration",
"page",
"for",
"entering"... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/slaves/NodeDescriptor.java#L88-L92 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTransitionExtractor.java | MapTransitionExtractor.getTransitionTwoGroups | private static Transition getTransitionTwoGroups(Collection<String> neighborGroups) {
"""
Get the tile transition between two groups.
@param neighborGroups The neighbor groups (must contain two groups).
@return The tile transition.
"""
final Iterator<String> iterator = new HashSet<>(neighborGroups... | java | private static Transition getTransitionTwoGroups(Collection<String> neighborGroups)
{
final Iterator<String> iterator = new HashSet<>(neighborGroups).iterator();
final String groupIn = iterator.next();
final String groupOut = iterator.next();
final TransitionType type = getTrans... | [
"private",
"static",
"Transition",
"getTransitionTwoGroups",
"(",
"Collection",
"<",
"String",
">",
"neighborGroups",
")",
"{",
"final",
"Iterator",
"<",
"String",
">",
"iterator",
"=",
"new",
"HashSet",
"<>",
"(",
"neighborGroups",
")",
".",
"iterator",
"(",
... | Get the tile transition between two groups.
@param neighborGroups The neighbor groups (must contain two groups).
@return The tile transition. | [
"Get",
"the",
"tile",
"transition",
"between",
"two",
"groups",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTransitionExtractor.java#L56-L64 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.dropWhile | @NotNull
public IntStream dropWhile(@NotNull final IntPredicate predicate) {
"""
Drops elements while the predicate is true and returns the rest.
<p>This is an intermediate operation.
<p>Example:
<pre>
predicate: (a) -> a < 3
stream: [1, 2, 3, 4, 1, 2, 3, 4]
result: [3, 4, 1, 2, 3, 4]
</pre>
... | java | @NotNull
public IntStream dropWhile(@NotNull final IntPredicate predicate) {
return new IntStream(params, new IntDropWhile(iterator, predicate));
} | [
"@",
"NotNull",
"public",
"IntStream",
"dropWhile",
"(",
"@",
"NotNull",
"final",
"IntPredicate",
"predicate",
")",
"{",
"return",
"new",
"IntStream",
"(",
"params",
",",
"new",
"IntDropWhile",
"(",
"iterator",
",",
"predicate",
")",
")",
";",
"}"
] | Drops elements while the predicate is true and returns the rest.
<p>This is an intermediate operation.
<p>Example:
<pre>
predicate: (a) -> a < 3
stream: [1, 2, 3, 4, 1, 2, 3, 4]
result: [3, 4, 1, 2, 3, 4]
</pre>
@param predicate the predicate used to drop elements
@return the new {@code IntStream} | [
"Drops",
"elements",
"while",
"the",
"predicate",
"is",
"true",
"and",
"returns",
"the",
"rest",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L798-L801 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.moveToTrash | public static void moveToTrash(FileSystem fs, Path path) throws IOException {
"""
Moves the object to the filesystem trash according to the file system policy.
@param fs FileSystem object
@param path Path to the object to be moved to trash.
@throws IOException
"""
Trash trash = new Trash(fs, new Configu... | java | public static void moveToTrash(FileSystem fs, Path path) throws IOException {
Trash trash = new Trash(fs, new Configuration());
trash.moveToTrash(path);
} | [
"public",
"static",
"void",
"moveToTrash",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"Trash",
"trash",
"=",
"new",
"Trash",
"(",
"fs",
",",
"new",
"Configuration",
"(",
")",
")",
";",
"trash",
".",
"moveToTrash",
"(... | Moves the object to the filesystem trash according to the file system policy.
@param fs FileSystem object
@param path Path to the object to be moved to trash.
@throws IOException | [
"Moves",
"the",
"object",
"to",
"the",
"filesystem",
"trash",
"according",
"to",
"the",
"file",
"system",
"policy",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L211-L214 |
jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/PMContext.java | PMContext.getPair | public ContextPair getPair(String key) {
"""
Obtains a pair based on the given key. In there is no key, this method
returns null
@param key The key
@return the ContextPair for the given key.
"""
if (!this.contains(key)) {
return null;
}
return new ContextPair(key, get(k... | java | public ContextPair getPair(String key) {
if (!this.contains(key)) {
return null;
}
return new ContextPair(key, get(key));
} | [
"public",
"ContextPair",
"getPair",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"!",
"this",
".",
"contains",
"(",
"key",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"ContextPair",
"(",
"key",
",",
"get",
"(",
"key",
")",
")",
";",
... | Obtains a pair based on the given key. In there is no key, this method
returns null
@param key The key
@return the ContextPair for the given key. | [
"Obtains",
"a",
"pair",
"based",
"on",
"the",
"given",
"key",
".",
"In",
"there",
"is",
"no",
"key",
"this",
"method",
"returns",
"null"
] | train | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/PMContext.java#L333-L338 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getSessionTokenVerified | public SessionTokenInfo getSessionTokenVerified(String devideId, String stateToken, String otpToken, String allowedOrigin, Boolean doNotNotify) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Verify a one-time password (OTP) value provided for multi-factor authentication (MFA).
@par... | java | public SessionTokenInfo getSessionTokenVerified(String devideId, String stateToken, String otpToken, String allowedOrigin, Boolean doNotNotify) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_TOKE... | [
"public",
"SessionTokenInfo",
"getSessionTokenVerified",
"(",
"String",
"devideId",
",",
"String",
"stateToken",
",",
"String",
"otpToken",
",",
"String",
"allowedOrigin",
",",
"Boolean",
"doNotNotify",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
... | Verify a one-time password (OTP) value provided for multi-factor authentication (MFA).
@param devideId
Provide the MFA device_id you are submitting for verification.
@param stateToken
Provide the state_token associated with the MFA device_id you are submitting for verification.
@param otpToken
Provide the OTP value fo... | [
"Verify",
"a",
"one",
"-",
"time",
"password",
"(",
"OTP",
")",
"value",
"provided",
"for",
"multi",
"-",
"factor",
"authentication",
"(",
"MFA",
")",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L896-L938 |
geomajas/geomajas-project-client-gwt2 | common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java | StyleUtil.createRule | public static RuleInfo createRule(String title, String name, SymbolizerTypeInfo symbolizer) {
"""
Create a non-filtered rule with the specified title, name and symbolizer.
@param title the title
@param name the name
@param symbolizer the symbolizer
@return the rule
"""
RuleInfo rule = new RuleInfo();
... | java | public static RuleInfo createRule(String title, String name, SymbolizerTypeInfo symbolizer) {
RuleInfo rule = new RuleInfo();
rule.setTitle(title);
rule.setName(name);
rule.getSymbolizerList().add(symbolizer);
return rule;
} | [
"public",
"static",
"RuleInfo",
"createRule",
"(",
"String",
"title",
",",
"String",
"name",
",",
"SymbolizerTypeInfo",
"symbolizer",
")",
"{",
"RuleInfo",
"rule",
"=",
"new",
"RuleInfo",
"(",
")",
";",
"rule",
".",
"setTitle",
"(",
"title",
")",
";",
"rul... | Create a non-filtered rule with the specified title, name and symbolizer.
@param title the title
@param name the name
@param symbolizer the symbolizer
@return the rule | [
"Create",
"a",
"non",
"-",
"filtered",
"rule",
"with",
"the",
"specified",
"title",
"name",
"and",
"symbolizer",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L134-L140 |
craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addDirectory | public void addDirectory( final String path, final Directive directive) throws NoSuchAlgorithmException, IOException {
"""
Adds the directory to the repository with the default mode of <code>644</code>.
@param path the absolute path to add as a directory.
@param directive directive indicating special handling ... | java | public void addDirectory( final String path, final Directive directive) throws NoSuchAlgorithmException, IOException {
contents.addDirectory( path, directive);
} | [
"public",
"void",
"addDirectory",
"(",
"final",
"String",
"path",
",",
"final",
"Directive",
"directive",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"contents",
".",
"addDirectory",
"(",
"path",
",",
"directive",
")",
";",
"}"
] | Adds the directory to the repository with the default mode of <code>644</code>.
@param path the absolute path to add as a directory.
@param directive directive indicating special handling for this file.
@throws NoSuchAlgorithmException the algorithm isn't supported
@throws IOException there was an IO error | [
"Adds",
"the",
"directory",
"to",
"the",
"repository",
"with",
"the",
"default",
"mode",
"of",
"<code",
">",
"644<",
"/",
"code",
">",
"."
] | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L1122-L1124 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addCustomPrebuiltEntity | public UUID addCustomPrebuiltEntity(UUID appId, String versionId, PrebuiltDomainModelCreateObject prebuiltDomainModelCreateObject) {
"""
Adds a custom prebuilt entity model to the application.
@param appId The application ID.
@param versionId The version ID.
@param prebuiltDomainModelCreateObject A model obje... | java | public UUID addCustomPrebuiltEntity(UUID appId, String versionId, PrebuiltDomainModelCreateObject prebuiltDomainModelCreateObject) {
return addCustomPrebuiltEntityWithServiceResponseAsync(appId, versionId, prebuiltDomainModelCreateObject).toBlocking().single().body();
} | [
"public",
"UUID",
"addCustomPrebuiltEntity",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"PrebuiltDomainModelCreateObject",
"prebuiltDomainModelCreateObject",
")",
"{",
"return",
"addCustomPrebuiltEntityWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
","... | Adds a custom prebuilt entity model to the application.
@param appId The application ID.
@param versionId The version ID.
@param prebuiltDomainModelCreateObject A model object containing the name of the custom prebuilt entity and the name of the domain to which this model belongs.
@throws IllegalArgumentException thro... | [
"Adds",
"a",
"custom",
"prebuilt",
"entity",
"model",
"to",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L5889-L5891 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java | FeaturesImpl.listPhraseLists | public List<PhraseListFeatureInfo> listPhraseLists(UUID appId, String versionId, ListPhraseListsOptionalParameter listPhraseListsOptionalParameter) {
"""
Gets all the phraselist features.
@param appId The application ID.
@param versionId The version ID.
@param listPhraseListsOptionalParameter the object repre... | java | public List<PhraseListFeatureInfo> listPhraseLists(UUID appId, String versionId, ListPhraseListsOptionalParameter listPhraseListsOptionalParameter) {
return listPhraseListsWithServiceResponseAsync(appId, versionId, listPhraseListsOptionalParameter).toBlocking().single().body();
} | [
"public",
"List",
"<",
"PhraseListFeatureInfo",
">",
"listPhraseLists",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ListPhraseListsOptionalParameter",
"listPhraseListsOptionalParameter",
")",
"{",
"return",
"listPhraseListsWithServiceResponseAsync",
"(",
"appId",
... | Gets all the phraselist features.
@param appId The application ID.
@param versionId The version ID.
@param listPhraseListsOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseEx... | [
"Gets",
"all",
"the",
"phraselist",
"features",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java#L201-L203 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/EntityFieldAnnotationRule.java | EntityFieldAnnotationRule.validateGeneratedValueAnnotation | private void validateGeneratedValueAnnotation(final Class<?> clazz, Field field) {
"""
validate generated value annotation if given.
@param clazz
@param field
@throws RuleValidationException
"""
Table table = clazz.getAnnotation(Table.class);
// Still we need to validate for this after po... | java | private void validateGeneratedValueAnnotation(final Class<?> clazz, Field field)
{
Table table = clazz.getAnnotation(Table.class);
// Still we need to validate for this after post metadata
// population.
if (table != null)
{
String schemaName = table.schema();
... | [
"private",
"void",
"validateGeneratedValueAnnotation",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"Field",
"field",
")",
"{",
"Table",
"table",
"=",
"clazz",
".",
"getAnnotation",
"(",
"Table",
".",
"class",
")",
";",
"// Still we need to validate for t... | validate generated value annotation if given.
@param clazz
@param field
@throws RuleValidationException | [
"validate",
"generated",
"value",
"annotation",
"if",
"given",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/EntityFieldAnnotationRule.java#L205-L237 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/config/resilience/DefaultResilienceStrategyProviderConfiguration.java | DefaultResilienceStrategyProviderConfiguration.setDefaultLoaderWriterResilienceStrategy | @SuppressWarnings("rawtypes")
public DefaultResilienceStrategyProviderConfiguration setDefaultLoaderWriterResilienceStrategy(Class<? extends ResilienceStrategy> clazz, Object... arguments) {
"""
Sets the default {@link ResilienceStrategy} class and associated constructor arguments to be used for caches with
a l... | java | @SuppressWarnings("rawtypes")
public DefaultResilienceStrategyProviderConfiguration setDefaultLoaderWriterResilienceStrategy(Class<? extends ResilienceStrategy> clazz, Object... arguments) {
this.defaultLoaderWriterConfiguration = new DefaultResilienceStrategyConfiguration(clazz, arguments);
return this;
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"DefaultResilienceStrategyProviderConfiguration",
"setDefaultLoaderWriterResilienceStrategy",
"(",
"Class",
"<",
"?",
"extends",
"ResilienceStrategy",
">",
"clazz",
",",
"Object",
"...",
"arguments",
")",
"{",
"... | Sets the default {@link ResilienceStrategy} class and associated constructor arguments to be used for caches with
a loader writer.
<p>
The provided class must have a constructor compatible with the supplied arguments followed by the cache's
{@code RecoveryStore} and {@code CacheLoaderWriter}.
@param clazz the resilien... | [
"Sets",
"the",
"default",
"{",
"@link",
"ResilienceStrategy",
"}",
"class",
"and",
"associated",
"constructor",
"arguments",
"to",
"be",
"used",
"for",
"caches",
"with",
"a",
"loader",
"writer",
".",
"<p",
">",
"The",
"provided",
"class",
"must",
"have",
"a"... | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/config/resilience/DefaultResilienceStrategyProviderConfiguration.java#L108-L112 |
javactic/javactic | src/main/java/com/github/javactic/futures/ExecutionContext.java | ExecutionContext.zip3 | public <A, B, C, ERR> OrFuture<Tuple3<A, B, C>, Every<ERR>>
zip3(OrFuture<? extends A, ? extends Every<? extends ERR>> a,
OrFuture<? extends B, ? extends Every<? extends ERR>> b,
OrFuture<? extends C, ? extends Every<? extends ERR>> c) {
"""
Zips three accumulating OrFutures together. If all comple... | java | public <A, B, C, ERR> OrFuture<Tuple3<A, B, C>, Every<ERR>>
zip3(OrFuture<? extends A, ? extends Every<? extends ERR>> a,
OrFuture<? extends B, ? extends Every<? extends ERR>> b,
OrFuture<? extends C, ? extends Every<? extends ERR>> c) {
return withGood(a, b, c, Tuple::of);
} | [
"public",
"<",
"A",
",",
"B",
",",
"C",
",",
"ERR",
">",
"OrFuture",
"<",
"Tuple3",
"<",
"A",
",",
"B",
",",
"C",
">",
",",
"Every",
"<",
"ERR",
">",
">",
"zip3",
"(",
"OrFuture",
"<",
"?",
"extends",
"A",
",",
"?",
"extends",
"Every",
"<",
... | Zips three accumulating OrFutures together. If all complete with Goods, returns an OrFuture
that completes with a Good tuple containing all original Good values. Otherwise returns an
OrFuture that completes with a Bad containing every error message.
@param <A> the success type
@param <B> the success type
@param <C... | [
"Zips",
"three",
"accumulating",
"OrFutures",
"together",
".",
"If",
"all",
"complete",
"with",
"Goods",
"returns",
"an",
"OrFuture",
"that",
"completes",
"with",
"a",
"Good",
"tuple",
"containing",
"all",
"original",
"Good",
"values",
".",
"Otherwise",
"returns... | train | https://github.com/javactic/javactic/blob/dfa040062178c259c3067fd9b59cb4498022d8bc/src/main/java/com/github/javactic/futures/ExecutionContext.java#L536-L541 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/index/IndexElasticsearchUpdater.java | IndexElasticsearchUpdater.isIndexExist | public static boolean isIndexExist(RestClient client, String index) throws Exception {
"""
Check if an index already exists
@param client Elasticsearch client
@param index Index name
@return true if index already exists
@throws Exception if the elasticsearch API call is failing
"""
Response response = cl... | java | public static boolean isIndexExist(RestClient client, String index) throws Exception {
Response response = client.performRequest(new Request("HEAD", "/" + index));
return response.getStatusLine().getStatusCode() == 200;
} | [
"public",
"static",
"boolean",
"isIndexExist",
"(",
"RestClient",
"client",
",",
"String",
"index",
")",
"throws",
"Exception",
"{",
"Response",
"response",
"=",
"client",
".",
"performRequest",
"(",
"new",
"Request",
"(",
"\"HEAD\"",
",",
"\"/\"",
"+",
"index... | Check if an index already exists
@param client Elasticsearch client
@param index Index name
@return true if index already exists
@throws Exception if the elasticsearch API call is failing | [
"Check",
"if",
"an",
"index",
"already",
"exists"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/index/IndexElasticsearchUpdater.java#L331-L334 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchParameters.java | CmsSearchParameters.toSeparatedString | private String toSeparatedString(List<String> stringList, char separator) {
"""
Concatenates the elements of the string list separated by the given separator character.<p>
@param stringList the list
@param separator the separator
@return the concatenated string
"""
StringBuffer result = new Str... | java | private String toSeparatedString(List<String> stringList, char separator) {
StringBuffer result = new StringBuffer();
Iterator<String> it = stringList.iterator();
while (it.hasNext()) {
result.append(it.next());
if (it.hasNext()) {
result.append(separator... | [
"private",
"String",
"toSeparatedString",
"(",
"List",
"<",
"String",
">",
"stringList",
",",
"char",
"separator",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"Iterator",
"<",
"String",
">",
"it",
"=",
"stringList",
".",
... | Concatenates the elements of the string list separated by the given separator character.<p>
@param stringList the list
@param separator the separator
@return the concatenated string | [
"Concatenates",
"the",
"elements",
"of",
"the",
"string",
"list",
"separated",
"by",
"the",
"given",
"separator",
"character",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchParameters.java#L1264-L1275 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsInner.java | StorageAccountsInner.getAsync | public Observable<StorageAccountInformationInner> getAsync(String resourceGroupName, String accountName, String storageAccountName) {
"""
Gets the specified Azure Storage account linked to the given Data Lake Analytics account.
@param resourceGroupName The name of the Azure resource group.
@param accountName T... | java | public Observable<StorageAccountInformationInner> getAsync(String resourceGroupName, String accountName, String storageAccountName) {
return getWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).map(new Func1<ServiceResponse<StorageAccountInformationInner>, StorageAccountInformationInn... | [
"public",
"Observable",
"<",
"StorageAccountInformationInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"storageAccountName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accoun... | Gets the specified Azure Storage account linked to the given Data Lake Analytics account.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Analytics account.
@param storageAccountName The name of the Azure Storage account for which to retrieve the details.
@th... | [
"Gets",
"the",
"specified",
"Azure",
"Storage",
"account",
"linked",
"to",
"the",
"given",
"Data",
"Lake",
"Analytics",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsInner.java#L527-L534 |
Netflix/ribbon | ribbon/src/main/java/com/netflix/ribbon/Ribbon.java | Ribbon.createHttpResourceGroup | public static HttpResourceGroup createHttpResourceGroup(String name, ClientOptions options) {
"""
Create the {@link com.netflix.ribbon.http.HttpResourceGroup} with a name.
@param name name of the resource group, as well as the transport client
@param options Options to override the client configuration created... | java | public static HttpResourceGroup createHttpResourceGroup(String name, ClientOptions options) {
return factory.createHttpResourceGroup(name, options);
} | [
"public",
"static",
"HttpResourceGroup",
"createHttpResourceGroup",
"(",
"String",
"name",
",",
"ClientOptions",
"options",
")",
"{",
"return",
"factory",
".",
"createHttpResourceGroup",
"(",
"name",
",",
"options",
")",
";",
"}"
] | Create the {@link com.netflix.ribbon.http.HttpResourceGroup} with a name.
@param name name of the resource group, as well as the transport client
@param options Options to override the client configuration created | [
"Create",
"the",
"{",
"@link",
"com",
".",
"netflix",
".",
"ribbon",
".",
"http",
".",
"HttpResourceGroup",
"}",
"with",
"a",
"name",
"."
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon/src/main/java/com/netflix/ribbon/Ribbon.java#L62-L64 |
dadoonet/spring-elasticsearch | src/main/java/fr/pilato/spring/elasticsearch/type/TypeElasticsearchUpdater.java | TypeElasticsearchUpdater.createMapping | public static void createMapping(RestHighLevelClient client, String root, String index, boolean merge)
throws Exception {
"""
Create a new type in Elasticsearch
@param client Elasticsearch client
@param root dir within the classpath
@param index Index name
@param merge Try to merge mapping if type ... | java | public static void createMapping(RestHighLevelClient client, String root, String index, boolean merge)
throws Exception {
String mapping = TypeSettingsReader.readMapping(root, index);
if (mapping != null) {
createMappingWithJson(client, index, mapping, merge);
}
} | [
"public",
"static",
"void",
"createMapping",
"(",
"RestHighLevelClient",
"client",
",",
"String",
"root",
",",
"String",
"index",
",",
"boolean",
"merge",
")",
"throws",
"Exception",
"{",
"String",
"mapping",
"=",
"TypeSettingsReader",
".",
"readMapping",
"(",
"... | Create a new type in Elasticsearch
@param client Elasticsearch client
@param root dir within the classpath
@param index Index name
@param merge Try to merge mapping if type already exists
@throws Exception if the elasticsearch call is failing | [
"Create",
"a",
"new",
"type",
"in",
"Elasticsearch"
] | train | https://github.com/dadoonet/spring-elasticsearch/blob/b338223818a5bdf5d9c06c88cb98589c843fd293/src/main/java/fr/pilato/spring/elasticsearch/type/TypeElasticsearchUpdater.java#L48-L54 |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java | EntityREST.getClassification | @GET
@Path("/guid/ {
"""
Gets the list of classifications for a given entity represented by a guid.
@param guid globally unique identifier for the entity
@return classification for the given entity guid
"""guid}/classification/{classificationName}")
@Produces(Servlets.JSON_MEDIA_TYPE)
public Atla... | java | @GET
@Path("/guid/{guid}/classification/{classificationName}")
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasClassification getClassification(@PathParam("guid") String guid, @PathParam("classificationName") final String classificationName) throws AtlasBaseException {
AtlasPerfTracer perf = null;
... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/guid/{guid}/classification/{classificationName}\"",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"AtlasClassification",
"getClassification",
"(",
"@",
"PathParam",
"(",
"\"guid\"",
")",
"String",
"guid... | Gets the list of classifications for a given entity represented by a guid.
@param guid globally unique identifier for the entity
@return classification for the given entity guid | [
"Gets",
"the",
"list",
"of",
"classifications",
"for",
"a",
"given",
"entity",
"represented",
"by",
"a",
"guid",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java#L276-L296 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPPAbstractTimephasedWorkNormaliser.java | MPPAbstractTimephasedWorkNormaliser.normalise | @Override public void normalise(ProjectCalendar calendar, LinkedList<TimephasedWork> list) {
"""
This method converts the internal representation of timephased
resource assignment data used by MS Project into a standardised
format to make it easy to work with.
@param calendar current calendar
@param list lis... | java | @Override public void normalise(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
{
if (!list.isEmpty())
{
//dumpList(list);
splitDays(calendar, list);
//dumpList(list);
mergeSameDay(calendar, list);
//dumpList(list);
mergeSameWork(list);
... | [
"@",
"Override",
"public",
"void",
"normalise",
"(",
"ProjectCalendar",
"calendar",
",",
"LinkedList",
"<",
"TimephasedWork",
">",
"list",
")",
"{",
"if",
"(",
"!",
"list",
".",
"isEmpty",
"(",
")",
")",
"{",
"//dumpList(list);",
"splitDays",
"(",
"calendar"... | This method converts the internal representation of timephased
resource assignment data used by MS Project into a standardised
format to make it easy to work with.
@param calendar current calendar
@param list list of assignment data | [
"This",
"method",
"converts",
"the",
"internal",
"representation",
"of",
"timephased",
"resource",
"assignment",
"data",
"used",
"by",
"MS",
"Project",
"into",
"a",
"standardised",
"format",
"to",
"make",
"it",
"easy",
"to",
"work",
"with",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPAbstractTimephasedWorkNormaliser.java#L50-L64 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ExponentiallyModifiedGaussianDistribution.java | ExponentiallyModifiedGaussianDistribution.logpdf | public static double logpdf(double x, double mu, double sigma, double lambda) {
"""
Probability density function of the ExGaussian distribution.
@param x The value.
@param mu The mean.
@param sigma The standard deviation.
@param lambda Rate parameter.
@return PDF of the given exgauss distribution at x.
... | java | public static double logpdf(double x, double mu, double sigma, double lambda) {
final double dx = x - mu;
final double lss = lambda * sigma * sigma;
final double erfc = NormalDistribution.erfc((lss - dx) / (sigma * MathUtil.SQRT2));
return erfc > 0 ? FastMath.log(.5 * lambda * erfc) + lambda * (lss * .5... | [
"public",
"static",
"double",
"logpdf",
"(",
"double",
"x",
",",
"double",
"mu",
",",
"double",
"sigma",
",",
"double",
"lambda",
")",
"{",
"final",
"double",
"dx",
"=",
"x",
"-",
"mu",
";",
"final",
"double",
"lss",
"=",
"lambda",
"*",
"sigma",
"*",... | Probability density function of the ExGaussian distribution.
@param x The value.
@param mu The mean.
@param sigma The standard deviation.
@param lambda Rate parameter.
@return PDF of the given exgauss distribution at x. | [
"Probability",
"density",
"function",
"of",
"the",
"ExGaussian",
"distribution",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ExponentiallyModifiedGaussianDistribution.java#L185-L190 |
zamrokk/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/shim/Handler.java | Handler.enterTransactionState | public void enterTransactionState(Event event) {
"""
enterTransactionState will execute chaincode's Run if coming from a TRANSACTION event.
"""
ChaincodeMessage message = messageHelper(event);
logger.debug(String.format("[%s]Received %s, invoking transaction on chaincode(src:%s, dst:%s)",
shortID(messa... | java | public void enterTransactionState(Event event) {
ChaincodeMessage message = messageHelper(event);
logger.debug(String.format("[%s]Received %s, invoking transaction on chaincode(src:%s, dst:%s)",
shortID(message), message.getType().toString(), event.src, event.dst));
if (message.getType() == TRANSACTION) {
... | [
"public",
"void",
"enterTransactionState",
"(",
"Event",
"event",
")",
"{",
"ChaincodeMessage",
"message",
"=",
"messageHelper",
"(",
"event",
")",
";",
"logger",
".",
"debug",
"(",
"String",
".",
"format",
"(",
"\"[%s]Received %s, invoking transaction on chaincode(sr... | enterTransactionState will execute chaincode's Run if coming from a TRANSACTION event. | [
"enterTransactionState",
"will",
"execute",
"chaincode",
"s",
"Run",
"if",
"coming",
"from",
"a",
"TRANSACTION",
"event",
"."
] | train | https://github.com/zamrokk/fabric-sdk-java/blob/d4993ca602f72d412cd682e1b92e805e48b27afa/src/main/java/org/hyperledger/fabric/sdk/shim/Handler.java#L414-L422 |
jfinal/jfinal | src/main/java/com/jfinal/core/Controller.java | Controller.getParaToBoolean | public Boolean getParaToBoolean(String name, Boolean defaultValue) {
"""
Returns the value of a request parameter and convert to Boolean with a default value if it is null.
@param name a String specifying the name of the parameter
@return true if the value of the parameter is "true" or "1", false if it is "false... | java | public Boolean getParaToBoolean(String name, Boolean defaultValue) {
return toBoolean(request.getParameter(name), defaultValue);
} | [
"public",
"Boolean",
"getParaToBoolean",
"(",
"String",
"name",
",",
"Boolean",
"defaultValue",
")",
"{",
"return",
"toBoolean",
"(",
"request",
".",
"getParameter",
"(",
"name",
")",
",",
"defaultValue",
")",
";",
"}"
] | Returns the value of a request parameter and convert to Boolean with a default value if it is null.
@param name a String specifying the name of the parameter
@return true if the value of the parameter is "true" or "1", false if it is "false" or "0", default value if it is null | [
"Returns",
"the",
"value",
"of",
"a",
"request",
"parameter",
"and",
"convert",
"to",
"Boolean",
"with",
"a",
"default",
"value",
"if",
"it",
"is",
"null",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/core/Controller.java#L380-L382 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxCollection.java | BoxCollection.getAllCollections | public static Iterable<BoxCollection.Info> getAllCollections(final BoxAPIConnection api) {
"""
Gets an iterable of all the collections for the given user.
@param api the API connection to be used when retrieving the collections.
@return an iterable containing info about all the collections.
"""
... | java | public static Iterable<BoxCollection.Info> getAllCollections(final BoxAPIConnection api) {
return new Iterable<BoxCollection.Info>() {
public Iterator<BoxCollection.Info> iterator() {
URL url = GET_COLLECTIONS_URL_TEMPLATE.build(api.getBaseURL());
return new BoxCollec... | [
"public",
"static",
"Iterable",
"<",
"BoxCollection",
".",
"Info",
">",
"getAllCollections",
"(",
"final",
"BoxAPIConnection",
"api",
")",
"{",
"return",
"new",
"Iterable",
"<",
"BoxCollection",
".",
"Info",
">",
"(",
")",
"{",
"public",
"Iterator",
"<",
"Bo... | Gets an iterable of all the collections for the given user.
@param api the API connection to be used when retrieving the collections.
@return an iterable containing info about all the collections. | [
"Gets",
"an",
"iterable",
"of",
"all",
"the",
"collections",
"for",
"the",
"given",
"user",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxCollection.java#L44-L51 |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java | MessageProcessor.createMessage | protected Message createMessage(ConnectionContext context, BasicMessage basicMessage) throws JMSException {
"""
Same as {@link #createMessage(ConnectionContext, BasicMessage, Map)} with <code>null</code> headers.
"""
return createMessage(context, basicMessage, null);
} | java | protected Message createMessage(ConnectionContext context, BasicMessage basicMessage) throws JMSException {
return createMessage(context, basicMessage, null);
} | [
"protected",
"Message",
"createMessage",
"(",
"ConnectionContext",
"context",
",",
"BasicMessage",
"basicMessage",
")",
"throws",
"JMSException",
"{",
"return",
"createMessage",
"(",
"context",
",",
"basicMessage",
",",
"null",
")",
";",
"}"
] | Same as {@link #createMessage(ConnectionContext, BasicMessage, Map)} with <code>null</code> headers. | [
"Same",
"as",
"{"
] | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java#L344-L346 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/concurrent/atomicreference/AtomicReferenceContainerCollector.java | AtomicReferenceContainerCollector.onIteration | @Override
protected void onIteration(String containerName, AtomicReferenceContainer container) {
"""
The {@link AtomicLongContainer} doesn't know its name or configuration, so we create these lookup maps.
This is cheaper than storing this information permanently in the container.
"""
AtomicReferen... | java | @Override
protected void onIteration(String containerName, AtomicReferenceContainer container) {
AtomicReferenceConfig atomicReferenceConfig = config.findAtomicReferenceConfig(containerName);
containerNames.put(container, containerName);
containerPolicies.put(container, atomicReferenceConfi... | [
"@",
"Override",
"protected",
"void",
"onIteration",
"(",
"String",
"containerName",
",",
"AtomicReferenceContainer",
"container",
")",
"{",
"AtomicReferenceConfig",
"atomicReferenceConfig",
"=",
"config",
".",
"findAtomicReferenceConfig",
"(",
"containerName",
")",
";",
... | The {@link AtomicLongContainer} doesn't know its name or configuration, so we create these lookup maps.
This is cheaper than storing this information permanently in the container. | [
"The",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/concurrent/atomicreference/AtomicReferenceContainerCollector.java#L48-L54 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/rest/auth/TokenRESTService.java | TokenRESTService.getCredentials | private Credentials getCredentials(HttpServletRequest request,
String username, String password) {
"""
Returns the credentials associated with the given request, using the
provided username and password.
@param request
The request to use to derive the credentials.
@param username
The username ... | java | private Credentials getCredentials(HttpServletRequest request,
String username, String password) {
// If no username/password given, try Authorization header
if (username == null && password == null) {
String authorization = request.getHeader("Authorization");
if (a... | [
"private",
"Credentials",
"getCredentials",
"(",
"HttpServletRequest",
"request",
",",
"String",
"username",
",",
"String",
"password",
")",
"{",
"// If no username/password given, try Authorization header",
"if",
"(",
"username",
"==",
"null",
"&&",
"password",
"==",
"... | Returns the credentials associated with the given request, using the
provided username and password.
@param request
The request to use to derive the credentials.
@param username
The username to associate with the credentials, or null if the
username should be derived from the request.
@param password
The password to... | [
"Returns",
"the",
"credentials",
"associated",
"with",
"the",
"given",
"request",
"using",
"the",
"provided",
"username",
"and",
"password",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/rest/auth/TokenRESTService.java#L84-L123 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/internal/crypto/ContentCryptoScheme.java | ContentCryptoScheme.createCipherLite | CipherLite createCipherLite(SecretKey cek, byte[] iv, int cipherMode,
Provider securityProvider) {
"""
Creates and initializes a {@link CipherLite} for content
encrypt/decryption.
@param cek
content encrypting key
@param iv
initialization vector
@param cipherMode
such as {@link Cipher#ENCRYPT_... | java | CipherLite createCipherLite(SecretKey cek, byte[] iv, int cipherMode,
Provider securityProvider) {
String specificProvider = getSpecificCipherProvider();
Cipher cipher;
try {
if (specificProvider != null) { // use the specific provider if defined
ciphe... | [
"CipherLite",
"createCipherLite",
"(",
"SecretKey",
"cek",
",",
"byte",
"[",
"]",
"iv",
",",
"int",
"cipherMode",
",",
"Provider",
"securityProvider",
")",
"{",
"String",
"specificProvider",
"=",
"getSpecificCipherProvider",
"(",
")",
";",
"Cipher",
"cipher",
";... | Creates and initializes a {@link CipherLite} for content
encrypt/decryption.
@param cek
content encrypting key
@param iv
initialization vector
@param cipherMode
such as {@link Cipher#ENCRYPT_MODE}
@param securityProvider
optional security provider to be used but only if there is no
specific provider defined for the sp... | [
"Creates",
"and",
"initializes",
"a",
"{",
"@link",
"CipherLite",
"}",
"for",
"content",
"encrypt",
"/",
"decryption",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/internal/crypto/ContentCryptoScheme.java#L175-L199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.