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 |
|---|---|---|---|---|---|---|---|---|---|---|
Patreon/patreon-java | src/main/java/com/patreon/PatreonAPI.java | PatreonAPI.addFieldsParam | private URIBuilder addFieldsParam(URIBuilder builder, Class<? extends BaseResource> type, Collection<? extends Field> fields) {
"""
Add fields[type]=fieldName,fieldName,fieldName as a query parameter to the request represented by builder
@param builder A URIBuilder building a request to the API
@param type A Bas... | java | private URIBuilder addFieldsParam(URIBuilder builder, Class<? extends BaseResource> type, Collection<? extends Field> fields) {
List<String> fieldNames = new ArrayList<>();
for (Field f : fields) {
fieldNames.add(f.getPropertyName());
}
String typeStr = BaseResource.getType(type);
builder.addP... | [
"private",
"URIBuilder",
"addFieldsParam",
"(",
"URIBuilder",
"builder",
",",
"Class",
"<",
"?",
"extends",
"BaseResource",
">",
"type",
",",
"Collection",
"<",
"?",
"extends",
"Field",
">",
"fields",
")",
"{",
"List",
"<",
"String",
">",
"fieldNames",
"=",
... | Add fields[type]=fieldName,fieldName,fieldName as a query parameter to the request represented by builder
@param builder A URIBuilder building a request to the API
@param type A BaseResource annotated with {@link com.github.jasminb.jsonapi.annotations.Type}
@param fields A list of fields to include. Only fields in thi... | [
"Add",
"fields",
"[",
"type",
"]",
"=",
"fieldName",
"fieldName",
"fieldName",
"as",
"a",
"query",
"parameter",
"to",
"the",
"request",
"represented",
"by",
"builder"
] | train | https://github.com/Patreon/patreon-java/blob/669104b3389f19635ffab75c593db9c022334092/src/main/java/com/patreon/PatreonAPI.java#L211-L220 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/miner/SIFSearcher.java | SIFSearcher.searchSIF | public boolean searchSIF(Model model, OutputStream out, SIFToText stt) {
"""
Searches the given model with the contained miners. Writes the textual result to the given
output stream. Closes the stream at the end.
@param model model to search
@param out stream to write
@param stt sif to text converter
@return ... | java | public boolean searchSIF(Model model, OutputStream out, SIFToText stt)
{
Set<SIFInteraction> inters = searchSIF(model);
if (!inters.isEmpty())
{
List<SIFInteraction> interList = new ArrayList<SIFInteraction>(inters);
Collections.sort(interList);
try
{
boolean first = true;
OutputStreamWriter... | [
"public",
"boolean",
"searchSIF",
"(",
"Model",
"model",
",",
"OutputStream",
"out",
",",
"SIFToText",
"stt",
")",
"{",
"Set",
"<",
"SIFInteraction",
">",
"inters",
"=",
"searchSIF",
"(",
"model",
")",
";",
"if",
"(",
"!",
"inters",
".",
"isEmpty",
"(",
... | Searches the given model with the contained miners. Writes the textual result to the given
output stream. Closes the stream at the end.
@param model model to search
@param out stream to write
@param stt sif to text converter
@return true if any output produced successfully | [
"Searches",
"the",
"given",
"model",
"with",
"the",
"contained",
"miners",
".",
"Writes",
"the",
"textual",
"result",
"to",
"the",
"given",
"output",
"stream",
".",
"Closes",
"the",
"stream",
"at",
"the",
"end",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/miner/SIFSearcher.java#L213-L241 |
belaban/JGroups | src/org/jgroups/stack/Configurator.java | Configurator.removeProvidedUpServices | protected static void removeProvidedUpServices(Protocol protocol, List<Integer> events) {
"""
Removes all events provided by the protocol below protocol from events
@param protocol
@param events
"""
if(protocol == null || events == null)
return;
for(Protocol prot=protocol.getDownP... | java | protected static void removeProvidedUpServices(Protocol protocol, List<Integer> events) {
if(protocol == null || events == null)
return;
for(Protocol prot=protocol.getDownProtocol(); prot != null && !events.isEmpty(); prot=prot.getDownProtocol()) {
List<Integer> provided_up_servi... | [
"protected",
"static",
"void",
"removeProvidedUpServices",
"(",
"Protocol",
"protocol",
",",
"List",
"<",
"Integer",
">",
"events",
")",
"{",
"if",
"(",
"protocol",
"==",
"null",
"||",
"events",
"==",
"null",
")",
"return",
";",
"for",
"(",
"Protocol",
"pr... | Removes all events provided by the protocol below protocol from events
@param protocol
@param events | [
"Removes",
"all",
"events",
"provided",
"by",
"the",
"protocol",
"below",
"protocol",
"from",
"events"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/stack/Configurator.java#L343-L351 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java | SqlFunctionUtils.lpad | public static String lpad(String base, int len, String pad) {
"""
Returns the string str left-padded with the string pad to a length of len characters.
If str is longer than len, the return value is shortened to len characters.
"""
if (len < 0 || "".equals(pad)) {
return null;
} else if (len == 0) {
... | java | public static String lpad(String base, int len, String pad) {
if (len < 0 || "".equals(pad)) {
return null;
} else if (len == 0) {
return "";
}
char[] data = new char[len];
char[] baseChars = base.toCharArray();
char[] padChars = pad.toCharArray();
// the length of the padding needed
int pos = M... | [
"public",
"static",
"String",
"lpad",
"(",
"String",
"base",
",",
"int",
"len",
",",
"String",
"pad",
")",
"{",
"if",
"(",
"len",
"<",
"0",
"||",
"\"\"",
".",
"equals",
"(",
"pad",
")",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"... | Returns the string str left-padded with the string pad to a length of len characters.
If str is longer than len, the return value is shortened to len characters. | [
"Returns",
"the",
"string",
"str",
"left",
"-",
"padded",
"with",
"the",
"string",
"pad",
"to",
"a",
"length",
"of",
"len",
"characters",
".",
"If",
"str",
"is",
"longer",
"than",
"len",
"the",
"return",
"value",
"is",
"shortened",
"to",
"len",
"characte... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L221-L250 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkNonEmpty | private void checkNonEmpty(Tuple<Decl.Variable> decls, LifetimeRelation lifetimes) {
"""
Check a given set of variable declarations are not "empty". That is, their
declared type is not equivalent to void.
@param decls
"""
for (int i = 0; i != decls.size(); ++i) {
checkNonEmpty(decls.get(i), lifetimes)... | java | private void checkNonEmpty(Tuple<Decl.Variable> decls, LifetimeRelation lifetimes) {
for (int i = 0; i != decls.size(); ++i) {
checkNonEmpty(decls.get(i), lifetimes);
}
} | [
"private",
"void",
"checkNonEmpty",
"(",
"Tuple",
"<",
"Decl",
".",
"Variable",
">",
"decls",
",",
"LifetimeRelation",
"lifetimes",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"!=",
"decls",
".",
"size",
"(",
")",
";",
"++",
"i",
")",
"{"... | Check a given set of variable declarations are not "empty". That is, their
declared type is not equivalent to void.
@param decls | [
"Check",
"a",
"given",
"set",
"of",
"variable",
"declarations",
"are",
"not",
"empty",
".",
"That",
"is",
"their",
"declared",
"type",
"is",
"not",
"equivalent",
"to",
"void",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L1850-L1854 |
google/closure-compiler | src/com/google/javascript/jscomp/JSModuleGraph.java | JSModuleGraph.moveMarkedWeakSources | private static void moveMarkedWeakSources(JSModule weakModule, Iterable<CompilerInput> inputs) {
"""
Moves all sources that have {@link SourceKind#WEAK} into the weak module so that they may be
pruned later.
"""
checkNotNull(weakModule);
ImmutableList<CompilerInput> allInputs = ImmutableList.copyOf(in... | java | private static void moveMarkedWeakSources(JSModule weakModule, Iterable<CompilerInput> inputs) {
checkNotNull(weakModule);
ImmutableList<CompilerInput> allInputs = ImmutableList.copyOf(inputs);
for (CompilerInput i : allInputs) {
if (i.getSourceFile().isWeak()) {
JSModule existingModule = i.ge... | [
"private",
"static",
"void",
"moveMarkedWeakSources",
"(",
"JSModule",
"weakModule",
",",
"Iterable",
"<",
"CompilerInput",
">",
"inputs",
")",
"{",
"checkNotNull",
"(",
"weakModule",
")",
";",
"ImmutableList",
"<",
"CompilerInput",
">",
"allInputs",
"=",
"Immutab... | Moves all sources that have {@link SourceKind#WEAK} into the weak module so that they may be
pruned later. | [
"Moves",
"all",
"sources",
"that",
"have",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L479-L494 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/CorporationApi.java | CorporationApi.getCorporationsCorporationId | public CorporationResponse getCorporationsCorporationId(Integer corporationId, String datasource, String ifNoneMatch)
throws ApiException {
"""
Get corporation information Public information about a corporation ---
This route is cached for up to 3600 seconds
@param corporationId
An EVE corporation... | java | public CorporationResponse getCorporationsCorporationId(Integer corporationId, String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<CorporationResponse> resp = getCorporationsCorporationIdWithHttpInfo(corporationId, datasource,
ifNoneMatch);
return resp.ge... | [
"public",
"CorporationResponse",
"getCorporationsCorporationId",
"(",
"Integer",
"corporationId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"CorporationResponse",
">",
"resp",
"=",
"getCorporationsCo... | Get corporation information Public information about a corporation ---
This route is cached for up to 3600 seconds
@param corporationId
An EVE corporation ID (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous request. A 304 w... | [
"Get",
"corporation",
"information",
"Public",
"information",
"about",
"a",
"corporation",
"---",
"This",
"route",
"is",
"cached",
"for",
"up",
"to",
"3600",
"seconds"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/CorporationApi.java#L159-L164 |
MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/Morphia.java | Morphia.createDatastore | @SuppressWarnings("deprecation")
public Datastore createDatastore(final MongoClient mongoClient, final String dbName) {
"""
It is best to use a Mongo singleton instance here.
@param mongoClient the representations of the connection to a MongoDB instance
@param dbName the name of the database
@return ... | java | @SuppressWarnings("deprecation")
public Datastore createDatastore(final MongoClient mongoClient, final String dbName) {
return new DatastoreImpl(this, mongoClient, dbName);
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"Datastore",
"createDatastore",
"(",
"final",
"MongoClient",
"mongoClient",
",",
"final",
"String",
"dbName",
")",
"{",
"return",
"new",
"DatastoreImpl",
"(",
"this",
",",
"mongoClient",
",",
"dbName"... | It is best to use a Mongo singleton instance here.
@param mongoClient the representations of the connection to a MongoDB instance
@param dbName the name of the database
@return a Datastore that you can use to interact with MongoDB | [
"It",
"is",
"best",
"to",
"use",
"a",
"Mongo",
"singleton",
"instance",
"here",
"."
] | train | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/Morphia.java#L88-L91 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/readerwriter/multicast/MulticastJournalWriter.java | MulticastJournalWriter.writeJournalEntry | @Override
public void writeJournalEntry(CreatorJournalEntry journalEntry)
throws JournalException {
"""
<p>
Write a journal entry.
</p>
<p>
If we are shutdown, ignore this request. Otherwise, get an output stream
from each Transport in turn, and write the entry. If this puts the file
size ove... | java | @Override
public void writeJournalEntry(CreatorJournalEntry journalEntry)
throws JournalException {
synchronized (JournalWriter.SYNCHRONIZER) {
if (state == SHUTDOWN) {
return;
}
logger.debug("Writing journal entry.");
sendRequestTo... | [
"@",
"Override",
"public",
"void",
"writeJournalEntry",
"(",
"CreatorJournalEntry",
"journalEntry",
")",
"throws",
"JournalException",
"{",
"synchronized",
"(",
"JournalWriter",
".",
"SYNCHRONIZER",
")",
"{",
"if",
"(",
"state",
"==",
"SHUTDOWN",
")",
"{",
"return... | <p>
Write a journal entry.
</p>
<p>
If we are shutdown, ignore this request. Otherwise, get an output stream
from each Transport in turn, and write the entry. If this puts the file
size over the limit, close them.
</p>
@see org.fcrepo.server.journal.JournalWriter#writeJournalEntry(org.fcrepo.server.journal.entry.Creat... | [
"<p",
">",
"Write",
"a",
"journal",
"entry",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"we",
"are",
"shutdown",
"ignore",
"this",
"request",
".",
"Otherwise",
"get",
"an",
"output",
"stream",
"from",
"each",
"Transport",
"in",
"turn",
"and",
"write",
... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/readerwriter/multicast/MulticastJournalWriter.java#L299-L314 |
mangstadt/biweekly | src/main/java/biweekly/util/com/google/ical/iter/Util.java | Util.countInPeriod | static int countInPeriod(DayOfWeek dow, DayOfWeek dow0, int nDays) {
"""
Counts the number of occurrences of a weekday in a given period.
@param dow the weekday
@param dow0 the weekday of the first day of the period
@param nDays the number of days in the period
"""
//two cases:
// (1a) dow >= dow0: co... | java | static int countInPeriod(DayOfWeek dow, DayOfWeek dow0, int nDays) {
//two cases:
// (1a) dow >= dow0: count === (nDays - (dow - dow0)) / 7
// (1b) dow < dow0: count === (nDays - (7 - dow0 - dow)) / 7
if (dow.getCalendarConstant() >= dow0.getCalendarConstant()) {
return 1 + ((nDays - (dow.getCalendarCon... | [
"static",
"int",
"countInPeriod",
"(",
"DayOfWeek",
"dow",
",",
"DayOfWeek",
"dow0",
",",
"int",
"nDays",
")",
"{",
"//two cases:",
"// (1a) dow >= dow0: count === (nDays - (dow - dow0)) / 7",
"// (1b) dow < dow0: count === (nDays - (7 - dow0 - dow)) / 7",
"if",
"(",
"dow"... | Counts the number of occurrences of a weekday in a given period.
@param dow the weekday
@param dow0 the weekday of the first day of the period
@param nDays the number of days in the period | [
"Counts",
"the",
"number",
"of",
"occurrences",
"of",
"a",
"weekday",
"in",
"a",
"given",
"period",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/Util.java#L149-L158 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/DefaultExceptionResolver.java | DefaultExceptionResolver.createThrowable | private Throwable createThrowable(String typeName, String message) throws IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException {
"""
Attempts to create an {@link Throwable} of the given type with the given message. For this method to create a
{@link Throwable} it mus... | java | private Throwable createThrowable(String typeName, String message) throws IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException {
Class<? extends Throwable> clazz = resolveThrowableClass(typeName);
Constructor<? extends Throwable> defaultCtr = getDefaultConstructor(clazz... | [
"private",
"Throwable",
"createThrowable",
"(",
"String",
"typeName",
",",
"String",
"message",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"InstantiationException",
",",
"ClassNotFoundException",
"{",
"Class",
"<",
"?",
"extends",
"T... | Attempts to create an {@link Throwable} of the given type with the given message. For this method to create a
{@link Throwable} it must have either a default (no-args) constructor or a constructor that takes a {@code String}
as the message name. null is returned if a {@link Throwable} can't be created.
@param type... | [
"Attempts",
"to",
"create",
"an",
"{",
"@link",
"Throwable",
"}",
"of",
"the",
"given",
"type",
"with",
"the",
"given",
"message",
".",
"For",
"this",
"method",
"to",
"create",
"a",
"{",
"@link",
"Throwable",
"}",
"it",
"must",
"have",
"either",
"a",
"... | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/DefaultExceptionResolver.java#L69-L89 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseQualifiedAccess | private Expr parseQualifiedAccess(EnclosingScope scope, boolean terminated) {
"""
Attempt to parse a possible module identifier. This will reflect a true
module identifier only if the root variable is not in the given
environment.
@param src
@param scope
The enclosing scope for this statement, which determi... | java | private Expr parseQualifiedAccess(EnclosingScope scope, boolean terminated) {
int start = index;
// Parse qualified name
Name name = parseName(scope);
// Construct link to be resolved
Decl.Link link = new Decl.Link<>(name);
// Decide what we've got
int mid = index;
Expr expr;
if (skipTemplate(scope) &... | [
"private",
"Expr",
"parseQualifiedAccess",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"// Parse qualified name",
"Name",
"name",
"=",
"parseName",
"(",
"scope",
")",
";",
"// Construct link to be resolv... | Attempt to parse a possible module identifier. This will reflect a true
module identifier only if the root variable is not in the given
environment.
@param src
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@ret... | [
"Attempt",
"to",
"parse",
"a",
"possible",
"module",
"identifier",
".",
"This",
"will",
"reflect",
"a",
"true",
"module",
"identifier",
"only",
"if",
"the",
"root",
"variable",
"is",
"not",
"in",
"the",
"given",
"environment",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L2271-L2298 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_flavor_flavorId_GET | public OvhFlavor project_serviceName_flavor_flavorId_GET(String serviceName, String flavorId) throws IOException {
"""
Get flavor
REST: GET /cloud/project/{serviceName}/flavor/{flavorId}
@param flavorId [required] Flavor id
@param serviceName [required] Service name
"""
String qPath = "/cloud/project/{s... | java | public OvhFlavor project_serviceName_flavor_flavorId_GET(String serviceName, String flavorId) throws IOException {
String qPath = "/cloud/project/{serviceName}/flavor/{flavorId}";
StringBuilder sb = path(qPath, serviceName, flavorId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp,... | [
"public",
"OvhFlavor",
"project_serviceName_flavor_flavorId_GET",
"(",
"String",
"serviceName",
",",
"String",
"flavorId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/flavor/{flavorId}\"",
";",
"StringBuilder",
"sb",
"=",
"path... | Get flavor
REST: GET /cloud/project/{serviceName}/flavor/{flavorId}
@param flavorId [required] Flavor id
@param serviceName [required] Service name | [
"Get",
"flavor"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2312-L2317 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getAddFileMetadataRequest | public BoxRequestsMetadata.AddFileMetadata getAddFileMetadataRequest(String id, LinkedHashMap<String, Object> values, String scope, String template) {
"""
Gets a request that adds metadata to a file
@param id id of the file to add metadata to
@param values mapping of the template keys to their values
@p... | java | public BoxRequestsMetadata.AddFileMetadata getAddFileMetadataRequest(String id, LinkedHashMap<String, Object> values, String scope, String template) {
BoxRequestsMetadata.AddFileMetadata request = new BoxRequestsMetadata.AddFileMetadata(values, getFileMetadataUrl(id, scope, template), mSession);
return ... | [
"public",
"BoxRequestsMetadata",
".",
"AddFileMetadata",
"getAddFileMetadataRequest",
"(",
"String",
"id",
",",
"LinkedHashMap",
"<",
"String",
",",
"Object",
">",
"values",
",",
"String",
"scope",
",",
"String",
"template",
")",
"{",
"BoxRequestsMetadata",
".",
"... | Gets a request that adds metadata to a file
@param id id of the file to add metadata to
@param values mapping of the template keys to their values
@param scope currently only global and enterprise scopes are supported
@param template metadata template to use
@return request to add metadata to a file | [
"Gets",
"a",
"request",
"that",
"adds",
"metadata",
"to",
"a",
"file"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L115-L118 |
fuzzylite/jfuzzylite | jfuzzylite/src/main/java/com/fuzzylite/defuzzifier/LargestOfMaximum.java | LargestOfMaximum.defuzzify | @Override
public double defuzzify(Term term, double minimum, double maximum) {
"""
Computes the largest value of the maximum membership function of a fuzzy
set. The largest value is computed by integrating over the fuzzy set. The
integration algorithm is the midpoint rectangle method
(https://en.wikipedia.o... | java | @Override
public double defuzzify(Term term, double minimum, double maximum) {
if (!Op.isFinite(minimum + maximum)) {
return Double.NaN;
}
final int resolution = getResolution();
final double dx = (maximum - minimum) / resolution;
double x, y;
double ymax... | [
"@",
"Override",
"public",
"double",
"defuzzify",
"(",
"Term",
"term",
",",
"double",
"minimum",
",",
"double",
"maximum",
")",
"{",
"if",
"(",
"!",
"Op",
".",
"isFinite",
"(",
"minimum",
"+",
"maximum",
")",
")",
"{",
"return",
"Double",
".",
"NaN",
... | Computes the largest value of the maximum membership function of a fuzzy
set. The largest value is computed by integrating over the fuzzy set. The
integration algorithm is the midpoint rectangle method
(https://en.wikipedia.org/wiki/Rectangle_method).
@param term is the fuzzy set
@param minimum is the minimum value of... | [
"Computes",
"the",
"largest",
"value",
"of",
"the",
"maximum",
"membership",
"function",
"of",
"a",
"fuzzy",
"set",
".",
"The",
"largest",
"value",
"is",
"computed",
"by",
"integrating",
"over",
"the",
"fuzzy",
"set",
".",
"The",
"integration",
"algorithm",
... | train | https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/defuzzifier/LargestOfMaximum.java#L55-L75 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/DigitalSignature.java | DigitalSignature.verify | public boolean verify(String base64Signature, String content, String timestamp) throws Exception {
"""
Verifies the validity of the digital signature using stored key name.
@param base64Signature The digital signature.
@param content The authorization string to which the signature was applied.
@param timestam... | java | public boolean verify(String base64Signature, String content, String timestamp) throws Exception {
return verify(base64Signature, content, timestamp, keyName);
} | [
"public",
"boolean",
"verify",
"(",
"String",
"base64Signature",
",",
"String",
"content",
",",
"String",
"timestamp",
")",
"throws",
"Exception",
"{",
"return",
"verify",
"(",
"base64Signature",
",",
"content",
",",
"timestamp",
",",
"keyName",
")",
";",
"}"
... | Verifies the validity of the digital signature using stored key name.
@param base64Signature The digital signature.
@param content The authorization string to which the signature was applied.
@param timestamp The timestamp of the digital signature.
@return True if the signature is valid.
@throws Exception Unspecified ... | [
"Verifies",
"the",
"validity",
"of",
"the",
"digital",
"signature",
"using",
"stored",
"key",
"name",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/DigitalSignature.java#L87-L89 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.deleteArtifact | public void deleteArtifact(final String gavc, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
"""
Delete an artifact in the Grapes server
@param gavc
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationException
"""
final... | java | public void deleteArtifact(final String gavc, final String user, final String password) throws GrapesCommunicationException, AuthenticationException{
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL).path(RequestUtils.getArtifactPath(gavc));
... | [
"public",
"void",
"deleteArtifact",
"(",
"final",
"String",
"gavc",
",",
"final",
"String",
"user",
",",
"final",
"String",
"password",
")",
"throws",
"GrapesCommunicationException",
",",
"AuthenticationException",
"{",
"final",
"Client",
"client",
"=",
"getClient",... | Delete an artifact in the Grapes server
@param gavc
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationException | [
"Delete",
"an",
"artifact",
"in",
"the",
"Grapes",
"server"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L440-L453 |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/evaluator/AggregateContainer.java | AggregateContainer.taskletFailed | public void taskletFailed(final int taskletId, final Exception e) {
"""
Reported when an associated tasklet is complete and adds it to the failure pool.
"""
final boolean aggregateOnCount;
synchronized (stateLock) {
failedTasklets.add(new ImmutablePair<>(taskletId, e));
removePendingTasklet... | java | public void taskletFailed(final int taskletId, final Exception e) {
final boolean aggregateOnCount;
synchronized (stateLock) {
failedTasklets.add(new ImmutablePair<>(taskletId, e));
removePendingTaskletReferenceCount(taskletId);
aggregateOnCount = aggregateOnCount();
}
if (aggregateOn... | [
"public",
"void",
"taskletFailed",
"(",
"final",
"int",
"taskletId",
",",
"final",
"Exception",
"e",
")",
"{",
"final",
"boolean",
"aggregateOnCount",
";",
"synchronized",
"(",
"stateLock",
")",
"{",
"failedTasklets",
".",
"add",
"(",
"new",
"ImmutablePair",
"... | Reported when an associated tasklet is complete and adds it to the failure pool. | [
"Reported",
"when",
"an",
"associated",
"tasklet",
"is",
"complete",
"and",
"adds",
"it",
"to",
"the",
"failure",
"pool",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/evaluator/AggregateContainer.java#L201-L212 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getFinisherInfo | public void getFinisherInfo(int[] ids, Callback<List<Finisher>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on Finishers API go <a href="https://wiki.guildwars2.com/wiki/API:2/finishers">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link... | java | public void getFinisherInfo(int[] ids, Callback<List<Finisher>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getFinisherInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getFinisherInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Finisher",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids... | For more info on Finishers API go <a href="https://wiki.guildwars2.com/wiki/API:2/finishers">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of finisher id
@param callback callback tha... | [
"For",
"more",
"info",
"on",
"Finishers",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"finishers",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1390-L1393 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java | StrSubstitutor.replaceIn | public boolean replaceIn(final StringBuilder source) {
"""
Replaces all the occurrences of variables within the given source buffer
with their matching values from the resolver.
The buffer is updated with the result.
@param source the buffer to replace in, updated, null returns zero
@return true if altered
... | java | public boolean replaceIn(final StringBuilder source) {
if (source == null) {
return false;
}
return replaceIn(source, 0, source.length());
} | [
"public",
"boolean",
"replaceIn",
"(",
"final",
"StringBuilder",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"replaceIn",
"(",
"source",
",",
"0",
",",
"source",
".",
"length",
"(",
")",
")",
... | Replaces all the occurrences of variables within the given source buffer
with their matching values from the resolver.
The buffer is updated with the result.
@param source the buffer to replace in, updated, null returns zero
@return true if altered
@since 3.2 | [
"Replaces",
"all",
"the",
"occurrences",
"of",
"variables",
"within",
"the",
"given",
"source",
"buffer",
"with",
"their",
"matching",
"values",
"from",
"the",
"resolver",
".",
"The",
"buffer",
"is",
"updated",
"with",
"the",
"result",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java#L663-L668 |
KyoriPowered/text | api/src/main/java/net/kyori/text/TranslatableComponent.java | TranslatableComponent.of | public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color) {
"""
Creates a translatable component with a translation key.
@param key the translation key
@param color the color
@return the translatable component
"""
return builder(key)
.color(color)
.... | java | public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color) {
return builder(key)
.color(color)
.build();
} | [
"public",
"static",
"TranslatableComponent",
"of",
"(",
"final",
"@",
"NonNull",
"String",
"key",
",",
"final",
"@",
"Nullable",
"TextColor",
"color",
")",
"{",
"return",
"builder",
"(",
"key",
")",
".",
"color",
"(",
"color",
")",
".",
"build",
"(",
")"... | Creates a translatable component with a translation key.
@param key the translation key
@param color the color
@return the translatable component | [
"Creates",
"a",
"translatable",
"component",
"with",
"a",
"translation",
"key",
"."
] | train | https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/TranslatableComponent.java#L93-L97 |
fcrepo3/fcrepo | fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/util/ContextUtil.java | ContextUtil.buildRequest | public RequestCtx buildRequest(List<Map<URI, List<AttributeValue>>> subjects,
Map<URI, AttributeValue> actions,
Map<URI, AttributeValue> resources,
Map<URI, AttributeValue> environment,
... | java | public RequestCtx buildRequest(List<Map<URI, List<AttributeValue>>> subjects,
Map<URI, AttributeValue> actions,
Map<URI, AttributeValue> resources,
Map<URI, AttributeValue> environment,
... | [
"public",
"RequestCtx",
"buildRequest",
"(",
"List",
"<",
"Map",
"<",
"URI",
",",
"List",
"<",
"AttributeValue",
">",
">",
">",
"subjects",
",",
"Map",
"<",
"URI",
",",
"AttributeValue",
">",
"actions",
",",
"Map",
"<",
"URI",
",",
"AttributeValue",
">",... | Constructs a RequestCtx object.
@param subjects
list of Subjects
@param actions
list of Action attributes
@param resources
list of resource Attributes
@param environment
list of environment Attributes
@return the RequestCtx object
@throws MelcoeXacmlException | [
"Constructs",
"a",
"RequestCtx",
"object",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/util/ContextUtil.java#L250-L275 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.evaluateExpression | public static Object evaluateExpression(Expression expr, CompilerConfiguration config) {
"""
A helper method that can be used to evaluate expressions as found in annotation
parameters. For example, it will evaluate a constant, be it referenced directly as
an integer or as a reference to a field.
<p>
If this me... | java | public static Object evaluateExpression(Expression expr, CompilerConfiguration config) {
String className = "Expression$" + UUID.randomUUID().toString().replace('-', '$');
ClassNode node = new ClassNode(className, Opcodes.ACC_PUBLIC, OBJECT_TYPE);
ReturnStatement code = new ReturnStatement(expr)... | [
"public",
"static",
"Object",
"evaluateExpression",
"(",
"Expression",
"expr",
",",
"CompilerConfiguration",
"config",
")",
"{",
"String",
"className",
"=",
"\"Expression$\"",
"+",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
".",
"replace",
... | A helper method that can be used to evaluate expressions as found in annotation
parameters. For example, it will evaluate a constant, be it referenced directly as
an integer or as a reference to a field.
<p>
If this method throws an exception, then the expression cannot be evaluated on its own.
@param expr the expre... | [
"A",
"helper",
"method",
"that",
"can",
"be",
"used",
"to",
"evaluate",
"expressions",
"as",
"found",
"in",
"annotation",
"parameters",
".",
"For",
"example",
"it",
"will",
"evaluate",
"a",
"constant",
"be",
"it",
"referenced",
"directly",
"as",
"an",
"integ... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L2470-L2487 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.lastIndexOf | public static int lastIndexOf(final CharSequence seq, final int searchChar) {
"""
Returns the index within <code>seq</code> of the last occurrence of
the specified character. For values of <code>searchChar</code> in the
range from 0 to 0xFFFF (inclusive), the index (in Unicode code
units) returned is the larges... | java | public static int lastIndexOf(final CharSequence seq, final int searchChar) {
if (isEmpty(seq)) {
return INDEX_NOT_FOUND;
}
return CharSequenceUtils.lastIndexOf(seq, searchChar, seq.length());
} | [
"public",
"static",
"int",
"lastIndexOf",
"(",
"final",
"CharSequence",
"seq",
",",
"final",
"int",
"searchChar",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"seq",
")",
")",
"{",
"return",
"INDEX_NOT_FOUND",
";",
"}",
"return",
"CharSequenceUtils",
".",
"lastIndex... | Returns the index within <code>seq</code> of the last occurrence of
the specified character. For values of <code>searchChar</code> in the
range from 0 to 0xFFFF (inclusive), the index (in Unicode code
units) returned is the largest value <i>k</i> such that:
<blockquote><pre>
this.charAt(<i>k</i>) == searchChar
</pre></... | [
"Returns",
"the",
"index",
"within",
"<code",
">",
"seq<",
"/",
"code",
">",
"of",
"the",
"last",
"occurrence",
"of",
"the",
"specified",
"character",
".",
"For",
"values",
"of",
"<code",
">",
"searchChar<",
"/",
"code",
">",
"in",
"the",
"range",
"from"... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L1675-L1680 |
hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/model/HttpFields.java | HttpFields.putLongField | public void putLongField(HttpHeader name, long value) {
"""
Sets the value of an long field.
@param name the field name
@param value the field long value
"""
String v = Long.toString(value);
put(name, v);
} | java | public void putLongField(HttpHeader name, long value) {
String v = Long.toString(value);
put(name, v);
} | [
"public",
"void",
"putLongField",
"(",
"HttpHeader",
"name",
",",
"long",
"value",
")",
"{",
"String",
"v",
"=",
"Long",
".",
"toString",
"(",
"value",
")",
";",
"put",
"(",
"name",
",",
"v",
")",
";",
"}"
] | Sets the value of an long field.
@param name the field name
@param value the field long value | [
"Sets",
"the",
"value",
"of",
"an",
"long",
"field",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/model/HttpFields.java#L651-L654 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Pixel.java | Pixel.argb_fromNormalized | public static final int argb_fromNormalized(final double a, final double r, final double g, final double b) {
"""
Packs normalized ARGB color components (values in [0.0 .. 1.0]) into a
single 32bit integer value.
Component values less than 0 or greater than 1 are clamped to fit the range.
@param a alpha
@param... | java | public static final int argb_fromNormalized(final double a, final double r, final double g, final double b){
return argb_bounded((int)Math.round(a*0xff), (int)Math.round(r*0xff), (int)Math.round(g*0xff), (int)Math.round(b*0xff));
} | [
"public",
"static",
"final",
"int",
"argb_fromNormalized",
"(",
"final",
"double",
"a",
",",
"final",
"double",
"r",
",",
"final",
"double",
"g",
",",
"final",
"double",
"b",
")",
"{",
"return",
"argb_bounded",
"(",
"(",
"int",
")",
"Math",
".",
"round",... | Packs normalized ARGB color components (values in [0.0 .. 1.0]) into a
single 32bit integer value.
Component values less than 0 or greater than 1 are clamped to fit the range.
@param a alpha
@param r red
@param g green
@param b blue
@return packed ARGB value
@see #rgb_fromNormalized(double, double, double)
@see #argb(... | [
"Packs",
"normalized",
"ARGB",
"color",
"components",
"(",
"values",
"in",
"[",
"0",
".",
"0",
"..",
"1",
".",
"0",
"]",
")",
"into",
"a",
"single",
"32bit",
"integer",
"value",
".",
"Component",
"values",
"less",
"than",
"0",
"or",
"greater",
"than",
... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Pixel.java#L792-L794 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/corpus/processing/ProcessorContext.java | ProcessorContext.getString | public String getString(String name, String defaultValue) {
"""
Gets string.
@param name the name
@param defaultValue the default value
@return the string
"""
return getAs(name, String.class, defaultValue);
} | java | public String getString(String name, String defaultValue) {
return getAs(name, String.class, defaultValue);
} | [
"public",
"String",
"getString",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"return",
"getAs",
"(",
"name",
",",
"String",
".",
"class",
",",
"defaultValue",
")",
";",
"}"
] | Gets string.
@param name the name
@param defaultValue the default value
@return the string | [
"Gets",
"string",
"."
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/corpus/processing/ProcessorContext.java#L152-L154 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.createWithServiceResponseAsync | public Observable<ServiceResponse<Person>> createWithServiceResponseAsync(String personGroupId, CreatePersonGroupPersonsOptionalParameter createOptionalParameter) {
"""
Create a new person in a specified person group.
@param personGroupId Id referencing a particular person group.
@param createOptionalParameter... | java | public Observable<ServiceResponse<Person>> createWithServiceResponseAsync(String personGroupId, CreatePersonGroupPersonsOptionalParameter createOptionalParameter) {
if (this.client.azureRegion() == null) {
throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Person",
">",
">",
"createWithServiceResponseAsync",
"(",
"String",
"personGroupId",
",",
"CreatePersonGroupPersonsOptionalParameter",
"createOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"client",
".",
"azur... | Create a new person in a specified person group.
@param personGroupId Id referencing a particular person group.
@param createOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observab... | [
"Create",
"a",
"new",
"person",
"in",
"a",
"specified",
"person",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L172-L183 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.removeChatRoomMembers | public ResponseWrapper removeChatRoomMembers(long roomId, String... members)
throws APIConnectionException, APIRequestException {
"""
remove members from chat room
@param roomId chat room id
@param members username array
@return No content
@throws APIConnectionException connect exception
@throw... | java | public ResponseWrapper removeChatRoomMembers(long roomId, String... members)
throws APIConnectionException, APIRequestException {
return _chatRoomClient.removeChatRoomMembers(roomId, members);
} | [
"public",
"ResponseWrapper",
"removeChatRoomMembers",
"(",
"long",
"roomId",
",",
"String",
"...",
"members",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_chatRoomClient",
".",
"removeChatRoomMembers",
"(",
"roomId",
",",
"member... | remove members from chat room
@param roomId chat room id
@param members username array
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"remove",
"members",
"from",
"chat",
"room"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L918-L921 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/SubscriptionsApi.java | SubscriptionsApi.getAllSubscriptions | public SubscriptionsEnvelope getAllSubscriptions(String uid, Integer offset, Integer count) throws ApiException {
"""
Get All Subscriptions
Get All Subscriptions
@param uid User ID (optional)
@param offset Offset for pagination. (optional)
@param count Desired count of items in the result set. (optional)
@ret... | java | public SubscriptionsEnvelope getAllSubscriptions(String uid, Integer offset, Integer count) throws ApiException {
ApiResponse<SubscriptionsEnvelope> resp = getAllSubscriptionsWithHttpInfo(uid, offset, count);
return resp.getData();
} | [
"public",
"SubscriptionsEnvelope",
"getAllSubscriptions",
"(",
"String",
"uid",
",",
"Integer",
"offset",
",",
"Integer",
"count",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"SubscriptionsEnvelope",
">",
"resp",
"=",
"getAllSubscriptionsWithHttpInfo",
"(",
... | Get All Subscriptions
Get All Subscriptions
@param uid User ID (optional)
@param offset Offset for pagination. (optional)
@param count Desired count of items in the result set. (optional)
@return SubscriptionsEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response bod... | [
"Get",
"All",
"Subscriptions",
"Get",
"All",
"Subscriptions"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/SubscriptionsApi.java#L367-L370 |
epam/parso | src/main/java/com/epam/parso/impl/CSVDataWriterImpl.java | CSVDataWriterImpl.writeRowsArray | @Override
public void writeRowsArray(List<Column> columns, Object[][] rows) throws IOException {
"""
The method to export a parsed sas7bdat file (stored as an object of the {@link SasFileReaderImpl} class)
using {@link CSVDataWriterImpl#writer}.
@param columns the {@link Column} class variables list that s... | java | @Override
public void writeRowsArray(List<Column> columns, Object[][] rows) throws IOException {
for (Object[] currentRow : rows) {
if (currentRow != null) {
writeRow(columns, currentRow);
} else {
break;
}
}
} | [
"@",
"Override",
"public",
"void",
"writeRowsArray",
"(",
"List",
"<",
"Column",
">",
"columns",
",",
"Object",
"[",
"]",
"[",
"]",
"rows",
")",
"throws",
"IOException",
"{",
"for",
"(",
"Object",
"[",
"]",
"currentRow",
":",
"rows",
")",
"{",
"if",
... | The method to export a parsed sas7bdat file (stored as an object of the {@link SasFileReaderImpl} class)
using {@link CSVDataWriterImpl#writer}.
@param columns the {@link Column} class variables list that stores columns description from the sas7bdat file.
@param rows the Objects arrays array that stores data from t... | [
"The",
"method",
"to",
"export",
"a",
"parsed",
"sas7bdat",
"file",
"(",
"stored",
"as",
"an",
"object",
"of",
"the",
"{",
"@link",
"SasFileReaderImpl",
"}",
"class",
")",
"using",
"{",
"@link",
"CSVDataWriterImpl#writer",
"}",
"."
] | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/CSVDataWriterImpl.java#L121-L130 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/kiteconnect/KiteConnect.java | KiteConnect.modifyMFSIP | public boolean modifyMFSIP(String frequency, int day, int instalments, double amount, String status, String sipId) throws KiteException, IOException, JSONException {
"""
Modify a mutualfunds sip.
@param frequency weekly, monthly, or quarterly.
@param status Pause or unpause an SIP (active or paused).
@param amo... | java | public boolean modifyMFSIP(String frequency, int day, int instalments, double amount, String status, String sipId) throws KiteException, IOException, JSONException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("frequency", frequency);
params.put("day", day);
pa... | [
"public",
"boolean",
"modifyMFSIP",
"(",
"String",
"frequency",
",",
"int",
"day",
",",
"int",
"instalments",
",",
"double",
"amount",
",",
"String",
"status",
",",
"String",
"sipId",
")",
"throws",
"KiteException",
",",
"IOException",
",",
"JSONException",
"{... | Modify a mutualfunds sip.
@param frequency weekly, monthly, or quarterly.
@param status Pause or unpause an SIP (active or paused).
@param amount Amount worth of units to purchase. It should be equal to or greated than minimum_additional_purchase_amount and in multiple of purchase_amount_multiplier in the instrument ma... | [
"Modify",
"a",
"mutualfunds",
"sip",
"."
] | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/kiteconnect/KiteConnect.java#L713-L723 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java | CommonOps_DSCC.scale | public static void scale(double scalar, DMatrixSparseCSC A, DMatrixSparseCSC B) {
"""
B = scalar*A. A and B can be the same instance.
@param scalar (Input) Scalar value
@param A (Input) Matrix. Not modified.
@param B (Output) Matrix. Modified.
"""
if( A != B ) {
B.copyStructure(A);
... | java | public static void scale(double scalar, DMatrixSparseCSC A, DMatrixSparseCSC B) {
if( A != B ) {
B.copyStructure(A);
for(int i = 0; i < A.nz_length; i++ ) {
B.nz_values[i] = A.nz_values[i]*scalar;
}
} else {
for(int i = 0; i < A.nz_length;... | [
"public",
"static",
"void",
"scale",
"(",
"double",
"scalar",
",",
"DMatrixSparseCSC",
"A",
",",
"DMatrixSparseCSC",
"B",
")",
"{",
"if",
"(",
"A",
"!=",
"B",
")",
"{",
"B",
".",
"copyStructure",
"(",
"A",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0"... | B = scalar*A. A and B can be the same instance.
@param scalar (Input) Scalar value
@param A (Input) Matrix. Not modified.
@param B (Output) Matrix. Modified. | [
"B",
"=",
"scalar",
"*",
"A",
".",
"A",
"and",
"B",
"can",
"be",
"the",
"same",
"instance",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java#L384-L396 |
Netflix/conductor | redis-persistence/src/main/java/com/netflix/conductor/jedis/JedisMock.java | JedisMock.zcount | @Override public Long zcount(final String key, final double min, final double max) {
"""
/*
public List<String> sort(final String key) {
checkIsInMulti();
client.sort(key);
return client.getMultiBulkReply();
}
public List<String> sort(final String key, final SortingParams sortingParameters) {
checkIsInMul... | java | @Override public Long zcount(final String key, final double min, final double max) {
try {
return redis.zcount(key, min, max);
}
catch (Exception e) {
throw new JedisException(e);
}
} | [
"@",
"Override",
"public",
"Long",
"zcount",
"(",
"final",
"String",
"key",
",",
"final",
"double",
"min",
",",
"final",
"double",
"max",
")",
"{",
"try",
"{",
"return",
"redis",
".",
"zcount",
"(",
"key",
",",
"min",
",",
"max",
")",
";",
"}",
"ca... | /*
public List<String> sort(final String key) {
checkIsInMulti();
client.sort(key);
return client.getMultiBulkReply();
}
public List<String> sort(final String key, final SortingParams sortingParameters) {
checkIsInMulti();
client.sort(key, sortingParameters);
return client.getMultiBulkReply();
}
public List<String> b... | [
"/",
"*",
"public",
"List<String",
">",
"sort",
"(",
"final",
"String",
"key",
")",
"{",
"checkIsInMulti",
"()",
";",
"client",
".",
"sort",
"(",
"key",
")",
";",
"return",
"client",
".",
"getMultiBulkReply",
"()",
";",
"}"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/redis-persistence/src/main/java/com/netflix/conductor/jedis/JedisMock.java#L964-L971 |
alipay/sofa-rpc | core/common/src/main/java/com/alipay/sofa/rpc/common/utils/BeanUtils.java | BeanUtils.setProperty | public static <T> void setProperty(Object bean, String name, Class<T> clazz, T value) throws Exception {
"""
设置属性
@param bean 对象
@param name 属性名
@param clazz 设置值的类
@param value 属性值
@param <T> 和值对应的类型
@throws Exception 设值异常
"""
Method method = ReflectUtils.getPropertySetterMethod(bean.getCla... | java | public static <T> void setProperty(Object bean, String name, Class<T> clazz, T value) throws Exception {
Method method = ReflectUtils.getPropertySetterMethod(bean.getClass(), name, clazz);
if (method.isAccessible()) {
method.invoke(bean, value);
} else {
try {
... | [
"public",
"static",
"<",
"T",
">",
"void",
"setProperty",
"(",
"Object",
"bean",
",",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"T",
"value",
")",
"throws",
"Exception",
"{",
"Method",
"method",
"=",
"ReflectUtils",
".",
"getPropertySe... | 设置属性
@param bean 对象
@param name 属性名
@param clazz 设置值的类
@param value 属性值
@param <T> 和值对应的类型
@throws Exception 设值异常 | [
"设置属性"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/utils/BeanUtils.java#L47-L59 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java | AbstractMemberWriter.addNavDetailLink | protected void addNavDetailLink(List<?> members, Content liNav) {
"""
Add the navigation detail link.
@param members the members to be linked
@param liNav the content tree to which the navigation detail link will be added
"""
addNavDetailLink(members.size() > 0 ? true : false, liNav);
} | java | protected void addNavDetailLink(List<?> members, Content liNav) {
addNavDetailLink(members.size() > 0 ? true : false, liNav);
} | [
"protected",
"void",
"addNavDetailLink",
"(",
"List",
"<",
"?",
">",
"members",
",",
"Content",
"liNav",
")",
"{",
"addNavDetailLink",
"(",
"members",
".",
"size",
"(",
")",
">",
"0",
"?",
"true",
":",
"false",
",",
"liNav",
")",
";",
"}"
] | Add the navigation detail link.
@param members the members to be linked
@param liNav the content tree to which the navigation detail link will be added | [
"Add",
"the",
"navigation",
"detail",
"link",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java#L512-L514 |
twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/util/BackoffHelper.java | BackoffHelper.doUntilResult | public <T, E extends Exception> T doUntilResult(ExceptionalSupplier<T, E> task)
throws InterruptedException, BackoffStoppedException, E {
"""
Executes the given task using the configured backoff strategy until the task succeeds as
indicated by returning a non-null value.
@param task the retryable task to... | java | public <T, E extends Exception> T doUntilResult(ExceptionalSupplier<T, E> task)
throws InterruptedException, BackoffStoppedException, E {
T result = task.get(); // give an immediate try
return (result != null) ? result : retryWork(task);
} | [
"public",
"<",
"T",
",",
"E",
"extends",
"Exception",
">",
"T",
"doUntilResult",
"(",
"ExceptionalSupplier",
"<",
"T",
",",
"E",
">",
"task",
")",
"throws",
"InterruptedException",
",",
"BackoffStoppedException",
",",
"E",
"{",
"T",
"result",
"=",
"task",
... | Executes the given task using the configured backoff strategy until the task succeeds as
indicated by returning a non-null value.
@param task the retryable task to execute until success
@return the result of the successfully executed task
@throws InterruptedException if interrupted while waiting for the task to execut... | [
"Executes",
"the",
"given",
"task",
"using",
"the",
"configured",
"backoff",
"strategy",
"until",
"the",
"task",
"succeeds",
"as",
"indicated",
"by",
"returning",
"a",
"non",
"-",
"null",
"value",
"."
] | train | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/util/BackoffHelper.java#L118-L122 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_ips_ip_DELETE | public void serviceName_ips_ip_DELETE(String serviceName, String ip) throws IOException {
"""
Stop renewing this extra IPv4 option
REST: DELETE /xdsl/{serviceName}/ips/{ip}
@param serviceName [required] The internal name of your XDSL offer
@param ip [required] The IP address
"""
String qPath = "/xdsl/{s... | java | public void serviceName_ips_ip_DELETE(String serviceName, String ip) throws IOException {
String qPath = "/xdsl/{serviceName}/ips/{ip}";
StringBuilder sb = path(qPath, serviceName, ip);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_ips_ip_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/ips/{ip}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"serviceName"... | Stop renewing this extra IPv4 option
REST: DELETE /xdsl/{serviceName}/ips/{ip}
@param serviceName [required] The internal name of your XDSL offer
@param ip [required] The IP address | [
"Stop",
"renewing",
"this",
"extra",
"IPv4",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1481-L1485 |
anotheria/configureme | src/main/java/org/configureme/sources/ConfigurationSourceKey.java | ConfigurationSourceKey.setTypeIfNotDefault | public void setTypeIfNotDefault(final Type defType, final Type toChange) {
"""
<p>setTypeIfNotDefault.</p>
@param defType a {@link org.configureme.sources.ConfigurationSourceKey.Type} object.
@param toChange a {@link org.configureme.sources.ConfigurationSourceKey.Type} object.
"""
this.type = defType != ... | java | public void setTypeIfNotDefault(final Type defType, final Type toChange){
this.type = defType != Type.FILE ? defType : toChange;
} | [
"public",
"void",
"setTypeIfNotDefault",
"(",
"final",
"Type",
"defType",
",",
"final",
"Type",
"toChange",
")",
"{",
"this",
".",
"type",
"=",
"defType",
"!=",
"Type",
".",
"FILE",
"?",
"defType",
":",
"toChange",
";",
"}"
] | <p>setTypeIfNotDefault.</p>
@param defType a {@link org.configureme.sources.ConfigurationSourceKey.Type} object.
@param toChange a {@link org.configureme.sources.ConfigurationSourceKey.Type} object. | [
"<p",
">",
"setTypeIfNotDefault",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/sources/ConfigurationSourceKey.java#L120-L122 |
Falydoor/limesurvey-rc | src/main/java/com/github/falydoor/limesurveyrc/LimesurveyRC.java | LimesurveyRC.getSessionKey | public String getSessionKey() throws LimesurveyRCException {
"""
Gets the current session key.
@return the session key
@throws LimesurveyRCException the limesurvey rc exception
"""
// Use the saved key if isn't expired
if (!key.isEmpty() && ZonedDateTime.now().isBefore(keyExpiration)) {
... | java | public String getSessionKey() throws LimesurveyRCException {
// Use the saved key if isn't expired
if (!key.isEmpty() && ZonedDateTime.now().isBefore(keyExpiration)) {
return key;
}
// Get session key and save it with an expiration set to 1 minute before the expiration date
... | [
"public",
"String",
"getSessionKey",
"(",
")",
"throws",
"LimesurveyRCException",
"{",
"// Use the saved key if isn't expired",
"if",
"(",
"!",
"key",
".",
"isEmpty",
"(",
")",
"&&",
"ZonedDateTime",
".",
"now",
"(",
")",
".",
"isBefore",
"(",
"keyExpiration",
"... | Gets the current session key.
@return the session key
@throws LimesurveyRCException the limesurvey rc exception | [
"Gets",
"the",
"current",
"session",
"key",
"."
] | train | https://github.com/Falydoor/limesurvey-rc/blob/b8d573389086395e46a0bdeeddeef4d1c2c0a488/src/main/java/com/github/falydoor/limesurveyrc/LimesurveyRC.java#L358-L373 |
whizzosoftware/WZWave | src/main/java/com/whizzosoftware/wzwave/commandclass/CommandClass.java | CommandClass.createSendDataFrame | static protected DataFrame createSendDataFrame(String name, byte nodeId, byte[] data, boolean isResponseExpected) {
"""
Convenience method for creating SendData frames
@param name the name for logging purposes
@param nodeId the destination node ID
@param data the data portion of the SendData frame
@param isR... | java | static protected DataFrame createSendDataFrame(String name, byte nodeId, byte[] data, boolean isResponseExpected) {
return new SendData(name, nodeId, data, (byte)(SendData.TRANSMIT_OPTION_ACK | SendData.TRANSMIT_OPTION_AUTO_ROUTE), isResponseExpected);
} | [
"static",
"protected",
"DataFrame",
"createSendDataFrame",
"(",
"String",
"name",
",",
"byte",
"nodeId",
",",
"byte",
"[",
"]",
"data",
",",
"boolean",
"isResponseExpected",
")",
"{",
"return",
"new",
"SendData",
"(",
"name",
",",
"nodeId",
",",
"data",
",",... | Convenience method for creating SendData frames
@param name the name for logging purposes
@param nodeId the destination node ID
@param data the data portion of the SendData frame
@param isResponseExpected indicates whether sending this data frame should require a response
@return a DataFrame instance | [
"Convenience",
"method",
"for",
"creating",
"SendData",
"frames"
] | train | https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/commandclass/CommandClass.java#L136-L138 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/BaseQueryRequest.java | BaseQueryRequest.addPositionalBindings | public void addPositionalBindings(Object first, Object... others) {
"""
Adds the positional bindings that are needed for any positional parameters in the GQL query.
@param first
the first positional binding
@param others
subsequent positional bindings, if any
"""
positionalBindings.add(first);
po... | java | public void addPositionalBindings(Object first, Object... others) {
positionalBindings.add(first);
positionalBindings.addAll(Arrays.asList(others));
} | [
"public",
"void",
"addPositionalBindings",
"(",
"Object",
"first",
",",
"Object",
"...",
"others",
")",
"{",
"positionalBindings",
".",
"add",
"(",
"first",
")",
";",
"positionalBindings",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"others",
")",
")",... | Adds the positional bindings that are needed for any positional parameters in the GQL query.
@param first
the first positional binding
@param others
subsequent positional bindings, if any | [
"Adds",
"the",
"positional",
"bindings",
"that",
"are",
"needed",
"for",
"any",
"positional",
"parameters",
"in",
"the",
"GQL",
"query",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/BaseQueryRequest.java#L152-L155 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/db/ResultSetUtility.java | ResultSetUtility.convertAllToMaps | public List<Map<String, Object>> convertAllToMaps(ResultSet rs) throws SQLException {
"""
Convert all rows of the ResultSet to a Map. The keys of the Map are property names transformed from column names.
@param rs the result set
@return A list of Map representations of all the rows in the result set
@throws SQL... | java | public List<Map<String, Object>> convertAllToMaps(ResultSet rs) throws SQLException{
return convertAllToMaps(rs, null);
} | [
"public",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"convertAllToMaps",
"(",
"ResultSet",
"rs",
")",
"throws",
"SQLException",
"{",
"return",
"convertAllToMaps",
"(",
"rs",
",",
"null",
")",
";",
"}"
] | Convert all rows of the ResultSet to a Map. The keys of the Map are property names transformed from column names.
@param rs the result set
@return A list of Map representations of all the rows in the result set
@throws SQLException | [
"Convert",
"all",
"rows",
"of",
"the",
"ResultSet",
"to",
"a",
"Map",
".",
"The",
"keys",
"of",
"the",
"Map",
"are",
"property",
"names",
"transformed",
"from",
"column",
"names",
"."
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/ResultSetUtility.java#L92-L94 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java | ClassesManager.areMappedObjects | public static boolean areMappedObjects(Class<?> dClass,Class<?> sClass,XML xml) {
"""
returns true if almost one class is configured, false otherwise.
@param dClass class to verify
@param sClass class to verify
@param xml xml to check
@return true if almost one class is configured, false otherwise.
"""
... | java | public static boolean areMappedObjects(Class<?> dClass,Class<?> sClass,XML xml){
return isMapped(dClass,xml) || isMapped(sClass,xml);
} | [
"public",
"static",
"boolean",
"areMappedObjects",
"(",
"Class",
"<",
"?",
">",
"dClass",
",",
"Class",
"<",
"?",
">",
"sClass",
",",
"XML",
"xml",
")",
"{",
"return",
"isMapped",
"(",
"dClass",
",",
"xml",
")",
"||",
"isMapped",
"(",
"sClass",
",",
... | returns true if almost one class is configured, false otherwise.
@param dClass class to verify
@param sClass class to verify
@param xml xml to check
@return true if almost one class is configured, false otherwise. | [
"returns",
"true",
"if",
"almost",
"one",
"class",
"is",
"configured",
"false",
"otherwise",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java#L428-L430 |
audit4j/audit4j-db | src/main/java/org/audit4j/handler/db/ConnectionFactory.java | ConnectionFactory.getDataSourceConnection | Connection getDataSourceConnection() {
"""
Gets the data source connection.
@return the data source connection
@since 2.4.0
"""
Connection connection = null;
try {
connection = dataSource.getConnection();
} catch (SQLException ex) {
throw new InitializationEx... | java | Connection getDataSourceConnection() {
Connection connection = null;
try {
connection = dataSource.getConnection();
} catch (SQLException ex) {
throw new InitializationException("Could not obtain the db connection: Cannot get connection", ex);
}
return con... | [
"Connection",
"getDataSourceConnection",
"(",
")",
"{",
"Connection",
"connection",
"=",
"null",
";",
"try",
"{",
"connection",
"=",
"dataSource",
".",
"getConnection",
"(",
")",
";",
"}",
"catch",
"(",
"SQLException",
"ex",
")",
"{",
"throw",
"new",
"Initia... | Gets the data source connection.
@return the data source connection
@since 2.4.0 | [
"Gets",
"the",
"data",
"source",
"connection",
"."
] | train | https://github.com/audit4j/audit4j-db/blob/bba822a5722533e6f465a9784f2353ae2e5bc01d/src/main/java/org/audit4j/handler/db/ConnectionFactory.java#L143-L151 |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.updateBaseTile | public void updateBaseTile (int fqTileId, int tx, int ty) {
"""
Informs this scene block that the specified base tile has been
changed.
"""
String errmsg = null;
int tidx = index(tx, ty);
// this is a bit magical: we pass the fully qualified tile id to
// the tile manager whic... | java | public void updateBaseTile (int fqTileId, int tx, int ty)
{
String errmsg = null;
int tidx = index(tx, ty);
// this is a bit magical: we pass the fully qualified tile id to
// the tile manager which loads up from the configured tileset
// repository the appropriate tileset (... | [
"public",
"void",
"updateBaseTile",
"(",
"int",
"fqTileId",
",",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"String",
"errmsg",
"=",
"null",
";",
"int",
"tidx",
"=",
"index",
"(",
"tx",
",",
"ty",
")",
";",
"// this is a bit magical: we pass the fully qualifie... | Informs this scene block that the specified base tile has been
changed. | [
"Informs",
"this",
"scene",
"block",
"that",
"the",
"specified",
"base",
"tile",
"has",
"been",
"changed",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L311-L340 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/perceptron/model/LinearModel.java | LinearModel.save | public void save(String modelFile, Set<Map.Entry<String, Integer>> featureIdSet, final double ratio, boolean text) throws IOException {
"""
保存
@param modelFile 路径
@param featureIdSet 特征集(有些数据结构不支持遍历,可以提供构造时用到的特征集来规避这个缺陷)
@param ratio 压缩比
@param text 是否输出文本以供调试
@throws IOException
"""
... | java | public void save(String modelFile, Set<Map.Entry<String, Integer>> featureIdSet, final double ratio, boolean text) throws IOException
{
float[] parameter = this.parameter;
this.compress(ratio, 1e-3f);
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(IOUtil.newOutputStrea... | [
"public",
"void",
"save",
"(",
"String",
"modelFile",
",",
"Set",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Integer",
">",
">",
"featureIdSet",
",",
"final",
"double",
"ratio",
",",
"boolean",
"text",
")",
"throws",
"IOException",
"{",
"float",
"[",... | 保存
@param modelFile 路径
@param featureIdSet 特征集(有些数据结构不支持遍历,可以提供构造时用到的特征集来规避这个缺陷)
@param ratio 压缩比
@param text 是否输出文本以供调试
@throws IOException | [
"保存"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/model/LinearModel.java#L193-L226 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java | RegisterUtils.getALoadReg | public static int getALoadReg(DismantleBytecode dbc, int seen) {
"""
returns the register used to load a reference
@param dbc
the dismantle byte code parsing the class
@param seen
the opcode of the load
@return the register loaded from
"""
if (seen == Const.ALOAD) {
return dbc.getReg... | java | public static int getALoadReg(DismantleBytecode dbc, int seen) {
if (seen == Const.ALOAD) {
return dbc.getRegisterOperand();
}
if (OpcodeUtils.isALoad(seen)) {
return seen - Const.ALOAD_0;
}
return -1;
} | [
"public",
"static",
"int",
"getALoadReg",
"(",
"DismantleBytecode",
"dbc",
",",
"int",
"seen",
")",
"{",
"if",
"(",
"seen",
"==",
"Const",
".",
"ALOAD",
")",
"{",
"return",
"dbc",
".",
"getRegisterOperand",
"(",
")",
";",
"}",
"if",
"(",
"OpcodeUtils",
... | returns the register used to load a reference
@param dbc
the dismantle byte code parsing the class
@param seen
the opcode of the load
@return the register loaded from | [
"returns",
"the",
"register",
"used",
"to",
"load",
"a",
"reference"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java#L69-L77 |
BioPAX/Paxtools | psimi-converter/src/main/java/org/biopax/paxtools/converter/psi/PsiToBiopax3Converter.java | PsiToBiopax3Converter.convertTab | public void convertTab(InputStream inputStream, OutputStream outputStream,
boolean forceInteractionToComplex) throws IOException, PsimiTabException {
"""
Converts the PSI-MITAB inputStream into BioPAX outputStream.
Streams will be closed by the converter.
@param inputStream psi-mitab
@param outputStream b... | java | public void convertTab(InputStream inputStream, OutputStream outputStream,
boolean forceInteractionToComplex) throws IOException, PsimiTabException {
// check args
if (inputStream == null || outputStream == null) {
throw new IllegalArgumentException("convertTab(): " +
"one or more null arguments.");
... | [
"public",
"void",
"convertTab",
"(",
"InputStream",
"inputStream",
",",
"OutputStream",
"outputStream",
",",
"boolean",
"forceInteractionToComplex",
")",
"throws",
"IOException",
",",
"PsimiTabException",
"{",
"// check args",
"if",
"(",
"inputStream",
"==",
"null",
"... | Converts the PSI-MITAB inputStream into BioPAX outputStream.
Streams will be closed by the converter.
@param inputStream psi-mitab
@param outputStream biopax
@param forceInteractionToComplex - always generate Complex instead of MolecularInteraction
@throws IOException when an I/O error occur
@throws PsimiTabException... | [
"Converts",
"the",
"PSI",
"-",
"MITAB",
"inputStream",
"into",
"BioPAX",
"outputStream",
".",
"Streams",
"will",
"be",
"closed",
"by",
"the",
"converter",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/psimi-converter/src/main/java/org/biopax/paxtools/converter/psi/PsiToBiopax3Converter.java#L123-L148 |
tango-controls/JTango | server/src/main/java/org/tango/logging/LoggingManager.java | LoggingManager.setLoggingLevel | public void setLoggingLevel(final int loggingLevel, final Class<?>... deviceClassNames) {
"""
Set the level of all loggers of JTangoServer
@param loggingLevel
"""
if (rootLoggingLevel < loggingLevel) {
setRootLoggingLevel(loggingLevel);
}
System.out.println("set logging ... | java | public void setLoggingLevel(final int loggingLevel, final Class<?>... deviceClassNames) {
if (rootLoggingLevel < loggingLevel) {
setRootLoggingLevel(loggingLevel);
}
System.out.println("set logging to " + LoggingLevel.getLevelFromInt(loggingLevel));
final Logger tangoLogger ... | [
"public",
"void",
"setLoggingLevel",
"(",
"final",
"int",
"loggingLevel",
",",
"final",
"Class",
"<",
"?",
">",
"...",
"deviceClassNames",
")",
"{",
"if",
"(",
"rootLoggingLevel",
"<",
"loggingLevel",
")",
"{",
"setRootLoggingLevel",
"(",
"loggingLevel",
")",
... | Set the level of all loggers of JTangoServer
@param loggingLevel | [
"Set",
"the",
"level",
"of",
"all",
"loggers",
"of",
"JTangoServer"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/logging/LoggingManager.java#L142-L166 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/printer/FormulaStringRepresentation.java | FormulaStringRepresentation.binaryOperator | protected String binaryOperator(final BinaryOperator operator, final String opString) {
"""
Returns the string representation of a binary operator.
@param operator the binary operator
@param opString the operator string
@return the string representation
"""
final String leftString = operator.type(... | java | protected String binaryOperator(final BinaryOperator operator, final String opString) {
final String leftString = operator.type().precedence() < operator.left().type().precedence()
? this.toString(operator.left()) : this.bracket(operator.left());
final String rightString = operator.type(... | [
"protected",
"String",
"binaryOperator",
"(",
"final",
"BinaryOperator",
"operator",
",",
"final",
"String",
"opString",
")",
"{",
"final",
"String",
"leftString",
"=",
"operator",
".",
"type",
"(",
")",
".",
"precedence",
"(",
")",
"<",
"operator",
".",
"le... | Returns the string representation of a binary operator.
@param operator the binary operator
@param opString the operator string
@return the string representation | [
"Returns",
"the",
"string",
"representation",
"of",
"a",
"binary",
"operator",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/printer/FormulaStringRepresentation.java#L98-L104 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.addEntry | public Jar addEntry(Path path, Path file) throws IOException {
"""
Adds an entry to this JAR.
@param path the entry's path within the JAR
@param file the file to add as an entry
@return {@code this}
"""
return addEntry(path, Files.newInputStream(file));
} | java | public Jar addEntry(Path path, Path file) throws IOException {
return addEntry(path, Files.newInputStream(file));
} | [
"public",
"Jar",
"addEntry",
"(",
"Path",
"path",
",",
"Path",
"file",
")",
"throws",
"IOException",
"{",
"return",
"addEntry",
"(",
"path",
",",
"Files",
".",
"newInputStream",
"(",
"file",
")",
")",
";",
"}"
] | Adds an entry to this JAR.
@param path the entry's path within the JAR
@param file the file to add as an entry
@return {@code this} | [
"Adds",
"an",
"entry",
"to",
"this",
"JAR",
"."
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L332-L334 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ActivitysInner.java | ActivitysInner.listByModuleAsync | public Observable<Page<ActivityInner>> listByModuleAsync(final String resourceGroupName, final String automationAccountName, final String moduleName) {
"""
Retrieve a list of activities in the module identified by module name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountNa... | java | public Observable<Page<ActivityInner>> listByModuleAsync(final String resourceGroupName, final String automationAccountName, final String moduleName) {
return listByModuleWithServiceResponseAsync(resourceGroupName, automationAccountName, moduleName)
.map(new Func1<ServiceResponse<Page<ActivityInner>... | [
"public",
"Observable",
"<",
"Page",
"<",
"ActivityInner",
">",
">",
"listByModuleAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"automationAccountName",
",",
"final",
"String",
"moduleName",
")",
"{",
"return",
"listByModuleWithServiceRe... | Retrieve a list of activities in the module identified by module name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param moduleName The name of module.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the o... | [
"Retrieve",
"a",
"list",
"of",
"activities",
"in",
"the",
"module",
"identified",
"by",
"module",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ActivitysInner.java#L224-L232 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/zone/ZoneRules.java | ZoneRules.getTransitions | public List<ZoneOffsetTransition> getTransitions() {
"""
Gets the complete list of fully defined transitions.
<p>
The complete set of transitions for this rules instance is defined by this method
and {@link #getTransitionRules()}. This method returns those transitions that have
been fully defined. These are ty... | java | public List<ZoneOffsetTransition> getTransitions() {
List<ZoneOffsetTransition> list = new ArrayList<>();
for (int i = 0; i < savingsInstantTransitions.length; i++) {
list.add(new ZoneOffsetTransition(savingsInstantTransitions[i], wallOffsets[i], wallOffsets[i + 1]));
}
retur... | [
"public",
"List",
"<",
"ZoneOffsetTransition",
">",
"getTransitions",
"(",
")",
"{",
"List",
"<",
"ZoneOffsetTransition",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"savingsInstantTransitions... | Gets the complete list of fully defined transitions.
<p>
The complete set of transitions for this rules instance is defined by this method
and {@link #getTransitionRules()}. This method returns those transitions that have
been fully defined. These are typically historical, but may be in the future.
<p>
The list will be... | [
"Gets",
"the",
"complete",
"list",
"of",
"fully",
"defined",
"transitions",
".",
"<p",
">",
"The",
"complete",
"set",
"of",
"transitions",
"for",
"this",
"rules",
"instance",
"is",
"defined",
"by",
"this",
"method",
"and",
"{",
"@link",
"#getTransitionRules",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/zone/ZoneRules.java#L943-L949 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/management/CronUtils.java | CronUtils.extendRepeating | private static String extendRepeating(String e, String max) {
"""
Converts repeating segments from "short" Quartz form to "extended"
SauronSoftware form. For example "0/5" will be converted to
"0-59/5", "/3" will be converted to "*/3"
@param e Source item
@param m... | java | private static String extendRepeating(String e, String max) {
String[] parts = e.split(",");
for (int i = 0; i < parts.length; ++i) {
if (parts[i].indexOf('-') == -1 && parts[i].indexOf('*') == -1) {
int indSlash = parts[i].indexOf('/');
if (indSlash == 0) {
parts[i] = "*" + parts[i];
} e... | [
"private",
"static",
"String",
"extendRepeating",
"(",
"String",
"e",
",",
"String",
"max",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"e",
".",
"split",
"(",
"\",\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"parts",
".",
"len... | Converts repeating segments from "short" Quartz form to "extended"
SauronSoftware form. For example "0/5" will be converted to
"0-59/5", "/3" will be converted to "*/3"
@param e Source item
@param max Maximal value in this item ("59" for minutes, "23" for hours, etc.)
@retu... | [
"Converts",
"repeating",
"segments",
"from",
"short",
"Quartz",
"form",
"to",
"extended",
"SauronSoftware",
"form",
".",
"For",
"example",
""",
";",
"0",
"/",
"5"",
";",
"will",
"be",
"converted",
"to",
""",
";",
"0",
"-",
"59",
"/",
"5"",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/management/CronUtils.java#L198-L211 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/multi/spatial/rectangleAlgebra/RectangleConstraintSolver.java | RectangleConstraintSolver.drawAlmostCentreRectangle | public String drawAlmostCentreRectangle(long horizon, RectangularRegion ... rect) {
"""
Output a Gnuplot-readable script that draws, for each given
{@link RectangularRegion}, a rectangle which is close to the
"center" of the {@link RectangularRegion}'s domain.
@param horizon The maximum X and Y coordinate to be... | java | public String drawAlmostCentreRectangle(long horizon, RectangularRegion ... rect){
String ret = "";
int j = 1;
ret = "set xrange [0:" + horizon +"]"+ "\n";
ret += "set yrange [0:" + horizon +"]" + "\n";
for (int i = 0; i < rect.length; i++) {
//rec
ret += "set obj " + j + " rect from " + extract... | [
"public",
"String",
"drawAlmostCentreRectangle",
"(",
"long",
"horizon",
",",
"RectangularRegion",
"...",
"rect",
")",
"{",
"String",
"ret",
"=",
"\"\"",
";",
"int",
"j",
"=",
"1",
";",
"ret",
"=",
"\"set xrange [0:\"",
"+",
"horizon",
"+",
"\"]\"",
"+",
"... | Output a Gnuplot-readable script that draws, for each given
{@link RectangularRegion}, a rectangle which is close to the
"center" of the {@link RectangularRegion}'s domain.
@param horizon The maximum X and Y coordinate to be used in the plot.
@param rect The set of {@link RectangularRegion}s to draw.
@return A Gnuplot ... | [
"Output",
"a",
"Gnuplot",
"-",
"readable",
"script",
"that",
"draws",
"for",
"each",
"given",
"{"
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/multi/spatial/rectangleAlgebra/RectangleConstraintSolver.java#L112-L131 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/compiler/SemanticServiceImpl.java | SemanticServiceImpl.pruneStatement | private void pruneStatement(final Statement stmt, final Document doc) {
"""
Prunes the provided {@link Statement statement} from the {@link Document document}.
"""
final List<StatementGroup> stmtgroups = doc.getAllStatementGroups();
for (final StatementGroup stmtgroup : stmtgroups) {
... | java | private void pruneStatement(final Statement stmt, final Document doc) {
final List<StatementGroup> stmtgroups = doc.getAllStatementGroups();
for (final StatementGroup stmtgroup : stmtgroups) {
final Iterator<Statement> sgi = stmtgroup.getStatements()
.iterator();
... | [
"private",
"void",
"pruneStatement",
"(",
"final",
"Statement",
"stmt",
",",
"final",
"Document",
"doc",
")",
"{",
"final",
"List",
"<",
"StatementGroup",
">",
"stmtgroups",
"=",
"doc",
".",
"getAllStatementGroups",
"(",
")",
";",
"for",
"(",
"final",
"State... | Prunes the provided {@link Statement statement} from the {@link Document document}. | [
"Prunes",
"the",
"provided",
"{"
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/compiler/SemanticServiceImpl.java#L320-L334 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/PipelineApi.java | PipelineApi.getPipeline | public Pipeline getPipeline(Object projectIdOrPath, int pipelineId) throws GitLabApiException {
"""
Get single pipelines in a project.
<pre><code>GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project i... | java | public Pipeline getPipeline(Object projectIdOrPath, int pipelineId) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "pipelines", pipelineId);
return (response.readEntity(Pipeline.class));
} | [
"public",
"Pipeline",
"getPipeline",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"pipelineId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"projects\"",
",",
"ge... | Get single pipelines in a project.
<pre><code>GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param pipelineId the pipeline ID to get
@return a single pipelines for the specified project ID
@thr... | [
"Get",
"single",
"pipelines",
"in",
"a",
"project",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/PipelineApi.java#L213-L216 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsSerializers.java | HalFormsSerializers.validate | private static void validate(RepresentationModel<?> resource, HalFormsAffordanceModel model) {
"""
Verify that the resource's self link and the affordance's URI have the same relative path.
@param resource
@param model
"""
String affordanceUri = model.getURI();
String selfLinkUri = resource.getRequire... | java | private static void validate(RepresentationModel<?> resource, HalFormsAffordanceModel model) {
String affordanceUri = model.getURI();
String selfLinkUri = resource.getRequiredLink(IanaLinkRelations.SELF.value()).expand().getHref();
if (!affordanceUri.equals(selfLinkUri)) {
throw new IllegalStateException("Af... | [
"private",
"static",
"void",
"validate",
"(",
"RepresentationModel",
"<",
"?",
">",
"resource",
",",
"HalFormsAffordanceModel",
"model",
")",
"{",
"String",
"affordanceUri",
"=",
"model",
".",
"getURI",
"(",
")",
";",
"String",
"selfLinkUri",
"=",
"resource",
... | Verify that the resource's self link and the affordance's URI have the same relative path.
@param resource
@param model | [
"Verify",
"that",
"the",
"resource",
"s",
"self",
"link",
"and",
"the",
"affordance",
"s",
"URI",
"have",
"the",
"same",
"relative",
"path",
"."
] | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsSerializers.java#L289-L298 |
TimeAndSpaceIO/SmoothieMap | src/main/java/net/openhft/smoothie/SmoothieMap.java | SmoothieMap.removeIf | public final boolean removeIf(BiPredicate<? super K, ? super V> filter) {
"""
Removes all of the entries of this map that satisfy the given predicate. Errors or runtime
exceptions thrown during iteration or by the predicate are relayed to the caller.
<p>Note the order in which this method visits entries is <i>... | java | public final boolean removeIf(BiPredicate<? super K, ? super V> filter) {
Objects.requireNonNull(filter);
if (isEmpty())
return false;
Segment<K, V> segment;
int mc = this.modCount;
int initialModCount = mc;
for (long segmentIndex = 0; segmentIndex >= 0;
... | [
"public",
"final",
"boolean",
"removeIf",
"(",
"BiPredicate",
"<",
"?",
"super",
"K",
",",
"?",
"super",
"V",
">",
"filter",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"filter",
")",
";",
"if",
"(",
"isEmpty",
"(",
")",
")",
"return",
"false",
... | Removes all of the entries of this map that satisfy the given predicate. Errors or runtime
exceptions thrown during iteration or by the predicate are relayed to the caller.
<p>Note the order in which this method visits entries is <i>different</i> from the iteration
and {@link #forEach(BiConsumer)} order.
@param filte... | [
"Removes",
"all",
"of",
"the",
"entries",
"of",
"this",
"map",
"that",
"satisfy",
"the",
"given",
"predicate",
".",
"Errors",
"or",
"runtime",
"exceptions",
"thrown",
"during",
"iteration",
"or",
"by",
"the",
"predicate",
"are",
"relayed",
"to",
"the",
"call... | train | https://github.com/TimeAndSpaceIO/SmoothieMap/blob/c798f6cae1d377f6913e8821a1fcf5bf45ee0412/src/main/java/net/openhft/smoothie/SmoothieMap.java#L1274-L1288 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRAnimationChannel.java | GVRAnimationChannel.animate | public void animate(float animationTime, Matrix4f mat) {
"""
Obtains the transform for a specific time in animation.
@param animationTime The time in animation.
@return The transform.
"""
mRotInterpolator.animate(animationTime, mRotKey);
mPosInterpolator.animate(animationTime, mPosKey);
... | java | public void animate(float animationTime, Matrix4f mat)
{
mRotInterpolator.animate(animationTime, mRotKey);
mPosInterpolator.animate(animationTime, mPosKey);
mSclInterpolator.animate(animationTime, mScaleKey);
mat.translationRotateScale(mPosKey[0], mPosKey[1], mPosKey[2], mRotKey[0], ... | [
"public",
"void",
"animate",
"(",
"float",
"animationTime",
",",
"Matrix4f",
"mat",
")",
"{",
"mRotInterpolator",
".",
"animate",
"(",
"animationTime",
",",
"mRotKey",
")",
";",
"mPosInterpolator",
".",
"animate",
"(",
"animationTime",
",",
"mPosKey",
")",
";"... | Obtains the transform for a specific time in animation.
@param animationTime The time in animation.
@return The transform. | [
"Obtains",
"the",
"transform",
"for",
"a",
"specific",
"time",
"in",
"animation",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRAnimationChannel.java#L291-L298 |
voldemort/voldemort | src/java/voldemort/utils/UpdateClusterUtils.java | UpdateClusterUtils.removePartitionsFromNode | public static Node removePartitionsFromNode(final Node node,
final Set<Integer> donatedPartitions) {
"""
Remove the set of partitions from the node provided
@param node The node from which we're removing the partitions
@param donatedPartitions The list of partiti... | java | public static Node removePartitionsFromNode(final Node node,
final Set<Integer> donatedPartitions) {
List<Integer> deepCopy = new ArrayList<Integer>(node.getPartitionIds());
deepCopy.removeAll(donatedPartitions);
return updateNode(node, deepCopy);
... | [
"public",
"static",
"Node",
"removePartitionsFromNode",
"(",
"final",
"Node",
"node",
",",
"final",
"Set",
"<",
"Integer",
">",
"donatedPartitions",
")",
"{",
"List",
"<",
"Integer",
">",
"deepCopy",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
"node",... | Remove the set of partitions from the node provided
@param node The node from which we're removing the partitions
@param donatedPartitions The list of partitions to remove
@return The new node without the partitions | [
"Remove",
"the",
"set",
"of",
"partitions",
"from",
"the",
"node",
"provided"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/UpdateClusterUtils.java#L103-L108 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.retrieveServiceStatus | public String retrieveServiceStatus(String service, String cluster) throws Exception {
"""
Get service status
@param service name of the service to be checked
@param cluster URI of the cluster
@return String normalized service status
@throws Exception exception *
"""
String status = "";... | java | public String retrieveServiceStatus(String service, String cluster) throws Exception {
String status = "";
String endPoint = "/service/deploy-api/deploy/status/service?service=" + service;
String element = "$.status";
Future response;
this.setRestProtocol("https://");
th... | [
"public",
"String",
"retrieveServiceStatus",
"(",
"String",
"service",
",",
"String",
"cluster",
")",
"throws",
"Exception",
"{",
"String",
"status",
"=",
"\"\"",
";",
"String",
"endPoint",
"=",
"\"/service/deploy-api/deploy/status/service?service=\"",
"+",
"service",
... | Get service status
@param service name of the service to be checked
@param cluster URI of the cluster
@return String normalized service status
@throws Exception exception * | [
"Get",
"service",
"status"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L2261-L2297 |
apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/FlinkKinesisProducer.java | FlinkKinesisProducer.checkAndPropagateAsyncError | private void checkAndPropagateAsyncError() throws Exception {
"""
Check if there are any asynchronous exceptions. If so, rethrow the exception.
"""
if (thrownException != null) {
String errorMessages = "";
if (thrownException instanceof UserRecordFailedException) {
List<Attempt> attempts = ((UserRe... | java | private void checkAndPropagateAsyncError() throws Exception {
if (thrownException != null) {
String errorMessages = "";
if (thrownException instanceof UserRecordFailedException) {
List<Attempt> attempts = ((UserRecordFailedException) thrownException).getResult().getAttempts();
for (Attempt attempt: atte... | [
"private",
"void",
"checkAndPropagateAsyncError",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"thrownException",
"!=",
"null",
")",
"{",
"String",
"errorMessages",
"=",
"\"\"",
";",
"if",
"(",
"thrownException",
"instanceof",
"UserRecordFailedException",
")",
... | Check if there are any asynchronous exceptions. If so, rethrow the exception. | [
"Check",
"if",
"there",
"are",
"any",
"asynchronous",
"exceptions",
".",
"If",
"so",
"rethrow",
"the",
"exception",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/FlinkKinesisProducer.java#L350-L370 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java | A_CmsSelectBox.onValueSelect | protected void onValueSelect(String value, boolean fireEvents) {
"""
Internal handler method which is called when a new value is selected.<p>
@param value the new value
@param fireEvents true if change events should be fired
"""
String oldValue = m_selectedValue;
selectValue(value);
... | java | protected void onValueSelect(String value, boolean fireEvents) {
String oldValue = m_selectedValue;
selectValue(value);
if (fireEvents) {
if ((oldValue == null) || !oldValue.equals(value)) {
// fire value change only if the the value really changed
Va... | [
"protected",
"void",
"onValueSelect",
"(",
"String",
"value",
",",
"boolean",
"fireEvents",
")",
"{",
"String",
"oldValue",
"=",
"m_selectedValue",
";",
"selectValue",
"(",
"value",
")",
";",
"if",
"(",
"fireEvents",
")",
"{",
"if",
"(",
"(",
"oldValue",
"... | Internal handler method which is called when a new value is selected.<p>
@param value the new value
@param fireEvents true if change events should be fired | [
"Internal",
"handler",
"method",
"which",
"is",
"called",
"when",
"a",
"new",
"value",
"is",
"selected",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java#L640-L650 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/super_src/com/google/gwt/http/client/RequestBuilder.java | RequestBuilder.sendRequest | public Request sendRequest(String requestData, RequestCallback callback)
throws RequestException {
"""
Sends an HTTP request based on the current builder configuration with the
specified data and callback. If no request headers have been set, the
header "Content-Type" will be used with a value of "text/... | java | public Request sendRequest(String requestData, RequestCallback callback)
throws RequestException {
StringValidator.throwIfNull("callback", callback);
return doSend(requestData, callback);
} | [
"public",
"Request",
"sendRequest",
"(",
"String",
"requestData",
",",
"RequestCallback",
"callback",
")",
"throws",
"RequestException",
"{",
"StringValidator",
".",
"throwIfNull",
"(",
"\"callback\"",
",",
"callback",
")",
";",
"return",
"doSend",
"(",
"requestData... | Sends an HTTP request based on the current builder configuration with the
specified data and callback. If no request headers have been set, the
header "Content-Type" will be used with a value of "text/plain;
charset=utf-8". This method does not cache <code>requestData</code> or
<code>callback</code>.
@param requestDat... | [
"Sends",
"an",
"HTTP",
"request",
"based",
"on",
"the",
"current",
"builder",
"configuration",
"with",
"the",
"specified",
"data",
"and",
"callback",
".",
"If",
"no",
"request",
"headers",
"have",
"been",
"set",
"the",
"header",
"Content",
"-",
"Type",
"will... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/super_src/com/google/gwt/http/client/RequestBuilder.java#L251-L255 |
apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/XmlParser.java | XmlParser.getElementName | protected Object getElementName(String namespaceURI, String localName, String qName) {
"""
Return a name given the namespaceURI, localName and qName.
@param namespaceURI the namespace URI
@param localName the local name
@param qName the qualified name
@return the newly created representation of the... | java | protected Object getElementName(String namespaceURI, String localName, String qName) {
String name = localName;
String prefix = "";
if ((name == null) || (name.length() < 1)) {
name = qName;
}
if (namespaceURI == null || namespaceURI.length() <= 0) {
retur... | [
"protected",
"Object",
"getElementName",
"(",
"String",
"namespaceURI",
",",
"String",
"localName",
",",
"String",
"qName",
")",
"{",
"String",
"name",
"=",
"localName",
";",
"String",
"prefix",
"=",
"\"\"",
";",
"if",
"(",
"(",
"name",
"==",
"null",
")",
... | Return a name given the namespaceURI, localName and qName.
@param namespaceURI the namespace URI
@param localName the local name
@param qName the qualified name
@return the newly created representation of the name | [
"Return",
"a",
"name",
"given",
"the",
"namespaceURI",
"localName",
"and",
"qName",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/XmlParser.java#L485-L501 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/CFFFontSubset.java | CFFFontSubset.CountCharset | int CountCharset(int Offset,int NumofGlyphs) {
"""
Calculates the length of the charset according to its format
@param Offset The Charset Offset
@param NumofGlyphs Number of glyphs in the font
@return the length of the Charset
"""
int format;
int Length=0;
seek(Offset);
// Read the forma... | java | int CountCharset(int Offset,int NumofGlyphs){
int format;
int Length=0;
seek(Offset);
// Read the format
format = getCard8();
// Calc according to format
switch (format){
case 0:
Length = 1+2*NumofGlyphs;
break;
case 1:
Length = 1+3*CountRange(NumofGly... | [
"int",
"CountCharset",
"(",
"int",
"Offset",
",",
"int",
"NumofGlyphs",
")",
"{",
"int",
"format",
";",
"int",
"Length",
"=",
"0",
";",
"seek",
"(",
"Offset",
")",
";",
"// Read the format",
"format",
"=",
"getCard8",
"(",
")",
";",
"// Calc according to f... | Calculates the length of the charset according to its format
@param Offset The Charset Offset
@param NumofGlyphs Number of glyphs in the font
@return the length of the Charset | [
"Calculates",
"the",
"length",
"of",
"the",
"charset",
"according",
"to",
"its",
"format"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/CFFFontSubset.java#L214-L235 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/CmsCoreProvider.java | CmsCoreProvider.substituteLinkForRootPath | public void substituteLinkForRootPath(final String rootPath, final I_CmsSimpleCallback<String> callback) {
"""
Returns the absolute link to the given root path.<p>
@param rootPath the root path
@param callback the callback to execute
"""
CmsRpcAction<String> action = new CmsRpcAction<String>() {
... | java | public void substituteLinkForRootPath(final String rootPath, final I_CmsSimpleCallback<String> callback) {
CmsRpcAction<String> action = new CmsRpcAction<String>() {
@Override
public void execute() {
getVfsService().substituteLinkForRootPath(getSiteRoot(), rootPath, th... | [
"public",
"void",
"substituteLinkForRootPath",
"(",
"final",
"String",
"rootPath",
",",
"final",
"I_CmsSimpleCallback",
"<",
"String",
">",
"callback",
")",
"{",
"CmsRpcAction",
"<",
"String",
">",
"action",
"=",
"new",
"CmsRpcAction",
"<",
"String",
">",
"(",
... | Returns the absolute link to the given root path.<p>
@param rootPath the root path
@param callback the callback to execute | [
"Returns",
"the",
"absolute",
"link",
"to",
"the",
"given",
"root",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/CmsCoreProvider.java#L734-L751 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Animation.java | Animation.drawFlash | public void drawFlash(float x,float y,float width,float height, Color col) {
"""
Draw the animation
@param x The x position to draw the animation at
@param y The y position to draw the animation at
@param width The width to draw the animation at
@param height The height to draw the animation at
@param col T... | java | public void drawFlash(float x,float y,float width,float height, Color col) {
if (frames.size() == 0) {
return;
}
if (autoUpdate) {
long now = getTime();
long delta = now - lastUpdate;
if (firstUpdate) {
delta = 0;
firstUpdate = false;
}
lastUpdate = now;
nextFrame(delt... | [
"public",
"void",
"drawFlash",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"width",
",",
"float",
"height",
",",
"Color",
"col",
")",
"{",
"if",
"(",
"frames",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"if",
"(",
"... | Draw the animation
@param x The x position to draw the animation at
@param y The y position to draw the animation at
@param width The width to draw the animation at
@param height The height to draw the animation at
@param col The colour for the flash | [
"Draw",
"the",
"animation"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Animation.java#L449-L467 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamFilenameHelper.java | DatastreamFilenameHelper.getFilenameFromLabel | private final String getFilenameFromLabel(Context context, String pid, String dsid, Date asOfDateTime, String MIMETYPE) throws Exception {
"""
Get filename based on datastream label
@param context
@param pid
@param dsid
@param asOfDateTime
@param MIMETYPE
@return
@throws Exception
"""
// can'... | java | private final String getFilenameFromLabel(Context context, String pid, String dsid, Date asOfDateTime, String MIMETYPE) throws Exception {
// can't get datastream label directly from datastream as this is an API-M call
// instead get list of datastream defs, as these contain labels
DOReader rea... | [
"private",
"final",
"String",
"getFilenameFromLabel",
"(",
"Context",
"context",
",",
"String",
"pid",
",",
"String",
"dsid",
",",
"Date",
"asOfDateTime",
",",
"String",
"MIMETYPE",
")",
"throws",
"Exception",
"{",
"// can't get datastream label directly from datastream... | Get filename based on datastream label
@param context
@param pid
@param dsid
@param asOfDateTime
@param MIMETYPE
@return
@throws Exception | [
"Get",
"filename",
"based",
"on",
"datastream",
"label"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamFilenameHelper.java#L344-L352 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java | SqlModifyBuilder.generateLogForModifiers | public static void generateLogForModifiers(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
"""
generate sql log.
@param method
the method
@param methodBuilder
the method builder
"""
JQLChecker jqlChecker = JQLChecker.getInstance();
final One<Boolean> usedInWhere = new One<Boolean... | java | public static void generateLogForModifiers(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
JQLChecker jqlChecker = JQLChecker.getInstance();
final One<Boolean> usedInWhere = new One<Boolean>(false);
methodBuilder.addCode("\n// display log\n");
String sqlForLog = jqlChecker.replace(method, ... | [
"public",
"static",
"void",
"generateLogForModifiers",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
")",
"{",
"JQLChecker",
"jqlChecker",
"=",
"JQLChecker",
".",
"getInstance",
"(",
")",
";",
"final",
"One",
"<",... | generate sql log.
@param method
the method
@param methodBuilder
the method builder | [
"generate",
"sql",
"log",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java#L579-L640 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.removeParticipants | public Observable<ComapiResult<Void>> removeParticipants(@NonNull final String conversationId, @NonNull final List<String> ids) {
"""
Returns observable to remove list of participants from a conversation.
@param conversationId ID of a conversation to delete.
@param ids List of participant ids to be ... | java | public Observable<ComapiResult<Void>> removeParticipants(@NonNull final String conversationId, @NonNull final List<String> ids) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queueRemoveParticipants(conversationId, ids);
} else... | [
"public",
"Observable",
"<",
"ComapiResult",
"<",
"Void",
">",
">",
"removeParticipants",
"(",
"@",
"NonNull",
"final",
"String",
"conversationId",
",",
"@",
"NonNull",
"final",
"List",
"<",
"String",
">",
"ids",
")",
"{",
"final",
"String",
"token",
"=",
... | Returns observable to remove list of participants from a conversation.
@param conversationId ID of a conversation to delete.
@param ids List of participant ids to be removed.
@return Observable to remove list of participants from a conversation. | [
"Returns",
"observable",
"to",
"remove",
"list",
"of",
"participants",
"from",
"a",
"conversation",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L606-L617 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/Matrix.java | Matrix.mutableSubtract | public void mutableSubtract(double c, Matrix B, ExecutorService threadPool) {
"""
Alters the current matrix to store <i>A-c*B</i>
@param c the scalar constant to multiply <i>B</i> by
@param B the matrix to subtract from <i>this</i>.
@param threadPool the source of threads to do computation in parallel
"""
... | java | public void mutableSubtract(double c, Matrix B, ExecutorService threadPool)
{
mutableAdd(-c, B, threadPool);
} | [
"public",
"void",
"mutableSubtract",
"(",
"double",
"c",
",",
"Matrix",
"B",
",",
"ExecutorService",
"threadPool",
")",
"{",
"mutableAdd",
"(",
"-",
"c",
",",
"B",
",",
"threadPool",
")",
";",
"}"
] | Alters the current matrix to store <i>A-c*B</i>
@param c the scalar constant to multiply <i>B</i> by
@param B the matrix to subtract from <i>this</i>.
@param threadPool the source of threads to do computation in parallel | [
"Alters",
"the",
"current",
"matrix",
"to",
"store",
"<i",
">",
"A",
"-",
"c",
"*",
"B<",
"/",
"i",
">"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L247-L250 |
fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgUtils.java | SgUtils.toModifiers | public static int toModifiers(final String modifiers) {
"""
Returns a Java "Modifier" value for a list of modifier names.
@param modifiers
Modifier names separated by spaces.
@return Modifiers.
"""
if (modifiers == null) {
return 0;
}
final String trimmedModifiers... | java | public static int toModifiers(final String modifiers) {
if (modifiers == null) {
return 0;
}
final String trimmedModifiers = modifiers.trim();
int modifier = 0;
final StringTokenizer tok = new StringTokenizer(trimmedModifiers, " ");
while (tok.hasMoreTo... | [
"public",
"static",
"int",
"toModifiers",
"(",
"final",
"String",
"modifiers",
")",
"{",
"if",
"(",
"modifiers",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"final",
"String",
"trimmedModifiers",
"=",
"modifiers",
".",
"trim",
"(",
")",
";",
"int",
... | Returns a Java "Modifier" value for a list of modifier names.
@param modifiers
Modifier names separated by spaces.
@return Modifiers. | [
"Returns",
"a",
"Java",
"Modifier",
"value",
"for",
"a",
"list",
"of",
"modifier",
"names",
"."
] | train | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgUtils.java#L427-L439 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java | ST_Split.splitMultiPolygonWithLine | private static Geometry splitMultiPolygonWithLine(MultiPolygon multiPolygon, LineString lineString) throws SQLException {
"""
Splits a MultiPolygon using a LineString.
@param multiPolygon
@param lineString
@return
"""
ArrayList<Polygon> allPolygons = new ArrayList<Polygon>();
for (int i = ... | java | private static Geometry splitMultiPolygonWithLine(MultiPolygon multiPolygon, LineString lineString) throws SQLException {
ArrayList<Polygon> allPolygons = new ArrayList<Polygon>();
for (int i = 0; i < multiPolygon.getNumGeometries(); i++) {
Collection<Polygon> polygons = splitPolygonizer((Po... | [
"private",
"static",
"Geometry",
"splitMultiPolygonWithLine",
"(",
"MultiPolygon",
"multiPolygon",
",",
"LineString",
"lineString",
")",
"throws",
"SQLException",
"{",
"ArrayList",
"<",
"Polygon",
">",
"allPolygons",
"=",
"new",
"ArrayList",
"<",
"Polygon",
">",
"("... | Splits a MultiPolygon using a LineString.
@param multiPolygon
@param lineString
@return | [
"Splits",
"a",
"MultiPolygon",
"using",
"a",
"LineString",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java#L290-L302 |
apache/fluo-recipes | modules/accumulo/src/main/java/org/apache/fluo/recipes/accumulo/ops/TableOperations.java | TableOperations.optimizeTable | public static void optimizeTable(FluoConfiguration fluoConfig, TableOptimizations tableOptim)
throws Exception {
"""
Make the requested table optimizations.
@param fluoConfig should contain information need to connect to Accumulo and name of Fluo table
@param tableOptim Will perform these optimizations o... | java | public static void optimizeTable(FluoConfiguration fluoConfig, TableOptimizations tableOptim)
throws Exception {
Connector conn = getConnector(fluoConfig);
TreeSet<Text> splits = new TreeSet<>();
for (Bytes split : tableOptim.getSplits()) {
splits.add(new Text(split.toArray()));
}
Str... | [
"public",
"static",
"void",
"optimizeTable",
"(",
"FluoConfiguration",
"fluoConfig",
",",
"TableOptimizations",
"tableOptim",
")",
"throws",
"Exception",
"{",
"Connector",
"conn",
"=",
"getConnector",
"(",
"fluoConfig",
")",
";",
"TreeSet",
"<",
"Text",
">",
"spli... | Make the requested table optimizations.
@param fluoConfig should contain information need to connect to Accumulo and name of Fluo table
@param tableOptim Will perform these optimizations on Fluo table in Accumulo. | [
"Make",
"the",
"requested",
"table",
"optimizations",
"."
] | train | https://github.com/apache/fluo-recipes/blob/24c11234c9654b16d999437ff49ddc3db86665f8/modules/accumulo/src/main/java/org/apache/fluo/recipes/accumulo/ops/TableOperations.java#L70-L102 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/bind/BindUploader.java | BindUploader.newInstance | public synchronized static BindUploader newInstance(SFSession session, String stageDir)
throws BindException {
"""
Create a new BindUploader which will upload to the given stage path
Ensure temporary directory for file writing exists
@param session the session to use for uploading binds
@param stageDir the... | java | public synchronized static BindUploader newInstance(SFSession session, String stageDir)
throws BindException
{
try
{
Path bindDir = Files.createTempDirectory(PREFIX);
return new BindUploader(session, stageDir, bindDir);
}
catch (IOException ex)
{
throw new BindException(
... | [
"public",
"synchronized",
"static",
"BindUploader",
"newInstance",
"(",
"SFSession",
"session",
",",
"String",
"stageDir",
")",
"throws",
"BindException",
"{",
"try",
"{",
"Path",
"bindDir",
"=",
"Files",
".",
"createTempDirectory",
"(",
"PREFIX",
")",
";",
"ret... | Create a new BindUploader which will upload to the given stage path
Ensure temporary directory for file writing exists
@param session the session to use for uploading binds
@param stageDir the stage path to upload to
@return BindUploader instance
@throws BindException if temporary directory could not be created | [
"Create",
"a",
"new",
"BindUploader",
"which",
"will",
"upload",
"to",
"the",
"given",
"stage",
"path",
"Ensure",
"temporary",
"directory",
"for",
"file",
"writing",
"exists"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/bind/BindUploader.java#L174-L187 |
Steveice10/OpenNBT | src/main/java/com/github/steveice10/opennbt/NBTIO.java | NBTIO.writeFile | public static void writeFile(CompoundTag tag, File file) throws IOException {
"""
Writes the given root CompoundTag to the given file, compressed and in big endian.
@param tag Tag to write.
@param file File to write to.
@throws java.io.IOException If an I/O error occurs.
"""
writeFile(tag, file, ... | java | public static void writeFile(CompoundTag tag, File file) throws IOException {
writeFile(tag, file, true, false);
} | [
"public",
"static",
"void",
"writeFile",
"(",
"CompoundTag",
"tag",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"writeFile",
"(",
"tag",
",",
"file",
",",
"true",
",",
"false",
")",
";",
"}"
] | Writes the given root CompoundTag to the given file, compressed and in big endian.
@param tag Tag to write.
@param file File to write to.
@throws java.io.IOException If an I/O error occurs. | [
"Writes",
"the",
"given",
"root",
"CompoundTag",
"to",
"the",
"given",
"file",
"compressed",
"and",
"in",
"big",
"endian",
"."
] | train | https://github.com/Steveice10/OpenNBT/blob/9bf4adb2afd206a21bc4309c85d642494d1fb536/src/main/java/com/github/steveice10/opennbt/NBTIO.java#L104-L106 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildFieldSerializationOverview | public void buildFieldSerializationOverview(ClassDoc classDoc, Content classContentTree) {
"""
Build the serialization overview for the given class.
@param classDoc the class to print the overview for.
@param classContentTree content tree to which the documentation will be added
"""
if (classDoc.de... | java | public void buildFieldSerializationOverview(ClassDoc classDoc, Content classContentTree) {
if (classDoc.definesSerializableFields()) {
FieldDoc serialPersistentField = classDoc.serializableFields()[0];
// Check to see if there are inline comments, tags or deprecation
// infor... | [
"public",
"void",
"buildFieldSerializationOverview",
"(",
"ClassDoc",
"classDoc",
",",
"Content",
"classContentTree",
")",
"{",
"if",
"(",
"classDoc",
".",
"definesSerializableFields",
"(",
")",
")",
"{",
"FieldDoc",
"serialPersistentField",
"=",
"classDoc",
".",
"s... | Build the serialization overview for the given class.
@param classDoc the class to print the overview for.
@param classContentTree content tree to which the documentation will be added | [
"Build",
"the",
"serialization",
"overview",
"for",
"the",
"given",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L382-L404 |
buschmais/jqa-core-framework | rule/src/main/java/com/buschmais/jqassistant/core/rule/api/executor/RuleSetExecutor.java | RuleSetExecutor.executeGroup | private void executeGroup(RuleSet ruleSet, Group group, Severity parentSeverity) throws RuleException {
"""
Executes the given group.
@param ruleSet
The rule set.
@param group
The group.
@param parentSeverity
The severity.
"""
if (!executedGroups.contains(group)) {
ruleVisitor.befor... | java | private void executeGroup(RuleSet ruleSet, Group group, Severity parentSeverity) throws RuleException {
if (!executedGroups.contains(group)) {
ruleVisitor.beforeGroup(group, getEffectiveSeverity(group, parentSeverity, parentSeverity));
for (Map.Entry<String, Severity> conceptEntry : grou... | [
"private",
"void",
"executeGroup",
"(",
"RuleSet",
"ruleSet",
",",
"Group",
"group",
",",
"Severity",
"parentSeverity",
")",
"throws",
"RuleException",
"{",
"if",
"(",
"!",
"executedGroups",
".",
"contains",
"(",
"group",
")",
")",
"{",
"ruleVisitor",
".",
"... | Executes the given group.
@param ruleSet
The rule set.
@param group
The group.
@param parentSeverity
The severity. | [
"Executes",
"the",
"given",
"group",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/rule/src/main/java/com/buschmais/jqassistant/core/rule/api/executor/RuleSetExecutor.java#L70-L86 |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/datamodel/DataModelFactory.java | DataModelFactory.createLicense | public static License createLicense(final String name, final String longName, final String comments, final String regexp, final String url) {
"""
Generates a License regarding the parameters.
@param name String
@param longName String
@param comments String
@param regexp String
@param url String
@return Lic... | java | public static License createLicense(final String name, final String longName, final String comments, final String regexp, final String url){
final License license = new License();
license.setName(name);
license.setLongName(longName);
license.setComments(comments);
license.setRegexp(regexp);
license.setUrl(... | [
"public",
"static",
"License",
"createLicense",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"longName",
",",
"final",
"String",
"comments",
",",
"final",
"String",
"regexp",
",",
"final",
"String",
"url",
")",
"{",
"final",
"License",
"license",
... | Generates a License regarding the parameters.
@param name String
@param longName String
@param comments String
@param regexp String
@param url String
@return License | [
"Generates",
"a",
"License",
"regarding",
"the",
"parameters",
"."
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/datamodel/DataModelFactory.java#L124-L134 |
alb-i986/selenium-tinafw | src/main/java/me/alb_i986/selenium/tinafw/config/TinafwGuiceModule.java | TinafwGuiceModule.webDriverFactoryProvider | @Provides
@Singleton
WebDriverFactory webDriverFactoryProvider() {
"""
A {@link WebDriverFactory} according to the settings:
<ul>
<li>a {@link WebDriverFactoryLocal} if {@link Config#PROP_GRID_HUB_URL} is
not defined;
<li>else, a {@link WebDriverFactoryRemote}
<li>finally, decorate it with {@link WebD... | java | @Provides
@Singleton
WebDriverFactory webDriverFactoryProvider() {
WebDriverFactory tmpFactoryFromConfig;
URL hubURL = Config.getGridHubUrl();
if(hubURL == null) {
tmpFactoryFromConfig = new WebDriverFactoryLocal();
} else {
DesiredCapabilities extraDesire... | [
"@",
"Provides",
"@",
"Singleton",
"WebDriverFactory",
"webDriverFactoryProvider",
"(",
")",
"{",
"WebDriverFactory",
"tmpFactoryFromConfig",
";",
"URL",
"hubURL",
"=",
"Config",
".",
"getGridHubUrl",
"(",
")",
";",
"if",
"(",
"hubURL",
"==",
"null",
")",
"{",
... | A {@link WebDriverFactory} according to the settings:
<ul>
<li>a {@link WebDriverFactoryLocal} if {@link Config#PROP_GRID_HUB_URL} is
not defined;
<li>else, a {@link WebDriverFactoryRemote}
<li>finally, decorate it with {@link WebDriverFactoryDecoratorImplicitWait}, if
{@link Config#PROP_TIMEOUT_IMPLICIT_WAIT} is defin... | [
"A",
"{"
] | train | https://github.com/alb-i986/selenium-tinafw/blob/91c66720cda9f69751f96c58c0a0624b2222186e/src/main/java/me/alb_i986/selenium/tinafw/config/TinafwGuiceModule.java#L31-L48 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/attribute/IntegerAttribute.java | IntegerAttribute.asSet | public MutableIntSet asSet(List<T> list, MutableIntSet setToAppend) {
"""
extracts the int values represented by this attribute from the list and adds them to the setToAppend.
If the int attribute is null, it's ignored.
@param list incoming list
@param setToAppend the set to append to
"""
asSet(lis... | java | public MutableIntSet asSet(List<T> list, MutableIntSet setToAppend)
{
asSet(list, this, setToAppend);
return setToAppend;
} | [
"public",
"MutableIntSet",
"asSet",
"(",
"List",
"<",
"T",
">",
"list",
",",
"MutableIntSet",
"setToAppend",
")",
"{",
"asSet",
"(",
"list",
",",
"this",
",",
"setToAppend",
")",
";",
"return",
"setToAppend",
";",
"}"
] | extracts the int values represented by this attribute from the list and adds them to the setToAppend.
If the int attribute is null, it's ignored.
@param list incoming list
@param setToAppend the set to append to | [
"extracts",
"the",
"int",
"values",
"represented",
"by",
"this",
"attribute",
"from",
"the",
"list",
"and",
"adds",
"them",
"to",
"the",
"setToAppend",
".",
"If",
"the",
"int",
"attribute",
"is",
"null",
"it",
"s",
"ignored",
"."
] | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/attribute/IntegerAttribute.java#L135-L139 |
ops4j/org.ops4j.base | ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java | PropertiesUtils.resolveProperty | public static String resolveProperty( Properties props, String value ) {
"""
Resolve symbols in a supplied value against supplied known properties.
@param props a set of know properties
@param value the string to parse for tokens
@return the resolved string
"""
return PropertyResolver.resolve( p... | java | public static String resolveProperty( Properties props, String value )
{
return PropertyResolver.resolve( props, value );
} | [
"public",
"static",
"String",
"resolveProperty",
"(",
"Properties",
"props",
",",
"String",
"value",
")",
"{",
"return",
"PropertyResolver",
".",
"resolve",
"(",
"props",
",",
"value",
")",
";",
"}"
] | Resolve symbols in a supplied value against supplied known properties.
@param props a set of know properties
@param value the string to parse for tokens
@return the resolved string | [
"Resolve",
"symbols",
"in",
"a",
"supplied",
"value",
"against",
"supplied",
"known",
"properties",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java#L139-L142 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java | SnowflakeStatementV1.executeInternal | boolean executeInternal(String sql,
Map<String, ParameterBindingDTO> parameterBindings)
throws SQLException {
"""
Execute sql
@param sql sql statement
@param parameterBindings a map of binds to use for this query
@return whether there is result set or not
@throws SQL... | java | boolean executeInternal(String sql,
Map<String, ParameterBindingDTO> parameterBindings)
throws SQLException
{
raiseSQLExceptionIfStatementIsClosed();
connection.injectedDelay();
logger.debug("execute: {}", sql);
String trimmedSql = sql.trim();
if (trimmedSql.length()... | [
"boolean",
"executeInternal",
"(",
"String",
"sql",
",",
"Map",
"<",
"String",
",",
"ParameterBindingDTO",
">",
"parameterBindings",
")",
"throws",
"SQLException",
"{",
"raiseSQLExceptionIfStatementIsClosed",
"(",
")",
";",
"connection",
".",
"injectedDelay",
"(",
"... | Execute sql
@param sql sql statement
@param parameterBindings a map of binds to use for this query
@return whether there is result set or not
@throws SQLException if @link{#executeQuery(String)} throws exception | [
"Execute",
"sql"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java#L267-L324 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheListUtil.java | CacheListUtil.addAll | public static Single<Boolean> addAll(String cacheKey, List list) {
"""
Add a list of elements to the end of the cached list.
@param cacheKey the key for the cached list.
@param list the list of elements to be added.
@return true on success, false on failure.
"""
return addAll(CacheService.CACH... | java | public static Single<Boolean> addAll(String cacheKey, List list) {
return addAll(CacheService.CACHE_CONFIG_BEAN, cacheKey, list);
} | [
"public",
"static",
"Single",
"<",
"Boolean",
">",
"addAll",
"(",
"String",
"cacheKey",
",",
"List",
"list",
")",
"{",
"return",
"addAll",
"(",
"CacheService",
".",
"CACHE_CONFIG_BEAN",
",",
"cacheKey",
",",
"list",
")",
";",
"}"
] | Add a list of elements to the end of the cached list.
@param cacheKey the key for the cached list.
@param list the list of elements to be added.
@return true on success, false on failure. | [
"Add",
"a",
"list",
"of",
"elements",
"to",
"the",
"end",
"of",
"the",
"cached",
"list",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheListUtil.java#L158-L160 |
lotaris/rox-client-java | rox-client-java/src/main/java/com/lotaris/rox/core/filters/FilterTargetData.java | FilterTargetData.mergeTags | private static String mergeTags(RoxableTest mAnnotation, RoxableTestClass cAnnotation) {
"""
Create a string containing all the tags from method and class annotations
@param mAnnotation Method annotation
@param cAnnotation Class annotation
@return The string of tags
"""
List<String> tags = new ArrayList... | java | private static String mergeTags(RoxableTest mAnnotation, RoxableTestClass cAnnotation) {
List<String> tags = new ArrayList<>();
if (mAnnotation != null) {
tags.addAll(Arrays.asList(mAnnotation.tags()));
}
if (cAnnotation != null) {
tags.addAll(Arrays.asList(cAnnotation.tags()));
}
return Arrays... | [
"private",
"static",
"String",
"mergeTags",
"(",
"RoxableTest",
"mAnnotation",
",",
"RoxableTestClass",
"cAnnotation",
")",
"{",
"List",
"<",
"String",
">",
"tags",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"mAnnotation",
"!=",
"null",
")",
... | Create a string containing all the tags from method and class annotations
@param mAnnotation Method annotation
@param cAnnotation Class annotation
@return The string of tags | [
"Create",
"a",
"string",
"containing",
"all",
"the",
"tags",
"from",
"method",
"and",
"class",
"annotations"
] | train | https://github.com/lotaris/rox-client-java/blob/1b33f7560347c382c59a40c4037d175ab8127fde/rox-client-java/src/main/java/com/lotaris/rox/core/filters/FilterTargetData.java#L137-L149 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PemObjectReader.java | PemObjectReader.readPemPrivateKey | public static PrivateKey readPemPrivateKey(File keyFile, String password) throws IOException {
"""
Reads the given {@link File}( in *.pem format) that contains a password protected private
key.
@param keyFile
the file with the password protected private key
@param password
the password
@return the {@link P... | java | public static PrivateKey readPemPrivateKey(File keyFile, String password) throws IOException
{
Security.addProvider(new BouncyCastleProvider());
try (PEMParser pemParser = new PEMParser(
new InputStreamReader(new FileInputStream(keyFile))))
{
PEMEncryptedKeyPair encryptedKeyPair = (PEMEncryptedKeyPair)pemP... | [
"public",
"static",
"PrivateKey",
"readPemPrivateKey",
"(",
"File",
"keyFile",
",",
"String",
"password",
")",
"throws",
"IOException",
"{",
"Security",
".",
"addProvider",
"(",
"new",
"BouncyCastleProvider",
"(",
")",
")",
";",
"try",
"(",
"PEMParser",
"pemPars... | Reads the given {@link File}( in *.pem format) that contains a password protected private
key.
@param keyFile
the file with the password protected private key
@param password
the password
@return the {@link PrivateKey} object
@throws IOException
Signals that an I/O exception has occurred. | [
"Reads",
"the",
"given",
"{",
"@link",
"File",
"}",
"(",
"in",
"*",
".",
"pem",
"format",
")",
"that",
"contains",
"a",
"password",
"protected",
"private",
"key",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PemObjectReader.java#L87-L102 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.VarArray | public JBBPDslBuilder VarArray(final String name, final int size, final String param) {
"""
Create named var array with fixed size.
@param name name of the array, can be null for anonymous one
@param size size of array, it can be negative if to read stream till end.
@param param optional parameter for the f... | java | public JBBPDslBuilder VarArray(final String name, final int size, final String param) {
return this.VarArray(name, arraySizeToString(size), param);
} | [
"public",
"JBBPDslBuilder",
"VarArray",
"(",
"final",
"String",
"name",
",",
"final",
"int",
"size",
",",
"final",
"String",
"param",
")",
"{",
"return",
"this",
".",
"VarArray",
"(",
"name",
",",
"arraySizeToString",
"(",
"size",
")",
",",
"param",
")",
... | Create named var array with fixed size.
@param name name of the array, can be null for anonymous one
@param size size of array, it can be negative if to read stream till end.
@param param optional parameter for the field, can be null
@return the builder instance, must not be null | [
"Create",
"named",
"var",
"array",
"with",
"fixed",
"size",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L462-L464 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/geom/Polygon.java | Polygon.addPoint | public void addPoint(double x, double y) {
"""
Add a point to the polygon.
@param x The horizontal location.
@param y The vertical location.
"""
if (npoints >= xpoints.length)
{
final int newLength = npoints * 2;
xpoints = Arrays.copyOf(xpoints, newLength);
... | java | public void addPoint(double x, double y)
{
if (npoints >= xpoints.length)
{
final int newLength = npoints * 2;
xpoints = Arrays.copyOf(xpoints, newLength);
ypoints = Arrays.copyOf(ypoints, newLength);
}
xpoints[npoints] = x;
ypoint... | [
"public",
"void",
"addPoint",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"if",
"(",
"npoints",
">=",
"xpoints",
".",
"length",
")",
"{",
"final",
"int",
"newLength",
"=",
"npoints",
"*",
"2",
";",
"xpoints",
"=",
"Arrays",
".",
"copyOf",
"(",
... | Add a point to the polygon.
@param x The horizontal location.
@param y The vertical location. | [
"Add",
"a",
"point",
"to",
"the",
"polygon",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/geom/Polygon.java#L57-L69 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/model/JBBPFieldStruct.java | JBBPFieldStruct.mapTo | public <T> T mapTo(final Class<T> mappingClass, final JBBPMapperCustomFieldProcessor customFieldProcessor) {
"""
Map the structure fields to a class fields.
@param <T> a class type
@param mappingClass a mapping class to be mapped by the structure fields,
must not be null and must have... | java | public <T> T mapTo(final Class<T> mappingClass, final JBBPMapperCustomFieldProcessor customFieldProcessor) {
return JBBPMapper.map(this, mappingClass, customFieldProcessor);
} | [
"public",
"<",
"T",
">",
"T",
"mapTo",
"(",
"final",
"Class",
"<",
"T",
">",
"mappingClass",
",",
"final",
"JBBPMapperCustomFieldProcessor",
"customFieldProcessor",
")",
"{",
"return",
"JBBPMapper",
".",
"map",
"(",
"this",
",",
"mappingClass",
",",
"customFie... | Map the structure fields to a class fields.
@param <T> a class type
@param mappingClass a mapping class to be mapped by the structure fields,
must not be null and must have the default constructor
@param customFieldProcessor a custom field processor to provide values for
custom mapping fields,... | [
"Map",
"the",
"structure",
"fields",
"to",
"a",
"class",
"fields",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/model/JBBPFieldStruct.java#L258-L260 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/EqualsValueChangeDetector.java | EqualsValueChangeDetector.hasValueChanged | public boolean hasValueChanged(Object oldValue, Object newValue) {
"""
Determines if there has been a change in value between the provided arguments. The
objects are compared using the <code>equals</code> method.
@param oldValue Original object value
@param newValue New object value
@return true if the objec... | java | public boolean hasValueChanged(Object oldValue, Object newValue) {
return !(oldValue == newValue || (oldValue != null && oldValue.equals( newValue )));
} | [
"public",
"boolean",
"hasValueChanged",
"(",
"Object",
"oldValue",
",",
"Object",
"newValue",
")",
"{",
"return",
"!",
"(",
"oldValue",
"==",
"newValue",
"||",
"(",
"oldValue",
"!=",
"null",
"&&",
"oldValue",
".",
"equals",
"(",
"newValue",
")",
")",
")",
... | Determines if there has been a change in value between the provided arguments. The
objects are compared using the <code>equals</code> method.
@param oldValue Original object value
@param newValue New object value
@return true if the objects are different enough to indicate a change in the value
model | [
"Determines",
"if",
"there",
"has",
"been",
"a",
"change",
"in",
"value",
"between",
"the",
"provided",
"arguments",
".",
"The",
"objects",
"are",
"compared",
"using",
"the",
"<code",
">",
"equals<",
"/",
"code",
">",
"method",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/EqualsValueChangeDetector.java#L40-L42 |
josueeduardo/snappy | plugin-parent/snappy-maven-plugin/src/main/java/io/joshworks/snappy/maven/tools/MainClassFinder.java | MainClassFinder.findSingleMainClass | public static String findSingleMainClass(JarFile jarFile, String classesLocation)
throws IOException {
"""
Find a single main class in a given jar file.
@param jarFile the jar file to search
@param classesLocation the location within the jar containing classes
@return the main class or {@c... | java | public static String findSingleMainClass(JarFile jarFile, String classesLocation)
throws IOException {
MainClassesCallback callback = new MainClassesCallback();
MainClassFinder.doWithMainClasses(jarFile, classesLocation, callback);
return callback.getMainClass();
} | [
"public",
"static",
"String",
"findSingleMainClass",
"(",
"JarFile",
"jarFile",
",",
"String",
"classesLocation",
")",
"throws",
"IOException",
"{",
"MainClassesCallback",
"callback",
"=",
"new",
"MainClassesCallback",
"(",
")",
";",
"MainClassFinder",
".",
"doWithMai... | Find a single main class in a given jar file.
@param jarFile the jar file to search
@param classesLocation the location within the jar containing classes
@return the main class or {@code null}
@throws IOException if the jar file cannot be read | [
"Find",
"a",
"single",
"main",
"class",
"in",
"a",
"given",
"jar",
"file",
"."
] | train | https://github.com/josueeduardo/snappy/blob/d95a9e811eda3c24a5e53086369208819884fa49/plugin-parent/snappy-maven-plugin/src/main/java/io/joshworks/snappy/maven/tools/MainClassFinder.java#L190-L195 |
haifengl/smile | core/src/main/java/smile/taxonomy/Taxonomy.java | Taxonomy.lowestCommonAncestor | public Concept lowestCommonAncestor(String v, String w) {
"""
Returns the lowest common ancestor (LCA) of concepts v and w. The lowest
common ancestor is defined between two nodes v and w as the lowest node
that has both v and w as descendants (where we allow a node to be a
descendant of itself).
"""
... | java | public Concept lowestCommonAncestor(String v, String w) {
Concept vnode = getConcept(v);
Concept wnode = getConcept(w);
return lowestCommonAncestor(vnode, wnode);
} | [
"public",
"Concept",
"lowestCommonAncestor",
"(",
"String",
"v",
",",
"String",
"w",
")",
"{",
"Concept",
"vnode",
"=",
"getConcept",
"(",
"v",
")",
";",
"Concept",
"wnode",
"=",
"getConcept",
"(",
"w",
")",
";",
"return",
"lowestCommonAncestor",
"(",
"vno... | Returns the lowest common ancestor (LCA) of concepts v and w. The lowest
common ancestor is defined between two nodes v and w as the lowest node
that has both v and w as descendants (where we allow a node to be a
descendant of itself). | [
"Returns",
"the",
"lowest",
"common",
"ancestor",
"(",
"LCA",
")",
"of",
"concepts",
"v",
"and",
"w",
".",
"The",
"lowest",
"common",
"ancestor",
"is",
"defined",
"between",
"two",
"nodes",
"v",
"and",
"w",
"as",
"the",
"lowest",
"node",
"that",
"has",
... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/taxonomy/Taxonomy.java#L110-L115 |
Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyAuthorizationPolicy.java | ContentKeyAuthorizationPolicy.linkOptions | public static EntityLinkOperation linkOptions(String contentKeyAuthorizationPolicyId,
String contentKeyAuthorizationPolicyOptionId) {
"""
Link a content key authorization policy options.
@param contentKeyAuthorizationPolicyId
the content key authorization policy id
@param contentKeyAuthorizationPo... | java | public static EntityLinkOperation linkOptions(String contentKeyAuthorizationPolicyId,
String contentKeyAuthorizationPolicyOptionId) {
String escapedContentKeyId = null;
try {
escapedContentKeyId = URLEncoder.encode(contentKeyAuthorizationPolicyOptionId, "UTF-8");
} catch ... | [
"public",
"static",
"EntityLinkOperation",
"linkOptions",
"(",
"String",
"contentKeyAuthorizationPolicyId",
",",
"String",
"contentKeyAuthorizationPolicyOptionId",
")",
"{",
"String",
"escapedContentKeyId",
"=",
"null",
";",
"try",
"{",
"escapedContentKeyId",
"=",
"URLEncod... | Link a content key authorization policy options.
@param contentKeyAuthorizationPolicyId
the content key authorization policy id
@param contentKeyAuthorizationPolicyOptionId
the content key authorization policy option id
@return the entity action operation | [
"Link",
"a",
"content",
"key",
"authorization",
"policy",
"options",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyAuthorizationPolicy.java#L138-L149 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/RandomProjection.java | RandomProjection.johnsonLindenstraussMinDim | public static List<Integer> johnsonLindenstraussMinDim(int[] n, double... eps) {
"""
Find a safe number of components to project this to, through
the Johnson-Lindenstrauss lemma
The minimum number n' of components to guarantee the eps-embedding is
given by:
n' >= 4 log(n) / (eps² / 2 - eps³ / 3)
see http:... | java | public static List<Integer> johnsonLindenstraussMinDim(int[] n, double... eps){
Boolean basicCheck = n == null || n.length == 0 || eps == null || eps.length == 0;
if (basicCheck)
throw new IllegalArgumentException("Johnson-Lindenstrauss dimension estimation requires > 0 components and at lea... | [
"public",
"static",
"List",
"<",
"Integer",
">",
"johnsonLindenstraussMinDim",
"(",
"int",
"[",
"]",
"n",
",",
"double",
"...",
"eps",
")",
"{",
"Boolean",
"basicCheck",
"=",
"n",
"==",
"null",
"||",
"n",
".",
"length",
"==",
"0",
"||",
"eps",
"==",
... | Find a safe number of components to project this to, through
the Johnson-Lindenstrauss lemma
The minimum number n' of components to guarantee the eps-embedding is
given by:
n' >= 4 log(n) / (eps² / 2 - eps³ / 3)
see http://cseweb.ucsd.edu/~dasgupta/papers/jl.pdf §2.1
@param n Number of samples. If an array is given, ... | [
"Find",
"a",
"safe",
"number",
"of",
"components",
"to",
"project",
"this",
"to",
"through",
"the",
"Johnson",
"-",
"Lindenstrauss",
"lemma",
"The",
"minimum",
"number",
"n",
"of",
"components",
"to",
"guarantee",
"the",
"eps",
"-",
"embedding",
"is",
"given... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/RandomProjection.java#L76-L93 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.debugv | public void debugv(Throwable t, String format, Object... params) {
"""
Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting.
@param t the throwable
@param format the message format string
@param params the parameters
"""
doLog(Level.DEBUG, FQCN, format, ... | java | public void debugv(Throwable t, String format, Object... params) {
doLog(Level.DEBUG, FQCN, format, params, t);
} | [
"public",
"void",
"debugv",
"(",
"Throwable",
"t",
",",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLog",
"(",
"Level",
".",
"DEBUG",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"t",
")",
";",
"}"
] | Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting.
@param t the throwable
@param format the message format string
@param params the parameters | [
"Issue",
"a",
"log",
"message",
"with",
"a",
"level",
"of",
"DEBUG",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L648-L650 |
alipay/sofa-hessian | src/main/java/com/caucho/hessian/io/Hessian2Output.java | Hessian2Output.startCall | @Override
public void startCall(String method, int length)
throws IOException {
"""
Starts the method call. Clients would use <code>startCall</code>
instead of <code>call</code> if they wanted finer control over
writing the arguments, or needed to write headers.
<code><pre>
C
string # method na... | java | @Override
public void startCall(String method, int length)
throws IOException
{
int offset = _offset;
if (SIZE < offset + 32) {
flushBuffer();
offset = _offset;
}
byte[] buffer = _buffer;
buffer[_offset++] = (byte) 'C';
writeStr... | [
"@",
"Override",
"public",
"void",
"startCall",
"(",
"String",
"method",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"offset",
"=",
"_offset",
";",
"if",
"(",
"SIZE",
"<",
"offset",
"+",
"32",
")",
"{",
"flushBuffer",
"(",
")",
";",... | Starts the method call. Clients would use <code>startCall</code>
instead of <code>call</code> if they wanted finer control over
writing the arguments, or needed to write headers.
<code><pre>
C
string # method name
int # arg count
</pre></code>
@param method the method name to call. | [
"Starts",
"the",
"method",
"call",
".",
"Clients",
"would",
"use",
"<code",
">",
"startCall<",
"/",
"code",
">",
"instead",
"of",
"<code",
">",
"call<",
"/",
"code",
">",
"if",
"they",
"wanted",
"finer",
"control",
"over",
"writing",
"the",
"arguments",
... | train | https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/Hessian2Output.java#L202-L219 |
palaima/DebugDrawer | debugdrawer/src/main/java/io/palaima/debugdrawer/util/UIUtils.java | UIUtils.setBackground | public static void setBackground(View v, int drawableRes) {
"""
helper method to set the background depending on the android version
@param v
@param drawableRes
"""
setBackground(v, getCompatDrawable(v.getContext(), drawableRes));
} | java | public static void setBackground(View v, int drawableRes) {
setBackground(v, getCompatDrawable(v.getContext(), drawableRes));
} | [
"public",
"static",
"void",
"setBackground",
"(",
"View",
"v",
",",
"int",
"drawableRes",
")",
"{",
"setBackground",
"(",
"v",
",",
"getCompatDrawable",
"(",
"v",
".",
"getContext",
"(",
")",
",",
"drawableRes",
")",
")",
";",
"}"
] | helper method to set the background depending on the android version
@param v
@param drawableRes | [
"helper",
"method",
"to",
"set",
"the",
"background",
"depending",
"on",
"the",
"android",
"version"
] | train | https://github.com/palaima/DebugDrawer/blob/49b5992a1148757bd740c4a0b7df10ef70ade6d8/debugdrawer/src/main/java/io/palaima/debugdrawer/util/UIUtils.java#L53-L55 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.