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 |
|---|---|---|---|---|---|---|---|---|---|---|
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseIfStatement | private Stmt.IfElse parseIfStatement(EnclosingScope scope) {
"""
Parse a classical if-else statement, which is has the form:
<pre>
"if" Expr ':' NewLine Block ["else" ':' NewLine Block]
</pre>
The first expression is referred to as the <i>condition</i>, while the
first block is referred to as the <i>true ... | java | private Stmt.IfElse parseIfStatement(EnclosingScope scope) {
int start = index;
// An if statement begins with the keyword "if", followed by an
// expression representing the condition.
match(If);
// NOTE: expression terminated by ':'
Expr c = parseLogicalExpression(scope, true);
// The a colon to signal ... | [
"private",
"Stmt",
".",
"IfElse",
"parseIfStatement",
"(",
"EnclosingScope",
"scope",
")",
"{",
"int",
"start",
"=",
"index",
";",
"// An if statement begins with the keyword \"if\", followed by an",
"// expression representing the condition.",
"match",
"(",
"If",
")",
";",... | Parse a classical if-else statement, which is has the form:
<pre>
"if" Expr ':' NewLine Block ["else" ':' NewLine Block]
</pre>
The first expression is referred to as the <i>condition</i>, while the
first block is referred to as the <i>true branch</i>. The optional second
block is referred to as the <i>false branch</... | [
"Parse",
"a",
"classical",
"if",
"-",
"else",
"statement",
"which",
"is",
"has",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L1125-L1162 |
square/protoparser | src/main/java/com/squareup/protoparser/ProtoParser.java | ProtoParser.parseUtf8 | public static ProtoFile parseUtf8(String name, InputStream is) throws IOException {
"""
Parse a named {@code .proto} schema. The {@code InputStream} is not closed.
"""
return parse(name, new InputStreamReader(is, UTF_8));
} | java | public static ProtoFile parseUtf8(String name, InputStream is) throws IOException {
return parse(name, new InputStreamReader(is, UTF_8));
} | [
"public",
"static",
"ProtoFile",
"parseUtf8",
"(",
"String",
"name",
",",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"return",
"parse",
"(",
"name",
",",
"new",
"InputStreamReader",
"(",
"is",
",",
"UTF_8",
")",
")",
";",
"}"
] | Parse a named {@code .proto} schema. The {@code InputStream} is not closed. | [
"Parse",
"a",
"named",
"{"
] | train | https://github.com/square/protoparser/blob/8be66bb8fe6658b04741df0358daabca501f2524/src/main/java/com/squareup/protoparser/ProtoParser.java#L44-L46 |
datacleaner/DataCleaner | engine/env/spark/src/main/java/org/datacleaner/spark/functions/RowProcessingFunction.java | RowProcessingFunction.createReplacementDatastore | private ResourceDatastore createReplacementDatastore(final ComponentBuilder cb, final ResourceDatastore datastore,
final Resource replacementResource) {
"""
Creates a {@link Datastore} replacement to use for configured properties
@param cb
@param datastore
@param replacementResource
@return a rep... | java | private ResourceDatastore createReplacementDatastore(final ComponentBuilder cb, final ResourceDatastore datastore,
final Resource replacementResource) {
final String name = datastore.getName();
if (datastore instanceof CsvDatastore) {
final CsvConfiguration csvConfiguration = ((C... | [
"private",
"ResourceDatastore",
"createReplacementDatastore",
"(",
"final",
"ComponentBuilder",
"cb",
",",
"final",
"ResourceDatastore",
"datastore",
",",
"final",
"Resource",
"replacementResource",
")",
"{",
"final",
"String",
"name",
"=",
"datastore",
".",
"getName",
... | Creates a {@link Datastore} replacement to use for configured properties
@param cb
@param datastore
@param replacementResource
@return a replacement datastore, or null if it shouldn't be replaced | [
"Creates",
"a",
"{",
"@link",
"Datastore",
"}",
"replacement",
"to",
"use",
"for",
"configured",
"properties"
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/env/spark/src/main/java/org/datacleaner/spark/functions/RowProcessingFunction.java#L216-L230 |
forge/core | addons/impl/src/main/java/org/jboss/forge/addon/addons/project/AddonProjectConfiguratorImpl.java | AddonProjectConfiguratorImpl.setupComplexAddonProject | @Override
public void setupComplexAddonProject(Project project, Iterable<AddonId> dependencyAddons)
throws FileNotFoundException, FacetNotFoundException {
"""
Create a Furnace Project with the full structure (api,impl,tests,spi and addon)
@throws FacetNotFoundException
@throws FileNotFoundExcept... | java | @Override
public void setupComplexAddonProject(Project project, Iterable<AddonId> dependencyAddons)
throws FileNotFoundException, FacetNotFoundException
{
FacetFactory facetFactory = getFacetFactory();
DependencyInstaller dependencyInstaller = getDependencyInstaller();
generateReadme... | [
"@",
"Override",
"public",
"void",
"setupComplexAddonProject",
"(",
"Project",
"project",
",",
"Iterable",
"<",
"AddonId",
">",
"dependencyAddons",
")",
"throws",
"FileNotFoundException",
",",
"FacetNotFoundException",
"{",
"FacetFactory",
"facetFactory",
"=",
"getFacet... | Create a Furnace Project with the full structure (api,impl,tests,spi and addon)
@throws FacetNotFoundException
@throws FileNotFoundException | [
"Create",
"a",
"Furnace",
"Project",
"with",
"the",
"full",
"structure",
"(",
"api",
"impl",
"tests",
"spi",
"and",
"addon",
")"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/addons/impl/src/main/java/org/jboss/forge/addon/addons/project/AddonProjectConfiguratorImpl.java#L90-L157 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java | ZooKeeperUtils.createLeaderRetrievalService | public static ZooKeeperLeaderRetrievalService createLeaderRetrievalService(
final CuratorFramework client,
final Configuration configuration) throws Exception {
"""
Creates a {@link ZooKeeperLeaderRetrievalService} instance.
@param client The {@link CuratorFramework} ZooKeeper client to use
@param c... | java | public static ZooKeeperLeaderRetrievalService createLeaderRetrievalService(
final CuratorFramework client,
final Configuration configuration) throws Exception {
return createLeaderRetrievalService(client, configuration, "");
} | [
"public",
"static",
"ZooKeeperLeaderRetrievalService",
"createLeaderRetrievalService",
"(",
"final",
"CuratorFramework",
"client",
",",
"final",
"Configuration",
"configuration",
")",
"throws",
"Exception",
"{",
"return",
"createLeaderRetrievalService",
"(",
"client",
",",
... | Creates a {@link ZooKeeperLeaderRetrievalService} instance.
@param client The {@link CuratorFramework} ZooKeeper client to use
@param configuration {@link Configuration} object containing the configuration values
@return {@link ZooKeeperLeaderRetrievalService} instance.
@throws Exception | [
"Creates",
"a",
"{",
"@link",
"ZooKeeperLeaderRetrievalService",
"}",
"instance",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java#L170-L174 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/JapaneseDate.java | JapaneseDate.ofYearDay | static JapaneseDate ofYearDay(JapaneseEra era, int yearOfEra, int dayOfYear) {
"""
Obtains a {@code JapaneseDate} representing a date in the Japanese calendar
system from the era, year-of-era and day-of-year fields.
<p>
This returns a {@code JapaneseDate} with the specified fields.
The day must be valid for th... | java | static JapaneseDate ofYearDay(JapaneseEra era, int yearOfEra, int dayOfYear) {
Jdk8Methods.requireNonNull(era, "era");
if (yearOfEra < 1) {
throw new DateTimeException("Invalid YearOfEra: " + yearOfEra);
}
LocalDate eraStartDate = era.startDate();
LocalDate eraEndDate... | [
"static",
"JapaneseDate",
"ofYearDay",
"(",
"JapaneseEra",
"era",
",",
"int",
"yearOfEra",
",",
"int",
"dayOfYear",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"era",
",",
"\"era\"",
")",
";",
"if",
"(",
"yearOfEra",
"<",
"1",
")",
"{",
"throw",
... | Obtains a {@code JapaneseDate} representing a date in the Japanese calendar
system from the era, year-of-era and day-of-year fields.
<p>
This returns a {@code JapaneseDate} with the specified fields.
The day must be valid for the year, otherwise an exception will be thrown.
The Japanese day-of-year is reset when the er... | [
"Obtains",
"a",
"{",
"@code",
"JapaneseDate",
"}",
"representing",
"a",
"date",
"in",
"the",
"Japanese",
"calendar",
"system",
"from",
"the",
"era",
"year",
"-",
"of",
"-",
"era",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
".",
"<p",
">",
"This",
... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/JapaneseDate.java#L213-L232 |
zaproxy/zaproxy | src/org/parosproxy/paros/core/scanner/HostProcess.java | HostProcess.performScannerHookBeforeScan | protected synchronized void performScannerHookBeforeScan(HttpMessage msg, AbstractPlugin plugin) {
"""
ZAP: abstract plugin will call this method in order to invoke any extensions that have hooked into the active scanner
@param msg the message being scanned
@param plugin the plugin being run
"""
Iterator<... | java | protected synchronized void performScannerHookBeforeScan(HttpMessage msg, AbstractPlugin plugin) {
Iterator<ScannerHook> iter = this.parentScanner.getScannerHooks().iterator();
while(iter.hasNext()){
ScannerHook hook = iter.next();
if(hook != null) {
try {
hook.beforeScan(msg, plugin, this.pare... | [
"protected",
"synchronized",
"void",
"performScannerHookBeforeScan",
"(",
"HttpMessage",
"msg",
",",
"AbstractPlugin",
"plugin",
")",
"{",
"Iterator",
"<",
"ScannerHook",
">",
"iter",
"=",
"this",
".",
"parentScanner",
".",
"getScannerHooks",
"(",
")",
".",
"itera... | ZAP: abstract plugin will call this method in order to invoke any extensions that have hooked into the active scanner
@param msg the message being scanned
@param plugin the plugin being run | [
"ZAP",
":",
"abstract",
"plugin",
"will",
"call",
"this",
"method",
"in",
"order",
"to",
"invoke",
"any",
"extensions",
"that",
"have",
"hooked",
"into",
"the",
"active",
"scanner"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/HostProcess.java#L1068-L1080 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.getKeyPair | public static KeyPair getKeyPair(KeyStore keyStore, char[] password, String alias) {
"""
从KeyStore中获取私钥公钥
@param keyStore {@link KeyStore}
@param password 密码
@param alias 别名
@return {@link KeyPair}
@since 4.4.1
"""
PublicKey publicKey;
PrivateKey privateKey;
try {
publicKey = keyStore.getCe... | java | public static KeyPair getKeyPair(KeyStore keyStore, char[] password, String alias) {
PublicKey publicKey;
PrivateKey privateKey;
try {
publicKey = keyStore.getCertificate(alias).getPublicKey();
privateKey = (PrivateKey) keyStore.getKey(alias, password);
} catch (Exception e) {
throw new CryptoEx... | [
"public",
"static",
"KeyPair",
"getKeyPair",
"(",
"KeyStore",
"keyStore",
",",
"char",
"[",
"]",
"password",
",",
"String",
"alias",
")",
"{",
"PublicKey",
"publicKey",
";",
"PrivateKey",
"privateKey",
";",
"try",
"{",
"publicKey",
"=",
"keyStore",
".",
"get... | 从KeyStore中获取私钥公钥
@param keyStore {@link KeyStore}
@param password 密码
@param alias 别名
@return {@link KeyPair}
@since 4.4.1 | [
"从KeyStore中获取私钥公钥"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L606-L616 |
samskivert/pythagoras | src/main/java/pythagoras/f/Vectors.java | Vectors.vectorToString | public static String vectorToString (float x, float y) {
"""
Returns a string describing the supplied vector, of the form <code>+x+y</code>,
<code>+x-y</code>, <code>-x-y</code>, etc.
"""
return MathUtil.toString(x) + MathUtil.toString(y);
} | java | public static String vectorToString (float x, float y) {
return MathUtil.toString(x) + MathUtil.toString(y);
} | [
"public",
"static",
"String",
"vectorToString",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"return",
"MathUtil",
".",
"toString",
"(",
"x",
")",
"+",
"MathUtil",
".",
"toString",
"(",
"y",
")",
";",
"}"
] | Returns a string describing the supplied vector, of the form <code>+x+y</code>,
<code>+x-y</code>, <code>-x-y</code>, etc. | [
"Returns",
"a",
"string",
"describing",
"the",
"supplied",
"vector",
"of",
"the",
"form",
"<code",
">",
"+",
"x",
"+",
"y<",
"/",
"code",
">",
"<code",
">",
"+",
"x",
"-",
"y<",
"/",
"code",
">",
"<code",
">",
"-",
"x",
"-",
"y<",
"/",
"code",
... | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Vectors.java#L146-L148 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/validation/CsvBindingErrors.java | CsvBindingErrors.reject | public void reject(final String errorCode, final Map<String, Object> messageVariables, final String defaultMessage) {
"""
グローバルエラーを登録する。
@param errorCode エラーコード
@param messageVariables メッセージ中の変数。
@param defaultMessage 指定したエラーコードに対するメッセージが見つからないときに使用するメッセージです。指定しない場合はnullを設定します。
"""
reject(new Strin... | java | public void reject(final String errorCode, final Map<String, Object> messageVariables, final String defaultMessage) {
reject(new String[]{errorCode}, messageVariables, defaultMessage);
} | [
"public",
"void",
"reject",
"(",
"final",
"String",
"errorCode",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"messageVariables",
",",
"final",
"String",
"defaultMessage",
")",
"{",
"reject",
"(",
"new",
"String",
"[",
"]",
"{",
"errorCode",
"}"... | グローバルエラーを登録する。
@param errorCode エラーコード
@param messageVariables メッセージ中の変数。
@param defaultMessage 指定したエラーコードに対するメッセージが見つからないときに使用するメッセージです。指定しない場合はnullを設定します。 | [
"グローバルエラーを登録する。"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/validation/CsvBindingErrors.java#L302-L304 |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/AbstractEDBService.java | AbstractEDBService.addModifiedObjectsToEntityManager | private void addModifiedObjectsToEntityManager(List<JPAObject> modified, Long timestamp) {
"""
Updates all modified EDBObjects with the timestamp and persist them through the entity manager.
"""
for (JPAObject update : modified) {
update.setTimestamp(timestamp);
entityManager.pe... | java | private void addModifiedObjectsToEntityManager(List<JPAObject> modified, Long timestamp) {
for (JPAObject update : modified) {
update.setTimestamp(timestamp);
entityManager.persist(update);
}
} | [
"private",
"void",
"addModifiedObjectsToEntityManager",
"(",
"List",
"<",
"JPAObject",
">",
"modified",
",",
"Long",
"timestamp",
")",
"{",
"for",
"(",
"JPAObject",
"update",
":",
"modified",
")",
"{",
"update",
".",
"setTimestamp",
"(",
"timestamp",
")",
";",... | Updates all modified EDBObjects with the timestamp and persist them through the entity manager. | [
"Updates",
"all",
"modified",
"EDBObjects",
"with",
"the",
"timestamp",
"and",
"persist",
"them",
"through",
"the",
"entity",
"manager",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/AbstractEDBService.java#L125-L130 |
calimero-project/calimero-core | src/tuwien/auto/calimero/dptxlator/TranslatorTypes.java | TranslatorTypes.createTranslator | public static DPTXlator createTranslator(final int mainNumber, final String dptId) throws KNXException {
"""
Creates a DPT translator for the given datapoint type ID.
<p>
The translation behavior of a DPT translator instance is uniquely defined by the supplied datapoint type ID.
<p>
If the <code>dptId</code> a... | java | public static DPTXlator createTranslator(final int mainNumber, final String dptId) throws KNXException
{
int main = 0;
try {
main = getMainNumber(mainNumber, dptId);
}
catch (final NumberFormatException e) {}
final MainType type = map.get(main);
if (type == null)
throw new KNXException("no DPT transl... | [
"public",
"static",
"DPTXlator",
"createTranslator",
"(",
"final",
"int",
"mainNumber",
",",
"final",
"String",
"dptId",
")",
"throws",
"KNXException",
"{",
"int",
"main",
"=",
"0",
";",
"try",
"{",
"main",
"=",
"getMainNumber",
"(",
"mainNumber",
",",
"dptI... | Creates a DPT translator for the given datapoint type ID.
<p>
The translation behavior of a DPT translator instance is uniquely defined by the supplied datapoint type ID.
<p>
If the <code>dptId</code> argument is built up the recommended way, that is "<i>main number</i>.<i>sub number</i>
", the <code>mainNumber</code> ... | [
"Creates",
"a",
"DPT",
"translator",
"for",
"the",
"given",
"datapoint",
"type",
"ID",
".",
"<p",
">",
"The",
"translation",
"behavior",
"of",
"a",
"DPT",
"translator",
"instance",
"is",
"uniquely",
"defined",
"by",
"the",
"supplied",
"datapoint",
"type",
"I... | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/dptxlator/TranslatorTypes.java#L562-L575 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java | CompressionCodecFactory.getCodecClasses | public static List<Class<? extends CompressionCodec>> getCodecClasses(Configuration conf) {
"""
Get the list of codecs listed in the configuration
@param conf the configuration to look in
@return a list of the Configuration classes or null if the attribute
was not set
"""
String codecsString = conf.get(... | java | public static List<Class<? extends CompressionCodec>> getCodecClasses(Configuration conf) {
String codecsString = conf.get("io.compression.codecs");
if (codecsString != null) {
List<Class<? extends CompressionCodec>> result
= new ArrayList<Class<? extends CompressionCodec>>();
StringTokenize... | [
"public",
"static",
"List",
"<",
"Class",
"<",
"?",
"extends",
"CompressionCodec",
">",
">",
"getCodecClasses",
"(",
"Configuration",
"conf",
")",
"{",
"String",
"codecsString",
"=",
"conf",
".",
"get",
"(",
"\"io.compression.codecs\"",
")",
";",
"if",
"(",
... | Get the list of codecs listed in the configuration
@param conf the configuration to look in
@return a list of the Configuration classes or null if the attribute
was not set | [
"Get",
"the",
"list",
"of",
"codecs",
"listed",
"in",
"the",
"configuration"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java#L85-L112 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/EnumHelper.java | EnumHelper.getFromNameOrNull | @Nullable
public static <ENUMTYPE extends Enum <ENUMTYPE> & IHasName> ENUMTYPE getFromNameOrNull (@Nonnull final Class <ENUMTYPE> aClass,
@Nullable final String sName) {
"""
Get the enum value with the passed name
@param... | java | @Nullable
public static <ENUMTYPE extends Enum <ENUMTYPE> & IHasName> ENUMTYPE getFromNameOrNull (@Nonnull final Class <ENUMTYPE> aClass,
@Nullable final String sName)
{
return getFromNameOrDefault (aClass, sName, null);
... | [
"@",
"Nullable",
"public",
"static",
"<",
"ENUMTYPE",
"extends",
"Enum",
"<",
"ENUMTYPE",
">",
"&",
"IHasName",
">",
"ENUMTYPE",
"getFromNameOrNull",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"ENUMTYPE",
">",
"aClass",
",",
"@",
"Nullable",
"final",
"Strin... | Get the enum value with the passed name
@param <ENUMTYPE>
The enum type
@param aClass
The enum class
@param sName
The name to search
@return <code>null</code> if no enum item with the given name is present. | [
"Get",
"the",
"enum",
"value",
"with",
"the",
"passed",
"name"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/EnumHelper.java#L350-L355 |
overturetool/overture | core/interpreter/src/main/java/org/overture/interpreter/runtime/Interpreter.java | Interpreter.setBreakpoint | public Breakpoint setBreakpoint(PExp exp, String condition)
throws ParserException, LexException {
"""
Set an expression breakpoint. A breakpoint stops execution and allows the user to query the environment.
@param exp
The expression at which to stop.
@param condition
The condition when to stop.
@return ... | java | public Breakpoint setBreakpoint(PExp exp, String condition)
throws ParserException, LexException
{
BreakpointManager.setBreakpoint(exp, new Stoppoint(exp.getLocation(), ++nextbreakpoint, condition));
breakpoints.put(nextbreakpoint, BreakpointManager.getBreakpoint(exp));
return BreakpointManager.getBreakpoint(... | [
"public",
"Breakpoint",
"setBreakpoint",
"(",
"PExp",
"exp",
",",
"String",
"condition",
")",
"throws",
"ParserException",
",",
"LexException",
"{",
"BreakpointManager",
".",
"setBreakpoint",
"(",
"exp",
",",
"new",
"Stoppoint",
"(",
"exp",
".",
"getLocation",
"... | Set an expression breakpoint. A breakpoint stops execution and allows the user to query the environment.
@param exp
The expression at which to stop.
@param condition
The condition when to stop.
@return The Breakpoint object created.
@throws LexException
@throws ParserException | [
"Set",
"an",
"expression",
"breakpoint",
".",
"A",
"breakpoint",
"stops",
"execution",
"and",
"allows",
"the",
"user",
"to",
"query",
"the",
"environment",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/interpreter/src/main/java/org/overture/interpreter/runtime/Interpreter.java#L487-L493 |
OpenTSDB/opentsdb | src/rollup/RollupConfig.java | RollupConfig.ensureTablesExist | public void ensureTablesExist(final TSDB tsdb) {
"""
Makes sure each of the rollup tables exists
@param tsdb The TSDB to use for fetching the HBase client
"""
final List<Deferred<Object>> deferreds =
new ArrayList<Deferred<Object>>(forward_intervals.size() * 2);
for (RollupInterval inter... | java | public void ensureTablesExist(final TSDB tsdb) {
final List<Deferred<Object>> deferreds =
new ArrayList<Deferred<Object>>(forward_intervals.size() * 2);
for (RollupInterval interval : forward_intervals.values()) {
deferreds.add(tsdb.getClient()
.ensureTableExists(interval.getTempor... | [
"public",
"void",
"ensureTablesExist",
"(",
"final",
"TSDB",
"tsdb",
")",
"{",
"final",
"List",
"<",
"Deferred",
"<",
"Object",
">",
">",
"deferreds",
"=",
"new",
"ArrayList",
"<",
"Deferred",
"<",
"Object",
">",
">",
"(",
"forward_intervals",
".",
"size",... | Makes sure each of the rollup tables exists
@param tsdb The TSDB to use for fetching the HBase client | [
"Makes",
"sure",
"each",
"of",
"the",
"rollup",
"tables",
"exists"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/rollup/RollupConfig.java#L226-L247 |
rhuss/jolokia | agent/osgi/src/main/java/org/jolokia/osgi/JolokiaActivator.java | JolokiaActivator.getHttpContext | public synchronized HttpContext getHttpContext() {
"""
Get the security context for out servlet. Dependent on the configuration,
this is either a no-op context or one which authenticates with a given user
@return the HttpContext with which the agent servlet gets registered.
"""
if (jolokiaHttpConte... | java | public synchronized HttpContext getHttpContext() {
if (jolokiaHttpContext == null) {
final String user = getConfiguration(USER);
final String authMode = getConfiguration(AUTH_MODE);
if (user == null) {
if (ServiceAuthenticationHttpContext.shouldBeUsed(authMode... | [
"public",
"synchronized",
"HttpContext",
"getHttpContext",
"(",
")",
"{",
"if",
"(",
"jolokiaHttpContext",
"==",
"null",
")",
"{",
"final",
"String",
"user",
"=",
"getConfiguration",
"(",
"USER",
")",
";",
"final",
"String",
"authMode",
"=",
"getConfiguration",
... | Get the security context for out servlet. Dependent on the configuration,
this is either a no-op context or one which authenticates with a given user
@return the HttpContext with which the agent servlet gets registered. | [
"Get",
"the",
"security",
"context",
"for",
"out",
"servlet",
".",
"Dependent",
"on",
"the",
"configuration",
"this",
"is",
"either",
"a",
"no",
"-",
"op",
"context",
"or",
"one",
"which",
"authenticates",
"with",
"a",
"given",
"user"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/osgi/src/main/java/org/jolokia/osgi/JolokiaActivator.java#L147-L164 |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/collect/FluentCloseableIterable.java | FluentCloseableIterable.append | public final FluentCloseableIterable<T> append(Iterable<? extends T> other) {
"""
Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable,
followed by those of {@code other}. The iterators are not polled until necessary.
<p>The returned iterable's {@code Iterator} supports... | java | public final FluentCloseableIterable<T> append(Iterable<? extends T> other) {
return from(wrap(Iterables.concat(this, other), this));
} | [
"public",
"final",
"FluentCloseableIterable",
"<",
"T",
">",
"append",
"(",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"other",
")",
"{",
"return",
"from",
"(",
"wrap",
"(",
"Iterables",
".",
"concat",
"(",
"this",
",",
"other",
")",
",",
"this",
")",
... | Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable,
followed by those of {@code other}. The iterators are not polled until necessary.
<p>The returned iterable's {@code Iterator} supports {@code remove()} when the corresponding
{@code Iterator} supports it. | [
"Returns",
"a",
"fluent",
"iterable",
"whose",
"iterators",
"traverse",
"first",
"the",
"elements",
"of",
"this",
"fluent",
"iterable",
"followed",
"by",
"those",
"of",
"{",
"@code",
"other",
"}",
".",
"The",
"iterators",
"are",
"not",
"polled",
"until",
"ne... | train | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/collect/FluentCloseableIterable.java#L126-L128 |
jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/manager/factory/GhprbBuildManagerFactoryUtil.java | GhprbBuildManagerFactoryUtil.getBuildManager | public static GhprbBuildManager getBuildManager(Run<?, ?> build) {
"""
Gets an instance of a library that is able to calculate build urls depending of build type.
<p>
If the class representing the build type is not present on the classloader then default implementation is returned.
@param build the job from J... | java | public static GhprbBuildManager getBuildManager(Run<?, ?> build) {
JobConfiguration jobConfiguration = JobConfiguration.builder().printStackTrace(false).build();
return getBuildManager(build, jobConfiguration);
} | [
"public",
"static",
"GhprbBuildManager",
"getBuildManager",
"(",
"Run",
"<",
"?",
",",
"?",
">",
"build",
")",
"{",
"JobConfiguration",
"jobConfiguration",
"=",
"JobConfiguration",
".",
"builder",
"(",
")",
".",
"printStackTrace",
"(",
"false",
")",
".",
"buil... | Gets an instance of a library that is able to calculate build urls depending of build type.
<p>
If the class representing the build type is not present on the classloader then default implementation is returned.
@param build the job from Jenkins
@return a buildManager | [
"Gets",
"an",
"instance",
"of",
"a",
"library",
"that",
"is",
"able",
"to",
"calculate",
"build",
"urls",
"depending",
"of",
"build",
"type",
".",
"<p",
">",
"If",
"the",
"class",
"representing",
"the",
"build",
"type",
"is",
"not",
"present",
"on",
"the... | train | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/manager/factory/GhprbBuildManagerFactoryUtil.java#L26-L30 |
gotev/android-upload-service | uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadRequest.java | FTPUploadRequest.addFileToUpload | public FTPUploadRequest addFileToUpload(String filePath, String remotePath, UnixPermissions permissions)
throws FileNotFoundException {
"""
Add a file to be uploaded.
@param filePath path to the local file on the device
@param remotePath absolute path (or relative path to the default remote working d... | java | public FTPUploadRequest addFileToUpload(String filePath, String remotePath, UnixPermissions permissions)
throws FileNotFoundException {
UploadFile file = new UploadFile(filePath);
if (remotePath == null || remotePath.isEmpty()) {
throw new IllegalArgumentException("You have to s... | [
"public",
"FTPUploadRequest",
"addFileToUpload",
"(",
"String",
"filePath",
",",
"String",
"remotePath",
",",
"UnixPermissions",
"permissions",
")",
"throws",
"FileNotFoundException",
"{",
"UploadFile",
"file",
"=",
"new",
"UploadFile",
"(",
"filePath",
")",
";",
"i... | Add a file to be uploaded.
@param filePath path to the local file on the device
@param remotePath absolute path (or relative path to the default remote working directory)
of the file on the FTP server. Valid paths are for example:
{@code /path/to/myfile.txt}, {@code relative/path/} or {@code myfile.zip}.
If any of the ... | [
"Add",
"a",
"file",
"to",
"be",
"uploaded",
"."
] | train | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadRequest.java#L141-L157 |
eclipse/xtext-core | org.eclipse.xtext/xtend-gen/org/eclipse/xtext/generator/trace/node/GeneratorNodeExtensions.java | GeneratorNodeExtensions.appendNewLineIfNotEmpty | public CompositeGeneratorNode appendNewLineIfNotEmpty(final CompositeGeneratorNode parent) {
"""
Appends a line separator node that will only be effective if the current line contains non-whitespace text.
@return the given parent node
"""
List<IGeneratorNode> _children = parent.getChildren();
String... | java | public CompositeGeneratorNode appendNewLineIfNotEmpty(final CompositeGeneratorNode parent) {
List<IGeneratorNode> _children = parent.getChildren();
String _lineDelimiter = this.wsConfig.getLineDelimiter();
NewLineNode _newLineNode = new NewLineNode(_lineDelimiter, true);
_children.add(_newLineNode);
... | [
"public",
"CompositeGeneratorNode",
"appendNewLineIfNotEmpty",
"(",
"final",
"CompositeGeneratorNode",
"parent",
")",
"{",
"List",
"<",
"IGeneratorNode",
">",
"_children",
"=",
"parent",
".",
"getChildren",
"(",
")",
";",
"String",
"_lineDelimiter",
"=",
"this",
"."... | Appends a line separator node that will only be effective if the current line contains non-whitespace text.
@return the given parent node | [
"Appends",
"a",
"line",
"separator",
"node",
"that",
"will",
"only",
"be",
"effective",
"if",
"the",
"current",
"line",
"contains",
"non",
"-",
"whitespace",
"text",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/xtend-gen/org/eclipse/xtext/generator/trace/node/GeneratorNodeExtensions.java#L121-L127 |
dihedron/dihedron-commons | src/main/java/org/dihedron/patterns/visitor/VisitorHelper.java | VisitorHelper.getValue | public static Object getValue(Object object, Field field) throws VisitorException {
"""
Returns the value of the given field on the given object.
@param object
the object whose field is to be retrieved.
@param field
the field being retrieved.
@return
the value of the field.
@throws VisitorException
if an... | java | public static Object getValue(Object object, Field field) throws VisitorException {
boolean reprotect = false;
if(object == null) {
return null;
}
try {
if(!field.isAccessible()) {
field.setAccessible(true);
reprotect = true;
}
Object value = field.get(object);
logger.trace("field '{}' ha... | [
"public",
"static",
"Object",
"getValue",
"(",
"Object",
"object",
",",
"Field",
"field",
")",
"throws",
"VisitorException",
"{",
"boolean",
"reprotect",
"=",
"false",
";",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"... | Returns the value of the given field on the given object.
@param object
the object whose field is to be retrieved.
@param field
the field being retrieved.
@return
the value of the field.
@throws VisitorException
if an error occurs while evaluating the node's value. | [
"Returns",
"the",
"value",
"of",
"the",
"given",
"field",
"on",
"the",
"given",
"object",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/visitor/VisitorHelper.java#L64-L88 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/internal/util/Checks.java | Checks.checkMinMax | public static void checkMinMax(int min, int max) {
"""
Checks that neither {@code min} or {@code max} is negative and {@code min <= max}.
"""
checkMin(min);
checkMax(max);
checkArgument(min <= max, "min > max");
} | java | public static void checkMinMax(int min, int max) {
checkMin(min);
checkMax(max);
checkArgument(min <= max, "min > max");
} | [
"public",
"static",
"void",
"checkMinMax",
"(",
"int",
"min",
",",
"int",
"max",
")",
"{",
"checkMin",
"(",
"min",
")",
";",
"checkMax",
"(",
"max",
")",
";",
"checkArgument",
"(",
"min",
"<=",
"max",
",",
"\"min > max\"",
")",
";",
"}"
] | Checks that neither {@code min} or {@code max} is negative and {@code min <= max}. | [
"Checks",
"that",
"neither",
"{"
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/internal/util/Checks.java#L124-L128 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java | JmsJcaManagedConnectionFactoryImpl.getReference | Reference getReference() {
"""
Returns a reference for this managed connection factory.
@return a reference for this managed connection factory
"""
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "getReference");
}
// Creat... | java | Reference getReference() {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "getReference");
}
// Create a reference object describing this class
final Reference reference = new Reference(getConnectionType(),
... | [
"Reference",
"getReference",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"TRACE",
",",
"\"getReference\"",
")",
";",
... | Returns a reference for this managed connection factory.
@return a reference for this managed connection factory | [
"Returns",
"a",
"reference",
"for",
"this",
"managed",
"connection",
"factory",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java#L1779-L1818 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.listSiteDetectorsSlotAsync | public Observable<Page<DetectorDefinitionInner>> listSiteDetectorsSlotAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String slot) {
"""
Get Detectors.
Get Detectors.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param s... | java | public Observable<Page<DetectorDefinitionInner>> listSiteDetectorsSlotAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String slot) {
return listSiteDetectorsSlotWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, slot)
.map(ne... | [
"public",
"Observable",
"<",
"Page",
"<",
"DetectorDefinitionInner",
">",
">",
"listSiteDetectorsSlotAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
",",
"final",
"String",
"diagnosticCategory",
",",
"final",
"String",
"slot",
... | Get Detectors.
Get Detectors.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@param slot Slot Name
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedLis... | [
"Get",
"Detectors",
".",
"Get",
"Detectors",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L2120-L2128 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/hypergraph/depparse/HyperDepParser.java | HyperDepParser.insideOutsideO2AllGraSingleRoot | public static EdgeScores insideOutsideO2AllGraSingleRoot(DependencyScorer scorer, Algebra s) {
"""
Runs inside outside on an all-grandparents hypergraph and returns the edge marginals in the real semiring.
"""
return insideOutside02AllGra(scorer, s, true);
} | java | public static EdgeScores insideOutsideO2AllGraSingleRoot(DependencyScorer scorer, Algebra s) {
return insideOutside02AllGra(scorer, s, true);
} | [
"public",
"static",
"EdgeScores",
"insideOutsideO2AllGraSingleRoot",
"(",
"DependencyScorer",
"scorer",
",",
"Algebra",
"s",
")",
"{",
"return",
"insideOutside02AllGra",
"(",
"scorer",
",",
"s",
",",
"true",
")",
";",
"}"
] | Runs inside outside on an all-grandparents hypergraph and returns the edge marginals in the real semiring. | [
"Runs",
"inside",
"outside",
"on",
"an",
"all",
"-",
"grandparents",
"hypergraph",
"and",
"returns",
"the",
"edge",
"marginals",
"in",
"the",
"real",
"semiring",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/hypergraph/depparse/HyperDepParser.java#L146-L148 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.setOrthoSymmetric | public Matrix4x3f setOrthoSymmetric(float width, float height, float zNear, float zFar, boolean zZeroToOne) {
"""
Set this matrix to be a symmetric orthographic projection transformation for a right-handed coordinate system using the given NDC z range.
<p>
This method is equivalent to calling {@link #setOrtho(fl... | java | public Matrix4x3f setOrthoSymmetric(float width, float height, float zNear, float zFar, boolean zZeroToOne) {
MemUtil.INSTANCE.identity(this);
m00 = 2.0f / width;
m11 = 2.0f / height;
m22 = (zZeroToOne ? 1.0f : 2.0f) / (zNear - zFar);
m32 = (zZeroToOne ? zNear : (zFar + zNear)) /... | [
"public",
"Matrix4x3f",
"setOrthoSymmetric",
"(",
"float",
"width",
",",
"float",
"height",
",",
"float",
"zNear",
",",
"float",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"identity",
"(",
"this",
")",
";",
"m00",
"=",... | Set this matrix to be a symmetric orthographic projection transformation for a right-handed coordinate system using the given NDC z range.
<p>
This method is equivalent to calling {@link #setOrtho(float, float, float, float, float, float, boolean) setOrtho()} with
<code>left=-width/2</code>, <code>right=+width/2</code>... | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
".",
"<p",
">",
"This",
"method",
"is",
"equivale... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L5550-L5558 |
andrehertwig/admintool | admin-tools-demo-core/src/main/java/de/chandre/admintool/Beans.java | Beans.adminToolMbeansExported | @Bean
public boolean adminToolMbeansExported(MBeanServer server, BeanFactory beanFactory, List<AdminToolConfig> configs) throws MalformedObjectNameException {
"""
maybe not reasonable to export all configuration beans as mbeans, especially configurations like fileBrowser or dbBrowser
@param mbeanExporter
@pa... | java | @Bean
public boolean adminToolMbeansExported(MBeanServer server, BeanFactory beanFactory, List<AdminToolConfig> configs) throws MalformedObjectNameException {
MBeanExporter mbeanExporter = new MBeanExporter();
mbeanExporter.setServer(server);
mbeanExporter.setBeanFactory(beanFactory);
SimpleReflectiveMBeanInf... | [
"@",
"Bean",
"public",
"boolean",
"adminToolMbeansExported",
"(",
"MBeanServer",
"server",
",",
"BeanFactory",
"beanFactory",
",",
"List",
"<",
"AdminToolConfig",
">",
"configs",
")",
"throws",
"MalformedObjectNameException",
"{",
"MBeanExporter",
"mbeanExporter",
"=",
... | maybe not reasonable to export all configuration beans as mbeans, especially configurations like fileBrowser or dbBrowser
@param mbeanExporter
@param configs
@return
@throws MalformedObjectNameException | [
"maybe",
"not",
"reasonable",
"to",
"export",
"all",
"configuration",
"beans",
"as",
"mbeans",
"especially",
"configurations",
"like",
"fileBrowser",
"or",
"dbBrowser"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-demo-core/src/main/java/de/chandre/admintool/Beans.java#L107-L122 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FilterFileSystem.java | FilterFileSystem.initialize | public void initialize(URI name, Configuration conf) throws IOException {
"""
Called after a new FileSystem instance is constructed.
@param name a uri whose authority section names the host, port, etc.
for this FileSystem
@param conf the configuration
"""
fs.initialize(name, conf);
} | java | public void initialize(URI name, Configuration conf) throws IOException {
fs.initialize(name, conf);
} | [
"public",
"void",
"initialize",
"(",
"URI",
"name",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"fs",
".",
"initialize",
"(",
"name",
",",
"conf",
")",
";",
"}"
] | Called after a new FileSystem instance is constructed.
@param name a uri whose authority section names the host, port, etc.
for this FileSystem
@param conf the configuration | [
"Called",
"after",
"a",
"new",
"FileSystem",
"instance",
"is",
"constructed",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L64-L66 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/ReflectionUtils.java | ReflectionUtils.getRequiredField | public static Field getRequiredField(Class type, String name) {
"""
Finds a field on the given type for the given name.
@param type The type
@param name The name
@return An {@link Optional} contains the method or empty
"""
try {
return type.getDeclaredField(name);
} catch (NoSu... | java | public static Field getRequiredField(Class type, String name) {
try {
return type.getDeclaredField(name);
} catch (NoSuchFieldException e) {
Optional<Field> field = findField(type, name);
return field.orElseThrow(() -> new NoSuchFieldError("No field '" + name + "' fou... | [
"public",
"static",
"Field",
"getRequiredField",
"(",
"Class",
"type",
",",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"type",
".",
"getDeclaredField",
"(",
"name",
")",
";",
"}",
"catch",
"(",
"NoSuchFieldException",
"e",
")",
"{",
"Optional",
"<",... | Finds a field on the given type for the given name.
@param type The type
@param name The name
@return An {@link Optional} contains the method or empty | [
"Finds",
"a",
"field",
"on",
"the",
"given",
"type",
"for",
"the",
"given",
"name",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/ReflectionUtils.java#L289-L296 |
mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java | RenderTheme.matchClosedWay | public void matchClosedWay(RenderCallback renderCallback, final RenderContext renderContext, PolylineContainer way) {
"""
Matches a closed way with the given parameters against this RenderTheme.
@param renderCallback the callback implementation which will be executed on each match.
@param renderContext
@param... | java | public void matchClosedWay(RenderCallback renderCallback, final RenderContext renderContext, PolylineContainer way) {
matchWay(renderCallback, renderContext, Closed.YES, way);
} | [
"public",
"void",
"matchClosedWay",
"(",
"RenderCallback",
"renderCallback",
",",
"final",
"RenderContext",
"renderContext",
",",
"PolylineContainer",
"way",
")",
"{",
"matchWay",
"(",
"renderCallback",
",",
"renderContext",
",",
"Closed",
".",
"YES",
",",
"way",
... | Matches a closed way with the given parameters against this RenderTheme.
@param renderCallback the callback implementation which will be executed on each match.
@param renderContext
@param way | [
"Matches",
"a",
"closed",
"way",
"with",
"the",
"given",
"parameters",
"against",
"this",
"RenderTheme",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java#L111-L113 |
finmath/finmath-lib | src/main/java/net/finmath/time/SchedulePrototype.java | SchedulePrototype.generateSchedule | public Schedule generateSchedule(LocalDate referenceDate, int maturity, int termination, OffsetUnit unit) {
"""
Generate a schedule with start / end date determined by an offset from the reference date.
@param referenceDate The reference date (corresponds to \( t = 0 \).
@param maturity Offset of the start dat... | java | public Schedule generateSchedule(LocalDate referenceDate, int maturity, int termination, OffsetUnit unit) {
LocalDate startDate;
LocalDate endDate;
switch(unit) {
case YEARS : startDate = referenceDate.plusYears(maturity); endDate = startDate.plusYears(termination); break;
case MONTHS : startDate = ... | [
"public",
"Schedule",
"generateSchedule",
"(",
"LocalDate",
"referenceDate",
",",
"int",
"maturity",
",",
"int",
"termination",
",",
"OffsetUnit",
"unit",
")",
"{",
"LocalDate",
"startDate",
";",
"LocalDate",
"endDate",
";",
"switch",
"(",
"unit",
")",
"{",
"c... | Generate a schedule with start / end date determined by an offset from the reference date.
@param referenceDate The reference date (corresponds to \( t = 0 \).
@param maturity Offset of the start date to the reference date
@param termination Offset of the end date to the start date
@param unit The convention to use fo... | [
"Generate",
"a",
"schedule",
"with",
"start",
"/",
"end",
"date",
"determined",
"by",
"an",
"offset",
"from",
"the",
"reference",
"date",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/time/SchedulePrototype.java#L165-L179 |
zaproxy/zaproxy | src/org/parosproxy/paros/model/HistoryList.java | HistoryList.removeRange | @Override
public void removeRange(int fromIndex, int toIndex) {
"""
Note: implementation copied from base class (DefaultListModel) but changed to call the local method removeElementAt(int)
"""
if (fromIndex > toIndex) {
throw new IllegalArgumentException("fromIndex must be <= toIndex... | java | @Override
public void removeRange(int fromIndex, int toIndex) {
if (fromIndex > toIndex) {
throw new IllegalArgumentException("fromIndex must be <= toIndex");
}
for (int i = toIndex; i >= fromIndex; i--) {
removeElementAt(i);
}
fireIntervalRemo... | [
"@",
"Override",
"public",
"void",
"removeRange",
"(",
"int",
"fromIndex",
",",
"int",
"toIndex",
")",
"{",
"if",
"(",
"fromIndex",
">",
"toIndex",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"fromIndex must be <= toIndex\"",
")",
";",
"}",
"f... | Note: implementation copied from base class (DefaultListModel) but changed to call the local method removeElementAt(int) | [
"Note",
":",
"implementation",
"copied",
"from",
"base",
"class",
"(",
"DefaultListModel",
")",
"but",
"changed",
"to",
"call",
"the",
"local",
"method",
"removeElementAt",
"(",
"int",
")"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/model/HistoryList.java#L115-L124 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.identity_group_group_GET | public OvhGroup identity_group_group_GET(String group) throws IOException {
"""
Get this object properties
REST: GET /me/identity/group/{group}
@param group [required] Group's name
"""
String qPath = "/me/identity/group/{group}";
StringBuilder sb = path(qPath, group);
String resp = exec(qPath, "GET",... | java | public OvhGroup identity_group_group_GET(String group) throws IOException {
String qPath = "/me/identity/group/{group}";
StringBuilder sb = path(qPath, group);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhGroup.class);
} | [
"public",
"OvhGroup",
"identity_group_group_GET",
"(",
"String",
"group",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/identity/group/{group}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"group",
")",
";",
"String",
"resp",
... | Get this object properties
REST: GET /me/identity/group/{group}
@param group [required] Group's name | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L272-L277 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.println | public static void println(Object self, Object value) {
"""
Print a value formatted Groovy style (followed by a newline) to self
if it is a Writer, otherwise to the standard output stream.
@param self any Object
@param value the value to print
@since 1.0
"""
// we won't get here if we are a Prin... | java | public static void println(Object self, Object value) {
// we won't get here if we are a PrintWriter
if (self instanceof Writer) {
final PrintWriter pw = new GroovyPrintWriter((Writer) self);
pw.println(value);
} else {
System.out.println(InvokerHelper.toStrin... | [
"public",
"static",
"void",
"println",
"(",
"Object",
"self",
",",
"Object",
"value",
")",
"{",
"// we won't get here if we are a PrintWriter",
"if",
"(",
"self",
"instanceof",
"Writer",
")",
"{",
"final",
"PrintWriter",
"pw",
"=",
"new",
"GroovyPrintWriter",
"(",... | Print a value formatted Groovy style (followed by a newline) to self
if it is a Writer, otherwise to the standard output stream.
@param self any Object
@param value the value to print
@since 1.0 | [
"Print",
"a",
"value",
"formatted",
"Groovy",
"style",
"(",
"followed",
"by",
"a",
"newline",
")",
"to",
"self",
"if",
"it",
"is",
"a",
"Writer",
"otherwise",
"to",
"the",
"standard",
"output",
"stream",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L797-L805 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/scheduler/JobScheduler.java | JobScheduler.getTrigger | private Trigger getTrigger(JobKey jobKey, Properties jobProps) {
"""
Get a {@link org.quartz.Trigger} from the given job configuration properties.
"""
// Build a trigger for the job with the given cron-style schedule
return TriggerBuilder.newTrigger()
.withIdentity(jobProps.getProperty(Configur... | java | private Trigger getTrigger(JobKey jobKey, Properties jobProps) {
// Build a trigger for the job with the given cron-style schedule
return TriggerBuilder.newTrigger()
.withIdentity(jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY),
Strings.nullToEmpty(jobProps.getProperty(ConfigurationKeys... | [
"private",
"Trigger",
"getTrigger",
"(",
"JobKey",
"jobKey",
",",
"Properties",
"jobProps",
")",
"{",
"// Build a trigger for the job with the given cron-style schedule",
"return",
"TriggerBuilder",
".",
"newTrigger",
"(",
")",
".",
"withIdentity",
"(",
"jobProps",
".",
... | Get a {@link org.quartz.Trigger} from the given job configuration properties. | [
"Get",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/scheduler/JobScheduler.java#L572-L580 |
BlueBrain/bluima | utils/blue_commons/src/main/java/ch/epfl/bbp/StringUtils.java | StringUtils.maxTruncStr | public static String maxTruncStr(String source, int maxNrChars) {
"""
Truncates the String at maxNrChars.
@param source
@param maxNrChars
@return
"""
if (source != null && source.length() > maxNrChars) {
return source.substring(0, maxNrChars);
} else {
return source... | java | public static String maxTruncStr(String source, int maxNrChars) {
if (source != null && source.length() > maxNrChars) {
return source.substring(0, maxNrChars);
} else {
return source;
}
} | [
"public",
"static",
"String",
"maxTruncStr",
"(",
"String",
"source",
",",
"int",
"maxNrChars",
")",
"{",
"if",
"(",
"source",
"!=",
"null",
"&&",
"source",
".",
"length",
"(",
")",
">",
"maxNrChars",
")",
"{",
"return",
"source",
".",
"substring",
"(",
... | Truncates the String at maxNrChars.
@param source
@param maxNrChars
@return | [
"Truncates",
"the",
"String",
"at",
"maxNrChars",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/utils/blue_commons/src/main/java/ch/epfl/bbp/StringUtils.java#L259-L265 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java | MultiChangeBuilder.insertTextAbsolutely | public MultiChangeBuilder<PS, SEG, S> insertTextAbsolutely(int paragraphIndex, int columnPosition, String text) {
"""
Inserts the given text at the position returned from
{@code getAbsolutePosition(paragraphIndex, columnPosition)}.
<p><b>Caution:</b> see {@link StyledDocument#getAbsolutePosition(int, int)} to ... | java | public MultiChangeBuilder<PS, SEG, S> insertTextAbsolutely(int paragraphIndex, int columnPosition, String text) {
int index = area.getAbsolutePosition(paragraphIndex, columnPosition);
return replaceTextAbsolutely(index, index, text);
} | [
"public",
"MultiChangeBuilder",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"insertTextAbsolutely",
"(",
"int",
"paragraphIndex",
",",
"int",
"columnPosition",
",",
"String",
"text",
")",
"{",
"int",
"index",
"=",
"area",
".",
"getAbsolutePosition",
"(",
"paragraphI... | Inserts the given text at the position returned from
{@code getAbsolutePosition(paragraphIndex, columnPosition)}.
<p><b>Caution:</b> see {@link StyledDocument#getAbsolutePosition(int, int)} to know how the column index argument
can affect the returned position.</p>
@param text The text to insert | [
"Inserts",
"the",
"given",
"text",
"at",
"the",
"position",
"returned",
"from",
"{",
"@code",
"getAbsolutePosition",
"(",
"paragraphIndex",
"columnPosition",
")",
"}",
"."
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java#L177-L180 |
microfocus-idol/java-view-proxy-components | idol/src/main/java/com/hp/autonomy/frontend/view/idol/IdolViewServerService.java | IdolViewServerService.viewDocument | @Override
public <T> T viewDocument(final String documentReference, final Collection<String> indexes, final Processor<T> processor) throws ViewDocumentNotFoundException, ViewNoReferenceFieldException, ReferenceFieldBlankException {
"""
Provides an HTML rendering of the given IDOL document reference. This first... | java | @Override
public <T> T viewDocument(final String documentReference, final Collection<String> indexes, final Processor<T> processor) throws ViewDocumentNotFoundException, ViewNoReferenceFieldException, ReferenceFieldBlankException {
final String referenceFieldValue = getReferenceFieldValue(documentReference,... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"viewDocument",
"(",
"final",
"String",
"documentReference",
",",
"final",
"Collection",
"<",
"String",
">",
"indexes",
",",
"final",
"Processor",
"<",
"T",
">",
"processor",
")",
"throws",
"ViewDocumentNotFoundEx... | Provides an HTML rendering of the given IDOL document reference. This first performs a GetContent to make sure the
document exists, then reads the configured reference field and passes the value of the field to ViewServer.
@param documentReference The IDOL document reference of the document to view
@param indexes ... | [
"Provides",
"an",
"HTML",
"rendering",
"of",
"the",
"given",
"IDOL",
"document",
"reference",
".",
"This",
"first",
"performs",
"a",
"GetContent",
"to",
"make",
"sure",
"the",
"document",
"exists",
"then",
"reads",
"the",
"configured",
"reference",
"field",
"a... | train | https://github.com/microfocus-idol/java-view-proxy-components/blob/d338c38fb9fb78adcc1887c4b23617372c06c651/idol/src/main/java/com/hp/autonomy/frontend/view/idol/IdolViewServerService.java#L64-L80 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/StorableGenerator.java | StorableGenerator.addPropertyStateCheckMethod | private void addPropertyStateCheckMethod(String name, int state) {
"""
Generates public method which accepts a property name and returns a
boolean true, if the given state matches the property's actual state.
@param name name of method
@param state property state to check
"""
MethodInfo mi = addM... | java | private void addPropertyStateCheckMethod(String name, int state) {
MethodInfo mi = addMethodIfNotFinal(Modifiers.PUBLIC, name,
TypeDesc.BOOLEAN, new TypeDesc[] {TypeDesc.STRING});
if (mi == null) {
return;
}
CodeBuilder b ... | [
"private",
"void",
"addPropertyStateCheckMethod",
"(",
"String",
"name",
",",
"int",
"state",
")",
"{",
"MethodInfo",
"mi",
"=",
"addMethodIfNotFinal",
"(",
"Modifiers",
".",
"PUBLIC",
",",
"name",
",",
"TypeDesc",
".",
"BOOLEAN",
",",
"new",
"TypeDesc",
"[",
... | Generates public method which accepts a property name and returns a
boolean true, if the given state matches the property's actual state.
@param name name of method
@param state property state to check | [
"Generates",
"public",
"method",
"which",
"accepts",
"a",
"property",
"name",
"and",
"returns",
"a",
"boolean",
"true",
"if",
"the",
"given",
"state",
"matches",
"the",
"property",
"s",
"actual",
"state",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java#L2860-L2887 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.createMenuItem | public final JMenuItem createMenuItem(MenuFactory menuFactory, CommandButtonConfigurer buttonConfigurer) {
"""
Create a menuItem using the default faceDescriptorId.
@see #createMenuItem(String, MenuFactory, CommandButtonConfigurer)
"""
return createMenuItem(getDefaultFaceDescriptorId(), menuFactory, butto... | java | public final JMenuItem createMenuItem(MenuFactory menuFactory, CommandButtonConfigurer buttonConfigurer) {
return createMenuItem(getDefaultFaceDescriptorId(), menuFactory, buttonConfigurer);
} | [
"public",
"final",
"JMenuItem",
"createMenuItem",
"(",
"MenuFactory",
"menuFactory",
",",
"CommandButtonConfigurer",
"buttonConfigurer",
")",
"{",
"return",
"createMenuItem",
"(",
"getDefaultFaceDescriptorId",
"(",
")",
",",
"menuFactory",
",",
"buttonConfigurer",
")",
... | Create a menuItem using the default faceDescriptorId.
@see #createMenuItem(String, MenuFactory, CommandButtonConfigurer) | [
"Create",
"a",
"menuItem",
"using",
"the",
"default",
"faceDescriptorId",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L831-L833 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/JobLeaderIdService.java | JobLeaderIdService.addJob | public void addJob(JobID jobId) throws Exception {
"""
Add a job to be monitored to retrieve the job leader id.
@param jobId identifying the job to monitor
@throws Exception if the job could not be added to the service
"""
Preconditions.checkNotNull(jobLeaderIdActions);
LOG.debug("Add job {} to job le... | java | public void addJob(JobID jobId) throws Exception {
Preconditions.checkNotNull(jobLeaderIdActions);
LOG.debug("Add job {} to job leader id monitoring.", jobId);
if (!jobLeaderIdListeners.containsKey(jobId)) {
LeaderRetrievalService leaderRetrievalService = highAvailabilityServices.getJobManagerLeaderRetriever... | [
"public",
"void",
"addJob",
"(",
"JobID",
"jobId",
")",
"throws",
"Exception",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"jobLeaderIdActions",
")",
";",
"LOG",
".",
"debug",
"(",
"\"Add job {} to job leader id monitoring.\"",
",",
"jobId",
")",
";",
"if",
... | Add a job to be monitored to retrieve the job leader id.
@param jobId identifying the job to monitor
@throws Exception if the job could not be added to the service | [
"Add",
"a",
"job",
"to",
"be",
"monitored",
"to",
"retrieve",
"the",
"job",
"leader",
"id",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/JobLeaderIdService.java#L145-L156 |
kikinteractive/ice | ice/src/main/java/com/kik/config/ice/ConfigSystem.java | ConfigSystem.overrideModule | public static <C> Module overrideModule(
final Class<C> configInterface,
final OverrideConsumer<C> overrideConsumer) {
"""
Generates a Guice Module for use with Injector creation. The module created is intended to be used in a
<code>Modules.override</code> manner, to produce overrides for static c... | java | public static <C> Module overrideModule(
final Class<C> configInterface,
final OverrideConsumer<C> overrideConsumer)
{
return overrideModule(configInterface, Optional.empty(), overrideConsumer);
} | [
"public",
"static",
"<",
"C",
">",
"Module",
"overrideModule",
"(",
"final",
"Class",
"<",
"C",
">",
"configInterface",
",",
"final",
"OverrideConsumer",
"<",
"C",
">",
"overrideConsumer",
")",
"{",
"return",
"overrideModule",
"(",
"configInterface",
",",
"Opt... | Generates a Guice Module for use with Injector creation. The module created is intended to be used in a
<code>Modules.override</code> manner, to produce overrides for static configuration.
@param configInterface The configuration interface type for which values are to be overridden
@param overrideConsumer a lambda wh... | [
"Generates",
"a",
"Guice",
"Module",
"for",
"use",
"with",
"Injector",
"creation",
".",
"The",
"module",
"created",
"is",
"intended",
"to",
"be",
"used",
"in",
"a",
"<code",
">",
"Modules",
".",
"override<",
"/",
"code",
">",
"manner",
"to",
"produce",
"... | train | https://github.com/kikinteractive/ice/blob/0c58d7bf2d9f6504892d0768d6022fcfa6df7514/ice/src/main/java/com/kik/config/ice/ConfigSystem.java#L169-L174 |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java | EntityREST.validateUniqueAttribute | private void validateUniqueAttribute(AtlasEntityType entityType, Map<String, Object> attributes) throws AtlasBaseException {
"""
Validate that each attribute given is an unique attribute
@param entityType the entity type
@param attributes attributes
"""
if (MapUtils.isEmpty(attributes)) {
... | java | private void validateUniqueAttribute(AtlasEntityType entityType, Map<String, Object> attributes) throws AtlasBaseException {
if (MapUtils.isEmpty(attributes)) {
throw new AtlasBaseException(AtlasErrorCode.ATTRIBUTE_UNIQUE_INVALID, entityType.getTypeName(), "");
}
for (String attribu... | [
"private",
"void",
"validateUniqueAttribute",
"(",
"AtlasEntityType",
"entityType",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"throws",
"AtlasBaseException",
"{",
"if",
"(",
"MapUtils",
".",
"isEmpty",
"(",
"attributes",
")",
")",
"{",
... | Validate that each attribute given is an unique attribute
@param entityType the entity type
@param attributes attributes | [
"Validate",
"that",
"each",
"attribute",
"given",
"is",
"an",
"unique",
"attribute"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java#L557-L569 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/AnnotationUtils.java | AnnotationUtils.getBeanFieldValue | public static Serializable getBeanFieldValue(IDeepType entity, Field deepField) {
"""
Returns the value of the fields <i>deepField</i> in the instance <i>entity</i> of type T.
@param entity the entity to process.
@param deepField the Field to process belonging to <i>entity</i>
@return the property value.
... | java | public static Serializable getBeanFieldValue(IDeepType entity, Field deepField) {
try {
return (Serializable) PropertyUtils.getProperty(entity, deepField.getName());
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e1) {
throw new DeepIOExcepti... | [
"public",
"static",
"Serializable",
"getBeanFieldValue",
"(",
"IDeepType",
"entity",
",",
"Field",
"deepField",
")",
"{",
"try",
"{",
"return",
"(",
"Serializable",
")",
"PropertyUtils",
".",
"getProperty",
"(",
"entity",
",",
"deepField",
".",
"getName",
"(",
... | Returns the value of the fields <i>deepField</i> in the instance <i>entity</i> of type T.
@param entity the entity to process.
@param deepField the Field to process belonging to <i>entity</i>
@return the property value. | [
"Returns",
"the",
"value",
"of",
"the",
"fields",
"<i",
">",
"deepField<",
"/",
"i",
">",
"in",
"the",
"instance",
"<i",
">",
"entity<",
"/",
"i",
">",
"of",
"type",
"T",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/AnnotationUtils.java#L116-L124 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.ortho2D | public Matrix4x3d ortho2D(double left, double right, double bottom, double top) {
"""
Apply an orthographic projection transformation for a right-handed coordinate system to this matrix.
<p>
This method is equivalent to calling {@link #ortho(double, double, double, double, double, double) ortho()} with
<code>zN... | java | public Matrix4x3d ortho2D(double left, double right, double bottom, double top) {
return ortho2D(left, right, bottom, top, this);
} | [
"public",
"Matrix4x3d",
"ortho2D",
"(",
"double",
"left",
",",
"double",
"right",
",",
"double",
"bottom",
",",
"double",
"top",
")",
"{",
"return",
"ortho2D",
"(",
"left",
",",
"right",
",",
"bottom",
",",
"top",
",",
"this",
")",
";",
"}"
] | Apply an orthographic projection transformation for a right-handed coordinate system to this matrix.
<p>
This method is equivalent to calling {@link #ortho(double, double, double, double, double, double) ortho()} with
<code>zNear=-1</code> and <code>zFar=+1</code>.
<p>
If <code>M</code> is <code>this</code> matrix and ... | [
"Apply",
"an",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"to",
"this",
"matrix",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#ortho",
"(",
"double",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L7594-L7596 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/stats/VariantAggregatedStatsCalculator.java | VariantAggregatedStatsCalculator.getGenotype | public static void getGenotype(int index, Integer alleles[]) {
"""
returns in alleles[] the genotype specified in index in the sequence:
0/0, 0/1, 1/1, 0/2, 1/2, 2/2, 0/3...
@param index in this sequence, starting in 0
@param alleles returned genotype.
"""
// index++;
// double value = (-3 + M... | java | public static void getGenotype(int index, Integer alleles[]) {
// index++;
// double value = (-3 + Math.sqrt(1 + 8 * index)) / 2; // slower than the iterating version, right?
// alleles[1] = new Double(Math.ceil(value)).intValue();
// alleles[0] = alleles[1] - ((alleles[1] + 1) * (alleles... | [
"public",
"static",
"void",
"getGenotype",
"(",
"int",
"index",
",",
"Integer",
"alleles",
"[",
"]",
")",
"{",
"// index++;",
"// double value = (-3 + Math.sqrt(1 + 8 * index)) / 2; // slower than the iterating version, right?",
"// alleles[1] = new Double(Mat... | returns in alleles[] the genotype specified in index in the sequence:
0/0, 0/1, 1/1, 0/2, 1/2, 2/2, 0/3...
@param index in this sequence, starting in 0
@param alleles returned genotype. | [
"returns",
"in",
"alleles",
"[]",
"the",
"genotype",
"specified",
"in",
"index",
"in",
"the",
"sequence",
":",
"0",
"/",
"0",
"0",
"/",
"1",
"1",
"/",
"1",
"0",
"/",
"2",
"1",
"/",
"2",
"2",
"/",
"2",
"0",
"/",
"3",
"..."
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/stats/VariantAggregatedStatsCalculator.java#L389-L407 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java | TimestampUtils.guessTimestamp | private long guessTimestamp(long millis, TimeZone tz) {
"""
<p>Given a UTC timestamp {@code millis} finds another point in time that is rendered in given time
zone {@code tz} exactly as "millis in UTC".</p>
<p>For instance, given 7 Jan 16:00 UTC and tz=GMT+02:00 it returns 7 Jan 14:00 UTC == 7 Jan 16:00
GMT+0... | java | private long guessTimestamp(long millis, TimeZone tz) {
if (tz == null) {
// If client did not provide us with time zone, we use system default time zone
tz = getDefaultTz();
}
// The story here:
// Backend provided us with something like '2015-10-04 13:40' and it did NOT provide us with a
... | [
"private",
"long",
"guessTimestamp",
"(",
"long",
"millis",
",",
"TimeZone",
"tz",
")",
"{",
"if",
"(",
"tz",
"==",
"null",
")",
"{",
"// If client did not provide us with time zone, we use system default time zone",
"tz",
"=",
"getDefaultTz",
"(",
")",
";",
"}",
... | <p>Given a UTC timestamp {@code millis} finds another point in time that is rendered in given time
zone {@code tz} exactly as "millis in UTC".</p>
<p>For instance, given 7 Jan 16:00 UTC and tz=GMT+02:00 it returns 7 Jan 14:00 UTC == 7 Jan 16:00
GMT+02:00 Note that is not trivial for timestamps near DST change. For suc... | [
"<p",
">",
"Given",
"a",
"UTC",
"timestamp",
"{",
"@code",
"millis",
"}",
"finds",
"another",
"point",
"in",
"time",
"that",
"is",
"rendered",
"in",
"given",
"time",
"zone",
"{",
"@code",
"tz",
"}",
"exactly",
"as",
"millis",
"in",
"UTC",
".",
"<",
"... | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L1158-L1212 |
dimaki/refuel | src/main/java/de/dimaki/refuel/updater/boundary/Updater.java | Updater.getApplicationStatus | public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl, Proxy proxy, int connectTimeout, int readTimeout) {
"""
Get the update status of the application specified.
@param localVersion The local version string, e.g. "2.0.1344"
@param updateUrl The update URL (Appcast URL)
@param... | java | public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl, Proxy proxy, int connectTimeout, int readTimeout) {
return getApplicationStatus(localVersion, updateUrl, proxy, connectTimeout, readTimeout, null);
} | [
"public",
"ApplicationStatus",
"getApplicationStatus",
"(",
"String",
"localVersion",
",",
"final",
"URL",
"updateUrl",
",",
"Proxy",
"proxy",
",",
"int",
"connectTimeout",
",",
"int",
"readTimeout",
")",
"{",
"return",
"getApplicationStatus",
"(",
"localVersion",
"... | Get the update status of the application specified.
@param localVersion The local version string, e.g. "2.0.1344"
@param updateUrl The update URL (Appcast URL)
@param proxy Proxy data
@param connectTimeout The connect timeout in milliseconds
@param readTimeout The read timeout in milliseconds
@return The application s... | [
"Get",
"the",
"update",
"status",
"of",
"the",
"application",
"specified",
"."
] | train | https://github.com/dimaki/refuel/blob/8024ac34f52b33de291d859c3b12fc237783f873/src/main/java/de/dimaki/refuel/updater/boundary/Updater.java#L82-L84 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.generatePrivateKey | public static PrivateKey generatePrivateKey(String algorithm, byte[] key) {
"""
生成私钥,仅用于非对称加密<br>
采用PKCS#8规范,此规范定义了私钥信息语法和加密私钥语法<br>
算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyFactory
@param algorithm 算法
@param key 密钥,必须为DER编码存储
@return 私钥 {@link PrivateKey}
... | java | public static PrivateKey generatePrivateKey(String algorithm, byte[] key) {
if (null == key) {
return null;
}
return generatePrivateKey(algorithm, new PKCS8EncodedKeySpec(key));
} | [
"public",
"static",
"PrivateKey",
"generatePrivateKey",
"(",
"String",
"algorithm",
",",
"byte",
"[",
"]",
"key",
")",
"{",
"if",
"(",
"null",
"==",
"key",
")",
"{",
"return",
"null",
";",
"}",
"return",
"generatePrivateKey",
"(",
"algorithm",
",",
"new",
... | 生成私钥,仅用于非对称加密<br>
采用PKCS#8规范,此规范定义了私钥信息语法和加密私钥语法<br>
算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyFactory
@param algorithm 算法
@param key 密钥,必须为DER编码存储
@return 私钥 {@link PrivateKey} | [
"生成私钥,仅用于非对称加密<br",
">",
"采用PKCS#8规范,此规范定义了私钥信息语法和加密私钥语法<br",
">",
"算法见:https",
":",
"//",
"docs",
".",
"oracle",
".",
"com",
"/",
"javase",
"/",
"7",
"/",
"docs",
"/",
"technotes",
"/",
"guides",
"/",
"security",
"/",
"StandardNames",
".",
"html#KeyFactory"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L219-L224 |
spring-projects/spring-social | spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java | ConnectController.connectionStatusRedirect | protected RedirectView connectionStatusRedirect(String providerId, NativeWebRequest request) {
"""
Returns a RedirectView with the URL to redirect to after a connection is created or deleted.
Defaults to "/connect/{providerId}" relative to DispatcherServlet's path.
May be overridden to handle custom redirection ... | java | protected RedirectView connectionStatusRedirect(String providerId, NativeWebRequest request) {
HttpServletRequest servletRequest = request.getNativeRequest(HttpServletRequest.class);
String path = connectionStatusUrlPath + providerId + getPathExtension(servletRequest);
if (prependServletPath(servletRequest)) {
... | [
"protected",
"RedirectView",
"connectionStatusRedirect",
"(",
"String",
"providerId",
",",
"NativeWebRequest",
"request",
")",
"{",
"HttpServletRequest",
"servletRequest",
"=",
"request",
".",
"getNativeRequest",
"(",
"HttpServletRequest",
".",
"class",
")",
";",
"Strin... | Returns a RedirectView with the URL to redirect to after a connection is created or deleted.
Defaults to "/connect/{providerId}" relative to DispatcherServlet's path.
May be overridden to handle custom redirection needs.
@param providerId the ID of the provider for which a connection was created or deleted.
@param requ... | [
"Returns",
"a",
"RedirectView",
"with",
"the",
"URL",
"to",
"redirect",
"to",
"after",
"a",
"connection",
"is",
"created",
"or",
"deleted",
".",
"Defaults",
"to",
"/",
"connect",
"/",
"{",
"providerId",
"}",
"relative",
"to",
"DispatcherServlet",
"s",
"path"... | train | https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java#L400-L407 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java | PageFlowManagedObject.initializeField | protected void initializeField( Field field, Object instance ) {
"""
Initialize the given field with an instance. Mainly useful for the error handling.
"""
if ( instance != null )
{
if ( _log.isTraceEnabled() )
{
_log.trace( "Initializing field " + field... | java | protected void initializeField( Field field, Object instance )
{
if ( instance != null )
{
if ( _log.isTraceEnabled() )
{
_log.trace( "Initializing field " + field.getName() + " in " + getDisplayName() + " with " + instance );
}
... | [
"protected",
"void",
"initializeField",
"(",
"Field",
"field",
",",
"Object",
"instance",
")",
"{",
"if",
"(",
"instance",
"!=",
"null",
")",
"{",
"if",
"(",
"_log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"_log",
".",
"trace",
"(",
"\"Initializing fi... | Initialize the given field with an instance. Mainly useful for the error handling. | [
"Initialize",
"the",
"given",
"field",
"with",
"an",
"instance",
".",
"Mainly",
"useful",
"for",
"the",
"error",
"handling",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java#L214-L238 |
nicoulaj/commons-dbcp-jmx | jdbc4/src/main/java/org/apache/commons/dbcp/ManagedBasicDataSourceFactory.java | ManagedBasicDataSourceFactory.getObjectInstance | @Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception {
"""
Create and return a new {@link org.apache.commons.dbcp.ManagedBasicDataSource} instance. If no instance can be created, return <code>null</code>
instead.
@param obj The p... | java | @Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception {
// We only know how to deal with <code>javax.naming.Reference</code>s
// that specify a class name of "javax.sql.DataSource"
if ((obj == null) || !(obj instanceof Refe... | [
"@",
"Override",
"public",
"Object",
"getObjectInstance",
"(",
"Object",
"obj",
",",
"Name",
"name",
",",
"Context",
"nameCtx",
",",
"Hashtable",
"environment",
")",
"throws",
"Exception",
"{",
"// We only know how to deal with <code>javax.naming.Reference</code>s",
"// t... | Create and return a new {@link org.apache.commons.dbcp.ManagedBasicDataSource} instance. If no instance can be created, return <code>null</code>
instead.
@param obj The possibly null object containing location or reference information that can be used in creating an object.
@param name The name of this... | [
"Create",
"and",
"return",
"a",
"new",
"{",
"@link",
"org",
".",
"apache",
".",
"commons",
".",
"dbcp",
".",
"ManagedBasicDataSource",
"}",
"instance",
".",
"If",
"no",
"instance",
"can",
"be",
"created",
"return",
"<code",
">",
"null<",
"/",
"code",
">"... | train | https://github.com/nicoulaj/commons-dbcp-jmx/blob/be8716526698da2f6dac817c95343b539ac5e3d9/jdbc4/src/main/java/org/apache/commons/dbcp/ManagedBasicDataSourceFactory.java#L240-L264 |
languagetool-org/languagetool | languagetool-gui-commons/src/main/java/org/languagetool/gui/Tools.java | Tools.showErrorMessage | static void showErrorMessage(Exception e, Component parent) {
"""
Show the exception (message without stacktrace) in a dialog and print the
stacktrace to STDERR.
"""
String msg = e.getMessage();
JOptionPane.showMessageDialog(parent, msg, "Error", JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
... | java | static void showErrorMessage(Exception e, Component parent) {
String msg = e.getMessage();
JOptionPane.showMessageDialog(parent, msg, "Error", JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
} | [
"static",
"void",
"showErrorMessage",
"(",
"Exception",
"e",
",",
"Component",
"parent",
")",
"{",
"String",
"msg",
"=",
"e",
".",
"getMessage",
"(",
")",
";",
"JOptionPane",
".",
"showMessageDialog",
"(",
"parent",
",",
"msg",
",",
"\"Error\"",
",",
"JOpt... | Show the exception (message without stacktrace) in a dialog and print the
stacktrace to STDERR. | [
"Show",
"the",
"exception",
"(",
"message",
"without",
"stacktrace",
")",
"in",
"a",
"dialog",
"and",
"print",
"the",
"stacktrace",
"to",
"STDERR",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-gui-commons/src/main/java/org/languagetool/gui/Tools.java#L107-L111 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/BandwidthSchedulesInner.java | BandwidthSchedulesInner.createOrUpdate | public BandwidthScheduleInner createOrUpdate(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) {
"""
Creates or updates a bandwidth schedule.
@param deviceName The device name.
@param name The bandwidth schedule name which needs to be added/updated.
@param resourceGr... | java | public BandwidthScheduleInner createOrUpdate(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) {
return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).toBlocking().last().body();
} | [
"public",
"BandwidthScheduleInner",
"createOrUpdate",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
",",
"BandwidthScheduleInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"deviceName",
",",
... | Creates or updates a bandwidth schedule.
@param deviceName The device name.
@param name The bandwidth schedule name which needs to be added/updated.
@param resourceGroupName The resource group name.
@param parameters The bandwidth schedule to be added or updated.
@throws IllegalArgumentException thrown if parameters f... | [
"Creates",
"or",
"updates",
"a",
"bandwidth",
"schedule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/BandwidthSchedulesInner.java#L322-L324 |
frostwire/frostwire-jlibtorrent | src/main/java/com/frostwire/jlibtorrent/TorrentHandle.java | TorrentHandle.addPiece | public void addPiece(int piece, byte[] data, add_piece_flags_t flags) {
"""
This function will write {@code data} to the storage as piece {@code piece},
as if it had been downloaded from a peer. {@code data} is expected to
point to a buffer of as many bytes as the size of the specified piece.
The data in the bu... | java | public void addPiece(int piece, byte[] data, add_piece_flags_t flags) {
th.add_piece_bytes(piece, Vectors.bytes2byte_vector(data), flags);
} | [
"public",
"void",
"addPiece",
"(",
"int",
"piece",
",",
"byte",
"[",
"]",
"data",
",",
"add_piece_flags_t",
"flags",
")",
"{",
"th",
".",
"add_piece_bytes",
"(",
"piece",
",",
"Vectors",
".",
"bytes2byte_vector",
"(",
"data",
")",
",",
"flags",
")",
";",... | This function will write {@code data} to the storage as piece {@code piece},
as if it had been downloaded from a peer. {@code data} is expected to
point to a buffer of as many bytes as the size of the specified piece.
The data in the buffer is copied and passed on to the disk IO thread
to be written at a later point.
<... | [
"This",
"function",
"will",
"write",
"{",
"@code",
"data",
"}",
"to",
"the",
"storage",
"as",
"piece",
"{",
"@code",
"piece",
"}",
"as",
"if",
"it",
"had",
"been",
"downloaded",
"from",
"a",
"peer",
".",
"{",
"@code",
"data",
"}",
"is",
"expected",
"... | train | https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/TorrentHandle.java#L89-L91 |
podio/podio-java | src/main/java/com/podio/user/UserAPI.java | UserAPI.updateProfileField | public <F> void updateProfileField(ProfileField<F, ?> field, List<F> values) {
"""
Updates a single field on the profile of the user
@param field
The field that should be updated
@param values
The new values of the field
"""
if (field.isSingle()) {
throw new IllegalArgumentException(
"Field is ... | java | public <F> void updateProfileField(ProfileField<F, ?> field, List<F> values) {
if (field.isSingle()) {
throw new IllegalArgumentException(
"Field is only valid for single value");
} else {
getResourceFactory()
.getApiResource("/user/profile/" + field.getName())
.entity(new ProfileFieldMultiValu... | [
"public",
"<",
"F",
">",
"void",
"updateProfileField",
"(",
"ProfileField",
"<",
"F",
",",
"?",
">",
"field",
",",
"List",
"<",
"F",
">",
"values",
")",
"{",
"if",
"(",
"field",
".",
"isSingle",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentExc... | Updates a single field on the profile of the user
@param field
The field that should be updated
@param values
The new values of the field | [
"Updates",
"a",
"single",
"field",
"on",
"the",
"profile",
"of",
"the",
"user"
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/user/UserAPI.java#L132-L142 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java | Planar.reshape | @Override
public void reshape(int width, int height) {
"""
Changes the image's width and height without declaring new memory. If the internal array
is not large enough to store the new image an IllegalArgumentException is thrown.
@param width The new width.
@param height The new height.
"""
if( this.w... | java | @Override
public void reshape(int width, int height) {
if( this.width == width && this.height == height )
return;
if( isSubimage() )
throw new IllegalArgumentException("Can't reshape subimage");
for( int i = 0; i < bands.length; i++ ) {
bands[i].reshape(width,height);
}
this.startIndex = 0;
thi... | [
"@",
"Override",
"public",
"void",
"reshape",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"if",
"(",
"this",
".",
"width",
"==",
"width",
"&&",
"this",
".",
"height",
"==",
"height",
")",
"return",
";",
"if",
"(",
"isSubimage",
"(",
")",
"... | Changes the image's width and height without declaring new memory. If the internal array
is not large enough to store the new image an IllegalArgumentException is thrown.
@param width The new width.
@param height The new height. | [
"Changes",
"the",
"image",
"s",
"width",
"and",
"height",
"without",
"declaring",
"new",
"memory",
".",
"If",
"the",
"internal",
"array",
"is",
"not",
"large",
"enough",
"to",
"store",
"the",
"new",
"image",
"an",
"IllegalArgumentException",
"is",
"thrown",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java#L205-L221 |
FasterXML/jackson-modules-java8 | datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/ser/InstantSerializerBase.java | InstantSerializerBase._acceptTimestampVisitor | @Override
protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
throws JsonMappingException {
"""
Overridden to ensure that our timestamp handling is as expected
"""
SerializerProvider prov = visitor.getProvider();
if ((prov != null) && useNanos... | java | @Override
protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
throws JsonMappingException
{
SerializerProvider prov = visitor.getProvider();
if ((prov != null) && useNanoseconds(prov)) {
JsonNumberFormatVisitor v2 = visitor.expectNumber... | [
"@",
"Override",
"protected",
"void",
"_acceptTimestampVisitor",
"(",
"JsonFormatVisitorWrapper",
"visitor",
",",
"JavaType",
"typeHint",
")",
"throws",
"JsonMappingException",
"{",
"SerializerProvider",
"prov",
"=",
"visitor",
".",
"getProvider",
"(",
")",
";",
"if",... | Overridden to ensure that our timestamp handling is as expected | [
"Overridden",
"to",
"ensure",
"that",
"our",
"timestamp",
"handling",
"is",
"as",
"expected"
] | train | https://github.com/FasterXML/jackson-modules-java8/blob/bd093eafbd4d5216e13093b0a031e06dcbb8839b/datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/ser/InstantSerializerBase.java#L107-L123 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java | DamVideoMediaMarkupBuilder.getFlashPlayerElement | protected HtmlElement getFlashPlayerElement(Media media, Dimension dimension) {
"""
Build flash player element
@param media Media metadata
@param dimension Dimension
@return Media element
"""
Asset asset = getDamAsset(media);
if (asset == null) {
return null;
}
com.day.cq.dam.api.Rend... | java | protected HtmlElement getFlashPlayerElement(Media media, Dimension dimension) {
Asset asset = getDamAsset(media);
if (asset == null) {
return null;
}
com.day.cq.dam.api.Rendition rendition = asset.getRendition(new PrefixRenditionPicker(VideoConstants.RENDITION_PREFIX + H264_PROFILE));
if (ren... | [
"protected",
"HtmlElement",
"getFlashPlayerElement",
"(",
"Media",
"media",
",",
"Dimension",
"dimension",
")",
"{",
"Asset",
"asset",
"=",
"getDamAsset",
"(",
"media",
")",
";",
"if",
"(",
"asset",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"com"... | Build flash player element
@param media Media metadata
@param dimension Dimension
@return Media element | [
"Build",
"flash",
"player",
"element"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java#L181-L226 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/fit/MapColumnFixture.java | MapColumnFixture.getParameter | private String getParameter(String paramKey, String defaultValue) {
"""
Gets fixture parameter value by parameter key match.
Parameter should be defined in format <parameterKey>=<parameterValue>.
@param paramKey parameter key
@param defaultValue default parameter value
@return the fixture parameter value
"... | java | private String getParameter(String paramKey, String defaultValue) {
String paramValue = defaultValue;
if (StringUtils.isNotBlank(paramKey) && args != null && args.length > 0) {
for (String arg : args) {
String[] parameter = arg.split("=");
if (parameter != nul... | [
"private",
"String",
"getParameter",
"(",
"String",
"paramKey",
",",
"String",
"defaultValue",
")",
"{",
"String",
"paramValue",
"=",
"defaultValue",
";",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"paramKey",
")",
"&&",
"args",
"!=",
"null",
"&&",
"a... | Gets fixture parameter value by parameter key match.
Parameter should be defined in format <parameterKey>=<parameterValue>.
@param paramKey parameter key
@param defaultValue default parameter value
@return the fixture parameter value | [
"Gets",
"fixture",
"parameter",
"value",
"by",
"parameter",
"key",
"match",
".",
"Parameter",
"should",
"be",
"defined",
"in",
"format",
"<parameterKey",
">",
"=",
"<parameterValue",
">",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/fit/MapColumnFixture.java#L457-L469 |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ExpiringResourceClaim.java | ExpiringResourceClaim.claimExpiring | public static ResourceClaim claimExpiring(ZooKeeperConnection zooKeeperConnection,
int poolSize,
String znode,
Long timeout)
throws IOException {
"""
Claim a resourc... | java | public static ResourceClaim claimExpiring(ZooKeeperConnection zooKeeperConnection,
int poolSize,
String znode,
Long timeout)
throws IOException {
long timeoutNon... | [
"public",
"static",
"ResourceClaim",
"claimExpiring",
"(",
"ZooKeeperConnection",
"zooKeeperConnection",
",",
"int",
"poolSize",
",",
"String",
"znode",
",",
"Long",
"timeout",
")",
"throws",
"IOException",
"{",
"long",
"timeoutNonNull",
"=",
"timeout",
"==",
"null"... | Claim a resource.
@param zooKeeperConnection ZooKeeper connection to use.
@param poolSize Size of the resource pool.
@param znode Root znode of the ZooKeeper resource-pool.
@param timeout Delay in milliseconds before the claim expires.
@return A resource claim. | [
"Claim",
"a",
"resource",
"."
] | train | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ExpiringResourceClaim.java#L68-L78 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java | AmazonSQSMessagingClientWrapper.queueExists | public boolean queueExists(String queueName, String queueOwnerAccountId) throws JMSException {
"""
Check if the requested queue exists. This function calls
<code>GetQueueUrl</code> for the given queue name with the given owner
accountId, returning true on success, false if it gets
<code>QueueDoesNotExistExcepti... | java | public boolean queueExists(String queueName, String queueOwnerAccountId) throws JMSException {
try {
GetQueueUrlRequest getQueueUrlRequest = new GetQueueUrlRequest(queueName);
getQueueUrlRequest.setQueueOwnerAWSAccountId(queueOwnerAccountId);
prepareRequest(getQueueUrlRequest... | [
"public",
"boolean",
"queueExists",
"(",
"String",
"queueName",
",",
"String",
"queueOwnerAccountId",
")",
"throws",
"JMSException",
"{",
"try",
"{",
"GetQueueUrlRequest",
"getQueueUrlRequest",
"=",
"new",
"GetQueueUrlRequest",
"(",
"queueName",
")",
";",
"getQueueUrl... | Check if the requested queue exists. This function calls
<code>GetQueueUrl</code> for the given queue name with the given owner
accountId, returning true on success, false if it gets
<code>QueueDoesNotExistException</code>.
@param queueName
the queue to check
@param queueOwnerAccountId
The AWS accountId of the account... | [
"Check",
"if",
"the",
"requested",
"queue",
"exists",
".",
"This",
"function",
"calls",
"<code",
">",
"GetQueueUrl<",
"/",
"code",
">",
"for",
"the",
"given",
"queue",
"name",
"with",
"the",
"given",
"owner",
"accountId",
"returning",
"true",
"on",
"success"... | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java#L242-L254 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.readLines | public static List<String> readLines(InputStream stream, String charset) throws IOException {
"""
Reads the stream into a list, with one element for each line.
@param stream a stream
@param charset opens the stream with a specified charset
@return a List of lines
@throws IOException if an IOException occurs... | java | public static List<String> readLines(InputStream stream, String charset) throws IOException {
return readLines(newReader(stream, charset));
} | [
"public",
"static",
"List",
"<",
"String",
">",
"readLines",
"(",
"InputStream",
"stream",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"return",
"readLines",
"(",
"newReader",
"(",
"stream",
",",
"charset",
")",
")",
";",
"}"
] | Reads the stream into a list, with one element for each line.
@param stream a stream
@param charset opens the stream with a specified charset
@return a List of lines
@throws IOException if an IOException occurs.
@see #readLines(java.io.Reader)
@since 1.6.8 | [
"Reads",
"the",
"stream",
"into",
"a",
"list",
"with",
"one",
"element",
"for",
"each",
"line",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L783-L785 |
lucee/Lucee | core/src/main/java/lucee/runtime/schedule/SchedulerImpl.java | SchedulerImpl.setAttributes | private void setAttributes(Element el, ScheduleTask task) {
"""
sets all attributes in XML Element from Schedule Task
@param el
@param task
"""
if (el == null) return;
NamedNodeMap atts = el.getAttributes();
for (int i = atts.getLength() - 1; i >= 0; i--) {
Attr att = (Attr) atts.item(i);
el.... | java | private void setAttributes(Element el, ScheduleTask task) {
if (el == null) return;
NamedNodeMap atts = el.getAttributes();
for (int i = atts.getLength() - 1; i >= 0; i--) {
Attr att = (Attr) atts.item(i);
el.removeAttribute(att.getName());
}
su.setString(el, "name", task.getTask());
su.setFile(el, "f... | [
"private",
"void",
"setAttributes",
"(",
"Element",
"el",
",",
"ScheduleTask",
"task",
")",
"{",
"if",
"(",
"el",
"==",
"null",
")",
"return",
";",
"NamedNodeMap",
"atts",
"=",
"el",
".",
"getAttributes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"... | sets all attributes in XML Element from Schedule Task
@param el
@param task | [
"sets",
"all",
"attributes",
"in",
"XML",
"Element",
"from",
"Schedule",
"Task"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/SchedulerImpl.java#L229-L259 |
lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java | VariableImpl.isNamed | private static boolean isNamed(String funcName, Argument[] args) throws TransformerException {
"""
check if the arguments are named arguments or regular arguments, throws a exception when mixed
@param funcName
@param args
@param line
@return
@throws TransformerException
"""
if (ArrayUtil.isEmpty(args))... | java | private static boolean isNamed(String funcName, Argument[] args) throws TransformerException {
if (ArrayUtil.isEmpty(args)) return false;
boolean named = false;
for (int i = 0; i < args.length; i++) {
if (args[i] instanceof NamedArgument) named = true;
else if (named) throw new TransformerException("invali... | [
"private",
"static",
"boolean",
"isNamed",
"(",
"String",
"funcName",
",",
"Argument",
"[",
"]",
"args",
")",
"throws",
"TransformerException",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"args",
")",
")",
"return",
"false",
";",
"boolean",
"named",
... | check if the arguments are named arguments or regular arguments, throws a exception when mixed
@param funcName
@param args
@param line
@return
@throws TransformerException | [
"check",
"if",
"the",
"arguments",
"are",
"named",
"arguments",
"or",
"regular",
"arguments",
"throws",
"a",
"exception",
"when",
"mixed"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java#L793-L802 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Currency.java | Currency.isAvailable | public static boolean isAvailable(String code, Date from, Date to) {
"""
Queries if the given ISO 4217 3-letter code is available on the specified date range.
<p>
Note: For checking availability of a currency on a specific date, specify the date on both <code>from</code> and
<code>to</code>. When both <code>fro... | java | public static boolean isAvailable(String code, Date from, Date to) {
if (!isAlpha3Code(code)) {
return false;
}
if (from != null && to != null && from.after(to)) {
throw new IllegalArgumentException("To is before from");
}
code = code.toUpperCase(Locale.... | [
"public",
"static",
"boolean",
"isAvailable",
"(",
"String",
"code",
",",
"Date",
"from",
",",
"Date",
"to",
")",
"{",
"if",
"(",
"!",
"isAlpha3Code",
"(",
"code",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"from",
"!=",
"null",
"&&",
"... | Queries if the given ISO 4217 3-letter code is available on the specified date range.
<p>
Note: For checking availability of a currency on a specific date, specify the date on both <code>from</code> and
<code>to</code>. When both <code>from</code> and <code>to</code> are null, this method checks if the specified
curren... | [
"Queries",
"if",
"the",
"given",
"ISO",
"4217",
"3",
"-",
"letter",
"code",
"is",
"available",
"on",
"the",
"specified",
"date",
"range",
".",
"<p",
">",
"Note",
":",
"For",
"checking",
"availability",
"of",
"a",
"currency",
"on",
"a",
"specific",
"date"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Currency.java#L899-L921 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/scm/svn/SubversionManager.java | SubversionManager.commitWorkingCopy | public void commitWorkingCopy(final String commitMessage) throws IOException, InterruptedException {
"""
Commits the working copy.
@param commitMessage@return The commit info upon successful operation.
@throws IOException On IO of SVN failure
"""
build.getWorkspace().act(new SVNCommitWorkingCopyCal... | java | public void commitWorkingCopy(final String commitMessage) throws IOException, InterruptedException {
build.getWorkspace().act(new SVNCommitWorkingCopyCallable(commitMessage, getLocation(),
getSvnAuthenticationProvider(build), buildListener));
} | [
"public",
"void",
"commitWorkingCopy",
"(",
"final",
"String",
"commitMessage",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"build",
".",
"getWorkspace",
"(",
")",
".",
"act",
"(",
"new",
"SVNCommitWorkingCopyCallable",
"(",
"commitMessage",
",",... | Commits the working copy.
@param commitMessage@return The commit info upon successful operation.
@throws IOException On IO of SVN failure | [
"Commits",
"the",
"working",
"copy",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/scm/svn/SubversionManager.java#L58-L61 |
joniles/mpxj | src/main/java/net/sf/mpxj/json/JsonWriter.java | JsonWriter.writeAttributeTypes | private void writeAttributeTypes(String name, FieldType[] types) throws IOException {
"""
Generates a mapping between attribute names and data types.
@param name name of the map
@param types types to write
"""
m_writer.writeStartObject(name);
for (FieldType field : types)
{
m_wri... | java | private void writeAttributeTypes(String name, FieldType[] types) throws IOException
{
m_writer.writeStartObject(name);
for (FieldType field : types)
{
m_writer.writeNameValuePair(field.name().toLowerCase(), field.getDataType().getValue());
}
m_writer.writeEndObject();
} | [
"private",
"void",
"writeAttributeTypes",
"(",
"String",
"name",
",",
"FieldType",
"[",
"]",
"types",
")",
"throws",
"IOException",
"{",
"m_writer",
".",
"writeStartObject",
"(",
"name",
")",
";",
"for",
"(",
"FieldType",
"field",
":",
"types",
")",
"{",
"... | Generates a mapping between attribute names and data types.
@param name name of the map
@param types types to write | [
"Generates",
"a",
"mapping",
"between",
"attribute",
"names",
"and",
"data",
"types",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonWriter.java#L239-L247 |
carewebframework/carewebframework-vista | org.carewebframework.vista.plugin-parent/org.carewebframework.vista.plugin.documents/src/main/java/org/carewebframework/vista/plugin/documents/DocumentDisplayComboRenderer.java | DocumentDisplayComboRenderer.renderItem | @Override
public void renderItem(final Comboitem item, final Document doc) {
"""
Render the combo item for the specified document.
@param item Combo item to render.
@param doc The document associated with the list item.
"""
item.setLabel(doc.getTitle());
} | java | @Override
public void renderItem(final Comboitem item, final Document doc) {
item.setLabel(doc.getTitle());
} | [
"@",
"Override",
"public",
"void",
"renderItem",
"(",
"final",
"Comboitem",
"item",
",",
"final",
"Document",
"doc",
")",
"{",
"item",
".",
"setLabel",
"(",
"doc",
".",
"getTitle",
"(",
")",
")",
";",
"}"
] | Render the combo item for the specified document.
@param item Combo item to render.
@param doc The document associated with the list item. | [
"Render",
"the",
"combo",
"item",
"for",
"the",
"specified",
"document",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.plugin-parent/org.carewebframework.vista.plugin.documents/src/main/java/org/carewebframework/vista/plugin/documents/DocumentDisplayComboRenderer.java#L44-L47 |
actorapp/actor-platform | actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java | MarkdownParser.findCodeBlockEnd | private int findCodeBlockEnd(TextCursor cursor, int blockStart) {
"""
Searching for valid code block end
@param cursor text cursor
@param blockStart start of expected code block
@return code block end, -1 if not found
"""
int offset = blockStart + 3;
int index;
while ((index = ... | java | private int findCodeBlockEnd(TextCursor cursor, int blockStart) {
int offset = blockStart + 3;
int index;
while ((index = cursor.text.indexOf(CODE_BLOCK, offset)) >= 0) {
if (isGoodAnchor(cursor.text, index + 3)) {
return index + 3;
}
offset = ... | [
"private",
"int",
"findCodeBlockEnd",
"(",
"TextCursor",
"cursor",
",",
"int",
"blockStart",
")",
"{",
"int",
"offset",
"=",
"blockStart",
"+",
"3",
";",
"int",
"index",
";",
"while",
"(",
"(",
"index",
"=",
"cursor",
".",
"text",
".",
"indexOf",
"(",
... | Searching for valid code block end
@param cursor text cursor
@param blockStart start of expected code block
@return code block end, -1 if not found | [
"Searching",
"for",
"valid",
"code",
"block",
"end"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java#L252-L262 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ResourceLoader.java | ResourceLoader.getConfigInputStreamReader | public static InputStreamReader getConfigInputStreamReader(final String resource, final String encoding) throws IOException {
"""
Loads a resource as {@link InputStreamReader} relative to {@link #getConfigDir()}.
@param resource
The resource to be loaded.
@param encoding
The encoding to use
@return The read... | java | public static InputStreamReader getConfigInputStreamReader(final String resource, final String encoding) throws IOException {
return new InputStreamReader(getConfigInputStream(resource), encoding);
} | [
"public",
"static",
"InputStreamReader",
"getConfigInputStreamReader",
"(",
"final",
"String",
"resource",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"return",
"new",
"InputStreamReader",
"(",
"getConfigInputStream",
"(",
"resource",
")",
"... | Loads a resource as {@link InputStreamReader} relative to {@link #getConfigDir()}.
@param resource
The resource to be loaded.
@param encoding
The encoding to use
@return The reader | [
"Loads",
"a",
"resource",
"as",
"{",
"@link",
"InputStreamReader",
"}",
"relative",
"to",
"{",
"@link",
"#getConfigDir",
"()",
"}",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ResourceLoader.java#L176-L178 |
cdk/cdk | display/render/src/main/java/org/openscience/cdk/renderer/color/CPKAtomColors.java | CPKAtomColors.getAtomColor | @Override
public Color getAtomColor(IAtom atom, Color defaultColor) {
"""
Returns the font color for atom given atom.
@param atom the atom.
@param defaultColor atom default color.
@return A color for the atom. The default colour is used if none is
found for the atom.
"""
Color col... | java | @Override
public Color getAtomColor(IAtom atom, Color defaultColor) {
Color color = defaultColor;
String symbol = atom.getSymbol().toUpperCase();
if (atom.getAtomicNumber() != null && ATOM_COLORS_MASSNUM.containsKey(atom.getAtomicNumber())) {
color = ATOM_COLORS_MASSNUM.get(atom.... | [
"@",
"Override",
"public",
"Color",
"getAtomColor",
"(",
"IAtom",
"atom",
",",
"Color",
"defaultColor",
")",
"{",
"Color",
"color",
"=",
"defaultColor",
";",
"String",
"symbol",
"=",
"atom",
".",
"getSymbol",
"(",
")",
".",
"toUpperCase",
"(",
")",
";",
... | Returns the font color for atom given atom.
@param atom the atom.
@param defaultColor atom default color.
@return A color for the atom. The default colour is used if none is
found for the atom. | [
"Returns",
"the",
"font",
"color",
"for",
"atom",
"given",
"atom",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/render/src/main/java/org/openscience/cdk/renderer/color/CPKAtomColors.java#L152-L163 |
twilio/twilio-java | src/main/java/com/twilio/rest/proxy/v1/service/session/participant/MessageInteractionReader.java | MessageInteractionReader.firstPage | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<MessageInteraction> firstPage(final TwilioRestClient client) {
"""
Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return MessageInteraction ResourceSet
"""
... | java | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<MessageInteraction> firstPage(final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
Domains.PROXY.toString(),
"/v1/Services/" + this.pathServiceSid + "/Sessions/" + this.pathSes... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:linelength\"",
")",
"public",
"Page",
"<",
"MessageInteraction",
">",
"firstPage",
"(",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".... | Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return MessageInteraction ResourceSet | [
"Make",
"the",
"request",
"to",
"the",
"Twilio",
"API",
"to",
"perform",
"the",
"read",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/proxy/v1/service/session/participant/MessageInteractionReader.java#L63-L75 |
duracloud/duracloud | s3storageprovider/src/main/java/org/duracloud/s3storage/S3StorageProvider.java | S3StorageProvider.createHiddenSpace | public String createHiddenSpace(String spaceId, int expirationInDays) {
"""
Creates a "hidden" space. This space will not be returned by the StorageProvider.getSpaces() method.
It can be accessed using the getSpace* methods. You must know the name of the space in order to
access it.
@param spaceId The spaceId... | java | public String createHiddenSpace(String spaceId, int expirationInDays) {
String bucketName = getHiddenBucketName(spaceId);
try {
Bucket bucket = s3Client.createBucket(bucketName);
// Apply lifecycle config to bucket
BucketLifecycleConfiguration.Rule expiresRule = new... | [
"public",
"String",
"createHiddenSpace",
"(",
"String",
"spaceId",
",",
"int",
"expirationInDays",
")",
"{",
"String",
"bucketName",
"=",
"getHiddenBucketName",
"(",
"spaceId",
")",
";",
"try",
"{",
"Bucket",
"bucket",
"=",
"s3Client",
".",
"createBucket",
"(",
... | Creates a "hidden" space. This space will not be returned by the StorageProvider.getSpaces() method.
It can be accessed using the getSpace* methods. You must know the name of the space in order to
access it.
@param spaceId The spaceId
@param expirationInDays The number of days before content in the space is automatic... | [
"Creates",
"a",
"hidden",
"space",
".",
"This",
"space",
"will",
"not",
"be",
"returned",
"by",
"the",
"StorageProvider",
".",
"getSpaces",
"()",
"method",
".",
"It",
"can",
"be",
"accessed",
"using",
"the",
"getSpace",
"*",
"methods",
".",
"You",
"must",
... | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/s3storageprovider/src/main/java/org/duracloud/s3storage/S3StorageProvider.java#L282-L306 |
Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java | AlluxioFuseUtils.getIdInfo | private static long getIdInfo(String option, String username) {
"""
Runs the "id" command with the given options on the passed username.
@param option option to pass to id (either -u or -g)
@param username the username on which to run the command
@return the uid (-u) or gid (-g) of username
"""
String... | java | private static long getIdInfo(String option, String username) {
String output;
try {
output = ShellUtils.execCommand("id", option, username).trim();
} catch (IOException e) {
LOG.error("Failed to get id from {} with option {}", username, option);
return -1;
}
return Long.parseLong(... | [
"private",
"static",
"long",
"getIdInfo",
"(",
"String",
"option",
",",
"String",
"username",
")",
"{",
"String",
"output",
";",
"try",
"{",
"output",
"=",
"ShellUtils",
".",
"execCommand",
"(",
"\"id\"",
",",
"option",
",",
"username",
")",
".",
"trim",
... | Runs the "id" command with the given options on the passed username.
@param option option to pass to id (either -u or -g)
@param username the username on which to run the command
@return the uid (-u) or gid (-g) of username | [
"Runs",
"the",
"id",
"command",
"with",
"the",
"given",
"options",
"on",
"the",
"passed",
"username",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java#L153-L162 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/PixelMath.java | PixelMath.negative | public static void negative( InterleavedS16 input , InterleavedS16 output ) {
"""
Changes the sign of every pixel in the image: output[x,y] = -input[x,y]
@param input The input image. Not modified.
@param output Where the negated image is written to. Modified.
"""
output.reshape(input.width,input.height... | java | public static void negative( InterleavedS16 input , InterleavedS16 output ) {
output.reshape(input.width,input.height);
int columns = input.width*input.numBands;
if(BoofConcurrency.USE_CONCURRENT ) {
ImplPixelMath_MT.negative(input.data, input.startIndex, input.stride,
output.data, output.startIndex, ou... | [
"public",
"static",
"void",
"negative",
"(",
"InterleavedS16",
"input",
",",
"InterleavedS16",
"output",
")",
"{",
"output",
".",
"reshape",
"(",
"input",
".",
"width",
",",
"input",
".",
"height",
")",
";",
"int",
"columns",
"=",
"input",
".",
"width",
... | Changes the sign of every pixel in the image: output[x,y] = -input[x,y]
@param input The input image. Not modified.
@param output Where the negated image is written to. Modified. | [
"Changes",
"the",
"sign",
"of",
"every",
"pixel",
"in",
"the",
"image",
":",
"output",
"[",
"x",
"y",
"]",
"=",
"-",
"input",
"[",
"x",
"y",
"]"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/PixelMath.java#L387-L401 |
netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java | Bzip2HuffmanAllocator.allocateHuffmanCodeLengths | static void allocateHuffmanCodeLengths(final int[] array, final int maximumLength) {
"""
Allocates Canonical Huffman code lengths in place based on a sorted frequency array.
@param array On input, a sorted array of symbol frequencies; On output, an array of Canonical
Huffman code lengths
@param maximumLength Th... | java | static void allocateHuffmanCodeLengths(final int[] array, final int maximumLength) {
switch (array.length) {
case 2:
array[1] = 1;
// fall through
case 1:
array[0] = 1;
return;
}
/* Pass 1 : Set extended par... | [
"static",
"void",
"allocateHuffmanCodeLengths",
"(",
"final",
"int",
"[",
"]",
"array",
",",
"final",
"int",
"maximumLength",
")",
"{",
"switch",
"(",
"array",
".",
"length",
")",
"{",
"case",
"2",
":",
"array",
"[",
"1",
"]",
"=",
"1",
";",
"// fall t... | Allocates Canonical Huffman code lengths in place based on a sorted frequency array.
@param array On input, a sorted array of symbol frequencies; On output, an array of Canonical
Huffman code lengths
@param maximumLength The maximum code length. Must be at least {@code ceil(log2(array.length))} | [
"Allocates",
"Canonical",
"Huffman",
"code",
"lengths",
"in",
"place",
"based",
"on",
"a",
"sorted",
"frequency",
"array",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java#L158-L181 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/vocab/OWLFacet_CustomFieldSerializer.java | OWLFacet_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLFacet instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rp... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLFacet instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLFacet",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/vocab/OWLFacet_CustomFieldSerializer.java#L69-L72 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java | SyncGroupsInner.getAsync | public Observable<SyncGroupInner> getAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName) {
"""
Gets a sync group.
@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 por... | java | public Observable<SyncGroupInner> getAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName).map(new Func1<ServiceResponse<SyncGroupInner>, SyncGroupInner>() {
@Over... | [
"public",
"Observable",
"<",
"SyncGroupInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Gets a sync group.
@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 databaseName The name of the database on which the sync group is hosted.
@param syncGroupN... | [
"Gets",
"a",
"sync",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java#L1144-L1151 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/LongStream.java | LongStream.peek | @NotNull
public LongStream peek(@NotNull final LongConsumer action) {
"""
Performs provided action on each element.
<p>This is an intermediate operation.
@param action the action to be performed on each element
@return the new stream
"""
return new LongStream(params, new LongPeek(iterator, a... | java | @NotNull
public LongStream peek(@NotNull final LongConsumer action) {
return new LongStream(params, new LongPeek(iterator, action));
} | [
"@",
"NotNull",
"public",
"LongStream",
"peek",
"(",
"@",
"NotNull",
"final",
"LongConsumer",
"action",
")",
"{",
"return",
"new",
"LongStream",
"(",
"params",
",",
"new",
"LongPeek",
"(",
"iterator",
",",
"action",
")",
")",
";",
"}"
] | Performs provided action on each element.
<p>This is an intermediate operation.
@param action the action to be performed on each element
@return the new stream | [
"Performs",
"provided",
"action",
"on",
"each",
"element",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/LongStream.java#L657-L660 |
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.beginCreateOrUpdateAsync | public Observable<ExpressRouteGatewayInner> beginCreateOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) {
"""
Creates or updates a ExpressRoute gateway in a specified resource group.
@param resourceGroupName The name of the resour... | java | public Observable<ExpressRouteGatewayInner> beginCreateOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParamet... | [
"public",
"Observable",
"<",
"ExpressRouteGatewayInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRouteGatewayName",
",",
"ExpressRouteGatewayInner",
"putExpressRouteGatewayParameters",
")",
"{",
"return",
"beginCreateOrUpdateWit... | Creates or updates a ExpressRoute gateway in a specified resource group.
@param resourceGroupName The name of the resource group.
@param expressRouteGatewayName The name of the ExpressRoute gateway.
@param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation.
@throws IllegalArg... | [
"Creates",
"or",
"updates",
"a",
"ExpressRoute",
"gateway",
"in",
"a",
"specified",
"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#L372-L379 |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/OTAUpdateFile.java | OTAUpdateFile.withAttributes | public OTAUpdateFile withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
A list of name/attribute pairs.
</p>
@param attributes
A list of name/attribute pairs.
@return Returns a reference to this object so that method calls can be chained together.
"""
setAttributes(attributes);
... | java | public OTAUpdateFile withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"OTAUpdateFile",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A list of name/attribute pairs.
</p>
@param attributes
A list of name/attribute pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"list",
"of",
"name",
"/",
"attribute",
"pairs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/OTAUpdateFile.java#L254-L257 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java | Http2CodecUtil.streamableBytes | public static int streamableBytes(StreamByteDistributor.StreamState state) {
"""
Calculate the amount of bytes that can be sent by {@code state}. The lower bound is {@code 0}.
"""
return max(0, (int) min(state.pendingBytes(), state.windowSize()));
} | java | public static int streamableBytes(StreamByteDistributor.StreamState state) {
return max(0, (int) min(state.pendingBytes(), state.windowSize()));
} | [
"public",
"static",
"int",
"streamableBytes",
"(",
"StreamByteDistributor",
".",
"StreamState",
"state",
")",
"{",
"return",
"max",
"(",
"0",
",",
"(",
"int",
")",
"min",
"(",
"state",
".",
"pendingBytes",
"(",
")",
",",
"state",
".",
"windowSize",
"(",
... | Calculate the amount of bytes that can be sent by {@code state}. The lower bound is {@code 0}. | [
"Calculate",
"the",
"amount",
"of",
"bytes",
"that",
"can",
"be",
"sent",
"by",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java#L214-L216 |
alkacon/opencms-core | src-modules/org/opencms/workplace/comparison/CmsResourceComparisonDialog.java | CmsResourceComparisonDialog.readResource | protected static CmsResource readResource(CmsObject cms, CmsUUID id, String version) throws CmsException {
"""
Returns either the historical resource or the offline resource, depending on the version number.<p>
@param cms the CmsObject to use
@param id the structure id of the resource
@param version the histo... | java | protected static CmsResource readResource(CmsObject cms, CmsUUID id, String version) throws CmsException {
if (Integer.parseInt(version) == CmsHistoryResourceHandler.PROJECT_OFFLINE_VERSION) {
return cms.readResource(id, CmsResourceFilter.IGNORE_EXPIRATION);
} else {
int ver = I... | [
"protected",
"static",
"CmsResource",
"readResource",
"(",
"CmsObject",
"cms",
",",
"CmsUUID",
"id",
",",
"String",
"version",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"Integer",
".",
"parseInt",
"(",
"version",
")",
"==",
"CmsHistoryResourceHandler",
".",... | Returns either the historical resource or the offline resource, depending on the version number.<p>
@param cms the CmsObject to use
@param id the structure id of the resource
@param version the historical version number
@return either the historical resource or the offline resource, depending on the version number
@... | [
"Returns",
"either",
"the",
"historical",
"resource",
"or",
"the",
"offline",
"resource",
"depending",
"on",
"the",
"version",
"number",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/comparison/CmsResourceComparisonDialog.java#L245-L262 |
apache/incubator-druid | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java | SupervisorManager.possiblyStopAndRemoveSupervisorInternal | private boolean possiblyStopAndRemoveSupervisorInternal(String id, boolean writeTombstone) {
"""
Stops a supervisor with a given id and then removes it from the list.
<p/>
Caller should have acquired [lock] before invoking this method to avoid contention with other threads that may be
starting, stopping, suspen... | java | private boolean possiblyStopAndRemoveSupervisorInternal(String id, boolean writeTombstone)
{
Pair<Supervisor, SupervisorSpec> pair = supervisors.get(id);
if (pair == null) {
return false;
}
if (writeTombstone) {
metadataSupervisorManager.insert(
id,
new NoopSupervisorS... | [
"private",
"boolean",
"possiblyStopAndRemoveSupervisorInternal",
"(",
"String",
"id",
",",
"boolean",
"writeTombstone",
")",
"{",
"Pair",
"<",
"Supervisor",
",",
"SupervisorSpec",
">",
"pair",
"=",
"supervisors",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"pa... | Stops a supervisor with a given id and then removes it from the list.
<p/>
Caller should have acquired [lock] before invoking this method to avoid contention with other threads that may be
starting, stopping, suspending and resuming supervisors.
@return true if a supervisor was stopped, false if there was no superviso... | [
"Stops",
"a",
"supervisor",
"with",
"a",
"given",
"id",
"and",
"then",
"removes",
"it",
"from",
"the",
"list",
".",
"<p",
"/",
">",
"Caller",
"should",
"have",
"acquired",
"[",
"lock",
"]",
"before",
"invoking",
"this",
"method",
"to",
"avoid",
"contenti... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java#L235-L252 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/GridBagLayoutFormBuilder.java | GridBagLayoutFormBuilder.appendLabeledField | public GridBagLayoutFormBuilder appendLabeledField(String propertyName, final JComponent field,
LabelOrientation labelOrientation) {
"""
Appends a label and field to the end of the current line.
<p />
The label will be to the left of the field, and be right-justified.
<br />
The field will "grow"... | java | public GridBagLayoutFormBuilder appendLabeledField(String propertyName, final JComponent field,
LabelOrientation labelOrientation) {
return appendLabeledField(propertyName, field, labelOrientation, 1);
} | [
"public",
"GridBagLayoutFormBuilder",
"appendLabeledField",
"(",
"String",
"propertyName",
",",
"final",
"JComponent",
"field",
",",
"LabelOrientation",
"labelOrientation",
")",
"{",
"return",
"appendLabeledField",
"(",
"propertyName",
",",
"field",
",",
"labelOrientation... | Appends a label and field to the end of the current line.
<p />
The label will be to the left of the field, and be right-justified.
<br />
The field will "grow" horizontally as space allows.
<p />
@param propertyName the name of the property to create the controls for
@return "this" to make it easier to string toget... | [
"Appends",
"a",
"label",
"and",
"field",
"to",
"the",
"end",
"of",
"the",
"current",
"line",
".",
"<p",
"/",
">"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/GridBagLayoutFormBuilder.java#L134-L137 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.translationRotateTowards | public Matrix4x3f translationRotateTowards(Vector3fc pos, Vector3fc dir, Vector3fc up) {
"""
Set this matrix to a model transformation for a right-handed coordinate system,
that translates to the given <code>pos</code> and aligns the local <code>-z</code>
axis with <code>dir</code>.
<p>
This method is equivale... | java | public Matrix4x3f translationRotateTowards(Vector3fc pos, Vector3fc dir, Vector3fc up) {
return translationRotateTowards(pos.x(), pos.y(), pos.z(), dir.x(), dir.y(), dir.z(), up.x(), up.y(), up.z());
} | [
"public",
"Matrix4x3f",
"translationRotateTowards",
"(",
"Vector3fc",
"pos",
",",
"Vector3fc",
"dir",
",",
"Vector3fc",
"up",
")",
"{",
"return",
"translationRotateTowards",
"(",
"pos",
".",
"x",
"(",
")",
",",
"pos",
".",
"y",
"(",
")",
",",
"pos",
".",
... | Set this matrix to a model transformation for a right-handed coordinate system,
that translates to the given <code>pos</code> and aligns the local <code>-z</code>
axis with <code>dir</code>.
<p>
This method is equivalent to calling: <code>translation(pos).rotateTowards(dir, up)</code>
@see #translation(Vector3fc)
@see... | [
"Set",
"this",
"matrix",
"to",
"a",
"model",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"translates",
"to",
"the",
"given",
"<code",
">",
"pos<",
"/",
"code",
">",
"and",
"aligns",
"the",
"local",
"<code",
">",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L8870-L8872 |
couchbase/CouchbaseMock | src/main/java/com/couchbase/mock/security/sasl/Sasl.java | Sasl.createSaslServer | public static SaslServer createSaslServer(String mechanism, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException {
"""
Creates a new {@link SaslServer} and first tries the JVM built-in servers
before falling back to {@link ShaSaslServer} implementations. The mechanisms are tried
in ... | java | public static SaslServer createSaslServer(String mechanism, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException {
if (Arrays.binarySearch(ShaSaslServerFactory.SUPPORTED_MECHS, mechanism) < 0) {
return javax.security.sasl.Sasl.createSaslServer(mechanism, PROTOCOL_COUCHB... | [
"public",
"static",
"SaslServer",
"createSaslServer",
"(",
"String",
"mechanism",
",",
"String",
"serverName",
",",
"Map",
"<",
"String",
",",
"?",
">",
"props",
",",
"CallbackHandler",
"cbh",
")",
"throws",
"SaslException",
"{",
"if",
"(",
"Arrays",
".",
"b... | Creates a new {@link SaslServer} and first tries the JVM built-in servers
before falling back to {@link ShaSaslServer} implementations. The mechanisms are tried
in the order they arrive.
@param mechanism The non-null mechanism name. It must be an IANA-registered
name of a SASL mechanism. (e.g. "SCRAM-SHA512", "PLAIN"... | [
"Creates",
"a",
"new",
"{",
"@link",
"SaslServer",
"}",
"and",
"first",
"tries",
"the",
"JVM",
"built",
"-",
"in",
"servers",
"before",
"falling",
"back",
"to",
"{",
"@link",
"ShaSaslServer",
"}",
"implementations",
".",
"The",
"mechanisms",
"are",
"tried",
... | train | https://github.com/couchbase/CouchbaseMock/blob/2085bbebade1d5b6356480e7bf335139d08383da/src/main/java/com/couchbase/mock/security/sasl/Sasl.java#L71-L77 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java | GenericsUtils.makeDeclaringAndActualGenericsTypeMap | public static Map<GenericsType, GenericsType> makeDeclaringAndActualGenericsTypeMap(ClassNode declaringClass, ClassNode actualReceiver) {
"""
map declaring generics type to actual generics type, e.g. GROOVY-7204:
declaring generics types: T, S extends Serializable
actual generics types : String, ... | java | public static Map<GenericsType, GenericsType> makeDeclaringAndActualGenericsTypeMap(ClassNode declaringClass, ClassNode actualReceiver) {
return doMakeDeclaringAndActualGenericsTypeMap(declaringClass, actualReceiver, false).getV1();
} | [
"public",
"static",
"Map",
"<",
"GenericsType",
",",
"GenericsType",
">",
"makeDeclaringAndActualGenericsTypeMap",
"(",
"ClassNode",
"declaringClass",
",",
"ClassNode",
"actualReceiver",
")",
"{",
"return",
"doMakeDeclaringAndActualGenericsTypeMap",
"(",
"declaringClass",
"... | map declaring generics type to actual generics type, e.g. GROOVY-7204:
declaring generics types: T, S extends Serializable
actual generics types : String, Long
the result map is [
T: String,
S: Long
]
The resolved types can not help us to choose methods correctly if the argument is a string: T: Obje... | [
"map",
"declaring",
"generics",
"type",
"to",
"actual",
"generics",
"type",
"e",
".",
"g",
".",
"GROOVY",
"-",
"7204",
":",
"declaring",
"generics",
"types",
":",
"T",
"S",
"extends",
"Serializable",
"actual",
"generics",
"types",
":",
"String",
"Long"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java#L805-L807 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaBindTexture | public static int cudaBindTexture(long offset[], textureReference texref, Pointer devPtr, cudaChannelFormatDesc desc, long size) {
"""
[C++ API] Binds a memory area to a texture
<pre>
template < class T, int dim, enum cudaTextureReadMode readMode >
cudaError_t cudaBindTexture (
size_t* offset,
const texture... | java | public static int cudaBindTexture(long offset[], textureReference texref, Pointer devPtr, cudaChannelFormatDesc desc, long size)
{
return checkResult(cudaBindTextureNative(offset, texref, devPtr, desc, size));
} | [
"public",
"static",
"int",
"cudaBindTexture",
"(",
"long",
"offset",
"[",
"]",
",",
"textureReference",
"texref",
",",
"Pointer",
"devPtr",
",",
"cudaChannelFormatDesc",
"desc",
",",
"long",
"size",
")",
"{",
"return",
"checkResult",
"(",
"cudaBindTextureNative",
... | [C++ API] Binds a memory area to a texture
<pre>
template < class T, int dim, enum cudaTextureReadMode readMode >
cudaError_t cudaBindTexture (
size_t* offset,
const texture < T,
dim,
readMode > & tex,
const void* devPtr,
const cudaChannelFormatDesc& desc,
size_t size = UINT_MAX ) [inline]
</pre>
<div>
<p>[C++ API] Bi... | [
"[",
"C",
"++",
"API",
"]",
"Binds",
"a",
"memory",
"area",
"to",
"a",
"texture"
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L9053-L9056 |
junit-team/junit4 | src/main/java/org/junit/runner/JUnitCore.java | JUnitCore.runClasses | public static Result runClasses(Computer computer, Class<?>... classes) {
"""
Run the tests contained in <code>classes</code>. Write feedback while the tests
are running and write stack traces for all failed tests after all tests complete. This is
similar to {@link #main(String[])}, but intended to be used progr... | java | public static Result runClasses(Computer computer, Class<?>... classes) {
return new JUnitCore().run(computer, classes);
} | [
"public",
"static",
"Result",
"runClasses",
"(",
"Computer",
"computer",
",",
"Class",
"<",
"?",
">",
"...",
"classes",
")",
"{",
"return",
"new",
"JUnitCore",
"(",
")",
".",
"run",
"(",
"computer",
",",
"classes",
")",
";",
"}"
] | Run the tests contained in <code>classes</code>. Write feedback while the tests
are running and write stack traces for all failed tests after all tests complete. This is
similar to {@link #main(String[])}, but intended to be used programmatically.
@param computer Helps construct Runners from classes
@param classes Cl... | [
"Run",
"the",
"tests",
"contained",
"in",
"<code",
">",
"classes<",
"/",
"code",
">",
".",
"Write",
"feedback",
"while",
"the",
"tests",
"are",
"running",
"and",
"write",
"stack",
"traces",
"for",
"all",
"failed",
"tests",
"after",
"all",
"tests",
"complet... | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runner/JUnitCore.java#L61-L63 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/api/impl/JobOperatorImpl.java | JobOperatorImpl.publishEvent | private void publishEvent(WSJobExecution jobEx, String topicToPublish, String correlationId) {
"""
Helper method to publish event
@param jobEx
@param topicToPublish
@param correlationId
"""
if (eventsPublisher != null) {
eventsPublisher.publishJobExecutionEvent(jobEx, topicToPublish, c... | java | private void publishEvent(WSJobExecution jobEx, String topicToPublish, String correlationId) {
if (eventsPublisher != null) {
eventsPublisher.publishJobExecutionEvent(jobEx, topicToPublish, correlationId);
}
} | [
"private",
"void",
"publishEvent",
"(",
"WSJobExecution",
"jobEx",
",",
"String",
"topicToPublish",
",",
"String",
"correlationId",
")",
"{",
"if",
"(",
"eventsPublisher",
"!=",
"null",
")",
"{",
"eventsPublisher",
".",
"publishJobExecutionEvent",
"(",
"jobEx",
",... | Helper method to publish event
@param jobEx
@param topicToPublish
@param correlationId | [
"Helper",
"method",
"to",
"publish",
"event"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/api/impl/JobOperatorImpl.java#L369-L373 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java | NamespacesInner.patchAsync | public Observable<NamespaceResourceInner> patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) {
"""
Patches the existing namespace.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param parameters Parameters supplie... | java | public Observable<NamespaceResourceInner> patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) {
return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1<ServiceResponse<NamespaceResourceInner>, NamespaceResourceInner>() {
... | [
"public",
"Observable",
"<",
"NamespaceResourceInner",
">",
"patchAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"NamespacePatchParameters",
"parameters",
")",
"{",
"return",
"patchWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Patches the existing namespace.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param parameters Parameters supplied to patch a Namespace Resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the NamespaceResourc... | [
"Patches",
"the",
"existing",
"namespace",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java#L357-L364 |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/org/apache/cxf/jaxrs/utils/HttpUtils.java | HttpUtils.encodePartiallyEncoded | public static String encodePartiallyEncoded(String encoded, boolean query) {
"""
Encodes partially encoded string. Encode all values but those matching pattern
"percent char followed by two hexadecimal digits".
@param encoded fully or partially encoded string.
@return fully encoded string
"""
if (... | java | public static String encodePartiallyEncoded(String encoded, boolean query) {
if (encoded.length() == 0) {
return encoded;
}
Matcher m = ENCODE_PATTERN.matcher(encoded);
if (!m.find()) {
return query ? HttpUtils.queryEncode(encoded) : HttpUtils.pathEncode(encoded)... | [
"public",
"static",
"String",
"encodePartiallyEncoded",
"(",
"String",
"encoded",
",",
"boolean",
"query",
")",
"{",
"if",
"(",
"encoded",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"encoded",
";",
"}",
"Matcher",
"m",
"=",
"ENCODE_PATTERN",
... | Encodes partially encoded string. Encode all values but those matching pattern
"percent char followed by two hexadecimal digits".
@param encoded fully or partially encoded string.
@return fully encoded string | [
"Encodes",
"partially",
"encoded",
"string",
".",
"Encode",
"all",
"values",
"but",
"those",
"matching",
"pattern",
"percent",
"char",
"followed",
"by",
"two",
"hexadecimal",
"digits",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/org/apache/cxf/jaxrs/utils/HttpUtils.java#L191-L213 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java | XMLReaderAdapter.processingInstruction | public void processingInstruction (String target, String data)
throws SAXException {
"""
Adapt a SAX2 processing instruction event.
@param target The processing instruction target.
@param data The remainder of the processing instruction
@exception org.xml.sax.SAXException The client may raise a
processin... | java | public void processingInstruction (String target, String data)
throws SAXException
{
if (documentHandler != null)
documentHandler.processingInstruction(target, data);
} | [
"public",
"void",
"processingInstruction",
"(",
"String",
"target",
",",
"String",
"data",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"documentHandler",
"!=",
"null",
")",
"documentHandler",
".",
"processingInstruction",
"(",
"target",
",",
"data",
")",
";",... | Adapt a SAX2 processing instruction event.
@param target The processing instruction target.
@param data The remainder of the processing instruction
@exception org.xml.sax.SAXException The client may raise a
processing exception.
@see org.xml.sax.ContentHandler#processingInstruction | [
"Adapt",
"a",
"SAX2",
"processing",
"instruction",
"event",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java#L402-L407 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/jiveproperties/packet/JivePropertiesExtension.java | JivePropertiesExtension.setProperty | public synchronized void setProperty(String name, Object value) {
"""
Sets a property with an Object as the value. The value must be Serializable
or an IllegalArgumentException will be thrown.
@param name the name of the property.
@param value the value of the property.
"""
if (!(value instanceof ... | java | public synchronized void setProperty(String name, Object value) {
if (!(value instanceof Serializable)) {
throw new IllegalArgumentException("Value must be serializable");
}
properties.put(name, value);
} | [
"public",
"synchronized",
"void",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"!",
"(",
"value",
"instanceof",
"Serializable",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Value must be serializable\"",
... | Sets a property with an Object as the value. The value must be Serializable
or an IllegalArgumentException will be thrown.
@param name the name of the property.
@param value the value of the property. | [
"Sets",
"a",
"property",
"with",
"an",
"Object",
"as",
"the",
"value",
".",
"The",
"value",
"must",
"be",
"Serializable",
"or",
"an",
"IllegalArgumentException",
"will",
"be",
"thrown",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/jiveproperties/packet/JivePropertiesExtension.java#L85-L90 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java | AbstractXbaseSemanticSequencer.sequence_XPostfixOperation | protected void sequence_XPostfixOperation(ISerializationContext context, XPostfixOperation semanticObject) {
"""
Contexts:
XExpression returns XPostfixOperation
XAssignment returns XPostfixOperation
XAssignment.XBinaryOperation_1_1_0_0_0 returns XPostfixOperation
XOrExpression returns XPostfixOperation
XOrExp... | java | protected void sequence_XPostfixOperation(ISerializationContext context, XPostfixOperation semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XPOSTFIX_OPERATION__OPERAND) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.create... | [
"protected",
"void",
"sequence_XPostfixOperation",
"(",
"ISerializationContext",
"context",
",",
"XPostfixOperation",
"semanticObject",
")",
"{",
"if",
"(",
"errorAcceptor",
"!=",
"null",
")",
"{",
"if",
"(",
"transientValues",
".",
"isValueTransient",
"(",
"semanticO... | Contexts:
XExpression returns XPostfixOperation
XAssignment returns XPostfixOperation
XAssignment.XBinaryOperation_1_1_0_0_0 returns XPostfixOperation
XOrExpression returns XPostfixOperation
XOrExpression.XBinaryOperation_1_0_0_0 returns XPostfixOperation
XAndExpression returns XPostfixOperation
XAndExpression.XBinaryO... | [
"Contexts",
":",
"XExpression",
"returns",
"XPostfixOperation",
"XAssignment",
"returns",
"XPostfixOperation",
"XAssignment",
".",
"XBinaryOperation_1_1_0_0_0",
"returns",
"XPostfixOperation",
"XOrExpression",
"returns",
"XPostfixOperation",
"XOrExpression",
".",
"XBinaryOperatio... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java#L1250-L1261 |
apigee/usergrid-java-sdk | src/main/java/org/usergrid/java/client/Client.java | Client.registerDevice | public Device registerDevice(UUID deviceId, Map<String, Object> properties) {
"""
Registers a device using the device's unique device ID.
@param context
@param properties
@return a Device object if success
"""
assertValidApplicationId();
if (properties == null) {
properties = n... | java | public Device registerDevice(UUID deviceId, Map<String, Object> properties) {
assertValidApplicationId();
if (properties == null) {
properties = new HashMap<String, Object>();
}
properties.put("refreshed", System.currentTimeMillis());
ApiResponse response = apiRequest... | [
"public",
"Device",
"registerDevice",
"(",
"UUID",
"deviceId",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"assertValidApplicationId",
"(",
")",
";",
"if",
"(",
"properties",
"==",
"null",
")",
"{",
"properties",
"=",
"new",
"Has... | Registers a device using the device's unique device ID.
@param context
@param properties
@return a Device object if success | [
"Registers",
"a",
"device",
"using",
"the",
"device",
"s",
"unique",
"device",
"ID",
"."
] | train | https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L543-L552 |
aol/cyclops | cyclops/src/main/java/com/oath/cyclops/internal/stream/FutureStreamUtils.java | FutureStreamUtils.forEachX | public static <T, X extends Throwable> Tuple3<CompletableFuture<Subscription>, Runnable, CompletableFuture<Boolean>> forEachX(
final Stream<T> stream, final long x, final Consumer<? super T> consumerElement) {
"""
Perform a forEach operation over the Stream, without closing it, consuming only the speci... | java | public static <T, X extends Throwable> Tuple3<CompletableFuture<Subscription>, Runnable, CompletableFuture<Boolean>> forEachX(
final Stream<T> stream, final long x, final Consumer<? super T> consumerElement) {
return forEachXEvents(stream, x, consumerElement, e -> {
} , () -> {
});
... | [
"public",
"static",
"<",
"T",
",",
"X",
"extends",
"Throwable",
">",
"Tuple3",
"<",
"CompletableFuture",
"<",
"Subscription",
">",
",",
"Runnable",
",",
"CompletableFuture",
"<",
"Boolean",
">",
">",
"forEachX",
"(",
"final",
"Stream",
"<",
"T",
">",
"stre... | Perform a forEach operation over the Stream, without closing it, consuming only the specified number of elements from
the Stream, at this time. More elements can be consumed later, by called request on the returned Subscription
<pre>
{@code
Subscription next = Streams.forEach(Stream.of(1,2,3,4),2,System.out::println);... | [
"Perform",
"a",
"forEach",
"operation",
"over",
"the",
"Stream",
"without",
"closing",
"it",
"consuming",
"only",
"the",
"specified",
"number",
"of",
"elements",
"from",
"the",
"Stream",
"at",
"this",
"time",
".",
"More",
"elements",
"can",
"be",
"consumed",
... | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/com/oath/cyclops/internal/stream/FutureStreamUtils.java#L45-L51 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.