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 |
|---|---|---|---|---|---|---|---|---|---|---|
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hash/MurmurHash3Adaptor.java | MurmurHash3Adaptor.hashToBytes | public static byte[] hashToBytes(final double datum, final long seed) {
"""
Hash a double and long seed.
@param datum the input double
@param seed A long valued seed.
@return The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs.
"""
final double d = (datum == 0.0) ? 0.0 : datum; //ca... | java | public static byte[] hashToBytes(final double datum, final long seed) {
final double d = (datum == 0.0) ? 0.0 : datum; //canonicalize -0.0, 0.0
final long[] data = { Double.doubleToLongBits(d) }; //canonicalize all NaN forms
return toByteArray(hash(data, seed));
} | [
"public",
"static",
"byte",
"[",
"]",
"hashToBytes",
"(",
"final",
"double",
"datum",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"double",
"d",
"=",
"(",
"datum",
"==",
"0.0",
")",
"?",
"0.0",
":",
"datum",
";",
"//canonicalize -0.0, 0.0",
"final",... | Hash a double and long seed.
@param datum the input double
@param seed A long valued seed.
@return The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs. | [
"Hash",
"a",
"double",
"and",
"long",
"seed",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hash/MurmurHash3Adaptor.java#L112-L116 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.forEachChar | public static void forEachChar(String string, CharProcedure procedure) {
"""
For each char in the {@code string}, execute the {@link CharProcedure}.
@since 7.0
"""
int size = string.length();
for (int i = 0; i < size; i++)
{
procedure.value(string.charAt(i));
}
... | java | public static void forEachChar(String string, CharProcedure procedure)
{
int size = string.length();
for (int i = 0; i < size; i++)
{
procedure.value(string.charAt(i));
}
} | [
"public",
"static",
"void",
"forEachChar",
"(",
"String",
"string",
",",
"CharProcedure",
"procedure",
")",
"{",
"int",
"size",
"=",
"string",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")... | For each char in the {@code string}, execute the {@link CharProcedure}.
@since 7.0 | [
"For",
"each",
"char",
"in",
"the",
"{",
"@code",
"string",
"}",
"execute",
"the",
"{",
"@link",
"CharProcedure",
"}",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L360-L367 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/random/RandomDateTime.java | RandomDateTime.updateDateTime | public static ZonedDateTime updateDateTime(ZonedDateTime value, float range) {
"""
Updates (drifts) a ZonedDateTime value within specified range defined
@param value a ZonedDateTime value to drift.
@param range (optional) a range in milliseconds. Default: 10 days
@return an updated ZonedDateTime and time valu... | java | public static ZonedDateTime updateDateTime(ZonedDateTime value, float range) {
range = range != 0 ? range : 10;
if (range < 0)
return value;
float days = RandomFloat.nextFloat(-range, range);
return value.plusDays((int) days);
} | [
"public",
"static",
"ZonedDateTime",
"updateDateTime",
"(",
"ZonedDateTime",
"value",
",",
"float",
"range",
")",
"{",
"range",
"=",
"range",
"!=",
"0",
"?",
"range",
":",
"10",
";",
"if",
"(",
"range",
"<",
"0",
")",
"return",
"value",
";",
"float",
"... | Updates (drifts) a ZonedDateTime value within specified range defined
@param value a ZonedDateTime value to drift.
@param range (optional) a range in milliseconds. Default: 10 days
@return an updated ZonedDateTime and time value. | [
"Updates",
"(",
"drifts",
")",
"a",
"ZonedDateTime",
"value",
"within",
"specified",
"range",
"defined"
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/random/RandomDateTime.java#L94-L101 |
maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/TooltipHelper.java | TooltipHelper.setup | public static void setup(View view) {
"""
Sets up a cheat sheet (tooltip) for the given view by setting its {@link android.view.View.OnLongClickListener}.
When the view is long-pressed, a {@link Toast} with the view's {@link android.view.View#getContentDescription()
content description} will be shown either abov... | java | public static void setup(View view) {
view.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
return showCheatSheet(view, view.getContentDescription());
}
});
} | [
"public",
"static",
"void",
"setup",
"(",
"View",
"view",
")",
"{",
"view",
".",
"setOnLongClickListener",
"(",
"new",
"View",
".",
"OnLongClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onLongClick",
"(",
"View",
"view",
")",
"{",
"r... | Sets up a cheat sheet (tooltip) for the given view by setting its {@link android.view.View.OnLongClickListener}.
When the view is long-pressed, a {@link Toast} with the view's {@link android.view.View#getContentDescription()
content description} will be shown either above (default) or below the view (if there isn't roo... | [
"Sets",
"up",
"a",
"cheat",
"sheet",
"(",
"tooltip",
")",
"for",
"the",
"given",
"view",
"by",
"setting",
"its",
"{",
"@link",
"android",
".",
"view",
".",
"View",
".",
"OnLongClickListener",
"}",
".",
"When",
"the",
"view",
"is",
"long",
"-",
"pressed... | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/TooltipHelper.java#L35-L43 |
bbottema/outlook-message-parser | src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java | OutlookMessageParser.checkDirectoryEntry | private void checkDirectoryEntry(final DirectoryEntry dir, final OutlookMessage msg)
throws IOException {
"""
Recursively parses the complete .msg file with the help of the POI library. The parsed information is put into the {@link OutlookMessage} object.
@param dir The current node in the .msg file.
@param... | java | private void checkDirectoryEntry(final DirectoryEntry dir, final OutlookMessage msg)
throws IOException {
// we iterate through all entries in the current directory
for (final Iterator<?> iter = dir.getEntries(); iter.hasNext(); ) {
final Entry entry = (Entry) iter.next();
// check whether the entry is ei... | [
"private",
"void",
"checkDirectoryEntry",
"(",
"final",
"DirectoryEntry",
"dir",
",",
"final",
"OutlookMessage",
"msg",
")",
"throws",
"IOException",
"{",
"// we iterate through all entries in the current directory",
"for",
"(",
"final",
"Iterator",
"<",
"?",
">",
"iter... | Recursively parses the complete .msg file with the help of the POI library. The parsed information is put into the {@link OutlookMessage} object.
@param dir The current node in the .msg file.
@param msg The resulting {@link OutlookMessage} object.
@throws IOException Thrown if the .msg file could not be parsed. | [
"Recursively",
"parses",
"the",
"complete",
".",
"msg",
"file",
"with",
"the",
"help",
"of",
"the",
"POI",
"library",
".",
"The",
"parsed",
"information",
"is",
"put",
"into",
"the",
"{",
"@link",
"OutlookMessage",
"}",
"object",
"."
] | train | https://github.com/bbottema/outlook-message-parser/blob/ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e/src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java#L143-L171 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/calltrace/TracingUtil.java | TracingUtil.buildCall | @Deprecated
public static String buildCall(final Method method, final Object[] parameters) {
"""
Builds call.
@param method source {@link Method}, can't be null
@param parameters method parameters
@return call
"""
if (method == null) {
throw new IllegalArgumentException("Parameter method can't b... | java | @Deprecated
public static String buildCall(final Method method, final Object[] parameters) {
if (method == null) {
throw new IllegalArgumentException("Parameter method can't be null");
}
return buildCall(method.getDeclaringClass().getSimpleName(), method.getName(), parameters, null).toString();
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"buildCall",
"(",
"final",
"Method",
"method",
",",
"final",
"Object",
"[",
"]",
"parameters",
")",
"{",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Paramet... | Builds call.
@param method source {@link Method}, can't be null
@param parameters method parameters
@return call | [
"Builds",
"call",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/calltrace/TracingUtil.java#L29-L36 |
alkacon/opencms-core | src/org/opencms/configuration/CmsElementWithAttrsParamConfigHelper.java | CmsElementWithAttrsParamConfigHelper.generateXml | public void generateXml(Element parent, I_CmsConfigurationParameterHandler config) {
"""
Generates the XML configuration from the given configuration object.<p>
@param parent the parent element
@param config the configuration
"""
if (config != null) {
Element elem = parent.addElement(m... | java | public void generateXml(Element parent, I_CmsConfigurationParameterHandler config) {
if (config != null) {
Element elem = parent.addElement(m_name);
for (String attrName : m_attrs) {
String value = config.getConfiguration().get(attrName);
if (value != nul... | [
"public",
"void",
"generateXml",
"(",
"Element",
"parent",
",",
"I_CmsConfigurationParameterHandler",
"config",
")",
"{",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"Element",
"elem",
"=",
"parent",
".",
"addElement",
"(",
"m_name",
")",
";",
"for",
"(",
... | Generates the XML configuration from the given configuration object.<p>
@param parent the parent element
@param config the configuration | [
"Generates",
"the",
"XML",
"configuration",
"from",
"the",
"given",
"configuration",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsElementWithAttrsParamConfigHelper.java#L108-L119 |
VoltDB/voltdb | src/frontend/org/voltcore/agreement/AgreementSeeker.java | AgreementSeeker.startSeekingFor | public void startSeekingFor(
final Set<Long> hsids, final Map<Long,Boolean> inTrouble) {
"""
Start accumulate site links graphing information
@param hsids pre-failure mesh hsids
@param inTrouble a map where each key is a failed site, and its value is
a boolean that indicates whether or not the fai... | java | public void startSeekingFor(
final Set<Long> hsids, final Map<Long,Boolean> inTrouble) {
// if the mesh hsids change we need to reset
if (!m_hsids.equals(hsids)) {
if (!m_hsids.isEmpty()) clear();
m_hsids = ImmutableSortedSet.copyOf(hsids);
}
// deter... | [
"public",
"void",
"startSeekingFor",
"(",
"final",
"Set",
"<",
"Long",
">",
"hsids",
",",
"final",
"Map",
"<",
"Long",
",",
"Boolean",
">",
"inTrouble",
")",
"{",
"// if the mesh hsids change we need to reset",
"if",
"(",
"!",
"m_hsids",
".",
"equals",
"(",
... | Start accumulate site links graphing information
@param hsids pre-failure mesh hsids
@param inTrouble a map where each key is a failed site, and its value is
a boolean that indicates whether or not the failure was witnessed directly
or reported by some other site | [
"Start",
"accumulate",
"site",
"links",
"graphing",
"information"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/agreement/AgreementSeeker.java#L87-L99 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/xspec/Condition.java | Condition.or | public OrCondition or(Condition that) {
"""
Returns a new condition based on the disjunction of the current condition
and the given condition.
@param that given condition.
"""
return new OrCondition(this, that.atomic() ? that : _(that));
} | java | public OrCondition or(Condition that) {
return new OrCondition(this, that.atomic() ? that : _(that));
} | [
"public",
"OrCondition",
"or",
"(",
"Condition",
"that",
")",
"{",
"return",
"new",
"OrCondition",
"(",
"this",
",",
"that",
".",
"atomic",
"(",
")",
"?",
"that",
":",
"_",
"(",
"that",
")",
")",
";",
"}"
] | Returns a new condition based on the disjunction of the current condition
and the given condition.
@param that given condition. | [
"Returns",
"a",
"new",
"condition",
"based",
"on",
"the",
"disjunction",
"of",
"the",
"current",
"condition",
"and",
"the",
"given",
"condition",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/xspec/Condition.java#L49-L51 |
biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java | FastqTools.convertQualities | static String convertQualities(final Fastq fastq, final FastqVariant variant) {
"""
Convert the qualities in the specified FASTQ formatted sequence to the
specified FASTQ sequence format variant.
@since 4.2
@param fastq FASTQ formatted sequence, must not be null
@param variant FASTQ sequence format variant, ... | java | static String convertQualities(final Fastq fastq, final FastqVariant variant)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
if (variant == null)
{
throw new IllegalArgumentException("variant must not be null");
}
if (fastq.getVariant().equals(variant))
{
... | [
"static",
"String",
"convertQualities",
"(",
"final",
"Fastq",
"fastq",
",",
"final",
"FastqVariant",
"variant",
")",
"{",
"if",
"(",
"fastq",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"fastq must not be null\"",
")",
";",
"}",
... | Convert the qualities in the specified FASTQ formatted sequence to the
specified FASTQ sequence format variant.
@since 4.2
@param fastq FASTQ formatted sequence, must not be null
@param variant FASTQ sequence format variant, must not be null
@return the qualities in the specified FASTQ formatted sequence converted to ... | [
"Convert",
"the",
"qualities",
"in",
"the",
"specified",
"FASTQ",
"formatted",
"sequence",
"to",
"the",
"specified",
"FASTQ",
"sequence",
"format",
"variant",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java#L308-L330 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java | MetadataService.removeToken | public CompletableFuture<Revision> removeToken(Author author, String projectName, Token token) {
"""
Removes the specified {@link Token} from the specified {@code projectName}. It also removes
every token permission belonging to the {@link Token} from every {@link RepositoryMetadata}.
"""
return remov... | java | public CompletableFuture<Revision> removeToken(Author author, String projectName, Token token) {
return removeToken(author, projectName, requireNonNull(token, "token").appId());
} | [
"public",
"CompletableFuture",
"<",
"Revision",
">",
"removeToken",
"(",
"Author",
"author",
",",
"String",
"projectName",
",",
"Token",
"token",
")",
"{",
"return",
"removeToken",
"(",
"author",
",",
"projectName",
",",
"requireNonNull",
"(",
"token",
",",
"\... | Removes the specified {@link Token} from the specified {@code projectName}. It also removes
every token permission belonging to the {@link Token} from every {@link RepositoryMetadata}. | [
"Removes",
"the",
"specified",
"{"
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java#L362-L364 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/PTSaxton2006.java | PTSaxton2006.calcAdjustedSaturatedMoisture | public static String calcAdjustedSaturatedMoisture(String slsnd, String slcly, String omPct, String df) {
"""
Equation 8 for calculating Saturated moisture (0 kPa), adjusted density,
([0,100]%)
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@pa... | java | public static String calcAdjustedSaturatedMoisture(String slsnd, String slcly, String omPct, String df) {
String adjDensity = calcAdjustedDensity(slsnd, slcly, omPct, df);
String ret = substract("100", divide(adjDensity, "0.0265"));
LOG.debug("Calculate result for Saturated moisture (0 kPa), ad... | [
"public",
"static",
"String",
"calcAdjustedSaturatedMoisture",
"(",
"String",
"slsnd",
",",
"String",
"slcly",
",",
"String",
"omPct",
",",
"String",
"df",
")",
"{",
"String",
"adjDensity",
"=",
"calcAdjustedDensity",
"(",
"slsnd",
",",
"slcly",
",",
"omPct",
... | Equation 8 for calculating Saturated moisture (0 kPa), adjusted density,
([0,100]%)
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage by layer ([0,100]%), (=
SLOC * 1.72)
@param df Density adjustment Factor (0.9... | [
"Equation",
"8",
"for",
"calculating",
"Saturated",
"moisture",
"(",
"0",
"kPa",
")",
"adjusted",
"density",
"(",
"[",
"0",
"100",
"]",
"%",
")"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/PTSaxton2006.java#L266-L272 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getParameterValueFromString | public static Object getParameterValueFromString(String parameterClass, String value) throws Exception {
"""
Get parameter value from a string represenation
@param parameterClass parameter class
@param value string value representation
@return parameter value from string representation
@throws Exception if s... | java | public static Object getParameterValueFromString(String parameterClass, String value) throws Exception {
return getParameterValueFromString(parameterClass, value, null);
} | [
"public",
"static",
"Object",
"getParameterValueFromString",
"(",
"String",
"parameterClass",
",",
"String",
"value",
")",
"throws",
"Exception",
"{",
"return",
"getParameterValueFromString",
"(",
"parameterClass",
",",
"value",
",",
"null",
")",
";",
"}"
] | Get parameter value from a string represenation
@param parameterClass parameter class
@param value string value representation
@return parameter value from string representation
@throws Exception if string value cannot be parse | [
"Get",
"parameter",
"value",
"from",
"a",
"string",
"represenation"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L1055-L1057 |
cojen/Cojen | src/main/java/org/cojen/classfile/ClassFile.java | ClassFile.setVersion | public void setVersion(int major, int minor) {
"""
Sets the version to use when writing the generated classfile, overriding
the target.
"""
if (major > 65535 || minor > 65535) {
throw new IllegalArgumentException("Version number element cannot exceed 65535");
}
mVersion = ... | java | public void setVersion(int major, int minor) {
if (major > 65535 || minor > 65535) {
throw new IllegalArgumentException("Version number element cannot exceed 65535");
}
mVersion = (minor << 16) | (major & 0xffff);
String target;
switch (major) {
default:
... | [
"public",
"void",
"setVersion",
"(",
"int",
"major",
",",
"int",
"minor",
")",
"{",
"if",
"(",
"major",
">",
"65535",
"||",
"minor",
">",
"65535",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Version number element cannot exceed 65535\"",
")",
... | Sets the version to use when writing the generated classfile, overriding
the target. | [
"Sets",
"the",
"version",
"to",
"use",
"when",
"writing",
"the",
"generated",
"classfile",
"overriding",
"the",
"target",
"."
] | train | https://github.com/cojen/Cojen/blob/ddee9a0fde83870b97e0ed04c58270aa665f3a62/src/main/java/org/cojen/classfile/ClassFile.java#L997-L1033 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MetadataCache.java | MetadataCache.addCacheDetailsEntry | private static void addCacheDetailsEntry(SlotReference slot, ZipOutputStream zos, WritableByteChannel channel) throws IOException {
"""
Record the details of the media being cached, to make it easier to recognize, now that we have access to that
information.
@param slot the slot from which a metadata cache is ... | java | private static void addCacheDetailsEntry(SlotReference slot, ZipOutputStream zos, WritableByteChannel channel) throws IOException {
// Record the details of the media being cached, to make it easier to recognize now that we can.
MediaDetails details = MetadataFinder.getInstance().getMediaDetailsFor(slot... | [
"private",
"static",
"void",
"addCacheDetailsEntry",
"(",
"SlotReference",
"slot",
",",
"ZipOutputStream",
"zos",
",",
"WritableByteChannel",
"channel",
")",
"throws",
"IOException",
"{",
"// Record the details of the media being cached, to make it easier to recognize now that we c... | Record the details of the media being cached, to make it easier to recognize, now that we have access to that
information.
@param slot the slot from which a metadata cache is being created
@param zos the stream to which the ZipFile is being written
@param channel the low-level channel to which the cache is being writt... | [
"Record",
"the",
"details",
"of",
"the",
"media",
"being",
"cached",
"to",
"make",
"it",
"easier",
"to",
"recognize",
"now",
"that",
"we",
"have",
"access",
"to",
"that",
"information",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MetadataCache.java#L364-L371 |
Erudika/para | para-server/src/main/java/com/erudika/para/i18n/LanguageUtils.java | LanguageUtils.approveTranslation | public boolean approveTranslation(String appid, String langCode, String key, String value) {
"""
Approves a translation for a given language.
@param appid appid name of the {@link com.erudika.para.core.App}
@param langCode the 2-letter language code
@param key the translation key
@param value the translated st... | java | public boolean approveTranslation(String appid, String langCode, String key, String value) {
if (StringUtils.isBlank(langCode) || key == null || value == null || getDefaultLanguageCode().equals(langCode)) {
return false;
}
Sysprop s = dao.read(appid, keyPrefix.concat(langCode));
boolean create = false;
if ... | [
"public",
"boolean",
"approveTranslation",
"(",
"String",
"appid",
",",
"String",
"langCode",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"langCode",
")",
"||",
"key",
"==",
"null",
"||",
"value",
... | Approves a translation for a given language.
@param appid appid name of the {@link com.erudika.para.core.App}
@param langCode the 2-letter language code
@param key the translation key
@param value the translated string
@return true if the operation was successful | [
"Approves",
"a",
"translation",
"for",
"a",
"given",
"language",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/i18n/LanguageUtils.java#L320-L342 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java | NetworkSecurityGroupsInner.updateTagsAsync | public Observable<NetworkSecurityGroupInner> updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map<String, String> tags) {
"""
Updates a network security group tags.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network securit... | java | public Observable<NetworkSecurityGroupInner> updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1<ServiceResponse<NetworkSecurityGroupInner>, NetworkSecuri... | [
"public",
"Observable",
"<",
"NetworkSecurityGroupInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkSecurityGroupName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"updateTagsWithServiceResponseAsyn... | Updates a network security group tags.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@param tags Resource tags.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"a",
"network",
"security",
"group",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java#L708-L715 |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/io/logging/PortLoggerFactory.java | PortLoggerFactory.getLogger | public static PortLogger getLogger(String name, OutputCollector output) {
"""
Creates an output port logger with the given name.
@param name The logger name.
@param output The output to which to log messages.
@return An output port logger.
"""
Args.checkNotNull(name, "logger name cannot be null");
... | java | public static PortLogger getLogger(String name, OutputCollector output) {
Args.checkNotNull(name, "logger name cannot be null");
Map<OutputCollector, PortLogger> loggers = PortLoggerFactory.loggers.get(name);
if (loggers == null) {
loggers = new HashMap<>();
PortLoggerFactory.loggers.put(name, l... | [
"public",
"static",
"PortLogger",
"getLogger",
"(",
"String",
"name",
",",
"OutputCollector",
"output",
")",
"{",
"Args",
".",
"checkNotNull",
"(",
"name",
",",
"\"logger name cannot be null\"",
")",
";",
"Map",
"<",
"OutputCollector",
",",
"PortLogger",
">",
"l... | Creates an output port logger with the given name.
@param name The logger name.
@param output The output to which to log messages.
@return An output port logger. | [
"Creates",
"an",
"output",
"port",
"logger",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/logging/PortLoggerFactory.java#L52-L66 |
playn/playn | core/src/playn/core/Input.java | Input.getText | public RFuture<String> getText (Keyboard.TextType textType, String label, String initialValue) {
"""
Requests a line of text from the user. On platforms that have only a virtual keyboard, this
will display a text entry interface, obtain the line of text, and dismiss the text entry
interface when finished.
@pa... | java | public RFuture<String> getText (Keyboard.TextType textType, String label, String initialValue) {
return getText(textType, label, initialValue, "Ok", "Cancel");
} | [
"public",
"RFuture",
"<",
"String",
">",
"getText",
"(",
"Keyboard",
".",
"TextType",
"textType",
",",
"String",
"label",
",",
"String",
"initialValue",
")",
"{",
"return",
"getText",
"(",
"textType",
",",
"label",
",",
"initialValue",
",",
"\"Ok\"",
",",
... | Requests a line of text from the user. On platforms that have only a virtual keyboard, this
will display a text entry interface, obtain the line of text, and dismiss the text entry
interface when finished.
@param textType the expected type of text. On mobile devices this hint may be used to display a
keyboard customiz... | [
"Requests",
"a",
"line",
"of",
"text",
"from",
"the",
"user",
".",
"On",
"platforms",
"that",
"have",
"only",
"a",
"virtual",
"keyboard",
"this",
"will",
"display",
"a",
"text",
"entry",
"interface",
"obtain",
"the",
"line",
"of",
"text",
"and",
"dismiss",... | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Input.java#L96-L98 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/splitassigner/InputSplitTracker.java | InputSplitTracker.registerJob | void registerJob(final ExecutionGraph eg) {
"""
Registers a new job with the input split tracker.
@param eg
the execution graph of the job to be registered
"""
final Iterator<ExecutionGroupVertex> it = new ExecutionGroupVertexIterator(eg, true, -1);
while (it.hasNext()) {
final ExecutionGroupVerte... | java | void registerJob(final ExecutionGraph eg) {
final Iterator<ExecutionGroupVertex> it = new ExecutionGroupVertexIterator(eg, true, -1);
while (it.hasNext()) {
final ExecutionGroupVertex groupVertex = it.next();
final InputSplit[] inputSplits = groupVertex.getInputSplits();
if (inputSplits == null) {
c... | [
"void",
"registerJob",
"(",
"final",
"ExecutionGraph",
"eg",
")",
"{",
"final",
"Iterator",
"<",
"ExecutionGroupVertex",
">",
"it",
"=",
"new",
"ExecutionGroupVertexIterator",
"(",
"eg",
",",
"true",
",",
"-",
"1",
")",
";",
"while",
"(",
"it",
".",
"hasNe... | Registers a new job with the input split tracker.
@param eg
the execution graph of the job to be registered | [
"Registers",
"a",
"new",
"job",
"with",
"the",
"input",
"split",
"tracker",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/splitassigner/InputSplitTracker.java#L65-L88 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/lang/UrlUtils.java | UrlUtils.addQueryStringFragment | public static String addQueryStringFragment(String url, String fragment) {
"""
Adds a query string fragment to the URL, adding a '?' if there's no query string yet.
@param url the URL
@param fragment the query string fragment
@return the URL with the query string fragment appended
"""
Str... | java | public static String addQueryStringFragment(String url, String fragment) {
StringBuilder newUrl = new StringBuilder(url);
if (fragment.startsWith("?") || fragment.startsWith("&")) {
fragment = fragment.substring(1);
}
if (!url.endsWith("?") && !url.endsWith("&")) {
... | [
"public",
"static",
"String",
"addQueryStringFragment",
"(",
"String",
"url",
",",
"String",
"fragment",
")",
"{",
"StringBuilder",
"newUrl",
"=",
"new",
"StringBuilder",
"(",
"url",
")",
";",
"if",
"(",
"fragment",
".",
"startsWith",
"(",
"\"?\"",
")",
"||"... | Adds a query string fragment to the URL, adding a '?' if there's no query string yet.
@param url the URL
@param fragment the query string fragment
@return the URL with the query string fragment appended | [
"Adds",
"a",
"query",
"string",
"fragment",
"to",
"the",
"URL",
"adding",
"a",
"?",
"if",
"there",
"s",
"no",
"query",
"string",
"yet",
"."
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/lang/UrlUtils.java#L121-L137 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/nodemodel/impl/InternalNodeModelUtils.java | InternalNodeModelUtils.getLineAndColumn | protected static LineAndColumn getLineAndColumn(INode anyNode, int documentOffset) {
"""
Obtain the line breaks from the document and search / compute the line number
and column number at the given document offset.
"""
INode rootNode = anyNode.getRootNode();
int[] lineBreaks = getLineBreakOffsets(rootNode... | java | protected static LineAndColumn getLineAndColumn(INode anyNode, int documentOffset) {
INode rootNode = anyNode.getRootNode();
int[] lineBreaks = getLineBreakOffsets(rootNode);
String document = rootNode.getText();
return getLineAndColumn(document, lineBreaks, documentOffset);
} | [
"protected",
"static",
"LineAndColumn",
"getLineAndColumn",
"(",
"INode",
"anyNode",
",",
"int",
"documentOffset",
")",
"{",
"INode",
"rootNode",
"=",
"anyNode",
".",
"getRootNode",
"(",
")",
";",
"int",
"[",
"]",
"lineBreaks",
"=",
"getLineBreakOffsets",
"(",
... | Obtain the line breaks from the document and search / compute the line number
and column number at the given document offset. | [
"Obtain",
"the",
"line",
"breaks",
"from",
"the",
"document",
"and",
"search",
"/",
"compute",
"the",
"line",
"number",
"and",
"column",
"number",
"at",
"the",
"given",
"document",
"offset",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/nodemodel/impl/InternalNodeModelUtils.java#L45-L50 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/StringUtils.java | StringUtils.indexOfIgnoreCase | public static int indexOfIgnoreCase(String text, String str, int startIndex) {
"""
Case insensitive version of {@link String#indexOf(java.lang.String, int)}. Equivalent to
{@code text.indexOf(str, startIndex)}, except the matching is case insensitive.
"""
Matcher m = Pattern.compile(Pattern.quote(str)... | java | public static int indexOfIgnoreCase(String text, String str, int startIndex) {
Matcher m = Pattern.compile(Pattern.quote(str), Pattern.CASE_INSENSITIVE).matcher(text);
return m.find(startIndex) ? m.start() : -1;
} | [
"public",
"static",
"int",
"indexOfIgnoreCase",
"(",
"String",
"text",
",",
"String",
"str",
",",
"int",
"startIndex",
")",
"{",
"Matcher",
"m",
"=",
"Pattern",
".",
"compile",
"(",
"Pattern",
".",
"quote",
"(",
"str",
")",
",",
"Pattern",
".",
"CASE_INS... | Case insensitive version of {@link String#indexOf(java.lang.String, int)}. Equivalent to
{@code text.indexOf(str, startIndex)}, except the matching is case insensitive. | [
"Case",
"insensitive",
"version",
"of",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/StringUtils.java#L65-L68 |
EdwardRaff/JSAT | JSAT/src/jsat/DataSet.java | DataSet.base_add | protected void base_add(DataPoint dp, double weight) {
"""
Adds a new datapoint to this set.This method is protected, as not all
datasets will be satisfied by adding just a data point.
@param dp the datapoint to add
@param weight weight of the point to add
"""
datapoints.addDataPoint(dp);
... | java | protected void base_add(DataPoint dp, double weight)
{
datapoints.addDataPoint(dp);
setWeight(size()-1, weight);
} | [
"protected",
"void",
"base_add",
"(",
"DataPoint",
"dp",
",",
"double",
"weight",
")",
"{",
"datapoints",
".",
"addDataPoint",
"(",
"dp",
")",
";",
"setWeight",
"(",
"size",
"(",
")",
"-",
"1",
",",
"weight",
")",
";",
"}"
] | Adds a new datapoint to this set.This method is protected, as not all
datasets will be satisfied by adding just a data point.
@param dp the datapoint to add
@param weight weight of the point to add | [
"Adds",
"a",
"new",
"datapoint",
"to",
"this",
"set",
".",
"This",
"method",
"is",
"protected",
"as",
"not",
"all",
"datasets",
"will",
"be",
"satisfied",
"by",
"adding",
"just",
"a",
"data",
"point",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/DataSet.java#L269-L273 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/SecureClassLoader.java | SecureClassLoader.getProtectionDomain | private ProtectionDomain getProtectionDomain(CodeSource cs) {
"""
/*
Returned cached ProtectionDomain for the specified CodeSource.
"""
if (cs == null)
return null;
ProtectionDomain pd = null;
synchronized (pdcache) {
pd = pdcache.get(cs);
if (pd ==... | java | private ProtectionDomain getProtectionDomain(CodeSource cs) {
if (cs == null)
return null;
ProtectionDomain pd = null;
synchronized (pdcache) {
pd = pdcache.get(cs);
if (pd == null) {
PermissionCollection perms = getPermissions(cs);
... | [
"private",
"ProtectionDomain",
"getProtectionDomain",
"(",
"CodeSource",
"cs",
")",
"{",
"if",
"(",
"cs",
"==",
"null",
")",
"return",
"null",
";",
"ProtectionDomain",
"pd",
"=",
"null",
";",
"synchronized",
"(",
"pdcache",
")",
"{",
"pd",
"=",
"pdcache",
... | /*
Returned cached ProtectionDomain for the specified CodeSource. | [
"/",
"*",
"Returned",
"cached",
"ProtectionDomain",
"for",
"the",
"specified",
"CodeSource",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/SecureClassLoader.java#L198-L216 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileUtil.java | FileUtil.chmod | public static int chmod(String filename, String perm, boolean recursive)
throws IOException, InterruptedException {
"""
Change the permissions on a file / directory, recursively, if
needed.
@param filename name of the file whose permissions are to change
@param perm permission string... | java | public static int chmod(String filename, String perm, boolean recursive)
throws IOException, InterruptedException {
StringBuffer cmdBuf = new StringBuffer();
cmdBuf.append("chmod ");
if (recursive) {
cmdBuf.append("-R ");
}
cmdBuf.append(perm).append(" ");
cmdBu... | [
"public",
"static",
"int",
"chmod",
"(",
"String",
"filename",
",",
"String",
"perm",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"StringBuffer",
"cmdBuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"cmdBuf",
".... | Change the permissions on a file / directory, recursively, if
needed.
@param filename name of the file whose permissions are to change
@param perm permission string
@param recursive true, if permissions should be changed recursively
@return the exit code from the command.
@throws IOException
@throws InterruptedExceptio... | [
"Change",
"the",
"permissions",
"on",
"a",
"file",
"/",
"directory",
"recursively",
"if",
"needed",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileUtil.java#L756-L776 |
jmeetsma/Iglu-Http | src/main/java/org/ijsberg/iglu/server/http/module/SimpleJettyServletContext.java | SimpleJettyServletContext.addInitParameters | public static void addInitParameters(Holder holder, Properties subSection) {
"""
/*
public static void addInitParameters(Map<Object, String> params, Properties subSection) {
Properties properties = PropertiesSupport.getSubsection(subSection, "initparam");
for (Object key : properties.keySet()) {
params.put(key... | java | public static void addInitParameters(Holder holder, Properties subSection) {
//TODO rename initparam to property
Properties properties = PropertiesSupport.getSubsection(subSection, "initparam");
// System.out.println("PROPS:" + properties);
for (Object key : properties.keySet()) {
// System.out.println(key + "... | [
"public",
"static",
"void",
"addInitParameters",
"(",
"Holder",
"holder",
",",
"Properties",
"subSection",
")",
"{",
"//TODO rename initparam to property",
"Properties",
"properties",
"=",
"PropertiesSupport",
".",
"getSubsection",
"(",
"subSection",
",",
"\"initparam\"",... | /*
public static void addInitParameters(Map<Object, String> params, Properties subSection) {
Properties properties = PropertiesSupport.getSubsection(subSection, "initparam");
for (Object key : properties.keySet()) {
params.put(key, subSection.getProperty(key.toString()));
}
} | [
"/",
"*",
"public",
"static",
"void",
"addInitParameters",
"(",
"Map<Object",
"String",
">",
"params",
"Properties",
"subSection",
")",
"{",
"Properties",
"properties",
"=",
"PropertiesSupport",
".",
"getSubsection",
"(",
"subSection",
"initparam",
")",
";",
"for"... | train | https://github.com/jmeetsma/Iglu-Http/blob/5b5ed3b417285dc79b7aa013bf2340bb5ba1ffbe/src/main/java/org/ijsberg/iglu/server/http/module/SimpleJettyServletContext.java#L316-L324 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java | AuroraListener.setUrlParserFromEndpoints | private void setUrlParserFromEndpoints(List<String> endpoints, int port) {
"""
Sets urlParser accordingly to discovered hosts.
@param endpoints instance identifiers
@param port port that is common to all endpoints
"""
List<HostAddress> addresses = new ArrayList<>();
for (String endpoint : endp... | java | private void setUrlParserFromEndpoints(List<String> endpoints, int port) {
List<HostAddress> addresses = new ArrayList<>();
for (String endpoint : endpoints) {
HostAddress newHostAddress = new HostAddress(endpoint, port, null);
addresses.add(newHostAddress);
}
synchronized (urlParser) {
... | [
"private",
"void",
"setUrlParserFromEndpoints",
"(",
"List",
"<",
"String",
">",
"endpoints",
",",
"int",
"port",
")",
"{",
"List",
"<",
"HostAddress",
">",
"addresses",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"endpoint",
":",
... | Sets urlParser accordingly to discovered hosts.
@param endpoints instance identifiers
@param port port that is common to all endpoints | [
"Sets",
"urlParser",
"accordingly",
"to",
"discovered",
"hosts",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java#L303-L313 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.write | public static void write(OutputStream out, Charset charset, boolean isCloseOut, Object... contents) throws IORuntimeException {
"""
将多部分内容写到流中,自动转换为字符串
@param out 输出流
@param charset 写出的内容的字符集
@param isCloseOut 写入完毕是否关闭输出流
@param contents 写入的内容,调用toString()方法,不包括不会自动换行
@throws IORuntimeException IO异常
@since... | java | public static void write(OutputStream out, Charset charset, boolean isCloseOut, Object... contents) throws IORuntimeException {
OutputStreamWriter osw = null;
try {
osw = getWriter(out, charset);
for (Object content : contents) {
if (content != null) {
osw.write(Convert.toStr(content, StrUtil.E... | [
"public",
"static",
"void",
"write",
"(",
"OutputStream",
"out",
",",
"Charset",
"charset",
",",
"boolean",
"isCloseOut",
",",
"Object",
"...",
"contents",
")",
"throws",
"IORuntimeException",
"{",
"OutputStreamWriter",
"osw",
"=",
"null",
";",
"try",
"{",
"os... | 将多部分内容写到流中,自动转换为字符串
@param out 输出流
@param charset 写出的内容的字符集
@param isCloseOut 写入完毕是否关闭输出流
@param contents 写入的内容,调用toString()方法,不包括不会自动换行
@throws IORuntimeException IO异常
@since 3.0.9 | [
"将多部分内容写到流中,自动转换为字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L905-L922 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/block/component/ItemTransformComponent.java | ItemTransformComponent.thirdPerson | public ItemTransformComponent thirdPerson(Matrix4f left, Matrix4f right) {
"""
Sets the transforms to use for the {@link Item} third person.
@param left the left
@param right the right
@return the item transform component
"""
this.thirdPersonLeftHand = left;
this.thirdPersonRightHand = right;
return... | java | public ItemTransformComponent thirdPerson(Matrix4f left, Matrix4f right)
{
this.thirdPersonLeftHand = left;
this.thirdPersonRightHand = right;
return this;
} | [
"public",
"ItemTransformComponent",
"thirdPerson",
"(",
"Matrix4f",
"left",
",",
"Matrix4f",
"right",
")",
"{",
"this",
".",
"thirdPersonLeftHand",
"=",
"left",
";",
"this",
".",
"thirdPersonRightHand",
"=",
"right",
";",
"return",
"this",
";",
"}"
] | Sets the transforms to use for the {@link Item} third person.
@param left the left
@param right the right
@return the item transform component | [
"Sets",
"the",
"transforms",
"to",
"use",
"for",
"the",
"{",
"@link",
"Item",
"}",
"third",
"person",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/block/component/ItemTransformComponent.java#L66-L71 |
Azure/azure-sdk-for-java | sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceVulnerabilityAssessmentsInner.java | ManagedInstanceVulnerabilityAssessmentsInner.createOrUpdateAsync | public Observable<ManagedInstanceVulnerabilityAssessmentInner> createOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceVulnerabilityAssessmentInner parameters) {
"""
Creates or updates the managed instance's vulnerability assessment.
@param resourceGroupName The name of the reso... | java | public Observable<ManagedInstanceVulnerabilityAssessmentInner> createOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceVulnerabilityAssessmentInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).map(new Func1<Servi... | [
"public",
"Observable",
"<",
"ManagedInstanceVulnerabilityAssessmentInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"ManagedInstanceVulnerabilityAssessmentInner",
"parameters",
")",
"{",
"return",
"createOrUpdateW... | Creates or updates the managed instance's vulnerability assessment.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance for which the vulnerability as... | [
"Creates",
"or",
"updates",
"the",
"managed",
"instance",
"s",
"vulnerability",
"assessment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceVulnerabilityAssessmentsInner.java#L212-L219 |
alkacon/opencms-core | src/org/opencms/ade/upload/CmsUploadService.java | CmsUploadService.existsResource | private boolean existsResource(String path, boolean rootPath) {
"""
Checks if a resource already exists for the given path.<p>
@param path the path
@param rootPath in case the path is a root path
@return true if a resource already exists
"""
CmsObject cms = getCmsObject();
if (rootPath)... | java | private boolean existsResource(String path, boolean rootPath) {
CmsObject cms = getCmsObject();
if (rootPath) {
String origSiteRoot = cms.getRequestContext().getSiteRoot();
try {
cms.getRequestContext().setSiteRoot("");
if (cms.existsResource(path... | [
"private",
"boolean",
"existsResource",
"(",
"String",
"path",
",",
"boolean",
"rootPath",
")",
"{",
"CmsObject",
"cms",
"=",
"getCmsObject",
"(",
")",
";",
"if",
"(",
"rootPath",
")",
"{",
"String",
"origSiteRoot",
"=",
"cms",
".",
"getRequestContext",
"(",... | Checks if a resource already exists for the given path.<p>
@param path the path
@param rootPath in case the path is a root path
@return true if a resource already exists | [
"Checks",
"if",
"a",
"resource",
"already",
"exists",
"for",
"the",
"given",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/upload/CmsUploadService.java#L140-L159 |
innoq/LiQID | ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java | LdapHelper.getGroup | @Override
public Node getGroup(final String cn) {
"""
Returns a LDAP-Group.
@param cn the cn of that Group.
@see com.innoq.liqid.model.Node#getName()
@return the Node of that Group, either filled (if Group was found), or empty.
"""
try {
String query = "(&(objectClass=" + groupObje... | java | @Override
public Node getGroup(final String cn) {
try {
String query = "(&(objectClass=" + groupObjectClass + ")(" + groupIdentifyer + "=" + cn + "))";
SearchResult searchResult;
Attributes attributes;
SearchControls controls = new SearchControls();
... | [
"@",
"Override",
"public",
"Node",
"getGroup",
"(",
"final",
"String",
"cn",
")",
"{",
"try",
"{",
"String",
"query",
"=",
"\"(&(objectClass=\"",
"+",
"groupObjectClass",
"+",
"\")(\"",
"+",
"groupIdentifyer",
"+",
"\"=\"",
"+",
"cn",
"+",
"\"))\"",
";",
"... | Returns a LDAP-Group.
@param cn the cn of that Group.
@see com.innoq.liqid.model.Node#getName()
@return the Node of that Group, either filled (if Group was found), or empty. | [
"Returns",
"a",
"LDAP",
"-",
"Group",
"."
] | train | https://github.com/innoq/LiQID/blob/ae3de2c1fd78c40219780d510eba57c931901279/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java#L368-L391 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/EmbedBuilder.java | EmbedBuilder.setFooter | public EmbedBuilder setFooter(String text, String iconUrl) {
"""
Sets the Footer of the embed.
<p><b><a href="http://i.imgur.com/jdf4sbi.png">Example</a></b>
<p><b>Uploading images with Embeds</b>
<br>When uploading an <u>image</u>
(using {@link net.dv8tion.jda.core.entities.MessageChannel#sendFile(java.io... | java | public EmbedBuilder setFooter(String text, String iconUrl)
{
//We only check if the text is null because its presence is what determines if the
// footer will appear in the embed.
if (text == null)
{
this.footer = null;
}
else
{
Checks.... | [
"public",
"EmbedBuilder",
"setFooter",
"(",
"String",
"text",
",",
"String",
"iconUrl",
")",
"{",
"//We only check if the text is null because its presence is what determines if the",
"// footer will appear in the embed.",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"this",
... | Sets the Footer of the embed.
<p><b><a href="http://i.imgur.com/jdf4sbi.png">Example</a></b>
<p><b>Uploading images with Embeds</b>
<br>When uploading an <u>image</u>
(using {@link net.dv8tion.jda.core.entities.MessageChannel#sendFile(java.io.File, net.dv8tion.jda.core.entities.Message) MessageChannel.sendFile(...)})... | [
"Sets",
"the",
"Footer",
"of",
"the",
"embed",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/EmbedBuilder.java#L660-L675 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.addPersonFaceFromStreamAsync | public Observable<PersistedFace> addPersonFaceFromStreamAsync(String personGroupId, UUID personId, byte[] image, AddPersonFaceFromStreamOptionalParameter addPersonFaceFromStreamOptionalParameter) {
"""
Add a representative face to a person for identification. The input face is specified as an image with a targetFa... | java | public Observable<PersistedFace> addPersonFaceFromStreamAsync(String personGroupId, UUID personId, byte[] image, AddPersonFaceFromStreamOptionalParameter addPersonFaceFromStreamOptionalParameter) {
return addPersonFaceFromStreamWithServiceResponseAsync(personGroupId, personId, image, addPersonFaceFromStreamOpti... | [
"public",
"Observable",
"<",
"PersistedFace",
">",
"addPersonFaceFromStreamAsync",
"(",
"String",
"personGroupId",
",",
"UUID",
"personId",
",",
"byte",
"[",
"]",
"image",
",",
"AddPersonFaceFromStreamOptionalParameter",
"addPersonFaceFromStreamOptionalParameter",
")",
"{",... | Add a representative face to a person for identification. The input face is specified as an image with a targetFace rectangle.
@param personGroupId Id referencing a particular person group.
@param personId Id referencing a particular person.
@param image An image stream.
@param addPersonFaceFromStreamOptionalParameter... | [
"Add",
"a",
"representative",
"face",
"to",
"a",
"person",
"for",
"identification",
".",
"The",
"input",
"face",
"is",
"specified",
"as",
"an",
"image",
"with",
"a",
"targetFace",
"rectangle",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L1400-L1407 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/CFFFontSubset.java | CFFFontSubset.BuildNewIndex | protected byte[] BuildNewIndex(int[] Offsets,HashMap Used,byte OperatorForUnusedEntries) throws IOException {
"""
Function builds the new offset array, object array and assembles the index.
used for creating the glyph and subrs subsetted index
@param Offsets the offset array of the original index
@param Used th... | java | protected byte[] BuildNewIndex(int[] Offsets,HashMap Used,byte OperatorForUnusedEntries) throws IOException
{
int unusedCount = 0;
int Offset=0;
int[] NewOffsets = new int[Offsets.length];
// Build the Offsets Array for the Subset
for (int i=0;i<Offsets.length;++i)
{
NewOffsets[i] = Offset;
// If th... | [
"protected",
"byte",
"[",
"]",
"BuildNewIndex",
"(",
"int",
"[",
"]",
"Offsets",
",",
"HashMap",
"Used",
",",
"byte",
"OperatorForUnusedEntries",
")",
"throws",
"IOException",
"{",
"int",
"unusedCount",
"=",
"0",
";",
"int",
"Offset",
"=",
"0",
";",
"int",... | Function builds the new offset array, object array and assembles the index.
used for creating the glyph and subrs subsetted index
@param Offsets the offset array of the original index
@param Used the hashmap of the used objects
@param OperatorForUnusedEntries the operator inserted into the data stream for unused entrie... | [
"Function",
"builds",
"the",
"new",
"offset",
"array",
"object",
"array",
"and",
"assembles",
"the",
"index",
".",
"used",
"for",
"creating",
"the",
"glyph",
"and",
"subrs",
"subsetted",
"index"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/CFFFontSubset.java#L937-L981 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getCharacterHeroPoints | public void getCharacterHeroPoints(String API, String name, Callback<List<String>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on character hero points API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Heropoints">here</a><br/>
@param API API key
@param n... | java | public void getCharacterHeroPoints(String API, String name, Callback<List<String>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacterHeroPoints(name, API).enqueue(callback);
} | [
"public",
"void",
"getCharacterHeroPoints",
"(",
"String",
"API",
",",
"String",
"name",
",",
"Callback",
"<",
"List",
"<",
"String",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"Param... | For more info on character hero points API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Heropoints">here</a><br/>
@param API API key
@param name name of character
@param callback callback that is going to be used for {@link Call#enqueue(Callback)}
@throws GuildWars2Exception invalid API key ... | [
"For",
"more",
"info",
"on",
"character",
"hero",
"points",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"characters#Heropoints",
">",
"here<",
"/",
"a",
">",
"<br"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L765-L768 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/common/enums/FilterPredicate.java | FilterPredicate.areEqual | public static FilterPredicate areEqual(FilterableAttribute attribute, Object value) {
"""
Create a predicate specifying that the value of the specified attribute must exactly
match the supplied value. The value must also be the type specified by the FilterableAttribute
@param attribute The attribute to match o... | java | public static FilterPredicate areEqual(FilterableAttribute attribute, Object value) {
FilterPredicate pred = new FilterPredicate();
pred.attribute = attribute;
Class<?> requiredType = attribute.getType();
if (!requiredType.isInstance(value)) {
throw new IllegalArgumentExcepti... | [
"public",
"static",
"FilterPredicate",
"areEqual",
"(",
"FilterableAttribute",
"attribute",
",",
"Object",
"value",
")",
"{",
"FilterPredicate",
"pred",
"=",
"new",
"FilterPredicate",
"(",
")",
";",
"pred",
".",
"attribute",
"=",
"attribute",
";",
"Class",
"<",
... | Create a predicate specifying that the value of the specified attribute must exactly
match the supplied value. The value must also be the type specified by the FilterableAttribute
@param attribute The attribute to match on
@param value The exact value that the attribute must have
@throws IllegalArgumentException if th... | [
"Create",
"a",
"predicate",
"specifying",
"that",
"the",
"value",
"of",
"the",
"specified",
"attribute",
"must",
"exactly",
"match",
"the",
"supplied",
"value",
".",
"The",
"value",
"must",
"also",
"be",
"the",
"type",
"specified",
"by",
"the",
"FilterableAttr... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/common/enums/FilterPredicate.java#L54-L65 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java | DefaultGroovyStaticMethods.startDaemon | public static Thread startDaemon(Thread self, String name, Closure closure) {
"""
Start a daemon Thread with a given name and the given closure as
a Runnable instance.
@param self placeholder variable used by Groovy categories; ignored for default static methods
@param name the name to give the thread
... | java | public static Thread startDaemon(Thread self, String name, Closure closure) {
return createThread(name, true, closure);
} | [
"public",
"static",
"Thread",
"startDaemon",
"(",
"Thread",
"self",
",",
"String",
"name",
",",
"Closure",
"closure",
")",
"{",
"return",
"createThread",
"(",
"name",
",",
"true",
",",
"closure",
")",
";",
"}"
] | Start a daemon Thread with a given name and the given closure as
a Runnable instance.
@param self placeholder variable used by Groovy categories; ignored for default static methods
@param name the name to give the thread
@param closure the Runnable closure
@return the started thread
@since 1.6 | [
"Start",
"a",
"daemon",
"Thread",
"with",
"a",
"given",
"name",
"and",
"the",
"given",
"closure",
"as",
"a",
"Runnable",
"instance",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java#L90-L92 |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java | JavaMailSender.setMimeContent | private void setMimeContent(Email email, MimeMessage mimeMsg) throws MessagingException, ContentHandlerException, AttachmentResourceHandlerException {
"""
Set the content on the mime message.
<p>
If the source email has several contents (for example text and html) and
attachments (with attachment content disp... | java | private void setMimeContent(Email email, MimeMessage mimeMsg) throws MessagingException, ContentHandlerException, AttachmentResourceHandlerException {
LOG.debug("Add message content for email {}", email);
// create the root as mixed
MimeMultipart rootContainer = new MimeMultipart("mixed");
// create the contain... | [
"private",
"void",
"setMimeContent",
"(",
"Email",
"email",
",",
"MimeMessage",
"mimeMsg",
")",
"throws",
"MessagingException",
",",
"ContentHandlerException",
",",
"AttachmentResourceHandlerException",
"{",
"LOG",
".",
"debug",
"(",
"\"Add message content for email {}\"",
... | Set the content on the mime message.
<p>
If the source email has several contents (for example text and html) and
attachments (with attachment content disposition), the mime message looks
like:
<pre>
mixed
related
alternative
[text/plain] text message
[text/html] html message
attachment 1
attachment 2
</pre>
<p>
If ... | [
"Set",
"the",
"content",
"on",
"the",
"mime",
"message",
"."
] | train | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java#L232-L266 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelCBEFormatter.java | HpelCBEFormatter.createEventOTag | private void createEventOTag(StringBuilder sb, RepositoryLogRecord record, Locale locale) {
"""
Appends the opening tag of a CommonBaseEvent XML element to a string buffer
@param sb the string buffer the tag will be added to
@param record the record that represents the common base event
@param locale ... | java | private void createEventOTag(StringBuilder sb, RepositoryLogRecord record, Locale locale){
sb.append("<CommonBaseEvent creationTime=\"");
// create the XML dateTime format
// TimeZone is UTC, but since we are dealing with Millis we are already in UTC.
sb.append(CBE_DATE_FORMAT.format(record.getMillis()));
sb.... | [
"private",
"void",
"createEventOTag",
"(",
"StringBuilder",
"sb",
",",
"RepositoryLogRecord",
"record",
",",
"Locale",
"locale",
")",
"{",
"sb",
".",
"append",
"(",
"\"<CommonBaseEvent creationTime=\\\"\"",
")",
";",
"// create the XML dateTime format",
"// TimeZone is UT... | Appends the opening tag of a CommonBaseEvent XML element to a string buffer
@param sb the string buffer the tag will be added to
@param record the record that represents the common base event
@param locale locale to be used for formatting the log record into CBE | [
"Appends",
"the",
"opening",
"tag",
"of",
"a",
"CommonBaseEvent",
"XML",
"element",
"to",
"a",
"string",
"buffer"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelCBEFormatter.java#L146-L170 |
jeluard/semantic-versioning | api/src/main/java/org/osjava/jardiff/PublicDiffCriteria.java | PublicDiffCriteria.differs | public boolean differs(MethodInfo oldInfo, MethodInfo newInfo) {
"""
Check if there is a change between two versions of a method.
Returns true if the access flags differ, or if the thrown
exceptions differ.
@param oldInfo Info about the old version of the method.
@param newInfo Info about the new version of ... | java | public boolean differs(MethodInfo oldInfo, MethodInfo newInfo) {
if (Tools.isMethodAccessChange(oldInfo.getAccess(), newInfo.getAccess()))
return true;
if (oldInfo.getExceptions() == null
|| newInfo.getExceptions() == null) {
if (oldInfo.getExceptions() != newInfo.get... | [
"public",
"boolean",
"differs",
"(",
"MethodInfo",
"oldInfo",
",",
"MethodInfo",
"newInfo",
")",
"{",
"if",
"(",
"Tools",
".",
"isMethodAccessChange",
"(",
"oldInfo",
".",
"getAccess",
"(",
")",
",",
"newInfo",
".",
"getAccess",
"(",
")",
")",
")",
"return... | Check if there is a change between two versions of a method.
Returns true if the access flags differ, or if the thrown
exceptions differ.
@param oldInfo Info about the old version of the method.
@param newInfo Info about the new version of the method.
@return True if the methods differ, false otherwise. | [
"Check",
"if",
"there",
"is",
"a",
"change",
"between",
"two",
"versions",
"of",
"a",
"method",
".",
"Returns",
"true",
"if",
"the",
"access",
"flags",
"differ",
"or",
"if",
"the",
"thrown",
"exceptions",
"differ",
"."
] | train | https://github.com/jeluard/semantic-versioning/blob/d0bfbeddca8ac4202f5225810227c72a708360a9/api/src/main/java/org/osjava/jardiff/PublicDiffCriteria.java#L102-L118 |
census-instrumentation/opencensus-java | impl_core/src/main/java/io/opencensus/implcore/tags/propagation/CorrelationContextFormat.java | CorrelationContextFormat.encodeTag | private static int encodeTag(Tag tag, StringBuilder stringBuilder) {
"""
Encodes the tag to the given string builder, and returns the length of encoded key-value pair.
"""
String key = tag.getKey().getName();
String value = tag.getValue().asString();
int charsOfTag = key.length() + value.length();
... | java | private static int encodeTag(Tag tag, StringBuilder stringBuilder) {
String key = tag.getKey().getName();
String value = tag.getValue().asString();
int charsOfTag = key.length() + value.length();
// This should never happen with our current constraints (<= 255 chars) on tags.
checkArgument(
... | [
"private",
"static",
"int",
"encodeTag",
"(",
"Tag",
"tag",
",",
"StringBuilder",
"stringBuilder",
")",
"{",
"String",
"key",
"=",
"tag",
".",
"getKey",
"(",
")",
".",
"getName",
"(",
")",
";",
"String",
"value",
"=",
"tag",
".",
"getValue",
"(",
")",
... | Encodes the tag to the given string builder, and returns the length of encoded key-value pair. | [
"Encodes",
"the",
"tag",
"to",
"the",
"given",
"string",
"builder",
"and",
"returns",
"the",
"length",
"of",
"encoded",
"key",
"-",
"value",
"pair",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/impl_core/src/main/java/io/opencensus/implcore/tags/propagation/CorrelationContextFormat.java#L127-L139 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/HttpURLConnection.java | HttpURLConnection.writeRequestHeaders | private static void writeRequestHeaders(OutputStream pOut, URL pURL, String pMethod, Properties pProps, boolean pUsingProxy,
PasswordAuthentication pAuth, String pAuthType) {
"""
Writes the HTTP request headers, for HTTP GET method.
@see <A href="http://www.w3.org/Pro... | java | private static void writeRequestHeaders(OutputStream pOut, URL pURL, String pMethod, Properties pProps, boolean pUsingProxy,
PasswordAuthentication pAuth, String pAuthType) {
PrintWriter out = new PrintWriter(pOut, true); // autoFlush
if (!pUsingProxy) {
... | [
"private",
"static",
"void",
"writeRequestHeaders",
"(",
"OutputStream",
"pOut",
",",
"URL",
"pURL",
",",
"String",
"pMethod",
",",
"Properties",
"pProps",
",",
"boolean",
"pUsingProxy",
",",
"PasswordAuthentication",
"pAuth",
",",
"String",
"pAuthType",
")",
"{",... | Writes the HTTP request headers, for HTTP GET method.
@see <A href="http://www.w3.org/Protocols/rfc2616/rfc2616.html">RFC 2616</A> | [
"Writes",
"the",
"HTTP",
"request",
"headers",
"for",
"HTTP",
"GET",
"method",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/HttpURLConnection.java#L681-L744 |
CloudBees-community/syslog-java-client | src/main/java/com/cloudbees/syslog/integration/jul/util/LogManagerHelper.java | LogManagerHelper.getBooleanProperty | public static boolean getBooleanProperty(@Nonnull LogManager manager, @Nullable String name, boolean defaultValue) {
"""
Visible version of {@link java.util.logging.LogManager#getIntProperty(String, int)}.
Method to get a boolean property.
If the property is not defined or cannot be parsed we return the give... | java | public static boolean getBooleanProperty(@Nonnull LogManager manager, @Nullable String name, boolean defaultValue) {
if (name == null) {
return defaultValue;
}
String val = manager.getProperty(name);
if (val == null) {
return defaultValue;
}
val = ... | [
"public",
"static",
"boolean",
"getBooleanProperty",
"(",
"@",
"Nonnull",
"LogManager",
"manager",
",",
"@",
"Nullable",
"String",
"name",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}"... | Visible version of {@link java.util.logging.LogManager#getIntProperty(String, int)}.
Method to get a boolean property.
If the property is not defined or cannot be parsed we return the given default value. | [
"Visible",
"version",
"of",
"{",
"@link",
"java",
".",
"util",
".",
"logging",
".",
"LogManager#getIntProperty",
"(",
"String",
"int",
")",
"}",
"."
] | train | https://github.com/CloudBees-community/syslog-java-client/blob/41e01206e4ce17c6d225ffb443bf19792a3f3c3a/src/main/java/com/cloudbees/syslog/integration/jul/util/LogManagerHelper.java#L159-L174 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | app/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/app/MainActivity.java | MainActivity.sendAutoRetryRequest | private void sendAutoRetryRequest(ResponseListener responseListener) {
"""
Exercise auto-retries by trying to resend a request up to 5 times with a 504 (gateway timeout) response
"""
Log.i("BMSCore", String.format("\n\nSending request to 504 endpoint"));
Request request504 = new Request("http://httpstat.u... | java | private void sendAutoRetryRequest(ResponseListener responseListener) {
Log.i("BMSCore", String.format("\n\nSending request to 504 endpoint"));
Request request504 = new Request("http://httpstat.us/504", Request.POST, 1000, 5);
request504.send(getApplicationContext(), "Sample upload text", responseListener);
} | [
"private",
"void",
"sendAutoRetryRequest",
"(",
"ResponseListener",
"responseListener",
")",
"{",
"Log",
".",
"i",
"(",
"\"BMSCore\"",
",",
"String",
".",
"format",
"(",
"\"\\n\\nSending request to 504 endpoint\"",
")",
")",
";",
"Request",
"request504",
"=",
"new",... | Exercise auto-retries by trying to resend a request up to 5 times with a 504 (gateway timeout) response | [
"Exercise",
"auto",
"-",
"retries",
"by",
"trying",
"to",
"resend",
"a",
"request",
"up",
"to",
"5",
"times",
"with",
"a",
"504",
"(",
"gateway",
"timeout",
")",
"response"
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/app/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/app/MainActivity.java#L141-L146 |
lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigFactory.java | XMLConfigFactory.getChildByName | static Element getChildByName(Node parent, String nodeName) {
"""
return first direct child Elements of a Element with given Name
@param parent
@param nodeName
@return matching children
"""
return getChildByName(parent, nodeName, false);
} | java | static Element getChildByName(Node parent, String nodeName) {
return getChildByName(parent, nodeName, false);
} | [
"static",
"Element",
"getChildByName",
"(",
"Node",
"parent",
",",
"String",
"nodeName",
")",
"{",
"return",
"getChildByName",
"(",
"parent",
",",
"nodeName",
",",
"false",
")",
";",
"}"
] | return first direct child Elements of a Element with given Name
@param parent
@param nodeName
@return matching children | [
"return",
"first",
"direct",
"child",
"Elements",
"of",
"a",
"Element",
"with",
"given",
"Name"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigFactory.java#L211-L213 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixRedundantAgentCapacityUse | @Fix(io.sarl.lang.validation.IssueCodes.REDUNDANT_CAPACITY_USE)
public void fixRedundantAgentCapacityUse(final Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Redundant capacity use".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
CapacityReferenceRemoveModificat... | java | @Fix(io.sarl.lang.validation.IssueCodes.REDUNDANT_CAPACITY_USE)
public void fixRedundantAgentCapacityUse(final Issue issue, IssueResolutionAcceptor acceptor) {
CapacityReferenceRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"io",
".",
"sarl",
".",
"lang",
".",
"validation",
".",
"IssueCodes",
".",
"REDUNDANT_CAPACITY_USE",
")",
"public",
"void",
"fixRedundantAgentCapacityUse",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"Ca... | Quick fix for "Redundant capacity use".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Redundant",
"capacity",
"use",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L896-L899 |
craterdog/java-security-framework | java-certificate-management-providers/src/main/java/craterdog/security/RsaCertificateManager.java | RsaCertificateManager.decodeSigningRequest | public PKCS10CertificationRequest decodeSigningRequest(String csr) {
"""
This method decodes a certificate signing request (CSR) from a string. This is a convenience
method that really should be part of the <code>CertificateManagement</code> interface except
that it depends on a Bouncy Castle class in the signa... | java | public PKCS10CertificationRequest decodeSigningRequest(String csr) {
logger.entry();
try (StringReader sreader = new StringReader(csr); PemReader preader = new PemReader(sreader)) {
byte[] requestBytes = preader.readPemObject().getContent();
PKCS10CertificationRequest result ... | [
"public",
"PKCS10CertificationRequest",
"decodeSigningRequest",
"(",
"String",
"csr",
")",
"{",
"logger",
".",
"entry",
"(",
")",
";",
"try",
"(",
"StringReader",
"sreader",
"=",
"new",
"StringReader",
"(",
"csr",
")",
";",
"PemReader",
"preader",
"=",
"new",
... | This method decodes a certificate signing request (CSR) from a string. This is a convenience
method that really should be part of the <code>CertificateManagement</code> interface except
that it depends on a Bouncy Castle class in the signature. The java security framework does
not have a similar class so it has been ... | [
"This",
"method",
"decodes",
"a",
"certificate",
"signing",
"request",
"(",
"CSR",
")",
"from",
"a",
"string",
".",
"This",
"is",
"a",
"convenience",
"method",
"that",
"really",
"should",
"be",
"part",
"of",
"the",
"<code",
">",
"CertificateManagement<",
"/"... | train | https://github.com/craterdog/java-security-framework/blob/a5634c19812d473b608bc11060f5cbb4b4b0b5da/java-certificate-management-providers/src/main/java/craterdog/security/RsaCertificateManager.java#L245-L257 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java | DiagnosticsInner.getSiteDetectorResponseAsync | public Observable<DetectorResponseInner> getSiteDetectorResponseAsync(String resourceGroupName, String siteName, String detectorName, DateTime startTime, DateTime endTime, String timeGrain) {
"""
Get site detector response.
Get site detector response.
@param resourceGroupName Name of the resource group to whic... | java | public Observable<DetectorResponseInner> getSiteDetectorResponseAsync(String resourceGroupName, String siteName, String detectorName, DateTime startTime, DateTime endTime, String timeGrain) {
return getSiteDetectorResponseWithServiceResponseAsync(resourceGroupName, siteName, detectorName, startTime, endTime, ti... | [
"public",
"Observable",
"<",
"DetectorResponseInner",
">",
"getSiteDetectorResponseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"detectorName",
",",
"DateTime",
"startTime",
",",
"DateTime",
"endTime",
",",
"String",
"timeGrain",... | Get site detector response.
Get site detector response.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param detectorName Detector Resource Name
@param startTime Start Time
@param endTime End Time
@param timeGrain Time Grain
@throws IllegalArgumentExceptio... | [
"Get",
"site",
"detector",
"response",
".",
"Get",
"site",
"detector",
"response",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java#L797-L804 |
astrapi69/jaulp-wicket | jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java | PackageResourceReferences.initializeResources | public void initializeResources(final String packageName)
throws ClassNotFoundException, IOException, URISyntaxException {
"""
Initialize resources from the given package.
@param packageName
the package name
@throws ClassNotFoundException
occurs if a given class cannot be located by the specified class loa... | java | public void initializeResources(final String packageName)
throws ClassNotFoundException, IOException, URISyntaxException
{
final Map<Class<?>, ImportResource[]> resourcesMap = ImportResourcesExtensions
.getImportResources(packageName);
for (final Entry<Class<?>, ImportResource[]> entry : resourcesMap.entrySe... | [
"public",
"void",
"initializeResources",
"(",
"final",
"String",
"packageName",
")",
"throws",
"ClassNotFoundException",
",",
"IOException",
",",
"URISyntaxException",
"{",
"final",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"ImportResource",
"[",
"]",
">",
"resou... | Initialize resources from the given package.
@param packageName
the package name
@throws ClassNotFoundException
occurs if a given class cannot be located by the specified class loader
@throws IOException
Signals that an I/O exception has occurred.
@throws URISyntaxException
is thrown if a string could not be parsed as... | [
"Initialize",
"resources",
"from",
"the",
"given",
"package",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java#L220-L252 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Application.java | Application.get | public static Application get(final BandwidthClient client, final String id) throws Exception {
"""
Factory method for Application, returns Application object
@param client the client
@param id the application id
@return the application
@throws IOException unexpected error.
"""
assert(id != null);
... | java | public static Application get(final BandwidthClient client, final String id) throws Exception {
assert(id != null);
final String applicationUri = client.getUserResourceInstanceUri(BandwidthConstants.APPLICATIONS_URI_PATH, id);
final JSONObject applicationObj = toJSONObject( client.get(applicatio... | [
"public",
"static",
"Application",
"get",
"(",
"final",
"BandwidthClient",
"client",
",",
"final",
"String",
"id",
")",
"throws",
"Exception",
"{",
"assert",
"(",
"id",
"!=",
"null",
")",
";",
"final",
"String",
"applicationUri",
"=",
"client",
".",
"getUser... | Factory method for Application, returns Application object
@param client the client
@param id the application id
@return the application
@throws IOException unexpected error. | [
"Factory",
"method",
"for",
"Application",
"returns",
"Application",
"object"
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Application.java#L40-L47 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/dbhandling/DBHandlingTask.java | DBHandlingTask.addIncludes | private void addIncludes(DBHandling handling, FileSet fileSet) throws BuildException {
"""
Adds the includes of the fileset to the handling.
@param handling The handling
@param fileSet The fileset
"""
DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
String[] ... | java | private void addIncludes(DBHandling handling, FileSet fileSet) throws BuildException
{
DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
String[] files = scanner.getIncludedFiles();
StringBuffer includes = new StringBuffer();
for (int idx = ... | [
"private",
"void",
"addIncludes",
"(",
"DBHandling",
"handling",
",",
"FileSet",
"fileSet",
")",
"throws",
"BuildException",
"{",
"DirectoryScanner",
"scanner",
"=",
"fileSet",
".",
"getDirectoryScanner",
"(",
"getProject",
"(",
")",
")",
";",
"String",
"[",
"]"... | Adds the includes of the fileset to the handling.
@param handling The handling
@param fileSet The fileset | [
"Adds",
"the",
"includes",
"of",
"the",
"fileset",
"to",
"the",
"handling",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/dbhandling/DBHandlingTask.java#L271-L293 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CompoundTransliterator.java | CompoundTransliterator._smartAppend | private static void _smartAppend(StringBuilder buf, char c) {
"""
Append c to buf, unless buf is empty or buf already ends in c.
"""
if (buf.length() != 0 &&
buf.charAt(buf.length() - 1) != c) {
buf.append(c);
}
} | java | private static void _smartAppend(StringBuilder buf, char c) {
if (buf.length() != 0 &&
buf.charAt(buf.length() - 1) != c) {
buf.append(c);
}
} | [
"private",
"static",
"void",
"_smartAppend",
"(",
"StringBuilder",
"buf",
",",
"char",
"c",
")",
"{",
"if",
"(",
"buf",
".",
"length",
"(",
")",
"!=",
"0",
"&&",
"buf",
".",
"charAt",
"(",
"buf",
".",
"length",
"(",
")",
"-",
"1",
")",
"!=",
"c",... | Append c to buf, unless buf is empty or buf already ends in c. | [
"Append",
"c",
"to",
"buf",
"unless",
"buf",
"is",
"empty",
"or",
"buf",
"already",
"ends",
"in",
"c",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CompoundTransliterator.java#L250-L255 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBaseGridScreen.java | XBaseGridScreen.printEndGridScreenData | public void printEndGridScreenData(PrintWriter out, int iPrintOptions) {
"""
Display the start grid in input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
"""
out.println(Utility.endTag(XMLTags.DATA));
} | java | public void printEndGridScreenData(PrintWriter out, int iPrintOptions)
{
out.println(Utility.endTag(XMLTags.DATA));
} | [
"public",
"void",
"printEndGridScreenData",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"out",
".",
"println",
"(",
"Utility",
".",
"endTag",
"(",
"XMLTags",
".",
"DATA",
")",
")",
";",
"}"
] | Display the start grid in input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception. | [
"Display",
"the",
"start",
"grid",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBaseGridScreen.java#L157-L160 |
google/closure-compiler | src/com/google/javascript/jscomp/gwt/client/JsfileParser.java | JsfileParser.gjd | @JsMethod(namespace = "jscomp")
public static JsObject<Object> gjd(String code, String filename, @Nullable Reporter reporter) {
"""
Method exported to JS to parse a file for dependencies and annotations.
"""
return parse(code, filename, reporter).full();
} | java | @JsMethod(namespace = "jscomp")
public static JsObject<Object> gjd(String code, String filename, @Nullable Reporter reporter) {
return parse(code, filename, reporter).full();
} | [
"@",
"JsMethod",
"(",
"namespace",
"=",
"\"jscomp\"",
")",
"public",
"static",
"JsObject",
"<",
"Object",
">",
"gjd",
"(",
"String",
"code",
",",
"String",
"filename",
",",
"@",
"Nullable",
"Reporter",
"reporter",
")",
"{",
"return",
"parse",
"(",
"code",
... | Method exported to JS to parse a file for dependencies and annotations. | [
"Method",
"exported",
"to",
"JS",
"to",
"parse",
"a",
"file",
"for",
"dependencies",
"and",
"annotations",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/gwt/client/JsfileParser.java#L219-L222 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/annotation/AnnotationValue.java | AnnotationValue.getValue | public <T> Optional<T> getValue(ArgumentConversionContext<T> conversionContext) {
"""
Get the value of the {@code value} member of the annotation.
@param conversionContext The conversion context
@param <T> The type
@return The result
"""
return get(AnnotationMetadata.VALUE_MEMBER, conversionContex... | java | public <T> Optional<T> getValue(ArgumentConversionContext<T> conversionContext) {
return get(AnnotationMetadata.VALUE_MEMBER, conversionContext);
} | [
"public",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"getValue",
"(",
"ArgumentConversionContext",
"<",
"T",
">",
"conversionContext",
")",
"{",
"return",
"get",
"(",
"AnnotationMetadata",
".",
"VALUE_MEMBER",
",",
"conversionContext",
")",
";",
"}"
] | Get the value of the {@code value} member of the annotation.
@param conversionContext The conversion context
@param <T> The type
@return The result | [
"Get",
"the",
"value",
"of",
"the",
"{",
"@code",
"value",
"}",
"member",
"of",
"the",
"annotation",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/annotation/AnnotationValue.java#L176-L178 |
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.getRegexEntityInfosWithServiceResponseAsync | public Observable<ServiceResponse<List<RegexEntityExtractor>>> getRegexEntityInfosWithServiceResponseAsync(UUID appId, String versionId, GetRegexEntityInfosOptionalParameter getRegexEntityInfosOptionalParameter) {
"""
Gets information about the regex entity models.
@param appId The application ID.
@param versi... | java | public Observable<ServiceResponse<List<RegexEntityExtractor>>> getRegexEntityInfosWithServiceResponseAsync(UUID appId, String versionId, GetRegexEntityInfosOptionalParameter getRegexEntityInfosOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter th... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"RegexEntityExtractor",
">",
">",
">",
"getRegexEntityInfosWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"GetRegexEntityInfosOptionalParameter",
"getRegexEntityInfosOptionalP... | Gets information about the regex entity models.
@param appId The application ID.
@param versionId The version ID.
@param getRegexEntityInfosOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@retu... | [
"Gets",
"information",
"about",
"the",
"regex",
"entity",
"models",
"."
] | 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#L7165-L7179 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java | DBTransaction.deleteRow | public void deleteRow(String storeName, String rowKey) {
"""
Add an update that will delete the row with the given row key from the given store.
@param storeName Name of store from which to delete an object row.
@param rowKey Row key in string form.
"""
m_rowDeletes.add(new RowDelete(storeName,... | java | public void deleteRow(String storeName, String rowKey) {
m_rowDeletes.add(new RowDelete(storeName, rowKey));
} | [
"public",
"void",
"deleteRow",
"(",
"String",
"storeName",
",",
"String",
"rowKey",
")",
"{",
"m_rowDeletes",
".",
"add",
"(",
"new",
"RowDelete",
"(",
"storeName",
",",
"rowKey",
")",
")",
";",
"}"
] | Add an update that will delete the row with the given row key from the given store.
@param storeName Name of store from which to delete an object row.
@param rowKey Row key in string form. | [
"Add",
"an",
"update",
"that",
"will",
"delete",
"the",
"row",
"with",
"the",
"given",
"row",
"key",
"from",
"the",
"given",
"store",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java#L230-L232 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/ImageGray.java | ImageGray.reshape | @Override
public void reshape(int width, int height) {
"""
Changes the image's width and height without declaring new memory. If the internal array
is not large enough to store the new image an IllegalArgumentException is thrown.
@param width The new width.
@param height The new height.
"""
if( this.w... | java | @Override
public void reshape(int width, int height) {
if( this.width == width && this.height == height )
return;
if( isSubimage() )
throw new IllegalArgumentException("Can't reshape sub-images");
Object data = _getData();
if( Array.getLength(data) < width*height ) {
// declare a new larger image ... | [
"@",
"Override",
"public",
"void",
"reshape",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"if",
"(",
"this",
".",
"width",
"==",
"width",
"&&",
"this",
".",
"height",
"==",
"height",
")",
"return",
";",
"if",
"(",
"isSubimage",
"(",
")",
"... | Changes the image's width and height without declaring new memory. If the internal array
is not large enough to store the new image an IllegalArgumentException is thrown.
@param width The new width.
@param height The new height. | [
"Changes",
"the",
"image",
"s",
"width",
"and",
"height",
"without",
"declaring",
"new",
"memory",
".",
"If",
"the",
"internal",
"array",
"is",
"not",
"large",
"enough",
"to",
"store",
"the",
"new",
"image",
"an",
"IllegalArgumentException",
"is",
"thrown",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageGray.java#L141-L159 |
rolfl/MicroBench | src/main/java/net/tuis/ubench/UBench.java | UBench.addLongTask | public UBench addLongTask(String name, LongSupplier task) {
"""
Include a long-specialized named task in to the benchmark.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@return The same object, for chaining calls.
"""
return addLon... | java | public UBench addLongTask(String name, LongSupplier task) {
return addLongTask(name, task, null);
} | [
"public",
"UBench",
"addLongTask",
"(",
"String",
"name",
",",
"LongSupplier",
"task",
")",
"{",
"return",
"addLongTask",
"(",
"name",
",",
"task",
",",
"null",
")",
";",
"}"
] | Include a long-specialized named task in to the benchmark.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@return The same object, for chaining calls. | [
"Include",
"a",
"long",
"-",
"specialized",
"named",
"task",
"in",
"to",
"the",
"benchmark",
"."
] | train | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UBench.java#L231-L233 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/effect/EffectUtils.java | EffectUtils.gaussianBlur | static BufferedImage gaussianBlur(BufferedImage src, BufferedImage dst, int radius) {
"""
Apply Gaussian Blur to Image
@param src The image tp
@param dst The destination image to draw blured src image into, null
if you want a new one created
@param radius The blur kernel radius
@return The blured... | java | static BufferedImage gaussianBlur(BufferedImage src, BufferedImage dst, int radius) {
int width = src.getWidth();
int height = src.getHeight();
if (dst == null || dst.getWidth() != width || dst.getHeight() != height || src.getType() != dst.getType()) {
dst = createColorModelCompati... | [
"static",
"BufferedImage",
"gaussianBlur",
"(",
"BufferedImage",
"src",
",",
"BufferedImage",
"dst",
",",
"int",
"radius",
")",
"{",
"int",
"width",
"=",
"src",
".",
"getWidth",
"(",
")",
";",
"int",
"height",
"=",
"src",
".",
"getHeight",
"(",
")",
";",... | Apply Gaussian Blur to Image
@param src The image tp
@param dst The destination image to draw blured src image into, null
if you want a new one created
@param radius The blur kernel radius
@return The blured image | [
"Apply",
"Gaussian",
"Blur",
"to",
"Image"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/effect/EffectUtils.java#L66-L112 |
VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/saverestore/SnapshotUtil.java | SnapshotUtil.writeSnapshotCatalog | public static Runnable writeSnapshotCatalog(String path, String nonce, boolean isTruncationSnapshot)
throws IOException {
"""
Write the current catalog associated with the database snapshot
to the snapshot location
"""
String filename = SnapshotUtil.constructCatalogFilenameForNonce(nonce);
... | java | public static Runnable writeSnapshotCatalog(String path, String nonce, boolean isTruncationSnapshot)
throws IOException
{
String filename = SnapshotUtil.constructCatalogFilenameForNonce(nonce);
try
{
return VoltDB.instance().getCatalogContext().writeCatalogJarToFile(path, fil... | [
"public",
"static",
"Runnable",
"writeSnapshotCatalog",
"(",
"String",
"path",
",",
"String",
"nonce",
",",
"boolean",
"isTruncationSnapshot",
")",
"throws",
"IOException",
"{",
"String",
"filename",
"=",
"SnapshotUtil",
".",
"constructCatalogFilenameForNonce",
"(",
"... | Write the current catalog associated with the database snapshot
to the snapshot location | [
"Write",
"the",
"current",
"catalog",
"associated",
"with",
"the",
"database",
"snapshot",
"to",
"the",
"snapshot",
"location"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/saverestore/SnapshotUtil.java#L456-L474 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java | Subtypes2.getFirstCommonSuperclass | public ObjectType getFirstCommonSuperclass(ObjectType a, ObjectType b) throws ClassNotFoundException {
"""
Get the first common superclass of the given object types. Note that an
interface type is never returned unless <code>a</code> and <code>b</code>
are the same type. Otherwise, we try to return as accurate a... | java | public ObjectType getFirstCommonSuperclass(ObjectType a, ObjectType b) throws ClassNotFoundException {
// Easy case
if (a.equals(b)) {
return a;
}
ObjectType firstCommonSupertype = (ObjectType) checkFirstCommonSuperclassQueryCache(a, b);
if (firstCommonSupertype == n... | [
"public",
"ObjectType",
"getFirstCommonSuperclass",
"(",
"ObjectType",
"a",
",",
"ObjectType",
"b",
")",
"throws",
"ClassNotFoundException",
"{",
"// Easy case",
"if",
"(",
"a",
".",
"equals",
"(",
"b",
")",
")",
"{",
"return",
"a",
";",
"}",
"ObjectType",
"... | Get the first common superclass of the given object types. Note that an
interface type is never returned unless <code>a</code> and <code>b</code>
are the same type. Otherwise, we try to return as accurate a type as
possible. This method is used as the meet operator in
TypeDataflowAnalysis, and is intended to follow (mo... | [
"Get",
"the",
"first",
"common",
"superclass",
"of",
"the",
"given",
"object",
"types",
".",
"Note",
"that",
"an",
"interface",
"type",
"is",
"never",
"returned",
"unless",
"<code",
">",
"a<",
"/",
"code",
">",
"and",
"<code",
">",
"b<",
"/",
"code",
"... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java#L702-L715 |
ziccardi/jnrpe | jnrpe-plugins/src/main/java/it/jnrpe/plugin/mysql/CheckMysql.java | CheckMysql.configureThresholdEvaluatorBuilder | @Override
public final void configureThresholdEvaluatorBuilder(final ThresholdsEvaluatorBuilder thrb, final ICommandLine cl) throws BadThresholdException {
"""
Configures the threshold evaluator. This plugin supports both the legacy
threshold format and the new format specification.
@param thrb
- the eval... | java | @Override
public final void configureThresholdEvaluatorBuilder(final ThresholdsEvaluatorBuilder thrb, final ICommandLine cl) throws BadThresholdException {
if (cl.hasOption("th")) {
super.configureThresholdEvaluatorBuilder(thrb, cl);
} else {
thrb.withLegacyThreshold("time", ... | [
"@",
"Override",
"public",
"final",
"void",
"configureThresholdEvaluatorBuilder",
"(",
"final",
"ThresholdsEvaluatorBuilder",
"thrb",
",",
"final",
"ICommandLine",
"cl",
")",
"throws",
"BadThresholdException",
"{",
"if",
"(",
"cl",
".",
"hasOption",
"(",
"\"th\"",
"... | Configures the threshold evaluator. This plugin supports both the legacy
threshold format and the new format specification.
@param thrb
- the evaluator to be configured
@param cl
- the received command line
@throws BadThresholdException
- if the threshold can't be parsed | [
"Configures",
"the",
"threshold",
"evaluator",
".",
"This",
"plugin",
"supports",
"both",
"the",
"legacy",
"threshold",
"format",
"and",
"the",
"new",
"format",
"specification",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-plugins/src/main/java/it/jnrpe/plugin/mysql/CheckMysql.java#L58-L66 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java | ICUResourceBundle.getAvailableULocales | public static final ULocale[] getAvailableULocales(String baseName, ClassLoader loader) {
"""
Get the set of Locales installed in the specified bundles.
@return the list of available locales
"""
return getAvailEntry(baseName, loader).getULocaleList();
} | java | public static final ULocale[] getAvailableULocales(String baseName, ClassLoader loader) {
return getAvailEntry(baseName, loader).getULocaleList();
} | [
"public",
"static",
"final",
"ULocale",
"[",
"]",
"getAvailableULocales",
"(",
"String",
"baseName",
",",
"ClassLoader",
"loader",
")",
"{",
"return",
"getAvailEntry",
"(",
"baseName",
",",
"loader",
")",
".",
"getULocaleList",
"(",
")",
";",
"}"
] | Get the set of Locales installed in the specified bundles.
@return the list of available locales | [
"Get",
"the",
"set",
"of",
"Locales",
"installed",
"in",
"the",
"specified",
"bundles",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java#L475-L477 |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/jhlabs/image/GaussianFilter.java | GaussianFilter.makeKernel | public static Kernel makeKernel(float radius) {
"""
Make a Gaussian blur kernel.
@param radius the blur radius
@return the kernel
"""
int r = (int) Math.ceil(radius);
int rows = r * 2 + 1;
float[] matrix = new float[rows];
float sigma = radius / 3;
float sigma22 = 2 ... | java | public static Kernel makeKernel(float radius) {
int r = (int) Math.ceil(radius);
int rows = r * 2 + 1;
float[] matrix = new float[rows];
float sigma = radius / 3;
float sigma22 = 2 * sigma * sigma;
float sigmaPi2 = 2 * ImageMath.PI * sigma;
float sqrtSigmaPi2 = (f... | [
"public",
"static",
"Kernel",
"makeKernel",
"(",
"float",
"radius",
")",
"{",
"int",
"r",
"=",
"(",
"int",
")",
"Math",
".",
"ceil",
"(",
"radius",
")",
";",
"int",
"rows",
"=",
"r",
"*",
"2",
"+",
"1",
";",
"float",
"[",
"]",
"matrix",
"=",
"n... | Make a Gaussian blur kernel.
@param radius the blur radius
@return the kernel | [
"Make",
"a",
"Gaussian",
"blur",
"kernel",
"."
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/GaussianFilter.java#L176-L200 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/Graph.java | Graph.findPath | protected String findPath(String start, String end) {
"""
Find the path.
@param start key of first node in the path
@param end key of last node in the path
@return string containing the nodes keys in the path separated by arrow symbol
"""
if (start.equals(end)) {
return start;
... | java | protected String findPath(String start, String end) {
if (start.equals(end)) {
return start;
} else {
return findPath(start, parent.get(end)) + " -> " + end;
}
} | [
"protected",
"String",
"findPath",
"(",
"String",
"start",
",",
"String",
"end",
")",
"{",
"if",
"(",
"start",
".",
"equals",
"(",
"end",
")",
")",
"{",
"return",
"start",
";",
"}",
"else",
"{",
"return",
"findPath",
"(",
"start",
",",
"parent",
".",... | Find the path.
@param start key of first node in the path
@param end key of last node in the path
@return string containing the nodes keys in the path separated by arrow symbol | [
"Find",
"the",
"path",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/Graph.java#L156-L162 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/CollectionUtils.java | CollectionUtils.toCollection | @SneakyThrows
public static <T extends Collection> T toCollection(final Object obj, final Class<T> clazz) {
"""
To collection t.
@param <T> the type parameter
@param obj the obj
@param clazz the clazz
@return the t
"""
val results = toCollection(obj);
if (clazz.isInterface()) {
... | java | @SneakyThrows
public static <T extends Collection> T toCollection(final Object obj, final Class<T> clazz) {
val results = toCollection(obj);
if (clazz.isInterface()) {
throw new IllegalArgumentException("Cannot accept an interface " + clazz.getSimpleName() + " to create a new object inst... | [
"@",
"SneakyThrows",
"public",
"static",
"<",
"T",
"extends",
"Collection",
">",
"T",
"toCollection",
"(",
"final",
"Object",
"obj",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"val",
"results",
"=",
"toCollection",
"(",
"obj",
")",
";",
"... | To collection t.
@param <T> the type parameter
@param obj the obj
@param clazz the clazz
@return the t | [
"To",
"collection",
"t",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/CollectionUtils.java#L62-L71 |
mnlipp/jgrapes | examples/src/org/jgrapes/http/demo/httpserver/WsEchoServer.java | WsEchoServer.onInput | @Handler
public void onInput(Input<CharBuffer> event, IOSubchannel channel) {
"""
Process the input data.
@param event the event
@param channel the channel
"""
if (!openChannels.contains(channel)) {
return;
}
ManagedBuffer<CharBuffer> out = ManagedBuffer.wrap(
... | java | @Handler
public void onInput(Input<CharBuffer> event, IOSubchannel channel) {
if (!openChannels.contains(channel)) {
return;
}
ManagedBuffer<CharBuffer> out = ManagedBuffer.wrap(
CharBuffer.wrap(event.data()));
out.position(out.limit());
out.flip();
... | [
"@",
"Handler",
"public",
"void",
"onInput",
"(",
"Input",
"<",
"CharBuffer",
">",
"event",
",",
"IOSubchannel",
"channel",
")",
"{",
"if",
"(",
"!",
"openChannels",
".",
"contains",
"(",
"channel",
")",
")",
"{",
"return",
";",
"}",
"ManagedBuffer",
"<"... | Process the input data.
@param event the event
@param channel the channel | [
"Process",
"the",
"input",
"data",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/examples/src/org/jgrapes/http/demo/httpserver/WsEchoServer.java#L100-L114 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java | AbstractCodeGen.writeRightCurlyBracket | void writeRightCurlyBracket(Writer out, int indent) throws IOException {
"""
Output right curly bracket
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeEol(out);
writeWithIndent(out, indent, "}\n");
} | java | void writeRightCurlyBracket(Writer out, int indent) throws IOException
{
writeEol(out);
writeWithIndent(out, indent, "}\n");
} | [
"void",
"writeRightCurlyBracket",
"(",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeEol",
"(",
"out",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"}\\n\"",
")",
";",
"}"
] | Output right curly bracket
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"right",
"curly",
"bracket"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java#L202-L206 |
airbnb/lottie-android | lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java | LottieDrawable.setImageAssetDelegate | public void setImageAssetDelegate(
@SuppressWarnings("NullableProblems") ImageAssetDelegate assetDelegate) {
"""
Use this if you can't bundle images with your app. This may be useful if you download the
animations from the network or have the images saved to an SD Card. In that case, Lottie
will defer the ... | java | public void setImageAssetDelegate(
@SuppressWarnings("NullableProblems") ImageAssetDelegate assetDelegate) {
this.imageAssetDelegate = assetDelegate;
if (imageAssetManager != null) {
imageAssetManager.setDelegate(assetDelegate);
}
} | [
"public",
"void",
"setImageAssetDelegate",
"(",
"@",
"SuppressWarnings",
"(",
"\"NullableProblems\"",
")",
"ImageAssetDelegate",
"assetDelegate",
")",
"{",
"this",
".",
"imageAssetDelegate",
"=",
"assetDelegate",
";",
"if",
"(",
"imageAssetManager",
"!=",
"null",
")",... | Use this if you can't bundle images with your app. This may be useful if you download the
animations from the network or have the images saved to an SD Card. In that case, Lottie
will defer the loading of the bitmap to this delegate.
<p>
Be wary if you are using many images, however. Lottie is designed to work with vec... | [
"Use",
"this",
"if",
"you",
"can",
"t",
"bundle",
"images",
"with",
"your",
"app",
".",
"This",
"may",
"be",
"useful",
"if",
"you",
"download",
"the",
"animations",
"from",
"the",
"network",
"or",
"have",
"the",
"images",
"saved",
"to",
"an",
"SD",
"Ca... | train | https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L776-L782 |
timehop/sticky-headers-recyclerview | library/src/main/java/com/timehop/stickyheadersrecyclerview/HeaderPositionCalculator.java | HeaderPositionCalculator.itemIsObscuredByHeader | private boolean itemIsObscuredByHeader(RecyclerView parent, View item, View header, int orientation) {
"""
Determines if an item is obscured by a header
@param parent
@param item to determine if obscured by header
@param header that might be obscuring the item
@param orientation of the {@link R... | java | private boolean itemIsObscuredByHeader(RecyclerView parent, View item, View header, int orientation) {
RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) item.getLayoutParams();
mDimensionCalculator.initMargins(mTempRect1, header);
int adapterPosition = parent.getChildAdapterPosition(item... | [
"private",
"boolean",
"itemIsObscuredByHeader",
"(",
"RecyclerView",
"parent",
",",
"View",
"item",
",",
"View",
"header",
",",
"int",
"orientation",
")",
"{",
"RecyclerView",
".",
"LayoutParams",
"layoutParams",
"=",
"(",
"RecyclerView",
".",
"LayoutParams",
")",... | Determines if an item is obscured by a header
@param parent
@param item to determine if obscured by header
@param header that might be obscuring the item
@param orientation of the {@link RecyclerView}
@return true if the item view is obscured by the header view | [
"Determines",
"if",
"an",
"item",
"is",
"obscured",
"by",
"a",
"header"
] | train | https://github.com/timehop/sticky-headers-recyclerview/blob/f5a9e9b8f5d96734e20439b0a41381865fa52fb7/library/src/main/java/com/timehop/stickyheadersrecyclerview/HeaderPositionCalculator.java#L218-L244 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java | PersistentTimerTaskHandler.serializeObject | private static byte[] serializeObject(Object obj) {
"""
Internal convenience method for serializing the user info object to a byte array.
"""
if (obj == null) {
return null;
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
ObjectOutputS... | java | private static byte[] serializeObject(Object obj) {
if (obj == null) {
return null;
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(obj);
out.flush()... | [
"private",
"static",
"byte",
"[",
"]",
"serializeObject",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"try",
"{... | Internal convenience method for serializing the user info object to a byte array. | [
"Internal",
"convenience",
"method",
"for",
"serializing",
"the",
"user",
"info",
"object",
"to",
"a",
"byte",
"array",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java#L768-L784 |
samskivert/samskivert | src/main/java/com/samskivert/util/IntIntMap.java | IntIntMap.put | public void put (int key, int value) {
"""
Adds the supplied key/value mapping. Any previous mapping for that key will be overwritten.
"""
_modCount++;
// check to see if we've passed our load factor, if so: resize
ensureCapacity(_size + 1);
int index = Math.abs(key)%_buckets.... | java | public void put (int key, int value)
{
_modCount++;
// check to see if we've passed our load factor, if so: resize
ensureCapacity(_size + 1);
int index = Math.abs(key)%_buckets.length;
Record rec = _buckets[index];
// either we start a new chain
if (rec == ... | [
"public",
"void",
"put",
"(",
"int",
"key",
",",
"int",
"value",
")",
"{",
"_modCount",
"++",
";",
"// check to see if we've passed our load factor, if so: resize",
"ensureCapacity",
"(",
"_size",
"+",
"1",
")",
";",
"int",
"index",
"=",
"Math",
".",
"abs",
"(... | Adds the supplied key/value mapping. Any previous mapping for that key will be overwritten. | [
"Adds",
"the",
"supplied",
"key",
"/",
"value",
"mapping",
".",
"Any",
"previous",
"mapping",
"for",
"that",
"key",
"will",
"be",
"overwritten",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntIntMap.java#L76-L106 |
blackfizz/EazeGraph | EazeGraphLibrary/src/main/java/org/eazegraph/lib/utils/Utils.java | Utils.calculateLegendInformation | public static void calculateLegendInformation(List<? extends BaseModel> _Models, float _StartX, float _EndX, Paint _Paint) {
"""
Calculates the legend positions and which legend title should be displayed or not.
Important: the LegendBounds in the _Models should be set and correctly calculated before this
funct... | java | public static void calculateLegendInformation(List<? extends BaseModel> _Models, float _StartX, float _EndX, Paint _Paint) {
float textMargin = Utils.dpToPx(10.f);
float lastX = _StartX;
// calculate the legend label positions and check if there is enough space to display the label,
// ... | [
"public",
"static",
"void",
"calculateLegendInformation",
"(",
"List",
"<",
"?",
"extends",
"BaseModel",
">",
"_Models",
",",
"float",
"_StartX",
",",
"float",
"_EndX",
",",
"Paint",
"_Paint",
")",
"{",
"float",
"textMargin",
"=",
"Utils",
".",
"dpToPx",
"("... | Calculates the legend positions and which legend title should be displayed or not.
Important: the LegendBounds in the _Models should be set and correctly calculated before this
function is called!
@param _Models The graph data which should have the BaseModel class as parent class.
@param _StartX Left starting point on... | [
"Calculates",
"the",
"legend",
"positions",
"and",
"which",
"legend",
"title",
"should",
"be",
"displayed",
"or",
"not",
"."
] | train | https://github.com/blackfizz/EazeGraph/blob/ce5e68ecc70e154f83bbb2fcce1a970db125c1e6/EazeGraphLibrary/src/main/java/org/eazegraph/lib/utils/Utils.java#L98-L140 |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/filler/AbstractMessageAwareFiller.java | AbstractMessageAwareFiller.getProperty | protected <T> T getProperty(String alias, Class<T> targetType) {
"""
Returns the value of first property represented by the provided alias
that has a value (not {@code null}).
@param alias
the property alias to resolve
@param targetType
the expected type of the property value
@param <T>
the type of the pr... | java | protected <T> T getProperty(String alias, Class<T> targetType) {
String k = resolveKey(alias);
return k == null ? null : resolver.getProperty(k, targetType);
} | [
"protected",
"<",
"T",
">",
"T",
"getProperty",
"(",
"String",
"alias",
",",
"Class",
"<",
"T",
">",
"targetType",
")",
"{",
"String",
"k",
"=",
"resolveKey",
"(",
"alias",
")",
";",
"return",
"k",
"==",
"null",
"?",
"null",
":",
"resolver",
".",
"... | Returns the value of first property represented by the provided alias
that has a value (not {@code null}).
@param alias
the property alias to resolve
@param targetType
the expected type of the property value
@param <T>
the type of the property value
@return The property value or null | [
"Returns",
"the",
"value",
"of",
"first",
"property",
"represented",
"by",
"the",
"provided",
"alias",
"that",
"has",
"a",
"value",
"(",
"not",
"{",
"@code",
"null",
"}",
")",
"."
] | train | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/filler/AbstractMessageAwareFiller.java#L105-L108 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/CommonUtils.java | CommonUtils.waitFor | public static void waitFor(String description, Supplier<Boolean> condition)
throws InterruptedException, TimeoutException {
"""
Waits for a condition to be satisfied.
@param description a description of what causes condition to evaluate to true
@param condition the condition to wait on
@throws TimeoutEx... | java | public static void waitFor(String description, Supplier<Boolean> condition)
throws InterruptedException, TimeoutException {
waitFor(description, condition, WaitForOptions.defaults());
} | [
"public",
"static",
"void",
"waitFor",
"(",
"String",
"description",
",",
"Supplier",
"<",
"Boolean",
">",
"condition",
")",
"throws",
"InterruptedException",
",",
"TimeoutException",
"{",
"waitFor",
"(",
"description",
",",
"condition",
",",
"WaitForOptions",
"."... | Waits for a condition to be satisfied.
@param description a description of what causes condition to evaluate to true
@param condition the condition to wait on
@throws TimeoutException if the function times out while waiting for the condition to be true | [
"Waits",
"for",
"a",
"condition",
"to",
"be",
"satisfied",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L271-L274 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java | SourceLineAnnotation.fromVisitedInstructionRange | public static @Nonnull SourceLineAnnotation fromVisitedInstructionRange(ClassContext classContext, PreorderVisitor visitor,
int startPC, int endPC) {
"""
Factory method for creating a source line annotation describing the
source line numbers for a range of instructions in the method being
visited by ... | java | public static @Nonnull SourceLineAnnotation fromVisitedInstructionRange(ClassContext classContext, PreorderVisitor visitor,
int startPC, int endPC) {
if (startPC > endPC) {
throw new IllegalArgumentException("Start pc " + startPC + " greater than end pc " + endPC);
}
Lin... | [
"public",
"static",
"@",
"Nonnull",
"SourceLineAnnotation",
"fromVisitedInstructionRange",
"(",
"ClassContext",
"classContext",
",",
"PreorderVisitor",
"visitor",
",",
"int",
"startPC",
",",
"int",
"endPC",
")",
"{",
"if",
"(",
"startPC",
">",
"endPC",
")",
"{",
... | Factory method for creating a source line annotation describing the
source line numbers for a range of instructions in the method being
visited by the given visitor.
@param classContext
the ClassContext
@param visitor
a BetterVisitor which is visiting the method
@param startPC
the bytecode offset of the start instruct... | [
"Factory",
"method",
"for",
"creating",
"a",
"source",
"line",
"annotation",
"describing",
"the",
"source",
"line",
"numbers",
"for",
"a",
"range",
"of",
"instructions",
"in",
"the",
"method",
"being",
"visited",
"by",
"the",
"given",
"visitor",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L524-L541 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/service/HBaseReader.java | HBaseReader.loadAll | public List<HBaseDataWrapper> loadAll(final Table hTable, final List<Object> rows, final String columnFamily,
final String[] columns) throws IOException {
"""
Load all.
@param hTable
the h table
@param rows
the rows
@param columnFamily
the column family
@param columns
the columns
@return th... | java | public List<HBaseDataWrapper> loadAll(final Table hTable, final List<Object> rows, final String columnFamily,
final String[] columns) throws IOException
{
setTableName(hTable);
List<HBaseDataWrapper> results = new ArrayList<HBaseDataWrapper>();
List<Get> getRequest = new Arr... | [
"public",
"List",
"<",
"HBaseDataWrapper",
">",
"loadAll",
"(",
"final",
"Table",
"hTable",
",",
"final",
"List",
"<",
"Object",
">",
"rows",
",",
"final",
"String",
"columnFamily",
",",
"final",
"String",
"[",
"]",
"columns",
")",
"throws",
"IOException",
... | Load all.
@param hTable
the h table
@param rows
the rows
@param columnFamily
the column family
@param columns
the columns
@return the list
@throws IOException
Signals that an I/O exception has occurred. | [
"Load",
"all",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/service/HBaseReader.java#L220-L247 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/reader/EventReader.java | EventReader.deleteMessageAfterProcessSource | private void deleteMessageAfterProcessSource(ProgressState progressState, CloudTrailSource source) {
"""
Delete SQS message after processing source.
@param progressState {@link ProgressState} either {@link ProgressState#deleteMessage}, or {@link ProgressState#deleteFilteredMessage}
@param source {@link CloudTr... | java | private void deleteMessageAfterProcessSource(ProgressState progressState, CloudTrailSource source) {
ProgressStatus deleteMessageStatus = new ProgressStatus(progressState, new BasicProcessSourceInfo(source, false));
sqsManager.deleteMessageFromQueue(((SQSBasedSource)source).getSqsMessage(), deleteMessag... | [
"private",
"void",
"deleteMessageAfterProcessSource",
"(",
"ProgressState",
"progressState",
",",
"CloudTrailSource",
"source",
")",
"{",
"ProgressStatus",
"deleteMessageStatus",
"=",
"new",
"ProgressStatus",
"(",
"progressState",
",",
"new",
"BasicProcessSourceInfo",
"(",
... | Delete SQS message after processing source.
@param progressState {@link ProgressState} either {@link ProgressState#deleteMessage}, or {@link ProgressState#deleteFilteredMessage}
@param source {@link CloudTrailSource} that contains the SQS message that will be deleted. | [
"Delete",
"SQS",
"message",
"after",
"processing",
"source",
"."
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/reader/EventReader.java#L194-L197 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/metastore/caching/Cache.java | Cache.put | public void put(K key, V value) {
"""
Writes a key/value pair to the cache.
@param key the key
@param value the value
"""
mMap.compute(key, (k, entry) -> {
onPut(key, value);
if (entry == null && cacheIsFull()) {
writeToBackingStore(key, value);
return null;
}
if... | java | public void put(K key, V value) {
mMap.compute(key, (k, entry) -> {
onPut(key, value);
if (entry == null && cacheIsFull()) {
writeToBackingStore(key, value);
return null;
}
if (entry == null || entry.mValue == null) {
onCacheUpdate(key, value);
return new Entr... | [
"public",
"void",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"mMap",
".",
"compute",
"(",
"key",
",",
"(",
"k",
",",
"entry",
")",
"->",
"{",
"onPut",
"(",
"key",
",",
"value",
")",
";",
"if",
"(",
"entry",
"==",
"null",
"&&",
"cach... | Writes a key/value pair to the cache.
@param key the key
@param value the value | [
"Writes",
"a",
"key",
"/",
"value",
"pair",
"to",
"the",
"cache",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metastore/caching/Cache.java#L135-L152 |
cdk/cdk | descriptor/qsar/src/main/java/org/openscience/cdk/qsar/AbstractBondDescriptor.java | AbstractBondDescriptor.cacheDescriptorValue | public void cacheDescriptorValue(IBond bond, IAtomContainer container, IDescriptorResult doubleResult) {
"""
Caches a DescriptorValue for a given IBond. This method may only
be called after setNewContainer() is called.
@param bond IBond to cache the value for
@param doubleResult DescriptorValue for the given... | java | public void cacheDescriptorValue(IBond bond, IAtomContainer container, IDescriptorResult doubleResult) {
if (cachedDescriptorValues == null) {
cachedDescriptorValues = new HashMap();
cachedDescriptorValues.put(PREVIOUS_ATOMCONTAINER, container);
} else if (cachedDescriptorValues.... | [
"public",
"void",
"cacheDescriptorValue",
"(",
"IBond",
"bond",
",",
"IAtomContainer",
"container",
",",
"IDescriptorResult",
"doubleResult",
")",
"{",
"if",
"(",
"cachedDescriptorValues",
"==",
"null",
")",
"{",
"cachedDescriptorValues",
"=",
"new",
"HashMap",
"(",... | Caches a DescriptorValue for a given IBond. This method may only
be called after setNewContainer() is called.
@param bond IBond to cache the value for
@param doubleResult DescriptorValue for the given IBond | [
"Caches",
"a",
"DescriptorValue",
"for",
"a",
"given",
"IBond",
".",
"This",
"method",
"may",
"only",
"be",
"called",
"after",
"setNewContainer",
"()",
"is",
"called",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsar/src/main/java/org/openscience/cdk/qsar/AbstractBondDescriptor.java#L72-L81 |
woo-j/OkapiBarcode | src/main/java/uk/org/okapibarcode/backend/MaxiCode.java | MaxiCode.bestSurroundingSet | private int bestSurroundingSet(int index, int length, int... valid) {
"""
Guesses the best set to use at the specified index by looking at the surrounding sets. In general, characters in
lower-numbered sets are more common, so we choose them if we can. If no good surrounding sets can be found, the default
value ... | java | private int bestSurroundingSet(int index, int length, int... valid) {
int option1 = set[index - 1];
if (index + 1 < length) {
// we have two options to check
int option2 = set[index + 1];
if (contains(valid, option1) && contains(valid, option2)) {
... | [
"private",
"int",
"bestSurroundingSet",
"(",
"int",
"index",
",",
"int",
"length",
",",
"int",
"...",
"valid",
")",
"{",
"int",
"option1",
"=",
"set",
"[",
"index",
"-",
"1",
"]",
";",
"if",
"(",
"index",
"+",
"1",
"<",
"length",
")",
"{",
"// we h... | Guesses the best set to use at the specified index by looking at the surrounding sets. In general, characters in
lower-numbered sets are more common, so we choose them if we can. If no good surrounding sets can be found, the default
value returned is the first value from the valid set.
@param index the current index
@... | [
"Guesses",
"the",
"best",
"set",
"to",
"use",
"at",
"the",
"specified",
"index",
"by",
"looking",
"at",
"the",
"surrounding",
"sets",
".",
"In",
"general",
"characters",
"in",
"lower",
"-",
"numbered",
"sets",
"are",
"more",
"common",
"so",
"we",
"choose",... | train | https://github.com/woo-j/OkapiBarcode/blob/d1cb4f4ab64557cd3db64d9a473528a52ce58081/src/main/java/uk/org/okapibarcode/backend/MaxiCode.java#L828-L850 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/util/PebbleDictionary.java | PebbleDictionary.addBytes | public void addBytes(int key, byte[] bytes) {
"""
Associate the specified byte array with the provided key in the dictionary. If another key-value pair with the
same key is already present in the dictionary, it will be replaced.
@param key
key with which the specified value is associated
@param bytes
value ... | java | public void addBytes(int key, byte[] bytes) {
PebbleTuple t = PebbleTuple.create(key, PebbleTuple.TupleType.BYTES, PebbleTuple.Width.NONE, bytes);
addTuple(t);
} | [
"public",
"void",
"addBytes",
"(",
"int",
"key",
",",
"byte",
"[",
"]",
"bytes",
")",
"{",
"PebbleTuple",
"t",
"=",
"PebbleTuple",
".",
"create",
"(",
"key",
",",
"PebbleTuple",
".",
"TupleType",
".",
"BYTES",
",",
"PebbleTuple",
".",
"Width",
".",
"NO... | Associate the specified byte array with the provided key in the dictionary. If another key-value pair with the
same key is already present in the dictionary, it will be replaced.
@param key
key with which the specified value is associated
@param bytes
value to be associated with the specified key | [
"Associate",
"the",
"specified",
"byte",
"array",
"with",
"the",
"provided",
"key",
"in",
"the",
"dictionary",
".",
"If",
"another",
"key",
"-",
"value",
"pair",
"with",
"the",
"same",
"key",
"is",
"already",
"present",
"in",
"the",
"dictionary",
"it",
"wi... | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/util/PebbleDictionary.java#L78-L81 |
upwork/java-upwork | src/com/Upwork/api/UpworkRestClient.java | UpworkRestClient.getJSONObject | public static JSONObject getJSONObject(HttpGet request, Integer method, HashMap<String, String> params) throws JSONException {
"""
Get JSON response for GET
@param request Request object for GET
@param method HTTP method
@param params POST parameters
@throws JSONException
@return {@link JSONObject}
... | java | public static JSONObject getJSONObject(HttpGet request, Integer method, HashMap<String, String> params) throws JSONException {
switch (method) {
case METHOD_GET:
return doGetRequest(request);
default:
throw new RuntimeException("Wrong http method requested");
}
... | [
"public",
"static",
"JSONObject",
"getJSONObject",
"(",
"HttpGet",
"request",
",",
"Integer",
"method",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"switch",
"(",
"method",
")",
"{",
"case",
"METHOD_GET",
... | Get JSON response for GET
@param request Request object for GET
@param method HTTP method
@param params POST parameters
@throws JSONException
@return {@link JSONObject} | [
"Get",
"JSON",
"response",
"for",
"GET"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/UpworkRestClient.java#L87-L94 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java | JvmTypesBuilder.addAnnotations | public void addAnnotations(/* @Nullable */ JvmAnnotationTarget target, /* @Nullable */ Iterable<? extends XAnnotation> annotations) {
"""
Translates {@link XAnnotation XAnnotations} to {@link JvmAnnotationReference JvmAnnotationReferences}
and adds them to the given {@link JvmAnnotationTarget}.
@param target t... | java | public void addAnnotations(/* @Nullable */ JvmAnnotationTarget target, /* @Nullable */ Iterable<? extends XAnnotation> annotations) {
if(annotations == null || target == null)
return;
for (XAnnotation annotation : annotations) {
addAnnotation(target, annotation);
}
} | [
"public",
"void",
"addAnnotations",
"(",
"/* @Nullable */",
"JvmAnnotationTarget",
"target",
",",
"/* @Nullable */",
"Iterable",
"<",
"?",
"extends",
"XAnnotation",
">",
"annotations",
")",
"{",
"if",
"(",
"annotations",
"==",
"null",
"||",
"target",
"==",
"null",... | Translates {@link XAnnotation XAnnotations} to {@link JvmAnnotationReference JvmAnnotationReferences}
and adds them to the given {@link JvmAnnotationTarget}.
@param target the annotation target. If <code>null</code> this method does nothing.
@param annotations the annotations. If <code>null</code> this method does not... | [
"Translates",
"{",
"@link",
"XAnnotation",
"XAnnotations",
"}",
"to",
"{",
"@link",
"JvmAnnotationReference",
"JvmAnnotationReferences",
"}",
"and",
"adds",
"them",
"to",
"the",
"given",
"{",
"@link",
"JvmAnnotationTarget",
"}",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java#L1354-L1360 |
intellimate/Izou | src/main/java/org/intellimate/izou/system/file/FileManager.java | FileManager.isFileType | private boolean isFileType(WatchEvent event, String fileType) {
"""
Checks if an event belongs to the desired file type
@param event the event to check
@return the boolean value corresponding to the output
"""
return event.context().toString().contains(fileType);
} | java | private boolean isFileType(WatchEvent event, String fileType) {
return event.context().toString().contains(fileType);
} | [
"private",
"boolean",
"isFileType",
"(",
"WatchEvent",
"event",
",",
"String",
"fileType",
")",
"{",
"return",
"event",
".",
"context",
"(",
")",
".",
"toString",
"(",
")",
".",
"contains",
"(",
"fileType",
")",
";",
"}"
] | Checks if an event belongs to the desired file type
@param event the event to check
@return the boolean value corresponding to the output | [
"Checks",
"if",
"an",
"event",
"belongs",
"to",
"the",
"desired",
"file",
"type"
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/system/file/FileManager.java#L79-L81 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/SearchFilter.java | SearchFilter.matchList | public void matchList(String ElementName, Vector values, int oper) {
"""
Change the search filter to one that specifies an element to
match or not match one of a list of values.
The old search filter is deleted.
@param ElementName is the name of the element to be matched
@param values is a vector of possible... | java | public void matchList(String ElementName, Vector values, int oper)
{
// Delete the old search filter
m_filter = null;
// If not NOT_IN, assume IN
// (Since ints are passed by value, it is OK to change it)
if (oper != NOT_IN)
{
oper = IN;
... | [
"public",
"void",
"matchList",
"(",
"String",
"ElementName",
",",
"Vector",
"values",
",",
"int",
"oper",
")",
"{",
"// Delete the old search filter\r",
"m_filter",
"=",
"null",
";",
"// If not NOT_IN, assume IN\r",
"// (Since ints are passed by value, it is OK to change it)\... | Change the search filter to one that specifies an element to
match or not match one of a list of values.
The old search filter is deleted.
@param ElementName is the name of the element to be matched
@param values is a vector of possible matches
@param oper is the IN or NOT_IN operator to indicate how to matche | [
"Change",
"the",
"search",
"filter",
"to",
"one",
"that",
"specifies",
"an",
"element",
"to",
"match",
"or",
"not",
"match",
"one",
"of",
"a",
"list",
"of",
"values",
".",
"The",
"old",
"search",
"filter",
"is",
"deleted",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/SearchFilter.java#L74-L89 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newWasStartedBy | public WasStartedBy newWasStartedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger, QualifiedName starter, XMLGregorianCalendar time, Collection<Attribute> attributes) {
"""
/* (non-Javadoc)
@see org.openprovenance.prov.model.ModelConstructor#newWasStartedBy(org.openprovenance.model.QualifiedName... | java | public WasStartedBy newWasStartedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger, QualifiedName starter, XMLGregorianCalendar time, Collection<Attribute> attributes) {
WasStartedBy res=newWasStartedBy(id,activity,trigger);
res.setTime(time);
res.setStarter(starter);
setAttribut... | [
"public",
"WasStartedBy",
"newWasStartedBy",
"(",
"QualifiedName",
"id",
",",
"QualifiedName",
"activity",
",",
"QualifiedName",
"trigger",
",",
"QualifiedName",
"starter",
",",
"XMLGregorianCalendar",
"time",
",",
"Collection",
"<",
"Attribute",
">",
"attributes",
")... | /* (non-Javadoc)
@see org.openprovenance.prov.model.ModelConstructor#newWasStartedBy(org.openprovenance.model.QualifiedName, org.openprovenance.model.QualifiedName, org.openprovenance.model.QualifiedName, org.openprovenance.model.QualifiedName, javax.xml.datatype.XMLGregorianCalendar, java.util.Collection) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L1526-L1532 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/Stage.java | Stage.withStageVariables | public Stage withStageVariables(java.util.Map<String, String> stageVariables) {
"""
<p>
A map that defines the stage variables for a stage resource. Variable names can have alphanumeric and underscore
characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.
</p>
@param stageVariables
A map that define... | java | public Stage withStageVariables(java.util.Map<String, String> stageVariables) {
setStageVariables(stageVariables);
return this;
} | [
"public",
"Stage",
"withStageVariables",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"stageVariables",
")",
"{",
"setStageVariables",
"(",
"stageVariables",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map that defines the stage variables for a stage resource. Variable names can have alphanumeric and underscore
characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.
</p>
@param stageVariables
A map that defines the stage variables for a stage resource. Variable names can have alphanumeric and
underscore... | [
"<p",
">",
"A",
"map",
"that",
"defines",
"the",
"stage",
"variables",
"for",
"a",
"stage",
"resource",
".",
"Variable",
"names",
"can",
"have",
"alphanumeric",
"and",
"underscore",
"characters",
"and",
"the",
"values",
"must",
"match",
"[",
"A",
"-",
"Za"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/Stage.java#L512-L515 |
jayantk/jklol | src/com/jayantkrish/jklol/util/PairCountAccumulator.java | PairCountAccumulator.getConditionalProbability | public double getConditionalProbability(A first, B second) {
"""
Gets the conditional probability of observing {@code second} given
{@code first}. Returns NaN if {@code first} has never been observed.
@param first
@param second
@return
"""
return getCount(first, second) / conditionalCounts.get(first)... | java | public double getConditionalProbability(A first, B second) {
return getCount(first, second) / conditionalCounts.get(first);
} | [
"public",
"double",
"getConditionalProbability",
"(",
"A",
"first",
",",
"B",
"second",
")",
"{",
"return",
"getCount",
"(",
"first",
",",
"second",
")",
"/",
"conditionalCounts",
".",
"get",
"(",
"first",
")",
";",
"}"
] | Gets the conditional probability of observing {@code second} given
{@code first}. Returns NaN if {@code first} has never been observed.
@param first
@param second
@return | [
"Gets",
"the",
"conditional",
"probability",
"of",
"observing",
"{",
"@code",
"second",
"}",
"given",
"{",
"@code",
"first",
"}",
".",
"Returns",
"NaN",
"if",
"{",
"@code",
"first",
"}",
"has",
"never",
"been",
"observed",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/PairCountAccumulator.java#L170-L172 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/EntityCachingAbstractSequencePrior.java | EntityCachingAbstractSequencePrior.extractEntity | public Entity extractEntity(int[] sequence, int position) {
"""
extracts the entity starting at the given position
and adds it to the entity list. returns the index
of the last element in the entity (<B>not</b> index+1)
"""
Entity entity = new Entity();
entity.type = sequence[position];
entit... | java | public Entity extractEntity(int[] sequence, int position) {
Entity entity = new Entity();
entity.type = sequence[position];
entity.startPosition = position;
entity.words = new ArrayList<String>();
for ( ; position < sequence.length; position++) {
if (sequence[position] == entity.type) {
... | [
"public",
"Entity",
"extractEntity",
"(",
"int",
"[",
"]",
"sequence",
",",
"int",
"position",
")",
"{",
"Entity",
"entity",
"=",
"new",
"Entity",
"(",
")",
";",
"entity",
".",
"type",
"=",
"sequence",
"[",
"position",
"]",
";",
"entity",
".",
"startPo... | extracts the entity starting at the given position
and adds it to the entity list. returns the index
of the last element in the entity (<B>not</b> index+1) | [
"extracts",
"the",
"entity",
"starting",
"at",
"the",
"given",
"position",
"and",
"adds",
"it",
"to",
"the",
"entity",
"list",
".",
"returns",
"the",
"index",
"of",
"the",
"last",
"element",
"in",
"the",
"entity",
"(",
"<B",
">",
"not<",
"/",
"b",
">",... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/EntityCachingAbstractSequencePrior.java#L122-L140 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseInsertKeyword | public static boolean parseInsertKeyword(final char[] query, int offset) {
"""
Parse string to check presence of INSERT keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word
"""
if (query.leng... | java | public static boolean parseInsertKeyword(final char[] query, int offset) {
if (query.length < (offset + 7)) {
return false;
}
return (query[offset] | 32) == 'i'
&& (query[offset + 1] | 32) == 'n'
&& (query[offset + 2] | 32) == 's'
&& (query[offset + 3] | 32) == 'e'
&& ... | [
"public",
"static",
"boolean",
"parseInsertKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"7",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
... | Parse string to check presence of INSERT keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"INSERT",
"keyword",
"regardless",
"of",
"case",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L582-L593 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/partition/Partitioner.java | Partitioner.getUpdatedInterval | private static int getUpdatedInterval(int inputInterval, ExtractType extractType, WatermarkType watermarkType) {
"""
Calculate interval in hours with the given interval
@param inputInterval input interval
@param extractType Extract type
@param watermarkType Watermark type
@return interval in range
"""
... | java | private static int getUpdatedInterval(int inputInterval, ExtractType extractType, WatermarkType watermarkType) {
LOG.debug("Getting updated interval");
if ((extractType == ExtractType.SNAPSHOT && watermarkType == WatermarkType.DATE)) {
return inputInterval * 24;
} else if (extractType == ExtractType.A... | [
"private",
"static",
"int",
"getUpdatedInterval",
"(",
"int",
"inputInterval",
",",
"ExtractType",
"extractType",
",",
"WatermarkType",
"watermarkType",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Getting updated interval\"",
")",
";",
"if",
"(",
"(",
"extractType",
"=... | Calculate interval in hours with the given interval
@param inputInterval input interval
@param extractType Extract type
@param watermarkType Watermark type
@return interval in range | [
"Calculate",
"interval",
"in",
"hours",
"with",
"the",
"given",
"interval"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/partition/Partitioner.java#L312-L321 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java | JsonModelCoder.encodeNullToNull | public void encodeNullToNull(Writer writer, T obj) throws IOException {
"""
Encodes the given value into the JSON format, and writes it using the given writer.<br>
Writes "null" if null is given.
@param writer {@link Writer} to be used for writing value
@param obj Value to encoded
@throws IOException
"""... | java | public void encodeNullToNull(Writer writer, T obj) throws IOException {
if (obj == null) {
writer.write("null");
return;
}
JsonUtil.startHash(writer);
encodeValue(writer, obj);
JsonUtil.endHash(writer);
writer.flush();
} | [
"public",
"void",
"encodeNullToNull",
"(",
"Writer",
"writer",
",",
"T",
"obj",
")",
"throws",
"IOException",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"writer",
".",
"write",
"(",
"\"null\"",
")",
";",
"return",
";",
"}",
"JsonUtil",
".",
"startH... | Encodes the given value into the JSON format, and writes it using the given writer.<br>
Writes "null" if null is given.
@param writer {@link Writer} to be used for writing value
@param obj Value to encoded
@throws IOException | [
"Encodes",
"the",
"given",
"value",
"into",
"the",
"JSON",
"format",
"and",
"writes",
"it",
"using",
"the",
"given",
"writer",
".",
"<br",
">",
"Writes",
"null",
"if",
"null",
"is",
"given",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java#L429-L442 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java | CommandGroup.createButtonBar | public JComponent createButtonBar(final ColumnSpec columnSpec, final RowSpec rowSpec) {
"""
Create a button bar with buttons for all the commands in this.
@param columnSpec Custom columnSpec for each column containing a button,
can be <code>null</code>.
@param rowSpec Custom rowspec for the buttonbar, can be ... | java | public JComponent createButtonBar(final ColumnSpec columnSpec, final RowSpec rowSpec) {
return createButtonBar(columnSpec, rowSpec, null);
} | [
"public",
"JComponent",
"createButtonBar",
"(",
"final",
"ColumnSpec",
"columnSpec",
",",
"final",
"RowSpec",
"rowSpec",
")",
"{",
"return",
"createButtonBar",
"(",
"columnSpec",
",",
"rowSpec",
",",
"null",
")",
";",
"}"
] | Create a button bar with buttons for all the commands in this.
@param columnSpec Custom columnSpec for each column containing a button,
can be <code>null</code>.
@param rowSpec Custom rowspec for the buttonbar, can be <code>null</code>.
@return never null | [
"Create",
"a",
"button",
"bar",
"with",
"buttons",
"for",
"all",
"the",
"commands",
"in",
"this",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L446-L448 |
FitLayout/classify | src/main/java/org/fit/layout/classify/taggers/IntegerTagger.java | IntegerTagger.validateMatch | protected boolean validateMatch(String srcString, String substring, int matchStart, int matchEnd) {
"""
Validates the substring match -- checks the neighborhood and numeric range. This may be overriden
for particular use cases.
@param srcString the whole source string
@param substring the matched substring
@pa... | java | protected boolean validateMatch(String srcString, String substring, int matchStart, int matchEnd)
{
if ((matchStart == 0 || !Character.isAlphabetic(srcString.codePointAt(matchStart))) && //require something non-alphabetic chars around
(matchEnd == srcString.length() || !Character.isAlphabeti... | [
"protected",
"boolean",
"validateMatch",
"(",
"String",
"srcString",
",",
"String",
"substring",
",",
"int",
"matchStart",
",",
"int",
"matchEnd",
")",
"{",
"if",
"(",
"(",
"matchStart",
"==",
"0",
"||",
"!",
"Character",
".",
"isAlphabetic",
"(",
"srcString... | Validates the substring match -- checks the neighborhood and numeric range. This may be overriden
for particular use cases.
@param srcString the whole source string
@param substring the matched substring
@param matchStart start index of the substring in the whole string
@param matchEnd end index of the substring in the... | [
"Validates",
"the",
"substring",
"match",
"--",
"checks",
"the",
"neighborhood",
"and",
"numeric",
"range",
".",
"This",
"may",
"be",
"overriden",
"for",
"particular",
"use",
"cases",
"."
] | train | https://github.com/FitLayout/classify/blob/0b43ceb2f0be4e6d26263491893884d811f0d605/src/main/java/org/fit/layout/classify/taggers/IntegerTagger.java#L146-L155 |
codescape/bitvunit | bitvunit-core/src/main/java/de/codescape/bitvunit/util/html/HtmlLabelUtil.java | HtmlLabelUtil.containsLabelForId | public static boolean containsLabelForId(List<HtmlLabel> labels, String id) {
"""
Returns <code>true</code> for a label in the given list of labels with the value of the <code>for</code>
attribute equal to the given id.
@param labels list of all labels
@param id id for which a label should exist
@return ... | java | public static boolean containsLabelForId(List<HtmlLabel> labels, String id) {
for (HtmlLabel label : labels) {
if (label.getForAttribute() != null && label.getForAttribute().equals(id)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"containsLabelForId",
"(",
"List",
"<",
"HtmlLabel",
">",
"labels",
",",
"String",
"id",
")",
"{",
"for",
"(",
"HtmlLabel",
"label",
":",
"labels",
")",
"{",
"if",
"(",
"label",
".",
"getForAttribute",
"(",
")",
"!=",
"null... | Returns <code>true</code> for a label in the given list of labels with the value of the <code>for</code>
attribute equal to the given id.
@param labels list of all labels
@param id id for which a label should exist
@return <code>true</code> if a label referencing the given id is found, otherwise <code>false</code> | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"for",
"a",
"label",
"in",
"the",
"given",
"list",
"of",
"labels",
"with",
"the",
"value",
"of",
"the",
"<code",
">",
"for<",
"/",
"code",
">",
"attribute",
"equal",
"to",
"the",
"given",
"id",
"."
... | train | https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/util/html/HtmlLabelUtil.java#L26-L33 |
yerenkow/javaz | cache/src/main/java/org/javaz/cache/CacheImpl.java | CacheImpl.put | public Object put(Object key, Object value) {
"""
Method to store value in cache, if this value first in cache - also mark nextTimeSomeExpired
as its creating time;
@param key, may not be null
@param value - any value object
@return old value or null
"""
long objectStamp = System.currentTimeMill... | java | public Object put(Object key, Object value)
{
long objectStamp = System.currentTimeMillis();
synchronized (objects)
{
objectTimeStamps.put(key, objectStamp);
if (nextTimeSomeExpired == NO_OBJECTS)
{
nextTimeSomeExpired = objectStamp;
... | [
"public",
"Object",
"put",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"long",
"objectStamp",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"synchronized",
"(",
"objects",
")",
"{",
"objectTimeStamps",
".",
"put",
"(",
"key",
",",
"... | Method to store value in cache, if this value first in cache - also mark nextTimeSomeExpired
as its creating time;
@param key, may not be null
@param value - any value object
@return old value or null | [
"Method",
"to",
"store",
"value",
"in",
"cache",
"if",
"this",
"value",
"first",
"in",
"cache",
"-",
"also",
"mark",
"nextTimeSomeExpired",
"as",
"its",
"creating",
"time",
";"
] | train | https://github.com/yerenkow/javaz/blob/1902ec50b5d6a531d9c5faf99760eacf3d0cbb21/cache/src/main/java/org/javaz/cache/CacheImpl.java#L81-L93 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.