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 |
|---|---|---|---|---|---|---|---|---|---|---|
vkostyukov/la4j | src/main/java/org/la4j/vector/dense/BasicVector.java | BasicVector.fromMap | public static BasicVector fromMap(Map<Integer, ? extends Number> map, int length) {
"""
Creates new {@link BasicVector} from index-value map
@param map index-value map
@param length vector length
@return created vector
"""
return Vector.fromMap(map, length).to(Vectors.BASIC);
} | java | public static BasicVector fromMap(Map<Integer, ? extends Number> map, int length) {
return Vector.fromMap(map, length).to(Vectors.BASIC);
} | [
"public",
"static",
"BasicVector",
"fromMap",
"(",
"Map",
"<",
"Integer",
",",
"?",
"extends",
"Number",
">",
"map",
",",
"int",
"length",
")",
"{",
"return",
"Vector",
".",
"fromMap",
"(",
"map",
",",
"length",
")",
".",
"to",
"(",
"Vectors",
".",
"... | Creates new {@link BasicVector} from index-value map
@param map index-value map
@param length vector length
@return created vector | [
"Creates",
"new",
"{",
"@link",
"BasicVector",
"}",
"from",
"index",
"-",
"value",
"map"
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/vector/dense/BasicVector.java#L189-L191 |
ltsopensource/light-task-scheduler | lts-core/src/main/java/com/github/ltsopensource/core/commons/utils/WebUtils.java | WebUtils.doGet | public static String doGet(String url, Map<String, String> params) throws IOException {
"""
执行HTTP GET请求。
@param url 请求地址
@param params 请求参数
@return 响应字符串
"""
return doGet(url, params, DEFAULT_CHARSET);
} | java | public static String doGet(String url, Map<String, String> params) throws IOException {
return doGet(url, params, DEFAULT_CHARSET);
} | [
"public",
"static",
"String",
"doGet",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"IOException",
"{",
"return",
"doGet",
"(",
"url",
",",
"params",
",",
"DEFAULT_CHARSET",
")",
";",
"}"
] | 执行HTTP GET请求。
@param url 请求地址
@param params 请求参数
@return 响应字符串 | [
"执行HTTP",
"GET请求。"
] | train | https://github.com/ltsopensource/light-task-scheduler/blob/64d3aa000ff5022be5e94f511b58f405e5f4c8eb/lts-core/src/main/java/com/github/ltsopensource/core/commons/utils/WebUtils.java#L120-L122 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsInner.java | ExportConfigurationsInner.createAsync | public Observable<List<ApplicationInsightsComponentExportConfigurationInner>> createAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties) {
"""
Create a Continuous Export configuration of an Application Insights component.
@param resourceGroupName The n... | java | public Observable<List<ApplicationInsightsComponentExportConfigurationInner>> createAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties) {
return createWithServiceResponseAsync(resourceGroupName, resourceName, exportProperties).map(new Func1<ServiceRes... | [
"public",
"Observable",
"<",
"List",
"<",
"ApplicationInsightsComponentExportConfigurationInner",
">",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ApplicationInsightsComponentExportRequest",
"exportProperties",
")",
"{",
"retur... | Create a Continuous Export configuration of an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param exportProperties Properties that need to be specified to create a Continuous Export configuration o... | [
"Create",
"a",
"Continuous",
"Export",
"configuration",
"of",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsInner.java#L207-L214 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.withPrintWriter | public static <T> T withPrintWriter(Writer writer, @ClosureParams(value=SimpleType.class, options="java.io.PrintWriter") Closure<T> closure) throws IOException {
"""
Create a new PrintWriter for this Writer. The writer is passed to the
closure, and will be closed before this method returns.
@param writer a w... | java | public static <T> T withPrintWriter(Writer writer, @ClosureParams(value=SimpleType.class, options="java.io.PrintWriter") Closure<T> closure) throws IOException {
return withWriter(newPrintWriter(writer), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withPrintWriter",
"(",
"Writer",
"writer",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.PrintWriter\"",
")",
"Closure",
"<",
"T",
">",
"closure",
")",
"th... | Create a new PrintWriter for this Writer. The writer is passed to the
closure, and will be closed before this method returns.
@param writer a writer
@param closure the closure to invoke with the PrintWriter
@return the value returned by the closure
@throws IOException if an IOException occurs.
@since 1.6.0 | [
"Create",
"a",
"new",
"PrintWriter",
"for",
"this",
"Writer",
".",
"The",
"writer",
"is",
"passed",
"to",
"the",
"closure",
"and",
"will",
"be",
"closed",
"before",
"this",
"method",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1103-L1105 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Validators.java | Validators.noWhitespace | public static Validator<CharSequence> noWhitespace(@NonNull final Context context,
@StringRes final int resourceId) {
"""
Creates and returns a validator, which allows to validate texts to ensure, that they contain
no whitespace. Empty texts are also accepted... | java | public static Validator<CharSequence> noWhitespace(@NonNull final Context context,
@StringRes final int resourceId) {
return new NoWhitespaceValidator(context, resourceId);
} | [
"public",
"static",
"Validator",
"<",
"CharSequence",
">",
"noWhitespace",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"StringRes",
"final",
"int",
"resourceId",
")",
"{",
"return",
"new",
"NoWhitespaceValidator",
"(",
"context",
",",
"resource... | Creates and returns a validator, which allows to validate texts to ensure, that they contain
no whitespace. Empty texts are also accepted.
@param context
The context, which should be used to retrieve the error message, as an instance of
the class {@link Context}. The context may not be null
@param resourceId
The resou... | [
"Creates",
"and",
"returns",
"a",
"validator",
"which",
"allows",
"to",
"validate",
"texts",
"to",
"ensure",
"that",
"they",
"contain",
"no",
"whitespace",
".",
"Empty",
"texts",
"are",
"also",
"accepted",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/Validators.java#L531-L534 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildFieldInfo | public void buildFieldInfo(XMLNode node, Content fieldsContentTree) {
"""
Build the field information.
@param node the XML element that specifies which components to document
@param fieldsContentTree content tree to which the documentation will be added
"""
if(configuration.nocomment){
... | java | public void buildFieldInfo(XMLNode node, Content fieldsContentTree) {
if(configuration.nocomment){
return;
}
VariableElement field = (VariableElement)currentMember;
TypeElement te = utils.getEnclosingTypeElement(currentMember);
// Process default Serializable field.
... | [
"public",
"void",
"buildFieldInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"fieldsContentTree",
")",
"{",
"if",
"(",
"configuration",
".",
"nocomment",
")",
"{",
"return",
";",
"}",
"VariableElement",
"field",
"=",
"(",
"VariableElement",
")",
"currentMember",
... | Build the field information.
@param node the XML element that specifies which components to document
@param fieldsContentTree content tree to which the documentation will be added | [
"Build",
"the",
"field",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java#L530-L545 |
google/j2objc | jre_emul/Classes/com/google/j2objc/util/NativeTimeZone.java | NativeTimeZone.getOffset | @Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) {
"""
This implementation is adapted from libcore's ZoneInfo.
The method always assumes Gregorian calendar, and uses a simple formula to first derive the
instant of the local datetime arguments and then call {@li... | java | @Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) {
long calc = (year / 400) * MILLISECONDS_PER_400_YEARS;
year %= 400;
calc += year * (365 * MILLISECONDS_PER_DAY);
calc += ((year + 3) / 4) * MILLISECONDS_PER_DAY;
if (year > 0) {
calc -= ((y... | [
"@",
"Override",
"public",
"int",
"getOffset",
"(",
"int",
"era",
",",
"int",
"year",
",",
"int",
"month",
",",
"int",
"day",
",",
"int",
"dayOfWeek",
",",
"int",
"millis",
")",
"{",
"long",
"calc",
"=",
"(",
"year",
"/",
"400",
")",
"*",
"MILLISEC... | This implementation is adapted from libcore's ZoneInfo.
The method always assumes Gregorian calendar, and uses a simple formula to first derive the
instant of the local datetime arguments and then call {@link #getOffset(long)} to get the
actual offset. The local datetime used here is always in the non-DST time zone, i... | [
"This",
"implementation",
"is",
"adapted",
"from",
"libcore",
"s",
"ZoneInfo",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/Classes/com/google/j2objc/util/NativeTimeZone.java#L217-L240 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/rest/RelationshipResource.java | RelationshipResource.addRelationship | @Path("/new")
@POST
public Response addRelationship(
@PathParam(RestParam.PID)
String pid,
@QueryParam(RestParam.SUBJECT)
String subject,
@QueryParam(RestParam.PREDICATE)
String predicate,
@QueryParam(RestParam.OBJECT)
... | java | @Path("/new")
@POST
public Response addRelationship(
@PathParam(RestParam.PID)
String pid,
@QueryParam(RestParam.SUBJECT)
String subject,
@QueryParam(RestParam.PREDICATE)
String predicate,
@QueryParam(RestParam.OBJECT)
... | [
"@",
"Path",
"(",
"\"/new\"",
")",
"@",
"POST",
"public",
"Response",
"addRelationship",
"(",
"@",
"PathParam",
"(",
"RestParam",
".",
"PID",
")",
"String",
"pid",
",",
"@",
"QueryParam",
"(",
"RestParam",
".",
"SUBJECT",
")",
"String",
"subject",
",",
"... | Add a relationship.
<br>
POST /objects/{pid}/relationships/new ? subject predicate object isLiteral datatype
<br>
Successful Response:
Status: 200 OK | [
"Add",
"a",
"relationship",
".",
"<br",
">",
"POST",
"/",
"objects",
"/",
"{",
"pid",
"}",
"/",
"relationships",
"/",
"new",
"?",
"subject",
"predicate",
"object",
"isLiteral",
"datatype",
"<br",
">",
"Successful",
"Response",
":",
"Status",
":",
"200",
... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/rest/RelationshipResource.java#L121-L150 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Flowable.java | Flowable.flatMapIterable | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <U> Flowable<U> flatMapIterable(final Function<? super T, ? extends Iterable<? extends U>> mapper, int bufferSize) {
"""
Returns a Flowable that merges each item emitted by the source Pub... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <U> Flowable<U> flatMapIterable(final Function<? super T, ? extends Iterable<? extends U>> mapper, int bufferSize) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
Obje... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"U",
">",
"Flowable",
"<",
"U",
">",
"flatMapIterable",
"(",
"final",
"F... | Returns a Flowable that merges each item emitted by the source Publisher with the values in an
Iterable corresponding to that item that is generated by a selector.
<p>
<img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/flatMapIterable.f.png" alt="">
<dl>
<dt><b>Backpress... | [
"Returns",
"a",
"Flowable",
"that",
"merges",
"each",
"item",
"emitted",
"by",
"the",
"source",
"Publisher",
"with",
"the",
"values",
"in",
"an",
"Iterable",
"corresponding",
"to",
"that",
"item",
"that",
"is",
"generated",
"by",
"a",
"selector",
".",
"<p",
... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L9939-L9946 |
MenoData/Time4J | base/src/main/java/net/time4j/range/IntervalParser.java | IntervalParser.parsePattern | static <T, I extends ChronoInterval<T>> I parsePattern(
CharSequence text,
IntervalCreator<T, I> factory,
ChronoParser<T> parser,
String pattern
) throws ParseException {
"""
<p>Custom parsing using any kind of interval pattern (possibly with or-logic). </p>
@param text ... | java | static <T, I extends ChronoInterval<T>> I parsePattern(
CharSequence text,
IntervalCreator<T, I> factory,
ChronoParser<T> parser,
String pattern
) throws ParseException {
ParseLog plog = new ParseLog();
String[] components = pattern.split("\\|");
for (String... | [
"static",
"<",
"T",
",",
"I",
"extends",
"ChronoInterval",
"<",
"T",
">",
">",
"I",
"parsePattern",
"(",
"CharSequence",
"text",
",",
"IntervalCreator",
"<",
"T",
",",
"I",
">",
"factory",
",",
"ChronoParser",
"<",
"T",
">",
"parser",
",",
"String",
"p... | <p>Custom parsing using any kind of interval pattern (possibly with or-logic). </p>
@param text text to be parsed
@param factory interval factory
@param parser parser used for parsing either start or end component
@param pattern interval pattern containing the placeholders {0} or {1}
@retur... | [
"<p",
">",
"Custom",
"parsing",
"using",
"any",
"kind",
"of",
"interval",
"pattern",
"(",
"possibly",
"with",
"or",
"-",
"logic",
")",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/IntervalParser.java#L483-L508 |
m-m-m/util | exception/src/main/java/net/sf/mmm/util/exception/api/NlsNullPointerException.java | NlsNullPointerException.checkNotNull | public static void checkNotNull(String objectName, Object object) throws NlsNullPointerException {
"""
This method checks if the given {@code object} is {@code null}. <br>
Look at the following example:
<pre>
{@link NlsNullPointerException}.checkNotNull("someParameter", someParameter);
</pre>
This is equi... | java | public static void checkNotNull(String objectName, Object object) throws NlsNullPointerException {
if (object == null) {
throw new NlsNullPointerException(objectName);
}
} | [
"public",
"static",
"void",
"checkNotNull",
"(",
"String",
"objectName",
",",
"Object",
"object",
")",
"throws",
"NlsNullPointerException",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NlsNullPointerException",
"(",
"objectName",
")",
";",
... | This method checks if the given {@code object} is {@code null}. <br>
Look at the following example:
<pre>
{@link NlsNullPointerException}.checkNotNull("someParameter", someParameter);
</pre>
This is equivalent to this code:
<pre>
if (someParameter == null) {
throw new {@link NlsNullPointerException}("someParameter")... | [
"This",
"method",
"checks",
"if",
"the",
"given",
"{",
"@code",
"object",
"}",
"is",
"{",
"@code",
"null",
"}",
".",
"<br",
">",
"Look",
"at",
"the",
"following",
"example",
":"
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/exception/src/main/java/net/sf/mmm/util/exception/api/NlsNullPointerException.java#L102-L107 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/Keys.java | Keys.fillServer | public static void fillServer(final Map<String, Object> dataModel) {
"""
Fills the server info into the specified data model.
<ul>
<li>{@value org.b3log.latke.Keys.Server#SERVER_SCHEME}</li>
<li>{@value org.b3log.latke.Keys.Server#SERVER_HOST}</li>
<li>{@value org.b3log.latke.Keys.Server#SERVER_PORT}</li>
<li... | java | public static void fillServer(final Map<String, Object> dataModel) {
dataModel.put(Server.SERVER_SCHEME, Latkes.getServerScheme());
dataModel.put(Server.SERVER_HOST, Latkes.getServerHost());
dataModel.put(Server.SERVER_PORT, Latkes.getServerPort());
dataModel.put(Server.SERVER, Latkes.ge... | [
"public",
"static",
"void",
"fillServer",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"dataModel",
")",
"{",
"dataModel",
".",
"put",
"(",
"Server",
".",
"SERVER_SCHEME",
",",
"Latkes",
".",
"getServerScheme",
"(",
")",
")",
";",
"dataModel",
... | Fills the server info into the specified data model.
<ul>
<li>{@value org.b3log.latke.Keys.Server#SERVER_SCHEME}</li>
<li>{@value org.b3log.latke.Keys.Server#SERVER_HOST}</li>
<li>{@value org.b3log.latke.Keys.Server#SERVER_PORT}</li>
<li>{@value org.b3log.latke.Keys.Server#SERVER}</li>
<li>{@value org.b3log.latke.Keys.... | [
"Fills",
"the",
"server",
"info",
"into",
"the",
"specified",
"data",
"model",
".",
"<ul",
">",
"<li",
">",
"{",
"@value",
"org",
".",
"b3log",
".",
"latke",
".",
"Keys",
".",
"Server#SERVER_SCHEME",
"}",
"<",
"/",
"li",
">",
"<li",
">",
"{",
"@value... | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/Keys.java#L142-L156 |
playn/playn | android/src/playn/android/AndroidHttpClient.java | AndroidHttpClient.newInstance | public static AndroidHttpClient newInstance(String userAgent) {
"""
Create a new HttpClient with reasonable defaults (which you can update).
@param userAgent to report in your HTTP requests.
@return AndroidHttpClient for you to use for all your requests.
"""
HttpParams params = new BasicHttpParams();
... | java | public static AndroidHttpClient newInstance(String userAgent) {
HttpParams params = new BasicHttpParams();
// Turn off stale checking. Our connections break all the time anyway,
// and it's not worth it to pay the penalty of checking every time.
HttpConnectionParams.setStaleCheckingEnabled(params, fals... | [
"public",
"static",
"AndroidHttpClient",
"newInstance",
"(",
"String",
"userAgent",
")",
"{",
"HttpParams",
"params",
"=",
"new",
"BasicHttpParams",
"(",
")",
";",
"// Turn off stale checking. Our connections break all the time anyway,",
"// and it's not worth it to pay the penal... | Create a new HttpClient with reasonable defaults (which you can update).
@param userAgent to report in your HTTP requests.
@return AndroidHttpClient for you to use for all your requests. | [
"Create",
"a",
"new",
"HttpClient",
"with",
"reasonable",
"defaults",
"(",
"which",
"you",
"can",
"update",
")",
"."
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/android/src/playn/android/AndroidHttpClient.java#L80-L106 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java | DBTransaction.addColumn | public void addColumn(String storeName, String rowKey, String columnName) {
"""
Add a column with empty value. The value will be empty byte array/empty string, not null
@param storeName Name of store that owns row.
@param rowKey Key of row that owns column.
@param columnName Name of column.
"""
... | java | public void addColumn(String storeName, String rowKey, String columnName) {
addColumn(storeName, rowKey, columnName, EMPTY);
} | [
"public",
"void",
"addColumn",
"(",
"String",
"storeName",
",",
"String",
"rowKey",
",",
"String",
"columnName",
")",
"{",
"addColumn",
"(",
"storeName",
",",
"rowKey",
",",
"columnName",
",",
"EMPTY",
")",
";",
"}"
] | Add a column with empty value. The value will be empty byte array/empty string, not null
@param storeName Name of store that owns row.
@param rowKey Key of row that owns column.
@param columnName Name of column. | [
"Add",
"a",
"column",
"with",
"empty",
"value",
".",
"The",
"value",
"will",
"be",
"empty",
"byte",
"array",
"/",
"empty",
"string",
"not",
"null"
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java#L193-L195 |
EdwardRaff/JSAT | JSAT/src/jsat/io/CSV.java | CSV.readC | public static ClassificationDataSet readC(int classification_target, Reader reader, char delimiter, int lines_to_skip, char comment, Set<Integer> cat_cols) throws IOException {
"""
Reads in a CSV dataset as a classification dataset.
@param classification_target the column index (starting from zero) of the
feat... | java | public static ClassificationDataSet readC(int classification_target, Reader reader, char delimiter, int lines_to_skip, char comment, Set<Integer> cat_cols) throws IOException
{
return (ClassificationDataSet) readCSV(reader, lines_to_skip, delimiter, comment, cat_cols, -1, classification_target);
} | [
"public",
"static",
"ClassificationDataSet",
"readC",
"(",
"int",
"classification_target",
",",
"Reader",
"reader",
",",
"char",
"delimiter",
",",
"int",
"lines_to_skip",
",",
"char",
"comment",
",",
"Set",
"<",
"Integer",
">",
"cat_cols",
")",
"throws",
"IOExce... | Reads in a CSV dataset as a classification dataset.
@param classification_target the column index (starting from zero) of the
feature that will be the categorical target value
@param reader the reader for the CSV content
@param delimiter the delimiter to separate columns, usually a comma
@param lines_to_skip the numbe... | [
"Reads",
"in",
"a",
"CSV",
"dataset",
"as",
"a",
"classification",
"dataset",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/CSV.java#L193-L196 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/InetSocketAddressFactory.java | InetSocketAddressFactory.createWithResolveRetry | public static InetSocketAddress createWithResolveRetry(
String hostname,
int port,
int delayMillis,
int maxAttempt
) {
"""
Utility function to create an InetSocketAddress that has been resolved.
Retries with a small sleep in between
@param hostname - host
@param port - port
@param delayMill... | java | public static InetSocketAddress createWithResolveRetry(
String hostname,
int port,
int delayMillis,
int maxAttempt
) {
InetSocketAddress socketAddress;
int attempts = 0;
do {
socketAddress = new InetSocketAddress(hostname, port);
// if dns failed, try one more time
if (s... | [
"public",
"static",
"InetSocketAddress",
"createWithResolveRetry",
"(",
"String",
"hostname",
",",
"int",
"port",
",",
"int",
"delayMillis",
",",
"int",
"maxAttempt",
")",
"{",
"InetSocketAddress",
"socketAddress",
";",
"int",
"attempts",
"=",
"0",
";",
"do",
"{... | Utility function to create an InetSocketAddress that has been resolved.
Retries with a small sleep in between
@param hostname - host
@param port - port
@param delayMillis - millis to sleep between attempts
@param maxAttempt - max total attempts to retry
@return InetSocketAddress, may be unresolved if all attempts fail | [
"Utility",
"function",
"to",
"create",
"an",
"InetSocketAddress",
"that",
"has",
"been",
"resolved",
".",
"Retries",
"with",
"a",
"small",
"sleep",
"in",
"between"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/InetSocketAddressFactory.java#L43-L76 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java | SDNN.layerNorm | public SDVariable layerNorm(SDVariable input, SDVariable gain, int... dimensions) {
"""
Apply Layer Normalization without bias
y = gain * standardize(x)
@return Output variable
"""
return layerNorm((String)null, input, gain, dimensions);
} | java | public SDVariable layerNorm(SDVariable input, SDVariable gain, int... dimensions) {
return layerNorm((String)null, input, gain, dimensions);
} | [
"public",
"SDVariable",
"layerNorm",
"(",
"SDVariable",
"input",
",",
"SDVariable",
"gain",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"layerNorm",
"(",
"(",
"String",
")",
"null",
",",
"input",
",",
"gain",
",",
"dimensions",
")",
";",
"}"
] | Apply Layer Normalization without bias
y = gain * standardize(x)
@return Output variable | [
"Apply",
"Layer",
"Normalization",
"without",
"bias"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java#L731-L733 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java | VirtualMachineImagesInner.listSkusAsync | public Observable<List<VirtualMachineImageResourceInner>> listSkusAsync(String location, String publisherName, String offer) {
"""
Gets a list of virtual machine image SKUs for the specified location, publisher, and offer.
@param location The name of a supported Azure region.
@param publisherName A valid image... | java | public Observable<List<VirtualMachineImageResourceInner>> listSkusAsync(String location, String publisherName, String offer) {
return listSkusWithServiceResponseAsync(location, publisherName, offer).map(new Func1<ServiceResponse<List<VirtualMachineImageResourceInner>>, List<VirtualMachineImageResourceInner>>() ... | [
"public",
"Observable",
"<",
"List",
"<",
"VirtualMachineImageResourceInner",
">",
">",
"listSkusAsync",
"(",
"String",
"location",
",",
"String",
"publisherName",
",",
"String",
"offer",
")",
"{",
"return",
"listSkusWithServiceResponseAsync",
"(",
"location",
",",
... | Gets a list of virtual machine image SKUs for the specified location, publisher, and offer.
@param location The name of a supported Azure region.
@param publisherName A valid image publisher.
@param offer A valid image publisher offer.
@throws IllegalArgumentException thrown if parameters fail the validation
@return t... | [
"Gets",
"a",
"list",
"of",
"virtual",
"machine",
"image",
"SKUs",
"for",
"the",
"specified",
"location",
"publisher",
"and",
"offer",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java#L595-L602 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/cache/Cache.java | Cache.putInCacheNotLocked | @MustBeLocked (ELockType.WRITE)
protected final void putInCacheNotLocked (@Nonnull final KEYTYPE aKey, @Nonnull final VALUETYPE aValue) {
"""
Put a new value into the cache.
@param aKey
The cache key. May not be <code>null</code>.
@param aValue
The cache value. May not be <code>null</code>.
"""
Val... | java | @MustBeLocked (ELockType.WRITE)
protected final void putInCacheNotLocked (@Nonnull final KEYTYPE aKey, @Nonnull final VALUETYPE aValue)
{
ValueEnforcer.notNull (aKey, "cacheKey");
ValueEnforcer.notNull (aValue, "cacheValue");
// try again in write lock
if (m_aCache == null)
{
// Create a ... | [
"@",
"MustBeLocked",
"(",
"ELockType",
".",
"WRITE",
")",
"protected",
"final",
"void",
"putInCacheNotLocked",
"(",
"@",
"Nonnull",
"final",
"KEYTYPE",
"aKey",
",",
"@",
"Nonnull",
"final",
"VALUETYPE",
"aValue",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",... | Put a new value into the cache.
@param aKey
The cache key. May not be <code>null</code>.
@param aValue
The cache value. May not be <code>null</code>. | [
"Put",
"a",
"new",
"value",
"into",
"the",
"cache",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/cache/Cache.java#L140-L155 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java | StringSupport.replaceAll | public static void replaceAll(StringBuffer haystack, String needle, String newNeedle) {
"""
replaces all occurrences of needle in haystack with newNeedle
the input itself is not modified
@param haystack input string
@param needle string to replace
@param newNeedle replacement
"""
/* if(needle == null |... | java | public static void replaceAll(StringBuffer haystack, String needle, String newNeedle) {
/* if(needle == null || "".equals(needle))
{
throw new IllegalArgumentException("string to replace may not be empty");
}
int idx = haystack.indexOf(needle);
int needleLength = needle.length();
int newNeedleLength = new... | [
"public",
"static",
"void",
"replaceAll",
"(",
"StringBuffer",
"haystack",
",",
"String",
"needle",
",",
"String",
"newNeedle",
")",
"{",
"/*\t\tif(needle == null || \"\".equals(needle))\n\t\t{\n\t\t\tthrow new IllegalArgumentException(\"string to replace may not be empty\");\n\t\t}\n\... | replaces all occurrences of needle in haystack with newNeedle
the input itself is not modified
@param haystack input string
@param needle string to replace
@param newNeedle replacement | [
"replaces",
"all",
"occurrences",
"of",
"needle",
"in",
"haystack",
"with",
"newNeedle",
"the",
"input",
"itself",
"is",
"not",
"modified"
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java#L141-L155 |
lucee/Lucee | core/src/main/java/lucee/runtime/converter/JSConverter.java | JSConverter._serializeQuery | private void _serializeQuery(String name, Query query, StringBuilder sb, Set<Object> done) throws ConverterException {
"""
serialize a Query
@param query Query to serialize
@param done
@return serialized query
@throws ConverterException
"""
if (useWDDX) _serializeWDDXQuery(name, query, sb, done);
else ... | java | private void _serializeQuery(String name, Query query, StringBuilder sb, Set<Object> done) throws ConverterException {
if (useWDDX) _serializeWDDXQuery(name, query, sb, done);
else _serializeASQuery(name, query, sb, done);
} | [
"private",
"void",
"_serializeQuery",
"(",
"String",
"name",
",",
"Query",
"query",
",",
"StringBuilder",
"sb",
",",
"Set",
"<",
"Object",
">",
"done",
")",
"throws",
"ConverterException",
"{",
"if",
"(",
"useWDDX",
")",
"_serializeWDDXQuery",
"(",
"name",
"... | serialize a Query
@param query Query to serialize
@param done
@return serialized query
@throws ConverterException | [
"serialize",
"a",
"Query"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/JSConverter.java#L267-L270 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/URLConnectionTools.java | URLConnectionTools.getInputStream | public static InputStream getInputStream(URL url, int timeout) throws IOException {
"""
Connect to server and return result as an InputStream.
always asks for response to be in GZIP encoded
<p>
The caller is responsible to close the returned InputStream not to cause
resource leaks.
@param url the URL to conne... | java | public static InputStream getInputStream(URL url, int timeout) throws IOException
{
return getInputStream(url,true, timeout);
} | [
"public",
"static",
"InputStream",
"getInputStream",
"(",
"URL",
"url",
",",
"int",
"timeout",
")",
"throws",
"IOException",
"{",
"return",
"getInputStream",
"(",
"url",
",",
"true",
",",
"timeout",
")",
";",
"}"
] | Connect to server and return result as an InputStream.
always asks for response to be in GZIP encoded
<p>
The caller is responsible to close the returned InputStream not to cause
resource leaks.
@param url the URL to connect to
@param timeout the timeout for the connection
@return an {@link InputStream} of response
@th... | [
"Connect",
"to",
"server",
"and",
"return",
"result",
"as",
"an",
"InputStream",
".",
"always",
"asks",
"for",
"response",
"to",
"be",
"in",
"GZIP",
"encoded",
"<p",
">",
"The",
"caller",
"is",
"responsible",
"to",
"close",
"the",
"returned",
"InputStream",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/URLConnectionTools.java#L91-L94 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dictionary/CoreBiGramTableDictionary.java | CoreBiGramTableDictionary.binarySearch | private static int binarySearch(int[] a, int fromIndex, int length, int key) {
"""
二分搜索,由于二元接续前一个词固定时,后一个词比较少,所以二分也能取得很高的性能
@param a 目标数组
@param fromIndex 开始下标
@param length 长度
@param key 词的id
@return 共现频次
"""
int low = fromIndex;
int high = fromIndex + length - 1;
while (low <= h... | java | private static int binarySearch(int[] a, int fromIndex, int length, int key)
{
int low = fromIndex;
int high = fromIndex + length - 1;
while (low <= high)
{
int mid = (low + high) >>> 1;
int midVal = a[mid << 1];
if (midVal < key)
... | [
"private",
"static",
"int",
"binarySearch",
"(",
"int",
"[",
"]",
"a",
",",
"int",
"fromIndex",
",",
"int",
"length",
",",
"int",
"key",
")",
"{",
"int",
"low",
"=",
"fromIndex",
";",
"int",
"high",
"=",
"fromIndex",
"+",
"length",
"-",
"1",
";",
"... | 二分搜索,由于二元接续前一个词固定时,后一个词比较少,所以二分也能取得很高的性能
@param a 目标数组
@param fromIndex 开始下标
@param length 长度
@param key 词的id
@return 共现频次 | [
"二分搜索,由于二元接续前一个词固定时,后一个词比较少,所以二分也能取得很高的性能"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CoreBiGramTableDictionary.java#L218-L236 |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundGroup.java | SoundGroup.getSound | public Sound getSound (String path) {
"""
Obtains an "instance" of the specified sound which can be positioned, played, looped and
otherwise used to make noise.
"""
ClipBuffer buffer = null;
if (_manager.isInitialized()) {
buffer = _manager.getClip(_provider, path);
}
... | java | public Sound getSound (String path)
{
ClipBuffer buffer = null;
if (_manager.isInitialized()) {
buffer = _manager.getClip(_provider, path);
}
return (buffer == null) ? new BlankSound() : new Sound(this, buffer);
} | [
"public",
"Sound",
"getSound",
"(",
"String",
"path",
")",
"{",
"ClipBuffer",
"buffer",
"=",
"null",
";",
"if",
"(",
"_manager",
".",
"isInitialized",
"(",
")",
")",
"{",
"buffer",
"=",
"_manager",
".",
"getClip",
"(",
"_provider",
",",
"path",
")",
";... | Obtains an "instance" of the specified sound which can be positioned, played, looped and
otherwise used to make noise. | [
"Obtains",
"an",
"instance",
"of",
"the",
"specified",
"sound",
"which",
"can",
"be",
"positioned",
"played",
"looped",
"and",
"otherwise",
"used",
"to",
"make",
"noise",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundGroup.java#L69-L76 |
mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/internal/CoreRemoteMongoCollectionImpl.java | CoreRemoteMongoCollectionImpl.findOneAndReplace | public DocumentT findOneAndReplace(final Bson filter, final Bson replacement) {
"""
Finds a document in the collection and replaces it with the given document
@param filter the query filter
@param replacement the document to replace the matched document with
@return the resulting document
"""
return o... | java | public DocumentT findOneAndReplace(final Bson filter, final Bson replacement) {
return operations.findOneAndModify(
"findOneAndReplace",
filter,
replacement,
new RemoteFindOneAndModifyOptions(),
documentClass).execute(service);
} | [
"public",
"DocumentT",
"findOneAndReplace",
"(",
"final",
"Bson",
"filter",
",",
"final",
"Bson",
"replacement",
")",
"{",
"return",
"operations",
".",
"findOneAndModify",
"(",
"\"findOneAndReplace\"",
",",
"filter",
",",
"replacement",
",",
"new",
"RemoteFindOneAnd... | Finds a document in the collection and replaces it with the given document
@param filter the query filter
@param replacement the document to replace the matched document with
@return the resulting document | [
"Finds",
"a",
"document",
"in",
"the",
"collection",
"and",
"replaces",
"it",
"with",
"the",
"given",
"document"
] | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/internal/CoreRemoteMongoCollectionImpl.java#L542-L549 |
eBay/parallec | src/main/java/io/parallec/core/util/PcStringUtils.java | PcStringUtils.getAggregatedResultHuman | public static String getAggregatedResultHuman(Map<String, LinkedHashSet<String>> aggregateResultMap) {
"""
Get the aggregated result human readable string for easy display.
@param aggregateResultMap the aggregate result map
@return the aggregated result human
"""
StringBuilder res = new StringBu... | java | public static String getAggregatedResultHuman(Map<String, LinkedHashSet<String>> aggregateResultMap){
StringBuilder res = new StringBuilder();
for (Entry<String, LinkedHashSet<String>> entry : aggregateResultMap
.entrySet()) {
LinkedHashSet<String> valueSet = entry.getValue... | [
"public",
"static",
"String",
"getAggregatedResultHuman",
"(",
"Map",
"<",
"String",
",",
"LinkedHashSet",
"<",
"String",
">",
">",
"aggregateResultMap",
")",
"{",
"StringBuilder",
"res",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
... | Get the aggregated result human readable string for easy display.
@param aggregateResultMap the aggregate result map
@return the aggregated result human | [
"Get",
"the",
"aggregated",
"result",
"human",
"readable",
"string",
"for",
"easy",
"display",
"."
] | train | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcStringUtils.java#L76-L92 |
phax/ph-commons | ph-matrix/src/main/java/com/helger/matrix/QRDecomposition.java | QRDecomposition.getH | @Nonnull
@ReturnsMutableCopy
public Matrix getH () {
"""
Return the Householder vectors
@return Lower trapezoidal matrix whose columns define the reflections
"""
final Matrix aNewMatrix = new Matrix (m_nRows, m_nCols);
final double [] [] aNewArray = aNewMatrix.internalGetArray ();
for (int n... | java | @Nonnull
@ReturnsMutableCopy
public Matrix getH ()
{
final Matrix aNewMatrix = new Matrix (m_nRows, m_nCols);
final double [] [] aNewArray = aNewMatrix.internalGetArray ();
for (int nRow = 0; nRow < m_nRows; nRow++)
{
final double [] aSrcRow = m_aQR[nRow];
final double [] aDstRow = aNe... | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"Matrix",
"getH",
"(",
")",
"{",
"final",
"Matrix",
"aNewMatrix",
"=",
"new",
"Matrix",
"(",
"m_nRows",
",",
"m_nCols",
")",
";",
"final",
"double",
"[",
"]",
"[",
"]",
"aNewArray",
"=",
"aNewMatrix",
... | Return the Householder vectors
@return Lower trapezoidal matrix whose columns define the reflections | [
"Return",
"the",
"Householder",
"vectors"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-matrix/src/main/java/com/helger/matrix/QRDecomposition.java#L142-L158 |
unbescape/unbescape | src/main/java/org/unbescape/html/HtmlEscape.java | HtmlEscape.escapeHtml5Xml | public static void escapeHtml5Xml(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
"""
<p>
Perform an HTML5 level 1 (XML-style) <strong>escape</strong> operation on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 1</em> means this m... | java | public static void escapeHtml5Xml(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapeHtml(text, offset, len, writer, HtmlEscapeType.HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_1_ONLY_MARKU... | [
"public",
"static",
"void",
"escapeHtml5Xml",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeHtml",
"(",
"text",
",",
"offset",
... | <p>
Perform an HTML5 level 1 (XML-style) <strong>escape</strong> operation on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 1</em> means this method will only escape the five markup-significant characters:
<tt><</tt>, <tt>></tt>, <tt>&</tt>, <tt>"</tt> and <tt>'</tt>. It is called
<em>XML-style</em> in... | [
"<p",
">",
"Perform",
"an",
"HTML5",
"level",
"1",
"(",
"XML",
"-",
"style",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L912-L916 |
autermann/yaml | src/main/java/com/github/autermann/yaml/nodes/YamlMappingNode.java | YamlMappingNode.put | public T put(YamlNode key, Double value) {
"""
Adds the specified {@code key}/{@code value} pair to this mapping.
@param key the key
@param value the value
@return {@code this}
"""
return put(key, getNodeFactory().doubleNode(value));
} | java | public T put(YamlNode key, Double value) {
return put(key, getNodeFactory().doubleNode(value));
} | [
"public",
"T",
"put",
"(",
"YamlNode",
"key",
",",
"Double",
"value",
")",
"{",
"return",
"put",
"(",
"key",
",",
"getNodeFactory",
"(",
")",
".",
"doubleNode",
"(",
"value",
")",
")",
";",
"}"
] | Adds the specified {@code key}/{@code value} pair to this mapping.
@param key the key
@param value the value
@return {@code this} | [
"Adds",
"the",
"specified",
"{",
"@code",
"key",
"}",
"/",
"{",
"@code",
"value",
"}",
"pair",
"to",
"this",
"mapping",
"."
] | train | https://github.com/autermann/yaml/blob/5f8ab03e4fec3a2abe72c03561cdaa3a3936634d/src/main/java/com/github/autermann/yaml/nodes/YamlMappingNode.java#L660-L662 |
aws/aws-sdk-java | aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/CreateQueueRequest.java | CreateQueueRequest.withTags | public CreateQueueRequest withTags(java.util.Map<String, String> tags) {
"""
The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key.
@param tags
The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a
key.... | java | public CreateQueueRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"CreateQueueRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key.
@param tags
The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a
key.
@return Returns a reference to this object so that method calls can be chained togeth... | [
"The",
"tags",
"that",
"you",
"want",
"to",
"add",
"to",
"the",
"resource",
".",
"You",
"can",
"tag",
"resources",
"with",
"a",
"key",
"-",
"value",
"pair",
"or",
"with",
"only",
"a",
"key",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/CreateQueueRequest.java#L262-L265 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/dialogs/ListSelectDialog.java | ListSelectDialog.showDialog | public static <T> T showDialog(WindowBasedTextGUI textGUI, String title, String description, TerminalSize listBoxSize, T... items) {
"""
Shortcut for quickly creating a new dialog
@param textGUI Text GUI to add the dialog to
@param title Title of the dialog
@param description Description of the dialog
@param l... | java | public static <T> T showDialog(WindowBasedTextGUI textGUI, String title, String description, TerminalSize listBoxSize, T... items) {
ListSelectDialog<T> listSelectDialog = new ListSelectDialogBuilder<T>()
.setTitle(title)
.setDescription(description)
.setListBoxSi... | [
"public",
"static",
"<",
"T",
">",
"T",
"showDialog",
"(",
"WindowBasedTextGUI",
"textGUI",
",",
"String",
"title",
",",
"String",
"description",
",",
"TerminalSize",
"listBoxSize",
",",
"T",
"...",
"items",
")",
"{",
"ListSelectDialog",
"<",
"T",
">",
"list... | Shortcut for quickly creating a new dialog
@param textGUI Text GUI to add the dialog to
@param title Title of the dialog
@param description Description of the dialog
@param listBoxSize Maximum size of the list box, scrollbars will be used if the items cannot fit
@param items Items in the dialog
@param <T> Type of items... | [
"Shortcut",
"for",
"quickly",
"creating",
"a",
"new",
"dialog"
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/dialogs/ListSelectDialog.java#L161-L169 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java | TypeConverter.convertToByte | public static byte convertToByte (@Nullable final Object aSrcValue, final byte nDefault) {
"""
Convert the passed source value to byte
@param aSrcValue
The source value. May be <code>null</code>.
@param nDefault
The default value to be returned if an error occurs during type
conversion.
@return The convert... | java | public static byte convertToByte (@Nullable final Object aSrcValue, final byte nDefault)
{
final Byte aValue = convert (aSrcValue, Byte.class, null);
return aValue == null ? nDefault : aValue.byteValue ();
} | [
"public",
"static",
"byte",
"convertToByte",
"(",
"@",
"Nullable",
"final",
"Object",
"aSrcValue",
",",
"final",
"byte",
"nDefault",
")",
"{",
"final",
"Byte",
"aValue",
"=",
"convert",
"(",
"aSrcValue",
",",
"Byte",
".",
"class",
",",
"null",
")",
";",
... | Convert the passed source value to byte
@param aSrcValue
The source value. May be <code>null</code>.
@param nDefault
The default value to be returned if an error occurs during type
conversion.
@return The converted value.
@throws RuntimeException
If the converter itself throws an exception
@see TypeConverterProviderBe... | [
"Convert",
"the",
"passed",
"source",
"value",
"to",
"byte"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java#L175-L179 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectRayAab | public static boolean intersectRayAab(Vector3fc origin, Vector3fc dir, Vector3fc min, Vector3fc max, Vector2f result) {
"""
Test whether the ray with the given <code>origin</code> and direction <code>dir</code>
intersects the axis-aligned box specified as its minimum corner <code>min</code> and maximum corner <co... | java | public static boolean intersectRayAab(Vector3fc origin, Vector3fc dir, Vector3fc min, Vector3fc max, Vector2f result) {
return intersectRayAab(origin.x(), origin.y(), origin.z(), dir.x(), dir.y(), dir.z(), min.x(), min.y(), min.z(), max.x(), max.y(), max.z(), result);
} | [
"public",
"static",
"boolean",
"intersectRayAab",
"(",
"Vector3fc",
"origin",
",",
"Vector3fc",
"dir",
",",
"Vector3fc",
"min",
",",
"Vector3fc",
"max",
",",
"Vector2f",
"result",
")",
"{",
"return",
"intersectRayAab",
"(",
"origin",
".",
"x",
"(",
")",
",",... | Test whether the ray with the given <code>origin</code> and direction <code>dir</code>
intersects the axis-aligned box specified as its minimum corner <code>min</code> and maximum corner <code>max</code>,
and return the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the near and ... | [
"Test",
"whether",
"the",
"ray",
"with",
"the",
"given",
"<code",
">",
"origin<",
"/",
"code",
">",
"and",
"direction",
"<code",
">",
"dir<",
"/",
"code",
">",
"intersects",
"the",
"axis",
"-",
"aligned",
"box",
"specified",
"as",
"its",
"minimum",
"corn... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L2411-L2413 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextItems.java | ContextItems.setItem | public void setItem(String itemName, String value) {
"""
Sets a context item value.
@param itemName Item name
@param value Item value
"""
itemName = lookupItemName(itemName, value != null);
if (value == null) {
items.remove(itemName);
index.remove(itemName.toLowerCa... | java | public void setItem(String itemName, String value) {
itemName = lookupItemName(itemName, value != null);
if (value == null) {
items.remove(itemName);
index.remove(itemName.toLowerCase());
} else {
items.put(itemName, value);
}
} | [
"public",
"void",
"setItem",
"(",
"String",
"itemName",
",",
"String",
"value",
")",
"{",
"itemName",
"=",
"lookupItemName",
"(",
"itemName",
",",
"value",
"!=",
"null",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"items",
".",
"remove",
"(",... | Sets a context item value.
@param itemName Item name
@param value Item value | [
"Sets",
"a",
"context",
"item",
"value",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextItems.java#L232-L241 |
knightliao/disconf | disconf-client/src/main/java/com/baidu/disconf/client/support/utils/StringUtil.java | StringUtil.toCamelCase | public static String toCamelCase(String str) {
"""
将字符串转换成camel case。
<p>
如果字符串是<code>null</code>则返回<code>null</code>。
<p/>
<p/>
<pre>
StringUtil.toCamelCase(null) = null
StringUtil.toCamelCase("") = ""
StringUtil.toCamelCase("aBc") = "aBc"
StringUtil.toCamelCase("aBc def") = "aBcDef"
StringUtil.toCa... | java | public static String toCamelCase(String str) {
return new WordTokenizer() {
@Override
protected void startSentence(StringBuilder buffer, char ch) {
buffer.append(Character.toLowerCase(ch));
}
@Override
protected void startWord(StringBu... | [
"public",
"static",
"String",
"toCamelCase",
"(",
"String",
"str",
")",
"{",
"return",
"new",
"WordTokenizer",
"(",
")",
"{",
"@",
"Override",
"protected",
"void",
"startSentence",
"(",
"StringBuilder",
"buffer",
",",
"char",
"ch",
")",
"{",
"buffer",
".",
... | 将字符串转换成camel case。
<p>
如果字符串是<code>null</code>则返回<code>null</code>。
<p/>
<p/>
<pre>
StringUtil.toCamelCase(null) = null
StringUtil.toCamelCase("") = ""
StringUtil.toCamelCase("aBc") = "aBc"
StringUtil.toCamelCase("aBc def") = "aBcDef"
StringUtil.toCamelCase("aBc def_ghi") = "aBcDefGhi"
StringUtil.toCamelCase("aBc d... | [
"将字符串转换成camel",
"case。",
"<p",
">",
"如果字符串是<code",
">",
"null<",
"/",
"code",
">",
"则返回<code",
">",
"null<",
"/",
"code",
">",
"。",
"<p",
"/",
">",
"<p",
"/",
">",
"<pre",
">",
"StringUtil",
".",
"toCamelCase",
"(",
"null",
")",
"=",
"null",
"StringU... | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-client/src/main/java/com/baidu/disconf/client/support/utils/StringUtil.java#L167-L210 |
GistLabs/mechanize | src/main/java/com/gistlabs/mechanize/requestor/RequestBuilder.java | RequestBuilder.set | public RequestBuilder<Resource> set(final String name, final File file) {
"""
Adds a file to the request also making the request to become a multi-part post request or removes any file registered
under the given name if the file value is null.
"""
return set(name, file != null ? new FileBody(file) : null);
... | java | public RequestBuilder<Resource> set(final String name, final File file) {
return set(name, file != null ? new FileBody(file) : null);
} | [
"public",
"RequestBuilder",
"<",
"Resource",
">",
"set",
"(",
"final",
"String",
"name",
",",
"final",
"File",
"file",
")",
"{",
"return",
"set",
"(",
"name",
",",
"file",
"!=",
"null",
"?",
"new",
"FileBody",
"(",
"file",
")",
":",
"null",
")",
";",... | Adds a file to the request also making the request to become a multi-part post request or removes any file registered
under the given name if the file value is null. | [
"Adds",
"a",
"file",
"to",
"the",
"request",
"also",
"making",
"the",
"request",
"to",
"become",
"a",
"multi",
"-",
"part",
"post",
"request",
"or",
"removes",
"any",
"file",
"registered",
"under",
"the",
"given",
"name",
"if",
"the",
"file",
"value",
"i... | train | https://github.com/GistLabs/mechanize/blob/32ddd0774439a4c08513c05d7ac7416a3899efed/src/main/java/com/gistlabs/mechanize/requestor/RequestBuilder.java#L127-L129 |
astrapi69/jaulp-wicket | jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/panels/confirm/YesNoPanel.java | YesNoPanel.newNoButton | protected AjaxButton newNoButton(final String id) {
"""
Factory method for creating a new no {@link AjaxButton}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a no {@link AjaxButton}.
@param id
the id
@return the new {@link... | java | protected AjaxButton newNoButton(final String id)
{
final AjaxButton ajaxButton = new AjaxButton(id)
{
/**
* The serialVersionUID.
*/
private static final long serialVersionUID = 1L;
@Override
protected void onError(final AjaxRequestTarget target, final Form<?> form)
{
onNo(target, form... | [
"protected",
"AjaxButton",
"newNoButton",
"(",
"final",
"String",
"id",
")",
"{",
"final",
"AjaxButton",
"ajaxButton",
"=",
"new",
"AjaxButton",
"(",
"id",
")",
"{",
"/**\n\t\t\t * The serialVersionUID.\n\t\t\t */",
"private",
"static",
"final",
"long",
"serialVersion... | Factory method for creating a new no {@link AjaxButton}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a no {@link AjaxButton}.
@param id
the id
@return the new {@link AjaxButton} | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"no",
"{",
"@link",
"AjaxButton",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"pro... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/panels/confirm/YesNoPanel.java#L96-L121 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxrs.2.1.common/src/com/ibm/ws/jaxrs20/clientconfig/JAXRSClientConfigImpl.java | JAXRSClientConfigImpl.getURI | private String getURI(Map<String, Object> props) {
"""
find the uri parameter which we will key off of
@param props
@return value of uri param within props, or null if no uri param
"""
if (props == null)
return null;
if (props.keySet().contains(URI)) {
return (props.... | java | private String getURI(Map<String, Object> props) {
if (props == null)
return null;
if (props.keySet().contains(URI)) {
return (props.get(URI).toString());
} else {
return null;
}
} | [
"private",
"String",
"getURI",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"if",
"(",
"props",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"props",
".",
"keySet",
"(",
")",
".",
"contains",
"(",
"URI",
")",
")",
"{"... | find the uri parameter which we will key off of
@param props
@return value of uri param within props, or null if no uri param | [
"find",
"the",
"uri",
"parameter",
"which",
"we",
"will",
"key",
"off",
"of"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.1.common/src/com/ibm/ws/jaxrs20/clientconfig/JAXRSClientConfigImpl.java#L151-L159 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/locking/InMemoryLockMapImpl.java | InMemoryLockMapImpl.hasReadLock | public boolean hasReadLock(TransactionImpl tx, Object obj) {
"""
check if there is a reader lock entry for transaction tx on object obj
in the persistent storage.
"""
checkTimedOutLocks();
Identity oid = new Identity(obj,getBroker());
String oidString = oid.toString();
String t... | java | public boolean hasReadLock(TransactionImpl tx, Object obj)
{
checkTimedOutLocks();
Identity oid = new Identity(obj,getBroker());
String oidString = oid.toString();
String txGuid = tx.getGUID();
return hasReadLockInternal(oidString, txGuid);
} | [
"public",
"boolean",
"hasReadLock",
"(",
"TransactionImpl",
"tx",
",",
"Object",
"obj",
")",
"{",
"checkTimedOutLocks",
"(",
")",
";",
"Identity",
"oid",
"=",
"new",
"Identity",
"(",
"obj",
",",
"getBroker",
"(",
")",
")",
";",
"String",
"oidString",
"=",
... | check if there is a reader lock entry for transaction tx on object obj
in the persistent storage. | [
"check",
"if",
"there",
"is",
"a",
"reader",
"lock",
"entry",
"for",
"transaction",
"tx",
"on",
"object",
"obj",
"in",
"the",
"persistent",
"storage",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/locking/InMemoryLockMapImpl.java#L338-L346 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java | StructuredQueryBuilder.geospatialConstraint | public GeospatialConstraintQuery geospatialConstraint(String constraintName, Region... regions) {
"""
Matches the container specified by the constraint
whose geospatial point appears within one of the criteria regions.
@param constraintName the constraint definition
@param regions the possible regions con... | java | public GeospatialConstraintQuery geospatialConstraint(String constraintName, Region... regions) {
checkRegions(regions);
return new GeospatialConstraintQuery(constraintName, regions);
} | [
"public",
"GeospatialConstraintQuery",
"geospatialConstraint",
"(",
"String",
"constraintName",
",",
"Region",
"...",
"regions",
")",
"{",
"checkRegions",
"(",
"regions",
")",
";",
"return",
"new",
"GeospatialConstraintQuery",
"(",
"constraintName",
",",
"regions",
")... | Matches the container specified by the constraint
whose geospatial point appears within one of the criteria regions.
@param constraintName the constraint definition
@param regions the possible regions containing the point
@return the StructuredQueryDefinition for the geospatial constraint query | [
"Matches",
"the",
"container",
"specified",
"by",
"the",
"constraint",
"whose",
"geospatial",
"point",
"appears",
"within",
"one",
"of",
"the",
"criteria",
"regions",
"."
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L1091-L1094 |
filestack/filestack-android | filestack/src/main/java/com/filestack/android/internal/Util.java | Util.initializeClient | public static void initializeClient(Config config, String sessionToken) {
"""
Create the Java SDK client and set a session token. The token maintains cloud auth state.
"""
// Override returnUrl until introduction of FilestackUi class which will allow to set this
// all up manually.
Conf... | java | public static void initializeClient(Config config, String sessionToken) {
// Override returnUrl until introduction of FilestackUi class which will allow to set this
// all up manually.
Config overridenConfig = new Config(config.getApiKey(), "filestack://done",
config.getPolicy(),... | [
"public",
"static",
"void",
"initializeClient",
"(",
"Config",
"config",
",",
"String",
"sessionToken",
")",
"{",
"// Override returnUrl until introduction of FilestackUi class which will allow to set this",
"// all up manually.",
"Config",
"overridenConfig",
"=",
"new",
"Config"... | Create the Java SDK client and set a session token. The token maintains cloud auth state. | [
"Create",
"the",
"Java",
"SDK",
"client",
"and",
"set",
"a",
"session",
"token",
".",
"The",
"token",
"maintains",
"cloud",
"auth",
"state",
"."
] | train | https://github.com/filestack/filestack-android/blob/8dafa1cb5c77542c351d631be0742717b5a9d45d/filestack/src/main/java/com/filestack/android/internal/Util.java#L206-L214 |
spring-projects/spring-plugin | core/src/main/java/org/springframework/plugin/core/OrderAwarePluginRegistry.java | OrderAwarePluginRegistry.reverse | public OrderAwarePluginRegistry<T, S> reverse() {
"""
Returns a new {@link OrderAwarePluginRegistry} with the order of the plugins reverted.
@return
"""
List<T> copy = new ArrayList<>(getPlugins());
return of(copy, comparator.reversed());
} | java | public OrderAwarePluginRegistry<T, S> reverse() {
List<T> copy = new ArrayList<>(getPlugins());
return of(copy, comparator.reversed());
} | [
"public",
"OrderAwarePluginRegistry",
"<",
"T",
",",
"S",
">",
"reverse",
"(",
")",
"{",
"List",
"<",
"T",
">",
"copy",
"=",
"new",
"ArrayList",
"<>",
"(",
"getPlugins",
"(",
")",
")",
";",
"return",
"of",
"(",
"copy",
",",
"comparator",
".",
"revers... | Returns a new {@link OrderAwarePluginRegistry} with the order of the plugins reverted.
@return | [
"Returns",
"a",
"new",
"{",
"@link",
"OrderAwarePluginRegistry",
"}",
"with",
"the",
"order",
"of",
"the",
"plugins",
"reverted",
"."
] | train | https://github.com/spring-projects/spring-plugin/blob/953d2ce12f05f26444fbb3bf21011f538f729868/core/src/main/java/org/springframework/plugin/core/OrderAwarePluginRegistry.java#L226-L230 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmVisitor.java | XsdAsmVisitor.addVisitorAttributeMethod | private static void addVisitorAttributeMethod(ClassWriter classWriter, XsdAttribute attribute) {
"""
Adds a specific method for a visitAttribute call.
Example:
void visitAttributeManifest(String manifestValue){
visitAttribute("manifest", manifestValue);
}
@param classWriter The ElementVisitor class {@link Cla... | java | private static void addVisitorAttributeMethod(ClassWriter classWriter, XsdAttribute attribute) {
MethodVisitor mVisitor = classWriter.visitMethod(ACC_PUBLIC, VISIT_ATTRIBUTE_NAME + getCleanName(attribute.getName()), "(" + JAVA_STRING_DESC + ")V", null, null);
mVisitor.visitLocalVariable(firstToLower(get... | [
"private",
"static",
"void",
"addVisitorAttributeMethod",
"(",
"ClassWriter",
"classWriter",
",",
"XsdAttribute",
"attribute",
")",
"{",
"MethodVisitor",
"mVisitor",
"=",
"classWriter",
".",
"visitMethod",
"(",
"ACC_PUBLIC",
",",
"VISIT_ATTRIBUTE_NAME",
"+",
"getCleanNa... | Adds a specific method for a visitAttribute call.
Example:
void visitAttributeManifest(String manifestValue){
visitAttribute("manifest", manifestValue);
}
@param classWriter The ElementVisitor class {@link ClassWriter}.
@param attribute The specific attribute. | [
"Adds",
"a",
"specific",
"method",
"for",
"a",
"visitAttribute",
"call",
".",
"Example",
":",
"void",
"visitAttributeManifest",
"(",
"String",
"manifestValue",
")",
"{",
"visitAttribute",
"(",
"manifest",
"manifestValue",
")",
";",
"}"
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmVisitor.java#L107-L118 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUData.java | ICUData.getStream | static InputStream getStream(final ClassLoader loader, final String resourceName, boolean required) {
"""
Should be called only from ICUBinary.getData() or from convenience overloads here.
"""
InputStream i = null;
if (System.getSecurityManager() != null) {
i = AccessController.doPr... | java | static InputStream getStream(final ClassLoader loader, final String resourceName, boolean required) {
InputStream i = null;
if (System.getSecurityManager() != null) {
i = AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
@Override
pub... | [
"static",
"InputStream",
"getStream",
"(",
"final",
"ClassLoader",
"loader",
",",
"final",
"String",
"resourceName",
",",
"boolean",
"required",
")",
"{",
"InputStream",
"i",
"=",
"null",
";",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"!=",
"... | Should be called only from ICUBinary.getData() or from convenience overloads here. | [
"Should",
"be",
"called",
"only",
"from",
"ICUBinary",
".",
"getData",
"()",
"or",
"from",
"convenience",
"overloads",
"here",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUData.java#L144-L161 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeTraversal.java | NodeTraversal.traverseClass | private void traverseClass(Node n) {
"""
Traverses a class. Note that we traverse some of the child nodes slightly out of order to
ensure children are visited in the correct scope. The following children are in the outer
scope: (1) the 'extends' clause, (2) any computed method keys, (3) the class name for clas... | java | private void traverseClass(Node n) {
final Node className = n.getFirstChild();
final Node extendsClause = className.getNext();
final Node body = extendsClause.getNext();
boolean isClassExpression = NodeUtil.isClassExpression(n);
traverseBranch(extendsClause, n);
for (Node child = body.getFirs... | [
"private",
"void",
"traverseClass",
"(",
"Node",
"n",
")",
"{",
"final",
"Node",
"className",
"=",
"n",
".",
"getFirstChild",
"(",
")",
";",
"final",
"Node",
"extendsClause",
"=",
"className",
".",
"getNext",
"(",
")",
";",
"final",
"Node",
"body",
"=",
... | Traverses a class. Note that we traverse some of the child nodes slightly out of order to
ensure children are visited in the correct scope. The following children are in the outer
scope: (1) the 'extends' clause, (2) any computed method keys, (3) the class name for class
declarations only (class expression names are ... | [
"Traverses",
"a",
"class",
".",
"Note",
"that",
"we",
"traverse",
"some",
"of",
"the",
"child",
"nodes",
"slightly",
"out",
"of",
"order",
"to",
"ensure",
"children",
"are",
"visited",
"in",
"the",
"correct",
"scope",
".",
"The",
"following",
"children",
"... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeTraversal.java#L919-L954 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.getFloat | public float getFloat(String name, float defaultValue) {
"""
Returns the float value for the specified name. If the name does not
exist or the value for the name can not be interpreted as a float, the
defaultValue is returned.
@param name
@param defaultValue
@return name value or defaultValue
"""
... | java | public float getFloat(String name, float defaultValue) {
try {
String value = getString(name, null);
if (!StringUtils.isNullOrEmpty(value)) {
return Float.parseFloat(value.trim());
}
} catch (NumberFormatException e) {
log.warn("Failed to p... | [
"public",
"float",
"getFloat",
"(",
"String",
"name",
",",
"float",
"defaultValue",
")",
"{",
"try",
"{",
"String",
"value",
"=",
"getString",
"(",
"name",
",",
"null",
")",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"value",
")",
"... | Returns the float value for the specified name. If the name does not
exist or the value for the name can not be interpreted as a float, the
defaultValue is returned.
@param name
@param defaultValue
@return name value or defaultValue | [
"Returns",
"the",
"float",
"value",
"for",
"the",
"specified",
"name",
".",
"If",
"the",
"name",
"does",
"not",
"exist",
"or",
"the",
"value",
"for",
"the",
"name",
"can",
"not",
"be",
"interpreted",
"as",
"a",
"float",
"the",
"defaultValue",
"is",
"retu... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L541-L553 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointRequest.java | EndpointRequest.setAttributes | public void setAttributes(java.util.Map<String, java.util.List<String>> attributes) {
"""
Custom attributes that describe the endpoint by associating a name with an array of values. For example, an
attribute named "interests" might have the values ["science", "politics", "travel"]. You can use these attributes
a... | java | public void setAttributes(java.util.Map<String, java.util.List<String>> attributes) {
this.attributes = attributes;
} | [
"public",
"void",
"setAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"attributes",
")",
"{",
"this",
".",
"attributes",
"=",
"attributes",
";",
"}"
] | Custom attributes that describe the endpoint by associating a name with an array of values. For example, an
attribute named "interests" might have the values ["science", "politics", "travel"]. You can use these attributes
as selection criteria when you create a segment of users to engage with a messaging campaign.
The... | [
"Custom",
"attributes",
"that",
"describe",
"the",
"endpoint",
"by",
"associating",
"a",
"name",
"with",
"an",
"array",
"of",
"values",
".",
"For",
"example",
"an",
"attribute",
"named",
"interests",
"might",
"have",
"the",
"values",
"[",
"science",
"politics"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointRequest.java#L165-L167 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/Utils/SchemaHelper.java | SchemaHelper.deserialiseObject | static public Object deserialiseObject(String xml, String xsdFile, Class<?> objclass) throws JAXBException, SAXException, XMLStreamException {
"""
Attempt to construct the specified object from this XML string
@param xml the XML string to parse
@param xsdFile the name of the XSD schema that defines the object
@... | java | static public Object deserialiseObject(String xml, String xsdFile, Class<?> objclass) throws JAXBException, SAXException, XMLStreamException
{
Object obj = null;
JAXBContext jaxbContext = getJAXBContext(objclass);
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_S... | [
"static",
"public",
"Object",
"deserialiseObject",
"(",
"String",
"xml",
",",
"String",
"xsdFile",
",",
"Class",
"<",
"?",
">",
"objclass",
")",
"throws",
"JAXBException",
",",
"SAXException",
",",
"XMLStreamException",
"{",
"Object",
"obj",
"=",
"null",
";",
... | Attempt to construct the specified object from this XML string
@param xml the XML string to parse
@param xsdFile the name of the XSD schema that defines the object
@param objclass the class of the object requested
@return if successful, an instance of class objclass that captures the data in the XML string | [
"Attempt",
"to",
"construct",
"the",
"specified",
"object",
"from",
"this",
"XML",
"string"
] | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/SchemaHelper.java#L98-L118 |
enioka/jqm | jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/ResourceManagerBase.java | ResourceManagerBase.getStringParameter | protected String getStringParameter(String key, JobInstance ji, boolean pop) {
"""
Apply precedence rules for parameter value resolution: JI parameter using RM key > JI parameter using generic RM name without key >
JD > RM > defaults
@param key
the end of the parameter key. getParameterRoot()[.key] is automat... | java | protected String getStringParameter(String key, JobInstance ji, boolean pop)
{
// First try: parameter name with specific RM key.
String res = ji.getPrms().get(getParameterRoot() + this.key + "." + key);
if (res != null && pop)
{
ji.getPrms().remove(getParameterRoot() + t... | [
"protected",
"String",
"getStringParameter",
"(",
"String",
"key",
",",
"JobInstance",
"ji",
",",
"boolean",
"pop",
")",
"{",
"// First try: parameter name with specific RM key.",
"String",
"res",
"=",
"ji",
".",
"getPrms",
"(",
")",
".",
"get",
"(",
"getParameter... | Apply precedence rules for parameter value resolution: JI parameter using RM key > JI parameter using generic RM name without key >
JD > RM > defaults
@param key
the end of the parameter key. getParameterRoot()[.key] is automatically prefixed.
@param ji
the analysed job instance
@param pop
if true, parameter will be r... | [
"Apply",
"precedence",
"rules",
"for",
"parameter",
"value",
"resolution",
":",
"JI",
"parameter",
"using",
"RM",
"key",
">",
"JI",
"parameter",
"using",
"generic",
"RM",
"name",
"without",
"key",
">",
"JD",
">",
"RM",
">",
"defaults"
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/ResourceManagerBase.java#L118-L145 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/operator/aggregation/AccumulatorCompiler.java | AccumulatorCompiler.pushStackType | private static void pushStackType(Scope scope, BytecodeBlock block, Type sqlType, BytecodeBlock getBlockBytecode, Class<?> parameter, CallSiteBinder callSiteBinder) {
"""
Assumes that there is a variable named 'position' in the block, which is the current index
"""
Variable position = scope.getVariable... | java | private static void pushStackType(Scope scope, BytecodeBlock block, Type sqlType, BytecodeBlock getBlockBytecode, Class<?> parameter, CallSiteBinder callSiteBinder)
{
Variable position = scope.getVariable("position");
if (parameter == long.class) {
block.comment("%s.getLong(block, positi... | [
"private",
"static",
"void",
"pushStackType",
"(",
"Scope",
"scope",
",",
"BytecodeBlock",
"block",
",",
"Type",
"sqlType",
",",
"BytecodeBlock",
"getBlockBytecode",
",",
"Class",
"<",
"?",
">",
"parameter",
",",
"CallSiteBinder",
"callSiteBinder",
")",
"{",
"Va... | Assumes that there is a variable named 'position' in the block, which is the current index | [
"Assumes",
"that",
"there",
"is",
"a",
"variable",
"named",
"position",
"in",
"the",
"block",
"which",
"is",
"the",
"current",
"index"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/operator/aggregation/AccumulatorCompiler.java#L618-L656 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java | JacksonUtils.readJson | public static JsonNode readJson(String source, ClassLoader classLoader) {
"""
Read a JSON string and parse to {@link JsonNode} instance, with a custom class loader.
@param source
@param classLoader
@return
"""
return SerializationUtils.readJson(source, classLoader);
} | java | public static JsonNode readJson(String source, ClassLoader classLoader) {
return SerializationUtils.readJson(source, classLoader);
} | [
"public",
"static",
"JsonNode",
"readJson",
"(",
"String",
"source",
",",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"SerializationUtils",
".",
"readJson",
"(",
"source",
",",
"classLoader",
")",
";",
"}"
] | Read a JSON string and parse to {@link JsonNode} instance, with a custom class loader.
@param source
@param classLoader
@return | [
"Read",
"a",
"JSON",
"string",
"and",
"parse",
"to",
"{",
"@link",
"JsonNode",
"}",
"instance",
"with",
"a",
"custom",
"class",
"loader",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java#L117-L119 |
actorapp/actor-platform | actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java | MarkdownParser.handleTextBlock | private void handleTextBlock(TextCursor cursor, int blockEnd, ArrayList<MDSection> paragraphs) {
"""
Processing text blocks between code blocks
@param cursor text cursor
@param blockEnd text block end
@param paragraphs current paragraphs
"""
MDText[] spans = handleSpans(cursor, blockEnd);
... | java | private void handleTextBlock(TextCursor cursor, int blockEnd, ArrayList<MDSection> paragraphs) {
MDText[] spans = handleSpans(cursor, blockEnd);
paragraphs.add(new MDSection(spans));
cursor.currentOffset = blockEnd;
} | [
"private",
"void",
"handleTextBlock",
"(",
"TextCursor",
"cursor",
",",
"int",
"blockEnd",
",",
"ArrayList",
"<",
"MDSection",
">",
"paragraphs",
")",
"{",
"MDText",
"[",
"]",
"spans",
"=",
"handleSpans",
"(",
"cursor",
",",
"blockEnd",
")",
";",
"paragraphs... | Processing text blocks between code blocks
@param cursor text cursor
@param blockEnd text block end
@param paragraphs current paragraphs | [
"Processing",
"text",
"blocks",
"between",
"code",
"blocks"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java#L85-L89 |
upwork/java-upwork | src/com/Upwork/api/Routers/Reports/Time.java | Time.getByTeamLimited | public JSONObject getByTeamLimited(String company, String team, HashMap<String, String> params) throws JSONException {
"""
Generate Time Reports for a Specific Team (hide financial info)
@param company Company ID
@param team Team ID
@param params Parameters
@throws JSONException If error occurred
@ret... | java | public JSONObject getByTeamLimited(String company, String team, HashMap<String, String> params) throws JSONException {
return _getByType(company, team, null, params, true);
} | [
"public",
"JSONObject",
"getByTeamLimited",
"(",
"String",
"company",
",",
"String",
"team",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"_getByType",
"(",
"company",
",",
"team",
",",
"null",
"... | Generate Time Reports for a Specific Team (hide financial info)
@param company Company ID
@param team Team ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Generate",
"Time",
"Reports",
"for",
"a",
"Specific",
"Team",
"(",
"hide",
"financial",
"info",
")"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Reports/Time.java#L93-L95 |
fcrepo3/fcrepo | fcrepo-common/src/main/java/org/fcrepo/utilities/DateUtility.java | DateUtility.convertDateToString | public static String convertDateToString(Date date, boolean millis) {
"""
Converts an instance of java.util.Date into an ISO 8601 String
representation. Uses the date format yyyy-MM-ddTHH:mm:ss.SSSZ or
yyyy-MM-ddTHH:mm:ssZ, depending on whether millisecond precision is
desired.
@param date
Instance of java.... | java | public static String convertDateToString(Date date, boolean millis) {
if (date == null) {
return null;
} else {
DateTimeFormatter df;
if (millis) {
// df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
df = FORMATTER_MILLISECONDS_T_Z;
} else {
// df = new SimpleDateFormat("yyyy-MM-dd... | [
"public",
"static",
"String",
"convertDateToString",
"(",
"Date",
"date",
",",
"boolean",
"millis",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"DateTimeFormatter",
"df",
";",
"if",
"(",
"millis",
")",
... | Converts an instance of java.util.Date into an ISO 8601 String
representation. Uses the date format yyyy-MM-ddTHH:mm:ss.SSSZ or
yyyy-MM-ddTHH:mm:ssZ, depending on whether millisecond precision is
desired.
@param date
Instance of java.util.Date.
@param millis
Whether or not the return value should include milliseconds.... | [
"Converts",
"an",
"instance",
"of",
"java",
".",
"util",
".",
"Date",
"into",
"an",
"ISO",
"8601",
"String",
"representation",
".",
"Uses",
"the",
"date",
"format",
"yyyy",
"-",
"MM",
"-",
"ddTHH",
":",
"mm",
":",
"ss",
".",
"SSSZ",
"or",
"yyyy",
"-"... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/utilities/DateUtility.java#L87-L102 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/text/StartWithMatcher.java | StartWithMatcher.getLastAcceptedState | protected int getLastAcceptedState(CharSequence text, int startIndex) {
"""
By utilizing the state machine (dk.brics.automaton.RunAutomaton), get the last accepted matching state.
The matching test starts at specified position.<br>
利用状态机(dk.brics.automaton.RunAutomaton),取得最后一个匹配到的状态。从指定位置开始进行匹配检查。
@param text... | java | protected int getLastAcceptedState(CharSequence text, int startIndex){
int lastAcceptedState = -1;
int p = runAutomaton.getInitialState();
int l = text.length();
for (int i = startIndex; i < l; i++) {
p = runAutomaton.step(p, text.charAt(i));
if (p == -1) {
if (lastAcceptedState == -1){
... | [
"protected",
"int",
"getLastAcceptedState",
"(",
"CharSequence",
"text",
",",
"int",
"startIndex",
")",
"{",
"int",
"lastAcceptedState",
"=",
"-",
"1",
";",
"int",
"p",
"=",
"runAutomaton",
".",
"getInitialState",
"(",
")",
";",
"int",
"l",
"=",
"text",
".... | By utilizing the state machine (dk.brics.automaton.RunAutomaton), get the last accepted matching state.
The matching test starts at specified position.<br>
利用状态机(dk.brics.automaton.RunAutomaton),取得最后一个匹配到的状态。从指定位置开始进行匹配检查。
@param text The text to be tested.<br>待进行匹配检查的文本。
@param startIndex The position to start ma... | [
"By",
"utilizing",
"the",
"state",
"machine",
"(",
"dk",
".",
"brics",
".",
"automaton",
".",
"RunAutomaton",
")",
"get",
"the",
"last",
"accepted",
"matching",
"state",
".",
"The",
"matching",
"test",
"starts",
"at",
"specified",
"position",
".",
"<br",
"... | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/text/StartWithMatcher.java#L216-L235 |
ldapchai/ldapchai | src/main/java/com/novell/ldapchai/provider/ChaiConfiguration.java | ChaiConfiguration.newConfiguration | public static ChaiConfiguration newConfiguration(
final List<String> ldapURLs,
final String bindDN,
final String bindPassword
) {
"""
Construct a default {@code ChaiConfiguration}.
@param bindDN ldap bind DN, in ldap fully qualified syntax. Also used as the DN of t... | java | public static ChaiConfiguration newConfiguration(
final List<String> ldapURLs,
final String bindDN,
final String bindPassword
)
{
return new ChaiConfigurationBuilder( ldapURLs, bindDN, bindPassword ).build();
} | [
"public",
"static",
"ChaiConfiguration",
"newConfiguration",
"(",
"final",
"List",
"<",
"String",
">",
"ldapURLs",
",",
"final",
"String",
"bindDN",
",",
"final",
"String",
"bindPassword",
")",
"{",
"return",
"new",
"ChaiConfigurationBuilder",
"(",
"ldapURLs",
","... | Construct a default {@code ChaiConfiguration}.
@param bindDN ldap bind DN, in ldap fully qualified syntax. Also used as the DN of the returned ChaiUser.
@param bindPassword password for the bind DN.
@param ldapURLs ldap server and port in url format, example: <i>ldap://127.0.0.1:389</i>
@return A new {@cod... | [
"Construct",
"a",
"default",
"{",
"@code",
"ChaiConfiguration",
"}",
"."
] | train | https://github.com/ldapchai/ldapchai/blob/a6d4b5dbfa4e270db0ce70892512cbe39e64b874/src/main/java/com/novell/ldapchai/provider/ChaiConfiguration.java#L94-L101 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.inclusiveBetween | public long inclusiveBetween(long start, long end, long value, String message) {
"""
Validate that the specified primitive value falls between the two inclusive values specified; otherwise, throws an exception with the specified message.
<pre>Validate.inclusiveBetween(0, 2, 1, "Not in range");</pre>
@param sta... | java | public long inclusiveBetween(long start, long end, long value, String message) {
if (value < start || value > end) {
fail(message);
}
return value;
} | [
"public",
"long",
"inclusiveBetween",
"(",
"long",
"start",
",",
"long",
"end",
",",
"long",
"value",
",",
"String",
"message",
")",
"{",
"if",
"(",
"value",
"<",
"start",
"||",
"value",
">",
"end",
")",
"{",
"fail",
"(",
"message",
")",
";",
"}",
... | Validate that the specified primitive value falls between the two inclusive values specified; otherwise, throws an exception with the specified message.
<pre>Validate.inclusiveBetween(0, 2, 1, "Not in range");</pre>
@param start
the inclusive start value
@param end
the inclusive end value
@param value
the value to val... | [
"Validate",
"that",
"the",
"specified",
"primitive",
"value",
"falls",
"between",
"the",
"two",
"inclusive",
"values",
"specified",
";",
"otherwise",
"throws",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"<pre",
">",
"Validate",
".",
"inclusiv... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L1308-L1313 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/RandomCompat.java | RandomCompat.doubles | @NotNull
public DoubleStream doubles(final double randomNumberOrigin, final double randomNumberBound) {
"""
Returns an effectively unlimited stream of pseudorandom {@code double}
values, each conforming to the given origin (inclusive) and bound (exclusive)
@param randomNumberOrigin the origin (inclusive) ... | java | @NotNull
public DoubleStream doubles(final double randomNumberOrigin, final double randomNumberBound) {
if (randomNumberOrigin >= randomNumberBound) {
throw new IllegalArgumentException();
}
return DoubleStream.generate(new DoubleSupplier() {
private final double bou... | [
"@",
"NotNull",
"public",
"DoubleStream",
"doubles",
"(",
"final",
"double",
"randomNumberOrigin",
",",
"final",
"double",
"randomNumberBound",
")",
"{",
"if",
"(",
"randomNumberOrigin",
">=",
"randomNumberBound",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Returns an effectively unlimited stream of pseudorandom {@code double}
values, each conforming to the given origin (inclusive) and bound (exclusive)
@param randomNumberOrigin the origin (inclusive) of each random value
@param randomNumberBound the bound (exclusive) of each random value
@return a stream of pseudorand... | [
"Returns",
"an",
"effectively",
"unlimited",
"stream",
"of",
"pseudorandom",
"{",
"@code",
"double",
"}",
"values",
"each",
"conforming",
"to",
"the",
"given",
"origin",
"(",
"inclusive",
")",
"and",
"bound",
"(",
"exclusive",
")"
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/RandomCompat.java#L338-L356 |
autermann/yaml | src/main/java/com/github/autermann/yaml/nodes/YamlMappingNode.java | YamlMappingNode.put | public T put(YamlNode key, boolean value) {
"""
Adds the specified {@code key}/{@code value} pair to this mapping.
@param key the key
@param value the value
@return {@code this}
"""
return put(key, getNodeFactory().booleanNode(value));
} | java | public T put(YamlNode key, boolean value) {
return put(key, getNodeFactory().booleanNode(value));
} | [
"public",
"T",
"put",
"(",
"YamlNode",
"key",
",",
"boolean",
"value",
")",
"{",
"return",
"put",
"(",
"key",
",",
"getNodeFactory",
"(",
")",
".",
"booleanNode",
"(",
"value",
")",
")",
";",
"}"
] | Adds the specified {@code key}/{@code value} pair to this mapping.
@param key the key
@param value the value
@return {@code this} | [
"Adds",
"the",
"specified",
"{",
"@code",
"key",
"}",
"/",
"{",
"@code",
"value",
"}",
"pair",
"to",
"this",
"mapping",
"."
] | train | https://github.com/autermann/yaml/blob/5f8ab03e4fec3a2abe72c03561cdaa3a3936634d/src/main/java/com/github/autermann/yaml/nodes/YamlMappingNode.java#L324-L326 |
rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.formatCurrency | public static String formatCurrency(ITemplate template, Object data, String currencyCode) {
"""
Transformer method. Format currency using specified parameters
@param template
@param data
@param currencyCode
@return the currency string
See {@link #formatCurrency(org.rythmengine.template.ITemplate, Object, Stri... | java | public static String formatCurrency(ITemplate template, Object data, String currencyCode) {
return formatCurrency(template, data, currencyCode, null);
} | [
"public",
"static",
"String",
"formatCurrency",
"(",
"ITemplate",
"template",
",",
"Object",
"data",
",",
"String",
"currencyCode",
")",
"{",
"return",
"formatCurrency",
"(",
"template",
",",
"data",
",",
"currencyCode",
",",
"null",
")",
";",
"}"
] | Transformer method. Format currency using specified parameters
@param template
@param data
@param currencyCode
@return the currency string
See {@link #formatCurrency(org.rythmengine.template.ITemplate, Object, String, java.util.Locale)} | [
"Transformer",
"method",
".",
"Format",
"currency",
"using",
"specified",
"parameters"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1482-L1484 |
prestodb/presto | presto-orc/src/main/java/com/facebook/presto/orc/reader/MapFlatStreamReader.java | MapFlatStreamReader.copyStreamDescriptorWithSequence | private static StreamDescriptor copyStreamDescriptorWithSequence(StreamDescriptor streamDescriptor, int sequence) {
"""
Creates StreamDescriptor which is a copy of this one with the value of sequence changed to
the value passed in. Recursively calls itself on the nested streams.
"""
List<StreamDescri... | java | private static StreamDescriptor copyStreamDescriptorWithSequence(StreamDescriptor streamDescriptor, int sequence)
{
List<StreamDescriptor> streamDescriptors = streamDescriptor.getNestedStreams().stream()
.map(stream -> copyStreamDescriptorWithSequence(stream, sequence))
.coll... | [
"private",
"static",
"StreamDescriptor",
"copyStreamDescriptorWithSequence",
"(",
"StreamDescriptor",
"streamDescriptor",
",",
"int",
"sequence",
")",
"{",
"List",
"<",
"StreamDescriptor",
">",
"streamDescriptors",
"=",
"streamDescriptor",
".",
"getNestedStreams",
"(",
")... | Creates StreamDescriptor which is a copy of this one with the value of sequence changed to
the value passed in. Recursively calls itself on the nested streams. | [
"Creates",
"StreamDescriptor",
"which",
"is",
"a",
"copy",
"of",
"this",
"one",
"with",
"the",
"value",
"of",
"sequence",
"changed",
"to",
"the",
"value",
"passed",
"in",
".",
"Recursively",
"calls",
"itself",
"on",
"the",
"nested",
"streams",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-orc/src/main/java/com/facebook/presto/orc/reader/MapFlatStreamReader.java#L263-L277 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.getCurrentActivity | public Activity getCurrentActivity(boolean shouldSleepFirst, boolean waitForActivity) {
"""
Returns the current {@code Activity}.
@param shouldSleepFirst whether to sleep a default pause first
@param waitForActivity whether to wait for the activity
@return the current {@code Activity}
"""
if(shouldSleep... | java | public Activity getCurrentActivity(boolean shouldSleepFirst, boolean waitForActivity) {
if(shouldSleepFirst){
sleeper.sleep();
}
if(!config.trackActivities){
return activity;
}
if(waitForActivity){
waitForActivityIfNotAvailable();
}
if(!activityStack.isEmpty()){
activity=activityStack.peek(... | [
"public",
"Activity",
"getCurrentActivity",
"(",
"boolean",
"shouldSleepFirst",
",",
"boolean",
"waitForActivity",
")",
"{",
"if",
"(",
"shouldSleepFirst",
")",
"{",
"sleeper",
".",
"sleep",
"(",
")",
";",
"}",
"if",
"(",
"!",
"config",
".",
"trackActivities",... | Returns the current {@code Activity}.
@param shouldSleepFirst whether to sleep a default pause first
@param waitForActivity whether to wait for the activity
@return the current {@code Activity} | [
"Returns",
"the",
"current",
"{",
"@code",
"Activity",
"}",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L295-L310 |
calimero-project/calimero-core | src/tuwien/auto/calimero/knxnetip/ConnectionBase.java | ConnectionBase.checkChannelId | protected boolean checkChannelId(final int id, final String svcType) {
"""
Validates channel id received in a packet against the one assigned to this connection.
@param id received id to check
@param svcType packet service type
@return <code>true</code> if valid, <code>false</code> otherwise
"""
if (id ... | java | protected boolean checkChannelId(final int id, final String svcType)
{
if (id == channelId)
return true;
logger.warn("received service " + svcType + " with wrong channel ID " + id + ", expected " + channelId
+ " - ignored");
return false;
} | [
"protected",
"boolean",
"checkChannelId",
"(",
"final",
"int",
"id",
",",
"final",
"String",
"svcType",
")",
"{",
"if",
"(",
"id",
"==",
"channelId",
")",
"return",
"true",
";",
"logger",
".",
"warn",
"(",
"\"received service \"",
"+",
"svcType",
"+",
"\" ... | Validates channel id received in a packet against the one assigned to this connection.
@param id received id to check
@param svcType packet service type
@return <code>true</code> if valid, <code>false</code> otherwise | [
"Validates",
"channel",
"id",
"received",
"in",
"a",
"packet",
"against",
"the",
"one",
"assigned",
"to",
"this",
"connection",
"."
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/ConnectionBase.java#L487-L494 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/HttpUtils.java | HttpUtils.buildEtagHash | public static String buildEtagHash(final String identifier, final Instant modified, final Prefer prefer) {
"""
Build a hash value suitable for generating an ETag.
@param identifier the resource identifier
@param modified the last modified value
@param prefer a prefer header, may be null
@return a corresponding... | java | public static String buildEtagHash(final String identifier, final Instant modified, final Prefer prefer) {
final String sep = ".";
final String hash = prefer != null ? prefer.getInclude().hashCode() + sep + prefer.getOmit().hashCode() : "";
return md5Hex(modified.toEpochMilli() + sep + modified.... | [
"public",
"static",
"String",
"buildEtagHash",
"(",
"final",
"String",
"identifier",
",",
"final",
"Instant",
"modified",
",",
"final",
"Prefer",
"prefer",
")",
"{",
"final",
"String",
"sep",
"=",
"\".\"",
";",
"final",
"String",
"hash",
"=",
"prefer",
"!=",... | Build a hash value suitable for generating an ETag.
@param identifier the resource identifier
@param modified the last modified value
@param prefer a prefer header, may be null
@return a corresponding hash value | [
"Build",
"a",
"hash",
"value",
"suitable",
"for",
"generating",
"an",
"ETag",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/HttpUtils.java#L113-L117 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMPreParser.java | OSMPreParser.startElement | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
"""
Fires whenever an XML start markup is encountered. It indicates which
version of osm file is to be parsed.
@param uri URI of the local element
@param localName Name of the local ... | java | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (localName.compareToIgnoreCase("osm") == 0) {
version = attributes.getValue(GPXTags.VERSION);
} else if (localName.compareToIgnoreCase("node") == 0) {
... | [
"@",
"Override",
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"attributes",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"localName",
".",
"compareToIgnoreCase",
"(",
"\"osm\"",
... | Fires whenever an XML start markup is encountered. It indicates which
version of osm file is to be parsed.
@param uri URI of the local element
@param localName Name of the local element (without prefix)
@param qName qName of the local element (with prefix)
@param attributes Attributes of the local element (contained i... | [
"Fires",
"whenever",
"an",
"XML",
"start",
"markup",
"is",
"encountered",
".",
"It",
"indicates",
"which",
"version",
"of",
"osm",
"file",
"is",
"to",
"be",
"parsed",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMPreParser.java#L92-L103 |
EdwardRaff/JSAT | JSAT/src/jsat/DataSet.java | DataSet.cvSet | public List<Type> cvSet(int folds, Random rand) {
"""
Creates <tt>folds</tt> data sets that contain data from this data set.
The data points in each set will be random. These are meant for cross
validation
@param folds the number of cross validation sets to create. Should be greater then 1
@param rand the so... | java | public List<Type> cvSet(int folds, Random rand)
{
double[] splits = new double[folds];
Arrays.fill(splits, 1.0/folds);
return randomSplit(rand, splits);
} | [
"public",
"List",
"<",
"Type",
">",
"cvSet",
"(",
"int",
"folds",
",",
"Random",
"rand",
")",
"{",
"double",
"[",
"]",
"splits",
"=",
"new",
"double",
"[",
"folds",
"]",
";",
"Arrays",
".",
"fill",
"(",
"splits",
",",
"1.0",
"/",
"folds",
")",
";... | Creates <tt>folds</tt> data sets that contain data from this data set.
The data points in each set will be random. These are meant for cross
validation
@param folds the number of cross validation sets to create. Should be greater then 1
@param rand the source of randomness
@return the list of data sets. | [
"Creates",
"<tt",
">",
"folds<",
"/",
"tt",
">",
"data",
"sets",
"that",
"contain",
"data",
"from",
"this",
"data",
"set",
".",
"The",
"data",
"points",
"in",
"each",
"set",
"will",
"be",
"random",
".",
"These",
"are",
"meant",
"for",
"cross",
"validat... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/DataSet.java#L580-L585 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritQueryHandler.java | GerritQueryHandler.queryJava | public List<JSONObject> queryJava(String queryString, boolean getPatchSets, boolean getCurrentPatchSet,
boolean getFiles) throws SshException, IOException, GerritQueryException {
"""
Runs the query and returns the result as a list of Java JSONObjects.
@param queryString the q... | java | public List<JSONObject> queryJava(String queryString, boolean getPatchSets, boolean getCurrentPatchSet,
boolean getFiles) throws SshException, IOException, GerritQueryException {
return queryJava(queryString, getPatchSets, getCurrentPatchSet, getFiles, false);
} | [
"public",
"List",
"<",
"JSONObject",
">",
"queryJava",
"(",
"String",
"queryString",
",",
"boolean",
"getPatchSets",
",",
"boolean",
"getCurrentPatchSet",
",",
"boolean",
"getFiles",
")",
"throws",
"SshException",
",",
"IOException",
",",
"GerritQueryException",
"{"... | Runs the query and returns the result as a list of Java JSONObjects.
@param queryString the query.
@param getPatchSets getPatchSets if all patch-sets of the projects found should be included in the result.
Meaning if --patch-sets should be appended to the command call.
@param getCurrentPatchSet if the current patch-set... | [
"Runs",
"the",
"query",
"and",
"returns",
"the",
"result",
"as",
"a",
"list",
"of",
"Java",
"JSONObjects",
".",
"@param",
"queryString",
"the",
"query",
".",
"@param",
"getPatchSets",
"getPatchSets",
"if",
"all",
"patch",
"-",
"sets",
"of",
"the",
"projects"... | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritQueryHandler.java#L156-L159 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.setErrorCodeVariableOnErrorEventDefinition | protected void setErrorCodeVariableOnErrorEventDefinition(Element errorEventDefinition, ErrorEventDefinition definition) {
"""
Sets the value for "camunda:errorCodeVariable" on the passed definition if
it's present.
@param errorEventDefinition
the XML errorEventDefinition tag
@param definition
the errorEven... | java | protected void setErrorCodeVariableOnErrorEventDefinition(Element errorEventDefinition, ErrorEventDefinition definition) {
String errorCodeVar = errorEventDefinition.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "errorCodeVariable");
if (errorCodeVar != null) {
definition.setErrorCodeVariable(errorCodeVar);
... | [
"protected",
"void",
"setErrorCodeVariableOnErrorEventDefinition",
"(",
"Element",
"errorEventDefinition",
",",
"ErrorEventDefinition",
"definition",
")",
"{",
"String",
"errorCodeVar",
"=",
"errorEventDefinition",
".",
"attributeNS",
"(",
"CAMUNDA_BPMN_EXTENSIONS_NS",
",",
"... | Sets the value for "camunda:errorCodeVariable" on the passed definition if
it's present.
@param errorEventDefinition
the XML errorEventDefinition tag
@param definition
the errorEventDefintion that can get the errorCodeVariable value | [
"Sets",
"the",
"value",
"for",
"camunda",
":",
"errorCodeVariable",
"on",
"the",
"passed",
"definition",
"if",
"it",
"s",
"present",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1122-L1127 |
gallandarakhneorg/afc | advanced/shapefile/src/main/java/org/arakhne/afc/io/shape/ShapeFileIndexReader.java | ShapeFileIndexReader.seek | @Override
public void seek(int recordIndex) throws IOException {
"""
Move the reading head at the specified record index.
<p>If the index is negative, the next record to read is assumed to be
the first record.
If the index is greater or equals to the count of records, the exception
{@link EOFException} will... | java | @Override
public void seek(int recordIndex) throws IOException {
readHeader();
int ri = recordIndex;
if (ri < 0) {
ri = 0;
}
if (ri >= this.recordCount) {
throw new EOFException();
}
// Goto the record
setReadingPosition(recordIndex, RECORD_SIZE * ri);
} | [
"@",
"Override",
"public",
"void",
"seek",
"(",
"int",
"recordIndex",
")",
"throws",
"IOException",
"{",
"readHeader",
"(",
")",
";",
"int",
"ri",
"=",
"recordIndex",
";",
"if",
"(",
"ri",
"<",
"0",
")",
"{",
"ri",
"=",
"0",
";",
"}",
"if",
"(",
... | Move the reading head at the specified record index.
<p>If the index is negative, the next record to read is assumed to be
the first record.
If the index is greater or equals to the count of records, the exception
{@link EOFException} will be thrown.
@param recordIndex is the index of record to reply at the next read... | [
"Move",
"the",
"reading",
"head",
"at",
"the",
"specified",
"record",
"index",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/shapefile/src/main/java/org/arakhne/afc/io/shape/ShapeFileIndexReader.java#L116-L129 |
danieldk/dictomaton | src/main/java/eu/danieldk/dictomaton/CompactIntArray.java | CompactIntArray.binarySearch | public int binarySearch(int fromIndex, int toIndex, int value) {
"""
Search a value in the array, the subarray <i>(fromIndex, toIndex]</i> should be sorted.
@param fromIndex The index of the first element to be searched.
@param toIndex The index of the last element to be searched (exclusive).
@param value The v... | java | public int binarySearch(int fromIndex, int toIndex, int value)
{
--toIndex;
while (toIndex >= fromIndex)
{
int mid = (fromIndex + toIndex) >>> 1;
int midVal = get(mid);
if (midVal > value)
toIndex = mid - 1;
else if (midVal < ... | [
"public",
"int",
"binarySearch",
"(",
"int",
"fromIndex",
",",
"int",
"toIndex",
",",
"int",
"value",
")",
"{",
"--",
"toIndex",
";",
"while",
"(",
"toIndex",
">=",
"fromIndex",
")",
"{",
"int",
"mid",
"=",
"(",
"fromIndex",
"+",
"toIndex",
")",
">>>",... | Search a value in the array, the subarray <i>(fromIndex, toIndex]</i> should be sorted.
@param fromIndex The index of the first element to be searched.
@param toIndex The index of the last element to be searched (exclusive).
@param value The value to be searched.
@return | [
"Search",
"a",
"value",
"in",
"the",
"array",
"the",
"subarray",
"<i",
">",
"(",
"fromIndex",
"toIndex",
"]",
"<",
"/",
"i",
">",
"should",
"be",
"sorted",
"."
] | train | https://github.com/danieldk/dictomaton/blob/c0a3ae2d407ebd88023ea2d0f02a4882b0492df0/src/main/java/eu/danieldk/dictomaton/CompactIntArray.java#L64-L82 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.getHybridConnection | public HybridConnectionInner getHybridConnection(String resourceGroupName, String name, String namespaceName, String relayName) {
"""
Retrieve a Hybrid Connection in use in an App Service plan.
Retrieve a Hybrid Connection in use in an App Service plan.
@param resourceGroupName Name of the resource group to wh... | java | public HybridConnectionInner getHybridConnection(String resourceGroupName, String name, String namespaceName, String relayName) {
return getHybridConnectionWithServiceResponseAsync(resourceGroupName, name, namespaceName, relayName).toBlocking().single().body();
} | [
"public",
"HybridConnectionInner",
"getHybridConnection",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"namespaceName",
",",
"String",
"relayName",
")",
"{",
"return",
"getHybridConnectionWithServiceResponseAsync",
"(",
"resourceGroupName",
",",... | Retrieve a Hybrid Connection in use in an App Service plan.
Retrieve a Hybrid Connection in use in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param namespaceName Name of the Service Bus namespace.
@param relayName N... | [
"Retrieve",
"a",
"Hybrid",
"Connection",
"in",
"use",
"in",
"an",
"App",
"Service",
"plan",
".",
"Retrieve",
"a",
"Hybrid",
"Connection",
"in",
"use",
"in",
"an",
"App",
"Service",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L1135-L1137 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.getAt | public static String getAt(CharSequence self, Collection indices) {
"""
Select a List of characters from a CharSequence using a Collection
to identify the indices to be selected.
@param self a CharSequence
@param indices a Collection of indices
@return a String consisting of the characters at the given in... | java | public static String getAt(CharSequence self, Collection indices) {
StringBuilder answer = new StringBuilder();
for (Object value : indices) {
if (value instanceof Range) {
answer.append(getAt(self, (Range) value));
} else if (value instanceof Collection) {
... | [
"public",
"static",
"String",
"getAt",
"(",
"CharSequence",
"self",
",",
"Collection",
"indices",
")",
"{",
"StringBuilder",
"answer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Object",
"value",
":",
"indices",
")",
"{",
"if",
"(",
"value",
... | Select a List of characters from a CharSequence using a Collection
to identify the indices to be selected.
@param self a CharSequence
@param indices a Collection of indices
@return a String consisting of the characters at the given indices
@since 1.0 | [
"Select",
"a",
"List",
"of",
"characters",
"from",
"a",
"CharSequence",
"using",
"a",
"Collection",
"to",
"identify",
"the",
"indices",
"to",
"be",
"selected",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L1205-L1218 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F5.andThen | public F5<P1, P2, P3, P4, P5, R> andThen(
final Func5<? super P1, ? super P2, ? super P3, ? super P4, ? super P5, ? extends R>... fs
) {
"""
Returns a composed function that applied, in sequence, this function and
all functions specified one by one. If applying anyone of the functions
thr... | java | public F5<P1, P2, P3, P4, P5, R> andThen(
final Func5<? super P1, ? super P2, ? super P3, ? super P4, ? super P5, ? extends R>... fs
) {
if (0 == fs.length) {
return this;
}
final F5<P1, P2, P3, P4, P5, R> me = this;
return new F5<... | [
"public",
"F5",
"<",
"P1",
",",
"P2",
",",
"P3",
",",
"P4",
",",
"P5",
",",
"R",
">",
"andThen",
"(",
"final",
"Func5",
"<",
"?",
"super",
"P1",
",",
"?",
"super",
"P2",
",",
"?",
"super",
"P3",
",",
"?",
"super",
"P4",
",",
"?",
"super",
"... | Returns a composed function that applied, in sequence, this function and
all functions specified one by one. If applying anyone of the functions
throws an exception, it is relayed to the caller of the composed function.
If an exception is thrown out, the following functions will not be applied.
<p>When apply the compos... | [
"Returns",
"a",
"composed",
"function",
"that",
"applied",
"in",
"sequence",
"this",
"function",
"and",
"all",
"functions",
"specified",
"one",
"by",
"one",
".",
"If",
"applying",
"anyone",
"of",
"the",
"functions",
"throws",
"an",
"exception",
"it",
"is",
"... | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1890-L1908 |
UrielCh/ovh-java-sdk | ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java | ApiOvhCaasregistry.serviceName_namespaces_namespaceId_GET | public OvhNamespace serviceName_namespaces_namespaceId_GET(String serviceName, String namespaceId) throws IOException {
"""
Inspect namespace
REST: GET /caas/registry/{serviceName}/namespaces/{namespaceId}
@param namespaceId [required] Namespace id
@param serviceName [required] Service name
API beta
""... | java | public OvhNamespace serviceName_namespaces_namespaceId_GET(String serviceName, String namespaceId) throws IOException {
String qPath = "/caas/registry/{serviceName}/namespaces/{namespaceId}";
StringBuilder sb = path(qPath, serviceName, namespaceId);
String resp = exec(qPath, "GET", sb.toString(), null);
return ... | [
"public",
"OvhNamespace",
"serviceName_namespaces_namespaceId_GET",
"(",
"String",
"serviceName",
",",
"String",
"namespaceId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/caas/registry/{serviceName}/namespaces/{namespaceId}\"",
";",
"StringBuilder",
"sb",
... | Inspect namespace
REST: GET /caas/registry/{serviceName}/namespaces/{namespaceId}
@param namespaceId [required] Namespace id
@param serviceName [required] Service name
API beta | [
"Inspect",
"namespace"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java#L387-L392 |
yanzhenjie/AndPermission | support/src/main/java/com/yanzhenjie/permission/AndPermission.java | AndPermission.hasAlwaysDeniedPermission | public static boolean hasAlwaysDeniedPermission(Context context, List<String> deniedPermissions) {
"""
Some privileges permanently disabled, may need to set up in the execute.
@param context {@link Context}.
@param deniedPermissions one or more permissions.
@return true, other wise is false.
"""
... | java | public static boolean hasAlwaysDeniedPermission(Context context, List<String> deniedPermissions) {
return hasAlwaysDeniedPermission(getContextSource(context), deniedPermissions);
} | [
"public",
"static",
"boolean",
"hasAlwaysDeniedPermission",
"(",
"Context",
"context",
",",
"List",
"<",
"String",
">",
"deniedPermissions",
")",
"{",
"return",
"hasAlwaysDeniedPermission",
"(",
"getContextSource",
"(",
"context",
")",
",",
"deniedPermissions",
")",
... | Some privileges permanently disabled, may need to set up in the execute.
@param context {@link Context}.
@param deniedPermissions one or more permissions.
@return true, other wise is false. | [
"Some",
"privileges",
"permanently",
"disabled",
"may",
"need",
"to",
"set",
"up",
"in",
"the",
"execute",
"."
] | train | https://github.com/yanzhenjie/AndPermission/blob/bbfaaecdb8ecf0f2aa270d80c0b88d022dddda7c/support/src/main/java/com/yanzhenjie/permission/AndPermission.java#L94-L96 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java | OpenShiftManagedClustersInner.createOrUpdateAsync | public Observable<OpenShiftManagedClusterInner> createOrUpdateAsync(String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) {
"""
Creates or updates an OpenShift managed cluster.
Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShif... | java | public Observable<OpenShiftManagedClusterInner> createOrUpdateAsync(String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<OpenShiftManagedClusterInner>, Op... | [
"public",
"Observable",
"<",
"OpenShiftManagedClusterInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"OpenShiftManagedClusterInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"r... | Creates or updates an OpenShift managed cluster.
Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the OpenShift managed cluster resource.
@param parameters Parameter... | [
"Creates",
"or",
"updates",
"an",
"OpenShift",
"managed",
"cluster",
".",
"Creates",
"or",
"updates",
"a",
"OpenShift",
"managed",
"cluster",
"with",
"the",
"specified",
"configuration",
"for",
"agents",
"and",
"OpenShift",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java#L473-L480 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator._generate | protected void _generate(SarlAnnotationType annotation, PyAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param annotation the annotation.
@param it the target for the generated content.
@param context the context.
"""
generateTypeDeclaration(
this.qualifiedN... | java | protected void _generate(SarlAnnotationType annotation, PyAppendable it, IExtraLanguageGeneratorContext context) {
generateTypeDeclaration(
this.qualifiedNameProvider.getFullyQualifiedName(annotation).toString(),
annotation.getName(), false, Collections.emptyList(),
getTypeBuilder().getDocumentation(annot... | [
"protected",
"void",
"_generate",
"(",
"SarlAnnotationType",
"annotation",
",",
"PyAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"generateTypeDeclaration",
"(",
"this",
".",
"qualifiedNameProvider",
".",
"getFullyQualifiedName",
"(",
"anno... | Generate the given object.
@param annotation the annotation.
@param it the target for the generated content.
@param context the context. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L923-L930 |
drapostolos/type-parser | src/main/java/com/github/drapostolos/typeparser/TypeParser.java | TypeParser.parseType | public Object parseType(String input, Type targetType) {
"""
Parses the given {@code input} string to the given {@code targetType}.
<p/>
@param input - string value to parse.
@param targetType - the expected type to convert {@code input} to.
@return an instance of {@code targetType} corresponding to the give... | java | public Object parseType(String input, Type targetType) {
if (input == null) {
throw new NullPointerException(makeNullArgumentErrorMsg("input"));
}
if (targetType == null) {
throw new NullPointerException(makeNullArgumentErrorMsg("targetType"));
}
return p... | [
"public",
"Object",
"parseType",
"(",
"String",
"input",
",",
"Type",
"targetType",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"makeNullArgumentErrorMsg",
"(",
"\"input\"",
")",
")",
";",
"}",
"if",
"... | Parses the given {@code input} string to the given {@code targetType}.
<p/>
@param input - string value to parse.
@param targetType - the expected type to convert {@code input} to.
@return an instance of {@code targetType} corresponding to the given {@code input}.
@throws NullPointerException if any given argument is ... | [
"Parses",
"the",
"given",
"{",
"@code",
"input",
"}",
"string",
"to",
"the",
"given",
"{",
"@code",
"targetType",
"}",
".",
"<p",
"/",
">"
] | train | https://github.com/drapostolos/type-parser/blob/74c66311f8dd009897c74ab5069e36c045cda073/src/main/java/com/github/drapostolos/typeparser/TypeParser.java#L127-L137 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java | LocalizedMessage.getFormattedMessage | @Override
public String getFormattedMessage() {
"""
Returns the formatted message after looking up the format in the resource bundle.
@return The formatted message String.
"""
if (formattedMessage != null) {
return formattedMessage;
}
ResourceBundle bundle = this.reso... | java | @Override
public String getFormattedMessage() {
if (formattedMessage != null) {
return formattedMessage;
}
ResourceBundle bundle = this.resourceBundle;
if (bundle == null) {
if (baseName != null) {
bundle = getResourceBundle(baseName, locale, f... | [
"@",
"Override",
"public",
"String",
"getFormattedMessage",
"(",
")",
"{",
"if",
"(",
"formattedMessage",
"!=",
"null",
")",
"{",
"return",
"formattedMessage",
";",
"}",
"ResourceBundle",
"bundle",
"=",
"this",
".",
"resourceBundle",
";",
"if",
"(",
"bundle",
... | Returns the formatted message after looking up the format in the resource bundle.
@return The formatted message String. | [
"Returns",
"the",
"formatted",
"message",
"after",
"looking",
"up",
"the",
"format",
"in",
"the",
"resource",
"bundle",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java#L179-L199 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca/src/com/ibm/ws/jca/internal/WorkManagerImpl.java | WorkManagerImpl.beforeRunCheck | @Trivial
private void beforeRunCheck(
Work work,
WorkListener workListener,
long startTimeout) throws WorkRejectedException {
"""
Input parameter checks that can be done before calling run.
@param work
@param wo... | java | @Trivial
private void beforeRunCheck(
Work work,
WorkListener workListener,
long startTimeout) throws WorkRejectedException {
WorkRejectedException wrex = null;
if (work == null) {
wrex = new... | [
"@",
"Trivial",
"private",
"void",
"beforeRunCheck",
"(",
"Work",
"work",
",",
"WorkListener",
"workListener",
",",
"long",
"startTimeout",
")",
"throws",
"WorkRejectedException",
"{",
"WorkRejectedException",
"wrex",
"=",
"null",
";",
"if",
"(",
"work",
"==",
"... | Input parameter checks that can be done before calling run.
@param work
@param workListener
@param startTimeout
@throws WorkRejectedException | [
"Input",
"parameter",
"checks",
"that",
"can",
"be",
"done",
"before",
"calling",
"run",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca/src/com/ibm/ws/jca/internal/WorkManagerImpl.java#L273-L295 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java | TransactionableDataManager.getItemData | public ItemData getItemData(String identifier, boolean checkChangesLogOnly) throws RepositoryException {
"""
Return item data by identifier in this transient storage then in storage container.
@param identifier
@param checkChangesLogOnly
@return existed item data or null if not found
@throws RepositoryExcept... | java | public ItemData getItemData(String identifier, boolean checkChangesLogOnly) throws RepositoryException
{
if (txStarted())
{
ItemState state = transactionLog.getItemState(identifier);
if (state != null)
{
return state.isDeleted() ? null : state.getData();
}
... | [
"public",
"ItemData",
"getItemData",
"(",
"String",
"identifier",
",",
"boolean",
"checkChangesLogOnly",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"txStarted",
"(",
")",
")",
"{",
"ItemState",
"state",
"=",
"transactionLog",
".",
"getItemState",
"(",
... | Return item data by identifier in this transient storage then in storage container.
@param identifier
@param checkChangesLogOnly
@return existed item data or null if not found
@throws RepositoryException
@see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getItemData(java.lang.String) | [
"Return",
"item",
"data",
"by",
"identifier",
"in",
"this",
"transient",
"storage",
"then",
"in",
"storage",
"container",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java#L389-L402 |
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java | DatabaseAccountsInner.failoverPriorityChange | public void failoverPriorityChange(String resourceGroupName, String accountName, List<FailoverPolicy> failoverPolicies) {
"""
Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regio... | java | public void failoverPriorityChange(String resourceGroupName, String accountName, List<FailoverPolicy> failoverPolicies) {
failoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies).toBlocking().last().body();
} | [
"public",
"void",
"failoverPriorityChange",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"List",
"<",
"FailoverPolicy",
">",
"failoverPolicies",
")",
"{",
"failoverPriorityChangeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName... | Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
@param resourceGrou... | [
"Changes",
"the",
"failover",
"priority",
"for",
"the",
"Azure",
"Cosmos",
"DB",
"database",
"account",
".",
"A",
"failover",
"priority",
"of",
"0",
"indicates",
"a",
"write",
"region",
".",
"The",
"maximum",
"value",
"for",
"a",
"failover",
"priority",
"=",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L769-L771 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationService.java | ClassificationService.attachClassification | public ClassificationModel attachClassification(GraphRewrite event, ClassificationModel classificationModel, FileModel fileModel) {
"""
This method just attaches the {@link ClassificationModel} to the {@link FileModel}.
It will only do so if this link is not already present.
"""
if (fileModel instance... | java | public ClassificationModel attachClassification(GraphRewrite event, ClassificationModel classificationModel, FileModel fileModel)
{
if (fileModel instanceof DuplicateArchiveModel)
{
fileModel = ((DuplicateArchiveModel) fileModel).getCanonicalArchive();
}
if (!isClassific... | [
"public",
"ClassificationModel",
"attachClassification",
"(",
"GraphRewrite",
"event",
",",
"ClassificationModel",
"classificationModel",
",",
"FileModel",
"fileModel",
")",
"{",
"if",
"(",
"fileModel",
"instanceof",
"DuplicateArchiveModel",
")",
"{",
"fileModel",
"=",
... | This method just attaches the {@link ClassificationModel} to the {@link FileModel}.
It will only do so if this link is not already present. | [
"This",
"method",
"just",
"attaches",
"the",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationService.java#L296-L312 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/vectorwriter/OmsVectorWriter.java | OmsVectorWriter.writeVector | public static void writeVector( String path, SimpleFeatureCollection featureCollection ) throws IOException {
"""
Fast write access mode.
@param path the vector file path.
@param featureCollection the {@link FeatureCollection} to write.
@throws IOException
"""
OmsVectorWriter writer = new OmsVecto... | java | public static void writeVector( String path, SimpleFeatureCollection featureCollection ) throws IOException {
OmsVectorWriter writer = new OmsVectorWriter();
writer.file = path;
writer.inVector = featureCollection;
writer.process();
} | [
"public",
"static",
"void",
"writeVector",
"(",
"String",
"path",
",",
"SimpleFeatureCollection",
"featureCollection",
")",
"throws",
"IOException",
"{",
"OmsVectorWriter",
"writer",
"=",
"new",
"OmsVectorWriter",
"(",
")",
";",
"writer",
".",
"file",
"=",
"path",... | Fast write access mode.
@param path the vector file path.
@param featureCollection the {@link FeatureCollection} to write.
@throws IOException | [
"Fast",
"write",
"access",
"mode",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/vectorwriter/OmsVectorWriter.java#L102-L107 |
timothyb89/EventBus | src/main/java/org/timothyb89/eventbus/EventBus.java | EventBus.registerMethod | protected void registerMethod(
Object o, Method m, int priority, boolean vetoable) {
"""
Registers the given method to the event bus. The object is assumed to be
of the class that contains the given method.
<p>The method parameters are
checked and added to the event queue corresponding to the {@link Event}
... | java | protected void registerMethod(
Object o, Method m, int priority, boolean vetoable) {
// check the parameter types, and attempt to resolve the event
// type
if (m.getParameterTypes().length != 1) {
log.warn("Skipping invalid event handler definition: " + m);
return;
}
// make sure the parameter is an... | [
"protected",
"void",
"registerMethod",
"(",
"Object",
"o",
",",
"Method",
"m",
",",
"int",
"priority",
",",
"boolean",
"vetoable",
")",
"{",
"// check the parameter types, and attempt to resolve the event",
"// type",
"if",
"(",
"m",
".",
"getParameterTypes",
"(",
"... | Registers the given method to the event bus. The object is assumed to be
of the class that contains the given method.
<p>The method parameters are
checked and added to the event queue corresponding to the {@link Event}
used as the first method parameter. In other words, if passed a reference
to the following method:</p... | [
"Registers",
"the",
"given",
"method",
"to",
"the",
"event",
"bus",
".",
"The",
"object",
"is",
"assumed",
"to",
"be",
"of",
"the",
"class",
"that",
"contains",
"the",
"given",
"method",
".",
"<p",
">",
"The",
"method",
"parameters",
"are",
"checked",
"a... | train | https://github.com/timothyb89/EventBus/blob/9285406c16eda84e20da6c72fe2500c24c7848db/src/main/java/org/timothyb89/eventbus/EventBus.java#L149-L179 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/JsonFixture.java | JsonFixture.setJsonPathTo | public void setJsonPathTo(String path, Object value) {
"""
Update a value in a the content by supplied jsonPath
@param path the jsonPath to locate the key whose value needs changing
@param value the new value to set
"""
Object cleanValue = cleanupValue(value);
String jsonPath = getPathExpr(pa... | java | public void setJsonPathTo(String path, Object value) {
Object cleanValue = cleanupValue(value);
String jsonPath = getPathExpr(path);
String newContent = getPathHelper().updateJsonPathWithValue(content, jsonPath, cleanValue);
content = newContent;
} | [
"public",
"void",
"setJsonPathTo",
"(",
"String",
"path",
",",
"Object",
"value",
")",
"{",
"Object",
"cleanValue",
"=",
"cleanupValue",
"(",
"value",
")",
";",
"String",
"jsonPath",
"=",
"getPathExpr",
"(",
"path",
")",
";",
"String",
"newContent",
"=",
"... | Update a value in a the content by supplied jsonPath
@param path the jsonPath to locate the key whose value needs changing
@param value the new value to set | [
"Update",
"a",
"value",
"in",
"a",
"the",
"content",
"by",
"supplied",
"jsonPath"
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/JsonFixture.java#L107-L112 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/ws/kernel/service/util/OperatingSystem.java | OperatingSystem.getPageSize | public static synchronized int getPageSize() throws OperatingSystemException {
"""
Get the base OS page size (this current Java process may not
necessarily be using this page size). Not implemented on Windows.
@return Page size.
@throws OperatingSystemException Error computing page size.
"""
if (c... | java | public static synchronized int getPageSize() throws OperatingSystemException {
if (cachedPageSize == -1) {
switch (instance().getOperatingSystemType()) {
case AIX:
case HPUX:
case IBMi:
case Linux:
case Mac:
... | [
"public",
"static",
"synchronized",
"int",
"getPageSize",
"(",
")",
"throws",
"OperatingSystemException",
"{",
"if",
"(",
"cachedPageSize",
"==",
"-",
"1",
")",
"{",
"switch",
"(",
"instance",
"(",
")",
".",
"getOperatingSystemType",
"(",
")",
")",
"{",
"cas... | Get the base OS page size (this current Java process may not
necessarily be using this page size). Not implemented on Windows.
@return Page size.
@throws OperatingSystemException Error computing page size. | [
"Get",
"the",
"base",
"OS",
"page",
"size",
"(",
"this",
"current",
"Java",
"process",
"may",
"not",
"necessarily",
"be",
"using",
"this",
"page",
"size",
")",
".",
"Not",
"implemented",
"on",
"Windows",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/ws/kernel/service/util/OperatingSystem.java#L92-L109 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/bucket/hashfunction/RangeHashFunction.java | RangeHashFunction.generateFileName | protected String generateFileName(int subBucket, String oldName) {
"""
generates a new filename for a subbucket from the given oldName
@param subBucket
@param oldName
@return
"""
int dotPos = oldName.lastIndexOf(".");
int slashPos = Math.max(oldName.lastIndexOf("/"), oldName.lastIndexOf("\... | java | protected String generateFileName(int subBucket, String oldName) {
int dotPos = oldName.lastIndexOf(".");
int slashPos = Math.max(oldName.lastIndexOf("/"), oldName.lastIndexOf("\\"));
String prefix;
String suffix;
if (dotPos > slashPos) {
prefix = oldName.substring(0... | [
"protected",
"String",
"generateFileName",
"(",
"int",
"subBucket",
",",
"String",
"oldName",
")",
"{",
"int",
"dotPos",
"=",
"oldName",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"int",
"slashPos",
"=",
"Math",
".",
"max",
"(",
"oldName",
".",
"lastIndex... | generates a new filename for a subbucket from the given oldName
@param subBucket
@param oldName
@return | [
"generates",
"a",
"new",
"filename",
"for",
"a",
"subbucket",
"from",
"the",
"given",
"oldName"
] | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/bucket/hashfunction/RangeHashFunction.java#L307-L321 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassReader.java | ClassReader.enterClass | public ClassSymbol enterClass(Name flatName, JavaFileObject classFile) {
"""
Creates a new toplevel class symbol with given flat name and
given class (or source) file.
@param flatName a fully qualified binary class name
@param classFile the class file or compilation unit defining
the class (may be {@code nul... | java | public ClassSymbol enterClass(Name flatName, JavaFileObject classFile) {
ClassSymbol cs = classes.get(flatName);
if (cs != null) {
String msg = Log.format("%s: completer = %s; class file = %s; source file = %s",
cs.fullname,
... | [
"public",
"ClassSymbol",
"enterClass",
"(",
"Name",
"flatName",
",",
"JavaFileObject",
"classFile",
")",
"{",
"ClassSymbol",
"cs",
"=",
"classes",
".",
"get",
"(",
"flatName",
")",
";",
"if",
"(",
"cs",
"!=",
"null",
")",
"{",
"String",
"msg",
"=",
"Log"... | Creates a new toplevel class symbol with given flat name and
given class (or source) file.
@param flatName a fully qualified binary class name
@param classFile the class file or compilation unit defining
the class (may be {@code null})
@return a newly created class symbol
@throws AssertionError if the class symbol alr... | [
"Creates",
"a",
"new",
"toplevel",
"class",
"symbol",
"with",
"given",
"flat",
"name",
"and",
"given",
"class",
"(",
"or",
"source",
")",
"file",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2408-L2426 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.beginCreateOrUpdateAsync | public Observable<AppServiceCertificateOrderInner> beginCreateOrUpdateAsync(String resourceGroupName, String certificateOrderName, AppServiceCertificateOrderInner certificateDistinguishedName) {
"""
Create or update a certificate purchase order.
Create or update a certificate purchase order.
@param resourceGro... | java | public Observable<AppServiceCertificateOrderInner> beginCreateOrUpdateAsync(String resourceGroupName, String certificateOrderName, AppServiceCertificateOrderInner certificateDistinguishedName) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedN... | [
"public",
"Observable",
"<",
"AppServiceCertificateOrderInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"certificateOrderName",
",",
"AppServiceCertificateOrderInner",
"certificateDistinguishedName",
")",
"{",
"return",
"beginCreateOrUp... | Create or update a certificate purchase order.
Create or update a certificate purchase order.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@param certificateDistinguishedName Distinguished name to to use for the certificat... | [
"Create",
"or",
"update",
"a",
"certificate",
"purchase",
"order",
".",
"Create",
"or",
"update",
"a",
"certificate",
"purchase",
"order",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L704-L711 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/cp/CPSubsystemConfig.java | CPSubsystemConfig.setSemaphoreConfigs | public CPSubsystemConfig setSemaphoreConfigs(Map<String, CPSemaphoreConfig> cpSemaphoreConfigs) {
"""
Sets the map of CP {@link ISemaphore} configurations,
mapped by config name. Names could optionally contain
a {@link CPGroup} name, such as "mySemaphore@group1".
@param cpSemaphoreConfigs the CP {@link ISemap... | java | public CPSubsystemConfig setSemaphoreConfigs(Map<String, CPSemaphoreConfig> cpSemaphoreConfigs) {
this.semaphoreConfigs.clear();
this.semaphoreConfigs.putAll(cpSemaphoreConfigs);
for (Entry<String, CPSemaphoreConfig> entry : this.semaphoreConfigs.entrySet()) {
entry.getValue().setNam... | [
"public",
"CPSubsystemConfig",
"setSemaphoreConfigs",
"(",
"Map",
"<",
"String",
",",
"CPSemaphoreConfig",
">",
"cpSemaphoreConfigs",
")",
"{",
"this",
".",
"semaphoreConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"semaphoreConfigs",
".",
"putAll",
"(",
"cp... | Sets the map of CP {@link ISemaphore} configurations,
mapped by config name. Names could optionally contain
a {@link CPGroup} name, such as "mySemaphore@group1".
@param cpSemaphoreConfigs the CP {@link ISemaphore} config map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"CP",
"{",
"@link",
"ISemaphore",
"}",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"Names",
"could",
"optionally",
"contain",
"a",
"{",
"@link",
"CPGroup",
"}",
"name",
"such",
"as",
"mySemaphore@group1",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/cp/CPSubsystemConfig.java#L491-L498 |
joelittlejohn/jsonschema2pojo | jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java | NameHelper.getPropertyName | public String getPropertyName(String jsonFieldName, JsonNode node) {
"""
Convert jsonFieldName into the equivalent Java fieldname by replacing
illegal characters and normalizing it.
@param jsonFieldName
@param node
@return
"""
jsonFieldName = getFieldName(jsonFieldName, node);
jsonFieldN... | java | public String getPropertyName(String jsonFieldName, JsonNode node) {
jsonFieldName = getFieldName(jsonFieldName, node);
jsonFieldName = replaceIllegalCharacters(jsonFieldName);
jsonFieldName = normalizeName(jsonFieldName);
jsonFieldName = makeLowerCamelCase(jsonFieldName);
if (... | [
"public",
"String",
"getPropertyName",
"(",
"String",
"jsonFieldName",
",",
"JsonNode",
"node",
")",
"{",
"jsonFieldName",
"=",
"getFieldName",
"(",
"jsonFieldName",
",",
"node",
")",
";",
"jsonFieldName",
"=",
"replaceIllegalCharacters",
"(",
"jsonFieldName",
")",
... | Convert jsonFieldName into the equivalent Java fieldname by replacing
illegal characters and normalizing it.
@param jsonFieldName
@param node
@return | [
"Convert",
"jsonFieldName",
"into",
"the",
"equivalent",
"Java",
"fieldname",
"by",
"replacing",
"illegal",
"characters",
"and",
"normalizing",
"it",
"."
] | train | https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java#L103-L119 |
dropwizard/dropwizard | dropwizard-jersey/src/main/java/io/dropwizard/jersey/validation/ConstraintMessage.java | ConstraintMessage.getMessage | public static String getMessage(ConstraintViolation<?> v, Invocable invocable) {
"""
Gets the human friendly location of where the violation was raised.
"""
final Pair<Path, ? extends ConstraintDescriptor<?>> of =
Pair.of(v.getPropertyPath(), v.getConstraintDescriptor());
final ... | java | public static String getMessage(ConstraintViolation<?> v, Invocable invocable) {
final Pair<Path, ? extends ConstraintDescriptor<?>> of =
Pair.of(v.getPropertyPath(), v.getConstraintDescriptor());
final String cachePrefix = PREFIX_CACHE.getIfPresent(of);
if (cachePrefix == null) ... | [
"public",
"static",
"String",
"getMessage",
"(",
"ConstraintViolation",
"<",
"?",
">",
"v",
",",
"Invocable",
"invocable",
")",
"{",
"final",
"Pair",
"<",
"Path",
",",
"?",
"extends",
"ConstraintDescriptor",
"<",
"?",
">",
">",
"of",
"=",
"Pair",
".",
"o... | Gets the human friendly location of where the violation was raised. | [
"Gets",
"the",
"human",
"friendly",
"location",
"of",
"where",
"the",
"violation",
"was",
"raised",
"."
] | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-jersey/src/main/java/io/dropwizard/jersey/validation/ConstraintMessage.java#L40-L50 |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java | AbstractMessageHandler.getActiveOperation | protected <T, A> ActiveOperation<T, A> getActiveOperation(final Integer id) {
"""
Get the active operation.
@param id the active operation id
@return the active operation, {@code null} if if there is no registered operation
"""
//noinspection unchecked
return (ActiveOperation<T, A>) activeR... | java | protected <T, A> ActiveOperation<T, A> getActiveOperation(final Integer id) {
//noinspection unchecked
return (ActiveOperation<T, A>) activeRequests.get(id);
} | [
"protected",
"<",
"T",
",",
"A",
">",
"ActiveOperation",
"<",
"T",
",",
"A",
">",
"getActiveOperation",
"(",
"final",
"Integer",
"id",
")",
"{",
"//noinspection unchecked",
"return",
"(",
"ActiveOperation",
"<",
"T",
",",
"A",
">",
")",
"activeRequests",
"... | Get the active operation.
@param id the active operation id
@return the active operation, {@code null} if if there is no registered operation | [
"Get",
"the",
"active",
"operation",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java#L428-L431 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.newReader | public static BufferedReader newReader(Path self, String charset) throws IOException {
"""
Create a buffered reader for this file, using the specified
charset as the encoding.
@param self a Path
@param charset the charset for this Path
@return a BufferedReader
@throws java.io.FileNotFoundException ... | java | public static BufferedReader newReader(Path self, String charset) throws IOException {
return Files.newBufferedReader(self, Charset.forName(charset));
} | [
"public",
"static",
"BufferedReader",
"newReader",
"(",
"Path",
"self",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"return",
"Files",
".",
"newBufferedReader",
"(",
"self",
",",
"Charset",
".",
"forName",
"(",
"charset",
")",
")",
";",
"}"
... | Create a buffered reader for this file, using the specified
charset as the encoding.
@param self a Path
@param charset the charset for this Path
@return a BufferedReader
@throws java.io.FileNotFoundException if the Path was not found
@throws java.io.UnsupportedEncodingException if the encoding specified is n... | [
"Create",
"a",
"buffered",
"reader",
"for",
"this",
"file",
"using",
"the",
"specified",
"charset",
"as",
"the",
"encoding",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L1414-L1416 |
dbracewell/mango | src/main/java/com/davidbracewell/conversion/Val.java | Val.asSet | public <T> Set<T> asSet(Class<T> itemType) {
"""
Converts the object to a Set
@param <T> the type parameter
@param itemType The class of the item in the Set
@return The object as a Set
"""
return asCollection(Set.class, itemType);
} | java | public <T> Set<T> asSet(Class<T> itemType) {
return asCollection(Set.class, itemType);
} | [
"public",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"asSet",
"(",
"Class",
"<",
"T",
">",
"itemType",
")",
"{",
"return",
"asCollection",
"(",
"Set",
".",
"class",
",",
"itemType",
")",
";",
"}"
] | Converts the object to a Set
@param <T> the type parameter
@param itemType The class of the item in the Set
@return The object as a Set | [
"Converts",
"the",
"object",
"to",
"a",
"Set"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/conversion/Val.java#L762-L764 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java | StringBuilders.appendKeyDqValue | public static StringBuilder appendKeyDqValue(final StringBuilder sb, final Entry<String, String> entry) {
"""
Appends in the following format: key=double quoted value.
@param sb a string builder
@param entry a map entry
@return {@code key="value"}
"""
return appendKeyDqValue(sb, entry.getKey(), en... | java | public static StringBuilder appendKeyDqValue(final StringBuilder sb, final Entry<String, String> entry) {
return appendKeyDqValue(sb, entry.getKey(), entry.getValue());
} | [
"public",
"static",
"StringBuilder",
"appendKeyDqValue",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
")",
"{",
"return",
"appendKeyDqValue",
"(",
"sb",
",",
"entry",
".",
"getKey",
"(",
")",
",",
... | Appends in the following format: key=double quoted value.
@param sb a string builder
@param entry a map entry
@return {@code key="value"} | [
"Appends",
"in",
"the",
"following",
"format",
":",
"key",
"=",
"double",
"quoted",
"value",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java#L48-L50 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/debug/DebugHelper.java | DebugHelper.debugAnnotation | public static void debugAnnotation(Rectangle rectangle, String styleClass, PdfWriter writer) {
"""
adding a link (annotation) to information about the styleClass used
@param rectangle the value of rectangle
@param styleClass the value of styleClass
@param writer the value of writer
"""
if (styleClas... | java | public static void debugAnnotation(Rectangle rectangle, String styleClass, PdfWriter writer) {
if (styleClass == null) {
log.warning("not showing link to styleClass because there is no styleClass");
return;
}
// only now we can define a goto action, we know the position of the image
... | [
"public",
"static",
"void",
"debugAnnotation",
"(",
"Rectangle",
"rectangle",
",",
"String",
"styleClass",
",",
"PdfWriter",
"writer",
")",
"{",
"if",
"(",
"styleClass",
"==",
"null",
")",
"{",
"log",
".",
"warning",
"(",
"\"not showing link to styleClass because ... | adding a link (annotation) to information about the styleClass used
@param rectangle the value of rectangle
@param styleClass the value of styleClass
@param writer the value of writer | [
"adding",
"a",
"link",
"(",
"annotation",
")",
"to",
"information",
"about",
"the",
"styleClass",
"used"
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/debug/DebugHelper.java#L132-L140 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java | SQLService.toClob | public Clob toClob(String stringName, Connection sqlConnection) {
"""
Converts the given string to a clob object
@param stringName string name to clob
@param sqlConnection Connection object
@return Clob object or NULL
"""
Clob clobName = null;
try {
clobName = sqlConnection.cre... | java | public Clob toClob(String stringName, Connection sqlConnection) {
Clob clobName = null;
try {
clobName = sqlConnection.createClob();
clobName.setString(1, stringName);
} catch (SQLException e) {
// TODO Auto-generated catch block
logger.info("Unabl... | [
"public",
"Clob",
"toClob",
"(",
"String",
"stringName",
",",
"Connection",
"sqlConnection",
")",
"{",
"Clob",
"clobName",
"=",
"null",
";",
"try",
"{",
"clobName",
"=",
"sqlConnection",
".",
"createClob",
"(",
")",
";",
"clobName",
".",
"setString",
"(",
... | Converts the given string to a clob object
@param stringName string name to clob
@param sqlConnection Connection object
@return Clob object or NULL | [
"Converts",
"the",
"given",
"string",
"to",
"a",
"clob",
"object"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java#L328-L339 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanPODocBookBuilder.java | PublicanPODocBookBuilder.processPOTopicInjections | protected void processPOTopicInjections(final POBuildData buildData, final SpecTopic specTopic,
final Map<String, TranslationDetails> translations) {
"""
Process a spec topic and add any translation strings for it.
@param buildData Information and data structures for the build.
@param... | java | protected void processPOTopicInjections(final POBuildData buildData, final SpecTopic specTopic,
final Map<String, TranslationDetails> translations) {
// Prerequisites
addStringsFromTopicRelationships(buildData, specTopic.getPrerequisiteRelationships(),
DocBookXMLPreProcessor.... | [
"protected",
"void",
"processPOTopicInjections",
"(",
"final",
"POBuildData",
"buildData",
",",
"final",
"SpecTopic",
"specTopic",
",",
"final",
"Map",
"<",
"String",
",",
"TranslationDetails",
">",
"translations",
")",
"{",
"// Prerequisites",
"addStringsFromTopicRelat... | Process a spec topic and add any translation strings for it.
@param buildData Information and data structures for the build.
@param specTopic The spec topic to process any injections for.
@param translations The mapping of original strings to translation strings, that will be use... | [
"Process",
"a",
"spec",
"topic",
"and",
"add",
"any",
"translation",
"strings",
"for",
"it",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanPODocBookBuilder.java#L1101-L1138 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.