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 |
|---|---|---|---|---|---|---|---|---|---|---|
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java | InsertAllRequest.of | public static InsertAllRequest of(TableId tableId, Iterable<RowToInsert> rows) {
"""
Returns a {@code InsertAllRequest} object given the destination table and the rows to insert.
"""
return newBuilder(tableId, rows).build();
} | java | public static InsertAllRequest of(TableId tableId, Iterable<RowToInsert> rows) {
return newBuilder(tableId, rows).build();
} | [
"public",
"static",
"InsertAllRequest",
"of",
"(",
"TableId",
"tableId",
",",
"Iterable",
"<",
"RowToInsert",
">",
"rows",
")",
"{",
"return",
"newBuilder",
"(",
"tableId",
",",
"rows",
")",
".",
"build",
"(",
")",
";",
"}"
] | Returns a {@code InsertAllRequest} object given the destination table and the rows to insert. | [
"Returns",
"a",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java#L395-L397 |
vanniktech/RxPermission | rxpermission/src/main/java/com/vanniktech/rxpermission/RealRxPermission.java | RealRxPermission.ensureEach | @NonNull @CheckReturnValue private <T> ObservableTransformer<T, Permission> ensureEach(@NonNull final String... permissions) {
"""
Map emitted items from the source observable into {@link Permission} objects for each
permission in parameters.
<p>
If one or several permissions have never been requested, invoke t... | java | @NonNull @CheckReturnValue private <T> ObservableTransformer<T, Permission> ensureEach(@NonNull final String... permissions) {
checkPermissions(permissions);
return new ObservableTransformer<T, Permission>() {
@Override @NonNull @CheckReturnValue public ObservableSource<Permission> apply(final Observable... | [
"@",
"NonNull",
"@",
"CheckReturnValue",
"private",
"<",
"T",
">",
"ObservableTransformer",
"<",
"T",
",",
"Permission",
">",
"ensureEach",
"(",
"@",
"NonNull",
"final",
"String",
"...",
"permissions",
")",
"{",
"checkPermissions",
"(",
"permissions",
")",
";"... | Map emitted items from the source observable into {@link Permission} objects for each
permission in parameters.
<p>
If one or several permissions have never been requested, invoke the related framework method
to ask the user if he allows the permissions. | [
"Map",
"emitted",
"items",
"from",
"the",
"source",
"observable",
"into",
"{"
] | train | https://github.com/vanniktech/RxPermission/blob/db2b438f40e98d7440a70bc1a35e866312b813e0/rxpermission/src/main/java/com/vanniktech/rxpermission/RealRxPermission.java#L77-L85 |
JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuPresenter.java | ActionMenuPresenter.showOverflowMenu | public boolean showOverflowMenu() {
"""
Display the overflow menu if one is present.
@return true if the overflow menu was shown, false otherwise.
"""
if (mReserveOverflow && !isOverflowMenuShowing() && mMenu != null && mMenuView != null &&
mPostedOpenRunnable == null && !mMenu.getNonA... | java | public boolean showOverflowMenu() {
if (mReserveOverflow && !isOverflowMenuShowing() && mMenu != null && mMenuView != null &&
mPostedOpenRunnable == null && !mMenu.getNonActionItems().isEmpty()) {
OverflowPopup popup = new OverflowPopup(mContext, mMenu, mOverflowButton, true);
... | [
"public",
"boolean",
"showOverflowMenu",
"(",
")",
"{",
"if",
"(",
"mReserveOverflow",
"&&",
"!",
"isOverflowMenuShowing",
"(",
")",
"&&",
"mMenu",
"!=",
"null",
"&&",
"mMenuView",
"!=",
"null",
"&&",
"mPostedOpenRunnable",
"==",
"null",
"&&",
"!",
"mMenu",
... | Display the overflow menu if one is present.
@return true if the overflow menu was shown, false otherwise. | [
"Display",
"the",
"overflow",
"menu",
"if",
"one",
"is",
"present",
"."
] | train | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuPresenter.java#L297-L312 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/internal/Transport.java | Transport.addObject | public <T> T addObject(T object, NameValuePair... params)
throws RedmineException {
"""
Performs an "add object" request.
@param object
object to use.
@param params
name params.
@return object to use.
@throws RedmineException
if something goes wrong.
"""
final EntityConfig<T> config = getConfig(o... | java | public <T> T addObject(T object, NameValuePair... params)
throws RedmineException {
final EntityConfig<T> config = getConfig(object.getClass());
if (config.writer == null) {
throw new RuntimeException("can't create object: writer is not implemented or is not registered in RedmineJSONBuilder for... | [
"public",
"<",
"T",
">",
"T",
"addObject",
"(",
"T",
"object",
",",
"NameValuePair",
"...",
"params",
")",
"throws",
"RedmineException",
"{",
"final",
"EntityConfig",
"<",
"T",
">",
"config",
"=",
"getConfig",
"(",
"object",
".",
"getClass",
"(",
")",
")... | Performs an "add object" request.
@param object
object to use.
@param params
name params.
@return object to use.
@throws RedmineException
if something goes wrong. | [
"Performs",
"an",
"add",
"object",
"request",
"."
] | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/Transport.java#L220-L233 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/GrassLegacyUtilities.java | GrassLegacyUtilities.checkRasterMapConsistence | public static boolean checkRasterMapConsistence( String mapsetPath, String mapname ) {
"""
Returns the list of files involved in the raster map issues. If for example a map has to be
deleted, then all these files have to.
@param mapsetPath - the path of the mapset
@param mapname -the name of the map
@return ... | java | public static boolean checkRasterMapConsistence( String mapsetPath, String mapname ) {
File file = null;
File file2 = null;
file = new File(mapsetPath + File.separator + GrassLegacyConstans.FCELL + File.separator + mapname);
file2 = new File(mapsetPath + File.separator + GrassLegacyConst... | [
"public",
"static",
"boolean",
"checkRasterMapConsistence",
"(",
"String",
"mapsetPath",
",",
"String",
"mapname",
")",
"{",
"File",
"file",
"=",
"null",
";",
"File",
"file2",
"=",
"null",
";",
"file",
"=",
"new",
"File",
"(",
"mapsetPath",
"+",
"File",
".... | Returns the list of files involved in the raster map issues. If for example a map has to be
deleted, then all these files have to.
@param mapsetPath - the path of the mapset
@param mapname -the name of the map
@return the array of strings containing the full path to the involved files | [
"Returns",
"the",
"list",
"of",
"files",
"involved",
"in",
"the",
"raster",
"map",
"issues",
".",
"If",
"for",
"example",
"a",
"map",
"has",
"to",
"be",
"deleted",
"then",
"all",
"these",
"files",
"have",
"to",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/GrassLegacyUtilities.java#L290-L312 |
gallandarakhneorg/afc | advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/path/ClusteredRoadPath.java | ClusteredRoadPath.removeRoadSegmentAt | private RoadSegment removeRoadSegmentAt(RoadPath path, int index, PathIterator iterator) {
"""
Remove the road segment at the given index in the given path.
<p>The given path must be inside the clustered road-path.
The given index is inside the path's segments.
@param path a path.
@param index an index.
@... | java | private RoadSegment removeRoadSegmentAt(RoadPath path, int index, PathIterator iterator) {
final int pathIndex = this.paths.indexOf(path);
assert pathIndex >= 0 && pathIndex < this.paths.size();
assert index >= 0 && index < path.size();
final RoadPath syncPath;
final RoadSegment sgmt;
if (index == 0 || inde... | [
"private",
"RoadSegment",
"removeRoadSegmentAt",
"(",
"RoadPath",
"path",
",",
"int",
"index",
",",
"PathIterator",
"iterator",
")",
"{",
"final",
"int",
"pathIndex",
"=",
"this",
".",
"paths",
".",
"indexOf",
"(",
"path",
")",
";",
"assert",
"pathIndex",
">... | Remove the road segment at the given index in the given path.
<p>The given path must be inside the clustered road-path.
The given index is inside the path's segments.
@param path a path.
@param index an index.
@param iterator an iterator.
@return the removed segment, never <code>null</code>. | [
"Remove",
"the",
"road",
"segment",
"at",
"the",
"given",
"index",
"in",
"the",
"given",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/path/ClusteredRoadPath.java#L280-L316 |
netarchivesuite/heritrix3-wrapper | src/main/java/org/netarchivesuite/heritrix3wrapper/Heritrix3Wrapper.java | Heritrix3Wrapper.copyJob | public JobResult copyJob(String srcJobname, String dstJobName, boolean bAsProfile) {
"""
Copy a job.
@param srcJobname source job name
@param dstJobName destination job name
@param bAsProfile define if the job should be copied as a profile or not
@return job state of new job
"""
HttpPost postReques... | java | public JobResult copyJob(String srcJobname, String dstJobName, boolean bAsProfile) {
HttpPost postRequest = new HttpPost(baseUrl + "job/" + srcJobname);
List<NameValuePair> nvp = new LinkedList<NameValuePair>();
nvp.add(new BasicNameValuePair("copyTo", dstJobName));
if (bAsProfile) {
... | [
"public",
"JobResult",
"copyJob",
"(",
"String",
"srcJobname",
",",
"String",
"dstJobName",
",",
"boolean",
"bAsProfile",
")",
"{",
"HttpPost",
"postRequest",
"=",
"new",
"HttpPost",
"(",
"baseUrl",
"+",
"\"job/\"",
"+",
"srcJobname",
")",
";",
"List",
"<",
... | Copy a job.
@param srcJobname source job name
@param dstJobName destination job name
@param bAsProfile define if the job should be copied as a profile or not
@return job state of new job | [
"Copy",
"a",
"job",
"."
] | train | https://github.com/netarchivesuite/heritrix3-wrapper/blob/e53ec5736cbac0bdd3925b5331737dc905871629/src/main/java/org/netarchivesuite/heritrix3wrapper/Heritrix3Wrapper.java#L503-L520 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/sql/OIndexProxy.java | OIndexProxy.prepareKeys | private Set<Comparable> prepareKeys(OIndex<?> index, Object keys) {
"""
Make type conversion of keys for specific index.
@param index
- index for which keys prepared for.
@param keys
- which should be prepared.
@return keys converted to necessary type.
"""
final Class<?> targetType = index.getKeyTy... | java | private Set<Comparable> prepareKeys(OIndex<?> index, Object keys) {
final Class<?> targetType = index.getKeyTypes()[0].getDefaultJavaType();
return convertResult(keys, targetType);
} | [
"private",
"Set",
"<",
"Comparable",
">",
"prepareKeys",
"(",
"OIndex",
"<",
"?",
">",
"index",
",",
"Object",
"keys",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"targetType",
"=",
"index",
".",
"getKeyTypes",
"(",
")",
"[",
"0",
"]",
".",
"getDefaul... | Make type conversion of keys for specific index.
@param index
- index for which keys prepared for.
@param keys
- which should be prepared.
@return keys converted to necessary type. | [
"Make",
"type",
"conversion",
"of",
"keys",
"for",
"specific",
"index",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/sql/OIndexProxy.java#L243-L247 |
fedups/com.obdobion.algebrain | src/main/java/com/obdobion/algebrain/ValueStack.java | ValueStack.popString | public String popString() throws ParseException {
"""
<p>
popString.
</p>
@return a {@link java.lang.String} object.
@throws java.text.ParseException if any.
"""
final Object popped = super.pop();
if (popped instanceof String)
return (String) popped;
/*
* This... | java | public String popString() throws ParseException
{
final Object popped = super.pop();
if (popped instanceof String)
return (String) popped;
/*
* This is probably an unquoted single word literal.
*/
if (popped instanceof TokVariable)
return ((T... | [
"public",
"String",
"popString",
"(",
")",
"throws",
"ParseException",
"{",
"final",
"Object",
"popped",
"=",
"super",
".",
"pop",
"(",
")",
";",
"if",
"(",
"popped",
"instanceof",
"String",
")",
"return",
"(",
"String",
")",
"popped",
";",
"/*\n *... | <p>
popString.
</p>
@return a {@link java.lang.String} object.
@throws java.text.ParseException if any. | [
"<p",
">",
"popString",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/fedups/com.obdobion.algebrain/blob/d0adaa9fbbba907bdcf820961e9058b0d2b15a8a/src/main/java/com/obdobion/algebrain/ValueStack.java#L252-L264 |
EdwardRaff/JSAT | JSAT/src/jsat/utils/ListUtils.java | ListUtils.randomSample | public static <T> void randomSample(Collection<T> source, Collection<T> dest, int samples, Random rand) {
"""
Obtains a random sample without replacement from a source collection and
places it in the destination collection. This is done without modifying
the source collection. <br>
This random sampling is obliv... | java | public static <T> void randomSample(Collection<T> source, Collection<T> dest, int samples, Random rand)
{
if(samples > source.size())
throw new IllegalArgumentException("Can not obtain a number of samples larger than the source population");
else if(samples <= 0)
throw new Il... | [
"public",
"static",
"<",
"T",
">",
"void",
"randomSample",
"(",
"Collection",
"<",
"T",
">",
"source",
",",
"Collection",
"<",
"T",
">",
"dest",
",",
"int",
"samples",
",",
"Random",
"rand",
")",
"{",
"if",
"(",
"samples",
">",
"source",
".",
"size",... | Obtains a random sample without replacement from a source collection and
places it in the destination collection. This is done without modifying
the source collection. <br>
This random sampling is oblivious to failures to add to a collection that
may occur, such as if the collection is a {@link Set}
@param <T> the lis... | [
"Obtains",
"a",
"random",
"sample",
"without",
"replacement",
"from",
"a",
"source",
"collection",
"and",
"places",
"it",
"in",
"the",
"destination",
"collection",
".",
"This",
"is",
"done",
"without",
"modifying",
"the",
"source",
"collection",
".",
"<br",
">... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/ListUtils.java#L206-L223 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.multTransAB | public static void multTransAB(DMatrix1Row a , DMatrix1Row b , DMatrix1Row c ) {
"""
<p>
Performs the following operation:<br>
<br>
c = a<sup>T</sup> * b<sup>T</sup><br>
c<sub>ij</sub> = ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>jk</sub>}
</p>
@param a The left matrix in the multiplication operation. ... | java | public static void multTransAB(DMatrix1Row a , DMatrix1Row b , DMatrix1Row c )
{
if( b.numRows == 1) {
// there are significantly faster algorithms when dealing with vectors
if( a.numCols >= EjmlParameters.MULT_COLUMN_SWITCH ) {
MatrixVectorMult_DDRM.multTransA_reorde... | [
"public",
"static",
"void",
"multTransAB",
"(",
"DMatrix1Row",
"a",
",",
"DMatrix1Row",
"b",
",",
"DMatrix1Row",
"c",
")",
"{",
"if",
"(",
"b",
".",
"numRows",
"==",
"1",
")",
"{",
"// there are significantly faster algorithms when dealing with vectors",
"if",
"("... | <p>
Performs the following operation:<br>
<br>
c = a<sup>T</sup> * b<sup>T</sup><br>
c<sub>ij</sub> = ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>jk</sub>}
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix in the multiplication operation. Not modified.
@param c W... | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"a<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"b<sup",
">",
"T<",
"/",
"sup",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"&sum",
";",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L215-L229 |
Scout24/appmon4j | core/src/main/java/de/is24/util/monitoring/InApplicationMonitor.java | InApplicationMonitor.addTimerMeasurement | public void addTimerMeasurement(String name, long timing) {
"""
Add a timer measurement for the given name.
{@link Timer}s allow adding timer measurements, implicitly incrementing the count
Timers count and measure timed events.
The application decides which unit to use for timing.
Miliseconds are suggested an... | java | public void addTimerMeasurement(String name, long timing) {
if (monitorActive) {
String escapedName = keyHandler.handle(name);
for (MonitorPlugin p : getPlugins()) {
p.addTimerMeasurement(escapedName, timing);
}
}
} | [
"public",
"void",
"addTimerMeasurement",
"(",
"String",
"name",
",",
"long",
"timing",
")",
"{",
"if",
"(",
"monitorActive",
")",
"{",
"String",
"escapedName",
"=",
"keyHandler",
".",
"handle",
"(",
"name",
")",
";",
"for",
"(",
"MonitorPlugin",
"p",
":",
... | Add a timer measurement for the given name.
{@link Timer}s allow adding timer measurements, implicitly incrementing the count
Timers count and measure timed events.
The application decides which unit to use for timing.
Miliseconds are suggested and some {@link ReportVisitor} implementations
may imply this.
@param name... | [
"Add",
"a",
"timer",
"measurement",
"for",
"the",
"given",
"name",
".",
"{",
"@link",
"Timer",
"}",
"s",
"allow",
"adding",
"timer",
"measurements",
"implicitly",
"incrementing",
"the",
"count",
"Timers",
"count",
"and",
"measure",
"timed",
"events",
".",
"T... | train | https://github.com/Scout24/appmon4j/blob/a662e5123805ea455cfd01e1b9ae5d808f83529c/core/src/main/java/de/is24/util/monitoring/InApplicationMonitor.java#L230-L237 |
Impetus/Kundera | src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java | OracleNoSQLClient.populateId | private void populateId(EntityMetadata entityMetadata, Table schemaTable, Object entity, Row row) {
"""
Populate id.
@param entityMetadata
the entity metadata
@param schemaTable
the schema table
@param entity
the entity
@param row
the row
"""
FieldDef fieldMetadata;
FieldValue value;
... | java | private void populateId(EntityMetadata entityMetadata, Table schemaTable, Object entity, Row row)
{
FieldDef fieldMetadata;
FieldValue value;
String idColumnName = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
fieldMetadata = schemaTable.getField(idColumn... | [
"private",
"void",
"populateId",
"(",
"EntityMetadata",
"entityMetadata",
",",
"Table",
"schemaTable",
",",
"Object",
"entity",
",",
"Row",
"row",
")",
"{",
"FieldDef",
"fieldMetadata",
";",
"FieldValue",
"value",
";",
"String",
"idColumnName",
"=",
"(",
"(",
... | Populate id.
@param entityMetadata
the entity metadata
@param schemaTable
the schema table
@param entity
the entity
@param row
the row | [
"Populate",
"id",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java#L1197-L1208 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveInternal.java | ApptentiveInternal.updateApptentiveInteractionTheme | public void updateApptentiveInteractionTheme(Context context, Resources.Theme interactionTheme) {
"""
/* Apply Apptentive styling layers to the theme to be used by interaction. The layers include
Apptentive defaults, and app/activity theme inheritance and app specific overrides.
When the Apptentive fragments a... | java | public void updateApptentiveInteractionTheme(Context context, Resources.Theme interactionTheme) {
/* Step 1: Apply Apptentive default theme layer.
* If host activity is an activity, the base theme already has Apptentive defaults applied, so skip Step 1.
* If parent activity is NOT an activity, first apply Appte... | [
"public",
"void",
"updateApptentiveInteractionTheme",
"(",
"Context",
"context",
",",
"Resources",
".",
"Theme",
"interactionTheme",
")",
"{",
"/* Step 1: Apply Apptentive default theme layer.\n\t\t * If host activity is an activity, the base theme already has Apptentive defaults applied, ... | /* Apply Apptentive styling layers to the theme to be used by interaction. The layers include
Apptentive defaults, and app/activity theme inheritance and app specific overrides.
When the Apptentive fragments are hosted by ApptentiveViewActivity(by default), the value of theme attributes
are obtained in the following o... | [
"/",
"*",
"Apply",
"Apptentive",
"styling",
"layers",
"to",
"the",
"theme",
"to",
"be",
"used",
"by",
"interaction",
".",
"The",
"layers",
"include",
"Apptentive",
"defaults",
"and",
"app",
"/",
"activity",
"theme",
"inheritance",
"and",
"app",
"specific",
"... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveInternal.java#L463-L507 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/StructureSequenceMatcher.java | StructureSequenceMatcher.getSubstructureMatchingProteinSequence | public static Structure getSubstructureMatchingProteinSequence(ProteinSequence sequence, Structure wholeStructure) {
"""
Get a substructure of {@code wholeStructure} containing only the {@link Group Groups} that are included in
{@code sequence}. The resulting structure will contain only {@code ATOM} residues; the... | java | public static Structure getSubstructureMatchingProteinSequence(ProteinSequence sequence, Structure wholeStructure) {
ResidueNumber[] rns = matchSequenceToStructure(sequence, wholeStructure);
Structure structure = wholeStructure.clone();
structure.setChains(new ArrayList<>());
// structure.getHetGroups().clear();... | [
"public",
"static",
"Structure",
"getSubstructureMatchingProteinSequence",
"(",
"ProteinSequence",
"sequence",
",",
"Structure",
"wholeStructure",
")",
"{",
"ResidueNumber",
"[",
"]",
"rns",
"=",
"matchSequenceToStructure",
"(",
"sequence",
",",
"wholeStructure",
")",
"... | Get a substructure of {@code wholeStructure} containing only the {@link Group Groups} that are included in
{@code sequence}. The resulting structure will contain only {@code ATOM} residues; the SEQ-RES will be empty.
The {@link Chain Chains} of the Structure will be new instances (cloned), but the {@link Group Groups} ... | [
"Get",
"a",
"substructure",
"of",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/StructureSequenceMatcher.java#L65-L94 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/FloatField.java | FloatField.setValue | public int setValue(double value, boolean bDisplayOption, int iMoveMode) {
"""
/*
Set the Value of this field as a double.
Note The value is rounded at the scale position.
@param value The value of this field.
@param iDisplayOption If true, display the new field.
@param iMoveMove The move mode.
@return An er... | java | public int setValue(double value, boolean bDisplayOption, int iMoveMode)
{ // Set this field's value
double dRoundAt = Math.pow(10, m_ibScale);
Float tempfloat = new Float((float)(Math.floor(value * dRoundAt + 0.5) / dRoundAt));
int iErrorCode = this.setData(tempfloat, bDisplayOpti... | [
"public",
"int",
"setValue",
"(",
"double",
"value",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"// Set this field's value",
"double",
"dRoundAt",
"=",
"Math",
".",
"pow",
"(",
"10",
",",
"m_ibScale",
")",
";",
"Float",
"tempfloat",
... | /*
Set the Value of this field as a double.
Note The value is rounded at the scale position.
@param value The value of this field.
@param iDisplayOption If true, display the new field.
@param iMoveMove The move mode.
@return An error code (NORMAL_RETURN for success). | [
"/",
"*",
"Set",
"the",
"Value",
"of",
"this",
"field",
"as",
"a",
"double",
".",
"Note",
"The",
"value",
"is",
"rounded",
"at",
"the",
"scale",
"position",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/FloatField.java#L202-L208 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/sequences/FactoredSequenceListener.java | FactoredSequenceListener.updateSequenceElement | public void updateSequenceElement(int[] sequence, int pos, int oldVal) {
"""
Informs this sequence model that the value of the element at position pos has changed.
This allows this sequence model to update its internal model if desired.
"""
if(models != null){
for(int i = 0; i < models.length; i++... | java | public void updateSequenceElement(int[] sequence, int pos, int oldVal) {
if(models != null){
for(int i = 0; i < models.length; i++)
models[i].updateSequenceElement(sequence, pos, oldVal);
return;
}
model1.updateSequenceElement(sequence, pos, 0);
model2.updateSequenceElement(s... | [
"public",
"void",
"updateSequenceElement",
"(",
"int",
"[",
"]",
"sequence",
",",
"int",
"pos",
",",
"int",
"oldVal",
")",
"{",
"if",
"(",
"models",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"models",
".",
"length",
... | Informs this sequence model that the value of the element at position pos has changed.
This allows this sequence model to update its internal model if desired. | [
"Informs",
"this",
"sequence",
"model",
"that",
"the",
"value",
"of",
"the",
"element",
"at",
"position",
"pos",
"has",
"changed",
".",
"This",
"allows",
"this",
"sequence",
"model",
"to",
"update",
"its",
"internal",
"model",
"if",
"desired",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/sequences/FactoredSequenceListener.java#L18-L26 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/LastaAction.java | LastaAction.doForward | protected HtmlResponse doForward(Class<?> actionType, UrlChain chain) {
"""
Do forward the action with the more URL parts and the the parameters on GET. <br>
This method is to other forward methods so normally you don't use directly from your action.
@param actionType The class type of action that it forwards to... | java | protected HtmlResponse doForward(Class<?> actionType, UrlChain chain) {
assertArgumentNotNull("actionType", actionType);
assertArgumentNotNull("chain", chain);
return newHtmlResponseAsForward(toActionUrl(actionType, chain));
} | [
"protected",
"HtmlResponse",
"doForward",
"(",
"Class",
"<",
"?",
">",
"actionType",
",",
"UrlChain",
"chain",
")",
"{",
"assertArgumentNotNull",
"(",
"\"actionType\"",
",",
"actionType",
")",
";",
"assertArgumentNotNull",
"(",
"\"chain\"",
",",
"chain",
")",
";... | Do forward the action with the more URL parts and the the parameters on GET. <br>
This method is to other forward methods so normally you don't use directly from your action.
@param actionType The class type of action that it forwards to. (NotNull)
@param chain The chain of URL to build additional info on URL. (NotNull... | [
"Do",
"forward",
"the",
"action",
"with",
"the",
"more",
"URL",
"parts",
"and",
"the",
"the",
"parameters",
"on",
"GET",
".",
"<br",
">",
"This",
"method",
"is",
"to",
"other",
"forward",
"methods",
"so",
"normally",
"you",
"don",
"t",
"use",
"directly",... | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/LastaAction.java#L476-L480 |
calimero-project/calimero-core | src/tuwien/auto/calimero/dptxlator/DPTXlatorDateTime.java | DPTXlatorDateTime.setTime | public final void setTime(final int hour, final int minute, final int second) {
"""
Sets the hour, minute and second information for the first date/time item.
<p>
On a hour value of 24, values of minute and second have to be 0.<br>
This method does not reset other item data or discard other translation items.
... | java | public final void setTime(final int hour, final int minute, final int second)
{
if (!check24Hours(hour, minute, second))
throw new KNXIllegalArgumentException("incorrect time");
set(data, 0, HOUR, hour);
set(data, 0, MINUTE, minute);
set(data, 0, SECOND, second);
} | [
"public",
"final",
"void",
"setTime",
"(",
"final",
"int",
"hour",
",",
"final",
"int",
"minute",
",",
"final",
"int",
"second",
")",
"{",
"if",
"(",
"!",
"check24Hours",
"(",
"hour",
",",
"minute",
",",
"second",
")",
")",
"throw",
"new",
"KNXIllegalA... | Sets the hour, minute and second information for the first date/time item.
<p>
On a hour value of 24, values of minute and second have to be 0.<br>
This method does not reset other item data or discard other translation items.
@param hour hour value, 0 <= hour <= 24
@param minute minute value, 0 <= minute <... | [
"Sets",
"the",
"hour",
"minute",
"and",
"second",
"information",
"for",
"the",
"first",
"date",
"/",
"time",
"item",
".",
"<p",
">",
"On",
"a",
"hour",
"value",
"of",
"24",
"values",
"of",
"minute",
"and",
"second",
"have",
"to",
"be",
"0",
".",
"<br... | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/dptxlator/DPTXlatorDateTime.java#L319-L326 |
kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-api/src/main/java/org/kie/server/api/marshalling/MarshallerFactory.java | MarshallerFactory.getMarshaller | public static Marshaller getMarshaller(MarshallingFormat format, ClassLoader classLoader) {
"""
Builds new marshaller for given format and class loader
@param format marshaller format that marshaller should be built for
@param classLoader classloader to be used by the marshaller
@return new instance of the mars... | java | public static Marshaller getMarshaller(MarshallingFormat format, ClassLoader classLoader) {
return getMarshaller(null, format, classLoader);
} | [
"public",
"static",
"Marshaller",
"getMarshaller",
"(",
"MarshallingFormat",
"format",
",",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"getMarshaller",
"(",
"null",
",",
"format",
",",
"classLoader",
")",
";",
"}"
] | Builds new marshaller for given format and class loader
@param format marshaller format that marshaller should be built for
@param classLoader classloader to be used by the marshaller
@return new instance of the marshaller | [
"Builds",
"new",
"marshaller",
"for",
"given",
"format",
"and",
"class",
"loader"
] | train | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-api/src/main/java/org/kie/server/api/marshalling/MarshallerFactory.java#L38-L40 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2beans/BeansToExcelOnTemplate.java | BeansToExcelOnTemplate.mergeCols | private void mergeCols(ExcelRows excelRowsAnn, Cell templateCell, int itemSize) {
"""
根据@ExcelRows注解的指示,合并横向合并单元格。
@param excelRowsAnn @ExcelRows注解值。
@param templateCell 模板单元格。
@param itemSize 在多少行上横向合并单元格。
"""
val tmplRowIndexRef = templateCell.getRowIndex() + 1;
for (val mergeColAnn ... | java | private void mergeCols(ExcelRows excelRowsAnn, Cell templateCell, int itemSize) {
val tmplRowIndexRef = templateCell.getRowIndex() + 1;
for (val mergeColAnn : excelRowsAnn.mergeCols()) {
val from = PoiUtil.findCell(sheet, mergeColAnn.fromColRef() + tmplRowIndexRef);
val to = PoiU... | [
"private",
"void",
"mergeCols",
"(",
"ExcelRows",
"excelRowsAnn",
",",
"Cell",
"templateCell",
",",
"int",
"itemSize",
")",
"{",
"val",
"tmplRowIndexRef",
"=",
"templateCell",
".",
"getRowIndex",
"(",
")",
"+",
"1",
";",
"for",
"(",
"val",
"mergeColAnn",
":"... | 根据@ExcelRows注解的指示,合并横向合并单元格。
@param excelRowsAnn @ExcelRows注解值。
@param templateCell 模板单元格。
@param itemSize 在多少行上横向合并单元格。 | [
"根据@ExcelRows注解的指示,合并横向合并单元格。"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/BeansToExcelOnTemplate.java#L104-L118 |
gallandarakhneorg/afc | advanced/gis/gisroadfx/src/main/java/org/arakhne/afc/gis/road/ui/SimpleViewer.java | SimpleViewer.getElementUnderMouse | @SuppressWarnings( {
"""
Replies the element at the given mouse position.
@param pane the element pane.
@param x the x position of the mouse.
@param y the y position of the mouse.
@return the element.
@since 15.0
""" "rawtypes" })
public MapElement getElementUnderMouse(GisPane<?> pane, double x, double... | java | @SuppressWarnings({ "rawtypes" })
public MapElement getElementUnderMouse(GisPane<?> pane, double x, double y) {
final GISContainer model = pane.getDocumentModel();
final Point2d mousePosition = pane.toDocumentPosition(x, y);
final Rectangle2d selectionArea = pane.toDocumentRect(x - 2, y - 2, 5, 5);
return getE... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
"}",
")",
"public",
"MapElement",
"getElementUnderMouse",
"(",
"GisPane",
"<",
"?",
">",
"pane",
",",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"GISContainer",
"model",
"=",
"pane",
".",
"getDo... | Replies the element at the given mouse position.
@param pane the element pane.
@param x the x position of the mouse.
@param y the y position of the mouse.
@return the element.
@since 15.0 | [
"Replies",
"the",
"element",
"at",
"the",
"given",
"mouse",
"position",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroadfx/src/main/java/org/arakhne/afc/gis/road/ui/SimpleViewer.java#L261-L267 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/ModeUtils.java | ModeUtils.applyUMask | private static Mode applyUMask(Mode mode, Mode umask) {
"""
Applies the given umask {@link Mode} to this mode.
@param mode the mode to update
@param umask the umask to apply
@return the updated object
"""
mode.setOwnerBits(mode.getOwnerBits().and(umask.getOwnerBits().not()));
mode.setGroupBits(mod... | java | private static Mode applyUMask(Mode mode, Mode umask) {
mode.setOwnerBits(mode.getOwnerBits().and(umask.getOwnerBits().not()));
mode.setGroupBits(mode.getGroupBits().and(umask.getGroupBits().not()));
mode.setOtherBits(mode.getOtherBits().and(umask.getOtherBits().not()));
return mode;
} | [
"private",
"static",
"Mode",
"applyUMask",
"(",
"Mode",
"mode",
",",
"Mode",
"umask",
")",
"{",
"mode",
".",
"setOwnerBits",
"(",
"mode",
".",
"getOwnerBits",
"(",
")",
".",
"and",
"(",
"umask",
".",
"getOwnerBits",
"(",
")",
".",
"not",
"(",
")",
")... | Applies the given umask {@link Mode} to this mode.
@param mode the mode to update
@param umask the umask to apply
@return the updated object | [
"Applies",
"the",
"given",
"umask",
"{",
"@link",
"Mode",
"}",
"to",
"this",
"mode",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ModeUtils.java#L73-L78 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableWriteItems.java | TableWriteItems.addHashOnlyPrimaryKeysToDelete | public TableWriteItems addHashOnlyPrimaryKeysToDelete(String hashKeyName,
Object ... hashKeyValues) {
"""
Adds multiple hash-only primary keys to be deleted in a batch write
operation.
@param hashKeyName name of the hash key attribute name
@param hashKeyValues multiple hash key values
@return the... | java | public TableWriteItems addHashOnlyPrimaryKeysToDelete(String hashKeyName,
Object ... hashKeyValues) {
for (Object hashKeyValue: hashKeyValues) {
this.addPrimaryKeyToDelete(new PrimaryKey(hashKeyName, hashKeyValue));
}
return this;
} | [
"public",
"TableWriteItems",
"addHashOnlyPrimaryKeysToDelete",
"(",
"String",
"hashKeyName",
",",
"Object",
"...",
"hashKeyValues",
")",
"{",
"for",
"(",
"Object",
"hashKeyValue",
":",
"hashKeyValues",
")",
"{",
"this",
".",
"addPrimaryKeyToDelete",
"(",
"new",
"Pri... | Adds multiple hash-only primary keys to be deleted in a batch write
operation.
@param hashKeyName name of the hash key attribute name
@param hashKeyValues multiple hash key values
@return the current instance for method chaining purposes | [
"Adds",
"multiple",
"hash",
"-",
"only",
"primary",
"keys",
"to",
"be",
"deleted",
"in",
"a",
"batch",
"write",
"operation",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableWriteItems.java#L170-L176 |
lukas-krecan/json2xml | src/main/java/net/javacrumbs/json2xml/JsonXmlHelper.java | JsonXmlHelper.convertToJson | public static void convertToJson(Node node, JsonGenerator generator, ElementNameConverter converter) throws IOException {
"""
More complete helper method to convert DOM node back to JSON.The node
MUST have the "type" attributes (generated with addTypeAttributes flag
set as true).This method allows to customize t... | java | public static void convertToJson(Node node, JsonGenerator generator, ElementNameConverter converter) throws IOException {
Element element;
if (node instanceof Document) {
element = ((Document) node).getDocumentElement();
} else if (node instanceof Element) {
element = (El... | [
"public",
"static",
"void",
"convertToJson",
"(",
"Node",
"node",
",",
"JsonGenerator",
"generator",
",",
"ElementNameConverter",
"converter",
")",
"throws",
"IOException",
"{",
"Element",
"element",
";",
"if",
"(",
"node",
"instanceof",
"Document",
")",
"{",
"e... | More complete helper method to convert DOM node back to JSON.The node
MUST have the "type" attributes (generated with addTypeAttributes flag
set as true).This method allows to customize the JsonGenerator.
@param node The DOM Node
@param generator A configured JsonGenerator
@param converter Converter to convert element... | [
"More",
"complete",
"helper",
"method",
"to",
"convert",
"DOM",
"node",
"back",
"to",
"JSON",
".",
"The",
"node",
"MUST",
"have",
"the",
"type",
"attributes",
"(",
"generated",
"with",
"addTypeAttributes",
"flag",
"set",
"as",
"true",
")",
".",
"This",
"me... | train | https://github.com/lukas-krecan/json2xml/blob/8fba4f942ebed5d6f7ad851390c634fff8559cac/src/main/java/net/javacrumbs/json2xml/JsonXmlHelper.java#L101-L121 |
forge/furnace | container-api/src/main/java/org/jboss/forge/furnace/util/Strings.java | Strings.rangeOf | public static Range rangeOf(final String beginToken, final String endToken,
final String string, final int fromIndex) {
"""
Return the range from a begining token to an ending token.
@param beginToken String to indicate begining of range.
@param endToken String to indicate ending of range.
@param ... | java | public static Range rangeOf(final String beginToken, final String endToken,
final String string, final int fromIndex)
{
int begin = string.indexOf(beginToken, fromIndex);
if (begin != -1)
{
int end = string.indexOf(endToken, begin + 1);
if (end != -1)
{
... | [
"public",
"static",
"Range",
"rangeOf",
"(",
"final",
"String",
"beginToken",
",",
"final",
"String",
"endToken",
",",
"final",
"String",
"string",
",",
"final",
"int",
"fromIndex",
")",
"{",
"int",
"begin",
"=",
"string",
".",
"indexOf",
"(",
"beginToken",
... | Return the range from a begining token to an ending token.
@param beginToken String to indicate begining of range.
@param endToken String to indicate ending of range.
@param string String to look for range in.
@param fromIndex Beginning index.
@return (begin index, end index) or <i>null</i>. | [
"Return",
"the",
"range",
"from",
"a",
"begining",
"token",
"to",
"an",
"ending",
"token",
"."
] | train | https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/container-api/src/main/java/org/jboss/forge/furnace/util/Strings.java#L359-L374 |
scaleset/scaleset-geo | src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java | GoogleMapsTileMath.tileTopLeft | public Coordinate tileTopLeft(int tx, int ty, int zoomLevel) {
"""
Returns the top-left corner of the specific tile coordinate
@param tx The tile x coordinate
@param ty The tile y coordinate
@param zoomLevel The tile zoom level
@return The EPSG:3857 coordinate of the top-left corner
"""
... | java | public Coordinate tileTopLeft(int tx, int ty, int zoomLevel) {
int px = tx * tileSize;
int py = ty * tileSize;
Coordinate result = pixelsToMeters(px, py, zoomLevel);
return result;
} | [
"public",
"Coordinate",
"tileTopLeft",
"(",
"int",
"tx",
",",
"int",
"ty",
",",
"int",
"zoomLevel",
")",
"{",
"int",
"px",
"=",
"tx",
"*",
"tileSize",
";",
"int",
"py",
"=",
"ty",
"*",
"tileSize",
";",
"Coordinate",
"result",
"=",
"pixelsToMeters",
"("... | Returns the top-left corner of the specific tile coordinate
@param tx The tile x coordinate
@param ty The tile y coordinate
@param zoomLevel The tile zoom level
@return The EPSG:3857 coordinate of the top-left corner | [
"Returns",
"the",
"top",
"-",
"left",
"corner",
"of",
"the",
"specific",
"tile",
"coordinate"
] | train | https://github.com/scaleset/scaleset-geo/blob/5cff2349668037dc287928a6c1a1f67c76d96b02/src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java#L316-L321 |
prestodb/presto | presto-spi/src/main/java/com/facebook/presto/spi/type/UnscaledDecimal128Arithmetic.java | UnscaledDecimal128Arithmetic.scaleDownTenRoundUp | private static void scaleDownTenRoundUp(Slice decimal, int tenScale, Slice result) {
"""
Scale down the value for 10**tenScale (this := this / 5**tenScale). This
method rounds-up, eg 44/10=4, 44/10=5.
"""
boolean round;
do {
int powerTen = Math.min(tenScale, MAX_POWER_OF_TEN_INT);
... | java | private static void scaleDownTenRoundUp(Slice decimal, int tenScale, Slice result)
{
boolean round;
do {
int powerTen = Math.min(tenScale, MAX_POWER_OF_TEN_INT);
tenScale -= powerTen;
int divisor = POWERS_OF_TEN_INT[powerTen];
round = divideCheckRound... | [
"private",
"static",
"void",
"scaleDownTenRoundUp",
"(",
"Slice",
"decimal",
",",
"int",
"tenScale",
",",
"Slice",
"result",
")",
"{",
"boolean",
"round",
";",
"do",
"{",
"int",
"powerTen",
"=",
"Math",
".",
"min",
"(",
"tenScale",
",",
"MAX_POWER_OF_TEN_INT... | Scale down the value for 10**tenScale (this := this / 5**tenScale). This
method rounds-up, eg 44/10=4, 44/10=5. | [
"Scale",
"down",
"the",
"value",
"for",
"10",
"**",
"tenScale",
"(",
"this",
":",
"=",
"this",
"/",
"5",
"**",
"tenScale",
")",
".",
"This",
"method",
"rounds",
"-",
"up",
"eg",
"44",
"/",
"10",
"=",
"4",
"44",
"/",
"10",
"=",
"5",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/type/UnscaledDecimal128Arithmetic.java#L881-L897 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/helpers/ParameterHelper.java | ParameterHelper.parseParametersForFilenamePrefix | public static String parseParametersForFilenamePrefix(Map<String, String> parameters) {
"""
Look for a string to use as a prefix for the names of the journal files.
Default is "fedoraJournal"
"""
return getOptionalStringParameter(parameters,
PARAMETER_JOURNAL_... | java | public static String parseParametersForFilenamePrefix(Map<String, String> parameters) {
return getOptionalStringParameter(parameters,
PARAMETER_JOURNAL_FILENAME_PREFIX,
DEFAULT_FILENAME_PREFIX);
} | [
"public",
"static",
"String",
"parseParametersForFilenamePrefix",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"return",
"getOptionalStringParameter",
"(",
"parameters",
",",
"PARAMETER_JOURNAL_FILENAME_PREFIX",
",",
"DEFAULT_FILENAME_PREFIX",
")... | Look for a string to use as a prefix for the names of the journal files.
Default is "fedoraJournal" | [
"Look",
"for",
"a",
"string",
"to",
"use",
"as",
"a",
"prefix",
"for",
"the",
"names",
"of",
"the",
"journal",
"files",
".",
"Default",
"is",
"fedoraJournal"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/helpers/ParameterHelper.java#L119-L123 |
carewebframework/carewebframework-core | org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/HelpTopicNode.java | HelpTopicNode.addChild | public void addChild(HelpTopicNode node, int index) {
"""
Inserts a child node at the specified position.
@param node Child node to insert.
@param index Insertion position (-1 to append).
"""
node.detach();
node.parent = this;
if (index < 0) {
children.add(node)... | java | public void addChild(HelpTopicNode node, int index) {
node.detach();
node.parent = this;
if (index < 0) {
children.add(node);
} else {
children.add(index, node);
}
} | [
"public",
"void",
"addChild",
"(",
"HelpTopicNode",
"node",
",",
"int",
"index",
")",
"{",
"node",
".",
"detach",
"(",
")",
";",
"node",
".",
"parent",
"=",
"this",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"children",
".",
"add",
"(",
"node",
... | Inserts a child node at the specified position.
@param node Child node to insert.
@param index Insertion position (-1 to append). | [
"Inserts",
"a",
"child",
"node",
"at",
"the",
"specified",
"position",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/HelpTopicNode.java#L152-L161 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/SOS.java | SOS.estimateInitialBeta | @Reference(authors = "Erich Schubert, Michael Gertz", //
title = "Intrinsic t-Stochastic Neighbor Embedding for Visualization and Outlier Detection: A Remedy Against the Curse of Dimensionality?", //
booktitle = "Proc. Int. Conf. Similarity Search and Applications, SISAP'2017", //
url = "https://doi.o... | java | @Reference(authors = "Erich Schubert, Michael Gertz", //
title = "Intrinsic t-Stochastic Neighbor Embedding for Visualization and Outlier Detection: A Remedy Against the Curse of Dimensionality?", //
booktitle = "Proc. Int. Conf. Similarity Search and Applications, SISAP'2017", //
url = "https://doi.o... | [
"@",
"Reference",
"(",
"authors",
"=",
"\"Erich Schubert, Michael Gertz\"",
",",
"//",
"title",
"=",
"\"Intrinsic t-Stochastic Neighbor Embedding for Visualization and Outlier Detection: A Remedy Against the Curse of Dimensionality?\"",
",",
"//",
"booktitle",
"=",
"\"Proc. Int. Conf. ... | Estimate beta from the distances in a row.
<p>
This lacks a thorough mathematical argument, but is a handcrafted heuristic
to avoid numerical problems. The average distance is usually too large, so
we scale the average distance by 2*N/perplexity. Then estimate beta as 1/x.
@param ignore Object to skip
@param it Distan... | [
"Estimate",
"beta",
"from",
"the",
"distances",
"in",
"a",
"row",
".",
"<p",
">",
"This",
"lacks",
"a",
"thorough",
"mathematical",
"argument",
"but",
"is",
"a",
"handcrafted",
"heuristic",
"to",
"avoid",
"numerical",
"problems",
".",
"The",
"average",
"dist... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/SOS.java#L244-L261 |
wisdom-framework/wisdom-jdbc | wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java | AbstractDataSourceFactory.setBeanProperties | static void setBeanProperties(Object object, Properties props)
throws SQLException {
"""
Sets the given properties on the target object.
@param object the object on which the properties need to be set
@param props the properties
@throws SQLException if a property cannot be set.
"""
i... | java | static void setBeanProperties(Object object, Properties props)
throws SQLException {
if (props != null) {
Enumeration<?> enumeration = props.keys();
while (enumeration.hasMoreElements()) {
String name = (String) enumeration.nextElement();
setP... | [
"static",
"void",
"setBeanProperties",
"(",
"Object",
"object",
",",
"Properties",
"props",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"props",
"!=",
"null",
")",
"{",
"Enumeration",
"<",
"?",
">",
"enumeration",
"=",
"props",
".",
"keys",
"(",
")",
... | Sets the given properties on the target object.
@param object the object on which the properties need to be set
@param props the properties
@throws SQLException if a property cannot be set. | [
"Sets",
"the",
"given",
"properties",
"on",
"the",
"target",
"object",
"."
] | train | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java#L123-L133 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/BasePanel.java | BasePanel.displayError | public void displayError(String strError, int iWarningLevel) {
"""
Display a dialog/status box with this error.
@param strError The error text.
@param The level of the error (debug/warning/error/etc).
"""
if ((strError == null) || (strError.length() == 0))
return; // No error
... | java | public void displayError(String strError, int iWarningLevel)
{
if ((strError == null) || (strError.length() == 0))
return; // No error
Task task = this.getTask();
if (task != null)
task.setStatusText(strError, iWarningLevel);
} | [
"public",
"void",
"displayError",
"(",
"String",
"strError",
",",
"int",
"iWarningLevel",
")",
"{",
"if",
"(",
"(",
"strError",
"==",
"null",
")",
"||",
"(",
"strError",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"return",
";",
"// No error",
"Task"... | Display a dialog/status box with this error.
@param strError The error text.
@param The level of the error (debug/warning/error/etc). | [
"Display",
"a",
"dialog",
"/",
"status",
"box",
"with",
"this",
"error",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/BasePanel.java#L370-L377 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/io/FileSupport.java | FileSupport.getContentsInDirectoryTree | private static ArrayList<File> getContentsInDirectoryTree(File directory, String includeMask, boolean returnFiles, boolean returnDirs) {
"""
Retrieves contents from a directory and its subdirectories matching a given mask.
@param directory directory
@param includeMask file name to match
@param returnFiles ret... | java | private static ArrayList<File> getContentsInDirectoryTree(File directory, String includeMask, boolean returnFiles, boolean returnDirs) {
return getContentsInDirectoryTree(directory, new FileFilterRuleSet(directory.getPath()).setIncludeFilesWithNameMask(includeMask), returnFiles, returnDirs);
} | [
"private",
"static",
"ArrayList",
"<",
"File",
">",
"getContentsInDirectoryTree",
"(",
"File",
"directory",
",",
"String",
"includeMask",
",",
"boolean",
"returnFiles",
",",
"boolean",
"returnDirs",
")",
"{",
"return",
"getContentsInDirectoryTree",
"(",
"directory",
... | Retrieves contents from a directory and its subdirectories matching a given mask.
@param directory directory
@param includeMask file name to match
@param returnFiles return files
@param returnDirs return directories
@return a list containing the found contents | [
"Retrieves",
"contents",
"from",
"a",
"directory",
"and",
"its",
"subdirectories",
"matching",
"a",
"given",
"mask",
"."
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/io/FileSupport.java#L127-L129 |
aws/aws-sdk-java | aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/DecryptRequest.java | DecryptRequest.withEncryptionContext | public DecryptRequest withEncryptionContext(java.util.Map<String, String> encryptionContext) {
"""
<p>
The encryption context. If this was specified in the <a>Encrypt</a> function, it must be specified here or the
decryption operation will fail. For more information, see <a
href="http://docs.aws.amazon.com/kms/... | java | public DecryptRequest withEncryptionContext(java.util.Map<String, String> encryptionContext) {
setEncryptionContext(encryptionContext);
return this;
} | [
"public",
"DecryptRequest",
"withEncryptionContext",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"encryptionContext",
")",
"{",
"setEncryptionContext",
"(",
"encryptionContext",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The encryption context. If this was specified in the <a>Encrypt</a> function, it must be specified here or the
decryption operation will fail. For more information, see <a
href="http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html">Encryption Context</a>.
</p>
@param encryptionContext
The e... | [
"<p",
">",
"The",
"encryption",
"context",
".",
"If",
"this",
"was",
"specified",
"in",
"the",
"<a",
">",
"Encrypt<",
"/",
"a",
">",
"function",
"it",
"must",
"be",
"specified",
"here",
"or",
"the",
"decryption",
"operation",
"will",
"fail",
".",
"For",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/DecryptRequest.java#L173-L176 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/command/blobstore.java | blobstore.setupStormCode | private static void setupStormCode(Map conf, String topologyId, String topologyRoot, Set<String> activeKeys)
throws Exception {
"""
create local topology files in blobstore and sync metadata to zk
"""
Map<String, String> blobKeysToLocation = getBlobKeysToLocation(topologyRoot, topologyId);
... | java | private static void setupStormCode(Map conf, String topologyId, String topologyRoot, Set<String> activeKeys)
throws Exception {
Map<String, String> blobKeysToLocation = getBlobKeysToLocation(topologyRoot, topologyId);
for (Map.Entry<String, String> entry : blobKeysToLocation.entrySet()) {
... | [
"private",
"static",
"void",
"setupStormCode",
"(",
"Map",
"conf",
",",
"String",
"topologyId",
",",
"String",
"topologyRoot",
",",
"Set",
"<",
"String",
">",
"activeKeys",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"blobKeysT... | create local topology files in blobstore and sync metadata to zk | [
"create",
"local",
"topology",
"files",
"in",
"blobstore",
"and",
"sync",
"metadata",
"to",
"zk"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/command/blobstore.java#L84-L100 |
hortonworks/dstream | dstream-tez/src/main/java/io/dstream/tez/utils/HadoopUtils.java | HadoopUtils.provisionResourceToFs | public static Path provisionResourceToFs(File localResource, FileSystem fs, String applicationName) throws Exception {
"""
Provisions resource represented as {@link File} to the {@link FileSystem} for a given application
@param localResource
@param fs
@param applicationName
@return
"""
String destinati... | java | public static Path provisionResourceToFs(File localResource, FileSystem fs, String applicationName) throws Exception {
String destinationFilePath = applicationName + "/" + localResource.getName();
Path provisionedPath = new Path(fs.getHomeDirectory(), destinationFilePath);
provisioinResourceToFs(fs, new Path(loca... | [
"public",
"static",
"Path",
"provisionResourceToFs",
"(",
"File",
"localResource",
",",
"FileSystem",
"fs",
",",
"String",
"applicationName",
")",
"throws",
"Exception",
"{",
"String",
"destinationFilePath",
"=",
"applicationName",
"+",
"\"/\"",
"+",
"localResource",
... | Provisions resource represented as {@link File} to the {@link FileSystem} for a given application
@param localResource
@param fs
@param applicationName
@return | [
"Provisions",
"resource",
"represented",
"as",
"{",
"@link",
"File",
"}",
"to",
"the",
"{",
"@link",
"FileSystem",
"}",
"for",
"a",
"given",
"application"
] | train | https://github.com/hortonworks/dstream/blob/3a106c0f14725b028fe7fe2dbc660406d9a5f142/dstream-tez/src/main/java/io/dstream/tez/utils/HadoopUtils.java#L84-L89 |
molgenis/molgenis | molgenis-data/src/main/java/org/molgenis/data/util/PackageUtils.java | PackageUtils.contains | public static boolean contains(Package pack, Package wantedPackage) {
"""
Looks through a {@link Package} and its children to see if the sought-after package is
contained within.
@param pack the package to explore
@param wantedPackage the sought-after package
@return true if the sought-after package was foun... | java | public static boolean contains(Package pack, Package wantedPackage) {
return new PackageTreeTraverser()
.postOrderTraversal(pack)
.anyMatch(childPackage -> Objects.equals(childPackage, wantedPackage));
} | [
"public",
"static",
"boolean",
"contains",
"(",
"Package",
"pack",
",",
"Package",
"wantedPackage",
")",
"{",
"return",
"new",
"PackageTreeTraverser",
"(",
")",
".",
"postOrderTraversal",
"(",
"pack",
")",
".",
"anyMatch",
"(",
"childPackage",
"->",
"Objects",
... | Looks through a {@link Package} and its children to see if the sought-after package is
contained within.
@param pack the package to explore
@param wantedPackage the sought-after package
@return true if the sought-after package was found | [
"Looks",
"through",
"a",
"{",
"@link",
"Package",
"}",
"and",
"its",
"children",
"to",
"see",
"if",
"the",
"sought",
"-",
"after",
"package",
"is",
"contained",
"within",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data/src/main/java/org/molgenis/data/util/PackageUtils.java#L43-L47 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/Preconditions.java | Preconditions.checkBackupCount | public static int checkBackupCount(int newBackupCount, int currentAsyncBackupCount) {
"""
Tests if the newBackupCount count is valid.
@param newBackupCount the number of sync backups
@param currentAsyncBackupCount the current number of async backups
@return the newBackupCount
@throws java.lang.Illeg... | java | public static int checkBackupCount(int newBackupCount, int currentAsyncBackupCount) {
if (newBackupCount < 0) {
throw new IllegalArgumentException("backup-count can't be smaller than 0");
}
if (currentAsyncBackupCount < 0) {
throw new IllegalArgumentException("async-back... | [
"public",
"static",
"int",
"checkBackupCount",
"(",
"int",
"newBackupCount",
",",
"int",
"currentAsyncBackupCount",
")",
"{",
"if",
"(",
"newBackupCount",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"backup-count can't be smaller than 0\"",
... | Tests if the newBackupCount count is valid.
@param newBackupCount the number of sync backups
@param currentAsyncBackupCount the current number of async backups
@return the newBackupCount
@throws java.lang.IllegalArgumentException if newBackupCount is smaller than 0, or larger than the maximum
number of backup... | [
"Tests",
"if",
"the",
"newBackupCount",
"count",
"is",
"valid",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/Preconditions.java#L212-L231 |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/MeterRegistry.java | MeterRegistry.newTimeGauge | protected <T> TimeGauge newTimeGauge(Meter.Id id, @Nullable T obj, TimeUnit valueFunctionUnit, ToDoubleFunction<T> valueFunction) {
"""
Build a new time gauge to be added to the registry. This is guaranteed to only be called if the time gauge doesn't already exist.
@param id The id that uniquely ... | java | protected <T> TimeGauge newTimeGauge(Meter.Id id, @Nullable T obj, TimeUnit valueFunctionUnit, ToDoubleFunction<T> valueFunction) {
Meter.Id withUnit = id.withBaseUnit(getBaseTimeUnitStr());
Gauge gauge = newGauge(withUnit, obj, obj2 -> TimeUtils.convert(valueFunction.applyAsDouble(obj2), valueFunctionU... | [
"protected",
"<",
"T",
">",
"TimeGauge",
"newTimeGauge",
"(",
"Meter",
".",
"Id",
"id",
",",
"@",
"Nullable",
"T",
"obj",
",",
"TimeUnit",
"valueFunctionUnit",
",",
"ToDoubleFunction",
"<",
"T",
">",
"valueFunction",
")",
"{",
"Meter",
".",
"Id",
"withUnit... | Build a new time gauge to be added to the registry. This is guaranteed to only be called if the time gauge doesn't already exist.
@param id The id that uniquely identifies the time gauge.
@param obj The state object from which the value function derives a measurement.
@param valueFunctionU... | [
"Build",
"a",
"new",
"time",
"gauge",
"to",
"be",
"added",
"to",
"the",
"registry",
".",
"This",
"is",
"guaranteed",
"to",
"only",
"be",
"called",
"if",
"the",
"time",
"gauge",
"doesn",
"t",
"already",
"exist",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/MeterRegistry.java#L162-L182 |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/util/IntentUtils.java | IntentUtils.sendSms | public static Intent sendSms(String to, String message) {
"""
Send SMS message using built-in app
@param to Receiver phone number
@param message Text to send
"""
Uri smsUri = Uri.parse("tel:" + to);
Intent intent = new Intent(Intent.ACTION_VIEW, smsUri);
intent.putExtra("addres... | java | public static Intent sendSms(String to, String message) {
Uri smsUri = Uri.parse("tel:" + to);
Intent intent = new Intent(Intent.ACTION_VIEW, smsUri);
intent.putExtra("address", to);
intent.putExtra("sms_body", message);
intent.setType("vnd.android-dir/mms-sms");
return i... | [
"public",
"static",
"Intent",
"sendSms",
"(",
"String",
"to",
",",
"String",
"message",
")",
"{",
"Uri",
"smsUri",
"=",
"Uri",
".",
"parse",
"(",
"\"tel:\"",
"+",
"to",
")",
";",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_VIE... | Send SMS message using built-in app
@param to Receiver phone number
@param message Text to send | [
"Send",
"SMS",
"message",
"using",
"built",
"-",
"in",
"app"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/IntentUtils.java#L117-L124 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java | Constraints.inRangeProperties | public PropertyConstraint inRangeProperties(String propertyName, String minPropertyName, String maxPropertyName) {
"""
Apply a inclusive "range" constraint between two other properties to a
bean property.
@param propertyName the property with the range constraint.
@param minPropertyName the low edge of the ra... | java | public PropertyConstraint inRangeProperties(String propertyName, String minPropertyName, String maxPropertyName) {
Constraint min = gteProperty(propertyName, minPropertyName);
Constraint max = lteProperty(propertyName, maxPropertyName);
return new CompoundPropertyConstraint(new And(min, max));
... | [
"public",
"PropertyConstraint",
"inRangeProperties",
"(",
"String",
"propertyName",
",",
"String",
"minPropertyName",
",",
"String",
"maxPropertyName",
")",
"{",
"Constraint",
"min",
"=",
"gteProperty",
"(",
"propertyName",
",",
"minPropertyName",
")",
";",
"Constrain... | Apply a inclusive "range" constraint between two other properties to a
bean property.
@param propertyName the property with the range constraint.
@param minPropertyName the low edge of the range
@param maxPropertyName the high edge of the range
@return The range constraint constraint | [
"Apply",
"a",
"inclusive",
"range",
"constraint",
"between",
"two",
"other",
"properties",
"to",
"a",
"bean",
"property",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java#L911-L915 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java | PublicIPAddressesInner.listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync | public Observable<ServiceResponse<Page<PublicIPAddressInner>>> listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) {
"""
Gets information about all public IP addresses on a virtual machine scale set level.
@param resourceGr... | java | public Observable<ServiceResponse<Page<PublicIPAddressInner>>> listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) {
return listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSe... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"PublicIPAddressInner",
">",
">",
">",
"listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualMachineScaleSetName",
"... | Gets information about all public IP addresses on a virtual machine scale set level.
@param resourceGroupName The name of the resource group.
@param virtualMachineScaleSetName The name of the virtual machine scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to ... | [
"Gets",
"information",
"about",
"all",
"public",
"IP",
"addresses",
"on",
"a",
"virtual",
"machine",
"scale",
"set",
"level",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java#L1220-L1232 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/message/query/GenericQueryRequest.java | GenericQueryRequest.jsonQuery | public static GenericQueryRequest jsonQuery(String jsonQuery, String bucket, String password, String contextId) {
"""
Create a {@link GenericQueryRequest} and mark it as containing a full N1QL query in Json form
(including additional query parameters like named arguments, etc...).
The simplest form of such a q... | java | public static GenericQueryRequest jsonQuery(String jsonQuery, String bucket, String password, String contextId) {
return new GenericQueryRequest(jsonQuery, true, bucket, bucket, password, null,
contextId, null);
} | [
"public",
"static",
"GenericQueryRequest",
"jsonQuery",
"(",
"String",
"jsonQuery",
",",
"String",
"bucket",
",",
"String",
"password",
",",
"String",
"contextId",
")",
"{",
"return",
"new",
"GenericQueryRequest",
"(",
"jsonQuery",
",",
"true",
",",
"bucket",
",... | Create a {@link GenericQueryRequest} and mark it as containing a full N1QL query in Json form
(including additional query parameters like named arguments, etc...).
The simplest form of such a query is a single statement encapsulated in a json query object:
<pre>{"statement":"SELECT * FROM default"}</pre>.
@param json... | [
"Create",
"a",
"{",
"@link",
"GenericQueryRequest",
"}",
"and",
"mark",
"it",
"as",
"containing",
"a",
"full",
"N1QL",
"query",
"in",
"Json",
"form",
"(",
"including",
"additional",
"query",
"parameters",
"like",
"named",
"arguments",
"etc",
"...",
")",
"."
... | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/message/query/GenericQueryRequest.java#L124-L127 |
weld/core | impl/src/main/java/org/jboss/weld/resolution/CovariantTypes.java | CovariantTypes.isAssignableFrom | private static boolean isAssignableFrom(TypeVariable<?> type1, TypeVariable<?> type2) {
"""
Returns <tt>true</tt> if <tt>type2</tt> is a "sub-variable" of <tt>type1</tt>, i.e. if they are equal or if
<tt>type2</tt> (transitively) extends <tt>type1</tt>.
"""
if (type1.equals(type2)) {
retur... | java | private static boolean isAssignableFrom(TypeVariable<?> type1, TypeVariable<?> type2) {
if (type1.equals(type2)) {
return true;
}
// if a type variable extends another type variable, it cannot declare other bounds
if (type2.getBounds()[0] instanceof TypeVariable<?>) {
... | [
"private",
"static",
"boolean",
"isAssignableFrom",
"(",
"TypeVariable",
"<",
"?",
">",
"type1",
",",
"TypeVariable",
"<",
"?",
">",
"type2",
")",
"{",
"if",
"(",
"type1",
".",
"equals",
"(",
"type2",
")",
")",
"{",
"return",
"true",
";",
"}",
"// if a... | Returns <tt>true</tt> if <tt>type2</tt> is a "sub-variable" of <tt>type1</tt>, i.e. if they are equal or if
<tt>type2</tt> (transitively) extends <tt>type1</tt>. | [
"Returns",
"<tt",
">",
"true<",
"/",
"tt",
">",
"if",
"<tt",
">",
"type2<",
"/",
"tt",
">",
"is",
"a",
"sub",
"-",
"variable",
"of",
"<tt",
">",
"type1<",
"/",
"tt",
">",
"i",
".",
"e",
".",
"if",
"they",
"are",
"equal",
"or",
"if",
"<tt",
">... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/CovariantTypes.java#L269-L278 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java | GeneratedDConnectionDaoImpl.queryByProfileUrl | public Iterable<DConnection> queryByProfileUrl(java.lang.String profileUrl) {
"""
query-by method for field profileUrl
@param profileUrl the specified attribute
@return an Iterable of DConnections for the specified profileUrl
"""
return queryByField(null, DConnectionMapper.Field.PROFILEURL.getFieldName()... | java | public Iterable<DConnection> queryByProfileUrl(java.lang.String profileUrl) {
return queryByField(null, DConnectionMapper.Field.PROFILEURL.getFieldName(), profileUrl);
} | [
"public",
"Iterable",
"<",
"DConnection",
">",
"queryByProfileUrl",
"(",
"java",
".",
"lang",
".",
"String",
"profileUrl",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DConnectionMapper",
".",
"Field",
".",
"PROFILEURL",
".",
"getFieldName",
"(",
")"... | query-by method for field profileUrl
@param profileUrl the specified attribute
@return an Iterable of DConnections for the specified profileUrl | [
"query",
"-",
"by",
"method",
"for",
"field",
"profileUrl"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L106-L108 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WImageRenderer.java | WImageRenderer.renderTagOpen | protected static void renderTagOpen(final WImage imageComponent, final XmlStringBuilder xml) {
"""
Builds the "open tag" part of the XML, that is the tagname and attributes.
E.g. <ui:image src="example.png" alt="some alt txt"
The caller may then append any additional attributes and then close the XML tag.... | java | protected static void renderTagOpen(final WImage imageComponent, final XmlStringBuilder xml) {
// Check for alternative text on the image
String alternativeText = imageComponent.getAlternativeText();
if (alternativeText == null) {
alternativeText = "";
} else {
alternativeText = I18nUtilities.format(null... | [
"protected",
"static",
"void",
"renderTagOpen",
"(",
"final",
"WImage",
"imageComponent",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"// Check for alternative text on the image",
"String",
"alternativeText",
"=",
"imageComponent",
".",
"getAlternativeText",
"(",
"... | Builds the "open tag" part of the XML, that is the tagname and attributes.
E.g. <ui:image src="example.png" alt="some alt txt"
The caller may then append any additional attributes and then close the XML tag.
@param imageComponent The WImage to render.
@param xml The buffer to render the XML into. | [
"Builds",
"the",
"open",
"tag",
"part",
"of",
"the",
"XML",
"that",
"is",
"the",
"tagname",
"and",
"attributes",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WImageRenderer.java#L28-L57 |
OpenTSDB/opentsdb | src/tools/UidManager.java | UidManager.lookupId | private static int lookupId(final HBaseClient client,
final byte[] table,
final short idwidth,
final long lid,
final String kind) {
"""
Looks up an ID and finds the corresponding name(s), if any.... | java | private static int lookupId(final HBaseClient client,
final byte[] table,
final short idwidth,
final long lid,
final String kind) {
final byte[] id = idInBytes(idwidth, lid);
if (id == null) {... | [
"private",
"static",
"int",
"lookupId",
"(",
"final",
"HBaseClient",
"client",
",",
"final",
"byte",
"[",
"]",
"table",
",",
"final",
"short",
"idwidth",
",",
"final",
"long",
"lid",
",",
"final",
"String",
"kind",
")",
"{",
"final",
"byte",
"[",
"]",
... | Looks up an ID and finds the corresponding name(s), if any.
@param client The HBase client to use.
@param table The name of the HBase table to use.
@param idwidth Number of bytes on which the UIDs should be.
@param lid The ID to look for.
@param kind The 'kind' of the ID (can be {@code null}).
@return The exit status o... | [
"Looks",
"up",
"an",
"ID",
"and",
"finds",
"the",
"corresponding",
"name",
"(",
"s",
")",
"if",
"any",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/UidManager.java#L840-L852 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/nearcache/impl/preloader/NearCachePreloader.java | NearCachePreloader.loadKeys | public void loadKeys(DataStructureAdapter<Object, ?> adapter) {
"""
Loads the values via a stored key file into the supplied {@link DataStructureAdapter}.
@param adapter the {@link DataStructureAdapter} to load the values from
"""
if (!storeFile.exists()) {
logger.info(format("Skipped lo... | java | public void loadKeys(DataStructureAdapter<Object, ?> adapter) {
if (!storeFile.exists()) {
logger.info(format("Skipped loading keys of Near Cache %s since storage file doesn't exist (%s)", nearCacheName,
storeFile.getAbsolutePath()));
return;
}
long s... | [
"public",
"void",
"loadKeys",
"(",
"DataStructureAdapter",
"<",
"Object",
",",
"?",
">",
"adapter",
")",
"{",
"if",
"(",
"!",
"storeFile",
".",
"exists",
"(",
")",
")",
"{",
"logger",
".",
"info",
"(",
"format",
"(",
"\"Skipped loading keys of Near Cache %s ... | Loads the values via a stored key file into the supplied {@link DataStructureAdapter}.
@param adapter the {@link DataStructureAdapter} to load the values from | [
"Loads",
"the",
"values",
"via",
"a",
"stored",
"key",
"file",
"into",
"the",
"supplied",
"{",
"@link",
"DataStructureAdapter",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/nearcache/impl/preloader/NearCachePreloader.java#L123-L147 |
spring-cloud/spring-cloud-config | spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/support/PassphraseCredentialsProvider.java | PassphraseCredentialsProvider.get | @Override
public boolean get(URIish uri, CredentialItem... items)
throws UnsupportedCredentialItem {
"""
Ask for the credential items to be populated with the passphrase.
@param uri the URI of the remote resource that needs authentication.
@param items the items the application requires to complete authentic... | java | @Override
public boolean get(URIish uri, CredentialItem... items)
throws UnsupportedCredentialItem {
for (final CredentialItem item : items) {
if (item instanceof CredentialItem.StringType
&& item.getPromptText().startsWith(PROMPT)) {
((CredentialItem.StringType) item).setValue(this.passphrase);
c... | [
"@",
"Override",
"public",
"boolean",
"get",
"(",
"URIish",
"uri",
",",
"CredentialItem",
"...",
"items",
")",
"throws",
"UnsupportedCredentialItem",
"{",
"for",
"(",
"final",
"CredentialItem",
"item",
":",
"items",
")",
"{",
"if",
"(",
"item",
"instanceof",
... | Ask for the credential items to be populated with the passphrase.
@param uri the URI of the remote resource that needs authentication.
@param items the items the application requires to complete authentication.
@return {@code true} if the request was successful and values were supplied;
{@code false} if the user cancel... | [
"Ask",
"for",
"the",
"credential",
"items",
"to",
"be",
"populated",
"with",
"the",
"passphrase",
"."
] | train | https://github.com/spring-cloud/spring-cloud-config/blob/6b99631f78bac4e1b521d2cc126c8b2da45d1f1f/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/support/PassphraseCredentialsProvider.java#L83-L96 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java | SourceInfoMap.getMethodLine | public @CheckForNull
SourceLineRange getMethodLine(String className, String methodName, String methodSignature) {
"""
Look up the line number range for a method.
@param className
name of class containing the method
@param methodName
name of method
@param methodSignature
signature of method
@return the... | java | public @CheckForNull
SourceLineRange getMethodLine(String className, String methodName, String methodSignature) {
return methodLineMap.get(new MethodDescriptor(className, methodName, methodSignature));
} | [
"public",
"@",
"CheckForNull",
"SourceLineRange",
"getMethodLine",
"(",
"String",
"className",
",",
"String",
"methodName",
",",
"String",
"methodSignature",
")",
"{",
"return",
"methodLineMap",
".",
"get",
"(",
"new",
"MethodDescriptor",
"(",
"className",
",",
"m... | Look up the line number range for a method.
@param className
name of class containing the method
@param methodName
name of method
@param methodSignature
signature of method
@return the line number range, or null if no line number is known for the
method | [
"Look",
"up",
"the",
"line",
"number",
"range",
"for",
"a",
"method",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java#L310-L313 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/BigIntegerExtensions.java | BigIntegerExtensions.operator_modulo | @Inline(value="$1.mod($2)")
@Pure
public static BigInteger operator_modulo(BigInteger a, BigInteger b) {
"""
The binary <code>modulo</code> operator.
@param a
a BigInteger. May not be <code>null</code>.
@param b
a BigInteger. May not be <code>null</code>.
@return <code>a.mod(b)</code>
@throws NullPointer... | java | @Inline(value="$1.mod($2)")
@Pure
public static BigInteger operator_modulo(BigInteger a, BigInteger b) {
return a.mod(b);
} | [
"@",
"Inline",
"(",
"value",
"=",
"\"$1.mod($2)\"",
")",
"@",
"Pure",
"public",
"static",
"BigInteger",
"operator_modulo",
"(",
"BigInteger",
"a",
",",
"BigInteger",
"b",
")",
"{",
"return",
"a",
".",
"mod",
"(",
"b",
")",
";",
"}"
] | The binary <code>modulo</code> operator.
@param a
a BigInteger. May not be <code>null</code>.
@param b
a BigInteger. May not be <code>null</code>.
@return <code>a.mod(b)</code>
@throws NullPointerException
if {@code a} or {@code b} is <code>null</code>. | [
"The",
"binary",
"<code",
">",
"modulo<",
"/",
"code",
">",
"operator",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/BigIntegerExtensions.java#L133-L137 |
finmath/finmath-lib | src/main/java/net/finmath/fouriermethod/products/smile/EuropeanOptionSmile.java | EuropeanOptionSmile.getDescriptors | public Map<Double, SingleAssetEuropeanOptionProductDescriptor> getDescriptors(LocalDate referenceDate) {
"""
Return a collection of product descriptors for each option in the smile.
@param referenceDate The reference date (translating the maturity floating point date to dates.
@return a collection of product d... | java | public Map<Double, SingleAssetEuropeanOptionProductDescriptor> getDescriptors(LocalDate referenceDate){
int numberOfStrikes = strikes.length;
HashMap<Double, SingleAssetEuropeanOptionProductDescriptor> descriptors = new HashMap<Double, SingleAssetEuropeanOptionProductDescriptor>();
LocalDate maturityDate = Floa... | [
"public",
"Map",
"<",
"Double",
",",
"SingleAssetEuropeanOptionProductDescriptor",
">",
"getDescriptors",
"(",
"LocalDate",
"referenceDate",
")",
"{",
"int",
"numberOfStrikes",
"=",
"strikes",
".",
"length",
";",
"HashMap",
"<",
"Double",
",",
"SingleAssetEuropeanOpti... | Return a collection of product descriptors for each option in the smile.
@param referenceDate The reference date (translating the maturity floating point date to dates.
@return a collection of product descriptors for each option in the smile. | [
"Return",
"a",
"collection",
"of",
"product",
"descriptors",
"for",
"each",
"option",
"in",
"the",
"smile",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/fouriermethod/products/smile/EuropeanOptionSmile.java#L88-L99 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java | Transactions.begin | public Transaction begin() throws NotSupportedException, SystemException, RollbackException {
"""
Starts a new transaction if one does not already exist, and associate it with the calling thread.
@return the ModeShape transaction
@throws NotSupportedException If the calling thread is already associated with a ... | java | public Transaction begin() throws NotSupportedException, SystemException, RollbackException {
// check if there isn't an active transaction already
NestableThreadLocalTransaction localTx = LOCAL_TRANSACTION.get();
if (localTx != null) {
// we have an existing local transaction so we ... | [
"public",
"Transaction",
"begin",
"(",
")",
"throws",
"NotSupportedException",
",",
"SystemException",
",",
"RollbackException",
"{",
"// check if there isn't an active transaction already",
"NestableThreadLocalTransaction",
"localTx",
"=",
"LOCAL_TRANSACTION",
".",
"get",
"(",... | Starts a new transaction if one does not already exist, and associate it with the calling thread.
@return the ModeShape transaction
@throws NotSupportedException If the calling thread is already associated with a transaction, and nested transactions are
not supported.
@throws SystemException If the transaction service... | [
"Starts",
"a",
"new",
"transaction",
"if",
"one",
"does",
"not",
"already",
"exist",
"and",
"associate",
"it",
"with",
"the",
"calling",
"thread",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java#L141-L186 |
VoltDB/voltdb | examples/windowing/procedures/windowing/InsertAndDeleteAfterDate.java | InsertAndDeleteAfterDate.run | public long run(String uuid, long val, TimestampType update_ts, TimestampType newestToDiscard, long targetMaxRowsToDelete) {
"""
Procedure main logic.
@param uuid Column value for tuple insertion and partitioning key for this procedure.
@param val Column value for tuple insertion.
@param update_ts Column valu... | java | public long run(String uuid, long val, TimestampType update_ts, TimestampType newestToDiscard, long targetMaxRowsToDelete) {
if (newestToDiscard == null) {
throw new VoltAbortException("newestToDiscard shouldn't be null.");
// It might be Long.MIN_VALUE as a TimestampType though.
... | [
"public",
"long",
"run",
"(",
"String",
"uuid",
",",
"long",
"val",
",",
"TimestampType",
"update_ts",
",",
"TimestampType",
"newestToDiscard",
",",
"long",
"targetMaxRowsToDelete",
")",
"{",
"if",
"(",
"newestToDiscard",
"==",
"null",
")",
"{",
"throw",
"new"... | Procedure main logic.
@param uuid Column value for tuple insertion and partitioning key for this procedure.
@param val Column value for tuple insertion.
@param update_ts Column value for tuple insertion.
@param newestToDiscard Try to remove any tuples as old or older than this value.
@param targetMaxRowsToDelete The u... | [
"Procedure",
"main",
"logic",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/windowing/procedures/windowing/InsertAndDeleteAfterDate.java#L74-L107 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WLink.java | WLink.handleRequest | @Override
public void handleRequest(final Request request) {
"""
Override handleRequest in order to perform processing for this component. This implementation checks whether the
link has been pressed via the current ajax operation.
@param request the request being responded to.
"""
// Check if this link... | java | @Override
public void handleRequest(final Request request) {
// Check if this link was the AJAX Trigger
AjaxOperation operation = AjaxHelper.getCurrentOperation();
boolean pressed = (operation != null && getId().equals(operation.getTriggerId()));
// Protect against client-side tampering of disabled/read-only ... | [
"@",
"Override",
"public",
"void",
"handleRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"// Check if this link was the AJAX Trigger",
"AjaxOperation",
"operation",
"=",
"AjaxHelper",
".",
"getCurrentOperation",
"(",
")",
";",
"boolean",
"pressed",
"=",
"(",
... | Override handleRequest in order to perform processing for this component. This implementation checks whether the
link has been pressed via the current ajax operation.
@param request the request being responded to. | [
"Override",
"handleRequest",
"in",
"order",
"to",
"perform",
"processing",
"for",
"this",
"component",
".",
"This",
"implementation",
"checks",
"whether",
"the",
"link",
"has",
"been",
"pressed",
"via",
"the",
"current",
"ajax",
"operation",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WLink.java#L377-L405 |
bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/ScanUploader.java | ScanUploader.createPlan | private ScanPlan createPlan(String scanId, ScanOptions options) {
"""
Returns a ScanPlan based on the Cassandra rings and token ranges.
"""
ScanPlan plan = new ScanPlan(scanId, options);
for (String placement : options.getPlacements()) {
String cluster = _dataTools.getPlacementClus... | java | private ScanPlan createPlan(String scanId, ScanOptions options) {
ScanPlan plan = new ScanPlan(scanId, options);
for (String placement : options.getPlacements()) {
String cluster = _dataTools.getPlacementCluster(placement);
ScanRangeSplits scanRangeSplits = _dataTools.getScanRan... | [
"private",
"ScanPlan",
"createPlan",
"(",
"String",
"scanId",
",",
"ScanOptions",
"options",
")",
"{",
"ScanPlan",
"plan",
"=",
"new",
"ScanPlan",
"(",
"scanId",
",",
"options",
")",
";",
"for",
"(",
"String",
"placement",
":",
"options",
".",
"getPlacements... | Returns a ScanPlan based on the Cassandra rings and token ranges. | [
"Returns",
"a",
"ScanPlan",
"based",
"on",
"the",
"Cassandra",
"rings",
"and",
"token",
"ranges",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/ScanUploader.java#L134-L159 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Element.java | Element.getElementsByAttributeValueStarting | public Elements getElementsByAttributeValueStarting(String key, String valuePrefix) {
"""
Find elements that have attributes that start with the value prefix. Case insensitive.
@param key name of the attribute
@param valuePrefix start of attribute value
@return elements that have attributes that start with th... | java | public Elements getElementsByAttributeValueStarting(String key, String valuePrefix) {
return Collector.collect(new Evaluator.AttributeWithValueStarting(key, valuePrefix), this);
} | [
"public",
"Elements",
"getElementsByAttributeValueStarting",
"(",
"String",
"key",
",",
"String",
"valuePrefix",
")",
"{",
"return",
"Collector",
".",
"collect",
"(",
"new",
"Evaluator",
".",
"AttributeWithValueStarting",
"(",
"key",
",",
"valuePrefix",
")",
",",
... | Find elements that have attributes that start with the value prefix. Case insensitive.
@param key name of the attribute
@param valuePrefix start of attribute value
@return elements that have attributes that start with the value prefix | [
"Find",
"elements",
"that",
"have",
"attributes",
"that",
"start",
"with",
"the",
"value",
"prefix",
".",
"Case",
"insensitive",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L885-L887 |
mguymon/model-citizen | core/src/main/java/com/tobedevoured/modelcitizen/ModelFactory.java | ModelFactory.createModel | public <T> T createModel(Class<T> clazz, boolean withPolicies) throws CreateModelException {
"""
Create a Model for a registered Blueprint
@param <T> model Class
@param clazz Model class
@param withPolicies boolean if Policies should be applied to the create
@return Model
@throws CreateModelException... | java | public <T> T createModel(Class<T> clazz, boolean withPolicies) throws CreateModelException {
Erector erector = erectors.get(clazz);
if (erector == null) {
throw new CreateModelException("Unregistered class: " + clazz);
}
return createModel(erector, null, withPolicies);
... | [
"public",
"<",
"T",
">",
"T",
"createModel",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"boolean",
"withPolicies",
")",
"throws",
"CreateModelException",
"{",
"Erector",
"erector",
"=",
"erectors",
".",
"get",
"(",
"clazz",
")",
";",
"if",
"(",
"erector"... | Create a Model for a registered Blueprint
@param <T> model Class
@param clazz Model class
@param withPolicies boolean if Policies should be applied to the create
@return Model
@throws CreateModelException model failed to create | [
"Create",
"a",
"Model",
"for",
"a",
"registered",
"Blueprint"
] | train | https://github.com/mguymon/model-citizen/blob/9078ab4121897a21e598dd4f0efa6996b46e4dea/core/src/main/java/com/tobedevoured/modelcitizen/ModelFactory.java#L464-L472 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/ProductReservationUrl.java | ProductReservationUrl.getProductReservationUrl | public static MozuUrl getProductReservationUrl(Integer productReservationId, String responseFields) {
"""
Get Resource Url for GetProductReservation
@param productReservationId Unique identifier of the product reservation.
@param responseFields Filtering syntax appended to an API call to increase or decrease the... | java | public static MozuUrl getProductReservationUrl(Integer productReservationId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/productreservations/{productReservationId}?responseFields={responseFields}");
formatter.formatUrl("productReservationId", productReservatio... | [
"public",
"static",
"MozuUrl",
"getProductReservationUrl",
"(",
"Integer",
"productReservationId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/productreservations/{productReservationId}?re... | Get Resource Url for GetProductReservation
@param productReservationId Unique identifier of the product reservation.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to... | [
"Get",
"Resource",
"Url",
"for",
"GetProductReservation"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/ProductReservationUrl.java#L42-L48 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.clickOn | @Conditioned
@Quand("Je clique sur '(.*)-(.*)'[\\.|\\?]")
@When("I click on '(.*)-(.*)'[\\.|\\?]")
public void clickOn(String page, String toClick, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
"""
Click on html element if all 'expected' parameters equals 'actu... | java | @Conditioned
@Quand("Je clique sur '(.*)-(.*)'[\\.|\\?]")
@When("I click on '(.*)-(.*)'[\\.|\\?]")
public void clickOn(String page, String toClick, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
logger.debug("{} clickOn: {}", page, toClick);
clickOn... | [
"@",
"Conditioned",
"@",
"Quand",
"(",
"\"Je clique sur '(.*)-(.*)'[\\\\.|\\\\?]\"",
")",
"@",
"When",
"(",
"\"I click on '(.*)-(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"clickOn",
"(",
"String",
"page",
",",
"String",
"toClick",
",",
"List",
"<",
"GherkinStepCond... | Click on html element if all 'expected' parameters equals 'actual' parameters in conditions.
@param page
The concerned page of toClick
@param toClick
html element.
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@throws TechnicalExcept... | [
"Click",
"on",
"html",
"element",
"if",
"all",
"expected",
"parameters",
"equals",
"actual",
"parameters",
"in",
"conditions",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L384-L390 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java | MediaDescriptorField.createFormat | private RTPFormat createFormat(int payload, Text description) {
"""
Creates or updates format using payload number and text format description.
@param payload the payload number of the format.
@param description text description of the format
@return format object
"""
MediaType mtype = MediaType.fromDes... | java | private RTPFormat createFormat(int payload, Text description) {
MediaType mtype = MediaType.fromDescription(mediaType);
switch (mtype) {
case AUDIO:
return createAudioFormat(payload, description);
case VIDEO:
return createVideoFormat(payload, description);
case APPLICATION:
return createApplicationFo... | [
"private",
"RTPFormat",
"createFormat",
"(",
"int",
"payload",
",",
"Text",
"description",
")",
"{",
"MediaType",
"mtype",
"=",
"MediaType",
".",
"fromDescription",
"(",
"mediaType",
")",
";",
"switch",
"(",
"mtype",
")",
"{",
"case",
"AUDIO",
":",
"return",... | Creates or updates format using payload number and text format description.
@param payload the payload number of the format.
@param description text description of the format
@return format object | [
"Creates",
"or",
"updates",
"format",
"using",
"payload",
"number",
"and",
"text",
"format",
"description",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L400-L412 |
p6spy/p6spy | src/main/java/com/p6spy/engine/common/ConnectionInformation.java | ConnectionInformation.fromDriver | public static ConnectionInformation fromDriver(Driver driver, Connection connection, long timeToGetConnectionNs) {
"""
Creates a new {@link ConnectionInformation} instance for a {@link Connection} which has been obtained via a
{@link Driver}
@param driver the {@link Driver} which created the {@l... | java | public static ConnectionInformation fromDriver(Driver driver, Connection connection, long timeToGetConnectionNs) {
final ConnectionInformation connectionInformation = new ConnectionInformation();
connectionInformation.driver = driver;
connectionInformation.connection = connection;
connectionInformation.... | [
"public",
"static",
"ConnectionInformation",
"fromDriver",
"(",
"Driver",
"driver",
",",
"Connection",
"connection",
",",
"long",
"timeToGetConnectionNs",
")",
"{",
"final",
"ConnectionInformation",
"connectionInformation",
"=",
"new",
"ConnectionInformation",
"(",
")",
... | Creates a new {@link ConnectionInformation} instance for a {@link Connection} which has been obtained via a
{@link Driver}
@param driver the {@link Driver} which created the {@link #connection}
@param connection the {@link #connection} created by the {@link #driver}
@param timeToGetConnection... | [
"Creates",
"a",
"new",
"{",
"@link",
"ConnectionInformation",
"}",
"instance",
"for",
"a",
"{",
"@link",
"Connection",
"}",
"which",
"has",
"been",
"obtained",
"via",
"a",
"{",
"@link",
"Driver",
"}"
] | train | https://github.com/p6spy/p6spy/blob/c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2/src/main/java/com/p6spy/engine/common/ConnectionInformation.java#L55-L61 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.listFirewallRulesAsync | public Observable<Page<FirewallRuleInner>> listFirewallRulesAsync(final String resourceGroupName, final String accountName) {
"""
Lists the Data Lake Store firewall rules within the specified Data Lake Store account.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Store... | java | public Observable<Page<FirewallRuleInner>> listFirewallRulesAsync(final String resourceGroupName, final String accountName) {
return listFirewallRulesWithServiceResponseAsync(resourceGroupName, accountName)
.map(new Func1<ServiceResponse<Page<FirewallRuleInner>>, Page<FirewallRuleInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"FirewallRuleInner",
">",
">",
"listFirewallRulesAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
")",
"{",
"return",
"listFirewallRulesWithServiceResponseAsync",
"(",
"resourceGroupName"... | Lists the Data Lake Store firewall rules within the specified Data Lake Store account.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account.
@param accountName The name of the Data Lake Store account from which to get the firewall rules.
@throws IllegalArgumentExcepti... | [
"Lists",
"the",
"Data",
"Lake",
"Store",
"firewall",
"rules",
"within",
"the",
"specified",
"Data",
"Lake",
"Store",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java#L374-L382 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseAdditiveExpression | private Expr parseAdditiveExpression(EnclosingScope scope, boolean terminated) {
"""
Parse an additive expression.
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates that... | java | private Expr parseAdditiveExpression(EnclosingScope scope, boolean terminated) {
int start = index;
Expr lhs = parseMultiplicativeExpression(scope, terminated);
Token lookahead;
while ((lookahead = tryAndMatch(terminated, Plus, Minus)) != null) {
Expr rhs = parseMultiplicativeExpression(scope, terminated);
... | [
"private",
"Expr",
"parseAdditiveExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"Expr",
"lhs",
"=",
"parseMultiplicativeExpression",
"(",
"scope",
",",
"terminated",
")",
";",
"Token",
"loo... | Parse an additive expression.
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates that the expression is known to be terminated
(or not). An expression that's known to be terminated i... | [
"Parse",
"an",
"additive",
"expression",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L2076-L2096 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java | DateTieredCompactionStrategy.getNow | private long getNow() {
"""
Gets the timestamp that DateTieredCompactionStrategy considers to be the "current time".
@return the maximum timestamp across all SSTables.
@throws java.util.NoSuchElementException if there are no SSTables.
"""
return Collections.max(cfs.getSSTables(), new Comparator<SSTab... | java | private long getNow()
{
return Collections.max(cfs.getSSTables(), new Comparator<SSTableReader>()
{
public int compare(SSTableReader o1, SSTableReader o2)
{
return Long.compare(o1.getMaxTimestamp(), o2.getMaxTimestamp());
}
}).getMaxTimesta... | [
"private",
"long",
"getNow",
"(",
")",
"{",
"return",
"Collections",
".",
"max",
"(",
"cfs",
".",
"getSSTables",
"(",
")",
",",
"new",
"Comparator",
"<",
"SSTableReader",
">",
"(",
")",
"{",
"public",
"int",
"compare",
"(",
"SSTableReader",
"o1",
",",
... | Gets the timestamp that DateTieredCompactionStrategy considers to be the "current time".
@return the maximum timestamp across all SSTables.
@throws java.util.NoSuchElementException if there are no SSTables. | [
"Gets",
"the",
"timestamp",
"that",
"DateTieredCompactionStrategy",
"considers",
"to",
"be",
"the",
"current",
"time",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java#L138-L147 |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/network/Routing.java | Routing.getMaxBW | public int getMaxBW(Node n1, Node n2) {
"""
Get the maximal bandwidth available between two nodes.
@param n1 the source node
@param n2 the destination node
@return the bandwidth
"""
int max = Integer.MAX_VALUE;
for (Link inf : getPath(n1, n2)) {
if (inf.getCapacity() < m... | java | public int getMaxBW(Node n1, Node n2) {
int max = Integer.MAX_VALUE;
for (Link inf : getPath(n1, n2)) {
if (inf.getCapacity() < max) {
max = inf.getCapacity();
}
Switch sw = inf.getSwitch();
if (sw.getCapacity() >= 0 && sw.getCapacity() < m... | [
"public",
"int",
"getMaxBW",
"(",
"Node",
"n1",
",",
"Node",
"n2",
")",
"{",
"int",
"max",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"for",
"(",
"Link",
"inf",
":",
"getPath",
"(",
"n1",
",",
"n2",
")",
")",
"{",
"if",
"(",
"inf",
".",
"getCapacity"... | Get the maximal bandwidth available between two nodes.
@param n1 the source node
@param n2 the destination node
@return the bandwidth | [
"Get",
"the",
"maximal",
"bandwidth",
"available",
"between",
"two",
"nodes",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/Routing.java#L89-L103 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelUtilsBase.java | ChannelUtilsBase.traceDebugStack | protected final void traceDebugStack(Object logTool, Throwable t, String message) {
"""
Print debug stacktrace using given trace component. -- Use tc of CALLER,
so that this appears with it's trace..
@param logTool
Caller's LogTool (should be Logger OR TraceComponent)
@param t
Throwable (contains execution ... | java | protected final void traceDebugStack(Object logTool, Throwable t, String message) {
StackTraceElement[] stack = t.getStackTrace();
if (stack != null) {
// convert stack trace to a string
StringBuilder stackTrace = new StringBuilder();
for (int i = 0; i < stack.lengt... | [
"protected",
"final",
"void",
"traceDebugStack",
"(",
"Object",
"logTool",
",",
"Throwable",
"t",
",",
"String",
"message",
")",
"{",
"StackTraceElement",
"[",
"]",
"stack",
"=",
"t",
".",
"getStackTrace",
"(",
")",
";",
"if",
"(",
"stack",
"!=",
"null",
... | Print debug stacktrace using given trace component. -- Use tc of CALLER,
so that this appears with it's trace..
@param logTool
Caller's LogTool (should be Logger OR TraceComponent)
@param t
Throwable (contains execution stack)
@param message
String to accompany stack trace | [
"Print",
"debug",
"stacktrace",
"using",
"given",
"trace",
"component",
".",
"--",
"Use",
"tc",
"of",
"CALLER",
"so",
"that",
"this",
"appears",
"with",
"it",
"s",
"trace",
".."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelUtilsBase.java#L256-L270 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getImagePerformanceCount | public int getImagePerformanceCount(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) {
"""
Gets the number of images tagged with the provided {tagIds} that have prediction results from
training for the provided iteration {iterationId}.
The fil... | java | public int getImagePerformanceCount(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) {
return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, getImagePerformanceCountOptionalParameter).toBlocking().single().body();
... | [
"public",
"int",
"getImagePerformanceCount",
"(",
"UUID",
"projectId",
",",
"UUID",
"iterationId",
",",
"GetImagePerformanceCountOptionalParameter",
"getImagePerformanceCountOptionalParameter",
")",
"{",
"return",
"getImagePerformanceCountWithServiceResponseAsync",
"(",
"projectId"... | Gets the number of images tagged with the provided {tagIds} that have prediction results from
training for the provided iteration {iterationId}.
The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
"Cat" tags, then only images tagged with Dog and/or Cat will be returned... | [
"Gets",
"the",
"number",
"of",
"images",
"tagged",
"with",
"the",
"provided",
"{",
"tagIds",
"}",
"that",
"have",
"prediction",
"results",
"from",
"training",
"for",
"the",
"provided",
"iteration",
"{",
"iterationId",
"}",
".",
"The",
"filtering",
"is",
"on"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L1217-L1219 |
vkostyukov/la4j | src/main/java/org/la4j/matrix/SparseMatrix.java | SparseMatrix.randomSymmetric | public static SparseMatrix randomSymmetric(int size, double density, Random random) {
"""
Creates a random symmetric {@link SparseMatrix} of the given {@code size}.
"""
return CRSMatrix.randomSymmetric(size, density, random);
} | java | public static SparseMatrix randomSymmetric(int size, double density, Random random) {
return CRSMatrix.randomSymmetric(size, density, random);
} | [
"public",
"static",
"SparseMatrix",
"randomSymmetric",
"(",
"int",
"size",
",",
"double",
"density",
",",
"Random",
"random",
")",
"{",
"return",
"CRSMatrix",
".",
"randomSymmetric",
"(",
"size",
",",
"density",
",",
"random",
")",
";",
"}"
] | Creates a random symmetric {@link SparseMatrix} of the given {@code size}. | [
"Creates",
"a",
"random",
"symmetric",
"{"
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/matrix/SparseMatrix.java#L101-L103 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlUtils.java | ControlUtils.resolveDefaultBinding | public static String resolveDefaultBinding( String implBinding, String controlClass ) {
"""
Implements the default control implementation binding algorithm ( <InterfaceName> + "Impl" ). See
documentation for the org.apache.beehive.controls.api.bean.ControlInterface annotation.
@param implBinding the value of ... | java | public static String resolveDefaultBinding( String implBinding, String controlClass )
{
int intfIndex = implBinding.indexOf(ControlInterface.INTERFACE_NAME);
if (intfIndex >= 0)
{
implBinding = implBinding.substring(0,intfIndex) + controlClass +
implBind... | [
"public",
"static",
"String",
"resolveDefaultBinding",
"(",
"String",
"implBinding",
",",
"String",
"controlClass",
")",
"{",
"int",
"intfIndex",
"=",
"implBinding",
".",
"indexOf",
"(",
"ControlInterface",
".",
"INTERFACE_NAME",
")",
";",
"if",
"(",
"intfIndex",
... | Implements the default control implementation binding algorithm ( <InterfaceName> + "Impl" ). See
documentation for the org.apache.beehive.controls.api.bean.ControlInterface annotation.
@param implBinding the value of the defaultBinding attribute returned from a ControlInterface annotation
@param controlClass the act... | [
"Implements",
"the",
"default",
"control",
"implementation",
"binding",
"algorithm",
"(",
"<InterfaceName",
">",
"+",
"Impl",
")",
".",
"See",
"documentation",
"for",
"the",
"org",
".",
"apache",
".",
"beehive",
".",
"controls",
".",
"api",
".",
"bean",
".",... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlUtils.java#L40-L50 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/DiskTreebank.java | DiskTreebank.loadPath | @Override
public void loadPath(File path, FileFilter filt) {
"""
Load trees from given directory. This version just records
the paths to be processed, and actually processes them at apply time.
@param path file or directory to load from
@param filt a FilenameFilter of files to load
"""
if(path.ex... | java | @Override
public void loadPath(File path, FileFilter filt) {
if(path.exists()) {
filePaths.add(path);
fileFilters.add(filt);
} else {
System.err.printf("%s: File/path %s does not exist. Skipping.\n" , this.getClass().getName(), path.getPath());
}
} | [
"@",
"Override",
"public",
"void",
"loadPath",
"(",
"File",
"path",
",",
"FileFilter",
"filt",
")",
"{",
"if",
"(",
"path",
".",
"exists",
"(",
")",
")",
"{",
"filePaths",
".",
"add",
"(",
"path",
")",
";",
"fileFilters",
".",
"add",
"(",
"filt",
"... | Load trees from given directory. This version just records
the paths to be processed, and actually processes them at apply time.
@param path file or directory to load from
@param filt a FilenameFilter of files to load | [
"Load",
"trees",
"from",
"given",
"directory",
".",
"This",
"version",
"just",
"records",
"the",
"paths",
"to",
"be",
"processed",
"and",
"actually",
"processes",
"them",
"at",
"apply",
"time",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/DiskTreebank.java#L112-L120 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.updateConversation | public Observable<ComapiResult<ConversationDetails>> updateConversation(@NonNull final String conversationId, @NonNull final ConversationUpdate request, @Nullable final String eTag) {
"""
Returns observable to update a conversation.
@param conversationId ID of a conversation to update.
@param request Re... | java | public Observable<ComapiResult<ConversationDetails>> updateConversation(@NonNull final String conversationId, @NonNull final ConversationUpdate request, @Nullable final String eTag) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queueU... | [
"public",
"Observable",
"<",
"ComapiResult",
"<",
"ConversationDetails",
">",
">",
"updateConversation",
"(",
"@",
"NonNull",
"final",
"String",
"conversationId",
",",
"@",
"NonNull",
"final",
"ConversationUpdate",
"request",
",",
"@",
"Nullable",
"final",
"String",... | Returns observable to update a conversation.
@param conversationId ID of a conversation to update.
@param request Request with conversation details to update.
@param eTag Tag to specify local data version.
@return Observable to update a conversation. | [
"Returns",
"observable",
"to",
"update",
"a",
"conversation",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L574-L585 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareRegularClustersIntoGrids.java | SquareRegularClustersIntoGrids.pickNot | static SquareNode pickNot( SquareNode target , SquareNode child0 , SquareNode child1 ) {
"""
There are only three edges on target and two of them are known. Pick the one which isn't an inptu child
"""
for (int i = 0; i < 4; i++) {
SquareEdge e = target.edges[i];
if( e == null ) continue;
SquareNode... | java | static SquareNode pickNot( SquareNode target , SquareNode child0 , SquareNode child1 ) {
for (int i = 0; i < 4; i++) {
SquareEdge e = target.edges[i];
if( e == null ) continue;
SquareNode c = e.destination(target);
if( c != child0 && c != child1 )
return c;
}
throw new RuntimeException("There was ... | [
"static",
"SquareNode",
"pickNot",
"(",
"SquareNode",
"target",
",",
"SquareNode",
"child0",
",",
"SquareNode",
"child1",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"4",
";",
"i",
"++",
")",
"{",
"SquareEdge",
"e",
"=",
"target",
".",... | There are only three edges on target and two of them are known. Pick the one which isn't an inptu child | [
"There",
"are",
"only",
"three",
"edges",
"on",
"target",
"and",
"two",
"of",
"them",
"are",
"known",
".",
"Pick",
"the",
"one",
"which",
"isn",
"t",
"an",
"inptu",
"child"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareRegularClustersIntoGrids.java#L349-L358 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/StringUtil.java | StringUtil.substituteWithEnvironment | public static String substituteWithEnvironment(String string0) throws SubstitutionException {
"""
Searches the string for occurrences of the pattern $ENV{key} and
attempts to replace this pattern with a value from the System environment
obtained using the 'key'. For example, including "$ENV{USERNAME}" in
a str... | java | public static String substituteWithEnvironment(String string0) throws SubstitutionException {
// turn environment into properties
Properties envProps = new Properties();
// add all system environment vars to the properties
envProps.putAll(System.getenv());
// delegate to other me... | [
"public",
"static",
"String",
"substituteWithEnvironment",
"(",
"String",
"string0",
")",
"throws",
"SubstitutionException",
"{",
"// turn environment into properties",
"Properties",
"envProps",
"=",
"new",
"Properties",
"(",
")",
";",
"// add all system environment vars to t... | Searches the string for occurrences of the pattern $ENV{key} and
attempts to replace this pattern with a value from the System environment
obtained using the 'key'. For example, including "$ENV{USERNAME}" in
a string and calling this method would then attempt to replace the entire
pattern with the value of the environ... | [
"Searches",
"the",
"string",
"for",
"occurrences",
"of",
"the",
"pattern",
"$ENV",
"{",
"key",
"}",
"and",
"attempts",
"to",
"replace",
"this",
"pattern",
"with",
"a",
"value",
"from",
"the",
"System",
"environment",
"obtained",
"using",
"the",
"key",
".",
... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/StringUtil.java#L70-L77 |
paymill/paymill-java | src/main/java/com/paymill/services/PaymentService.java | PaymentService.createWithTokenAndClient | public Payment createWithTokenAndClient( String token, Client client ) {
"""
Creates a credit card or direct debit {@link Payment} from a given token. With the provided {@link Client}, the
{@link Payment} will be created and subsequently be added to the given {@link Client}.
@param token
Token generated by PAYM... | java | public Payment createWithTokenAndClient( String token, Client client ) {
if( client == null )
throw new IllegalArgumentException( "Client can not be null" );
return this.createWithTokenAndClient( token, client.getId() );
} | [
"public",
"Payment",
"createWithTokenAndClient",
"(",
"String",
"token",
",",
"Client",
"client",
")",
"{",
"if",
"(",
"client",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Client can not be null\"",
")",
";",
"return",
"this",
".",
"c... | Creates a credit card or direct debit {@link Payment} from a given token. With the provided {@link Client}, the
{@link Payment} will be created and subsequently be added to the given {@link Client}.
@param token
Token generated by PAYMILL Bridge, which represents a credit card or direct debit.
@param client
A {@link Cl... | [
"Creates",
"a",
"credit",
"card",
"or",
"direct",
"debit",
"{"
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/PaymentService.java#L119-L123 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/HerokuAPI.java | HerokuAPI.getSlugInfo | public Slug getSlugInfo(String appName, String slugId) {
"""
Gets the slug info for an existing slug
@param appName See {@link #listApps} for a list of apps that can be used.
@param slugId the unique identifier of the slug
"""
return connection.execute(new SlugInfo(appName, slugId), apiKey);
} | java | public Slug getSlugInfo(String appName, String slugId) {
return connection.execute(new SlugInfo(appName, slugId), apiKey);
} | [
"public",
"Slug",
"getSlugInfo",
"(",
"String",
"appName",
",",
"String",
"slugId",
")",
"{",
"return",
"connection",
".",
"execute",
"(",
"new",
"SlugInfo",
"(",
"appName",
",",
"slugId",
")",
",",
"apiKey",
")",
";",
"}"
] | Gets the slug info for an existing slug
@param appName See {@link #listApps} for a list of apps that can be used.
@param slugId the unique identifier of the slug | [
"Gets",
"the",
"slug",
"info",
"for",
"an",
"existing",
"slug"
] | train | https://github.com/heroku/heroku.jar/blob/d9e52991293159498c10c498c6f91fcdd637378e/heroku-api/src/main/java/com/heroku/api/HerokuAPI.java#L423-L425 |
bartprokop/rxtx | src/main/java/gnu/io/RXTXPort.java | RXTXPort.staticSetDSR | public static boolean staticSetDSR(String port, boolean flag)
throws UnsupportedCommOperationException {
"""
Extension to CommAPI This is an extension to CommAPI. It may not be
supported on all operating systems.
Open the port and set DSR. remove lockfile and do not close This is so
some software ... | java | public static boolean staticSetDSR(String port, boolean flag)
throws UnsupportedCommOperationException {
logger.fine("RXTXPort:staticSetDSR( " + port
+ " " + flag);
return (nativeStaticSetDSR(port, flag));
} | [
"public",
"static",
"boolean",
"staticSetDSR",
"(",
"String",
"port",
",",
"boolean",
"flag",
")",
"throws",
"UnsupportedCommOperationException",
"{",
"logger",
".",
"fine",
"(",
"\"RXTXPort:staticSetDSR( \"",
"+",
"port",
"+",
"\" \"",
"+",
"flag",
")",
";",
"r... | Extension to CommAPI This is an extension to CommAPI. It may not be
supported on all operating systems.
Open the port and set DSR. remove lockfile and do not close This is so
some software can appear to set the DSR before 'opening' the port a
second time later on.
@param port port name
@param flag flag value
@return ... | [
"Extension",
"to",
"CommAPI",
"This",
"is",
"an",
"extension",
"to",
"CommAPI",
".",
"It",
"may",
"not",
"be",
"supported",
"on",
"all",
"operating",
"systems",
"."
] | train | https://github.com/bartprokop/rxtx/blob/7b2c7857c262743e9dd15e9779c880b93c650890/src/main/java/gnu/io/RXTXPort.java#L1742-L1748 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java | Util.createMatchAllQuery | public static Query createMatchAllQuery(String name, IndexFormatVersion version) {
"""
Depending on the index format this method returns a query that matches
all nodes that have a property with a given <code>name</code>.
@param name the property name.
@param version the index format version.
@return Query... | java | public static Query createMatchAllQuery(String name, IndexFormatVersion version)
{
if (version.getVersion() >= IndexFormatVersion.V2.getVersion())
{
// new index format style
return new JcrTermQuery(new Term(FieldNames.PROPERTIES_SET, name));
}
else
{
return n... | [
"public",
"static",
"Query",
"createMatchAllQuery",
"(",
"String",
"name",
",",
"IndexFormatVersion",
"version",
")",
"{",
"if",
"(",
"version",
".",
"getVersion",
"(",
")",
">=",
"IndexFormatVersion",
".",
"V2",
".",
"getVersion",
"(",
")",
")",
"{",
"// ne... | Depending on the index format this method returns a query that matches
all nodes that have a property with a given <code>name</code>.
@param name the property name.
@param version the index format version.
@return Query that matches all nodes that have a property with the given
<code>name</code>. | [
"Depending",
"on",
"the",
"index",
"format",
"this",
"method",
"returns",
"a",
"query",
"that",
"matches",
"all",
"nodes",
"that",
"have",
"a",
"property",
"with",
"a",
"given",
"<code",
">",
"name<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java#L89-L100 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.readCustomLayout | public static InputStream readCustomLayout(Class<? extends Component> layoutClass, String relativeName) {
"""
Reads a layout from a resource, applies basic i18n macro substitution on the contained text, and returns a stream of the transformed
data.<p>
@param layoutClass the class relative to which the layout r... | java | public static InputStream readCustomLayout(Class<? extends Component> layoutClass, String relativeName) {
CmsMacroResolver resolver = new CmsMacroResolver() {
@Override
public String getMacroValue(String macro) {
return CmsEncoder.escapeXml(super.getMacroValue(macro));... | [
"public",
"static",
"InputStream",
"readCustomLayout",
"(",
"Class",
"<",
"?",
"extends",
"Component",
">",
"layoutClass",
",",
"String",
"relativeName",
")",
"{",
"CmsMacroResolver",
"resolver",
"=",
"new",
"CmsMacroResolver",
"(",
")",
"{",
"@",
"Override",
"p... | Reads a layout from a resource, applies basic i18n macro substitution on the contained text, and returns a stream of the transformed
data.<p>
@param layoutClass the class relative to which the layout resource will be looked up
@param relativeName the file name of the layout file
@return an input stream which produces... | [
"Reads",
"a",
"layout",
"from",
"a",
"resource",
"applies",
"basic",
"i18n",
"macro",
"substitution",
"on",
"the",
"contained",
"text",
"and",
"returns",
"a",
"stream",
"of",
"the",
"transformed",
"data",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L1082-L1097 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.getAllCurrencyID | public List<Integer> getAllCurrencyID() throws GuildWars2Exception {
"""
For more info on Currency API go <a href="https://wiki.guildwars2.com/wiki/API:2/currencies">here</a><br/>
Get all currency ids
@return list of currency ids
@throws GuildWars2Exception see {@link ErrorCode} for detail
@see Currency curr... | java | public List<Integer> getAllCurrencyID() throws GuildWars2Exception {
try {
Response<List<Integer>> response = gw2API.getAllCurrencies().execute();
if (!response.isSuccessful()) throwError(response.code(), response.errorBody());
return response.body();
} catch (IOException e) {
throw new GuildWars2Except... | [
"public",
"List",
"<",
"Integer",
">",
"getAllCurrencyID",
"(",
")",
"throws",
"GuildWars2Exception",
"{",
"try",
"{",
"Response",
"<",
"List",
"<",
"Integer",
">>",
"response",
"=",
"gw2API",
".",
"getAllCurrencies",
"(",
")",
".",
"execute",
"(",
")",
";... | For more info on Currency API go <a href="https://wiki.guildwars2.com/wiki/API:2/currencies">here</a><br/>
Get all currency ids
@return list of currency ids
@throws GuildWars2Exception see {@link ErrorCode} for detail
@see Currency currency info | [
"For",
"more",
"info",
"on",
"Currency",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"currencies",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Get",
"all",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L1667-L1675 |
wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java | RamlControllerVisitor.normalizeActionPath | private String normalizeActionPath(Resource parent, String uri) {
"""
A method normalizing "action" path. In RAML action path must always starts with a "/".
@param parent the parent resource
@param uri the path to normalize
@return the normalized path
"""
String relativeUri = extractRelativeUrl... | java | private String normalizeActionPath(Resource parent, String uri) {
String relativeUri = extractRelativeUrl(uri, parent.getUri());
if (!relativeUri.startsWith("/")) {
relativeUri = "/" + relativeUri;
}
return relativeUri;
} | [
"private",
"String",
"normalizeActionPath",
"(",
"Resource",
"parent",
",",
"String",
"uri",
")",
"{",
"String",
"relativeUri",
"=",
"extractRelativeUrl",
"(",
"uri",
",",
"parent",
".",
"getUri",
"(",
")",
")",
";",
"if",
"(",
"!",
"relativeUri",
".",
"st... | A method normalizing "action" path. In RAML action path must always starts with a "/".
@param parent the parent resource
@param uri the path to normalize
@return the normalized path | [
"A",
"method",
"normalizing",
"action",
"path",
".",
"In",
"RAML",
"action",
"path",
"must",
"always",
"starts",
"with",
"a",
"/",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java#L201-L207 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java | CommandGroup.createButtonBar | public JComponent createButtonBar(final Size minimumButtonSize, final Border border) {
"""
Create a button bar with buttons for all the commands in this.
@param minimumButtonSize if null, then there is no minimum size
@param border if null, then don't use a border
@return never null
"""
return createB... | java | public JComponent createButtonBar(final Size minimumButtonSize, final Border border) {
return createButtonBar(minimumButtonSize == null ? null : new ColumnSpec(minimumButtonSize), null, border);
} | [
"public",
"JComponent",
"createButtonBar",
"(",
"final",
"Size",
"minimumButtonSize",
",",
"final",
"Border",
"border",
")",
"{",
"return",
"createButtonBar",
"(",
"minimumButtonSize",
"==",
"null",
"?",
"null",
":",
"new",
"ColumnSpec",
"(",
"minimumButtonSize",
... | Create a button bar with buttons for all the commands in this.
@param minimumButtonSize if null, then there is no minimum size
@param border if null, then don't use a border
@return never null | [
"Create",
"a",
"button",
"bar",
"with",
"buttons",
"for",
"all",
"the",
"commands",
"in",
"this",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L458-L460 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendTextBlocking | public static void sendTextBlocking(final ByteBuffer message, final WebSocketChannel wsChannel) throws IOException {
"""
Sends a complete text message, invoking the callback when complete
@param message The text to send
@param wsChannel The web socket channel
"""
sendBlockingInternal(message, WebSo... | java | public static void sendTextBlocking(final ByteBuffer message, final WebSocketChannel wsChannel) throws IOException {
sendBlockingInternal(message, WebSocketFrameType.TEXT, wsChannel);
} | [
"public",
"static",
"void",
"sendTextBlocking",
"(",
"final",
"ByteBuffer",
"message",
",",
"final",
"WebSocketChannel",
"wsChannel",
")",
"throws",
"IOException",
"{",
"sendBlockingInternal",
"(",
"message",
",",
"WebSocketFrameType",
".",
"TEXT",
",",
"wsChannel",
... | Sends a complete text message, invoking the callback when complete
@param message The text to send
@param wsChannel The web socket channel | [
"Sends",
"a",
"complete",
"text",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L209-L211 |
openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java | SVGIcon.seBackgroundIconColor | public void seBackgroundIconColor(final Color color, final Color outline, final double width) {
"""
Method sets the icon color and a stroke with a given color and width.
@param color color for the background icon to be set
@param outline color for the stroke
@param width width of the stroke
"""
... | java | public void seBackgroundIconColor(final Color color, final Color outline, final double width) {
setBackgroundIconColor(color);
backgroundIcon.setStroke(outline);
backgroundIcon.setStrokeWidth(width);
} | [
"public",
"void",
"seBackgroundIconColor",
"(",
"final",
"Color",
"color",
",",
"final",
"Color",
"outline",
",",
"final",
"double",
"width",
")",
"{",
"setBackgroundIconColor",
"(",
"color",
")",
";",
"backgroundIcon",
".",
"setStroke",
"(",
"outline",
")",
"... | Method sets the icon color and a stroke with a given color and width.
@param color color for the background icon to be set
@param outline color for the stroke
@param width width of the stroke | [
"Method",
"sets",
"the",
"icon",
"color",
"and",
"a",
"stroke",
"with",
"a",
"given",
"color",
"and",
"width",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L479-L483 |
virgo47/javasimon | javaee/src/main/java/org/javasimon/javaee/SimonServletFilterUtils.java | SimonServletFilterUtils.getSimonName | public static String getSimonName(String uri, Replacer unallowedCharacterReplacer) {
"""
Returns Simon name for the specified request (local name without any configured prefix). By default dots and all non-simon-name
compliant characters are removed first, then all slashes are switched to dots (repeating slashes ... | java | public static String getSimonName(String uri, Replacer unallowedCharacterReplacer) {
if (uri.startsWith("/")) {
uri = uri.substring(1);
}
String name = unallowedCharacterReplacer.process(uri);
name = TO_DOT_PATTERN.process(name);
return name;
} | [
"public",
"static",
"String",
"getSimonName",
"(",
"String",
"uri",
",",
"Replacer",
"unallowedCharacterReplacer",
")",
"{",
"if",
"(",
"uri",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"uri",
"=",
"uri",
".",
"substring",
"(",
"1",
")",
";",
"}",
... | Returns Simon name for the specified request (local name without any configured prefix). By default dots and all non-simon-name
compliant characters are removed first, then all slashes are switched to dots (repeating slashes make one dot).
@param uri request URI
@param unallowedCharacterReplacer replacer for character... | [
"Returns",
"Simon",
"name",
"for",
"the",
"specified",
"request",
"(",
"local",
"name",
"without",
"any",
"configured",
"prefix",
")",
".",
"By",
"default",
"dots",
"and",
"all",
"non",
"-",
"simon",
"-",
"name",
"compliant",
"characters",
"are",
"removed",
... | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/javaee/src/main/java/org/javasimon/javaee/SimonServletFilterUtils.java#L47-L54 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_changeOrg_POST | public OvhIpTask ip_changeOrg_POST(String ip, String organisation) throws IOException {
"""
Change organisation of this IP
REST: POST /ip/{ip}/changeOrg
@param organisation [required] Your organisation id (RIPE_XXXX) to add on block informations
@param ip [required]
"""
String qPath = "/ip/{ip}/changeOr... | java | public OvhIpTask ip_changeOrg_POST(String ip, String organisation) throws IOException {
String qPath = "/ip/{ip}/changeOrg";
StringBuilder sb = path(qPath, ip);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "organisation", organisation);
String resp = exec(qPath, "POST", sb.toString(), ... | [
"public",
"OvhIpTask",
"ip_changeOrg_POST",
"(",
"String",
"ip",
",",
"String",
"organisation",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/changeOrg\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
")",
";",
"Ha... | Change organisation of this IP
REST: POST /ip/{ip}/changeOrg
@param organisation [required] Your organisation id (RIPE_XXXX) to add on block informations
@param ip [required] | [
"Change",
"organisation",
"of",
"this",
"IP"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L811-L818 |
samskivert/pythagoras | src/main/java/pythagoras/i/Points.java | Points.pointToString | public static String pointToString (int x, int y) {
"""
Returns a string describing the supplied point, of the form {@code +x+y}, {@code +x-y},
{@code -x-y}, etc.
"""
StringBuilder buf = new StringBuilder();
if (x >= 0) buf.append("+");
buf.append(x);
if (y >= 0) buf.append("+"... | java | public static String pointToString (int x, int y) {
StringBuilder buf = new StringBuilder();
if (x >= 0) buf.append("+");
buf.append(x);
if (y >= 0) buf.append("+");
buf.append(y);
return buf.toString();
} | [
"public",
"static",
"String",
"pointToString",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"x",
">=",
"0",
")",
"buf",
".",
"append",
"(",
"\"+\"",
")",
";",
"buf",
".",... | Returns a string describing the supplied point, of the form {@code +x+y}, {@code +x-y},
{@code -x-y}, etc. | [
"Returns",
"a",
"string",
"describing",
"the",
"supplied",
"point",
"of",
"the",
"form",
"{"
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/i/Points.java#L41-L48 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java | WTemplate.addTaggedComponent | public void addTaggedComponent(final String tag, final WComponent component) {
"""
Add a tagged component to be included in the template. The component will be rendered in place of the
corresponding tag in the template.
@param tag the tag for this component in the template
@param component the component to ad... | java | public void addTaggedComponent(final String tag, final WComponent component) {
if (Util.empty(tag)) {
throw new IllegalArgumentException("A tag must be provided.");
}
if (component == null) {
throw new IllegalArgumentException("A component must be provided.");
}
TemplateModel model = getOrCreateCompone... | [
"public",
"void",
"addTaggedComponent",
"(",
"final",
"String",
"tag",
",",
"final",
"WComponent",
"component",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"tag",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A tag must be provided.\"",
... | Add a tagged component to be included in the template. The component will be rendered in place of the
corresponding tag in the template.
@param tag the tag for this component in the template
@param component the component to add | [
"Add",
"a",
"tagged",
"component",
"to",
"be",
"included",
"in",
"the",
"template",
".",
"The",
"component",
"will",
"be",
"rendered",
"in",
"place",
"of",
"the",
"corresponding",
"tag",
"in",
"the",
"template",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java#L132-L153 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java | PolicyEventsInner.listQueryResultsForPolicyDefinition | public PolicyEventsQueryResultsInner listQueryResultsForPolicyDefinition(String subscriptionId, String policyDefinitionName) {
"""
Queries policy events for the subscription level policy definition.
@param subscriptionId Microsoft Azure subscription ID.
@param policyDefinitionName Policy definition name.
@thr... | java | public PolicyEventsQueryResultsInner listQueryResultsForPolicyDefinition(String subscriptionId, String policyDefinitionName) {
return listQueryResultsForPolicyDefinitionWithServiceResponseAsync(subscriptionId, policyDefinitionName).toBlocking().single().body();
} | [
"public",
"PolicyEventsQueryResultsInner",
"listQueryResultsForPolicyDefinition",
"(",
"String",
"subscriptionId",
",",
"String",
"policyDefinitionName",
")",
"{",
"return",
"listQueryResultsForPolicyDefinitionWithServiceResponseAsync",
"(",
"subscriptionId",
",",
"policyDefinitionNa... | Queries policy events for the subscription level policy definition.
@param subscriptionId Microsoft Azure subscription ID.
@param policyDefinitionName Policy definition name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws QueryFailureException thrown if the request is rejected by ser... | [
"Queries",
"policy",
"events",
"for",
"the",
"subscription",
"level",
"policy",
"definition",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java#L1078-L1080 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/DefaultQueryParameter.java | DefaultQueryParameter.putIfNotSet | static void putIfNotSet(Map<String, String> target, Map<String, String> defaults) {
"""
Update a given map with some default values if not already present in map.
@param target the map to be filled with values, if a key for them is not set already.
@param defaults the list of defaults, to be set.
"""
... | java | static void putIfNotSet(Map<String, String> target, Map<String, String> defaults) {
for (final String key : defaults.keySet()) {
if (!target.containsKey(key)) {
target.put(key, defaults.get(key));
}
}
} | [
"static",
"void",
"putIfNotSet",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"target",
",",
"Map",
"<",
"String",
",",
"String",
">",
"defaults",
")",
"{",
"for",
"(",
"final",
"String",
"key",
":",
"defaults",
".",
"keySet",
"(",
")",
")",
"{",
... | Update a given map with some default values if not already present in map.
@param target the map to be filled with values, if a key for them is not set already.
@param defaults the list of defaults, to be set. | [
"Update",
"a",
"given",
"map",
"with",
"some",
"default",
"values",
"if",
"not",
"already",
"present",
"in",
"map",
"."
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/DefaultQueryParameter.java#L37-L43 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java | GlobalUsersInner.stopEnvironment | public void stopEnvironment(String userName, String environmentId) {
"""
Stops an environment by stopping all resources inside the environment This operation can take a while to complete.
@param userName The name of the user.
@param environmentId The resourceId of the environment
@throws IllegalArgumentExcept... | java | public void stopEnvironment(String userName, String environmentId) {
stopEnvironmentWithServiceResponseAsync(userName, environmentId).toBlocking().last().body();
} | [
"public",
"void",
"stopEnvironment",
"(",
"String",
"userName",
",",
"String",
"environmentId",
")",
"{",
"stopEnvironmentWithServiceResponseAsync",
"(",
"userName",
",",
"environmentId",
")",
".",
"toBlocking",
"(",
")",
".",
"last",
"(",
")",
".",
"body",
"(",... | Stops an environment by stopping all resources inside the environment This operation can take a while to complete.
@param userName The name of the user.
@param environmentId The resourceId of the environment
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the ... | [
"Stops",
"an",
"environment",
"by",
"stopping",
"all",
"resources",
"inside",
"the",
"environment",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L1234-L1236 |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/engine/internal/StencilOperands.java | StencilOperands.isFloatingPointType | protected boolean isFloatingPointType(Object left, Object right) {
"""
Test if either left or right are either a Float or Double.
@param left
one object to test
@param right
the other
@return the result of the test.
"""
return left instanceof Float || left instanceof Double || right instanceof Float... | java | protected boolean isFloatingPointType(Object left, Object right) {
return left instanceof Float || left instanceof Double || right instanceof Float || right instanceof Double;
} | [
"protected",
"boolean",
"isFloatingPointType",
"(",
"Object",
"left",
",",
"Object",
"right",
")",
"{",
"return",
"left",
"instanceof",
"Float",
"||",
"left",
"instanceof",
"Double",
"||",
"right",
"instanceof",
"Float",
"||",
"right",
"instanceof",
"Double",
";... | Test if either left or right are either a Float or Double.
@param left
one object to test
@param right
the other
@return the result of the test. | [
"Test",
"if",
"either",
"left",
"or",
"right",
"are",
"either",
"a",
"Float",
"or",
"Double",
"."
] | train | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/internal/StencilOperands.java#L119-L121 |
BioPAX/Paxtools | paxtools-core/src/main/java/org/biopax/paxtools/io/BioPAXIOHandlerAdapter.java | BioPAXIOHandlerAdapter.convertToOWL | public void convertToOWL(Model model, OutputStream outputStream, String... ids) {
"""
Similar to {@link BioPAXIOHandler#convertToOWL(org.biopax.paxtools.model.Model,
java.io.OutputStream)} (org.biopax.paxtools.model.Model, Object)}, but
extracts a sub-model, converts it into BioPAX (OWL) format,
and writes it i... | java | public void convertToOWL(Model model, OutputStream outputStream, String... ids)
{
if (ids.length == 0)
{
convertToOWL(model, outputStream);
} else
{
Model m = model.getLevel().getDefaultFactory().createModel();
m.setXmlBase(model.getXmlBase());
Fetcher fetcher = new Fetcher(SimpleEditorMap.get(mod... | [
"public",
"void",
"convertToOWL",
"(",
"Model",
"model",
",",
"OutputStream",
"outputStream",
",",
"String",
"...",
"ids",
")",
"{",
"if",
"(",
"ids",
".",
"length",
"==",
"0",
")",
"{",
"convertToOWL",
"(",
"model",
",",
"outputStream",
")",
";",
"}",
... | Similar to {@link BioPAXIOHandler#convertToOWL(org.biopax.paxtools.model.Model,
java.io.OutputStream)} (org.biopax.paxtools.model.Model, Object)}, but
extracts a sub-model, converts it into BioPAX (OWL) format,
and writes it into the outputStream.
Saved data can be then read via {@link BioPAXIOHandler}
interface (e.g.,... | [
"Similar",
"to",
"{"
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/io/BioPAXIOHandlerAdapter.java#L372-L395 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.renamenx | @Override
public Long renamenx(final byte[] oldkey, final byte[] newkey) {
"""
Rename oldkey into newkey but fails if the destination key newkey already exists.
<p>
Time complexity: O(1)
@param oldkey
@param newkey
@return Integer reply, specifically: 1 if the key was renamed 0 if the target key already exi... | java | @Override
public Long renamenx(final byte[] oldkey, final byte[] newkey) {
checkIsInMultiOrPipeline();
client.renamenx(oldkey, newkey);
return client.getIntegerReply();
} | [
"@",
"Override",
"public",
"Long",
"renamenx",
"(",
"final",
"byte",
"[",
"]",
"oldkey",
",",
"final",
"byte",
"[",
"]",
"newkey",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"renamenx",
"(",
"oldkey",
",",
"newkey",
")",
";",
"... | Rename oldkey into newkey but fails if the destination key newkey already exists.
<p>
Time complexity: O(1)
@param oldkey
@param newkey
@return Integer reply, specifically: 1 if the key was renamed 0 if the target key already exist | [
"Rename",
"oldkey",
"into",
"newkey",
"but",
"fails",
"if",
"the",
"destination",
"key",
"newkey",
"already",
"exists",
".",
"<p",
">",
"Time",
"complexity",
":",
"O",
"(",
"1",
")"
] | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L436-L441 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java | StorageAccountsInner.listAccountSAS | public ListAccountSasResponseInner listAccountSAS(String resourceGroupName, String accountName, AccountSasParameters parameters) {
"""
List SAS credentials of a storage account.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountN... | java | public ListAccountSasResponseInner listAccountSAS(String resourceGroupName, String accountName, AccountSasParameters parameters) {
return listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body();
} | [
"public",
"ListAccountSasResponseInner",
"listAccountSAS",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"AccountSasParameters",
"parameters",
")",
"{",
"return",
"listAccountSASWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
... | List SAS credentials of a storage account.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length an... | [
"List",
"SAS",
"credentials",
"of",
"a",
"storage",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java#L1015-L1017 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getImageRegionProposalsAsync | public Observable<ImageRegionProposal> getImageRegionProposalsAsync(UUID projectId, UUID imageId) {
"""
Get region proposals for an image. Returns empty array if no proposals are found.
This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals... | java | public Observable<ImageRegionProposal> getImageRegionProposalsAsync(UUID projectId, UUID imageId) {
return getImageRegionProposalsWithServiceResponseAsync(projectId, imageId).map(new Func1<ServiceResponse<ImageRegionProposal>, ImageRegionProposal>() {
@Override
public ImageRegionProposal... | [
"public",
"Observable",
"<",
"ImageRegionProposal",
">",
"getImageRegionProposalsAsync",
"(",
"UUID",
"projectId",
",",
"UUID",
"imageId",
")",
"{",
"return",
"getImageRegionProposalsWithServiceResponseAsync",
"(",
"projectId",
",",
"imageId",
")",
".",
"map",
"(",
"n... | Get region proposals for an image. Returns empty array if no proposals are found.
This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found.
@param projectId The project id
@param imageId The image id
@throws IllegalArgumentException thro... | [
"Get",
"region",
"proposals",
"for",
"an",
"image",
".",
"Returns",
"empty",
"array",
"if",
"no",
"proposals",
"are",
"found",
".",
"This",
"API",
"will",
"get",
"region",
"proposals",
"for",
"an",
"image",
"along",
"with",
"confidences",
"for",
"the",
"re... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3199-L3206 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRFloatAnimation.java | GVRFloatAnimation.getKey | public void getKey(int keyIndex, float[] values) {
"""
Returns the key value in the given array.
@param keyIndex the index of the scale key
"""
int index = keyIndex * mFloatsPerKey;
System.arraycopy(mKeys, index + 1, values, 0, values.length);
} | java | public void getKey(int keyIndex, float[] values)
{
int index = keyIndex * mFloatsPerKey;
System.arraycopy(mKeys, index + 1, values, 0, values.length);
} | [
"public",
"void",
"getKey",
"(",
"int",
"keyIndex",
",",
"float",
"[",
"]",
"values",
")",
"{",
"int",
"index",
"=",
"keyIndex",
"*",
"mFloatsPerKey",
";",
"System",
".",
"arraycopy",
"(",
"mKeys",
",",
"index",
"+",
"1",
",",
"values",
",",
"0",
","... | Returns the key value in the given array.
@param keyIndex the index of the scale key | [
"Returns",
"the",
"key",
"value",
"in",
"the",
"given",
"array",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRFloatAnimation.java#L321-L325 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/core/TitanFactory.java | TitanFactory.getLocalConfiguration | @SuppressWarnings("unchecked")
private static ReadConfiguration getLocalConfiguration(File file) {
"""
Load a properties file containing a Titan graph configuration.
<p/>
<ol>
<li>Load the file contents into a {@link org.apache.commons.configuration.PropertiesConfiguration}</li>
<li>For each key that point... | java | @SuppressWarnings("unchecked")
private static ReadConfiguration getLocalConfiguration(File file) {
Preconditions.checkArgument(file != null && file.exists() && file.isFile() && file.canRead(),
"Need to specify a readable configuration file, but was given: %s", file.toString());
try ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"ReadConfiguration",
"getLocalConfiguration",
"(",
"File",
"file",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"file",
"!=",
"null",
"&&",
"file",
".",
"exists",
"(",
")",
"&&",
... | Load a properties file containing a Titan graph configuration.
<p/>
<ol>
<li>Load the file contents into a {@link org.apache.commons.configuration.PropertiesConfiguration}</li>
<li>For each key that points to a configuration object that is either a directory
or local file, check
whether the associated value is a non-nu... | [
"Load",
"a",
"properties",
"file",
"containing",
"a",
"Titan",
"graph",
"configuration",
".",
"<p",
"/",
">",
"<ol",
">",
"<li",
">",
"Load",
"the",
"file",
"contents",
"into",
"a",
"{",
"@link",
"org",
".",
"apache",
".",
"commons",
".",
"configuration"... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/core/TitanFactory.java#L218-L274 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear7.java | FundamentalLinear7.process | public boolean process( List<AssociatedPair> points , FastQueue<DMatrixRMaj> solutions ) {
"""
<p>
Computes a fundamental or essential matrix from a set of associated point correspondences.
</p>
@param points Input: List of corresponding image coordinates. In pixel for fundamental matrix or
normalized coordi... | java | public boolean process( List<AssociatedPair> points , FastQueue<DMatrixRMaj> solutions ) {
if( points.size() != 7 )
throw new IllegalArgumentException("Must be exactly 7 points. Not "+points.size()+" you gelatinous piece of pond scum.");
// reset data structures
solutions.reset();
// must normalize for whe... | [
"public",
"boolean",
"process",
"(",
"List",
"<",
"AssociatedPair",
">",
"points",
",",
"FastQueue",
"<",
"DMatrixRMaj",
">",
"solutions",
")",
"{",
"if",
"(",
"points",
".",
"size",
"(",
")",
"!=",
"7",
")",
"throw",
"new",
"IllegalArgumentException",
"("... | <p>
Computes a fundamental or essential matrix from a set of associated point correspondences.
</p>
@param points Input: List of corresponding image coordinates. In pixel for fundamental matrix or
normalized coordinates for essential matrix.
@param solutions Output: Storage for the found solutions.
@return true If suc... | [
"<p",
">",
"Computes",
"a",
"fundamental",
"or",
"essential",
"matrix",
"from",
"a",
"set",
"of",
"associated",
"point",
"correspondences",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear7.java#L88-L116 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.