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 |
|---|---|---|---|---|---|---|---|---|---|---|
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.createOrUpdate | public ExpressRouteGatewayInner createOrUpdate(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) {
"""
Creates or updates a ExpressRoute gateway in a specified resource group.
@param resourceGroupName The name of the resource group.
@param expr... | java | public ExpressRouteGatewayInner createOrUpdate(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).toBlocking().last().bo... | [
"public",
"ExpressRouteGatewayInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRouteGatewayName",
",",
"ExpressRouteGatewayInner",
"putExpressRouteGatewayParameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGro... | 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#L270-L272 |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.deleteCrowdIndiv_same | public void deleteCrowdIndiv_same(int crowdIdx, int nicheCount, double indivFitness, S indiv) {
"""
delete one solution from the most crowded subregion, which is indiv's subregion. Compare
indiv's fitness value and the worst one in this subregion
"""
// find the solution indices within this crowdIdx subr... | java | public void deleteCrowdIndiv_same(int crowdIdx, int nicheCount, double indivFitness, S indiv) {
// find the solution indices within this crowdIdx subregion
ArrayList<Integer> indList = new ArrayList<>();
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[crowdIdx][i] == 1) {
indList.... | [
"public",
"void",
"deleteCrowdIndiv_same",
"(",
"int",
"crowdIdx",
",",
"int",
"nicheCount",
",",
"double",
"indivFitness",
",",
"S",
"indiv",
")",
"{",
"// find the solution indices within this crowdIdx subregion",
"ArrayList",
"<",
"Integer",
">",
"indList",
"=",
"n... | delete one solution from the most crowded subregion, which is indiv's subregion. Compare
indiv's fitness value and the worst one in this subregion | [
"delete",
"one",
"solution",
"from",
"the",
"most",
"crowded",
"subregion",
"which",
"is",
"indiv",
"s",
"subregion",
".",
"Compare",
"indiv",
"s",
"fitness",
"value",
"and",
"the",
"worst",
"one",
"in",
"this",
"subregion"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1124-L1151 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/requests/restaction/MessageAction.java | MessageAction.addFile | @CheckReturnValue
public MessageAction addFile(final File file, final String name) {
"""
Adds the provided {@link java.io.File File} as file data.
<p>To reset all files use {@link #clearFiles()}
<br><u>This method opens a {@link java.io.FileInputStream FileInputStream} which will be closed by executing thi... | java | @CheckReturnValue
public MessageAction addFile(final File file, final String name)
{
Checks.notNull(file, "File");
Checks.check(file.exists() && file.canRead(), "Provided file either does not exist or cannot be read from!");
final long maxSize = getJDA().getSelfUser().getAllowedFileSize(... | [
"@",
"CheckReturnValue",
"public",
"MessageAction",
"addFile",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"name",
")",
"{",
"Checks",
".",
"notNull",
"(",
"file",
",",
"\"File\"",
")",
";",
"Checks",
".",
"check",
"(",
"file",
".",
"exists",
"... | Adds the provided {@link java.io.File File} as file data.
<p>To reset all files use {@link #clearFiles()}
<br><u>This method opens a {@link java.io.FileInputStream FileInputStream} which will be closed by executing this action or using {@link #clearFiles()}!</u>
@param file
The File that will be interpreted as file ... | [
"Adds",
"the",
"provided",
"{",
"@link",
"java",
".",
"io",
".",
"File",
"File",
"}",
"as",
"file",
"data",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/requests/restaction/MessageAction.java#L468-L485 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java | CheckArg.isNotLessThan | public static void isNotLessThan( int argument,
int notLessThanValue,
String name ) {
"""
Check that the argument is not less than the supplied value
@param argument The argument
@param notLessThanValue the value that is to be used to ... | java | public static void isNotLessThan( int argument,
int notLessThanValue,
String name ) {
if (argument < notLessThanValue) {
throw new IllegalArgumentException(CommonI18n.argumentMayNotBeLessThan.text(name, argument, notLessThan... | [
"public",
"static",
"void",
"isNotLessThan",
"(",
"int",
"argument",
",",
"int",
"notLessThanValue",
",",
"String",
"name",
")",
"{",
"if",
"(",
"argument",
"<",
"notLessThanValue",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"CommonI18n",
".",
... | Check that the argument is not less than the supplied value
@param argument The argument
@param notLessThanValue the value that is to be used to check the value
@param name The name of the argument
@throws IllegalArgumentException If argument greater than or equal to the supplied vlaue | [
"Check",
"that",
"the",
"argument",
"is",
"not",
"less",
"than",
"the",
"supplied",
"value"
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java#L41-L47 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java | FileUtils.loadMap | public static <K, V> ImmutableMap<K, V> loadMap(final File file,
final Function<String, K> keyFunction, final Function<String, V> valueFunction)
throws IOException {
"""
Reads an {@link ImmutableMap} from a {@link File}, where each line is a key, a tab
character ("\t"), and a value. Blank lines and li... | java | public static <K, V> ImmutableMap<K, V> loadMap(final File file,
final Function<String, K> keyFunction, final Function<String, V> valueFunction)
throws IOException {
return loadMap(Files.asCharSource(file, Charsets.UTF_8), keyFunction, valueFunction);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"ImmutableMap",
"<",
"K",
",",
"V",
">",
"loadMap",
"(",
"final",
"File",
"file",
",",
"final",
"Function",
"<",
"String",
",",
"K",
">",
"keyFunction",
",",
"final",
"Function",
"<",
"String",
",",
"V",
... | Reads an {@link ImmutableMap} from a {@link File}, where each line is a key, a tab
character ("\t"), and a value. Blank lines and lines beginning with "#" are ignored. | [
"Reads",
"an",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java#L329-L333 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/HFClient.java | HFClient.loadChannelFromConfig | public Channel loadChannelFromConfig(String channelName, NetworkConfig networkConfig) throws InvalidArgumentException, NetworkConfigurationException {
"""
Configures a channel based on information loaded from a Network Config file.
Note that it is up to the caller to initialize the returned channel.
@param cha... | java | public Channel loadChannelFromConfig(String channelName, NetworkConfig networkConfig) throws InvalidArgumentException, NetworkConfigurationException {
clientCheck();
// Sanity checks
if (channelName == null || channelName.isEmpty()) {
throw new InvalidArgumentException("channelName ... | [
"public",
"Channel",
"loadChannelFromConfig",
"(",
"String",
"channelName",
",",
"NetworkConfig",
"networkConfig",
")",
"throws",
"InvalidArgumentException",
",",
"NetworkConfigurationException",
"{",
"clientCheck",
"(",
")",
";",
"// Sanity checks",
"if",
"(",
"channelNa... | Configures a channel based on information loaded from a Network Config file.
Note that it is up to the caller to initialize the returned channel.
@param channelName The name of the channel to be configured
@param networkConfig The network configuration to use to configure the channel
@return The configured channel, ... | [
"Configures",
"a",
"channel",
"based",
"on",
"information",
"loaded",
"from",
"a",
"Network",
"Config",
"file",
".",
"Note",
"that",
"it",
"is",
"up",
"to",
"the",
"caller",
"to",
"initialize",
"the",
"returned",
"channel",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/HFClient.java#L203-L220 |
isisaddons-legacy/isis-module-security | dom/src/main/java/org/isisaddons/module/security/dom/user/ApplicationUserRepository.java | ApplicationUserRepository.findOrCreateUserByUsername | @Programmatic
public ApplicationUser findOrCreateUserByUsername(
final String username) {
"""
Uses the {@link QueryResultsCache} in order to support
multiple lookups from <code>org.isisaddons.module.security.app.user.UserPermissionViewModel</code>.
<p>
<p>
If the user does not exist, it will be... | java | @Programmatic
public ApplicationUser findOrCreateUserByUsername(
final String username) {
// slightly unusual to cache a function that modifies state, but safe because this is idempotent
return queryResultsCache.execute(new Callable<ApplicationUser>() {
@Override
... | [
"@",
"Programmatic",
"public",
"ApplicationUser",
"findOrCreateUserByUsername",
"(",
"final",
"String",
"username",
")",
"{",
"// slightly unusual to cache a function that modifies state, but safe because this is idempotent",
"return",
"queryResultsCache",
".",
"execute",
"(",
"new... | Uses the {@link QueryResultsCache} in order to support
multiple lookups from <code>org.isisaddons.module.security.app.user.UserPermissionViewModel</code>.
<p>
<p>
If the user does not exist, it will be automatically created.
</p> | [
"Uses",
"the",
"{"
] | train | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/dom/src/main/java/org/isisaddons/module/security/dom/user/ApplicationUserRepository.java#L57-L71 |
jmxtrans/embedded-jmxtrans | src/main/java/org/jmxtrans/embedded/ResultNameStrategy.java | ResultNameStrategy.appendEscapedNonAlphaNumericChars | private void appendEscapedNonAlphaNumericChars(String str, boolean escapeDot, StringBuilder result) {
"""
Escape all non a-z,A-Z, 0-9 and '-' with a '_'.
'.' is escaped with a '_' if {@code escapeDot} is {$code true}.
@param str the string to escape
@param escapeDot indicates whether '.' should be esc... | java | private void appendEscapedNonAlphaNumericChars(String str, boolean escapeDot, StringBuilder result) {
char[] chars = str.toCharArray();
for (int i = 0; i < chars.length; i++) {
char ch = chars[i];
if (Character.isLetter(ch) || Character.isDigit(ch) || ch == '-') {
... | [
"private",
"void",
"appendEscapedNonAlphaNumericChars",
"(",
"String",
"str",
",",
"boolean",
"escapeDot",
",",
"StringBuilder",
"result",
")",
"{",
"char",
"[",
"]",
"chars",
"=",
"str",
".",
"toCharArray",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",... | Escape all non a-z,A-Z, 0-9 and '-' with a '_'.
'.' is escaped with a '_' if {@code escapeDot} is {$code true}.
@param str the string to escape
@param escapeDot indicates whether '.' should be escaped into '_' or not.
@param result the {@linkplain StringBuilder} in which the escaped string is appended | [
"Escape",
"all",
"non",
"a",
"-",
"z",
"A",
"-",
"Z",
"0",
"-",
"9",
"and",
"-",
"with",
"a",
"_",
"."
] | train | https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/ResultNameStrategy.java#L292-L306 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/FileInputFormat.java | FileInputFormat.addInputPaths | public static void addInputPaths(JobConf conf, String commaSeparatedPaths) {
"""
Add the given comma separated paths to the list of inputs for
the map-reduce job.
@param conf The configuration of the job
@param commaSeparatedPaths Comma separated paths to be added to
the list of inputs for the map-reduce job... | java | public static void addInputPaths(JobConf conf, String commaSeparatedPaths) {
for (String str : getPathStrings(commaSeparatedPaths)) {
addInputPath(conf, new Path(str));
}
} | [
"public",
"static",
"void",
"addInputPaths",
"(",
"JobConf",
"conf",
",",
"String",
"commaSeparatedPaths",
")",
"{",
"for",
"(",
"String",
"str",
":",
"getPathStrings",
"(",
"commaSeparatedPaths",
")",
")",
"{",
"addInputPath",
"(",
"conf",
",",
"new",
"Path",... | Add the given comma separated paths to the list of inputs for
the map-reduce job.
@param conf The configuration of the job
@param commaSeparatedPaths Comma separated paths to be added to
the list of inputs for the map-reduce job. | [
"Add",
"the",
"given",
"comma",
"separated",
"paths",
"to",
"the",
"list",
"of",
"inputs",
"for",
"the",
"map",
"-",
"reduce",
"job",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/FileInputFormat.java#L501-L505 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/URI.java | URI.setPort | public void setPort(int p_port) throws MalformedURIException {
"""
Set the port for this URI. -1 is used to indicate that the port is
not specified, otherwise valid port numbers are between 0 and 65535.
If a valid port number is passed in and the host field is null,
an exception is thrown.
@param p_port the... | java | public void setPort(int p_port) throws MalformedURIException
{
if (p_port >= 0 && p_port <= 65535)
{
if (m_host == null)
{
throw new MalformedURIException(
Utils.messages.createMessage(MsgKey.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!");
}
... | [
"public",
"void",
"setPort",
"(",
"int",
"p_port",
")",
"throws",
"MalformedURIException",
"{",
"if",
"(",
"p_port",
">=",
"0",
"&&",
"p_port",
"<=",
"65535",
")",
"{",
"if",
"(",
"m_host",
"==",
"null",
")",
"{",
"throw",
"new",
"MalformedURIException",
... | Set the port for this URI. -1 is used to indicate that the port is
not specified, otherwise valid port numbers are between 0 and 65535.
If a valid port number is passed in and the host field is null,
an exception is thrown.
@param p_port the port number for this URI
@throws MalformedURIException if p_port is not -1 ... | [
"Set",
"the",
"port",
"for",
"this",
"URI",
".",
"-",
"1",
"is",
"used",
"to",
"indicate",
"that",
"the",
"port",
"is",
"not",
"specified",
"otherwise",
"valid",
"port",
"numbers",
"are",
"between",
"0",
"and",
"65535",
".",
"If",
"a",
"valid",
"port",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/URI.java#L1126-L1143 |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepository.java | MarkLogicRepository.getMarkLogicClient | @Override
public synchronized MarkLogicClient getMarkLogicClient() {
"""
returns MarkLogicClient object which manages communication to ML server via Java api client
@return MarkLogicClient
"""
if(null != databaseClient){
this.client = new MarkLogicClient(databaseClient);
}els... | java | @Override
public synchronized MarkLogicClient getMarkLogicClient() {
if(null != databaseClient){
this.client = new MarkLogicClient(databaseClient);
}else{
this.client = new MarkLogicClient(host, port, user, password, auth);
}
return this.client;
} | [
"@",
"Override",
"public",
"synchronized",
"MarkLogicClient",
"getMarkLogicClient",
"(",
")",
"{",
"if",
"(",
"null",
"!=",
"databaseClient",
")",
"{",
"this",
".",
"client",
"=",
"new",
"MarkLogicClient",
"(",
"databaseClient",
")",
";",
"}",
"else",
"{",
"... | returns MarkLogicClient object which manages communication to ML server via Java api client
@return MarkLogicClient | [
"returns",
"MarkLogicClient",
"object",
"which",
"manages",
"communication",
"to",
"ML",
"server",
"via",
"Java",
"api",
"client"
] | train | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepository.java#L231-L239 |
netplex/json-smart-v2 | accessors-smart/src/main/java/net/minidev/asm/ASMUtil.java | ASMUtil.autoUnBoxing1 | protected static void autoUnBoxing1(MethodVisitor mv, Type fieldType) {
"""
Append the call of proper extract primitive type of an boxed object.
"""
switch (fieldType.getSort()) {
case Type.BOOLEAN:
mv.visitTypeInsn(CHECKCAST, "java/lang/Boolean");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Boolean... | java | protected static void autoUnBoxing1(MethodVisitor mv, Type fieldType) {
switch (fieldType.getSort()) {
case Type.BOOLEAN:
mv.visitTypeInsn(CHECKCAST, "java/lang/Boolean");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Boolean", "booleanValue", "()Z");
break;
case Type.BYTE:
mv.visitTypeInsn(CHECKCAST, ... | [
"protected",
"static",
"void",
"autoUnBoxing1",
"(",
"MethodVisitor",
"mv",
",",
"Type",
"fieldType",
")",
"{",
"switch",
"(",
"fieldType",
".",
"getSort",
"(",
")",
")",
"{",
"case",
"Type",
".",
"BOOLEAN",
":",
"mv",
".",
"visitTypeInsn",
"(",
"CHECKCAST... | Append the call of proper extract primitive type of an boxed object. | [
"Append",
"the",
"call",
"of",
"proper",
"extract",
"primitive",
"type",
"of",
"an",
"boxed",
"object",
"."
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/accessors-smart/src/main/java/net/minidev/asm/ASMUtil.java#L105-L145 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java | SessionBuilder.withNodeFilter | @NonNull
public SelfT withNodeFilter(@NonNull String profileName, @NonNull Predicate<Node> nodeFilter) {
"""
Adds a custom filter to include/exclude nodes for a particular execution profile. This assumes
that you're also using a dedicated load balancing policy for that profile.
<p>The predicate's {@link Pred... | java | @NonNull
public SelfT withNodeFilter(@NonNull String profileName, @NonNull Predicate<Node> nodeFilter) {
this.nodeFilters.put(profileName, nodeFilter);
return self;
} | [
"@",
"NonNull",
"public",
"SelfT",
"withNodeFilter",
"(",
"@",
"NonNull",
"String",
"profileName",
",",
"@",
"NonNull",
"Predicate",
"<",
"Node",
">",
"nodeFilter",
")",
"{",
"this",
".",
"nodeFilters",
".",
"put",
"(",
"profileName",
",",
"nodeFilter",
")",... | Adds a custom filter to include/exclude nodes for a particular execution profile. This assumes
that you're also using a dedicated load balancing policy for that profile.
<p>The predicate's {@link Predicate#test(Object) test()} method will be invoked each time the
{@link LoadBalancingPolicy} processes a topology or sta... | [
"Adds",
"a",
"custom",
"filter",
"to",
"include",
"/",
"exclude",
"nodes",
"for",
"a",
"particular",
"execution",
"profile",
".",
"This",
"assumes",
"that",
"you",
"re",
"also",
"using",
"a",
"dedicated",
"load",
"balancing",
"policy",
"for",
"that",
"profil... | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java#L264-L268 |
petergeneric/stdlib | guice/common/src/main/java/com/peterphi/std/guice/apploader/impl/GuiceFactory.java | GuiceFactory.applyNetworkConfiguration | private static void applyNetworkConfiguration(final GuiceConfig config) {
"""
Add to the configuration any properties defined by the network configuration endpoint (if network config is enabled in a
previous property)
@param config
"""
final String configEndpoint = config.get(GuiceProperties.CONFIG_ENDPO... | java | private static void applyNetworkConfiguration(final GuiceConfig config)
{
final String configEndpoint = config.get(GuiceProperties.CONFIG_ENDPOINT, null);
final Boolean configSkip = config.getBoolean(GuiceProperties.CONFIG_SKIP, false);
if (configEndpoint != null && !configSkip)
{
final boolean useMoxy = ... | [
"private",
"static",
"void",
"applyNetworkConfiguration",
"(",
"final",
"GuiceConfig",
"config",
")",
"{",
"final",
"String",
"configEndpoint",
"=",
"config",
".",
"get",
"(",
"GuiceProperties",
".",
"CONFIG_ENDPOINT",
",",
"null",
")",
";",
"final",
"Boolean",
... | Add to the configuration any properties defined by the network configuration endpoint (if network config is enabled in a
previous property)
@param config | [
"Add",
"to",
"the",
"configuration",
"any",
"properties",
"defined",
"by",
"the",
"network",
"configuration",
"endpoint",
"(",
"if",
"network",
"config",
"is",
"enabled",
"in",
"a",
"previous",
"property",
")"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/common/src/main/java/com/peterphi/std/guice/apploader/impl/GuiceFactory.java#L372-L424 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/AbstractParser.java | AbstractParser.elementAsBoolean | protected Boolean elementAsBoolean(XMLStreamReader reader, String key, Map<String, String> expressions)
throws XMLStreamException, ParserException {
"""
convert an xml element in boolean value. Empty elements results with true (tag presence is sufficient condition)
@param reader the StAX reader
@param ke... | java | protected Boolean elementAsBoolean(XMLStreamReader reader, String key, Map<String, String> expressions)
throws XMLStreamException, ParserException
{
String elementtext = rawElementText(reader);
if (key != null && expressions != null && elementtext != null && elementtext.indexOf("${") != -1)
... | [
"protected",
"Boolean",
"elementAsBoolean",
"(",
"XMLStreamReader",
"reader",
",",
"String",
"key",
",",
"Map",
"<",
"String",
",",
"String",
">",
"expressions",
")",
"throws",
"XMLStreamException",
",",
"ParserException",
"{",
"String",
"elementtext",
"=",
"rawEl... | convert an xml element in boolean value. Empty elements results with true (tag presence is sufficient condition)
@param reader the StAX reader
@param key The key
@param expressions The expressions
@return the boolean representing element
@throws XMLStreamException StAX exception
@throws ParserException in case of non ... | [
"convert",
"an",
"xml",
"element",
"in",
"boolean",
"value",
".",
"Empty",
"elements",
"results",
"with",
"true",
"(",
"tag",
"presence",
"is",
"sufficient",
"condition",
")"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/AbstractParser.java#L97-L115 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.serviceName_transferCredits_POST | public void serviceName_transferCredits_POST(String serviceName, Double credits, String smsAccountTarget) throws IOException {
"""
Credit transfer between two sms accounts.
REST: POST /sms/{serviceName}/transferCredits
@param smsAccountTarget [required] Sms account destination.
@param credits [required] Amoun... | java | public void serviceName_transferCredits_POST(String serviceName, Double credits, String smsAccountTarget) throws IOException {
String qPath = "/sms/{serviceName}/transferCredits";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "credits", credits... | [
"public",
"void",
"serviceName_transferCredits_POST",
"(",
"String",
"serviceName",
",",
"Double",
"credits",
",",
"String",
"smsAccountTarget",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sms/{serviceName}/transferCredits\"",
";",
"StringBuilder",
"sb"... | Credit transfer between two sms accounts.
REST: POST /sms/{serviceName}/transferCredits
@param smsAccountTarget [required] Sms account destination.
@param credits [required] Amount of credits to transfer.
@param serviceName [required] The internal name of your SMS offer | [
"Credit",
"transfer",
"between",
"two",
"sms",
"accounts",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L1535-L1542 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getSummonerSpell | public Future<SummonerSpell> getSummonerSpell(int id, SpellData data) {
"""
<p>
Retrieve a specific summoner spell
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param id The id of the spell
@param data Additional information to retrieve
@return The spell
@see <a... | java | public Future<SummonerSpell> getSummonerSpell(int id, SpellData data) {
return new DummyFuture<>(handler.getSummonerSpell(id, data));
} | [
"public",
"Future",
"<",
"SummonerSpell",
">",
"getSummonerSpell",
"(",
"int",
"id",
",",
"SpellData",
"data",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",
".",
"getSummonerSpell",
"(",
"id",
",",
"data",
")",
")",
";",
"}"
] | <p>
Retrieve a specific summoner spell
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param id The id of the spell
@param data Additional information to retrieve
@return The spell
@see <a href=https://developer.riotgames.com/api/methods#!/649/2167>Official API documentation<... | [
"<p",
">",
"Retrieve",
"a",
"specific",
"summoner",
"spell",
"<",
"/",
"p",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"the",
"rate",
"limit",
"and",
"is",
"not",
"affected",
"by",
"the",
"throttle"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L809-L811 |
petergeneric/stdlib | guice/webapp/src/main/java/com/peterphi/std/guice/web/rest/service/servicedescription/freemarker/RestServiceInfo.java | RestServiceInfo.truncatePath | static String truncatePath(String path, String commonPrefix) {
"""
Truncate path to the completion of the segment ending with the common prefix
@param path
@param commonPrefix
@return
"""
final int nextSlash = path.indexOf('/', commonPrefix.length());
final int nextOpenCurly = path.indexOf('{', comm... | java | static String truncatePath(String path, String commonPrefix)
{
final int nextSlash = path.indexOf('/', commonPrefix.length());
final int nextOpenCurly = path.indexOf('{', commonPrefix.length());
if (nextSlash > 0)
return path.substring(0, nextSlash);
else if (nextOpenCurly > 0)
return path.substring(0, ... | [
"static",
"String",
"truncatePath",
"(",
"String",
"path",
",",
"String",
"commonPrefix",
")",
"{",
"final",
"int",
"nextSlash",
"=",
"path",
".",
"indexOf",
"(",
"'",
"'",
",",
"commonPrefix",
".",
"length",
"(",
")",
")",
";",
"final",
"int",
"nextOpen... | Truncate path to the completion of the segment ending with the common prefix
@param path
@param commonPrefix
@return | [
"Truncate",
"path",
"to",
"the",
"completion",
"of",
"the",
"segment",
"ending",
"with",
"the",
"common",
"prefix"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/webapp/src/main/java/com/peterphi/std/guice/web/rest/service/servicedescription/freemarker/RestServiceInfo.java#L93-L104 |
alkacon/opencms-core | src/org/opencms/search/solr/CmsSolrIndex.java | CmsSolrIndex.writeResp | private void writeResp(ServletResponse response, SolrQueryRequest queryRequest, SolrQueryResponse queryResponse)
throws IOException, UnsupportedEncodingException {
"""
Writes the Solr response.<p>
@param response the servlet response
@param queryRequest the Solr request
@param queryResponse the Solr resp... | java | private void writeResp(ServletResponse response, SolrQueryRequest queryRequest, SolrQueryResponse queryResponse)
throws IOException, UnsupportedEncodingException {
if (m_solr instanceof EmbeddedSolrServer) {
SolrCore core = ((EmbeddedSolrServer)m_solr).getCoreContainer().getCore(getCoreName... | [
"private",
"void",
"writeResp",
"(",
"ServletResponse",
"response",
",",
"SolrQueryRequest",
"queryRequest",
",",
"SolrQueryResponse",
"queryResponse",
")",
"throws",
"IOException",
",",
"UnsupportedEncodingException",
"{",
"if",
"(",
"m_solr",
"instanceof",
"EmbeddedSolr... | Writes the Solr response.<p>
@param response the servlet response
@param queryRequest the Solr request
@param queryResponse the Solr response to write
@throws IOException if sth. goes wrong
@throws UnsupportedEncodingException if sth. goes wrong | [
"Writes",
"the",
"Solr",
"response",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrIndex.java#L1694-L1729 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.updateSensitiveWord | public ResponseWrapper updateSensitiveWord(String newWord, String oldWord)
throws APIConnectionException, APIRequestException {
"""
Update sensitive word
@param newWord new word
@param oldWord old word
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException ... | java | public ResponseWrapper updateSensitiveWord(String newWord, String oldWord)
throws APIConnectionException, APIRequestException {
return _sensitiveWordClient.updateSensitiveWord(newWord, oldWord);
} | [
"public",
"ResponseWrapper",
"updateSensitiveWord",
"(",
"String",
"newWord",
",",
"String",
"oldWord",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_sensitiveWordClient",
".",
"updateSensitiveWord",
"(",
"newWord",
",",
"oldWord",
... | Update sensitive word
@param newWord new word
@param oldWord old word
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Update",
"sensitive",
"word"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L721-L724 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPOptionLocalServiceBaseImpl.java | CPOptionLocalServiceBaseImpl.getCPOptionByUuidAndGroupId | @Override
public CPOption getCPOptionByUuidAndGroupId(String uuid, long groupId)
throws PortalException {
"""
Returns the cp option matching the UUID and group.
@param uuid the cp option's UUID
@param groupId the primary key of the group
@return the matching cp option
@throws PortalException if a matching... | java | @Override
public CPOption getCPOptionByUuidAndGroupId(String uuid, long groupId)
throws PortalException {
return cpOptionPersistence.findByUUID_G(uuid, groupId);
} | [
"@",
"Override",
"public",
"CPOption",
"getCPOptionByUuidAndGroupId",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"PortalException",
"{",
"return",
"cpOptionPersistence",
".",
"findByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"}"
] | Returns the cp option matching the UUID and group.
@param uuid the cp option's UUID
@param groupId the primary key of the group
@return the matching cp option
@throws PortalException if a matching cp option could not be found | [
"Returns",
"the",
"cp",
"option",
"matching",
"the",
"UUID",
"and",
"group",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPOptionLocalServiceBaseImpl.java#L425-L429 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassContext.java | ClassContext.getMethodAnalysis | public Object getMethodAnalysis(Class<?> analysisClass, MethodDescriptor methodDescriptor) {
"""
Retrieve a method analysis object.
@param analysisClass
class the method analysis object should belong to
@param methodDescriptor
method descriptor identifying the analyzed method
@return the analysis object
... | java | public Object getMethodAnalysis(Class<?> analysisClass, MethodDescriptor methodDescriptor) {
Map<MethodDescriptor, Object> objectMap = getObjectMap(analysisClass);
return objectMap.get(methodDescriptor);
} | [
"public",
"Object",
"getMethodAnalysis",
"(",
"Class",
"<",
"?",
">",
"analysisClass",
",",
"MethodDescriptor",
"methodDescriptor",
")",
"{",
"Map",
"<",
"MethodDescriptor",
",",
"Object",
">",
"objectMap",
"=",
"getObjectMap",
"(",
"analysisClass",
")",
";",
"r... | Retrieve a method analysis object.
@param analysisClass
class the method analysis object should belong to
@param methodDescriptor
method descriptor identifying the analyzed method
@return the analysis object | [
"Retrieve",
"a",
"method",
"analysis",
"object",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassContext.java#L169-L172 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java | AbstractInvokable.abortCheckpointOnBarrier | public void abortCheckpointOnBarrier(long checkpointId, Throwable cause) throws Exception {
"""
Aborts a checkpoint as the result of receiving possibly some checkpoint barriers,
but at least one {@link org.apache.flink.runtime.io.network.api.CancelCheckpointMarker}.
<p>This requires implementing tasks to forwa... | java | public void abortCheckpointOnBarrier(long checkpointId, Throwable cause) throws Exception {
throw new UnsupportedOperationException(String.format("abortCheckpointOnBarrier not supported by %s", this.getClass().getName()));
} | [
"public",
"void",
"abortCheckpointOnBarrier",
"(",
"long",
"checkpointId",
",",
"Throwable",
"cause",
")",
"throws",
"Exception",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"String",
".",
"format",
"(",
"\"abortCheckpointOnBarrier not supported by %s\"",
"... | Aborts a checkpoint as the result of receiving possibly some checkpoint barriers,
but at least one {@link org.apache.flink.runtime.io.network.api.CancelCheckpointMarker}.
<p>This requires implementing tasks to forward a
{@link org.apache.flink.runtime.io.network.api.CancelCheckpointMarker} to their outputs.
@param ch... | [
"Aborts",
"a",
"checkpoint",
"as",
"the",
"result",
"of",
"receiving",
"possibly",
"some",
"checkpoint",
"barriers",
"but",
"at",
"least",
"one",
"{",
"@link",
"org",
".",
"apache",
".",
"flink",
".",
"runtime",
".",
"io",
".",
"network",
".",
"api",
"."... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java#L239-L241 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.forbidUser | public ResponseWrapper forbidUser(String username, boolean disable)
throws APIConnectionException, APIRequestException {
"""
Forbid or activate user
@param username username
@param disable true means forbid, false means activate
@return No content
@throws APIConnectionException connect exception
@... | java | public ResponseWrapper forbidUser(String username, boolean disable)
throws APIConnectionException, APIRequestException {
return _userClient.forbidUser(username, disable);
} | [
"public",
"ResponseWrapper",
"forbidUser",
"(",
"String",
"username",
",",
"boolean",
"disable",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_userClient",
".",
"forbidUser",
"(",
"username",
",",
"disable",
")",
";",
"}"
] | Forbid or activate user
@param username username
@param disable true means forbid, false means activate
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Forbid",
"or",
"activate",
"user"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L354-L357 |
restfb/restfb | src/main/java/com/restfb/util/DateUtils.java | DateUtils.toDateWithFormatString | private static Date toDateWithFormatString(String date, String format) {
"""
Returns a Java representation of a {@code date} string.
@param date
Date in string format.
@return Java date representation of the given {@code date} string or {@code null} if {@code date} is {@code null}
or invalid.
"""
if... | java | private static Date toDateWithFormatString(String date, String format) {
if (date == null) {
return null;
}
try {
return strategy.formatFor(format).parse(date);
} catch (ParseException e) {
UTILS_LOGGER.trace("Unable to parse date '{}' using format string '{}': {}", date, form... | [
"private",
"static",
"Date",
"toDateWithFormatString",
"(",
"String",
"date",
",",
"String",
"format",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"strategy",
".",
"formatFor",
"(",
"format",
")"... | Returns a Java representation of a {@code date} string.
@param date
Date in string format.
@return Java date representation of the given {@code date} string or {@code null} if {@code date} is {@code null}
or invalid. | [
"Returns",
"a",
"Java",
"representation",
"of",
"a",
"{",
"@code",
"date",
"}",
"string",
"."
] | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/util/DateUtils.java#L181-L193 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/KeyPairGenerator.java | KeyPairGenerator.getInstance | public static KeyPairGenerator getInstance(String algorithm,
String provider)
throws NoSuchAlgorithmException, NoSuchProviderException {
"""
Returns a KeyPairGenerator object that generates public/private
key pairs for the specified algorithm.
<p> A new KeyPairGenerator object encapsula... | java | public static KeyPairGenerator getInstance(String algorithm,
String provider)
throws NoSuchAlgorithmException, NoSuchProviderException {
Instance instance = GetInstance.getInstance("KeyPairGenerator",
KeyPairGeneratorSpi.class, algorithm, provider);
return getInst... | [
"public",
"static",
"KeyPairGenerator",
"getInstance",
"(",
"String",
"algorithm",
",",
"String",
"provider",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchProviderException",
"{",
"Instance",
"instance",
"=",
"GetInstance",
".",
"getInstance",
"(",
"\"KeyPairG... | Returns a KeyPairGenerator object that generates public/private
key pairs for the specified algorithm.
<p> A new KeyPairGenerator object encapsulating the
KeyPairGeneratorSpi implementation from the specified provider
is returned. The specified provider must be registered
in the security provider list.
<p> Note that... | [
"Returns",
"a",
"KeyPairGenerator",
"object",
"that",
"generates",
"public",
"/",
"private",
"key",
"pairs",
"for",
"the",
"specified",
"algorithm",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/KeyPairGenerator.java#L304-L310 |
facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/NamespaceNotifierClient.java | NamespaceNotifierClient.placeWatch | public void placeWatch(String path, EventType watchType,
long transactionId) throws TransactionIdTooOldException,
NotConnectedToServerException, InterruptedException,
WatchAlreadyPlacedException {
"""
The watcher (given in the constructor) will be notified when an
event of the given type and at ... | java | public void placeWatch(String path, EventType watchType,
long transactionId) throws TransactionIdTooOldException,
NotConnectedToServerException, InterruptedException,
WatchAlreadyPlacedException {
NamespaceEventKey eventKey = new NamespaceEventKey(path, watchType);
Object connectionLock = conn... | [
"public",
"void",
"placeWatch",
"(",
"String",
"path",
",",
"EventType",
"watchType",
",",
"long",
"transactionId",
")",
"throws",
"TransactionIdTooOldException",
",",
"NotConnectedToServerException",
",",
"InterruptedException",
",",
"WatchAlreadyPlacedException",
"{",
"... | The watcher (given in the constructor) will be notified when an
event of the given type and at the given path will happen. He will
keep receiving notifications until the watch is removed with
{@link #removeWatch(String, EventType)}.
The subscription is considered done if the method doesn't throw an
exception (even if ... | [
"The",
"watcher",
"(",
"given",
"in",
"the",
"constructor",
")",
"will",
"be",
"notified",
"when",
"an",
"event",
"of",
"the",
"given",
"type",
"and",
"at",
"the",
"given",
"path",
"will",
"happen",
".",
"He",
"will",
"keep",
"receiving",
"notifications",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/NamespaceNotifierClient.java#L297-L329 |
haifengl/smile | math/src/main/java/smile/math/special/Gamma.java | Gamma.regularizedIncompleteGammaSeries | private static double regularizedIncompleteGammaSeries(double a, double x) {
"""
Regularized Incomplete Gamma Function P(a,x) = <i><big>∫</big><sub><small>0</small></sub><sup><small>x</small></sup> e<sup>-t</sup> t<sup>(a-1)</sup> dt</i>.
Series representation of the function - valid for x < a + 1
"""
... | java | private static double regularizedIncompleteGammaSeries(double a, double x) {
if (a < 0.0 || x < 0.0 || x >= a + 1) {
throw new IllegalArgumentException(String.format("Invalid a = %f, x = %f", a, x));
}
int i = 0;
double igf = 0.0;
boolean check = true;
doubl... | [
"private",
"static",
"double",
"regularizedIncompleteGammaSeries",
"(",
"double",
"a",
",",
"double",
"x",
")",
"{",
"if",
"(",
"a",
"<",
"0.0",
"||",
"x",
"<",
"0.0",
"||",
"x",
">=",
"a",
"+",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Regularized Incomplete Gamma Function P(a,x) = <i><big>∫</big><sub><small>0</small></sub><sup><small>x</small></sup> e<sup>-t</sup> t<sup>(a-1)</sup> dt</i>.
Series representation of the function - valid for x < a + 1 | [
"Regularized",
"Incomplete",
"Gamma",
"Function",
"P",
"(",
"a",
"x",
")",
"=",
"<i",
">",
"<big",
">",
"∫",
";",
"<",
"/",
"big",
">",
"<sub",
">",
"<small",
">",
"0<",
"/",
"small",
">",
"<",
"/",
"sub",
">",
"<sup",
">",
"<small",
">",
... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/special/Gamma.java#L179-L209 |
wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java | RamlControllerVisitor.extractRelativeUrl | private static String extractRelativeUrl(String resURI, String parentUri) {
"""
Get the relative route uri from its resURI/fullUri and parentUri.
@param resURI the route full uri.
@param parentUri the route parent uri.
@return The route relative uri.
"""
if (Strings.isNullOrEmpty(parentUri)) {... | java | private static String extractRelativeUrl(String resURI, String parentUri) {
if (Strings.isNullOrEmpty(parentUri)) {
if (resURI.isEmpty()) {
return "/";
}
return resURI;
}
String url;
//Get the relative part of the url
String ... | [
"private",
"static",
"String",
"extractRelativeUrl",
"(",
"String",
"resURI",
",",
"String",
"parentUri",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"parentUri",
")",
")",
"{",
"if",
"(",
"resURI",
".",
"isEmpty",
"(",
")",
")",
"{",
"ret... | Get the relative route uri from its resURI/fullUri and parentUri.
@param resURI the route full uri.
@param parentUri the route parent uri.
@return The route relative uri. | [
"Get",
"the",
"relative",
"route",
"uri",
"from",
"its",
"resURI",
"/",
"fullUri",
"and",
"parentUri",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java#L231-L259 |
Frostman/dropbox4j | src/main/java/ru/frostman/dropbox/api/DropboxClient.java | DropboxClient.getThumbnail | public ThumbnailDownload getThumbnail(String path, ThumbnailSize size, ThumbnailFormat format) {
"""
Download thumbnail of the file with specified path (if exists).
@param path to file
@param size of thumbnail
@param format of thumbnail
@return special objects that provides different ways to access thu... | java | public ThumbnailDownload getThumbnail(String path, ThumbnailSize size, ThumbnailFormat format) {
OAuthRequest request = new OAuthRequest(Verb.GET, THUMBNAILS_URL + encode(path));
if (size != THUMBNAIL_SIZE) {
request.addQuerystringParameter("size", size.toString());
}
if (f... | [
"public",
"ThumbnailDownload",
"getThumbnail",
"(",
"String",
"path",
",",
"ThumbnailSize",
"size",
",",
"ThumbnailFormat",
"format",
")",
"{",
"OAuthRequest",
"request",
"=",
"new",
"OAuthRequest",
"(",
"Verb",
".",
"GET",
",",
"THUMBNAILS_URL",
"+",
"encode",
... | Download thumbnail of the file with specified path (if exists).
@param path to file
@param size of thumbnail
@param format of thumbnail
@return special objects that provides different ways to access thumbnail | [
"Download",
"thumbnail",
"of",
"the",
"file",
"with",
"specified",
"path",
"(",
"if",
"exists",
")",
"."
] | train | https://github.com/Frostman/dropbox4j/blob/774c817e5bf294d0139ecb5ac81399be50ada5e0/src/main/java/ru/frostman/dropbox/api/DropboxClient.java#L321-L336 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/client/WebSocketClient.java | WebSocketClient.connectionBuilder | public static ConnectionBuilder connectionBuilder(XnioWorker worker, ByteBufferPool bufferPool, URI uri) {
"""
Creates a new connection builder that can be used to create a web socket connection.
@param worker The XnioWorker to use for the connection
@param bufferPool The buffer pool
@param uri The connection U... | java | public static ConnectionBuilder connectionBuilder(XnioWorker worker, ByteBufferPool bufferPool, URI uri) {
return new ConnectionBuilder(worker, bufferPool, uri);
} | [
"public",
"static",
"ConnectionBuilder",
"connectionBuilder",
"(",
"XnioWorker",
"worker",
",",
"ByteBufferPool",
"bufferPool",
",",
"URI",
"uri",
")",
"{",
"return",
"new",
"ConnectionBuilder",
"(",
"worker",
",",
"bufferPool",
",",
"uri",
")",
";",
"}"
] | Creates a new connection builder that can be used to create a web socket connection.
@param worker The XnioWorker to use for the connection
@param bufferPool The buffer pool
@param uri The connection URI
@return The connection builder | [
"Creates",
"a",
"new",
"connection",
"builder",
"that",
"can",
"be",
"used",
"to",
"create",
"a",
"web",
"socket",
"connection",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/client/WebSocketClient.java#L386-L388 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/OptimalCECPMain.java | OptimalCECPMain.alignPermuted | public AFPChain alignPermuted(Atom[] ca1, Atom[] ca2, Object param, int cp) throws StructureException {
"""
Aligns ca1 with ca2 permuted by <i>cp</i> residues.
<p><strong>WARNING:</strong> Modifies ca2 during the permutation. Be sure
to make a copy before calling this method.
@param ca1
@param ca2
@param pa... | java | public AFPChain alignPermuted(Atom[] ca1, Atom[] ca2, Object param, int cp) throws StructureException {
// initial permutation
permuteArray(ca2,cp);
// perform alignment
AFPChain afpChain = super.align(ca1, ca2, param);
// un-permute alignment
permuteAFPChain(afpChain, -cp);
if(afpChain.getName2() != n... | [
"public",
"AFPChain",
"alignPermuted",
"(",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
",",
"Object",
"param",
",",
"int",
"cp",
")",
"throws",
"StructureException",
"{",
"// initial permutation",
"permuteArray",
"(",
"ca2",
",",
"cp",
")",
";"... | Aligns ca1 with ca2 permuted by <i>cp</i> residues.
<p><strong>WARNING:</strong> Modifies ca2 during the permutation. Be sure
to make a copy before calling this method.
@param ca1
@param ca2
@param param
@param cp
@return
@throws StructureException | [
"Aligns",
"ca1",
"with",
"ca2",
"permuted",
"by",
"<i",
">",
"cp<",
"/",
"i",
">",
"residues",
".",
"<p",
">",
"<strong",
">",
"WARNING",
":",
"<",
"/",
"strong",
">",
"Modifies",
"ca2",
"during",
"the",
"permutation",
".",
"Be",
"sure",
"to",
"make"... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/OptimalCECPMain.java#L193-L209 |
gliga/ekstazi | org.ekstazi.core/src/main/java/org/ekstazi/dynamic/DynamicEkstazi.java | DynamicEkstazi.setSystemClassLoaderClassPath | private static void setSystemClassLoaderClassPath() throws Exception {
"""
Set paths from the current class loader to the path of system class
loader. This method should be invoked only once.
"""
Log.d("Setting classpath");
// We use agent class as we do not extract this class in newly created... | java | private static void setSystemClassLoaderClassPath() throws Exception {
Log.d("Setting classpath");
// We use agent class as we do not extract this class in newly created
// jar (otherwise we may end up creating one -magic jar from another);
// also it will exist even without JUnit classe... | [
"private",
"static",
"void",
"setSystemClassLoaderClassPath",
"(",
")",
"throws",
"Exception",
"{",
"Log",
".",
"d",
"(",
"\"Setting classpath\"",
")",
";",
"// We use agent class as we do not extract this class in newly created",
"// jar (otherwise we may end up creating one -magi... | Set paths from the current class loader to the path of system class
loader. This method should be invoked only once. | [
"Set",
"paths",
"from",
"the",
"current",
"class",
"loader",
"to",
"the",
"path",
"of",
"system",
"class",
"loader",
".",
"This",
"method",
"should",
"be",
"invoked",
"only",
"once",
"."
] | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/dynamic/DynamicEkstazi.java#L137-L167 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/ArrayUtils.java | ArrayUtils.getElementAt | public static <T> T getElementAt(T[] array, int index) {
"""
Returns the element at the given index in the {@code array}.
@param <T> {@link Class} type of elements in the array.
@param array array from which to extract the given element at index.
@param index integer indicating the index of the element in the... | java | public static <T> T getElementAt(T[] array, int index) {
return getElementAt(array, index, null);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getElementAt",
"(",
"T",
"[",
"]",
"array",
",",
"int",
"index",
")",
"{",
"return",
"getElementAt",
"(",
"array",
",",
"index",
",",
"null",
")",
";",
"}"
] | Returns the element at the given index in the {@code array}.
@param <T> {@link Class} type of elements in the array.
@param array array from which to extract the given element at index.
@param index integer indicating the index of the element in the array to return.
@return the element at the given index in the array.... | [
"Returns",
"the",
"element",
"at",
"the",
"given",
"index",
"in",
"the",
"{",
"@code",
"array",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/ArrayUtils.java#L424-L426 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeValidator.java | TypeValidator.expectAutoboxesToIterable | boolean expectAutoboxesToIterable(Node n, JSType type, String msg) {
"""
Expect the type to autobox to be an Iterable.
@return True if there was no warning, false if there was a mismatch.
"""
// Note: we don't just use JSType.autobox() here because that removes null and undefined.
// We want to keep... | java | boolean expectAutoboxesToIterable(Node n, JSType type, String msg) {
// Note: we don't just use JSType.autobox() here because that removes null and undefined.
// We want to keep null and undefined around.
if (type.isUnionType()) {
for (JSType alt : type.toMaybeUnionType().getAlternates()) {
al... | [
"boolean",
"expectAutoboxesToIterable",
"(",
"Node",
"n",
",",
"JSType",
"type",
",",
"String",
"msg",
")",
"{",
"// Note: we don't just use JSType.autobox() here because that removes null and undefined.",
"// We want to keep null and undefined around.",
"if",
"(",
"type",
".",
... | Expect the type to autobox to be an Iterable.
@return True if there was no warning, false if there was a mismatch. | [
"Expect",
"the",
"type",
"to",
"autobox",
"to",
"be",
"an",
"Iterable",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L282-L302 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java | AllWindowedStream.minBy | public SingleOutputStreamOperator<T> minBy(String field, boolean first) {
"""
Applies an aggregation that that gives the minimum element of the pojo
data stream by the given field expression for every window. A field
expression is either the name of a public field or a getter method with
parentheses of the {@li... | java | public SingleOutputStreamOperator<T> minBy(String field, boolean first) {
return aggregate(new ComparableAggregator<>(field, input.getType(), AggregationFunction.AggregationType.MINBY, first, input.getExecutionConfig()));
} | [
"public",
"SingleOutputStreamOperator",
"<",
"T",
">",
"minBy",
"(",
"String",
"field",
",",
"boolean",
"first",
")",
"{",
"return",
"aggregate",
"(",
"new",
"ComparableAggregator",
"<>",
"(",
"field",
",",
"input",
".",
"getType",
"(",
")",
",",
"Aggregatio... | Applies an aggregation that that gives the minimum element of the pojo
data stream by the given field expression for every window. A field
expression is either the name of a public field or a getter method with
parentheses of the {@link DataStream DataStreams} underlying type. A dot can be used
to drill down into objec... | [
"Applies",
"an",
"aggregation",
"that",
"that",
"gives",
"the",
"minimum",
"element",
"of",
"the",
"pojo",
"data",
"stream",
"by",
"the",
"given",
"field",
"expression",
"for",
"every",
"window",
".",
"A",
"field",
"expression",
"is",
"either",
"the",
"name"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L1473-L1475 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CSVUtil.java | CSVUtil.importCSV | public static <E extends Exception> long importCSV(final InputStream is, long offset, final long count, final Try.Predicate<String[], E> filter,
final PreparedStatement stmt, final int batchSize, final int batchInterval,
final Try.BiConsumer<? super PreparedStatement, ? super String[], SQLExce... | java | public static <E extends Exception> long importCSV(final InputStream is, long offset, final long count, final Try.Predicate<String[], E> filter,
final PreparedStatement stmt, final int batchSize, final int batchInterval,
final Try.BiConsumer<? super PreparedStatement, ? super String[], SQLExce... | [
"public",
"static",
"<",
"E",
"extends",
"Exception",
">",
"long",
"importCSV",
"(",
"final",
"InputStream",
"is",
",",
"long",
"offset",
",",
"final",
"long",
"count",
",",
"final",
"Try",
".",
"Predicate",
"<",
"String",
"[",
"]",
",",
"E",
">",
"fil... | Imports the data from CSV to database.
@param is
@param offset
@param count
@param filter
@param stmt the column order in the sql should be consistent with the column order in the CSV file.
@param batchSize
@param batchInterval
@param stmtSetter
@return | [
"Imports",
"the",
"data",
"from",
"CSV",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L1644-L1649 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxFolder.java | BoxFolder.uploadFile | public BoxFile.Info uploadFile(InputStream fileContent, String name, long fileSize, ProgressListener listener) {
"""
Uploads a new file to this folder while reporting the progress to a ProgressListener.
@param fileContent a stream containing the contents of the file to upload.
@param name the name to gi... | java | public BoxFile.Info uploadFile(InputStream fileContent, String name, long fileSize, ProgressListener listener) {
FileUploadParams uploadInfo = new FileUploadParams()
.setContent(fileContent)
.setName(name)
.setSize(fileSize)
.setProgressListener(li... | [
"public",
"BoxFile",
".",
"Info",
"uploadFile",
"(",
"InputStream",
"fileContent",
",",
"String",
"name",
",",
"long",
"fileSize",
",",
"ProgressListener",
"listener",
")",
"{",
"FileUploadParams",
"uploadInfo",
"=",
"new",
"FileUploadParams",
"(",
")",
".",
"se... | Uploads a new file to this folder while reporting the progress to a ProgressListener.
@param fileContent a stream containing the contents of the file to upload.
@param name the name to give the uploaded file.
@param fileSize the size of the file used for determining the progress of the upload.
@param listene... | [
"Uploads",
"a",
"new",
"file",
"to",
"this",
"folder",
"while",
"reporting",
"the",
"progress",
"to",
"a",
"ProgressListener",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFolder.java#L482-L489 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java | GeneratedDOAuth2UserDaoImpl.queryByState | public Iterable<DOAuth2User> queryByState(java.lang.Integer state) {
"""
query-by method for field state
@param state the specified attribute
@return an Iterable of DOAuth2Users for the specified state
"""
return queryByField(null, DOAuth2UserMapper.Field.STATE.getFieldName(), state);
} | java | public Iterable<DOAuth2User> queryByState(java.lang.Integer state) {
return queryByField(null, DOAuth2UserMapper.Field.STATE.getFieldName(), state);
} | [
"public",
"Iterable",
"<",
"DOAuth2User",
">",
"queryByState",
"(",
"java",
".",
"lang",
".",
"Integer",
"state",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DOAuth2UserMapper",
".",
"Field",
".",
"STATE",
".",
"getFieldName",
"(",
")",
",",
"st... | query-by method for field state
@param state the specified attribute
@return an Iterable of DOAuth2Users for the specified state | [
"query",
"-",
"by",
"method",
"for",
"field",
"state"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java#L124-L126 |
sebastiangraf/treetank | interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java | DatabaseRepresentation.createResource | public void createResource(final InputStream inputStream, final String resourceName)
throws JaxRxException {
"""
This method is responsible to create a new database.
@param inputStream
The stream containing the XML document that has to be stored.
@param resourceName
The name of the new database.
@th... | java | public void createResource(final InputStream inputStream, final String resourceName)
throws JaxRxException {
synchronized (resourceName) {
if (inputStream == null) {
throw new JaxRxException(400, "Bad user request");
} else {
try {
... | [
"public",
"void",
"createResource",
"(",
"final",
"InputStream",
"inputStream",
",",
"final",
"String",
"resourceName",
")",
"throws",
"JaxRxException",
"{",
"synchronized",
"(",
"resourceName",
")",
"{",
"if",
"(",
"inputStream",
"==",
"null",
")",
"{",
"throw"... | This method is responsible to create a new database.
@param inputStream
The stream containing the XML document that has to be stored.
@param resourceName
The name of the new database.
@throws JaxRxException
The exception occurred. | [
"This",
"method",
"is",
"responsible",
"to",
"create",
"a",
"new",
"database",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java#L136-L149 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java | PhotosInterface.getPhoto | public Photo getPhoto(String id, String secret) throws FlickrException {
"""
Get the photo for the specified ID with the given secret. Currently maps to the getInfo() method.
@param id
The ID
@param secret
The secret
@return The Photo
"""
return getInfo(id, secret);
} | java | public Photo getPhoto(String id, String secret) throws FlickrException {
return getInfo(id, secret);
} | [
"public",
"Photo",
"getPhoto",
"(",
"String",
"id",
",",
"String",
"secret",
")",
"throws",
"FlickrException",
"{",
"return",
"getInfo",
"(",
"id",
",",
"secret",
")",
";",
"}"
] | Get the photo for the specified ID with the given secret. Currently maps to the getInfo() method.
@param id
The ID
@param secret
The secret
@return The Photo | [
"Get",
"the",
"photo",
"for",
"the",
"specified",
"ID",
"with",
"the",
"given",
"secret",
".",
"Currently",
"maps",
"to",
"the",
"getInfo",
"()",
"method",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java#L1324-L1326 |
VerbalExpressions/JavaVerbalExpressions | src/main/java/ru/lanwen/verbalregex/VerbalExpression.java | VerbalExpression.getTextGroups | public List<String> getTextGroups(final String toTest, final int group) {
"""
Extract exact group from string and add it to list
Example:
String text = "SampleHelloWorldString";
VerbalExpression regex = regex().capt().oneOf("Hello", "World").endCapt().maybe("String").build();
list = regex.getTextGroups(text,... | java | public List<String> getTextGroups(final String toTest, final int group) {
List<String> groups = new ArrayList<>();
Matcher m = pattern.matcher(toTest);
while (m.find()) {
groups.add(m.group(group));
}
return groups;
} | [
"public",
"List",
"<",
"String",
">",
"getTextGroups",
"(",
"final",
"String",
"toTest",
",",
"final",
"int",
"group",
")",
"{",
"List",
"<",
"String",
">",
"groups",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Matcher",
"m",
"=",
"pattern",
".",
... | Extract exact group from string and add it to list
Example:
String text = "SampleHelloWorldString";
VerbalExpression regex = regex().capt().oneOf("Hello", "World").endCapt().maybe("String").build();
list = regex.getTextGroups(text, 0) //result: "Hello", "WorldString"
list = regex.getTextGroups(text, 1) //result: "Hell... | [
"Extract",
"exact",
"group",
"from",
"string",
"and",
"add",
"it",
"to",
"list"
] | train | https://github.com/VerbalExpressions/JavaVerbalExpressions/blob/4ee34e6c96ea2cf8335e3b425afa44c535229347/src/main/java/ru/lanwen/verbalregex/VerbalExpression.java#L783-L790 |
wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/util/ByteUtils.java | ByteUtils.toHexString | public static String toHexString(byte[] bytes, boolean isHNF) {
"""
Converts a byte array to a hex String.
@param bytes
a byte array
@param isHNF
true if HNF(high nibble first), false if LNF(low nibble first)
@return hex String
"""
StringBuilder sb = new StringBuilder();
for (byte b : bytes) {
... | java | public static String toHexString(byte[] bytes, boolean isHNF) {
StringBuilder sb = new StringBuilder();
for (byte b : bytes) {
String hex =
String.format("%2s", Integer.toHexString(b & 0xFF)).replace(' ', '0');
if (isHNF)
sb.append(hex);
else
sb.append(new StringBuild... | [
"public",
"static",
"String",
"toHexString",
"(",
"byte",
"[",
"]",
"bytes",
",",
"boolean",
"isHNF",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"byte",
"b",
":",
"bytes",
")",
"{",
"String",
"hex",
"=",
... | Converts a byte array to a hex String.
@param bytes
a byte array
@param isHNF
true if HNF(high nibble first), false if LNF(low nibble first)
@return hex String | [
"Converts",
"a",
"byte",
"array",
"to",
"a",
"hex",
"String",
"."
] | train | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/util/ByteUtils.java#L496-L507 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ProjectFilePanel.java | ProjectFilePanel.saveFile | public void saveFile(File file, String type) {
"""
Saves the project file displayed in this panel.
@param file target file
@param type file type
"""
if (file != null)
{
m_treeController.saveFile(file, type);
}
} | java | public void saveFile(File file, String type)
{
if (file != null)
{
m_treeController.saveFile(file, type);
}
} | [
"public",
"void",
"saveFile",
"(",
"File",
"file",
",",
"String",
"type",
")",
"{",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"m_treeController",
".",
"saveFile",
"(",
"file",
",",
"type",
")",
";",
"}",
"}"
] | Saves the project file displayed in this panel.
@param file target file
@param type file type | [
"Saves",
"the",
"project",
"file",
"displayed",
"in",
"this",
"panel",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ProjectFilePanel.java#L104-L110 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.startAt | @Nonnull
public Query startAt(@Nonnull DocumentSnapshot snapshot) {
"""
Creates and returns a new Query that starts at the provided document (inclusive). The starting
position is relative to the order of the query. The document must contain all of the fields
provided in the orderBy of this query.
@param sna... | java | @Nonnull
public Query startAt(@Nonnull DocumentSnapshot snapshot) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.fieldOrders = createImplicitOrderBy();
newOptions.startCursor = createCursor(newOptions.fieldOrders, snapshot, true);
return new Query(firestore, path, newOptions);
} | [
"@",
"Nonnull",
"public",
"Query",
"startAt",
"(",
"@",
"Nonnull",
"DocumentSnapshot",
"snapshot",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"fieldOrders",
"=",
"createImplicitOrderBy",
"(",
... | Creates and returns a new Query that starts at the provided document (inclusive). The starting
position is relative to the order of the query. The document must contain all of the fields
provided in the orderBy of this query.
@param snapshot The snapshot of the document to start at.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"starts",
"at",
"the",
"provided",
"document",
"(",
"inclusive",
")",
".",
"The",
"starting",
"position",
"is",
"relative",
"to",
"the",
"order",
"of",
"the",
"query",
".",
"The",
"document",
"must"... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L706-L712 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/auditlog/AuditLogImpl.java | AuditLogImpl.addEntries | public void addEntries(JsonNode data) {
"""
Adds entries to the audit log.
@param data The json data of the audit log.
"""
for (JsonNode webhookJson : data.get("webhooks")) {
boolean alreadyAdded = involvedWebhooks.stream()
.anyMatch(webhook -> webhook.getId() == webh... | java | public void addEntries(JsonNode data) {
for (JsonNode webhookJson : data.get("webhooks")) {
boolean alreadyAdded = involvedWebhooks.stream()
.anyMatch(webhook -> webhook.getId() == webhookJson.get("id").asLong());
if (!alreadyAdded) {
involvedWebhooks.... | [
"public",
"void",
"addEntries",
"(",
"JsonNode",
"data",
")",
"{",
"for",
"(",
"JsonNode",
"webhookJson",
":",
"data",
".",
"get",
"(",
"\"webhooks\"",
")",
")",
"{",
"boolean",
"alreadyAdded",
"=",
"involvedWebhooks",
".",
"stream",
"(",
")",
".",
"anyMat... | Adds entries to the audit log.
@param data The json data of the audit log. | [
"Adds",
"entries",
"to",
"the",
"audit",
"log",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/auditlog/AuditLogImpl.java#L63-L81 |
ontop/ontop | core/obda/src/main/java/it/unibz/inf/ontop/spec/ontology/impl/OntologyBuilderImpl.java | OntologyBuilderImpl.createAnnotationAssertion | public static AnnotationAssertion createAnnotationAssertion(AnnotationProperty ap, ObjectConstant o, Constant c) {
"""
Creates an annotation assertion
AnnotationAssertion := 'AnnotationAssertion' '(' axiomAnnotations AnnotationProperty AnnotationSubject AnnotationValue ')'
AnnotationSubject := IRI | AnonymousInd... | java | public static AnnotationAssertion createAnnotationAssertion(AnnotationProperty ap, ObjectConstant o, Constant c) {
return new AnnotationAssertionImpl(ap,o,c);
} | [
"public",
"static",
"AnnotationAssertion",
"createAnnotationAssertion",
"(",
"AnnotationProperty",
"ap",
",",
"ObjectConstant",
"o",
",",
"Constant",
"c",
")",
"{",
"return",
"new",
"AnnotationAssertionImpl",
"(",
"ap",
",",
"o",
",",
"c",
")",
";",
"}"
] | Creates an annotation assertion
AnnotationAssertion := 'AnnotationAssertion' '(' axiomAnnotations AnnotationProperty AnnotationSubject AnnotationValue ')'
AnnotationSubject := IRI | AnonymousIndividual | [
"Creates",
"an",
"annotation",
"assertion",
"AnnotationAssertion",
":",
"=",
"AnnotationAssertion",
"(",
"axiomAnnotations",
"AnnotationProperty",
"AnnotationSubject",
"AnnotationValue",
")",
"AnnotationSubject",
":",
"=",
"IRI",
"|",
"AnonymousIndividual"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/obda/src/main/java/it/unibz/inf/ontop/spec/ontology/impl/OntologyBuilderImpl.java#L495-L497 |
liferay/com-liferay-commerce | commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java | CommerceCurrencyPersistenceImpl.countByG_P_A | @Override
public int countByG_P_A(long groupId, boolean primary, boolean active) {
"""
Returns the number of commerce currencies where groupId = ? and primary = ? and active = ?.
@param groupId the group ID
@param primary the primary
@param active the active
@return the number of matching commer... | java | @Override
public int countByG_P_A(long groupId, boolean primary, boolean active) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_P_A;
Object[] finderArgs = new Object[] { groupId, primary, active };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundle... | [
"@",
"Override",
"public",
"int",
"countByG_P_A",
"(",
"long",
"groupId",
",",
"boolean",
"primary",
",",
"boolean",
"active",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_G_P_A",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
... | Returns the number of commerce currencies where groupId = ? and primary = ? and active = ?.
@param groupId the group ID
@param primary the primary
@param active the active
@return the number of matching commerce currencies | [
"Returns",
"the",
"number",
"of",
"commerce",
"currencies",
"where",
"groupId",
"=",
"?",
";",
"and",
"primary",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java#L3863-L3914 |
apigee/usergrid-java-sdk | src/main/java/org/usergrid/java/client/Client.java | Client.authorizeAppUser | public ApiResponse authorizeAppUser(String email, String password) {
"""
Log the user in and get a valid access token.
@param email
@param password
@return non-null ApiResponse if request succeeds, check getError() for
"invalid_grant" to see if access is denied.
"""
validateNonEmptyParam(email, "... | java | public ApiResponse authorizeAppUser(String email, String password) {
validateNonEmptyParam(email, "email");
validateNonEmptyParam(password,"password");
assertValidApplicationId();
loggedInUser = null;
accessToken = null;
currentOrganization = null;
Map<String, Obj... | [
"public",
"ApiResponse",
"authorizeAppUser",
"(",
"String",
"email",
",",
"String",
"password",
")",
"{",
"validateNonEmptyParam",
"(",
"email",
",",
"\"email\"",
")",
";",
"validateNonEmptyParam",
"(",
"password",
",",
"\"password\"",
")",
";",
"assertValidApplicat... | Log the user in and get a valid access token.
@param email
@param password
@return non-null ApiResponse if request succeeds, check getError() for
"invalid_grant" to see if access is denied. | [
"Log",
"the",
"user",
"in",
"and",
"get",
"a",
"valid",
"access",
"token",
"."
] | train | https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L375-L400 |
seam/faces | impl/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java | DelegatingPhaseListener.shouldProcessPhase | private boolean shouldProcessPhase(final PhaseListener listener, final PhaseEvent event) {
"""
Determine if the {@link PhaseListener} should process the given {@link PhaseEvent}.
"""
return (PhaseId.ANY_PHASE.equals(listener.getPhaseId()) || event.getPhaseId().equals(listener.getPhaseId()));
} | java | private boolean shouldProcessPhase(final PhaseListener listener, final PhaseEvent event) {
return (PhaseId.ANY_PHASE.equals(listener.getPhaseId()) || event.getPhaseId().equals(listener.getPhaseId()));
} | [
"private",
"boolean",
"shouldProcessPhase",
"(",
"final",
"PhaseListener",
"listener",
",",
"final",
"PhaseEvent",
"event",
")",
"{",
"return",
"(",
"PhaseId",
".",
"ANY_PHASE",
".",
"equals",
"(",
"listener",
".",
"getPhaseId",
"(",
")",
")",
"||",
"event",
... | Determine if the {@link PhaseListener} should process the given {@link PhaseEvent}. | [
"Determine",
"if",
"the",
"{"
] | train | https://github.com/seam/faces/blob/2fdedbc7070318c2c58bfffb8a26f1ea1d0ee1e3/impl/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java#L59-L61 |
Impetus/Kundera | src/kundera-spark/spark-core/src/main/java/com/impetus/spark/client/SparkClient.java | SparkClient.executeQuery | public List executeQuery(String query, EntityMetadata m, KunderaQuery kunderaQuery) {
"""
Execute query.
@param query
the query
@param m
the m
@param kunderaQuery
the kundera query
@return the list
"""
DataFrame dataFrame = getDataFrame(query, m, kunderaQuery);
// dataFrame.show();
... | java | public List executeQuery(String query, EntityMetadata m, KunderaQuery kunderaQuery)
{
DataFrame dataFrame = getDataFrame(query, m, kunderaQuery);
// dataFrame.show();
return dataHandler.loadDataAndPopulateResults(dataFrame, m, kunderaQuery);
} | [
"public",
"List",
"executeQuery",
"(",
"String",
"query",
",",
"EntityMetadata",
"m",
",",
"KunderaQuery",
"kunderaQuery",
")",
"{",
"DataFrame",
"dataFrame",
"=",
"getDataFrame",
"(",
"query",
",",
"m",
",",
"kunderaQuery",
")",
";",
"// dataFrame.show();",
"re... | Execute query.
@param query
the query
@param m
the m
@param kunderaQuery
the kundera query
@return the list | [
"Execute",
"query",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-spark/spark-core/src/main/java/com/impetus/spark/client/SparkClient.java#L314-L320 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/HelloSignClient.java | HelloSignClient.createAccount | public Account createAccount(String email, String clientId, String clientSecret) throws HelloSignException {
"""
Creates a new HelloSign account and provides OAuth app credentials to
automatically generate an OAuth token with the user Account response.
@param email String New user's email address
@param clien... | java | public Account createAccount(String email, String clientId, String clientSecret) throws HelloSignException {
HttpClient client = httpClient.withAuth(auth).withPostField(Account.ACCOUNT_EMAIL_ADDRESS, email);
if (clientId != null && clientSecret != null) {
client = client.withPostField(CLIENT... | [
"public",
"Account",
"createAccount",
"(",
"String",
"email",
",",
"String",
"clientId",
",",
"String",
"clientSecret",
")",
"throws",
"HelloSignException",
"{",
"HttpClient",
"client",
"=",
"httpClient",
".",
"withAuth",
"(",
"auth",
")",
".",
"withPostField",
... | Creates a new HelloSign account and provides OAuth app credentials to
automatically generate an OAuth token with the user Account response.
@param email String New user's email address
@param clientId String Client ID
@param clientSecret String App secret
@return Account New user's account information
@throws HelloSig... | [
"Creates",
"a",
"new",
"HelloSign",
"account",
"and",
"provides",
"OAuth",
"app",
"credentials",
"to",
"automatically",
"generate",
"an",
"OAuth",
"token",
"with",
"the",
"user",
"Account",
"response",
"."
] | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/HelloSignClient.java#L282-L298 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/Program.java | Program.getItem | private <T> T getItem(String itemName, Map<String, T> items, String typeName) {
"""
Get an item from a map.
<p>
@param <T> the map type
@param itemName the item name
@param items the items
@param typeName the item type name
@return the item
"""
T item = items.get(itemName);
if (item == null) ... | java | private <T> T getItem(String itemName, Map<String, T> items, String typeName) {
T item = items.get(itemName);
if (item == null) {
throw new FuzzerException(name + ": " + typeName + " '" + itemName + "' not found");
}
return item;
} | [
"private",
"<",
"T",
">",
"T",
"getItem",
"(",
"String",
"itemName",
",",
"Map",
"<",
"String",
",",
"T",
">",
"items",
",",
"String",
"typeName",
")",
"{",
"T",
"item",
"=",
"items",
".",
"get",
"(",
"itemName",
")",
";",
"if",
"(",
"item",
"=="... | Get an item from a map.
<p>
@param <T> the map type
@param itemName the item name
@param items the items
@param typeName the item type name
@return the item | [
"Get",
"an",
"item",
"from",
"a",
"map",
".",
"<p",
">"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/Program.java#L369-L375 |
Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseFileSystem.java | AlluxioFuseFileSystem.mkdir | @Override
public int mkdir(String path, @mode_t long mode) {
"""
Creates a new dir.
@param path the path on the FS of the new dir
@param mode Dir creation flags (IGNORED)
@return 0 on success, a negative value on error
"""
final AlluxioURI turi = mPathResolverCache.getUnchecked(path);
LOG.trace(... | java | @Override
public int mkdir(String path, @mode_t long mode) {
final AlluxioURI turi = mPathResolverCache.getUnchecked(path);
LOG.trace("mkdir({}) [Alluxio: {}]", path, turi);
try {
mFileSystem.createDirectory(turi);
} catch (FileAlreadyExistsException e) {
LOG.debug("Failed to create direct... | [
"@",
"Override",
"public",
"int",
"mkdir",
"(",
"String",
"path",
",",
"@",
"mode_t",
"long",
"mode",
")",
"{",
"final",
"AlluxioURI",
"turi",
"=",
"mPathResolverCache",
".",
"getUnchecked",
"(",
"path",
")",
";",
"LOG",
".",
"trace",
"(",
"\"mkdir({}) [Al... | Creates a new dir.
@param path the path on the FS of the new dir
@param mode Dir creation flags (IGNORED)
@return 0 on success, a negative value on error | [
"Creates",
"a",
"new",
"dir",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseFileSystem.java#L389-L407 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java | UnresolvedBindingValidator.validate | public boolean validate(DependencyExplorerOutput output, InvalidKeys invalidKeys) {
"""
Returns true if the graph is valid (does not have any cycles or problems creating required
keys). If there are any errors, they will be reported to the global {@link ErrorManager}.
"""
Collection<Map.Entry<Key<?>, Str... | java | public boolean validate(DependencyExplorerOutput output, InvalidKeys invalidKeys) {
Collection<Map.Entry<Key<?>, String>> invalidRequiredKeys =
invalidKeys.getInvalidRequiredKeys();
for (Map.Entry<Key<?>, String> error : invalidRequiredKeys) {
reportError(output, error.getKey(), error.getValue())... | [
"public",
"boolean",
"validate",
"(",
"DependencyExplorerOutput",
"output",
",",
"InvalidKeys",
"invalidKeys",
")",
"{",
"Collection",
"<",
"Map",
".",
"Entry",
"<",
"Key",
"<",
"?",
">",
",",
"String",
">",
">",
"invalidRequiredKeys",
"=",
"invalidKeys",
".",... | Returns true if the graph is valid (does not have any cycles or problems creating required
keys). If there are any errors, they will be reported to the global {@link ErrorManager}. | [
"Returns",
"true",
"if",
"the",
"graph",
"is",
"valid",
"(",
"does",
"not",
"have",
"any",
"cycles",
"or",
"problems",
"creating",
"required",
"keys",
")",
".",
"If",
"there",
"are",
"any",
"errors",
"they",
"will",
"be",
"reported",
"to",
"the",
"global... | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java#L96-L104 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/snapshot/SnapshotCreator.java | SnapshotCreator.createSnapshot | public static ProducerSnapshot createSnapshot(IStatsProducer producer, String intervalName) {
"""
Creates a snapshot for a producer.
@param producer
@param intervalName
@return
"""
ProducerSnapshot ret = new ProducerSnapshot();
ret.setCategory(producer.getCategory());
ret.setSubsystem(producer.getSubs... | java | public static ProducerSnapshot createSnapshot(IStatsProducer producer, String intervalName){
ProducerSnapshot ret = new ProducerSnapshot();
ret.setCategory(producer.getCategory());
ret.setSubsystem(producer.getSubsystem());
ret.setProducerId(producer.getProducerId());
ret.setIntervalName(intervalName);
Li... | [
"public",
"static",
"ProducerSnapshot",
"createSnapshot",
"(",
"IStatsProducer",
"producer",
",",
"String",
"intervalName",
")",
"{",
"ProducerSnapshot",
"ret",
"=",
"new",
"ProducerSnapshot",
"(",
")",
";",
"ret",
".",
"setCategory",
"(",
"producer",
".",
"getCat... | Creates a snapshot for a producer.
@param producer
@param intervalName
@return | [
"Creates",
"a",
"snapshot",
"for",
"a",
"producer",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/snapshot/SnapshotCreator.java#L22-L46 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java | FileSystemShellUtils.getFiles | public static List<File> getFiles(String inputPath) {
"""
Gets the files (on the local filesystem) that match the given input path.
If the path is a regular path, the returned list only contains the corresponding file;
Else if the path contains wildcards, the returned list contains all the matched Files.
@par... | java | public static List<File> getFiles(String inputPath) {
File file = new File(inputPath);
if (!inputPath.contains("*")) {
List<File> res = new ArrayList<>();
if (file.exists()) {
res.add(file);
}
return res;
} else {
String prefix = inputPath.substring(0, inputPath.indexOf... | [
"public",
"static",
"List",
"<",
"File",
">",
"getFiles",
"(",
"String",
"inputPath",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"inputPath",
")",
";",
"if",
"(",
"!",
"inputPath",
".",
"contains",
"(",
"\"*\"",
")",
")",
"{",
"List",
"<",
... | Gets the files (on the local filesystem) that match the given input path.
If the path is a regular path, the returned list only contains the corresponding file;
Else if the path contains wildcards, the returned list contains all the matched Files.
@param inputPath The input file path (could contain wildcards)
@return ... | [
"Gets",
"the",
"files",
"(",
"on",
"the",
"local",
"filesystem",
")",
"that",
"match",
"the",
"given",
"input",
"path",
".",
"If",
"the",
"path",
"is",
"a",
"regular",
"path",
"the",
"returned",
"list",
"only",
"contains",
"the",
"corresponding",
"file",
... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java#L171-L184 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java | InjectionBinding.mergeSavedValue | protected final <T> void mergeSavedValue(T oldValue, T newValue, String name) // d681743
throws InjectionConfigurationException {
"""
Validates that two values are identical. This helper method is intended
to be used by {@link #mergeSaved}.
@param oldValue the value in this binding
@param newValue the val... | java | protected final <T> void mergeSavedValue(T oldValue, T newValue, String name) // d681743
throws InjectionConfigurationException
{
if (oldValue == null ? newValue != null : !oldValue.equals(newValue))
{
Tr.error(tc, "INCOMPATIBLE_MERGE_ATTRIBUTES_CWNEN0072E",
getJ... | [
"protected",
"final",
"<",
"T",
">",
"void",
"mergeSavedValue",
"(",
"T",
"oldValue",
",",
"T",
"newValue",
",",
"String",
"name",
")",
"// d681743",
"throws",
"InjectionConfigurationException",
"{",
"if",
"(",
"oldValue",
"==",
"null",
"?",
"newValue",
"!=",
... | Validates that two values are identical. This helper method is intended
to be used by {@link #mergeSaved}.
@param oldValue the value in this binding
@param newValue the value from a saved binding
@param name the name for the metadata attribute; by convention, this
should be the XML element name from the deployment des... | [
"Validates",
"that",
"two",
"values",
"are",
"identical",
".",
"This",
"helper",
"method",
"is",
"intended",
"to",
"be",
"used",
"by",
"{",
"@link",
"#mergeSaved",
"}",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java#L1174-L1185 |
square/okhttp | mockwebserver/src/main/java/okhttp3/mockwebserver/MockResponse.java | MockResponse.setChunkedBody | public MockResponse setChunkedBody(Buffer body, int maxChunkSize) {
"""
Sets the response body to {@code body}, chunked every {@code maxChunkSize} bytes.
"""
removeHeader("Content-Length");
headers.add(CHUNKED_BODY_HEADER);
Buffer bytesOut = new Buffer();
while (!body.exhausted()) {
long... | java | public MockResponse setChunkedBody(Buffer body, int maxChunkSize) {
removeHeader("Content-Length");
headers.add(CHUNKED_BODY_HEADER);
Buffer bytesOut = new Buffer();
while (!body.exhausted()) {
long chunkSize = Math.min(body.size(), maxChunkSize);
bytesOut.writeHexadecimalUnsignedLong(chunk... | [
"public",
"MockResponse",
"setChunkedBody",
"(",
"Buffer",
"body",
",",
"int",
"maxChunkSize",
")",
"{",
"removeHeader",
"(",
"\"Content-Length\"",
")",
";",
"headers",
".",
"add",
"(",
"CHUNKED_BODY_HEADER",
")",
";",
"Buffer",
"bytesOut",
"=",
"new",
"Buffer",... | Sets the response body to {@code body}, chunked every {@code maxChunkSize} bytes. | [
"Sets",
"the",
"response",
"body",
"to",
"{"
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/mockwebserver/src/main/java/okhttp3/mockwebserver/MockResponse.java#L203-L219 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/update/version/Application.java | Application.reloadCache | protected void reloadCache()
throws InstallationException {
"""
Reloads the eFaps cache.
@throws InstallationException if reload of the cache failed
"""
try {
LOG.info("Reloading Cache");
Context.begin();
if (RunLevel.isInitialisable()) {
R... | java | protected void reloadCache()
throws InstallationException
{
try {
LOG.info("Reloading Cache");
Context.begin();
if (RunLevel.isInitialisable()) {
RunLevel.init("shell");
RunLevel.execute();
}
Context.commit()... | [
"protected",
"void",
"reloadCache",
"(",
")",
"throws",
"InstallationException",
"{",
"try",
"{",
"LOG",
".",
"info",
"(",
"\"Reloading Cache\"",
")",
";",
"Context",
".",
"begin",
"(",
")",
";",
"if",
"(",
"RunLevel",
".",
"isInitialisable",
"(",
")",
")"... | Reloads the eFaps cache.
@throws InstallationException if reload of the cache failed | [
"Reloads",
"the",
"eFaps",
"cache",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/update/version/Application.java#L743-L757 |
Azure/azure-sdk-for-java | features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/FeaturesInner.java | FeaturesInner.getAsync | public Observable<FeatureResultInner> getAsync(String resourceProviderNamespace, String featureName) {
"""
Gets the preview feature with the specified name.
@param resourceProviderNamespace The resource provider namespace for the feature.
@param featureName The name of the feature to get.
@throws IllegalArgum... | java | public Observable<FeatureResultInner> getAsync(String resourceProviderNamespace, String featureName) {
return getWithServiceResponseAsync(resourceProviderNamespace, featureName).map(new Func1<ServiceResponse<FeatureResultInner>, FeatureResultInner>() {
@Override
public FeatureResultInner... | [
"public",
"Observable",
"<",
"FeatureResultInner",
">",
"getAsync",
"(",
"String",
"resourceProviderNamespace",
",",
"String",
"featureName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceProviderNamespace",
",",
"featureName",
")",
".",
"map",
"(",
... | Gets the preview feature with the specified name.
@param resourceProviderNamespace The resource provider namespace for the feature.
@param featureName The name of the feature to get.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the FeatureResultInner object | [
"Gets",
"the",
"preview",
"feature",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/FeaturesInner.java#L344-L351 |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/SerializationUtilities.java | SerializationUtilities.deSerializeFromDisk | public static <T> T deSerializeFromDisk( File file, Class<T> adaptee ) throws Exception {
"""
Deserialize a file to a given object.
@param file
the file to read.
@param adaptee
the class to adapt to.
@return the object.
@throws Exception
"""
try (RandomAccessFile raf = new RandomAccessFile(file... | java | public static <T> T deSerializeFromDisk( File file, Class<T> adaptee ) throws Exception {
try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
long length = raf.length();
// System.out.println(length + "/" + (int) length);
byte[] bytes = new byte[(int) length];
... | [
"public",
"static",
"<",
"T",
">",
"T",
"deSerializeFromDisk",
"(",
"File",
"file",
",",
"Class",
"<",
"T",
">",
"adaptee",
")",
"throws",
"Exception",
"{",
"try",
"(",
"RandomAccessFile",
"raf",
"=",
"new",
"RandomAccessFile",
"(",
"file",
",",
"\"r\"",
... | Deserialize a file to a given object.
@param file
the file to read.
@param adaptee
the class to adapt to.
@return the object.
@throws Exception | [
"Deserialize",
"a",
"file",
"to",
"a",
"given",
"object",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/SerializationUtilities.java#L75-L88 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_user_userId_regeneratePassword_POST | public OvhUserDetail project_serviceName_user_userId_regeneratePassword_POST(String serviceName, Long userId) throws IOException {
"""
Regenerate user password
REST: POST /cloud/project/{serviceName}/user/{userId}/regeneratePassword
@param serviceName [required] Service name
@param userId [required] User id
... | java | public OvhUserDetail project_serviceName_user_userId_regeneratePassword_POST(String serviceName, Long userId) throws IOException {
String qPath = "/cloud/project/{serviceName}/user/{userId}/regeneratePassword";
StringBuilder sb = path(qPath, serviceName, userId);
String resp = exec(qPath, "POST", sb.toString(), n... | [
"public",
"OvhUserDetail",
"project_serviceName_user_userId_regeneratePassword_POST",
"(",
"String",
"serviceName",
",",
"Long",
"userId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/user/{userId}/regeneratePassword\"",
";",
"StringB... | Regenerate user password
REST: POST /cloud/project/{serviceName}/user/{userId}/regeneratePassword
@param serviceName [required] Service name
@param userId [required] User id | [
"Regenerate",
"user",
"password"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L418-L423 |
michel-kraemer/bson4jackson | src/main/java/de/undercouch/bson4jackson/io/StaticBuffers.java | StaticBuffers.charBuffer | public CharBuffer charBuffer(Key key, int minSize) {
"""
Creates or re-uses a {@link CharBuffer} that has a minimum size. Calling
this method multiple times with the same key will always return the
same buffer, as long as it has the minimum size and is marked to be
re-used. Buffers that are allowed to be re-use... | java | public CharBuffer charBuffer(Key key, int minSize) {
minSize = Math.max(minSize, GLOBAL_MIN_SIZE);
CharBuffer r = _charBuffers[key.ordinal()];
if (r == null || r.capacity() < minSize) {
r = CharBuffer.allocate(minSize);
} else {
_charBuffers[key.ordinal()] = null;
r.clear();
}
return r;
} | [
"public",
"CharBuffer",
"charBuffer",
"(",
"Key",
"key",
",",
"int",
"minSize",
")",
"{",
"minSize",
"=",
"Math",
".",
"max",
"(",
"minSize",
",",
"GLOBAL_MIN_SIZE",
")",
";",
"CharBuffer",
"r",
"=",
"_charBuffers",
"[",
"key",
".",
"ordinal",
"(",
")",
... | Creates or re-uses a {@link CharBuffer} that has a minimum size. Calling
this method multiple times with the same key will always return the
same buffer, as long as it has the minimum size and is marked to be
re-used. Buffers that are allowed to be re-used should be released using
{@link #releaseCharBuffer(Key, CharBuf... | [
"Creates",
"or",
"re",
"-",
"uses",
"a",
"{"
] | train | https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/io/StaticBuffers.java#L95-L106 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java | MetricQueryService.replaceInvalidChars | private static String replaceInvalidChars(String str) {
"""
Lightweight method to replace unsupported characters.
If the string does not contain any unsupported characters, this method creates no
new string (and in fact no new objects at all).
<p>Replacements:
<ul>
<li>{@code space : . ,} are replaced by ... | java | private static String replaceInvalidChars(String str) {
char[] chars = null;
final int strLen = str.length();
int pos = 0;
for (int i = 0; i < strLen; i++) {
final char c = str.charAt(i);
switch (c) {
case ' ':
case '.':
case ':':
case ',':
if (chars == null) {
chars = str.toCh... | [
"private",
"static",
"String",
"replaceInvalidChars",
"(",
"String",
"str",
")",
"{",
"char",
"[",
"]",
"chars",
"=",
"null",
";",
"final",
"int",
"strLen",
"=",
"str",
".",
"length",
"(",
")",
";",
"int",
"pos",
"=",
"0",
";",
"for",
"(",
"int",
"... | Lightweight method to replace unsupported characters.
If the string does not contain any unsupported characters, this method creates no
new string (and in fact no new objects at all).
<p>Replacements:
<ul>
<li>{@code space : . ,} are replaced by {@code _} (underscore)</li>
</ul> | [
"Lightweight",
"method",
"to",
"replace",
"unsupported",
"characters",
".",
"If",
"the",
"string",
"does",
"not",
"contain",
"any",
"unsupported",
"characters",
"this",
"method",
"creates",
"no",
"new",
"string",
"(",
"and",
"in",
"fact",
"no",
"new",
"objects... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java#L208-L234 |
offbynull/coroutines | maven-plugin/src/main/java/com/offbynull/coroutines/mavenplugin/AbstractInstrumentMojo.java | AbstractInstrumentMojo.getInstrumenter | private Instrumenter getInstrumenter(Log log, List<String> classpath) throws MojoExecutionException {
"""
Creates an {@link Instrumenter} instance.
@param log maven logger
@param classpath classpath for classes being instrumented
@return a new {@link Instrumenter}
@throws MojoExecutionException if any exceptio... | java | private Instrumenter getInstrumenter(Log log, List<String> classpath) throws MojoExecutionException {
List<File> classpathFiles;
try {
log.debug("Getting compile classpath");
classpathFiles = classpath
.stream().map(x -> new File(x)).collect(Collectors.toList(... | [
"private",
"Instrumenter",
"getInstrumenter",
"(",
"Log",
"log",
",",
"List",
"<",
"String",
">",
"classpath",
")",
"throws",
"MojoExecutionException",
"{",
"List",
"<",
"File",
">",
"classpathFiles",
";",
"try",
"{",
"log",
".",
"debug",
"(",
"\"Getting compi... | Creates an {@link Instrumenter} instance.
@param log maven logger
@param classpath classpath for classes being instrumented
@return a new {@link Instrumenter}
@throws MojoExecutionException if any exception occurs | [
"Creates",
"an",
"{"
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/maven-plugin/src/main/java/com/offbynull/coroutines/mavenplugin/AbstractInstrumentMojo.java#L76-L95 |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryFormatsSingletonSpi.java | BaseMonetaryFormatsSingletonSpi.isAvailable | public boolean isAvailable(Locale locale, String... providers) {
"""
Checks if a {@link javax.money.format.MonetaryAmountFormat} is available given a {@link javax.money.format
.AmountFormatQuery}.
@param locale the target {@link java.util.Locale}, not {@code null}.
@param providers The (optional) providers... | java | public boolean isAvailable(Locale locale, String... providers) {
return isAvailable(AmountFormatQuery.of(locale, providers));
} | [
"public",
"boolean",
"isAvailable",
"(",
"Locale",
"locale",
",",
"String",
"...",
"providers",
")",
"{",
"return",
"isAvailable",
"(",
"AmountFormatQuery",
".",
"of",
"(",
"locale",
",",
"providers",
")",
")",
";",
"}"
] | Checks if a {@link javax.money.format.MonetaryAmountFormat} is available given a {@link javax.money.format
.AmountFormatQuery}.
@param locale the target {@link java.util.Locale}, not {@code null}.
@param providers The (optional) providers to be used, ordered correspondingly.
@return true, if a t least one {@link ja... | [
"Checks",
"if",
"a",
"{",
"@link",
"javax",
".",
"money",
".",
"format",
".",
"MonetaryAmountFormat",
"}",
"is",
"available",
"given",
"a",
"{",
"@link",
"javax",
".",
"money",
".",
"format",
".",
"AmountFormatQuery",
"}",
"."
] | train | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryFormatsSingletonSpi.java#L66-L68 |
apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java | GatewayServlet.writeFailure | protected void writeFailure(final ApiRequest request, final HttpServletResponse resp, final PolicyFailure policyFailure) {
"""
Writes a policy failure to the http response.
@param request
@param resp
@param policyFailure
"""
getFailureWriter().write(request, policyFailure, new IApiClientResponse() {... | java | protected void writeFailure(final ApiRequest request, final HttpServletResponse resp, final PolicyFailure policyFailure) {
getFailureWriter().write(request, policyFailure, new IApiClientResponse() {
@Override
public void write(StringBuffer buffer) {
write(buffer.toString(... | [
"protected",
"void",
"writeFailure",
"(",
"final",
"ApiRequest",
"request",
",",
"final",
"HttpServletResponse",
"resp",
",",
"final",
"PolicyFailure",
"policyFailure",
")",
"{",
"getFailureWriter",
"(",
")",
".",
"write",
"(",
"request",
",",
"policyFailure",
","... | Writes a policy failure to the http response.
@param request
@param resp
@param policyFailure | [
"Writes",
"a",
"policy",
"failure",
"to",
"the",
"http",
"response",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java#L306-L341 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.convertNormToPixel | public static Point2D_F64 convertNormToPixel(CameraModel param , double x , double y , Point2D_F64 pixel ) {
"""
<p>
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
If speed is a concern then {@link PinholeNtoP_F64} should be used instead.
</p>
@pa... | java | public static Point2D_F64 convertNormToPixel(CameraModel param , double x , double y , Point2D_F64 pixel ) {
return ImplPerspectiveOps_F64.convertNormToPixel(param, x, y, pixel);
} | [
"public",
"static",
"Point2D_F64",
"convertNormToPixel",
"(",
"CameraModel",
"param",
",",
"double",
"x",
",",
"double",
"y",
",",
"Point2D_F64",
"pixel",
")",
"{",
"return",
"ImplPerspectiveOps_F64",
".",
"convertNormToPixel",
"(",
"param",
",",
"x",
",",
"y",
... | <p>
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
If speed is a concern then {@link PinholeNtoP_F64} should be used instead.
</p>
@param param Intrinsic camera parameters
@param x X-coordinate of normalized.
@param y Y-coordinate of normalized.
@param pixe... | [
"<p",
">",
"Convenient",
"function",
"for",
"converting",
"from",
"normalized",
"image",
"coordinates",
"to",
"the",
"original",
"image",
"pixel",
"coordinate",
".",
"If",
"speed",
"is",
"a",
"concern",
"then",
"{",
"@link",
"PinholeNtoP_F64",
"}",
"should",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L368-L370 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java | GraphHelper.getVerticesForGUIDs | public Map<String, AtlasVertex> getVerticesForGUIDs(List<String> guids) {
"""
Finds the Vertices that correspond to the given GUIDs. GUIDs
that are not found in the graph will not be in the map.
@return GUID to AtlasVertex map with the result.
"""
return getVerticesForPropertyValues(Constants.GUI... | java | public Map<String, AtlasVertex> getVerticesForGUIDs(List<String> guids) {
return getVerticesForPropertyValues(Constants.GUID_PROPERTY_KEY, guids);
} | [
"public",
"Map",
"<",
"String",
",",
"AtlasVertex",
">",
"getVerticesForGUIDs",
"(",
"List",
"<",
"String",
">",
"guids",
")",
"{",
"return",
"getVerticesForPropertyValues",
"(",
"Constants",
".",
"GUID_PROPERTY_KEY",
",",
"guids",
")",
";",
"}"
] | Finds the Vertices that correspond to the given GUIDs. GUIDs
that are not found in the graph will not be in the map.
@return GUID to AtlasVertex map with the result. | [
"Finds",
"the",
"Vertices",
"that",
"correspond",
"to",
"the",
"given",
"GUIDs",
".",
"GUIDs",
"that",
"are",
"not",
"found",
"in",
"the",
"graph",
"will",
"not",
"be",
"in",
"the",
"map",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java#L648-L651 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Expression.java | Expression.lessThanOrEqualTo | @NonNull
public Expression lessThanOrEqualTo(@NonNull Expression expression) {
"""
Create a less than or equal to expression that evaluates whether or not the current
expression is less than or equal to the given expression.
@param expression the expression to compare with the current expression.
@return ... | java | @NonNull
public Expression lessThanOrEqualTo(@NonNull Expression expression) {
if (expression == null) {
throw new IllegalArgumentException("expression cannot be null.");
}
return new BinaryExpression(this, expression, BinaryExpression.OpType.LessThanOrEqualTo);
} | [
"@",
"NonNull",
"public",
"Expression",
"lessThanOrEqualTo",
"(",
"@",
"NonNull",
"Expression",
"expression",
")",
"{",
"if",
"(",
"expression",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"expression cannot be null.\"",
")",
";",
"}... | Create a less than or equal to expression that evaluates whether or not the current
expression is less than or equal to the given expression.
@param expression the expression to compare with the current expression.
@return a less than or equal to expression. | [
"Create",
"a",
"less",
"than",
"or",
"equal",
"to",
"expression",
"that",
"evaluates",
"whether",
"or",
"not",
"the",
"current",
"expression",
"is",
"less",
"than",
"or",
"equal",
"to",
"the",
"given",
"expression",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Expression.java#L630-L636 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeWordVectors | public static void writeWordVectors(@NonNull Glove vectors, @NonNull File file) {
"""
This method saves GloVe model to the given output stream.
@param vectors GloVe model to be saved
@param file path where model should be saved to
"""
try (BufferedOutputStream fos = new BufferedOutputStream(new ... | java | public static void writeWordVectors(@NonNull Glove vectors, @NonNull File file) {
try (BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(file))) {
writeWordVectors(vectors, fos);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"void",
"writeWordVectors",
"(",
"@",
"NonNull",
"Glove",
"vectors",
",",
"@",
"NonNull",
"File",
"file",
")",
"{",
"try",
"(",
"BufferedOutputStream",
"fos",
"=",
"new",
"BufferedOutputStream",
"(",
"new",
"FileOutputStream",
"(",
"file",
... | This method saves GloVe model to the given output stream.
@param vectors GloVe model to be saved
@param file path where model should be saved to | [
"This",
"method",
"saves",
"GloVe",
"model",
"to",
"the",
"given",
"output",
"stream",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L1113-L1119 |
haifengl/smile | core/src/main/java/smile/wavelet/WaveletShrinkage.java | WaveletShrinkage.denoise | public static void denoise(double[] t, Wavelet wavelet, boolean soft) {
"""
Adaptive denoising a time series with given wavelet.
@param t the time series array. The size should be a power of 2. For time
series of size no power of 2, 0 padding can be applied.
@param wavelet the wavelet to transform the time se... | java | public static void denoise(double[] t, Wavelet wavelet, boolean soft) {
wavelet.transform(t);
int n = t.length;
int nh = t.length >> 1;
double[] wc = new double[nh];
System.arraycopy(t, nh, wc, 0, nh);
double error = Math.mad(wc) / 0.6745;
double lambda = error... | [
"public",
"static",
"void",
"denoise",
"(",
"double",
"[",
"]",
"t",
",",
"Wavelet",
"wavelet",
",",
"boolean",
"soft",
")",
"{",
"wavelet",
".",
"transform",
"(",
"t",
")",
";",
"int",
"n",
"=",
"t",
".",
"length",
";",
"int",
"nh",
"=",
"t",
".... | Adaptive denoising a time series with given wavelet.
@param t the time series array. The size should be a power of 2. For time
series of size no power of 2, 0 padding can be applied.
@param wavelet the wavelet to transform the time series.
@param soft true if apply soft thresholding. | [
"Adaptive",
"denoising",
"a",
"time",
"series",
"with",
"given",
"wavelet",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/wavelet/WaveletShrinkage.java#L68-L93 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/FastByteArrayOutputStream.java | FastByteArrayOutputStream.writeToViaString | void writeToViaString(Writer out, String encoding) throws IOException {
"""
This can <b>ONLY</b> be called if there is only a single buffer to write, instead
use {@link #writeTo(java.io.Writer, String)}, which auto detects if
{@link #writeToViaString(java.io.Writer, String)} is to be used or
{@link #writeToViaS... | java | void writeToViaString(Writer out, String encoding) throws IOException {
byte[] bufferToWrite = buffer; // this is always the last buffer to write
int bufferToWriteLen = index; // index points to our place in the last buffer
writeToImpl(out, encoding, bufferToWrite, bufferToWriteLen);
} | [
"void",
"writeToViaString",
"(",
"Writer",
"out",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bufferToWrite",
"=",
"buffer",
";",
"// this is always the last buffer to write",
"int",
"bufferToWriteLen",
"=",
"index",
";",
"// ind... | This can <b>ONLY</b> be called if there is only a single buffer to write, instead
use {@link #writeTo(java.io.Writer, String)}, which auto detects if
{@link #writeToViaString(java.io.Writer, String)} is to be used or
{@link #writeToViaSmoosh(java.io.Writer, String)}.
@param out the JspWriter
@param encoding the e... | [
"This",
"can",
"<b",
">",
"ONLY<",
"/",
"b",
">",
"be",
"called",
"if",
"there",
"is",
"only",
"a",
"single",
"buffer",
"to",
"write",
"instead",
"use",
"{",
"@link",
"#writeTo",
"(",
"java",
".",
"io",
".",
"Writer",
"String",
")",
"}",
"which",
"... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/FastByteArrayOutputStream.java#L217-L221 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java | RedisInner.importDataAsync | public Observable<Void> importDataAsync(String resourceGroupName, String name, ImportRDBParameters parameters) {
"""
Import data into Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redis import operation.
@throws... | java | public Observable<Void> importDataAsync(String resourceGroupName, String name, ImportRDBParameters parameters) {
return importDataWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> ... | [
"public",
"Observable",
"<",
"Void",
">",
"importDataAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"ImportRDBParameters",
"parameters",
")",
"{",
"return",
"importDataWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"par... | Import data into Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redis import operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Import",
"data",
"into",
"Redis",
"cache",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L1364-L1371 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java | DateFormat.get | private static DateFormat get(int dateStyle, int timeStyle, ULocale loc, Calendar cal) {
"""
Creates a DateFormat with the given time and/or date style in the given
locale.
@param dateStyle a value from 0 to 3 indicating the time format,
or -1 to indicate no date
@param timeStyle a value from 0 to 3 indicating... | java | private static DateFormat get(int dateStyle, int timeStyle, ULocale loc, Calendar cal) {
if((timeStyle != DateFormat.NONE && (timeStyle & RELATIVE)>0) ||
(dateStyle != DateFormat.NONE && (dateStyle & RELATIVE)>0)) {
RelativeDateFormat r = new RelativeDateFormat(timeStyle, dateStyle /* off... | [
"private",
"static",
"DateFormat",
"get",
"(",
"int",
"dateStyle",
",",
"int",
"timeStyle",
",",
"ULocale",
"loc",
",",
"Calendar",
"cal",
")",
"{",
"if",
"(",
"(",
"timeStyle",
"!=",
"DateFormat",
".",
"NONE",
"&&",
"(",
"timeStyle",
"&",
"RELATIVE",
")... | Creates a DateFormat with the given time and/or date style in the given
locale.
@param dateStyle a value from 0 to 3 indicating the time format,
or -1 to indicate no date
@param timeStyle a value from 0 to 3 indicating the time format,
or -1 to indicate no time
@param loc the locale for the format
@param cal the calend... | [
"Creates",
"a",
"DateFormat",
"with",
"the",
"given",
"time",
"and",
"/",
"or",
"date",
"style",
"in",
"the",
"given",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1672-L1701 |
sniffy/sniffy | sniffy-core/src/main/java/io/sniffy/LegacySpy.java | LegacySpy.expectAtMost | @Deprecated
public C expectAtMost(int allowedStatements, Threads threadMatcher) {
"""
Alias for {@link #expectBetween(int, int, Threads, Query)} with arguments 0, {@code allowedStatements}, {@code threads}, {@link Query#ANY}
@since 2.0
"""
return expect(SqlQueries.maxQueries(allowedStatements).thr... | java | @Deprecated
public C expectAtMost(int allowedStatements, Threads threadMatcher) {
return expect(SqlQueries.maxQueries(allowedStatements).threads(threadMatcher));
} | [
"@",
"Deprecated",
"public",
"C",
"expectAtMost",
"(",
"int",
"allowedStatements",
",",
"Threads",
"threadMatcher",
")",
"{",
"return",
"expect",
"(",
"SqlQueries",
".",
"maxQueries",
"(",
"allowedStatements",
")",
".",
"threads",
"(",
"threadMatcher",
")",
")",... | Alias for {@link #expectBetween(int, int, Threads, Query)} with arguments 0, {@code allowedStatements}, {@code threads}, {@link Query#ANY}
@since 2.0 | [
"Alias",
"for",
"{"
] | train | https://github.com/sniffy/sniffy/blob/7bdddb9593e6b6e9fe5c7c87519f864acbc3a5c0/sniffy-core/src/main/java/io/sniffy/LegacySpy.java#L319-L322 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/curves/DiscountCurveInterpolation.java | DiscountCurveInterpolation.createDiscountCurveFromZeroRates | public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(String name, double[] times, double[] givenZeroRates) {
"""
Create a discount curve from given times and given zero rates using default interpolation and extrapolation methods.
The discount factor is determined by
<code>
givenDiscountFact... | java | public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(String name, double[] times, double[] givenZeroRates) {
double[] givenDiscountFactors = new double[givenZeroRates.length];
for(int timeIndex=0; timeIndex<times.length;timeIndex++) {
givenDiscountFactors[timeIndex] = Math.exp(- givenZeroRa... | [
"public",
"static",
"DiscountCurveInterpolation",
"createDiscountCurveFromZeroRates",
"(",
"String",
"name",
",",
"double",
"[",
"]",
"times",
",",
"double",
"[",
"]",
"givenZeroRates",
")",
"{",
"double",
"[",
"]",
"givenDiscountFactors",
"=",
"new",
"double",
"[... | Create a discount curve from given times and given zero rates using default interpolation and extrapolation methods.
The discount factor is determined by
<code>
givenDiscountFactors[timeIndex] = Math.exp(- givenZeroRates[timeIndex] * times[timeIndex]);
</code>
@param name The name of this discount curve.
@param times ... | [
"Create",
"a",
"discount",
"curve",
"from",
"given",
"times",
"and",
"given",
"zero",
"rates",
"using",
"default",
"interpolation",
"and",
"extrapolation",
"methods",
".",
"The",
"discount",
"factor",
"is",
"determined",
"by",
"<code",
">",
"givenDiscountFactors",... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/curves/DiscountCurveInterpolation.java#L292-L300 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/Cartographer.java | Cartographer.arrayToWriter | private static void arrayToWriter(Object array, JsonWriter writer) throws IOException {
"""
Print the json representation of an array to the given writer. Primitive arrays cannot be cast
to Object[], to this method accepts the raw object and uses {@link Array#getLength(Object)} and
{@link Array#get(Object, int)}... | java | private static void arrayToWriter(Object array, JsonWriter writer) throws IOException {
writer.beginArray();
for (int i = 0, size = Array.getLength(array); i < size; i++) {
writeValue(Array.get(array, i), writer);
}
writer.endArray();
} | [
"private",
"static",
"void",
"arrayToWriter",
"(",
"Object",
"array",
",",
"JsonWriter",
"writer",
")",
"throws",
"IOException",
"{",
"writer",
".",
"beginArray",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"size",
"=",
"Array",
".",
"getLength... | Print the json representation of an array to the given writer. Primitive arrays cannot be cast
to Object[], to this method accepts the raw object and uses {@link Array#getLength(Object)} and
{@link Array#get(Object, int)} to read the array. | [
"Print",
"the",
"json",
"representation",
"of",
"an",
"array",
"to",
"the",
"given",
"writer",
".",
"Primitive",
"arrays",
"cannot",
"be",
"cast",
"to",
"Object",
"[]",
"to",
"this",
"method",
"accepts",
"the",
"raw",
"object",
"and",
"uses",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/Cartographer.java#L198-L204 |
kkopacz/agiso-core | bundles/agiso-core-lang/src/main/java/org/agiso/core/lang/util/ObjectUtils.java | ObjectUtils.equalsBuilder | public static boolean equalsBuilder(Object object1, Object object2) {
"""
Porównuje dwa obiekty wykorzystując mechamizmy refleksji. W trakcie
porównywania wykorzystuje opis dostarczany przez adnotację {@link
InEquals}. Ignoruje pola finalne oraz statyczne.
@see EqualsBuilder#reflectionEquals(Object, Object, S... | java | public static boolean equalsBuilder(Object object1, Object object2) {
Set<String> excludeFields = new HashSet<String>();
for(Field field: object1.getClass().getDeclaredFields()) {
if(field.isAnnotationPresent(InEquals.class)) {
InEquals inEquals = field.getAnnotation(InEquals.class);
if(inEquals.ignore()... | [
"public",
"static",
"boolean",
"equalsBuilder",
"(",
"Object",
"object1",
",",
"Object",
"object2",
")",
"{",
"Set",
"<",
"String",
">",
"excludeFields",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"Field",
"field",
":",
"object... | Porównuje dwa obiekty wykorzystując mechamizmy refleksji. W trakcie
porównywania wykorzystuje opis dostarczany przez adnotację {@link
InEquals}. Ignoruje pola finalne oraz statyczne.
@see EqualsBuilder#reflectionEquals(Object, Object, String[]) | [
"Porównuje",
"dwa",
"obiekty",
"wykorzystując",
"mechamizmy",
"refleksji",
".",
"W",
"trakcie",
"porównywania",
"wykorzystuje",
"opis",
"dostarczany",
"przez",
"adnotację",
"{",
"@link",
"InEquals",
"}",
".",
"Ignoruje",
"pola",
"finalne",
"oraz",
"statyczne",
"."
] | train | https://github.com/kkopacz/agiso-core/blob/b994ec0146be1fe3f10829d69cd719bdbdebe1c5/bundles/agiso-core-lang/src/main/java/org/agiso/core/lang/util/ObjectUtils.java#L89-L100 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java | ImageClient.insertImage | @BetaApi
public final Operation insertImage(Boolean forceCreate, String project, Image imageResource) {
"""
Creates an image in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (ImageClient imageClient = ImageClient.create()) {
Boolean forceCreate = false;
Pr... | java | @BetaApi
public final Operation insertImage(Boolean forceCreate, String project, Image imageResource) {
InsertImageHttpRequest request =
InsertImageHttpRequest.newBuilder()
.setForceCreate(forceCreate)
.setProject(project)
.setImageResource(imageResource)
.... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertImage",
"(",
"Boolean",
"forceCreate",
",",
"String",
"project",
",",
"Image",
"imageResource",
")",
"{",
"InsertImageHttpRequest",
"request",
"=",
"InsertImageHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"... | Creates an image in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (ImageClient imageClient = ImageClient.create()) {
Boolean forceCreate = false;
ProjectName project = ProjectName.of("[PROJECT]");
Image imageResource = Image.newBuilder().build();
Operation response = im... | [
"Creates",
"an",
"image",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java#L715-L725 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/PriorityQueue.java | PriorityQueue.put | public final void put(long priority, Object value) {
"""
Insert data with the given priority into the heap and heapify.
@param priority the priority to associate with the new data.
@param value the date to enqueue.
"""
// if (tc.isEntryEnabled())
// SibTr.entry(tc, "put", new Object[] { new Long(pr... | java | public final void put(long priority, Object value)
{
// if (tc.isEntryEnabled())
// SibTr.entry(tc, "put", new Object[] { new Long(priority), value});
PriorityQueueNode node = new PriorityQueueNode(priority,value);
// Resize the array (double it) if we are out of space.
if (size == elements.leng... | [
"public",
"final",
"void",
"put",
"(",
"long",
"priority",
",",
"Object",
"value",
")",
"{",
"// if (tc.isEntryEnabled())",
"// SibTr.entry(tc, \"put\", new Object[] { new Long(priority), value});",
"PriorityQueueNode",
"node",
"=",
"new",
"PriorityQueueNode",
"(",
"p... | Insert data with the given priority into the heap and heapify.
@param priority the priority to associate with the new data.
@param value the date to enqueue. | [
"Insert",
"data",
"with",
"the",
"given",
"priority",
"into",
"the",
"heap",
"and",
"heapify",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/PriorityQueue.java#L155-L177 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryServiceImpl.java | UserRegistryServiceImpl.autoDetectUserRegistry | private UserRegistry autoDetectUserRegistry(boolean exceptionOnError) throws RegistryException {
"""
When a configuration element is not defined, use some "auto-detect"
logic to try and return the single UserRegistry. If there is no
service, or multiple services, that is considered an error case which
"auto-det... | java | private UserRegistry autoDetectUserRegistry(boolean exceptionOnError) throws RegistryException {
// Determine if there is a federation registry configured.
UserRegistry ur = getFederationRegistry(exceptionOnError);
synchronized (userRegistrySync) {
if (ur != null) {
s... | [
"private",
"UserRegistry",
"autoDetectUserRegistry",
"(",
"boolean",
"exceptionOnError",
")",
"throws",
"RegistryException",
"{",
"// Determine if there is a federation registry configured.",
"UserRegistry",
"ur",
"=",
"getFederationRegistry",
"(",
"exceptionOnError",
")",
";",
... | When a configuration element is not defined, use some "auto-detect"
logic to try and return the single UserRegistry. If there is no
service, or multiple services, that is considered an error case which
"auto-detect" can not resolve.
@return
@throws RegistryException | [
"When",
"a",
"configuration",
"element",
"is",
"not",
"defined",
"use",
"some",
"auto",
"-",
"detect",
"logic",
"to",
"try",
"and",
"return",
"the",
"single",
"UserRegistry",
".",
"If",
"there",
"is",
"no",
"service",
"or",
"multiple",
"services",
"that",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryServiceImpl.java#L391-L429 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/spacefillingcurves/ZCurveSpatialSorter.java | ZCurveSpatialSorter.getMinPlusMaxObject | private static double getMinPlusMaxObject(List<? extends SpatialComparable> objs, int s, int dim) {
"""
Compute getMin(dim) + getMax(dim) for the spatial object.
@param objs Objects
@param s index
@param dim Dimensionality
@return Min+Max
"""
SpatialComparable sobj = objs.get(s);
return sobj.getM... | java | private static double getMinPlusMaxObject(List<? extends SpatialComparable> objs, int s, int dim) {
SpatialComparable sobj = objs.get(s);
return sobj.getMin(dim) + sobj.getMax(dim);
} | [
"private",
"static",
"double",
"getMinPlusMaxObject",
"(",
"List",
"<",
"?",
"extends",
"SpatialComparable",
">",
"objs",
",",
"int",
"s",
",",
"int",
"dim",
")",
"{",
"SpatialComparable",
"sobj",
"=",
"objs",
".",
"get",
"(",
"s",
")",
";",
"return",
"s... | Compute getMin(dim) + getMax(dim) for the spatial object.
@param objs Objects
@param s index
@param dim Dimensionality
@return Min+Max | [
"Compute",
"getMin",
"(",
"dim",
")",
"+",
"getMax",
"(",
"dim",
")",
"for",
"the",
"spatial",
"object",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/spacefillingcurves/ZCurveSpatialSorter.java#L166-L169 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.getByResourceGroupAsync | public Observable<NetworkInterfaceInner> getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName) {
"""
Gets information about the specified network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@throws ... | java | public Observable<NetworkInterfaceInner> getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1<ServiceResponse<NetworkInterfaceInner>, NetworkInterfaceInner>() {
@Overr... | [
"public",
"Observable",
"<",
"NetworkInterfaceInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkInterfaceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkInterfaceNam... | Gets information about the specified network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the NetworkInterfaceInner object | [
"Gets",
"information",
"about",
"the",
"specified",
"network",
"interface",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L351-L358 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java | StringUtil.getHexString | public static String getHexString( byte[] bytes ) {
"""
Get the hexadecimal string representation of the supplied byte array.
@param bytes the byte array
@return the hex string representation of the byte array; never null
"""
try {
byte[] hex = new byte[2 * bytes.length];
in... | java | public static String getHexString( byte[] bytes ) {
try {
byte[] hex = new byte[2 * bytes.length];
int index = 0;
for (byte b : bytes) {
int v = b & 0xFF;
hex[index++] = HEX_CHAR_TABLE[v >>> 4];
hex[index++] = HEX_CHAR_TABLE[v ... | [
"public",
"static",
"String",
"getHexString",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"hex",
"=",
"new",
"byte",
"[",
"2",
"*",
"bytes",
".",
"length",
"]",
";",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"byte",
... | Get the hexadecimal string representation of the supplied byte array.
@param bytes the byte array
@return the hex string representation of the byte array; never null | [
"Get",
"the",
"hexadecimal",
"string",
"representation",
"of",
"the",
"supplied",
"byte",
"array",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L530-L545 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/servlet/filters/RequestSecurityFilter.java | RequestSecurityFilter.createRequestContext | protected RequestContext createRequestContext(HttpServletRequest request, HttpServletResponse response) {
"""
Returns a new {@link RequestContext}, using the specified {@link HttpServletRequest} and {@link
HttpServletResponse}.
"""
return new RequestContext(request, response, getServletContext());
... | java | protected RequestContext createRequestContext(HttpServletRequest request, HttpServletResponse response) {
return new RequestContext(request, response, getServletContext());
} | [
"protected",
"RequestContext",
"createRequestContext",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"return",
"new",
"RequestContext",
"(",
"request",
",",
"response",
",",
"getServletContext",
"(",
")",
")",
";",
"}"
] | Returns a new {@link RequestContext}, using the specified {@link HttpServletRequest} and {@link
HttpServletResponse}. | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/servlet/filters/RequestSecurityFilter.java#L181-L183 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java | FDBigInteger.multBy10 | public FDBigInteger multBy10() {
"""
/*@
@ requires this.value() == 0;
@ assignable \nothing;
@ ensures \result == this;
@
@ also
@
@ requires this.value() > 0 && this.isImmutable;
@ assignable \nothing;
@ ensures \result.value() == \old(this.value() * 10);
@
@ also
@
@ requires this.value() > 0 && ... | java | public FDBigInteger multBy10() {
if (nWords == 0) {
return this;
}
if (isImmutable) {
int[] res = new int[nWords + 1];
res[nWords] = multAndCarryBy10(data, nWords, res);
return new FDBigInteger(res, offset);
} else {
int p = mul... | [
"public",
"FDBigInteger",
"multBy10",
"(",
")",
"{",
"if",
"(",
"nWords",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"isImmutable",
")",
"{",
"int",
"[",
"]",
"res",
"=",
"new",
"int",
"[",
"nWords",
"+",
"1",
"]",
";",
"res",
... | /*@
@ requires this.value() == 0;
@ assignable \nothing;
@ ensures \result == this;
@
@ also
@
@ requires this.value() > 0 && this.isImmutable;
@ assignable \nothing;
@ ensures \result.value() == \old(this.value() * 10);
@
@ also
@
@ requires this.value() > 0 && !this.isImmutable;
@ assignable this.nWords, this.data,... | [
"/",
"*"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java#L653-L678 |
ops4j/org.ops4j.pax.swissbox | pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java | ServiceLookup.getService | public static <T> T getService( BundleContext bc, Class<T> type ) {
"""
Returns a service matching the given criteria.
@param <T> class implemented or extended by the service
@param bc bundle context for accessing the OSGi registry
@param type class implemented or extended by the service
@return matching ser... | java | public static <T> T getService( BundleContext bc, Class<T> type )
{
return getService( bc, type, DEFAULT_TIMEOUT );
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getService",
"(",
"BundleContext",
"bc",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"getService",
"(",
"bc",
",",
"type",
",",
"DEFAULT_TIMEOUT",
")",
";",
"}"
] | Returns a service matching the given criteria.
@param <T> class implemented or extended by the service
@param bc bundle context for accessing the OSGi registry
@param type class implemented or extended by the service
@return matching service (not null)
@throws ServiceLookupException when no matching service has been f... | [
"Returns",
"a",
"service",
"matching",
"the",
"given",
"criteria",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java#L70-L73 |
apache/flink | flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java | Utils.require | static void require(boolean condition, String message, Object... values) {
"""
Validates a condition, throwing a RuntimeException if the condition is violated.
@param condition The condition.
@param message The message for the runtime exception, with format variables as defined by
{@link String#format(String,... | java | static void require(boolean condition, String message, Object... values) {
if (!condition) {
throw new RuntimeException(String.format(message, values));
}
} | [
"static",
"void",
"require",
"(",
"boolean",
"condition",
",",
"String",
"message",
",",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"String",
".",
"format",
"(",
"message",
",",
"v... | Validates a condition, throwing a RuntimeException if the condition is violated.
@param condition The condition.
@param message The message for the runtime exception, with format variables as defined by
{@link String#format(String, Object...)}.
@param values The format arguments. | [
"Validates",
"a",
"condition",
"throwing",
"a",
"RuntimeException",
"if",
"the",
"condition",
"is",
"violated",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java#L589-L593 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/StringUtils.java | StringUtils.substituteValueInExpression | public static String substituteValueInExpression(String expression, String newValue) {
"""
Substitutes a default value in expression by a new one
@param expression to check
@param newValue to substitute
@return resulting expression
"""
ExpressionTemplate t = new ExpressionTemplate(expression);
i... | java | public static String substituteValueInExpression(String expression, String newValue)
{
ExpressionTemplate t = new ExpressionTemplate(expression);
if (newValue != null && (getExpressionKey(t.getTemplate()) == null ||
(t.isComplex() && !newValue.equals(t.getValue()))))
return newValue... | [
"public",
"static",
"String",
"substituteValueInExpression",
"(",
"String",
"expression",
",",
"String",
"newValue",
")",
"{",
"ExpressionTemplate",
"t",
"=",
"new",
"ExpressionTemplate",
"(",
"expression",
")",
";",
"if",
"(",
"newValue",
"!=",
"null",
"&&",
"(... | Substitutes a default value in expression by a new one
@param expression to check
@param newValue to substitute
@return resulting expression | [
"Substitutes",
"a",
"default",
"value",
"in",
"expression",
"by",
"a",
"new",
"one"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/StringUtils.java#L73-L93 |
tootedom/related | app/domain/src/main/java/org/greencheek/related/elastic/http/ahc/AHCFactory.java | AHCFactory.createClient | public static AsyncHttpClient createClient(Configuration configuration, int numberOfHostsBeingConnectedTo) {
"""
Creates a AsyncHttpClient object that can be used for talking to elasticsearch
@param configuration The configuration object containing properties for configuring the http connections
@param numberO... | java | public static AsyncHttpClient createClient(Configuration configuration, int numberOfHostsBeingConnectedTo) {
AsyncHttpClientConfig.Builder cf = createClientConfig(configuration);
// A Bug exists in the AsyncConnection library that leak permits on a
// Connection exception (i.e. when host not l... | [
"public",
"static",
"AsyncHttpClient",
"createClient",
"(",
"Configuration",
"configuration",
",",
"int",
"numberOfHostsBeingConnectedTo",
")",
"{",
"AsyncHttpClientConfig",
".",
"Builder",
"cf",
"=",
"createClientConfig",
"(",
"configuration",
")",
";",
"// A Bug exists ... | Creates a AsyncHttpClient object that can be used for talking to elasticsearch
@param configuration The configuration object containing properties for configuring the http connections
@param numberOfHostsBeingConnectedTo the number of hosts that are currently known about in the es cluster
@return | [
"Creates",
"a",
"AsyncHttpClient",
"object",
"that",
"can",
"be",
"used",
"for",
"talking",
"to",
"elasticsearch"
] | train | https://github.com/tootedom/related/blob/3782dd5a839bbcdc15661d598e8b895aae8aabb7/app/domain/src/main/java/org/greencheek/related/elastic/http/ahc/AHCFactory.java#L30-L46 |
infinispan/infinispan | extended-statistics/src/main/java/org/infinispan/stats/topK/StreamSummaryContainer.java | StreamSummaryContainer.addLockInformation | public void addLockInformation(Object key, boolean contention, boolean failLock) {
"""
Adds the lock information about the key, namely if the key suffer some contention and if the keys was locked or
not.
@param contention {@code true} if the key was contented.
@param failLock {@code true} if the key was not... | java | public void addLockInformation(Object key, boolean contention, boolean failLock) {
if (!isEnabled()) {
return;
}
syncOffer(Stat.MOST_LOCKED_KEYS, key);
if (contention) {
syncOffer(Stat.MOST_CONTENDED_KEYS, key);
}
if (failLock) {
syncOffer(Stat.MOST_FAILE... | [
"public",
"void",
"addLockInformation",
"(",
"Object",
"key",
",",
"boolean",
"contention",
",",
"boolean",
"failLock",
")",
"{",
"if",
"(",
"!",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"syncOffer",
"(",
"Stat",
".",
"MOST_LOCKED_KEYS",
",",
... | Adds the lock information about the key, namely if the key suffer some contention and if the keys was locked or
not.
@param contention {@code true} if the key was contented.
@param failLock {@code true} if the key was not locked. | [
"Adds",
"the",
"lock",
"information",
"about",
"the",
"key",
"namely",
"if",
"the",
"key",
"suffer",
"some",
"contention",
"and",
"if",
"the",
"keys",
"was",
"locked",
"or",
"not",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/extended-statistics/src/main/java/org/infinispan/stats/topK/StreamSummaryContainer.java#L129-L142 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java | CPSpecificationOptionPersistenceImpl.findAll | @Override
public List<CPSpecificationOption> findAll(int start, int end) {
"""
Returns a range of all the cp specification options.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the... | java | @Override
public List<CPSpecificationOption> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPSpecificationOption",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp specification options.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <c... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"specification",
"options",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java#L3495-L3498 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Invariants.java | Invariants.checkInvariantL | public static long checkInvariantL(
final long value,
final LongPredicate predicate,
final LongFunction<String> describer) {
"""
A {@code long} specialized version of {@link #checkInvariant(Object,
Predicate, Function)}
@param value The value
@param predicate The predicate
@param describer Th... | java | public static long checkInvariantL(
final long value,
final LongPredicate predicate,
final LongFunction<String> describer)
{
final boolean ok;
try {
ok = predicate.test(value);
} catch (final Throwable e) {
final Violations violations = singleViolation(failedPredicate(e));
th... | [
"public",
"static",
"long",
"checkInvariantL",
"(",
"final",
"long",
"value",
",",
"final",
"LongPredicate",
"predicate",
",",
"final",
"LongFunction",
"<",
"String",
">",
"describer",
")",
"{",
"final",
"boolean",
"ok",
";",
"try",
"{",
"ok",
"=",
"predicat... | A {@code long} specialized version of {@link #checkInvariant(Object,
Predicate, Function)}
@param value The value
@param predicate The predicate
@param describer The describer of the predicate
@return value
@throws InvariantViolationException If the predicate is false | [
"A",
"{",
"@code",
"long",
"}",
"specialized",
"version",
"of",
"{",
"@link",
"#checkInvariant",
"(",
"Object",
"Predicate",
"Function",
")",
"}"
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Invariants.java#L450-L465 |
wisdom-framework/wisdom | framework/default-error-handler/src/main/java/org/wisdom/error/InterestingLines.java | InterestingLines.extractInterestedLines | public static InterestingLines extractInterestedLines(String source, int line, int border, Logger logger) {
"""
Extracts interesting lines to be displayed to the user.
@param source the source
@param line the line responsible of the error
@param border number of lines to use as a border
@param logger the l... | java | public static InterestingLines extractInterestedLines(String source, int line, int border, Logger logger) {
try {
if (source == null) {
return null;
}
String[] lines = source.split("\n");
int firstLine = Math.max(0, line - border);
int ... | [
"public",
"static",
"InterestingLines",
"extractInterestedLines",
"(",
"String",
"source",
",",
"int",
"line",
",",
"int",
"border",
",",
"Logger",
"logger",
")",
"{",
"try",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"... | Extracts interesting lines to be displayed to the user.
@param source the source
@param line the line responsible of the error
@param border number of lines to use as a border
@param logger the logger to use to report errors
@return the interested line structure | [
"Extracts",
"interesting",
"lines",
"to",
"be",
"displayed",
"to",
"the",
"user",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/default-error-handler/src/main/java/org/wisdom/error/InterestingLines.java#L71-L86 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ServerDnsAliasesInner.java | ServerDnsAliasesInner.beginAcquire | public void beginAcquire(String resourceGroupName, String serverName, String dnsAliasName) {
"""
Acquires server DNS alias from another server.
@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... | java | public void beginAcquire(String resourceGroupName, String serverName, String dnsAliasName) {
beginAcquireWithServiceResponseAsync(resourceGroupName, serverName, dnsAliasName).toBlocking().single().body();
} | [
"public",
"void",
"beginAcquire",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"dnsAliasName",
")",
"{",
"beginAcquireWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"dnsAliasName",
")",
".",
"toBlocking",
... | Acquires server DNS alias from another server.
@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 that the alias is pointing to.
@param dnsAliasName The name of the ser... | [
"Acquires",
"server",
"DNS",
"alias",
"from",
"another",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ServerDnsAliasesInner.java#L827-L829 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java | base_resource.get_resource | protected base_resource get_resource(nitro_service service,options option) throws Exception {
"""
Use this method to perform a get operation on netscaler resource.
@param service nitro_service object.
@param option options class object.
@return Array of nitro resources of specified type.
@throws Exception Nitr... | java | protected base_resource get_resource(nitro_service service,options option) throws Exception
{
if (!service.isLogin())
service.login();
base_resource[] response = get_request(service, option);
if (response != null) {
return response[0];
}
return null;
} | [
"protected",
"base_resource",
"get_resource",
"(",
"nitro_service",
"service",
",",
"options",
"option",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"service",
".",
"isLogin",
"(",
")",
")",
"service",
".",
"login",
"(",
")",
";",
"base_resource",
"[",
... | Use this method to perform a get operation on netscaler resource.
@param service nitro_service object.
@param option options class object.
@return Array of nitro resources of specified type.
@throws Exception Nitro exception is thrown. | [
"Use",
"this",
"method",
"to",
"perform",
"a",
"get",
"operation",
"on",
"netscaler",
"resource",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java#L266-L276 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.relativeQuadTo | public SVGPath relativeQuadTo(double c1x, double c1y, double x, double y) {
"""
Quadratic Bezier line to the given relative coordinates.
@param c1x first control point x
@param c1y first control point y
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax.
"""
re... | java | public SVGPath relativeQuadTo(double c1x, double c1y, double x, double y) {
return append(PATH_QUAD_TO_RELATIVE).append(c1x).append(c1y).append(x).append(y);
} | [
"public",
"SVGPath",
"relativeQuadTo",
"(",
"double",
"c1x",
",",
"double",
"c1y",
",",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"append",
"(",
"PATH_QUAD_TO_RELATIVE",
")",
".",
"append",
"(",
"c1x",
")",
".",
"append",
"(",
"c1y",
")",
... | Quadratic Bezier line to the given relative coordinates.
@param c1x first control point x
@param c1y first control point y
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax. | [
"Quadratic",
"Bezier",
"line",
"to",
"the",
"given",
"relative",
"coordinates",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L481-L483 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/TargetsApi.java | TargetsApi.addRecentTarget | public void addRecentTarget(Target target, String media, long timestamp) throws WorkspaceApiException {
"""
Add a target that the agent recently used.
@param target The target to add.
@param media The media channel the where the target was recently used.
@param timestamp The timestamp for when the target was us... | java | public void addRecentTarget(Target target, String media, long timestamp) throws WorkspaceApiException {
try {
TargetsrecentsaddData data = new TargetsrecentsaddData();
data.setTarget(toInformation(target));
RecentData recentData = new RecentData();
recentData... | [
"public",
"void",
"addRecentTarget",
"(",
"Target",
"target",
",",
"String",
"media",
",",
"long",
"timestamp",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"TargetsrecentsaddData",
"data",
"=",
"new",
"TargetsrecentsaddData",
"(",
")",
";",
"data",
... | Add a target that the agent recently used.
@param target The target to add.
@param media The media channel the where the target was recently used.
@param timestamp The timestamp for when the target was used. This value should be a number representing the milliseconds elapsed since the UNIX epoch. (optional) | [
"Add",
"a",
"target",
"that",
"the",
"agent",
"recently",
"used",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/TargetsApi.java#L111-L127 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.