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 |
|---|---|---|---|---|---|---|---|---|---|---|
tvesalainen/lpg | src/main/java/org/vesalainen/regex/Regex.java | Regex.isMatch | public boolean isMatch(PushbackReader input, int size) throws IOException {
"""
Return true if input matches the regex
@param input
@param size
@return
@throws IOException
"""
InputReader reader = Input.getInstance(input, size);
return isMatch(reader);
} | java | public boolean isMatch(PushbackReader input, int size) throws IOException
{
InputReader reader = Input.getInstance(input, size);
return isMatch(reader);
} | [
"public",
"boolean",
"isMatch",
"(",
"PushbackReader",
"input",
",",
"int",
"size",
")",
"throws",
"IOException",
"{",
"InputReader",
"reader",
"=",
"Input",
".",
"getInstance",
"(",
"input",
",",
"size",
")",
";",
"return",
"isMatch",
"(",
"reader",
")",
... | Return true if input matches the regex
@param input
@param size
@return
@throws IOException | [
"Return",
"true",
"if",
"input",
"matches",
"the",
"regex"
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/regex/Regex.java#L307-L311 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/InitOnChangeHandler.java | InitOnChangeHandler.syncClonedListener | public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) {
"""
Set this cloned listener to the same state at this listener.
@param field The field this new listener will be added to.
@param The new listener to sync to this.
@param Has the init method been called?
@return ... | java | public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled)
{
if (!bInitCalled)
{
BaseField fldTarget = this.getSyncedListenersField(m_fldTarget, listener);
((InitOnChangeHandler)listener).init(null, fldTarget);
}
return sup... | [
"public",
"boolean",
"syncClonedListener",
"(",
"BaseField",
"field",
",",
"FieldListener",
"listener",
",",
"boolean",
"bInitCalled",
")",
"{",
"if",
"(",
"!",
"bInitCalled",
")",
"{",
"BaseField",
"fldTarget",
"=",
"this",
".",
"getSyncedListenersField",
"(",
... | Set this cloned listener to the same state at this listener.
@param field The field this new listener will be added to.
@param The new listener to sync to this.
@param Has the init method been called?
@return True if I called init. | [
"Set",
"this",
"cloned",
"listener",
"to",
"the",
"same",
"state",
"at",
"this",
"listener",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/InitOnChangeHandler.java#L62-L70 |
kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/ConflictResolverUtils.java | ConflictResolverUtils.resolveConflicts | public static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern) {
"""
Resolves directive conflicts between two PatternCacheControl objects
@param specificPattern - the pattern which can be included in the second one
@param generalPattern - the pattern which includes t... | java | public static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern) {
for (Entry<Directive, String> entry : generalPattern.getDirectives().entrySet()) {
Directive generalDirective = entry.getKey();
String generalValue = entry.getValue();
... | [
"public",
"static",
"void",
"resolveConflicts",
"(",
"PatternCacheControl",
"specificPattern",
",",
"PatternCacheControl",
"generalPattern",
")",
"{",
"for",
"(",
"Entry",
"<",
"Directive",
",",
"String",
">",
"entry",
":",
"generalPattern",
".",
"getDirectives",
"(... | Resolves directive conflicts between two PatternCacheControl objects
@param specificPattern - the pattern which can be included in the second one
@param generalPattern - the pattern which includes the first one | [
"Resolves",
"directive",
"conflicts",
"between",
"two",
"PatternCacheControl",
"objects"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/ConflictResolverUtils.java#L52-L62 |
jenkinsci/jenkins | core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java | AbstractNodeMonitorDescriptor.markOffline | protected boolean markOffline(Computer c, OfflineCause oc) {
"""
Utility method to mark the computer offline for derived classes.
@return true
if the node was actually taken offline by this act (as opposed to us deciding not to do it,
or the computer already marked offline.)
"""
if(isIgnored() || ... | java | protected boolean markOffline(Computer c, OfflineCause oc) {
if(isIgnored() || c.isTemporarilyOffline()) return false; // noop
c.setTemporarilyOffline(true, oc);
// notify the admin
MonitorMarkedNodeOffline no = AdministrativeMonitor.all().get(MonitorMarkedNodeOffline.class);
i... | [
"protected",
"boolean",
"markOffline",
"(",
"Computer",
"c",
",",
"OfflineCause",
"oc",
")",
"{",
"if",
"(",
"isIgnored",
"(",
")",
"||",
"c",
".",
"isTemporarilyOffline",
"(",
")",
")",
"return",
"false",
";",
"// noop",
"c",
".",
"setTemporarilyOffline",
... | Utility method to mark the computer offline for derived classes.
@return true
if the node was actually taken offline by this act (as opposed to us deciding not to do it,
or the computer already marked offline.) | [
"Utility",
"method",
"to",
"mark",
"the",
"computer",
"offline",
"for",
"derived",
"classes",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java#L226-L236 |
rFlex/SCJavaTools | src/main/java/me/corsin/javatools/reflect/ClassIndexer.java | ClassIndexer.add | public boolean add(T element, Class<?> accessibleClass) {
"""
Associate the element with accessibleClass and any of the the superclass and interfaces
of the accessibleClass until baseClass
@param element
@param accessibleClass
@return
"""
boolean added = false;
while (accessibleClass != null && access... | java | public boolean add(T element, Class<?> accessibleClass) {
boolean added = false;
while (accessibleClass != null && accessibleClass != this.baseClass) {
added |= this.addSingle(element, accessibleClass);
for (Class<?> interf : accessibleClass.getInterfaces()) {
this.addSingle(element, interf);
}
a... | [
"public",
"boolean",
"add",
"(",
"T",
"element",
",",
"Class",
"<",
"?",
">",
"accessibleClass",
")",
"{",
"boolean",
"added",
"=",
"false",
";",
"while",
"(",
"accessibleClass",
"!=",
"null",
"&&",
"accessibleClass",
"!=",
"this",
".",
"baseClass",
")",
... | Associate the element with accessibleClass and any of the the superclass and interfaces
of the accessibleClass until baseClass
@param element
@param accessibleClass
@return | [
"Associate",
"the",
"element",
"with",
"accessibleClass",
"and",
"any",
"of",
"the",
"the",
"superclass",
"and",
"interfaces",
"of",
"the",
"accessibleClass",
"until",
"baseClass"
] | train | https://github.com/rFlex/SCJavaTools/blob/6bafee99f12a6ad73265db64776edac2bab71f67/src/main/java/me/corsin/javatools/reflect/ClassIndexer.java#L77-L91 |
Canadensys/canadensys-core | src/main/java/net/canadensys/utils/ZipUtils.java | ZipUtils.zipFolder | public static boolean zipFolder(File folder, String fileName) {
"""
Utility function to zip the content of an entire folder, but not the folder itself.
@param folder
@param fileName optional
@return success or not
"""
boolean success = false;
if(!folder.isDirectory()){
return false;
}
if(fileN... | java | public static boolean zipFolder(File folder, String fileName){
boolean success = false;
if(!folder.isDirectory()){
return false;
}
if(fileName == null){
fileName = folder.getAbsolutePath()+ZIP_EXT;
}
ZipArchiveOutputStream zipOutput = null;
try {
zipOutput = new ZipArchiveOutputStream(new F... | [
"public",
"static",
"boolean",
"zipFolder",
"(",
"File",
"folder",
",",
"String",
"fileName",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"if",
"(",
"!",
"folder",
".",
"isDirectory",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
... | Utility function to zip the content of an entire folder, but not the folder itself.
@param folder
@param fileName optional
@return success or not | [
"Utility",
"function",
"to",
"zip",
"the",
"content",
"of",
"an",
"entire",
"folder",
"but",
"not",
"the",
"folder",
"itself",
"."
] | train | https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ZipUtils.java#L34-L64 |
JoeKerouac/utils | src/main/java/com/joe/utils/secure/KeyTools.java | KeyTools.buildKey | public static SecretKey buildKey(AbstractCipher.Algorithms algorithm, String seed,
int keySize) {
"""
使用指定password构建对称加密的Key,即使seed相同构建出来的key也会不同,因为seed仅用于生成随机数种
子,keySize有一定限制,详情参照README
@param algorithm 算法名称,当前仅支持AES和DES
@param seed 用来生成随机数的种子
@param keySize keyS... | java | public static SecretKey buildKey(AbstractCipher.Algorithms algorithm, String seed,
int keySize) {
log.debug("开始构建对称加密[{}]的Key,Keysize为:[{}]", algorithm, keySize);
String name = algorithm.name();
try {
KeyGenerator kgen = KeyGenerator.getInstance(n... | [
"public",
"static",
"SecretKey",
"buildKey",
"(",
"AbstractCipher",
".",
"Algorithms",
"algorithm",
",",
"String",
"seed",
",",
"int",
"keySize",
")",
"{",
"log",
".",
"debug",
"(",
"\"开始构建对称加密[{}]的Key,Keysize为:[{}]\", algorithm, keySize);",
"",
"",
"",
"",
"",
... | 使用指定password构建对称加密的Key,即使seed相同构建出来的key也会不同,因为seed仅用于生成随机数种
子,keySize有一定限制,详情参照README
@param algorithm 算法名称,当前仅支持AES和DES
@param seed 用来生成随机数的种子
@param keySize keySize
@return 对称加密的key | [
"使用指定password构建对称加密的Key,即使seed相同构建出来的key也会不同,因为seed仅用于生成随机数种",
"子,keySize有一定限制,详情参照README"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/secure/KeyTools.java#L105-L116 |
febit/wit | wit-core/src/main/java/org/febit/wit/global/GlobalManager.java | GlobalManager.forEachConst | public void forEachConst(BiConsumer<String, Object> action) {
"""
Performs the given action for each const vars until all have been processed or the action throws an exception.
@param action
@since 2.5.0
"""
Objects.requireNonNull(action);
this.constVars.forEach(action);
} | java | public void forEachConst(BiConsumer<String, Object> action) {
Objects.requireNonNull(action);
this.constVars.forEach(action);
} | [
"public",
"void",
"forEachConst",
"(",
"BiConsumer",
"<",
"String",
",",
"Object",
">",
"action",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"action",
")",
";",
"this",
".",
"constVars",
".",
"forEach",
"(",
"action",
")",
";",
"}"
] | Performs the given action for each const vars until all have been processed or the action throws an exception.
@param action
@since 2.5.0 | [
"Performs",
"the",
"given",
"action",
"for",
"each",
"const",
"vars",
"until",
"all",
"have",
"been",
"processed",
"or",
"the",
"action",
"throws",
"an",
"exception",
"."
] | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit/global/GlobalManager.java#L50-L53 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.getPath | @Deprecated
public static URI getPath(String bucketName, String objectName) {
"""
Construct a URI using the legacy path codec.
@deprecated This method is deprecated as each instance of GCS FS can be configured
with a codec.
"""
return LEGACY_PATH_CODEC.getPath(
bucketName, objectName, false /... | java | @Deprecated
public static URI getPath(String bucketName, String objectName) {
return LEGACY_PATH_CODEC.getPath(
bucketName, objectName, false /* do not allow empty object */);
} | [
"@",
"Deprecated",
"public",
"static",
"URI",
"getPath",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
")",
"{",
"return",
"LEGACY_PATH_CODEC",
".",
"getPath",
"(",
"bucketName",
",",
"objectName",
",",
"false",
"/* do not allow empty object */",
")",
... | Construct a URI using the legacy path codec.
@deprecated This method is deprecated as each instance of GCS FS can be configured
with a codec. | [
"Construct",
"a",
"URI",
"using",
"the",
"legacy",
"path",
"codec",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1569-L1573 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bmr/BmrClient.java | BmrClient.listInstances | public ListInstancesResponse listInstances(String clusterId, String instanceGroupId) {
"""
List the instances belonging to the target instance in the BMR cluster.
@param clusterId the ID of target BMR cluster.
@param instanceGroupId the ID of target instance group.
@return The response containing a list of In... | java | public ListInstancesResponse listInstances(String clusterId, String instanceGroupId) {
return listInstances(new ListInstancesRequest().withClusterId(clusterId).withInstanceGroupId(instanceGroupId));
} | [
"public",
"ListInstancesResponse",
"listInstances",
"(",
"String",
"clusterId",
",",
"String",
"instanceGroupId",
")",
"{",
"return",
"listInstances",
"(",
"new",
"ListInstancesRequest",
"(",
")",
".",
"withClusterId",
"(",
"clusterId",
")",
".",
"withInstanceGroupId"... | List the instances belonging to the target instance in the BMR cluster.
@param clusterId the ID of target BMR cluster.
@param instanceGroupId the ID of target instance group.
@return The response containing a list of Instance objects. | [
"List",
"the",
"instances",
"belonging",
"to",
"the",
"target",
"instance",
"in",
"the",
"BMR",
"cluster",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bmr/BmrClient.java#L410-L412 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/common/CoGProperties.java | CoGProperties.getReverseDNSCacheType | public String getReverseDNSCacheType() {
"""
Returns the reverse DNS cache type.
Defaults to a threaded chache.
@return the type of cache for reverse DNS requests
"""
String value = System.getProperty(REVERSE_DNS_CACHETYPE);
if (value != null) {
return value;
}
r... | java | public String getReverseDNSCacheType() {
String value = System.getProperty(REVERSE_DNS_CACHETYPE);
if (value != null) {
return value;
}
return getProperty(REVERSE_DNS_CACHETYPE, THREADED_CACHE);
} | [
"public",
"String",
"getReverseDNSCacheType",
"(",
")",
"{",
"String",
"value",
"=",
"System",
".",
"getProperty",
"(",
"REVERSE_DNS_CACHETYPE",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"value",
";",
"}",
"return",
"getProperty",
"(",
... | Returns the reverse DNS cache type.
Defaults to a threaded chache.
@return the type of cache for reverse DNS requests | [
"Returns",
"the",
"reverse",
"DNS",
"cache",
"type",
".",
"Defaults",
"to",
"a",
"threaded",
"chache",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/common/CoGProperties.java#L645-L651 |
Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.existsTable | public boolean existsTable(String keyspace, String table, boolean showLog) {
"""
Checks if a keyspace contains an especific table.
@param keyspace
@param table
@param showLog
@return boolean
"""
this.metadata = this.cluster.getMetadata();
if (!(this.metadata.getKeyspace(keyspace).getTabl... | java | public boolean existsTable(String keyspace, String table, boolean showLog) {
this.metadata = this.cluster.getMetadata();
if (!(this.metadata.getKeyspace(keyspace).getTables().isEmpty())) {
for (TableMetadata t : this.metadata.getKeyspace(keyspace).getTables()) {
if (t.getNam... | [
"public",
"boolean",
"existsTable",
"(",
"String",
"keyspace",
",",
"String",
"table",
",",
"boolean",
"showLog",
")",
"{",
"this",
".",
"metadata",
"=",
"this",
".",
"cluster",
".",
"getMetadata",
"(",
")",
";",
"if",
"(",
"!",
"(",
"this",
".",
"meta... | Checks if a keyspace contains an especific table.
@param keyspace
@param table
@param showLog
@return boolean | [
"Checks",
"if",
"a",
"keyspace",
"contains",
"an",
"especific",
"table",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L281-L292 |
pravega/pravega | common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java | ExecutorServiceHelpers.getThreadFactory | public static ThreadFactory getThreadFactory(String groupName) {
"""
Creates and returns a thread factory that will create threads with the given name prefix.
@param groupName the name of the threads
@return a thread factory
"""
return new ThreadFactory() {
final AtomicInteger threadCou... | java | public static ThreadFactory getThreadFactory(String groupName) {
return new ThreadFactory() {
final AtomicInteger threadCount = new AtomicInteger();
@Override
public Thread newThread(Runnable r) {
Thread thread = new Thread(r, groupName + "-" + threadCount.in... | [
"public",
"static",
"ThreadFactory",
"getThreadFactory",
"(",
"String",
"groupName",
")",
"{",
"return",
"new",
"ThreadFactory",
"(",
")",
"{",
"final",
"AtomicInteger",
"threadCount",
"=",
"new",
"AtomicInteger",
"(",
")",
";",
"@",
"Override",
"public",
"Threa... | Creates and returns a thread factory that will create threads with the given name prefix.
@param groupName the name of the threads
@return a thread factory | [
"Creates",
"and",
"returns",
"a",
"thread",
"factory",
"that",
"will",
"create",
"threads",
"with",
"the",
"given",
"name",
"prefix",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java#L52-L63 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/ParsedSelectStmt.java | ParsedSelectStmt.rewriteAsMV | ParsedSelectStmt rewriteAsMV(Table view) {
"""
Updates miscellaneous fields as part of rewriting as materialized view.
"""
m_groupByColumns.clear();
m_distinctGroupByColumns = null;
m_groupByExpressions.clear();
m_distinctProjectSchema = null;
m_distinct = m_hasAggregate... | java | ParsedSelectStmt rewriteAsMV(Table view) {
m_groupByColumns.clear();
m_distinctGroupByColumns = null;
m_groupByExpressions.clear();
m_distinctProjectSchema = null;
m_distinct = m_hasAggregateExpression = m_hasComplexGroupby = m_hasComplexAgg = false;
// Resets paramsBy* f... | [
"ParsedSelectStmt",
"rewriteAsMV",
"(",
"Table",
"view",
")",
"{",
"m_groupByColumns",
".",
"clear",
"(",
")",
";",
"m_distinctGroupByColumns",
"=",
"null",
";",
"m_groupByExpressions",
".",
"clear",
"(",
")",
";",
"m_distinctProjectSchema",
"=",
"null",
";",
"m... | Updates miscellaneous fields as part of rewriting as materialized view. | [
"Updates",
"miscellaneous",
"fields",
"as",
"part",
"of",
"rewriting",
"as",
"materialized",
"view",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/ParsedSelectStmt.java#L186-L208 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/Utils.java | Utils.getResourceLocation | public static ResourceLocation getResourceLocation(String name) {
"""
Creates a {@link ResourceLocation} from the specified name.<br>
The name is split on ':' to find the modid.<br>
If the modid is not specified, the current active mod container is used, or "minecraft" if none is found.
@param name the name
... | java | public static ResourceLocation getResourceLocation(String name)
{
int index = name.lastIndexOf(':');
String res = null;
String modid = null;
if (index == -1)
{
ModContainer container = Loader.instance().activeModContainer();
modid = container != null ? container.getModId() : "minecraft";
res = name;... | [
"public",
"static",
"ResourceLocation",
"getResourceLocation",
"(",
"String",
"name",
")",
"{",
"int",
"index",
"=",
"name",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"String",
"res",
"=",
"null",
";",
"String",
"modid",
"=",
"null",
";",
"if",
"(",
... | Creates a {@link ResourceLocation} from the specified name.<br>
The name is split on ':' to find the modid.<br>
If the modid is not specified, the current active mod container is used, or "minecraft" if none is found.
@param name the name
@return the resource location | [
"Creates",
"a",
"{",
"@link",
"ResourceLocation",
"}",
"from",
"the",
"specified",
"name",
".",
"<br",
">",
"The",
"name",
"is",
"split",
"on",
":",
"to",
"find",
"the",
"modid",
".",
"<br",
">",
"If",
"the",
"modid",
"is",
"not",
"specified",
"the",
... | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/Utils.java#L107-L125 |
logic-ng/LogicNG | src/main/java/org/logicng/cardinalityconstraints/CCTotalizer.java | CCTotalizer.buildEXK | void buildEXK(final EncodingResult result, final Variable[] vars, int rhs) {
"""
Builds an exactly-k constraint.
@param vars the variables
@param rhs the right-hand side
@throws IllegalArgumentException if the right hand side of the constraint was negative
"""
final LNGVector<Variable> cardinalityOutva... | java | void buildEXK(final EncodingResult result, final Variable[] vars, int rhs) {
final LNGVector<Variable> cardinalityOutvars = this.initializeConstraint(result, vars);
this.toCNF(cardinalityOutvars, rhs, Bound.BOTH);
assert this.cardinalityInvars.size() == 0;
for (int i = 0; i < rhs; i++)
this.result... | [
"void",
"buildEXK",
"(",
"final",
"EncodingResult",
"result",
",",
"final",
"Variable",
"[",
"]",
"vars",
",",
"int",
"rhs",
")",
"{",
"final",
"LNGVector",
"<",
"Variable",
">",
"cardinalityOutvars",
"=",
"this",
".",
"initializeConstraint",
"(",
"result",
... | Builds an exactly-k constraint.
@param vars the variables
@param rhs the right-hand side
@throws IllegalArgumentException if the right hand side of the constraint was negative | [
"Builds",
"an",
"exactly",
"-",
"k",
"constraint",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/cardinalityconstraints/CCTotalizer.java#L114-L122 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/filter/RawScale2x.java | RawScale2x.setDestPixel | private void setDestPixel(int[] dstImage, int x, int y, int p) {
"""
Set destination pixel.
@param dstImage The image destination.
@param x The location x.
@param y The location y.
@param p The pixel destination value.
"""
dstImage[x + y * width * SCALE] = p;
} | java | private void setDestPixel(int[] dstImage, int x, int y, int p)
{
dstImage[x + y * width * SCALE] = p;
} | [
"private",
"void",
"setDestPixel",
"(",
"int",
"[",
"]",
"dstImage",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"p",
")",
"{",
"dstImage",
"[",
"x",
"+",
"y",
"*",
"width",
"*",
"SCALE",
"]",
"=",
"p",
";",
"}"
] | Set destination pixel.
@param dstImage The image destination.
@param x The location x.
@param y The location y.
@param p The pixel destination value. | [
"Set",
"destination",
"pixel",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/filter/RawScale2x.java#L76-L79 |
mapbox/mapbox-navigation-android | libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationTelemetry.java | NavigationTelemetry.startSession | void startSession(DirectionsRoute directionsRoute, LocationEngine locationEngineName) {
"""
Called when navigation is starting for the first time.
Initializes the {@link SessionState}.
@param directionsRoute first route passed to navigation
"""
updateLocationEngineNameAndSimulation(locationEngineName);... | java | void startSession(DirectionsRoute directionsRoute, LocationEngine locationEngineName) {
updateLocationEngineNameAndSimulation(locationEngineName);
navigationSessionState = navigationSessionState.toBuilder()
.sessionIdentifier(TelemetryUtils.obtainUniversalUniqueIdentifier())
.tripIdentifier(Telemetr... | [
"void",
"startSession",
"(",
"DirectionsRoute",
"directionsRoute",
",",
"LocationEngine",
"locationEngineName",
")",
"{",
"updateLocationEngineNameAndSimulation",
"(",
"locationEngineName",
")",
";",
"navigationSessionState",
"=",
"navigationSessionState",
".",
"toBuilder",
"... | Called when navigation is starting for the first time.
Initializes the {@link SessionState}.
@param directionsRoute first route passed to navigation | [
"Called",
"when",
"navigation",
"is",
"starting",
"for",
"the",
"first",
"time",
".",
"Initializes",
"the",
"{",
"@link",
"SessionState",
"}",
"."
] | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationTelemetry.java#L157-L172 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/inventoryservice/GetAllAdUnitSizes.java | GetAllAdUnitSizes.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the InventoryService.
InventoryServiceInterface inventoryService =
adManagerServices.get(session, InventoryServiceInterface.class);
// Create a statement to select all ... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the InventoryService.",
"InventoryServiceInterface",
"inventoryService",
"=",
"adManagerServices",
".",
... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/inventoryservice/GetAllAdUnitSizes.java#L50-L73 |
belaban/jgroups-raft | src/org/jgroups/protocols/raft/RaftImpl.java | RaftImpl.getFirstIndexOfConflictingTerm | protected int getFirstIndexOfConflictingTerm(int start_index, int conflicting_term) {
"""
Finds the first index at which conflicting_term starts, going back from start_index towards the head of the log
"""
Log log=raft.log_impl;
int first=Math.max(1, log.firstAppended()), last=log.lastAppended(... | java | protected int getFirstIndexOfConflictingTerm(int start_index, int conflicting_term) {
Log log=raft.log_impl;
int first=Math.max(1, log.firstAppended()), last=log.lastAppended();
int retval=Math.min(start_index, last);
for(int i=retval; i >= first; i--) {
LogEntry entry=log.ge... | [
"protected",
"int",
"getFirstIndexOfConflictingTerm",
"(",
"int",
"start_index",
",",
"int",
"conflicting_term",
")",
"{",
"Log",
"log",
"=",
"raft",
".",
"log_impl",
";",
"int",
"first",
"=",
"Math",
".",
"max",
"(",
"1",
",",
"log",
".",
"firstAppended",
... | Finds the first index at which conflicting_term starts, going back from start_index towards the head of the log | [
"Finds",
"the",
"first",
"index",
"at",
"which",
"conflicting_term",
"starts",
"going",
"back",
"from",
"start_index",
"towards",
"the",
"head",
"of",
"the",
"log"
] | train | https://github.com/belaban/jgroups-raft/blob/5923a4761df50bfd203cc82cefc138694b4d7fc3/src/org/jgroups/protocols/raft/RaftImpl.java#L83-L94 |
CenturyLinkCloud/clc-java-sdk | sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/InvoiceService.java | InvoiceService.getInvoice | public InvoiceData getInvoice(int year, int month, String pricingAccountAlias) {
"""
Gets a list of invoicing data for a given account alias for a given month.
@param year Year of usage
@param month Monthly period of usage
@param pricingAccountAlias Short code of the account that sends the invoice for the accou... | java | public InvoiceData getInvoice(int year, int month, String pricingAccountAlias) {
return client.getInvoice(year, month, pricingAccountAlias);
} | [
"public",
"InvoiceData",
"getInvoice",
"(",
"int",
"year",
",",
"int",
"month",
",",
"String",
"pricingAccountAlias",
")",
"{",
"return",
"client",
".",
"getInvoice",
"(",
"year",
",",
"month",
",",
"pricingAccountAlias",
")",
";",
"}"
] | Gets a list of invoicing data for a given account alias for a given month.
@param year Year of usage
@param month Monthly period of usage
@param pricingAccountAlias Short code of the account that sends the invoice for the accountAlias
@return the invoice data | [
"Gets",
"a",
"list",
"of",
"invoicing",
"data",
"for",
"a",
"given",
"account",
"alias",
"for",
"a",
"given",
"month",
"."
] | train | https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/InvoiceService.java#L43-L45 |
op4j/op4j | src/main/java/org/op4j/functions/FnString.java | FnString.toFloat | public static final Function<String,Float> toFloat(final int scale, final RoundingMode roundingMode) {
"""
<p>
Converts a String into a Float, using the default configuration
for for decimal point and thousands separator and establishing the specified scale. Rounding
mode is used for setting the scale to the sp... | java | public static final Function<String,Float> toFloat(final int scale, final RoundingMode roundingMode) {
return new ToFloat(scale, roundingMode);
} | [
"public",
"static",
"final",
"Function",
"<",
"String",
",",
"Float",
">",
"toFloat",
"(",
"final",
"int",
"scale",
",",
"final",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"new",
"ToFloat",
"(",
"scale",
",",
"roundingMode",
")",
";",
"}"
] | <p>
Converts a String into a Float, using the default configuration
for for decimal point and thousands separator and establishing the specified scale. Rounding
mode is used for setting the scale to the specified value.
The input string must be between
{@link Float#MIN_VALUE} and {@link Float#MAX_VALUE}
</p>
@param sc... | [
"<p",
">",
"Converts",
"a",
"String",
"into",
"a",
"Float",
"using",
"the",
"default",
"configuration",
"for",
"for",
"decimal",
"point",
"and",
"thousands",
"separator",
"and",
"establishing",
"the",
"specified",
"scale",
".",
"Rounding",
"mode",
"is",
"used"... | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnString.java#L619-L621 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/JapaneseEra.java | JapaneseEra.registerEra | public static JapaneseEra registerEra(LocalDate since, String name) {
"""
Registers an additional instance of {@code JapaneseEra}.
<p>
A new Japanese era can begin at any time.
This method allows one new era to be registered without the need for a new library version.
If needed, callers should assign the resul... | java | public static JapaneseEra registerEra(LocalDate since, String name) {
JapaneseEra[] known = KNOWN_ERAS.get();
if (known.length > 4) {
throw new DateTimeException("Only one additional Japanese era can be added");
}
Jdk8Methods.requireNonNull(since, "since");
Jdk8Method... | [
"public",
"static",
"JapaneseEra",
"registerEra",
"(",
"LocalDate",
"since",
",",
"String",
"name",
")",
"{",
"JapaneseEra",
"[",
"]",
"known",
"=",
"KNOWN_ERAS",
".",
"get",
"(",
")",
";",
"if",
"(",
"known",
".",
"length",
">",
"4",
")",
"{",
"throw"... | Registers an additional instance of {@code JapaneseEra}.
<p>
A new Japanese era can begin at any time.
This method allows one new era to be registered without the need for a new library version.
If needed, callers should assign the result to a static variable accessible
across the application. This must be done once, i... | [
"Registers",
"an",
"additional",
"instance",
"of",
"{",
"@code",
"JapaneseEra",
"}",
".",
"<p",
">",
"A",
"new",
"Japanese",
"era",
"can",
"begin",
"at",
"any",
"time",
".",
"This",
"method",
"allows",
"one",
"new",
"era",
"to",
"be",
"registered",
"with... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/JapaneseEra.java#L173-L190 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/util/NativeLibraryLoader.java | NativeLibraryLoader.loadLibraryFromClasspath | public static void loadLibraryFromClasspath(String path) throws IOException {
"""
Loads library from classpath
The file from classpath is copied into system temporary directory and then loaded. The temporary file is
deleted after exiting. Method uses String as filename because the pathname is
"abstract", not ... | java | public static void loadLibraryFromClasspath(String path) throws IOException {
Path inputPath = Paths.get(path);
if (!inputPath.isAbsolute()) {
throw new IllegalArgumentException("The path has to be absolute, but found: " + inputPath);
}
String fileNameFull = inputPath.getFileName().toString();
int dotInd... | [
"public",
"static",
"void",
"loadLibraryFromClasspath",
"(",
"String",
"path",
")",
"throws",
"IOException",
"{",
"Path",
"inputPath",
"=",
"Paths",
".",
"get",
"(",
"path",
")",
";",
"if",
"(",
"!",
"inputPath",
".",
"isAbsolute",
"(",
")",
")",
"{",
"t... | Loads library from classpath
The file from classpath is copied into system temporary directory and then loaded. The temporary file is
deleted after exiting. Method uses String as filename because the pathname is
"abstract", not system-dependent.
@param path
The file path in classpath as an absolute path, e.g. /packag... | [
"Loads",
"library",
"from",
"classpath"
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/util/NativeLibraryLoader.java#L132-L160 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/utils/BtcFormat.java | BtcFormat.getMilliInstance | public static BtcFormat getMilliInstance(int scale, int... groups) {
"""
Return a new millicoin-denominated formatter with the specified fractional decimal
placing. The returned object will format and parse values according to the default
locale, and will format the fractional part of numbers with the given min... | java | public static BtcFormat getMilliInstance(int scale, int... groups) {
return getInstance(MILLICOIN_SCALE, defaultLocale(), scale, boxAsList(groups));
} | [
"public",
"static",
"BtcFormat",
"getMilliInstance",
"(",
"int",
"scale",
",",
"int",
"...",
"groups",
")",
"{",
"return",
"getInstance",
"(",
"MILLICOIN_SCALE",
",",
"defaultLocale",
"(",
")",
",",
"scale",
",",
"boxAsList",
"(",
"groups",
")",
")",
";",
... | Return a new millicoin-denominated formatter with the specified fractional decimal
placing. The returned object will format and parse values according to the default
locale, and will format the fractional part of numbers with the given minimum number of
fractional decimal places. Optionally, repeating integer argumen... | [
"Return",
"a",
"new",
"millicoin",
"-",
"denominated",
"formatter",
"with",
"the",
"specified",
"fractional",
"decimal",
"placing",
".",
"The",
"returned",
"object",
"will",
"format",
"and",
"parse",
"values",
"according",
"to",
"the",
"default",
"locale",
"and"... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/BtcFormat.java#L996-L998 |
infinispan/infinispan | core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java | ParseUtils.missingRequired | public static XMLStreamException missingRequired(final XMLStreamReader reader, final Set<?> required) {
"""
Get an exception reporting a missing, required XML attribute.
@param reader the stream reader
@param required a set of enums whose toString method returns the
attribute name
@return the exception
"""... | java | public static XMLStreamException missingRequired(final XMLStreamReader reader, final Set<?> required) {
final StringBuilder b = new StringBuilder();
Iterator<?> iterator = required.iterator();
while (iterator.hasNext()) {
final Object o = iterator.next();
b.append(o.toStr... | [
"public",
"static",
"XMLStreamException",
"missingRequired",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"Set",
"<",
"?",
">",
"required",
")",
"{",
"final",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Iterator",
"<",
"?",
... | Get an exception reporting a missing, required XML attribute.
@param reader the stream reader
@param required a set of enums whose toString method returns the
attribute name
@return the exception | [
"Get",
"an",
"exception",
"reporting",
"a",
"missing",
"required",
"XML",
"attribute",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java#L89-L100 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java | GeoJsonWriteDriver.writeProperties | private void writeProperties(JsonGenerator jsonGenerator, ResultSet rs) throws IOException, SQLException {
"""
Write the GeoJSON properties.
@param jsonGenerator
@param rs
@throws IOException
"""
if (columnCountProperties != -1) {
jsonGenerator.writeObjectFieldStart("properties");
... | java | private void writeProperties(JsonGenerator jsonGenerator, ResultSet rs) throws IOException, SQLException {
if (columnCountProperties != -1) {
jsonGenerator.writeObjectFieldStart("properties");
for (Map.Entry<String, Integer> entry : cachedColumnNames.entrySet()) {
String ... | [
"private",
"void",
"writeProperties",
"(",
"JsonGenerator",
"jsonGenerator",
",",
"ResultSet",
"rs",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"if",
"(",
"columnCountProperties",
"!=",
"-",
"1",
")",
"{",
"jsonGenerator",
".",
"writeObjectFieldStart",
... | Write the GeoJSON properties.
@param jsonGenerator
@param rs
@throws IOException | [
"Write",
"the",
"GeoJSON",
"properties",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java#L564-L588 |
lviggiano/owner | owner/src/main/java/org/aeonbits/owner/ConfigFactory.java | ConfigFactory.newInstance | public static Factory newInstance() {
"""
Returns a new instance of a config Factory object.
@return a new instance of a config Factory object.
"""
ScheduledExecutorService scheduler = newSingleThreadScheduledExecutor(new ThreadFactory() {
public Thread newThread(Runnable r) {
... | java | public static Factory newInstance() {
ScheduledExecutorService scheduler = newSingleThreadScheduledExecutor(new ThreadFactory() {
public Thread newThread(Runnable r) {
Thread result = new Thread(r);
result.setDaemon(true);
return result;
}
... | [
"public",
"static",
"Factory",
"newInstance",
"(",
")",
"{",
"ScheduledExecutorService",
"scheduler",
"=",
"newSingleThreadScheduledExecutor",
"(",
"new",
"ThreadFactory",
"(",
")",
"{",
"public",
"Thread",
"newThread",
"(",
"Runnable",
"r",
")",
"{",
"Thread",
"r... | Returns a new instance of a config Factory object.
@return a new instance of a config Factory object. | [
"Returns",
"a",
"new",
"instance",
"of",
"a",
"config",
"Factory",
"object",
"."
] | train | https://github.com/lviggiano/owner/blob/1223ecfbe3c275b3b7c5ec13e9238c9bb888754f/owner/src/main/java/org/aeonbits/owner/ConfigFactory.java#L45-L55 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java | ImplBinaryNaiveOps.getT | public static boolean getT(GrayU8 image, int x, int y) {
"""
If a point is inside the image true is returned if its value is not zero, otherwise true is returned.
"""
if (image.isInBounds(x, y)) {
return image.get(x, y) != 0;
} else {
return true;
}
} | java | public static boolean getT(GrayU8 image, int x, int y) {
if (image.isInBounds(x, y)) {
return image.get(x, y) != 0;
} else {
return true;
}
} | [
"public",
"static",
"boolean",
"getT",
"(",
"GrayU8",
"image",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"image",
".",
"isInBounds",
"(",
"x",
",",
"y",
")",
")",
"{",
"return",
"image",
".",
"get",
"(",
"x",
",",
"y",
")",
"!=",
... | If a point is inside the image true is returned if its value is not zero, otherwise true is returned. | [
"If",
"a",
"point",
"is",
"inside",
"the",
"image",
"true",
"is",
"returned",
"if",
"its",
"value",
"is",
"not",
"zero",
"otherwise",
"true",
"is",
"returned",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java#L183-L189 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewaysInner.java | ExpressRouteGatewaysInner.getByResourceGroup | public ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName) {
"""
Fetches the details of a ExpressRoute gateway in a resource group.
@param resourceGroupName The name of the resource group.
@param expressRouteGatewayName The name of the ExpressRoute gateway.
@t... | java | public ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).toBlocking().single().body();
} | [
"public",
"ExpressRouteGatewayInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRouteGatewayName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"expressRouteGatewayName",
")",
".",
"toBlo... | Fetches the details of a ExpressRoute gateway in a resource group.
@param resourceGroupName The name of the resource group.
@param expressRouteGatewayName The name of the ExpressRoute gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is reje... | [
"Fetches",
"the",
"details",
"of",
"a",
"ExpressRoute",
"gateway",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewaysInner.java#L437-L439 |
coveo/fmt-maven-plugin | src/main/java/com/coveo/Check.java | Check.onNonComplyingFile | @Override
protected void onNonComplyingFile(final File file, final String formatted) throws IOException {
"""
Hook called when the processd file is not compliant with the formatter.
@param file the file that is not compliant
@param formatted the corresponding formatted of the file.
"""
filesNotFormat... | java | @Override
protected void onNonComplyingFile(final File file, final String formatted) throws IOException {
filesNotFormatted.add(file.getAbsolutePath());
} | [
"@",
"Override",
"protected",
"void",
"onNonComplyingFile",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"formatted",
")",
"throws",
"IOException",
"{",
"filesNotFormatted",
".",
"add",
"(",
"file",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"}"
] | Hook called when the processd file is not compliant with the formatter.
@param file the file that is not compliant
@param formatted the corresponding formatted of the file. | [
"Hook",
"called",
"when",
"the",
"processd",
"file",
"is",
"not",
"compliant",
"with",
"the",
"formatter",
"."
] | train | https://github.com/coveo/fmt-maven-plugin/blob/9368be6985ecc2126c875ff4aabe647c7e57ecca/src/main/java/com/coveo/Check.java#L73-L76 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.notPositive | @Throws(IllegalPositiveArgumentException.class)
public static double notPositive(final double value, @Nullable final String name) {
"""
Ensures that an double reference passed as a parameter to the calling method is not greater than {@code 0}.
@param value
a number
@param name
name of the number reference (... | java | @Throws(IllegalPositiveArgumentException.class)
public static double notPositive(final double value, @Nullable final String name) {
if (value > 0.0) {
throw new IllegalPositiveArgumentException(name, value);
}
return value;
} | [
"@",
"Throws",
"(",
"IllegalPositiveArgumentException",
".",
"class",
")",
"public",
"static",
"double",
"notPositive",
"(",
"final",
"double",
"value",
",",
"@",
"Nullable",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"value",
">",
"0.0",
")",
"{",
"t... | Ensures that an double reference passed as a parameter to the calling method is not greater than {@code 0}.
@param value
a number
@param name
name of the number reference (in source code)
@return the non-null reference that was validated
@throws IllegalNullArgumentException
if the given argument {@code reference} is s... | [
"Ensures",
"that",
"an",
"double",
"reference",
"passed",
"as",
"a",
"parameter",
"to",
"the",
"calling",
"method",
"is",
"not",
"greater",
"than",
"{",
"@code",
"0",
"}",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L3019-L3025 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/SinglePerturbationNeighbourhood.java | SinglePerturbationNeighbourhood.getAllMoves | @Override
public List<SubsetMove> getAllMoves(SubsetSolution solution) {
"""
Generate all valid swap, deletion and addition moves that transform the given subset solution into
a neighbour within the minimum and maximum allowed subset size. The returned list may be empty,
if no valid moves exist. If any fixed... | java | @Override
public List<SubsetMove> getAllMoves(SubsetSolution solution) {
// get set of candidate IDs for deletion and addition (fixed IDs are discarded)
Set<Integer> removeCandidates = getRemoveCandidates(solution);
Set<Integer> addCandidates = getAddCandidates(solution);
// create e... | [
"@",
"Override",
"public",
"List",
"<",
"SubsetMove",
">",
"getAllMoves",
"(",
"SubsetSolution",
"solution",
")",
"{",
"// get set of candidate IDs for deletion and addition (fixed IDs are discarded)",
"Set",
"<",
"Integer",
">",
"removeCandidates",
"=",
"getRemoveCandidates"... | Generate all valid swap, deletion and addition moves that transform the given subset solution into
a neighbour within the minimum and maximum allowed subset size. The returned list may be empty,
if no valid moves exist. If any fixed IDs have been specified, these will not be considered
for deletion nor addition.
@para... | [
"Generate",
"all",
"valid",
"swap",
"deletion",
"and",
"addition",
"moves",
"that",
"transform",
"the",
"given",
"subset",
"solution",
"into",
"a",
"neighbour",
"within",
"the",
"minimum",
"and",
"maximum",
"allowed",
"subset",
"size",
".",
"The",
"returned",
... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/SinglePerturbationNeighbourhood.java#L184-L212 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkConfigurator.java | FrameworkConfigurator.getFrameworkFactory | public static FrameworkFactory getFrameworkFactory(ClassLoader loader) {
"""
Use the provided classloader to find the target FrameworkFactory via the
ServiceLoader pattern. If the
"META-INF/services/org.osgi.framework.launch.FrameworkFactory" resource
is found on the classpath, it is read for the first non-comm... | java | public static FrameworkFactory getFrameworkFactory(ClassLoader loader) {
FrameworkFactory factory = null;
Class<?> factoryClass = null;
final String factoryResource = "META-INF/services/org.osgi.framework.launch.FrameworkFactory";
java.io.InputStream inputstream = loader.getResourceAsS... | [
"public",
"static",
"FrameworkFactory",
"getFrameworkFactory",
"(",
"ClassLoader",
"loader",
")",
"{",
"FrameworkFactory",
"factory",
"=",
"null",
";",
"Class",
"<",
"?",
">",
"factoryClass",
"=",
"null",
";",
"final",
"String",
"factoryResource",
"=",
"\"META-INF... | Use the provided classloader to find the target FrameworkFactory via the
ServiceLoader pattern. If the
"META-INF/services/org.osgi.framework.launch.FrameworkFactory" resource
is found on the classpath, it is read for the first non-comment line
containing a classname. That factory is then used as the service class
for c... | [
"Use",
"the",
"provided",
"classloader",
"to",
"find",
"the",
"target",
"FrameworkFactory",
"via",
"the",
"ServiceLoader",
"pattern",
".",
"If",
"the",
"META",
"-",
"INF",
"/",
"services",
"/",
"org",
".",
"osgi",
".",
"framework",
".",
"launch",
".",
"Fra... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkConfigurator.java#L208-L245 |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java | ClientController.addClient | @RequestMapping(value = "/api/profile/ {
"""
Returns a new client id for the profileIdentifier
@param model
@param profileIdentifier
@return json with a new client_id
@throws Exception
"""profileIdentifier}/clients", method = RequestMethod.POST)
public
@ResponseBody
HashMap<String, Object> ad... | java | @RequestMapping(value = "/api/profile/{profileIdentifier}/clients", method = RequestMethod.POST)
public
@ResponseBody
HashMap<String, Object> addClient(Model model,
@PathVariable("profileIdentifier") String profileIdentifier,
@Reque... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/api/profile/{profileIdentifier}/clients\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"@",
"ResponseBody",
"HashMap",
"<",
"String",
",",
"Object",
">",
"addClient",
"(",
"Model",
"model",
",",
... | Returns a new client id for the profileIdentifier
@param model
@param profileIdentifier
@return json with a new client_id
@throws Exception | [
"Returns",
"a",
"new",
"client",
"id",
"for",
"the",
"profileIdentifier"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java#L104-L128 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java | JobControllerClient.cancelJob | public final Job cancelJob(String projectId, String region, String jobId) {
"""
Starts a job cancellation request. To access the job resource after cancellation, call
[regions/{region}/jobs.list](/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or
[regions/{region}/jobs.get](/dataproc/docs/reference/... | java | public final Job cancelJob(String projectId, String region, String jobId) {
CancelJobRequest request =
CancelJobRequest.newBuilder()
.setProjectId(projectId)
.setRegion(region)
.setJobId(jobId)
.build();
return cancelJob(request);
} | [
"public",
"final",
"Job",
"cancelJob",
"(",
"String",
"projectId",
",",
"String",
"region",
",",
"String",
"jobId",
")",
"{",
"CancelJobRequest",
"request",
"=",
"CancelJobRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
")",
".",
... | Starts a job cancellation request. To access the job resource after cancellation, call
[regions/{region}/jobs.list](/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or
[regions/{region}/jobs.get](/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).
<p>Sample code:
<pre><code>
try (JobControllerCli... | [
"Starts",
"a",
"job",
"cancellation",
"request",
".",
"To",
"access",
"the",
"job",
"resource",
"after",
"cancellation",
"call",
"[",
"regions",
"/",
"{",
"region",
"}",
"/",
"jobs",
".",
"list",
"]",
"(",
"/",
"dataproc",
"/",
"docs",
"/",
"reference",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java#L558-L567 |
woo-j/OkapiBarcode | src/main/java/uk/org/okapibarcode/util/Arrays.java | Arrays.positionOf | public static int positionOf(char value, char[] array) {
"""
Returns the position of the specified value in the specified array.
@param value the value to search for
@param array the array to search in
@return the position of the specified value in the specified array
"""
for (int i = 0; i < array... | java | public static int positionOf(char value, char[] array) {
for (int i = 0; i < array.length; i++) {
if (value == array[i]) {
return i;
}
}
throw new OkapiException("Unable to find character '" + value + "' in character array.");
} | [
"public",
"static",
"int",
"positionOf",
"(",
"char",
"value",
",",
"char",
"[",
"]",
"array",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"value",
"==",
"array",
"[",
... | Returns the position of the specified value in the specified array.
@param value the value to search for
@param array the array to search in
@return the position of the specified value in the specified array | [
"Returns",
"the",
"position",
"of",
"the",
"specified",
"value",
"in",
"the",
"specified",
"array",
"."
] | train | https://github.com/woo-j/OkapiBarcode/blob/d1cb4f4ab64557cd3db64d9a473528a52ce58081/src/main/java/uk/org/okapibarcode/util/Arrays.java#L39-L46 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java | ApiOvhHostingprivateDatabase.serviceName_whitelist_ip_PUT | public void serviceName_whitelist_ip_PUT(String serviceName, String ip, OvhWhitelist body) throws IOException {
"""
Alter this object properties
REST: PUT /hosting/privateDatabase/{serviceName}/whitelist/{ip}
@param body [required] New object properties
@param serviceName [required] The internal name of your ... | java | public void serviceName_whitelist_ip_PUT(String serviceName, String ip, OvhWhitelist body) throws IOException {
String qPath = "/hosting/privateDatabase/{serviceName}/whitelist/{ip}";
StringBuilder sb = path(qPath, serviceName, ip);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_whitelist_ip_PUT",
"(",
"String",
"serviceName",
",",
"String",
"ip",
",",
"OvhWhitelist",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/privateDatabase/{serviceName}/whitelist/{ip}\"",
";",
"StringBuilder",
... | Alter this object properties
REST: PUT /hosting/privateDatabase/{serviceName}/whitelist/{ip}
@param body [required] New object properties
@param serviceName [required] The internal name of your private database
@param ip [required] The whitelisted IP in your instance | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java#L819-L823 |
jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/utils/Translations.java | Translations.getMessage | public String getMessage(String id, String defaultMsg) {
"""
use configured language
@param id - the id of the message to retrieve
@param defaultMsg - string to use if the message is not defined or a language match is not found (if null, then will default to english)
@return the message
"""
return ge... | java | public String getMessage(String id, String defaultMsg) {
return getMessage(id, lang, defaultMsg);
} | [
"public",
"String",
"getMessage",
"(",
"String",
"id",
",",
"String",
"defaultMsg",
")",
"{",
"return",
"getMessage",
"(",
"id",
",",
"lang",
",",
"defaultMsg",
")",
";",
"}"
] | use configured language
@param id - the id of the message to retrieve
@param defaultMsg - string to use if the message is not defined or a language match is not found (if null, then will default to english)
@return the message | [
"use",
"configured",
"language"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/utils/Translations.java#L68-L70 |
operasoftware/operaprestodriver | src/com/opera/core/systems/internal/VersionUtil.java | VersionUtil.compare | public static int compare(String a, String b) {
"""
Returns a negative number if the first version is lower than the second, zero if they are
equal, and a positive number if the first version is higher than the second.
@param a first version
@param b second version
@return -1, 0 or 1 based upon the compariso... | java | public static int compare(String a, String b) {
int shortestLength = (a.length() < b.length()) ? a.length() : b.length();
for (int i = 0; i < shortestLength; i++) {
if (a.charAt(i) < b.charAt(i)) {
return -1;
} else if (a.charAt(i) > b.charAt(i)) {
return 1;
}
}
// Ch... | [
"public",
"static",
"int",
"compare",
"(",
"String",
"a",
",",
"String",
"b",
")",
"{",
"int",
"shortestLength",
"=",
"(",
"a",
".",
"length",
"(",
")",
"<",
"b",
".",
"length",
"(",
")",
")",
"?",
"a",
".",
"length",
"(",
")",
":",
"b",
".",
... | Returns a negative number if the first version is lower than the second, zero if they are
equal, and a positive number if the first version is higher than the second.
@param a first version
@param b second version
@return -1, 0 or 1 based upon the comparison results: -1 if a is less than b, 0 if a is equal
to b 1 if ... | [
"Returns",
"a",
"negative",
"number",
"if",
"the",
"first",
"version",
"is",
"lower",
"than",
"the",
"second",
"zero",
"if",
"they",
"are",
"equal",
"and",
"a",
"positive",
"number",
"if",
"the",
"first",
"version",
"is",
"higher",
"than",
"the",
"second",... | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/internal/VersionUtil.java#L33-L53 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Grego.java | Grego.fieldsToDay | public static long fieldsToDay(int year, int month, int dom) {
"""
Convert a year, month, and day-of-month, given in the proleptic
Gregorian calendar, to 1970 epoch days.
@param year Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.
@param month 0-based month, with 0==Jan
@param dom 1-based day of month
@ret... | java | public static long fieldsToDay(int year, int month, int dom) {
int y = year - 1;
long julian =
365 * y + floorDivide(y, 4) + (JULIAN_1_CE - 3) + // Julian cal
floorDivide(y, 400) - floorDivide(y, 100) + 2 + // => Gregorian cal
DAYS_BEFORE[month + (isLeapYear(year... | [
"public",
"static",
"long",
"fieldsToDay",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"dom",
")",
"{",
"int",
"y",
"=",
"year",
"-",
"1",
";",
"long",
"julian",
"=",
"365",
"*",
"y",
"+",
"floorDivide",
"(",
"y",
",",
"4",
")",
"+",
"... | Convert a year, month, and day-of-month, given in the proleptic
Gregorian calendar, to 1970 epoch days.
@param year Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.
@param month 0-based month, with 0==Jan
@param dom 1-based day of month
@return the day number, with day 0 == Jan 1 1970 | [
"Convert",
"a",
"year",
"month",
"and",
"day",
"-",
"of",
"-",
"month",
"given",
"in",
"the",
"proleptic",
"Gregorian",
"calendar",
"to",
"1970",
"epoch",
"days",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Grego.java#L97-L104 |
resilience4j/resilience4j | resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/BulkheadExports.java | BulkheadExports.ofIterable | public static BulkheadExports ofIterable(String prefix, Iterable<Bulkhead> bulkheads) {
"""
Creates a new instance of {@link BulkheadExports} with specified metrics names prefix and
{@link Iterable} of bulkheads.
@param prefix the prefix of metrics names
@param bulkheads the bulkheads
"""
return n... | java | public static BulkheadExports ofIterable(String prefix, Iterable<Bulkhead> bulkheads) {
return new BulkheadExports(prefix, bulkheads);
} | [
"public",
"static",
"BulkheadExports",
"ofIterable",
"(",
"String",
"prefix",
",",
"Iterable",
"<",
"Bulkhead",
">",
"bulkheads",
")",
"{",
"return",
"new",
"BulkheadExports",
"(",
"prefix",
",",
"bulkheads",
")",
";",
"}"
] | Creates a new instance of {@link BulkheadExports} with specified metrics names prefix and
{@link Iterable} of bulkheads.
@param prefix the prefix of metrics names
@param bulkheads the bulkheads | [
"Creates",
"a",
"new",
"instance",
"of",
"{",
"@link",
"BulkheadExports",
"}",
"with",
"specified",
"metrics",
"names",
"prefix",
"and",
"{",
"@link",
"Iterable",
"}",
"of",
"bulkheads",
"."
] | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/BulkheadExports.java#L117-L119 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/util/IOUtils.java | IOUtils.copyFile | public static void copyFile(File srcFile, File destFile) throws IOException {
"""
<p>copyFile.</p>
@param srcFile a {@link java.io.File} object.
@param destFile a {@link java.io.File} object.
@throws java.io.IOException if any.
"""
InputStream reader = new FileInputStream(srcFile);
OutputS... | java | public static void copyFile(File srcFile, File destFile) throws IOException
{
InputStream reader = new FileInputStream(srcFile);
OutputStream out = new FileOutputStream(destFile);
try
{
byte[] buffer = new byte[2048];
int n = 0;
while (-1 != (n = r... | [
"public",
"static",
"void",
"copyFile",
"(",
"File",
"srcFile",
",",
"File",
"destFile",
")",
"throws",
"IOException",
"{",
"InputStream",
"reader",
"=",
"new",
"FileInputStream",
"(",
"srcFile",
")",
";",
"OutputStream",
"out",
"=",
"new",
"FileOutputStream",
... | <p>copyFile.</p>
@param srcFile a {@link java.io.File} object.
@param destFile a {@link java.io.File} object.
@throws java.io.IOException if any. | [
"<p",
">",
"copyFile",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/util/IOUtils.java#L25-L43 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java | RepositoryServiceImpl.createRepository | public void createRepository(RepositoryEntry rEntry) throws RepositoryConfigurationException, RepositoryException {
"""
Create repository. <br>
Init worksapces for initial start or them load from persistence. <br>
Add namespaces and nodetypes from service plugins.
"""
// Need privileges to manage repos... | java | public void createRepository(RepositoryEntry rEntry) throws RepositoryConfigurationException, RepositoryException
{
// Need privileges to manage repository.
SecurityManager security = System.getSecurityManager();
if (security != null)
{
security.checkPermission(JCRRuntimePermissions.... | [
"public",
"void",
"createRepository",
"(",
"RepositoryEntry",
"rEntry",
")",
"throws",
"RepositoryConfigurationException",
",",
"RepositoryException",
"{",
"// Need privileges to manage repository.",
"SecurityManager",
"security",
"=",
"System",
".",
"getSecurityManager",
"(",
... | Create repository. <br>
Init worksapces for initial start or them load from persistence. <br>
Add namespaces and nodetypes from service plugins. | [
"Create",
"repository",
".",
"<br",
">",
"Init",
"worksapces",
"for",
"initial",
"start",
"or",
"them",
"load",
"from",
"persistence",
".",
"<br",
">",
"Add",
"namespaces",
"and",
"nodetypes",
"from",
"service",
"plugins",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java#L126-L181 |
esigate/esigate | esigate-server/src/main/java/org/esigate/server/EsigateServer.java | EsigateServer.getProperty | private static String getProperty(String prefix, String name, String defaultValue) {
"""
Get String from System properties
@param prefix
@param name
@param defaultValue
@return
"""
return System.getProperty(prefix + name, defaultValue);
} | java | private static String getProperty(String prefix, String name, String defaultValue) {
return System.getProperty(prefix + name, defaultValue);
} | [
"private",
"static",
"String",
"getProperty",
"(",
"String",
"prefix",
",",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"return",
"System",
".",
"getProperty",
"(",
"prefix",
"+",
"name",
",",
"defaultValue",
")",
";",
"}"
] | Get String from System properties
@param prefix
@param name
@param defaultValue
@return | [
"Get",
"String",
"from",
"System",
"properties"
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-server/src/main/java/org/esigate/server/EsigateServer.java#L106-L108 |
protostuff/protostuff | protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java | XmlIOUtil.mergeFrom | public static <T> void mergeFrom(InputStream in, T message, Schema<T> schema)
throws IOException {
"""
Merges the {@code message} from the {@link InputStream} using the given {@code schema}.
"""
mergeFrom(in, message, schema, DEFAULT_INPUT_FACTORY);
} | java | public static <T> void mergeFrom(InputStream in, T message, Schema<T> schema)
throws IOException
{
mergeFrom(in, message, schema, DEFAULT_INPUT_FACTORY);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"mergeFrom",
"(",
"InputStream",
"in",
",",
"T",
"message",
",",
"Schema",
"<",
"T",
">",
"schema",
")",
"throws",
"IOException",
"{",
"mergeFrom",
"(",
"in",
",",
"message",
",",
"schema",
",",
"DEFAULT_INPUT_F... | Merges the {@code message} from the {@link InputStream} using the given {@code schema}. | [
"Merges",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java#L215-L219 |
pravega/pravega | controller/src/main/java/io/pravega/controller/server/rest/ModelHelper.java | ModelHelper.encodeStreamResponse | public static final StreamProperty encodeStreamResponse(String scope, String streamName, final StreamConfiguration streamConfiguration) {
"""
The method translates the internal object StreamConfiguration into REST response object.
@param scope the scope of the stream
@param streamName the name of the stream
@... | java | public static final StreamProperty encodeStreamResponse(String scope, String streamName, final StreamConfiguration streamConfiguration) {
ScalingConfig scalingPolicy = new ScalingConfig();
if (streamConfiguration.getScalingPolicy().getScaleType() == ScalingPolicy.ScaleType.FIXED_NUM_SEGMENTS) {
... | [
"public",
"static",
"final",
"StreamProperty",
"encodeStreamResponse",
"(",
"String",
"scope",
",",
"String",
"streamName",
",",
"final",
"StreamConfiguration",
"streamConfiguration",
")",
"{",
"ScalingConfig",
"scalingPolicy",
"=",
"new",
"ScalingConfig",
"(",
")",
"... | The method translates the internal object StreamConfiguration into REST response object.
@param scope the scope of the stream
@param streamName the name of the stream
@param streamConfiguration The configuration of stream
@return Stream properties wrapped in StreamResponse object | [
"The",
"method",
"translates",
"the",
"internal",
"object",
"StreamConfiguration",
"into",
"REST",
"response",
"object",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rest/ModelHelper.java#L122-L158 |
windup/windup | rules-java/api/src/main/java/org/jboss/windup/rules/apps/mavenize/FeatureBasedApiDependenciesDeducer.java | FeatureBasedApiDependenciesDeducer.addDeploymentTypeBasedDependencies | private boolean addDeploymentTypeBasedDependencies(ProjectModel projectModel, Pom modulePom) {
"""
Adds the dependencies typical for particular deployment types.
This is not accurate and doesn't cover the real needs of the project.
Basically it's just to have "something" for the initial implementation.
"""
... | java | private boolean addDeploymentTypeBasedDependencies(ProjectModel projectModel, Pom modulePom)
{
if (projectModel.getProjectType() == null)
return true;
switch (projectModel.getProjectType()){
case "ear":
break;
case "war":
modulePom.... | [
"private",
"boolean",
"addDeploymentTypeBasedDependencies",
"(",
"ProjectModel",
"projectModel",
",",
"Pom",
"modulePom",
")",
"{",
"if",
"(",
"projectModel",
".",
"getProjectType",
"(",
")",
"==",
"null",
")",
"return",
"true",
";",
"switch",
"(",
"projectModel",... | Adds the dependencies typical for particular deployment types.
This is not accurate and doesn't cover the real needs of the project.
Basically it's just to have "something" for the initial implementation. | [
"Adds",
"the",
"dependencies",
"typical",
"for",
"particular",
"deployment",
"types",
".",
"This",
"is",
"not",
"accurate",
"and",
"doesn",
"t",
"cover",
"the",
"real",
"needs",
"of",
"the",
"project",
".",
"Basically",
"it",
"s",
"just",
"to",
"have",
"so... | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/mavenize/FeatureBasedApiDependenciesDeducer.java#L52-L72 |
prestodb/presto | presto-spi/src/main/java/com/facebook/presto/spi/predicate/SortedRangeSet.java | SortedRangeSet.of | static SortedRangeSet of(Type type, Object first, Object... rest) {
"""
Provided discrete values that are unioned together to form the SortedRangeSet
"""
List<Range> ranges = new ArrayList<>(rest.length + 1);
ranges.add(Range.equal(type, first));
for (Object value : rest) {
... | java | static SortedRangeSet of(Type type, Object first, Object... rest)
{
List<Range> ranges = new ArrayList<>(rest.length + 1);
ranges.add(Range.equal(type, first));
for (Object value : rest) {
ranges.add(Range.equal(type, value));
}
return copyOf(type, ranges);
} | [
"static",
"SortedRangeSet",
"of",
"(",
"Type",
"type",
",",
"Object",
"first",
",",
"Object",
"...",
"rest",
")",
"{",
"List",
"<",
"Range",
">",
"ranges",
"=",
"new",
"ArrayList",
"<>",
"(",
"rest",
".",
"length",
"+",
"1",
")",
";",
"ranges",
".",
... | Provided discrete values that are unioned together to form the SortedRangeSet | [
"Provided",
"discrete",
"values",
"that",
"are",
"unioned",
"together",
"to",
"form",
"the",
"SortedRangeSet"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/predicate/SortedRangeSet.java#L74-L82 |
UrielCh/ovh-java-sdk | ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java | ApiOvhMsServices.serviceName_upnSuffix_suffix_GET | public OvhUpnSuffix serviceName_upnSuffix_suffix_GET(String serviceName, String suffix) throws IOException {
"""
Get this object properties
REST: GET /msServices/{serviceName}/upnSuffix/{suffix}
@param serviceName [required] The internal name of your Active Directory organization
@param suffix [required] UPN ... | java | public OvhUpnSuffix serviceName_upnSuffix_suffix_GET(String serviceName, String suffix) throws IOException {
String qPath = "/msServices/{serviceName}/upnSuffix/{suffix}";
StringBuilder sb = path(qPath, serviceName, suffix);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhUpnSuf... | [
"public",
"OvhUpnSuffix",
"serviceName_upnSuffix_suffix_GET",
"(",
"String",
"serviceName",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/msServices/{serviceName}/upnSuffix/{suffix}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"("... | Get this object properties
REST: GET /msServices/{serviceName}/upnSuffix/{suffix}
@param serviceName [required] The internal name of your Active Directory organization
@param suffix [required] UPN suffix
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java#L86-L91 |
LearnLib/learnlib | oracles/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/ReuseNode.java | ReuseNode.addEdge | public void addEdge(int index, ReuseEdge<S, I, O> edge) {
"""
Adds an outgoing {@link ReuseEdge} to this {@link ReuseNode}.
"""
this.edges[index] = edge;
} | java | public void addEdge(int index, ReuseEdge<S, I, O> edge) {
this.edges[index] = edge;
} | [
"public",
"void",
"addEdge",
"(",
"int",
"index",
",",
"ReuseEdge",
"<",
"S",
",",
"I",
",",
"O",
">",
"edge",
")",
"{",
"this",
".",
"edges",
"[",
"index",
"]",
"=",
"edge",
";",
"}"
] | Adds an outgoing {@link ReuseEdge} to this {@link ReuseNode}. | [
"Adds",
"an",
"outgoing",
"{"
] | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/ReuseNode.java#L95-L97 |
abel533/EasyXls | src/main/java/com/github/abel533/easyxls/common/FieldUtil.java | FieldUtil.getField | public static Field getField(Class clazz, String fieldName) {
"""
获取字段中的Field
@param clazz 类
@param fieldName 字段名
@return 返回字段对象
"""
if (Map.class.isAssignableFrom(clazz)) {
return new Field(new MapField(fieldName));
}
java.lang.reflect.Field field = null;
w... | java | public static Field getField(Class clazz, String fieldName) {
if (Map.class.isAssignableFrom(clazz)) {
return new Field(new MapField(fieldName));
}
java.lang.reflect.Field field = null;
while (field == null && clazz != null) {
try {
field = clazz.g... | [
"public",
"static",
"Field",
"getField",
"(",
"Class",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"if",
"(",
"Map",
".",
"class",
".",
"isAssignableFrom",
"(",
"clazz",
")",
")",
"{",
"return",
"new",
"Field",
"(",
"new",
"MapField",
"(",
"fieldName"... | 获取字段中的Field
@param clazz 类
@param fieldName 字段名
@return 返回字段对象 | [
"获取字段中的Field"
] | train | https://github.com/abel533/EasyXls/blob/f73be23745c2180d7c0b8f0a510e72e61cc37d5d/src/main/java/com/github/abel533/easyxls/common/FieldUtil.java#L33-L47 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/painter/VectorTilePainter.java | VectorTilePainter.deleteShape | public void deleteShape(Paintable paintable, Object group, MapContext context) {
"""
Delete a {@link Paintable} object from the given {@link MapContext}. It the object does not exist, nothing
will be done.
@param paintable
The object to be painted.
@param group
The group where the object resides in (optiona... | java | public void deleteShape(Paintable paintable, Object group, MapContext context) {
VectorTile tile = (VectorTile) paintable;
context.getVectorContext().deleteGroup(tile.getFeatureContent());
context.getVectorContext().deleteGroup(tile.getLabelContent());
context.getRasterContext().deleteGroup(tile.getFeatureConte... | [
"public",
"void",
"deleteShape",
"(",
"Paintable",
"paintable",
",",
"Object",
"group",
",",
"MapContext",
"context",
")",
"{",
"VectorTile",
"tile",
"=",
"(",
"VectorTile",
")",
"paintable",
";",
"context",
".",
"getVectorContext",
"(",
")",
".",
"deleteGroup... | Delete a {@link Paintable} object from the given {@link MapContext}. It the object does not exist, nothing
will be done.
@param paintable
The object to be painted.
@param group
The group where the object resides in (optional).
@param context
The context to paint on. | [
"Delete",
"a",
"{",
"@link",
"Paintable",
"}",
"object",
"from",
"the",
"given",
"{",
"@link",
"MapContext",
"}",
".",
"It",
"the",
"object",
"does",
"not",
"exist",
"nothing",
"will",
"be",
"done",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/painter/VectorTilePainter.java#L105-L111 |
webmetrics/browsermob-proxy | src/main/java/org/xbill/DNS/ResolverConfig.java | ResolverConfig.findAndroid | private void
findAndroid() {
"""
Parses the output of getprop, which is the only way to get DNS
info on Android. getprop might disappear in future releases, so
this code comes with a use-by date.
"""
String re1 = "^\\d+(\\.\\d+){3}$";
String re2 = "^[0-9a-f]+(:[0-9a-f]*)+:[0-9a-f]+$";
try {
ArrayList m... | java | private void
findAndroid() {
String re1 = "^\\d+(\\.\\d+){3}$";
String re2 = "^[0-9a-f]+(:[0-9a-f]*)+:[0-9a-f]+$";
try {
ArrayList maybe = new ArrayList();
String line;
Process p = Runtime.getRuntime().exec("getprop");
InputStream in = p.getInputStream();
InputStreamReader isr = new InputStreamReader(i... | [
"private",
"void",
"findAndroid",
"(",
")",
"{",
"String",
"re1",
"=",
"\"^\\\\d+(\\\\.\\\\d+){3}$\"",
";",
"String",
"re2",
"=",
"\"^[0-9a-f]+(:[0-9a-f]*)+:[0-9a-f]+$\"",
";",
"try",
"{",
"ArrayList",
"maybe",
"=",
"new",
"ArrayList",
"(",
")",
";",
"String",
"... | Parses the output of getprop, which is the only way to get DNS
info on Android. getprop might disappear in future releases, so
this code comes with a use-by date. | [
"Parses",
"the",
"output",
"of",
"getprop",
"which",
"is",
"the",
"only",
"way",
"to",
"get",
"DNS",
"info",
"on",
"Android",
".",
"getprop",
"might",
"disappear",
"in",
"future",
"releases",
"so",
"this",
"code",
"comes",
"with",
"a",
"use",
"-",
"by",
... | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/ResolverConfig.java#L377-L403 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_virtualMac_macAddress_virtualAddress_ipAddress_GET | public OvhVirtualMacManagement serviceName_virtualMac_macAddress_virtualAddress_ipAddress_GET(String serviceName, String macAddress, String ipAddress) throws IOException {
"""
Get this object properties
REST: GET /dedicated/server/{serviceName}/virtualMac/{macAddress}/virtualAddress/{ipAddress}
@param serviceN... | java | public OvhVirtualMacManagement serviceName_virtualMac_macAddress_virtualAddress_ipAddress_GET(String serviceName, String macAddress, String ipAddress) throws IOException {
String qPath = "/dedicated/server/{serviceName}/virtualMac/{macAddress}/virtualAddress/{ipAddress}";
StringBuilder sb = path(qPath, serviceName,... | [
"public",
"OvhVirtualMacManagement",
"serviceName_virtualMac_macAddress_virtualAddress_ipAddress_GET",
"(",
"String",
"serviceName",
",",
"String",
"macAddress",
",",
"String",
"ipAddress",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{service... | Get this object properties
REST: GET /dedicated/server/{serviceName}/virtualMac/{macAddress}/virtualAddress/{ipAddress}
@param serviceName [required] The internal name of your dedicated server
@param macAddress [required] Virtual MAC address in 00:00:00:00:00:00 format
@param ipAddress [required] IP address | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L574-L579 |
drewnoakes/metadata-extractor | Source/com/drew/metadata/exif/ExifTiffHandler.java | ExifTiffHandler.getReaderString | @NotNull
private static String getReaderString(final @NotNull RandomAccessReader reader, final int makernoteOffset, final int bytesRequested) throws IOException {
"""
Read a given number of bytes from the stream
This method is employed to "suppress" attempts to read beyond end of the
file as may happen at ... | java | @NotNull
private static String getReaderString(final @NotNull RandomAccessReader reader, final int makernoteOffset, final int bytesRequested) throws IOException
{
try {
return reader.getString(makernoteOffset, bytesRequested, Charsets.UTF_8);
} catch(BufferBoundsException e) {
... | [
"@",
"NotNull",
"private",
"static",
"String",
"getReaderString",
"(",
"final",
"@",
"NotNull",
"RandomAccessReader",
"reader",
",",
"final",
"int",
"makernoteOffset",
",",
"final",
"int",
"bytesRequested",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
... | Read a given number of bytes from the stream
This method is employed to "suppress" attempts to read beyond end of the
file as may happen at the beginning of processMakernote when we read
increasingly longer camera makes.
Instead of failing altogether in this context we return an empty string
which will fail all sensi... | [
"Read",
"a",
"given",
"number",
"of",
"bytes",
"from",
"the",
"stream"
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/metadata/exif/ExifTiffHandler.java#L379-L387 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/dos/dos_stats.java | dos_stats.get_nitro_response | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
"""
<pre>
converts nitro response into object and returns the object array in case of get request.
</pre>
"""
dos_stats[] resources = new dos_stats[1];
dos_response result = (dos_response) service.get_... | java | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
dos_stats[] resources = new dos_stats[1];
dos_response result = (dos_response) service.get_payload_formatter().string_to_resource(dos_response.class, response);
if(result.errorcode != 0) {
if (result.errorco... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"dos_stats",
"[",
"]",
"resources",
"=",
"new",
"dos_stats",
"[",
"1",
"]",
";",
"dos_response",
"result",
... | <pre>
converts nitro response into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"converts",
"nitro",
"response",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/dos/dos_stats.java#L117-L136 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/cli/Init.java | Init.deleteDynamicTemplates | private void deleteDynamicTemplates() throws IOException {
"""
These will be retrieved just-in-time based on current mdw version.
"""
File codegenDir = new File(getProjectDir() + "/codegen");
if (codegenDir.exists()) {
getOut().println("Deleting " + codegenDir);
new Dele... | java | private void deleteDynamicTemplates() throws IOException {
File codegenDir = new File(getProjectDir() + "/codegen");
if (codegenDir.exists()) {
getOut().println("Deleting " + codegenDir);
new Delete(codegenDir, true).run();
}
File assetsDir = new File(getProjectDi... | [
"private",
"void",
"deleteDynamicTemplates",
"(",
")",
"throws",
"IOException",
"{",
"File",
"codegenDir",
"=",
"new",
"File",
"(",
"getProjectDir",
"(",
")",
"+",
"\"/codegen\"",
")",
";",
"if",
"(",
"codegenDir",
".",
"exists",
"(",
")",
")",
"{",
"getOu... | These will be retrieved just-in-time based on current mdw version. | [
"These",
"will",
"be",
"retrieved",
"just",
"-",
"in",
"-",
"time",
"based",
"on",
"current",
"mdw",
"version",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/cli/Init.java#L165-L181 |
netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollServerSocketChannelConfig.java | EpollServerSocketChannelConfig.setTcpMd5Sig | public EpollServerSocketChannelConfig setTcpMd5Sig(Map<InetAddress, byte[]> keys) {
"""
Set the {@code TCP_MD5SIG} option on the socket. See {@code linux/tcp.h} for more details.
Keys can only be set on, not read to prevent a potential leak, as they are confidential.
Allowing them being read would mean anyone wi... | java | public EpollServerSocketChannelConfig setTcpMd5Sig(Map<InetAddress, byte[]> keys) {
try {
((EpollServerSocketChannel) channel).setTcpMd5Sig(keys);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
} | [
"public",
"EpollServerSocketChannelConfig",
"setTcpMd5Sig",
"(",
"Map",
"<",
"InetAddress",
",",
"byte",
"[",
"]",
">",
"keys",
")",
"{",
"try",
"{",
"(",
"(",
"EpollServerSocketChannel",
")",
"channel",
")",
".",
"setTcpMd5Sig",
"(",
"keys",
")",
";",
"retu... | Set the {@code TCP_MD5SIG} option on the socket. See {@code linux/tcp.h} for more details.
Keys can only be set on, not read to prevent a potential leak, as they are confidential.
Allowing them being read would mean anyone with access to the channel could get them. | [
"Set",
"the",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollServerSocketChannelConfig.java#L180-L187 |
alkacon/opencms-core | src/org/opencms/ui/dialogs/permissions/CmsPermissionView.java | CmsPermissionView.getEntryType | protected String getEntryType(int flags, boolean all) {
"""
Determines the type of the current access control entry.<p>
@param flags the value of the current flags
@param all to include all types, or just user and groups
@return String representation of the ace type
"""
for (int i = 0; i < getT... | java | protected String getEntryType(int flags, boolean all) {
for (int i = 0; i < getTypes(all).length; i++) {
if ((flags & getTypesInt()[i]) > 0) {
return getTypes(all)[i];
}
}
return UNKNOWN_TYPE;
} | [
"protected",
"String",
"getEntryType",
"(",
"int",
"flags",
",",
"boolean",
"all",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getTypes",
"(",
"all",
")",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"(",
"flags",
"&",
"g... | Determines the type of the current access control entry.<p>
@param flags the value of the current flags
@param all to include all types, or just user and groups
@return String representation of the ace type | [
"Determines",
"the",
"type",
"of",
"the",
"current",
"access",
"control",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dialogs/permissions/CmsPermissionView.java#L371-L379 |
apache/groovy | src/main/groovy/groovy/util/GroovyScriptEngine.java | GroovyScriptEngine.createScript | public Script createScript(String scriptName, Binding binding) throws ResourceException, ScriptException {
"""
Creates a Script with a given scriptName and binding.
@param scriptName name of the script to run
@param binding the binding to pass to the script
@return the script object
@throws ResourceExcept... | java | public Script createScript(String scriptName, Binding binding) throws ResourceException, ScriptException {
return InvokerHelper.createScript(loadScriptByName(scriptName), binding);
} | [
"public",
"Script",
"createScript",
"(",
"String",
"scriptName",
",",
"Binding",
"binding",
")",
"throws",
"ResourceException",
",",
"ScriptException",
"{",
"return",
"InvokerHelper",
".",
"createScript",
"(",
"loadScriptByName",
"(",
"scriptName",
")",
",",
"bindin... | Creates a Script with a given scriptName and binding.
@param scriptName name of the script to run
@param binding the binding to pass to the script
@return the script object
@throws ResourceException if there is a problem accessing the script
@throws ScriptException if there is a problem parsing the script | [
"Creates",
"a",
"Script",
"with",
"a",
"given",
"scriptName",
"and",
"binding",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/GroovyScriptEngine.java#L590-L592 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java | PgDatabaseMetaData.getCatalogs | @Override
public ResultSet getCatalogs() throws SQLException {
"""
PostgreSQL does not support multiple catalogs from a single connection, so to reduce confusion
we only return the current catalog. {@inheritDoc}
"""
Field[] f = new Field[1];
List<byte[][]> v = new ArrayList<byte[][]>();
f[0] = n... | java | @Override
public ResultSet getCatalogs() throws SQLException {
Field[] f = new Field[1];
List<byte[][]> v = new ArrayList<byte[][]>();
f[0] = new Field("TABLE_CAT", Oid.VARCHAR);
byte[][] tuple = new byte[1][];
tuple[0] = connection.encodeString(connection.getCatalog());
v.add(tuple);
ret... | [
"@",
"Override",
"public",
"ResultSet",
"getCatalogs",
"(",
")",
"throws",
"SQLException",
"{",
"Field",
"[",
"]",
"f",
"=",
"new",
"Field",
"[",
"1",
"]",
";",
"List",
"<",
"byte",
"[",
"]",
"[",
"]",
">",
"v",
"=",
"new",
"ArrayList",
"<",
"byte"... | PostgreSQL does not support multiple catalogs from a single connection, so to reduce confusion
we only return the current catalog. {@inheritDoc} | [
"PostgreSQL",
"does",
"not",
"support",
"multiple",
"catalogs",
"from",
"a",
"single",
"connection",
"so",
"to",
"reduce",
"confusion",
"we",
"only",
"return",
"the",
"current",
"catalog",
".",
"{"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java#L1423-L1433 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexRequest.java | CmsFlexRequest.getRequestDispatcherToExternal | public CmsFlexRequestDispatcher getRequestDispatcherToExternal(String vfs_target, String ext_target) {
"""
Replacement for the standard servlet API getRequestDispatcher() method.<p>
This variation is used if an external file (probably JSP) is dispatched to.
This external file must have a "mirror" version, i.e.... | java | public CmsFlexRequestDispatcher getRequestDispatcherToExternal(String vfs_target, String ext_target) {
return new CmsFlexRequestDispatcher(
m_controller.getTopRequest().getRequestDispatcher(ext_target),
CmsLinkManager.getAbsoluteUri(vfs_target, m_controller.getCmsObject().getRequestCont... | [
"public",
"CmsFlexRequestDispatcher",
"getRequestDispatcherToExternal",
"(",
"String",
"vfs_target",
",",
"String",
"ext_target",
")",
"{",
"return",
"new",
"CmsFlexRequestDispatcher",
"(",
"m_controller",
".",
"getTopRequest",
"(",
")",
".",
"getRequestDispatcher",
"(",
... | Replacement for the standard servlet API getRequestDispatcher() method.<p>
This variation is used if an external file (probably JSP) is dispatched to.
This external file must have a "mirror" version, i.e. a file in the OpenCms VFS
that represents the external file.<p>
@param vfs_target the OpenCms file that is a "mir... | [
"Replacement",
"for",
"the",
"standard",
"servlet",
"API",
"getRequestDispatcher",
"()",
"method",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexRequest.java#L565-L571 |
ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OBDAModelManager.java | OBDAModelManager.triggerOntologyChanged | private void triggerOntologyChanged() {
"""
*
Protege wont trigger a save action unless it detects that the OWLOntology
currently opened has suffered a change. The OBDA plugin requires that
protege triggers a save action also in the case when only the OBDA model
has suffered changes. To accomplish this, this m... | java | private void triggerOntologyChanged() {
if (loadingData) {
return;
}
OWLModelManager owlmm = owlEditorKit.getOWLModelManager();
OWLOntology ontology = owlmm.getActiveOntology();
if (ontology == null) {
return;
}
OWLClass newClass = owlmm.getOWLDataFactory().getOWLClass(IRI.create("http://www.unibz... | [
"private",
"void",
"triggerOntologyChanged",
"(",
")",
"{",
"if",
"(",
"loadingData",
")",
"{",
"return",
";",
"}",
"OWLModelManager",
"owlmm",
"=",
"owlEditorKit",
".",
"getOWLModelManager",
"(",
")",
";",
"OWLOntology",
"ontology",
"=",
"owlmm",
".",
"getAct... | *
Protege wont trigger a save action unless it detects that the OWLOntology
currently opened has suffered a change. The OBDA plugin requires that
protege triggers a save action also in the case when only the OBDA model
has suffered changes. To accomplish this, this method will "fake" an
ontology change by inserting and... | [
"*",
"Protege",
"wont",
"trigger",
"a",
"save",
"action",
"unless",
"it",
"detects",
"that",
"the",
"OWLOntology",
"currently",
"opened",
"has",
"suffered",
"a",
"change",
".",
"The",
"OBDA",
"plugin",
"requires",
"that",
"protege",
"triggers",
"a",
"save",
... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OBDAModelManager.java#L726-L752 |
lucee/Lucee | core/src/main/java/lucee/runtime/converter/ScriptConverter.java | ScriptConverter._serializeArray | private void _serializeArray(Array array, StringBuilder sb, Set<Object> done) throws ConverterException {
"""
serialize a Array
@param array Array to serialize
@param sb
@param done
@throws ConverterException
"""
_serializeList(array.toList(), sb, done);
} | java | private void _serializeArray(Array array, StringBuilder sb, Set<Object> done) throws ConverterException {
_serializeList(array.toList(), sb, done);
} | [
"private",
"void",
"_serializeArray",
"(",
"Array",
"array",
",",
"StringBuilder",
"sb",
",",
"Set",
"<",
"Object",
">",
"done",
")",
"throws",
"ConverterException",
"{",
"_serializeList",
"(",
"array",
".",
"toList",
"(",
")",
",",
"sb",
",",
"done",
")",... | serialize a Array
@param array Array to serialize
@param sb
@param done
@throws ConverterException | [
"serialize",
"a",
"Array"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/ScriptConverter.java#L151-L153 |
JodaOrg/joda-time | src/main/java/org/joda/time/Duration.java | Duration.dividedBy | public Duration dividedBy(long divisor, RoundingMode roundingMode) {
"""
Returns a new duration with its length divided by the
specified divisor. {@code RoundingMode} can be specified.
This instance is immutable and is not altered.
<p>
If the divisor is one, this instance is returned.
@param divisor the di... | java | public Duration dividedBy(long divisor, RoundingMode roundingMode) {
if (divisor == 1) {
return this;
}
return new Duration(FieldUtils.safeDivide(getMillis(), divisor, roundingMode));
} | [
"public",
"Duration",
"dividedBy",
"(",
"long",
"divisor",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"if",
"(",
"divisor",
"==",
"1",
")",
"{",
"return",
"this",
";",
"}",
"return",
"new",
"Duration",
"(",
"FieldUtils",
".",
"safeDivide",
"(",
"getMil... | Returns a new duration with its length divided by the
specified divisor. {@code RoundingMode} can be specified.
This instance is immutable and is not altered.
<p>
If the divisor is one, this instance is returned.
@param divisor the divisor to divide this one by
@param roundingMode the type of rounding desired
@retur... | [
"Returns",
"a",
"new",
"duration",
"with",
"its",
"length",
"divided",
"by",
"the",
"specified",
"divisor",
".",
"{",
"@code",
"RoundingMode",
"}",
"can",
"be",
"specified",
".",
"This",
"instance",
"is",
"immutable",
"and",
"is",
"not",
"altered",
".",
"<... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Duration.java#L520-L525 |
HtmlUnit/htmlunit-cssparser | src/main/java/com/gargoylesoftware/css/dom/MediaListImpl.java | MediaListImpl.setMediaText | public void setMediaText(final String mediaText) throws DOMException {
"""
Parses the given media text.
@param mediaText text to be parsed
@throws DOMException in case of error
"""
try {
final CSSOMParser parser = new CSSOMParser();
parser.setErrorHandler(ThrowCssExceptionErro... | java | public void setMediaText(final String mediaText) throws DOMException {
try {
final CSSOMParser parser = new CSSOMParser();
parser.setErrorHandler(ThrowCssExceptionErrorHandler.INSTANCE);
final MediaQueryList sml = parser.parseMedia(mediaText);
setMediaList(sml);
... | [
"public",
"void",
"setMediaText",
"(",
"final",
"String",
"mediaText",
")",
"throws",
"DOMException",
"{",
"try",
"{",
"final",
"CSSOMParser",
"parser",
"=",
"new",
"CSSOMParser",
"(",
")",
";",
"parser",
".",
"setErrorHandler",
"(",
"ThrowCssExceptionErrorHandler... | Parses the given media text.
@param mediaText text to be parsed
@throws DOMException in case of error | [
"Parses",
"the",
"given",
"media",
"text",
"."
] | train | https://github.com/HtmlUnit/htmlunit-cssparser/blob/384e4170737169b5b4c87c5766495d9b8a6d3866/src/main/java/com/gargoylesoftware/css/dom/MediaListImpl.java#L77-L90 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Base.java | Base.addBatch | public static void addBatch(PreparedStatement ps, Object... parameters) {
"""
Adds a batch statement using given <code>java.sql.PreparedStatement</code> and parameters.
@param ps <code>java.sql.PreparedStatement</code> to add batch to.
@param parameters parameters for the query in <code>java.sql.PreparedStatemen... | java | public static void addBatch(PreparedStatement ps, Object... parameters) {
new DB(DB.DEFAULT_NAME).addBatch(ps, parameters);
} | [
"public",
"static",
"void",
"addBatch",
"(",
"PreparedStatement",
"ps",
",",
"Object",
"...",
"parameters",
")",
"{",
"new",
"DB",
"(",
"DB",
".",
"DEFAULT_NAME",
")",
".",
"addBatch",
"(",
"ps",
",",
"parameters",
")",
";",
"}"
] | Adds a batch statement using given <code>java.sql.PreparedStatement</code> and parameters.
@param ps <code>java.sql.PreparedStatement</code> to add batch to.
@param parameters parameters for the query in <code>java.sql.PreparedStatement</code>. Parameters will be
set on the statement in the same order as provided here. | [
"Adds",
"a",
"batch",
"statement",
"using",
"given",
"<code",
">",
"java",
".",
"sql",
".",
"PreparedStatement<",
"/",
"code",
">",
"and",
"parameters",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Base.java#L334-L336 |
jbake-org/jbake | jbake-core/src/main/java/org/jbake/app/Asset.java | Asset.isAssetFile | public boolean isAssetFile(File path) {
"""
Determine if a given file is an asset file.
@param path to the file to validate.
@return true if the path provided points to a file in the asset folder.
"""
boolean isAsset = false;
try {
if(FileUtil.directoryOnlyIfNotIgnored(path.getPa... | java | public boolean isAssetFile(File path) {
boolean isAsset = false;
try {
if(FileUtil.directoryOnlyIfNotIgnored(path.getParentFile())) {
if (FileUtil.isFileInDirectory(path, config.getAssetFolder())) {
isAsset = true;
} else if (FileUtil.isFi... | [
"public",
"boolean",
"isAssetFile",
"(",
"File",
"path",
")",
"{",
"boolean",
"isAsset",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"FileUtil",
".",
"directoryOnlyIfNotIgnored",
"(",
"path",
".",
"getParentFile",
"(",
")",
")",
")",
"{",
"if",
"(",
"FileU... | Determine if a given file is an asset file.
@param path to the file to validate.
@return true if the path provided points to a file in the asset folder. | [
"Determine",
"if",
"a",
"given",
"file",
"is",
"an",
"asset",
"file",
"."
] | train | https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/Asset.java#L98-L114 |
openengsb/openengsb | components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java | OrientModelGraphUtils.fillEdgeWithPropertyConnections | public static void fillEdgeWithPropertyConnections(ODocument edge, TransformationDescription description) {
"""
Adds to the given map the property connection information which result from the given transformation description.
"""
Map<String, String> connections = convertPropertyConnectionsToSimpleForm(... | java | public static void fillEdgeWithPropertyConnections(ODocument edge, TransformationDescription description) {
Map<String, String> connections = convertPropertyConnectionsToSimpleForm(description.getPropertyConnections());
for (Map.Entry<String, String> entry : connections.entrySet()) {
edge.fi... | [
"public",
"static",
"void",
"fillEdgeWithPropertyConnections",
"(",
"ODocument",
"edge",
",",
"TransformationDescription",
"description",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"connections",
"=",
"convertPropertyConnectionsToSimpleForm",
"(",
"description",
... | Adds to the given map the property connection information which result from the given transformation description. | [
"Adds",
"to",
"the",
"given",
"map",
"the",
"property",
"connection",
"information",
"which",
"result",
"from",
"the",
"given",
"transformation",
"description",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java#L92-L97 |
geomajas/geomajas-project-client-gwt2 | common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/Dom.java | Dom.createElementNS | public static Element createElementNS(String ns, String tag) {
"""
<p> Creates a new DOM element in the given name-space. If the name-space is HTML, a normal element will be
created. </p> <p> There is an exception when using Internet Explorer! For Internet Explorer a new element will be
created of type "namespac... | java | public static Element createElementNS(String ns, String tag) {
return IMPL.createElementNS(ns, tag);
} | [
"public",
"static",
"Element",
"createElementNS",
"(",
"String",
"ns",
",",
"String",
"tag",
")",
"{",
"return",
"IMPL",
".",
"createElementNS",
"(",
"ns",
",",
"tag",
")",
";",
"}"
] | <p> Creates a new DOM element in the given name-space. If the name-space is HTML, a normal element will be
created. </p> <p> There is an exception when using Internet Explorer! For Internet Explorer a new element will be
created of type "namespace:tag". </p>
@param ns The name-space to be used in the element creation... | [
"<p",
">",
"Creates",
"a",
"new",
"DOM",
"element",
"in",
"the",
"given",
"name",
"-",
"space",
".",
"If",
"the",
"name",
"-",
"space",
"is",
"HTML",
"a",
"normal",
"element",
"will",
"be",
"created",
".",
"<",
"/",
"p",
">",
"<p",
">",
"There",
... | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/Dom.java#L116-L118 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.createOrUpdateAsync | public Observable<VirtualNetworkGatewayInner> createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) {
"""
Creates or updates a virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@para... | java | public Observable<VirtualNetworkGatewayInner> createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1<ServiceResponse<VirtualNetw... | [
"public",
"Observable",
"<",
"VirtualNetworkGatewayInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"VirtualNetworkGatewayInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
... | Creates or updates a virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param parameters Parameters supplied to create or update virtual network gateway operation.
@throws IllegalAr... | [
"Creates",
"or",
"updates",
"a",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L236-L243 |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/common/GeoDistance.java | GeoDistance.parse | @JsonCreator
public static GeoDistance parse(String json) {
"""
Returns the {@link GeoDistance} represented by the specified JSON {@code String}.
@param json A {@code String} containing a JSON encoded {@link GeoDistance}.
@return The {@link GeoDistance} represented by the specified JSON {@code String}.
... | java | @JsonCreator
public static GeoDistance parse(String json) {
try {
String unit = null;
for (GeoDistanceUnit geoDistanceUnit : GeoDistanceUnit.values()) {
for (String name : geoDistanceUnit.getNames()) {
if (json.endsWith(name) && (unit == null || un... | [
"@",
"JsonCreator",
"public",
"static",
"GeoDistance",
"parse",
"(",
"String",
"json",
")",
"{",
"try",
"{",
"String",
"unit",
"=",
"null",
";",
"for",
"(",
"GeoDistanceUnit",
"geoDistanceUnit",
":",
"GeoDistanceUnit",
".",
"values",
"(",
")",
")",
"{",
"f... | Returns the {@link GeoDistance} represented by the specified JSON {@code String}.
@param json A {@code String} containing a JSON encoded {@link GeoDistance}.
@return The {@link GeoDistance} represented by the specified JSON {@code String}. | [
"Returns",
"the",
"{",
"@link",
"GeoDistance",
"}",
"represented",
"by",
"the",
"specified",
"JSON",
"{",
"@code",
"String",
"}",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/common/GeoDistance.java#L73-L93 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_binding.java | sslpolicy_binding.get | public static sslpolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch sslpolicy_binding resource of given name .
"""
sslpolicy_binding obj = new sslpolicy_binding();
obj.set_name(name);
sslpolicy_binding response = (sslpolicy_binding) obj.get_resource(servic... | java | public static sslpolicy_binding get(nitro_service service, String name) throws Exception{
sslpolicy_binding obj = new sslpolicy_binding();
obj.set_name(name);
sslpolicy_binding response = (sslpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"sslpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"sslpolicy_binding",
"obj",
"=",
"new",
"sslpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
... | Use this API to fetch sslpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"sslpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_binding.java#L158-L163 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AwardEmojiApi.java | AwardEmojiApi.deleteSnippetAwardEmoji | public void deleteSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, Integer awardId) throws GitLabApiException {
"""
Delete an award emoji from the specified snippet.
<pre><code>GitLab Endpoint: DELETE /projects/:id/snippets/:snippet_id/award_emoji/:award_id</code></pre>
@param projectIdOrPath id,... | java | public void deleteSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, Integer awardId) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null,
"projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "award_emoji", awardId);
} | [
"public",
"void",
"deleteSnippetAwardEmoji",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"snippetId",
",",
"Integer",
"awardId",
")",
"throws",
"GitLabApiException",
"{",
"delete",
"(",
"Response",
".",
"Status",
".",
"NO_CONTENT",
",",
"null",
",",
"\"proje... | Delete an award emoji from the specified snippet.
<pre><code>GitLab Endpoint: DELETE /projects/:id/snippets/:snippet_id/award_emoji/:award_id</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param snippetId the snippet ID to delete the award emoji from... | [
"Delete",
"an",
"award",
"emoji",
"from",
"the",
"specified",
"snippet",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AwardEmojiApi.java#L269-L272 |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixUtils.java | IFixUtils.findIFixXmlFiles | private static File[] findIFixXmlFiles(File wlpInstallationDirectory) {
"""
This loads all of the files ending with ".xml" within the lib/fixes directory of the WLP install. If none exist then it returns an empty array.
@param wlpInstallationDirectory The installation directory of the current install
@return T... | java | private static File[] findIFixXmlFiles(File wlpInstallationDirectory) {
File iFixDirectory = new File(wlpInstallationDirectory, "lib/fixes");
if (!iFixDirectory.exists() || !iFixDirectory.isDirectory()) {
return new File[0];
}
File[] iFixFiles = iFixDirectory.listFiles(new Fi... | [
"private",
"static",
"File",
"[",
"]",
"findIFixXmlFiles",
"(",
"File",
"wlpInstallationDirectory",
")",
"{",
"File",
"iFixDirectory",
"=",
"new",
"File",
"(",
"wlpInstallationDirectory",
",",
"\"lib/fixes\"",
")",
";",
"if",
"(",
"!",
"iFixDirectory",
".",
"exi... | This loads all of the files ending with ".xml" within the lib/fixes directory of the WLP install. If none exist then it returns an empty array.
@param wlpInstallationDirectory The installation directory of the current install
@return The list of XML files or an empty array if none is found | [
"This",
"loads",
"all",
"of",
"the",
"files",
"ending",
"with",
".",
"xml",
"within",
"the",
"lib",
"/",
"fixes",
"directory",
"of",
"the",
"WLP",
"install",
".",
"If",
"none",
"exist",
"then",
"it",
"returns",
"an",
"empty",
"array",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixUtils.java#L143-L155 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java | PrimaveraReader.processCalendarExceptions | private void processCalendarExceptions(ProjectCalendar calendar, Record root) {
"""
Process calendar exceptions.
@param calendar project calendar
@param root calendar data
"""
// Retrieve exceptions
Record exceptions = root.getChild("Exceptions");
if (exceptions != null)
{
... | java | private void processCalendarExceptions(ProjectCalendar calendar, Record root)
{
// Retrieve exceptions
Record exceptions = root.getChild("Exceptions");
if (exceptions != null)
{
for (Record exception : exceptions.getChildren())
{
long daysFromEpoch = Integer.pars... | [
"private",
"void",
"processCalendarExceptions",
"(",
"ProjectCalendar",
"calendar",
",",
"Record",
"root",
")",
"{",
"// Retrieve exceptions",
"Record",
"exceptions",
"=",
"root",
".",
"getChild",
"(",
"\"Exceptions\"",
")",
";",
"if",
"(",
"exceptions",
"!=",
"nu... | Process calendar exceptions.
@param calendar project calendar
@param root calendar data | [
"Process",
"calendar",
"exceptions",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java#L454-L472 |
alkacon/opencms-core | src/org/opencms/search/CmsVfsIndexer.java | CmsVfsIndexer.updateResource | protected void updateResource(I_CmsIndexWriter writer, CmsIndexingThreadManager threadManager, CmsResource resource)
throws CmsIndexException {
"""
Updates (writes) a single resource in the index.<p>
@param writer the index writer to use
@param threadManager the thread manager to use when extracting the do... | java | protected void updateResource(I_CmsIndexWriter writer, CmsIndexingThreadManager threadManager, CmsResource resource)
throws CmsIndexException {
if (resource.isFolder() || resource.isTemporaryFile()) {
// don't ever index folders or temporary files
return;
}
try {
... | [
"protected",
"void",
"updateResource",
"(",
"I_CmsIndexWriter",
"writer",
",",
"CmsIndexingThreadManager",
"threadManager",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsIndexException",
"{",
"if",
"(",
"resource",
".",
"isFolder",
"(",
")",
"||",
"resource",
"... | Updates (writes) a single resource in the index.<p>
@param writer the index writer to use
@param threadManager the thread manager to use when extracting the document text
@param resource the resource to update
@throws CmsIndexException if something goes wrong | [
"Updates",
"(",
"writes",
")",
"a",
"single",
"resource",
"in",
"the",
"index",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsVfsIndexer.java#L346-L377 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/events/PdfPageEventForwarder.java | PdfPageEventForwarder.onOpenDocument | public void onOpenDocument(PdfWriter writer, Document document) {
"""
Called when the document is opened.
@param writer
the <CODE>PdfWriter</CODE> for this document
@param document
the document
"""
PdfPageEvent event;
for (Iterator i = events.iterator(); i.hasNext(); ) {
event = (PdfPageEvent)i.ne... | java | public void onOpenDocument(PdfWriter writer, Document document) {
PdfPageEvent event;
for (Iterator i = events.iterator(); i.hasNext(); ) {
event = (PdfPageEvent)i.next();
event.onOpenDocument(writer, document);
}
} | [
"public",
"void",
"onOpenDocument",
"(",
"PdfWriter",
"writer",
",",
"Document",
"document",
")",
"{",
"PdfPageEvent",
"event",
";",
"for",
"(",
"Iterator",
"i",
"=",
"events",
".",
"iterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{... | Called when the document is opened.
@param writer
the <CODE>PdfWriter</CODE> for this document
@param document
the document | [
"Called",
"when",
"the",
"document",
"is",
"opened",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/events/PdfPageEventForwarder.java#L89-L95 |
OpenLiberty/open-liberty | dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java | CustomUtils.listExtensionDirectories | static List<File> listExtensionDirectories() {
"""
Returns the list of the absolute path of the extension directories.
The directory may or may not exist.
the list of directories which this method returns is:
1. wlp/usr/extension/
2. all locations returned from ProductExtension.getProductExtensions()
"""
... | java | static List<File> listExtensionDirectories() {
List<File> dirs = new ArrayList<File>();
dirs.add(new File(CustomUtils.getInstallRoot(), USER_FEATURE_DIR)); // wlp/usr/extension
for (ProductExtensionInfo info : ProductExtension.getProductExtensions()) {
File extensionDir = new File(i... | [
"static",
"List",
"<",
"File",
">",
"listExtensionDirectories",
"(",
")",
"{",
"List",
"<",
"File",
">",
"dirs",
"=",
"new",
"ArrayList",
"<",
"File",
">",
"(",
")",
";",
"dirs",
".",
"add",
"(",
"new",
"File",
"(",
"CustomUtils",
".",
"getInstallRoot"... | Returns the list of the absolute path of the extension directories.
The directory may or may not exist.
the list of directories which this method returns is:
1. wlp/usr/extension/
2. all locations returned from ProductExtension.getProductExtensions() | [
"Returns",
"the",
"list",
"of",
"the",
"absolute",
"path",
"of",
"the",
"extension",
"directories",
".",
"The",
"directory",
"may",
"or",
"may",
"not",
"exist",
".",
"the",
"list",
"of",
"directories",
"which",
"this",
"method",
"returns",
"is",
":",
"1",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java#L331-L347 |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/filters/AtlasKnoxSSOAuthenticationFilter.java | AtlasKnoxSSOAuthenticationFilter.parseRSAPublicKey | public static RSAPublicKey parseRSAPublicKey(String pem)
throws CertificateException, UnsupportedEncodingException,
ServletException {
"""
/*
public static RSAPublicKey getPublicKeyFromFile(String filePath) throws
IOException, CertificateException {
FileUtils.readFileToString(new File(fi... | java | public static RSAPublicKey parseRSAPublicKey(String pem)
throws CertificateException, UnsupportedEncodingException,
ServletException {
String PEM_HEADER = "-----BEGIN CERTIFICATE-----\n";
String PEM_FOOTER = "\n-----END CERTIFICATE-----";
String fullPem = PEM_HEADER + pem... | [
"public",
"static",
"RSAPublicKey",
"parseRSAPublicKey",
"(",
"String",
"pem",
")",
"throws",
"CertificateException",
",",
"UnsupportedEncodingException",
",",
"ServletException",
"{",
"String",
"PEM_HEADER",
"=",
"\"-----BEGIN CERTIFICATE-----\\n\"",
";",
"String",
"PEM_FO... | /*
public static RSAPublicKey getPublicKeyFromFile(String filePath) throws
IOException, CertificateException {
FileUtils.readFileToString(new File(filePath));
getPublicKeyFromString(pemString); } | [
"/",
"*",
"public",
"static",
"RSAPublicKey",
"getPublicKeyFromFile",
"(",
"String",
"filePath",
")",
"throws",
"IOException",
"CertificateException",
"{",
"FileUtils",
".",
"readFileToString",
"(",
"new",
"File",
"(",
"filePath",
"))",
";",
"getPublicKeyFromString",
... | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/filters/AtlasKnoxSSOAuthenticationFilter.java#L450-L474 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfCopy.java | PdfCopy.addPage | public void addPage(Rectangle rect, int rotation) {
"""
Adds a blank page.
@param rect The page dimension
@param rotation The rotation angle in degrees
@since 2.1.5
"""
PdfRectangle mediabox = new PdfRectangle(rect, rotation);
PageResources resources = new PageResources();
PdfPage page = new ... | java | public void addPage(Rectangle rect, int rotation) {
PdfRectangle mediabox = new PdfRectangle(rect, rotation);
PageResources resources = new PageResources();
PdfPage page = new PdfPage(mediabox, new HashMap(), resources.getResources(), 0);
page.put(PdfName.TABS, getTabs());
root.addPage(page);
... | [
"public",
"void",
"addPage",
"(",
"Rectangle",
"rect",
",",
"int",
"rotation",
")",
"{",
"PdfRectangle",
"mediabox",
"=",
"new",
"PdfRectangle",
"(",
"rect",
",",
"rotation",
")",
";",
"PageResources",
"resources",
"=",
"new",
"PageResources",
"(",
")",
";",... | Adds a blank page.
@param rect The page dimension
@param rotation The rotation angle in degrees
@since 2.1.5 | [
"Adds",
"a",
"blank",
"page",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfCopy.java#L372-L379 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java | CommonOps_DSCC.permuteRowInv | public static void permuteRowInv(int permInv[], DMatrixSparseCSC input, DMatrixSparseCSC output) {
"""
Applies the row permutation specified by the vector to the input matrix and save the results
in the output matrix. output[perm[j],:] = input[j,:]
@param permInv (Input) Inverse permutation vector. Specifies... | java | public static void permuteRowInv(int permInv[], DMatrixSparseCSC input, DMatrixSparseCSC output) {
if( input.numRows > permInv.length )
throw new IllegalArgumentException("permutation vector must have at least as many elements as input has rows");
output.reshape(input.numRows,input.numCols,... | [
"public",
"static",
"void",
"permuteRowInv",
"(",
"int",
"permInv",
"[",
"]",
",",
"DMatrixSparseCSC",
"input",
",",
"DMatrixSparseCSC",
"output",
")",
"{",
"if",
"(",
"input",
".",
"numRows",
">",
"permInv",
".",
"length",
")",
"throw",
"new",
"IllegalArgum... | Applies the row permutation specified by the vector to the input matrix and save the results
in the output matrix. output[perm[j],:] = input[j,:]
@param permInv (Input) Inverse permutation vector. Specifies new order of the rows.
@param input (Input) Matrix which is to be permuted
@param output (Output) Matrix which... | [
"Applies",
"the",
"row",
"permutation",
"specified",
"by",
"the",
"vector",
"to",
"the",
"input",
"matrix",
"and",
"save",
"the",
"results",
"in",
"the",
"output",
"matrix",
".",
"output",
"[",
"perm",
"[",
"j",
"]",
":",
"]",
"=",
"input",
"[",
"j",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java#L886-L906 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/serde/binary/BinarySerde.java | BinarySerde.doByteBufferPutUnCompressed | public static void doByteBufferPutUnCompressed(INDArray arr, ByteBuffer allocated, boolean rewind) {
"""
Setup the given byte buffer
for serialization (note that this is for uncompressed INDArrays)
4 bytes int for rank
4 bytes for data opType
shape buffer
data buffer
@param arr the array to setup
@param a... | java | public static void doByteBufferPutUnCompressed(INDArray arr, ByteBuffer allocated, boolean rewind) {
// ensure we send data to host memory
Nd4j.getExecutioner().commit();
Nd4j.getAffinityManager().ensureLocation(arr, AffinityManager.Location.HOST);
ByteBuffer buffer = arr.data().pointer... | [
"public",
"static",
"void",
"doByteBufferPutUnCompressed",
"(",
"INDArray",
"arr",
",",
"ByteBuffer",
"allocated",
",",
"boolean",
"rewind",
")",
"{",
"// ensure we send data to host memory",
"Nd4j",
".",
"getExecutioner",
"(",
")",
".",
"commit",
"(",
")",
";",
"... | Setup the given byte buffer
for serialization (note that this is for uncompressed INDArrays)
4 bytes int for rank
4 bytes for data opType
shape buffer
data buffer
@param arr the array to setup
@param allocated the byte buffer to setup
@param rewind whether to rewind the byte buffer or nt | [
"Setup",
"the",
"given",
"byte",
"buffer",
"for",
"serialization",
"(",
"note",
"that",
"this",
"is",
"for",
"uncompressed",
"INDArrays",
")",
"4",
"bytes",
"int",
"for",
"rank",
"4",
"bytes",
"for",
"data",
"opType",
"shape",
"buffer",
"data",
"buffer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/serde/binary/BinarySerde.java#L205-L220 |
minio/minio-java | api/src/main/java/io/minio/messages/XmlEntity.java | XmlEntity.parseXml | protected void parseXml(Reader reader, XmlNamespaceDictionary namespaceDictionary)
throws IOException, XmlPullParserException {
"""
Parses content from given reader input stream and namespace dictionary.
"""
this.xmlPullParser.setInput(reader);
Xml.parseElement(this.xmlPullParser, this, namespaceDi... | java | protected void parseXml(Reader reader, XmlNamespaceDictionary namespaceDictionary)
throws IOException, XmlPullParserException {
this.xmlPullParser.setInput(reader);
Xml.parseElement(this.xmlPullParser, this, namespaceDictionary, null);
} | [
"protected",
"void",
"parseXml",
"(",
"Reader",
"reader",
",",
"XmlNamespaceDictionary",
"namespaceDictionary",
")",
"throws",
"IOException",
",",
"XmlPullParserException",
"{",
"this",
".",
"xmlPullParser",
".",
"setInput",
"(",
"reader",
")",
";",
"Xml",
".",
"p... | Parses content from given reader input stream and namespace dictionary. | [
"Parses",
"content",
"from",
"given",
"reader",
"input",
"stream",
"and",
"namespace",
"dictionary",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/messages/XmlEntity.java#L72-L76 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/LocaleUtils.java | LocaleUtils.getAvailableViewLocales | public static List<ViewLocale> getAvailableViewLocales() {
"""
Returns a list of {@code ViewLocale}s, sorted by display name, of the default language and available translations.
@return the {@code ViewLocale}s of the default language and available translations.
@see ViewLocale
@since 2.4.0
"""
List<Str... | java | public static List<ViewLocale> getAvailableViewLocales() {
List<String> locales = readAvailableLocales();
List<ViewLocale> localesUI = new ArrayList<>();
if (!locales.isEmpty()) {
for (String locale : locales) {
localesUI.add(new ViewLocale(locale, getLocalDisplayName(locale)));
}
Collecti... | [
"public",
"static",
"List",
"<",
"ViewLocale",
">",
"getAvailableViewLocales",
"(",
")",
"{",
"List",
"<",
"String",
">",
"locales",
"=",
"readAvailableLocales",
"(",
")",
";",
"List",
"<",
"ViewLocale",
">",
"localesUI",
"=",
"new",
"ArrayList",
"<>",
"(",
... | Returns a list of {@code ViewLocale}s, sorted by display name, of the default language and available translations.
@return the {@code ViewLocale}s of the default language and available translations.
@see ViewLocale
@since 2.4.0 | [
"Returns",
"a",
"list",
"of",
"{",
"@code",
"ViewLocale",
"}",
"s",
"sorted",
"by",
"display",
"name",
"of",
"the",
"default",
"language",
"and",
"available",
"translations",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/LocaleUtils.java#L410-L432 |
leadware/jpersistence-tools | jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/utils/RestrictionsContainer.java | RestrictionsContainer.addLe | public <Y extends Comparable<? super Y>> RestrictionsContainer addLe(String property, Y value) {
"""
Methode d'ajout de la restriction Le
@param property Nom de la Propriete
@param value Valeur de la propriete
@param <Y> Type de valeur
@return Conteneur
"""
// Ajout de la restriction
restrictions... | java | public <Y extends Comparable<? super Y>> RestrictionsContainer addLe(String property, Y value) {
// Ajout de la restriction
restrictions.add(new Le<Y>(property, value));
// On retourne le conteneur
return this;
} | [
"public",
"<",
"Y",
"extends",
"Comparable",
"<",
"?",
"super",
"Y",
">",
">",
"RestrictionsContainer",
"addLe",
"(",
"String",
"property",
",",
"Y",
"value",
")",
"{",
"// Ajout de la restriction\r",
"restrictions",
".",
"add",
"(",
"new",
"Le",
"<",
"Y",
... | Methode d'ajout de la restriction Le
@param property Nom de la Propriete
@param value Valeur de la propriete
@param <Y> Type de valeur
@return Conteneur | [
"Methode",
"d",
"ajout",
"de",
"la",
"restriction",
"Le"
] | train | https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/utils/RestrictionsContainer.java#L199-L206 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java | AccountFiltersInner.createOrUpdateAsync | public Observable<AccountFilterInner> createOrUpdateAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) {
"""
Create or update an Account Filter.
Creates or updates an Account Filter in the Media Services account.
@param resourceGroupName The name of the resour... | java | public Observable<AccountFilterInner> createOrUpdateAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters).map(new Func1<ServiceResponse<AccountFilterInner>, Acc... | [
"public",
"Observable",
"<",
"AccountFilterInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"filterName",
",",
"AccountFilterInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync... | Create or update an Account Filter.
Creates or updates an Account Filter in the Media Services account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param filterName The Account Filter name
@param parameters The request para... | [
"Create",
"or",
"update",
"an",
"Account",
"Filter",
".",
"Creates",
"or",
"updates",
"an",
"Account",
"Filter",
"in",
"the",
"Media",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java#L361-L368 |
mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java | AbstractXmlMojo.getFiles | protected File[] getFiles( File pDir, String[] pIncludes, String[] pExcludes )
throws MojoFailureException, MojoExecutionException {
"""
Scans a directory for files and returns a set of {@link File} instances.
"""
return asFiles( pDir, getFileNames( pDir, pIncludes, pExcludes ) );
} | java | protected File[] getFiles( File pDir, String[] pIncludes, String[] pExcludes )
throws MojoFailureException, MojoExecutionException
{
return asFiles( pDir, getFileNames( pDir, pIncludes, pExcludes ) );
} | [
"protected",
"File",
"[",
"]",
"getFiles",
"(",
"File",
"pDir",
",",
"String",
"[",
"]",
"pIncludes",
",",
"String",
"[",
"]",
"pExcludes",
")",
"throws",
"MojoFailureException",
",",
"MojoExecutionException",
"{",
"return",
"asFiles",
"(",
"pDir",
",",
"get... | Scans a directory for files and returns a set of {@link File} instances. | [
"Scans",
"a",
"directory",
"for",
"files",
"and",
"returns",
"a",
"set",
"of",
"{"
] | train | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java#L239-L243 |
opengeospatial/teamengine | teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java | DomUtils.checkCommentNodes | public static boolean checkCommentNodes(Node node, String str) {
"""
Determines if there is a comment Node that contains the given string.
@param node
the Node to look in
@param str
the string value to match in the comment nodes
CTL declaration, if we ever want to use it <!--Sample Usage:
ctl:checkCommen... | java | public static boolean checkCommentNodes(Node node, String str) {
// Get nodes of node and go through them
NodeList children = node.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node child = children.item(i);
NodeList childChildren = child.getChi... | [
"public",
"static",
"boolean",
"checkCommentNodes",
"(",
"Node",
"node",
",",
"String",
"str",
")",
"{",
"// Get nodes of node and go through them\r",
"NodeList",
"children",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
"... | Determines if there is a comment Node that contains the given string.
@param node
the Node to look in
@param str
the string value to match in the comment nodes
CTL declaration, if we ever want to use it <!--Sample Usage:
ctl:checkCommentNodes($xml.resp, 'complexContent')-->
<ctl:function name="ctl:checkCommentNodes">... | [
"Determines",
"if",
"there",
"is",
"a",
"comment",
"Node",
"that",
"contains",
"the",
"given",
"string",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java#L129-L153 |
mapbox/mapbox-navigation-android | libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/instruction/AbbreviationCreator.java | AbbreviationCreator.addPriorityInfo | private void addPriorityInfo(BannerComponents bannerComponents, int index) {
"""
Adds the given BannerComponents object to the list of abbreviations so that when the list of
BannerComponentNodes is completed, text can be abbreviated properly to fit the specified
TextView.
@param bannerComponents object holdin... | java | private void addPriorityInfo(BannerComponents bannerComponents, int index) {
Integer abbreviationPriority = bannerComponents.abbreviationPriority();
if (abbreviations.get(abbreviationPriority) == null) {
abbreviations.put(abbreviationPriority, new ArrayList<Integer>());
}
abbreviations.get(abbrevi... | [
"private",
"void",
"addPriorityInfo",
"(",
"BannerComponents",
"bannerComponents",
",",
"int",
"index",
")",
"{",
"Integer",
"abbreviationPriority",
"=",
"bannerComponents",
".",
"abbreviationPriority",
"(",
")",
";",
"if",
"(",
"abbreviations",
".",
"get",
"(",
"... | Adds the given BannerComponents object to the list of abbreviations so that when the list of
BannerComponentNodes is completed, text can be abbreviated properly to fit the specified
TextView.
@param bannerComponents object holding the abbreviation information
@param index in the list of BannerComponentNodes | [
"Adds",
"the",
"given",
"BannerComponents",
"object",
"to",
"the",
"list",
"of",
"abbreviations",
"so",
"that",
"when",
"the",
"list",
"of",
"BannerComponentNodes",
"is",
"completed",
"text",
"can",
"be",
"abbreviated",
"properly",
"to",
"fit",
"the",
"specified... | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/instruction/AbbreviationCreator.java#L47-L53 |
deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.toArrowColumnsTimeSeries | public static List<FieldVector> toArrowColumnsTimeSeries(final BufferAllocator bufferAllocator,
final Schema schema,
List<List<List<Writable>>> dataVecRecord) {
"""
Convert a set of input st... | java | public static List<FieldVector> toArrowColumnsTimeSeries(final BufferAllocator bufferAllocator,
final Schema schema,
List<List<List<Writable>>> dataVecRecord) {
return toArrowColumnsTimeS... | [
"public",
"static",
"List",
"<",
"FieldVector",
">",
"toArrowColumnsTimeSeries",
"(",
"final",
"BufferAllocator",
"bufferAllocator",
",",
"final",
"Schema",
"schema",
",",
"List",
"<",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
">",
"dataVecRecord",
")",
... | Convert a set of input strings to arrow columns
for a time series.
@param bufferAllocator the buffer allocator to use
@param schema the schema to use
@param dataVecRecord the collection of input strings to process
@return the created vectors | [
"Convert",
"a",
"set",
"of",
"input",
"strings",
"to",
"arrow",
"columns",
"for",
"a",
"time",
"series",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L605-L609 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepsInner.java | JobStepsInner.listByVersionWithServiceResponseAsync | public Observable<ServiceResponse<Page<JobStepInner>>> listByVersionWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final int jobVersion) {
"""
Gets all job steps in the specified job version.
@param resourceGroupName The name of... | java | public Observable<ServiceResponse<Page<JobStepInner>>> listByVersionWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final int jobVersion) {
return listByVersionSinglePageAsync(resourceGroupName, serverName, jobAgentName, jobName,... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"JobStepInner",
">",
">",
">",
"listByVersionWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"jobAgentName",
",",
... | Gets all job steps in the specified job version.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent.
@param jobName The n... | [
"Gets",
"all",
"job",
"steps",
"in",
"the",
"specified",
"job",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepsInner.java#L177-L189 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/crypto/digest/DigestHelper.java | DigestHelper.sha1hmac | public static String sha1hmac(String key, String plaintext) {
"""
Performs HMAC-SHA1 on the UTF-8 byte representation of strings
@param key
@param plaintext
@return
"""
return sha1hmac(key, plaintext, ENCODE_HEX);
} | java | public static String sha1hmac(String key, String plaintext)
{
return sha1hmac(key, plaintext, ENCODE_HEX);
} | [
"public",
"static",
"String",
"sha1hmac",
"(",
"String",
"key",
",",
"String",
"plaintext",
")",
"{",
"return",
"sha1hmac",
"(",
"key",
",",
"plaintext",
",",
"ENCODE_HEX",
")",
";",
"}"
] | Performs HMAC-SHA1 on the UTF-8 byte representation of strings
@param key
@param plaintext
@return | [
"Performs",
"HMAC",
"-",
"SHA1",
"on",
"the",
"UTF",
"-",
"8",
"byte",
"representation",
"of",
"strings"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/crypto/digest/DigestHelper.java#L42-L45 |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/learning/ConfusionMatrixPanel.java | ConfusionMatrixPanel.whatIsAtPoint | public LocationInfo whatIsAtPoint( int pixelX , int pixelY , LocationInfo output ) {
"""
Use to sample the panel to see what is being displayed at the location clicked. All coordinates
are in panel coordinates.
@param pixelX x-axis in panel coordinates
@param pixelY y-axis in panel coordinates
@param output... | java | public LocationInfo whatIsAtPoint( int pixelX , int pixelY , LocationInfo output ) {
if( output == null )
output = new LocationInfo();
int numCategories = confusion.getNumRows();
synchronized ( this ) {
if( pixelX >= gridWidth ) {
output.insideMatrix = false;
output.col = output.row = pixelY*numCa... | [
"public",
"LocationInfo",
"whatIsAtPoint",
"(",
"int",
"pixelX",
",",
"int",
"pixelY",
",",
"LocationInfo",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"output",
"=",
"new",
"LocationInfo",
"(",
")",
";",
"int",
"numCategories",
"=",
"confu... | Use to sample the panel to see what is being displayed at the location clicked. All coordinates
are in panel coordinates.
@param pixelX x-axis in panel coordinates
@param pixelY y-axis in panel coordinates
@param output (Optional) storage for output.
@return Information on what is at the specified location | [
"Use",
"to",
"sample",
"the",
"panel",
"to",
"see",
"what",
"is",
"being",
"displayed",
"at",
"the",
"location",
"clicked",
".",
"All",
"coordinates",
"are",
"in",
"panel",
"coordinates",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/learning/ConfusionMatrixPanel.java#L301-L319 |
sstrickx/yahoofinance-api | src/main/java/yahoofinance/YahooFinance.java | YahooFinance.get | public static Stock get(String symbol, Interval interval) throws IOException {
"""
Sends a request with the historical quotes included
at the specified interval (DAILY, WEEKLY, MONTHLY).
Returns null if the data can't be retrieved from Yahoo Finance.
@param symbol the symbol of the stock for which you ... | java | public static Stock get(String symbol, Interval interval) throws IOException {
return YahooFinance.get(symbol, HistQuotesRequest.DEFAULT_FROM, HistQuotesRequest.DEFAULT_TO, interval);
} | [
"public",
"static",
"Stock",
"get",
"(",
"String",
"symbol",
",",
"Interval",
"interval",
")",
"throws",
"IOException",
"{",
"return",
"YahooFinance",
".",
"get",
"(",
"symbol",
",",
"HistQuotesRequest",
".",
"DEFAULT_FROM",
",",
"HistQuotesRequest",
".",
"DEFAU... | Sends a request with the historical quotes included
at the specified interval (DAILY, WEEKLY, MONTHLY).
Returns null if the data can't be retrieved from Yahoo Finance.
@param symbol the symbol of the stock for which you want to retrieve information
@param interval the interval of the included historical da... | [
"Sends",
"a",
"request",
"with",
"the",
"historical",
"quotes",
"included",
"at",
"the",
"specified",
"interval",
"(",
"DAILY",
"WEEKLY",
"MONTHLY",
")",
".",
"Returns",
"null",
"if",
"the",
"data",
"can",
"t",
"be",
"retrieved",
"from",
"Yahoo",
"Finance",
... | train | https://github.com/sstrickx/yahoofinance-api/blob/2766ba52fc5cccf9b4da5c06423d68059cf0a6e6/src/main/java/yahoofinance/YahooFinance.java#L112-L114 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.queryMessages | public Observable<ComapiResult<MessagesQueryResponse>> queryMessages(@NonNull final String conversationId, final Long from, @NonNull final Integer limit) {
"""
Query chanel messages.
@param conversationId ID of a conversation to query messages in it.
@param from ID of the message to start from.
@par... | java | public Observable<ComapiResult<MessagesQueryResponse>> queryMessages(@NonNull final String conversationId, final Long from, @NonNull final Integer limit) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queueQueryMessages(conversationId,... | [
"public",
"Observable",
"<",
"ComapiResult",
"<",
"MessagesQueryResponse",
">",
">",
"queryMessages",
"(",
"@",
"NonNull",
"final",
"String",
"conversationId",
",",
"final",
"Long",
"from",
",",
"@",
"NonNull",
"final",
"Integer",
"limit",
")",
"{",
"final",
"... | Query chanel messages.
@param conversationId ID of a conversation to query messages in it.
@param from ID of the message to start from.
@param limit Limit of events to obtain in this call.
@return Observable to get messages in a conversation. | [
"Query",
"chanel",
"messages",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L881-L892 |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundManager.java | SoundManager.setBaseGain | public void setBaseGain (float gain) {
"""
Configures the base gain (which must be a value between 0 and 1.0) which is multiplied to
the individual gain assigned to sound effects (but not music).
"""
if (_baseGain == gain) {
return;
}
_baseGain = gain;
// alert the... | java | public void setBaseGain (float gain)
{
if (_baseGain == gain) {
return;
}
_baseGain = gain;
// alert the groups that inherite the gain
for (int ii = 0, nn = _groups.size(); ii < nn; ii++) {
SoundGroup group = _groups.get(ii);
if (group.get... | [
"public",
"void",
"setBaseGain",
"(",
"float",
"gain",
")",
"{",
"if",
"(",
"_baseGain",
"==",
"gain",
")",
"{",
"return",
";",
"}",
"_baseGain",
"=",
"gain",
";",
"// alert the groups that inherite the gain",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"nn",
... | Configures the base gain (which must be a value between 0 and 1.0) which is multiplied to
the individual gain assigned to sound effects (but not music). | [
"Configures",
"the",
"base",
"gain",
"(",
"which",
"must",
"be",
"a",
"value",
"between",
"0",
"and",
"1",
".",
"0",
")",
"which",
"is",
"multiplied",
"to",
"the",
"individual",
"gain",
"assigned",
"to",
"sound",
"effects",
"(",
"but",
"not",
"music",
... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundManager.java#L114-L128 |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.createTracedImage | public static BufferedImage createTracedImage (
ImageCreator isrc, BufferedImage src, Color tcolor, int thickness,
float startAlpha, float endAlpha) {
"""
Creates and returns a new image consisting of the supplied image traced with the given
color, thickness and alpha transparency.
"""
... | java | public static BufferedImage createTracedImage (
ImageCreator isrc, BufferedImage src, Color tcolor, int thickness,
float startAlpha, float endAlpha)
{
// create the destination image
int wid = src.getWidth(), hei = src.getHeight();
BufferedImage dest = isrc.createImage(wid, h... | [
"public",
"static",
"BufferedImage",
"createTracedImage",
"(",
"ImageCreator",
"isrc",
",",
"BufferedImage",
"src",
",",
"Color",
"tcolor",
",",
"int",
"thickness",
",",
"float",
"startAlpha",
",",
"float",
"endAlpha",
")",
"{",
"// create the destination image",
"i... | Creates and returns a new image consisting of the supplied image traced with the given
color, thickness and alpha transparency. | [
"Creates",
"and",
"returns",
"a",
"new",
"image",
"consisting",
"of",
"the",
"supplied",
"image",
"traced",
"with",
"the",
"given",
"color",
"thickness",
"and",
"alpha",
"transparency",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L271-L279 |
janus-project/guava.janusproject.io | guava/src/com/google/common/base/Joiner.java | Joiner.appendTo | public final StringBuilder appendTo(StringBuilder builder, Iterator<?> parts) {
"""
Appends the string representation of each of {@code parts}, using the previously configured
separator between each, to {@code builder}. Identical to {@link #appendTo(Appendable,
Iterable)}, except that it does not throw {@link IO... | java | public final StringBuilder appendTo(StringBuilder builder, Iterator<?> parts) {
try {
appendTo((Appendable) builder, parts);
} catch (IOException impossible) {
throw new AssertionError(impossible);
}
return builder;
} | [
"public",
"final",
"StringBuilder",
"appendTo",
"(",
"StringBuilder",
"builder",
",",
"Iterator",
"<",
"?",
">",
"parts",
")",
"{",
"try",
"{",
"appendTo",
"(",
"(",
"Appendable",
")",
"builder",
",",
"parts",
")",
";",
"}",
"catch",
"(",
"IOException",
... | Appends the string representation of each of {@code parts}, using the previously configured
separator between each, to {@code builder}. Identical to {@link #appendTo(Appendable,
Iterable)}, except that it does not throw {@link IOException}.
@since 11.0 | [
"Appends",
"the",
"string",
"representation",
"of",
"each",
"of",
"{",
"@code",
"parts",
"}",
"using",
"the",
"previously",
"configured",
"separator",
"between",
"each",
"to",
"{",
"@code",
"builder",
"}",
".",
"Identical",
"to",
"{",
"@link",
"#appendTo",
"... | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/base/Joiner.java#L150-L157 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.