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 |
|---|---|---|---|---|---|---|---|---|---|---|
jhy/jsoup | src/main/java/org/jsoup/parser/Tag.java | Tag.valueOf | public static Tag valueOf(String tagName, ParseSettings settings) {
"""
Get a Tag by name. If not previously defined (unknown), returns a new generic tag, that can do anything.
<p>
Pre-defined tags (P, DIV etc) will be ==, but unknown tags are not registered and will only .equals().
</p>
@param tagName Name ... | java | public static Tag valueOf(String tagName, ParseSettings settings) {
Validate.notNull(tagName);
Tag tag = tags.get(tagName);
if (tag == null) {
tagName = settings.normalizeTag(tagName);
Validate.notEmpty(tagName);
tag = tags.get(tagName);
if (tag ... | [
"public",
"static",
"Tag",
"valueOf",
"(",
"String",
"tagName",
",",
"ParseSettings",
"settings",
")",
"{",
"Validate",
".",
"notNull",
"(",
"tagName",
")",
";",
"Tag",
"tag",
"=",
"tags",
".",
"get",
"(",
"tagName",
")",
";",
"if",
"(",
"tag",
"==",
... | Get a Tag by name. If not previously defined (unknown), returns a new generic tag, that can do anything.
<p>
Pre-defined tags (P, DIV etc) will be ==, but unknown tags are not registered and will only .equals().
</p>
@param tagName Name of tag, e.g. "p". Case insensitive.
@param settings used to control tag name sensi... | [
"Get",
"a",
"Tag",
"by",
"name",
".",
"If",
"not",
"previously",
"defined",
"(",
"unknown",
")",
"returns",
"a",
"new",
"generic",
"tag",
"that",
"can",
"do",
"anything",
".",
"<p",
">",
"Pre",
"-",
"defined",
"tags",
"(",
"P",
"DIV",
"etc",
")",
"... | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/parser/Tag.java#L60-L76 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/expressions/Expressions.java | Expressions.isEqual | public static StringIsEqual isEqual(StringExpression left, Object constant) {
"""
Creates an IsEqual expression from the given expression and constant.
@param left The left expression.
@param constant The constant to compare to (must be a String).
@throws IllegalArgumentException If constant is not a String.... | java | public static StringIsEqual isEqual(StringExpression left, Object constant) {
if (!(constant instanceof String))
throw new IllegalArgumentException("constant is not a String");
return new StringIsEqual(left, constant((String)constant));
} | [
"public",
"static",
"StringIsEqual",
"isEqual",
"(",
"StringExpression",
"left",
",",
"Object",
"constant",
")",
"{",
"if",
"(",
"!",
"(",
"constant",
"instanceof",
"String",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"constant is not a String\"",
... | Creates an IsEqual expression from the given expression and constant.
@param left The left expression.
@param constant The constant to compare to (must be a String).
@throws IllegalArgumentException If constant is not a String.
@return A new IsEqual binary expression. | [
"Creates",
"an",
"IsEqual",
"expression",
"from",
"the",
"given",
"expression",
"and",
"constant",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L226-L232 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.groupingBy | @SuppressWarnings("unchecked")
public <K, D, M extends Map<K, D>> M groupingBy(Function<? super T, ? extends K> classifier,
Supplier<M> mapFactory, Collector<? super T, ?, D> downstream) {
"""
Returns a {@code Map} whose keys are the values resulting from applying
the classification function to th... | java | @SuppressWarnings("unchecked")
public <K, D, M extends Map<K, D>> M groupingBy(Function<? super T, ? extends K> classifier,
Supplier<M> mapFactory, Collector<? super T, ?, D> downstream) {
if (isParallel() && downstream.characteristics().contains(Characteristics.UNORDERED)
&& mapFact... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"K",
",",
"D",
",",
"M",
"extends",
"Map",
"<",
"K",
",",
"D",
">",
">",
"M",
"groupingBy",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
"classifier",
","... | Returns a {@code Map} whose keys are the values resulting from applying
the classification function to the input elements, and whose
corresponding values are the result of reduction of the input elements
which map to the associated key under the classification function.
<p>
The {@code Map} will be created using the pr... | [
"Returns",
"a",
"{",
"@code",
"Map",
"}",
"whose",
"keys",
"are",
"the",
"values",
"resulting",
"from",
"applying",
"the",
"classification",
"function",
"to",
"the",
"input",
"elements",
"and",
"whose",
"corresponding",
"values",
"are",
"the",
"result",
"of",
... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L566-L574 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/maxsat/encodings/Encoding.java | Encoding.addQuaternaryClause | void addQuaternaryClause(final MiniSatStyleSolver s, int a, int b, int c, int d) {
"""
Adds a quaterary clause to the given SAT solver.
@param s the sat solver
@param a the first literal
@param b the second literal
@param c the third literal
@param d the fourth literal
"""
this.addQuaternaryClause(s, ... | java | void addQuaternaryClause(final MiniSatStyleSolver s, int a, int b, int c, int d) {
this.addQuaternaryClause(s, a, b, c, d, LIT_UNDEF);
} | [
"void",
"addQuaternaryClause",
"(",
"final",
"MiniSatStyleSolver",
"s",
",",
"int",
"a",
",",
"int",
"b",
",",
"int",
"c",
",",
"int",
"d",
")",
"{",
"this",
".",
"addQuaternaryClause",
"(",
"s",
",",
"a",
",",
"b",
",",
"c",
",",
"d",
",",
"LIT_UN... | Adds a quaterary clause to the given SAT solver.
@param s the sat solver
@param a the first literal
@param b the second literal
@param c the third literal
@param d the fourth literal | [
"Adds",
"a",
"quaterary",
"clause",
"to",
"the",
"given",
"SAT",
"solver",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/maxsat/encodings/Encoding.java#L170-L172 |
deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java | ArrowSerde.addTypeTypeRelativeToNDArray | public static void addTypeTypeRelativeToNDArray(FlatBufferBuilder bufferBuilder,INDArray arr) {
"""
Convert the given {@link INDArray}
data type to the proper data type for the tensor.
@param bufferBuilder the buffer builder in use
@param arr the array to conver tthe data type for
"""
switch(arr.da... | java | public static void addTypeTypeRelativeToNDArray(FlatBufferBuilder bufferBuilder,INDArray arr) {
switch(arr.data().dataType()) {
case LONG:
case INT:
Tensor.addTypeType(bufferBuilder,Type.Int);
break;
case FLOAT:
Tensor.addTypeTy... | [
"public",
"static",
"void",
"addTypeTypeRelativeToNDArray",
"(",
"FlatBufferBuilder",
"bufferBuilder",
",",
"INDArray",
"arr",
")",
"{",
"switch",
"(",
"arr",
".",
"data",
"(",
")",
".",
"dataType",
"(",
")",
")",
"{",
"case",
"LONG",
":",
"case",
"INT",
"... | Convert the given {@link INDArray}
data type to the proper data type for the tensor.
@param bufferBuilder the buffer builder in use
@param arr the array to conver tthe data type for | [
"Convert",
"the",
"given",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java#L118-L131 |
mozilla/rhino | src/org/mozilla/javascript/Parser.java | Parser.propertyName | private AstNode propertyName(int atPos, String s, int memberTypeFlags)
throws IOException {
"""
Check if :: follows name in which case it becomes a qualified name.
@param atPos a natural number if we just read an '@' token, else -1
@param s the name or string that was matched (an identifier, "throw" ... | java | private AstNode propertyName(int atPos, String s, int memberTypeFlags)
throws IOException
{
int pos = atPos != -1 ? atPos : ts.tokenBeg, lineno = ts.lineno;
int colonPos = -1;
Name name = createNameNode(true, currentToken);
Name ns = null;
if (matchToken(Token.COLONC... | [
"private",
"AstNode",
"propertyName",
"(",
"int",
"atPos",
",",
"String",
"s",
",",
"int",
"memberTypeFlags",
")",
"throws",
"IOException",
"{",
"int",
"pos",
"=",
"atPos",
"!=",
"-",
"1",
"?",
"atPos",
":",
"ts",
".",
"tokenBeg",
",",
"lineno",
"=",
"... | Check if :: follows name in which case it becomes a qualified name.
@param atPos a natural number if we just read an '@' token, else -1
@param s the name or string that was matched (an identifier, "throw" or
"*").
@param memberTypeFlags flags tracking whether we're a '.' or '..' child
@return an XmlRef node if it's... | [
"Check",
"if",
"::",
"follows",
"name",
"in",
"which",
"case",
"it",
"becomes",
"a",
"qualified",
"name",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Parser.java#L3016-L3061 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/util/xml/ObjectTreeParser.java | ObjectTreeParser.parseOnto | public Object parseOnto(String ref, Object target) throws SlickXMLException {
"""
Parse the XML document located by the slick resource loader using the
reference given.
@param ref The reference to the XML document
@param target The top level object that represents the root node
@return The root element of th... | java | public Object parseOnto(String ref, Object target) throws SlickXMLException {
return parseOnto(ref, ResourceLoader.getResourceAsStream(ref), target);
} | [
"public",
"Object",
"parseOnto",
"(",
"String",
"ref",
",",
"Object",
"target",
")",
"throws",
"SlickXMLException",
"{",
"return",
"parseOnto",
"(",
"ref",
",",
"ResourceLoader",
".",
"getResourceAsStream",
"(",
"ref",
")",
",",
"target",
")",
";",
"}"
] | Parse the XML document located by the slick resource loader using the
reference given.
@param ref The reference to the XML document
@param target The top level object that represents the root node
@return The root element of the newly parse document
@throws SlickXMLException Indicates a failure to parse the XML, most ... | [
"Parse",
"the",
"XML",
"document",
"located",
"by",
"the",
"slick",
"resource",
"loader",
"using",
"the",
"reference",
"given",
"."
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/util/xml/ObjectTreeParser.java#L153-L155 |
aaberg/sql2o | core/src/main/java/org/sql2o/Sql2o.java | Sql2o.createQuery | @Deprecated
public Query createQuery(String query) {
"""
Creates a {@link Query}
@param query the sql query string
@return the {@link Query} instance
@deprecated create queries with {@link org.sql2o.Connection} class instead, using try-with-resource blocks
<code>
try (Connection con = sql2o.open()) {
r... | java | @Deprecated
public Query createQuery(String query){
Connection connection = new Connection(this, true);
return connection.createQuery(query);
} | [
"@",
"Deprecated",
"public",
"Query",
"createQuery",
"(",
"String",
"query",
")",
"{",
"Connection",
"connection",
"=",
"new",
"Connection",
"(",
"this",
",",
"true",
")",
";",
"return",
"connection",
".",
"createQuery",
"(",
"query",
")",
";",
"}"
] | Creates a {@link Query}
@param query the sql query string
@return the {@link Query} instance
@deprecated create queries with {@link org.sql2o.Connection} class instead, using try-with-resource blocks
<code>
try (Connection con = sql2o.open()) {
return sql2o.createQuery(query, name).executeAndFetch(Pojo.class);
}
</cod... | [
"Creates",
"a",
"{",
"@link",
"Query",
"}",
"@param",
"query",
"the",
"sql",
"query",
"string",
"@return",
"the",
"{",
"@link",
"Query",
"}",
"instance"
] | train | https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/Sql2o.java#L184-L189 |
apiman/apiman | manager/api/core/src/main/java/io/apiman/manager/api/core/plugin/AbstractPluginRegistry.java | AbstractPluginRegistry.downloadPlugin | protected void downloadPlugin(File pluginFile, PluginCoordinates coordinates) {
"""
Downloads the plugin via its maven GAV information. This will first look in the local
.m2 directory. If the plugin is not found there, then it will try to download the
plugin from one of the configured remote maven repositories... | java | protected void downloadPlugin(File pluginFile, PluginCoordinates coordinates) {
// First check the .m2 directory
File m2Dir = PluginUtils.getUserM2Repository();
if (m2Dir != null) {
File artifactFile = PluginUtils.getM2Path(m2Dir, coordinates);
if (artifactFile.isFile()) ... | [
"protected",
"void",
"downloadPlugin",
"(",
"File",
"pluginFile",
",",
"PluginCoordinates",
"coordinates",
")",
"{",
"// First check the .m2 directory",
"File",
"m2Dir",
"=",
"PluginUtils",
".",
"getUserM2Repository",
"(",
")",
";",
"if",
"(",
"m2Dir",
"!=",
"null",... | Downloads the plugin via its maven GAV information. This will first look in the local
.m2 directory. If the plugin is not found there, then it will try to download the
plugin from one of the configured remote maven repositories. | [
"Downloads",
"the",
"plugin",
"via",
"its",
"maven",
"GAV",
"information",
".",
"This",
"will",
"first",
"look",
"in",
"the",
"local",
".",
"m2",
"directory",
".",
"If",
"the",
"plugin",
"is",
"not",
"found",
"there",
"then",
"it",
"will",
"try",
"to",
... | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/core/src/main/java/io/apiman/manager/api/core/plugin/AbstractPluginRegistry.java#L149-L172 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java | XmlSchemaParser.getAttributeValue | public static String getAttributeValue(final Node elementNode, final String attrName, final String defValue) {
"""
Helper function that uses a default value when value not set.
@param elementNode that should have the attribute
@param attrName that is to be looked up
@param defValue String to return if n... | java | public static String getAttributeValue(final Node elementNode, final String attrName, final String defValue)
{
final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);
if (attrNode == null)
{
return defValue;
}
return attrNode.getNodeVal... | [
"public",
"static",
"String",
"getAttributeValue",
"(",
"final",
"Node",
"elementNode",
",",
"final",
"String",
"attrName",
",",
"final",
"String",
"defValue",
")",
"{",
"final",
"Node",
"attrNode",
"=",
"elementNode",
".",
"getAttributes",
"(",
")",
".",
"get... | Helper function that uses a default value when value not set.
@param elementNode that should have the attribute
@param attrName that is to be looked up
@param defValue String to return if not set
@return value of the attribute or defValue | [
"Helper",
"function",
"that",
"uses",
"a",
"default",
"value",
"when",
"value",
"not",
"set",
"."
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L301-L311 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java | PageFlowControlContainerFactory.getSessionVar | private static Object getSessionVar(HttpServletRequest request, ServletContext servletContext, String name) {
"""
This is a generic routine that will retrieve a value from the Session through the
StorageHandler.
@param request
@param servletContext
@param name The name of the value to be retrieved
@return The... | java | private static Object getSessionVar(HttpServletRequest request, ServletContext servletContext, String name)
{
StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
RequestContext rc = new Reque... | [
"private",
"static",
"Object",
"getSessionVar",
"(",
"HttpServletRequest",
"request",
",",
"ServletContext",
"servletContext",
",",
"String",
"name",
")",
"{",
"StorageHandler",
"sh",
"=",
"Handlers",
".",
"get",
"(",
"servletContext",
")",
".",
"getStorageHandler",... | This is a generic routine that will retrieve a value from the Session through the
StorageHandler.
@param request
@param servletContext
@param name The name of the value to be retrieved
@return The requested value from the session | [
"This",
"is",
"a",
"generic",
"routine",
"that",
"will",
"retrieve",
"a",
"value",
"from",
"the",
"Session",
"through",
"the",
"StorageHandler",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java#L59-L67 |
groupon/monsoon | prometheus/src/main/java/com/groupon/lex/prometheus/PrometheusMetrics.java | PrometheusMetrics.filteredMetrics | public static Stream<PrometheusMetric> filteredMetrics(PullProcessorPipeline registry) throws Exception {
"""
@param registry
@return a Stream of PrometheusMetrics
@throws java.lang.Exception
It will filter out None values and replace all Characters that
Does not confirm to Prometheus Metric Format.
"""
... | java | public static Stream<PrometheusMetric> filteredMetrics(PullProcessorPipeline registry) throws Exception {
Stream <PrometheusMetric> m = registry.get().stream()
.flatMap((TimeSeriesValue i) -> {
Map<MetricName, MetricValue> metrics = i.getMetrics();
GroupNa... | [
"public",
"static",
"Stream",
"<",
"PrometheusMetric",
">",
"filteredMetrics",
"(",
"PullProcessorPipeline",
"registry",
")",
"throws",
"Exception",
"{",
"Stream",
"<",
"PrometheusMetric",
">",
"m",
"=",
"registry",
".",
"get",
"(",
")",
".",
"stream",
"(",
")... | @param registry
@return a Stream of PrometheusMetrics
@throws java.lang.Exception
It will filter out None values and replace all Characters that
Does not confirm to Prometheus Metric Format. | [
"@param",
"registry",
"@return",
"a",
"Stream",
"of",
"PrometheusMetrics",
"@throws",
"java",
".",
"lang",
".",
"Exception"
] | train | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/prometheus/src/main/java/com/groupon/lex/prometheus/PrometheusMetrics.java#L61-L79 |
Red5/red5-client | src/main/java/org/red5/client/net/rtmp/BaseRTMPClientHandler.java | BaseRTMPClientHandler.getSharedObject | @Override
public IClientSharedObject getSharedObject(String name, boolean persistent) {
"""
Connect to client shared object.
@param name
Client shared object name
@param persistent
SO persistence flag
@return Client shared object instance
"""
log.debug("getSharedObject name: {} persistent ... | java | @Override
public IClientSharedObject getSharedObject(String name, boolean persistent) {
log.debug("getSharedObject name: {} persistent {}", new Object[] { name, persistent });
ClientSharedObject result = sharedObjects.get(name);
if (result != null) {
if (result.isPersistent(... | [
"@",
"Override",
"public",
"IClientSharedObject",
"getSharedObject",
"(",
"String",
"name",
",",
"boolean",
"persistent",
")",
"{",
"log",
".",
"debug",
"(",
"\"getSharedObject name: {} persistent {}\"",
",",
"new",
"Object",
"[",
"]",
"{",
"name",
",",
"persisten... | Connect to client shared object.
@param name
Client shared object name
@param persistent
SO persistence flag
@return Client shared object instance | [
"Connect",
"to",
"client",
"shared",
"object",
"."
] | train | https://github.com/Red5/red5-client/blob/f894495b60e59d7cfba647abd9b934237cac9d45/src/main/java/org/red5/client/net/rtmp/BaseRTMPClientHandler.java#L333-L346 |
carewebframework/carewebframework-core | org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewerProxy.java | HelpViewerProxy.sendRequest | private void sendRequest(String methodName, Object... params) {
"""
Send a request to the remote viewer to request execution of the specified method.
@param methodName Name of the method to execute.
@param params Parameters to pass to the method (may be null).
"""
sendRequest(new InvocationRequest(... | java | private void sendRequest(String methodName, Object... params) {
sendRequest(new InvocationRequest(methodName, params), true);
} | [
"private",
"void",
"sendRequest",
"(",
"String",
"methodName",
",",
"Object",
"...",
"params",
")",
"{",
"sendRequest",
"(",
"new",
"InvocationRequest",
"(",
"methodName",
",",
"params",
")",
",",
"true",
")",
";",
"}"
] | Send a request to the remote viewer to request execution of the specified method.
@param methodName Name of the method to execute.
@param params Parameters to pass to the method (may be null). | [
"Send",
"a",
"request",
"to",
"the",
"remote",
"viewer",
"to",
"request",
"execution",
"of",
"the",
"specified",
"method",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewerProxy.java#L96-L99 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/IntuitResponseDeserializer.java | IntuitResponseDeserializer.registerModulesForCustomFieldDef | private void registerModulesForCustomFieldDef(ObjectMapper objectMapper) {
"""
Method to add custom deserializer for CustomFieldDefinition
@param objectMapper the Jackson object mapper
"""
SimpleModule simpleModule = new SimpleModule("CustomFieldDefinition", new Version(1, 0, 0, null));
simpleModule.add... | java | private void registerModulesForCustomFieldDef(ObjectMapper objectMapper) {
SimpleModule simpleModule = new SimpleModule("CustomFieldDefinition", new Version(1, 0, 0, null));
simpleModule.addDeserializer(CustomFieldDefinition.class, new CustomFieldDefinitionDeserializer());
objectMapper.registerModule(simpleModule... | [
"private",
"void",
"registerModulesForCustomFieldDef",
"(",
"ObjectMapper",
"objectMapper",
")",
"{",
"SimpleModule",
"simpleModule",
"=",
"new",
"SimpleModule",
"(",
"\"CustomFieldDefinition\"",
",",
"new",
"Version",
"(",
"1",
",",
"0",
",",
"0",
",",
"null",
")... | Method to add custom deserializer for CustomFieldDefinition
@param objectMapper the Jackson object mapper | [
"Method",
"to",
"add",
"custom",
"deserializer",
"for",
"CustomFieldDefinition"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/IntuitResponseDeserializer.java#L389-L394 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.withObjectInputStream | public static <T> T withObjectInputStream(InputStream inputStream, @ClosureParams(value=SimpleType.class, options="java.io.ObjectInputStream") Closure<T> closure) throws IOException {
"""
Create a new ObjectInputStream for this file and pass it to the closure.
This method ensures the stream is closed after the cl... | java | public static <T> T withObjectInputStream(InputStream inputStream, @ClosureParams(value=SimpleType.class, options="java.io.ObjectInputStream") Closure<T> closure) throws IOException {
return withStream(newObjectInputStream(inputStream), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withObjectInputStream",
"(",
"InputStream",
"inputStream",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.ObjectInputStream\"",
")",
"Closure",
"<",
"T",
">",
"... | Create a new ObjectInputStream for this file and pass it to the closure.
This method ensures the stream is closed after the closure returns.
@param inputStream an input stream
@param closure a closure
@return the value returned by the closure
@throws IOException if an IOException occurs.
@see #withStream(java.io.I... | [
"Create",
"a",
"new",
"ObjectInputStream",
"for",
"this",
"file",
"and",
"pass",
"it",
"to",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L329-L331 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ButtonFactory.java | ButtonFactory.createUrlButton | public static Button createUrlButton(String title, String url,
WebViewHeightRatioType ratioType) {
"""
Creates a web view button.
@param title
the button label.
@param url
the URL to whom redirect when clicked.
@param ratioType
the web view ratio type.
@return the button
"""
return new WebUrlButt... | java | public static Button createUrlButton(String title, String url,
WebViewHeightRatioType ratioType) {
return new WebUrlButton(title, url, ratioType);
} | [
"public",
"static",
"Button",
"createUrlButton",
"(",
"String",
"title",
",",
"String",
"url",
",",
"WebViewHeightRatioType",
"ratioType",
")",
"{",
"return",
"new",
"WebUrlButton",
"(",
"title",
",",
"url",
",",
"ratioType",
")",
";",
"}"
] | Creates a web view button.
@param title
the button label.
@param url
the URL to whom redirect when clicked.
@param ratioType
the web view ratio type.
@return the button | [
"Creates",
"a",
"web",
"view",
"button",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ButtonFactory.java#L88-L91 |
telly/groundy | library/src/main/java/com/telly/groundy/TaskResult.java | TaskResult.add | public TaskResult add(String key, Bundle value) {
"""
Inserts a Bundle value into the mapping of this Bundle, replacing any existing value for the
given key. Either key or value may be null.
@param key a String, or null
@param value a Bundle object, or null
@return itself
"""
mBundle.putBundle(key, ... | java | public TaskResult add(String key, Bundle value) {
mBundle.putBundle(key, value);
return this;
} | [
"public",
"TaskResult",
"add",
"(",
"String",
"key",
",",
"Bundle",
"value",
")",
"{",
"mBundle",
".",
"putBundle",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a Bundle value into the mapping of this Bundle, replacing any existing value for the
given key. Either key or value may be null.
@param key a String, or null
@param value a Bundle object, or null
@return itself | [
"Inserts",
"a",
"Bundle",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L397-L400 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/spelling/SpellingCheckRule.java | SpellingCheckRule.startsWithIgnoredWord | protected int startsWithIgnoredWord(String word, boolean caseSensitive) {
"""
Checks whether a <code>word</code> starts with an ignored word.
Note that a minimum <code>word</code>-length of 4 characters is expected.
(This is for better performance. Moreover, such short words are most likely contained in the dict... | java | protected int startsWithIgnoredWord(String word, boolean caseSensitive) {
if (word.length() < 4) {
return 0;
}
Optional<String> match = Optional.empty();
if(caseSensitive) {
Set<String> subset = wordsToBeIgnoredDictionary.get(word.substring(0, 1));
if (subset != null) {
match =... | [
"protected",
"int",
"startsWithIgnoredWord",
"(",
"String",
"word",
",",
"boolean",
"caseSensitive",
")",
"{",
"if",
"(",
"word",
".",
"length",
"(",
")",
"<",
"4",
")",
"{",
"return",
"0",
";",
"}",
"Optional",
"<",
"String",
">",
"match",
"=",
"Optio... | Checks whether a <code>word</code> starts with an ignored word.
Note that a minimum <code>word</code>-length of 4 characters is expected.
(This is for better performance. Moreover, such short words are most likely contained in the dictionary.)
@param word - entire word
@param caseSensitive - determines whether the chec... | [
"Checks",
"whether",
"a",
"<code",
">",
"word<",
"/",
"code",
">",
"starts",
"with",
"an",
"ignored",
"word",
".",
"Note",
"that",
"a",
"minimum",
"<code",
">",
"word<",
"/",
"code",
">",
"-",
"length",
"of",
"4",
"characters",
"is",
"expected",
".",
... | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/spelling/SpellingCheckRule.java#L552-L570 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLApplicationMainLaunchConfigurationTab.java | SARLApplicationMainLaunchConfigurationTab.createLaunchOptionEditor | protected void createLaunchOptionEditor(Composite parent, String text) {
"""
Creates the widgets for configuring the launch options.
@param parent the parent composite.
@param text the label of the group.
"""
final Group group = SWTFactory.createGroup(parent, text, 1, 1, GridData.FILL_HORIZONTAL);
this... | java | protected void createLaunchOptionEditor(Composite parent, String text) {
final Group group = SWTFactory.createGroup(parent, text, 1, 1, GridData.FILL_HORIZONTAL);
this.enableAssertionsInRunModeButton = createCheckButton(group, Messages.SARLMainLaunchConfigurationTab_2);
this.enableAssertionsInRunModeButton.addSel... | [
"protected",
"void",
"createLaunchOptionEditor",
"(",
"Composite",
"parent",
",",
"String",
"text",
")",
"{",
"final",
"Group",
"group",
"=",
"SWTFactory",
".",
"createGroup",
"(",
"parent",
",",
"text",
",",
"1",
",",
"1",
",",
"GridData",
".",
"FILL_HORIZO... | Creates the widgets for configuring the launch options.
@param parent the parent composite.
@param text the label of the group. | [
"Creates",
"the",
"widgets",
"for",
"configuring",
"the",
"launch",
"options",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLApplicationMainLaunchConfigurationTab.java#L122-L130 |
BellaDati/belladati-sdk-api | src/main/java/com/belladati/sdk/dataset/data/OverwritePolicy.java | OverwritePolicy.byAttributes | public static OverwritePolicy byAttributes(String firstAttribute, String... otherAttributes) {
"""
Returns an {@link OverwritePolicy} that deletes records that are
identical in the specified attributes with a record being imported. As a
result, no two records can exist in the data set that have the same
values ... | java | public static OverwritePolicy byAttributes(String firstAttribute, String... otherAttributes) {
List<String> attributes = new ArrayList<String>();
attributes.add(firstAttribute);
attributes.addAll(Arrays.asList(otherAttributes));
return new AttributeOverwritePolicy(attributes);
} | [
"public",
"static",
"OverwritePolicy",
"byAttributes",
"(",
"String",
"firstAttribute",
",",
"String",
"...",
"otherAttributes",
")",
"{",
"List",
"<",
"String",
">",
"attributes",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"attributes",
".",
... | Returns an {@link OverwritePolicy} that deletes records that are
identical in the specified attributes with a record being imported. As a
result, no two records can exist in the data set that have the same
values for all of those attributes at once. <br>
At least one attribute needs to be specified.
<p>
Empty attribute... | [
"Returns",
"an",
"{",
"@link",
"OverwritePolicy",
"}",
"that",
"deletes",
"records",
"that",
"are",
"identical",
"in",
"the",
"specified",
"attributes",
"with",
"a",
"record",
"being",
"imported",
".",
"As",
"a",
"result",
"no",
"two",
"records",
"can",
"exi... | train | https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/dataset/data/OverwritePolicy.java#L89-L94 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/updater/SchemaUpdater.java | SchemaUpdater.getSql | protected String getSql(int version) {
"""
Returns the SQL which located within a package specified by the packageName as
"dialectname_version.sql" or "version.sql".
@param version the version number
@return SQL or null if the SQL file does not exist
"""
Dialect dialect = ((SqlManagerImpl) sqlMan... | java | protected String getSql(int version){
Dialect dialect = ((SqlManagerImpl) sqlManager).getDialect();
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
InputStream in = classLoader.getResourceAsStream(
String.format("%s/%s_%d.sql", packageName, dialect.g... | [
"protected",
"String",
"getSql",
"(",
"int",
"version",
")",
"{",
"Dialect",
"dialect",
"=",
"(",
"(",
"SqlManagerImpl",
")",
"sqlManager",
")",
".",
"getDialect",
"(",
")",
";",
"ClassLoader",
"classLoader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
... | Returns the SQL which located within a package specified by the packageName as
"dialectname_version.sql" or "version.sql".
@param version the version number
@return SQL or null if the SQL file does not exist | [
"Returns",
"the",
"SQL",
"which",
"located",
"within",
"a",
"package",
"specified",
"by",
"the",
"packageName",
"as",
"dialectname_version",
".",
"sql",
"or",
"version",
".",
"sql",
"."
] | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/updater/SchemaUpdater.java#L117-L136 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/Chronology.java | Chronology.dateYearDay | public ChronoLocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
"""
Obtains a local date in this chronology from the era, year-of-era and
day-of-year fields.
@param era the era of the correct type for the chronology, not null
@param yearOfEra the chronology year-of-era
@param dayOfYear the chr... | java | public ChronoLocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);
} | [
"public",
"ChronoLocalDate",
"dateYearDay",
"(",
"Era",
"era",
",",
"int",
"yearOfEra",
",",
"int",
"dayOfYear",
")",
"{",
"return",
"dateYearDay",
"(",
"prolepticYear",
"(",
"era",
",",
"yearOfEra",
")",
",",
"dayOfYear",
")",
";",
"}"
] | Obtains a local date in this chronology from the era, year-of-era and
day-of-year fields.
@param era the era of the correct type for the chronology, not null
@param yearOfEra the chronology year-of-era
@param dayOfYear the chronology day-of-year
@return the local date in this chronology, not null
@throws DateTimeEx... | [
"Obtains",
"a",
"local",
"date",
"in",
"this",
"chronology",
"from",
"the",
"era",
"year",
"-",
"of",
"-",
"era",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/Chronology.java#L468-L470 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MissionBehaviour.java | MissionBehaviour.appendExtraServerInformation | public void appendExtraServerInformation(HashMap<String, String> map) {
"""
This method gives our handlers a chance to add any information to the ping message
which the client sends (repeatedly) to the server while the agents are assembling.
This message is guaranteed to get through to the server, so it is a goo... | java | public void appendExtraServerInformation(HashMap<String, String> map)
{
List<HandlerBase> handlers = getClientHandlerList();
for (HandlerBase handler : handlers)
handler.appendExtraServerInformation(map);
} | [
"public",
"void",
"appendExtraServerInformation",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"List",
"<",
"HandlerBase",
">",
"handlers",
"=",
"getClientHandlerList",
"(",
")",
";",
"for",
"(",
"HandlerBase",
"handler",
":",
"handlers"... | This method gives our handlers a chance to add any information to the ping message
which the client sends (repeatedly) to the server while the agents are assembling.
This message is guaranteed to get through to the server, so it is a good place to
communicate.
(NOTE this is called BEFORE addExtraHandlers - but that mec... | [
"This",
"method",
"gives",
"our",
"handlers",
"a",
"chance",
"to",
"add",
"any",
"information",
"to",
"the",
"ping",
"message",
"which",
"the",
"client",
"sends",
"(",
"repeatedly",
")",
"to",
"the",
"server",
"while",
"the",
"agents",
"are",
"assembling",
... | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MissionBehaviour.java#L337-L342 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.findUniqueConstructorOrThrowException | public static Constructor<?> findUniqueConstructorOrThrowException(Class<?> type, Object... arguments) {
"""
Finds and returns a certain constructor. If the constructor couldn't be
found this method delegates to
@param type The type where the constructor should be located.
@param arguments The arguments ... | java | public static Constructor<?> findUniqueConstructorOrThrowException(Class<?> type, Object... arguments) {
return new ConstructorFinder(type, arguments).findConstructor();
} | [
"public",
"static",
"Constructor",
"<",
"?",
">",
"findUniqueConstructorOrThrowException",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"...",
"arguments",
")",
"{",
"return",
"new",
"ConstructorFinder",
"(",
"type",
",",
"arguments",
")",
".",
"findCon... | Finds and returns a certain constructor. If the constructor couldn't be
found this method delegates to
@param type The type where the constructor should be located.
@param arguments The arguments passed to the constructor.
@return The found constructor.
@throws ConstructorNotFoundException if no constructor was f... | [
"Finds",
"and",
"returns",
"a",
"certain",
"constructor",
".",
"If",
"the",
"constructor",
"couldn",
"t",
"be",
"found",
"this",
"method",
"delegates",
"to"
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L1081-L1083 |
alkacon/opencms-core | src/org/opencms/security/CmsRoleManager.java | CmsRoleManager.checkRoleForResource | public void checkRoleForResource(CmsObject cms, CmsRole role, String resourceName)
throws CmsException, CmsRoleViolationException {
"""
Checks if the user of this OpenCms context is a member of the given role
for the given resource.<p>
The user must have the given role in at least one organizational unit t... | java | public void checkRoleForResource(CmsObject cms, CmsRole role, String resourceName)
throws CmsException, CmsRoleViolationException {
CmsResource resource = cms.readResource(resourceName, CmsResourceFilter.ALL);
m_securityManager.checkRoleForResource(cms.getRequestContext(), role, resource);
} | [
"public",
"void",
"checkRoleForResource",
"(",
"CmsObject",
"cms",
",",
"CmsRole",
"role",
",",
"String",
"resourceName",
")",
"throws",
"CmsException",
",",
"CmsRoleViolationException",
"{",
"CmsResource",
"resource",
"=",
"cms",
".",
"readResource",
"(",
"resource... | Checks if the user of this OpenCms context is a member of the given role
for the given resource.<p>
The user must have the given role in at least one organizational unit to which this resource belongs.<p>
@param cms the opencms context
@param role the role to check
@param resourceName the name of the resource to chec... | [
"Checks",
"if",
"the",
"user",
"of",
"this",
"OpenCms",
"context",
"is",
"a",
"member",
"of",
"the",
"given",
"role",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsRoleManager.java#L109-L114 |
alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/FileLock.java | FileLock.getLastEntry | public static LogEntry getLastEntry(FileSystem fs, Path lockFile)
throws IOException {
"""
returns the last log entry
@param fs
@param lockFile
@return
@throws IOException
"""
FSDataInputStream in = fs.open(lockFile);
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
... | java | public static LogEntry getLastEntry(FileSystem fs, Path lockFile)
throws IOException {
FSDataInputStream in = fs.open(lockFile);
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String lastLine = null;
for(String line = reader.readLine(); line!=null; line = reader.readLin... | [
"public",
"static",
"LogEntry",
"getLastEntry",
"(",
"FileSystem",
"fs",
",",
"Path",
"lockFile",
")",
"throws",
"IOException",
"{",
"FSDataInputStream",
"in",
"=",
"fs",
".",
"open",
"(",
"lockFile",
")",
";",
"BufferedReader",
"reader",
"=",
"new",
"Buffered... | returns the last log entry
@param fs
@param lockFile
@return
@throws IOException | [
"returns",
"the",
"last",
"log",
"entry"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/FileLock.java#L171-L180 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java | SDNN.hardTanh | public SDVariable hardTanh(String name, SDVariable in) {
"""
Element-wise hard tanh function:<br>
out[i] = -1 if in[i] <= -1<br>
out[1] = in[i] if -1 < in[i] < 1<br>
out[i] = 1 if in[i] >= 1<br>
@param name Output variable name
@param in Input variable
@return Output variable
"""
validateFloa... | java | public SDVariable hardTanh(String name, SDVariable in) {
validateFloatingPoint("hard Tanh", in);
SDVariable result = f().hardTanh(in);
return updateVariableNameAndReference(result, name);
} | [
"public",
"SDVariable",
"hardTanh",
"(",
"String",
"name",
",",
"SDVariable",
"in",
")",
"{",
"validateFloatingPoint",
"(",
"\"hard Tanh\"",
",",
"in",
")",
";",
"SDVariable",
"result",
"=",
"f",
"(",
")",
".",
"hardTanh",
"(",
"in",
")",
";",
"return",
... | Element-wise hard tanh function:<br>
out[i] = -1 if in[i] <= -1<br>
out[1] = in[i] if -1 < in[i] < 1<br>
out[i] = 1 if in[i] >= 1<br>
@param name Output variable name
@param in Input variable
@return Output variable | [
"Element",
"-",
"wise",
"hard",
"tanh",
"function",
":",
"<br",
">",
"out",
"[",
"i",
"]",
"=",
"-",
"1",
"if",
"in",
"[",
"i",
"]",
"<",
"=",
"-",
"1<br",
">",
"out",
"[",
"1",
"]",
"=",
"in",
"[",
"i",
"]",
"if",
"-",
"1",
"<",
"in",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java#L254-L258 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriFragmentId | public static void unescapeUriFragmentId(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform am URI fragment identifier <strong>unescape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>.
</p>
<p>
This meth... | java | public static void unescapeUriFragmentId(final String text, final Writer writer)
throws IOException {
unescapeUriFragmentId(text, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"unescapeUriFragmentId",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"unescapeUriFragmentId",
"(",
"text",
",",
"writer",
",",
"DEFAULT_ENCODING",
")",
";",
"}"
] | <p>
Perform am URI fragment identifier <strong>unescape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to ... | [
"<p",
">",
"Perform",
"am",
"URI",
"fragment",
"identifier",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
"/",
"tt",
">",
"as",
"encodi... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L2030-L2033 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeCheck.java | TypeCheck.visitVar | private void visitVar(NodeTraversal t, Node n) {
"""
Visits a VAR node.
@param t The node traversal object that supplies context, such as the
scope chain to use in name lookups as well as error reporting.
@param n The node being visited.
"""
// Handle var declarations in for-of loops separately from r... | java | private void visitVar(NodeTraversal t, Node n) {
// Handle var declarations in for-of loops separately from regular var declarations.
if (n.getParent().isForOf() || n.getParent().isForIn()) {
return;
}
// TODO(nicksantos): Fix this so that the doc info always shows up
// on the NAME node. We ... | [
"private",
"void",
"visitVar",
"(",
"NodeTraversal",
"t",
",",
"Node",
"n",
")",
"{",
"// Handle var declarations in for-of loops separately from regular var declarations.",
"if",
"(",
"n",
".",
"getParent",
"(",
")",
".",
"isForOf",
"(",
")",
"||",
"n",
".",
"get... | Visits a VAR node.
@param t The node traversal object that supplies context, such as the
scope chain to use in name lookups as well as error reporting.
@param n The node being visited. | [
"Visits",
"a",
"VAR",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeCheck.java#L2229-L2262 |
magott/spring-social-yammer | spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/GroupTemplate.java | GroupTemplate.updateGroup | public void updateGroup(long groupId, String name, boolean isPrivate) {
"""
Method returns 401 from Yammer, so it isn't visible in GroupOperations yet
@param groupId
@param name
@param isPrivate
"""
LinkedMultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
params.set("name"... | java | public void updateGroup(long groupId, String name, boolean isPrivate) {
LinkedMultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
params.set("name",name);
params.set("private", String.valueOf(isPrivate));
restTemplate.put(buildUri("groups/"+groupId), params);
} | [
"public",
"void",
"updateGroup",
"(",
"long",
"groupId",
",",
"String",
"name",
",",
"boolean",
"isPrivate",
")",
"{",
"LinkedMultiValueMap",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"LinkedMultiValueMap",
"<",
"String",
",",
"String",
">",
"... | Method returns 401 from Yammer, so it isn't visible in GroupOperations yet
@param groupId
@param name
@param isPrivate | [
"Method",
"returns",
"401",
"from",
"Yammer",
"so",
"it",
"isn",
"t",
"visible",
"in",
"GroupOperations",
"yet"
] | train | https://github.com/magott/spring-social-yammer/blob/a39dab7c33e40bfaa26c15b6336823edf57452c3/spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/GroupTemplate.java#L71-L76 |
elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/correlation/UncenteredCorrelationDistanceFunction.java | UncenteredCorrelationDistanceFunction.uncenteredCorrelation | public static double uncenteredCorrelation(NumberVector x, NumberVector y) {
"""
Compute the uncentered correlation of two vectors.
@param x first NumberVector
@param y second NumberVector
@return the uncentered correlation coefficient for x and y
"""
final int xdim = x.getDimensionality(), ydim = y.g... | java | public static double uncenteredCorrelation(NumberVector x, NumberVector y) {
final int xdim = x.getDimensionality(), ydim = y.getDimensionality();
if(xdim != ydim) {
throw new IllegalArgumentException("Invalid arguments: number vectors differ in dimensionality.");
}
double sumXX = 0., sumYY = 0., ... | [
"public",
"static",
"double",
"uncenteredCorrelation",
"(",
"NumberVector",
"x",
",",
"NumberVector",
"y",
")",
"{",
"final",
"int",
"xdim",
"=",
"x",
".",
"getDimensionality",
"(",
")",
",",
"ydim",
"=",
"y",
".",
"getDimensionality",
"(",
")",
";",
"if",... | Compute the uncentered correlation of two vectors.
@param x first NumberVector
@param y second NumberVector
@return the uncentered correlation coefficient for x and y | [
"Compute",
"the",
"uncentered",
"correlation",
"of",
"two",
"vectors",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/correlation/UncenteredCorrelationDistanceFunction.java#L60-L77 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/common/Preconditions.java | Preconditions.checkArgNotNull | public static <T> T checkArgNotNull(T reference, String parameterName) {
"""
Ensures that an object reference passed as a parameter to the calling
method is not null.
@param reference an object reference
@param parameterName the parameter name
@return the non-null reference that was validated
@throws Nul... | java | public static <T> T checkArgNotNull(T reference, String parameterName) {
if (reference == null) {
throw new NullPointerException(format("Argument '%s' must not be null", parameterName));
}
return reference;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"checkArgNotNull",
"(",
"T",
"reference",
",",
"String",
"parameterName",
")",
"{",
"if",
"(",
"reference",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"format",
"(",
"\"Argument '%s' must not be... | Ensures that an object reference passed as a parameter to the calling
method is not null.
@param reference an object reference
@param parameterName the parameter name
@return the non-null reference that was validated
@throws NullPointerException if {@code reference} is null | [
"Ensures",
"that",
"an",
"object",
"reference",
"passed",
"as",
"a",
"parameter",
"to",
"the",
"calling",
"method",
"is",
"not",
"null",
"."
] | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/common/Preconditions.java#L206-L211 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleriesTab.java | CmsGalleriesTab.updateListContent | public void updateListContent(List<CmsGalleryFolderBean> galleries, List<String> selectedGalleries) {
"""
Update the galleries list.<p>
@param galleries the new gallery list
@param selectedGalleries the list of galleries to select
"""
clearList();
fillContent(galleries, selectedGalleries);... | java | public void updateListContent(List<CmsGalleryFolderBean> galleries, List<String> selectedGalleries) {
clearList();
fillContent(galleries, selectedGalleries);
} | [
"public",
"void",
"updateListContent",
"(",
"List",
"<",
"CmsGalleryFolderBean",
">",
"galleries",
",",
"List",
"<",
"String",
">",
"selectedGalleries",
")",
"{",
"clearList",
"(",
")",
";",
"fillContent",
"(",
"galleries",
",",
"selectedGalleries",
")",
";",
... | Update the galleries list.<p>
@param galleries the new gallery list
@param selectedGalleries the list of galleries to select | [
"Update",
"the",
"galleries",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleriesTab.java#L416-L420 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/WriteCampaignRequest.java | WriteCampaignRequest.withTags | public WriteCampaignRequest withTags(java.util.Map<String, String> tags) {
"""
The Tags for the campaign.
@param tags
The Tags for the campaign.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public WriteCampaignRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"WriteCampaignRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | The Tags for the campaign.
@param tags
The Tags for the campaign.
@return Returns a reference to this object so that method calls can be chained together. | [
"The",
"Tags",
"for",
"the",
"campaign",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/WriteCampaignRequest.java#L510-L513 |
rzwitserloot/lombok | src/core/lombok/eclipse/handlers/HandleWither.java | HandleWither.generateWitherForField | public void generateWitherForField(EclipseNode fieldNode, EclipseNode sourceNode, AccessLevel level) {
"""
Generates a wither on the stated field.
Used by {@link HandleValue}.
The difference between this call and the handle method is as follows:
If there is a {@code lombok.experimental.Wither} annotation ... | java | public void generateWitherForField(EclipseNode fieldNode, EclipseNode sourceNode, AccessLevel level) {
for (EclipseNode child : fieldNode.down()) {
if (child.getKind() == Kind.ANNOTATION) {
if (annotationTypeMatches(Wither.class, child)) {
//The annotation will make it happen, so we can skip it.
retu... | [
"public",
"void",
"generateWitherForField",
"(",
"EclipseNode",
"fieldNode",
",",
"EclipseNode",
"sourceNode",
",",
"AccessLevel",
"level",
")",
"{",
"for",
"(",
"EclipseNode",
"child",
":",
"fieldNode",
".",
"down",
"(",
")",
")",
"{",
"if",
"(",
"child",
"... | Generates a wither on the stated field.
Used by {@link HandleValue}.
The difference between this call and the handle method is as follows:
If there is a {@code lombok.experimental.Wither} annotation on the field, it is used and the
same rules apply (e.g. warning if the method already exists, stated access level appl... | [
"Generates",
"a",
"wither",
"on",
"the",
"stated",
"field",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/eclipse/handlers/HandleWither.java#L108-L120 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsContainerpageService.java | CmsContainerpageService.getLockInfo | private String getLockInfo(CmsResource resource) throws CmsException {
"""
Returns the lock information to the given resource.<p>
@param resource the resource
@return lock information, if the page is locked by another user
@throws CmsException if something goes wrong reading the lock owner user
"""
... | java | private String getLockInfo(CmsResource resource) throws CmsException {
CmsObject cms = getCmsObject();
CmsResourceUtil resourceUtil = new CmsResourceUtil(cms, resource);
CmsLock lock = resourceUtil.getLock();
String lockInfo = null;
if (!lock.isLockableBy(cms.getRequestContext()... | [
"private",
"String",
"getLockInfo",
"(",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"CmsObject",
"cms",
"=",
"getCmsObject",
"(",
")",
";",
"CmsResourceUtil",
"resourceUtil",
"=",
"new",
"CmsResourceUtil",
"(",
"cms",
",",
"resource",
")",
";... | Returns the lock information to the given resource.<p>
@param resource the resource
@return lock information, if the page is locked by another user
@throws CmsException if something goes wrong reading the lock owner user | [
"Returns",
"the",
"lock",
"information",
"to",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsContainerpageService.java#L2514-L2532 |
google/closure-templates | java/src/com/google/template/soy/soyparse/Tokens.java | Tokens.createSrcLoc | static SourceLocation createSrcLoc(String filePath, Token first, Token... rest) {
"""
Returns a source location for the given tokens.
<p>All the provided tokens should be in strictly increasing order.
"""
int beginLine = first.beginLine;
int beginColumn = first.beginColumn;
int endLine = first.e... | java | static SourceLocation createSrcLoc(String filePath, Token first, Token... rest) {
int beginLine = first.beginLine;
int beginColumn = first.beginColumn;
int endLine = first.endLine;
int endColumn = first.endColumn;
for (Token next : rest) {
checkArgument(startsLaterThan(next, beginLine, beginC... | [
"static",
"SourceLocation",
"createSrcLoc",
"(",
"String",
"filePath",
",",
"Token",
"first",
",",
"Token",
"...",
"rest",
")",
"{",
"int",
"beginLine",
"=",
"first",
".",
"beginLine",
";",
"int",
"beginColumn",
"=",
"first",
".",
"beginColumn",
";",
"int",
... | Returns a source location for the given tokens.
<p>All the provided tokens should be in strictly increasing order. | [
"Returns",
"a",
"source",
"location",
"for",
"the",
"given",
"tokens",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soyparse/Tokens.java#L31-L48 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java | AnalyticsItemsInner.put | public ApplicationInsightsComponentAnalyticsItemInner put(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties, Boolean overrideItem) {
"""
Adds or Updates a specific Analytics Item within an Application Insights component.
@param ... | java | public ApplicationInsightsComponentAnalyticsItemInner put(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties, Boolean overrideItem) {
return putWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, itemProperties, ... | [
"public",
"ApplicationInsightsComponentAnalyticsItemInner",
"put",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ItemScopePath",
"scopePath",
",",
"ApplicationInsightsComponentAnalyticsItemInner",
"itemProperties",
",",
"Boolean",
"overrideItem",
")",
... | Adds or Updates a specific Analytics Item within an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param scopePath Enum indicating if this item definition is owned by a specific user or is shared bet... | [
"Adds",
"or",
"Updates",
"a",
"specific",
"Analytics",
"Item",
"within",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java#L571-L573 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java | PathMetadataFactory.forListAccess | public static PathMetadata forListAccess(Path<?> parent, @Nonnegative int index) {
"""
Create a new PathMetadata instance for indexed list access
@param parent parent path
@param index index of element
@return list access path
"""
return new PathMetadata(parent, index, PathType.LISTVALUE_CONSTANT)... | java | public static PathMetadata forListAccess(Path<?> parent, @Nonnegative int index) {
return new PathMetadata(parent, index, PathType.LISTVALUE_CONSTANT);
} | [
"public",
"static",
"PathMetadata",
"forListAccess",
"(",
"Path",
"<",
"?",
">",
"parent",
",",
"@",
"Nonnegative",
"int",
"index",
")",
"{",
"return",
"new",
"PathMetadata",
"(",
"parent",
",",
"index",
",",
"PathType",
".",
"LISTVALUE_CONSTANT",
")",
";",
... | Create a new PathMetadata instance for indexed list access
@param parent parent path
@param index index of element
@return list access path | [
"Create",
"a",
"new",
"PathMetadata",
"instance",
"for",
"indexed",
"list",
"access"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java#L86-L88 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java | IndexWriter.generateBucketUpdate | private void generateBucketUpdate(TableBucket bucket, long bucketOffset, UpdateInstructions update) {
"""
Generates one or more {@link AttributeUpdate}s that will create or update the necessary Table Buckets entries
in the Segment's Extended Attributes.
@param bucket The Bucket to create or update.
... | java | private void generateBucketUpdate(TableBucket bucket, long bucketOffset, UpdateInstructions update) {
assert bucketOffset >= 0;
update.withAttribute(new AttributeUpdate(bucket.getHash(), AttributeUpdateType.Replace, bucketOffset));
if (!bucket.exists()) {
update.bucketAdded();
... | [
"private",
"void",
"generateBucketUpdate",
"(",
"TableBucket",
"bucket",
",",
"long",
"bucketOffset",
",",
"UpdateInstructions",
"update",
")",
"{",
"assert",
"bucketOffset",
">=",
"0",
";",
"update",
".",
"withAttribute",
"(",
"new",
"AttributeUpdate",
"(",
"buck... | Generates one or more {@link AttributeUpdate}s that will create or update the necessary Table Buckets entries
in the Segment's Extended Attributes.
@param bucket The Bucket to create or update.
@param bucketOffset The Bucket's new offset.
@param update A {@link UpdateInstructions} object to collect upd... | [
"Generates",
"one",
"or",
"more",
"{",
"@link",
"AttributeUpdate",
"}",
"s",
"that",
"will",
"create",
"or",
"update",
"the",
"necessary",
"Table",
"Buckets",
"entries",
"in",
"the",
"Segment",
"s",
"Extended",
"Attributes",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java#L196-L202 |
structr/structr | structr-core/src/main/java/org/structr/core/graph/SyncCommand.java | SyncCommand.exportToStream | public static void exportToStream(final OutputStream outputStream, final Iterable<? extends NodeInterface> nodes, final Iterable<? extends RelationshipInterface> relationships, final Iterable<String> filePaths, final boolean includeFiles) throws FrameworkException {
"""
Exports the given part of the structr databa... | java | public static void exportToStream(final OutputStream outputStream, final Iterable<? extends NodeInterface> nodes, final Iterable<? extends RelationshipInterface> relationships, final Iterable<String> filePaths, final boolean includeFiles) throws FrameworkException {
try (final ZipOutputStream zos = new ZipOutputStre... | [
"public",
"static",
"void",
"exportToStream",
"(",
"final",
"OutputStream",
"outputStream",
",",
"final",
"Iterable",
"<",
"?",
"extends",
"NodeInterface",
">",
"nodes",
",",
"final",
"Iterable",
"<",
"?",
"extends",
"RelationshipInterface",
">",
"relationships",
... | Exports the given part of the structr database to the given output stream.
@param outputStream
@param nodes
@param relationships
@param filePaths
@param includeFiles
@throws FrameworkException | [
"Exports",
"the",
"given",
"part",
"of",
"the",
"structr",
"database",
"to",
"the",
"given",
"output",
"stream",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/graph/SyncCommand.java#L262-L302 |
cfg4j/cfg4j | cfg4j-core/src/main/java/org/cfg4j/source/system/EnvironmentVariablesConfigurationSource.java | EnvironmentVariablesConfigurationSource.convertToPropertiesKey | private static String convertToPropertiesKey(String environmentVariableKey, String environmentContext) {
"""
Convert the Environment Variable Name to the expected Properties Key formatting
@param environmentVariableKey The Env Variable Name, possibly prefixed with the {@link Environment} which
in this context ... | java | private static String convertToPropertiesKey(String environmentVariableKey, String environmentContext) {
return environmentVariableKey.substring(environmentContext.length()).replace(ENV_DELIMITER, PROPERTIES_DELIMITER);
} | [
"private",
"static",
"String",
"convertToPropertiesKey",
"(",
"String",
"environmentVariableKey",
",",
"String",
"environmentContext",
")",
"{",
"return",
"environmentVariableKey",
".",
"substring",
"(",
"environmentContext",
".",
"length",
"(",
")",
")",
".",
"replac... | Convert the Environment Variable Name to the expected Properties Key formatting
@param environmentVariableKey The Env Variable Name, possibly prefixed with the {@link Environment} which
in this context serves as a way to namespace variables
@param environmentContext The Environment context in format: ENVIRONMENTNA... | [
"Convert",
"the",
"Environment",
"Variable",
"Name",
"to",
"the",
"expected",
"Properties",
"Key",
"formatting"
] | train | https://github.com/cfg4j/cfg4j/blob/47d4f63e5fc820c62631e557adc34a29d8ab396d/cfg4j-core/src/main/java/org/cfg4j/source/system/EnvironmentVariablesConfigurationSource.java#L81-L83 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/io/FileSupport.java | FileSupport.getFilesInDirectoryTree | public static List<File> getFilesInDirectoryTree(String path, String includeMask) {
"""
Retrieves files for a given mask from a directory and its subdirectories.
@param path root of directory tree
@param includeMask exact filename, or mask containing wildcards
@return A list containing the found files
"""... | java | public static List<File> getFilesInDirectoryTree(String path, String includeMask) {
File file = new File(path);
return getContentsInDirectoryTree(file, includeMask, true, false);
} | [
"public",
"static",
"List",
"<",
"File",
">",
"getFilesInDirectoryTree",
"(",
"String",
"path",
",",
"String",
"includeMask",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"path",
")",
";",
"return",
"getContentsInDirectoryTree",
"(",
"file",
",",
"incl... | Retrieves files for a given mask from a directory and its subdirectories.
@param path root of directory tree
@param includeMask exact filename, or mask containing wildcards
@return A list containing the found files | [
"Retrieves",
"files",
"for",
"a",
"given",
"mask",
"from",
"a",
"directory",
"and",
"its",
"subdirectories",
"."
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/io/FileSupport.java#L69-L72 |
diffplug/durian | src/com/diffplug/common/base/FieldsAndGetters.java | FieldsAndGetters.tryCall | private static Object tryCall(String methodName, Throwing.Supplier<Object> supplier) {
"""
Executes the given function, return any exceptions it might throw as wrapped values.
"""
try {
return supplier.get();
} catch (Throwable error) {
return new CallException(methodName, error);
}
} | java | private static Object tryCall(String methodName, Throwing.Supplier<Object> supplier) {
try {
return supplier.get();
} catch (Throwable error) {
return new CallException(methodName, error);
}
} | [
"private",
"static",
"Object",
"tryCall",
"(",
"String",
"methodName",
",",
"Throwing",
".",
"Supplier",
"<",
"Object",
">",
"supplier",
")",
"{",
"try",
"{",
"return",
"supplier",
".",
"get",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"error",
")",
... | Executes the given function, return any exceptions it might throw as wrapped values. | [
"Executes",
"the",
"given",
"function",
"return",
"any",
"exceptions",
"it",
"might",
"throw",
"as",
"wrapped",
"values",
"."
] | train | https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/FieldsAndGetters.java#L102-L108 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2beans/BeansToExcelOnTemplate.java | BeansToExcelOnTemplate.mergeRows | private void mergeRows(ExcelRows excelRowsAnn, Cell templateCell, int itemSize) {
"""
根据@ExcelRows注解的指示,纵向合并单元格。
@param excelRowsAnn @ExcelRows注解值。
@param templateCell 模板单元格。
@param itemSize 纵向合并多少行的单元格。
"""
val tmplCellRowIndex = templateCell.getRowIndex();
for (val ann : excelRowsAn... | java | private void mergeRows(ExcelRows excelRowsAnn, Cell templateCell, int itemSize) {
val tmplCellRowIndex = templateCell.getRowIndex();
for (val ann : excelRowsAnn.mergeRows()) {
val fr = ann.fromRef();
val cellRef = PoiUtil.isFullCellReference(fr) ? fr : fr + (tmplCellRowIndex + 1... | [
"private",
"void",
"mergeRows",
"(",
"ExcelRows",
"excelRowsAnn",
",",
"Cell",
"templateCell",
",",
"int",
"itemSize",
")",
"{",
"val",
"tmplCellRowIndex",
"=",
"templateCell",
".",
"getRowIndex",
"(",
")",
";",
"for",
"(",
"val",
"ann",
":",
"excelRowsAnn",
... | 根据@ExcelRows注解的指示,纵向合并单元格。
@param excelRowsAnn @ExcelRows注解值。
@param templateCell 模板单元格。
@param itemSize 纵向合并多少行的单元格。 | [
"根据@ExcelRows注解的指示,纵向合并单元格。"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/BeansToExcelOnTemplate.java#L127-L143 |
dadoonet/spring-elasticsearch | src/main/java/fr/pilato/spring/elasticsearch/type/TypeElasticsearchUpdater.java | TypeElasticsearchUpdater.createTypeWithMappingInElasticsearch | private static void createTypeWithMappingInElasticsearch(RestHighLevelClient client, String index, String mapping)
throws Exception {
"""
Create a new type in Elasticsearch
@param client Elasticsearch client
@param index Index name
@param mapping Mapping if any, null if no specific mapping
@throws ... | java | private static void createTypeWithMappingInElasticsearch(RestHighLevelClient client, String index, String mapping)
throws Exception {
logger.trace("createTypeWithMappingInElasticsearch([{}])", index);
assert client != null;
assert index != null;
if (mapping != null) {
... | [
"private",
"static",
"void",
"createTypeWithMappingInElasticsearch",
"(",
"RestHighLevelClient",
"client",
",",
"String",
"index",
",",
"String",
"mapping",
")",
"throws",
"Exception",
"{",
"logger",
".",
"trace",
"(",
"\"createTypeWithMappingInElasticsearch([{}])\"",
","... | Create a new type in Elasticsearch
@param client Elasticsearch client
@param index Index name
@param mapping Mapping if any, null if no specific mapping
@throws Exception if the elasticsearch call is failing | [
"Create",
"a",
"new",
"type",
"in",
"Elasticsearch"
] | train | https://github.com/dadoonet/spring-elasticsearch/blob/b338223818a5bdf5d9c06c88cb98589c843fd293/src/main/java/fr/pilato/spring/elasticsearch/type/TypeElasticsearchUpdater.java#L109-L124 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/config/Configuration.java | Configuration.updateGlobalConfiguration | public void updateGlobalConfiguration(Map<String, String> pConfig) {
"""
Update this global configuration from a string-string. Only the known keys are taken
from this map
@param pConfig config map from where to take the configuration
"""
for (ConfigKey c : ConfigKey.values()) {
if (c.i... | java | public void updateGlobalConfiguration(Map<String, String> pConfig) {
for (ConfigKey c : ConfigKey.values()) {
if (c.isGlobalConfig()) {
String value = pConfig.get(c.getKeyValue());
if (value != null) {
globalConfig.put(c,value);
}
... | [
"public",
"void",
"updateGlobalConfiguration",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"pConfig",
")",
"{",
"for",
"(",
"ConfigKey",
"c",
":",
"ConfigKey",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"c",
".",
"isGlobalConfig",
"(",
")",
")",
... | Update this global configuration from a string-string. Only the known keys are taken
from this map
@param pConfig config map from where to take the configuration | [
"Update",
"this",
"global",
"configuration",
"from",
"a",
"string",
"-",
"string",
".",
"Only",
"the",
"known",
"keys",
"are",
"taken",
"from",
"this",
"map"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/config/Configuration.java#L71-L80 |
overturetool/overture | core/parser/src/main/java/org/overture/parser/lex/LexTokenReader.java | LexTokenReader.checkFor | private void checkFor(char c, int number, String message)
throws LexException {
"""
Check the next character is as expected. If the character is not as expected, throw the message as a
{@link LexException}.
@param c
The expected next character.
@param number
The number of the error message.
@param messa... | java | private void checkFor(char c, int number, String message)
throws LexException
{
if (ch == c)
{
rdCh();
} else
{
throwMessage(number, message);
}
} | [
"private",
"void",
"checkFor",
"(",
"char",
"c",
",",
"int",
"number",
",",
"String",
"message",
")",
"throws",
"LexException",
"{",
"if",
"(",
"ch",
"==",
"c",
")",
"{",
"rdCh",
"(",
")",
";",
"}",
"else",
"{",
"throwMessage",
"(",
"number",
",",
... | Check the next character is as expected. If the character is not as expected, throw the message as a
{@link LexException}.
@param c
The expected next character.
@param number
The number of the error message.
@param message
The error message.
@throws LexException | [
"Check",
"the",
"next",
"character",
"is",
"as",
"expected",
".",
"If",
"the",
"character",
"is",
"not",
"as",
"expected",
"throw",
"the",
"message",
"as",
"a",
"{",
"@link",
"LexException",
"}",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/parser/src/main/java/org/overture/parser/lex/LexTokenReader.java#L320-L330 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isNotPresentDisplayedEnabledSelect | private boolean isNotPresentDisplayedEnabledSelect(String action, String expected) {
"""
Determines if something is present, displayed, enabled, and a select.
This returns true if all four are true, otherwise, it returns false
@param action - what action is occurring
@param expected - what is the expected r... | java | private boolean isNotPresentDisplayedEnabledSelect(String action, String expected) {
// wait for element to be present
if (isNotPresent(action, expected, Element.CANT_SELECT)) {
return true;
}
// wait for element to be displayed
if (isNotDisplayed(action, expected, El... | [
"private",
"boolean",
"isNotPresentDisplayedEnabledSelect",
"(",
"String",
"action",
",",
"String",
"expected",
")",
"{",
"// wait for element to be present",
"if",
"(",
"isNotPresent",
"(",
"action",
",",
"expected",
",",
"Element",
".",
"CANT_SELECT",
")",
")",
"{... | Determines if something is present, displayed, enabled, and a select.
This returns true if all four are true, otherwise, it returns false
@param action - what action is occurring
@param expected - what is the expected result
@return Boolean: is the element present, displayed, enabled, and an
input? | [
"Determines",
"if",
"something",
"is",
"present",
"displayed",
"enabled",
"and",
"a",
"select",
".",
"This",
"returns",
"true",
"if",
"all",
"four",
"are",
"true",
"otherwise",
"it",
"returns",
"false"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L756-L767 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getSAMLAssertionVerifying | public SAMLEndpointResponse getSAMLAssertionVerifying(String appId, String devideId, String stateToken, String otpToken) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Verifies a one-time password (OTP) value provided for a second factor when multi-factor authentication (MFA) is requi... | java | public SAMLEndpointResponse getSAMLAssertionVerifying(String appId, String devideId, String stateToken, String otpToken) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getSAMLAssertionVerifying(appId, devideId, stateToken, otpToken, null);
} | [
"public",
"SAMLEndpointResponse",
"getSAMLAssertionVerifying",
"(",
"String",
"appId",
",",
"String",
"devideId",
",",
"String",
"stateToken",
",",
"String",
"otpToken",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
... | Verifies a one-time password (OTP) value provided for a second factor when multi-factor authentication (MFA) is required for SAML authentication.
@param appId
App ID of the app for which you want to generate a SAML token
@param devideId
Provide the MFA device_id you are submitting for verification.
@param stateToken
P... | [
"Verifies",
"a",
"one",
"-",
"time",
"password",
"(",
"OTP",
")",
"value",
"provided",
"for",
"a",
"second",
"factor",
"when",
"multi",
"-",
"factor",
"authentication",
"(",
"MFA",
")",
"is",
"required",
"for",
"SAML",
"authentication",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2578-L2580 |
JOML-CI/JOML | src/org/joml/Quaterniond.java | Quaterniond.rotationAxis | public Quaterniond rotationAxis(AxisAngle4f axisAngle) {
"""
Set this {@link Quaterniond} to a rotation of the given angle in radians about the supplied
axis, all of which are specified via the {@link AxisAngle4f}.
@see #rotationAxis(double, double, double, double)
@param axisAngle
the {@link AxisAngle4f} ... | java | public Quaterniond rotationAxis(AxisAngle4f axisAngle) {
return rotationAxis(axisAngle.angle, axisAngle.x, axisAngle.y, axisAngle.z);
} | [
"public",
"Quaterniond",
"rotationAxis",
"(",
"AxisAngle4f",
"axisAngle",
")",
"{",
"return",
"rotationAxis",
"(",
"axisAngle",
".",
"angle",
",",
"axisAngle",
".",
"x",
",",
"axisAngle",
".",
"y",
",",
"axisAngle",
".",
"z",
")",
";",
"}"
] | Set this {@link Quaterniond} to a rotation of the given angle in radians about the supplied
axis, all of which are specified via the {@link AxisAngle4f}.
@see #rotationAxis(double, double, double, double)
@param axisAngle
the {@link AxisAngle4f} giving the rotation angle in radians and the axis to rotate about
@retur... | [
"Set",
"this",
"{",
"@link",
"Quaterniond",
"}",
"to",
"a",
"rotation",
"of",
"the",
"given",
"angle",
"in",
"radians",
"about",
"the",
"supplied",
"axis",
"all",
"of",
"which",
"are",
"specified",
"via",
"the",
"{",
"@link",
"AxisAngle4f",
"}",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaterniond.java#L1991-L1993 |
h2oai/h2o-3 | h2o-core/src/main/java/water/util/FrameUtils.java | FrameUtils.parseFrame | public static Frame parseFrame(Key okey, File ...files) throws IOException {
"""
Parse given file(s) into the form of single frame represented by the given key.
@param okey destination key for parsed frame
@param files files to parse
@return a new frame
"""
if (files == null || files.length == 0) {
... | java | public static Frame parseFrame(Key okey, File ...files) throws IOException {
if (files == null || files.length == 0) {
throw new IllegalArgumentException("List of files is empty!");
}
for (File f : files) {
if (!f.exists())
throw new FileNotFoundException("File not found " + f);
}
... | [
"public",
"static",
"Frame",
"parseFrame",
"(",
"Key",
"okey",
",",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"if",
"(",
"files",
"==",
"null",
"||",
"files",
".",
"length",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Parse given file(s) into the form of single frame represented by the given key.
@param okey destination key for parsed frame
@param files files to parse
@return a new frame | [
"Parse",
"given",
"file",
"(",
"s",
")",
"into",
"the",
"form",
"of",
"single",
"frame",
"represented",
"by",
"the",
"given",
"key",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/FrameUtils.java#L31-L44 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/MPXReader.java | MPXReader.populateCalendarException | private void populateCalendarException(Record record, ProjectCalendar calendar) throws MPXJException {
"""
Populates a calendar exception instance.
@param record MPX record
@param calendar calendar to which the exception will be added
@throws MPXJException
"""
Date fromDate = record.getDate(0);
... | java | private void populateCalendarException(Record record, ProjectCalendar calendar) throws MPXJException
{
Date fromDate = record.getDate(0);
Date toDate = record.getDate(1);
boolean working = record.getNumericBoolean(2);
// I have found an example MPX file where a single day exception is expres... | [
"private",
"void",
"populateCalendarException",
"(",
"Record",
"record",
",",
"ProjectCalendar",
"calendar",
")",
"throws",
"MPXJException",
"{",
"Date",
"fromDate",
"=",
"record",
".",
"getDate",
"(",
"0",
")",
";",
"Date",
"toDate",
"=",
"record",
".",
"getD... | Populates a calendar exception instance.
@param record MPX record
@param calendar calendar to which the exception will be added
@throws MPXJException | [
"Populates",
"a",
"calendar",
"exception",
"instance",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/MPXReader.java#L673-L693 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java | Grid.addCoords | public void addCoords(Point3d[] atoms, BoundingBox bounds) {
"""
Adds a set of coordinates, subsequent call to {@link #getIndicesContacts()} will produce the
contacts, i.e. the set of points within distance cutoff.
The bounds calculated elsewhere can be passed, or if null they are computed.
Subsequent calls to ... | java | public void addCoords(Point3d[] atoms, BoundingBox bounds) {
this.iAtoms = atoms;
this.iAtomObjects = null;
if (bounds!=null) {
this.ibounds = bounds;
} else {
this.ibounds = new BoundingBox(iAtoms);
}
this.jAtoms = null;
this.jAtomObjects = null;
this.jbounds = null;
fillGrid();
} | [
"public",
"void",
"addCoords",
"(",
"Point3d",
"[",
"]",
"atoms",
",",
"BoundingBox",
"bounds",
")",
"{",
"this",
".",
"iAtoms",
"=",
"atoms",
";",
"this",
".",
"iAtomObjects",
"=",
"null",
";",
"if",
"(",
"bounds",
"!=",
"null",
")",
"{",
"this",
".... | Adds a set of coordinates, subsequent call to {@link #getIndicesContacts()} will produce the
contacts, i.e. the set of points within distance cutoff.
The bounds calculated elsewhere can be passed, or if null they are computed.
Subsequent calls to method {@link #getAtomContacts()} will produce a NullPointerException
sin... | [
"Adds",
"a",
"set",
"of",
"coordinates",
"subsequent",
"call",
"to",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java#L267-L282 |
workplacesystems/queuj | src/main/java/com/workplacesystems/queuj/Queue.java | Queue.newProcessBuilder | private B newProcessBuilder(Class[] param_types, Object[] params) {
"""
Private method to instantiate the Queues ProcessBuilder. Will ask the parent Queue
to instantiate its ProcessBuilder if this Queue doesn't have one.
"""
if (process_builder_class != null)
{
try
{
... | java | private B newProcessBuilder(Class[] param_types, Object[] params)
{
if (process_builder_class != null)
{
try
{
Constructor<B> constructor = process_builder_class.getDeclaredConstructor(param_types);
return constructor.newInstance(params);
... | [
"private",
"B",
"newProcessBuilder",
"(",
"Class",
"[",
"]",
"param_types",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"if",
"(",
"process_builder_class",
"!=",
"null",
")",
"{",
"try",
"{",
"Constructor",
"<",
"B",
">",
"constructor",
"=",
"process_buil... | Private method to instantiate the Queues ProcessBuilder. Will ask the parent Queue
to instantiate its ProcessBuilder if this Queue doesn't have one. | [
"Private",
"method",
"to",
"instantiate",
"the",
"Queues",
"ProcessBuilder",
".",
"Will",
"ask",
"the",
"parent",
"Queue",
"to",
"instantiate",
"its",
"ProcessBuilder",
"if",
"this",
"Queue",
"doesn",
"t",
"have",
"one",
"."
] | train | https://github.com/workplacesystems/queuj/blob/4293116b412b4a20ead99963b9b05a135812c501/src/main/java/com/workplacesystems/queuj/Queue.java#L127-L147 |
apache/flink | flink-connectors/flink-connector-kafka-0.11/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/FlinkKafkaProducer.java | FlinkKafkaProducer.resumeTransaction | public void resumeTransaction(long producerId, short epoch) {
"""
Instead of obtaining producerId and epoch from the transaction coordinator, re-use previously obtained ones,
so that we can resume transaction after a restart. Implementation of this method is based on
{@link org.apache.kafka.clients.producer.Kafk... | java | public void resumeTransaction(long producerId, short epoch) {
Preconditions.checkState(producerId >= 0 && epoch >= 0, "Incorrect values for producerId {} and epoch {}", producerId, epoch);
LOG.info("Attempting to resume transaction {} with producerId {} and epoch {}", transactionalId, producerId, epoch);
Object ... | [
"public",
"void",
"resumeTransaction",
"(",
"long",
"producerId",
",",
"short",
"epoch",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"producerId",
">=",
"0",
"&&",
"epoch",
">=",
"0",
",",
"\"Incorrect values for producerId {} and epoch {}\"",
",",
"producerI... | Instead of obtaining producerId and epoch from the transaction coordinator, re-use previously obtained ones,
so that we can resume transaction after a restart. Implementation of this method is based on
{@link org.apache.kafka.clients.producer.KafkaProducer#initTransactions}. | [
"Instead",
"of",
"obtaining",
"producerId",
"and",
"epoch",
"from",
"the",
"transaction",
"coordinator",
"re",
"-",
"use",
"previously",
"obtained",
"ones",
"so",
"that",
"we",
"can",
"resume",
"transaction",
"after",
"a",
"restart",
".",
"Implementation",
"of",... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.11/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/FlinkKafkaProducer.java#L191-L211 |
jayantk/jklol | src/com/jayantkrish/jklol/boost/ParametricFactorGraphEnsembleBuilder.java | ParametricFactorGraphEnsembleBuilder.addUnreplicatedFactor | public void addUnreplicatedFactor(String factorName, BoostingFactorFamily factor) {
"""
Adds a parameterized, unreplicated factor to the model being constructed.
The factor will match only the variables which it is defined over.
@param factor
"""
super.addUnreplicatedFactor(factorName, factor, factor.g... | java | public void addUnreplicatedFactor(String factorName, BoostingFactorFamily factor) {
super.addUnreplicatedFactor(factorName, factor, factor.getVariables());
} | [
"public",
"void",
"addUnreplicatedFactor",
"(",
"String",
"factorName",
",",
"BoostingFactorFamily",
"factor",
")",
"{",
"super",
".",
"addUnreplicatedFactor",
"(",
"factorName",
",",
"factor",
",",
"factor",
".",
"getVariables",
"(",
")",
")",
";",
"}"
] | Adds a parameterized, unreplicated factor to the model being constructed.
The factor will match only the variables which it is defined over.
@param factor | [
"Adds",
"a",
"parameterized",
"unreplicated",
"factor",
"to",
"the",
"model",
"being",
"constructed",
".",
"The",
"factor",
"will",
"match",
"only",
"the",
"variables",
"which",
"it",
"is",
"defined",
"over",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/boost/ParametricFactorGraphEnsembleBuilder.java#L43-L45 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.validateAsync | public Observable<Void> validateAsync(String resourceGroupName, String location, String workflowName, WorkflowInner workflow) {
"""
Validates the workflow definition.
@param resourceGroupName The resource group name.
@param location The workflow location.
@param workflowName The workflow name.
@param workflo... | java | public Observable<Void> validateAsync(String resourceGroupName, String location, String workflowName, WorkflowInner workflow) {
return validateWithServiceResponseAsync(resourceGroupName, location, workflowName, workflow).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Voi... | [
"public",
"Observable",
"<",
"Void",
">",
"validateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"location",
",",
"String",
"workflowName",
",",
"WorkflowInner",
"workflow",
")",
"{",
"return",
"validateWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Validates the workflow definition.
@param resourceGroupName The resource group name.
@param location The workflow location.
@param workflowName The workflow name.
@param workflow The workflow definition.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} objec... | [
"Validates",
"the",
"workflow",
"definition",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L1881-L1888 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java | FeatureIO.textToBinary | public static void textToBinary(String featuresFolder, final String featureType, int featureLength)
throws Exception {
"""
Takes a folder with feature files in text format and converts them to binary.
@param featuresFolder
@param featureType
@param featureLength
@throws Exception
"""
// read the f... | java | public static void textToBinary(String featuresFolder, final String featureType, int featureLength)
throws Exception {
// read the folder containing the description files
File dir = new File(featuresFolder);
FilenameFilter filter = new FilenameFilter() {
public boolean accept(File dir, String name) {
... | [
"public",
"static",
"void",
"textToBinary",
"(",
"String",
"featuresFolder",
",",
"final",
"String",
"featureType",
",",
"int",
"featureLength",
")",
"throws",
"Exception",
"{",
"// read the folder containing the description files\r",
"File",
"dir",
"=",
"new",
"File",
... | Takes a folder with feature files in text format and converts them to binary.
@param featuresFolder
@param featureType
@param featureLength
@throws Exception | [
"Takes",
"a",
"folder",
"with",
"feature",
"files",
"in",
"text",
"format",
"and",
"converts",
"them",
"to",
"binary",
"."
] | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java#L140-L171 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/BatchOperation.java | BatchOperation.addReportQuery | public void addReportQuery(String reportQuery, String bId) {
"""
Method to add the report query batch operation to batchItemRequest
@param reportQuery
@param bId
"""
BatchItemRequest batchItemRequest = new BatchItemRequest();
batchItemRequest.setBId(bId);
batchItemRequest.setReportQuery(reportQuer... | java | public void addReportQuery(String reportQuery, String bId) {
BatchItemRequest batchItemRequest = new BatchItemRequest();
batchItemRequest.setBId(bId);
batchItemRequest.setReportQuery(reportQuery);
batchItemRequests.add(batchItemRequest);
bIds.add(bId);
} | [
"public",
"void",
"addReportQuery",
"(",
"String",
"reportQuery",
",",
"String",
"bId",
")",
"{",
"BatchItemRequest",
"batchItemRequest",
"=",
"new",
"BatchItemRequest",
"(",
")",
";",
"batchItemRequest",
".",
"setBId",
"(",
"bId",
")",
";",
"batchItemRequest",
... | Method to add the report query batch operation to batchItemRequest
@param reportQuery
@param bId | [
"Method",
"to",
"add",
"the",
"report",
"query",
"batch",
"operation",
"to",
"batchItemRequest"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/BatchOperation.java#L169-L177 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesInner.java | StreamingPoliciesInner.listAsync | public Observable<Page<StreamingPolicyInner>> listAsync(final String resourceGroupName, final String accountName) {
"""
List Streaming Policies.
Lists the Streaming Policies in the account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Serv... | java | public Observable<Page<StreamingPolicyInner>> listAsync(final String resourceGroupName, final String accountName) {
return listWithServiceResponseAsync(resourceGroupName, accountName)
.map(new Func1<ServiceResponse<Page<StreamingPolicyInner>>, Page<StreamingPolicyInner>>() {
@Overrid... | [
"public",
"Observable",
"<",
"Page",
"<",
"StreamingPolicyInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName... | List Streaming Policies.
Lists the Streaming Policies in the account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedL... | [
"List",
"Streaming",
"Policies",
".",
"Lists",
"the",
"Streaming",
"Policies",
"in",
"the",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesInner.java#L138-L146 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/script/Script.java | Script.getSigOpCount | public static int getSigOpCount(byte[] program) throws ScriptException {
"""
Gets the count of regular SigOps in the script program (counting multisig ops as 20)
"""
Script script = new Script();
try {
script.parse(program);
} catch (ScriptException e) {
// Ignor... | java | public static int getSigOpCount(byte[] program) throws ScriptException {
Script script = new Script();
try {
script.parse(program);
} catch (ScriptException e) {
// Ignore errors and count up to the parse-able length
}
return getSigOpCount(script.chunks, f... | [
"public",
"static",
"int",
"getSigOpCount",
"(",
"byte",
"[",
"]",
"program",
")",
"throws",
"ScriptException",
"{",
"Script",
"script",
"=",
"new",
"Script",
"(",
")",
";",
"try",
"{",
"script",
".",
"parse",
"(",
"program",
")",
";",
"}",
"catch",
"(... | Gets the count of regular SigOps in the script program (counting multisig ops as 20) | [
"Gets",
"the",
"count",
"of",
"regular",
"SigOps",
"in",
"the",
"script",
"program",
"(",
"counting",
"multisig",
"ops",
"as",
"20",
")"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/Script.java#L560-L568 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/providers/googledrive/GoogleDrive.java | GoogleDrive.rawCreateFolder | private String rawCreateFolder( CPath path, String parentId ) {
"""
Create a folder without creating any higher level intermediate folders, and returned id of created folder.
@param path
@param parentId
@return id of created folder
"""
JSONObject body = new JSONObject();
body.put( "title",... | java | private String rawCreateFolder( CPath path, String parentId )
{
JSONObject body = new JSONObject();
body.put( "title", path.getBaseName() );
body.put( "mimeType", MIME_TYPE_DIRECTORY );
JSONArray ids = new JSONArray();
JSONObject idObj = new JSONObject();
idObj.put( "... | [
"private",
"String",
"rawCreateFolder",
"(",
"CPath",
"path",
",",
"String",
"parentId",
")",
"{",
"JSONObject",
"body",
"=",
"new",
"JSONObject",
"(",
")",
";",
"body",
".",
"put",
"(",
"\"title\"",
",",
"path",
".",
"getBaseName",
"(",
")",
")",
";",
... | Create a folder without creating any higher level intermediate folders, and returned id of created folder.
@param path
@param parentId
@return id of created folder | [
"Create",
"a",
"folder",
"without",
"creating",
"any",
"higher",
"level",
"intermediate",
"folders",
"and",
"returned",
"id",
"of",
"created",
"folder",
"."
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/googledrive/GoogleDrive.java#L374-L391 |
zaproxy/zaproxy | src/org/zaproxy/zap/spider/Spider.java | Spider.isDefaultPort | private static boolean isDefaultPort(String scheme, int port) {
"""
Tells whether or not the given port is the default for the given scheme.
<p>
Only intended to be used with HTTP/S schemes.
@param scheme the scheme.
@param port the port.
@return {@code true} if the given port is the default for the given s... | java | private static boolean isDefaultPort(String scheme, int port) {
if (port == -1) {
return true;
}
if ("http".equalsIgnoreCase(scheme)) {
return port == 80;
}
if ("https".equalsIgnoreCase(scheme)) {
return port == 443;
}
return false;
} | [
"private",
"static",
"boolean",
"isDefaultPort",
"(",
"String",
"scheme",
",",
"int",
"port",
")",
"{",
"if",
"(",
"port",
"==",
"-",
"1",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"\"http\"",
".",
"equalsIgnoreCase",
"(",
"scheme",
")",
")",
... | Tells whether or not the given port is the default for the given scheme.
<p>
Only intended to be used with HTTP/S schemes.
@param scheme the scheme.
@param port the port.
@return {@code true} if the given port is the default for the given scheme, {@code false} otherwise. | [
"Tells",
"whether",
"or",
"not",
"the",
"given",
"port",
"is",
"the",
"default",
"for",
"the",
"given",
"scheme",
".",
"<p",
">",
"Only",
"intended",
"to",
"be",
"used",
"with",
"HTTP",
"/",
"S",
"schemes",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/Spider.java#L350-L364 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/Pattern.java | Pattern.updateLabel | public void updateLabel(String oldLabel, String newLabel) {
"""
Changes a label. The oldLabel has to be an existing label and new label has to be a new
label.
@param oldLabel label to update
@param newLabel updated label
"""
if (hasLabel(newLabel)) throw new IllegalArgumentException(
"The label \"" + n... | java | public void updateLabel(String oldLabel, String newLabel)
{
if (hasLabel(newLabel)) throw new IllegalArgumentException(
"The label \"" + newLabel + "\" already exists.");
int i = indexOf(oldLabel);
labelMap.remove(oldLabel);
labelMap.put(newLabel, i);
} | [
"public",
"void",
"updateLabel",
"(",
"String",
"oldLabel",
",",
"String",
"newLabel",
")",
"{",
"if",
"(",
"hasLabel",
"(",
"newLabel",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The label \\\"\"",
"+",
"newLabel",
"+",
"\"\\\" already exists.\... | Changes a label. The oldLabel has to be an existing label and new label has to be a new
label.
@param oldLabel label to update
@param newLabel updated label | [
"Changes",
"a",
"label",
".",
"The",
"oldLabel",
"has",
"to",
"be",
"an",
"existing",
"label",
"and",
"new",
"label",
"has",
"to",
"be",
"a",
"new",
"label",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Pattern.java#L417-L425 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java | EJSContainer.addBean | public BeanO addBean(BeanO beanO, ContainerTx containerTx) throws DuplicateKeyException, RemoteException {
"""
Add the bean associated with the given <code>BeanO</code> to this
container in the context of the given transaction. <p>
If a bean with the same identity already exists in this container
within the s... | java | public BeanO addBean(BeanO beanO, ContainerTx containerTx) throws DuplicateKeyException, RemoteException {
return activator.addBean(containerTx, beanO);
} | [
"public",
"BeanO",
"addBean",
"(",
"BeanO",
"beanO",
",",
"ContainerTx",
"containerTx",
")",
"throws",
"DuplicateKeyException",
",",
"RemoteException",
"{",
"return",
"activator",
".",
"addBean",
"(",
"containerTx",
",",
"beanO",
")",
";",
"}"
] | Add the bean associated with the given <code>BeanO</code> to this
container in the context of the given transaction. <p>
If a bean with the same identity already exists in this container
within the same transaction context then the bean is not added
and the <code>BeanO</code> associated with the existing bean is
retur... | [
"Add",
"the",
"bean",
"associated",
"with",
"the",
"given",
"<code",
">",
"BeanO<",
"/",
"code",
">",
"to",
"this",
"container",
"in",
"the",
"context",
"of",
"the",
"given",
"transaction",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java#L1777-L1779 |
rampo/UpdateChecker | library/src/main/java/com/rampo/updatechecker/UpdateChecker.java | UpdateChecker.saveNumberOfChecksForUpdatedVersion | private void saveNumberOfChecksForUpdatedVersion(String versionDownloadable, int mChecksMade) {
"""
Update number of checks for this version downloadable from the Store.
"""
mChecksMade++;
SharedPreferences prefs = mActivity.getSharedPreferences(PREFS_FILENAME, 0);
SharedPreferences.Edi... | java | private void saveNumberOfChecksForUpdatedVersion(String versionDownloadable, int mChecksMade) {
mChecksMade++;
SharedPreferences prefs = mActivity.getSharedPreferences(PREFS_FILENAME, 0);
SharedPreferences.Editor editor = prefs.edit();
editor.putInt(SUCCESSFUL_CHEKS_PREF_KEY + versionDow... | [
"private",
"void",
"saveNumberOfChecksForUpdatedVersion",
"(",
"String",
"versionDownloadable",
",",
"int",
"mChecksMade",
")",
"{",
"mChecksMade",
"++",
";",
"SharedPreferences",
"prefs",
"=",
"mActivity",
".",
"getSharedPreferences",
"(",
"PREFS_FILENAME",
",",
"0",
... | Update number of checks for this version downloadable from the Store. | [
"Update",
"number",
"of",
"checks",
"for",
"this",
"version",
"downloadable",
"from",
"the",
"Store",
"."
] | train | https://github.com/rampo/UpdateChecker/blob/738da234d46396b6396e15e7261f38b0cabf9913/library/src/main/java/com/rampo/updatechecker/UpdateChecker.java#L276-L283 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/util/BoundedSortedMap.java | BoundedSortedMap.put | public V put(K key, V value) {
"""
Adds the key-value mapping to this map, and if the total number of
mappings exceeds the bounds, removes either the currently lowest element,
or if reversed, the currently highest element.
@param key {@inheritDoc}
@param value {@inheritDoc}
"""
V old = super.put(key, va... | java | public V put(K key, V value) {
V old = super.put(key, value);
if (size() > bound) {
remove(firstKey());
}
return old;
} | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"V",
"old",
"=",
"super",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"if",
"(",
"size",
"(",
")",
">",
"bound",
")",
"{",
"remove",
"(",
"firstKey",
"(",
")",
")",
";"... | Adds the key-value mapping to this map, and if the total number of
mappings exceeds the bounds, removes either the currently lowest element,
or if reversed, the currently highest element.
@param key {@inheritDoc}
@param value {@inheritDoc} | [
"Adds",
"the",
"key",
"-",
"value",
"mapping",
"to",
"this",
"map",
"and",
"if",
"the",
"total",
"number",
"of",
"mappings",
"exceeds",
"the",
"bounds",
"removes",
"either",
"the",
"currently",
"lowest",
"element",
"or",
"if",
"reversed",
"the",
"currently",... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/BoundedSortedMap.java#L75-L81 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/StringUtils.java | StringUtils.getBytesUtf8 | public static byte[] getBytesUtf8(String string) {
"""
Encodes the given string into a sequence of bytes using the UTF-8 charset, storing the result
into a new byte array.
@param string the String to encode, may be <code>null</code>
@return encoded bytes, or <code>null</code> if the input string was <code>nul... | java | public static byte[] getBytesUtf8(String string) {
if (string == null) {
return null;
}
return string.getBytes(StandardCharsets.UTF_8);
} | [
"public",
"static",
"byte",
"[",
"]",
"getBytesUtf8",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"string",
".",
"getBytes",
"(",
"StandardCharsets",
".",
"UTF_8",
")",
";",
"}"
... | Encodes the given string into a sequence of bytes using the UTF-8 charset, storing the result
into a new byte array.
@param string the String to encode, may be <code>null</code>
@return encoded bytes, or <code>null</code> if the input string was <code>null</code>
@throws IllegalStateException Thrown when the charset i... | [
"Encodes",
"the",
"given",
"string",
"into",
"a",
"sequence",
"of",
"bytes",
"using",
"the",
"UTF",
"-",
"8",
"charset",
"storing",
"the",
"result",
"into",
"a",
"new",
"byte",
"array",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/StringUtils.java#L47-L52 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/schema/ElasticSearchSchemaService.java | ElasticSearchSchemaService.toEntity | private <T> T toEntity(String content, TypeReference<T> type) {
"""
/* Helper method to convert JSON String representation to the corresponding Java entity.
"""
try {
return _mapper.readValue(content, type);
} catch (IOException ex) {
throw new SystemException(ex);
}
} | java | private <T> T toEntity(String content, TypeReference<T> type) {
try {
return _mapper.readValue(content, type);
} catch (IOException ex) {
throw new SystemException(ex);
}
} | [
"private",
"<",
"T",
">",
"T",
"toEntity",
"(",
"String",
"content",
",",
"TypeReference",
"<",
"T",
">",
"type",
")",
"{",
"try",
"{",
"return",
"_mapper",
".",
"readValue",
"(",
"content",
",",
"type",
")",
";",
"}",
"catch",
"(",
"IOException",
"e... | /* Helper method to convert JSON String representation to the corresponding Java entity. | [
"/",
"*",
"Helper",
"method",
"to",
"convert",
"JSON",
"String",
"representation",
"to",
"the",
"corresponding",
"Java",
"entity",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/schema/ElasticSearchSchemaService.java#L1372-L1378 |
teknux-org/jetty-bootstrap | jetty-bootstrap/src/main/java/org/teknux/jettybootstrap/JettyBootstrap.java | JettyBootstrap.addWarAppFromClasspath | public WebAppContext addWarAppFromClasspath(String warFromClasspath, String contextPath) throws JettyBootstrapException {
"""
Add a War application from the current classpath specifying the context path.
@param warFromClasspath
the path to a war file in the classpath
@param contextPath
the path (base URL) to... | java | public WebAppContext addWarAppFromClasspath(String warFromClasspath, String contextPath) throws JettyBootstrapException {
WarAppFromClasspathJettyHandler warAppFromClasspathJettyHandler = new WarAppFromClasspathJettyHandler(getInitializedConfiguration());
warAppFromClasspathJettyHandler.setWarFromClassp... | [
"public",
"WebAppContext",
"addWarAppFromClasspath",
"(",
"String",
"warFromClasspath",
",",
"String",
"contextPath",
")",
"throws",
"JettyBootstrapException",
"{",
"WarAppFromClasspathJettyHandler",
"warAppFromClasspathJettyHandler",
"=",
"new",
"WarAppFromClasspathJettyHandler",
... | Add a War application from the current classpath specifying the context path.
@param warFromClasspath
the path to a war file in the classpath
@param contextPath
the path (base URL) to make the war available
@return WebAppContext
@throws JettyBootstrapException
on failed | [
"Add",
"a",
"War",
"application",
"from",
"the",
"current",
"classpath",
"specifying",
"the",
"context",
"path",
"."
] | train | https://github.com/teknux-org/jetty-bootstrap/blob/c16e710b833084c650fce35aa8c1ccaf83cd93ef/jetty-bootstrap/src/main/java/org/teknux/jettybootstrap/JettyBootstrap.java#L283-L292 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.moduleList_id_GET | public OvhModuleList moduleList_id_GET(Long id) throws IOException {
"""
Get this object properties
REST: GET /hosting/web/moduleList/{id}
@param id [required] The ID of the module
"""
String qPath = "/hosting/web/moduleList/{id}";
StringBuilder sb = path(qPath, id);
String resp = execN(qPath, "GET",... | java | public OvhModuleList moduleList_id_GET(Long id) throws IOException {
String qPath = "/hosting/web/moduleList/{id}";
StringBuilder sb = path(qPath, id);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhModuleList.class);
} | [
"public",
"OvhModuleList",
"moduleList_id_GET",
"(",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/moduleList/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"id",
")",
";",
"String",
"resp",
"=",
... | Get this object properties
REST: GET /hosting/web/moduleList/{id}
@param id [required] The ID of the module | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L2322-L2327 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRuleUserSegmentRelPersistenceImpl.java | CPRuleUserSegmentRelPersistenceImpl.findByCPRuleId | @Override
public List<CPRuleUserSegmentRel> findByCPRuleId(long CPRuleId, int start,
int end) {
"""
Returns a range of all the cp rule user segment rels where CPRuleId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code... | java | @Override
public List<CPRuleUserSegmentRel> findByCPRuleId(long CPRuleId, int start,
int end) {
return findByCPRuleId(CPRuleId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPRuleUserSegmentRel",
">",
"findByCPRuleId",
"(",
"long",
"CPRuleId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCPRuleId",
"(",
"CPRuleId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
... | Returns a range of all the cp rule user segment rels where CPRuleId = ?.
<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 ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"rule",
"user",
"segment",
"rels",
"where",
"CPRuleId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRuleUserSegmentRelPersistenceImpl.java#L140-L144 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/graphics/SimpleTheme.java | SimpleTheme.makeTheme | public static SimpleTheme makeTheme(
boolean activeIsBold,
TextColor baseForeground,
TextColor baseBackground,
TextColor editableForeground,
TextColor editableBackground,
TextColor selectedForeground,
TextColor selectedBackground,
... | java | public static SimpleTheme makeTheme(
boolean activeIsBold,
TextColor baseForeground,
TextColor baseBackground,
TextColor editableForeground,
TextColor editableBackground,
TextColor selectedForeground,
TextColor selectedBackground,
... | [
"public",
"static",
"SimpleTheme",
"makeTheme",
"(",
"boolean",
"activeIsBold",
",",
"TextColor",
"baseForeground",
",",
"TextColor",
"baseBackground",
",",
"TextColor",
"editableForeground",
",",
"TextColor",
"editableBackground",
",",
"TextColor",
"selectedForeground",
... | Helper method that will quickly setup a new theme with some sensible component overrides.
@param activeIsBold Should focused components also use bold SGR style?
@param baseForeground The base foreground color of the theme
@param baseBackground The base background color of the theme
@param editableForeground Foreground ... | [
"Helper",
"method",
"that",
"will",
"quickly",
"setup",
"a",
"new",
"theme",
"with",
"some",
"sensible",
"component",
"overrides",
"."
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/graphics/SimpleTheme.java#L49-L96 |
phax/ph-oton | ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java | FineUploaderBasic.setParams | @Nonnull
public FineUploaderBasic setParams (@Nullable final Map <String, String> aParams) {
"""
These parameters are sent with the request to the endpoint specified in the
action option.
@param aParams
New parameters to be set.
@return this
"""
m_aRequestParams.setAll (aParams);
return this;
... | java | @Nonnull
public FineUploaderBasic setParams (@Nullable final Map <String, String> aParams)
{
m_aRequestParams.setAll (aParams);
return this;
} | [
"@",
"Nonnull",
"public",
"FineUploaderBasic",
"setParams",
"(",
"@",
"Nullable",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"aParams",
")",
"{",
"m_aRequestParams",
".",
"setAll",
"(",
"aParams",
")",
";",
"return",
"this",
";",
"}"
] | These parameters are sent with the request to the endpoint specified in the
action option.
@param aParams
New parameters to be set.
@return this | [
"These",
"parameters",
"are",
"sent",
"with",
"the",
"request",
"to",
"the",
"endpoint",
"specified",
"in",
"the",
"action",
"option",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java#L167-L172 |
googlegenomics/utils-java | src/main/java/com/google/cloud/genomics/utils/grpc/GenomicsChannel.java | GenomicsChannel.fromCreds | public static ManagedChannel fromCreds(GoogleCredentials creds, String fields) throws SSLException {
"""
Create a new gRPC channel to the Google Genomics API, using the provided credentials for auth.
@param creds The credential.
@param fields Which fields to return in the partial response, or null for none.
@... | java | public static ManagedChannel fromCreds(GoogleCredentials creds, String fields) throws SSLException {
List<ClientInterceptor> interceptors = new ArrayList();
interceptors.add(new ClientAuthInterceptor(creds.createScoped(Arrays.asList(GENOMICS_SCOPE)),
Executors.newSingleThreadExecutor()));
if (!Strin... | [
"public",
"static",
"ManagedChannel",
"fromCreds",
"(",
"GoogleCredentials",
"creds",
",",
"String",
"fields",
")",
"throws",
"SSLException",
"{",
"List",
"<",
"ClientInterceptor",
">",
"interceptors",
"=",
"new",
"ArrayList",
"(",
")",
";",
"interceptors",
".",
... | Create a new gRPC channel to the Google Genomics API, using the provided credentials for auth.
@param creds The credential.
@param fields Which fields to return in the partial response, or null for none.
@return The ManagedChannel.
@throws SSLException | [
"Create",
"a",
"new",
"gRPC",
"channel",
"to",
"the",
"Google",
"Genomics",
"API",
"using",
"the",
"provided",
"credentials",
"for",
"auth",
"."
] | train | https://github.com/googlegenomics/utils-java/blob/7205d5b4e4f61fc6b93acb4bdd76b93df5b5f612/src/main/java/com/google/cloud/genomics/utils/grpc/GenomicsChannel.java#L74-L86 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/BufferUtil.java | BufferUtil.copy | public static ByteBuffer copy(ByteBuffer src, int start, int end) {
"""
拷贝到一个新的ByteBuffer
@param src 源ByteBuffer
@param start 起始位置(包括)
@param end 结束位置(不包括)
@return 新的ByteBuffer
"""
return copy(src, ByteBuffer.allocate(end - start));
} | java | public static ByteBuffer copy(ByteBuffer src, int start, int end) {
return copy(src, ByteBuffer.allocate(end - start));
} | [
"public",
"static",
"ByteBuffer",
"copy",
"(",
"ByteBuffer",
"src",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"copy",
"(",
"src",
",",
"ByteBuffer",
".",
"allocate",
"(",
"end",
"-",
"start",
")",
")",
";",
"}"
] | 拷贝到一个新的ByteBuffer
@param src 源ByteBuffer
@param start 起始位置(包括)
@param end 结束位置(不包括)
@return 新的ByteBuffer | [
"拷贝到一个新的ByteBuffer"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/BufferUtil.java#L28-L30 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/model/Model.java | Model.addDef | public boolean addDef(String sec, String key, String value) {
"""
addDef adds an assertion to the model.
@param sec the section, "p" or "g".
@param key the policy type, "p", "p2", .. or "g", "g2", ..
@param value the policy rule, separated by ", ".
@return succeeds or not.
"""
Assertion ast = new... | java | public boolean addDef(String sec, String key, String value) {
Assertion ast = new Assertion();
ast.key = key;
ast.value = value;
if (ast.value.equals("")) {
return false;
}
if (sec.equals("r") || sec.equals("p")) {
ast.tokens = ast.value.split(",... | [
"public",
"boolean",
"addDef",
"(",
"String",
"sec",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"Assertion",
"ast",
"=",
"new",
"Assertion",
"(",
")",
";",
"ast",
".",
"key",
"=",
"key",
";",
"ast",
".",
"value",
"=",
"value",
";",
"if... | addDef adds an assertion to the model.
@param sec the section, "p" or "g".
@param key the policy type, "p", "p2", .. or "g", "g2", ..
@param value the policy rule, separated by ", ".
@return succeeds or not. | [
"addDef",
"adds",
"an",
"assertion",
"to",
"the",
"model",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/model/Model.java#L57-L81 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/InetAddress.java | InetAddress.getByNameOnNet | public static InetAddress getByNameOnNet(String host, int netId) throws UnknownHostException {
"""
Operates identically to {@code getByName} except host resolution is
performed on the network designated by {@code netId}.
@param host
the hostName to be resolved to an address or {@code null}.
@param netId the ... | java | public static InetAddress getByNameOnNet(String host, int netId) throws UnknownHostException {
return impl.lookupAllHostAddr(host, netId)[0];
} | [
"public",
"static",
"InetAddress",
"getByNameOnNet",
"(",
"String",
"host",
",",
"int",
"netId",
")",
"throws",
"UnknownHostException",
"{",
"return",
"impl",
".",
"lookupAllHostAddr",
"(",
"host",
",",
"netId",
")",
"[",
"0",
"]",
";",
"}"
] | Operates identically to {@code getByName} except host resolution is
performed on the network designated by {@code netId}.
@param host
the hostName to be resolved to an address or {@code null}.
@param netId the network to use for host resolution.
@return the {@code InetAddress} instance representing the host.
@throws U... | [
"Operates",
"identically",
"to",
"{",
"@code",
"getByName",
"}",
"except",
"host",
"resolution",
"is",
"performed",
"on",
"the",
"network",
"designated",
"by",
"{",
"@code",
"netId",
"}",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/InetAddress.java#L970-L972 |
killme2008/xmemcached | src/main/java/net/rubyeye/xmemcached/aws/AWSUtils.java | AWSUtils.parseConfiguration | public static ClusterConfigration parseConfiguration(String line) {
"""
Parse response string to ClusterConfiguration instance.
@param line
@return
"""
String[] lines = line.trim().split("(?:\\r?\\n)");
if (lines.length < 2) {
throw new IllegalArgumentException("Incorrect config response:" + ... | java | public static ClusterConfigration parseConfiguration(String line) {
String[] lines = line.trim().split("(?:\\r?\\n)");
if (lines.length < 2) {
throw new IllegalArgumentException("Incorrect config response:" + line);
}
String configversion = lines[0];
String nodeListStr = lines[1];
if (!Byt... | [
"public",
"static",
"ClusterConfigration",
"parseConfiguration",
"(",
"String",
"line",
")",
"{",
"String",
"[",
"]",
"lines",
"=",
"line",
".",
"trim",
"(",
")",
".",
"split",
"(",
"\"(?:\\\\r?\\\\n)\"",
")",
";",
"if",
"(",
"lines",
".",
"length",
"<",
... | Parse response string to ClusterConfiguration instance.
@param line
@return | [
"Parse",
"response",
"string",
"to",
"ClusterConfiguration",
"instance",
"."
] | train | https://github.com/killme2008/xmemcached/blob/66150915938813b3e3413de1d7b43b6ff9b1478d/src/main/java/net/rubyeye/xmemcached/aws/AWSUtils.java#L23-L57 |
lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/util/FileUtils.java | FileUtils.isTargetValid | private static boolean isTargetValid(File fi, boolean ignoreCase, String... fileExt) {
"""
是否是符合特殊的文件格式, 如果 fi 或者 fileExt 是null, 空, 将会直接返回TRUE.
@param fi
@param ignoreCase
@param fileExt
@return
"""
if (fi == null || fileExt == null || fileExt.length == 0)
return true;
String... | java | private static boolean isTargetValid(File fi, boolean ignoreCase, String... fileExt) {
if (fi == null || fileExt == null || fileExt.length == 0)
return true;
String ext = getExtension(fi);
for (String str : fileExt) {
if (ignoreCase ? ext.equalsIgnoreCase(str) : ext.equ... | [
"private",
"static",
"boolean",
"isTargetValid",
"(",
"File",
"fi",
",",
"boolean",
"ignoreCase",
",",
"String",
"...",
"fileExt",
")",
"{",
"if",
"(",
"fi",
"==",
"null",
"||",
"fileExt",
"==",
"null",
"||",
"fileExt",
".",
"length",
"==",
"0",
")",
"... | 是否是符合特殊的文件格式, 如果 fi 或者 fileExt 是null, 空, 将会直接返回TRUE.
@param fi
@param ignoreCase
@param fileExt
@return | [
"是否是符合特殊的文件格式",
"如果",
"fi",
"或者",
"fileExt",
"是null",
"空",
"将会直接返回TRUE",
"."
] | train | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/util/FileUtils.java#L92-L104 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java | EvaluationBinary.fBeta | public double fBeta(double beta, int outputNum) {
"""
Calculate the F-beta value for the given output
@param beta Beta value to use
@param outputNum Output number
@return F-beta for the given output
"""
assertIndex(outputNum);
double precision = precision(outputNum);
double re... | java | public double fBeta(double beta, int outputNum) {
assertIndex(outputNum);
double precision = precision(outputNum);
double recall = recall(outputNum);
return EvaluationUtils.fBeta(beta, precision, recall);
} | [
"public",
"double",
"fBeta",
"(",
"double",
"beta",
",",
"int",
"outputNum",
")",
"{",
"assertIndex",
"(",
"outputNum",
")",
";",
"double",
"precision",
"=",
"precision",
"(",
"outputNum",
")",
";",
"double",
"recall",
"=",
"recall",
"(",
"outputNum",
")",... | Calculate the F-beta value for the given output
@param beta Beta value to use
@param outputNum Output number
@return F-beta for the given output | [
"Calculate",
"the",
"F",
"-",
"beta",
"value",
"for",
"the",
"given",
"output"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java#L414-L419 |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/util/db/DbUtils.java | DbUtils.printWarnings | public static void printWarnings(Connection conn, PrintWriter pw) {
"""
Print warnings on a Connection to a specified PrintWriter.
@param conn Connection to print warnings from
@param pw PrintWriter to print to
"""
if (conn != null) {
try {
printStackTrace(conn.getWarnin... | java | public static void printWarnings(Connection conn, PrintWriter pw) {
if (conn != null) {
try {
printStackTrace(conn.getWarnings(), pw);
} catch (SQLException e) {
printStackTrace(e, pw);
}
}
} | [
"public",
"static",
"void",
"printWarnings",
"(",
"Connection",
"conn",
",",
"PrintWriter",
"pw",
")",
"{",
"if",
"(",
"conn",
"!=",
"null",
")",
"{",
"try",
"{",
"printStackTrace",
"(",
"conn",
".",
"getWarnings",
"(",
")",
",",
"pw",
")",
";",
"}",
... | Print warnings on a Connection to a specified PrintWriter.
@param conn Connection to print warnings from
@param pw PrintWriter to print to | [
"Print",
"warnings",
"on",
"a",
"Connection",
"to",
"a",
"specified",
"PrintWriter",
"."
] | train | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/util/db/DbUtils.java#L234-L242 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java | TypicalLoginAssist.doSaveRememberMeCookie | protected void doSaveRememberMeCookie(USER_ENTITY userEntity, USER_BEAN userBean, int expireDays, String cookieKey) {
"""
Do save remember-me key to cookie.
@param userEntity The selected entity of login user. (NotNull)
@param userBean The user bean saved in session. (NotNull)
@param expireDays The expire days ... | java | protected void doSaveRememberMeCookie(USER_ENTITY userEntity, USER_BEAN userBean, int expireDays, String cookieKey) {
logger.debug("...Saving remember-me key to cookie: key={}", cookieKey);
final String value = buildRememberMeCookieValue(userEntity, userBean, expireDays);
final int expireSeconds... | [
"protected",
"void",
"doSaveRememberMeCookie",
"(",
"USER_ENTITY",
"userEntity",
",",
"USER_BEAN",
"userBean",
",",
"int",
"expireDays",
",",
"String",
"cookieKey",
")",
"{",
"logger",
".",
"debug",
"(",
"\"...Saving remember-me key to cookie: key={}\"",
",",
"cookieKey... | Do save remember-me key to cookie.
@param userEntity The selected entity of login user. (NotNull)
@param userBean The user bean saved in session. (NotNull)
@param expireDays The expire days of both access token and cookie value.
@param cookieKey The key of the cookie. (NotNull) | [
"Do",
"save",
"remember",
"-",
"me",
"key",
"to",
"cookie",
"."
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java#L436-L441 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java | RestClientUtil.searchAllParallel | public <T> ESDatas<T> searchAllParallel(String index, final int fetchSize ,ScrollHandler<T> scrollHandler,final Class<T> type,int max) throws ElasticSearchException {
"""
并行检索索引所有数据
@param index
@param fetchSize 指定每批次返回的数据,不指定默认为5000
@param scrollHandler 每批数据处理方法
@param type
@param <T>
@return
@throws Elas... | java | public <T> ESDatas<T> searchAllParallel(String index, final int fetchSize ,ScrollHandler<T> scrollHandler,final Class<T> type,int max) throws ElasticSearchException{
if(!this.client.isV1()) {
SliceScroll sliceScroll = new SliceScroll() {
@Override
public String buildSliceDsl(int sliceId, int max) {
S... | [
"public",
"<",
"T",
">",
"ESDatas",
"<",
"T",
">",
"searchAllParallel",
"(",
"String",
"index",
",",
"final",
"int",
"fetchSize",
",",
"ScrollHandler",
"<",
"T",
">",
"scrollHandler",
",",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"int",
"max",
")"... | 并行检索索引所有数据
@param index
@param fetchSize 指定每批次返回的数据,不指定默认为5000
@param scrollHandler 每批数据处理方法
@param type
@param <T>
@return
@throws ElasticSearchException | [
"并行检索索引所有数据"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L1732-L1754 |
apache/groovy | src/main/java/org/codehaus/groovy/syntax/CSTNode.java | CSTNode.matches | boolean matches(int type, int child1, int child2) {
"""
Returns true if the node and it's first and second child match the
specified types. Missing nodes are Token.NULL.
"""
return matches(type, child1) && get(2, true).isA(child2);
} | java | boolean matches(int type, int child1, int child2) {
return matches(type, child1) && get(2, true).isA(child2);
} | [
"boolean",
"matches",
"(",
"int",
"type",
",",
"int",
"child1",
",",
"int",
"child2",
")",
"{",
"return",
"matches",
"(",
"type",
",",
"child1",
")",
"&&",
"get",
"(",
"2",
",",
"true",
")",
".",
"isA",
"(",
"child2",
")",
";",
"}"
] | Returns true if the node and it's first and second child match the
specified types. Missing nodes are Token.NULL. | [
"Returns",
"true",
"if",
"the",
"node",
"and",
"it",
"s",
"first",
"and",
"second",
"child",
"match",
"the",
"specified",
"types",
".",
"Missing",
"nodes",
"are",
"Token",
".",
"NULL",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/CSTNode.java#L149-L151 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.findByGroupId | @Override
public List<CommerceOrder> findByGroupId(long groupId, int start, int end) {
"""
Returns a range of all the commerce orders where groupId = ?.
<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... | java | @Override
public List<CommerceOrder> findByGroupId(long groupId, int start, int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceOrder",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce orders where groupId = ?.
<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. Se... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"orders",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L1527-L1530 |
glyptodon/guacamole-client | extensions/guacamole-auth-duo/src/main/java/org/apache/guacamole/auth/duo/api/SignedDuoCookie.java | SignedDuoCookie.parseSignedDuoCookie | public static SignedDuoCookie parseSignedDuoCookie(String key, String str)
throws GuacamoleException {
"""
Parses a signed Duo cookie string, such as that produced by the
toString() function or received from the Duo service, producing a new
SignedDuoCookie object containing the associated cookie data... | java | public static SignedDuoCookie parseSignedDuoCookie(String key, String str)
throws GuacamoleException {
// Verify format of provided data
Matcher matcher = SIGNED_COOKIE_FORMAT.matcher(str);
if (!matcher.matches())
throw new GuacamoleClientException("Format of signed Duo ... | [
"public",
"static",
"SignedDuoCookie",
"parseSignedDuoCookie",
"(",
"String",
"key",
",",
"String",
"str",
")",
"throws",
"GuacamoleException",
"{",
"// Verify format of provided data",
"Matcher",
"matcher",
"=",
"SIGNED_COOKIE_FORMAT",
".",
"matcher",
"(",
"str",
")",
... | Parses a signed Duo cookie string, such as that produced by the
toString() function or received from the Duo service, producing a new
SignedDuoCookie object containing the associated cookie data and
signature. If the given string is not a valid Duo cookie, or if the
signature is incorrect, an exception is thrown. Note ... | [
"Parses",
"a",
"signed",
"Duo",
"cookie",
"string",
"such",
"as",
"that",
"produced",
"by",
"the",
"toString",
"()",
"function",
"or",
"received",
"from",
"the",
"Duo",
"service",
"producing",
"a",
"new",
"SignedDuoCookie",
"object",
"containing",
"the",
"asso... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-duo/src/main/java/org/apache/guacamole/auth/duo/api/SignedDuoCookie.java#L291-L316 |
huahin/huahin-core | src/main/java/org/huahinframework/core/SimpleJob.java | SimpleJob.setSimpleJoin | public SimpleJob setSimpleJoin(String[] masterLabels, String[] masterColumns,
String[] dataColumns, String masterPath) throws DataFormatException {
"""
Easily supports the Join. To use the setSimpleJoin,
you must be a size master data appear in the memory of the task.
@param ma... | java | public SimpleJob setSimpleJoin(String[] masterLabels, String[] masterColumns,
String[] dataColumns, String masterPath) throws DataFormatException {
String separator = conf.get(SEPARATOR);
return setSimpleJoin(masterLabels, masterColumns, dataColumns, masterPath, separa... | [
"public",
"SimpleJob",
"setSimpleJoin",
"(",
"String",
"[",
"]",
"masterLabels",
",",
"String",
"[",
"]",
"masterColumns",
",",
"String",
"[",
"]",
"dataColumns",
",",
"String",
"masterPath",
")",
"throws",
"DataFormatException",
"{",
"String",
"separator",
"=",... | Easily supports the Join. To use the setSimpleJoin,
you must be a size master data appear in the memory of the task.
@param masterLabels label of master data
@param masterColumns master column's
@param dataColumns data column's
@param masterPath master data HDFS path
@return this
@throws DataFormatException | [
"Easily",
"supports",
"the",
"Join",
".",
"To",
"use",
"the",
"setSimpleJoin",
"you",
"must",
"be",
"a",
"size",
"master",
"data",
"appear",
"in",
"the",
"memory",
"of",
"the",
"task",
"."
] | train | https://github.com/huahin/huahin-core/blob/a87921b5a12be92a822f753c075ab2431036e6f5/src/main/java/org/huahinframework/core/SimpleJob.java#L303-L307 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Normalizer.java | Normalizer.isNormalized | @Deprecated
public static boolean isNormalized(String str, Mode mode, int options) {
"""
Test if a string is in a given normalization form.
This is semantically equivalent to source.equals(normalize(source, mode)).
Unlike quickCheck(), this function returns a definitive result,
never a "maybe".
For NFD, ... | java | @Deprecated
public static boolean isNormalized(String str, Mode mode, int options) {
return mode.getNormalizer2(options).isNormalized(str);
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"isNormalized",
"(",
"String",
"str",
",",
"Mode",
"mode",
",",
"int",
"options",
")",
"{",
"return",
"mode",
".",
"getNormalizer2",
"(",
"options",
")",
".",
"isNormalized",
"(",
"str",
")",
";",
"}"
] | Test if a string is in a given normalization form.
This is semantically equivalent to source.equals(normalize(source, mode)).
Unlike quickCheck(), this function returns a definitive result,
never a "maybe".
For NFD, NFKD, and FCD, both functions work exactly the same.
For NFC and NFKC where quickCheck may return "mayb... | [
"Test",
"if",
"a",
"string",
"is",
"in",
"a",
"given",
"normalization",
"form",
".",
"This",
"is",
"semantically",
"equivalent",
"to",
"source",
".",
"equals",
"(",
"normalize",
"(",
"source",
"mode",
"))",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Normalizer.java#L1110-L1113 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java | VirtualHubsInner.beginCreateOrUpdate | public VirtualHubInner beginCreateOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) {
"""
Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubNa... | java | public VirtualHubInner beginCreateOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).toBlocking().single().body();
} | [
"public",
"VirtualHubInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualHubName",
",",
"VirtualHubInner",
"virtualHubParameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualHub... | Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@param virtualHubParameters Parameters supplied to create or update VirtualHub.
@throws IllegalArgumentException ... | [
"Creates",
"a",
"VirtualHub",
"resource",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"VirtualHub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java#L286-L288 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java | ListManagementImagesImpl.addImageUrlInputAsync | public Observable<Image> addImageUrlInputAsync(String listId, String contentType, BodyModelModel imageUrl, AddImageUrlInputOptionalParameter addImageUrlInputOptionalParameter) {
"""
Add an image to the list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param contentType The co... | java | public Observable<Image> addImageUrlInputAsync(String listId, String contentType, BodyModelModel imageUrl, AddImageUrlInputOptionalParameter addImageUrlInputOptionalParameter) {
return addImageUrlInputWithServiceResponseAsync(listId, contentType, imageUrl, addImageUrlInputOptionalParameter).map(new Func1<Servic... | [
"public",
"Observable",
"<",
"Image",
">",
"addImageUrlInputAsync",
"(",
"String",
"listId",
",",
"String",
"contentType",
",",
"BodyModelModel",
"imageUrl",
",",
"AddImageUrlInputOptionalParameter",
"addImageUrlInputOptionalParameter",
")",
"{",
"return",
"addImageUrlInput... | Add an image to the list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param contentType The content type.
@param imageUrl The image url.
@param addImageUrlInputOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentE... | [
"Add",
"an",
"image",
"to",
"the",
"list",
"with",
"list",
"Id",
"equal",
"to",
"list",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java#L534-L541 |
twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ServerSets.java | ServerSets.serializeServiceInstance | public static byte[] serializeServiceInstance(
InetSocketAddress address,
Map<String, Endpoint> additionalEndpoints,
Status status,
Codec<ServiceInstance> codec) throws IOException {
"""
Serializes a service instance based on endpoints.
@see #serializeServiceInstance(ServiceInstance, Codec... | java | public static byte[] serializeServiceInstance(
InetSocketAddress address,
Map<String, Endpoint> additionalEndpoints,
Status status,
Codec<ServiceInstance> codec) throws IOException {
ServiceInstance serviceInstance =
new ServiceInstance(toEndpoint(address), additionalEndpoints, stat... | [
"public",
"static",
"byte",
"[",
"]",
"serializeServiceInstance",
"(",
"InetSocketAddress",
"address",
",",
"Map",
"<",
"String",
",",
"Endpoint",
">",
"additionalEndpoints",
",",
"Status",
"status",
",",
"Codec",
"<",
"ServiceInstance",
">",
"codec",
")",
"thro... | Serializes a service instance based on endpoints.
@see #serializeServiceInstance(ServiceInstance, Codec)
@param address the target address of the service instance
@param additionalEndpoints additional endpoints of the service instance
@param status service status | [
"Serializes",
"a",
"service",
"instance",
"based",
"on",
"endpoints",
".",
"@see",
"#serializeServiceInstance",
"(",
"ServiceInstance",
"Codec",
")"
] | train | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ServerSets.java#L52-L61 |
BioPAX/Paxtools | paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/CycleBreaker.java | CycleBreaker.isSafe | public boolean isSafe(Node node, Edge edge) {
"""
Checks whether an edge is on an unwanted cycle.
@param node Node that the edge is bound
@param edge The edge to check
@return True if no cycle is detected, false otherwise
"""
initMaps();
setColor(node, BLACK);
setLabel(node, 0);
setLabel(edge, 0);
... | java | public boolean isSafe(Node node, Edge edge)
{
initMaps();
setColor(node, BLACK);
setLabel(node, 0);
setLabel(edge, 0);
labelEquivRecursive(node, UPWARD, 0, false, false);
labelEquivRecursive(node, DOWNWARD, 0, false, false);
// Initialize dist and color of source set
Node neigh = edge.getTargetNode... | [
"public",
"boolean",
"isSafe",
"(",
"Node",
"node",
",",
"Edge",
"edge",
")",
"{",
"initMaps",
"(",
")",
";",
"setColor",
"(",
"node",
",",
"BLACK",
")",
";",
"setLabel",
"(",
"node",
",",
"0",
")",
";",
"setLabel",
"(",
"edge",
",",
"0",
")",
";... | Checks whether an edge is on an unwanted cycle.
@param node Node that the edge is bound
@param edge The edge to check
@return True if no cycle is detected, false otherwise | [
"Checks",
"whether",
"an",
"edge",
"is",
"on",
"an",
"unwanted",
"cycle",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/CycleBreaker.java#L72-L114 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/SimulatedTaskRunner.java | SimulatedTaskRunner.launchTask | public void launchTask(TaskInProgress tip) throws IOException {
"""
The primary public method that should be called to 'run' a task. Handles
both map and reduce tasks and marks them as completed after the configured
time interval
@param tip
"""
LOG.info("Launching simulated task " + tip.getTask().getTas... | java | public void launchTask(TaskInProgress tip) throws IOException {
LOG.info("Launching simulated task " + tip.getTask().getTaskID() +
" for job " + tip.getTask().getJobID());
TaskUmbilicalProtocol umbilicalProtocol = taskTracker.getUmbilical(tip);
// For map tasks, we can just finish the task after som... | [
"public",
"void",
"launchTask",
"(",
"TaskInProgress",
"tip",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"info",
"(",
"\"Launching simulated task \"",
"+",
"tip",
".",
"getTask",
"(",
")",
".",
"getTaskID",
"(",
")",
"+",
"\" for job \"",
"+",
"tip",
"."... | The primary public method that should be called to 'run' a task. Handles
both map and reduce tasks and marks them as completed after the configured
time interval
@param tip | [
"The",
"primary",
"public",
"method",
"that",
"should",
"be",
"called",
"to",
"run",
"a",
"task",
".",
"Handles",
"both",
"map",
"and",
"reduce",
"tasks",
"and",
"marks",
"them",
"as",
"completed",
"after",
"the",
"configured",
"time",
"interval"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/SimulatedTaskRunner.java#L144-L162 |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.populateExpandedExceptions | private void populateExpandedExceptions() {
"""
Populate the expanded exceptions list based on the main exceptions list.
Where we find recurring exception definitions, we generate individual
exceptions for each recurrence to ensure that we account for them correctly.
"""
if (!m_exceptions.isEmpty() && ... | java | private void populateExpandedExceptions()
{
if (!m_exceptions.isEmpty() && m_expandedExceptions.isEmpty())
{
for (ProjectCalendarException exception : m_exceptions)
{
RecurringData recurring = exception.getRecurring();
if (recurring == null)
{
... | [
"private",
"void",
"populateExpandedExceptions",
"(",
")",
"{",
"if",
"(",
"!",
"m_exceptions",
".",
"isEmpty",
"(",
")",
"&&",
"m_expandedExceptions",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"ProjectCalendarException",
"exception",
":",
"m_exceptions",
... | Populate the expanded exceptions list based on the main exceptions list.
Where we find recurring exception definitions, we generate individual
exceptions for each recurrence to ensure that we account for them correctly. | [
"Populate",
"the",
"expanded",
"exceptions",
"list",
"based",
"on",
"the",
"main",
"exceptions",
"list",
".",
"Where",
"we",
"find",
"recurring",
"exception",
"definitions",
"we",
"generate",
"individual",
"exceptions",
"for",
"each",
"recurrence",
"to",
"ensure",... | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L1929-L1958 |
tzaeschke/zoodb | src/org/zoodb/internal/client/SchemaManager.java | SchemaManager.applyOp | private void applyOp(SchemaOperation op, ZooClassDef def) {
"""
Apply an operation to all objects in the cache.
@param op
@param def
"""
ops.add(op);
for (GenericObject o: cache.getAllGenericObjects()) {
if (o.jdoZooGetClassDef() == def) {
o.evolve(op);
}
}
} | java | private void applyOp(SchemaOperation op, ZooClassDef def) {
ops.add(op);
for (GenericObject o: cache.getAllGenericObjects()) {
if (o.jdoZooGetClassDef() == def) {
o.evolve(op);
}
}
} | [
"private",
"void",
"applyOp",
"(",
"SchemaOperation",
"op",
",",
"ZooClassDef",
"def",
")",
"{",
"ops",
".",
"add",
"(",
"op",
")",
";",
"for",
"(",
"GenericObject",
"o",
":",
"cache",
".",
"getAllGenericObjects",
"(",
")",
")",
"{",
"if",
"(",
"o",
... | Apply an operation to all objects in the cache.
@param op
@param def | [
"Apply",
"an",
"operation",
"to",
"all",
"objects",
"in",
"the",
"cache",
"."
] | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/client/SchemaManager.java#L409-L416 |
ops4j/org.ops4j.pax.exam2 | legacy/maven-paxexam-plugin/src/main/java/org/ops4j/pax/exam/mavenplugin/GenerateConfigMojo.java | GenerateConfigMojo.createPaxRunnerScan | private String createPaxRunnerScan( Artifact artifact, String optionTokens ) {
"""
Creates scanner directives from artifact to be parsed by pax runner.
Also includes options found and matched in settings part of configuration.
@param artifact to be used to create scanner directive.
@param optionTokens to ... | java | private String createPaxRunnerScan( Artifact artifact, String optionTokens )
{
return "scan-bundle:" + artifact.getFile().toURI().normalize().toString() + "@update" + optionTokens;
} | [
"private",
"String",
"createPaxRunnerScan",
"(",
"Artifact",
"artifact",
",",
"String",
"optionTokens",
")",
"{",
"return",
"\"scan-bundle:\"",
"+",
"artifact",
".",
"getFile",
"(",
")",
".",
"toURI",
"(",
")",
".",
"normalize",
"(",
")",
".",
"toString",
"(... | Creates scanner directives from artifact to be parsed by pax runner.
Also includes options found and matched in settings part of configuration.
@param artifact to be used to create scanner directive.
@param optionTokens to be used to create scanner directive.
@return pax runner compatible scanner directive. | [
"Creates",
"scanner",
"directives",
"from",
"artifact",
"to",
"be",
"parsed",
"by",
"pax",
"runner",
".",
"Also",
"includes",
"options",
"found",
"and",
"matched",
"in",
"settings",
"part",
"of",
"configuration",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/legacy/maven-paxexam-plugin/src/main/java/org/ops4j/pax/exam/mavenplugin/GenerateConfigMojo.java#L310-L313 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfilesInner.java | NetworkProfilesInner.updateTagsAsync | public Observable<NetworkProfileInner> updateTagsAsync(String resourceGroupName, String networkProfileName) {
"""
Updates network profile tags.
@param resourceGroupName The name of the resource group.
@param networkProfileName The name of the network profile.
@throws IllegalArgumentException thrown if paramet... | java | public Observable<NetworkProfileInner> updateTagsAsync(String resourceGroupName, String networkProfileName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName).map(new Func1<ServiceResponse<NetworkProfileInner>, NetworkProfileInner>() {
@Override
public Net... | [
"public",
"Observable",
"<",
"NetworkProfileInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkProfileName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkProfileName",
")",
".",
"m... | Updates network profile tags.
@param resourceGroupName The name of the resource group.
@param networkProfileName The name of the network profile.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"network",
"profile",
"tags",
"."
] | 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/NetworkProfilesInner.java#L446-L453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.