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 |
|---|---|---|---|---|---|---|---|---|---|---|
lucee/Lucee | core/src/main/java/lucee/runtime/interpreter/VariableInterpreter.java | VariableInterpreter.removeVariable | public static Object removeVariable(PageContext pc, String var) throws PageException {
"""
removes a variable eith matching name from page context
@param pc
@param var
@return has removed or not
@throws PageException
"""
// print.ln("var:"+var);
StringList list = parse(pc, new ParserString(var), false)... | java | public static Object removeVariable(PageContext pc, String var) throws PageException {
// print.ln("var:"+var);
StringList list = parse(pc, new ParserString(var), false);
if (list == null) throw new InterpreterException("invalid variable declaration [" + var + "]");
if (list.size() == 1) {
return pc.undefined... | [
"public",
"static",
"Object",
"removeVariable",
"(",
"PageContext",
"pc",
",",
"String",
"var",
")",
"throws",
"PageException",
"{",
"// print.ln(\"var:\"+var);",
"StringList",
"list",
"=",
"parse",
"(",
"pc",
",",
"new",
"ParserString",
"(",
"var",
")",
",",
... | removes a variable eith matching name from page context
@param pc
@param var
@return has removed or not
@throws PageException | [
"removes",
"a",
"variable",
"eith",
"matching",
"name",
"from",
"page",
"context"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/interpreter/VariableInterpreter.java#L394-L418 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/util/cache/ImageMemoryCache.java | ImageMemoryCache.removeFromCache | public static void removeFromCache(String imageUri, ImageMemoryCache memoryCache) {
"""
Removes from memory cache all sizes of a given image URI.<br />
"""
List<String> keysToRemove = new ArrayList<String>();
for (String key : memoryCache.getKeySet()) {
if (key.startsWith(imageUri)) {
keysToRemove.a... | java | public static void removeFromCache(String imageUri, ImageMemoryCache memoryCache) {
List<String> keysToRemove = new ArrayList<String>();
for (String key : memoryCache.getKeySet()) {
if (key.startsWith(imageUri)) {
keysToRemove.add(key);
}
}
for (String keyToRemove : keysToRemove) {
memoryCache.remo... | [
"public",
"static",
"void",
"removeFromCache",
"(",
"String",
"imageUri",
",",
"ImageMemoryCache",
"memoryCache",
")",
"{",
"List",
"<",
"String",
">",
"keysToRemove",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"key",
... | Removes from memory cache all sizes of a given image URI.<br /> | [
"Removes",
"from",
"memory",
"cache",
"all",
"sizes",
"of",
"a",
"given",
"image",
"URI",
".",
"<br",
"/",
">"
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/cache/ImageMemoryCache.java#L170-L180 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchManager.java | CmsSearchManager.getIndexSolr | public static final CmsSolrIndex getIndexSolr(CmsObject cms, Map<String, String[]> params) {
"""
Returns the Solr index configured with the parameters name.
The parameters must contain a key/value pair with an existing
Solr index, otherwise <code>null</code> is returned.<p>
@param cms the current context
@pa... | java | public static final CmsSolrIndex getIndexSolr(CmsObject cms, Map<String, String[]> params) {
String indexName = null;
CmsSolrIndex index = null;
// try to get the index name from the parameters: 'core' or 'index'
if (params != null) {
indexName = params.get(OpenCmsSolrHandle... | [
"public",
"static",
"final",
"CmsSolrIndex",
"getIndexSolr",
"(",
"CmsObject",
"cms",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"params",
")",
"{",
"String",
"indexName",
"=",
"null",
";",
"CmsSolrIndex",
"index",
"=",
"null",
";",
"// try t... | Returns the Solr index configured with the parameters name.
The parameters must contain a key/value pair with an existing
Solr index, otherwise <code>null</code> is returned.<p>
@param cms the current context
@param params the parameter map
@return the best matching Solr index | [
"Returns",
"the",
"Solr",
"index",
"configured",
"with",
"the",
"parameters",
"name",
".",
"The",
"parameters",
"must",
"contain",
"a",
"key",
"/",
"value",
"pair",
"with",
"an",
"existing",
"Solr",
"index",
"otherwise",
"<code",
">",
"null<",
"/",
"code",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchManager.java#L802-L830 |
bwkimmel/jdcp | jdcp-worker/src/main/java/ca/eandb/jdcp/worker/CachingJobServiceClassLoaderStrategy.java | CachingJobServiceClassLoaderStrategy.beginLookup | private synchronized boolean beginLookup(Map<String, String> pending, String name) {
"""
Ensures that only one thread is calling the service to obtain the class
digest or definition for a particular class name.
@param pending The <code>Map</code> in which to store pending lookups.
@param name The name of the cl... | java | private synchronized boolean beginLookup(Map<String, String> pending, String name) {
String canonical = pending.get(name);
if (canonical != null) {
do {
try {
canonical.wait();
} catch (InterruptedException e) {}
} while (pending.containsKey(name));
}
return (canoni... | [
"private",
"synchronized",
"boolean",
"beginLookup",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"pending",
",",
"String",
"name",
")",
"{",
"String",
"canonical",
"=",
"pending",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"canonical",
"!=",
"null"... | Ensures that only one thread is calling the service to obtain the class
digest or definition for a particular class name.
@param pending The <code>Map</code> in which to store pending lookups.
@param name The name of the class to be looked up.
@return A value indicating whether the current thread is designated to
perfo... | [
"Ensures",
"that",
"only",
"one",
"thread",
"is",
"calling",
"the",
"service",
"to",
"obtain",
"the",
"class",
"digest",
"or",
"definition",
"for",
"a",
"particular",
"class",
"name",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker/src/main/java/ca/eandb/jdcp/worker/CachingJobServiceClassLoaderStrategy.java#L127-L137 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateUtils.java | DateUtils.parseDateWithLeniency | @GwtIncompatible("incompatible method")
private static Date parseDateWithLeniency(
final String str, final Locale locale, final String[] parsePatterns, final boolean lenient) throws ParseException {
"""
<p>Parses a string representing a date by trying a variety of different parsers.</p>
<p>The p... | java | @GwtIncompatible("incompatible method")
private static Date parseDateWithLeniency(
final String str, final Locale locale, final String[] parsePatterns, final boolean lenient) throws ParseException {
if (str == null || parsePatterns == null) {
throw new IllegalArgumentException("Date ... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"private",
"static",
"Date",
"parseDateWithLeniency",
"(",
"final",
"String",
"str",
",",
"final",
"Locale",
"locale",
",",
"final",
"String",
"[",
"]",
"parsePatterns",
",",
"final",
"boolean",
"lenient... | <p>Parses a string representing a date by trying a variety of different parsers.</p>
<p>The parse will try each parse pattern in turn.
A parse is only deemed successful if it parses the whole of the input string.
If no parse patterns match, a ParseException is thrown.</p>
@param str the date to parse, not null
@para... | [
"<p",
">",
"Parses",
"a",
"string",
"representing",
"a",
"date",
"by",
"trying",
"a",
"variety",
"of",
"different",
"parsers",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L370-L396 |
yan74/afplib | org.afplib/src/main/java/org/afplib/base/util/BaseValidator.java | BaseValidator.validateModcaString8_MinLength | public boolean validateModcaString8_MinLength(String modcaString8, DiagnosticChain diagnostics, Map<Object, Object> context) {
"""
Validates the MinLength constraint of '<em>Modca String8</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated
"""
int length = modcaString8.length();
boolean resu... | java | public boolean validateModcaString8_MinLength(String modcaString8, DiagnosticChain diagnostics, Map<Object, Object> context) {
int length = modcaString8.length();
boolean result = length >= 8;
if (!result && diagnostics != null)
reportMinLengthViolation(BasePackage.Literals.MODCA_STRING8, modcaString8, length,... | [
"public",
"boolean",
"validateModcaString8_MinLength",
"(",
"String",
"modcaString8",
",",
"DiagnosticChain",
"diagnostics",
",",
"Map",
"<",
"Object",
",",
"Object",
">",
"context",
")",
"{",
"int",
"length",
"=",
"modcaString8",
".",
"length",
"(",
")",
";",
... | Validates the MinLength constraint of '<em>Modca String8</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"Validates",
"the",
"MinLength",
"constraint",
"of",
"<em",
">",
"Modca",
"String8<",
"/",
"em",
">",
".",
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | train | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/base/util/BaseValidator.java#L225-L231 |
OpenLiberty/open-liberty | dev/com.ibm.ws.concurrent.mp.1.0/src/com/ibm/ws/concurrent/mp/ManagedCompletableFuture.java | ManagedCompletableFuture.runAsync | @Trivial // traced by caller
public static CompletableFuture<Void> runAsync(Runnable action, Executor executor) {
"""
Alternative to CompletableFuture.runAsync(action, executor) with an implementation that switches the
default asynchronous execution facility to be the specified managed executor.
@param act... | java | @Trivial // traced by caller
public static CompletableFuture<Void> runAsync(Runnable action, Executor executor) {
// Reject ManagedTask so that we have the flexibility to decide later how to handle ManagedTaskListener and execution properties
if (action instanceof ManagedTask)
throw new ... | [
"@",
"Trivial",
"// traced by caller",
"public",
"static",
"CompletableFuture",
"<",
"Void",
">",
"runAsync",
"(",
"Runnable",
"action",
",",
"Executor",
"executor",
")",
"{",
"// Reject ManagedTask so that we have the flexibility to decide later how to handle ManagedTaskListener... | Alternative to CompletableFuture.runAsync(action, executor) with an implementation that switches the
default asynchronous execution facility to be the specified managed executor.
@param action the action to run asynchronously.
@param executor the executor, typically a managed executor, that becomes the default asynchr... | [
"Alternative",
"to",
"CompletableFuture",
".",
"runAsync",
"(",
"action",
"executor",
")",
"with",
"an",
"implementation",
"that",
"switches",
"the",
"default",
"asynchronous",
"execution",
"facility",
"to",
"be",
"the",
"specified",
"managed",
"executor",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent.mp.1.0/src/com/ibm/ws/concurrent/mp/ManagedCompletableFuture.java#L451-L481 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java | Alignments.getProfileProfileAligner | static <S extends Sequence<C>, C extends Compound> ProfileProfileAligner<S, C> getProfileProfileAligner(
Future<ProfilePair<S, C>> profile1, Future<ProfilePair<S, C>> profile2, ProfileProfileAlignerType type,
GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) {
"""
Factory method which constructs a prof... | java | static <S extends Sequence<C>, C extends Compound> ProfileProfileAligner<S, C> getProfileProfileAligner(
Future<ProfilePair<S, C>> profile1, Future<ProfilePair<S, C>> profile2, ProfileProfileAlignerType type,
GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) {
switch (type) {
default:
case GLOBAL:
... | [
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"ProfileProfileAligner",
"<",
"S",
",",
"C",
">",
"getProfileProfileAligner",
"(",
"Future",
"<",
"ProfilePair",
"<",
"S",
",",
"C",
">",
">",
"profile1",
","... | Factory method which constructs a profile-profile aligner.
@param <S> each {@link Sequence} of an alignment profile is of type S
@param <C> each element of an {@link AlignedSequence} is a {@link Compound} of type C
@param profile1 the first {@link Profile} to align
@param profile2 the second {@link Profile} to align
@... | [
"Factory",
"method",
"which",
"constructs",
"a",
"profile",
"-",
"profile",
"aligner",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L440-L456 |
knowm/XChange | xchange-coingi/src/main/java/org/knowm/xchange/coingi/CoingiAdapters.java | CoingiAdapters.adaptAccountInfo | public static AccountInfo adaptAccountInfo(CoingiBalances coingiBalances, String userName) {
"""
Adapts a CoingiBalances to an AccountInfo
@param coingiBalances The Coingi balance
@param userName The user name
@return The account info
"""
List<Balance> balances = new ArrayList<>();
for (CoingiBala... | java | public static AccountInfo adaptAccountInfo(CoingiBalances coingiBalances, String userName) {
List<Balance> balances = new ArrayList<>();
for (CoingiBalance coingiBalance : coingiBalances.getList()) {
BigDecimal total =
coingiBalance
.getAvailable()
.add(coingiBalance.... | [
"public",
"static",
"AccountInfo",
"adaptAccountInfo",
"(",
"CoingiBalances",
"coingiBalances",
",",
"String",
"userName",
")",
"{",
"List",
"<",
"Balance",
">",
"balances",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"CoingiBalance",
"coingiBalanc... | Adapts a CoingiBalances to an AccountInfo
@param coingiBalances The Coingi balance
@param userName The user name
@return The account info | [
"Adapts",
"a",
"CoingiBalances",
"to",
"an",
"AccountInfo"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coingi/src/main/java/org/knowm/xchange/coingi/CoingiAdapters.java#L45-L69 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/LongTermRetentionBackupsInner.java | LongTermRetentionBackupsInner.listByLocationAsync | public Observable<Page<LongTermRetentionBackupInner>> listByLocationAsync(final String locationName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) {
"""
Lists the long term retention backups for a given location.
@param locationName The location of the database
@param... | java | public Observable<Page<LongTermRetentionBackupInner>> listByLocationAsync(final String locationName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) {
return listByLocationWithServiceResponseAsync(locationName, onlyLatestPerDatabase, databaseState)
.map(new F... | [
"public",
"Observable",
"<",
"Page",
"<",
"LongTermRetentionBackupInner",
">",
">",
"listByLocationAsync",
"(",
"final",
"String",
"locationName",
",",
"final",
"Boolean",
"onlyLatestPerDatabase",
",",
"final",
"LongTermRetentionDatabaseState",
"databaseState",
")",
"{",
... | Lists the long term retention backups for a given location.
@param locationName The location of the database
@param onlyLatestPerDatabase Whether or not to only get the latest backup for each database.
@param databaseState Whether to query against just live databases, just deleted databases, or all databases. Possible... | [
"Lists",
"the",
"long",
"term",
"retention",
"backups",
"for",
"a",
"given",
"location",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/LongTermRetentionBackupsInner.java#L811-L819 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/AbstractJcrNode.java | AbstractJcrNode.nodeDefinitionId | NodeDefinitionId nodeDefinitionId() throws ItemNotFoundException, ConstraintViolationException, RepositoryException {
"""
Get the property definition ID.
@return the cached property definition ID; never null
@throws ItemNotFoundException if the node that contains this property doesn't exist anymore
@throws Co... | java | NodeDefinitionId nodeDefinitionId() throws ItemNotFoundException, ConstraintViolationException, RepositoryException {
CachedDefinition defn = cachedDefn;
NodeTypes nodeTypes = session().nodeTypes();
if (defn == null || nodeTypes.getVersion() > defn.nodeTypesVersion) {
assert !this.is... | [
"NodeDefinitionId",
"nodeDefinitionId",
"(",
")",
"throws",
"ItemNotFoundException",
",",
"ConstraintViolationException",
",",
"RepositoryException",
"{",
"CachedDefinition",
"defn",
"=",
"cachedDefn",
";",
"NodeTypes",
"nodeTypes",
"=",
"session",
"(",
")",
".",
"nodeT... | Get the property definition ID.
@return the cached property definition ID; never null
@throws ItemNotFoundException if the node that contains this property doesn't exist anymore
@throws ConstraintViolationException if no valid property definition could be found
@throws RepositoryException if there is a problem with th... | [
"Get",
"the",
"property",
"definition",
"ID",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/AbstractJcrNode.java#L2857-L2884 |
jenkinsci/jenkins | core/src/main/java/hudson/Lookup.java | Lookup.setIfNull | public <T> T setIfNull(Class<T> type, T instance) {
"""
Overwrites the value only if the current value is null.
@return
If the value was null, return the {@code instance} value.
Otherwise return the current value, which is non-null.
"""
Object o = data.putIfAbsent(type, instance);
if (o!=n... | java | public <T> T setIfNull(Class<T> type, T instance) {
Object o = data.putIfAbsent(type, instance);
if (o!=null) return type.cast(o);
return instance;
} | [
"public",
"<",
"T",
">",
"T",
"setIfNull",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"instance",
")",
"{",
"Object",
"o",
"=",
"data",
".",
"putIfAbsent",
"(",
"type",
",",
"instance",
")",
";",
"if",
"(",
"o",
"!=",
"null",
")",
"return",
... | Overwrites the value only if the current value is null.
@return
If the value was null, return the {@code instance} value.
Otherwise return the current value, which is non-null. | [
"Overwrites",
"the",
"value",
"only",
"if",
"the",
"current",
"value",
"is",
"null",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Lookup.java#L52-L56 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsImageGalleryField.java | CmsImageGalleryField.setValue | @Override
public void setValue(String value, boolean fireEvent) {
"""
Sets the widget value.<p>
@param value the value to set
@param fireEvent if the change event should be fired
"""
value = parseValue(value);
m_textbox.setValue(value);
if (fireEvent) {
fireChange(t... | java | @Override
public void setValue(String value, boolean fireEvent) {
value = parseValue(value);
m_textbox.setValue(value);
if (fireEvent) {
fireChange(true);
}
} | [
"@",
"Override",
"public",
"void",
"setValue",
"(",
"String",
"value",
",",
"boolean",
"fireEvent",
")",
"{",
"value",
"=",
"parseValue",
"(",
"value",
")",
";",
"m_textbox",
".",
"setValue",
"(",
"value",
")",
";",
"if",
"(",
"fireEvent",
")",
"{",
"f... | Sets the widget value.<p>
@param value the value to set
@param fireEvent if the change event should be fired | [
"Sets",
"the",
"widget",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsImageGalleryField.java#L206-L214 |
google/closure-compiler | src/com/google/javascript/jscomp/Compiler.java | Compiler.getAstDotGraph | public String getAstDotGraph() throws IOException {
"""
Gets the DOT graph of the AST generated at the end of compilation.
"""
if (jsRoot != null) {
ControlFlowAnalysis cfa = new ControlFlowAnalysis(this, true, false);
cfa.process(null, jsRoot);
return DotFormatter.toDot(jsRoot, cfa.getCf... | java | public String getAstDotGraph() throws IOException {
if (jsRoot != null) {
ControlFlowAnalysis cfa = new ControlFlowAnalysis(this, true, false);
cfa.process(null, jsRoot);
return DotFormatter.toDot(jsRoot, cfa.getCfg());
} else {
return "";
}
} | [
"public",
"String",
"getAstDotGraph",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"jsRoot",
"!=",
"null",
")",
"{",
"ControlFlowAnalysis",
"cfa",
"=",
"new",
"ControlFlowAnalysis",
"(",
"this",
",",
"true",
",",
"false",
")",
";",
"cfa",
".",
"proce... | Gets the DOT graph of the AST generated at the end of compilation. | [
"Gets",
"the",
"DOT",
"graph",
"of",
"the",
"AST",
"generated",
"at",
"the",
"end",
"of",
"compilation",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L3005-L3013 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/shared/core/types/Color.java | Color.hueToRGB | private static double hueToRGB(final double m1, final double m2, double h) {
"""
Used by {@link #fromNormalizedHSL(double, double, double)}
@param m1
@param m2
@param h
@return
"""
// see http://www.w3.org/TR/css3-color/
//
// HOW TO RETURN hue.to.rgb(m1, m2, h):
// IF h<0... | java | private static double hueToRGB(final double m1, final double m2, double h)
{
// see http://www.w3.org/TR/css3-color/
//
// HOW TO RETURN hue.to.rgb(m1, m2, h):
// IF h<0: PUT h+1 IN h
// IF h>1: PUT h-1 IN h
// IF h*6<1: RETURN m1+(m2-m1)*h*6
// IF h*2<1: RETU... | [
"private",
"static",
"double",
"hueToRGB",
"(",
"final",
"double",
"m1",
",",
"final",
"double",
"m2",
",",
"double",
"h",
")",
"{",
"// see http://www.w3.org/TR/css3-color/",
"//",
"// HOW TO RETURN hue.to.rgb(m1, m2, h):",
"// IF h<0: PUT h+1 IN h",
"// IF h>1: PUT h-1 IN... | Used by {@link #fromNormalizedHSL(double, double, double)}
@param m1
@param m2
@param h
@return | [
"Used",
"by",
"{",
"@link",
"#fromNormalizedHSL",
"(",
"double",
"double",
"double",
")",
"}"
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/shared/core/types/Color.java#L750-L783 |
ykrasik/jaci | jaci-reflection-api/src/main/java/com/github/ykrasik/jaci/reflection/ReflectionUtils.java | ReflectionUtils.getAnnotation | public static <T extends Annotation> T getAnnotation(Class<?> clazz, Class<T> annotationClass) {
"""
Returns this element's annotation for the specified type if
such an annotation is <em>present</em>, else null.
@param <T> the type of the annotation to query for and return if present
@param clazz Class to get... | java | public static <T extends Annotation> T getAnnotation(Class<?> clazz, Class<T> annotationClass) {
assertReflectionAccessor();
return accessor.getAnnotation(clazz, annotationClass);
} | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"getAnnotation",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Class",
"<",
"T",
">",
"annotationClass",
")",
"{",
"assertReflectionAccessor",
"(",
")",
";",
"return",
"accessor",
".",
"getAnno... | Returns this element's annotation for the specified type if
such an annotation is <em>present</em>, else null.
@param <T> the type of the annotation to query for and return if present
@param clazz Class to get annotation from
@param annotationClass the Class object corresponding to the
annotation type
@return this ele... | [
"Returns",
"this",
"element",
"s",
"annotation",
"for",
"the",
"specified",
"type",
"if",
"such",
"an",
"annotation",
"is",
"<em",
">",
"present<",
"/",
"em",
">",
"else",
"null",
"."
] | train | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-reflection-api/src/main/java/com/github/ykrasik/jaci/reflection/ReflectionUtils.java#L161-L164 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/servlet/BaseMapServlet.java | BaseMapServlet.findReplacement | public static String findReplacement(final String variableName, final Date date) {
"""
Update a variable name with a date if the variable is detected as being a date.
@param variableName the variable name.
@param date the date to replace the value with if the variable is a date variable.
"""
if (va... | java | public static String findReplacement(final String variableName, final Date date) {
if (variableName.equalsIgnoreCase("date")) {
return cleanUpName(DateFormat.getDateInstance().format(date));
} else if (variableName.equalsIgnoreCase("datetime")) {
return cleanUpName(DateFormat.get... | [
"public",
"static",
"String",
"findReplacement",
"(",
"final",
"String",
"variableName",
",",
"final",
"Date",
"date",
")",
"{",
"if",
"(",
"variableName",
".",
"equalsIgnoreCase",
"(",
"\"date\"",
")",
")",
"{",
"return",
"cleanUpName",
"(",
"DateFormat",
"."... | Update a variable name with a date if the variable is detected as being a date.
@param variableName the variable name.
@param date the date to replace the value with if the variable is a date variable. | [
"Update",
"a",
"variable",
"name",
"with",
"a",
"date",
"if",
"the",
"variable",
"is",
"detected",
"as",
"being",
"a",
"date",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/servlet/BaseMapServlet.java#L38-L53 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Radar.java | Radar.setMyLocation | public void setMyLocation(final double LON, final double LAT) {
"""
Defines the position of the center of the radar by the
given coordinates as latitude and longitude
@param LON
@param LAT
"""
this.MY_LOCATION.setLocation(LON, LAT);
checkForBlips();
init(getInnerBounds().width, getIn... | java | public void setMyLocation(final double LON, final double LAT) {
this.MY_LOCATION.setLocation(LON, LAT);
checkForBlips();
init(getInnerBounds().width, getInnerBounds().height);
repaint();
} | [
"public",
"void",
"setMyLocation",
"(",
"final",
"double",
"LON",
",",
"final",
"double",
"LAT",
")",
"{",
"this",
".",
"MY_LOCATION",
".",
"setLocation",
"(",
"LON",
",",
"LAT",
")",
";",
"checkForBlips",
"(",
")",
";",
"init",
"(",
"getInnerBounds",
"(... | Defines the position of the center of the radar by the
given coordinates as latitude and longitude
@param LON
@param LAT | [
"Defines",
"the",
"position",
"of",
"the",
"center",
"of",
"the",
"radar",
"by",
"the",
"given",
"coordinates",
"as",
"latitude",
"and",
"longitude"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Radar.java#L273-L278 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java | CmsXmlContentPropertyHelper.addFileListPropertyValue | protected static void addFileListPropertyValue(CmsObject cms, Element valueElement, String propValue) {
"""
Adds the XML for a property value of a property of type 'vfslist' to the DOM.<p>
@param cms the current CMS context
@param valueElement the element to which the vfslist property value should be added
@p... | java | protected static void addFileListPropertyValue(CmsObject cms, Element valueElement, String propValue) {
// resource list value
Element filelistElem = valueElement.addElement(CmsXmlContentProperty.XmlNode.FileList.name());
for (String strId : CmsStringUtil.splitAsList(propValue, CmsXmlContentPro... | [
"protected",
"static",
"void",
"addFileListPropertyValue",
"(",
"CmsObject",
"cms",
",",
"Element",
"valueElement",
",",
"String",
"propValue",
")",
"{",
"// resource list value",
"Element",
"filelistElem",
"=",
"valueElement",
".",
"addElement",
"(",
"CmsXmlContentProp... | Adds the XML for a property value of a property of type 'vfslist' to the DOM.<p>
@param cms the current CMS context
@param valueElement the element to which the vfslist property value should be added
@param propValue the property value which should be saved | [
"Adds",
"the",
"XML",
"for",
"a",
"property",
"value",
"of",
"a",
"property",
"of",
"type",
"vfslist",
"to",
"the",
"DOM",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java#L772-L789 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/network/inat_stats.java | inat_stats.get | public static inat_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of inat_stats resource of given name .
"""
inat_stats obj = new inat_stats();
obj.set_name(name);
inat_stats response = (inat_stats) obj.stat_resource(service);
return response;
} | java | public static inat_stats get(nitro_service service, String name) throws Exception{
inat_stats obj = new inat_stats();
obj.set_name(name);
inat_stats response = (inat_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"inat_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"inat_stats",
"obj",
"=",
"new",
"inat_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"inat_stats",
"re... | Use this API to fetch statistics of inat_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"inat_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/network/inat_stats.java#L449-L454 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java | MemberSummaryBuilder.buildAnnotationTypeFieldsSummary | public void buildAnnotationTypeFieldsSummary(XMLNode node, Content memberSummaryTree) {
"""
Build the summary for fields.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added
"""
MemberSummaryWrite... | java | public void buildAnnotationTypeFieldsSummary(XMLNode node, Content memberSummaryTree) {
MemberSummaryWriter writer =
memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_FIELDS];
VisibleMemberMap visibleMemberMap =
visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_FIELD... | [
"public",
"void",
"buildAnnotationTypeFieldsSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"memberSummaryTree",
")",
"{",
"MemberSummaryWriter",
"writer",
"=",
"memberSummaryWriters",
"[",
"VisibleMemberMap",
".",
"ANNOTATION_TYPE_FIELDS",
"]",
";",
"VisibleMemberMap",
... | Build the summary for fields.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added | [
"Build",
"the",
"summary",
"for",
"fields",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java#L222-L228 |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/servlets/ListAllNodes.java | ListAllNodes.process | protected void process(HttpServletRequest request, HttpServletResponse response) throws IOException {
"""
This method gets all the nodes which are connected to the grid machine from the Registry and displays them in
html page.
@param request
{@link HttpServletRequest} that represents the servlet request
@par... | java | protected void process(HttpServletRequest request, HttpServletResponse response) throws IOException {
boolean doStatusQuery = request.getParameter(PING_NODES) != null;
String acceptHeader = request.getHeader("Accept");
if (acceptHeader != null && acceptHeader.equalsIgnoreCase("application/json")... | [
"protected",
"void",
"process",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"boolean",
"doStatusQuery",
"=",
"request",
".",
"getParameter",
"(",
"PING_NODES",
")",
"!=",
"null",
";",
"String",
"... | This method gets all the nodes which are connected to the grid machine from the Registry and displays them in
html page.
@param request
{@link HttpServletRequest} that represents the servlet request
@param response
{@link HttpServletResponse} that represents the servlet response
@throws IOException | [
"This",
"method",
"gets",
"all",
"the",
"nodes",
"which",
"are",
"connected",
"to",
"the",
"grid",
"machine",
"from",
"the",
"Registry",
"and",
"displays",
"them",
"in",
"html",
"page",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/servlets/ListAllNodes.java#L76-L86 |
facebookarchive/swift | swift-generator/src/main/java/com/facebook/swift/generator/swift2thrift/Swift2ThriftGenerator.java | Swift2ThriftGenerator.verifyTypes | private boolean verifyTypes() {
"""
and does a topological sort of thriftTypes in dependency order
"""
SuccessAndResult<ThriftType> output = topologicalSort(thriftTypes, new Predicate<ThriftType>()
{
@Override
public boolean apply(@Nullable ThriftType t)
{
... | java | private boolean verifyTypes()
{
SuccessAndResult<ThriftType> output = topologicalSort(thriftTypes, new Predicate<ThriftType>()
{
@Override
public boolean apply(@Nullable ThriftType t)
{
ThriftProtocolType proto = checkNotNull(t).getProtocolType();
... | [
"private",
"boolean",
"verifyTypes",
"(",
")",
"{",
"SuccessAndResult",
"<",
"ThriftType",
">",
"output",
"=",
"topologicalSort",
"(",
"thriftTypes",
",",
"new",
"Predicate",
"<",
"ThriftType",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"apply",... | and does a topological sort of thriftTypes in dependency order | [
"and",
"does",
"a",
"topological",
"sort",
"of",
"thriftTypes",
"in",
"dependency",
"order"
] | train | https://github.com/facebookarchive/swift/blob/3f1f098a50d6106f50cd6fe1c361dd373ede0197/swift-generator/src/main/java/com/facebook/swift/generator/swift2thrift/Swift2ThriftGenerator.java#L211-L237 |
rapid7/conqueso-client-java | src/main/java/com/rapid7/conqueso/client/ConquesoClient.java | ConquesoClient.getRoleInstancesWithMetadata | public ImmutableList<InstanceInfo> getRoleInstancesWithMetadata(String roleName, String...metadataQueryPairs) {
"""
Retrieve information about all online instances of a particular role matching the given metadata query from
the Conqueso Server.
The metadata query is expressed as key/value pairs. For example, cal... | java | public ImmutableList<InstanceInfo> getRoleInstancesWithMetadata(String roleName, String...metadataQueryPairs) {
checkArgument(metadataQueryPairs.length > 0, "No metadata query pairs specified");
checkArgument(metadataQueryPairs.length % 2 == 0, "Odd number of arguments passed as metadata query pairs");
... | [
"public",
"ImmutableList",
"<",
"InstanceInfo",
">",
"getRoleInstancesWithMetadata",
"(",
"String",
"roleName",
",",
"String",
"...",
"metadataQueryPairs",
")",
"{",
"checkArgument",
"(",
"metadataQueryPairs",
".",
"length",
">",
"0",
",",
"\"No metadata query pairs spe... | Retrieve information about all online instances of a particular role matching the given metadata query from
the Conqueso Server.
The metadata query is expressed as key/value pairs. For example, calling this method like this:
<p>
<code>
conquesoClient.getRoleInstancesWithMetadata("reporting-service", "availability-zone"... | [
"Retrieve",
"information",
"about",
"all",
"online",
"instances",
"of",
"a",
"particular",
"role",
"matching",
"the",
"given",
"metadata",
"query",
"from",
"the",
"Conqueso",
"Server",
".",
"The",
"metadata",
"query",
"is",
"expressed",
"as",
"key",
"/",
"valu... | train | https://github.com/rapid7/conqueso-client-java/blob/fa4a7a6dbf67e5afe6b4f68cbc97b1929af864e2/src/main/java/com/rapid7/conqueso/client/ConquesoClient.java#L534-L539 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/DictionaryUtil.java | DictionaryUtil.loadUnrankedDictionary | public static Map<String, Integer> loadUnrankedDictionary(final String fileName) {
"""
Read a resource file with a list of entries (sorted by frequency) and use
it to create a ranked dictionary.
<p>
The dictionary must contain only lower case values for the matching to work properly.
@param fileName the name... | java | public static Map<String, Integer> loadUnrankedDictionary(final String fileName)
{
Map<String, Integer> unranked = new HashMap<>();
Set<String> unranked_set = new HashSet<>();
String path = "/dictionaries/" + fileName;
try (InputStream is = DictionaryUtil.class.getResourceAsStream(p... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Integer",
">",
"loadUnrankedDictionary",
"(",
"final",
"String",
"fileName",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"unranked",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Set",
"<",
"String"... | Read a resource file with a list of entries (sorted by frequency) and use
it to create a ranked dictionary.
<p>
The dictionary must contain only lower case values for the matching to work properly.
@param fileName the name of the file
@return the ranked dictionary (a {@code HashMap} which associated a
rank to each ent... | [
"Read",
"a",
"resource",
"file",
"with",
"a",
"list",
"of",
"entries",
"(",
"sorted",
"by",
"frequency",
")",
"and",
"use",
"it",
"to",
"create",
"a",
"ranked",
"dictionary",
".",
"<p",
">",
"The",
"dictionary",
"must",
"contain",
"only",
"lower",
"case"... | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/DictionaryUtil.java#L57-L87 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModuleEntries.java | ModuleEntries.fetchAll | public CMAArray<CMAEntry> fetchAll(Map<String, String> query) {
"""
Fetch all entries matching the query from the configured space and environment.
<p>
This fetch uses the default parameter defined in {@link DefaultQueryParameter#FETCH}
@param query the criteria to filter on.
@return {@link CMAArray} result ... | java | public CMAArray<CMAEntry> fetchAll(Map<String, String> query) {
return fetchAll(spaceId, environmentId, query);
} | [
"public",
"CMAArray",
"<",
"CMAEntry",
">",
"fetchAll",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"query",
")",
"{",
"return",
"fetchAll",
"(",
"spaceId",
",",
"environmentId",
",",
"query",
")",
";",
"}"
] | Fetch all entries matching the query from the configured space and environment.
<p>
This fetch uses the default parameter defined in {@link DefaultQueryParameter#FETCH}
@param query the criteria to filter on.
@return {@link CMAArray} result instance
@throws IllegalArgumentException if configured space id is null.
@thr... | [
"Fetch",
"all",
"entries",
"matching",
"the",
"query",
"from",
"the",
"configured",
"space",
"and",
"environment",
".",
"<p",
">",
"This",
"fetch",
"uses",
"the",
"default",
"parameter",
"defined",
"in",
"{",
"@link",
"DefaultQueryParameter#FETCH",
"}"
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleEntries.java#L196-L198 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Collectors.java | Collectors.joining | @NotNull
public static Collector<CharSequence, ?, String> joining(
@NotNull CharSequence delimiter,
@NotNull CharSequence prefix,
@NotNull CharSequence suffix) {
"""
Returns a {@code Collector} that concatenates input elements into new string.
@param delimiter the delimi... | java | @NotNull
public static Collector<CharSequence, ?, String> joining(
@NotNull CharSequence delimiter,
@NotNull CharSequence prefix,
@NotNull CharSequence suffix) {
return joining(delimiter, prefix, suffix, prefix.toString() + suffix.toString());
} | [
"@",
"NotNull",
"public",
"static",
"Collector",
"<",
"CharSequence",
",",
"?",
",",
"String",
">",
"joining",
"(",
"@",
"NotNull",
"CharSequence",
"delimiter",
",",
"@",
"NotNull",
"CharSequence",
"prefix",
",",
"@",
"NotNull",
"CharSequence",
"suffix",
")",
... | Returns a {@code Collector} that concatenates input elements into new string.
@param delimiter the delimiter between each element
@param prefix the prefix of result
@param suffix the suffix of result
@return a {@code Collector} | [
"Returns",
"a",
"{",
"@code",
"Collector",
"}",
"that",
"concatenates",
"input",
"elements",
"into",
"new",
"string",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Collectors.java#L398-L404 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentValueSequence.java | CmsXmlContentValueSequence.addValue | public I_CmsXmlContentValue addValue(CmsObject cms, String xpath, int index) {
"""
Adds a value element of the type indicated by the given xpath
at the selected index to the XML content document.<p>
@param cms the current users OpenCms context
@param xpath the path that indicates the element type in the conte... | java | public I_CmsXmlContentValue addValue(CmsObject cms, String xpath, int index) {
I_CmsXmlContentValue newValue = m_content.addValue(cms, xpath, getLocale(), index);
// re-initialize the value list
m_values = m_content.getValues(getPath(), getLocale());
return newValue;
} | [
"public",
"I_CmsXmlContentValue",
"addValue",
"(",
"CmsObject",
"cms",
",",
"String",
"xpath",
",",
"int",
"index",
")",
"{",
"I_CmsXmlContentValue",
"newValue",
"=",
"m_content",
".",
"addValue",
"(",
"cms",
",",
"xpath",
",",
"getLocale",
"(",
")",
",",
"i... | Adds a value element of the type indicated by the given xpath
at the selected index to the XML content document.<p>
@param cms the current users OpenCms context
@param xpath the path that indicates the element type in the content definition
@param index the index where to add the new value element
@return the added X... | [
"Adds",
"a",
"value",
"element",
"of",
"the",
"type",
"indicated",
"by",
"the",
"given",
"xpath",
"at",
"the",
"selected",
"index",
"to",
"the",
"XML",
"content",
"document",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentValueSequence.java#L152-L160 |
wildfly/wildfly-build-tools | provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java | ZipFileSubsystemInputStreamSources.addSubsystemFileSourceFromModule | public boolean addSubsystemFileSourceFromModule(String subsystem, FeaturePack.Module module, ArtifactFileResolver artifactFileResolver) throws IOException {
"""
Adds the file source for the specified subsystem, from the specified module's artifacts.
@param subsystem
@param module
@param artifactFileResolver
@r... | java | public boolean addSubsystemFileSourceFromModule(String subsystem, FeaturePack.Module module, ArtifactFileResolver artifactFileResolver) throws IOException {
// the subsystem templates are included in module artifacts files
for (ModuleParseResult.ArtifactName artifactName : module.getModuleParseResult().... | [
"public",
"boolean",
"addSubsystemFileSourceFromModule",
"(",
"String",
"subsystem",
",",
"FeaturePack",
".",
"Module",
"module",
",",
"ArtifactFileResolver",
"artifactFileResolver",
")",
"throws",
"IOException",
"{",
"// the subsystem templates are included in module artifacts f... | Adds the file source for the specified subsystem, from the specified module's artifacts.
@param subsystem
@param module
@param artifactFileResolver
@return true if such subsystem file source was found and added; false otherwise
@throws IOException | [
"Adds",
"the",
"file",
"source",
"for",
"the",
"specified",
"subsystem",
"from",
"the",
"specified",
"module",
"s",
"artifacts",
"."
] | train | https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java#L138-L154 |
forge/core | resources/api/src/main/java/org/jboss/forge/addon/resource/util/ResourceUtil.java | ResourceUtil.getDigest | public static byte[] getDigest(Resource<?> resource) {
"""
Returns the {@link Byte} array message digest of {@link #getResourceInputStream()} using the default MD5
{@link MessageDigest}.
"""
try
{
return getDigest(resource, MessageDigest.getInstance("MD5"));
}
catch (NoSuchAlg... | java | public static byte[] getDigest(Resource<?> resource)
{
try
{
return getDigest(resource, MessageDigest.getInstance("MD5"));
}
catch (NoSuchAlgorithmException e)
{
throw new IllegalStateException("Error calculating digest for resource [" + resource.getFullyQualifiedName(... | [
"public",
"static",
"byte",
"[",
"]",
"getDigest",
"(",
"Resource",
"<",
"?",
">",
"resource",
")",
"{",
"try",
"{",
"return",
"getDigest",
"(",
"resource",
",",
"MessageDigest",
".",
"getInstance",
"(",
"\"MD5\"",
")",
")",
";",
"}",
"catch",
"(",
"No... | Returns the {@link Byte} array message digest of {@link #getResourceInputStream()} using the default MD5
{@link MessageDigest}. | [
"Returns",
"the",
"{"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/resources/api/src/main/java/org/jboss/forge/addon/resource/util/ResourceUtil.java#L38-L49 |
kite-sdk/kite | kite-morphlines/kite-morphlines-core/src/main/java/org/kitesdk/morphline/base/Validator.java | Validator.validateRange | public void validateRange(Config config, T value, Comparable<T> min, Comparable<T> max) {
"""
Validates that the given value is contained in the range [min, max]
"""
boolean isValid = min.compareTo(value) <= 0 && 0 <= max.compareTo(value);
if (!isValid) {
throw new MorphlineCompilationException(... | java | public void validateRange(Config config, T value, Comparable<T> min, Comparable<T> max) {
boolean isValid = min.compareTo(value) <= 0 && 0 <= max.compareTo(value);
if (!isValid) {
throw new MorphlineCompilationException(
String.format("Invalid choice: '%s' (choose from {%s..%s})",
... | [
"public",
"void",
"validateRange",
"(",
"Config",
"config",
",",
"T",
"value",
",",
"Comparable",
"<",
"T",
">",
"min",
",",
"Comparable",
"<",
"T",
">",
"max",
")",
"{",
"boolean",
"isValid",
"=",
"min",
".",
"compareTo",
"(",
"value",
")",
"<=",
"0... | Validates that the given value is contained in the range [min, max] | [
"Validates",
"that",
"the",
"given",
"value",
"is",
"contained",
"in",
"the",
"range",
"[",
"min",
"max",
"]"
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-morphlines/kite-morphlines-core/src/main/java/org/kitesdk/morphline/base/Validator.java#L34-L44 |
k3po/k3po | driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/tcp/TcpBootstrapFactorySpi.java | TcpBootstrapFactorySpi.newServerBootstrap | @Override
public synchronized ServerBootstrap newServerBootstrap() throws Exception {
"""
Returns a {@link ServerBootstrap} instance for the named transport.
"""
ServerSocketChannelFactory serverChannelFactory = this.serverChannelFactory;
if (serverChannelFactory == null) {
Ex... | java | @Override
public synchronized ServerBootstrap newServerBootstrap() throws Exception {
ServerSocketChannelFactory serverChannelFactory = this.serverChannelFactory;
if (serverChannelFactory == null) {
Executor bossExecutor = executorServiceFactory.newExecutorService("boss.server");
... | [
"@",
"Override",
"public",
"synchronized",
"ServerBootstrap",
"newServerBootstrap",
"(",
")",
"throws",
"Exception",
"{",
"ServerSocketChannelFactory",
"serverChannelFactory",
"=",
"this",
".",
"serverChannelFactory",
";",
"if",
"(",
"serverChannelFactory",
"==",
"null",
... | Returns a {@link ServerBootstrap} instance for the named transport. | [
"Returns",
"a",
"{"
] | train | https://github.com/k3po/k3po/blob/3ca4fd31ab4a397893aa640c62ada0e485c8bbd4/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/tcp/TcpBootstrapFactorySpi.java#L124-L148 |
jclawson/jackson-dataformat-hocon | src/main/java/com/jasonclawson/jackson/dataformat/hocon/HoconFactory.java | HoconFactory.createParser | @SuppressWarnings("resource")
@Override
public HoconTreeTraversingParser createParser(String content)
throws IOException, JsonParseException {
"""
/*
********************************************************
/* Overridden parser factory methods (for 2.1)
******************************************... | java | @SuppressWarnings("resource")
@Override
public HoconTreeTraversingParser createParser(String content)
throws IOException, JsonParseException
{
Reader r = new StringReader(content);
IOContext ctxt = _createContext(r, true); // true->own, can close
// [JACKSON-512]: allow wrapp... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"@",
"Override",
"public",
"HoconTreeTraversingParser",
"createParser",
"(",
"String",
"content",
")",
"throws",
"IOException",
",",
"JsonParseException",
"{",
"Reader",
"r",
"=",
"new",
"StringReader",
"(",
"conten... | /*
********************************************************
/* Overridden parser factory methods (for 2.1)
******************************************************** | [
"/",
"*",
"********************************************************",
"/",
"*",
"Overridden",
"parser",
"factory",
"methods",
"(",
"for",
"2",
".",
"1",
")",
"********************************************************"
] | train | https://github.com/jclawson/jackson-dataformat-hocon/blob/32149c89f5f9288ce6860f87e7bf55acea03cdbf/src/main/java/com/jasonclawson/jackson/dataformat/hocon/HoconFactory.java#L145-L157 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/sorting/SortFileParser.java | SortFileParser.getSortedResources | public List<String> getSortedResources() {
"""
Creates a list with the ordered resource names and returns it. If a
resource is not in the resources dir, it is ignored.
@return the list of ordered resource names
"""
List<String> resources = new ArrayList<>();
try (BufferedReader bf = new BufferedReader(... | java | public List<String> getSortedResources() {
List<String> resources = new ArrayList<>();
try (BufferedReader bf = new BufferedReader(reader)) {
String res;
while ((res = bf.readLine()) != null) {
String name = PathNormalizer.normalizePath(res.trim());
for (String available : availableResources) {
... | [
"public",
"List",
"<",
"String",
">",
"getSortedResources",
"(",
")",
"{",
"List",
"<",
"String",
">",
"resources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"(",
"BufferedReader",
"bf",
"=",
"new",
"BufferedReader",
"(",
"reader",
")",
")",
... | Creates a list with the ordered resource names and returns it. If a
resource is not in the resources dir, it is ignored.
@return the list of ordered resource names | [
"Creates",
"a",
"list",
"with",
"the",
"ordered",
"resource",
"names",
"and",
"returns",
"it",
".",
"If",
"a",
"resource",
"is",
"not",
"in",
"the",
"resources",
"dir",
"it",
"is",
"ignored",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/sorting/SortFileParser.java#L67-L89 |
killme2008/gecko | src/main/java/com/taobao/gecko/core/buffer/IoBufferHexDumper.java | IoBufferHexDumper.getHexdump | public static String getHexdump(IoBuffer in, int lengthLimit) {
"""
Dumps an {@link IoBuffer} to a hex formatted string.
@param in
the buffer to dump
@param lengthLimit
the limit at which hex dumping will stop
@return a hex formatted string representation of the <i>in</i>
{@link Iobuffer}.
"""
... | java | public static String getHexdump(IoBuffer in, int lengthLimit) {
if (lengthLimit == 0) {
throw new IllegalArgumentException("lengthLimit: " + lengthLimit + " (expected: 1+)");
}
boolean truncate = in.remaining() > lengthLimit;
int size;
if (truncate) {
siz... | [
"public",
"static",
"String",
"getHexdump",
"(",
"IoBuffer",
"in",
",",
"int",
"lengthLimit",
")",
"{",
"if",
"(",
"lengthLimit",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"lengthLimit: \"",
"+",
"lengthLimit",
"+",
"\" (expected: 1... | Dumps an {@link IoBuffer} to a hex formatted string.
@param in
the buffer to dump
@param lengthLimit
the limit at which hex dumping will stop
@return a hex formatted string representation of the <i>in</i>
{@link Iobuffer}. | [
"Dumps",
"an",
"{",
"@link",
"IoBuffer",
"}",
"to",
"a",
"hex",
"formatted",
"string",
"."
] | train | https://github.com/killme2008/gecko/blob/0873b690ffde51e40e6eadfcd5d599eb4e3b642d/src/main/java/com/taobao/gecko/core/buffer/IoBufferHexDumper.java#L87-L130 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/SparqlLogicConceptMatcher.java | SparqlLogicConceptMatcher.listMatchesAtMostOfType | @Override
public Table<URI, URI, MatchResult> listMatchesAtMostOfType(Set<URI> origins, MatchType maxType) {
"""
Obtain all the matching resources that have a MatchTyoe with the URIs of {@code origin} of the type provided (inclusive) or less.
@param origins URIs to match
@param maxType the maximum MatchTyp... | java | @Override
public Table<URI, URI, MatchResult> listMatchesAtMostOfType(Set<URI> origins, MatchType maxType) {
return obtainMatchResults(origins, this.getMatchTypesSupported().getLowest(), maxType);
} | [
"@",
"Override",
"public",
"Table",
"<",
"URI",
",",
"URI",
",",
"MatchResult",
">",
"listMatchesAtMostOfType",
"(",
"Set",
"<",
"URI",
">",
"origins",
",",
"MatchType",
"maxType",
")",
"{",
"return",
"obtainMatchResults",
"(",
"origins",
",",
"this",
".",
... | Obtain all the matching resources that have a MatchTyoe with the URIs of {@code origin} of the type provided (inclusive) or less.
@param origins URIs to match
@param maxType the maximum MatchType we want to obtain
@return a {@link com.google.common.collect.Table} with the result of the matching indexed by origin URI a... | [
"Obtain",
"all",
"the",
"matching",
"resources",
"that",
"have",
"a",
"MatchTyoe",
"with",
"the",
"URIs",
"of",
"{",
"@code",
"origin",
"}",
"of",
"the",
"type",
"provided",
"(",
"inclusive",
")",
"or",
"less",
"."
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/SparqlLogicConceptMatcher.java#L316-L319 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/face/AipFace.java | AipFace.personVerify | public JSONObject personVerify(String image, String imageType, String idCardNumber, String name, HashMap<String, String> options) {
"""
身份验证接口
@param image - 图片信息(**总数据大小应小于10M**),图片上传方式根据image_type来判断
@param imageType - 图片类型 **BASE64**:图片的base64值,base64编码后的图片数据,需urlencode,编码后的图片大小不超过2M;**URL**:图片的 URL地址( 可能由于... | java | public JSONObject personVerify(String image, String imageType, String idCardNumber, String name, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("image", image);
request.addBody("image_type", imageType);
... | [
"public",
"JSONObject",
"personVerify",
"(",
"String",
"image",
",",
"String",
"imageType",
",",
"String",
"idCardNumber",
",",
"String",
"name",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"Ai... | 身份验证接口
@param image - 图片信息(**总数据大小应小于10M**),图片上传方式根据image_type来判断
@param imageType - 图片类型 **BASE64**:图片的base64值,base64编码后的图片数据,需urlencode,编码后的图片大小不超过2M;**URL**:图片的 URL地址( 可能由于网络等原因导致下载图片时间过长)**;FACE_TOKEN**: 人脸图片的唯一标识,调用人脸检测接口时,会为每个人脸图片赋予一个唯一的FACE_TOKEN,同一张图片多次检测得到的FACE_TOKEN是同一个
@param idCardNumber - 身份证号(真实身份证号号码)
@... | [
"身份验证接口"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/face/AipFace.java#L392-L410 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/SqlClosureElf.java | SqlClosureElf.numberFromSql | public static Number numberFromSql(Connection connection, String sql, Object... args) throws SQLException {
"""
Get a single Number from a SQL query, useful for getting a COUNT(), SUM(), MIN/MAX(), etc.
from a SQL statement. If the SQL query is parameterized, the parameter values can
be passed in as arguments f... | java | public static Number numberFromSql(Connection connection, String sql, Object... args) throws SQLException
{
return OrmReader.numberFromSql(connection, sql, args);
} | [
"public",
"static",
"Number",
"numberFromSql",
"(",
"Connection",
"connection",
",",
"String",
"sql",
",",
"Object",
"...",
"args",
")",
"throws",
"SQLException",
"{",
"return",
"OrmReader",
".",
"numberFromSql",
"(",
"connection",
",",
"sql",
",",
"args",
")"... | Get a single Number from a SQL query, useful for getting a COUNT(), SUM(), MIN/MAX(), etc.
from a SQL statement. If the SQL query is parameterized, the parameter values can
be passed in as arguments following the {@code sql} String parameter.
@param connection a SQL connection object.
@param sql a SQL statement strin... | [
"Get",
"a",
"single",
"Number",
"from",
"a",
"SQL",
"query",
"useful",
"for",
"getting",
"a",
"COUNT",
"()",
"SUM",
"()",
"MIN",
"/",
"MAX",
"()",
"etc",
".",
"from",
"a",
"SQL",
"statement",
".",
"If",
"the",
"SQL",
"query",
"is",
"parameterized",
"... | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/SqlClosureElf.java#L212-L215 |
GerdHolz/TOVAL | src/de/invation/code/toval/misc/CollectionUtils.java | CollectionUtils.containsNo | public static <T> boolean containsNo(Collection<T> baseList, Collection<T> valueList) {
"""
Checks if the given basic list contains any element of the given value
list.
@param <T>
Type of collection elements
@param baseList
List to check for occurrences
@param valueList
Values to search
@return <code>tru... | java | public static <T> boolean containsNo(Collection<T> baseList, Collection<T> valueList) {
for (T v : valueList) {
if (baseList.contains(v)) {
return false;
}
}
return true;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"containsNo",
"(",
"Collection",
"<",
"T",
">",
"baseList",
",",
"Collection",
"<",
"T",
">",
"valueList",
")",
"{",
"for",
"(",
"T",
"v",
":",
"valueList",
")",
"{",
"if",
"(",
"baseList",
".",
"contains... | Checks if the given basic list contains any element of the given value
list.
@param <T>
Type of collection elements
@param baseList
List to check for occurrences
@param valueList
Values to search
@return <code>true</code> if <code>baseList</code> contains any element
of <code>valueList</code>; <code>false</code> other... | [
"Checks",
"if",
"the",
"given",
"basic",
"list",
"contains",
"any",
"element",
"of",
"the",
"given",
"value",
"list",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/CollectionUtils.java#L45-L52 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/KernelBootstrap.java | KernelBootstrap.showVersion | public static void showVersion(BootstrapConfig bootProps) {
"""
Get the runtime build version based on the information in the manifest of the
kernel jar: this is not authoritative, as it won't include information about
applied iFixes, etc.
"""
BootstrapManifest bootManifest;
try {
... | java | public static void showVersion(BootstrapConfig bootProps) {
BootstrapManifest bootManifest;
try {
bootManifest = BootstrapManifest.readBootstrapManifest(Boolean.parseBoolean(bootProps.get(BootstrapConstants.LIBERTY_BOOT_PROPERTY)));
String kernelVersion = bootManifest.getBundleVe... | [
"public",
"static",
"void",
"showVersion",
"(",
"BootstrapConfig",
"bootProps",
")",
"{",
"BootstrapManifest",
"bootManifest",
";",
"try",
"{",
"bootManifest",
"=",
"BootstrapManifest",
".",
"readBootstrapManifest",
"(",
"Boolean",
".",
"parseBoolean",
"(",
"bootProps... | Get the runtime build version based on the information in the manifest of the
kernel jar: this is not authoritative, as it won't include information about
applied iFixes, etc. | [
"Get",
"the",
"runtime",
"build",
"version",
"based",
"on",
"the",
"information",
"in",
"the",
"manifest",
"of",
"the",
"kernel",
"jar",
":",
"this",
"is",
"not",
"authoritative",
"as",
"it",
"won",
"t",
"include",
"information",
"about",
"applied",
"iFixes"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/KernelBootstrap.java#L474-L485 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/StylesheetRoot.java | StylesheetRoot.initDefaultRule | private void initDefaultRule(ErrorListener errorListener) throws TransformerException {
"""
Create the default rule if needed.
@throws TransformerException
"""
// Then manufacture a default
m_defaultRule = new ElemTemplate();
m_defaultRule.setStylesheet(this);
XPath defMatch = new XPath("... | java | private void initDefaultRule(ErrorListener errorListener) throws TransformerException
{
// Then manufacture a default
m_defaultRule = new ElemTemplate();
m_defaultRule.setStylesheet(this);
XPath defMatch = new XPath("*", this, this, XPath.MATCH, errorListener);
m_defaultRule.setMatch(defMatch)... | [
"private",
"void",
"initDefaultRule",
"(",
"ErrorListener",
"errorListener",
")",
"throws",
"TransformerException",
"{",
"// Then manufacture a default",
"m_defaultRule",
"=",
"new",
"ElemTemplate",
"(",
")",
";",
"m_defaultRule",
".",
"setStylesheet",
"(",
"this",
")",... | Create the default rule if needed.
@throws TransformerException | [
"Create",
"the",
"default",
"rule",
"if",
"needed",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/StylesheetRoot.java#L1067-L1118 |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/time/StoppedClock.java | StoppedClock.plus | public final long plus(final long value, @Nonnull final TimeUnit timeUnit) {
"""
Add the specified amount of time to the current clock.
@param value The numeric value to add to the clock after converting
based on the provided {@code timeUnit}.
@param timeUnit The time unit that {@code value} is measured in.
... | java | public final long plus(final long value, @Nonnull final TimeUnit timeUnit) {
return this.millis.addAndGet(timeUnit.toMillis(value));
} | [
"public",
"final",
"long",
"plus",
"(",
"final",
"long",
"value",
",",
"@",
"Nonnull",
"final",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"this",
".",
"millis",
".",
"addAndGet",
"(",
"timeUnit",
".",
"toMillis",
"(",
"value",
")",
")",
";",
"}"
] | Add the specified amount of time to the current clock.
@param value The numeric value to add to the clock after converting
based on the provided {@code timeUnit}.
@param timeUnit The time unit that {@code value} is measured in.
@return The time after being adjusted by the provided offset. | [
"Add",
"the",
"specified",
"amount",
"of",
"time",
"to",
"the",
"current",
"clock",
"."
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/time/StoppedClock.java#L48-L50 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseInvokeExpression | private Expr parseInvokeExpression(EnclosingScope scope, int start, Identifier name, boolean terminated,
Tuple<? extends SyntacticItem> templateArguments) {
"""
Parse an invocation expression, which has the form:
<pre>
InvokeExpr::= Identifier '(' [ Expr (',' Expr)* ] ')'
</pre>
Observe that this when t... | java | private Expr parseInvokeExpression(EnclosingScope scope, int start, Identifier name, boolean terminated,
Tuple<? extends SyntacticItem> templateArguments) {
// First, parse the arguments to this invocation.
Tuple<Expr> args = parseInvocationArguments(scope);
// Second, determine what kind of invocation we have... | [
"private",
"Expr",
"parseInvokeExpression",
"(",
"EnclosingScope",
"scope",
",",
"int",
"start",
",",
"Identifier",
"name",
",",
"boolean",
"terminated",
",",
"Tuple",
"<",
"?",
"extends",
"SyntacticItem",
">",
"templateArguments",
")",
"{",
"// First, parse the arg... | Parse an invocation expression, which has the form:
<pre>
InvokeExpr::= Identifier '(' [ Expr (',' Expr)* ] ')'
</pre>
Observe that this when this function is called, we're assuming that the
identifier and opening brace has already been matched.
@param scope
The enclosing scope for this statement, which determines t... | [
"Parse",
"an",
"invocation",
"expression",
"which",
"has",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L2961-L2988 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/util/PropertyValueRecovered.java | PropertyValueRecovered.recoveredValue | public static <T> T recoveredValue(Class<T> type, String properties) throws ExecutionException {
"""
This method recovered the property.
@param properties the string which represents the properties to recovered.
@param type the type to recovered.
@return the properties.
@Throws ExecutionException if an... | java | public static <T> T recoveredValue(Class<T> type, String properties) throws ExecutionException {
return recoveredValueASArray(type, properties)[0];
} | [
"public",
"static",
"<",
"T",
">",
"T",
"recoveredValue",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"properties",
")",
"throws",
"ExecutionException",
"{",
"return",
"recoveredValueASArray",
"(",
"type",
",",
"properties",
")",
"[",
"0",
"]",
";"... | This method recovered the property.
@param properties the string which represents the properties to recovered.
@param type the type to recovered.
@return the properties.
@Throws ExecutionException if an error happens. | [
"This",
"method",
"recovered",
"the",
"property",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/util/PropertyValueRecovered.java#L91-L93 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_mailingList_mailingListAddress_member_contact_POST | public OvhTask organizationName_service_exchangeService_mailingList_mailingListAddress_member_contact_POST(String organizationName, String exchangeService, String mailingListAddress, Long memberAccountId, Long memberContactId) throws IOException {
"""
Add new mailing list member
REST: POST /email/exchange/{orga... | java | public OvhTask organizationName_service_exchangeService_mailingList_mailingListAddress_member_contact_POST(String organizationName, String exchangeService, String mailingListAddress, Long memberAccountId, Long memberContactId) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeSe... | [
"public",
"OvhTask",
"organizationName_service_exchangeService_mailingList_mailingListAddress_member_contact_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"mailingListAddress",
",",
"Long",
"memberAccountId",
",",
"Long",
"memberContactI... | Add new mailing list member
REST: POST /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/contact
@param memberAccountId [required] Member account id
@param memberContactId [required] Member contact id
@param organizationName [required] The internal name of your exchan... | [
"Add",
"new",
"mailing",
"list",
"member"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L1176-L1184 |
derari/cthul | matchers/src/main/java/org/cthul/matchers/proc/Raises.java | Raises.raises | @Factory
public static Matcher<Proc> raises(Class<? extends Throwable> clazz, String regex) {
"""
Does the proc raise a throwable that satisfies the condition?
@param clazz
@param regex
@return Proc-Matcher
"""
return raises(IsThrowable.throwable(clazz, regex));
} | java | @Factory
public static Matcher<Proc> raises(Class<? extends Throwable> clazz, String regex) {
return raises(IsThrowable.throwable(clazz, regex));
} | [
"@",
"Factory",
"public",
"static",
"Matcher",
"<",
"Proc",
">",
"raises",
"(",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"clazz",
",",
"String",
"regex",
")",
"{",
"return",
"raises",
"(",
"IsThrowable",
".",
"throwable",
"(",
"clazz",
",",
"regex... | Does the proc raise a throwable that satisfies the condition?
@param clazz
@param regex
@return Proc-Matcher | [
"Does",
"the",
"proc",
"raise",
"a",
"throwable",
"that",
"satisfies",
"the",
"condition?"
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/matchers/proc/Raises.java#L109-L112 |
vkostyukov/la4j | src/main/java/org/la4j/matrix/RowMajorSparseMatrix.java | RowMajorSparseMatrix.from1DArray | public static RowMajorSparseMatrix from1DArray(int rows, int columns, double[] array) {
"""
Creates a new {@link RowMajorSparseMatrix} from the given 1D {@code array} with
compressing (copying) the underlying array.
"""
return CRSMatrix.from1DArray(rows, columns, array);
} | java | public static RowMajorSparseMatrix from1DArray(int rows, int columns, double[] array) {
return CRSMatrix.from1DArray(rows, columns, array);
} | [
"public",
"static",
"RowMajorSparseMatrix",
"from1DArray",
"(",
"int",
"rows",
",",
"int",
"columns",
",",
"double",
"[",
"]",
"array",
")",
"{",
"return",
"CRSMatrix",
".",
"from1DArray",
"(",
"rows",
",",
"columns",
",",
"array",
")",
";",
"}"
] | Creates a new {@link RowMajorSparseMatrix} from the given 1D {@code array} with
compressing (copying) the underlying array. | [
"Creates",
"a",
"new",
"{"
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/matrix/RowMajorSparseMatrix.java#L101-L103 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java | SchemaBuilder.alterTable | @NonNull
public static AlterTableStart alterTable(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier tableName) {
"""
Starts an ALTER TABLE query with the given table name for the given keyspace name.
"""
return new DefaultAlterTable(keyspace, tableName);
} | java | @NonNull
public static AlterTableStart alterTable(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier tableName) {
return new DefaultAlterTable(keyspace, tableName);
} | [
"@",
"NonNull",
"public",
"static",
"AlterTableStart",
"alterTable",
"(",
"@",
"Nullable",
"CqlIdentifier",
"keyspace",
",",
"@",
"NonNull",
"CqlIdentifier",
"tableName",
")",
"{",
"return",
"new",
"DefaultAlterTable",
"(",
"keyspace",
",",
"tableName",
")",
";",
... | Starts an ALTER TABLE query with the given table name for the given keyspace name. | [
"Starts",
"an",
"ALTER",
"TABLE",
"query",
"with",
"the",
"given",
"table",
"name",
"for",
"the",
"given",
"keyspace",
"name",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L153-L157 |
xwiki/xwiki-rendering | xwiki-rendering-api/src/main/java/org/xwiki/rendering/block/AbstractBlock.java | AbstractBlock.indexOfBlock | private static int indexOfBlock(Block block, List<Block> blocks) {
"""
Get the position of the provided block in the provided list of blocks.
<p>
Can't use {@link List#indexOf(Object)} since it's using {@link Object#equals(Object)} internally which is not
what we want since two WordBlock with the same text or t... | java | private static int indexOfBlock(Block block, List<Block> blocks)
{
int position = 0;
for (Block child : blocks) {
if (child == block) {
return position;
}
++position;
}
return -1;
} | [
"private",
"static",
"int",
"indexOfBlock",
"(",
"Block",
"block",
",",
"List",
"<",
"Block",
">",
"blocks",
")",
"{",
"int",
"position",
"=",
"0",
";",
"for",
"(",
"Block",
"child",
":",
"blocks",
")",
"{",
"if",
"(",
"child",
"==",
"block",
")",
... | Get the position of the provided block in the provided list of blocks.
<p>
Can't use {@link List#indexOf(Object)} since it's using {@link Object#equals(Object)} internally which is not
what we want since two WordBlock with the same text or two spaces are equals for example but we want to be able
to target one specific ... | [
"Get",
"the",
"position",
"of",
"the",
"provided",
"block",
"in",
"the",
"provided",
"list",
"of",
"blocks",
".",
"<p",
">",
"Can",
"t",
"use",
"{",
"@link",
"List#indexOf",
"(",
"Object",
")",
"}",
"since",
"it",
"s",
"using",
"{",
"@link",
"Object#eq... | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-api/src/main/java/org/xwiki/rendering/block/AbstractBlock.java#L150-L162 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/endpoint/resolver/DynamicEndpointUriResolver.java | DynamicEndpointUriResolver.appendQueryParams | private String appendQueryParams(String uri, Map<String, Object> headers) {
"""
Appends one to many query param key value paris to request uri. Syntax must be: param1=value1,param2=value2.
Results in parameterized request uri such as http://localhost:8080/test?param1=value1¶m2=value2
@param uri
@param heade... | java | private String appendQueryParams(String uri, Map<String, Object> headers) {
if (!headers.containsKey(QUERY_PARAM_HEADER_NAME)) {
return uri;
}
String requestUri = uri;
StringBuilder queryParamBuilder = new StringBuilder();
String queryParams = headers.get(QUERY_PARAM... | [
"private",
"String",
"appendQueryParams",
"(",
"String",
"uri",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
")",
"{",
"if",
"(",
"!",
"headers",
".",
"containsKey",
"(",
"QUERY_PARAM_HEADER_NAME",
")",
")",
"{",
"return",
"uri",
";",
"}",
"... | Appends one to many query param key value paris to request uri. Syntax must be: param1=value1,param2=value2.
Results in parameterized request uri such as http://localhost:8080/test?param1=value1¶m2=value2
@param uri
@param headers
@return | [
"Appends",
"one",
"to",
"many",
"query",
"param",
"key",
"value",
"paris",
"to",
"request",
"uri",
".",
"Syntax",
"must",
"be",
":",
"param1",
"=",
"value1",
"param2",
"=",
"value2",
".",
"Results",
"in",
"parameterized",
"request",
"uri",
"such",
"as",
... | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/endpoint/resolver/DynamicEndpointUriResolver.java#L102-L125 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.groupingTo | public <K, C extends Collection<T>> Map<K, C> groupingTo(Function<? super T, ? extends K> classifier,
Supplier<C> collectionFactory) {
"""
Returns a {@code Map} whose keys are the values resulting from applying
the classification function to the input elements, and whose
corresponding values are the ... | java | public <K, C extends Collection<T>> Map<K, C> groupingTo(Function<? super T, ? extends K> classifier,
Supplier<C> collectionFactory) {
return groupingBy(classifier, Collectors.toCollection(collectionFactory));
} | [
"public",
"<",
"K",
",",
"C",
"extends",
"Collection",
"<",
"T",
">",
">",
"Map",
"<",
"K",
",",
"C",
">",
"groupingTo",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
"classifier",
",",
"Supplier",
"<",
"C",
">",
"collec... | Returns a {@code Map} whose keys are the values resulting from applying
the classification function to the input elements, and whose
corresponding values are the collections of the input elements which map
to the associated key under the classification function.
<p>
There are no guarantees on the type, mutability or s... | [
"Returns",
"a",
"{",
"@code",
"Map",
"}",
"whose",
"keys",
"are",
"the",
"values",
"resulting",
"from",
"applying",
"the",
"classification",
"function",
"to",
"the",
"input",
"elements",
"and",
"whose",
"corresponding",
"values",
"are",
"the",
"collections",
"... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L604-L607 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/utils/DisruptorRunable.java | DisruptorRunable.onEvent | @Override
public void onEvent(Object event, long sequence, boolean endOfBatch) throws Exception {
"""
This function need to be implements
@see com.lmax.disruptor.EventHandler#onEvent(java.lang.Object, long, boolean)
"""
if (event == null) {
return;
}
handleEvent(event... | java | @Override
public void onEvent(Object event, long sequence, boolean endOfBatch) throws Exception {
if (event == null) {
return;
}
handleEvent(event, endOfBatch);
} | [
"@",
"Override",
"public",
"void",
"onEvent",
"(",
"Object",
"event",
",",
"long",
"sequence",
",",
"boolean",
"endOfBatch",
")",
"throws",
"Exception",
"{",
"if",
"(",
"event",
"==",
"null",
")",
"{",
"return",
";",
"}",
"handleEvent",
"(",
"event",
","... | This function need to be implements
@see com.lmax.disruptor.EventHandler#onEvent(java.lang.Object, long, boolean) | [
"This",
"function",
"need",
"to",
"be",
"implements"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/DisruptorRunable.java#L52-L58 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/Symmetry454Chronology.java | Symmetry454Chronology.dateYearDay | @Override
public Symmetry454Date dateYearDay(Era era, int yearOfEra, int dayOfYear) {
"""
Obtains a local date in Symmetry454 calendar system from the
era, year-of-era and day-of-year fields.
@param era the Symmetry454 era, not null
@param yearOfEra the year-of-era
@param dayOfYear the day-of-year
@r... | java | @Override
public Symmetry454Date dateYearDay(Era era, int yearOfEra, int dayOfYear) {
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);
} | [
"@",
"Override",
"public",
"Symmetry454Date",
"dateYearDay",
"(",
"Era",
"era",
",",
"int",
"yearOfEra",
",",
"int",
"dayOfYear",
")",
"{",
"return",
"dateYearDay",
"(",
"prolepticYear",
"(",
"era",
",",
"yearOfEra",
")",
",",
"dayOfYear",
")",
";",
"}"
] | Obtains a local date in Symmetry454 calendar system from the
era, year-of-era and day-of-year fields.
@param era the Symmetry454 era, not null
@param yearOfEra the year-of-era
@param dayOfYear the day-of-year
@return the Symmetry454 local date, not null
@throws DateTimeException if unable to create the date
@throws... | [
"Obtains",
"a",
"local",
"date",
"in",
"Symmetry454",
"calendar",
"system",
"from",
"the",
"era",
"year",
"-",
"of",
"-",
"era",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
"."
] | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/Symmetry454Chronology.java#L280-L283 |
grpc/grpc-java | netty/src/main/java/io/grpc/netty/NettyServerBuilder.java | NettyServerBuilder.withChildOption | public <T> NettyServerBuilder withChildOption(ChannelOption<T> option, T value) {
"""
Specifies a channel option. As the underlying channel as well as network implementation may
ignore this value applications should consider it a hint.
@since 1.9.0
"""
this.channelOptions.put(option, value);
return... | java | public <T> NettyServerBuilder withChildOption(ChannelOption<T> option, T value) {
this.channelOptions.put(option, value);
return this;
} | [
"public",
"<",
"T",
">",
"NettyServerBuilder",
"withChildOption",
"(",
"ChannelOption",
"<",
"T",
">",
"option",
",",
"T",
"value",
")",
"{",
"this",
".",
"channelOptions",
".",
"put",
"(",
"option",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Specifies a channel option. As the underlying channel as well as network implementation may
ignore this value applications should consider it a hint.
@since 1.9.0 | [
"Specifies",
"a",
"channel",
"option",
".",
"As",
"the",
"underlying",
"channel",
"as",
"well",
"as",
"network",
"implementation",
"may",
"ignore",
"this",
"value",
"applications",
"should",
"consider",
"it",
"a",
"hint",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/netty/src/main/java/io/grpc/netty/NettyServerBuilder.java#L166-L169 |
OnyxDevTools/onyx-database-parent | onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/ApiClient.java | ApiClient.buildUrl | public String buildUrl(String path, List<Pair> queryParams) {
"""
Build full URL by concatenating base path, the given sub path and query parameters.
@param path The sub path
@param queryParams The query parameters
@return The full URL
"""
final StringBuilder url = new StringBuilder();
url... | java | public String buildUrl(String path, List<Pair> queryParams) {
final StringBuilder url = new StringBuilder();
url.append(basePath).append(path);
if (queryParams != null && !queryParams.isEmpty()) {
// support (constant) query string in `path`, e.g. "/posts?draft=1"
String... | [
"public",
"String",
"buildUrl",
"(",
"String",
"path",
",",
"List",
"<",
"Pair",
">",
"queryParams",
")",
"{",
"final",
"StringBuilder",
"url",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"url",
".",
"append",
"(",
"basePath",
")",
".",
"append",
"(",
... | Build full URL by concatenating base path, the given sub path and query parameters.
@param path The sub path
@param queryParams The query parameters
@return The full URL | [
"Build",
"full",
"URL",
"by",
"concatenating",
"base",
"path",
"the",
"given",
"sub",
"path",
"and",
"query",
"parameters",
"."
] | train | https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/ApiClient.java#L1165-L1187 |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/PurgeMonitor.java | PurgeMonitor.purgeDirectories | private void purgeDirectories(FileSystem fs, Path root) throws IOException {
"""
Traverse the parity destination directory, removing directories that
no longer existing in the source.
@throws IOException
"""
DirectoryTraversal traversal =
DirectoryTraversal.directoryRetriever(Arrays.asList(root),... | java | private void purgeDirectories(FileSystem fs, Path root) throws IOException {
DirectoryTraversal traversal =
DirectoryTraversal.directoryRetriever(Arrays.asList(root), fs,
directoryTraversalThreads, directoryTraversalShuffle);
String prefix = root.toUri().getPath();
FileStatus dir;
... | [
"private",
"void",
"purgeDirectories",
"(",
"FileSystem",
"fs",
",",
"Path",
"root",
")",
"throws",
"IOException",
"{",
"DirectoryTraversal",
"traversal",
"=",
"DirectoryTraversal",
".",
"directoryRetriever",
"(",
"Arrays",
".",
"asList",
"(",
"root",
")",
",",
... | Traverse the parity destination directory, removing directories that
no longer existing in the source.
@throws IOException | [
"Traverse",
"the",
"parity",
"destination",
"directory",
"removing",
"directories",
"that",
"no",
"longer",
"existing",
"in",
"the",
"source",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/PurgeMonitor.java#L101-L125 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/DeployKeysApi.java | DeployKeysApi.enableDeployKey | public DeployKey enableDeployKey(Object projectIdOrPath, Integer keyId) throws GitLabApiException {
"""
Enables a deploy key for a project so this can be used. Returns the enabled key when successful.
<pre><code>GitLab Endpoint: POST /projects/:id/deploy_keys/:key_id/enable</code></pre>
@param projectIdOrPat... | java | public DeployKey enableDeployKey(Object projectIdOrPath, Integer keyId) throws GitLabApiException {
if (keyId == null) {
throw new RuntimeException("keyId cannot be null");
}
Response response = post(Response.Status.CREATED, (Form)null,
"projects", getProjectIdOrPat... | [
"public",
"DeployKey",
"enableDeployKey",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"keyId",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"keyId",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"keyId cannot be null\"",
")",
";"... | Enables a deploy key for a project so this can be used. Returns the enabled key when successful.
<pre><code>GitLab Endpoint: POST /projects/:id/deploy_keys/:key_id/enable</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param keyId the ID of the deploy ... | [
"Enables",
"a",
"deploy",
"key",
"for",
"a",
"project",
"so",
"this",
"can",
"be",
"used",
".",
"Returns",
"the",
"enabled",
"key",
"when",
"successful",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/DeployKeysApi.java#L223-L232 |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/CloneCommand.java | CloneCommand.cloneContent | public static String cloneContent(String source, GitService service, String comment) throws Exception {
"""
Replaces the content contained within the Git repository branch pointed to by the {@link GitService} object with the source.
@param source The directory to commit the content from.
@param service The {@l... | java | public static String cloneContent(String source, GitService service, String comment) throws Exception {
String rev = GitService.moveContentToBranch(source, service, service.getBranchName(), comment);
service.push(false);
return rev;
} | [
"public",
"static",
"String",
"cloneContent",
"(",
"String",
"source",
",",
"GitService",
"service",
",",
"String",
"comment",
")",
"throws",
"Exception",
"{",
"String",
"rev",
"=",
"GitService",
".",
"moveContentToBranch",
"(",
"source",
",",
"service",
",",
... | Replaces the content contained within the Git repository branch pointed to by the {@link GitService} object with the source.
@param source The directory to commit the content from.
@param service The {@link GitService} pointing to the repository and branch to commit to.
@param comment The commit message.
@return The n... | [
"Replaces",
"the",
"content",
"contained",
"within",
"the",
"Git",
"repository",
"branch",
"pointed",
"to",
"by",
"the",
"{",
"@link",
"GitService",
"}",
"object",
"with",
"the",
"source",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/CloneCommand.java#L149-L153 |
cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAromaticTypeMapping.java | MmffAromaticTypeMapping.isAromaticRing | static boolean isAromaticRing(int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic) {
"""
Check if a cycle/ring is aromatic. A cycle is aromatic if the sum of its p electrons is equal
to 4n+2. Double bonds can only contribute if they are in the cycle being tested or are
already delocalised.
@param c... | java | static boolean isAromaticRing(int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic) {
int len = cycle.length - 1;
int sum = 0;
int i = 0;
int iPrev = len - 1;
int iNext = 1;
while (i < len) {
int prev = cycle[iPrev];
int curr = cycle[... | [
"static",
"boolean",
"isAromaticRing",
"(",
"int",
"[",
"]",
"cycle",
",",
"int",
"[",
"]",
"contribution",
",",
"int",
"[",
"]",
"dbs",
",",
"boolean",
"[",
"]",
"aromatic",
")",
"{",
"int",
"len",
"=",
"cycle",
".",
"length",
"-",
"1",
";",
"int"... | Check if a cycle/ring is aromatic. A cycle is aromatic if the sum of its p electrons is equal
to 4n+2. Double bonds can only contribute if they are in the cycle being tested or are
already delocalised.
@param cycle closed walk of vertices in the cycle
@param contribution vector of p electron contributions from ... | [
"Check",
"if",
"a",
"cycle",
"/",
"ring",
"is",
"aromatic",
".",
"A",
"cycle",
"is",
"aromatic",
"if",
"the",
"sum",
"of",
"its",
"p",
"electrons",
"is",
"equal",
"to",
"4n",
"+",
"2",
".",
"Double",
"bonds",
"can",
"only",
"contribute",
"if",
"they"... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAromaticTypeMapping.java#L180-L216 |
softindex/datakernel | cloud-lsmt-cube/src/main/java/io/datakernel/cube/Cube.java | Cube.queryRawStream | public <T> StreamSupplier<T> queryRawStream(List<String> dimensions, List<String> storedMeasures, AggregationPredicate where,
Class<T> resultClass) throws QueryException {
"""
Returns a {@link StreamSupplier} of the records retrieved from cube for the specified query.
@param <T> type of output object... | java | public <T> StreamSupplier<T> queryRawStream(List<String> dimensions, List<String> storedMeasures, AggregationPredicate where,
Class<T> resultClass) throws QueryException {
return queryRawStream(dimensions, storedMeasures, where, resultClass, classLoader);
} | [
"public",
"<",
"T",
">",
"StreamSupplier",
"<",
"T",
">",
"queryRawStream",
"(",
"List",
"<",
"String",
">",
"dimensions",
",",
"List",
"<",
"String",
">",
"storedMeasures",
",",
"AggregationPredicate",
"where",
",",
"Class",
"<",
"T",
">",
"resultClass",
... | Returns a {@link StreamSupplier} of the records retrieved from cube for the specified query.
@param <T> type of output objects
@param resultClass class of output records
@return supplier that streams query results | [
"Returns",
"a",
"{",
"@link",
"StreamSupplier",
"}",
"of",
"the",
"records",
"retrieved",
"from",
"cube",
"for",
"the",
"specified",
"query",
"."
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/cloud-lsmt-cube/src/main/java/io/datakernel/cube/Cube.java#L575-L578 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java | EditManager.addEditDirective | static void addEditDirective(Element plfNode, String attributeName, IPerson person)
throws PortalException {
"""
Create and append an edit directive to the edit set if not there. This only records that the
attribute was changed and the value in the plf copy node should be used, if allowed, during
the... | java | static void addEditDirective(Element plfNode, String attributeName, IPerson person)
throws PortalException {
addDirective(plfNode, attributeName, Constants.ELM_EDIT, person);
} | [
"static",
"void",
"addEditDirective",
"(",
"Element",
"plfNode",
",",
"String",
"attributeName",
",",
"IPerson",
"person",
")",
"throws",
"PortalException",
"{",
"addDirective",
"(",
"plfNode",
",",
"attributeName",
",",
"Constants",
".",
"ELM_EDIT",
",",
"person"... | Create and append an edit directive to the edit set if not there. This only records that the
attribute was changed and the value in the plf copy node should be used, if allowed, during
the merge at login time. | [
"Create",
"and",
"append",
"an",
"edit",
"directive",
"to",
"the",
"edit",
"set",
"if",
"not",
"there",
".",
"This",
"only",
"records",
"that",
"the",
"attribute",
"was",
"changed",
"and",
"the",
"value",
"in",
"the",
"plf",
"copy",
"node",
"should",
"be... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java#L89-L92 |
eserating/siren4j | src/main/java/com/google/code/siren4j/util/ComponentUtils.java | ComponentUtils.getLinkByRel | public static Link getLinkByRel(Entity entity, String... rel) {
"""
Retrieve a link by its relationship.
@param entity cannot be <code>null</code>.
@param rel cannot be <code>null</code> or empty.
@return the located link or <code>null</code> if not found.
"""
if(entity == null) {
thro... | java | public static Link getLinkByRel(Entity entity, String... rel) {
if(entity == null) {
throw new IllegalArgumentException("entity cannot be null.");
}
if(ArrayUtils.isEmpty(rel)) {
throw new IllegalArgumentException("rel cannot be null or empty");
}
L... | [
"public",
"static",
"Link",
"getLinkByRel",
"(",
"Entity",
"entity",
",",
"String",
"...",
"rel",
")",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"entity cannot be null.\"",
")",
";",
"}",
"if",
"(",
... | Retrieve a link by its relationship.
@param entity cannot be <code>null</code>.
@param rel cannot be <code>null</code> or empty.
@return the located link or <code>null</code> if not found. | [
"Retrieve",
"a",
"link",
"by",
"its",
"relationship",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/util/ComponentUtils.java#L76-L94 |
crawljax/crawljax | core/src/main/java/com/crawljax/stateabstractions/dom/RTED/RTED_InfoTree_Opt.java | RTED_InfoTree_Opt.nonNormalizedTreeDist | public double nonNormalizedTreeDist(LblTree t1, LblTree t2) {
"""
Computes the tree edit distance between trees t1 and t2.
@param t1
@param t2
@return tree edit distance between trees t1 and t2
"""
init(t1, t2);
STR = new int[size1][size2];
computeOptimalStrategy();
return computeDistUsingStrArray... | java | public double nonNormalizedTreeDist(LblTree t1, LblTree t2) {
init(t1, t2);
STR = new int[size1][size2];
computeOptimalStrategy();
return computeDistUsingStrArray(it1, it2);
} | [
"public",
"double",
"nonNormalizedTreeDist",
"(",
"LblTree",
"t1",
",",
"LblTree",
"t2",
")",
"{",
"init",
"(",
"t1",
",",
"t2",
")",
";",
"STR",
"=",
"new",
"int",
"[",
"size1",
"]",
"[",
"size2",
"]",
";",
"computeOptimalStrategy",
"(",
")",
";",
"... | Computes the tree edit distance between trees t1 and t2.
@param t1
@param t2
@return tree edit distance between trees t1 and t2 | [
"Computes",
"the",
"tree",
"edit",
"distance",
"between",
"trees",
"t1",
"and",
"t2",
"."
] | train | https://github.com/crawljax/crawljax/blob/d339f4f622ca902ccd35322065821e52a62ec543/core/src/main/java/com/crawljax/stateabstractions/dom/RTED/RTED_InfoTree_Opt.java#L100-L105 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java | BigDecimalMath.atan | public static BigDecimal atan(BigDecimal x, MathContext mathContext) {
"""
Calculates the arc tangens (inverted tangens) of {@link BigDecimal} x.
<p>See: <a href="http://en.wikipedia.org/wiki/Arctangens">Wikipedia: Arctangens</a></p>
@param x the {@link BigDecimal} to calculate the arc tangens for
@param ma... | java | public static BigDecimal atan(BigDecimal x, MathContext mathContext) {
checkMathContext(mathContext);
MathContext mc = new MathContext(mathContext.getPrecision() + 6, mathContext.getRoundingMode());
x = x.divide(sqrt(ONE.add(x.multiply(x, mc), mc), mc), mc);
BigDecimal result = asin(x, mc);
return round(res... | [
"public",
"static",
"BigDecimal",
"atan",
"(",
"BigDecimal",
"x",
",",
"MathContext",
"mathContext",
")",
"{",
"checkMathContext",
"(",
"mathContext",
")",
";",
"MathContext",
"mc",
"=",
"new",
"MathContext",
"(",
"mathContext",
".",
"getPrecision",
"(",
")",
... | Calculates the arc tangens (inverted tangens) of {@link BigDecimal} x.
<p>See: <a href="http://en.wikipedia.org/wiki/Arctangens">Wikipedia: Arctangens</a></p>
@param x the {@link BigDecimal} to calculate the arc tangens for
@param mathContext the {@link MathContext} used for the result
@return the calculated arc tang... | [
"Calculates",
"the",
"arc",
"tangens",
"(",
"inverted",
"tangens",
")",
"of",
"{",
"@link",
"BigDecimal",
"}",
"x",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java#L1434-L1442 |
wiibaker/robotframework-rest-java | src/main/java/org/wuokko/robot/restlib/JsonPathLibrary.java | JsonPathLibrary.findJsonElement | @RobotKeyword
public Object findJsonElement(String source, String jsonPath, String method, String data, String contentType) throws Exception {
"""
Find JSON element by `jsonPath` from the `source` and return its value if found.
`source` can be either URI or the actual JSON content.
You can add optional m... | java | @RobotKeyword
public Object findJsonElement(String source, String jsonPath, String method, String data, String contentType) throws Exception {
System.out.println("*DEBUG* Reading jsonPath: " + jsonPath);
String json = requestUtil.readSource(source, method, data, contentType);
Object value;... | [
"@",
"RobotKeyword",
"public",
"Object",
"findJsonElement",
"(",
"String",
"source",
",",
"String",
"jsonPath",
",",
"String",
"method",
",",
"String",
"data",
",",
"String",
"contentType",
")",
"throws",
"Exception",
"{",
"System",
".",
"out",
".",
"println",... | Find JSON element by `jsonPath` from the `source` and return its value if found.
`source` can be either URI or the actual JSON content.
You can add optional method (ie GET, POST, PUT), data or content type as parameters.
Method defaults to GET.
Example:
| Find Json Element | http://example.com/test.json | $.foo.bar ... | [
"Find",
"JSON",
"element",
"by",
"jsonPath",
"from",
"the",
"source",
"and",
"return",
"its",
"value",
"if",
"found",
"."
] | train | https://github.com/wiibaker/robotframework-rest-java/blob/e30a7e494c143b644ee4282137a5a38e75d9d97b/src/main/java/org/wuokko/robot/restlib/JsonPathLibrary.java#L243-L258 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/clhm/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.drainOnReadIfNeeded | void drainOnReadIfNeeded(int bufferIndex, long writeCount) {
"""
Attempts to drain the buffers if it is determined to be needed when
post-processing a read.
@param bufferIndex the index to the chosen read buffer
@param writeCount the number of writes on the chosen read buffer
"""
final long pendin... | java | void drainOnReadIfNeeded(int bufferIndex, long writeCount) {
final long pending = (writeCount - readBufferDrainAtWriteCount[bufferIndex].get());
final boolean delayable = (pending < READ_BUFFER_THRESHOLD);
final DrainStatus status = drainStatus.get();
if (status.shouldDrainBuffers(delaya... | [
"void",
"drainOnReadIfNeeded",
"(",
"int",
"bufferIndex",
",",
"long",
"writeCount",
")",
"{",
"final",
"long",
"pending",
"=",
"(",
"writeCount",
"-",
"readBufferDrainAtWriteCount",
"[",
"bufferIndex",
"]",
".",
"get",
"(",
")",
")",
";",
"final",
"boolean",
... | Attempts to drain the buffers if it is determined to be needed when
post-processing a read.
@param bufferIndex the index to the chosen read buffer
@param writeCount the number of writes on the chosen read buffer | [
"Attempts",
"to",
"drain",
"the",
"buffers",
"if",
"it",
"is",
"determined",
"to",
"be",
"needed",
"when",
"post",
"-",
"processing",
"a",
"read",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/clhm/ConcurrentLinkedHashMap.java#L381-L388 |
alkacon/opencms-core | src/org/opencms/jsp/decorator/CmsHtmlDecorator.java | CmsHtmlDecorator.hasDelimiter | private boolean hasDelimiter(String word, String[] delimiters) {
"""
Checks if a word contains a given delimiter.<p>
@param word the word to test
@param delimiters array of delimiter strings
@return true if the word contains the delimiter, false otherwiese
"""
boolean delim = false;
for (... | java | private boolean hasDelimiter(String word, String[] delimiters) {
boolean delim = false;
for (int i = 0; i < delimiters.length; i++) {
if (word.indexOf(delimiters[i]) > -1) {
delim = true;
break;
}
}
return delim;
} | [
"private",
"boolean",
"hasDelimiter",
"(",
"String",
"word",
",",
"String",
"[",
"]",
"delimiters",
")",
"{",
"boolean",
"delim",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"delimiters",
".",
"length",
";",
"i",
"++",
")",
... | Checks if a word contains a given delimiter.<p>
@param word the word to test
@param delimiters array of delimiter strings
@return true if the word contains the delimiter, false otherwiese | [
"Checks",
"if",
"a",
"word",
"contains",
"a",
"given",
"delimiter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/decorator/CmsHtmlDecorator.java#L460-L470 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Expression.java | Expression.greaterThanOrEqualTo | @NonNull
public Expression greaterThanOrEqualTo(@NonNull Expression expression) {
"""
Create a greater than or equal to expression that evaluates whether or not the current
expression is greater than or equal to the given expression.
@param expression the expression to compare with the current expression.
... | java | @NonNull
public Expression greaterThanOrEqualTo(@NonNull Expression expression) {
if (expression == null) {
throw new IllegalArgumentException("expression cannot be null.");
}
return new BinaryExpression(this, expression, BinaryExpression.OpType.GreaterThanOrEqualTo);
} | [
"@",
"NonNull",
"public",
"Expression",
"greaterThanOrEqualTo",
"(",
"@",
"NonNull",
"Expression",
"expression",
")",
"{",
"if",
"(",
"expression",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"expression cannot be null.\"",
")",
";",
... | Create a greater than or equal to expression that evaluates whether or not the current
expression is greater than or equal to the given expression.
@param expression the expression to compare with the current expression.
@return a greater than or equal to expression. | [
"Create",
"a",
"greater",
"than",
"or",
"equal",
"to",
"expression",
"that",
"evaluates",
"whether",
"or",
"not",
"the",
"current",
"expression",
"is",
"greater",
"than",
"or",
"equal",
"to",
"the",
"given",
"expression",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Expression.java#L660-L666 |
alkacon/opencms-core | src/org/opencms/publish/CmsPublishManager.java | CmsPublishManager.publishProject | public CmsUUID publishProject(CmsObject cms) throws Exception {
"""
Publishes the current project, printing messages to a shell report.<p>
@param cms the cms request context
@return the publish history id of the published project
@throws Exception if something goes wrong
@see CmsShellReport
"""
... | java | public CmsUUID publishProject(CmsObject cms) throws Exception {
return publishProject(cms, new CmsShellReport(cms.getRequestContext().getLocale()));
} | [
"public",
"CmsUUID",
"publishProject",
"(",
"CmsObject",
"cms",
")",
"throws",
"Exception",
"{",
"return",
"publishProject",
"(",
"cms",
",",
"new",
"CmsShellReport",
"(",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getLocale",
"(",
")",
")",
")",
";",
... | Publishes the current project, printing messages to a shell report.<p>
@param cms the cms request context
@return the publish history id of the published project
@throws Exception if something goes wrong
@see CmsShellReport | [
"Publishes",
"the",
"current",
"project",
"printing",
"messages",
"to",
"a",
"shell",
"report",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishManager.java#L525-L528 |
js-lib-com/commons | src/main/java/js/io/FilesInputStream.java | FilesInputStream.getMeta | public <T> T getMeta(String key, Class<T> type) {
"""
Get files archive meta data converted to requested type.
@param key meta data key,
@param type type to convert meta data value to.
@param <T> meta data type.
@return meta data value converted to type.
@throws InvalidFilesArchiveException if requested met... | java | public <T> T getMeta(String key, Class<T> type) {
return ConverterRegistry.getConverter().asObject(getMeta(key), type);
} | [
"public",
"<",
"T",
">",
"T",
"getMeta",
"(",
"String",
"key",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"ConverterRegistry",
".",
"getConverter",
"(",
")",
".",
"asObject",
"(",
"getMeta",
"(",
"key",
")",
",",
"type",
")",
";",
"}"... | Get files archive meta data converted to requested type.
@param key meta data key,
@param type type to convert meta data value to.
@param <T> meta data type.
@return meta data value converted to type.
@throws InvalidFilesArchiveException if requested meta data key does not exists. | [
"Get",
"files",
"archive",
"meta",
"data",
"converted",
"to",
"requested",
"type",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/io/FilesInputStream.java#L187-L189 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcDataSource.java | WSJdbcDataSource.invokeOperation | @Override
Object invokeOperation(Object implObject, Method method, Object[] args)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException,
SQLException {
"""
Invokes a method. Data sources should use the dynamic configuration manager
to select... | java | @Override
Object invokeOperation(Object implObject, Method method, Object[] args)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException,
SQLException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn... | [
"@",
"Override",
"Object",
"invokeOperation",
"(",
"Object",
"implObject",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"IllegalAccessException",
",",
"IllegalArgumentException",
",",
"InvocationTargetException",
",",
"SQLException",
"{",
... | Invokes a method. Data sources should use the dynamic configuration manager
to select the correct configuration, or if the method is a single-parameter
setter -- such as setExtProperties(map) -- then create a new configuration entry
for it.
@param implObject ignore this parameter; it does not apply to data sources.
@p... | [
"Invokes",
"a",
"method",
".",
"Data",
"sources",
"should",
"use",
"the",
"dynamic",
"configuration",
"manager",
"to",
"select",
"the",
"correct",
"configuration",
"or",
"if",
"the",
"method",
"is",
"a",
"single",
"-",
"parameter",
"setter",
"--",
"such",
"a... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcDataSource.java#L303-L333 |
infinispan/infinispan | core/src/main/java/org/infinispan/commands/functional/Mutations.java | Mutations.writeTo | static <K, V, T, R> void writeTo(ObjectOutput output, Mutation<K, V, R> mutation) throws IOException {
"""
No need to occupy externalizer ids when we have a limited set of options
"""
BaseMutation bm = (BaseMutation) mutation;
DataConversion.writeTo(output, bm.keyDataConversion);
DataConversi... | java | static <K, V, T, R> void writeTo(ObjectOutput output, Mutation<K, V, R> mutation) throws IOException {
BaseMutation bm = (BaseMutation) mutation;
DataConversion.writeTo(output, bm.keyDataConversion);
DataConversion.writeTo(output, bm.valueDataConversion);
byte type = mutation.type();
outpu... | [
"static",
"<",
"K",
",",
"V",
",",
"T",
",",
"R",
">",
"void",
"writeTo",
"(",
"ObjectOutput",
"output",
",",
"Mutation",
"<",
"K",
",",
"V",
",",
"R",
">",
"mutation",
")",
"throws",
"IOException",
"{",
"BaseMutation",
"bm",
"=",
"(",
"BaseMutation"... | No need to occupy externalizer ids when we have a limited set of options | [
"No",
"need",
"to",
"occupy",
"externalizer",
"ids",
"when",
"we",
"have",
"a",
"limited",
"set",
"of",
"options"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/commands/functional/Mutations.java#L26-L50 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java | GeometryUtilities.angleBetween3D | public static double angleBetween3D( Coordinate c1, Coordinate c2, Coordinate c3 ) {
"""
Calculates the angle in degrees between 3 3D coordinates.
<p>The calculated angle is the one placed in vertex c2.</p>
@param c1 first 3D point.
@param c2 central 3D point.
@param c3 last 3D point.
@return the angle be... | java | public static double angleBetween3D( Coordinate c1, Coordinate c2, Coordinate c3 ) {
double a = distance3d(c2, c1, null);
double b = distance3d(c2, c3, null);
double c = distance3d(c1, c3, null);
double angleInTriangle = getAngleInTriangle(a, b, c);
double degrees = toDegrees(an... | [
"public",
"static",
"double",
"angleBetween3D",
"(",
"Coordinate",
"c1",
",",
"Coordinate",
"c2",
",",
"Coordinate",
"c3",
")",
"{",
"double",
"a",
"=",
"distance3d",
"(",
"c2",
",",
"c1",
",",
"null",
")",
";",
"double",
"b",
"=",
"distance3d",
"(",
"... | Calculates the angle in degrees between 3 3D coordinates.
<p>The calculated angle is the one placed in vertex c2.</p>
@param c1 first 3D point.
@param c2 central 3D point.
@param c3 last 3D point.
@return the angle between the coordinates in degrees. | [
"Calculates",
"the",
"angle",
"in",
"degrees",
"between",
"3",
"3D",
"coordinates",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java#L852-L860 |
kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.executeAsync | @SuppressWarnings("unchecked")
public <T> void executeAsync(Call call, final Type returnType, final ApiCallback<T> callback) {
"""
Execute HTTP call asynchronously.
@see #execute(Call, Type)
@param <T> Type
@param call The callback to be executed when the API call finishes
@param returnType Return type
... | java | @SuppressWarnings("unchecked")
public <T> void executeAsync(Call call, final Type returnType, final ApiCallback<T> callback) {
call.enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
callback.onFailure(new ApiException(e), 0, nu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"void",
"executeAsync",
"(",
"Call",
"call",
",",
"final",
"Type",
"returnType",
",",
"final",
"ApiCallback",
"<",
"T",
">",
"callback",
")",
"{",
"call",
".",
"enqueue",
"(",
"... | Execute HTTP call asynchronously.
@see #execute(Call, Type)
@param <T> Type
@param call The callback to be executed when the API call finishes
@param returnType Return type
@param callback ApiCallback | [
"Execute",
"HTTP",
"call",
"asynchronously",
"."
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L829-L849 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/cli/CliUtils.java | CliUtils.executeCommandLine | public static CliOutput executeCommandLine(final Commandline cli, final String loggerName, final String logMessagePrefix) {
"""
Executes the specified command line and blocks until the process has finished. The output of
the process is captured, returned, as well as logged with info (stdout) and error (stderr)
l... | java | public static CliOutput executeCommandLine(final Commandline cli, final String loggerName, final String logMessagePrefix) {
try {
String cliString = CommandLineUtils.toString(cli.getShellCommandline());
LOGGER.info("Executing command-line: {}", cliString);
LoggingStreamConsumer out = new LoggingStreamConsum... | [
"public",
"static",
"CliOutput",
"executeCommandLine",
"(",
"final",
"Commandline",
"cli",
",",
"final",
"String",
"loggerName",
",",
"final",
"String",
"logMessagePrefix",
")",
"{",
"try",
"{",
"String",
"cliString",
"=",
"CommandLineUtils",
".",
"toString",
"(",... | Executes the specified command line and blocks until the process has finished. The output of
the process is captured, returned, as well as logged with info (stdout) and error (stderr)
level, respectively.
@param cli
the command line
@param loggerName
the name of the logger to use (passed to {@link LoggerFactory#getLog... | [
"Executes",
"the",
"specified",
"command",
"line",
"and",
"blocks",
"until",
"the",
"process",
"has",
"finished",
".",
"The",
"output",
"of",
"the",
"process",
"is",
"captured",
"returned",
"as",
"well",
"as",
"logged",
"with",
"info",
"(",
"stdout",
")",
... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/cli/CliUtils.java#L80-L92 |
banq/jdonframework | src/main/java/com/jdon/util/jdom/DataUnformatFilter.java | DataUnformatFilter.startElement | public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
"""
Filter a start element event.
@param uri
The element's Namespace URI.
@param localName
The element's local name.
@param qName
The element's qualified (prefixed) name.
@param atts
The element's ... | java | public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
clearWhitespace();
stateStack.push(SEEN_ELEMENT);
state = SEEN_NOTHING;
super.startElement(uri, localName, qName, atts);
} | [
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"atts",
")",
"throws",
"SAXException",
"{",
"clearWhitespace",
"(",
")",
";",
"stateStack",
".",
"push",
"(",
"SEEN_ELEMENT",
")",
... | Filter a start element event.
@param uri
The element's Namespace URI.
@param localName
The element's local name.
@param qName
The element's qualified (prefixed) name.
@param atts
The element's attribute list.
@exception org.xml.sax.SAXException
If a filter further down the chain raises an exception.
@see org.xml.sax.C... | [
"Filter",
"a",
"start",
"element",
"event",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/jdom/DataUnformatFilter.java#L157-L162 |
unbescape/unbescape | src/main/java/org/unbescape/properties/PropertiesEscape.java | PropertiesEscape.escapePropertiesValueMinimal | public static void escapePropertiesValueMinimal(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform a Java Properties Value level 1 (only basic set) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</... | java | public static void escapePropertiesValueMinimal(final Reader reader, final Writer writer)
throws IOException {
escapePropertiesValue(reader, writer, PropertiesValueEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapePropertiesValueMinimal",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapePropertiesValue",
"(",
"reader",
",",
"writer",
",",
"PropertiesValueEscapeLevel",
".",
"LEVEL_1_B... | <p>
Perform a Java Properties Value level 1 (only basic set) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will only escape the Java Properties basic escape set:
</p>
<ul>
<li>The <em>Single Escape Characters</em>:
<tt>	... | [
"<p",
">",
"Perform",
"a",
"Java",
"Properties",
"Value",
"level",
"1",
"(",
"only",
"basic",
"set",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L483-L486 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/MultipleFileConfigSource.java | MultipleFileConfigSource.initAdditionalPropertyBaseNames | protected void initAdditionalPropertyBaseNames(ServletContext context) {
"""
Initializes the propertyBaseNames list by reading the jawr.config.sources
servlet context param. Subclasses may override this method to use a
different strategy.
@param context
"""
String propertyNames = context.getInitParamete... | java | protected void initAdditionalPropertyBaseNames(ServletContext context) {
String propertyNames = context.getInitParameter(SERVLET_CONTEXT_ADDITIONAL_CONFIG_PARAM);
propertyBaseNames = new ArrayList<>();
if (null != propertyNames) {
StringTokenizer tk = new StringTokenizer(propertyNames, ",");
while (tk.hasMo... | [
"protected",
"void",
"initAdditionalPropertyBaseNames",
"(",
"ServletContext",
"context",
")",
"{",
"String",
"propertyNames",
"=",
"context",
".",
"getInitParameter",
"(",
"SERVLET_CONTEXT_ADDITIONAL_CONFIG_PARAM",
")",
";",
"propertyBaseNames",
"=",
"new",
"ArrayList",
... | Initializes the propertyBaseNames list by reading the jawr.config.sources
servlet context param. Subclasses may override this method to use a
different strategy.
@param context | [
"Initializes",
"the",
"propertyBaseNames",
"list",
"by",
"reading",
"the",
"jawr",
".",
"config",
".",
"sources",
"servlet",
"context",
"param",
".",
"Subclasses",
"may",
"override",
"this",
"method",
"to",
"use",
"a",
"different",
"strategy",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/MultipleFileConfigSource.java#L76-L84 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.updateHipChatService | public HipChatService updateHipChatService(Object projectIdOrPath, HipChatService hipChat) throws GitLabApiException {
"""
Updates the HipChatService notification settings for a project.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/hipchat</code></pre>
The following properties on the HipChatService... | java | public HipChatService updateHipChatService(Object projectIdOrPath, HipChatService hipChat) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("push_events", hipChat.getPushEvents())
.withParam("issues_events", hipChat.getIssuesEvents())
... | [
"public",
"HipChatService",
"updateHipChatService",
"(",
"Object",
"projectIdOrPath",
",",
"HipChatService",
"hipChat",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"push_events\""... | Updates the HipChatService notification settings for a project.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/hipchat</code></pre>
The following properties on the HipChatService instance are utilized in the update of the settings:
<p>
pushEvents (optional) - Enable notifications for push events
issuesEvents ... | [
"Updates",
"the",
"HipChatService",
"notification",
"settings",
"for",
"a",
"project",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L96-L115 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java | SPDateTimeUtil.getFormattedDate | public static String getFormattedDate(final Long lastQueryDate, final String datePattern) {
"""
Get formatted date with browser time zone.
@param lastQueryDate
@param datePattern
pattern how to format the date (cp. {@code SimpleDateFormat})
@return String formatted date
"""
return formatDate(last... | java | public static String getFormattedDate(final Long lastQueryDate, final String datePattern) {
return formatDate(lastQueryDate, null, datePattern);
} | [
"public",
"static",
"String",
"getFormattedDate",
"(",
"final",
"Long",
"lastQueryDate",
",",
"final",
"String",
"datePattern",
")",
"{",
"return",
"formatDate",
"(",
"lastQueryDate",
",",
"null",
",",
"datePattern",
")",
";",
"}"
] | Get formatted date with browser time zone.
@param lastQueryDate
@param datePattern
pattern how to format the date (cp. {@code SimpleDateFormat})
@return String formatted date | [
"Get",
"formatted",
"date",
"with",
"browser",
"time",
"zone",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java#L110-L112 |
amzn/ion-java | src/com/amazon/ion/util/IonStreamUtils.java | IonStreamUtils.writeBoolList | public static void writeBoolList(IonWriter writer, boolean[] values)
throws IOException {
"""
writes an IonList with a series of IonBool values. This
starts a List, writes the values (without any annoations)
and closes the list. For text and tree writers this is
just a convienience, but for the binary w... | java | public static void writeBoolList(IonWriter writer, boolean[] values)
throws IOException
{
if (writer instanceof _Private_ListWriter) {
((_Private_ListWriter)writer).writeBoolList(values);
return;
}
writer.stepIn(IonType.LIST);
for (int ii=0; ii<values... | [
"public",
"static",
"void",
"writeBoolList",
"(",
"IonWriter",
"writer",
",",
"boolean",
"[",
"]",
"values",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"instanceof",
"_Private_ListWriter",
")",
"{",
"(",
"(",
"_Private_ListWriter",
")",
"writer",
... | writes an IonList with a series of IonBool values. This
starts a List, writes the values (without any annoations)
and closes the list. For text and tree writers this is
just a convienience, but for the binary writer it can be
optimized internally.
@param values boolean values to populate the list with | [
"writes",
"an",
"IonList",
"with",
"a",
"series",
"of",
"IonBool",
"values",
".",
"This",
"starts",
"a",
"List",
"writes",
"the",
"values",
"(",
"without",
"any",
"annoations",
")",
"and",
"closes",
"the",
"list",
".",
"For",
"text",
"and",
"tree",
"writ... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonStreamUtils.java#L138-L151 |
jeluard/semantic-versioning | api/src/main/java/org/osjava/jardiff/DOMDiffHandler.java | DOMDiffHandler.classChanged | public void classChanged(ClassInfo oldInfo, ClassInfo newInfo)
throws DiffException {
"""
Write out info aboout a changed class.
This writes out a <classchange> node, followed by a
<from> node, with the old information about the class
followed by a <to> node with the new information ab... | java | public void classChanged(ClassInfo oldInfo, ClassInfo newInfo)
throws DiffException
{
Node currentNode = this.currentNode;
Element tmp = doc.createElementNS(XML_URI, "classchange");
Element from = doc.createElementNS(XML_URI, "from");
Element to = doc.createElementNS(XML_URI... | [
"public",
"void",
"classChanged",
"(",
"ClassInfo",
"oldInfo",
",",
"ClassInfo",
"newInfo",
")",
"throws",
"DiffException",
"{",
"Node",
"currentNode",
"=",
"this",
".",
"currentNode",
";",
"Element",
"tmp",
"=",
"doc",
".",
"createElementNS",
"(",
"XML_URI",
... | Write out info aboout a changed class.
This writes out a <classchange> node, followed by a
<from> node, with the old information about the class
followed by a <to> node with the new information about the
class.
@param oldInfo Info about the old class.
@param newInfo Info about the new class.
@throws ... | [
"Write",
"out",
"info",
"aboout",
"a",
"changed",
"class",
".",
"This",
"writes",
"out",
"a",
"<",
";",
"classchange>",
";",
"node",
"followed",
"by",
"a",
"<",
";",
"from>",
";",
"node",
"with",
"the",
"old",
"information",
"about",
"the",
"clas... | train | https://github.com/jeluard/semantic-versioning/blob/d0bfbeddca8ac4202f5225810227c72a708360a9/api/src/main/java/org/osjava/jardiff/DOMDiffHandler.java#L358-L373 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java | LoadBalancerFrontendIPConfigurationsInner.listAsync | public Observable<Page<FrontendIPConfigurationInner>> listAsync(final String resourceGroupName, final String loadBalancerName) {
"""
Gets all the load balancer frontend IP configurations.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@throws Il... | java | public Observable<Page<FrontendIPConfigurationInner>> listAsync(final String resourceGroupName, final String loadBalancerName) {
return listWithServiceResponseAsync(resourceGroupName, loadBalancerName)
.map(new Func1<ServiceResponse<Page<FrontendIPConfigurationInner>>, Page<FrontendIPConfigurationIn... | [
"public",
"Observable",
"<",
"Page",
"<",
"FrontendIPConfigurationInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"loadBalancerName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Gets all the load balancer frontend IP configurations.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<FrontendIPConfigurationInner> ob... | [
"Gets",
"all",
"the",
"load",
"balancer",
"frontend",
"IP",
"configurations",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java#L123-L131 |
carrotsearch/hppc | hppc/src/main/templates/com/carrotsearch/hppc/KTypeHashSet.java | KTypeHashSet.indexInsert | public void indexInsert(int index, KType key) {
"""
Inserts a key for an index that is not present in the set. This method
may help in avoiding double recalculation of the key's hash.
@see #indexOf
@param index The index of a previously non-existing key, as returned from
{@link #indexOf}.
@throws Assertio... | java | public void indexInsert(int index, KType key) {
assert index < 0 : "The index must not point at an existing key.";
index = ~index;
if (Intrinsics.isEmpty(key)) {
assert index == mask + 1;
assert Intrinsics.isEmpty(keys[index]);
hasEmptyKey = true;
} else {
assert Intrinsics.isEm... | [
"public",
"void",
"indexInsert",
"(",
"int",
"index",
",",
"KType",
"key",
")",
"{",
"assert",
"index",
"<",
"0",
":",
"\"The index must not point at an existing key.\"",
";",
"index",
"=",
"~",
"index",
";",
"if",
"(",
"Intrinsics",
".",
"isEmpty",
"(",
"ke... | Inserts a key for an index that is not present in the set. This method
may help in avoiding double recalculation of the key's hash.
@see #indexOf
@param index The index of a previously non-existing key, as returned from
{@link #indexOf}.
@throws AssertionError If assertions are enabled and the index does
not correspo... | [
"Inserts",
"a",
"key",
"for",
"an",
"index",
"that",
"is",
"not",
"present",
"in",
"the",
"set",
".",
"This",
"method",
"may",
"help",
"in",
"avoiding",
"double",
"recalculation",
"of",
"the",
"key",
"s",
"hash",
"."
] | train | https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/templates/com/carrotsearch/hppc/KTypeHashSet.java#L681-L700 |
rythmengine/rythmengine | src/main/java/org/rythmengine/toString/ToStringStyle.java | ToStringStyle.appendStart | public void appendStart(StringBuilder buffer, Object object) {
"""
<p>Append to the <code>toString</code> the start of data indicator.</p>
@param buffer the <code>StringBuilder</code> to populate
@param object the <code>Object</code> to build a <code>toString</code> for
"""
if (object != null) {
... | java | public void appendStart(StringBuilder buffer, Object object) {
if (object != null) {
appendClassName(buffer, object);
appendIdentityHashCode(buffer, object);
appendContentStart(buffer);
if (fieldSeparatorAtStart) {
appendFieldSeparator(buffer);
... | [
"public",
"void",
"appendStart",
"(",
"StringBuilder",
"buffer",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
"{",
"appendClassName",
"(",
"buffer",
",",
"object",
")",
";",
"appendIdentityHashCode",
"(",
"buffer",
",",
"object"... | <p>Append to the <code>toString</code> the start of data indicator.</p>
@param buffer the <code>StringBuilder</code> to populate
@param object the <code>Object</code> to build a <code>toString</code> for | [
"<p",
">",
"Append",
"to",
"the",
"<code",
">",
"toString<",
"/",
"code",
">",
"the",
"start",
"of",
"data",
"indicator",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/toString/ToStringStyle.java#L369-L378 |
alkacon/opencms-core | src/org/opencms/ui/components/fileselect/CmsResourceTreeContainer.java | CmsResourceTreeContainer.initRoot | public void initRoot(CmsObject cms, CmsResource root) {
"""
Initializes the root level of the tree.<p>
@param cms the CMS context
@param root the root folder
"""
addTreeItem(cms, root, null);
readTreeLevel(cms, root.getStructureId());
} | java | public void initRoot(CmsObject cms, CmsResource root) {
addTreeItem(cms, root, null);
readTreeLevel(cms, root.getStructureId());
} | [
"public",
"void",
"initRoot",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"root",
")",
"{",
"addTreeItem",
"(",
"cms",
",",
"root",
",",
"null",
")",
";",
"readTreeLevel",
"(",
"cms",
",",
"root",
".",
"getStructureId",
"(",
")",
")",
";",
"}"
] | Initializes the root level of the tree.<p>
@param cms the CMS context
@param root the root folder | [
"Initializes",
"the",
"root",
"level",
"of",
"the",
"tree",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/fileselect/CmsResourceTreeContainer.java#L146-L150 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.isAncestor | public static boolean isAncestor( File ancestorCandidate, File file ) {
"""
Determines whether a directory contains a given file.
@param ancestorCandidate the directory
@param file the file
@return true if the directory directly or indirectly contains the file
"""
String path = ancestorCandidate.getAbsol... | java | public static boolean isAncestor( File ancestorCandidate, File file ) {
String path = ancestorCandidate.getAbsolutePath();
if( ! path.endsWith( "/" ))
path += "/";
return file.getAbsolutePath().startsWith( path );
} | [
"public",
"static",
"boolean",
"isAncestor",
"(",
"File",
"ancestorCandidate",
",",
"File",
"file",
")",
"{",
"String",
"path",
"=",
"ancestorCandidate",
".",
"getAbsolutePath",
"(",
")",
";",
"if",
"(",
"!",
"path",
".",
"endsWith",
"(",
"\"/\"",
")",
")"... | Determines whether a directory contains a given file.
@param ancestorCandidate the directory
@param file the file
@return true if the directory directly or indirectly contains the file | [
"Determines",
"whether",
"a",
"directory",
"contains",
"a",
"given",
"file",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L1009-L1016 |
foundation-runtime/service-directory | 1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java | DirectoryServiceClient._deserialize | <T> T _deserialize(String body, Class<T> clazz) {
"""
Deserialize a JSON String to the target object.
@param body
the JSON String.
@param clazz
the Object class name deserialized to.
@return
the deserialized Object instance.
@throws IOException
@throws JsonMappingException
@throws JsonParseException
... | java | <T> T _deserialize(String body, Class<T> clazz) {
if(body == null || body.isEmpty()){
throw new ServiceException(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR,
ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR.getMessageTemplate(),
"the message body is empty");
}
... | [
"<",
"T",
">",
"T",
"_deserialize",
"(",
"String",
"body",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"body",
"==",
"null",
"||",
"body",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"ServiceException",
"(",
"ErrorCode",
".",... | Deserialize a JSON String to the target object.
@param body
the JSON String.
@param clazz
the Object class name deserialized to.
@return
the deserialized Object instance.
@throws IOException
@throws JsonMappingException
@throws JsonParseException | [
"Deserialize",
"a",
"JSON",
"String",
"to",
"the",
"target",
"object",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L380-L394 |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java | CharOperation.indexOf | public static final int indexOf(char toBeFound, char[] array, int start) {
"""
Answers the first index in the array for which the corresponding character is equal to toBeFound starting the
search at index start. Answers -1 if no occurrence of this character is found. <br>
<br>
For example:
<ol>
<li>
<pre>
... | java | public static final int indexOf(char toBeFound, char[] array, int start)
{
for (int i = start; i < array.length; i++)
{
if (toBeFound == array[i])
{
return i;
}
}
return -1;
} | [
"public",
"static",
"final",
"int",
"indexOf",
"(",
"char",
"toBeFound",
",",
"char",
"[",
"]",
"array",
",",
"int",
"start",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
... | Answers the first index in the array for which the corresponding character is equal to toBeFound starting the
search at index start. Answers -1 if no occurrence of this character is found. <br>
<br>
For example:
<ol>
<li>
<pre>
toBeFound = 'c'
array = { ' a', 'b', 'c', 'd' }
start = 2
result => 2
</pre>
</li>
<li>... | [
"Answers",
"the",
"first",
"index",
"in",
"the",
"array",
"for",
"which",
"the",
"corresponding",
"character",
"is",
"equal",
"to",
"toBeFound",
"starting",
"the",
"search",
"at",
"index",
"start",
".",
"Answers",
"-",
"1",
"if",
"no",
"occurrence",
"of",
... | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java#L2307-L2317 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.enableKeyVault | public void enableKeyVault(String resourceGroupName, String accountName) {
"""
Attempts to enable a user managed key vault for encryption of the specified Data Lake Store account.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account.
@param accountName The nam... | java | public void enableKeyVault(String resourceGroupName, String accountName) {
enableKeyVaultWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body();
} | [
"public",
"void",
"enableKeyVault",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"enableKeyVaultWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
... | Attempts to enable a user managed key vault for encryption of the specified Data Lake Store account.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account.
@param accountName The name of the Data Lake Store account to attempt to enable the Key Vault for.
@throws Illega... | [
"Attempts",
"to",
"enable",
"a",
"user",
"managed",
"key",
"vault",
"for",
"encryption",
"of",
"the",
"specified",
"Data",
"Lake",
"Store",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java#L1144-L1146 |
mikepenz/FastAdapter | library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterUIUtils.java | FastAdapterUIUtils.getRippleDrawable | public static Drawable getRippleDrawable(@ColorInt int normalColor, @ColorInt int pressedColor, int radius) {
"""
helper to create an ripple drawable with the given normal and pressed color
@param normalColor the normal color
@param pressedColor the pressed color
@param radius the button radius
@retur... | java | public static Drawable getRippleDrawable(@ColorInt int normalColor, @ColorInt int pressedColor, int radius) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return new RippleDrawable(ColorStateList.valueOf(pressedColor),
new ColorDrawable(normalColor), getRippleMask... | [
"public",
"static",
"Drawable",
"getRippleDrawable",
"(",
"@",
"ColorInt",
"int",
"normalColor",
",",
"@",
"ColorInt",
"int",
"pressedColor",
",",
"int",
"radius",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_COD... | helper to create an ripple drawable with the given normal and pressed color
@param normalColor the normal color
@param pressedColor the pressed color
@param radius the button radius
@return the ripple drawable | [
"helper",
"to",
"create",
"an",
"ripple",
"drawable",
"with",
"the",
"given",
"normal",
"and",
"pressed",
"color"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterUIUtils.java#L101-L108 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/ISOS.java | ISOS.nominateNeighbors | public static void nominateNeighbors(DBIDIter ignore, DBIDArrayIter di, double[] p, double norm, WritableDoubleDataStore scores) {
"""
Vote for neighbors not being outliers. The key method of SOS.
@param ignore Object to ignore
@param di Neighbor object IDs.
@param p Probabilities
@param norm Normalization f... | java | public static void nominateNeighbors(DBIDIter ignore, DBIDArrayIter di, double[] p, double norm, WritableDoubleDataStore scores) {
for(di.seek(0); di.valid(); di.advance()) {
if(DBIDUtil.equal(ignore, di)) {
continue;
}
double v = p[di.getOffset()] * norm; // Normalize
if(!(v > 0)) {... | [
"public",
"static",
"void",
"nominateNeighbors",
"(",
"DBIDIter",
"ignore",
",",
"DBIDArrayIter",
"di",
",",
"double",
"[",
"]",
"p",
",",
"double",
"norm",
",",
"WritableDoubleDataStore",
"scores",
")",
"{",
"for",
"(",
"di",
".",
"seek",
"(",
"0",
")",
... | Vote for neighbors not being outliers. The key method of SOS.
@param ignore Object to ignore
@param di Neighbor object IDs.
@param p Probabilities
@param norm Normalization factor (1/sum)
@param scores Output score storage | [
"Vote",
"for",
"neighbors",
"not",
"being",
"outliers",
".",
"The",
"key",
"method",
"of",
"SOS",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/ISOS.java#L217-L228 |
m-m-m/util | event/src/main/java/net/sf/mmm/util/event/base/AbstractEventSource.java | AbstractEventSource.handleListenerError | protected void handleListenerError(L listener, E event, Throwable error) {
"""
This method is called if a listener throws something while handling an event. <br>
The default implementation is log the error. Override this method to change the behaviour (e.g. ignore the problem,
remove the "evil" listener, throw t... | java | protected void handleListenerError(L listener, E event, Throwable error) {
LOG.debug("The listener (" + listener + ") failed to handle event (" + event + "):", error);
} | [
"protected",
"void",
"handleListenerError",
"(",
"L",
"listener",
",",
"E",
"event",
",",
"Throwable",
"error",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"The listener (\"",
"+",
"listener",
"+",
"\") failed to handle event (\"",
"+",
"event",
"+",
"\"):\"",
",",
... | This method is called if a listener throws something while handling an event. <br>
The default implementation is log the error. Override this method to change the behaviour (e.g. ignore the problem,
remove the "evil" listener, throw the error anyways).
@param listener is the listener that caused the error.
@param even... | [
"This",
"method",
"is",
"called",
"if",
"a",
"listener",
"throws",
"something",
"while",
"handling",
"an",
"event",
".",
"<br",
">",
"The",
"default",
"implementation",
"is",
"log",
"the",
"error",
".",
"Override",
"this",
"method",
"to",
"change",
"the",
... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/event/src/main/java/net/sf/mmm/util/event/base/AbstractEventSource.java#L103-L106 |
VoltDB/voltdb | src/frontend/org/voltdb/jni/ExecutionEngineJNI.java | ExecutionEngineJNI.loadLargeTempTableBlock | public boolean loadLargeTempTableBlock(long siteId, long blockCounter, ByteBuffer block) {
"""
Read a large table block from disk and write it to a ByteBuffer.
Block will still be stored on disk when this operation completes.
@param siteId The originating site id of the block to load
@param blockCount... | java | public boolean loadLargeTempTableBlock(long siteId, long blockCounter, ByteBuffer block) {
LargeBlockTask task = LargeBlockTask.getLoadTask(new BlockId(siteId, blockCounter), block);
return executeLargeBlockTaskSynchronously(task);
} | [
"public",
"boolean",
"loadLargeTempTableBlock",
"(",
"long",
"siteId",
",",
"long",
"blockCounter",
",",
"ByteBuffer",
"block",
")",
"{",
"LargeBlockTask",
"task",
"=",
"LargeBlockTask",
".",
"getLoadTask",
"(",
"new",
"BlockId",
"(",
"siteId",
",",
"blockCounter"... | Read a large table block from disk and write it to a ByteBuffer.
Block will still be stored on disk when this operation completes.
@param siteId The originating site id of the block to load
@param blockCounter The id of the block to load
@param block The buffer to write the block to
@return The orig... | [
"Read",
"a",
"large",
"table",
"block",
"from",
"disk",
"and",
"write",
"it",
"to",
"a",
"ByteBuffer",
".",
"Block",
"will",
"still",
"be",
"stored",
"on",
"disk",
"when",
"this",
"operation",
"completes",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngineJNI.java#L892-L895 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.getCreditInfo | public CreditInfo getCreditInfo(String creditId, String language) throws MovieDbException {
"""
Get the detailed information about a particular credit record.
<p>
This is currently only supported with the new credit model found in TV.
These IDs can be found from any TV credit response as well as the
TV_credi... | java | public CreditInfo getCreditInfo(String creditId, String language) throws MovieDbException {
return tmdbCredits.getCreditInfo(creditId, language);
} | [
"public",
"CreditInfo",
"getCreditInfo",
"(",
"String",
"creditId",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbCredits",
".",
"getCreditInfo",
"(",
"creditId",
",",
"language",
")",
";",
"}"
] | Get the detailed information about a particular credit record.
<p>
This is currently only supported with the new credit model found in TV.
These IDs can be found from any TV credit response as well as the
TV_credits and combined_credits methods for people.<br>
The episodes object returns a list of episodes and are gen... | [
"Get",
"the",
"detailed",
"information",
"about",
"a",
"particular",
"credit",
"record",
".",
"<p",
">",
"This",
"is",
"currently",
"only",
"supported",
"with",
"the",
"new",
"credit",
"model",
"found",
"in",
"TV",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L623-L625 |
weld/core | impl/src/main/java/org/jboss/weld/resolution/EventTypeAssignabilityRules.java | EventTypeAssignabilityRules.parametersMatch | private boolean parametersMatch(Type observedParameter, Type eventParameter) {
"""
A parameterized event type is considered assignable to a parameterized observed event type if
they have identical raw type and for each parameter:
"""
if (Types.isActualType(observedParameter) && Types.isActualType(even... | java | private boolean parametersMatch(Type observedParameter, Type eventParameter) {
if (Types.isActualType(observedParameter) && Types.isActualType(eventParameter)) {
/*
* the observed event type parameter is an actual type with identical raw type to the event type
* parameter, ... | [
"private",
"boolean",
"parametersMatch",
"(",
"Type",
"observedParameter",
",",
"Type",
"eventParameter",
")",
"{",
"if",
"(",
"Types",
".",
"isActualType",
"(",
"observedParameter",
")",
"&&",
"Types",
".",
"isActualType",
"(",
"eventParameter",
")",
")",
"{",
... | A parameterized event type is considered assignable to a parameterized observed event type if
they have identical raw type and for each parameter: | [
"A",
"parameterized",
"event",
"type",
"is",
"considered",
"assignable",
"to",
"a",
"parameterized",
"observed",
"event",
"type",
"if",
"they",
"have",
"identical",
"raw",
"type",
"and",
"for",
"each",
"parameter",
":"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/EventTypeAssignabilityRules.java#L124-L156 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LogNormalDistribution.java | LogNormalDistribution.quantile | public static double quantile(double x, double mu, double sigma) {
"""
Inverse cumulative probability density function (probit) of a normal
distribution.
@param x value to evaluate probit function at
@param mu Mean value
@param sigma Standard deviation.
@return The probit of the given normal distribution at... | java | public static double quantile(double x, double mu, double sigma) {
return FastMath.exp(mu + sigma * NormalDistribution.standardNormalQuantile(x));
} | [
"public",
"static",
"double",
"quantile",
"(",
"double",
"x",
",",
"double",
"mu",
",",
"double",
"sigma",
")",
"{",
"return",
"FastMath",
".",
"exp",
"(",
"mu",
"+",
"sigma",
"*",
"NormalDistribution",
".",
"standardNormalQuantile",
"(",
"x",
")",
")",
... | Inverse cumulative probability density function (probit) of a normal
distribution.
@param x value to evaluate probit function at
@param mu Mean value
@param sigma Standard deviation.
@return The probit of the given normal distribution at x. | [
"Inverse",
"cumulative",
"probability",
"density",
"function",
"(",
"probit",
")",
"of",
"a",
"normal",
"distribution",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LogNormalDistribution.java#L216-L218 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java | TmdbGenres.getGenreMovies | public ResultList<MovieBasic> getGenreMovies(int genreId, String language, Integer page, Boolean includeAllMovies, Boolean includeAdult) throws MovieDbException {
"""
Get the list of movies for a particular genre by id.
By default, only movies with 10 or more votes are included.
@param genreId
@param langua... | java | public ResultList<MovieBasic> getGenreMovies(int genreId, String language, Integer page, Boolean includeAllMovies, Boolean includeAdult) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, genreId);
parameters.add(Param.LANGUAGE, language);
... | [
"public",
"ResultList",
"<",
"MovieBasic",
">",
"getGenreMovies",
"(",
"int",
"genreId",
",",
"String",
"language",
",",
"Integer",
"page",
",",
"Boolean",
"includeAllMovies",
",",
"Boolean",
"includeAdult",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
... | Get the list of movies for a particular genre by id.
By default, only movies with 10 or more votes are included.
@param genreId
@param language
@param page
@param includeAllMovies
@param includeAdult
@return
@throws MovieDbException | [
"Get",
"the",
"list",
"of",
"movies",
"for",
"a",
"particular",
"genre",
"by",
"id",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java#L115-L128 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/loaders/context/StringFunctionLoader.java | StringFunctionLoader.addChild | static INode addChild(INode parent, IContext context, String child) {
"""
Adds a node to the tree.
@param parent parent node, if this is null then we are creating the root of the tree
and the child parameter represents the name of the root
@param context a tree being created
@param child child to be added... | java | static INode addChild(INode parent, IContext context, String child) {
INode result;
if (null == parent) { //if this is true, then it is the root of the tree
result = context.createRoot(child);
} else {
result = parent.createChild(child);
}
return ... | [
"static",
"INode",
"addChild",
"(",
"INode",
"parent",
",",
"IContext",
"context",
",",
"String",
"child",
")",
"{",
"INode",
"result",
";",
"if",
"(",
"null",
"==",
"parent",
")",
"{",
"//if this is true, then it is the root of the tree\r",
"result",
"=",
"cont... | Adds a node to the tree.
@param parent parent node, if this is null then we are creating the root of the tree
and the child parameter represents the name of the root
@param context a tree being created
@param child child to be added
@return inserted node | [
"Adds",
"a",
"node",
"to",
"the",
"tree",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/loaders/context/StringFunctionLoader.java#L83-L92 |
fracpete/multisearch-weka-package | src/main/java/weka/classifiers/meta/multisearch/DefaultEvaluationWrapper.java | DefaultEvaluationWrapper.getMetric | public double getMetric(int id, int classLabel) {
"""
Returns the metric for the given ID.
@param id the id to get the metric for
@param classLabel the class label index for which to return metric (if applicable)
@return the metric
"""
try {
switch (id) {
case DefaultEvaluationMetrics... | java | public double getMetric(int id, int classLabel) {
try {
switch (id) {
case DefaultEvaluationMetrics.EVALUATION_CC:
return m_Evaluation.correlationCoefficient();
case DefaultEvaluationMetrics.EVALUATION_MATTHEWS_CC:
return m_Evaluation.matthewsCorrelationCoefficient(0);
... | [
"public",
"double",
"getMetric",
"(",
"int",
"id",
",",
"int",
"classLabel",
")",
"{",
"try",
"{",
"switch",
"(",
"id",
")",
"{",
"case",
"DefaultEvaluationMetrics",
".",
"EVALUATION_CC",
":",
"return",
"m_Evaluation",
".",
"correlationCoefficient",
"(",
")",
... | Returns the metric for the given ID.
@param id the id to get the metric for
@param classLabel the class label index for which to return metric (if applicable)
@return the metric | [
"Returns",
"the",
"metric",
"for",
"the",
"given",
"ID",
"."
] | train | https://github.com/fracpete/multisearch-weka-package/blob/756fcf343e7cc9fd3844c99a0e1e828368f393d0/src/main/java/weka/classifiers/meta/multisearch/DefaultEvaluationWrapper.java#L67-L123 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.