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 |
|---|---|---|---|---|---|---|---|---|---|---|
lessthanoptimal/ejml | main/ejml-core/src/org/ejml/ops/MatrixIO.java | MatrixIO.loadCSV | public static <T extends DMatrix>T loadCSV(String fileName , boolean doublePrecision )
throws IOException {
"""
Reads a matrix in which has been encoded using a Column Space Value (CSV)
file format. The number of rows and columns are read in on the first line. Then
each row is read in the subsequent line... | java | public static <T extends DMatrix>T loadCSV(String fileName , boolean doublePrecision )
throws IOException
{
FileInputStream fileStream = new FileInputStream(fileName);
ReadMatrixCsv csv = new ReadMatrixCsv(fileStream);
T ret;
if( doublePrecision )
ret = csv.read6... | [
"public",
"static",
"<",
"T",
"extends",
"DMatrix",
">",
"T",
"loadCSV",
"(",
"String",
"fileName",
",",
"boolean",
"doublePrecision",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fileStream",
"=",
"new",
"FileInputStream",
"(",
"fileName",
")",
";",
... | Reads a matrix in which has been encoded using a Column Space Value (CSV)
file format. The number of rows and columns are read in on the first line. Then
each row is read in the subsequent lines.
Works with dense and sparse matrices.
@param fileName The file being loaded.
@return DMatrix
@throws IOException | [
"Reads",
"a",
"matrix",
"in",
"which",
"has",
"been",
"encoded",
"using",
"a",
"Column",
"Space",
"Value",
"(",
"CSV",
")",
"file",
"format",
".",
"The",
"number",
"of",
"rows",
"and",
"columns",
"are",
"read",
"in",
"on",
"the",
"first",
"line",
".",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/ops/MatrixIO.java#L178-L193 |
mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/TileDependencies.java | TileDependencies.addOverlappingElement | void addOverlappingElement(Tile from, Tile to, MapElementContainer element) {
"""
stores an MapElementContainer that clashesWith from one tile (the one being drawn) to
another (which must not have been drawn before).
@param from origin tile
@param to tile the label clashesWith to
@param element the M... | java | void addOverlappingElement(Tile from, Tile to, MapElementContainer element) {
if (!overlapData.containsKey(from)) {
overlapData.put(from, new HashMap<Tile, Set<MapElementContainer>>());
}
if (!overlapData.get(from).containsKey(to)) {
overlapData.get(from).put(to, new Hash... | [
"void",
"addOverlappingElement",
"(",
"Tile",
"from",
",",
"Tile",
"to",
",",
"MapElementContainer",
"element",
")",
"{",
"if",
"(",
"!",
"overlapData",
".",
"containsKey",
"(",
"from",
")",
")",
"{",
"overlapData",
".",
"put",
"(",
"from",
",",
"new",
"... | stores an MapElementContainer that clashesWith from one tile (the one being drawn) to
another (which must not have been drawn before).
@param from origin tile
@param to tile the label clashesWith to
@param element the MapElementContainer in question | [
"stores",
"an",
"MapElementContainer",
"that",
"clashesWith",
"from",
"one",
"tile",
"(",
"the",
"one",
"being",
"drawn",
")",
"to",
"another",
"(",
"which",
"must",
"not",
"have",
"been",
"drawn",
"before",
")",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/TileDependencies.java#L41-L49 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java | AbstractAnnotationMetadataBuilder.validateAnnotationValue | protected void validateAnnotationValue(T originatingElement, String annotationName, T member, String memberName, Object resolvedValue) {
"""
Validates an annotation value.
@param originatingElement The originating element
@param annotationName The annotation name
@param member The member
@param memberName The ... | java | protected void validateAnnotationValue(T originatingElement, String annotationName, T member, String memberName, Object resolvedValue) {
final AnnotatedElementValidator elementValidator = getElementValidator();
if (elementValidator != null && !erroneousElements.contains(member)) {
final bool... | [
"protected",
"void",
"validateAnnotationValue",
"(",
"T",
"originatingElement",
",",
"String",
"annotationName",
",",
"T",
"member",
",",
"String",
"memberName",
",",
"Object",
"resolvedValue",
")",
"{",
"final",
"AnnotatedElementValidator",
"elementValidator",
"=",
"... | Validates an annotation value.
@param originatingElement The originating element
@param annotationName The annotation name
@param member The member
@param memberName The member name
@param resolvedValue The resolved value | [
"Validates",
"an",
"annotation",
"value",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java#L266-L297 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/resourceIndex/ResourceIndexImpl.java | ResourceIndexImpl.updateTripleDiffs | private void updateTripleDiffs(Set<Triple> existing, Set<Triple> desired)
throws ResourceIndexException {
"""
Computes the difference between the given sets and applies the
appropriate deletes and adds to the triplestore. If _syncUpdates is true,
changes will be flushed before returning.
"""
... | java | private void updateTripleDiffs(Set<Triple> existing, Set<Triple> desired)
throws ResourceIndexException {
// Delete any existing triples that are no longer desired,
// leaving the ones we want in place
HashSet<Triple> obsoleteTriples = new HashSet<Triple>(existing);
obsolete... | [
"private",
"void",
"updateTripleDiffs",
"(",
"Set",
"<",
"Triple",
">",
"existing",
",",
"Set",
"<",
"Triple",
">",
"desired",
")",
"throws",
"ResourceIndexException",
"{",
"// Delete any existing triples that are no longer desired,",
"// leaving the ones we want in place",
... | Computes the difference between the given sets and applies the
appropriate deletes and adds to the triplestore. If _syncUpdates is true,
changes will be flushed before returning. | [
"Computes",
"the",
"difference",
"between",
"the",
"given",
"sets",
"and",
"applies",
"the",
"appropriate",
"deletes",
"and",
"adds",
"to",
"the",
"triplestore",
".",
"If",
"_syncUpdates",
"is",
"true",
"changes",
"will",
"be",
"flushed",
"before",
"returning",
... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/resourceIndex/ResourceIndexImpl.java#L177-L191 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java | IndexChangeAdapters.forNodeTypes | public static IndexChangeAdapter forNodeTypes( String propertyName,
ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
... | java | public static IndexChangeAdapter forNodeTypes( String propertyName,
ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
... | [
"public",
"static",
"IndexChangeAdapter",
"forNodeTypes",
"(",
"String",
"propertyName",
",",
"ExecutionContext",
"context",
",",
"NodeTypePredicate",
"matcher",
",",
"String",
"workspaceName",
",",
"ProvidedIndex",
"<",
"?",
">",
"index",
")",
"{",
"return",
"new",... | Create an {@link IndexChangeAdapter} implementation that handles node type information.
@param propertyName a symbolic name of the property that will be sent to the {@link ProvidedIndex} when the adapter
notices that there are either primary type of mixin type changes.
@param context the execution context; may not be ... | [
"Create",
"an",
"{",
"@link",
"IndexChangeAdapter",
"}",
"implementation",
"that",
"handles",
"node",
"type",
"information",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java#L237-L243 |
census-instrumentation/opencensus-java | contrib/resource_util/src/main/java/io/opencensus/contrib/resource/util/ContainerResource.java | ContainerResource.create | public static Resource create(String name, String imageName, String imageTag) {
"""
Returns a {@link Resource} that describes a container.
@param name the container name.
@param imageName the container image name.
@param imageTag the container image tag.
@return a {@link Resource} that describes a k8s contai... | java | public static Resource create(String name, String imageName, String imageTag) {
Map<String, String> labels = new LinkedHashMap<String, String>();
labels.put(NAME_KEY, checkNotNull(name, "name"));
labels.put(IMAGE_NAME_KEY, checkNotNull(imageName, "imageName"));
labels.put(IMAGE_TAG_KEY, checkNotNull(ima... | [
"public",
"static",
"Resource",
"create",
"(",
"String",
"name",
",",
"String",
"imageName",
",",
"String",
"imageTag",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"labels",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"(",
")"... | Returns a {@link Resource} that describes a container.
@param name the container name.
@param imageName the container image name.
@param imageTag the container image tag.
@return a {@link Resource} that describes a k8s container.
@since 0.20 | [
"Returns",
"a",
"{",
"@link",
"Resource",
"}",
"that",
"describes",
"a",
"container",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/contrib/resource_util/src/main/java/io/opencensus/contrib/resource/util/ContainerResource.java#L69-L75 |
yanzhenjie/AndPermission | support/src/main/java/com/yanzhenjie/permission/AndPermission.java | AndPermission.hasPermissions | public static boolean hasPermissions(android.app.Fragment fragment, String[]... permissions) {
"""
Judgment already has the target permission.
@param fragment {@link android.app.Fragment}.
@param permissions one or more permission groups.
@return true, other wise is false.
"""
return hasPermissi... | java | public static boolean hasPermissions(android.app.Fragment fragment, String[]... permissions) {
return hasPermissions(fragment.getActivity(), permissions);
} | [
"public",
"static",
"boolean",
"hasPermissions",
"(",
"android",
".",
"app",
".",
"Fragment",
"fragment",
",",
"String",
"[",
"]",
"...",
"permissions",
")",
"{",
"return",
"hasPermissions",
"(",
"fragment",
".",
"getActivity",
"(",
")",
",",
"permissions",
... | Judgment already has the target permission.
@param fragment {@link android.app.Fragment}.
@param permissions one or more permission groups.
@return true, other wise is false. | [
"Judgment",
"already",
"has",
"the",
"target",
"permission",
"."
] | train | https://github.com/yanzhenjie/AndPermission/blob/bbfaaecdb8ecf0f2aa270d80c0b88d022dddda7c/support/src/main/java/com/yanzhenjie/permission/AndPermission.java#L295-L297 |
spotify/apollo | apollo-api-impl/src/main/java/com/spotify/apollo/meta/MetaDescriptor.java | MetaDescriptor.loadVersion | private static String loadVersion(ClassLoader classLoader) throws IOException {
"""
Tries to load the first "Implementation-Version" manifest entry it can find in the given
classloader.
@param classLoader The classloader to load manifests from
@return a version string
@throws IOException
"""
try {
... | java | private static String loadVersion(ClassLoader classLoader) throws IOException {
try {
Enumeration<URL> resources = classLoader.getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
final URL url = resources.nextElement();
final Manifest manifest = new Manifest(url.... | [
"private",
"static",
"String",
"loadVersion",
"(",
"ClassLoader",
"classLoader",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Enumeration",
"<",
"URL",
">",
"resources",
"=",
"classLoader",
".",
"getResources",
"(",
"\"META-INF/MANIFEST.MF\"",
")",
";",
"while"... | Tries to load the first "Implementation-Version" manifest entry it can find in the given
classloader.
@param classLoader The classloader to load manifests from
@return a version string
@throws IOException | [
"Tries",
"to",
"load",
"the",
"first",
"Implementation",
"-",
"Version",
"manifest",
"entry",
"it",
"can",
"find",
"in",
"the",
"given",
"classloader",
"."
] | train | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api-impl/src/main/java/com/spotify/apollo/meta/MetaDescriptor.java#L87-L108 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatter.java | DateTimeFormatter.parseLocalDateTime | public LocalDateTime parseLocalDateTime(String text) {
"""
Parses only the local date-time from the given text, returning a new LocalDateTime.
<p>
This will parse the text fully according to the formatter, using the UTC zone.
Once parsed, only the local date-time will be used.
This means that any parsed time-z... | java | public LocalDateTime parseLocalDateTime(String text) {
InternalParser parser = requireParser();
Chronology chrono = selectChronology(null).withUTC(); // always use UTC, avoiding DST gaps
DateTimeParserBucket bucket = new DateTimeParserBucket(0, chrono, iLocale, iPivotYear, iDefaultYear... | [
"public",
"LocalDateTime",
"parseLocalDateTime",
"(",
"String",
"text",
")",
"{",
"InternalParser",
"parser",
"=",
"requireParser",
"(",
")",
";",
"Chronology",
"chrono",
"=",
"selectChronology",
"(",
"null",
")",
".",
"withUTC",
"(",
")",
";",
"// always use UT... | Parses only the local date-time from the given text, returning a new LocalDateTime.
<p>
This will parse the text fully according to the formatter, using the UTC zone.
Once parsed, only the local date-time will be used.
This means that any parsed time-zone or offset field is completely ignored.
It also means that the zo... | [
"Parses",
"only",
"the",
"local",
"date",
"-",
"time",
"from",
"the",
"given",
"text",
"returning",
"a",
"new",
"LocalDateTime",
".",
"<p",
">",
"This",
"will",
"parse",
"the",
"text",
"fully",
"according",
"to",
"the",
"formatter",
"using",
"the",
"UTC",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatter.java#L879-L901 |
EdwardRaff/JSAT | JSAT/src/jsat/datatransform/featureselection/SFS.java | SFS.getScore | protected static double getScore(DataSet workOn, Object evaluater, int folds, Random rand) {
"""
The score function for a data set and a learner by cross validation of a
classifier
@param workOn the transformed data set to test from with cross validation
@param evaluater the learning algorithm to use
@param ... | java | protected static double getScore(DataSet workOn, Object evaluater, int folds, Random rand)
{
if(workOn instanceof ClassificationDataSet)
{
ClassificationModelEvaluation cme =
new ClassificationModelEvaluation((Classifier)evaluater,
(Classification... | [
"protected",
"static",
"double",
"getScore",
"(",
"DataSet",
"workOn",
",",
"Object",
"evaluater",
",",
"int",
"folds",
",",
"Random",
"rand",
")",
"{",
"if",
"(",
"workOn",
"instanceof",
"ClassificationDataSet",
")",
"{",
"ClassificationModelEvaluation",
"cme",
... | The score function for a data set and a learner by cross validation of a
classifier
@param workOn the transformed data set to test from with cross validation
@param evaluater the learning algorithm to use
@param folds the number of cross validation folds to perform
@param rand the source of randomness
@return the scor... | [
"The",
"score",
"function",
"for",
"a",
"data",
"set",
"and",
"a",
"learner",
"by",
"cross",
"validation",
"of",
"a",
"classifier"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/datatransform/featureselection/SFS.java#L309-L330 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/meta/common/utils/Assertions.java | Assertions.assertIsValid | @Nullable
public static <T> T assertIsValid(@Nullable T obj, @Nonnull Validator<T> validator) {
"""
Check an object by a validator.
@param <T> object type
@param obj object to be checked
@param validator validator for the operation
@return the object if it is valid
@throws InvalidObjectError w... | java | @Nullable
public static <T> T assertIsValid(@Nullable T obj, @Nonnull Validator<T> validator) {
if (assertNotNull(validator).isValid(obj)) {
return obj;
} else {
final InvalidObjectError error = new InvalidObjectError("Detected invalid object", obj);
MetaErrorListeners.fireError("Invalid obj... | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
">",
"T",
"assertIsValid",
"(",
"@",
"Nullable",
"T",
"obj",
",",
"@",
"Nonnull",
"Validator",
"<",
"T",
">",
"validator",
")",
"{",
"if",
"(",
"assertNotNull",
"(",
"validator",
")",
".",
"isValid",
"(",
... | Check an object by a validator.
@param <T> object type
@param obj object to be checked
@param validator validator for the operation
@return the object if it is valid
@throws InvalidObjectError will be thrown if the object is invalid
@since 1.0.2 | [
"Check",
"an",
"object",
"by",
"a",
"validator",
"."
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/utils/Assertions.java#L291-L300 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/S3ObjectWrapper.java | S3ObjectWrapper.encryptionSchemeOf | ContentCryptoScheme encryptionSchemeOf(Map<String,String> instructionFile) {
"""
Returns the original crypto scheme used for encryption, which may
differ from the crypto scheme used for decryption during, for example,
a range-get operation.
@param instructionFile
the instruction file of the s3 object; or nul... | java | ContentCryptoScheme encryptionSchemeOf(Map<String,String> instructionFile) {
if (instructionFile != null) {
String cekAlgo = instructionFile.get(Headers.CRYPTO_CEK_ALGORITHM);
return ContentCryptoScheme.fromCEKAlgo(cekAlgo);
}
ObjectMetadata meta = s3obj.getObjectMetadata... | [
"ContentCryptoScheme",
"encryptionSchemeOf",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"instructionFile",
")",
"{",
"if",
"(",
"instructionFile",
"!=",
"null",
")",
"{",
"String",
"cekAlgo",
"=",
"instructionFile",
".",
"get",
"(",
"Headers",
".",
"CRYPTO... | Returns the original crypto scheme used for encryption, which may
differ from the crypto scheme used for decryption during, for example,
a range-get operation.
@param instructionFile
the instruction file of the s3 object; or null if there is
none. | [
"Returns",
"the",
"original",
"crypto",
"scheme",
"used",
"for",
"encryption",
"which",
"may",
"differ",
"from",
"the",
"crypto",
"scheme",
"used",
"for",
"decryption",
"during",
"for",
"example",
"a",
"range",
"-",
"get",
"operation",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/S3ObjectWrapper.java#L157-L166 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java | MapDotApi.dotGetMapUnsafe | public static <A, B> Map<A, B> dotGetMapUnsafe(final Map map, final String pathString) {
"""
Get map value by path.
@param <A> map key type
@param <B> map value type
@param map subject
@param pathString nodes to walk in map
@return value
"""
return dotGetUnsafe(map, Map.class, pathString);
} | java | public static <A, B> Map<A, B> dotGetMapUnsafe(final Map map, final String pathString) {
return dotGetUnsafe(map, Map.class, pathString);
} | [
"public",
"static",
"<",
"A",
",",
"B",
">",
"Map",
"<",
"A",
",",
"B",
">",
"dotGetMapUnsafe",
"(",
"final",
"Map",
"map",
",",
"final",
"String",
"pathString",
")",
"{",
"return",
"dotGetUnsafe",
"(",
"map",
",",
"Map",
".",
"class",
",",
"pathStri... | Get map value by path.
@param <A> map key type
@param <B> map value type
@param map subject
@param pathString nodes to walk in map
@return value | [
"Get",
"map",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java#L192-L194 |
alibaba/canal | client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java | RelaxedDataBinder.modifyProperties | private MutablePropertyValues modifyProperties(MutablePropertyValues propertyValues, Object target) {
"""
Modify the property values so that period separated property paths are valid
for map keys. Also creates new maps for properties of map type that are null
(assuming all maps are potentially nested). The stand... | java | private MutablePropertyValues modifyProperties(MutablePropertyValues propertyValues, Object target) {
propertyValues = getPropertyValuesForNamePrefix(propertyValues);
if (target instanceof RelaxedDataBinder.MapHolder) {
propertyValues = addMapPrefix(propertyValues);
}
BeanWra... | [
"private",
"MutablePropertyValues",
"modifyProperties",
"(",
"MutablePropertyValues",
"propertyValues",
",",
"Object",
"target",
")",
"{",
"propertyValues",
"=",
"getPropertyValuesForNamePrefix",
"(",
"propertyValues",
")",
";",
"if",
"(",
"target",
"instanceof",
"Relaxed... | Modify the property values so that period separated property paths are valid
for map keys. Also creates new maps for properties of map type that are null
(assuming all maps are potentially nested). The standard bracket {@code[...]}
dereferencing is also accepted.
@param propertyValues the property values
@param target... | [
"Modify",
"the",
"property",
"values",
"so",
"that",
"period",
"separated",
"property",
"paths",
"are",
"valid",
"for",
"map",
"keys",
".",
"Also",
"creates",
"new",
"maps",
"for",
"properties",
"of",
"map",
"type",
"that",
"are",
"null",
"(",
"assuming",
... | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java#L124-L143 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/paintable/Circle.java | Circle.setRadius | public void setRadius(float radius) {
"""
Set circle radius in world coordinates.
@param radius circle radius in world units
"""
if (getOriginalLocation() != null) {
Bbox oldBounds = (Bbox) getOriginalLocation();
Bbox newBounds = (Bbox) oldBounds.clone();
newBounds.setWidth(2 * radius);
newBou... | java | public void setRadius(float radius) {
if (getOriginalLocation() != null) {
Bbox oldBounds = (Bbox) getOriginalLocation();
Bbox newBounds = (Bbox) oldBounds.clone();
newBounds.setWidth(2 * radius);
newBounds.setHeight(2 * radius);
newBounds.setCenterPoint(oldBounds.getCenterPoint());
setOriginalLocat... | [
"public",
"void",
"setRadius",
"(",
"float",
"radius",
")",
"{",
"if",
"(",
"getOriginalLocation",
"(",
")",
"!=",
"null",
")",
"{",
"Bbox",
"oldBounds",
"=",
"(",
"Bbox",
")",
"getOriginalLocation",
"(",
")",
";",
"Bbox",
"newBounds",
"=",
"(",
"Bbox",
... | Set circle radius in world coordinates.
@param radius circle radius in world units | [
"Set",
"circle",
"radius",
"in",
"world",
"coordinates",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/paintable/Circle.java#L107-L118 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getRenameRequest | public BoxRequestsFile.UpdateFile getRenameRequest(String id, String newName) {
"""
Gets a request that renames a file
@param id id of file to rename
@param newName id of file to retrieve info on
@return request to rename a file
"""
BoxRequestsFile.UpdateFile request = new BoxRequest... | java | public BoxRequestsFile.UpdateFile getRenameRequest(String id, String newName) {
BoxRequestsFile.UpdateFile request = new BoxRequestsFile.UpdateFile(id, getFileInfoUrl(id), mSession);
request.setName(newName);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"UpdateFile",
"getRenameRequest",
"(",
"String",
"id",
",",
"String",
"newName",
")",
"{",
"BoxRequestsFile",
".",
"UpdateFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"UpdateFile",
"(",
"id",
",",
"getFileInfoUrl",
"(",
... | Gets a request that renames a file
@param id id of file to rename
@param newName id of file to retrieve info on
@return request to rename a file | [
"Gets",
"a",
"request",
"that",
"renames",
"a",
"file"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L221-L225 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF5.java | CommonOps_DDF5.fill | public static void fill( DMatrix5x5 a , double v ) {
"""
<p>
Sets every element in the matrix to the specified value.<br>
<br>
a<sub>ij</sub> = value
<p>
@param a A matrix whose elements are about to be set. Modified.
@param v The value each element will have.
"""
a.a11 = v; a.a12 = v; a.a13 =... | java | public static void fill( DMatrix5x5 a , double v ) {
a.a11 = v; a.a12 = v; a.a13 = v; a.a14 = v; a.a15 = v;
a.a21 = v; a.a22 = v; a.a23 = v; a.a24 = v; a.a25 = v;
a.a31 = v; a.a32 = v; a.a33 = v; a.a34 = v; a.a35 = v;
a.a41 = v; a.a42 = v; a.a43 = v; a.a44 = v; a.a45 = v;
a.a51 ... | [
"public",
"static",
"void",
"fill",
"(",
"DMatrix5x5",
"a",
",",
"double",
"v",
")",
"{",
"a",
".",
"a11",
"=",
"v",
";",
"a",
".",
"a12",
"=",
"v",
";",
"a",
".",
"a13",
"=",
"v",
";",
"a",
".",
"a14",
"=",
"v",
";",
"a",
".",
"a15",
"="... | <p>
Sets every element in the matrix to the specified value.<br>
<br>
a<sub>ij</sub> = value
<p>
@param a A matrix whose elements are about to be set. Modified.
@param v The value each element will have. | [
"<p",
">",
"Sets",
"every",
"element",
"in",
"the",
"matrix",
"to",
"the",
"specified",
"value",
".",
"<br",
">",
"<br",
">",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"value",
"<p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF5.java#L1920-L1926 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/net/MessagingService.java | MessagingService.registerVerbHandlers | public void registerVerbHandlers(Verb verb, IVerbHandler verbHandler) {
"""
Register a verb and the corresponding verb handler with the
Messaging Service.
@param verb
@param verbHandler handler for the specified verb
"""
assert !verbHandlers.containsKey(verb);
verbHandlers.put(verb, verbHa... | java | public void registerVerbHandlers(Verb verb, IVerbHandler verbHandler)
{
assert !verbHandlers.containsKey(verb);
verbHandlers.put(verb, verbHandler);
} | [
"public",
"void",
"registerVerbHandlers",
"(",
"Verb",
"verb",
",",
"IVerbHandler",
"verbHandler",
")",
"{",
"assert",
"!",
"verbHandlers",
".",
"containsKey",
"(",
"verb",
")",
";",
"verbHandlers",
".",
"put",
"(",
"verb",
",",
"verbHandler",
")",
";",
"}"
... | Register a verb and the corresponding verb handler with the
Messaging Service.
@param verb
@param verbHandler handler for the specified verb | [
"Register",
"a",
"verb",
"and",
"the",
"corresponding",
"verb",
"handler",
"with",
"the",
"Messaging",
"Service",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/net/MessagingService.java#L540-L544 |
ysc/word | src/main/java/org/apdplat/word/corpus/ExtractText.java | ExtractText.analyzeCorpus | private static void analyzeCorpus(String zipFile, String output, final String separator, final boolean includePhrase) throws IOException {
"""
分析语料库
@param zipFile 压缩的语料库
@param output 保存抽取出的文本的文件路径
@param separator 词之间的分隔符
@param includePhrase 是否抽取短语
@throws IOException
"""
File outputFile = new ... | java | private static void analyzeCorpus(String zipFile, String output, final String separator, final boolean includePhrase) throws IOException{
File outputFile = new File(output);
//准备输出目录
if(!outputFile.getParentFile().exists()){
outputFile.getParentFile().mkdirs();
}
try ... | [
"private",
"static",
"void",
"analyzeCorpus",
"(",
"String",
"zipFile",
",",
"String",
"output",
",",
"final",
"String",
"separator",
",",
"final",
"boolean",
"includePhrase",
")",
"throws",
"IOException",
"{",
"File",
"outputFile",
"=",
"new",
"File",
"(",
"o... | 分析语料库
@param zipFile 压缩的语料库
@param output 保存抽取出的文本的文件路径
@param separator 词之间的分隔符
@param includePhrase 是否抽取短语
@throws IOException | [
"分析语料库"
] | train | https://github.com/ysc/word/blob/5e45607f4e97207f55d1e3bc561abda6b34f7c54/src/main/java/org/apdplat/word/corpus/ExtractText.java#L80-L105 |
pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.persistMetadata | private void persistMetadata(LogMetadata metadata, boolean create) throws DurableDataLogException {
"""
Persists the given metadata into ZooKeeper.
@param metadata The LogMetadata to persist. At the end of this method, this metadata will have its Version updated
to the one in ZooKeeper.
@param create Whethe... | java | private void persistMetadata(LogMetadata metadata, boolean create) throws DurableDataLogException {
try {
byte[] serializedMetadata = LogMetadata.SERIALIZER.serialize(metadata).getCopy();
if (create) {
this.zkClient.create()
.creatingParentsIf... | [
"private",
"void",
"persistMetadata",
"(",
"LogMetadata",
"metadata",
",",
"boolean",
"create",
")",
"throws",
"DurableDataLogException",
"{",
"try",
"{",
"byte",
"[",
"]",
"serializedMetadata",
"=",
"LogMetadata",
".",
"SERIALIZER",
".",
"serialize",
"(",
"metada... | Persists the given metadata into ZooKeeper.
@param metadata The LogMetadata to persist. At the end of this method, this metadata will have its Version updated
to the one in ZooKeeper.
@param create Whether to create (true) or update (false) the data in ZooKeeper.
@throws DataLogWriterNotPrimaryException If the metad... | [
"Persists",
"the",
"given",
"metadata",
"into",
"ZooKeeper",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L782-L812 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java | ELHelper.evaluateElExpression | @Trivial
protected Object evaluateElExpression(String expression, boolean mask) {
"""
Evaluate a possible EL expression.
@param expression The expression to evaluate.
@param mask Set whether to mask the expression and result. Useful for when passwords might be
contained in either the expression or the res... | java | @Trivial
protected Object evaluateElExpression(String expression, boolean mask) {
final String methodName = "evaluateElExpression";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, methodName, new Object[] { (expression == null) ? null : mask ? OBFUSCATED_S... | [
"@",
"Trivial",
"protected",
"Object",
"evaluateElExpression",
"(",
"String",
"expression",
",",
"boolean",
"mask",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"evaluateElExpression\"",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
... | Evaluate a possible EL expression.
@param expression The expression to evaluate.
@param mask Set whether to mask the expression and result. Useful for when passwords might be
contained in either the expression or the result.
@return The evaluated expression. | [
"Evaluate",
"a",
"possible",
"EL",
"expression",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java#L60-L74 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/IdentifierToken.java | IdentifierToken.write | public void write(Object object, Object value) {
"""
Update the value represented by this token on the given object <code>object</code> with
the value <code>value</code>.
@param object the object to update
@param value the new value
"""
if(object == null) {
String msg = "Can not update t... | java | public void write(Object object, Object value) {
if(object == null) {
String msg = "Can not update the identifier \"" + _identifier + "\" on a null value object.";
LOGGER.error(msg);
throw new RuntimeException(msg);
}
if(TRACE_ENABLED)
LOGGER.trac... | [
"public",
"void",
"write",
"(",
"Object",
"object",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"String",
"msg",
"=",
"\"Can not update the identifier \\\"\"",
"+",
"_identifier",
"+",
"\"\\\" on a null value object.\"",
";",
"... | Update the value represented by this token on the given object <code>object</code> with
the value <code>value</code>.
@param object the object to update
@param value the new value | [
"Update",
"the",
"value",
"represented",
"by",
"this",
"token",
"on",
"the",
"given",
"object",
"<code",
">",
"object<",
"/",
"code",
">",
"with",
"the",
"value",
"<code",
">",
"value<",
"/",
"code",
">",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/IdentifierToken.java#L77-L98 |
apollographql/apollo-android | apollo-runtime/src/main/java/com/apollographql/apollo/internal/ApolloCallTracker.java | ApolloCallTracker.activePrefetchCalls | @NotNull Set<ApolloPrefetch> activePrefetchCalls(@NotNull OperationName operationName) {
"""
Returns currently active {@link ApolloPrefetch} calls by operation name.
@param operationName prefetch operation name
@return set of active prefetch calls
"""
return activeCalls(activePrefetchCalls, operationNa... | java | @NotNull Set<ApolloPrefetch> activePrefetchCalls(@NotNull OperationName operationName) {
return activeCalls(activePrefetchCalls, operationName);
} | [
"@",
"NotNull",
"Set",
"<",
"ApolloPrefetch",
">",
"activePrefetchCalls",
"(",
"@",
"NotNull",
"OperationName",
"operationName",
")",
"{",
"return",
"activeCalls",
"(",
"activePrefetchCalls",
",",
"operationName",
")",
";",
"}"
] | Returns currently active {@link ApolloPrefetch} calls by operation name.
@param operationName prefetch operation name
@return set of active prefetch calls | [
"Returns",
"currently",
"active",
"{",
"@link",
"ApolloPrefetch",
"}",
"calls",
"by",
"operation",
"name",
"."
] | train | https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-runtime/src/main/java/com/apollographql/apollo/internal/ApolloCallTracker.java#L113-L115 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java | IPv6AddressSection.intersect | public IPv6AddressSection intersect(IPv6AddressSection other) throws SizeMismatchException {
"""
Produces the subnet sections whose addresses are found in both this and the given argument.
<p>
This is also known as the conjunction of the two sets of address sections.
<p>
@param other
@return the section conta... | java | public IPv6AddressSection intersect(IPv6AddressSection other) throws SizeMismatchException {
return intersect(this, other, getAddressCreator(), this::getSegment, other::getSegment);
} | [
"public",
"IPv6AddressSection",
"intersect",
"(",
"IPv6AddressSection",
"other",
")",
"throws",
"SizeMismatchException",
"{",
"return",
"intersect",
"(",
"this",
",",
"other",
",",
"getAddressCreator",
"(",
")",
",",
"this",
"::",
"getSegment",
",",
"other",
"::",... | Produces the subnet sections whose addresses are found in both this and the given argument.
<p>
This is also known as the conjunction of the two sets of address sections.
<p>
@param other
@return the section containing the sections found in both this and the given subnet sections | [
"Produces",
"the",
"subnet",
"sections",
"whose",
"addresses",
"are",
"found",
"in",
"both",
"this",
"and",
"the",
"given",
"argument",
".",
"<p",
">",
"This",
"is",
"also",
"known",
"as",
"the",
"conjunction",
"of",
"the",
"two",
"sets",
"of",
"address",
... | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java#L1617-L1619 |
vatbub/common | updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java | UpdateChecker.downloadAndInstallUpdate | public static boolean downloadAndInstallUpdate(UpdateInfo updateToInstall, UpdateProgressDialog gui,
boolean launchUpdateAfterInstall, @SuppressWarnings("SameParameterValue") boolean deleteOldVersion, String... params) throws IllegalStateException, IOException {
""... | java | public static boolean downloadAndInstallUpdate(UpdateInfo updateToInstall, UpdateProgressDialog gui,
boolean launchUpdateAfterInstall, @SuppressWarnings("SameParameterValue") boolean deleteOldVersion, String... params) throws IllegalStateException, IOException {
... | [
"public",
"static",
"boolean",
"downloadAndInstallUpdate",
"(",
"UpdateInfo",
"updateToInstall",
",",
"UpdateProgressDialog",
"gui",
",",
"boolean",
"launchUpdateAfterInstall",
",",
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"boolean",
"deleteOldVersion",
... | Downloads the specified update as a jar-file and launches it. The jar
file will be saved at the same location as the currently executed file
but will not replace it (unless it has the same filename but this will
never happen)
@param updateToInstall The {@link UpdateInfo}-object that contains the information
a... | [
"Downloads",
"the",
"specified",
"update",
"as",
"a",
"jar",
"-",
"file",
"and",
"launches",
"it",
".",
"The",
"jar",
"file",
"will",
"be",
"saved",
"at",
"the",
"same",
"location",
"as",
"the",
"currently",
"executed",
"file",
"but",
"will",
"not",
"rep... | train | https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java#L484-L487 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java | XMLCharHelper.isInvalidXMLNameStartChar | public static boolean isInvalidXMLNameStartChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c) {
"""
Check if the passed character is invalid for an element or attribute name
on the first position
@param eXMLVersion
XML version to be used. May not be <code>null</code>.
@param c
char to check... | java | public static boolean isInvalidXMLNameStartChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c)
{
switch (eXMLVersion)
{
case XML_10:
return INVALID_NAME_START_CHAR_XML10.get (c);
case XML_11:
return INVALID_NAME_START_CHAR_XML11.get (c);
case HTML:
ret... | [
"public",
"static",
"boolean",
"isInvalidXMLNameStartChar",
"(",
"@",
"Nonnull",
"final",
"EXMLSerializeVersion",
"eXMLVersion",
",",
"final",
"int",
"c",
")",
"{",
"switch",
"(",
"eXMLVersion",
")",
"{",
"case",
"XML_10",
":",
"return",
"INVALID_NAME_START_CHAR_XML... | Check if the passed character is invalid for an element or attribute name
on the first position
@param eXMLVersion
XML version to be used. May not be <code>null</code>.
@param c
char to check
@return <code>true</code> if the char is invalid | [
"Check",
"if",
"the",
"passed",
"character",
"is",
"invalid",
"for",
"an",
"element",
"or",
"attribute",
"name",
"on",
"the",
"first",
"position"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java#L643-L656 |
twitter/twitter-korean-text | src/main/java/com/twitter/penguin/korean/util/CharacterUtils.java | CharacterUtils.toCodePoints | public final int toCodePoints(char[] src, int srcOff, int srcLen, int[] dest, int destOff) {
"""
Converts a sequence of Java characters to a sequence of unicode code points.
@return the number of code points written to the destination buffer
"""
if (srcLen < 0) {
throw new IllegalArgumentException... | java | public final int toCodePoints(char[] src, int srcOff, int srcLen, int[] dest, int destOff) {
if (srcLen < 0) {
throw new IllegalArgumentException("srcLen must be >= 0");
}
int codePointCount = 0;
for (int i = 0; i < srcLen; ) {
final int cp = codePointAt(src, srcOff + i, srcOff + srcLen);
... | [
"public",
"final",
"int",
"toCodePoints",
"(",
"char",
"[",
"]",
"src",
",",
"int",
"srcOff",
",",
"int",
"srcLen",
",",
"int",
"[",
"]",
"dest",
",",
"int",
"destOff",
")",
"{",
"if",
"(",
"srcLen",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgu... | Converts a sequence of Java characters to a sequence of unicode code points.
@return the number of code points written to the destination buffer | [
"Converts",
"a",
"sequence",
"of",
"Java",
"characters",
"to",
"a",
"sequence",
"of",
"unicode",
"code",
"points",
"."
] | train | https://github.com/twitter/twitter-korean-text/blob/95bbe21fcc62fa7bf50b769ae80a5734fef6b903/src/main/java/com/twitter/penguin/korean/util/CharacterUtils.java#L134-L146 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateEntityRole | public OperationStatus updateEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateEntityRoleOptionalParameter updateEntityRoleOptionalParameter) {
"""
Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID... | java | public OperationStatus updateEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateEntityRoleOptionalParameter updateEntityRoleOptionalParameter) {
return updateEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId, updateEntityRoleOptionalParameter).toBlocking().single().bo... | [
"public",
"OperationStatus",
"updateEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
",",
"UpdateEntityRoleOptionalParameter",
"updateEntityRoleOptionalParameter",
")",
"{",
"return",
"updateEntityRoleWithService... | Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role ID.
@param updateEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgument... | [
"Update",
"an",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10842-L10844 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.patchClosedList | public OperationStatus patchClosedList(UUID appId, String versionId, UUID clEntityId, PatchClosedListOptionalParameter patchClosedListOptionalParameter) {
"""
Adds a batch of sublists to an existing closedlist.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list... | java | public OperationStatus patchClosedList(UUID appId, String versionId, UUID clEntityId, PatchClosedListOptionalParameter patchClosedListOptionalParameter) {
return patchClosedListWithServiceResponseAsync(appId, versionId, clEntityId, patchClosedListOptionalParameter).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"patchClosedList",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"clEntityId",
",",
"PatchClosedListOptionalParameter",
"patchClosedListOptionalParameter",
")",
"{",
"return",
"patchClosedListWithServiceResponseAsync",
"(",
"appId... | Adds a batch of sublists to an existing closedlist.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list model ID.
@param patchClosedListOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException th... | [
"Adds",
"a",
"batch",
"of",
"sublists",
"to",
"an",
"existing",
"closedlist",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4410-L4412 |
ehcache/ehcache3 | xml/src/main/java/org/ehcache/xml/XmlConfiguration.java | XmlConfiguration.newCacheConfigurationBuilderFromTemplate | @SuppressWarnings("unchecked")
public <K, V> CacheConfigurationBuilder<K, V> newCacheConfigurationBuilderFromTemplate(final String name,
final Class<K> keyType,
... | java | @SuppressWarnings("unchecked")
public <K, V> CacheConfigurationBuilder<K, V> newCacheConfigurationBuilderFromTemplate(final String name,
final Class<K> keyType,
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"K",
",",
"V",
">",
"CacheConfigurationBuilder",
"<",
"K",
",",
"V",
">",
"newCacheConfigurationBuilderFromTemplate",
"(",
"final",
"String",
"name",
",",
"final",
"Class",
"<",
"K",
">",
"keyT... | Creates a new {@link CacheConfigurationBuilder} seeded with the cache-template configuration
by the given {@code name} in the parsed XML configuration.
@param name the unique name identifying the cache-template element in the XML
@param keyType the type of keys for the {@link CacheConfigurationBuilder} to use, must
ma... | [
"Creates",
"a",
"new",
"{",
"@link",
"CacheConfigurationBuilder",
"}",
"seeded",
"with",
"the",
"cache",
"-",
"template",
"configuration",
"by",
"the",
"given",
"{",
"@code",
"name",
"}",
"in",
"the",
"parsed",
"XML",
"configuration",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/xml/src/main/java/org/ehcache/xml/XmlConfiguration.java#L335-L342 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java | QrCodeDecoderImage.process | public void process(FastQueue<PositionPatternNode> pps , T gray ) {
"""
Detects QR Codes inside image using position pattern graph
@param pps position pattern graph
@param gray Gray input image
"""
gridReader.setImage(gray);
storageQR.reset();
successes.clear();
failures.clear();
for (int i = 0;... | java | public void process(FastQueue<PositionPatternNode> pps , T gray ) {
gridReader.setImage(gray);
storageQR.reset();
successes.clear();
failures.clear();
for (int i = 0; i < pps.size; i++) {
PositionPatternNode ppn = pps.get(i);
for (int j = 3,k=0; k < 4; j=k,k++) {
if( ppn.edges[j] != null && ppn.ed... | [
"public",
"void",
"process",
"(",
"FastQueue",
"<",
"PositionPatternNode",
">",
"pps",
",",
"T",
"gray",
")",
"{",
"gridReader",
".",
"setImage",
"(",
"gray",
")",
";",
"storageQR",
".",
"reset",
"(",
")",
";",
"successes",
".",
"clear",
"(",
")",
";",... | Detects QR Codes inside image using position pattern graph
@param pps position pattern graph
@param gray Gray input image | [
"Detects",
"QR",
"Codes",
"inside",
"image",
"using",
"position",
"pattern",
"graph"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L75-L102 |
crnk-project/crnk-framework | crnk-core/src/main/java/io/crnk/core/engine/internal/http/JsonApiRequestProcessor.java | JsonApiRequestProcessor.isJsonApiRequest | @SuppressWarnings("UnnecessaryLocalVariable")
public static boolean isJsonApiRequest(HttpRequestContext requestContext, boolean acceptPlainJson) {
"""
Determines whether the supplied HTTP request is considered a JSON-API request.
@param requestContext The HTTP request
@param acceptPlainJson Whether a plain JS... | java | @SuppressWarnings("UnnecessaryLocalVariable")
public static boolean isJsonApiRequest(HttpRequestContext requestContext, boolean acceptPlainJson) {
String method = requestContext.getMethod().toUpperCase();
boolean isPatch = method.equals(HttpMethod.PATCH.toString());
boolean isPost = method.equals(HttpMethod.POST... | [
"@",
"SuppressWarnings",
"(",
"\"UnnecessaryLocalVariable\"",
")",
"public",
"static",
"boolean",
"isJsonApiRequest",
"(",
"HttpRequestContext",
"requestContext",
",",
"boolean",
"acceptPlainJson",
")",
"{",
"String",
"method",
"=",
"requestContext",
".",
"getMethod",
"... | Determines whether the supplied HTTP request is considered a JSON-API request.
@param requestContext The HTTP request
@param acceptPlainJson Whether a plain JSON request should also be considered a JSON-API request
@return <code>true</code> if it is a JSON-API request; <code>false</code> otherwise
@since 2.4 | [
"Determines",
"whether",
"the",
"supplied",
"HTTP",
"request",
"is",
"considered",
"a",
"JSON",
"-",
"API",
"request",
"."
] | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/http/JsonApiRequestProcessor.java#L53-L74 |
apache/incubator-zipkin | zipkin/src/main/java/zipkin2/Call.java | Call.flatMap | public final <R> Call<R> flatMap(FlatMapper<V, R> flatMapper) {
"""
Maps the result of this call into another, as defined by the {@code flatMapper} function. This
is used to chain two remote calls together. For example, you could use this to chain a list IDs
call to a get by IDs call.
<pre>{@code
getTracesCa... | java | public final <R> Call<R> flatMap(FlatMapper<V, R> flatMapper) {
return new FlatMapping<>(flatMapper, this);
} | [
"public",
"final",
"<",
"R",
">",
"Call",
"<",
"R",
">",
"flatMap",
"(",
"FlatMapper",
"<",
"V",
",",
"R",
">",
"flatMapper",
")",
"{",
"return",
"new",
"FlatMapping",
"<>",
"(",
"flatMapper",
",",
"this",
")",
";",
"}"
] | Maps the result of this call into another, as defined by the {@code flatMapper} function. This
is used to chain two remote calls together. For example, you could use this to chain a list IDs
call to a get by IDs call.
<pre>{@code
getTracesCall = getIdsCall.flatMap(ids -> getTraces(ids));
// this would now invoke the ... | [
"Maps",
"the",
"result",
"of",
"this",
"call",
"into",
"another",
"as",
"defined",
"by",
"the",
"{",
"@code",
"flatMapper",
"}",
"function",
".",
"This",
"is",
"used",
"to",
"chain",
"two",
"remote",
"calls",
"together",
".",
"For",
"example",
"you",
"co... | train | https://github.com/apache/incubator-zipkin/blob/89b2fab983fc626b3be32ce9d7cf64b3f01f1a87/zipkin/src/main/java/zipkin2/Call.java#L110-L112 |
jingwei/krati | krati-main/src/main/java/krati/io/IOFactory.java | IOFactory.createDataReader | public final static DataReader createDataReader(File file, IOType type) {
"""
Creates a new DataReader to read from a file.
@param file - file to read.
@param type - I/O type.
@return a new DataReader instance.
"""
if(type == IOType.MAPPED) {
if(file.length() <= Integer.MAX_VALUE) {
... | java | public final static DataReader createDataReader(File file, IOType type) {
if(type == IOType.MAPPED) {
if(file.length() <= Integer.MAX_VALUE) {
return new MappedReader(file);
} else {
return new MultiMappedReader(file);
}
} else {
... | [
"public",
"final",
"static",
"DataReader",
"createDataReader",
"(",
"File",
"file",
",",
"IOType",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"IOType",
".",
"MAPPED",
")",
"{",
"if",
"(",
"file",
".",
"length",
"(",
")",
"<=",
"Integer",
".",
"MAX_VALU... | Creates a new DataReader to read from a file.
@param file - file to read.
@param type - I/O type.
@return a new DataReader instance. | [
"Creates",
"a",
"new",
"DataReader",
"to",
"read",
"from",
"a",
"file",
"."
] | train | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/io/IOFactory.java#L37-L47 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/auth/AuthenticatorFactory.java | AuthenticatorFactory.createPersonaAuthenticator | public static Authenticator createPersonaAuthenticator(String assertion) {
"""
/*
Creates an Authenticator that knows how to do Persona authentication.
@param assertion Persona Assertion
"""
Map<String, String> params = new HashMap<String, String>();
params.put("assertion", assertion);
... | java | public static Authenticator createPersonaAuthenticator(String assertion) {
Map<String, String> params = new HashMap<String, String>();
params.put("assertion", assertion);
return new TokenAuthenticator("_persona", params);
} | [
"public",
"static",
"Authenticator",
"createPersonaAuthenticator",
"(",
"String",
"assertion",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"params",
".",
"put",
"(",... | /*
Creates an Authenticator that knows how to do Persona authentication.
@param assertion Persona Assertion | [
"/",
"*",
"Creates",
"an",
"Authenticator",
"that",
"knows",
"how",
"to",
"do",
"Persona",
"authentication",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/auth/AuthenticatorFactory.java#L50-L54 |
j256/simplejmx | src/main/java/com/j256/simplejmx/server/JmxServer.java | JmxServer.stopThrow | public synchronized void stopThrow() throws JMException {
"""
Stop the JMX server by closing the connector and unpublishing it from the RMI registry. This throws a JMException
on any issues.
"""
if (connector != null) {
try {
connector.stop();
} catch (IOException e) {
throw createJmException(... | java | public synchronized void stopThrow() throws JMException {
if (connector != null) {
try {
connector.stop();
} catch (IOException e) {
throw createJmException("Could not stop our Jmx connector server", e);
} finally {
connector = null;
}
}
if (rmiRegistry != null) {
try {
UnicastRemot... | [
"public",
"synchronized",
"void",
"stopThrow",
"(",
")",
"throws",
"JMException",
"{",
"if",
"(",
"connector",
"!=",
"null",
")",
"{",
"try",
"{",
"connector",
".",
"stop",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"creat... | Stop the JMX server by closing the connector and unpublishing it from the RMI registry. This throws a JMException
on any issues. | [
"Stop",
"the",
"JMX",
"server",
"by",
"closing",
"the",
"connector",
"and",
"unpublishing",
"it",
"from",
"the",
"RMI",
"registry",
".",
"This",
"throws",
"a",
"JMException",
"on",
"any",
"issues",
"."
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/server/JmxServer.java#L186-L209 |
lukas-krecan/json2xml | src/main/java/net/javacrumbs/json2xml/JsonSaxAdapter.java | JsonSaxAdapter.parseElement | private void parseElement(final String elementName, final boolean inArray) throws Exception {
"""
Pares JSON element.
@param elementName
@param inArray if the element is in an array
@throws Exception
"""
JsonToken currentToken = jsonParser.getCurrentToken();
if (inArray) {
startE... | java | private void parseElement(final String elementName, final boolean inArray) throws Exception {
JsonToken currentToken = jsonParser.getCurrentToken();
if (inArray) {
startElement(elementName);
}
if (START_OBJECT.equals(currentToken)) {
parseObject();
} else ... | [
"private",
"void",
"parseElement",
"(",
"final",
"String",
"elementName",
",",
"final",
"boolean",
"inArray",
")",
"throws",
"Exception",
"{",
"JsonToken",
"currentToken",
"=",
"jsonParser",
".",
"getCurrentToken",
"(",
")",
";",
"if",
"(",
"inArray",
")",
"{"... | Pares JSON element.
@param elementName
@param inArray if the element is in an array
@throws Exception | [
"Pares",
"JSON",
"element",
"."
] | train | https://github.com/lukas-krecan/json2xml/blob/8fba4f942ebed5d6f7ad851390c634fff8559cac/src/main/java/net/javacrumbs/json2xml/JsonSaxAdapter.java#L225-L240 |
b3dgs/lionengine | lionengine-audio-wav/src/main/java/com/b3dgs/lionengine/audio/wav/WavImpl.java | WavImpl.readSound | private static void readSound(AudioInputStream input, SourceDataLine dataLine) throws IOException {
"""
Read the full sound and play it by buffer.
@param input The audio input.
@param dataLine Audio source data.
@throws IOException If error when reading the sound.
"""
int read;
final byte[... | java | private static void readSound(AudioInputStream input, SourceDataLine dataLine) throws IOException
{
int read;
final byte[] buffer = new byte[BUFFER];
while ((read = input.read(buffer, 0, buffer.length)) > 0)
{
dataLine.write(buffer, 0, read);
}
} | [
"private",
"static",
"void",
"readSound",
"(",
"AudioInputStream",
"input",
",",
"SourceDataLine",
"dataLine",
")",
"throws",
"IOException",
"{",
"int",
"read",
";",
"final",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"BUFFER",
"]",
";",
"while",
... | Read the full sound and play it by buffer.
@param input The audio input.
@param dataLine Audio source data.
@throws IOException If error when reading the sound. | [
"Read",
"the",
"full",
"sound",
"and",
"play",
"it",
"by",
"buffer",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-audio-wav/src/main/java/com/b3dgs/lionengine/audio/wav/WavImpl.java#L177-L185 |
Erudika/para | para-core/src/main/java/com/erudika/para/core/Linker.java | Linker.isReversed | private boolean isReversed(String s1, String s2) {
"""
Compare the names of the two linkable objects
and decide if we need to swap their positions.
For example: isReversed(user, tag) - true; isReversed(tag, user) - false
"""
if (s1 == null || s2 == null) {
return false;
}
return s1.compareToIgnoreCa... | java | private boolean isReversed(String s1, String s2) {
if (s1 == null || s2 == null) {
return false;
}
return s1.compareToIgnoreCase(s2) > 0;
} | [
"private",
"boolean",
"isReversed",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"s1",
"==",
"null",
"||",
"s2",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"s1",
".",
"compareToIgnoreCase",
"(",
"s2",
")",
">",
... | Compare the names of the two linkable objects
and decide if we need to swap their positions.
For example: isReversed(user, tag) - true; isReversed(tag, user) - false | [
"Compare",
"the",
"names",
"of",
"the",
"two",
"linkable",
"objects",
"and",
"decide",
"if",
"we",
"need",
"to",
"swap",
"their",
"positions",
".",
"For",
"example",
":",
"isReversed",
"(",
"user",
"tag",
")",
"-",
"true",
";",
"isReversed",
"(",
"tag",
... | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/Linker.java#L180-L185 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java | SDValidation.validateBool | protected static void validateBool(String opName, SDVariable v1, SDVariable v2) {
"""
Validate that the operation is being applied on boolean SDVariables
@param opName Operation name to print in the exception
@param v1 Variable to validate datatype for (input to operation)
@param v2 Variable to valida... | java | protected static void validateBool(String opName, SDVariable v1, SDVariable v2) {
if (v1.dataType() != DataType.BOOL || v2.dataType() != DataType.BOOL)
throw new IllegalStateException("Cannot perform operation \"" + opName + "\" on variables \"" + v1.getVarName() + "\" and \"" +
... | [
"protected",
"static",
"void",
"validateBool",
"(",
"String",
"opName",
",",
"SDVariable",
"v1",
",",
"SDVariable",
"v2",
")",
"{",
"if",
"(",
"v1",
".",
"dataType",
"(",
")",
"!=",
"DataType",
".",
"BOOL",
"||",
"v2",
".",
"dataType",
"(",
")",
"!=",
... | Validate that the operation is being applied on boolean SDVariables
@param opName Operation name to print in the exception
@param v1 Variable to validate datatype for (input to operation)
@param v2 Variable to validate datatype for (input to operation) | [
"Validate",
"that",
"the",
"operation",
"is",
"being",
"applied",
"on",
"boolean",
"SDVariables"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java#L147-L151 |
BioPAX/Paxtools | paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java | LevelUpgrader.convertAndAddVocabulary | private ControlledVocabulary convertAndAddVocabulary(openControlledVocabulary value,
Level2Element parent, Model newModel, PropertyEditor newEditor) {
"""
/*
Creates a specific ControlledVocabulary subclass
and adds to the new model
"""
String id = ((BioPAXElement) value).getUri();
if (!newModel.cont... | java | private ControlledVocabulary convertAndAddVocabulary(openControlledVocabulary value,
Level2Element parent, Model newModel, PropertyEditor newEditor)
{
String id = ((BioPAXElement) value).getUri();
if (!newModel.containsID(id)) {
if (newEditor != null) {
newModel.addNew(newEditor.getRange(), id);
// ... | [
"private",
"ControlledVocabulary",
"convertAndAddVocabulary",
"(",
"openControlledVocabulary",
"value",
",",
"Level2Element",
"parent",
",",
"Model",
"newModel",
",",
"PropertyEditor",
"newEditor",
")",
"{",
"String",
"id",
"=",
"(",
"(",
"BioPAXElement",
")",
"value"... | /*
Creates a specific ControlledVocabulary subclass
and adds to the new model | [
"/",
"*",
"Creates",
"a",
"specific",
"ControlledVocabulary",
"subclass",
"and",
"adds",
"to",
"the",
"new",
"model"
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java#L274-L290 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/ECKey.java | ECKey.encryptionIsReversible | public static boolean encryptionIsReversible(ECKey originalKey, ECKey encryptedKey, KeyCrypter keyCrypter, KeyParameter aesKey) {
"""
<p>Check that it is possible to decrypt the key with the keyCrypter and that the original key is returned.</p>
<p>Because it is a critical failure if the private keys cannot be d... | java | public static boolean encryptionIsReversible(ECKey originalKey, ECKey encryptedKey, KeyCrypter keyCrypter, KeyParameter aesKey) {
try {
ECKey rebornUnencryptedKey = encryptedKey.decrypt(keyCrypter, aesKey);
byte[] originalPrivateKeyBytes = originalKey.getPrivKeyBytes();
byte[... | [
"public",
"static",
"boolean",
"encryptionIsReversible",
"(",
"ECKey",
"originalKey",
",",
"ECKey",
"encryptedKey",
",",
"KeyCrypter",
"keyCrypter",
",",
"KeyParameter",
"aesKey",
")",
"{",
"try",
"{",
"ECKey",
"rebornUnencryptedKey",
"=",
"encryptedKey",
".",
"decr... | <p>Check that it is possible to decrypt the key with the keyCrypter and that the original key is returned.</p>
<p>Because it is a critical failure if the private keys cannot be decrypted successfully (resulting of loss of all
bitcoins controlled by the private key) you can use this method to check when you *encrypt* a... | [
"<p",
">",
"Check",
"that",
"it",
"is",
"possible",
"to",
"decrypt",
"the",
"key",
"with",
"the",
"keyCrypter",
"and",
"that",
"the",
"original",
"key",
"is",
"returned",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/ECKey.java#L1154-L1168 |
landawn/AbacusUtil | src/com/landawn/abacus/util/DateUtil.java | DateUtil.addMilliseconds | public static <T extends java.util.Date> T addMilliseconds(final T date, final int amount) {
"""
Adds a number of milliseconds to a date returning a new object.
The original {@code Date} is unchanged.
@param date the date, not null
@param amount the amount to add, may be negative
@return the new {@code Dat... | java | public static <T extends java.util.Date> T addMilliseconds(final T date, final int amount) {
return roll(date, amount, CalendarUnit.MILLISECOND);
} | [
"public",
"static",
"<",
"T",
"extends",
"java",
".",
"util",
".",
"Date",
">",
"T",
"addMilliseconds",
"(",
"final",
"T",
"date",
",",
"final",
"int",
"amount",
")",
"{",
"return",
"roll",
"(",
"date",
",",
"amount",
",",
"CalendarUnit",
".",
"MILLISE... | Adds a number of milliseconds to a date returning a new object.
The original {@code Date} is unchanged.
@param date the date, not null
@param amount the amount to add, may be negative
@return the new {@code Date} with the amount added
@throws IllegalArgumentException if the date is null | [
"Adds",
"a",
"number",
"of",
"milliseconds",
"to",
"a",
"date",
"returning",
"a",
"new",
"object",
".",
"The",
"original",
"{",
"@code",
"Date",
"}",
"is",
"unchanged",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DateUtil.java#L1049-L1051 |
Jasig/uPortal | uPortal-tools/src/main/java/org/apereo/portal/version/VersionUtils.java | VersionUtils.canUpdate | public static boolean canUpdate(Version from, Version to) {
"""
Determine if an "update" can be done between the from and to versions. The ability to update
is defined as from == to OR (from.isBefore(to) AND mostSpecificMatchingField in (PATCH,
MINOR))
@param from Version updating from
@param to Version upda... | java | public static boolean canUpdate(Version from, Version to) {
final Field mostSpecificMatchingField = getMostSpecificMatchingField(from, to);
switch (mostSpecificMatchingField) {
case LOCAL:
{
return true;
}
case PATCH:
... | [
"public",
"static",
"boolean",
"canUpdate",
"(",
"Version",
"from",
",",
"Version",
"to",
")",
"{",
"final",
"Field",
"mostSpecificMatchingField",
"=",
"getMostSpecificMatchingField",
"(",
"from",
",",
"to",
")",
";",
"switch",
"(",
"mostSpecificMatchingField",
")... | Determine if an "update" can be done between the from and to versions. The ability to update
is defined as from == to OR (from.isBefore(to) AND mostSpecificMatchingField in (PATCH,
MINOR))
@param from Version updating from
@param to Version updating to
@return true if the major and minor versions match and the from.pa... | [
"Determine",
"if",
"an",
"update",
"can",
"be",
"done",
"between",
"the",
"from",
"and",
"to",
"versions",
".",
"The",
"ability",
"to",
"update",
"is",
"defined",
"as",
"from",
"==",
"to",
"OR",
"(",
"from",
".",
"isBefore",
"(",
"to",
")",
"AND",
"m... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-tools/src/main/java/org/apereo/portal/version/VersionUtils.java#L100-L117 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.setCacheEventJournalConfigs | public Config setCacheEventJournalConfigs(Map<String, EventJournalConfig> eventJournalConfigs) {
"""
Sets the map of cache event journal configurations, mapped by config name.
The config name may be a pattern with which the configuration will be
obtained in the future.
@param eventJournalConfigs the cache eve... | java | public Config setCacheEventJournalConfigs(Map<String, EventJournalConfig> eventJournalConfigs) {
this.cacheEventJournalConfigs.clear();
this.cacheEventJournalConfigs.putAll(eventJournalConfigs);
for (Entry<String, EventJournalConfig> entry : eventJournalConfigs.entrySet()) {
entry.ge... | [
"public",
"Config",
"setCacheEventJournalConfigs",
"(",
"Map",
"<",
"String",
",",
"EventJournalConfig",
">",
"eventJournalConfigs",
")",
"{",
"this",
".",
"cacheEventJournalConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"cacheEventJournalConfigs",
".",
"putAll... | Sets the map of cache event journal configurations, mapped by config name.
The config name may be a pattern with which the configuration will be
obtained in the future.
@param eventJournalConfigs the cache event journal configuration map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"cache",
"event",
"journal",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"The",
"config",
"name",
"may",
"be",
"a",
"pattern",
"with",
"which",
"the",
"configuration",
"will",
"be",
"obtained",
"in",
"the",
"future",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L3139-L3146 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.rmacc | public void rmacc(String resourceName, String principalType, String principalName) throws CmsException {
"""
Removes an access control entry of a given principal from a given resource.<p>
@param resourceName name of the resource
@param principalType the type of the principal (currently group or user)
@param p... | java | public void rmacc(String resourceName, String principalType, String principalName) throws CmsException {
CmsResource res = readResource(resourceName, CmsResourceFilter.ALL);
if (CmsUUID.isValidUUID(principalName)) {
// principal name is in fact a UUID, probably the user was already deleted... | [
"public",
"void",
"rmacc",
"(",
"String",
"resourceName",
",",
"String",
"principalType",
",",
"String",
"principalName",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"res",
"=",
"readResource",
"(",
"resourceName",
",",
"CmsResourceFilter",
".",
"ALL",
")",... | Removes an access control entry of a given principal from a given resource.<p>
@param resourceName name of the resource
@param principalType the type of the principal (currently group or user)
@param principalName the name of the principal
@throws CmsException if something goes wrong | [
"Removes",
"an",
"access",
"control",
"entry",
"of",
"a",
"given",
"principal",
"from",
"a",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3714-L3742 |
3pillarlabs/spring-data-simpledb | spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/attributeutil/AmazonSimpleDBUtil.java | AmazonSimpleDBUtil.decodeByteArray | public static byte[] decodeByteArray(String value) throws ParseException {
"""
Decodes byte[] value from the string representation created using encodeDate(..) function.
@param value
string representation of the date value
@return original byte[] value
"""
try {
return Base64.decodeBase64(value.getBy... | java | public static byte[] decodeByteArray(String value) throws ParseException {
try {
return Base64.decodeBase64(value.getBytes(UTF8_ENCODING));
} catch(UnsupportedEncodingException e) {
throw new MappingException("Could not decode byteArray to UTF8 encoding", e);
}
} | [
"public",
"static",
"byte",
"[",
"]",
"decodeByteArray",
"(",
"String",
"value",
")",
"throws",
"ParseException",
"{",
"try",
"{",
"return",
"Base64",
".",
"decodeBase64",
"(",
"value",
".",
"getBytes",
"(",
"UTF8_ENCODING",
")",
")",
";",
"}",
"catch",
"(... | Decodes byte[] value from the string representation created using encodeDate(..) function.
@param value
string representation of the date value
@return original byte[] value | [
"Decodes",
"byte",
"[]",
"value",
"from",
"the",
"string",
"representation",
"created",
"using",
"encodeDate",
"(",
"..",
")",
"function",
"."
] | train | https://github.com/3pillarlabs/spring-data-simpledb/blob/f1e0eb4e48ec4674d3966e8f5bc04c95031f93ae/spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/attributeutil/AmazonSimpleDBUtil.java#L187-L194 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/reconciliationreportservice/GetReconciliationReportForLastBillingPeriod.java | GetReconciliationReportForLastBillingPeriod.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
ReconciliationReportServiceInterface reconciliationReportService =
adManagerServices.get(session, ReconciliationReportServiceInterface.class);
// Get the NetworkService.
Netwo... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"ReconciliationReportServiceInterface",
"reconciliationReportService",
"=",
"adManagerServices",
".",
"get",
"("... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/reconciliationreportservice/GetReconciliationReportForLastBillingPeriod.java#L55-L98 |
pedrovgs/DraggablePanel | draggablepanel/src/main/java/com/github/pedrovgs/DraggableViewCallback.java | DraggableViewCallback.onViewReleased | @Override public void onViewReleased(View releasedChild, float xVel, float yVel) {
"""
Override method used to apply different animations when the dragged view is released. The
dragged view is going to be maximized or minimized if the view is above the middle of the
custom view and the velocity is greater than a... | java | @Override public void onViewReleased(View releasedChild, float xVel, float yVel) {
super.onViewReleased(releasedChild, xVel, yVel);
if (draggableView.isDragViewAtBottom() && !draggableView.isDragViewAtRight()) {
triggerOnReleaseActionsWhileHorizontalDrag(xVel);
} else {
triggerOnReleaseActionsW... | [
"@",
"Override",
"public",
"void",
"onViewReleased",
"(",
"View",
"releasedChild",
",",
"float",
"xVel",
",",
"float",
"yVel",
")",
"{",
"super",
".",
"onViewReleased",
"(",
"releasedChild",
",",
"xVel",
",",
"yVel",
")",
";",
"if",
"(",
"draggableView",
"... | Override method used to apply different animations when the dragged view is released. The
dragged view is going to be maximized or minimized if the view is above the middle of the
custom view and the velocity is greater than a constant value.
@param releasedChild the captured child view now being released.
@param xVel... | [
"Override",
"method",
"used",
"to",
"apply",
"different",
"animations",
"when",
"the",
"dragged",
"view",
"is",
"released",
".",
"The",
"dragged",
"view",
"is",
"going",
"to",
"be",
"maximized",
"or",
"minimized",
"if",
"the",
"view",
"is",
"above",
"the",
... | train | https://github.com/pedrovgs/DraggablePanel/blob/6b6d1806fa4140113f31307a2571bf02435aa53a/draggablepanel/src/main/java/com/github/pedrovgs/DraggableViewCallback.java#L78-L86 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java | ExtraLanguagePreferenceAccess.getBoolean | public static boolean getBoolean(IPreferenceStore store, String preferenceContainerID, String preferenceName) {
"""
Replies the preference value from the given store.
@param store the preference storE.
@param preferenceContainerID the identifier of the generator's preference container.
@param preferenceName t... | java | public static boolean getBoolean(IPreferenceStore store, String preferenceContainerID, String preferenceName) {
return store.getBoolean(getPrefixedKey(preferenceContainerID, preferenceName));
} | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"IPreferenceStore",
"store",
",",
"String",
"preferenceContainerID",
",",
"String",
"preferenceName",
")",
"{",
"return",
"store",
".",
"getBoolean",
"(",
"getPrefixedKey",
"(",
"preferenceContainerID",
",",
"preferenc... | Replies the preference value from the given store.
@param store the preference storE.
@param preferenceContainerID the identifier of the generator's preference container.
@param preferenceName the name of the preference.
@return the key. | [
"Replies",
"the",
"preference",
"value",
"from",
"the",
"given",
"store",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java#L151-L153 |
nuun-io/kernel | core/src/main/java/io/nuun/kernel/core/internal/utils/AssertUtils.java | AssertUtils.hasAnnotationDeepRegex | public static boolean hasAnnotationDeepRegex(Class<?> memberDeclaringClass, String metaAnnotationRegex) {
"""
Indicates if the class name or at least the name of one of its annotations matches the regex.
<p>
Notice that the classes with a package name starting with "java.lang" will be ignored.
</p>
@param memb... | java | public static boolean hasAnnotationDeepRegex(Class<?> memberDeclaringClass, String metaAnnotationRegex)
{
if (memberDeclaringClass.getName().matches(metaAnnotationRegex))
{
return true;
}
for (Annotation anno : memberDeclaringClass.getAnnotations())
... | [
"public",
"static",
"boolean",
"hasAnnotationDeepRegex",
"(",
"Class",
"<",
"?",
">",
"memberDeclaringClass",
",",
"String",
"metaAnnotationRegex",
")",
"{",
"if",
"(",
"memberDeclaringClass",
".",
"getName",
"(",
")",
".",
"matches",
"(",
"metaAnnotationRegex",
"... | Indicates if the class name or at least the name of one of its annotations matches the regex.
<p>
Notice that the classes with a package name starting with "java.lang" will be ignored.
</p>
@param memberDeclaringClass the class to check
@param metaAnnotationRegex the regex to match
@return true if the regex matches, fa... | [
"Indicates",
"if",
"the",
"class",
"name",
"or",
"at",
"least",
"the",
"name",
"of",
"one",
"of",
"its",
"annotations",
"matches",
"the",
"regex",
".",
"<p",
">",
"Notice",
"that",
"the",
"classes",
"with",
"a",
"package",
"name",
"starting",
"with",
"ja... | train | https://github.com/nuun-io/kernel/blob/116a7664fe2a9323e280574803d273699a333732/core/src/main/java/io/nuun/kernel/core/internal/utils/AssertUtils.java#L118-L136 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java | PossiblyRedundantMethodCalls.isRiskyName | private static boolean isRiskyName(String className, String methodName) {
"""
returns true if the class or method name contains a pattern that is
considered likely to be this modifying
@param className the class name to check
@param methodName the method name to check
@return whether the method sounds like ... | java | private static boolean isRiskyName(String className, String methodName) {
if (riskyClassNames.contains(className)) {
return true;
}
String qualifiedMethodName = className + '.' + methodName;
if (riskyMethodNameContents.contains(qualifiedMethodName)) {
return true;
}
for (String riskyName : riskyMeth... | [
"private",
"static",
"boolean",
"isRiskyName",
"(",
"String",
"className",
",",
"String",
"methodName",
")",
"{",
"if",
"(",
"riskyClassNames",
".",
"contains",
"(",
"className",
")",
")",
"{",
"return",
"true",
";",
"}",
"String",
"qualifiedMethodName",
"=",
... | returns true if the class or method name contains a pattern that is
considered likely to be this modifying
@param className the class name to check
@param methodName the method name to check
@return whether the method sounds like it modifies this | [
"returns",
"true",
"if",
"the",
"class",
"or",
"method",
"name",
"contains",
"a",
"pattern",
"that",
"is",
"considered",
"likely",
"to",
"be",
"this",
"modifying"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java#L501-L518 |
opencb/biodata | biodata-formats/src/main/java/org/opencb/biodata/formats/variant/vcf4/VariantVcfFactory.java | VariantVcfFactory.mapToMultiallelicIndex | public static int mapToMultiallelicIndex (int parsedAllele, int numAllele) {
"""
In multiallelic variants, we have a list of alternates, where numAllele is the one whose variant we are parsing now.
If we are parsing the first variant (numAllele == 0) A1 refers to first alternative, (i.e. alternateAlleles[0]), A2 ... | java | public static int mapToMultiallelicIndex (int parsedAllele, int numAllele) {
int correctedAllele = parsedAllele;
if (parsedAllele > 0) {
if (parsedAllele == numAllele + 1) {
correctedAllele = 1;
} else if (parsedAllele < numAllele + 1) {
correctedA... | [
"public",
"static",
"int",
"mapToMultiallelicIndex",
"(",
"int",
"parsedAllele",
",",
"int",
"numAllele",
")",
"{",
"int",
"correctedAllele",
"=",
"parsedAllele",
";",
"if",
"(",
"parsedAllele",
">",
"0",
")",
"{",
"if",
"(",
"parsedAllele",
"==",
"numAllele",... | In multiallelic variants, we have a list of alternates, where numAllele is the one whose variant we are parsing now.
If we are parsing the first variant (numAllele == 0) A1 refers to first alternative, (i.e. alternateAlleles[0]), A2 to
second alternative (alternateAlleles[1]), and so on.
However, if numAllele == 1, A1 ... | [
"In",
"multiallelic",
"variants",
"we",
"have",
"a",
"list",
"of",
"alternates",
"where",
"numAllele",
"is",
"the",
"one",
"whose",
"variant",
"we",
"are",
"parsing",
"now",
".",
"If",
"we",
"are",
"parsing",
"the",
"first",
"variant",
"(",
"numAllele",
"=... | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-formats/src/main/java/org/opencb/biodata/formats/variant/vcf4/VariantVcfFactory.java#L281-L291 |
JOML-CI/JOML | src/org/joml/Vector3d.java | Vector3d.lengthSquared | public static double lengthSquared(double x, double y, double z) {
"""
Get the length squared of a 3-dimensional double-precision vector.
@param x The vector's x component
@param y The vector's y component
@param z The vector's z component
@return the length squared of the given vector
@author F. Neurat... | java | public static double lengthSquared(double x, double y, double z) {
return x * x + y * y + z * z;
} | [
"public",
"static",
"double",
"lengthSquared",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"return",
"x",
"*",
"x",
"+",
"y",
"*",
"y",
"+",
"z",
"*",
"z",
";",
"}"
] | Get the length squared of a 3-dimensional double-precision vector.
@param x The vector's x component
@param y The vector's y component
@param z The vector's z component
@return the length squared of the given vector
@author F. Neurath | [
"Get",
"the",
"length",
"squared",
"of",
"a",
"3",
"-",
"dimensional",
"double",
"-",
"precision",
"vector",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector3d.java#L1677-L1679 |
forge/furnace | maven-plugin/src/main/java/org/jboss/forge/furnace/maven/plugin/GenerateDOTMojo.java | GenerateDOTMojo.generateDOTFile | private File generateDOTFile(AddonDependencyResolver addonResolver, AddonId id, String fileName) {
"""
Generates the DOT file for a given addonId
@param addonResolver
@param id
@return generated file
"""
File parent = new File(outputDirectory);
parent.mkdirs();
File file = new File(paren... | java | private File generateDOTFile(AddonDependencyResolver addonResolver, AddonId id, String fileName)
{
File parent = new File(outputDirectory);
parent.mkdirs();
File file = new File(parent, fileName);
getLog().info("Generating " + file);
AddonInfo addonInfo = addonResolver.resolveAddonDepen... | [
"private",
"File",
"generateDOTFile",
"(",
"AddonDependencyResolver",
"addonResolver",
",",
"AddonId",
"id",
",",
"String",
"fileName",
")",
"{",
"File",
"parent",
"=",
"new",
"File",
"(",
"outputDirectory",
")",
";",
"parent",
".",
"mkdirs",
"(",
")",
";",
... | Generates the DOT file for a given addonId
@param addonResolver
@param id
@return generated file | [
"Generates",
"the",
"DOT",
"file",
"for",
"a",
"given",
"addonId"
] | train | https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/maven-plugin/src/main/java/org/jboss/forge/furnace/maven/plugin/GenerateDOTMojo.java#L167-L176 |
CenturyLinkCloud/mdw | mdw-workflow/assets/com/centurylink/mdw/microservice/ResponseCollector.java | ResponseCollector.updateResponse | protected void updateResponse(Pair<Integer,JSONObject> combined) throws ActivityException {
"""
Updates the response variable and responseHeaders status code (if present).
Override if your main response does not have a JsonTranslator for its type.
"""
ServiceValuesAccess serviceValues = getRuntimeCont... | java | protected void updateResponse(Pair<Integer,JSONObject> combined) throws ActivityException {
ServiceValuesAccess serviceValues = getRuntimeContext().getServiceValues();
Map<String,String> responseHeaders = serviceValues.getResponseHeaders();
if (responseHeaders == null)
responseHeader... | [
"protected",
"void",
"updateResponse",
"(",
"Pair",
"<",
"Integer",
",",
"JSONObject",
">",
"combined",
")",
"throws",
"ActivityException",
"{",
"ServiceValuesAccess",
"serviceValues",
"=",
"getRuntimeContext",
"(",
")",
".",
"getServiceValues",
"(",
")",
";",
"Ma... | Updates the response variable and responseHeaders status code (if present).
Override if your main response does not have a JsonTranslator for its type. | [
"Updates",
"the",
"response",
"variable",
"and",
"responseHeaders",
"status",
"code",
"(",
"if",
"present",
")",
".",
"Override",
"if",
"your",
"main",
"response",
"does",
"not",
"have",
"a",
"JsonTranslator",
"for",
"its",
"type",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/assets/com/centurylink/mdw/microservice/ResponseCollector.java#L64-L73 |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/cluster/impl/ClusterLocator.java | ClusterLocator.locateGroup | public void locateGroup(String cluster, String group, Handler<AsyncResult<String>> doneHandler) {
"""
Locates the local address of the nearest group node if one exists.
@param cluster The cluster in which to search for the node.
@param group The group to search.
@param doneHandler A handler to be called once ... | java | public void locateGroup(String cluster, String group, Handler<AsyncResult<String>> doneHandler) {
locateGroup(String.format("%s.%s", cluster, group), doneHandler);
} | [
"public",
"void",
"locateGroup",
"(",
"String",
"cluster",
",",
"String",
"group",
",",
"Handler",
"<",
"AsyncResult",
"<",
"String",
">",
">",
"doneHandler",
")",
"{",
"locateGroup",
"(",
"String",
".",
"format",
"(",
"\"%s.%s\"",
",",
"cluster",
",",
"gr... | Locates the local address of the nearest group node if one exists.
@param cluster The cluster in which to search for the node.
@param group The group to search.
@param doneHandler A handler to be called once the address has been located. | [
"Locates",
"the",
"local",
"address",
"of",
"the",
"nearest",
"group",
"node",
"if",
"one",
"exists",
"."
] | train | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/cluster/impl/ClusterLocator.java#L63-L65 |
grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java | UrlMappingUtils.includeForUrlMappingInfo | @SuppressWarnings( {
"""
Include whatever the given UrlMappingInfo maps to within the current response
@param request The request
@param response The response
@param info The UrlMappingInfo
@param model The model
@param linkGenerator allows for reverse url mapping
@return The included content
""" "un... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public static IncludedContent includeForUrlMappingInfo(HttpServletRequest request,
HttpServletResponse response, UrlMappingInfo info, Map model, LinkGenerator linkGenerator) {
final String includeUrl = buildDispatchUrlForMapping(info, true, linkGene... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"static",
"IncludedContent",
"includeForUrlMappingInfo",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"UrlMappingInfo",
"info",
",",
"Map",... | Include whatever the given UrlMappingInfo maps to within the current response
@param request The request
@param response The response
@param info The UrlMappingInfo
@param model The model
@param linkGenerator allows for reverse url mapping
@return The included content | [
"Include",
"whatever",
"the",
"given",
"UrlMappingInfo",
"maps",
"to",
"within",
"the",
"current",
"response"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java#L274-L281 |
cloudinary/cloudinary_java | cloudinary-core/src/main/java/com/cloudinary/utils/StringUtils.java | StringUtils.replaceIfFirstChar | public static String replaceIfFirstChar(String s, char c, String replacement) {
"""
Replaces the char c in the string S, if it's the first character in the string.
@param s The string to search
@param c The character to replace
@param replacement The string to replace the character in S
@return The string with... | java | public static String replaceIfFirstChar(String s, char c, String replacement) {
return s.charAt(0) == c ? replacement + s.substring(1) : s;
} | [
"public",
"static",
"String",
"replaceIfFirstChar",
"(",
"String",
"s",
",",
"char",
"c",
",",
"String",
"replacement",
")",
"{",
"return",
"s",
".",
"charAt",
"(",
"0",
")",
"==",
"c",
"?",
"replacement",
"+",
"s",
".",
"substring",
"(",
"1",
")",
"... | Replaces the char c in the string S, if it's the first character in the string.
@param s The string to search
@param c The character to replace
@param replacement The string to replace the character in S
@return The string with the character replaced (or the original string if the char is not found) | [
"Replaces",
"the",
"char",
"c",
"in",
"the",
"string",
"S",
"if",
"it",
"s",
"the",
"first",
"character",
"in",
"the",
"string",
"."
] | train | https://github.com/cloudinary/cloudinary_java/blob/58ee1823180da2dea6a2eb7e5cf00d5a760f8aef/cloudinary-core/src/main/java/com/cloudinary/utils/StringUtils.java#L305-L307 |
DDTH/ddth-zookeeper | src/main/java/com/github/ddth/zookeeper/ZooKeeperClient.java | ZooKeeperClient.createEphemeralNode | public boolean createEphemeralNode(String path, byte[] value) throws ZooKeeperException {
"""
Creates an ephemeral node, with initial values.
<p>
Note: nodes are created recursively (parent nodes are created if needed).
</p>
@param path
@param value
@return
@since 0.4.1
@throws ZooKeeperException
"... | java | public boolean createEphemeralNode(String path, byte[] value) throws ZooKeeperException {
return _create(path, value, CreateMode.EPHEMERAL);
} | [
"public",
"boolean",
"createEphemeralNode",
"(",
"String",
"path",
",",
"byte",
"[",
"]",
"value",
")",
"throws",
"ZooKeeperException",
"{",
"return",
"_create",
"(",
"path",
",",
"value",
",",
"CreateMode",
".",
"EPHEMERAL",
")",
";",
"}"
] | Creates an ephemeral node, with initial values.
<p>
Note: nodes are created recursively (parent nodes are created if needed).
</p>
@param path
@param value
@return
@since 0.4.1
@throws ZooKeeperException | [
"Creates",
"an",
"ephemeral",
"node",
"with",
"initial",
"values",
"."
] | train | https://github.com/DDTH/ddth-zookeeper/blob/0994eea8b25fa3d885f3da4579768b7d08c1c32b/src/main/java/com/github/ddth/zookeeper/ZooKeeperClient.java#L405-L407 |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.checkOutputFile | private void checkOutputFile(File file) throws ApkCreationException {
"""
Checks an output {@link File} object.
This checks the following:
- the file is not an existing directory.
- if the file exists, that it can be modified.
- if it doesn't exists, that a new file can be created.
@param file the File to che... | java | private void checkOutputFile(File file) throws ApkCreationException {
if (file.isDirectory()) {
throw new ApkCreationException("%s is a directory!", file);
}
if (file.exists()) { // will be a file in this case.
if (!file.canWrite()) {
throw new ApkCreatio... | [
"private",
"void",
"checkOutputFile",
"(",
"File",
"file",
")",
"throws",
"ApkCreationException",
"{",
"if",
"(",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"throw",
"new",
"ApkCreationException",
"(",
"\"%s is a directory!\"",
",",
"file",
")",
";",
"}",... | Checks an output {@link File} object.
This checks the following:
- the file is not an existing directory.
- if the file exists, that it can be modified.
- if it doesn't exists, that a new file can be created.
@param file the File to check
@throws ApkCreationException If the check fails | [
"Checks",
"an",
"output",
"{"
] | train | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L950-L969 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java | Convolution.outSize | @Deprecated
public static int outSize(int size, int k, int s, int p, int dilation, boolean coverAll) {
"""
The out size for a convolution
@param size
@param k
@param s
@param p
@param coverAll
@return
"""
k = effectiveKernelSize(k, dilation);
if (coverAll)
return (size ... | java | @Deprecated
public static int outSize(int size, int k, int s, int p, int dilation, boolean coverAll) {
k = effectiveKernelSize(k, dilation);
if (coverAll)
return (size + p * 2 - k + s - 1) / s + 1;
else
return (size + p * 2 - k) / s + 1;
} | [
"@",
"Deprecated",
"public",
"static",
"int",
"outSize",
"(",
"int",
"size",
",",
"int",
"k",
",",
"int",
"s",
",",
"int",
"p",
",",
"int",
"dilation",
",",
"boolean",
"coverAll",
")",
"{",
"k",
"=",
"effectiveKernelSize",
"(",
"k",
",",
"dilation",
... | The out size for a convolution
@param size
@param k
@param s
@param p
@param coverAll
@return | [
"The",
"out",
"size",
"for",
"a",
"convolution"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java#L322-L330 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java | VirtualMachineImagesInner.listOffers | public List<VirtualMachineImageResourceInner> listOffers(String location, String publisherName) {
"""
Gets a list of virtual machine image offers for the specified location and publisher.
@param location The name of a supported Azure region.
@param publisherName A valid image publisher.
@throws IllegalArgumen... | java | public List<VirtualMachineImageResourceInner> listOffers(String location, String publisherName) {
return listOffersWithServiceResponseAsync(location, publisherName).toBlocking().single().body();
} | [
"public",
"List",
"<",
"VirtualMachineImageResourceInner",
">",
"listOffers",
"(",
"String",
"location",
",",
"String",
"publisherName",
")",
"{",
"return",
"listOffersWithServiceResponseAsync",
"(",
"location",
",",
"publisherName",
")",
".",
"toBlocking",
"(",
")",
... | Gets a list of virtual machine image offers for the specified location and publisher.
@param location The name of a supported Azure region.
@param publisherName A valid image publisher.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by... | [
"Gets",
"a",
"list",
"of",
"virtual",
"machine",
"image",
"offers",
"for",
"the",
"specified",
"location",
"and",
"publisher",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java#L402-L404 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java | DynamoDBReflector.getCustomMarshalledValue | @SuppressWarnings( {
"""
Marshalls the custom value given into the proper return type.
""" "rawtypes", "unchecked" })
private <T> T getCustomMarshalledValue(T toReturn, Method getter, AttributeValue value) {
DynamoDBMarshalling annotation = getter.getAnnotation(DynamoDBMarshalling.class);
C... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
private <T> T getCustomMarshalledValue(T toReturn, Method getter, AttributeValue value) {
DynamoDBMarshalling annotation = getter.getAnnotation(DynamoDBMarshalling.class);
Class<? extends DynamoDBMarshaller<? extends Object>> marshallerClass = annotatio... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"private",
"<",
"T",
">",
"T",
"getCustomMarshalledValue",
"(",
"T",
"toReturn",
",",
"Method",
"getter",
",",
"AttributeValue",
"value",
")",
"{",
"DynamoDBMarshalling",
"annotat... | Marshalls the custom value given into the proper return type. | [
"Marshalls",
"the",
"custom",
"value",
"given",
"into",
"the",
"proper",
"return",
"type",
"."
] | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java#L566-L581 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/BaseRTMPHandler.java | BaseRTMPHandler.handlePendingCallResult | protected void handlePendingCallResult(RTMPConnection conn, Invoke invoke) {
"""
Handler for pending call result. Dispatches results to all pending call handlers.
@param conn
Connection
@param invoke
Pending call result event context
"""
final IServiceCall call = invoke.getCall();
final... | java | protected void handlePendingCallResult(RTMPConnection conn, Invoke invoke) {
final IServiceCall call = invoke.getCall();
final IPendingServiceCall pendingCall = conn.retrievePendingCall(invoke.getTransactionId());
if (pendingCall != null) {
// The client sent a response to a prev... | [
"protected",
"void",
"handlePendingCallResult",
"(",
"RTMPConnection",
"conn",
",",
"Invoke",
"invoke",
")",
"{",
"final",
"IServiceCall",
"call",
"=",
"invoke",
".",
"getCall",
"(",
")",
";",
"final",
"IPendingServiceCall",
"pendingCall",
"=",
"conn",
".",
"ret... | Handler for pending call result. Dispatches results to all pending call handlers.
@param conn
Connection
@param invoke
Pending call result event context | [
"Handler",
"for",
"pending",
"call",
"result",
".",
"Dispatches",
"results",
"to",
"all",
"pending",
"call",
"handlers",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/BaseRTMPHandler.java#L234-L257 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/collections/MapUtils.java | MapUtils.longestKeyLength | public static <V> int longestKeyLength(Map<String, V> map) {
"""
Returns the length of the longest key in a map, or 0 if the map is empty. Useful for printing
tables, etc. The map may not have any null keys.
"""
if (map.isEmpty()) {
return 0;
}
return Ordering.natural().max(
FluentI... | java | public static <V> int longestKeyLength(Map<String, V> map) {
if (map.isEmpty()) {
return 0;
}
return Ordering.natural().max(
FluentIterable.from(map.keySet())
.transform(StringUtils.lengthFunction()));
} | [
"public",
"static",
"<",
"V",
">",
"int",
"longestKeyLength",
"(",
"Map",
"<",
"String",
",",
"V",
">",
"map",
")",
"{",
"if",
"(",
"map",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"return",
"Ordering",
".",
"natural",
"(",
")"... | Returns the length of the longest key in a map, or 0 if the map is empty. Useful for printing
tables, etc. The map may not have any null keys. | [
"Returns",
"the",
"length",
"of",
"the",
"longest",
"key",
"in",
"a",
"map",
"or",
"0",
"if",
"the",
"map",
"is",
"empty",
".",
"Useful",
"for",
"printing",
"tables",
"etc",
".",
"The",
"map",
"may",
"not",
"have",
"any",
"null",
"keys",
"."
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/collections/MapUtils.java#L338-L346 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java | ApiOvhVrack.serviceName_dedicatedServer_dedicatedServer_mrtg_GET | public ArrayList<OvhMrtgTimestampValue> serviceName_dedicatedServer_dedicatedServer_mrtg_GET(String serviceName, String dedicatedServer, OvhMrtgPeriodEnum period, OvhMrtgTypeEnum type) throws IOException {
"""
Retrieve vrack traffic graph values
REST: GET /vrack/{serviceName}/dedicatedServer/{dedicatedServer}/m... | java | public ArrayList<OvhMrtgTimestampValue> serviceName_dedicatedServer_dedicatedServer_mrtg_GET(String serviceName, String dedicatedServer, OvhMrtgPeriodEnum period, OvhMrtgTypeEnum type) throws IOException {
String qPath = "/vrack/{serviceName}/dedicatedServer/{dedicatedServer}/mrtg";
StringBuilder sb = path(qPath, s... | [
"public",
"ArrayList",
"<",
"OvhMrtgTimestampValue",
">",
"serviceName_dedicatedServer_dedicatedServer_mrtg_GET",
"(",
"String",
"serviceName",
",",
"String",
"dedicatedServer",
",",
"OvhMrtgPeriodEnum",
"period",
",",
"OvhMrtgTypeEnum",
"type",
")",
"throws",
"IOException",
... | Retrieve vrack traffic graph values
REST: GET /vrack/{serviceName}/dedicatedServer/{dedicatedServer}/mrtg
@param period [required] mrtg period
@param type [required] mrtg type
@param serviceName [required] The internal name of your vrack
@param dedicatedServer [required] Dedicated Server
@deprecated | [
"Retrieve",
"vrack",
"traffic",
"graph",
"values"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java#L323-L330 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/DateUpdatedHandler.java | DateUpdatedHandler.syncClonedListener | public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) {
"""
Set this cloned listener to the same state at this listener.
@param field The field this new listener will be added to.
@param The new listener to sync to this.
@param Has the init method been called?
@return ... | java | public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled)
{
if (!bInitCalled)
((DateUpdatedHandler)listener).init(null, m_iMainFilesFieldSeq, m_bMoveCurrentTime);
return super.syncClonedListener(field, listener, true);
} | [
"public",
"boolean",
"syncClonedListener",
"(",
"BaseField",
"field",
",",
"FieldListener",
"listener",
",",
"boolean",
"bInitCalled",
")",
"{",
"if",
"(",
"!",
"bInitCalled",
")",
"(",
"(",
"DateUpdatedHandler",
")",
"listener",
")",
".",
"init",
"(",
"null",... | Set this cloned listener to the same state at this listener.
@param field The field this new listener will be added to.
@param The new listener to sync to this.
@param Has the init method been called?
@return True if I called init. | [
"Set",
"this",
"cloned",
"listener",
"to",
"the",
"same",
"state",
"at",
"this",
"listener",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/DateUpdatedHandler.java#L80-L85 |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java | ReflectionUtils.getSetter | public static Method getSetter(Class<?> clazz, String fieldName) {
"""
Retrieves the setter method of the given class for the specified field
name. The method traverses through all methods of all types that are in
the inheritance hierarchie of the given class and tries to find a setter
method with the return ty... | java | public static Method getSetter(Class<?> clazz, String fieldName) {
StringBuilder sb = new StringBuilder("set").append(
Character.toUpperCase(fieldName.charAt(0))).append(fieldName,
1, fieldName.length());
final String internedName = sb.toString().intern();
return ... | [
"public",
"static",
"Method",
"getSetter",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"\"set\"",
")",
".",
"append",
"(",
"Character",
".",
"toUpperCase",
"(",
"field... | Retrieves the setter method of the given class for the specified field
name. The method traverses through all methods of all types that are in
the inheritance hierarchie of the given class and tries to find a setter
method with the return type void and exactly one parameter. If that
method can not be found, null is ret... | [
"Retrieves",
"the",
"setter",
"method",
"of",
"the",
"given",
"class",
"for",
"the",
"specified",
"field",
"name",
".",
"The",
"method",
"traverses",
"through",
"all",
"methods",
"of",
"all",
"types",
"that",
"are",
"in",
"the",
"inheritance",
"hierarchie",
... | train | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L1072-L1098 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/SubMatrix.java | SubMatrix.changeSize | @Override
public void changeSize(int newRows, int newCols) {
"""
This method alters the size of a matrix, either adding or subtracting
rows from the internal structure of the matrix. Every resize call may
cause a new allocation internally, and should not be called for excessive
changing of a matrix. All add... | java | @Override
public void changeSize(int newRows, int newCols)
{
if(newRows <= 0)
throw new ArithmeticException("Matrix must have a positive number of rows");
if(newCols <= 0)
throw new ArithmeticException("Matrix must have a positive number of columns");
//Increase t... | [
"@",
"Override",
"public",
"void",
"changeSize",
"(",
"int",
"newRows",
",",
"int",
"newCols",
")",
"{",
"if",
"(",
"newRows",
"<=",
"0",
")",
"throw",
"new",
"ArithmeticException",
"(",
"\"Matrix must have a positive number of rows\"",
")",
";",
"if",
"(",
"n... | This method alters the size of a matrix, either adding or subtracting
rows from the internal structure of the matrix. Every resize call may
cause a new allocation internally, and should not be called for excessive
changing of a matrix. All added rows/ columns will have values of zero.
If a row / column is removed, it i... | [
"This",
"method",
"alters",
"the",
"size",
"of",
"a",
"matrix",
"either",
"adding",
"or",
"subtracting",
"rows",
"from",
"the",
"internal",
"structure",
"of",
"the",
"matrix",
".",
"Every",
"resize",
"call",
"may",
"cause",
"a",
"new",
"allocation",
"interna... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/SubMatrix.java#L168-L190 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java | ResourceBundlesHandlerImpl.executeGlobalPostProcessing | private void executeGlobalPostProcessing(boolean processBundleFlag, StopWatch stopWatch) {
"""
Execute the global post processing
@param processBundleFlag
the flag indicating if the bundle should be processed
@param stopWatch
the stopWatch
"""
// Launch global postprocessing
if (resourceTypePostproce... | java | private void executeGlobalPostProcessing(boolean processBundleFlag, StopWatch stopWatch) {
// Launch global postprocessing
if (resourceTypePostprocessor != null) {
if (stopWatch != null) {
stopWatch.start("Global postprocessing");
}
GlobalPostProcessingContext ctx = new GlobalPostProcessingContext(conf... | [
"private",
"void",
"executeGlobalPostProcessing",
"(",
"boolean",
"processBundleFlag",
",",
"StopWatch",
"stopWatch",
")",
"{",
"// Launch global postprocessing",
"if",
"(",
"resourceTypePostprocessor",
"!=",
"null",
")",
"{",
"if",
"(",
"stopWatch",
"!=",
"null",
")"... | Execute the global post processing
@param processBundleFlag
the flag indicating if the bundle should be processed
@param stopWatch
the stopWatch | [
"Execute",
"the",
"global",
"post",
"processing"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java#L991-L1005 |
voldemort/voldemort | src/java/voldemort/routing/StoreRoutingPlan.java | StoreRoutingPlan.checkKeyBelongsToNode | public boolean checkKeyBelongsToNode(byte[] key, int nodeId) {
"""
Determines if the key replicates to the given node
@param key
@param nodeId
@return true if the key belongs to the node as some replica
"""
List<Integer> nodePartitions = cluster.getNodeById(nodeId).getPartitionIds();
List<... | java | public boolean checkKeyBelongsToNode(byte[] key, int nodeId) {
List<Integer> nodePartitions = cluster.getNodeById(nodeId).getPartitionIds();
List<Integer> replicatingPartitions = getReplicatingPartitionList(key);
// remove all partitions from the list, except those that belong to the
// ... | [
"public",
"boolean",
"checkKeyBelongsToNode",
"(",
"byte",
"[",
"]",
"key",
",",
"int",
"nodeId",
")",
"{",
"List",
"<",
"Integer",
">",
"nodePartitions",
"=",
"cluster",
".",
"getNodeById",
"(",
"nodeId",
")",
".",
"getPartitionIds",
"(",
")",
";",
"List"... | Determines if the key replicates to the given node
@param key
@param nodeId
@return true if the key belongs to the node as some replica | [
"Determines",
"if",
"the",
"key",
"replicates",
"to",
"the",
"given",
"node"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/StoreRoutingPlan.java#L360-L367 |
tomgibara/bits | src/main/java/com/tomgibara/bits/Bits.java | Bits.readerFrom | public static BitReader readerFrom(FileChannel channel, ByteBuffer buffer) {
"""
A {@link BitReader} that sources bits from a <code>FileChannel</code>.
This stream operates with a byte buffer. This will generally improve
performance in applications that skip forwards or backwards across the
file.
Note that u... | java | public static BitReader readerFrom(FileChannel channel, ByteBuffer buffer) {
if (channel == null) throw new IllegalArgumentException("null channel");
if (buffer == null) throw new IllegalArgumentException("null buffer");
return new FileChannelBitReader(channel, buffer);
} | [
"public",
"static",
"BitReader",
"readerFrom",
"(",
"FileChannel",
"channel",
",",
"ByteBuffer",
"buffer",
")",
"{",
"if",
"(",
"channel",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null channel\"",
")",
";",
"if",
"(",
"buffer",
"=... | A {@link BitReader} that sources bits from a <code>FileChannel</code>.
This stream operates with a byte buffer. This will generally improve
performance in applications that skip forwards or backwards across the
file.
Note that using a direct ByteBuffer should generally yield better
performance.
@param channel
the fil... | [
"A",
"{",
"@link",
"BitReader",
"}",
"that",
"sources",
"bits",
"from",
"a",
"<code",
">",
"FileChannel<",
"/",
"code",
">",
".",
"This",
"stream",
"operates",
"with",
"a",
"byte",
"buffer",
".",
"This",
"will",
"generally",
"improve",
"performance",
"in",... | train | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/Bits.java#L782-L786 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withParcelableArrayList | public Postcard withParcelableArrayList(@Nullable String key, @Nullable ArrayList<? extends Parcelable> value) {
"""
Inserts a List of Parcelable values into the mapping of this Bundle,
replacing any existing value for the given key. Either key or value may
be null.
@param key a String, or null
@param val... | java | public Postcard withParcelableArrayList(@Nullable String key, @Nullable ArrayList<? extends Parcelable> value) {
mBundle.putParcelableArrayList(key, value);
return this;
} | [
"public",
"Postcard",
"withParcelableArrayList",
"(",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"ArrayList",
"<",
"?",
"extends",
"Parcelable",
">",
"value",
")",
"{",
"mBundle",
".",
"putParcelableArrayList",
"(",
"key",
",",
"value",
")",
";",
... | Inserts a List of Parcelable values into the mapping of this Bundle,
replacing any existing value for the given key. Either key or value may
be null.
@param key a String, or null
@param value an ArrayList of Parcelable objects, or null
@return current | [
"Inserts",
"a",
"List",
"of",
"Parcelable",
"values",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L402-L405 |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientMockBuilder.java | HttpClientMockBuilder.withParameter | public HttpClientMockBuilder withParameter(String name, String value) {
"""
Adds parameter condition. Parameter must be equal to provided value.
@param name parameter name
@param value expected parameter value
@return condition builder
"""
return withParameter(name, equalTo(value));
} | java | public HttpClientMockBuilder withParameter(String name, String value) {
return withParameter(name, equalTo(value));
} | [
"public",
"HttpClientMockBuilder",
"withParameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"return",
"withParameter",
"(",
"name",
",",
"equalTo",
"(",
"value",
")",
")",
";",
"}"
] | Adds parameter condition. Parameter must be equal to provided value.
@param name parameter name
@param value expected parameter value
@return condition builder | [
"Adds",
"parameter",
"condition",
".",
"Parameter",
"must",
"be",
"equal",
"to",
"provided",
"value",
"."
] | train | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientMockBuilder.java#L75-L77 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/util/LevenshteinDistance.java | LevenshteinDistance.getDistance | public static int getDistance (@Nullable final String sStr1, @Nullable final String sStr2) {
"""
Get the distance of the 2 strings, using the costs 1 for insertion,
deletion and substitution.
@param sStr1
First string.
@param sStr2
second string.
@return The Levenshtein distance.
"""
final int nLen... | java | public static int getDistance (@Nullable final String sStr1, @Nullable final String sStr2)
{
final int nLen1 = StringHelper.getLength (sStr1);
final int nLen2 = StringHelper.getLength (sStr2);
if (nLen1 == 0)
return nLen2;
if (nLen2 == 0)
return nLen1;
return _getDistance111 (sStr1.t... | [
"public",
"static",
"int",
"getDistance",
"(",
"@",
"Nullable",
"final",
"String",
"sStr1",
",",
"@",
"Nullable",
"final",
"String",
"sStr2",
")",
"{",
"final",
"int",
"nLen1",
"=",
"StringHelper",
".",
"getLength",
"(",
"sStr1",
")",
";",
"final",
"int",
... | Get the distance of the 2 strings, using the costs 1 for insertion,
deletion and substitution.
@param sStr1
First string.
@param sStr2
second string.
@return The Levenshtein distance. | [
"Get",
"the",
"distance",
"of",
"the",
"2",
"strings",
"using",
"the",
"costs",
"1",
"for",
"insertion",
"deletion",
"and",
"substitution",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/util/LevenshteinDistance.java#L211-L222 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F64.java | EquirectangularDistortBase_F64.declareVectors | protected void declareVectors( int width , int height ) {
"""
Declares storage for precomputed pointing vectors to output image
@param width output image width
@param height output image height
"""
this.outWidth = width;
if( vectors.length < width*height ) {
Point3D_F64[] tmp = new Point3D_F64[widt... | java | protected void declareVectors( int width , int height ) {
this.outWidth = width;
if( vectors.length < width*height ) {
Point3D_F64[] tmp = new Point3D_F64[width*height];
System.arraycopy(vectors,0,tmp,0,vectors.length);
for (int i = vectors.length; i < tmp.length; i++) {
tmp[i] = new Point3D_F64();
... | [
"protected",
"void",
"declareVectors",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"this",
".",
"outWidth",
"=",
"width",
";",
"if",
"(",
"vectors",
".",
"length",
"<",
"width",
"*",
"height",
")",
"{",
"Point3D_F64",
"[",
"]",
"tmp",
"=",
"... | Declares storage for precomputed pointing vectors to output image
@param width output image width
@param height output image height | [
"Declares",
"storage",
"for",
"precomputed",
"pointing",
"vectors",
"to",
"output",
"image"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F64.java#L87-L99 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetRollingUpgradesInner.java | VirtualMachineScaleSetRollingUpgradesInner.beginCancel | public OperationStatusResponseInner beginCancel(String resourceGroupName, String vmScaleSetName) {
"""
Cancels the current virtual machine scale set rolling upgrade.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException th... | java | public OperationStatusResponseInner beginCancel(String resourceGroupName, String vmScaleSetName) {
return beginCancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body();
} | [
"public",
"OperationStatusResponseInner",
"beginCancel",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"beginCancelWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
".",
"toBlocking",
"(",
")",
".",... | Cancels the current virtual machine scale set rolling upgrade.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throw... | [
"Cancels",
"the",
"current",
"virtual",
"machine",
"scale",
"set",
"rolling",
"upgrade",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetRollingUpgradesInner.java#L156-L158 |
GenesysPureEngage/authentication-client-java | src/main/java/com/genesys/authentication/AuthenticationApi.java | AuthenticationApi.signOutGet | public ModelApiResponse signOutGet(String authorization, Boolean global, String redirectUri) throws AuthenticationApiException {
"""
Sign-out a logged in user
Sign-out the current user and invalidate either the current token or all tokens associated with the user.
@param authorization The OAuth 2 bearer access... | java | public ModelApiResponse signOutGet(String authorization, Boolean global, String redirectUri) throws AuthenticationApiException {
try {
return authenticationApi.signOut1(authorization, global, redirectUri);
} catch (ApiException e) {
throw new AuthenticationApiException("Error sig... | [
"public",
"ModelApiResponse",
"signOutGet",
"(",
"String",
"authorization",
",",
"Boolean",
"global",
",",
"String",
"redirectUri",
")",
"throws",
"AuthenticationApiException",
"{",
"try",
"{",
"return",
"authenticationApi",
".",
"signOut1",
"(",
"authorization",
",",... | Sign-out a logged in user
Sign-out the current user and invalidate either the current token or all tokens associated with the user.
@param authorization The OAuth 2 bearer access token you received from [/auth/v3/oauth/token](/reference/authentication/Authentication/index.html#retrieveToken). For example: \"Autho... | [
"Sign",
"-",
"out",
"a",
"logged",
"in",
"user",
"Sign",
"-",
"out",
"the",
"current",
"user",
"and",
"invalidate",
"either",
"the",
"current",
"token",
"or",
"all",
"tokens",
"associated",
"with",
"the",
"user",
"."
] | train | https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/authentication/AuthenticationApi.java#L152-L158 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/MSTransactionFactory.java | MSTransactionFactory.createXAResource | public ExternalXAResource createXAResource() {
"""
This method is used to create an XAResource that can be enlisted as a
particpant in a two-phase XA compliant transaction.
@return An instance of XAResource
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "create... | java | public ExternalXAResource createXAResource()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createXAResource");
ExternalXAResource instance = new MSDelegatingXAResource(_ms, _persistence, getMaximumTransactionSize());
if (TraceComponent.isAnyTracingEnab... | [
"public",
"ExternalXAResource",
"createXAResource",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createXAResource\"",
")",
";",
"... | This method is used to create an XAResource that can be enlisted as a
particpant in a two-phase XA compliant transaction.
@return An instance of XAResource | [
"This",
"method",
"is",
"used",
"to",
"create",
"an",
"XAResource",
"that",
"can",
"be",
"enlisted",
"as",
"a",
"particpant",
"in",
"a",
"two",
"-",
"phase",
"XA",
"compliant",
"transaction",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/MSTransactionFactory.java#L103-L111 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java | DistributionTable.styleDistributionSetTable | public void styleDistributionSetTable(final Long installedDistItemId, final Long assignedDistTableItemId) {
"""
Added by Saumya Target pin listener.
@param installedDistItemId
Item ids of installed distribution set
@param assignedDistTableItemId
Item ids of assigned distribution set
"""
setCellSt... | java | public void styleDistributionSetTable(final Long installedDistItemId, final Long assignedDistTableItemId) {
setCellStyleGenerator((source, itemId, propertyId) -> getPinnedDistributionStyle(installedDistItemId,
assignedDistTableItemId, itemId));
} | [
"public",
"void",
"styleDistributionSetTable",
"(",
"final",
"Long",
"installedDistItemId",
",",
"final",
"Long",
"assignedDistTableItemId",
")",
"{",
"setCellStyleGenerator",
"(",
"(",
"source",
",",
"itemId",
",",
"propertyId",
")",
"->",
"getPinnedDistributionStyle",... | Added by Saumya Target pin listener.
@param installedDistItemId
Item ids of installed distribution set
@param assignedDistTableItemId
Item ids of assigned distribution set | [
"Added",
"by",
"Saumya",
"Target",
"pin",
"listener",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java#L712-L715 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/file/FileOperations.java | FileOperations._copyFileViaStreams | @Nonnull
private static ESuccess _copyFileViaStreams (@Nonnull final File aSrcFile, @Nonnull final File aDestFile) {
"""
Copy the content of the source file to the destination file using
{@link InputStream} and {@link OutputStream}.
@param aSrcFile
Source file. May not be <code>null</code>.
@param aDestFil... | java | @Nonnull
private static ESuccess _copyFileViaStreams (@Nonnull final File aSrcFile, @Nonnull final File aDestFile)
{
final InputStream aSrcIS = FileHelper.getInputStream (aSrcFile);
if (aSrcIS == null)
return ESuccess.FAILURE;
try
{
final OutputStream aDstOS = FileHelper.getOutputStream... | [
"@",
"Nonnull",
"private",
"static",
"ESuccess",
"_copyFileViaStreams",
"(",
"@",
"Nonnull",
"final",
"File",
"aSrcFile",
",",
"@",
"Nonnull",
"final",
"File",
"aDestFile",
")",
"{",
"final",
"InputStream",
"aSrcIS",
"=",
"FileHelper",
".",
"getInputStream",
"("... | Copy the content of the source file to the destination file using
{@link InputStream} and {@link OutputStream}.
@param aSrcFile
Source file. May not be <code>null</code>.
@param aDestFile
Destination file. May not be <code>null</code>.
@return {@link ESuccess} | [
"Copy",
"the",
"content",
"of",
"the",
"source",
"file",
"to",
"the",
"destination",
"file",
"using",
"{",
"@link",
"InputStream",
"}",
"and",
"{",
"@link",
"OutputStream",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/FileOperations.java#L578-L604 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/SelectIterator.java | SelectIterator.hasNext | @Override
public boolean hasNext() {
"""
Returns whether or not there are any remaining objects in the table. Can be called before next().
@throws IllegalStateException
If there was a problem getting more results via SQL.
"""
try {
return hasNextThrow();
} catch (SQLException e) {
last = null;
... | java | @Override
public boolean hasNext() {
try {
return hasNextThrow();
} catch (SQLException e) {
last = null;
closeQuietly();
// unfortunately, can't propagate back the SQLException
throw new IllegalStateException("Errors getting more results of " + dataClass, e);
}
} | [
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
")",
"{",
"try",
"{",
"return",
"hasNextThrow",
"(",
")",
";",
"}",
"catch",
"(",
"SQLException",
"e",
")",
"{",
"last",
"=",
"null",
";",
"closeQuietly",
"(",
")",
";",
"// unfortunately, can't propaga... | Returns whether or not there are any remaining objects in the table. Can be called before next().
@throws IllegalStateException
If there was a problem getting more results via SQL. | [
"Returns",
"whether",
"or",
"not",
"there",
"are",
"any",
"remaining",
"objects",
"in",
"the",
"table",
".",
"Can",
"be",
"called",
"before",
"next",
"()",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/SelectIterator.java#L98-L108 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/SessionUtil.java | SessionUtil.renewSession | static public LoginOutput renewSession(LoginInput loginInput)
throws SFException, SnowflakeSQLException {
"""
Renew a session.
<p>
Use cases:
- Session and Master tokens are provided. No Id token:
- succeed in getting a new Session token.
- fail and raise SnowflakeReauthenticationRequest because Master
tok... | java | static public LoginOutput renewSession(LoginInput loginInput)
throws SFException, SnowflakeSQLException
{
try
{
return tokenRequest(loginInput, TokenRequestType.RENEW);
}
catch (SnowflakeReauthenticationRequest ex)
{
if (Strings.isNullOrEmpty(loginInput.getIdToken()))
{
... | [
"static",
"public",
"LoginOutput",
"renewSession",
"(",
"LoginInput",
"loginInput",
")",
"throws",
"SFException",
",",
"SnowflakeSQLException",
"{",
"try",
"{",
"return",
"tokenRequest",
"(",
"loginInput",
",",
"TokenRequestType",
".",
"RENEW",
")",
";",
"}",
"cat... | Renew a session.
<p>
Use cases:
- Session and Master tokens are provided. No Id token:
- succeed in getting a new Session token.
- fail and raise SnowflakeReauthenticationRequest because Master
token expires. Since no id token exists, the exception is thrown
to the upstream.
- Session and Id tokens are provided. No Mas... | [
"Renew",
"a",
"session",
".",
"<p",
">",
"Use",
"cases",
":",
"-",
"Session",
"and",
"Master",
"tokens",
"are",
"provided",
".",
"No",
"Id",
"token",
":",
"-",
"succeed",
"in",
"getting",
"a",
"new",
"Session",
"token",
".",
"-",
"fail",
"and",
"rais... | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SessionUtil.java#L888-L903 |
protostuff/protostuff | protostuff-msgpack/src/main/java/io/protostuff/MsgpackIOUtil.java | MsgpackIOUtil.mergeFrom | public static <T> void mergeFrom(MessageUnpacker unpacker, T message, Schema<T> schema, boolean numeric)
throws IOException {
"""
Merges the {@code message} from the JsonParser using the given {@code schema}.
"""
MsgpackParser parser = new MsgpackParser(unpacker, numeric);
schema.me... | java | public static <T> void mergeFrom(MessageUnpacker unpacker, T message, Schema<T> schema, boolean numeric)
throws IOException
{
MsgpackParser parser = new MsgpackParser(unpacker, numeric);
schema.mergeFrom(new MsgpackInput(parser), message);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"mergeFrom",
"(",
"MessageUnpacker",
"unpacker",
",",
"T",
"message",
",",
"Schema",
"<",
"T",
">",
"schema",
",",
"boolean",
"numeric",
")",
"throws",
"IOException",
"{",
"MsgpackParser",
"parser",
"=",
"new",
"M... | Merges the {@code message} from the JsonParser using the given {@code schema}. | [
"Merges",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-msgpack/src/main/java/io/protostuff/MsgpackIOUtil.java#L181-L186 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.multTranA | public static void multTranA( DMatrix3x3 A , DMatrix3x3 B , DMatrix3x3 C , DMatrix3x3 output ) {
"""
Computes: D = A<sup>T</sup>*B*C
@param A (Input) 3x3 matrix
@param B (Input) 3x3 matrix
@param C (Input) 3x3 matrix
@param output (Output) 3x3 matrix. Can be same instance A or B.
"""
double t11 = A.a11... | java | public static void multTranA( DMatrix3x3 A , DMatrix3x3 B , DMatrix3x3 C , DMatrix3x3 output )
{
double t11 = A.a11*B.a11 + A.a21*B.a21 + A.a31*B.a31;
double t12 = A.a11*B.a12 + A.a21*B.a22 + A.a31*B.a32;
double t13 = A.a11*B.a13 + A.a21*B.a23 + A.a31*B.a33;
double t21 = A.a12*B.a11 + A.a22*B.a21 + A.a32*B.a3... | [
"public",
"static",
"void",
"multTranA",
"(",
"DMatrix3x3",
"A",
",",
"DMatrix3x3",
"B",
",",
"DMatrix3x3",
"C",
",",
"DMatrix3x3",
"output",
")",
"{",
"double",
"t11",
"=",
"A",
".",
"a11",
"*",
"B",
".",
"a11",
"+",
"A",
".",
"a21",
"*",
"B",
"."... | Computes: D = A<sup>T</sup>*B*C
@param A (Input) 3x3 matrix
@param B (Input) 3x3 matrix
@param C (Input) 3x3 matrix
@param output (Output) 3x3 matrix. Can be same instance A or B. | [
"Computes",
":",
"D",
"=",
"A<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"B",
"*",
"C"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L859-L884 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/CacheUtil.java | CacheUtil.downloadResource | public static File
downloadResource(String remoteLocation, ResourceType type)
throws ResourceDownloadError {
"""
Download the resource and hash the contents using {@link Hasher}.
@param remoteLocation {@link String}, the remote resource location
@param type {@link ResourceType},... | java | public static File
downloadResource(String remoteLocation, ResourceType type)
throws ResourceDownloadError {
String localResourcePath = getResourceFolderPath(type) + File.separator
+ encodeLocation(remoteLocation);
String localResourceLocation =
... | [
"public",
"static",
"File",
"downloadResource",
"(",
"String",
"remoteLocation",
",",
"ResourceType",
"type",
")",
"throws",
"ResourceDownloadError",
"{",
"String",
"localResourcePath",
"=",
"getResourceFolderPath",
"(",
"type",
")",
"+",
"File",
".",
"separator",
"... | Download the resource and hash the contents using {@link Hasher}.
@param remoteLocation {@link String}, the remote resource location
@param type {@link ResourceType}, the resource type
@return {@link File} the downloaded resource file, decompressed if the
file is in GZIP format
@throws ResourceDownloadError Thrown if ... | [
"Download",
"the",
"resource",
"and",
"hash",
"the",
"contents",
"using",
"{",
"@link",
"Hasher",
"}",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/CacheUtil.java#L139-L165 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/PullFileLoader.java | PullFileLoader.findAndLoadGlobalConfigInDirectory | private Config findAndLoadGlobalConfigInDirectory(Path path, Config fallback) throws IOException {
"""
Find at most one *.properties file in the input {@link Path} and load it using fallback as fallback.
@return The {@link Config} in path with sysProps as fallback.
@throws IOException
"""
FileStatus[] fi... | java | private Config findAndLoadGlobalConfigInDirectory(Path path, Config fallback) throws IOException {
FileStatus[] files = this.fs.listStatus(path, GLOBAL_PATH_FILTER);
if (files == null) {
log.warn("Could not list files at path " + path);
return ConfigFactory.empty();
}
if (files.length > 1) {... | [
"private",
"Config",
"findAndLoadGlobalConfigInDirectory",
"(",
"Path",
"path",
",",
"Config",
"fallback",
")",
"throws",
"IOException",
"{",
"FileStatus",
"[",
"]",
"files",
"=",
"this",
".",
"fs",
".",
"listStatus",
"(",
"path",
",",
"GLOBAL_PATH_FILTER",
")",... | Find at most one *.properties file in the input {@link Path} and load it using fallback as fallback.
@return The {@link Config} in path with sysProps as fallback.
@throws IOException | [
"Find",
"at",
"most",
"one",
"*",
".",
"properties",
"file",
"in",
"the",
"input",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PullFileLoader.java#L253-L272 |
jenkinsci/jenkins | core/src/main/java/jenkins/util/SystemProperties.java | SystemProperties.getLong | public static Long getLong(String name, Long def) {
"""
Determines the integer value of the system property with the
specified name, or a default value.
This behaves just like <code>Long.getLong(String,Long)</code>, except that it
also consults the <code>ServletContext</code>'s "init" parameters. If neither e... | java | public static Long getLong(String name, Long def) {
return getLong(name, def, Level.CONFIG);
} | [
"public",
"static",
"Long",
"getLong",
"(",
"String",
"name",
",",
"Long",
"def",
")",
"{",
"return",
"getLong",
"(",
"name",
",",
"def",
",",
"Level",
".",
"CONFIG",
")",
";",
"}"
] | Determines the integer value of the system property with the
specified name, or a default value.
This behaves just like <code>Long.getLong(String,Long)</code>, except that it
also consults the <code>ServletContext</code>'s "init" parameters. If neither exist,
return the default value.
@param name property name.
@pa... | [
"Determines",
"the",
"integer",
"value",
"of",
"the",
"system",
"property",
"with",
"the",
"specified",
"name",
"or",
"a",
"default",
"value",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/SystemProperties.java#L411-L413 |
ologolo/streamline-api | src/org/daisy/streamline/api/media/BaseFolder.java | BaseFolder.with | public static BaseFolder with(String first, String... more) {
"""
Creates a new base folder at the specified location.
@param first the path string or initial part of the path string
@param more additional strings to be joined to form the path string
@return the new instance
"""
return new BaseFolder(Path... | java | public static BaseFolder with(String first, String... more) {
return new BaseFolder(Paths.get(first, more));
} | [
"public",
"static",
"BaseFolder",
"with",
"(",
"String",
"first",
",",
"String",
"...",
"more",
")",
"{",
"return",
"new",
"BaseFolder",
"(",
"Paths",
".",
"get",
"(",
"first",
",",
"more",
")",
")",
";",
"}"
] | Creates a new base folder at the specified location.
@param first the path string or initial part of the path string
@param more additional strings to be joined to form the path string
@return the new instance | [
"Creates",
"a",
"new",
"base",
"folder",
"at",
"the",
"specified",
"location",
"."
] | train | https://github.com/ologolo/streamline-api/blob/4934b6da1de06e364ae90d6ea9b0929500da9cdb/src/org/daisy/streamline/api/media/BaseFolder.java#L33-L35 |
morfologik/morfologik-stemming | morfologik-stemming/src/main/java/morfologik/stemming/BufferUtils.java | BufferUtils.bytesToChars | public static CharBuffer bytesToChars(CharsetDecoder decoder, ByteBuffer bytes, CharBuffer chars) {
"""
Convert byte buffer's content into characters. The input buffer's bytes are not
consumed (mark is set and reset).
"""
assert decoder.malformedInputAction() == CodingErrorAction.REPORT;
chars = c... | java | public static CharBuffer bytesToChars(CharsetDecoder decoder, ByteBuffer bytes, CharBuffer chars) {
assert decoder.malformedInputAction() == CodingErrorAction.REPORT;
chars = clearAndEnsureCapacity(chars, (int) (bytes.remaining() * decoder.maxCharsPerByte()));
bytes.mark();
decoder.reset();
... | [
"public",
"static",
"CharBuffer",
"bytesToChars",
"(",
"CharsetDecoder",
"decoder",
",",
"ByteBuffer",
"bytes",
",",
"CharBuffer",
"chars",
")",
"{",
"assert",
"decoder",
".",
"malformedInputAction",
"(",
")",
"==",
"CodingErrorAction",
".",
"REPORT",
";",
"chars"... | Convert byte buffer's content into characters. The input buffer's bytes are not
consumed (mark is set and reset). | [
"Convert",
"byte",
"buffer",
"s",
"content",
"into",
"characters",
".",
"The",
"input",
"buffer",
"s",
"bytes",
"are",
"not",
"consumed",
"(",
"mark",
"is",
"set",
"and",
"reset",
")",
"."
] | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-stemming/src/main/java/morfologik/stemming/BufferUtils.java#L121-L147 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.toXY | public final Point2D toXY(final double LAT, final double LON) {
"""
Converts the given latitude and longitude to x,y values
@param LAT
@param LON
@return Point2D with the location of the given lat, lon
"""
final double LATITUDE = (LAT * (-1)) + 90.0;
final double LONGITUDE = LON + 180.0;
... | java | public final Point2D toXY(final double LAT, final double LON) {
final double LATITUDE = (LAT * (-1)) + 90.0;
final double LONGITUDE = LON + 180.0;
final double X = Math.round(LONGITUDE * (WORLD_MAP.getWidth() / 360));
final double Y = Math.round(LATITUDE * (WORLD_MAP.getHeight() / 180))... | [
"public",
"final",
"Point2D",
"toXY",
"(",
"final",
"double",
"LAT",
",",
"final",
"double",
"LON",
")",
"{",
"final",
"double",
"LATITUDE",
"=",
"(",
"LAT",
"*",
"(",
"-",
"1",
")",
")",
"+",
"90.0",
";",
"final",
"double",
"LONGITUDE",
"=",
"LON",
... | Converts the given latitude and longitude to x,y values
@param LAT
@param LON
@return Point2D with the location of the given lat, lon | [
"Converts",
"the",
"given",
"latitude",
"and",
"longitude",
"to",
"x",
"y",
"values"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L439-L447 |
ReactiveX/RxJavaFX | src/main/java/io/reactivex/rxjavafx/transformers/FxFlowableTransformers.java | FxFlowableTransformers.doOnErrorCount | public static <T> FlowableTransformer<T,T> doOnErrorCount(Consumer<Integer> onError) {
"""
Performs an action on onError with the provided emission count
@param onError
@param <T>
"""
return obs -> obs.lift(new FlowableEmissionCounter<>(new CountObserver(null,null,onError)));
} | java | public static <T> FlowableTransformer<T,T> doOnErrorCount(Consumer<Integer> onError) {
return obs -> obs.lift(new FlowableEmissionCounter<>(new CountObserver(null,null,onError)));
} | [
"public",
"static",
"<",
"T",
">",
"FlowableTransformer",
"<",
"T",
",",
"T",
">",
"doOnErrorCount",
"(",
"Consumer",
"<",
"Integer",
">",
"onError",
")",
"{",
"return",
"obs",
"->",
"obs",
".",
"lift",
"(",
"new",
"FlowableEmissionCounter",
"<>",
"(",
"... | Performs an action on onError with the provided emission count
@param onError
@param <T> | [
"Performs",
"an",
"action",
"on",
"onError",
"with",
"the",
"provided",
"emission",
"count"
] | train | https://github.com/ReactiveX/RxJavaFX/blob/8f44d4cc1caba9a8919f01cb1897aaea5514c7e5/src/main/java/io/reactivex/rxjavafx/transformers/FxFlowableTransformers.java#L132-L134 |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java | ConvertBitmap.boofToBitmap | public static void boofToBitmap( ImageBase input , Bitmap output , byte[] storage) {
"""
Converts many BoofCV image types into a Bitmap.
@see #declareStorage(android.graphics.Bitmap, byte[])
@param input Input BoofCV image.
@param output Output Bitmap image.
@param storage Byte array used for internal stor... | java | public static void boofToBitmap( ImageBase input , Bitmap output , byte[] storage) {
if( BOverrideConvertAndroid.invokeBoofToBitmap(ColorFormat.RGB,input,output,storage))
return;
if( input instanceof Planar ) {
planarToBitmap((Planar)input,output,storage);
} else if( input instanceof ImageGray ) {
grayT... | [
"public",
"static",
"void",
"boofToBitmap",
"(",
"ImageBase",
"input",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"if",
"(",
"BOverrideConvertAndroid",
".",
"invokeBoofToBitmap",
"(",
"ColorFormat",
".",
"RGB",
",",
"input",
",",
"o... | Converts many BoofCV image types into a Bitmap.
@see #declareStorage(android.graphics.Bitmap, byte[])
@param input Input BoofCV image.
@param output Output Bitmap image.
@param storage Byte array used for internal storage. If null it will be declared internally. | [
"Converts",
"many",
"BoofCV",
"image",
"types",
"into",
"a",
"Bitmap",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L203-L216 |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/FunctionConfigurationEnvironment.java | FunctionConfigurationEnvironment.withVariables | public FunctionConfigurationEnvironment withVariables(java.util.Map<String, String> variables) {
"""
Environment variables for the Lambda function's configuration.
@param variables
Environment variables for the Lambda function's configuration.
@return Returns a reference to this object so that method calls ca... | java | public FunctionConfigurationEnvironment withVariables(java.util.Map<String, String> variables) {
setVariables(variables);
return this;
} | [
"public",
"FunctionConfigurationEnvironment",
"withVariables",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"variables",
")",
"{",
"setVariables",
"(",
"variables",
")",
";",
"return",
"this",
";",
"}"
] | Environment variables for the Lambda function's configuration.
@param variables
Environment variables for the Lambda function's configuration.
@return Returns a reference to this object so that method calls can be chained together. | [
"Environment",
"variables",
"for",
"the",
"Lambda",
"function",
"s",
"configuration",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/FunctionConfigurationEnvironment.java#L247-L250 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/StructurizrDocumentationTemplate.java | StructurizrDocumentationTemplate.addDataSection | @Nonnull
public Section addDataSection(@Nullable SoftwareSystem softwareSystem, @Nonnull Format format, @Nonnull String content) {
"""
Adds a "Data" section relating to a {@link SoftwareSystem}.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param format ... | java | @Nonnull
public Section addDataSection(@Nullable SoftwareSystem softwareSystem, @Nonnull Format format, @Nonnull String content) {
return addSection(softwareSystem, "Data", format, content);
} | [
"@",
"Nonnull",
"public",
"Section",
"addDataSection",
"(",
"@",
"Nullable",
"SoftwareSystem",
"softwareSystem",
",",
"@",
"Nonnull",
"Format",
"format",
",",
"@",
"Nonnull",
"String",
"content",
")",
"{",
"return",
"addSection",
"(",
"softwareSystem",
",",
"\"D... | Adds a "Data" section relating to a {@link SoftwareSystem}.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param format the {@link Format} of the documentation content
@param content a String containing the documentation content
@return a... | [
"Adds",
"a",
"Data",
"section",
"relating",
"to",
"a",
"{",
"@link",
"SoftwareSystem",
"}",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/StructurizrDocumentationTemplate.java#L304-L307 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java | CommerceRegionPersistenceImpl.findByUUID_G | @Override
public CommerceRegion findByUUID_G(String uuid, long groupId)
throws NoSuchRegionException {
"""
Returns the commerce region where uuid = ? and groupId = ? or throws a {@link NoSuchRegionException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matc... | java | @Override
public CommerceRegion findByUUID_G(String uuid, long groupId)
throws NoSuchRegionException {
CommerceRegion commerceRegion = fetchByUUID_G(uuid, groupId);
if (commerceRegion == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
ms... | [
"@",
"Override",
"public",
"CommerceRegion",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchRegionException",
"{",
"CommerceRegion",
"commerceRegion",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"if",
"(",
"... | Returns the commerce region where uuid = ? and groupId = ? or throws a {@link NoSuchRegionException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce region
@throws NoSuchRegionException if a matching commerce region could not be found | [
"Returns",
"the",
"commerce",
"region",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchRegionException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java#L665-L691 |
cache2k/cache2k | cache2k-api/src/main/java/org/cache2k/expiry/Expiry.java | Expiry.earliestTime | public static long earliestTime(long loadTime, long candidate1, long candidate2) {
"""
Helper to calculate the next expiry out of two expiry times that
may be up next. Return the time value that is closest or equal to
the current time. Time values in the past are ignored. If all times
are in the past, returns {... | java | public static long earliestTime(long loadTime, long candidate1, long candidate2) {
if (candidate1 >= loadTime) {
if (candidate1 < candidate2 || candidate2 < loadTime) {
return candidate1;
}
}
if (candidate2 >= loadTime) {
return candidate2;
}
return ETERNAL;
} | [
"public",
"static",
"long",
"earliestTime",
"(",
"long",
"loadTime",
",",
"long",
"candidate1",
",",
"long",
"candidate2",
")",
"{",
"if",
"(",
"candidate1",
">=",
"loadTime",
")",
"{",
"if",
"(",
"candidate1",
"<",
"candidate2",
"||",
"candidate2",
"<",
"... | Helper to calculate the next expiry out of two expiry times that
may be up next. Return the time value that is closest or equal to
the current time. Time values in the past are ignored. If all times
are in the past, returns {@link #ETERNAL}.
@param loadTime the current time in millis since epoch
@param candidate1 cand... | [
"Helper",
"to",
"calculate",
"the",
"next",
"expiry",
"out",
"of",
"two",
"expiry",
"times",
"that",
"may",
"be",
"up",
"next",
".",
"Return",
"the",
"time",
"value",
"that",
"is",
"closest",
"or",
"equal",
"to",
"the",
"current",
"time",
".",
"Time",
... | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/expiry/Expiry.java#L62-L72 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.addBodyAttribute | public void addBodyAttribute(String name, String value) throws ErrorDataEncoderException {
"""
Add a simple attribute in the body as Name=Value
@param name
name of the parameter
@param value
the value of the parameter
@throws NullPointerException
for name
@throws ErrorDataEncoderException
if the encoding... | java | public void addBodyAttribute(String name, String value) throws ErrorDataEncoderException {
String svalue = value != null? value : StringUtil.EMPTY_STRING;
Attribute data = factory.createAttribute(request, checkNotNull(name, "name"), svalue);
addBodyHttpData(data);
} | [
"public",
"void",
"addBodyAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"ErrorDataEncoderException",
"{",
"String",
"svalue",
"=",
"value",
"!=",
"null",
"?",
"value",
":",
"StringUtil",
".",
"EMPTY_STRING",
";",
"Attribute",
"data",
... | Add a simple attribute in the body as Name=Value
@param name
name of the parameter
@param value
the value of the parameter
@throws NullPointerException
for name
@throws ErrorDataEncoderException
if the encoding is in error or if the finalize were already done | [
"Add",
"a",
"simple",
"attribute",
"in",
"the",
"body",
"as",
"Name",
"=",
"Value"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L338-L342 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDisplayLayoutPersistenceImpl.java | CPDisplayLayoutPersistenceImpl.fetchByUUID_G | @Override
public CPDisplayLayout fetchByUUID_G(String uuid, long groupId) {
"""
Returns the cp display layout where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching cp display l... | java | @Override
public CPDisplayLayout fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CPDisplayLayout",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the cp display layout where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching cp display layout, or <code>null</code> if a matching cp display layout could not be found | [
"Returns",
"the",
"cp",
"display",
"layout",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"ca... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDisplayLayoutPersistenceImpl.java#L700-L703 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.