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 |
|---|---|---|---|---|---|---|---|---|---|---|
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/digest/_apacheCommonsCodec/StringUtils.java | StringUtils.newString | public static String newString(byte[] bytes, String charsetName) {
"""
Constructs a new <code>String</code> by decoding the specified array of bytes using the given charset.
<p>
This method catches {@link UnsupportedEncodingException} and re-throws it as {@link IllegalStateException}, which
should never happen ... | java | public static String newString(byte[] bytes, String charsetName) {
if (bytes == null) {
return null;
}
try {
return new String(bytes, charsetName);
} catch (UnsupportedEncodingException e) {
throw StringUtils.newIllegalStateException(charsetName, e);
... | [
"public",
"static",
"String",
"newString",
"(",
"byte",
"[",
"]",
"bytes",
",",
"String",
"charsetName",
")",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"new",
"String",
"(",
"bytes",
",",
"char... | Constructs a new <code>String</code> by decoding the specified array of bytes using the given charset.
<p>
This method catches {@link UnsupportedEncodingException} and re-throws it as {@link IllegalStateException}, which
should never happen for a required charset name. Use this method when the encoding is required to b... | [
"Constructs",
"a",
"new",
"<code",
">",
"String<",
"/",
"code",
">",
"by",
"decoding",
"the",
"specified",
"array",
"of",
"bytes",
"using",
"the",
"given",
"charset",
".",
"<p",
">",
"This",
"method",
"catches",
"{",
"@link",
"UnsupportedEncodingException",
... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/digest/_apacheCommonsCodec/StringUtils.java#L53-L62 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspContentAttachmentsBean.java | CmsJspContentAttachmentsBean.getAttachmentsForLocale | public static CmsJspContentAttachmentsBean getAttachmentsForLocale(
CmsObject cms,
CmsResource content,
String locale) {
"""
Loads the attachments for a given content.<p>
@param cms the CMS context
@param content the content
@param locale the locale
@return the attachment bean for t... | java | public static CmsJspContentAttachmentsBean getAttachmentsForLocale(
CmsObject cms,
CmsResource content,
String locale) {
Optional<CmsResource> detailOnly = CmsDetailOnlyContainerUtil.getDetailOnlyPage(cms, content, locale);
if (!detailOnly.isPresent()) {
return new C... | [
"public",
"static",
"CmsJspContentAttachmentsBean",
"getAttachmentsForLocale",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"content",
",",
"String",
"locale",
")",
"{",
"Optional",
"<",
"CmsResource",
">",
"detailOnly",
"=",
"CmsDetailOnlyContainerUtil",
".",
"getDetai... | Loads the attachments for a given content.<p>
@param cms the CMS context
@param content the content
@param locale the locale
@return the attachment bean for the given content and locale | [
"Loads",
"the",
"attachments",
"for",
"a",
"given",
"content",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspContentAttachmentsBean.java#L176-L192 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/AbstractListBinding.java | AbstractListBinding.convertValue | protected Object convertValue(Object value, Class targetClass) throws ConversionException {
"""
Converts the given object value into the given targetClass
@param value
the value to convert
@param targetClass
the target class to convert the value to
@return the converted value
@throws org.springframework.... | java | protected Object convertValue(Object value, Class targetClass) throws ConversionException {
Assert.notNull(value);
Assert.notNull(targetClass);
return getConversionService().getConversionExecutor(value.getClass(), targetClass).execute(value);
} | [
"protected",
"Object",
"convertValue",
"(",
"Object",
"value",
",",
"Class",
"targetClass",
")",
"throws",
"ConversionException",
"{",
"Assert",
".",
"notNull",
"(",
"value",
")",
";",
"Assert",
".",
"notNull",
"(",
"targetClass",
")",
";",
"return",
"getConve... | Converts the given object value into the given targetClass
@param value
the value to convert
@param targetClass
the target class to convert the value to
@return the converted value
@throws org.springframework.binding.convert.ConversionException
if the value can not be converted | [
"Converts",
"the",
"given",
"object",
"value",
"into",
"the",
"given",
"targetClass"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/AbstractListBinding.java#L157-L161 |
aicer/hibiscus-http-client | src/main/java/org/aicer/hibiscus/http/client/HttpClient.java | HttpClient.addNameValuePair | public final HttpClient addNameValuePair(final String param, final Double value) {
"""
Used by Entity-Enclosing HTTP Requests to send Name-Value pairs in the body of the request
@param param Name of Parameter
@param value Value of Parameter
@return
"""
return addNameValuePair(param, value.toString... | java | public final HttpClient addNameValuePair(final String param, final Double value) {
return addNameValuePair(param, value.toString());
} | [
"public",
"final",
"HttpClient",
"addNameValuePair",
"(",
"final",
"String",
"param",
",",
"final",
"Double",
"value",
")",
"{",
"return",
"addNameValuePair",
"(",
"param",
",",
"value",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Used by Entity-Enclosing HTTP Requests to send Name-Value pairs in the body of the request
@param param Name of Parameter
@param value Value of Parameter
@return | [
"Used",
"by",
"Entity",
"-",
"Enclosing",
"HTTP",
"Requests",
"to",
"send",
"Name",
"-",
"Value",
"pairs",
"in",
"the",
"body",
"of",
"the",
"request"
] | train | https://github.com/aicer/hibiscus-http-client/blob/a037e3cf8d4bb862d38a55a090778736a48d67cc/src/main/java/org/aicer/hibiscus/http/client/HttpClient.java#L280-L282 |
geomajas/geomajas-project-server | plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/filter/ExtendedLikeFilterImpl.java | ExtendedLikeFilterImpl.setPattern | @Deprecated
public final void setPattern(Expression p, String wildcardMultiChar, String wildcardOneChar, String escapeString) {
"""
Set the match pattern for this FilterLike.
@param p
the expression which evaluates to the match pattern for this filter
@param wildcardMultiChar
the string that represents a mu... | java | @Deprecated
public final void setPattern(Expression p, String wildcardMultiChar, String wildcardOneChar, String escapeString) {
setPattern(p.toString(), wildcardMultiChar, wildcardOneChar, escapeString);
} | [
"@",
"Deprecated",
"public",
"final",
"void",
"setPattern",
"(",
"Expression",
"p",
",",
"String",
"wildcardMultiChar",
",",
"String",
"wildcardOneChar",
",",
"String",
"escapeString",
")",
"{",
"setPattern",
"(",
"p",
".",
"toString",
"(",
")",
",",
"wildcard... | Set the match pattern for this FilterLike.
@param p
the expression which evaluates to the match pattern for this filter
@param wildcardMultiChar
the string that represents a multiple character (1->n) wildcard
@param wildcardOneChar
the string that represents a single character (1) wildcard
@param escapeString
the stri... | [
"Set",
"the",
"match",
"pattern",
"for",
"this",
"FilterLike",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/filter/ExtendedLikeFilterImpl.java#L307-L310 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java | ToStream.ignorableWhitespace | public void ignorableWhitespace(char ch[], int start, int length)
throws org.xml.sax.SAXException {
"""
Receive notification of ignorable whitespace in element content.
Not sure how to get this invoked quite yet.
@param ch The characters from the XML document.
@param start The start position in the ... | java | public void ignorableWhitespace(char ch[], int start, int length)
throws org.xml.sax.SAXException
{
if (0 == length)
return;
characters(ch, start, length);
} | [
"public",
"void",
"ignorableWhitespace",
"(",
"char",
"ch",
"[",
"]",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",
"{",
"if",
"(",
"0",
"==",
"length",
")",
"return",
";",
"characters",
... | Receive notification of ignorable whitespace in element content.
Not sure how to get this invoked quite yet.
@param ch The characters from the XML document.
@param start The start position in the array.
@param length The number of characters to read from the array.
@throws org.xml.sax.SAXException Any SAX exception, ... | [
"Receive",
"notification",
"of",
"ignorable",
"whitespace",
"in",
"element",
"content",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java#L2536-L2543 |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/JORARepository.java | JORARepository.loadByExample | protected <T> T loadByExample (
final Table<T> table, final T example, final FieldMask mask)
throws PersistenceException {
"""
Loads a single object from the specified table that matches the
supplied example. <em>Note:</em> the query should match one or zero
records, not more.
"""
ret... | java | protected <T> T loadByExample (
final Table<T> table, final T example, final FieldMask mask)
throws PersistenceException
{
return execute(new Operation<T>() {
public T invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
... | [
"protected",
"<",
"T",
">",
"T",
"loadByExample",
"(",
"final",
"Table",
"<",
"T",
">",
"table",
",",
"final",
"T",
"example",
",",
"final",
"FieldMask",
"mask",
")",
"throws",
"PersistenceException",
"{",
"return",
"execute",
"(",
"new",
"Operation",
"<",... | Loads a single object from the specified table that matches the
supplied example. <em>Note:</em> the query should match one or zero
records, not more. | [
"Loads",
"a",
"single",
"object",
"from",
"the",
"specified",
"table",
"that",
"matches",
"the",
"supplied",
"example",
".",
"<em",
">",
"Note",
":",
"<",
"/",
"em",
">",
"the",
"query",
"should",
"match",
"one",
"or",
"zero",
"records",
"not",
"more",
... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/JORARepository.java#L223-L234 |
mapbox/mapbox-plugins-android | plugin-localization/src/main/java/com/mapbox/mapboxsdk/plugins/localization/MapLocale.java | MapLocale.getMapLocale | @Nullable
public static MapLocale getMapLocale(@NonNull Locale locale, boolean acceptFallback) {
"""
Passing in a Locale, you are able to receive the {@link MapLocale} object which it is currently
paired with. If this returns null, there was no matching {@link MapLocale} to go along with the
passed in Locale. ... | java | @Nullable
public static MapLocale getMapLocale(@NonNull Locale locale, boolean acceptFallback) {
MapLocale foundLocale = LOCALE_SET.get(locale);
if (acceptFallback && foundLocale == null) {
foundLocale = getMapLocaleFallback(locale);
}
return foundLocale;
} | [
"@",
"Nullable",
"public",
"static",
"MapLocale",
"getMapLocale",
"(",
"@",
"NonNull",
"Locale",
"locale",
",",
"boolean",
"acceptFallback",
")",
"{",
"MapLocale",
"foundLocale",
"=",
"LOCALE_SET",
".",
"get",
"(",
"locale",
")",
";",
"if",
"(",
"acceptFallbac... | Passing in a Locale, you are able to receive the {@link MapLocale} object which it is currently
paired with. If this returns null, there was no matching {@link MapLocale} to go along with the
passed in Locale. If you expected a non-null result, you should make sure you used
{@link #addMapLocale(Locale, MapLocale)} befo... | [
"Passing",
"in",
"a",
"Locale",
"you",
"are",
"able",
"to",
"receive",
"the",
"{",
"@link",
"MapLocale",
"}",
"object",
"which",
"it",
"is",
"currently",
"paired",
"with",
".",
"If",
"this",
"returns",
"null",
"there",
"was",
"no",
"matching",
"{",
"@lin... | train | https://github.com/mapbox/mapbox-plugins-android/blob/c683cad4d8306945d71838d96fae73b8cbe2e6c9/plugin-localization/src/main/java/com/mapbox/mapboxsdk/plugins/localization/MapLocale.java#L416-L423 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java | SpannerClient.beginTransaction | public final Transaction beginTransaction(String session, TransactionOptions options) {
"""
Begins a new transaction. This step can often be skipped:
[Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
[Commit][google.spanner.v1.Spanner.Commit] can begin a new transacti... | java | public final Transaction beginTransaction(String session, TransactionOptions options) {
BeginTransactionRequest request =
BeginTransactionRequest.newBuilder().setSession(session).setOptions(options).build();
return beginTransaction(request);
} | [
"public",
"final",
"Transaction",
"beginTransaction",
"(",
"String",
"session",
",",
"TransactionOptions",
"options",
")",
"{",
"BeginTransactionRequest",
"request",
"=",
"BeginTransactionRequest",
".",
"newBuilder",
"(",
")",
".",
"setSession",
"(",
"session",
")",
... | Begins a new transaction. This step can often be skipped:
[Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
[Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a side-effect.
<p>Sample code:
<pre><code>
try (SpannerClient spannerClient = SpannerClient... | [
"Begins",
"a",
"new",
"transaction",
".",
"This",
"step",
"can",
"often",
"be",
"skipped",
":",
"[",
"Read",
"]",
"[",
"google",
".",
"spanner",
".",
"v1",
".",
"Spanner",
".",
"Read",
"]",
"[",
"ExecuteSql",
"]",
"[",
"google",
".",
"spanner",
".",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java#L970-L975 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.listQueryResultsForResourceAsync | public Observable<PolicyStatesQueryResultsInner> listQueryResultsForResourceAsync(PolicyStatesResource policyStatesResource, String resourceId) {
"""
Queries policy states for the resource.
@param policyStatesResource The virtual resource under PolicyStates resource type. In a given time range, 'latest' represe... | java | public Observable<PolicyStatesQueryResultsInner> listQueryResultsForResourceAsync(PolicyStatesResource policyStatesResource, String resourceId) {
return listQueryResultsForResourceWithServiceResponseAsync(policyStatesResource, resourceId).map(new Func1<ServiceResponse<PolicyStatesQueryResultsInner>, PolicyState... | [
"public",
"Observable",
"<",
"PolicyStatesQueryResultsInner",
">",
"listQueryResultsForResourceAsync",
"(",
"PolicyStatesResource",
"policyStatesResource",
",",
"String",
"resourceId",
")",
"{",
"return",
"listQueryResultsForResourceWithServiceResponseAsync",
"(",
"policyStatesReso... | Queries policy states for the resource.
@param policyStatesResource The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). Possible values include: 'default', 'latest'
@param resourceId Resource ID.... | [
"Queries",
"policy",
"states",
"for",
"the",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L1315-L1322 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspStandardContextBean.java | CmsJspStandardContextBean.getFunction | public Map<String, CmsDynamicFunctionBeanWrapper> getFunction() {
"""
Returns a lazy initialized Map which allows access to the dynamic function beans using the JSP EL.<p>
When given a key, the returned map will look up the corresponding dynamic function bean in the module configuration.<p>
@return a lazy in... | java | public Map<String, CmsDynamicFunctionBeanWrapper> getFunction() {
if (m_function == null) {
Transformer transformer = new Transformer() {
@Override
public Object transform(Object input) {
try {
CmsDynamicFunctionBean dyn... | [
"public",
"Map",
"<",
"String",
",",
"CmsDynamicFunctionBeanWrapper",
">",
"getFunction",
"(",
")",
"{",
"if",
"(",
"m_function",
"==",
"null",
")",
"{",
"Transformer",
"transformer",
"=",
"new",
"Transformer",
"(",
")",
"{",
"@",
"Override",
"public",
"Obje... | Returns a lazy initialized Map which allows access to the dynamic function beans using the JSP EL.<p>
When given a key, the returned map will look up the corresponding dynamic function bean in the module configuration.<p>
@return a lazy initialized Map which allows access to the dynamic function beans using the JSP E... | [
"Returns",
"a",
"lazy",
"initialized",
"Map",
"which",
"allows",
"access",
"to",
"the",
"dynamic",
"function",
"beans",
"using",
"the",
"JSP",
"EL",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspStandardContextBean.java#L1051-L1077 |
apiman/apiman | common/net/src/main/java/io/apiman/common/net/hawkular/HawkularMetricsClient.java | HawkularMetricsClient.addMultipleCounterDataPoints | public void addMultipleCounterDataPoints(String tenantId, List<MetricLongBean> data) {
"""
Adds one or more data points for multiple counters all at once!
@param tenantId
@param data
"""
try {
URL endpoint = serverUrl.toURI().resolve("counters/raw").toURL(); //$NON-NLS-1$
Requ... | java | public void addMultipleCounterDataPoints(String tenantId, List<MetricLongBean> data) {
try {
URL endpoint = serverUrl.toURI().resolve("counters/raw").toURL(); //$NON-NLS-1$
Request request = new Request.Builder()
.url(endpoint)
.post(toBody(data))
... | [
"public",
"void",
"addMultipleCounterDataPoints",
"(",
"String",
"tenantId",
",",
"List",
"<",
"MetricLongBean",
">",
"data",
")",
"{",
"try",
"{",
"URL",
"endpoint",
"=",
"serverUrl",
".",
"toURI",
"(",
")",
".",
"resolve",
"(",
"\"counters/raw\"",
")",
"."... | Adds one or more data points for multiple counters all at once!
@param tenantId
@param data | [
"Adds",
"one",
"or",
"more",
"data",
"points",
"for",
"multiple",
"counters",
"all",
"at",
"once!"
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/net/src/main/java/io/apiman/common/net/hawkular/HawkularMetricsClient.java#L272-L287 |
sebastiangraf/perfidix | src/main/java/org/perfidix/element/BenchmarkExecutor.java | BenchmarkExecutor.initialize | public static void initialize(final AbstractConfig config, final BenchmarkResult result) {
"""
Initializing the executor.
@param config to be benched
@param result to be stored to
"""
METERS_TO_BENCH.clear();
METERS_TO_BENCH.addAll(Arrays.asList(config.getMeters()));
EXECUTOR.clear(... | java | public static void initialize(final AbstractConfig config, final BenchmarkResult result) {
METERS_TO_BENCH.clear();
METERS_TO_BENCH.addAll(Arrays.asList(config.getMeters()));
EXECUTOR.clear();
BENCHRES = result;
CONFIG = config;
} | [
"public",
"static",
"void",
"initialize",
"(",
"final",
"AbstractConfig",
"config",
",",
"final",
"BenchmarkResult",
"result",
")",
"{",
"METERS_TO_BENCH",
".",
"clear",
"(",
")",
";",
"METERS_TO_BENCH",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"confi... | Initializing the executor.
@param config to be benched
@param result to be stored to | [
"Initializing",
"the",
"executor",
"."
] | train | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/element/BenchmarkExecutor.java#L122-L129 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/CountStatisticImpl.java | CountStatisticImpl.set | public void set(long count, long startTime, long lastSampleTime) {
"""
/*
Non-Synchronizable: counter is "replaced" with the input value. Caller should synchronize.
"""
this.count = count;
this.startTime = startTime;
this.lastSampleTime = lastSampleTime;
} | java | public void set(long count, long startTime, long lastSampleTime) {
this.count = count;
this.startTime = startTime;
this.lastSampleTime = lastSampleTime;
} | [
"public",
"void",
"set",
"(",
"long",
"count",
",",
"long",
"startTime",
",",
"long",
"lastSampleTime",
")",
"{",
"this",
".",
"count",
"=",
"count",
";",
"this",
".",
"startTime",
"=",
"startTime",
";",
"this",
".",
"lastSampleTime",
"=",
"lastSampleTime"... | /*
Non-Synchronizable: counter is "replaced" with the input value. Caller should synchronize. | [
"/",
"*",
"Non",
"-",
"Synchronizable",
":",
"counter",
"is",
"replaced",
"with",
"the",
"input",
"value",
".",
"Caller",
"should",
"synchronize",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/CountStatisticImpl.java#L72-L76 |
Coreoz/Wisp | src/main/java/com/coreoz/wisp/LongRunningJobMonitor.java | LongRunningJobMonitor.cleanUpLongJobIfItHasFinishedExecuting | Long cleanUpLongJobIfItHasFinishedExecuting(long currentTime, Job job) {
"""
cleanup jobs that have finished executing after {@link #thresholdDetectionInMillis}
"""
if(longRunningJobs.containsKey(job)
&& longRunningJobs.get(job).executionsCount != job.executionsCount()) {
Long jobLastExecutionTimeInMil... | java | Long cleanUpLongJobIfItHasFinishedExecuting(long currentTime, Job job) {
if(longRunningJobs.containsKey(job)
&& longRunningJobs.get(job).executionsCount != job.executionsCount()) {
Long jobLastExecutionTimeInMillis = job.lastExecutionEndedTimeInMillis();
int jobExecutionsCount = job.executionsCount();
Lon... | [
"Long",
"cleanUpLongJobIfItHasFinishedExecuting",
"(",
"long",
"currentTime",
",",
"Job",
"job",
")",
"{",
"if",
"(",
"longRunningJobs",
".",
"containsKey",
"(",
"job",
")",
"&&",
"longRunningJobs",
".",
"get",
"(",
"job",
")",
".",
"executionsCount",
"!=",
"j... | cleanup jobs that have finished executing after {@link #thresholdDetectionInMillis} | [
"cleanup",
"jobs",
"that",
"have",
"finished",
"executing",
"after",
"{"
] | train | https://github.com/Coreoz/Wisp/blob/6d5de3b88fbe259e327296eea167b18cf41c7641/src/main/java/com/coreoz/wisp/LongRunningJobMonitor.java#L115-L144 |
poetix/protonpack | src/main/java/com/codepoetics/protonpack/StreamUtils.java | StreamUtils.takeUntilInclusive | public static <T> Stream<T> takeUntilInclusive(Stream<T> source, Predicate<T> condition) {
"""
Construct a stream which takes values from the source stream until but including the first value that is
encountered which meets the supplied condition.
@param source The source stream.
@param condition The condition ... | java | public static <T> Stream<T> takeUntilInclusive(Stream<T> source, Predicate<T> condition) {
return takeWhileInclusive(source, condition.negate());
} | [
"public",
"static",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"takeUntilInclusive",
"(",
"Stream",
"<",
"T",
">",
"source",
",",
"Predicate",
"<",
"T",
">",
"condition",
")",
"{",
"return",
"takeWhileInclusive",
"(",
"source",
",",
"condition",
".",
"negat... | Construct a stream which takes values from the source stream until but including the first value that is
encountered which meets the supplied condition.
@param source The source stream.
@param condition The condition to apply to elements of the source stream.
@param <T> The type over which the stream streams.
@return A... | [
"Construct",
"a",
"stream",
"which",
"takes",
"values",
"from",
"the",
"source",
"stream",
"until",
"but",
"including",
"the",
"first",
"value",
"that",
"is",
"encountered",
"which",
"meets",
"the",
"supplied",
"condition",
"."
] | train | https://github.com/poetix/protonpack/blob/00c55a05a4779926d02d5f4e6c820560a773f9f1/src/main/java/com/codepoetics/protonpack/StreamUtils.java#L167-L169 |
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.deleteRegexEntityModel | public OperationStatus deleteRegexEntityModel(UUID appId, String versionId, UUID regexEntityId) {
"""
Deletes a regex entity model from the application.
@param appId The application ID.
@param versionId The version ID.
@param regexEntityId The regex entity extractor ID.
@throws IllegalArgumentException throw... | java | public OperationStatus deleteRegexEntityModel(UUID appId, String versionId, UUID regexEntityId) {
return deleteRegexEntityModelWithServiceResponseAsync(appId, versionId, regexEntityId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deleteRegexEntityModel",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"regexEntityId",
")",
"{",
"return",
"deleteRegexEntityModelWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"regexEntityId",
")",
".",
... | Deletes a regex entity model from the application.
@param appId The application ID.
@param versionId The version ID.
@param regexEntityId The regex entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@... | [
"Deletes",
"a",
"regex",
"entity",
"model",
"from",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10369-L10371 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java | PAbstractObject.optObject | @Override
public final PObject optObject(final String key, final PObject defaultValue) {
"""
Get a property as a array or default.
@param key the property name
@param defaultValue default
"""
PObject result = optObject(key);
return result == null ? defaultValue : result;
} | java | @Override
public final PObject optObject(final String key, final PObject defaultValue) {
PObject result = optObject(key);
return result == null ? defaultValue : result;
} | [
"@",
"Override",
"public",
"final",
"PObject",
"optObject",
"(",
"final",
"String",
"key",
",",
"final",
"PObject",
"defaultValue",
")",
"{",
"PObject",
"result",
"=",
"optObject",
"(",
"key",
")",
";",
"return",
"result",
"==",
"null",
"?",
"defaultValue",
... | Get a property as a array or default.
@param key the property name
@param defaultValue default | [
"Get",
"a",
"property",
"as",
"a",
"array",
"or",
"default",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java#L195-L199 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAnnotationPropertyDomainAxiomImpl_CustomFieldSerializer.java | OWLAnnotationPropertyDomainAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLAnnotationPropertyDomainAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link c... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLAnnotationPropertyDomainAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLAnnotationPropertyDomainAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}... | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAnnotationPropertyDomainAxiomImpl_CustomFieldSerializer.java#L76-L79 |
vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java | SkbShellFactory.newShell | public static SkbShell newShell(String id, MessageRenderer renderer) {
"""
Returns a new shell with a given identifier and STGroup plus console activated.
@param id new shell with identifier
@param renderer a renderer for help messages
@return new shell
"""
return SkbShellFactory.newShell(id, renderer, tr... | java | public static SkbShell newShell(String id, MessageRenderer renderer){
return SkbShellFactory.newShell(id, renderer, true);
} | [
"public",
"static",
"SkbShell",
"newShell",
"(",
"String",
"id",
",",
"MessageRenderer",
"renderer",
")",
"{",
"return",
"SkbShellFactory",
".",
"newShell",
"(",
"id",
",",
"renderer",
",",
"true",
")",
";",
"}"
] | Returns a new shell with a given identifier and STGroup plus console activated.
@param id new shell with identifier
@param renderer a renderer for help messages
@return new shell | [
"Returns",
"a",
"new",
"shell",
"with",
"a",
"given",
"identifier",
"and",
"STGroup",
"plus",
"console",
"activated",
"."
] | train | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java#L85-L87 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java | InodeTreePersistentState.applyAndJournal | public void applyAndJournal(Supplier<JournalContext> context, RenameEntry entry) {
"""
Renames an inode.
@param context journal context supplier
@param entry rename entry
"""
try {
applyRename(entry);
context.get().append(JournalEntry.newBuilder().setRename(entry).build());
} catch (Thr... | java | public void applyAndJournal(Supplier<JournalContext> context, RenameEntry entry) {
try {
applyRename(entry);
context.get().append(JournalEntry.newBuilder().setRename(entry).build());
} catch (Throwable t) {
ProcessUtils.fatalError(LOG, t, "Failed to apply %s", entry);
throw t; // fatalEr... | [
"public",
"void",
"applyAndJournal",
"(",
"Supplier",
"<",
"JournalContext",
">",
"context",
",",
"RenameEntry",
"entry",
")",
"{",
"try",
"{",
"applyRename",
"(",
"entry",
")",
";",
"context",
".",
"get",
"(",
")",
".",
"append",
"(",
"JournalEntry",
".",... | Renames an inode.
@param context journal context supplier
@param entry rename entry | [
"Renames",
"an",
"inode",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L202-L210 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WLabel.java | WLabel.setHint | public void setHint(final String hint, final Serializable... args) {
"""
Sets the label "hint" text, which can be used to provide additional information to the user.
@param hint the hint text, using {@link MessageFormat} syntax.
@param args optional arguments for the message format string.
"""
Serializab... | java | public void setHint(final String hint, final Serializable... args) {
Serializable currHint = getComponentModel().hint;
Serializable hintToBeSet = I18nUtilities.asMessage(hint, args);
if (!Objects.equals(hintToBeSet, currHint)) {
getOrCreateComponentModel().hint = hintToBeSet;
}
} | [
"public",
"void",
"setHint",
"(",
"final",
"String",
"hint",
",",
"final",
"Serializable",
"...",
"args",
")",
"{",
"Serializable",
"currHint",
"=",
"getComponentModel",
"(",
")",
".",
"hint",
";",
"Serializable",
"hintToBeSet",
"=",
"I18nUtilities",
".",
"asM... | Sets the label "hint" text, which can be used to provide additional information to the user.
@param hint the hint text, using {@link MessageFormat} syntax.
@param args optional arguments for the message format string. | [
"Sets",
"the",
"label",
"hint",
"text",
"which",
"can",
"be",
"used",
"to",
"provide",
"additional",
"information",
"to",
"the",
"user",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WLabel.java#L128-L135 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java | CheckClassAdapter.checkFieldTypeSignature | private static int checkFieldTypeSignature(final String signature, int pos) {
"""
Checks a field type signature.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the checked part.
""... | java | private static int checkFieldTypeSignature(final String signature, int pos) {
// FieldTypeSignature:
// ClassTypeSignature | ArrayTypeSignature | TypeVariableSignature
//
// ArrayTypeSignature:
// [ TypeSignature
switch (getChar(signature, pos)) {
case 'L':
... | [
"private",
"static",
"int",
"checkFieldTypeSignature",
"(",
"final",
"String",
"signature",
",",
"int",
"pos",
")",
"{",
"// FieldTypeSignature:",
"// ClassTypeSignature | ArrayTypeSignature | TypeVariableSignature",
"//",
"// ArrayTypeSignature:",
"// [ TypeSignature",
"switch",... | Checks a field type signature.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the checked part. | [
"Checks",
"a",
"field",
"type",
"signature",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java#L820-L835 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.listNextAsync | public ServiceFuture<List<CloudPool>> listNextAsync(final String nextPageLink, final ServiceFuture<List<CloudPool>> serviceFuture, final ListOperationCallback<CloudPool> serviceCallback) {
"""
Lists all of the pools in the specified account.
@param nextPageLink The NextLink from the previous successful call to ... | java | public ServiceFuture<List<CloudPool>> listNextAsync(final String nextPageLink, final ServiceFuture<List<CloudPool>> serviceFuture, final ListOperationCallback<CloudPool> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listNextSinglePageAsync(nextPageLink),
new Func1<... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"CloudPool",
">",
">",
"listNextAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"ServiceFuture",
"<",
"List",
"<",
"CloudPool",
">",
">",
"serviceFuture",
",",
"final",
"ListOperationCallback",
"<",
"Clo... | Lists all of the pools in the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param serviceFuture the ServiceFuture object tracking the Retrofit calls
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArg... | [
"Lists",
"all",
"of",
"the",
"pools",
"in",
"the",
"specified",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L3922-L3932 |
aws/aws-sdk-java | aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/validation/ValidationContext.java | ValidationContext.assertIsValidReferencePath | public void assertIsValidReferencePath(String path, String propertyName) {
"""
Asserts that the string represents a valid reference path expression.
@param path Path expression to validate.
@param propertyName Name of property.
"""
if (path == null) {
return;
}
i... | java | public void assertIsValidReferencePath(String path, String propertyName) {
if (path == null) {
return;
}
if (path.isEmpty()) {
problemReporter.report(new Problem(this, String.format("%s cannot be empty", propertyName)));
return;
}
} | [
"public",
"void",
"assertIsValidReferencePath",
"(",
"String",
"path",
",",
"String",
"propertyName",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"path",
".",
"isEmpty",
"(",
")",
")",
"{",
"problemReporter",
".",
... | Asserts that the string represents a valid reference path expression.
@param path Path expression to validate.
@param propertyName Name of property. | [
"Asserts",
"that",
"the",
"string",
"represents",
"a",
"valid",
"reference",
"path",
"expression",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/validation/ValidationContext.java#L181-L189 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java | VisualizerParameterizer.newContext | public VisualizerContext newContext(ResultHierarchy hier, Result start) {
"""
Make a new visualization context
@param hier Result hierarchy
@param start Starting result
@return New context
"""
Collection<Relation<?>> rels = ResultUtil.filterResults(hier, Relation.class);
for(Relation<?> rel : rels... | java | public VisualizerContext newContext(ResultHierarchy hier, Result start) {
Collection<Relation<?>> rels = ResultUtil.filterResults(hier, Relation.class);
for(Relation<?> rel : rels) {
if(samplesize == 0) {
continue;
}
if(!ResultUtil.filterResults(hier, rel, SamplingResult.class).isEmpty... | [
"public",
"VisualizerContext",
"newContext",
"(",
"ResultHierarchy",
"hier",
",",
"Result",
"start",
")",
"{",
"Collection",
"<",
"Relation",
"<",
"?",
">",
">",
"rels",
"=",
"ResultUtil",
".",
"filterResults",
"(",
"hier",
",",
"Relation",
".",
"class",
")"... | Make a new visualization context
@param hier Result hierarchy
@param start Starting result
@return New context | [
"Make",
"a",
"new",
"visualization",
"context"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java#L128-L144 |
structr/structr | structr-modules/structr-signed-jar-module/src/main/java/org/structr/jar/SignedJarBuilder.java | SignedJarBuilder.writeEntry | private void writeEntry(final InputStream input, final JarEntry entry) throws IOException {
"""
Adds an entry to the output jar, and write its content from the {@link InputStream}
@param input The input stream from where to write the entry content.
@param entry the entry to write in the jar.
@throws IOExcepti... | java | private void writeEntry(final InputStream input, final JarEntry entry) throws IOException {
// add the entry to the jar archive
jarOutputStream.putNextEntry(entry);
// read the content of the entry from the input stream, and write it into the archive.
int count;
while ((count = input.read(buffer)) != -1) {... | [
"private",
"void",
"writeEntry",
"(",
"final",
"InputStream",
"input",
",",
"final",
"JarEntry",
"entry",
")",
"throws",
"IOException",
"{",
"// add the entry to the jar archive",
"jarOutputStream",
".",
"putNextEntry",
"(",
"entry",
")",
";",
"// read the content of th... | Adds an entry to the output jar, and write its content from the {@link InputStream}
@param input The input stream from where to write the entry content.
@param entry the entry to write in the jar.
@throws IOException | [
"Adds",
"an",
"entry",
"to",
"the",
"output",
"jar",
"and",
"write",
"its",
"content",
"from",
"the",
"{",
"@link",
"InputStream",
"}"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-modules/structr-signed-jar-module/src/main/java/org/structr/jar/SignedJarBuilder.java#L164-L194 |
lucee/Lucee | core/src/main/java/lucee/commons/date/JREDateTimeUtil.java | JREDateTimeUtil.addTimeZoneOffset | private void addTimeZoneOffset(Calendar c, StringBuilder sb) {
"""
/*
public static void main(String[] args) { Calendar c =
Calendar.getInstance(TimeZone.getTimeZone("Pacific/Marquesas")); //c =
Calendar.getInstance(TimeZoneConstants.AUSTRALIA_DARWIN);
c.setTimeInMillis(0); print.e(c.getTimeZone()); print.e(... | java | private void addTimeZoneOffset(Calendar c, StringBuilder sb) {
int min = (c.get(Calendar.ZONE_OFFSET) + c.get(Calendar.DST_OFFSET)) / 60000;
char op;
if (min < 0) {
op = '-';
min = min - min - min;
}
else op = '+';
int hours = min / 60;
min = min - (hours * 60);
sb.append(op);
toString(sb, hours, 2)... | [
"private",
"void",
"addTimeZoneOffset",
"(",
"Calendar",
"c",
",",
"StringBuilder",
"sb",
")",
"{",
"int",
"min",
"=",
"(",
"c",
".",
"get",
"(",
"Calendar",
".",
"ZONE_OFFSET",
")",
"+",
"c",
".",
"get",
"(",
"Calendar",
".",
"DST_OFFSET",
")",
")",
... | /*
public static void main(String[] args) { Calendar c =
Calendar.getInstance(TimeZone.getTimeZone("Pacific/Marquesas")); //c =
Calendar.getInstance(TimeZoneConstants.AUSTRALIA_DARWIN);
c.setTimeInMillis(0); print.e(c.getTimeZone()); print.e(toTimeZoneOffset(c));
print.e(c.get(Calendar.ZONE_OFFSET)+c.get(Calendar.DST... | [
"/",
"*",
"public",
"static",
"void",
"main",
"(",
"String",
"[]",
"args",
")",
"{",
"Calendar",
"c",
"=",
"Calendar",
".",
"getInstance",
"(",
"TimeZone",
".",
"getTimeZone",
"(",
"Pacific",
"/",
"Marquesas",
"))",
";",
"//",
"c",
"=",
"Calendar",
"."... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/date/JREDateTimeUtil.java#L235-L250 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/COF.java | COF.computeCOFScores | private void computeCOFScores(KNNQuery<O> knnq, DBIDs ids, DoubleDataStore acds, WritableDoubleDataStore cofs, DoubleMinMax cofminmax) {
"""
Compute Connectivity outlier factors.
@param knnq KNN query
@param ids IDs to process
@param acds Average chaining distances
@param cofs Connectivity outlier factor sto... | java | private void computeCOFScores(KNNQuery<O> knnq, DBIDs ids, DoubleDataStore acds, WritableDoubleDataStore cofs, DoubleMinMax cofminmax) {
FiniteProgress progressCOFs = LOG.isVerbose() ? new FiniteProgress("COF for objects", ids.size(), LOG) : null;
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
... | [
"private",
"void",
"computeCOFScores",
"(",
"KNNQuery",
"<",
"O",
">",
"knnq",
",",
"DBIDs",
"ids",
",",
"DoubleDataStore",
"acds",
",",
"WritableDoubleDataStore",
"cofs",
",",
"DoubleMinMax",
"cofminmax",
")",
"{",
"FiniteProgress",
"progressCOFs",
"=",
"LOG",
... | Compute Connectivity outlier factors.
@param knnq KNN query
@param ids IDs to process
@param acds Average chaining distances
@param cofs Connectivity outlier factor storage
@param cofminmax Score minimum/maximum tracker | [
"Compute",
"Connectivity",
"outlier",
"factors",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/COF.java#L203-L224 |
jenkinsci/jenkins | core/src/main/java/hudson/scm/SCMS.java | SCMS.parseSCM | @SuppressWarnings("deprecation")
public static SCM parseSCM(StaplerRequest req, AbstractProject target) throws FormException, ServletException {
"""
Parses {@link SCM} configuration from the submitted form.
@param target
The project for which this SCM is configured to.
"""
SCM scm = SCM.all().n... | java | @SuppressWarnings("deprecation")
public static SCM parseSCM(StaplerRequest req, AbstractProject target) throws FormException, ServletException {
SCM scm = SCM.all().newInstanceFromRadioList(req.getSubmittedForm().getJSONObject("scm"));
if (scm == null) {
scm = new NullSCM(); // JENKINS-3... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"SCM",
"parseSCM",
"(",
"StaplerRequest",
"req",
",",
"AbstractProject",
"target",
")",
"throws",
"FormException",
",",
"ServletException",
"{",
"SCM",
"scm",
"=",
"SCM",
".",
"all",
"(",
... | Parses {@link SCM} configuration from the submitted form.
@param target
The project for which this SCM is configured to. | [
"Parses",
"{",
"@link",
"SCM",
"}",
"configuration",
"from",
"the",
"submitted",
"form",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/SCMS.java#L57-L65 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/events/service/EventService.java | EventService.dispatchEvent | public EventHandlerStatus dispatchEvent(HttpServletRequest httpRequest) {
"""
Takes the event notification message, parses it and dispatches the event
to the registered handler for the event category and type.
@param httpRequest The http request containing the event notification message
@return A response wit... | java | public EventHandlerStatus dispatchEvent(HttpServletRequest httpRequest) {
ApiContext apiContext = new MozuApiContext(httpRequest);
Event event = null;
// get the event from the request and validate
try {
String body = IOUtils.toString(httpRequest.getInputStream());
... | [
"public",
"EventHandlerStatus",
"dispatchEvent",
"(",
"HttpServletRequest",
"httpRequest",
")",
"{",
"ApiContext",
"apiContext",
"=",
"new",
"MozuApiContext",
"(",
"httpRequest",
")",
";",
"Event",
"event",
"=",
"null",
";",
"// get the event from the request and validate... | Takes the event notification message, parses it and dispatches the event
to the registered handler for the event category and type.
@param httpRequest The http request containing the event notification message
@return A response with a status code and optionally an error message | [
"Takes",
"the",
"event",
"notification",
"message",
"parses",
"it",
"and",
"dispatches",
"the",
"event",
"to",
"the",
"registered",
"handler",
"for",
"the",
"event",
"category",
"and",
"type",
"."
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/events/service/EventService.java#L34-L63 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/parser/TypeLord.java | TypeLord.findParameterizedType_Reverse | public static IType findParameterizedType_Reverse( IType sourceType, IType targetType ) {
"""
ArrayList<Foo> List<Foo> ArrayList<Z>
"""
if( sourceType == null || targetType == null )
{
return null;
}
if( !sourceType.isParameterizedType() )
{
return... | java | public static IType findParameterizedType_Reverse( IType sourceType, IType targetType )
{
if( sourceType == null || targetType == null )
{
return null;
}
if( !sourceType.isParameterizedType() )
{
return null;
}
// List<Z>
IType sourceTypeInHier = findParameterizedType( ta... | [
"public",
"static",
"IType",
"findParameterizedType_Reverse",
"(",
"IType",
"sourceType",
",",
"IType",
"targetType",
")",
"{",
"if",
"(",
"sourceType",
"==",
"null",
"||",
"targetType",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"... | ArrayList<Foo> List<Foo> ArrayList<Z> | [
"ArrayList<Foo",
">",
"List<Foo",
">",
"ArrayList<Z",
">"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/parser/TypeLord.java#L1145-L1176 |
Netflix/zeno | src/main/java/com/netflix/zeno/diff/DiffOperation.java | DiffOperation.performDiff | public DiffReport performDiff(FastBlobStateEngine fromState, FastBlobStateEngine toState) throws DiffReportGenerationException {
"""
Perform a diff between two data states.
Note: For now, this operation will ignore type instructions for non-unique keys.
@param fromState - The "from" state engine, populated ... | java | public DiffReport performDiff(FastBlobStateEngine fromState, FastBlobStateEngine toState) throws DiffReportGenerationException {
return performDiff(null, fromState, toState);
} | [
"public",
"DiffReport",
"performDiff",
"(",
"FastBlobStateEngine",
"fromState",
",",
"FastBlobStateEngine",
"toState",
")",
"throws",
"DiffReportGenerationException",
"{",
"return",
"performDiff",
"(",
"null",
",",
"fromState",
",",
"toState",
")",
";",
"}"
] | Perform a diff between two data states.
Note: For now, this operation will ignore type instructions for non-unique keys.
@param fromState - The "from" state engine, populated with one of the deserialized data states to compare
@param toState - the "to" state engine, populated with the other deserialized data state t... | [
"Perform",
"a",
"diff",
"between",
"two",
"data",
"states",
"."
] | train | https://github.com/Netflix/zeno/blob/e571a3f1e304942724d454408fe6417fe18c20fd/src/main/java/com/netflix/zeno/diff/DiffOperation.java#L53-L55 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/RingSetManipulator.java | RingSetManipulator.getHeaviestRing | public static IRing getHeaviestRing(IRingSet ringSet, IBond bond) {
"""
We define the heaviest ring as the one with the highest number of double bonds.
Needed for example for the placement of in-ring double bonds.
@param ringSet The collection of rings
@param bond A bond which must be contained by the heav... | java | public static IRing getHeaviestRing(IRingSet ringSet, IBond bond) {
IRingSet rings = ringSet.getRings(bond);
IRing ring = null;
int maxOrderSum = 0;
for (Object ring1 : rings.atomContainers()) {
if (maxOrderSum < ((IRing) ring1).getBondOrderSum()) {
ring = (IR... | [
"public",
"static",
"IRing",
"getHeaviestRing",
"(",
"IRingSet",
"ringSet",
",",
"IBond",
"bond",
")",
"{",
"IRingSet",
"rings",
"=",
"ringSet",
".",
"getRings",
"(",
"bond",
")",
";",
"IRing",
"ring",
"=",
"null",
";",
"int",
"maxOrderSum",
"=",
"0",
";... | We define the heaviest ring as the one with the highest number of double bonds.
Needed for example for the placement of in-ring double bonds.
@param ringSet The collection of rings
@param bond A bond which must be contained by the heaviest ring
@return The ring with the higest number of double bonds connected to a... | [
"We",
"define",
"the",
"heaviest",
"ring",
"as",
"the",
"one",
"with",
"the",
"highest",
"number",
"of",
"double",
"bonds",
".",
"Needed",
"for",
"example",
"for",
"the",
"placement",
"of",
"in",
"-",
"ring",
"double",
"bonds",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/RingSetManipulator.java#L143-L154 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/BaseGridScreen.java | BaseGridScreen.getNextRecord | public Record getNextRecord(PrintWriter out, int iPrintOptions, boolean bFirstTime, boolean bHeadingFootingExists)
throws DBException {
"""
Get the next record.
This is the special method for a report. It handles breaks by disabling all listeners
except filter listeners, then reenabling and calling the l... | java | public Record getNextRecord(PrintWriter out, int iPrintOptions, boolean bFirstTime, boolean bHeadingFootingExists)
throws DBException
{
Object[] rgobjEnabled = null;
boolean bAfterRequery = !this.getMainRecord().isOpen();
if (!this.getMainRecord().isOpen())
this.getMainRe... | [
"public",
"Record",
"getNextRecord",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
",",
"boolean",
"bFirstTime",
",",
"boolean",
"bHeadingFootingExists",
")",
"throws",
"DBException",
"{",
"Object",
"[",
"]",
"rgobjEnabled",
"=",
"null",
";",
"boolean",
... | Get the next record.
This is the special method for a report. It handles breaks by disabling all listeners
except filter listeners, then reenabling and calling the listeners after the footing
has been printed, so totals, etc will be in the next break.
@param out The out stream.
@param iPrintOptions Print options.
@para... | [
"Get",
"the",
"next",
"record",
".",
"This",
"is",
"the",
"special",
"method",
"for",
"a",
"report",
".",
"It",
"handles",
"breaks",
"by",
"disabling",
"all",
"listeners",
"except",
"filter",
"listeners",
"then",
"reenabling",
"and",
"calling",
"the",
"liste... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/BaseGridScreen.java#L302-L321 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java | DubiousListCollection.reportBugs | private void reportBugs() {
"""
implements the detector, by reporting all remaining fields that only have set
based access
"""
int major = getClassContext().getJavaClass().getMajor();
for (Map.Entry<String, FieldInfo> entry : fieldsReported.entrySet()) {
String field = entry.getKey();
FieldInfo fi =... | java | private void reportBugs() {
int major = getClassContext().getJavaClass().getMajor();
for (Map.Entry<String, FieldInfo> entry : fieldsReported.entrySet()) {
String field = entry.getKey();
FieldInfo fi = entry.getValue();
int cnt = fi.getSetCount();
if (cnt > 0) {
FieldAnnotation fa = getFieldAnnotati... | [
"private",
"void",
"reportBugs",
"(",
")",
"{",
"int",
"major",
"=",
"getClassContext",
"(",
")",
".",
"getJavaClass",
"(",
")",
".",
"getMajor",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"FieldInfo",
">",
"entry",
":",
"fie... | implements the detector, by reporting all remaining fields that only have set
based access | [
"implements",
"the",
"detector",
"by",
"reporting",
"all",
"remaining",
"fields",
"that",
"only",
"have",
"set",
"based",
"access"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java#L243-L259 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/FacetUrl.java | FacetUrl.getFacetUrl | public static MozuUrl getFacetUrl(Integer facetId, String responseFields, Boolean validate) {
"""
Get Resource Url for GetFacet
@param facetId Unique identifier of the facet to retrieve.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JS... | java | public static MozuUrl getFacetUrl(Integer facetId, String responseFields, Boolean validate)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/facets/{facetId}?validate={validate}&responseFields={responseFields}");
formatter.formatUrl("facetId", facetId);
formatter.formatUrl("responseFi... | [
"public",
"static",
"MozuUrl",
"getFacetUrl",
"(",
"Integer",
"facetId",
",",
"String",
"responseFields",
",",
"Boolean",
"validate",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/facets/{facetId}?validate={validate}&... | Get Resource Url for GetFacet
@param facetId Unique identifier of the facet to retrieve.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this para... | [
"Get",
"Resource",
"Url",
"for",
"GetFacet"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/FacetUrl.java#L23-L30 |
realtime-framework/RealtimeStorage-Android | library/src/main/java/co/realtime/storage/TableRef.java | TableRef.lessThan | public TableRef lessThan(String attributeName, ItemAttribute value) {
"""
Applies a filter to the table. When fetched, it will return the items lesser than the filter property value.
<pre>
StorageRef storage = new StorageRef("your_app_key", "your_token");
TableRef tableRef = storage.table("your_table");
... | java | public TableRef lessThan(String attributeName, ItemAttribute value){
filters.add(new Filter(StorageFilter.LESSERTHAN, attributeName, value, null));
return this;
} | [
"public",
"TableRef",
"lessThan",
"(",
"String",
"attributeName",
",",
"ItemAttribute",
"value",
")",
"{",
"filters",
".",
"add",
"(",
"new",
"Filter",
"(",
"StorageFilter",
".",
"LESSERTHAN",
",",
"attributeName",
",",
"value",
",",
"null",
")",
")",
";",
... | Applies a filter to the table. When fetched, it will return the items lesser than the filter property value.
<pre>
StorageRef storage = new StorageRef("your_app_key", "your_token");
TableRef tableRef = storage.table("your_table");
// Retrieve all items that have their "itemProperty" value lesser than 10
tableRef.les... | [
"Applies",
"a",
"filter",
"to",
"the",
"table",
".",
"When",
"fetched",
"it",
"will",
"return",
"the",
"items",
"lesser",
"than",
"the",
"filter",
"property",
"value",
"."
] | train | https://github.com/realtime-framework/RealtimeStorage-Android/blob/05816a6b7a6dcc83f9e7400ac3048494dadca302/library/src/main/java/co/realtime/storage/TableRef.java#L763-L766 |
remkop/picocli | src/main/java/picocli/CommandLine.java | CommandLine.populateCommand | public static <T> T populateCommand(T command, String... args) {
"""
<p>
Convenience method that initializes the specified annotated object from the specified command line arguments.
</p><p>
This is equivalent to
</p><pre>
CommandLine cli = new CommandLine(command);
cli.parse(args);
return command;
</pre>
... | java | public static <T> T populateCommand(T command, String... args) {
CommandLine cli = toCommandLine(command, new DefaultFactory());
cli.parse(args);
return command;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"populateCommand",
"(",
"T",
"command",
",",
"String",
"...",
"args",
")",
"{",
"CommandLine",
"cli",
"=",
"toCommandLine",
"(",
"command",
",",
"new",
"DefaultFactory",
"(",
")",
")",
";",
"cli",
".",
"parse",
"... | <p>
Convenience method that initializes the specified annotated object from the specified command line arguments.
</p><p>
This is equivalent to
</p><pre>
CommandLine cli = new CommandLine(command);
cli.parse(args);
return command;
</pre>
@param command the object to initialize. This object contains fields annotated wi... | [
"<p",
">",
"Convenience",
"method",
"that",
"initializes",
"the",
"specified",
"annotated",
"object",
"from",
"the",
"specified",
"command",
"line",
"arguments",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"is",
"equivalent",
"to",
"<",
"/",
"p",
">",
"<... | train | https://github.com/remkop/picocli/blob/3c5384f0d12817401d1921c3013c1282e2edcab2/src/main/java/picocli/CommandLine.java#L1031-L1035 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CharList.java | CharList.noneMatch | public <E extends Exception> boolean noneMatch(Try.CharPredicate<E> filter) throws E {
"""
Returns whether no elements of this List match the provided predicate.
@param filter
@return
"""
return noneMatch(0, size(), filter);
} | java | public <E extends Exception> boolean noneMatch(Try.CharPredicate<E> filter) throws E {
return noneMatch(0, size(), filter);
} | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"boolean",
"noneMatch",
"(",
"Try",
".",
"CharPredicate",
"<",
"E",
">",
"filter",
")",
"throws",
"E",
"{",
"return",
"noneMatch",
"(",
"0",
",",
"size",
"(",
")",
",",
"filter",
")",
";",
"}"
] | Returns whether no elements of this List match the provided predicate.
@param filter
@return | [
"Returns",
"whether",
"no",
"elements",
"of",
"this",
"List",
"match",
"the",
"provided",
"predicate",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CharList.java#L1000-L1002 |
ironjacamar/ironjacamar | tracer/src/main/java/org/ironjacamar/tracer/TraceEventHelper.java | TraceEventHelper.getEvents | public static List<TraceEvent> getEvents(FileReader fr, File directory) throws Exception {
"""
Get the events
@param fr The file reader
@param directory The directory
@return The events
@exception Exception If an error occurs
"""
return getEvents(getData(fr, directory));
} | java | public static List<TraceEvent> getEvents(FileReader fr, File directory) throws Exception
{
return getEvents(getData(fr, directory));
} | [
"public",
"static",
"List",
"<",
"TraceEvent",
">",
"getEvents",
"(",
"FileReader",
"fr",
",",
"File",
"directory",
")",
"throws",
"Exception",
"{",
"return",
"getEvents",
"(",
"getData",
"(",
"fr",
",",
"directory",
")",
")",
";",
"}"
] | Get the events
@param fr The file reader
@param directory The directory
@return The events
@exception Exception If an error occurs | [
"Get",
"the",
"events"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/tracer/src/main/java/org/ironjacamar/tracer/TraceEventHelper.java#L333-L336 |
ggrandes/packer | src/main/java/org/javastack/packer/Packer.java | Packer.putHexString | public Packer putHexString(final String value) throws IllegalArgumentException {
"""
Put Hex String ("0123456789ABCDEF")
@param value
@return
@throws IllegalArgumentException
@see #getHexStringLower()
@see #getHexStringUpper()
"""
try {
final byte[] hex = fromHex(value);
putVInt(hex.length);
... | java | public Packer putHexString(final String value) throws IllegalArgumentException {
try {
final byte[] hex = fromHex(value);
putVInt(hex.length);
ensureCapacity(bufPosition + hex.length);
System.arraycopy(hex, 0, buf, bufPosition, hex.length);
bufPosition += hex.length;
} catch (ParseException e) {
t... | [
"public",
"Packer",
"putHexString",
"(",
"final",
"String",
"value",
")",
"throws",
"IllegalArgumentException",
"{",
"try",
"{",
"final",
"byte",
"[",
"]",
"hex",
"=",
"fromHex",
"(",
"value",
")",
";",
"putVInt",
"(",
"hex",
".",
"length",
")",
";",
"en... | Put Hex String ("0123456789ABCDEF")
@param value
@return
@throws IllegalArgumentException
@see #getHexStringLower()
@see #getHexStringUpper() | [
"Put",
"Hex",
"String",
"(",
"0123456789ABCDEF",
")"
] | train | https://github.com/ggrandes/packer/blob/0b37b286a3d0555050eb2e65419dd74f8d8d3e78/src/main/java/org/javastack/packer/Packer.java#L739-L750 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerOutboundRulesInner.java | LoadBalancerOutboundRulesInner.getAsync | public Observable<OutboundRuleInner> getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName) {
"""
Gets the specified load balancer outbound rule.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param outboundRuleNam... | java | public Observable<OutboundRuleInner> getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName) {
return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName).map(new Func1<ServiceResponse<OutboundRuleInner>, OutboundRuleInner>() {
@Override
... | [
"public",
"Observable",
"<",
"OutboundRuleInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"loadBalancerName",
",",
"String",
"outboundRuleName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"loadBalancerName... | Gets the specified load balancer outbound rule.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param outboundRuleName The name of the outbound rule.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ... | [
"Gets",
"the",
"specified",
"load",
"balancer",
"outbound",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerOutboundRulesInner.java#L233-L240 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractSegment3F.java | AbstractSegment3F.intersectsLineLine | @Pure
public static boolean intersectsLineLine(
double x1, double y1, double z1,
double x2, double y2, double z2,
double x3, double y3, double z3,
double x4, double y4, double z4) {
"""
Replies if two lines are intersecting.
@param x1 is the first point of the first line.
@param y1 is the first po... | java | @Pure
public static boolean intersectsLineLine(
double x1, double y1, double z1,
double x2, double y2, double z2,
double x3, double y3, double z3,
double x4, double y4, double z4) {
double s = computeLineLineIntersectionFactor(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4);
return !Double.isNaN(s);
} | [
"@",
"Pure",
"public",
"static",
"boolean",
"intersectsLineLine",
"(",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"z1",
",",
"double",
"x2",
",",
"double",
"y2",
",",
"double",
"z2",
",",
"double",
"x3",
",",
"double",
"y3",
",",
"double",
"z3... | Replies if two lines are intersecting.
@param x1 is the first point of the first line.
@param y1 is the first point of the first line.
@param z1 is the first point of the first line.
@param x2 is the second point of the first line.
@param y2 is the second point of the first line.
@param z2 is the second point of the f... | [
"Replies",
"if",
"two",
"lines",
"are",
"intersecting",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractSegment3F.java#L517-L525 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLLabelProvider.java | SARLLabelProvider.handleImageDescriptorError | protected ImageDescriptor handleImageDescriptorError(Object[] params, Throwable exception) {
"""
Invoked when an image descriptor cannot be found.
@param params the parameters given to the method polymorphic dispatcher.
@param exception the cause of the error.
@return the image descriptor for the error.
"... | java | protected ImageDescriptor handleImageDescriptorError(Object[] params, Throwable exception) {
if (exception instanceof NullPointerException) {
final Object defaultImage = getDefaultImage();
if (defaultImage instanceof ImageDescriptor) {
return (ImageDescriptor) defaultImage;
}
if (defaultImage instance... | [
"protected",
"ImageDescriptor",
"handleImageDescriptorError",
"(",
"Object",
"[",
"]",
"params",
",",
"Throwable",
"exception",
")",
"{",
"if",
"(",
"exception",
"instanceof",
"NullPointerException",
")",
"{",
"final",
"Object",
"defaultImage",
"=",
"getDefaultImage",... | Invoked when an image descriptor cannot be found.
@param params the parameters given to the method polymorphic dispatcher.
@param exception the cause of the error.
@return the image descriptor for the error. | [
"Invoked",
"when",
"an",
"image",
"descriptor",
"cannot",
"be",
"found",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLLabelProvider.java#L162-L174 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java | TreeScanner.visitBlock | @Override
public R visitBlock(BlockTree node, P p) {
"""
{@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning
"""
return scan(node.getStatements(), p);
} | java | @Override
public R visitBlock(BlockTree node, P p) {
return scan(node.getStatements(), p);
} | [
"@",
"Override",
"public",
"R",
"visitBlock",
"(",
"BlockTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"scan",
"(",
"node",
".",
"getStatements",
"(",
")",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"scans",
"the",
"children",
"in",
"left",
"to",
"right",
"order",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java#L246-L249 |
vdurmont/etaprinter | src/main/java/com/vdurmont/etaprinter/ETAStatusGenerator.java | ETAStatusGenerator.getStatus | public static String getStatus(String elementName, long percentage, double speed, String speedUnit, Duration eta) {
"""
Generate the full status.
@param elementName the optional name of the element that is processed
@param percentage the progression percentage
@param speed the speed of the processing (... | java | public static String getStatus(String elementName, long percentage, double speed, String speedUnit, Duration eta) {
StringBuilder sb = new StringBuilder(getBar(percentage));
sb.append((long) speed);
if (elementName != null) {
sb.append(" ").append(elementName);
}
sb.a... | [
"public",
"static",
"String",
"getStatus",
"(",
"String",
"elementName",
",",
"long",
"percentage",
",",
"double",
"speed",
",",
"String",
"speedUnit",
",",
"Duration",
"eta",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"getBar",
"(",
... | Generate the full status.
@param elementName the optional name of the element that is processed
@param percentage the progression percentage
@param speed the speed of the processing (in number of element by speed unit)
@param speedUnit the unit of the given speed
@param eta the estimated remaining dur... | [
"Generate",
"the",
"full",
"status",
"."
] | train | https://github.com/vdurmont/etaprinter/blob/19039bdbbece8b05ceab2a23757f4e1e8b6872cb/src/main/java/com/vdurmont/etaprinter/ETAStatusGenerator.java#L46-L55 |
igniterealtime/Smack | smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java | AgentSession.setMetaData | public void setMetaData(String key, String val) throws XMPPException, SmackException, InterruptedException {
"""
Allows the addition of a new key-value pair to the agent's meta data, if the value is
new data, the revised meta data will be rebroadcast in an agent's presence broadcast.
@param key the meta data k... | java | public void setMetaData(String key, String val) throws XMPPException, SmackException, InterruptedException {
synchronized (this.metaData) {
List<String> oldVals = metaData.get(key);
if (oldVals == null || !oldVals.get(0).equals(val)) {
oldVals.set(0, val);
... | [
"public",
"void",
"setMetaData",
"(",
"String",
"key",
",",
"String",
"val",
")",
"throws",
"XMPPException",
",",
"SmackException",
",",
"InterruptedException",
"{",
"synchronized",
"(",
"this",
".",
"metaData",
")",
"{",
"List",
"<",
"String",
">",
"oldVals",... | Allows the addition of a new key-value pair to the agent's meta data, if the value is
new data, the revised meta data will be rebroadcast in an agent's presence broadcast.
@param key the meta data key
@param val the non-null meta data value
@throws XMPPException if an exception occurs.
@throws SmackException
@throws I... | [
"Allows",
"the",
"addition",
"of",
"a",
"new",
"key",
"-",
"value",
"pair",
"to",
"the",
"agent",
"s",
"meta",
"data",
"if",
"the",
"value",
"is",
"new",
"data",
"the",
"revised",
"meta",
"data",
"will",
"be",
"rebroadcast",
"in",
"an",
"agent",
"s",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java#L275-L285 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/multilayer/SparkDl4jMultiLayer.java | SparkDl4jMultiLayer.doEvaluation | @SuppressWarnings("unchecked")
public <T extends IEvaluation> T[] doEvaluation(JavaRDD<DataSet> data, int evalBatchSize, T... emptyEvaluations) {
"""
Perform distributed evaluation of any type of {@link IEvaluation} - or multiple IEvaluation instances.
Distributed equivalent of {@link MultiLayerNetwork#doEval... | java | @SuppressWarnings("unchecked")
public <T extends IEvaluation> T[] doEvaluation(JavaRDD<DataSet> data, int evalBatchSize, T... emptyEvaluations) {
return doEvaluation(data, getDefaultEvaluationWorkers(), evalBatchSize, emptyEvaluations );
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"IEvaluation",
">",
"T",
"[",
"]",
"doEvaluation",
"(",
"JavaRDD",
"<",
"DataSet",
">",
"data",
",",
"int",
"evalBatchSize",
",",
"T",
"...",
"emptyEvaluations",
")",
"{",
"... | Perform distributed evaluation of any type of {@link IEvaluation} - or multiple IEvaluation instances.
Distributed equivalent of {@link MultiLayerNetwork#doEvaluation(DataSetIterator, IEvaluation[])}
@param data Data to evaluate on
@param emptyEvaluations Empty evaluation instances. Starting point (seriali... | [
"Perform",
"distributed",
"evaluation",
"of",
"any",
"type",
"of",
"{",
"@link",
"IEvaluation",
"}",
"-",
"or",
"multiple",
"IEvaluation",
"instances",
".",
"Distributed",
"equivalent",
"of",
"{",
"@link",
"MultiLayerNetwork#doEvaluation",
"(",
"DataSetIterator",
"I... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/multilayer/SparkDl4jMultiLayer.java#L694-L697 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/TypeScriptCompilerMojo.java | TypeScriptCompilerMojo.execute | @Override
public void execute() throws MojoExecutionException {
"""
Finds and compiles coffeescript files.
@throws MojoExecutionException if the compilation failed.
"""
if (typescript == null) {
typescript = new TypeScript();
}
if (!typescript.isEnabled()) {
... | java | @Override
public void execute() throws MojoExecutionException {
if (typescript == null) {
typescript = new TypeScript();
}
if (!typescript.isEnabled()) {
removeFromWatching();
getLog().info("Typescript processing disabled");
return;
}
... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"typescript",
"==",
"null",
")",
"{",
"typescript",
"=",
"new",
"TypeScript",
"(",
")",
";",
"}",
"if",
"(",
"!",
"typescript",
".",
"isEnabled",
... | Finds and compiles coffeescript files.
@throws MojoExecutionException if the compilation failed. | [
"Finds",
"and",
"compiles",
"coffeescript",
"files",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/TypeScriptCompilerMojo.java#L94-L126 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java | XsdAsmInterfaces.getSequenceInfo | private SequenceMethodInfo getSequenceInfo(Stream<XsdAbstractElement> xsdElements, String className, int interfaceIndex, int unnamedIndex, String apiName, String groupName) {
"""
Obtains information about all the members that make up the sequence.
@param xsdElements The members that make the sequence.
@param cla... | java | private SequenceMethodInfo getSequenceInfo(Stream<XsdAbstractElement> xsdElements, String className, int interfaceIndex, int unnamedIndex, String apiName, String groupName){
List<XsdAbstractElement> xsdElementsList = xsdElements.collect(Collectors.toList());
SequenceMethodInfo sequenceMethodInfo = new S... | [
"private",
"SequenceMethodInfo",
"getSequenceInfo",
"(",
"Stream",
"<",
"XsdAbstractElement",
">",
"xsdElements",
",",
"String",
"className",
",",
"int",
"interfaceIndex",
",",
"int",
"unnamedIndex",
",",
"String",
"apiName",
",",
"String",
"groupName",
")",
"{",
... | Obtains information about all the members that make up the sequence.
@param xsdElements The members that make the sequence.
@param className The name of the element that this sequence belongs to.
@param interfaceIndex The current interface index.
@param unnamedIndex A special index for elements that have no name, which... | [
"Obtains",
"information",
"about",
"all",
"the",
"members",
"that",
"make",
"up",
"the",
"sequence",
"."
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java#L578-L605 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.batchRules | public JSONObject batchRules(List<JSONObject> rules, boolean forwardToReplicas, boolean clearExistingRules, RequestOptions requestOptions) throws AlgoliaException {
"""
Add or Replace a list of synonyms
@param rules the list of rules to add/replace
@param forwardToReplicas Forward this operation ... | java | public JSONObject batchRules(List<JSONObject> rules, boolean forwardToReplicas, boolean clearExistingRules, RequestOptions requestOptions) throws AlgoliaException {
JSONArray array = new JSONArray();
for (JSONObject obj : rules) {
array.put(obj);
}
return client.postRequest("/1/indexes/" + encode... | [
"public",
"JSONObject",
"batchRules",
"(",
"List",
"<",
"JSONObject",
">",
"rules",
",",
"boolean",
"forwardToReplicas",
",",
"boolean",
"clearExistingRules",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"JSONArray",
"array",
"=",
... | Add or Replace a list of synonyms
@param rules the list of rules to add/replace
@param forwardToReplicas Forward this operation to the replica indices
@param clearExistingRules Replace the existing query rules with this batch
@param requestOptions Options to pass to this request | [
"Add",
"or",
"Replace",
"a",
"list",
"of",
"synonyms"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1736-L1743 |
Azure/azure-sdk-for-java | containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java | ContainerGroupsInner.restartAsync | public Observable<Void> restartAsync(String resourceGroupName, String containerGroupName) {
"""
Restarts all containers in a container group.
Restarts all containers in a container group in place. If container image has updates, new image will be downloaded.
@param resourceGroupName The name of the resource gr... | java | public Observable<Void> restartAsync(String resourceGroupName, String containerGroupName) {
return restartWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
... | [
"public",
"Observable",
"<",
"Void",
">",
"restartAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerGroupName",
")",
"{",
"return",
"restartWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"containerGroupName",
")",
".",
"map",
"(",
"new",
... | Restarts all containers in a container group.
Restarts all containers in a container group in place. If container image has updates, new image will be downloaded.
@param resourceGroupName The name of the resource group.
@param containerGroupName The name of the container group.
@throws IllegalArgumentException thrown ... | [
"Restarts",
"all",
"containers",
"in",
"a",
"container",
"group",
".",
"Restarts",
"all",
"containers",
"in",
"a",
"container",
"group",
"in",
"place",
".",
"If",
"container",
"image",
"has",
"updates",
"new",
"image",
"will",
"be",
"downloaded",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java#L848-L855 |
resilience4j/resilience4j | resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/RateLimiterExports.java | RateLimiterExports.ofSupplier | public static RateLimiterExports ofSupplier(String prefix, Supplier<Iterable<RateLimiter>> rateLimitersSupplier) {
"""
Creates a new instance of {@link RateLimiterExports} with specified metrics names prefix and
{@link Supplier} of rate limiters
@param prefix the prefix of metrics names
@param rateLimitersSup... | java | public static RateLimiterExports ofSupplier(String prefix, Supplier<Iterable<RateLimiter>> rateLimitersSupplier) {
return new RateLimiterExports(prefix, rateLimitersSupplier);
} | [
"public",
"static",
"RateLimiterExports",
"ofSupplier",
"(",
"String",
"prefix",
",",
"Supplier",
"<",
"Iterable",
"<",
"RateLimiter",
">",
">",
"rateLimitersSupplier",
")",
"{",
"return",
"new",
"RateLimiterExports",
"(",
"prefix",
",",
"rateLimitersSupplier",
")",... | Creates a new instance of {@link RateLimiterExports} with specified metrics names prefix and
{@link Supplier} of rate limiters
@param prefix the prefix of metrics names
@param rateLimitersSupplier the supplier of rate limiters | [
"Creates",
"a",
"new",
"instance",
"of",
"{",
"@link",
"RateLimiterExports",
"}",
"with",
"specified",
"metrics",
"names",
"prefix",
"and",
"{",
"@link",
"Supplier",
"}",
"of",
"rate",
"limiters"
] | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/RateLimiterExports.java#L54-L56 |
haifengl/smile | math/src/main/java/smile/math/matrix/PageRank.java | PageRank.pagerank | public static double[] pagerank(Matrix A) {
"""
Calculate the page rank vector.
@param A the matrix supporting matrix vector multiplication operation.
@return the page rank vector.
"""
int n = A.nrows();
double[] v = new double[n];
Arrays.fill(v, 1.0 / n);
return pagerank(A, v... | java | public static double[] pagerank(Matrix A) {
int n = A.nrows();
double[] v = new double[n];
Arrays.fill(v, 1.0 / n);
return pagerank(A, v);
} | [
"public",
"static",
"double",
"[",
"]",
"pagerank",
"(",
"Matrix",
"A",
")",
"{",
"int",
"n",
"=",
"A",
".",
"nrows",
"(",
")",
";",
"double",
"[",
"]",
"v",
"=",
"new",
"double",
"[",
"n",
"]",
";",
"Arrays",
".",
"fill",
"(",
"v",
",",
"1.0... | Calculate the page rank vector.
@param A the matrix supporting matrix vector multiplication operation.
@return the page rank vector. | [
"Calculate",
"the",
"page",
"rank",
"vector",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/matrix/PageRank.java#L42-L47 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java | RTMPHandshake.calculateDigest | public void calculateDigest(int digestPos, byte[] handshakeMessage, int handshakeOffset, byte[] key, int keyLen, byte[] digest, int digestOffset) {
"""
Calculates the digest given the its offset in the handshake data.
@param digestPos digest position
@param handshakeMessage handshake message
@param handshakeO... | java | public void calculateDigest(int digestPos, byte[] handshakeMessage, int handshakeOffset, byte[] key, int keyLen, byte[] digest, int digestOffset) {
if (log.isTraceEnabled()) {
log.trace("calculateDigest - digestPos: {} handshakeOffset: {} keyLen: {} digestOffset: {}", digestPos, handshakeOffset, k... | [
"public",
"void",
"calculateDigest",
"(",
"int",
"digestPos",
",",
"byte",
"[",
"]",
"handshakeMessage",
",",
"int",
"handshakeOffset",
",",
"byte",
"[",
"]",
"key",
",",
"int",
"keyLen",
",",
"byte",
"[",
"]",
"digest",
",",
"int",
"digestOffset",
")",
... | Calculates the digest given the its offset in the handshake data.
@param digestPos digest position
@param handshakeMessage handshake message
@param handshakeOffset handshake message offset
@param key contains the key
@param keyLen the length of the key
@param digest contains the calculated digest
@param digestOffset d... | [
"Calculates",
"the",
"digest",
"given",
"the",
"its",
"offset",
"in",
"the",
"handshake",
"data",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java#L323-L335 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetRowResourcesImpl.java | SheetRowResourcesImpl.sendRow | @Deprecated
public void sendRow(long sheetId, long rowId, RowEmail email) throws SmartsheetException {
"""
@deprecated as of API V2.0.2, replaced by {@link #sendRows(long, MultiRowEmail)}
Send a row via email to the designated recipients.
It mirrors to the following Smartsheet REST API method: POST /sheets... | java | @Deprecated
public void sendRow(long sheetId, long rowId, RowEmail email) throws SmartsheetException {
this.createResource("sheets/" + sheetId + "/rows/" + rowId + "/emails", RowEmail.class, email);
} | [
"@",
"Deprecated",
"public",
"void",
"sendRow",
"(",
"long",
"sheetId",
",",
"long",
"rowId",
",",
"RowEmail",
"email",
")",
"throws",
"SmartsheetException",
"{",
"this",
".",
"createResource",
"(",
"\"sheets/\"",
"+",
"sheetId",
"+",
"\"/rows/\"",
"+",
"rowId... | @deprecated as of API V2.0.2, replaced by {@link #sendRows(long, MultiRowEmail)}
Send a row via email to the designated recipients.
It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/rows/{rowId}/emails
Exceptions:
IllegalArgumentException : if any argument is null
InvalidRequestException ... | [
"@deprecated",
"as",
"of",
"API",
"V2",
".",
"0",
".",
"2",
"replaced",
"by",
"{",
"@link",
"#sendRows",
"(",
"long",
"MultiRowEmail",
")",
"}",
"Send",
"a",
"row",
"via",
"email",
"to",
"the",
"designated",
"recipients",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetRowResourcesImpl.java#L207-L210 |
h2oai/h2o-3 | h2o-persist-s3/src/main/java/water/persist/PersistS3.java | PersistS3.decodePath | private static String [] decodePath(String s) {
"""
Decompose S3 name into bucket name and key name
@param s generic s3 path (e.g., "s3://bucketname/my/directory/file.ext")
@return array of { bucket name, key }
"""
assert s.startsWith(KEY_PREFIX) && s.indexOf('/') >= 0 : "Attempting to decode non s3 ke... | java | private static String [] decodePath(String s) {
assert s.startsWith(KEY_PREFIX) && s.indexOf('/') >= 0 : "Attempting to decode non s3 key: " + s;
s = s.substring(KEY_PREFIX_LEN);
int dlm = s.indexOf('/');
if(dlm < 0) return new String[]{s,null};
String bucket = s.substring(0, dlm);
String key = ... | [
"private",
"static",
"String",
"[",
"]",
"decodePath",
"(",
"String",
"s",
")",
"{",
"assert",
"s",
".",
"startsWith",
"(",
"KEY_PREFIX",
")",
"&&",
"s",
".",
"indexOf",
"(",
"'",
"'",
")",
">=",
"0",
":",
"\"Attempting to decode non s3 key: \"",
"+",
"s... | Decompose S3 name into bucket name and key name
@param s generic s3 path (e.g., "s3://bucketname/my/directory/file.ext")
@return array of { bucket name, key } | [
"Decompose",
"S3",
"name",
"into",
"bucket",
"name",
"and",
"key",
"name"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-persist-s3/src/main/java/water/persist/PersistS3.java#L321-L329 |
scireum/parsii | src/main/java/parsii/tokenizer/Tokenizer.java | Tokenizer.addError | public void addError(Position pos, String message, Object... parameters) {
"""
Adds a parse error to the internal problem collector.
<p>
It is preferred to collect as much errors as possible and then fail with an exception instead of failing
at the first problem. Often syntax errors can be worked out by the par... | java | public void addError(Position pos, String message, Object... parameters) {
getProblemCollector().add(ParseError.error(pos, String.format(message, parameters)));
} | [
"public",
"void",
"addError",
"(",
"Position",
"pos",
",",
"String",
"message",
",",
"Object",
"...",
"parameters",
")",
"{",
"getProblemCollector",
"(",
")",
".",
"add",
"(",
"ParseError",
".",
"error",
"(",
"pos",
",",
"String",
".",
"format",
"(",
"me... | Adds a parse error to the internal problem collector.
<p>
It is preferred to collect as much errors as possible and then fail with an exception instead of failing
at the first problem. Often syntax errors can be worked out by the parser and we can report a set of
errors at once.
@param pos the position of the e... | [
"Adds",
"a",
"parse",
"error",
"to",
"the",
"internal",
"problem",
"collector",
".",
"<p",
">",
"It",
"is",
"preferred",
"to",
"collect",
"as",
"much",
"errors",
"as",
"possible",
"and",
"then",
"fail",
"with",
"an",
"exception",
"instead",
"of",
"failing"... | train | https://github.com/scireum/parsii/blob/fbf686155b1147b9e07ae21dcd02820b15c79a8c/src/main/java/parsii/tokenizer/Tokenizer.java#L798-L800 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java | TopologyBuilder.addCheckPointInputs | private void addCheckPointInputs(ComponentCommon component) {
"""
For bolts that has incoming streams from spouts (the root bolts),
add checkpoint stream from checkpoint spout to its input. For other bolts,
add checkpoint stream from the previous bolt to its input.
"""
Set<GlobalStreamId> checkPointI... | java | private void addCheckPointInputs(ComponentCommon component) {
Set<GlobalStreamId> checkPointInputs = new HashSet<>();
for (GlobalStreamId inputStream : component.get_inputs().keySet()) {
String sourceId = inputStream.get_componentId();
if (_spouts.containsKey(sourceId)) {
... | [
"private",
"void",
"addCheckPointInputs",
"(",
"ComponentCommon",
"component",
")",
"{",
"Set",
"<",
"GlobalStreamId",
">",
"checkPointInputs",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"GlobalStreamId",
"inputStream",
":",
"component",
".",
"get_i... | For bolts that has incoming streams from spouts (the root bolts),
add checkpoint stream from checkpoint spout to its input. For other bolts,
add checkpoint stream from the previous bolt to its input. | [
"For",
"bolts",
"that",
"has",
"incoming",
"streams",
"from",
"spouts",
"(",
"the",
"root",
"bolts",
")",
"add",
"checkpoint",
"stream",
"from",
"checkpoint",
"spout",
"to",
"its",
"input",
".",
"For",
"other",
"bolts",
"add",
"checkpoint",
"stream",
"from",... | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java#L444-L457 |
Erudika/para | para-server/src/main/java/com/erudika/para/security/SimpleRequestCache.java | SimpleRequestCache.removeRequest | @Override
public void removeRequest(HttpServletRequest request, HttpServletResponse response) {
"""
Removes a saved request from cache.
@param request HTTP request
@param response HTTP response
"""
HttpUtils.removeStateParam(Config.RETURNTO_COOKIE, request, response);
} | java | @Override
public void removeRequest(HttpServletRequest request, HttpServletResponse response) {
HttpUtils.removeStateParam(Config.RETURNTO_COOKIE, request, response);
} | [
"@",
"Override",
"public",
"void",
"removeRequest",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"HttpUtils",
".",
"removeStateParam",
"(",
"Config",
".",
"RETURNTO_COOKIE",
",",
"request",
",",
"response",
")",
";",
"}"
... | Removes a saved request from cache.
@param request HTTP request
@param response HTTP response | [
"Removes",
"a",
"saved",
"request",
"from",
"cache",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/SimpleRequestCache.java#L84-L87 |
52inc/android-52Kit | library-eula/src/main/java/com/ftinc/kit/eula/EulaActivity.java | EulaActivity.createIntent | public static Intent createIntent(Context ctx, int logoResId, CharSequence eulaText) {
"""
Generate a pre-populated intent to launch this activity with
@param ctx the context to create the intent with
@param logoResId the resource id of the logo you want to use
@param eulaText the EULA text... | java | public static Intent createIntent(Context ctx, int logoResId, CharSequence eulaText){
Intent intent = new Intent(ctx, EulaActivity.class);
intent.putExtra(EXTRA_LOGO, logoResId);
intent.putExtra(EXTRA_EULA_TEXT, eulaText);
return intent;
} | [
"public",
"static",
"Intent",
"createIntent",
"(",
"Context",
"ctx",
",",
"int",
"logoResId",
",",
"CharSequence",
"eulaText",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"ctx",
",",
"EulaActivity",
".",
"class",
")",
";",
"intent",
".",
"putE... | Generate a pre-populated intent to launch this activity with
@param ctx the context to create the intent with
@param logoResId the resource id of the logo you want to use
@param eulaText the EULA text to display
@return the intent to launch | [
"Generate",
"a",
"pre",
"-",
"populated",
"intent",
"to",
"launch",
"this",
"activity",
"with"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library-eula/src/main/java/com/ftinc/kit/eula/EulaActivity.java#L52-L57 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java | ScriptContainer.addLegacyTagIdMappings | public void addLegacyTagIdMappings(String tagId, String tagName) {
"""
Adds a tagID and tagName to the Html's getId javascript function.
@param tagId the id of a child tag.
@param tagName the name of a child tag.
"""
assert (tagId != null) : "The parameter 'tagId' must not be null";
assert ... | java | public void addLegacyTagIdMappings(String tagId, String tagName)
{
assert (tagId != null) : "The parameter 'tagId' must not be null";
assert (tagName != null) : "The parameter 'tagName' must not be null";
if (_idMap == null) {
_idMap = new HashMap/*<String, String>*/();
... | [
"public",
"void",
"addLegacyTagIdMappings",
"(",
"String",
"tagId",
",",
"String",
"tagName",
")",
"{",
"assert",
"(",
"tagId",
"!=",
"null",
")",
":",
"\"The parameter 'tagId' must not be null\"",
";",
"assert",
"(",
"tagName",
"!=",
"null",
")",
":",
"\"The pa... | Adds a tagID and tagName to the Html's getId javascript function.
@param tagId the id of a child tag.
@param tagName the name of a child tag. | [
"Adds",
"a",
"tagID",
"and",
"tagName",
"to",
"the",
"Html",
"s",
"getId",
"javascript",
"function",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java#L142-L153 |
apache/predictionio-sdk-java | client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java | EventClient.getEventAsFuture | public FutureAPIResponse getEventAsFuture(String eid) throws IOException {
"""
Sends an asynchronous get event request to the API.
@param eid ID of the event to get
"""
Request request = (new RequestBuilder("GET"))
.setUrl(apiUrl + "/events/" + eid + ".json?accessKey=" + accessKey)
.buil... | java | public FutureAPIResponse getEventAsFuture(String eid) throws IOException {
Request request = (new RequestBuilder("GET"))
.setUrl(apiUrl + "/events/" + eid + ".json?accessKey=" + accessKey)
.build();
return new FutureAPIResponse(client.executeRequest(request, getHandler()));
} | [
"public",
"FutureAPIResponse",
"getEventAsFuture",
"(",
"String",
"eid",
")",
"throws",
"IOException",
"{",
"Request",
"request",
"=",
"(",
"new",
"RequestBuilder",
"(",
"\"GET\"",
")",
")",
".",
"setUrl",
"(",
"apiUrl",
"+",
"\"/events/\"",
"+",
"eid",
"+",
... | Sends an asynchronous get event request to the API.
@param eid ID of the event to get | [
"Sends",
"an",
"asynchronous",
"get",
"event",
"request",
"to",
"the",
"API",
"."
] | train | https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L234-L239 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java | PatternBox.relatedProteinRefOfInter | public static Pattern relatedProteinRefOfInter(Class<? extends Interaction>... seedType) {
"""
Finds ProteinsReference related to an interaction. If specific types of interactions are
desired, they should be sent as parameter, otherwise leave the parameter empty.
@param seedType specific BioPAX interaction sub... | java | public static Pattern relatedProteinRefOfInter(Class<? extends Interaction>... seedType)
{
Pattern p = new Pattern(Interaction.class, "Interaction");
if (seedType.length == 1)
{
p.add(new Type(seedType[0]), "Interaction");
}
else if (seedType.length > 1)
{
MappedConst[] mc = new MappedConst[seedType... | [
"public",
"static",
"Pattern",
"relatedProteinRefOfInter",
"(",
"Class",
"<",
"?",
"extends",
"Interaction",
">",
"...",
"seedType",
")",
"{",
"Pattern",
"p",
"=",
"new",
"Pattern",
"(",
"Interaction",
".",
"class",
",",
"\"Interaction\"",
")",
";",
"if",
"(... | Finds ProteinsReference related to an interaction. If specific types of interactions are
desired, they should be sent as parameter, otherwise leave the parameter empty.
@param seedType specific BioPAX interaction sub-types (interface classes)
@return pattern | [
"Finds",
"ProteinsReference",
"related",
"to",
"an",
"interaction",
".",
"If",
"specific",
"types",
"of",
"interactions",
"are",
"desired",
"they",
"should",
"be",
"sent",
"as",
"parameter",
"otherwise",
"leave",
"the",
"parameter",
"empty",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L680-L709 |
airbnb/lottie-android | lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java | KeyPath.propagateToChildren | @SuppressWarnings("SimplifiableIfStatement")
@RestrictTo(RestrictTo.Scope.LIBRARY)
public boolean propagateToChildren(String key, int depth) {
"""
Returns whether the keypath resolution should propagate to children. Some keypaths resolve
to content other than leaf contents (such as a layer or content group tr... | java | @SuppressWarnings("SimplifiableIfStatement")
@RestrictTo(RestrictTo.Scope.LIBRARY)
public boolean propagateToChildren(String key, int depth) {
if ("__container".equals(key)) {
return true;
}
return depth < keys.size() - 1 || keys.get(depth).equals("**");
} | [
"@",
"SuppressWarnings",
"(",
"\"SimplifiableIfStatement\"",
")",
"@",
"RestrictTo",
"(",
"RestrictTo",
".",
"Scope",
".",
"LIBRARY",
")",
"public",
"boolean",
"propagateToChildren",
"(",
"String",
"key",
",",
"int",
"depth",
")",
"{",
"if",
"(",
"\"__container\... | Returns whether the keypath resolution should propagate to children. Some keypaths resolve
to content other than leaf contents (such as a layer or content group transform) so sometimes
this will return false. | [
"Returns",
"whether",
"the",
"keypath",
"resolution",
"should",
"propagate",
"to",
"children",
".",
"Some",
"keypaths",
"resolve",
"to",
"content",
"other",
"than",
"leaf",
"contents",
"(",
"such",
"as",
"a",
"layer",
"or",
"content",
"group",
"transform",
")"... | train | https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java#L185-L192 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java | OptionsImpl.propertiesFileUpdated | protected void propertiesFileUpdated(Properties updated, long sequence) {
"""
Listener method for being informed of changes to the properties file by another
instance of this class. Called by other instances of this class for instances
that use the same properties file when properties are saved.
@param updat... | java | protected void propertiesFileUpdated(Properties updated, long sequence) {
Properties newProps = new Properties(getDefaultOptions());
Enumeration<?> propsEnum = updated.propertyNames();
while (propsEnum.hasMoreElements()) {
String name = (String)propsEnum.nextElement();
newProps.setProperty(name, update... | [
"protected",
"void",
"propertiesFileUpdated",
"(",
"Properties",
"updated",
",",
"long",
"sequence",
")",
"{",
"Properties",
"newProps",
"=",
"new",
"Properties",
"(",
"getDefaultOptions",
"(",
")",
")",
";",
"Enumeration",
"<",
"?",
">",
"propsEnum",
"=",
"up... | Listener method for being informed of changes to the properties file by another
instance of this class. Called by other instances of this class for instances
that use the same properties file when properties are saved.
@param updated
the updated properties
@param sequence
the update sequence number | [
"Listener",
"method",
"for",
"being",
"informed",
"of",
"changes",
"to",
"the",
"properties",
"file",
"by",
"another",
"instance",
"of",
"this",
"class",
".",
"Called",
"by",
"other",
"instances",
"of",
"this",
"class",
"for",
"instances",
"that",
"use",
"th... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java#L356-L365 |
jboss/jboss-jstl-api_spec | src/main/java/org/apache/taglibs/standard/functions/Functions.java | Functions.substringAfter | public static String substringAfter(String input, String substring) {
"""
Returns a subset of a string following the first occurrence of a specific substring.
<p>If the substring is empty, it matches the beginning of the input string and the
entire input string is returned. If the substring does not occur, an em... | java | public static String substringAfter(String input, String substring) {
int index = input.indexOf(substring);
if (index == -1) {
return "";
} else {
return input.substring(index + substring.length());
}
} | [
"public",
"static",
"String",
"substringAfter",
"(",
"String",
"input",
",",
"String",
"substring",
")",
"{",
"int",
"index",
"=",
"input",
".",
"indexOf",
"(",
"substring",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"return",
"\"\"",
";",... | Returns a subset of a string following the first occurrence of a specific substring.
<p>If the substring is empty, it matches the beginning of the input string and the
entire input string is returned. If the substring does not occur, an empty string is returned.
@param input the input string on which the substring... | [
"Returns",
"a",
"subset",
"of",
"a",
"string",
"following",
"the",
"first",
"occurrence",
"of",
"a",
"specific",
"substring",
".",
"<p",
">",
"If",
"the",
"substring",
"is",
"empty",
"it",
"matches",
"the",
"beginning",
"of",
"the",
"input",
"string",
"and... | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/functions/Functions.java#L173-L180 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/prune_policy.java | prune_policy.update | public static prune_policy update(nitro_service client, prune_policy resource) throws Exception {
"""
<pre>
Use this operation to modify the number of days data to retain.
</pre>
"""
resource.validate("modify");
return ((prune_policy[]) resource.update_resource(client))[0];
} | java | public static prune_policy update(nitro_service client, prune_policy resource) throws Exception
{
resource.validate("modify");
return ((prune_policy[]) resource.update_resource(client))[0];
} | [
"public",
"static",
"prune_policy",
"update",
"(",
"nitro_service",
"client",
",",
"prune_policy",
"resource",
")",
"throws",
"Exception",
"{",
"resource",
".",
"validate",
"(",
"\"modify\"",
")",
";",
"return",
"(",
"(",
"prune_policy",
"[",
"]",
")",
"resour... | <pre>
Use this operation to modify the number of days data to retain.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"modify",
"the",
"number",
"of",
"days",
"data",
"to",
"retain",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/prune_policy.java#L115-L119 |
davetcc/tcMenu | tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/controller/OSXAdapter.java | OSXAdapter.setApplicationEventHandled | protected void setApplicationEventHandled(Object event, boolean handled) {
"""
This method checks for a boolean result from the proxy method and sets the event accordingly
"""
if (event != null) {
try {
Method setHandledMethod = event.getClass().getDeclaredMethod("setHandled... | java | protected void setApplicationEventHandled(Object event, boolean handled) {
if (event != null) {
try {
Method setHandledMethod = event.getClass().getDeclaredMethod("setHandled", new Class[] { boolean.class });
// If the target method returns a boolean, use that as a hi... | [
"protected",
"void",
"setApplicationEventHandled",
"(",
"Object",
"event",
",",
"boolean",
"handled",
")",
"{",
"if",
"(",
"event",
"!=",
"null",
")",
"{",
"try",
"{",
"Method",
"setHandledMethod",
"=",
"event",
".",
"getClass",
"(",
")",
".",
"getDeclaredMe... | This method checks for a boolean result from the proxy method and sets the event accordingly | [
"This",
"method",
"checks",
"for",
"a",
"boolean",
"result",
"from",
"the",
"proxy",
"method",
"and",
"sets",
"the",
"event",
"accordingly"
] | train | https://github.com/davetcc/tcMenu/blob/61546e4b982b25ceaff384073fe9ec1fff55e64a/tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/controller/OSXAdapter.java#L205-L216 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.orthoSymmetricLH | public Matrix4x3d orthoSymmetricLH(double width, double height, double zNear, double zFar, boolean zZeroToOne) {
"""
Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using the given NDC z range to this matrix.
<p>
This method is equivalent to calling {@link #orthoLH(d... | java | public Matrix4x3d orthoSymmetricLH(double width, double height, double zNear, double zFar, boolean zZeroToOne) {
return orthoSymmetricLH(width, height, zNear, zFar, zZeroToOne, this);
} | [
"public",
"Matrix4x3d",
"orthoSymmetricLH",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"return",
"orthoSymmetricLH",
"(",
"width",
",",
"height",
",",
"zNear",
",",
... | Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using the given NDC z range to this matrix.
<p>
This method is equivalent to calling {@link #orthoLH(double, double, double, double, double, double, boolean) orthoLH()} with
<code>left=-width/2</code>, <code>right=+width/2</cod... | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
"to",
"this",
"matrix",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L7327-L7329 |
tomgibara/bits | src/main/java/com/tomgibara/bits/Bits.java | Bits.writerTo | public static BitWriter writerTo(int[] ints, long size) {
"""
Writes bits to an array of ints up-to a specified limit.
@param ints
the array of ints
@param size
the greatest number of bits the writer will write to the array
@return a writer that writes bits to the supplied array
"""
if (ints == null) ... | java | public static BitWriter writerTo(int[] ints, long size) {
if (ints == null) throw new IllegalArgumentException("null ints");
if (size < 0) throw new IllegalArgumentException("negative size");
long maxSize = ((long) ints.length) << 5;
if (size > maxSize) throw new IllegalArgumentException("size exceeds maximum p... | [
"public",
"static",
"BitWriter",
"writerTo",
"(",
"int",
"[",
"]",
"ints",
",",
"long",
"size",
")",
"{",
"if",
"(",
"ints",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null ints\"",
")",
";",
"if",
"(",
"size",
"<",
"0",
")"... | Writes bits to an array of ints up-to a specified limit.
@param ints
the array of ints
@param size
the greatest number of bits the writer will write to the array
@return a writer that writes bits to the supplied array | [
"Writes",
"bits",
"to",
"an",
"array",
"of",
"ints",
"up",
"-",
"to",
"a",
"specified",
"limit",
"."
] | train | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/Bits.java#L872-L878 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/datatype/xsd/DecimalDatatype.java | DecimalDatatype.sameValue | public boolean sameValue(Object value1, Object value2) {
"""
BigDecimal.equals considers objects distinct if they have the
different scales but the same mathematical value. Similarly
for hashCode.
"""
return ((BigDecimal)value1).compareTo((BigDecimal)value2) == 0;
} | java | public boolean sameValue(Object value1, Object value2) {
return ((BigDecimal)value1).compareTo((BigDecimal)value2) == 0;
} | [
"public",
"boolean",
"sameValue",
"(",
"Object",
"value1",
",",
"Object",
"value2",
")",
"{",
"return",
"(",
"(",
"BigDecimal",
")",
"value1",
")",
".",
"compareTo",
"(",
"(",
"BigDecimal",
")",
"value2",
")",
"==",
"0",
";",
"}"
] | BigDecimal.equals considers objects distinct if they have the
different scales but the same mathematical value. Similarly
for hashCode. | [
"BigDecimal",
".",
"equals",
"considers",
"objects",
"distinct",
"if",
"they",
"have",
"the",
"different",
"scales",
"but",
"the",
"same",
"mathematical",
"value",
".",
"Similarly",
"for",
"hashCode",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/datatype/xsd/DecimalDatatype.java#L75-L77 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.f1Score | @Override
public double f1Score(INDArray input, INDArray labels) {
"""
Perform inference and then calculate the F1 score of the output(input) vs. the labels.
@param input the input to perform inference with
@param labels the true labels
@return the score for the given input,label pairs
"""
fe... | java | @Override
public double f1Score(INDArray input, INDArray labels) {
feedForward(input);
setLabels(labels);
Evaluation eval = new Evaluation();
eval.eval(labels, output(input));
return eval.f1();
} | [
"@",
"Override",
"public",
"double",
"f1Score",
"(",
"INDArray",
"input",
",",
"INDArray",
"labels",
")",
"{",
"feedForward",
"(",
"input",
")",
";",
"setLabels",
"(",
"labels",
")",
";",
"Evaluation",
"eval",
"=",
"new",
"Evaluation",
"(",
")",
";",
"ev... | Perform inference and then calculate the F1 score of the output(input) vs. the labels.
@param input the input to perform inference with
@param labels the true labels
@return the score for the given input,label pairs | [
"Perform",
"inference",
"and",
"then",
"calculate",
"the",
"F1",
"score",
"of",
"the",
"output",
"(",
"input",
")",
"vs",
".",
"the",
"labels",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L2440-L2447 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java | CookieHelper.getCookieValue | @Sensitive
public static String getCookieValue(Cookie[] cookies, String cookieName) {
"""
Retrieve the value of the first instance of the specified Cookie name
from the array of Cookies. Note name matching ignores case.
@param cookies array of Cookie objects, may be {@code null}.
@param cookieName the nam... | java | @Sensitive
public static String getCookieValue(Cookie[] cookies, String cookieName) {
if (cookies == null) {
return null;
}
String retVal = null;
for (int i = 0; i < cookies.length; ++i) {
if (cookieName.equalsIgnoreCase(cookies[i].getName())) {
... | [
"@",
"Sensitive",
"public",
"static",
"String",
"getCookieValue",
"(",
"Cookie",
"[",
"]",
"cookies",
",",
"String",
"cookieName",
")",
"{",
"if",
"(",
"cookies",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"retVal",
"=",
"null",
";",
... | Retrieve the value of the first instance of the specified Cookie name
from the array of Cookies. Note name matching ignores case.
@param cookies array of Cookie objects, may be {@code null}.
@param cookieName the name of the cookie
@return String value associated with the specified cookieName, {@code null} if no match... | [
"Retrieve",
"the",
"value",
"of",
"the",
"first",
"instance",
"of",
"the",
"specified",
"Cookie",
"name",
"from",
"the",
"array",
"of",
"Cookies",
".",
"Note",
"name",
"matching",
"ignores",
"case",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java#L39-L54 |
google/closure-compiler | src/com/google/javascript/jscomp/InlineFunctions.java | InlineFunctions.verifyAllReferencesInlined | void verifyAllReferencesInlined(String name, FunctionState functionState) {
"""
Check to verify that expression rewriting didn't make a call inaccessible.
"""
for (Reference ref : functionState.getReferences()) {
if (!ref.inlined) {
Node parent = ref.callNode.getParent();
throw new Il... | java | void verifyAllReferencesInlined(String name, FunctionState functionState) {
for (Reference ref : functionState.getReferences()) {
if (!ref.inlined) {
Node parent = ref.callNode.getParent();
throw new IllegalStateException(
"Call site missed ("
+ name
... | [
"void",
"verifyAllReferencesInlined",
"(",
"String",
"name",
",",
"FunctionState",
"functionState",
")",
"{",
"for",
"(",
"Reference",
"ref",
":",
"functionState",
".",
"getReferences",
"(",
")",
")",
"{",
"if",
"(",
"!",
"ref",
".",
"inlined",
")",
"{",
"... | Check to verify that expression rewriting didn't make a call inaccessible. | [
"Check",
"to",
"verify",
"that",
"expression",
"rewriting",
"didn",
"t",
"make",
"a",
"call",
"inaccessible",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/InlineFunctions.java#L819-L832 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/graph/primitives/Graph.java | Graph.addEdge | @Override
public void addEdge(int from, int to, E value, boolean directed) {
"""
Convenience method for adding an edge (directed or undirected) to graph
@param from
@param to
@param value
@param directed
"""
addEdge(new Edge<>(from, to, value, directed));
} | java | @Override
public void addEdge(int from, int to, E value, boolean directed) {
addEdge(new Edge<>(from, to, value, directed));
} | [
"@",
"Override",
"public",
"void",
"addEdge",
"(",
"int",
"from",
",",
"int",
"to",
",",
"E",
"value",
",",
"boolean",
"directed",
")",
"{",
"addEdge",
"(",
"new",
"Edge",
"<>",
"(",
"from",
",",
"to",
",",
"value",
",",
"directed",
")",
")",
";",
... | Convenience method for adding an edge (directed or undirected) to graph
@param from
@param to
@param value
@param directed | [
"Convenience",
"method",
"for",
"adding",
"an",
"edge",
"(",
"directed",
"or",
"undirected",
")",
"to",
"graph"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/graph/primitives/Graph.java#L162-L165 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/CommonUtils.java | CommonUtils.imgToBase64StrWithPrefix | public static String imgToBase64StrWithPrefix(BufferedImage image, String formatName) {
"""
将一张图片转换成指定格式的Base64字符串编码,带类似于"data:image/png;base64,"前缀,
返回的字符串可直接放入HTML img标签src属性中显示图片
@param image 指定一张图片
@param formatName 图片格式名,如gif,png,jpg,jpeg等,默认为jpeg
@return 返回编码好的字符串, 失败返回null
"""
formatNa... | java | public static String imgToBase64StrWithPrefix(BufferedImage image, String formatName) {
formatName = formatName != null ? formatName : "jpeg";
return String.format("data:image/%s;base64,%s", formatName, imgToBase64Str(image, formatName));
} | [
"public",
"static",
"String",
"imgToBase64StrWithPrefix",
"(",
"BufferedImage",
"image",
",",
"String",
"formatName",
")",
"{",
"formatName",
"=",
"formatName",
"!=",
"null",
"?",
"formatName",
":",
"\"jpeg\"",
";",
"return",
"String",
".",
"format",
"(",
"\"dat... | 将一张图片转换成指定格式的Base64字符串编码,带类似于"data:image/png;base64,"前缀,
返回的字符串可直接放入HTML img标签src属性中显示图片
@param image 指定一张图片
@param formatName 图片格式名,如gif,png,jpg,jpeg等,默认为jpeg
@return 返回编码好的字符串, 失败返回null | [
"将一张图片转换成指定格式的Base64字符串编码",
"带类似于",
"data",
":",
"image",
"/",
"png",
";",
"base64",
"前缀",
"返回的字符串可直接放入HTML",
"img标签src属性中显示图片"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/CommonUtils.java#L220-L223 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/transport/netty/StartStreamHandler.java | StartStreamHandler.addHttpBasicAuth | private void addHttpBasicAuth(final ChannelHandlerContext ctx, final HttpRequest request) {
"""
Helper method to add authentication credentials to the config stream request.
"""
ByteBuf raw = ctx.alloc().buffer(username.length() + password.length() + 1);
raw.writeBytes((username + ":" + password).getBy... | java | private void addHttpBasicAuth(final ChannelHandlerContext ctx, final HttpRequest request) {
ByteBuf raw = ctx.alloc().buffer(username.length() + password.length() + 1);
raw.writeBytes((username + ":" + password).getBytes(CharsetUtil.UTF_8));
ByteBuf encoded = Base64.encode(raw, false);
request.headers()... | [
"private",
"void",
"addHttpBasicAuth",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"final",
"HttpRequest",
"request",
")",
"{",
"ByteBuf",
"raw",
"=",
"ctx",
".",
"alloc",
"(",
")",
".",
"buffer",
"(",
"username",
".",
"length",
"(",
")",
"+",
"pass... | Helper method to add authentication credentials to the config stream request. | [
"Helper",
"method",
"to",
"add",
"authentication",
"credentials",
"to",
"the",
"config",
"stream",
"request",
"."
] | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/transport/netty/StartStreamHandler.java#L91-L98 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <T1, T2, T3, T4, T5> Func5<T1, T2, T3, T4, T5, Observable<Void>> toAsync(Action5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5> action) {
"""
Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wik... | java | public static <T1, T2, T3, T4, T5> Func5<T1, T2, T3, T4, T5, Observable<Void>> toAsync(Action5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5> action) {
return toAsync(action, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
">",
"Func5",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"Observable",
"<",
"Void",
">",
">",
"toAsync",
"(",
"Action5",
"<",
"?",
"super",
"T1",
",",... | Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.an.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <T3> the third parameter type
... | [
"Convert",
"a",
"synchronous",
"action",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki",
... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L401-L403 |
LearnLib/automatalib | serialization/fsm/src/main/java/net/automatalib/serialization/fsm/parser/FSM2DFAParser.java | FSM2DFAParser.parseStateVector | @Override
protected void parseStateVector(StreamTokenizer streamTokenizer) throws FSMParseException, IOException {
"""
Parse a state vector.
<p>
This method will only search for whether the state is accepting or not. The state index will be equal to the
current {@link #getPartLineNumber()}.
@throws FSMPa... | java | @Override
protected void parseStateVector(StreamTokenizer streamTokenizer) throws FSMParseException, IOException {
Boolean accepting = null;
for (int i = 0;
i <= acceptIndex && streamTokenizer.nextToken() == StreamTokenizer.TT_WORD && accepting == null;
i++) {
f... | [
"@",
"Override",
"protected",
"void",
"parseStateVector",
"(",
"StreamTokenizer",
"streamTokenizer",
")",
"throws",
"FSMParseException",
",",
"IOException",
"{",
"Boolean",
"accepting",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<=",
"accep... | Parse a state vector.
<p>
This method will only search for whether the state is accepting or not. The state index will be equal to the
current {@link #getPartLineNumber()}.
@throws FSMParseException
when the current line is an illegal state vector.
@throws IOException
see {@link StreamTokenizer#nextToken()}. | [
"Parse",
"a",
"state",
"vector",
".",
"<p",
">",
"This",
"method",
"will",
"only",
"search",
"for",
"whether",
"the",
"state",
"is",
"accepting",
"or",
"not",
".",
"The",
"state",
"index",
"will",
"be",
"equal",
"to",
"the",
"current",
"{",
"@link",
"#... | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/serialization/fsm/src/main/java/net/automatalib/serialization/fsm/parser/FSM2DFAParser.java#L197-L217 |
Trilarion/java-vorbis-support | src/main/java/com/github/trilarion/sound/vorbis/jcraft/jorbis/CodeBook.java | CodeBook.encodevs | int encodevs(float[] a, Buffer b, int step, int addmul) {
"""
returns the number of bits and *modifies a* to the remainder value
"""
int best = besterror(a, step, addmul);
return (encode(best, b));
} | java | int encodevs(float[] a, Buffer b, int step, int addmul) {
int best = besterror(a, step, addmul);
return (encode(best, b));
} | [
"int",
"encodevs",
"(",
"float",
"[",
"]",
"a",
",",
"Buffer",
"b",
",",
"int",
"step",
",",
"int",
"addmul",
")",
"{",
"int",
"best",
"=",
"besterror",
"(",
"a",
",",
"step",
",",
"addmul",
")",
";",
"return",
"(",
"encode",
"(",
"best",
",",
... | returns the number of bits and *modifies a* to the remainder value | [
"returns",
"the",
"number",
"of",
"bits",
"and",
"*",
"modifies",
"a",
"*",
"to",
"the",
"remainder",
"value"
] | train | https://github.com/Trilarion/java-vorbis-support/blob/f72aba7d97167fe0ff20b1b719fdb5bb662ff736/src/main/java/com/github/trilarion/sound/vorbis/jcraft/jorbis/CodeBook.java#L74-L77 |
google/truth | core/src/main/java/com/google/common/truth/super/com/google/common/truth/Platform.java | Platform.isInstanceOfType | static boolean isInstanceOfType(Object instance, Class<?> clazz) {
"""
Returns true if the instance is assignable to the type Clazz.
"""
if (clazz.isInterface()) {
throw new UnsupportedOperationException(
"Under GWT, we can't determine whether an object is an instance of an interface Class"... | java | static boolean isInstanceOfType(Object instance, Class<?> clazz) {
if (clazz.isInterface()) {
throw new UnsupportedOperationException(
"Under GWT, we can't determine whether an object is an instance of an interface Class");
}
for (Class<?> current = instance.getClass();
current != n... | [
"static",
"boolean",
"isInstanceOfType",
"(",
"Object",
"instance",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
".",
"isInterface",
"(",
")",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Under GWT, we can't determine... | Returns true if the instance is assignable to the type Clazz. | [
"Returns",
"true",
"if",
"the",
"instance",
"is",
"assignable",
"to",
"the",
"type",
"Clazz",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/super/com/google/common/truth/Platform.java#L37-L51 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_modem_retrieveInfo_POST | public OvhAsyncTask<OvhModemInfo> serviceName_modem_retrieveInfo_POST(String serviceName) throws IOException {
"""
get general Modem information
REST: POST /xdsl/{serviceName}/modem/retrieveInfo
@param serviceName [required] The internal name of your XDSL offer
"""
String qPath = "/xdsl/{serviceName}/mod... | java | public OvhAsyncTask<OvhModemInfo> serviceName_modem_retrieveInfo_POST(String serviceName) throws IOException {
String qPath = "/xdsl/{serviceName}/modem/retrieveInfo";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, t16);
} | [
"public",
"OvhAsyncTask",
"<",
"OvhModemInfo",
">",
"serviceName_modem_retrieveInfo_POST",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/modem/retrieveInfo\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | get general Modem information
REST: POST /xdsl/{serviceName}/modem/retrieveInfo
@param serviceName [required] The internal name of your XDSL offer | [
"get",
"general",
"Modem",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L833-L838 |
apache/spark | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java | UnsafeRow.createFromByteArray | public static UnsafeRow createFromByteArray(int numBytes, int numFields) {
"""
Creates an empty UnsafeRow from a byte array with specified numBytes and numFields.
The returned row is invalid until we call copyFrom on it.
"""
final UnsafeRow row = new UnsafeRow(numFields);
row.pointTo(new byte[numBytes... | java | public static UnsafeRow createFromByteArray(int numBytes, int numFields) {
final UnsafeRow row = new UnsafeRow(numFields);
row.pointTo(new byte[numBytes], numBytes);
return row;
} | [
"public",
"static",
"UnsafeRow",
"createFromByteArray",
"(",
"int",
"numBytes",
",",
"int",
"numFields",
")",
"{",
"final",
"UnsafeRow",
"row",
"=",
"new",
"UnsafeRow",
"(",
"numFields",
")",
";",
"row",
".",
"pointTo",
"(",
"new",
"byte",
"[",
"numBytes",
... | Creates an empty UnsafeRow from a byte array with specified numBytes and numFields.
The returned row is invalid until we call copyFrom on it. | [
"Creates",
"an",
"empty",
"UnsafeRow",
"from",
"a",
"byte",
"array",
"with",
"specified",
"numBytes",
"and",
"numFields",
".",
"The",
"returned",
"row",
"is",
"invalid",
"until",
"we",
"call",
"copyFrom",
"on",
"it",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java#L475-L479 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/util/BoundedSortedMultiMap.java | BoundedSortedMultiMap.putMulti | public boolean putMulti(K key, Collection<V> values) {
"""
Adds all of the key-value mapping to this map, and if the total number of
mappings exceeds the bounds, removes either the currently lowest element,
or if reversed, the currently highest element. If this map is bound by
the number of keys, a {@code put}... | java | public boolean putMulti(K key, Collection<V> values) {
boolean added = false;
for (V v : values) {
if (put(key, v))
added = true;
}
return added;
} | [
"public",
"boolean",
"putMulti",
"(",
"K",
"key",
",",
"Collection",
"<",
"V",
">",
"values",
")",
"{",
"boolean",
"added",
"=",
"false",
";",
"for",
"(",
"V",
"v",
":",
"values",
")",
"{",
"if",
"(",
"put",
"(",
"key",
",",
"v",
")",
")",
"add... | Adds all of the key-value mapping to this map, and if the total number of
mappings exceeds the bounds, removes either the currently lowest element,
or if reversed, the currently highest element. If this map is bound by
the number of keys, a {@code put} operation may result in the {@code
range} decreasing, even though ... | [
"Adds",
"all",
"of",
"the",
"key",
"-",
"value",
"mapping",
"to",
"this",
"map",
"and",
"if",
"the",
"total",
"number",
"of",
"mappings",
"exceeds",
"the",
"bounds",
"removes",
"either",
"the",
"currently",
"lowest",
"element",
"or",
"if",
"reversed",
"the... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/BoundedSortedMultiMap.java#L177-L184 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/inherited/CmsInheritanceGroupUtils.java | CmsInheritanceGroupUtils.getInheritanceGroupContentByName | public static CmsResource getInheritanceGroupContentByName(CmsObject cms, String name) throws CmsException {
"""
Finds the inheritance group content with a given internal name.<p>
Currently this is implemented as a property search, which may be potentially slow.<p>
@param cms the current CMS context
@param ... | java | public static CmsResource getInheritanceGroupContentByName(CmsObject cms, String name) throws CmsException {
String oldSiteRoot = cms.getRequestContext().getSiteRoot();
try {
cms.getRequestContext().setSiteRoot("");
List<CmsResource> resources = cms.readResourcesWithPropert... | [
"public",
"static",
"CmsResource",
"getInheritanceGroupContentByName",
"(",
"CmsObject",
"cms",
",",
"String",
"name",
")",
"throws",
"CmsException",
"{",
"String",
"oldSiteRoot",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getSiteRoot",
"(",
")",
";",
... | Finds the inheritance group content with a given internal name.<p>
Currently this is implemented as a property search, which may be potentially slow.<p>
@param cms the current CMS context
@param name the name to search
@return the inheritance group resource
@throws CmsException if something goes wrong | [
"Finds",
"the",
"inheritance",
"group",
"content",
"with",
"a",
"given",
"internal",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/inherited/CmsInheritanceGroupUtils.java#L70-L97 |
sagiegurari/fax4j | src/main/java/org/fax4j/util/LibraryConfigurationLoader.java | LibraryConfigurationLoader.loadProperties | private static void loadProperties(Properties properties,InputStream inputStream,boolean internal) {
"""
This function loads the properties from the input stream
to the provided properties object.
@param properties
The target properties object
@param inputStream
The input stream to the configuration fil... | java | private static void loadProperties(Properties properties,InputStream inputStream,boolean internal)
{
try
{
properties.load(inputStream);
LibraryConfigurationLoader.closeResource(inputStream);
}
catch(Exception exception)
{
LibraryConfigurat... | [
"private",
"static",
"void",
"loadProperties",
"(",
"Properties",
"properties",
",",
"InputStream",
"inputStream",
",",
"boolean",
"internal",
")",
"{",
"try",
"{",
"properties",
".",
"load",
"(",
"inputStream",
")",
";",
"LibraryConfigurationLoader",
".",
"closeR... | This function loads the properties from the input stream
to the provided properties object.
@param properties
The target properties object
@param inputStream
The input stream to the configuration file
@param internal
True internal, else external | [
"This",
"function",
"loads",
"the",
"properties",
"from",
"the",
"input",
"stream",
"to",
"the",
"provided",
"properties",
"object",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/LibraryConfigurationLoader.java#L67-L84 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/stats/collector/WordNumberCollectorBundle.java | WordNumberCollectorBundle.addWord | public WordNumberCollectorBundle addWord(String key, String word) {
"""
Add word word number collector bundle.
@param key the key
@param word the word
@return the word number collector bundle
"""
wordCollector.add(key, word);
return this;
} | java | public WordNumberCollectorBundle addWord(String key, String word) {
wordCollector.add(key, word);
return this;
} | [
"public",
"WordNumberCollectorBundle",
"addWord",
"(",
"String",
"key",
",",
"String",
"word",
")",
"{",
"wordCollector",
".",
"add",
"(",
"key",
",",
"word",
")",
";",
"return",
"this",
";",
"}"
] | Add word word number collector bundle.
@param key the key
@param word the word
@return the word number collector bundle | [
"Add",
"word",
"word",
"number",
"collector",
"bundle",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/stats/collector/WordNumberCollectorBundle.java#L45-L48 |
qiniu/java-sdk | src/main/java/com/qiniu/storage/BucketManager.java | BucketManager.changeMime | public Response changeMime(String bucket, String key, String mime)
throws QiniuException {
"""
修改文件的MimeType
@param bucket 空间名称
@param key 文件名称
@param mime 文件的新MimeType
@throws QiniuException
@link http://developer.qiniu.com/kodo/api/chgm
"""
String resource = encodedEntry(bucke... | java | public Response changeMime(String bucket, String key, String mime)
throws QiniuException {
String resource = encodedEntry(bucket, key);
String encodedMime = UrlSafeBase64.encodeToString(mime);
String path = String.format("/chgm/%s/mime/%s", resource, encodedMime);
return rsPo... | [
"public",
"Response",
"changeMime",
"(",
"String",
"bucket",
",",
"String",
"key",
",",
"String",
"mime",
")",
"throws",
"QiniuException",
"{",
"String",
"resource",
"=",
"encodedEntry",
"(",
"bucket",
",",
"key",
")",
";",
"String",
"encodedMime",
"=",
"Url... | 修改文件的MimeType
@param bucket 空间名称
@param key 文件名称
@param mime 文件的新MimeType
@throws QiniuException
@link http://developer.qiniu.com/kodo/api/chgm | [
"修改文件的MimeType"
] | train | https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/storage/BucketManager.java#L273-L279 |
vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiParser.java | EmojiParser.getEmojiEndPos | protected static int getEmojiEndPos(char[] text, int startPos) {
"""
Returns end index of a unicode emoji if it is found in text starting at
index startPos, -1 if not found.
This returns the longest matching emoji, for example, in
"\uD83D\uDC68\u200D\uD83D\uDC69\u200D\uD83D\uDC66"
it will find alias:family_man... | java | protected static int getEmojiEndPos(char[] text, int startPos) {
int best = -1;
for (int j = startPos + 1; j <= text.length; j++) {
EmojiTrie.Matches status = EmojiManager.isEmoji(Arrays.copyOfRange(
text,
startPos,
j
));
if (status.exactMatch()) {
best = j;
... | [
"protected",
"static",
"int",
"getEmojiEndPos",
"(",
"char",
"[",
"]",
"text",
",",
"int",
"startPos",
")",
"{",
"int",
"best",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"j",
"=",
"startPos",
"+",
"1",
";",
"j",
"<=",
"text",
".",
"length",
";",
"j"... | Returns end index of a unicode emoji if it is found in text starting at
index startPos, -1 if not found.
This returns the longest matching emoji, for example, in
"\uD83D\uDC68\u200D\uD83D\uDC69\u200D\uD83D\uDC66"
it will find alias:family_man_woman_boy, NOT alias:man
@param text the current text where we are looking f... | [
"Returns",
"end",
"index",
"of",
"a",
"unicode",
"emoji",
"if",
"it",
"is",
"found",
"in",
"text",
"starting",
"at",
"index",
"startPos",
"-",
"1",
"if",
"not",
"found",
".",
"This",
"returns",
"the",
"longest",
"matching",
"emoji",
"for",
"example",
"in... | train | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L451-L468 |
gallandarakhneorg/afc | core/util/src/main/java/org/arakhne/afc/progress/ProgressionUtil.java | ProgressionUtil.advance | public static void advance(Progression model, int value) {
"""
Increment the value of the given task progression,
if not <code>null</code>, by the given amount.
@param model is the progression to change
@param value is the value to add to the progression value.
"""
if (model != null && value > 0) {
f... | java | public static void advance(Progression model, int value) {
if (model != null && value > 0) {
final SubProgressionModel sub = (SubProgressionModel) model.getSubTask();
final double base;
if (sub == null) {
base = model.getValue();
} else {
base = sub.getMinInParent();
model.ensureNoSubTask();
... | [
"public",
"static",
"void",
"advance",
"(",
"Progression",
"model",
",",
"int",
"value",
")",
"{",
"if",
"(",
"model",
"!=",
"null",
"&&",
"value",
">",
"0",
")",
"{",
"final",
"SubProgressionModel",
"sub",
"=",
"(",
"SubProgressionModel",
")",
"model",
... | Increment the value of the given task progression,
if not <code>null</code>, by the given amount.
@param model is the progression to change
@param value is the value to add to the progression value. | [
"Increment",
"the",
"value",
"of",
"the",
"given",
"task",
"progression",
"if",
"not",
"<code",
">",
"null<",
"/",
"code",
">",
"by",
"the",
"given",
"amount",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/util/src/main/java/org/arakhne/afc/progress/ProgressionUtil.java#L219-L231 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Point2D.java | Point2D.orientationRobust | public static int orientationRobust(Point2D p, Point2D q, Point2D r) {
"""
Calculates the orientation of the triangle formed by p, q, r. Returns 1
for counter-clockwise, -1 for clockwise, and 0 for collinear. May use
high precision arithmetics for some special degenerate cases.
"""
ECoordinate det_ec = new... | java | public static int orientationRobust(Point2D p, Point2D q, Point2D r) {
ECoordinate det_ec = new ECoordinate();
det_ec.set(q.x);
det_ec.sub(p.x);
ECoordinate rp_y_ec = new ECoordinate();
rp_y_ec.set(r.y);
rp_y_ec.sub(p.y);
ECoordinate qp_y_ec = new ECoordinate();
qp_y_ec.set(q.y);
qp_y_ec.sub(p.y);
... | [
"public",
"static",
"int",
"orientationRobust",
"(",
"Point2D",
"p",
",",
"Point2D",
"q",
",",
"Point2D",
"r",
")",
"{",
"ECoordinate",
"det_ec",
"=",
"new",
"ECoordinate",
"(",
")",
";",
"det_ec",
".",
"set",
"(",
"q",
".",
"x",
")",
";",
"det_ec",
... | Calculates the orientation of the triangle formed by p, q, r. Returns 1
for counter-clockwise, -1 for clockwise, and 0 for collinear. May use
high precision arithmetics for some special degenerate cases. | [
"Calculates",
"the",
"orientation",
"of",
"the",
"triangle",
"formed",
"by",
"p",
"q",
"r",
".",
"Returns",
"1",
"for",
"counter",
"-",
"clockwise",
"-",
"1",
"for",
"clockwise",
"and",
"0",
"for",
"collinear",
".",
"May",
"use",
"high",
"precision",
"ar... | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Point2D.java#L442-L496 |
jMetal/jMetal | jmetal-exec/src/main/java/org/uma/jmetal/experiment/NSGAIIStudy.java | NSGAIIStudy.configureAlgorithmList | static List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> configureAlgorithmList(
List<ExperimentProblem<DoubleSolution>> problemList) {
"""
The algorithm list is composed of pairs {@link Algorithm} + {@link Problem} which form part of
a {@link ExperimentAlgorithm}, which is a decorator for... | java | static List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> configureAlgorithmList(
List<ExperimentProblem<DoubleSolution>> problemList) {
List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> algorithms = new ArrayList<>();
for (int run = 0; run < INDEPENDENT_RUNS; run++) {
... | [
"static",
"List",
"<",
"ExperimentAlgorithm",
"<",
"DoubleSolution",
",",
"List",
"<",
"DoubleSolution",
">",
">",
">",
"configureAlgorithmList",
"(",
"List",
"<",
"ExperimentProblem",
"<",
"DoubleSolution",
">",
">",
"problemList",
")",
"{",
"List",
"<",
"Exper... | The algorithm list is composed of pairs {@link Algorithm} + {@link Problem} which form part of
a {@link ExperimentAlgorithm}, which is a decorator for class {@link Algorithm}. The {@link
ExperimentAlgorithm} has an optional tag component, that can be set as it is shown in this example,
where four variants of a same alg... | [
"The",
"algorithm",
"list",
"is",
"composed",
"of",
"pairs",
"{"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-exec/src/main/java/org/uma/jmetal/experiment/NSGAIIStudy.java#L96-L142 |
phax/ph-css | ph-css/src/main/java/com/helger/css/reader/CSSReader.java | CSSReader.isValidCSS | public static boolean isValidCSS (@Nonnull @WillClose final Reader aReader, @Nonnull final ECSSVersion eVersion) {
"""
Check if the passed reader can be resembled to valid CSS content. This is
accomplished by fully parsing the CSS each time the method is called. This
is similar to calling
{@link #readFromStream... | java | public static boolean isValidCSS (@Nonnull @WillClose final Reader aReader, @Nonnull final ECSSVersion eVersion)
{
ValueEnforcer.notNull (aReader, "Reader");
ValueEnforcer.notNull (eVersion, "Version");
try
{
final CSSCharStream aCharStream = new CSSCharStream (aReader);
final CSSNode aNo... | [
"public",
"static",
"boolean",
"isValidCSS",
"(",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"Reader",
"aReader",
",",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eVersion",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aReader",
",",
"\"Reader\"",
")",
";",
... | Check if the passed reader can be resembled to valid CSS content. This is
accomplished by fully parsing the CSS each time the method is called. This
is similar to calling
{@link #readFromStream(IHasInputStream, Charset, ECSSVersion)} and checking
for a non-<code>null</code> result.
@param aReader
The reader to use. Ma... | [
"Check",
"if",
"the",
"passed",
"reader",
"can",
"be",
"resembled",
"to",
"valid",
"CSS",
"content",
".",
"This",
"is",
"accomplished",
"by",
"fully",
"parsing",
"the",
"CSS",
"each",
"time",
"the",
"method",
"is",
"called",
".",
"This",
"is",
"similar",
... | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/reader/CSSReader.java#L352-L371 |
OpenLiberty/open-liberty | dev/com.ibm.ws.serialization/src/com/ibm/ws/serialization/internal/SerializationServiceImpl.java | SerializationServiceImpl.loadClass | Class<?> loadClass(String name) throws ClassNotFoundException {
"""
Attempts to resolve a class from registered class providers.
@param name the class name
@return the class, or null if not found
@throws ClassNotFoundException if a class provider claimed to provide a
class or package, but its bundle did not ... | java | Class<?> loadClass(String name) throws ClassNotFoundException {
// First, try to find the class by name.
ServiceReference<DeserializationClassProvider> provider = classProviders.getReference(name);
if (provider != null) {
return loadClass(provider, name);
}
// Next, ... | [
"Class",
"<",
"?",
">",
"loadClass",
"(",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"// First, try to find the class by name.",
"ServiceReference",
"<",
"DeserializationClassProvider",
">",
"provider",
"=",
"classProviders",
".",
"getReference",
"(",... | Attempts to resolve a class from registered class providers.
@param name the class name
@return the class, or null if not found
@throws ClassNotFoundException if a class provider claimed to provide a
class or package, but its bundle did not contain the class | [
"Attempts",
"to",
"resolve",
"a",
"class",
"from",
"registered",
"class",
"providers",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.serialization/src/com/ibm/ws/serialization/internal/SerializationServiceImpl.java#L247-L265 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/Validate.java | Validate.notEmpty | public static <T extends Map<?, ?>> T notEmpty(final T map, final String message, final Object... values) {
"""
<p>Validate that the specified argument map is neither {@code null} nor a size of zero (no elements); otherwise throwing an exception with the specified message.
<pre>Validate.notEmpty(myMap, "The map m... | java | public static <T extends Map<?, ?>> T notEmpty(final T map, final String message, final Object... values) {
return INSTANCE.notEmpty(map, message, values);
} | [
"public",
"static",
"<",
"T",
"extends",
"Map",
"<",
"?",
",",
"?",
">",
">",
"T",
"notEmpty",
"(",
"final",
"T",
"map",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"return",
"INSTANCE",
".",
"notEmpty",
"(",... | <p>Validate that the specified argument map is neither {@code null} nor a size of zero (no elements); otherwise throwing an exception with the specified message.
<pre>Validate.notEmpty(myMap, "The map must not be empty");</pre>
@param <T>
the map type
@param map
the map to check, validated not null by this method
@par... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"map",
"is",
"neither",
"{",
"@code",
"null",
"}",
"nor",
"a",
"size",
"of",
"zero",
"(",
"no",
"elements",
")",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/Validate.java#L916-L918 |
biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.getCDSLengthForward | public static int getCDSLengthForward(List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) {
"""
Get the length of the coding sequence
@param exonStarts
@param exonEnds
@param cdsStart
@param cdsEnd
@return
"""
int codingLength = 0;
for (int i = 0; i < exonStarts.size(); i++... | java | public static int getCDSLengthForward(List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) {
int codingLength = 0;
for (int i = 0; i < exonStarts.size(); i++) {
int start = exonStarts.get(i)+base;
int end = exonEnds.get(i);
if ( (start < cdsStart+base && end < cdsStart) || (start... | [
"public",
"static",
"int",
"getCDSLengthForward",
"(",
"List",
"<",
"Integer",
">",
"exonStarts",
",",
"List",
"<",
"Integer",
">",
"exonEnds",
",",
"int",
"cdsStart",
",",
"int",
"cdsEnd",
")",
"{",
"int",
"codingLength",
"=",
"0",
";",
"for",
"(",
"int... | Get the length of the coding sequence
@param exonStarts
@param exonEnds
@param cdsStart
@param cdsEnd
@return | [
"Get",
"the",
"length",
"of",
"the",
"coding",
"sequence"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L548-L569 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java | WalletProtobufSerializer.readWallet | public Wallet readWallet(InputStream input, @Nullable WalletExtension... walletExtensions) throws UnreadableWalletException {
"""
<p>Loads wallet data from the given protocol buffer and inserts it into the given Wallet object. This is primarily
useful when you wish to pre-register extension objects. Note that if ... | java | public Wallet readWallet(InputStream input, @Nullable WalletExtension... walletExtensions) throws UnreadableWalletException {
return readWallet(input, false, walletExtensions);
} | [
"public",
"Wallet",
"readWallet",
"(",
"InputStream",
"input",
",",
"@",
"Nullable",
"WalletExtension",
"...",
"walletExtensions",
")",
"throws",
"UnreadableWalletException",
"{",
"return",
"readWallet",
"(",
"input",
",",
"false",
",",
"walletExtensions",
")",
";",... | <p>Loads wallet data from the given protocol buffer and inserts it into the given Wallet object. This is primarily
useful when you wish to pre-register extension objects. Note that if loading fails the provided Wallet object
may be in an indeterminate state and should be thrown away.</p>
<p>A wallet can be unreadable ... | [
"<p",
">",
"Loads",
"wallet",
"data",
"from",
"the",
"given",
"protocol",
"buffer",
"and",
"inserts",
"it",
"into",
"the",
"given",
"Wallet",
"object",
".",
"This",
"is",
"primarily",
"useful",
"when",
"you",
"wish",
"to",
"pre",
"-",
"register",
"extensio... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java#L419-L421 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/BackendTransaction.java | BackendTransaction.acquireEdgeLock | public void acquireEdgeLock(StaticBuffer key, StaticBuffer column) throws BackendException {
"""
Acquires a lock for the key-column pair on the edge store which ensures that nobody else can take a lock on that
respective entry for the duration of this lock (but somebody could potentially still overwrite
the key-... | java | public void acquireEdgeLock(StaticBuffer key, StaticBuffer column) throws BackendException {
acquiredLock = true;
edgeStore.acquireLock(key, column, null, storeTx);
} | [
"public",
"void",
"acquireEdgeLock",
"(",
"StaticBuffer",
"key",
",",
"StaticBuffer",
"column",
")",
"throws",
"BackendException",
"{",
"acquiredLock",
"=",
"true",
";",
"edgeStore",
".",
"acquireLock",
"(",
"key",
",",
"column",
",",
"null",
",",
"storeTx",
"... | Acquires a lock for the key-column pair on the edge store which ensures that nobody else can take a lock on that
respective entry for the duration of this lock (but somebody could potentially still overwrite
the key-value entry without taking a lock).
The expectedValue defines the value expected to match the value at t... | [
"Acquires",
"a",
"lock",
"for",
"the",
"key",
"-",
"column",
"pair",
"on",
"the",
"edge",
"store",
"which",
"ensures",
"that",
"nobody",
"else",
"can",
"take",
"a",
"lock",
"on",
"that",
"respective",
"entry",
"for",
"the",
"duration",
"of",
"this",
"loc... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/BackendTransaction.java#L214-L217 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.