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 |
|---|---|---|---|---|---|---|---|---|---|---|
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/OpenIntObjectHashMap.java | OpenIntObjectHashMap.setUp | protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
"""
Initializes the receiver.
@param initialCapacity the initial capacity of the receiver.
@param minLoadFactor the minLoadFactor of the receiver.
@param maxLoadFactor the maxLoadFactor of th... | java | protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
int capacity = initialCapacity;
super.setUp(capacity, minLoadFactor, maxLoadFactor);
capacity = nextPrime(capacity);
if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
this.table =... | [
"protected",
"void",
"setUp",
"(",
"int",
"initialCapacity",
",",
"double",
"minLoadFactor",
",",
"double",
"maxLoadFactor",
")",
"{",
"int",
"capacity",
"=",
"initialCapacity",
";",
"super",
".",
"setUp",
"(",
"capacity",
",",
"minLoadFactor",
",",
"maxLoadFact... | Initializes the receiver.
@param initialCapacity the initial capacity of the receiver.
@param minLoadFactor the minLoadFactor of the receiver.
@param maxLoadFactor the maxLoadFactor of the receiver.
@throws IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || mi... | [
"Initializes",
"the",
"receiver",
"."
] | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/OpenIntObjectHashMap.java#L438-L462 |
facebook/nailgun | nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java | NGCommunicator.readPayload | private InputStream readPayload(InputStream in, int len) throws IOException {
"""
Reads a NailGun chunk payload from {@link #in} and returns an InputStream that reads from that
chunk.
@param in the InputStream to read the chunk payload from.
@param len the size of the payload chunk read from the chunkHeader.
... | java | private InputStream readPayload(InputStream in, int len) throws IOException {
byte[] receiveBuffer = new byte[len];
int totalRead = 0;
while (totalRead < len) {
int currentRead = in.read(receiveBuffer, totalRead, len - totalRead);
if (currentRead < 0) {
// server may forcefully close the... | [
"private",
"InputStream",
"readPayload",
"(",
"InputStream",
"in",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"receiveBuffer",
"=",
"new",
"byte",
"[",
"len",
"]",
";",
"int",
"totalRead",
"=",
"0",
";",
"while",
"(",
"totalR... | Reads a NailGun chunk payload from {@link #in} and returns an InputStream that reads from that
chunk.
@param in the InputStream to read the chunk payload from.
@param len the size of the payload chunk read from the chunkHeader.
@return an InputStream containing the read data.
@throws IOException if thrown by the under... | [
"Reads",
"a",
"NailGun",
"chunk",
"payload",
"from",
"{",
"@link",
"#in",
"}",
"and",
"returns",
"an",
"InputStream",
"that",
"reads",
"from",
"that",
"chunk",
"."
] | train | https://github.com/facebook/nailgun/blob/948c51c5fce138c65bb3df369c3f7b4d01440605/nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java#L457-L471 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java | HBasePanel.printDataEndField | public void printDataEndField(PrintWriter out, int iPrintOptions) {
"""
Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes.
"""
if ((iPrintOptions & HtmlConstants.MAIN_SCREEN) == HtmlConstants.MAIN_SCREEN)
{
}
e... | java | public void printDataEndField(PrintWriter out, int iPrintOptions)
{
if ((iPrintOptions & HtmlConstants.MAIN_SCREEN) == HtmlConstants.MAIN_SCREEN)
{
}
else
out.println("</tr>");
} | [
"public",
"void",
"printDataEndField",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"if",
"(",
"(",
"iPrintOptions",
"&",
"HtmlConstants",
".",
"MAIN_SCREEN",
")",
"==",
"HtmlConstants",
".",
"MAIN_SCREEN",
")",
"{",
"}",
"else",
"out",
... | Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes. | [
"Display",
"the",
"start",
"form",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java#L587-L594 |
emfjson/emfjson-jackson | src/main/java/org/emfjson/jackson/utils/EObjects.java | EObjects.isContainmentProxy | public static boolean isContainmentProxy(DatabindContext ctxt, EObject owner, EObject contained) {
"""
Checks that the contained object is in a different resource than it's owner, making
it a contained proxy.
@param owner
@param contained
@return true if proxy
"""
if (contained.eIsProxy())
return tr... | java | public static boolean isContainmentProxy(DatabindContext ctxt, EObject owner, EObject contained) {
if (contained.eIsProxy())
return true;
Resource ownerResource = EMFContext.getResource(ctxt, owner);
Resource containedResource = EMFContext.getResource(ctxt, contained);
return ownerResource != null && owner... | [
"public",
"static",
"boolean",
"isContainmentProxy",
"(",
"DatabindContext",
"ctxt",
",",
"EObject",
"owner",
",",
"EObject",
"contained",
")",
"{",
"if",
"(",
"contained",
".",
"eIsProxy",
"(",
")",
")",
"return",
"true",
";",
"Resource",
"ownerResource",
"="... | Checks that the contained object is in a different resource than it's owner, making
it a contained proxy.
@param owner
@param contained
@return true if proxy | [
"Checks",
"that",
"the",
"contained",
"object",
"is",
"in",
"a",
"different",
"resource",
"than",
"it",
"s",
"owner",
"making",
"it",
"a",
"contained",
"proxy",
"."
] | train | https://github.com/emfjson/emfjson-jackson/blob/5f4488d1b07d499003351606cf76ee0c4ac39964/src/main/java/org/emfjson/jackson/utils/EObjects.java#L58-L66 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java | RichClientFramework.getOutboundConnectionProperties | @Override
public Map getOutboundConnectionProperties(Object ep) {
"""
This method will retrieve the property bag on the outbound chain that will be used by the
specified end point. This method is only valid for CFEndPoints.
@param ep The CFEndPoint
@see com.ibm.ws.sib.jfapchannel.framework.Framework#get... | java | @Override
public Map getOutboundConnectionProperties(Object ep)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getOutboundConnectionProperties", ep);
Map properties = null;
if (ep instanceof CFEndPoint)
{
Outboun... | [
"@",
"Override",
"public",
"Map",
"getOutboundConnectionProperties",
"(",
"Object",
"ep",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
... | This method will retrieve the property bag on the outbound chain that will be used by the
specified end point. This method is only valid for CFEndPoints.
@param ep The CFEndPoint
@see com.ibm.ws.sib.jfapchannel.framework.Framework#getOutboundConnectionProperties(java.lang.Object) | [
"This",
"method",
"will",
"retrieve",
"the",
"property",
"bag",
"on",
"the",
"outbound",
"chain",
"that",
"will",
"be",
"used",
"by",
"the",
"specified",
"end",
"point",
".",
"This",
"method",
"is",
"only",
"valid",
"for",
"CFEndPoints",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java#L154-L172 |
hmsonline/storm-cassandra | src/main/java/com/hmsonline/storm/cassandra/bolt/mapper/ValuelessColumnsMapper.java | ValuelessColumnsMapper.mapToValues | @Override
public List<Values> mapToValues(String rowKey, Map<String, String> columns, Tuple input) {
"""
Given a set of columns, maps to values to emit.
@param columns
@return
"""
List<Values> values = new ArrayList<Values>();
Set<String> vals = columns.keySet();
for(String colu... | java | @Override
public List<Values> mapToValues(String rowKey, Map<String, String> columns, Tuple input) {
List<Values> values = new ArrayList<Values>();
Set<String> vals = columns.keySet();
for(String columnName : vals){
if(this.isDrpc){
values.add(new Values(input.get... | [
"@",
"Override",
"public",
"List",
"<",
"Values",
">",
"mapToValues",
"(",
"String",
"rowKey",
",",
"Map",
"<",
"String",
",",
"String",
">",
"columns",
",",
"Tuple",
"input",
")",
"{",
"List",
"<",
"Values",
">",
"values",
"=",
"new",
"ArrayList",
"<"... | Given a set of columns, maps to values to emit.
@param columns
@return | [
"Given",
"a",
"set",
"of",
"columns",
"maps",
"to",
"values",
"to",
"emit",
"."
] | train | https://github.com/hmsonline/storm-cassandra/blob/94303fad18f4692224187867144921904e35b001/src/main/java/com/hmsonline/storm/cassandra/bolt/mapper/ValuelessColumnsMapper.java#L117-L129 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/powerassert/AssertionRenderer.java | AssertionRenderer.render | public static String render(String text, ValueRecorder recorder) {
"""
Creates a string representation of an assertion and its recorded values.
@param text the assertion's source text
@param recorder a recorder holding the values recorded during evaluation
of the assertion
@return a string representation... | java | public static String render(String text, ValueRecorder recorder) {
return new AssertionRenderer(text, recorder).render();
} | [
"public",
"static",
"String",
"render",
"(",
"String",
"text",
",",
"ValueRecorder",
"recorder",
")",
"{",
"return",
"new",
"AssertionRenderer",
"(",
"text",
",",
"recorder",
")",
".",
"render",
"(",
")",
";",
"}"
] | Creates a string representation of an assertion and its recorded values.
@param text the assertion's source text
@param recorder a recorder holding the values recorded during evaluation
of the assertion
@return a string representation of the assertion and its recorded values | [
"Creates",
"a",
"string",
"representation",
"of",
"an",
"assertion",
"and",
"its",
"recorded",
"values",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/powerassert/AssertionRenderer.java#L54-L56 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/NameUtil.java | NameUtil.getRemoteImplClassName | public static String getRemoteImplClassName(EnterpriseBean enterpriseBean, boolean isPost11DD) // d114199 {
"""
Return the name of the deployed class that implements the remote
interface of the bean. <p>
@param enterpriseBean bean impl class
@param isPost11DD true if bean is defined using later than 1.1 deplo... | java | public static String getRemoteImplClassName(EnterpriseBean enterpriseBean, boolean isPost11DD) // d114199
{
String remoteInterfaceName = getRemoteInterfaceName(enterpriseBean);
if (remoteInterfaceName == null) { // f111627
return null; // f111627
} // f111627
String pack... | [
"public",
"static",
"String",
"getRemoteImplClassName",
"(",
"EnterpriseBean",
"enterpriseBean",
",",
"boolean",
"isPost11DD",
")",
"// d114199",
"{",
"String",
"remoteInterfaceName",
"=",
"getRemoteInterfaceName",
"(",
"enterpriseBean",
")",
";",
"if",
"(",
"remoteInte... | Return the name of the deployed class that implements the remote
interface of the bean. <p>
@param enterpriseBean bean impl class
@param isPost11DD true if bean is defined using later than 1.1 deployment description. | [
"Return",
"the",
"name",
"of",
"the",
"deployed",
"class",
"that",
"implements",
"the",
"remote",
"interface",
"of",
"the",
"bean",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/NameUtil.java#L189-L209 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/OgnlUtil.java | OgnlUtil.getValue | public static Object getValue(Object exp, Map ctx, Object root) {
"""
Returns the value using the OGNL expression, the root object and a context map.
@param exp the OGNL expression
@param ctx the context map
@param root the root object
@return the value
@see #getValue(Object, Map, Object, String, int)
... | java | public static Object getValue(Object exp, Map ctx, Object root) {
return getValue(exp, ctx, root, null, 0);
} | [
"public",
"static",
"Object",
"getValue",
"(",
"Object",
"exp",
",",
"Map",
"ctx",
",",
"Object",
"root",
")",
"{",
"return",
"getValue",
"(",
"exp",
",",
"ctx",
",",
"root",
",",
"null",
",",
"0",
")",
";",
"}"
] | Returns the value using the OGNL expression, the root object and a context map.
@param exp the OGNL expression
@param ctx the context map
@param root the root object
@return the value
@see #getValue(Object, Map, Object, String, int) | [
"Returns",
"the",
"value",
"using",
"the",
"OGNL",
"expression",
"the",
"root",
"object",
"and",
"a",
"context",
"map",
"."
] | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/OgnlUtil.java#L79-L81 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.withVoidTransaction | public void withVoidTransaction(@NotNull Propagation propagation, @NotNull VoidTransactionCallback callback) {
"""
Executes a block of code with given propagation and configuration default isolation.
"""
withVoidTransaction(propagation, Isolation.DEFAULT, callback);
} | java | public void withVoidTransaction(@NotNull Propagation propagation, @NotNull VoidTransactionCallback callback) {
withVoidTransaction(propagation, Isolation.DEFAULT, callback);
} | [
"public",
"void",
"withVoidTransaction",
"(",
"@",
"NotNull",
"Propagation",
"propagation",
",",
"@",
"NotNull",
"VoidTransactionCallback",
"callback",
")",
"{",
"withVoidTransaction",
"(",
"propagation",
",",
"Isolation",
".",
"DEFAULT",
",",
"callback",
")",
";",
... | Executes a block of code with given propagation and configuration default isolation. | [
"Executes",
"a",
"block",
"of",
"code",
"with",
"given",
"propagation",
"and",
"configuration",
"default",
"isolation",
"."
] | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L208-L210 |
jenkinsci/jenkins | core/src/main/java/hudson/model/Descriptor.java | Descriptor.getCheckMethod | public CheckMethod getCheckMethod(String fieldName) {
"""
If the field "xyz" of a {@link Describable} has the corresponding "doCheckXyz" method,
return the model of the check method.
<p>
This method is used to hook up the form validation method to the corresponding HTML input element.
"""
CheckMetho... | java | public CheckMethod getCheckMethod(String fieldName) {
CheckMethod method = checkMethods.get(fieldName);
if(method==null) {
method = new CheckMethod(this,fieldName);
checkMethods.put(fieldName,method);
}
return method;
} | [
"public",
"CheckMethod",
"getCheckMethod",
"(",
"String",
"fieldName",
")",
"{",
"CheckMethod",
"method",
"=",
"checkMethods",
".",
"get",
"(",
"fieldName",
")",
";",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"method",
"=",
"new",
"CheckMethod",
"(",
"t... | If the field "xyz" of a {@link Describable} has the corresponding "doCheckXyz" method,
return the model of the check method.
<p>
This method is used to hook up the form validation method to the corresponding HTML input element. | [
"If",
"the",
"field",
"xyz",
"of",
"a",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Descriptor.java#L396-L404 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/Utils/CraftingHelper.java | CraftingHelper.removeIngredientsFromPlayer | public static void removeIngredientsFromPlayer(EntityPlayerMP player, List<ItemStack> ingredients) {
"""
Manually attempt to remove ingredients from the player's inventory.<br>
@param player
@param ingredients
"""
NonNullList<ItemStack> main = player.inventory.mainInventory;
NonNullList<ItemS... | java | public static void removeIngredientsFromPlayer(EntityPlayerMP player, List<ItemStack> ingredients)
{
NonNullList<ItemStack> main = player.inventory.mainInventory;
NonNullList<ItemStack> arm = player.inventory.armorInventory;
for (ItemStack isIngredient : ingredients)
{
i... | [
"public",
"static",
"void",
"removeIngredientsFromPlayer",
"(",
"EntityPlayerMP",
"player",
",",
"List",
"<",
"ItemStack",
">",
"ingredients",
")",
"{",
"NonNullList",
"<",
"ItemStack",
">",
"main",
"=",
"player",
".",
"inventory",
".",
"mainInventory",
";",
"No... | Manually attempt to remove ingredients from the player's inventory.<br>
@param player
@param ingredients | [
"Manually",
"attempt",
"to",
"remove",
"ingredients",
"from",
"the",
"player",
"s",
"inventory",
".",
"<br",
">"
] | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/CraftingHelper.java#L290-L323 |
square/phrase | src/main/java/com/squareup/phrase/Phrase.java | Phrase.from | public static Phrase from(View v, @StringRes int patternResourceId) {
"""
Entry point into this API.
@throws IllegalArgumentException if pattern contains any syntax errors.
"""
return from(v.getResources(), patternResourceId);
} | java | public static Phrase from(View v, @StringRes int patternResourceId) {
return from(v.getResources(), patternResourceId);
} | [
"public",
"static",
"Phrase",
"from",
"(",
"View",
"v",
",",
"@",
"StringRes",
"int",
"patternResourceId",
")",
"{",
"return",
"from",
"(",
"v",
".",
"getResources",
"(",
")",
",",
"patternResourceId",
")",
";",
"}"
] | Entry point into this API.
@throws IllegalArgumentException if pattern contains any syntax errors. | [
"Entry",
"point",
"into",
"this",
"API",
"."
] | train | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/Phrase.java#L87-L89 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/RayleighDistribution.java | RayleighDistribution.logpdf | public static double logpdf(double x, double sigma) {
"""
PDF of Rayleigh distribution
@param x Value
@param sigma Scale
@return PDF at position x.
"""
if(!(x > 0.) || x == Double.POSITIVE_INFINITY) {
return x == x ? Double.NEGATIVE_INFINITY : Double.NaN;
}
final double xs = x / sigma, x... | java | public static double logpdf(double x, double sigma) {
if(!(x > 0.) || x == Double.POSITIVE_INFINITY) {
return x == x ? Double.NEGATIVE_INFINITY : Double.NaN;
}
final double xs = x / sigma, xs2 = xs * xs;
return xs2 < Double.POSITIVE_INFINITY ? FastMath.log(xs / sigma) - .5 * xs2 : Double.NEGATIVE_... | [
"public",
"static",
"double",
"logpdf",
"(",
"double",
"x",
",",
"double",
"sigma",
")",
"{",
"if",
"(",
"!",
"(",
"x",
">",
"0.",
")",
"||",
"x",
"==",
"Double",
".",
"POSITIVE_INFINITY",
")",
"{",
"return",
"x",
"==",
"x",
"?",
"Double",
".",
"... | PDF of Rayleigh distribution
@param x Value
@param sigma Scale
@return PDF at position x. | [
"PDF",
"of",
"Rayleigh",
"distribution"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/RayleighDistribution.java#L153-L159 |
elibom/jogger | src/main/java/com/elibom/jogger/middleware/router/RouterMiddleware.java | RouterMiddleware.matchesPath | private boolean matchesPath(String routePath, String pathToMatch) {
"""
Helper method. Tells if the the HTTP path matches the route path.
@param routePath the path defined for the route.
@param pathToMatch the path from the HTTP request.
@return true if the path matches, false otherwise.
"""
routePath... | java | private boolean matchesPath(String routePath, String pathToMatch) {
routePath = routePath.replaceAll(Path.VAR_REGEXP, Path.VAR_REPLACE);
return pathToMatch.matches("(?i)" + routePath);
} | [
"private",
"boolean",
"matchesPath",
"(",
"String",
"routePath",
",",
"String",
"pathToMatch",
")",
"{",
"routePath",
"=",
"routePath",
".",
"replaceAll",
"(",
"Path",
".",
"VAR_REGEXP",
",",
"Path",
".",
"VAR_REPLACE",
")",
";",
"return",
"pathToMatch",
".",
... | Helper method. Tells if the the HTTP path matches the route path.
@param routePath the path defined for the route.
@param pathToMatch the path from the HTTP request.
@return true if the path matches, false otherwise. | [
"Helper",
"method",
".",
"Tells",
"if",
"the",
"the",
"HTTP",
"path",
"matches",
"the",
"route",
"path",
"."
] | train | https://github.com/elibom/jogger/blob/d5892ff45e76328d444a68b5a38c26e7bdd0692b/src/main/java/com/elibom/jogger/middleware/router/RouterMiddleware.java#L145-L148 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getRevisionIdsContainingTemplateFragments | public List<Integer> getRevisionIdsContainingTemplateFragments(List<String> templateFragments) throws WikiApiException {
"""
Returns a list containing the ids of all revisions that contain a
template the name of which starts with any of the given Strings.
@param templateFragments
the beginning of the template... | java | public List<Integer> getRevisionIdsContainingTemplateFragments(List<String> templateFragments) throws WikiApiException{
return getFragmentFilteredRevisionIds(templateFragments,true);
} | [
"public",
"List",
"<",
"Integer",
">",
"getRevisionIdsContainingTemplateFragments",
"(",
"List",
"<",
"String",
">",
"templateFragments",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFragmentFilteredRevisionIds",
"(",
"templateFragments",
",",
"true",
")",
";",... | Returns a list containing the ids of all revisions that contain a
template the name of which starts with any of the given Strings.
@param templateFragments
the beginning of the templates that have to be matched
@return An list with the ids of the revisions that contain templates
beginning with any String in templateFr... | [
"Returns",
"a",
"list",
"containing",
"the",
"ids",
"of",
"all",
"revisions",
"that",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"starts",
"with",
"any",
"of",
"the",
"given",
"Strings",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L812-L814 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/Constraints.java | Constraints.toEntityPredicate | public <E> Predicate<E> toEntityPredicate(StorageKey key, EntityAccessor<E> accessor) {
"""
Get a {@link Predicate} for testing entity objects that match the given
{@link StorageKey}.
@param <E> The type of entities to be matched
@param key a StorageKey for entities tested with the Predicate
@return a Predic... | java | public <E> Predicate<E> toEntityPredicate(StorageKey key, EntityAccessor<E> accessor) {
if (key != null) {
Map<String, Predicate> predicates = minimizeFor(key);
if (predicates.isEmpty()) {
return alwaysTrue();
}
return entityPredicate(predicates, schema, accessor, strategy);
}
... | [
"public",
"<",
"E",
">",
"Predicate",
"<",
"E",
">",
"toEntityPredicate",
"(",
"StorageKey",
"key",
",",
"EntityAccessor",
"<",
"E",
">",
"accessor",
")",
"{",
"if",
"(",
"key",
"!=",
"null",
")",
"{",
"Map",
"<",
"String",
",",
"Predicate",
">",
"pr... | Get a {@link Predicate} for testing entity objects that match the given
{@link StorageKey}.
@param <E> The type of entities to be matched
@param key a StorageKey for entities tested with the Predicate
@return a Predicate to test if entity objects satisfy this constraint set | [
"Get",
"a",
"{",
"@link",
"Predicate",
"}",
"for",
"testing",
"entity",
"objects",
"that",
"match",
"the",
"given",
"{",
"@link",
"StorageKey",
"}",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/Constraints.java#L128-L137 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/io/DOMHandle.java | DOMHandle.evaluateXPath | public <T> T evaluateXPath(XPathExpression xpathExpression, Class<T> as)
throws XPathExpressionException {
"""
Evaluate a compiled XPath expression against the retrieved document.
An XPath expression can return a Node or subinterface such as
Element or Text, a NodeList, or a Boolean, Number, or String value.... | java | public <T> T evaluateXPath(XPathExpression xpathExpression, Class<T> as)
throws XPathExpressionException {
return evaluateXPath(xpathExpression, get(), as);
} | [
"public",
"<",
"T",
">",
"T",
"evaluateXPath",
"(",
"XPathExpression",
"xpathExpression",
",",
"Class",
"<",
"T",
">",
"as",
")",
"throws",
"XPathExpressionException",
"{",
"return",
"evaluateXPath",
"(",
"xpathExpression",
",",
"get",
"(",
")",
",",
"as",
"... | Evaluate a compiled XPath expression against the retrieved document.
An XPath expression can return a Node or subinterface such as
Element or Text, a NodeList, or a Boolean, Number, or String value.
@param xpathExpression an XPath expression compiled previously
@param as the type expected to be matched by the xpath
@pa... | [
"Evaluate",
"a",
"compiled",
"XPath",
"expression",
"against",
"the",
"retrieved",
"document",
".",
"An",
"XPath",
"expression",
"can",
"return",
"a",
"Node",
"or",
"subinterface",
"such",
"as",
"Element",
"or",
"Text",
"a",
"NodeList",
"or",
"a",
"Boolean",
... | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/io/DOMHandle.java#L316-L319 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/DbPro.java | DbPro.deleteByIds | public boolean deleteByIds(String tableName, String primaryKey, Object... idValues) {
"""
Delete record by ids.
<pre>
Example:
Db.use().deleteByIds("user", "user_id", 15);
Db.use().deleteByIds("user_role", "user_id, role_id", 123, 456);
</pre>
@param tableName the table name of the table
@param primaryKey t... | java | public boolean deleteByIds(String tableName, String primaryKey, Object... idValues) {
String[] pKeys = primaryKey.split(",");
if (pKeys.length != idValues.length)
throw new IllegalArgumentException("primary key number must equals id value number");
String sql = config.dialect.forDbDeleteById(tableName,... | [
"public",
"boolean",
"deleteByIds",
"(",
"String",
"tableName",
",",
"String",
"primaryKey",
",",
"Object",
"...",
"idValues",
")",
"{",
"String",
"[",
"]",
"pKeys",
"=",
"primaryKey",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
"(",
"pKeys",
".",
"lengt... | Delete record by ids.
<pre>
Example:
Db.use().deleteByIds("user", "user_id", 15);
Db.use().deleteByIds("user_role", "user_id, role_id", 123, 456);
</pre>
@param tableName the table name of the table
@param primaryKey the primary key of the table, composite primary key is separated by comma character: ","
@param idValue... | [
"Delete",
"record",
"by",
"ids",
".",
"<pre",
">",
"Example",
":",
"Db",
".",
"use",
"()",
".",
"deleteByIds",
"(",
"user",
"user_id",
"15",
")",
";",
"Db",
".",
"use",
"()",
".",
"deleteByIds",
"(",
"user_role",
"user_id",
"role_id",
"123",
"456",
"... | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/DbPro.java#L435-L442 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.removeSharedFlow | public static void removeSharedFlow( String sharedFlowClassName, HttpServletRequest request ) {
"""
Destroy the current {@link SharedFlowController} of the given class name.
@deprecated Use {@link #removeSharedFlow(String, HttpServletRequest, ServletContext)} instead.
@param sharedFlowClassName the class name of... | java | public static void removeSharedFlow( String sharedFlowClassName, HttpServletRequest request )
{
ServletContext servletContext = InternalUtils.getServletContext( request );
removeSharedFlow( sharedFlowClassName, request, servletContext );
} | [
"public",
"static",
"void",
"removeSharedFlow",
"(",
"String",
"sharedFlowClassName",
",",
"HttpServletRequest",
"request",
")",
"{",
"ServletContext",
"servletContext",
"=",
"InternalUtils",
".",
"getServletContext",
"(",
"request",
")",
";",
"removeSharedFlow",
"(",
... | Destroy the current {@link SharedFlowController} of the given class name.
@deprecated Use {@link #removeSharedFlow(String, HttpServletRequest, ServletContext)} instead.
@param sharedFlowClassName the class name of the current SharedFlowController to destroy.
@param request the current HttpServletRequest. | [
"Destroy",
"the",
"current",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L395-L399 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readOwner | public CmsUser readOwner(CmsRequestContext context, CmsProject project) throws CmsException {
"""
Reads the owner of a project from the OpenCms.<p>
@param context the current request context
@param project the project to get the owner from
@return the owner of a resource
@throws CmsException if something... | java | public CmsUser readOwner(CmsRequestContext context, CmsProject project) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsUser result = null;
try {
result = m_driverManager.readOwner(dbc, project);
} catch (Exception e) {
dbc.r... | [
"public",
"CmsUser",
"readOwner",
"(",
"CmsRequestContext",
"context",
",",
"CmsProject",
"project",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"CmsUser",
"result",
"=",
"nul... | Reads the owner of a project from the OpenCms.<p>
@param context the current request context
@param project the project to get the owner from
@return the owner of a resource
@throws CmsException if something goes wrong | [
"Reads",
"the",
"owner",
"of",
"a",
"project",
"from",
"the",
"OpenCms",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L4602-L4617 |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/AnnotatedTypeLoader.java | AnnotatedTypeLoader.loadAnnotatedType | public <T> SlimAnnotatedTypeContext<T> loadAnnotatedType(Class<T> clazz, String bdaId) {
"""
Creates a new {@link SlimAnnotatedTypeContext} instance for the given class. This method may return null if there is a problem
loading the class or this class is not needed for further processing (e.g. an annotation or a ... | java | public <T> SlimAnnotatedTypeContext<T> loadAnnotatedType(Class<T> clazz, String bdaId) {
return createContext(internalLoadAnnotatedType(clazz, bdaId));
} | [
"public",
"<",
"T",
">",
"SlimAnnotatedTypeContext",
"<",
"T",
">",
"loadAnnotatedType",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"bdaId",
")",
"{",
"return",
"createContext",
"(",
"internalLoadAnnotatedType",
"(",
"clazz",
",",
"bdaId",
")",
")"... | Creates a new {@link SlimAnnotatedTypeContext} instance for the given class. This method may return null if there is a problem
loading the class or this class is not needed for further processing (e.g. an annotation or a vetoed class).
@param clazz the given class
@param bdaId the identifier of the bean archive this c... | [
"Creates",
"a",
"new",
"{",
"@link",
"SlimAnnotatedTypeContext",
"}",
"instance",
"for",
"the",
"given",
"class",
".",
"This",
"method",
"may",
"return",
"null",
"if",
"there",
"is",
"a",
"problem",
"loading",
"the",
"class",
"or",
"this",
"class",
"is",
"... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/AnnotatedTypeLoader.java#L73-L75 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Section.java | Section.constructTitle | public static Paragraph constructTitle(Paragraph title, ArrayList numbers, int numberDepth, int numberStyle) {
"""
Constructs a Paragraph that will be used as title for a Section or Chapter.
@param title the title of the section
@param numbers a list of sectionnumbers
@param numberDepth how many numbers have to... | java | public static Paragraph constructTitle(Paragraph title, ArrayList numbers, int numberDepth, int numberStyle) {
if (title == null) {
return null;
}
int depth = Math.min(numbers.size(), numberDepth);
if (depth < 1) {
return title;
}
StringBuffer buf = new Strin... | [
"public",
"static",
"Paragraph",
"constructTitle",
"(",
"Paragraph",
"title",
",",
"ArrayList",
"numbers",
",",
"int",
"numberDepth",
",",
"int",
"numberStyle",
")",
"{",
"if",
"(",
"title",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"depth... | Constructs a Paragraph that will be used as title for a Section or Chapter.
@param title the title of the section
@param numbers a list of sectionnumbers
@param numberDepth how many numbers have to be shown
@param numberStyle the numbering style
@return a Paragraph object
@since iText 2.0.8 | [
"Constructs",
"a",
"Paragraph",
"that",
"will",
"be",
"used",
"as",
"title",
"for",
"a",
"Section",
"or",
"Chapter",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Section.java#L470-L490 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java | ClusterManagerClient.createCluster | public final Operation createCluster(String projectId, String zone, Cluster cluster) {
"""
Creates a cluster, consisting of the specified number and type of Google Compute Engine
instances.
<p>By default, the cluster is created in the project's [default
network](/compute/docs/networks-and-firewalls#networks).... | java | public final Operation createCluster(String projectId, String zone, Cluster cluster) {
CreateClusterRequest request =
CreateClusterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setCluster(cluster)
.build();
return createCluster(request);
... | [
"public",
"final",
"Operation",
"createCluster",
"(",
"String",
"projectId",
",",
"String",
"zone",
",",
"Cluster",
"cluster",
")",
"{",
"CreateClusterRequest",
"request",
"=",
"CreateClusterRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"project... | Creates a cluster, consisting of the specified number and type of Google Compute Engine
instances.
<p>By default, the cluster is created in the project's [default
network](/compute/docs/networks-and-firewalls#networks).
<p>One firewall is added for the cluster. After cluster creation, the cluster creates routes
for e... | [
"Creates",
"a",
"cluster",
"consisting",
"of",
"the",
"specified",
"number",
"and",
"type",
"of",
"Google",
"Compute",
"Engine",
"instances",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java#L394-L403 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java | ImageLoader.loadImageSync | public Bitmap loadImageSync(String uri, DisplayImageOptions options) {
"""
Loads and decodes image synchronously.<br />
<b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call
@param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png")
... | java | public Bitmap loadImageSync(String uri, DisplayImageOptions options) {
return loadImageSync(uri, null, options);
} | [
"public",
"Bitmap",
"loadImageSync",
"(",
"String",
"uri",
",",
"DisplayImageOptions",
"options",
")",
"{",
"return",
"loadImageSync",
"(",
"uri",
",",
"null",
",",
"options",
")",
";",
"}"
] | Loads and decodes image synchronously.<br />
<b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call
@param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png")
@param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptio... | [
"Loads",
"and",
"decodes",
"image",
"synchronously",
".",
"<br",
"/",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"{",
"@link",
"#init",
"(",
"ImageLoaderConfiguration",
")",
"}",
"method",
"must",
"be",
"called",
"before",
"this",
"method",
"call"
... | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java#L558-L560 |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/ShareableResource.java | ShareableResource.setConsumption | public ShareableResource setConsumption(VM vm, int val) {
"""
Set the resource consumption of a VM.
@param vm the VM
@param val the value to set
@return the current resource
"""
if (val < 0) {
throw new IllegalArgumentException(String.format("The '%s' consumption of VM '%s' must be >= 0", rcId,... | java | public ShareableResource setConsumption(VM vm, int val) {
if (val < 0) {
throw new IllegalArgumentException(String.format("The '%s' consumption of VM '%s' must be >= 0", rcId, vm));
}
vmsConsumption.put(vm, val);
return this;
} | [
"public",
"ShareableResource",
"setConsumption",
"(",
"VM",
"vm",
",",
"int",
"val",
")",
"{",
"if",
"(",
"val",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"The '%s' consumption of VM '%s' must be >= 0\"",
... | Set the resource consumption of a VM.
@param vm the VM
@param val the value to set
@return the current resource | [
"Set",
"the",
"resource",
"consumption",
"of",
"a",
"VM",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/ShareableResource.java#L150-L156 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.deleteSubscription | public PubsubFuture<Void> deleteSubscription(final String canonicalSubscriptionName) {
"""
Delete a Pub/Sub subscription.
@param canonicalSubscriptionName The canonical (including project) name of the subscription to delete.
@return A future that is completed when this request is completed. The future will be ... | java | public PubsubFuture<Void> deleteSubscription(final String canonicalSubscriptionName) {
validateCanonicalSubscription(canonicalSubscriptionName);
return delete("delete subscription", canonicalSubscriptionName, VOID);
} | [
"public",
"PubsubFuture",
"<",
"Void",
">",
"deleteSubscription",
"(",
"final",
"String",
"canonicalSubscriptionName",
")",
"{",
"validateCanonicalSubscription",
"(",
"canonicalSubscriptionName",
")",
";",
"return",
"delete",
"(",
"\"delete subscription\"",
",",
"canonica... | Delete a Pub/Sub subscription.
@param canonicalSubscriptionName The canonical (including project) name of the subscription to delete.
@return A future that is completed when this request is completed. The future will be completed with {@code null}
if the response is 404. | [
"Delete",
"a",
"Pub",
"/",
"Sub",
"subscription",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L468-L471 |
tzaeschke/zoodb | src/org/zoodb/internal/server/DiskAccessOneFile.java | DiskAccessOneFile.readObjectFromIndex | @Override
public CloseableIterator<ZooPC> readObjectFromIndex(
ZooFieldDef field, long minValue, long maxValue, boolean loadFromCache) {
"""
WARNING: float/double values need to be converted with BitTools before used on indices.
"""
SchemaIndexEntry se = schemaIndex.getSchema(field.getDeclaringType());
... | java | @Override
public CloseableIterator<ZooPC> readObjectFromIndex(
ZooFieldDef field, long minValue, long maxValue, boolean loadFromCache) {
SchemaIndexEntry se = schemaIndex.getSchema(field.getDeclaringType());
LongLongIndex fieldInd = se.getIndex(field);
LLEntryIterator iter = fieldInd.iterator(minValue, maxVal... | [
"@",
"Override",
"public",
"CloseableIterator",
"<",
"ZooPC",
">",
"readObjectFromIndex",
"(",
"ZooFieldDef",
"field",
",",
"long",
"minValue",
",",
"long",
"maxValue",
",",
"boolean",
"loadFromCache",
")",
"{",
"SchemaIndexEntry",
"se",
"=",
"schemaIndex",
".",
... | WARNING: float/double values need to be converted with BitTools before used on indices. | [
"WARNING",
":",
"float",
"/",
"double",
"values",
"need",
"to",
"be",
"converted",
"with",
"BitTools",
"before",
"used",
"on",
"indices",
"."
] | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/DiskAccessOneFile.java#L296-L303 |
eurekaclinical/eurekaclinical-common | src/main/java/org/eurekaclinical/common/filter/HasAuthenticatedSessionFilter.java | HasAuthenticatedSessionFilter.doFilter | @Override
public void doFilter(ServletRequest inRequest, ServletResponse inResponse, FilterChain inFilterChain) throws IOException, ServletException {
"""
Sets the request attribute and passes the request and response onto the
next filter. If there is no session or the remote user is not set,
the response st... | java | @Override
public void doFilter(ServletRequest inRequest, ServletResponse inResponse, FilterChain inFilterChain) throws IOException, ServletException {
HttpServletRequest servletRequest = (HttpServletRequest) inRequest;
HttpServletResponse servletResponse = (HttpServletResponse) inResponse;
... | [
"@",
"Override",
"public",
"void",
"doFilter",
"(",
"ServletRequest",
"inRequest",
",",
"ServletResponse",
"inResponse",
",",
"FilterChain",
"inFilterChain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"HttpServletRequest",
"servletRequest",
"=",
"(",
... | Sets the request attribute and passes the request and response onto the
next filter. If there is no session or the remote user is not set,
the response status is set to 400 (Bad Request).
@param inRequest the HTTP request.
@param inResponse the HTTP response.
@param inFilterChain the filter chain.
@throws IOException ... | [
"Sets",
"the",
"request",
"attribute",
"and",
"passes",
"the",
"request",
"and",
"response",
"onto",
"the",
"next",
"filter",
".",
"If",
"there",
"is",
"no",
"session",
"or",
"the",
"remote",
"user",
"is",
"not",
"set",
"the",
"response",
"status",
"is",
... | train | https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/filter/HasAuthenticatedSessionFilter.java#L64-L78 |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.processMethod | protected static <T extends MPBase> T processMethod(Class clazz, String methodName, String param1, Boolean useCache) throws MPException {
"""
Process the method to call the api, usually used for load methods
@param clazz a MPBase extended class
@param methodName a String with the decorated m... | java | protected static <T extends MPBase> T processMethod(Class clazz, String methodName, String param1, Boolean useCache) throws MPException {
HashMap<String, String> mapParams = new HashMap<String, String>();
mapParams.put("param1", param1);
return processMethod(clazz, null, methodName, mapParams, ... | [
"protected",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"T",
"processMethod",
"(",
"Class",
"clazz",
",",
"String",
"methodName",
",",
"String",
"param1",
",",
"Boolean",
"useCache",
")",
"throws",
"MPException",
"{",
"HashMap",
"<",
"String",
",",
"Strin... | Process the method to call the api, usually used for load methods
@param clazz a MPBase extended class
@param methodName a String with the decorated method to be processed
@param param1 a String with the arg passed in the call of the method
@param useCache a Boolean flag that ind... | [
"Process",
"the",
"method",
"to",
"call",
"the",
"api",
"usually",
"used",
"for",
"load",
"methods"
] | train | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L107-L112 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/param/CommandParamsContext.java | CommandParamsContext.addNamedParam | public void addNamedParam(final String name, final ParamInfo paramInfo) {
"""
Register parameter as named.
@param name parameter name
@param paramInfo parameter object
"""
check(!named.containsKey(name),
"Duplicate parameter %s declaration at position %s", name, paramInfo.posit... | java | public void addNamedParam(final String name, final ParamInfo paramInfo) {
check(!named.containsKey(name),
"Duplicate parameter %s declaration at position %s", name, paramInfo.position);
named.put(name, paramInfo);
} | [
"public",
"void",
"addNamedParam",
"(",
"final",
"String",
"name",
",",
"final",
"ParamInfo",
"paramInfo",
")",
"{",
"check",
"(",
"!",
"named",
".",
"containsKey",
"(",
"name",
")",
",",
"\"Duplicate parameter %s declaration at position %s\"",
",",
"name",
",",
... | Register parameter as named.
@param name parameter name
@param paramInfo parameter object | [
"Register",
"parameter",
"as",
"named",
"."
] | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/param/CommandParamsContext.java#L48-L52 |
jeluard/semantic-versioning | api/src/main/java/org/osjava/jardiff/DOMDiffHandler.java | DOMDiffHandler.startDiff | public void startDiff(String oldJar, String newJar) throws DiffException {
"""
Start the diff.
This writes out the start of a <diff> node.
@param oldJar ignored
@param newJar ignored
@throws DiffException when there is an underlying exception, e.g.
writing to a file caused an IOException
"""
... | java | public void startDiff(String oldJar, String newJar) throws DiffException {
Element tmp = doc.createElementNS(XML_URI, "diff");
tmp.setAttribute( "old", oldJar);
tmp.setAttribute( "new", newJar);
doc.appendChild(tmp);
currentNode = tmp;
} | [
"public",
"void",
"startDiff",
"(",
"String",
"oldJar",
",",
"String",
"newJar",
")",
"throws",
"DiffException",
"{",
"Element",
"tmp",
"=",
"doc",
".",
"createElementNS",
"(",
"XML_URI",
",",
"\"diff\"",
")",
";",
"tmp",
".",
"setAttribute",
"(",
"\"old\"",... | Start the diff.
This writes out the start of a <diff> node.
@param oldJar ignored
@param newJar ignored
@throws DiffException when there is an underlying exception, e.g.
writing to a file caused an IOException | [
"Start",
"the",
"diff",
".",
"This",
"writes",
"out",
"the",
"start",
"of",
"a",
"<",
";",
"diff>",
";",
"node",
"."
] | train | https://github.com/jeluard/semantic-versioning/blob/d0bfbeddca8ac4202f5225810227c72a708360a9/api/src/main/java/org/osjava/jardiff/DOMDiffHandler.java#L127-L133 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/results/PathNormalizer.java | PathNormalizer.addNonBlank | private static void addNonBlank(final String string, final List<String> strings) {
"""
Adds the string to the list if it is not blank.
@param string The string to add
@param strings The list
"""
if (!StringUtils.isBlank(string) && !"/".equals(string))
strings.add(string);
} | java | private static void addNonBlank(final String string, final List<String> strings) {
if (!StringUtils.isBlank(string) && !"/".equals(string))
strings.add(string);
} | [
"private",
"static",
"void",
"addNonBlank",
"(",
"final",
"String",
"string",
",",
"final",
"List",
"<",
"String",
">",
"strings",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isBlank",
"(",
"string",
")",
"&&",
"!",
"\"/\"",
".",
"equals",
"(",
"str... | Adds the string to the list if it is not blank.
@param string The string to add
@param strings The list | [
"Adds",
"the",
"string",
"to",
"the",
"list",
"if",
"it",
"is",
"not",
"blank",
"."
] | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/results/PathNormalizer.java#L94-L97 |
square/okhttp | okhttp/src/main/java/okhttp3/internal/connection/Transmitter.java | Transmitter.maybeReleaseConnection | private @Nullable IOException maybeReleaseConnection(@Nullable IOException e, boolean force) {
"""
Release the connection if it is no longer needed. This is called after each exchange completes
and after the call signals that no more exchanges are expected.
<p>If the transmitter was canceled or timed out, this... | java | private @Nullable IOException maybeReleaseConnection(@Nullable IOException e, boolean force) {
Socket socket;
Connection releasedConnection;
boolean callEnd;
synchronized (connectionPool) {
if (force && exchange != null) {
throw new IllegalStateException("cannot release connection while it... | [
"private",
"@",
"Nullable",
"IOException",
"maybeReleaseConnection",
"(",
"@",
"Nullable",
"IOException",
"e",
",",
"boolean",
"force",
")",
"{",
"Socket",
"socket",
";",
"Connection",
"releasedConnection",
";",
"boolean",
"callEnd",
";",
"synchronized",
"(",
"con... | Release the connection if it is no longer needed. This is called after each exchange completes
and after the call signals that no more exchanges are expected.
<p>If the transmitter was canceled or timed out, this will wrap {@code e} in an exception that
provides that additional context. Otherwise {@code e} is returned... | [
"Release",
"the",
"connection",
"if",
"it",
"is",
"no",
"longer",
"needed",
".",
"This",
"is",
"called",
"after",
"each",
"exchange",
"completes",
"and",
"after",
"the",
"call",
"signals",
"that",
"no",
"more",
"exchanges",
"are",
"expected",
"."
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/connection/Transmitter.java#L279-L310 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/ObjectWritable.java | ObjectWritable.readObject | public static Object readObject(DataInput in, Configuration conf)
throws IOException {
"""
Read a {@link Writable}, {@link String}, primitive type, or an array of
the preceding.
"""
return readObject(in, null, conf);
} | java | public static Object readObject(DataInput in, Configuration conf)
throws IOException {
return readObject(in, null, conf);
} | [
"public",
"static",
"Object",
"readObject",
"(",
"DataInput",
"in",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"return",
"readObject",
"(",
"in",
",",
"null",
",",
"conf",
")",
";",
"}"
] | Read a {@link Writable}, {@link String}, primitive type, or an array of
the preceding. | [
"Read",
"a",
"{"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/ObjectWritable.java#L239-L242 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Invariants.java | Invariants.checkInvariantL | public static long checkInvariantL(
final long value,
final ContractLongConditionType condition)
throws InvariantViolationException {
"""
A {@code long} specialized version of {@link #checkInvariant(Object,
ContractConditionType)}.
@param value The value
@param condition The predicate
@retu... | java | public static long checkInvariantL(
final long value,
final ContractLongConditionType condition)
throws InvariantViolationException
{
return checkInvariantL(value, condition.predicate(), condition.describer());
} | [
"public",
"static",
"long",
"checkInvariantL",
"(",
"final",
"long",
"value",
",",
"final",
"ContractLongConditionType",
"condition",
")",
"throws",
"InvariantViolationException",
"{",
"return",
"checkInvariantL",
"(",
"value",
",",
"condition",
".",
"predicate",
"(",... | A {@code long} specialized version of {@link #checkInvariant(Object,
ContractConditionType)}.
@param value The value
@param condition The predicate
@return value
@throws InvariantViolationException If the predicate is false | [
"A",
"{",
"@code",
"long",
"}",
"specialized",
"version",
"of",
"{",
"@link",
"#checkInvariant",
"(",
"Object",
"ContractConditionType",
")",
"}",
"."
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Invariants.java#L429-L435 |
theHilikus/JRoboCom | jrobocom-simple-gui/src/main/java/com/github/thehilikus/jrobocom/gui/panels/BoardPanel.java | BoardPanel.moveItem | public void moveItem(Point oldCoordinates, Point newCoordinates) {
"""
Changes the position of the item in the specified location
@param oldCoordinates position of the item to move
@param newCoordinates position to move the item to
"""
assertEDT();
if (oldCoordinates == null || newCoordinates == null) {
... | java | public void moveItem(Point oldCoordinates, Point newCoordinates) {
assertEDT();
if (oldCoordinates == null || newCoordinates == null) {
throw new IllegalArgumentException("Coordinates cannot be null");
}
if (getPanelAt(newCoordinates).hasModel()) {
throw new IllegalStateException(
"New position cont... | [
"public",
"void",
"moveItem",
"(",
"Point",
"oldCoordinates",
",",
"Point",
"newCoordinates",
")",
"{",
"assertEDT",
"(",
")",
";",
"if",
"(",
"oldCoordinates",
"==",
"null",
"||",
"newCoordinates",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExcep... | Changes the position of the item in the specified location
@param oldCoordinates position of the item to move
@param newCoordinates position to move the item to | [
"Changes",
"the",
"position",
"of",
"the",
"item",
"in",
"the",
"specified",
"location"
] | train | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-simple-gui/src/main/java/com/github/thehilikus/jrobocom/gui/panels/BoardPanel.java#L102-L120 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java | CPOptionPersistenceImpl.removeByUUID_G | @Override
public CPOption removeByUUID_G(String uuid, long groupId)
throws NoSuchCPOptionException {
"""
Removes the cp option where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp option that was removed
"""
CPOption cpOption = find... | java | @Override
public CPOption removeByUUID_G(String uuid, long groupId)
throws NoSuchCPOptionException {
CPOption cpOption = findByUUID_G(uuid, groupId);
return remove(cpOption);
} | [
"@",
"Override",
"public",
"CPOption",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPOptionException",
"{",
"CPOption",
"cpOption",
"=",
"findByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"return",
"remove",
"(",
... | Removes the cp option where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp option that was removed | [
"Removes",
"the",
"cp",
"option",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java#L805-L811 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/MediaIntents.java | MediaIntents.newPlayMediaFileIntent | public static Intent newPlayMediaFileIntent(String path, String type) {
"""
Open the media player to play the given media
@param path The file path of the media to play.
@param type The mime type
@return the intent
"""
return newPlayMediaIntent(Uri.fromFile(new File(path)), type);
} | java | public static Intent newPlayMediaFileIntent(String path, String type) {
return newPlayMediaIntent(Uri.fromFile(new File(path)), type);
} | [
"public",
"static",
"Intent",
"newPlayMediaFileIntent",
"(",
"String",
"path",
",",
"String",
"type",
")",
"{",
"return",
"newPlayMediaIntent",
"(",
"Uri",
".",
"fromFile",
"(",
"new",
"File",
"(",
"path",
")",
")",
",",
"type",
")",
";",
"}"
] | Open the media player to play the given media
@param path The file path of the media to play.
@param type The mime type
@return the intent | [
"Open",
"the",
"media",
"player",
"to",
"play",
"the",
"given",
"media"
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/MediaIntents.java#L171-L173 |
vigna/Sux4J | src/it/unimi/dsi/sux4j/mph/Hashes.java | Hashes.spooky4 | @SuppressWarnings( {
"""
SpookyHash (up to four values produced) for a triple of longs.
@param triple
three longs.
@param seed
a seed for the hash.
@param tuple
a tuple of longs in which up to four generated hashes will be
saved.
""""fallthrough"})
public static void spooky4(final long[] triple, fina... | java | @SuppressWarnings({"fallthrough"})
public static void spooky4(final long[] triple, final long seed, final long[] tuple) {
long h0, h1, h2, h3;
h0 = seed;
h1 = ARBITRARY_BITS + triple[0];
h2 = ARBITRARY_BITS + triple[1];
h3 = ARBITRARY_BITS + triple[2];
h2 = Long.rotateLeft(h2, 50);
h2 += h3;
h0 ^= h2;... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"fallthrough\"",
"}",
")",
"public",
"static",
"void",
"spooky4",
"(",
"final",
"long",
"[",
"]",
"triple",
",",
"final",
"long",
"seed",
",",
"final",
"long",
"[",
"]",
"tuple",
")",
"{",
"long",
"h0",
",",
"h1",
... | SpookyHash (up to four values produced) for a triple of longs.
@param triple
three longs.
@param seed
a seed for the hash.
@param tuple
a tuple of longs in which up to four generated hashes will be
saved. | [
"SpookyHash",
"(",
"up",
"to",
"four",
"values",
"produced",
")",
"for",
"a",
"triple",
"of",
"longs",
"."
] | train | https://github.com/vigna/Sux4J/blob/d57de8fa897c7d273e0e6dae7a3274174f175a5f/src/it/unimi/dsi/sux4j/mph/Hashes.java#L2444-L2499 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/SimpleSubstitutionMatrix.java | SimpleSubstitutionMatrix.getIndexOfCompound | private static <C extends Compound> int getIndexOfCompound(List<C> list, C compound) {
"""
Returns the index of the first occurrence of the specified element in the list.
If the list does not contain the given compound, the index of the first occurrence
of the element according to case-insensitive equality.
If ... | java | private static <C extends Compound> int getIndexOfCompound(List<C> list, C compound) {
int index = list.indexOf(compound);
if (index == -1) {
for (int i = 0; i < list.size(); i++) {
if (compound.equalsIgnoreCase(list.get(i))) {
index = i;
break;
}
}
}
return index;
} | [
"private",
"static",
"<",
"C",
"extends",
"Compound",
">",
"int",
"getIndexOfCompound",
"(",
"List",
"<",
"C",
">",
"list",
",",
"C",
"compound",
")",
"{",
"int",
"index",
"=",
"list",
".",
"indexOf",
"(",
"compound",
")",
";",
"if",
"(",
"index",
"=... | Returns the index of the first occurrence of the specified element in the list.
If the list does not contain the given compound, the index of the first occurrence
of the element according to case-insensitive equality.
If no such elements exist, -1 is returned.
@param list list of compounds to search
@param compound com... | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"element",
"in",
"the",
"list",
".",
"If",
"the",
"list",
"does",
"not",
"contain",
"the",
"given",
"compound",
"the",
"index",
"of",
"the",
"first",
"occurrence",
"of... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/SimpleSubstitutionMatrix.java#L229-L240 |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java | MarkLogicClient.sendRemove | public void sendRemove(String baseURI, Resource subject,URI predicate, Value object, Resource... contexts) throws MarkLogicSesameException {
"""
remove single triple
@param baseURI
@param subject
@param predicate
@param object
@param contexts
"""
if (DELETE_CACHE_ENABLED) {
timerDeleteCache.add(sub... | java | public void sendRemove(String baseURI, Resource subject,URI predicate, Value object, Resource... contexts) throws MarkLogicSesameException {
if (DELETE_CACHE_ENABLED) {
timerDeleteCache.add(subject, predicate, object, contexts);
} else {
if (WRITE_CACHE_ENABLED)
sync();
getClient().performRemove(baseUR... | [
"public",
"void",
"sendRemove",
"(",
"String",
"baseURI",
",",
"Resource",
"subject",
",",
"URI",
"predicate",
",",
"Value",
"object",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"MarkLogicSesameException",
"{",
"if",
"(",
"DELETE_CACHE_ENABLED",
")",
"{"... | remove single triple
@param baseURI
@param subject
@param predicate
@param object
@param contexts | [
"remove",
"single",
"triple"
] | train | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java#L357-L365 |
aws/aws-sdk-java | aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/StandardsSubscriptionRequest.java | StandardsSubscriptionRequest.withStandardsInput | public StandardsSubscriptionRequest withStandardsInput(java.util.Map<String, String> standardsInput) {
"""
<p/>
@param standardsInput
@return Returns a reference to this object so that method calls can be chained together.
"""
setStandardsInput(standardsInput);
return this;
} | java | public StandardsSubscriptionRequest withStandardsInput(java.util.Map<String, String> standardsInput) {
setStandardsInput(standardsInput);
return this;
} | [
"public",
"StandardsSubscriptionRequest",
"withStandardsInput",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"standardsInput",
")",
"{",
"setStandardsInput",
"(",
"standardsInput",
")",
";",
"return",
"this",
";",
"}"
] | <p/>
@param standardsInput
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
"/",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/StandardsSubscriptionRequest.java#L157-L160 |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/Snapshot.java | Snapshot.withCroppedThumbnail | public T withCroppedThumbnail(double scale, double cropWidth, double cropHeight) {
"""
Generate cropped thumbnail of the original screenshot.
Will save different thumbnails depends on when it was called in the chain.
@param scale to apply
@param cropWidth e.g. 0.2 will leave 20% of the initial width
@param c... | java | public T withCroppedThumbnail(double scale, double cropWidth, double cropHeight) {
return withCroppedThumbnail(Paths.get(location.toString(), "./thumbnails").toString(), "thumb_" + fileName, scale,cropWidth,cropHeight);
} | [
"public",
"T",
"withCroppedThumbnail",
"(",
"double",
"scale",
",",
"double",
"cropWidth",
",",
"double",
"cropHeight",
")",
"{",
"return",
"withCroppedThumbnail",
"(",
"Paths",
".",
"get",
"(",
"location",
".",
"toString",
"(",
")",
",",
"\"./thumbnails\"",
"... | Generate cropped thumbnail of the original screenshot.
Will save different thumbnails depends on when it was called in the chain.
@param scale to apply
@param cropWidth e.g. 0.2 will leave 20% of the initial width
@param cropHeight e.g. 0.1 will leave 10% of the initial width
@return instance of type Snapshot | [
"Generate",
"cropped",
"thumbnail",
"of",
"the",
"original",
"screenshot",
".",
"Will",
"save",
"different",
"thumbnails",
"depends",
"on",
"when",
"it",
"was",
"called",
"in",
"the",
"chain",
"."
] | train | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/Snapshot.java#L132-L134 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/util/binary/BitOutputStream.java | BitOutputStream.writeVarLong | public void writeVarLong(final long value) throws IOException {
"""
Write var long.
@param value the value
@throws IOException the io exception
"""
final int bitLength = new Bits(value).bitLength;
int type = Arrays.binarySearch(varLongDepths, bitLength);
if (type < 0) {
type = -type - 1;
... | java | public void writeVarLong(final long value) throws IOException {
final int bitLength = new Bits(value).bitLength;
int type = Arrays.binarySearch(varLongDepths, bitLength);
if (type < 0) {
type = -type - 1;
}
this.write(new Bits(type, 2));
this.write(new Bits(value, varLongDepths[type]));
... | [
"public",
"void",
"writeVarLong",
"(",
"final",
"long",
"value",
")",
"throws",
"IOException",
"{",
"final",
"int",
"bitLength",
"=",
"new",
"Bits",
"(",
"value",
")",
".",
"bitLength",
";",
"int",
"type",
"=",
"Arrays",
".",
"binarySearch",
"(",
"varLongD... | Write var long.
@param value the value
@throws IOException the io exception | [
"Write",
"var",
"long",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/util/binary/BitOutputStream.java#L200-L208 |
joniles/mpxj | src/main/java/net/sf/mpxj/common/DateHelper.java | DateHelper.getVariance | public static Duration getVariance(Task task, Date date1, Date date2, TimeUnit format) {
"""
This utility method calculates the difference in working
time between two dates, given the context of a task.
@param task parent task
@param date1 first date
@param date2 second date
@param format required format fo... | java | public static Duration getVariance(Task task, Date date1, Date date2, TimeUnit format)
{
Duration variance = null;
if (date1 != null && date2 != null)
{
ProjectCalendar calendar = task.getEffectiveCalendar();
if (calendar != null)
{
variance = calendar.getWor... | [
"public",
"static",
"Duration",
"getVariance",
"(",
"Task",
"task",
",",
"Date",
"date1",
",",
"Date",
"date2",
",",
"TimeUnit",
"format",
")",
"{",
"Duration",
"variance",
"=",
"null",
";",
"if",
"(",
"date1",
"!=",
"null",
"&&",
"date2",
"!=",
"null",
... | This utility method calculates the difference in working
time between two dates, given the context of a task.
@param task parent task
@param date1 first date
@param date2 second date
@param format required format for the resulting duration
@return difference in working time between the two dates | [
"This",
"utility",
"method",
"calculates",
"the",
"difference",
"in",
"working",
"time",
"between",
"two",
"dates",
"given",
"the",
"context",
"of",
"a",
"task",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/common/DateHelper.java#L247-L266 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Functions.java | Functions.filterLongs | public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> filterLongs(DoublePredicate b) {
"""
/*
Fluent filter operation using primitive types
e.g.
<pre>
{@code
import static cyclops.ReactiveSeq.filterDoubles;
ReactiveSeq.ofDoubles(1d,2d,3d)
.to(filterDoubles(i->i>2));
//[3d]
... | java | public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> filterLongs(DoublePredicate b){
return a->a.doubles(i->i,s->s.filter(b));
} | [
"public",
"static",
"Function",
"<",
"?",
"super",
"ReactiveSeq",
"<",
"Double",
">",
",",
"?",
"extends",
"ReactiveSeq",
"<",
"Double",
">",
">",
"filterLongs",
"(",
"DoublePredicate",
"b",
")",
"{",
"return",
"a",
"->",
"a",
".",
"doubles",
"(",
"i",
... | /*
Fluent filter operation using primitive types
e.g.
<pre>
{@code
import static cyclops.ReactiveSeq.filterDoubles;
ReactiveSeq.ofDoubles(1d,2d,3d)
.to(filterDoubles(i->i>2));
//[3d]
}
</pre> | [
"/",
"*",
"Fluent",
"filter",
"operation",
"using",
"primitive",
"types",
"e",
".",
"g",
".",
"<pre",
">",
"{",
"@code",
"import",
"static",
"cyclops",
".",
"ReactiveSeq",
".",
"filterDoubles",
";"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Functions.java#L518-L521 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_user_POST | public OvhTask serviceName_user_POST(String serviceName, String home, String login, String password, OvhSshStateEnum sshState) throws IOException {
"""
Create new ftp/ssh user
REST: POST /hosting/web/{serviceName}/user
@param password [required] Password
@param login [required] Login use for your new user
@p... | java | public OvhTask serviceName_user_POST(String serviceName, String home, String login, String password, OvhSshStateEnum sshState) throws IOException {
String qPath = "/hosting/web/{serviceName}/user";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, ... | [
"public",
"OvhTask",
"serviceName_user_POST",
"(",
"String",
"serviceName",
",",
"String",
"home",
",",
"String",
"login",
",",
"String",
"password",
",",
"OvhSshStateEnum",
"sshState",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serv... | Create new ftp/ssh user
REST: POST /hosting/web/{serviceName}/user
@param password [required] Password
@param login [required] Login use for your new user
@param sshState [required] Ssh state for this user. Default: none
@param home [required] Home directory
@param serviceName [required] The internal name of your host... | [
"Create",
"new",
"ftp",
"/",
"ssh",
"user"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1694-L1704 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/user/UserCoreDao.java | UserCoreDao.buildWhere | public String buildWhere(String field, Object value, String operation) {
"""
Build where (or selection) statement for a single field using the
provided operation
@param field
field
@param value
value
@param operation
operation
@return where clause
"""
return CoreSQLUtils.quoteWrap(field) + " "
... | java | public String buildWhere(String field, Object value, String operation) {
return CoreSQLUtils.quoteWrap(field) + " "
+ (value != null ? operation + " ?" : "IS NULL");
} | [
"public",
"String",
"buildWhere",
"(",
"String",
"field",
",",
"Object",
"value",
",",
"String",
"operation",
")",
"{",
"return",
"CoreSQLUtils",
".",
"quoteWrap",
"(",
"field",
")",
"+",
"\" \"",
"+",
"(",
"value",
"!=",
"null",
"?",
"operation",
"+",
"... | Build where (or selection) statement for a single field using the
provided operation
@param field
field
@param value
value
@param operation
operation
@return where clause | [
"Build",
"where",
"(",
"or",
"selection",
")",
"statement",
"for",
"a",
"single",
"field",
"using",
"the",
"provided",
"operation"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/user/UserCoreDao.java#L715-L718 |
openengsb/openengsb | api/ekb/src/main/java/org/openengsb/core/ekb/api/transformation/TransformationDescription.java | TransformationDescription.removeLeadingField | public void removeLeadingField(String sourceField, String targetField, String regexString, String length) {
"""
Adds a remove leading step to the transformation description. The source and the target field need to be of
String type. Based on the given regular expression string the beginning of the source string w... | java | public void removeLeadingField(String sourceField, String targetField, String regexString, String length) {
TransformationStep step = new TransformationStep();
step.setSourceFields(sourceField);
step.setTargetField(targetField);
step.setOperationParameter(TransformationConstants.REMOVELE... | [
"public",
"void",
"removeLeadingField",
"(",
"String",
"sourceField",
",",
"String",
"targetField",
",",
"String",
"regexString",
",",
"String",
"length",
")",
"{",
"TransformationStep",
"step",
"=",
"new",
"TransformationStep",
"(",
")",
";",
"step",
".",
"setS... | Adds a remove leading step to the transformation description. The source and the target field need to be of
String type. Based on the given regular expression string the beginning of the source string will be removed
until the given maximum length. If the length is 0, the maximum length is ignored. | [
"Adds",
"a",
"remove",
"leading",
"step",
"to",
"the",
"transformation",
"description",
".",
"The",
"source",
"and",
"the",
"target",
"field",
"need",
"to",
"be",
"of",
"String",
"type",
".",
"Based",
"on",
"the",
"given",
"regular",
"expression",
"string",
... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/transformation/TransformationDescription.java#L260-L268 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/flow/FactoryDenseOpticalFlow.java | FactoryDenseOpticalFlow.hornSchunck | public static <T extends ImageGray<T>,D extends ImageGray<D>>
DenseOpticalFlow<T> hornSchunck( @Nullable ConfigHornSchunck config , Class<T> imageType ) {
"""
The original Horn-Schunck algorithm. Only good for very small motions.
@see HornSchunck
@param config Configuration parameters. If null then defaul... | java | public static <T extends ImageGray<T>,D extends ImageGray<D>>
DenseOpticalFlow<T> hornSchunck( @Nullable ConfigHornSchunck config , Class<T> imageType )
{
if( config == null )
config = new ConfigHornSchunck();
HornSchunck<T,D> alg;
if( imageType == GrayU8.class )
alg = (HornSchunck)new HornSchunck_U8(con... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"DenseOpticalFlow",
"<",
"T",
">",
"hornSchunck",
"(",
"@",
"Nullable",
"ConfigHornSchunck",
"config",
",",
"Class",
"<",
"T",
">",... | The original Horn-Schunck algorithm. Only good for very small motions.
@see HornSchunck
@param config Configuration parameters. If null then default is used.
@param imageType Type of input gray scale image
@return dense optical flow | [
"The",
"original",
"Horn",
"-",
"Schunck",
"algorithm",
".",
"Only",
"good",
"for",
"very",
"small",
"motions",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/flow/FactoryDenseOpticalFlow.java#L122-L138 |
apereo/cas | support/cas-server-support-rest-authentication/src/main/java/org/apereo/cas/adaptors/rest/RestAuthenticationHandler.java | RestAuthenticationHandler.getWarnings | protected List<MessageDescriptor> getWarnings(final ResponseEntity<?> authenticationResponse) {
"""
Resolve {@link MessageDescriptor warnings} from the {@link ResponseEntity authenticationResponse}.
@param authenticationResponse The response sent by the REST authentication endpoint
@return The warnings for the... | java | protected List<MessageDescriptor> getWarnings(final ResponseEntity<?> authenticationResponse) {
val messageDescriptors = new ArrayList<MessageDescriptor>();
val passwordExpirationDate = authenticationResponse.getHeaders().getFirstZonedDateTime("X-CAS-PasswordExpirationDate");
if (passwordExpira... | [
"protected",
"List",
"<",
"MessageDescriptor",
">",
"getWarnings",
"(",
"final",
"ResponseEntity",
"<",
"?",
">",
"authenticationResponse",
")",
"{",
"val",
"messageDescriptors",
"=",
"new",
"ArrayList",
"<",
"MessageDescriptor",
">",
"(",
")",
";",
"val",
"pass... | Resolve {@link MessageDescriptor warnings} from the {@link ResponseEntity authenticationResponse}.
@param authenticationResponse The response sent by the REST authentication endpoint
@return The warnings for the created {@link AuthenticationHandlerExecutionResult} | [
"Resolve",
"{",
"@link",
"MessageDescriptor",
"warnings",
"}",
"from",
"the",
"{",
"@link",
"ResponseEntity",
"authenticationResponse",
"}",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-rest-authentication/src/main/java/org/apereo/cas/adaptors/rest/RestAuthenticationHandler.java#L95-L112 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/Update.java | Update.withExpressionAttributeNames | public Update withExpressionAttributeNames(java.util.Map<String, String> expressionAttributeNames) {
"""
<p>
One or more substitution tokens for attribute names in an expression.
</p>
@param expressionAttributeNames
One or more substitution tokens for attribute names in an expression.
@return Returns a refe... | java | public Update withExpressionAttributeNames(java.util.Map<String, String> expressionAttributeNames) {
setExpressionAttributeNames(expressionAttributeNames);
return this;
} | [
"public",
"Update",
"withExpressionAttributeNames",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"expressionAttributeNames",
")",
"{",
"setExpressionAttributeNames",
"(",
"expressionAttributeNames",
")",
";",
"return",
"this",
";",
"}"
] | <p>
One or more substitution tokens for attribute names in an expression.
</p>
@param expressionAttributeNames
One or more substitution tokens for attribute names in an expression.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"One",
"or",
"more",
"substitution",
"tokens",
"for",
"attribute",
"names",
"in",
"an",
"expression",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/Update.java#L306-L309 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/utils/JarUtils.java | JarUtils.appendPathElt | private static void appendPathElt(final Object pathElt, final StringBuilder buf) {
"""
Append a path element to a buffer.
@param pathElt
the path element
@param buf
the buf
"""
if (buf.length() > 0) {
buf.append(File.pathSeparatorChar);
}
// Escape any rogue path separ... | java | private static void appendPathElt(final Object pathElt, final StringBuilder buf) {
if (buf.length() > 0) {
buf.append(File.pathSeparatorChar);
}
// Escape any rogue path separators, as long as file separator is not '\\' (on Windows, if there are any
// extra ';' characters in... | [
"private",
"static",
"void",
"appendPathElt",
"(",
"final",
"Object",
"pathElt",
",",
"final",
"StringBuilder",
"buf",
")",
"{",
"if",
"(",
"buf",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"buf",
".",
"append",
"(",
"File",
".",
"pathSeparatorChar",
... | Append a path element to a buffer.
@param pathElt
the path element
@param buf
the buf | [
"Append",
"a",
"path",
"element",
"to",
"a",
"buffer",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/JarUtils.java#L191-L201 |
EdwardRaff/JSAT | JSAT/src/jsat/io/DataWriter.java | DataWriter.writePoint | public void writePoint(double weight, DataPoint dp, double label) throws IOException {
"""
Write out the given data point to the output stream
@param weight weight of the given data point to write out
@param dp the data point to write to the file
@param label The associated label for this dataum. If {@link #typ... | java | public void writePoint(double weight, DataPoint dp, double label) throws IOException
{
ByteArrayOutputStream baos = local_baos.get();
pointToBytes(weight, dp, label, baos);
if(baos.size() >= LOCAL_BUFFER_SIZE)//We've got a big chunk of data, lets dump it
synchronized(out)
... | [
"public",
"void",
"writePoint",
"(",
"double",
"weight",
",",
"DataPoint",
"dp",
",",
"double",
"label",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"local_baos",
".",
"get",
"(",
")",
";",
"pointToBytes",
"(",
"weight",
",",
"dp... | Write out the given data point to the output stream
@param weight weight of the given data point to write out
@param dp the data point to write to the file
@param label The associated label for this dataum. If {@link #type} is a
{@link DataSetType#SIMPLE} set, this value will be ignored. If
{@link DataSetType#CLASSIFIC... | [
"Write",
"out",
"the",
"given",
"data",
"point",
"to",
"the",
"output",
"stream"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/DataWriter.java#L114-L124 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/util/EventManger.java | EventManger.performActionAndWaitForEvent | public R performActionAndWaitForEvent(K eventKey, long timeout, Callback<E> action) throws InterruptedException, E {
"""
Perform an action and wait for an event.
<p>
The event is signaled with {@link #signalEvent(Object, Object)}.
</p>
@param eventKey the event key, must not be null.
@param timeout the time... | java | public R performActionAndWaitForEvent(K eventKey, long timeout, Callback<E> action) throws InterruptedException, E {
final Reference<R> reference = new Reference<>();
events.put(eventKey, reference);
try {
synchronized (reference) {
action.action();
re... | [
"public",
"R",
"performActionAndWaitForEvent",
"(",
"K",
"eventKey",
",",
"long",
"timeout",
",",
"Callback",
"<",
"E",
">",
"action",
")",
"throws",
"InterruptedException",
",",
"E",
"{",
"final",
"Reference",
"<",
"R",
">",
"reference",
"=",
"new",
"Refere... | Perform an action and wait for an event.
<p>
The event is signaled with {@link #signalEvent(Object, Object)}.
</p>
@param eventKey the event key, must not be null.
@param timeout the timeout to wait for the event in milliseconds.
@param action the action to perform prior waiting for the event, must not be null.
@retur... | [
"Perform",
"an",
"action",
"and",
"wait",
"for",
"an",
"event",
".",
"<p",
">",
"The",
"event",
"is",
"signaled",
"with",
"{",
"@link",
"#signalEvent",
"(",
"Object",
"Object",
")",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/util/EventManger.java#L52-L65 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/util/AstUtil.java | AstUtil.isMethodCall | public static boolean isMethodCall(Expression expression, String methodObjectPattern, String methodNamePattern) {
"""
Return true only if the expression represents a method call (MethodCallExpression) for the specified
method object (receiver) and method name.
@param expression - the AST expression to be check... | java | public static boolean isMethodCall(Expression expression, String methodObjectPattern, String methodNamePattern) {
return isMethodCallOnObject(expression, methodObjectPattern) && isMethodNamed((MethodCallExpression) expression, methodNamePattern);
} | [
"public",
"static",
"boolean",
"isMethodCall",
"(",
"Expression",
"expression",
",",
"String",
"methodObjectPattern",
",",
"String",
"methodNamePattern",
")",
"{",
"return",
"isMethodCallOnObject",
"(",
"expression",
",",
"methodObjectPattern",
")",
"&&",
"isMethodNamed... | Return true only if the expression represents a method call (MethodCallExpression) for the specified
method object (receiver) and method name.
@param expression - the AST expression to be checked
@param methodObjectPattern - the name of the method object (receiver)
@param methodNamePattern - the name of the method bei... | [
"Return",
"true",
"only",
"if",
"the",
"expression",
"represents",
"a",
"method",
"call",
"(",
"MethodCallExpression",
")",
"for",
"the",
"specified",
"method",
"object",
"(",
"receiver",
")",
"and",
"method",
"name",
"."
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/util/AstUtil.java#L337-L339 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/SymbolTable.java | SymbolTable.addAvailable | public void addAvailable(QualifiedName name, List<Decl.Named> available) {
"""
Make available declarations for an external symbol. This makes those
declarations available within the target for linking.
@param name Fully qualified name of symbol being consolidated.
@param available List of declaration stu... | java | public void addAvailable(QualifiedName name, List<Decl.Named> available) {
ExternalGroup group = (ExternalGroup) symbolTable.get(name.getUnit());
//
for (int i = 0; i != available.size(); ++i) {
group.addAvailable(available.get(i));
}
} | [
"public",
"void",
"addAvailable",
"(",
"QualifiedName",
"name",
",",
"List",
"<",
"Decl",
".",
"Named",
">",
"available",
")",
"{",
"ExternalGroup",
"group",
"=",
"(",
"ExternalGroup",
")",
"symbolTable",
".",
"get",
"(",
"name",
".",
"getUnit",
"(",
")",
... | Make available declarations for an external symbol. This makes those
declarations available within the target for linking.
@param name Fully qualified name of symbol being consolidated.
@param available List of declaration stubs which have now been imported into
the target. | [
"Make",
"available",
"declarations",
"for",
"an",
"external",
"symbol",
".",
"This",
"makes",
"those",
"declarations",
"available",
"within",
"the",
"target",
"for",
"linking",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/SymbolTable.java#L162-L168 |
lightblue-platform/lightblue-client | core/src/main/java/com/redhat/lightblue/client/Query.java | Query.withMatchingString | public static Query withMatchingString(String field, String value, boolean caseInsensitive) {
"""
<pre>
{ field: <field>, regex: <pattern>, caseInsensitive: <caseInsensitive>, ... }
</pre>
"""
return caseInsensitive ? regex(field, escapeRegExPattern(value), caseInsensitive, false, false, false) : wit... | java | public static Query withMatchingString(String field, String value, boolean caseInsensitive) {
return caseInsensitive ? regex(field, escapeRegExPattern(value), caseInsensitive, false, false, false) : withValue(field, eq, value);
} | [
"public",
"static",
"Query",
"withMatchingString",
"(",
"String",
"field",
",",
"String",
"value",
",",
"boolean",
"caseInsensitive",
")",
"{",
"return",
"caseInsensitive",
"?",
"regex",
"(",
"field",
",",
"escapeRegExPattern",
"(",
"value",
")",
",",
"caseInsen... | <pre>
{ field: <field>, regex: <pattern>, caseInsensitive: <caseInsensitive>, ... }
</pre> | [
"<pre",
">",
"{",
"field",
":",
"<field",
">",
"regex",
":",
"<pattern",
">",
"caseInsensitive",
":",
"<caseInsensitive",
">",
"...",
"}",
"<",
"/",
"pre",
">"
] | train | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/core/src/main/java/com/redhat/lightblue/client/Query.java#L193-L195 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexResponse.java | CmsFlexResponse.processHeaders | public static void processHeaders(Map<String, List<String>> headers, HttpServletResponse res) {
"""
Process the headers stored in the provided map and add them to the response.<p>
@param headers the headers to add
@param res the response to add the headers to
"""
if (headers != null) {
... | java | public static void processHeaders(Map<String, List<String>> headers, HttpServletResponse res) {
if (headers != null) {
Iterator<Map.Entry<String, List<String>>> i = headers.entrySet().iterator();
while (i.hasNext()) {
Map.Entry<String, List<String>> entry = i.next();
... | [
"public",
"static",
"void",
"processHeaders",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
",",
"HttpServletResponse",
"res",
")",
"{",
"if",
"(",
"headers",
"!=",
"null",
")",
"{",
"Iterator",
"<",
"Map",
".",
"Entry",
"... | Process the headers stored in the provided map and add them to the response.<p>
@param headers the headers to add
@param res the response to add the headers to | [
"Process",
"the",
"headers",
"stored",
"in",
"the",
"provided",
"map",
"and",
"add",
"them",
"to",
"the",
"response",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexResponse.java#L328-L346 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java | SeaGlassLookAndFeel.definePopups | private void definePopups(UIDefaults d) {
"""
Initialize the popup settings.
@param d the UI defaults map.
"""
d.put("seaGlassPopupBorder", new ColorUIResource(0xbbbbbb));
d.put("popupMenuInteriorEnabled", Color.WHITE);
// Rossi: Changed color of popup / submenus to get better contr... | java | private void definePopups(UIDefaults d) {
d.put("seaGlassPopupBorder", new ColorUIResource(0xbbbbbb));
d.put("popupMenuInteriorEnabled", Color.WHITE);
// Rossi: Changed color of popup / submenus to get better contrast to bright backgrounds.
// d.put("popupMenuBorderEnabled", new Color(0x... | [
"private",
"void",
"definePopups",
"(",
"UIDefaults",
"d",
")",
"{",
"d",
".",
"put",
"(",
"\"seaGlassPopupBorder\"",
",",
"new",
"ColorUIResource",
"(",
"0xbbbbbb",
")",
")",
";",
"d",
".",
"put",
"(",
"\"popupMenuInteriorEnabled\"",
",",
"Color",
".",
"WHI... | Initialize the popup settings.
@param d the UI defaults map. | [
"Initialize",
"the",
"popup",
"settings",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L1572-L1594 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java | MSPDIWriter.writeResourceExtendedAttributes | private void writeResourceExtendedAttributes(Project.Resources.Resource xml, Resource mpx) {
"""
This method writes extended attribute data for a resource.
@param xml MSPDI resource
@param mpx MPXJ resource
"""
Project.Resources.Resource.ExtendedAttribute attrib;
List<Project.Resources.Resource... | java | private void writeResourceExtendedAttributes(Project.Resources.Resource xml, Resource mpx)
{
Project.Resources.Resource.ExtendedAttribute attrib;
List<Project.Resources.Resource.ExtendedAttribute> extendedAttributes = xml.getExtendedAttribute();
for (ResourceField mpxFieldID : getAllResourceExtend... | [
"private",
"void",
"writeResourceExtendedAttributes",
"(",
"Project",
".",
"Resources",
".",
"Resource",
"xml",
",",
"Resource",
"mpx",
")",
"{",
"Project",
".",
"Resources",
".",
"Resource",
".",
"ExtendedAttribute",
"attrib",
";",
"List",
"<",
"Project",
".",
... | This method writes extended attribute data for a resource.
@param xml MSPDI resource
@param mpx MPXJ resource | [
"This",
"method",
"writes",
"extended",
"attribute",
"data",
"for",
"a",
"resource",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java#L915-L937 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/util/BufferedWriter.java | BufferedWriter.initNewBuffer | void initNewBuffer(Writer out, int bufSize) {
"""
Initializes the output stream with the specified raw output stream.
@param out
the raw output stream
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{ // 306998.15
Tr.debug(tc, "initNewBuffer, size --> " + bu... | java | void initNewBuffer(Writer out, int bufSize)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{ // 306998.15
Tr.debug(tc, "initNewBuffer, size --> " + bufSize + " this --> " + this);
}
this.out = out;
this.except = null;
bufferSize = bufSi... | [
"void",
"initNewBuffer",
"(",
"Writer",
"out",
",",
"int",
"bufSize",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"// 306998.15",
"Tr",
".",
"debug",
"(",
"tc",
",",
... | Initializes the output stream with the specified raw output stream.
@param out
the raw output stream | [
"Initializes",
"the",
"output",
"stream",
"with",
"the",
"specified",
"raw",
"output",
"stream",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/util/BufferedWriter.java#L161-L171 |
apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/LaunchableMesosWorker.java | LaunchableMesosWorker.configureArtifactServer | static void configureArtifactServer(MesosArtifactServer server, ContainerSpecification container) throws IOException {
"""
Configures an artifact server to serve the artifacts associated with a container specification.
@param server the server to configure.
@param container the container with artifacts to serve.... | java | static void configureArtifactServer(MesosArtifactServer server, ContainerSpecification container) throws IOException {
// serve the artifacts associated with the container environment
for (ContainerSpecification.Artifact artifact : container.getArtifacts()) {
server.addPath(artifact.source, artifact.dest);
}
... | [
"static",
"void",
"configureArtifactServer",
"(",
"MesosArtifactServer",
"server",
",",
"ContainerSpecification",
"container",
")",
"throws",
"IOException",
"{",
"// serve the artifacts associated with the container environment",
"for",
"(",
"ContainerSpecification",
".",
"Artifa... | Configures an artifact server to serve the artifacts associated with a container specification.
@param server the server to configure.
@param container the container with artifacts to serve.
@throws IOException if the artifacts cannot be accessed. | [
"Configures",
"an",
"artifact",
"server",
"to",
"serve",
"the",
"artifacts",
"associated",
"with",
"a",
"container",
"specification",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/LaunchableMesosWorker.java#L379-L384 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/config/ServerConfig.java | ServerConfig.setParameters | public ServerConfig setParameters(Map<String, String> parameters) {
"""
Sets parameters.
@param parameters the parameters
@return the parameters
"""
if (this.parameters == null) {
this.parameters = new ConcurrentHashMap<String, String>();
this.parameters.putAll(parameters);
... | java | public ServerConfig setParameters(Map<String, String> parameters) {
if (this.parameters == null) {
this.parameters = new ConcurrentHashMap<String, String>();
this.parameters.putAll(parameters);
}
return this;
} | [
"public",
"ServerConfig",
"setParameters",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"if",
"(",
"this",
".",
"parameters",
"==",
"null",
")",
"{",
"this",
".",
"parameters",
"=",
"new",
"ConcurrentHashMap",
"<",
"String",
",",
... | Sets parameters.
@param parameters the parameters
@return the parameters | [
"Sets",
"parameters",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/config/ServerConfig.java#L613-L619 |
comapi/comapi-chat-sdk-android | COMAPI/chat/src/main/java/com/comapi/chat/ChatController.java | ChatController.synchroniseEvents | private Observable<Boolean> synchroniseEvents(final RxComapiClient client, @NonNull final List<ChatConversation> conversationsToUpdate, @NonNull final List<Boolean> successes) {
"""
Synchronise missing events for the list of locally stored conversations.
@param client Foundation client.
@param c... | java | private Observable<Boolean> synchroniseEvents(final RxComapiClient client, @NonNull final List<ChatConversation> conversationsToUpdate, @NonNull final List<Boolean> successes) {
final List<ChatConversation> limited = limitNumberOfConversations(conversationsToUpdate);
if (limited.isEmpty()) {
... | [
"private",
"Observable",
"<",
"Boolean",
">",
"synchroniseEvents",
"(",
"final",
"RxComapiClient",
"client",
",",
"@",
"NonNull",
"final",
"List",
"<",
"ChatConversation",
">",
"conversationsToUpdate",
",",
"@",
"NonNull",
"final",
"List",
"<",
"Boolean",
">",
"... | Synchronise missing events for the list of locally stored conversations.
@param client Foundation client.
@param conversationsToUpdate List of conversations to query last events.
@param successes List of partial successes.
@return Observable with the merged result of operations. | [
"Synchronise",
"missing",
"events",
"for",
"the",
"list",
"of",
"locally",
"stored",
"conversations",
"."
] | train | https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/ChatController.java#L568-L588 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java | SpiderTransaction.deleteScalarValueColumn | public void deleteScalarValueColumn(TableDefinition tableDef, String objID, String fieldName) {
"""
Delete a scalar value column with the given field name for the given object ID
from the given table.
@param tableDef {@link TableDefinition} of scalar field.
@param objID ID of object.
@param fieldName Sc... | java | public void deleteScalarValueColumn(TableDefinition tableDef, String objID, String fieldName) {
deleteColumn(SpiderService.objectsStoreName(tableDef), objID, fieldName);
} | [
"public",
"void",
"deleteScalarValueColumn",
"(",
"TableDefinition",
"tableDef",
",",
"String",
"objID",
",",
"String",
"fieldName",
")",
"{",
"deleteColumn",
"(",
"SpiderService",
".",
"objectsStoreName",
"(",
"tableDef",
")",
",",
"objID",
",",
"fieldName",
")",... | Delete a scalar value column with the given field name for the given object ID
from the given table.
@param tableDef {@link TableDefinition} of scalar field.
@param objID ID of object.
@param fieldName Scalar field name. | [
"Delete",
"a",
"scalar",
"value",
"column",
"with",
"the",
"given",
"field",
"name",
"for",
"the",
"given",
"object",
"ID",
"from",
"the",
"given",
"table",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java#L408-L410 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxFileUploadSession.java | BoxFileUploadSession.uploadPart | public BoxFileUploadSessionPart uploadPart(InputStream stream, long offset, int partSize,
long totalSizeOfFile) {
"""
Uploads chunk of a stream to an open upload session.
@param stream the stream that is used to read the chunck using the offset and part size.
@param... | java | public BoxFileUploadSessionPart uploadPart(InputStream stream, long offset, int partSize,
long totalSizeOfFile) {
URL uploadPartURL = this.sessionInfo.getSessionEndpoints().getUploadPartEndpoint();
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), ... | [
"public",
"BoxFileUploadSessionPart",
"uploadPart",
"(",
"InputStream",
"stream",
",",
"long",
"offset",
",",
"int",
"partSize",
",",
"long",
"totalSizeOfFile",
")",
"{",
"URL",
"uploadPartURL",
"=",
"this",
".",
"sessionInfo",
".",
"getSessionEndpoints",
"(",
")"... | Uploads chunk of a stream to an open upload session.
@param stream the stream that is used to read the chunck using the offset and part size.
@param offset the byte position where the chunk begins in the file.
@param partSize the part size returned as part of the upload session instance creation.
Only the last chunk ca... | [
"Uploads",
"chunk",
"of",
"a",
"stream",
"to",
"an",
"open",
"upload",
"session",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L241-L258 |
shrinkwrap/resolver | maven/impl-maven-archive/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/archive/plugins/Validate.java | Validate.isReadable | public static void isReadable(final String path, String message) throws IllegalArgumentException {
"""
Checks that the specified String is not null or empty and represents a readable file, throws exception if it is empty or
null and does not represent a path to a file.
@param path The path to check
@param mes... | java | public static void isReadable(final String path, String message) throws IllegalArgumentException {
notNullOrEmpty(path, message);
isReadable(new File(path), message);
} | [
"public",
"static",
"void",
"isReadable",
"(",
"final",
"String",
"path",
",",
"String",
"message",
")",
"throws",
"IllegalArgumentException",
"{",
"notNullOrEmpty",
"(",
"path",
",",
"message",
")",
";",
"isReadable",
"(",
"new",
"File",
"(",
"path",
")",
"... | Checks that the specified String is not null or empty and represents a readable file, throws exception if it is empty or
null and does not represent a path to a file.
@param path The path to check
@param message The exception message
@throws IllegalArgumentException Thrown if path is empty, null or invalid | [
"Checks",
"that",
"the",
"specified",
"String",
"is",
"not",
"null",
"or",
"empty",
"and",
"represents",
"a",
"readable",
"file",
"throws",
"exception",
"if",
"it",
"is",
"empty",
"or",
"null",
"and",
"does",
"not",
"represent",
"a",
"path",
"to",
"a",
"... | train | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/maven/impl-maven-archive/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/archive/plugins/Validate.java#L200-L203 |
lessthanoptimal/ddogleg | src/org/ddogleg/nn/alg/KdTreeConstructor.java | KdTreeConstructor.construct | public KdTree construct(List<P> points , boolean trackIndexes ) {
"""
Creates a new {@link KdTree} from the provided points.
WARNING: Reference to each point is saved to reduce memory usage..
@param points Data points.
@return KdTre
"""
GrowQueue_I32 indexes = null;
if( trackIndexes ) {
indexes =... | java | public KdTree construct(List<P> points , boolean trackIndexes )
{
GrowQueue_I32 indexes = null;
if( trackIndexes ) {
indexes = new GrowQueue_I32();
indexes.resize(points.size());
for (int i = 0; i < indexes.size; i++) {
indexes.data[i] = i;
}
}
KdTree tree = memory.requestTree(splitter.getPoin... | [
"public",
"KdTree",
"construct",
"(",
"List",
"<",
"P",
">",
"points",
",",
"boolean",
"trackIndexes",
")",
"{",
"GrowQueue_I32",
"indexes",
"=",
"null",
";",
"if",
"(",
"trackIndexes",
")",
"{",
"indexes",
"=",
"new",
"GrowQueue_I32",
"(",
")",
";",
"in... | Creates a new {@link KdTree} from the provided points.
WARNING: Reference to each point is saved to reduce memory usage..
@param points Data points.
@return KdTre | [
"Creates",
"a",
"new",
"{",
"@link",
"KdTree",
"}",
"from",
"the",
"provided",
"points",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/nn/alg/KdTreeConstructor.java#L71-L91 |
UrielCh/ovh-java-sdk | ovh-java-sdk-caascontainers/src/main/java/net/minidev/ovh/api/ApiOvhCaascontainers.java | ApiOvhCaascontainers.serviceName_frameworks_frameworkId_password_PUT | public void serviceName_frameworks_frameworkId_password_PUT(String serviceName, String frameworkId, OvhPassword body) throws IOException {
"""
Update the framework access password
REST: PUT /caas/containers/{serviceName}/frameworks/{frameworkId}/password
@param frameworkId [required] framework id
@param servi... | java | public void serviceName_frameworks_frameworkId_password_PUT(String serviceName, String frameworkId, OvhPassword body) throws IOException {
String qPath = "/caas/containers/{serviceName}/frameworks/{frameworkId}/password";
StringBuilder sb = path(qPath, serviceName, frameworkId);
exec(qPath, "PUT", sb.toString(), ... | [
"public",
"void",
"serviceName_frameworks_frameworkId_password_PUT",
"(",
"String",
"serviceName",
",",
"String",
"frameworkId",
",",
"OvhPassword",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/caas/containers/{serviceName}/frameworks/{frameworkId}/pas... | Update the framework access password
REST: PUT /caas/containers/{serviceName}/frameworks/{frameworkId}/password
@param frameworkId [required] framework id
@param serviceName [required] service name
@param body [required] The new framework password
API beta | [
"Update",
"the",
"framework",
"access",
"password"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-caascontainers/src/main/java/net/minidev/ovh/api/ApiOvhCaascontainers.java#L200-L204 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.write | public static void write(OutputStream out, String charsetName, boolean isCloseOut, Object... contents) throws IORuntimeException {
"""
将多部分内容写到流中,自动转换为字符串
@param out 输出流
@param charsetName 写出的内容的字符集
@param isCloseOut 写入完毕是否关闭输出流
@param contents 写入的内容,调用toString()方法,不包括不会自动换行
@throws IORuntimeException IO异常
... | java | public static void write(OutputStream out, String charsetName, boolean isCloseOut, Object... contents) throws IORuntimeException {
write(out, CharsetUtil.charset(charsetName), isCloseOut, contents);
} | [
"public",
"static",
"void",
"write",
"(",
"OutputStream",
"out",
",",
"String",
"charsetName",
",",
"boolean",
"isCloseOut",
",",
"Object",
"...",
"contents",
")",
"throws",
"IORuntimeException",
"{",
"write",
"(",
"out",
",",
"CharsetUtil",
".",
"charset",
"(... | 将多部分内容写到流中,自动转换为字符串
@param out 输出流
@param charsetName 写出的内容的字符集
@param isCloseOut 写入完毕是否关闭输出流
@param contents 写入的内容,调用toString()方法,不包括不会自动换行
@throws IORuntimeException IO异常 | [
"将多部分内容写到流中,自动转换为字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L891-L893 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java | ExpressRoutePortsInner.updateTagsAsync | public Observable<ExpressRoutePortInner> updateTagsAsync(String resourceGroupName, String expressRoutePortName) {
"""
Update ExpressRoutePort tags.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@throws IllegalArgumentException t... | java | public Observable<ExpressRoutePortInner> updateTagsAsync(String resourceGroupName, String expressRoutePortName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1<ServiceResponse<ExpressRoutePortInner>, ExpressRoutePortInner>() {
@Override
... | [
"public",
"Observable",
"<",
"ExpressRoutePortInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRoutePortName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"expressRoutePortName",
")",
"."... | Update ExpressRoutePort tags.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Update",
"ExpressRoutePort",
"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/ExpressRoutePortsInner.java#L554-L561 |
Stratio/deep-spark | deep-elasticsearch/src/main/java/com/stratio/deep/es/utils/UtilES.java | UtilES.getObjectFromJson | public static <T> T getObjectFromJson(Class<T> classEntity, LinkedMapWritable jsonObject)
throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException {
"""
converts from JSONObject to an entity class with deep's anotations
@param classEntity the entity nam... | java | public static <T> T getObjectFromJson(Class<T> classEntity, LinkedMapWritable jsonObject)
throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException {
T t = classEntity.newInstance();
Field[] fields = AnnotationUtils.filterDeepFields(classEntity)... | [
"public",
"static",
"<",
"T",
">",
"T",
"getObjectFromJson",
"(",
"Class",
"<",
"T",
">",
"classEntity",
",",
"LinkedMapWritable",
"jsonObject",
")",
"throws",
"IllegalAccessException",
",",
"InstantiationException",
",",
"InvocationTargetException",
",",
"NoSuchMetho... | converts from JSONObject to an entity class with deep's anotations
@param classEntity the entity name.
@param jsonObject the instance of the JSONObject to convert.
@param <T> return type.
@return the provided JSONObject converted to an instance of T.
@throws IllegalAccessException
@throws InstantiationExcepti... | [
"converts",
"from",
"JSONObject",
"to",
"an",
"entity",
"class",
"with",
"deep",
"s",
"anotations"
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-elasticsearch/src/main/java/com/stratio/deep/es/utils/UtilES.java#L88-L128 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java | AbstractIndexWriter.addDescription | protected void addDescription(ClassDoc cd, Content dlTree, SearchIndexItem si) {
"""
Add one line summary comment for the class.
@param cd the class being documented
@param dlTree the content tree to which the description will be added
"""
Content link = getLink(new LinkInfoImpl(configuration,
... | java | protected void addDescription(ClassDoc cd, Content dlTree, SearchIndexItem si) {
Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.INDEX, cd).strong(true));
si.setContainingPackage(utils.getPackageName(cd.containingPackage()));
si.setLabel(cd.typeNa... | [
"protected",
"void",
"addDescription",
"(",
"ClassDoc",
"cd",
",",
"Content",
"dlTree",
",",
"SearchIndexItem",
"si",
")",
"{",
"Content",
"link",
"=",
"getLink",
"(",
"new",
"LinkInfoImpl",
"(",
"configuration",
",",
"LinkInfoImpl",
".",
"Kind",
".",
"INDEX",... | Add one line summary comment for the class.
@param cd the class being documented
@param dlTree the content tree to which the description will be added | [
"Add",
"one",
"line",
"summary",
"comment",
"for",
"the",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java#L207-L220 |
pravega/pravega | common/src/main/java/io/pravega/common/util/DelimitedStringParser.java | DelimitedStringParser.extractInteger | public DelimitedStringParser extractInteger(String key, Consumer<Integer> consumer) {
"""
Associates the given consumer with the given key. This consumer will be invoked every time a Key-Value pair with
the given key is encountered (argument is the Value of the pair). Note that this may be invoked multiple times ... | java | public DelimitedStringParser extractInteger(String key, Consumer<Integer> consumer) {
this.extractors.put(key, new Extractor<>(consumer, Integer::parseInt));
return this;
} | [
"public",
"DelimitedStringParser",
"extractInteger",
"(",
"String",
"key",
",",
"Consumer",
"<",
"Integer",
">",
"consumer",
")",
"{",
"this",
".",
"extractors",
".",
"put",
"(",
"key",
",",
"new",
"Extractor",
"<>",
"(",
"consumer",
",",
"Integer",
"::",
... | Associates the given consumer with the given key. This consumer will be invoked every time a Key-Value pair with
the given key is encountered (argument is the Value of the pair). Note that this may be invoked multiple times or
not at all, based on the given input.
@param key The key for which to invoke the consum... | [
"Associates",
"the",
"given",
"consumer",
"with",
"the",
"given",
"key",
".",
"This",
"consumer",
"will",
"be",
"invoked",
"every",
"time",
"a",
"Key",
"-",
"Value",
"pair",
"with",
"the",
"given",
"key",
"is",
"encountered",
"(",
"argument",
"is",
"the",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/DelimitedStringParser.java#L87-L90 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java | ComputationGraph.feedForward | public Map<String, INDArray> feedForward(INDArray[] input, int layerTillIndex,boolean train) {
"""
Conduct forward pass using an array of inputs
@param input An array of ComputationGraph inputs
@param layerTillIndex the index of the layer to feed forward to
@param train If true: do forward pass at training ti... | java | public Map<String, INDArray> feedForward(INDArray[] input, int layerTillIndex,boolean train) {
setInputs(input);
return feedForward(train, layerTillIndex);
} | [
"public",
"Map",
"<",
"String",
",",
"INDArray",
">",
"feedForward",
"(",
"INDArray",
"[",
"]",
"input",
",",
"int",
"layerTillIndex",
",",
"boolean",
"train",
")",
"{",
"setInputs",
"(",
"input",
")",
";",
"return",
"feedForward",
"(",
"train",
",",
"la... | Conduct forward pass using an array of inputs
@param input An array of ComputationGraph inputs
@param layerTillIndex the index of the layer to feed forward to
@param train If true: do forward pass at training time; false: do forward pass at test time
@return A map of activations for each layer (not each GraphVertex). ... | [
"Conduct",
"forward",
"pass",
"using",
"an",
"array",
"of",
"inputs"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L1481-L1484 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java | TreeScanner.visitParenthesized | @Override
public R visitParenthesized(ParenthesizedTree node, P p) {
"""
{@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning
"""
return scan(node.getExpression(), p);
} | java | @Override
public R visitParenthesized(ParenthesizedTree node, P p) {
return scan(node.getExpression(), p);
} | [
"@",
"Override",
"public",
"R",
"visitParenthesized",
"(",
"ParenthesizedTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"scan",
"(",
"node",
".",
"getExpression",
"(",
")",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"scans",
"the",
"children",
"in",
"left",
"to",
"right",
"order",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java#L570-L573 |
jenkinsci/jenkins | core/src/main/java/hudson/FilePath.java | FilePath.createTempDir | public FilePath createTempDir(final String prefix, final String suffix) throws IOException, InterruptedException {
"""
Creates a temporary directory inside the directory represented by 'this'
@param prefix
The prefix string to be used in generating the directory's name;
must be at least three characters long
... | java | public FilePath createTempDir(final String prefix, final String suffix) throws IOException, InterruptedException {
try {
String[] s;
if (StringUtils.isBlank(suffix)) {
s = new String[]{prefix, "tmp"}; // see File.createTempFile - tmp is used if suffix is null
... | [
"public",
"FilePath",
"createTempDir",
"(",
"final",
"String",
"prefix",
",",
"final",
"String",
"suffix",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"try",
"{",
"String",
"[",
"]",
"s",
";",
"if",
"(",
"StringUtils",
".",
"isBlank",
"("... | Creates a temporary directory inside the directory represented by 'this'
@param prefix
The prefix string to be used in generating the directory's name;
must be at least three characters long
@param suffix
The suffix string to be used in generating the directory's name; may
be null, in which case the suffix ".tmp" will... | [
"Creates",
"a",
"temporary",
"directory",
"inside",
"the",
"directory",
"represented",
"by",
"this"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/FilePath.java#L1493-L1506 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java | StringSupport.replaceLast | public static void replaceLast(StringBuffer haystack, String needle, String newNeedle) {
"""
replaces the last occurance of needle in haystack with newNeedle
@param haystack input string
@param needle string to replace
@param newNeedle replacement
"""
int idx = haystack.lastIndexOf(needle);
if (idx !... | java | public static void replaceLast(StringBuffer haystack, String needle, String newNeedle) {
int idx = haystack.lastIndexOf(needle);
if (idx != -1) {
haystack.replace(idx, idx + needle.length(), newNeedle);
}
} | [
"public",
"static",
"void",
"replaceLast",
"(",
"StringBuffer",
"haystack",
",",
"String",
"needle",
",",
"String",
"newNeedle",
")",
"{",
"int",
"idx",
"=",
"haystack",
".",
"lastIndexOf",
"(",
"needle",
")",
";",
"if",
"(",
"idx",
"!=",
"-",
"1",
")",
... | replaces the last occurance of needle in haystack with newNeedle
@param haystack input string
@param needle string to replace
@param newNeedle replacement | [
"replaces",
"the",
"last",
"occurance",
"of",
"needle",
"in",
"haystack",
"with",
"newNeedle"
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java#L82-L87 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/io/MECommsTrc.java | MECommsTrc.traceMessage | public static void traceMessage(TraceComponent _tc, MessageProcessor localME, SIBUuid8 remoteME, String operation, Object connection, AbstractMessage msg) {
"""
Minimal trace entry for ME<->ME comms.
Caller should check TraceComponent.isAnyTracingEnabled() before calling.
@param _tc The caller's trace component
... | java | public static void traceMessage(TraceComponent _tc, MessageProcessor localME, SIBUuid8 remoteME, String operation, Object connection, AbstractMessage msg) {
// Trace if either the callers trace is enabled, or our own trace group
if (tc.isDebugEnabled() || _tc.isDebugEnabled()) {
StringBuilder buff =... | [
"public",
"static",
"void",
"traceMessage",
"(",
"TraceComponent",
"_tc",
",",
"MessageProcessor",
"localME",
",",
"SIBUuid8",
"remoteME",
",",
"String",
"operation",
",",
"Object",
"connection",
",",
"AbstractMessage",
"msg",
")",
"{",
"// Trace if either the callers... | Minimal trace entry for ME<->ME comms.
Caller should check TraceComponent.isAnyTracingEnabled() before calling.
@param _tc The caller's trace component
@param operation The operation. See constants in this class.
@param targetME The MEUUID of the target ME
@param connection The ME<->ME connection (hashCode will be prin... | [
"Minimal",
"trace",
"entry",
"for",
"ME<",
"-",
">",
"ME",
"comms",
".",
"Caller",
"should",
"check",
"TraceComponent",
".",
"isAnyTracingEnabled",
"()",
"before",
"calling",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/io/MECommsTrc.java#L49-L107 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/partition/operation/PromotionCommitOperation.java | PromotionCommitOperation.beforePromotion | private CallStatus beforePromotion() {
"""
Sends {@link BeforePromotionOperation}s for all promotions and register a callback on each operation to track when
operations are finished.
"""
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
InternalOperationService operationService = n... | java | private CallStatus beforePromotion() {
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
InternalOperationService operationService = nodeEngine.getOperationService();
InternalPartitionServiceImpl partitionService = getService();
if (!partitionService.getMigrationManager().ac... | [
"private",
"CallStatus",
"beforePromotion",
"(",
")",
"{",
"NodeEngineImpl",
"nodeEngine",
"=",
"(",
"NodeEngineImpl",
")",
"getNodeEngine",
"(",
")",
";",
"InternalOperationService",
"operationService",
"=",
"nodeEngine",
".",
"getOperationService",
"(",
")",
";",
... | Sends {@link BeforePromotionOperation}s for all promotions and register a callback on each operation to track when
operations are finished. | [
"Sends",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/PromotionCommitOperation.java#L116-L155 |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/util/SerializationUtil.java | SerializationUtil.deserialize | public <T> T deserialize(Class<T> clazz, String stringContainingSerialisedInput) {
"""
Returns an object from a serialised string
@param clazz Class.name value
@param stringContainingSerialisedInput
@param <T>
@return
"""
T instance;
try {
instance = storageSerializer.deserializ... | java | public <T> T deserialize(Class<T> clazz, String stringContainingSerialisedInput) {
T instance;
try {
instance = storageSerializer.deserialize(clazz, stringContainingSerialisedInput);
} catch (SerializationException e) {
throw new IllegalStateException("unable to serialise... | [
"public",
"<",
"T",
">",
"T",
"deserialize",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"stringContainingSerialisedInput",
")",
"{",
"T",
"instance",
";",
"try",
"{",
"instance",
"=",
"storageSerializer",
".",
"deserialize",
"(",
"clazz",
",",
"s... | Returns an object from a serialised string
@param clazz Class.name value
@param stringContainingSerialisedInput
@param <T>
@return | [
"Returns",
"an",
"object",
"from",
"a",
"serialised",
"string"
] | train | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/util/SerializationUtil.java#L65-L73 |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/marketplace/MarketplaceSearchService.java | MarketplaceSearchService.getSearchResults | @Override
public SearchResults getSearchResults(PortletRequest request, SearchRequest query) {
"""
Returns a list of search results that pertain to the marketplace query is the query to search
will search name, title, description, fname, and captions
"""
final String queryString = query.getSearch... | java | @Override
public SearchResults getSearchResults(PortletRequest request, SearchRequest query) {
final String queryString = query.getSearchTerms().toLowerCase();
final List<IPortletDefinition> portlets =
portletDefinitionRegistry.getAllPortletDefinitions();
final HttpServletR... | [
"@",
"Override",
"public",
"SearchResults",
"getSearchResults",
"(",
"PortletRequest",
"request",
",",
"SearchRequest",
"query",
")",
"{",
"final",
"String",
"queryString",
"=",
"query",
".",
"getSearchTerms",
"(",
")",
".",
"toLowerCase",
"(",
")",
";",
"final"... | Returns a list of search results that pertain to the marketplace query is the query to search
will search name, title, description, fname, and captions | [
"Returns",
"a",
"list",
"of",
"search",
"results",
"that",
"pertain",
"to",
"the",
"marketplace",
"query",
"is",
"the",
"query",
"to",
"search",
"will",
"search",
"name",
"title",
"description",
"fname",
"and",
"captions"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/marketplace/MarketplaceSearchService.java#L93-L152 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/PropertiesAdapter.java | PropertiesAdapter.defaultIfNotSet | protected <T> T defaultIfNotSet(String propertyName, T defaultValue, Class<T> type) {
"""
Defaults of the value for the named property if the property does not exist.
@param <T> {@link Class} type of the return value.
@param propertyName the name of the property to get.
@param defaultValue the default value t... | java | protected <T> T defaultIfNotSet(String propertyName, T defaultValue, Class<T> type) {
return (isSet(propertyName) ? convert(propertyName, type) : defaultValue);
} | [
"protected",
"<",
"T",
">",
"T",
"defaultIfNotSet",
"(",
"String",
"propertyName",
",",
"T",
"defaultValue",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"(",
"isSet",
"(",
"propertyName",
")",
"?",
"convert",
"(",
"propertyName",
",",
"type"... | Defaults of the value for the named property if the property does not exist.
@param <T> {@link Class} type of the return value.
@param propertyName the name of the property to get.
@param defaultValue the default value to return if the named property does not exist.
@param type the desired {@link Class} type of the na... | [
"Defaults",
"of",
"the",
"value",
"for",
"the",
"named",
"property",
"if",
"the",
"property",
"does",
"not",
"exist",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/PropertiesAdapter.java#L170-L172 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Period.java | Period.plusYears | public Period plusYears(long yearsToAdd) {
"""
Returns a copy of this period with the specified years added.
<p>
This adds the amount to the years unit in a copy of this period.
The months and days units are unaffected.
For example, "1 year, 6 months and 3 days" plus 2 years returns "3 years, 6 months and 3 da... | java | public Period plusYears(long yearsToAdd) {
if (yearsToAdd == 0) {
return this;
}
return create(Math.toIntExact(Math.addExact(years, yearsToAdd)), months, days);
} | [
"public",
"Period",
"plusYears",
"(",
"long",
"yearsToAdd",
")",
"{",
"if",
"(",
"yearsToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"return",
"create",
"(",
"Math",
".",
"toIntExact",
"(",
"Math",
".",
"addExact",
"(",
"years",
",",
"yearsT... | Returns a copy of this period with the specified years added.
<p>
This adds the amount to the years unit in a copy of this period.
The months and days units are unaffected.
For example, "1 year, 6 months and 3 days" plus 2 years returns "3 years, 6 months and 3 days".
<p>
This instance is immutable and unaffected by th... | [
"Returns",
"a",
"copy",
"of",
"this",
"period",
"with",
"the",
"specified",
"years",
"added",
".",
"<p",
">",
"This",
"adds",
"the",
"amount",
"to",
"the",
"years",
"unit",
"in",
"a",
"copy",
"of",
"this",
"period",
".",
"The",
"months",
"and",
"days",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Period.java#L640-L645 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.torsionAngle | public static final double torsionAngle(Atom a, Atom b, Atom c, Atom d) {
"""
Calculate the torsion angle, i.e. the angle between the normal vectors of
the two plains a-b-c and b-c-d. See
http://en.wikipedia.org/wiki/Dihedral_angle
@param a
an Atom object
@param b
an Atom object
@param c
an Atom object
... | java | public static final double torsionAngle(Atom a, Atom b, Atom c, Atom d) {
Atom ab = subtract(a,b);
Atom cb = subtract(c,b);
Atom bc = subtract(b,c);
Atom dc = subtract(d,c);
Atom abc = vectorProduct(ab,cb);
Atom bcd = vectorProduct(bc,dc);
double angl = angle(abc,bcd) ;
/* calc the sign: */
Atom v... | [
"public",
"static",
"final",
"double",
"torsionAngle",
"(",
"Atom",
"a",
",",
"Atom",
"b",
",",
"Atom",
"c",
",",
"Atom",
"d",
")",
"{",
"Atom",
"ab",
"=",
"subtract",
"(",
"a",
",",
"b",
")",
";",
"Atom",
"cb",
"=",
"subtract",
"(",
"c",
",",
... | Calculate the torsion angle, i.e. the angle between the normal vectors of
the two plains a-b-c and b-c-d. See
http://en.wikipedia.org/wiki/Dihedral_angle
@param a
an Atom object
@param b
an Atom object
@param c
an Atom object
@param d
an Atom object
@return the torsion angle in degrees, in range +-[0,180]. If either f... | [
"Calculate",
"the",
"torsion",
"angle",
"i",
".",
"e",
".",
"the",
"angle",
"between",
"the",
"normal",
"vectors",
"of",
"the",
"two",
"plains",
"a",
"-",
"b",
"-",
"c",
"and",
"b",
"-",
"c",
"-",
"d",
".",
"See",
"http",
":",
"//",
"en",
".",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L242-L261 |
andremion/Louvre | louvre/src/main/java/com/andremion/louvre/data/MediaLoader.java | MediaLoader.addAllMediaBucketItem | private Cursor addAllMediaBucketItem(@Nullable Cursor cursor) {
"""
Add "All Media" item as the first row of bucket items.
@param cursor The original data of all bucket items
@return The data with "All Media" item added
"""
if (cursor == null || !cursor.moveToPosition(0)) {
return null;... | java | private Cursor addAllMediaBucketItem(@Nullable Cursor cursor) {
if (cursor == null || !cursor.moveToPosition(0)) {
return null;
}
ensureActivityAttached();
long id = ALL_MEDIA_BUCKET_ID;
String label = mActivity.getString(R.string.activity_gallery_bucket_all_media);
... | [
"private",
"Cursor",
"addAllMediaBucketItem",
"(",
"@",
"Nullable",
"Cursor",
"cursor",
")",
"{",
"if",
"(",
"cursor",
"==",
"null",
"||",
"!",
"cursor",
".",
"moveToPosition",
"(",
"0",
")",
")",
"{",
"return",
"null",
";",
"}",
"ensureActivityAttached",
... | Add "All Media" item as the first row of bucket items.
@param cursor The original data of all bucket items
@return The data with "All Media" item added | [
"Add",
"All",
"Media",
"item",
"as",
"the",
"first",
"row",
"of",
"bucket",
"items",
"."
] | train | https://github.com/andremion/Louvre/blob/9aeddc88f2e51b8f0f757c290ff26904ae8d6af2/louvre/src/main/java/com/andremion/louvre/data/MediaLoader.java#L167-L181 |
tvesalainen/util | security/src/main/java/org/vesalainen/net/ssl/SSLServerSocketChannel.java | SSLServerSocketChannel.open | public static SSLServerSocketChannel open(SocketAddress address, SSLContext sslContext) throws IOException {
"""
Creates and binds SSLServerSocketChannel using given SSLContext.
@param address
@param sslContext
@return
@throws IOException
"""
ServerSocketChannel serverSocketChannel = ServerSocketC... | java | public static SSLServerSocketChannel open(SocketAddress address, SSLContext sslContext) throws IOException
{
ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
serverSocketChannel.bind(address);
SSLServerSocketChannel sslSocketChannel = new SSLServerSocketChannel(serve... | [
"public",
"static",
"SSLServerSocketChannel",
"open",
"(",
"SocketAddress",
"address",
",",
"SSLContext",
"sslContext",
")",
"throws",
"IOException",
"{",
"ServerSocketChannel",
"serverSocketChannel",
"=",
"ServerSocketChannel",
".",
"open",
"(",
")",
";",
"serverSocket... | Creates and binds SSLServerSocketChannel using given SSLContext.
@param address
@param sslContext
@return
@throws IOException | [
"Creates",
"and",
"binds",
"SSLServerSocketChannel",
"using",
"given",
"SSLContext",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/security/src/main/java/org/vesalainen/net/ssl/SSLServerSocketChannel.java#L105-L111 |
micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java | JacksonConfiguration.setMapper | public void setMapper(Map<MapperFeature, Boolean> mapper) {
"""
Sets the object mapper features to use.
@param mapper The object mapper features
"""
if (CollectionUtils.isNotEmpty(mapper)) {
this.mapper = mapper;
}
} | java | public void setMapper(Map<MapperFeature, Boolean> mapper) {
if (CollectionUtils.isNotEmpty(mapper)) {
this.mapper = mapper;
}
} | [
"public",
"void",
"setMapper",
"(",
"Map",
"<",
"MapperFeature",
",",
"Boolean",
">",
"mapper",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isNotEmpty",
"(",
"mapper",
")",
")",
"{",
"this",
".",
"mapper",
"=",
"mapper",
";",
"}",
"}"
] | Sets the object mapper features to use.
@param mapper The object mapper features | [
"Sets",
"the",
"object",
"mapper",
"features",
"to",
"use",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java#L255-L259 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/crypto/AuthEngine.java | AuthEngine.respond | ServerResponse respond(ClientChallenge clientChallenge)
throws GeneralSecurityException {
"""
Validates the client challenge, and create the encryption backend for the channel from the
parameters sent by the client.
@param clientChallenge The challenge from the client.
@return A response to be sent to the... | java | ServerResponse respond(ClientChallenge clientChallenge)
throws GeneralSecurityException {
SecretKeySpec authKey = generateKey(clientChallenge.kdf, clientChallenge.iterations,
clientChallenge.nonce, clientChallenge.keyLength);
initializeForAuth(clientChallenge.cipher, clientChallenge.nonce, authKey);
... | [
"ServerResponse",
"respond",
"(",
"ClientChallenge",
"clientChallenge",
")",
"throws",
"GeneralSecurityException",
"{",
"SecretKeySpec",
"authKey",
"=",
"generateKey",
"(",
"clientChallenge",
".",
"kdf",
",",
"clientChallenge",
".",
"iterations",
",",
"clientChallenge",
... | Validates the client challenge, and create the encryption backend for the channel from the
parameters sent by the client.
@param clientChallenge The challenge from the client.
@return A response to be sent to the client. | [
"Validates",
"the",
"client",
"challenge",
"and",
"create",
"the",
"encryption",
"backend",
"for",
"the",
"channel",
"from",
"the",
"parameters",
"sent",
"by",
"the",
"client",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/crypto/AuthEngine.java#L107-L127 |
JDBDT/jdbdt | src/main/java/org/jdbdt/DBSetup.java | DBSetup.populateIfChanged | static void populateIfChanged(CallInfo callInfo, DataSet data) {
"""
Populate database table with a data set, if associated table
has changed.
@param callInfo Call Info.
@param data Data Set.
"""
Table table = asTable(data.getSource());
if ( table.getDirtyStatus() ) {
table.setDirtyStatus(t... | java | static void populateIfChanged(CallInfo callInfo, DataSet data) {
Table table = asTable(data.getSource());
if ( table.getDirtyStatus() ) {
table.setDirtyStatus(true);
doPopulate(callInfo, table, data);
}
} | [
"static",
"void",
"populateIfChanged",
"(",
"CallInfo",
"callInfo",
",",
"DataSet",
"data",
")",
"{",
"Table",
"table",
"=",
"asTable",
"(",
"data",
".",
"getSource",
"(",
")",
")",
";",
"if",
"(",
"table",
".",
"getDirtyStatus",
"(",
")",
")",
"{",
"t... | Populate database table with a data set, if associated table
has changed.
@param callInfo Call Info.
@param data Data Set. | [
"Populate",
"database",
"table",
"with",
"a",
"data",
"set",
"if",
"associated",
"table",
"has",
"changed",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DBSetup.java#L80-L86 |
sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/RateLimitingScanListeners.java | RateLimitingScanListeners.noMoreFrequentlyThan | public static ScanListener noMoreFrequentlyThan(
final ScanListener listener, final long time, final TimeUnit timeUnit) {
"""
Returns {@link ScanListener} that calls the given listener {@link ScanListener#recordRead}
method no more frequently than the given time any one device. Record read events from one
... | java | public static ScanListener noMoreFrequentlyThan(
final ScanListener listener, final long time, final TimeUnit timeUnit) {
return new ScanListener() {
// Most users will only scan from one device at a time.
private Map<SaneDevice, Long> lastSentTime = Maps.newHashMapWithExpectedSize(1);
@Ove... | [
"public",
"static",
"ScanListener",
"noMoreFrequentlyThan",
"(",
"final",
"ScanListener",
"listener",
",",
"final",
"long",
"time",
",",
"final",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"new",
"ScanListener",
"(",
")",
"{",
"// Most users will only scan from one d... | Returns {@link ScanListener} that calls the given listener {@link ScanListener#recordRead}
method no more frequently than the given time any one device. Record read events from one
device that occur more frequently are simply discarded. | [
"Returns",
"{"
] | train | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/RateLimitingScanListeners.java#L47-L82 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java | CommonOps_DDF4.elementMult | public static void elementMult( DMatrix4x4 a , DMatrix4x4 b , DMatrix4x4 c ) {
"""
<p>Performs an element by element multiplication operation:<br>
<br>
c<sub>ij</sub> = a<sub>ij</sub> * b<sub>ij</sub> <br>
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix i... | java | public static void elementMult( DMatrix4x4 a , DMatrix4x4 b , DMatrix4x4 c ) {
c.a11 = a.a11*b.a11; c.a12 = a.a12*b.a12; c.a13 = a.a13*b.a13; c.a14 = a.a14*b.a14;
c.a21 = a.a21*b.a21; c.a22 = a.a22*b.a22; c.a23 = a.a23*b.a23; c.a24 = a.a24*b.a24;
c.a31 = a.a31*b.a31; c.a32 = a.a32*b.a32; c.a33 =... | [
"public",
"static",
"void",
"elementMult",
"(",
"DMatrix4x4",
"a",
",",
"DMatrix4x4",
"b",
",",
"DMatrix4x4",
"c",
")",
"{",
"c",
".",
"a11",
"=",
"a",
".",
"a11",
"*",
"b",
".",
"a11",
";",
"c",
".",
"a12",
"=",
"a",
".",
"a12",
"*",
"b",
".",... | <p>Performs an element by element multiplication operation:<br>
<br>
c<sub>ij</sub> = a<sub>ij</sub> * b<sub>ij</sub> <br>
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix in the multiplication operation. Not modified.
@param c Where the results of the operation are... | [
"<p",
">",
"Performs",
"an",
"element",
"by",
"element",
"multiplication",
"operation",
":",
"<br",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"*",
"b<sub",
">",
"ij<",
"/",
"sub",
">",
"<br",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java#L1323-L1328 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java | Apptentive.showMessageCenter | public static void showMessageCenter(Context context, Map<String, Object> customData) {
"""
Opens the Apptentive Message Center UI Activity, and allows custom data to be sent with the
next message the user sends. If the user sends multiple messages, this data will only be sent
with the first message sent after t... | java | public static void showMessageCenter(Context context, Map<String, Object> customData) {
showMessageCenter(context, null, customData);
} | [
"public",
"static",
"void",
"showMessageCenter",
"(",
"Context",
"context",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"customData",
")",
"{",
"showMessageCenter",
"(",
"context",
",",
"null",
",",
"customData",
")",
";",
"}"
] | Opens the Apptentive Message Center UI Activity, and allows custom data to be sent with the
next message the user sends. If the user sends multiple messages, this data will only be sent
with the first message sent after this method is invoked. Additional invocations of this method
with custom data will repeat this proc... | [
"Opens",
"the",
"Apptentive",
"Message",
"Center",
"UI",
"Activity",
"and",
"allows",
"custom",
"data",
"to",
"be",
"sent",
"with",
"the",
"next",
"message",
"the",
"user",
"sends",
".",
"If",
"the",
"user",
"sends",
"multiple",
"messages",
"this",
"data",
... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java#L931-L933 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java | CoronaJobHistory.logInited | public void logInited(long startTime, int totalMaps, int totalReduces) {
"""
Logs launch time of job.
@param startTime start time of job.
@param totalMaps total maps assigned by jobtracker.
@param totalReduces total reduces.
"""
if (disableHistory) {
return;
}
if (null != writers) {
... | java | public void logInited(long startTime, int totalMaps, int totalReduces) {
if (disableHistory) {
return;
}
if (null != writers) {
log(writers, RecordTypes.Job,
new Keys[] {Keys.JOBID, Keys.LAUNCH_TIME, Keys.TOTAL_MAPS,
Keys.TOTAL_REDUCES, Keys.JOB_STATUS},
... | [
"public",
"void",
"logInited",
"(",
"long",
"startTime",
",",
"int",
"totalMaps",
",",
"int",
"totalReduces",
")",
"{",
"if",
"(",
"disableHistory",
")",
"{",
"return",
";",
"}",
"if",
"(",
"null",
"!=",
"writers",
")",
"{",
"log",
"(",
"writers",
",",... | Logs launch time of job.
@param startTime start time of job.
@param totalMaps total maps assigned by jobtracker.
@param totalReduces total reduces. | [
"Logs",
"launch",
"time",
"of",
"job",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L303-L317 |
EXIficient/exificient-grammars | src/main/java/com/siemens/ct/exi/grammars/regex/Match.java | Match.getCapturedText | public String getCapturedText(int index) {
"""
Return an substring of the target text matched to specified regular
expression group.
@param index
Less than <code>getNumberOfGroups()</code>.
"""
if (this.beginpos == null)
throw new IllegalStateException("match() has never been called.");
if (inde... | java | public String getCapturedText(int index) {
if (this.beginpos == null)
throw new IllegalStateException("match() has never been called.");
if (index < 0 || this.nofgroups <= index)
throw new IllegalArgumentException(
"The parameter must be less than " + this.nofgroups + ": "
+ index);
Strin... | [
"public",
"String",
"getCapturedText",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"this",
".",
"beginpos",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"match() has never been called.\"",
")",
";",
"if",
"(",
"index",
"<",
"0",
"||",
"th... | Return an substring of the target text matched to specified regular
expression group.
@param index
Less than <code>getNumberOfGroups()</code>. | [
"Return",
"an",
"substring",
"of",
"the",
"target",
"text",
"matched",
"to",
"specified",
"regular",
"expression",
"group",
"."
] | train | https://github.com/EXIficient/exificient-grammars/blob/d96477062ebdd4245920e44cc1995259699fc7fb/src/main/java/com/siemens/ct/exi/grammars/regex/Match.java#L179-L198 |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/event/annotation/SubscribeBeanPostProcessor.java | SubscribeBeanPostProcessor.postProcessAfterInitialization | @Override
public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException {
"""
Subscribes the <b>proxied</b> subscriber bean to the corresponding
{@link EventBus}.
"""
if (subscribers.containsKey(beanName)) {
Subscribe annotation = subscribers.get(beanNam... | java | @Override
public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException {
if (subscribers.containsKey(beanName)) {
Subscribe annotation = subscribers.get(beanName);
EventBus eventBus = getEventBus(annotation.eventBus(), beanName);
LOG.debug("Subscribing th... | [
"@",
"Override",
"public",
"Object",
"postProcessAfterInitialization",
"(",
"final",
"Object",
"bean",
",",
"final",
"String",
"beanName",
")",
"throws",
"BeansException",
"{",
"if",
"(",
"subscribers",
".",
"containsKey",
"(",
"beanName",
")",
")",
"{",
"Subscr... | Subscribes the <b>proxied</b> subscriber bean to the corresponding
{@link EventBus}. | [
"Subscribes",
"the",
"<b",
">",
"proxied<",
"/",
"b",
">",
"subscriber",
"bean",
"to",
"the",
"corresponding",
"{"
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/event/annotation/SubscribeBeanPostProcessor.java#L70-L80 |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.failedToMoveTo | public void failedToMoveTo (int placeId, String reason) {
"""
This can be called by cooperating directors that need to coopt the moving process to extend
it in some way or other. If the coopted move request fails, this failure can be propagated
to the location observers if appropriate.
@param placeId the plac... | java | public void failedToMoveTo (int placeId, String reason)
{
if (_moveListener != null) {
_moveListener.requestFailed(new MoveFailedException(reason));
_moveListener = null;
}
// clear out our last request time
_lastRequestTime = 0;
// let our observers... | [
"public",
"void",
"failedToMoveTo",
"(",
"int",
"placeId",
",",
"String",
"reason",
")",
"{",
"if",
"(",
"_moveListener",
"!=",
"null",
")",
"{",
"_moveListener",
".",
"requestFailed",
"(",
"new",
"MoveFailedException",
"(",
"reason",
")",
")",
";",
"_moveLi... | This can be called by cooperating directors that need to coopt the moving process to extend
it in some way or other. If the coopted move request fails, this failure can be propagated
to the location observers if appropriate.
@param placeId the place oid to which we failed to move.
@param reason the reason code given f... | [
"This",
"can",
"be",
"called",
"by",
"cooperating",
"directors",
"that",
"need",
"to",
"coopt",
"the",
"moving",
"process",
"to",
"extend",
"it",
"in",
"some",
"way",
"or",
"other",
".",
"If",
"the",
"coopted",
"move",
"request",
"fails",
"this",
"failure"... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L355-L367 |
yatechorg/jedis-utils | src/main/java/org/yatech/jedis/collections/JedisMap.java | JedisMap.putIfMissing | public boolean putIfMissing(final String field, final String value) {
"""
Put <code>value</code> associated to <code>field</code>, only if field does not yet exist.
@param field the field
@param value the value
@return <code>true</code> if the value was set, <code>false</code> otherwise
"""
return d... | java | public boolean putIfMissing(final String field, final String value) {
return doWithJedis(new JedisCallable<Boolean>() {
@Override
public Boolean call(Jedis jedis) {
return jedis.hsetnx(getKey(), field, value) != 0;
}
});
} | [
"public",
"boolean",
"putIfMissing",
"(",
"final",
"String",
"field",
",",
"final",
"String",
"value",
")",
"{",
"return",
"doWithJedis",
"(",
"new",
"JedisCallable",
"<",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Boolean",
"call",
"(",
"J... | Put <code>value</code> associated to <code>field</code>, only if field does not yet exist.
@param field the field
@param value the value
@return <code>true</code> if the value was set, <code>false</code> otherwise | [
"Put",
"<code",
">",
"value<",
"/",
"code",
">",
"associated",
"to",
"<code",
">",
"field<",
"/",
"code",
">",
"only",
"if",
"field",
"does",
"not",
"yet",
"exist",
"."
] | train | https://github.com/yatechorg/jedis-utils/blob/1951609fa6697df4f69be76e7d66b9284924bd97/src/main/java/org/yatech/jedis/collections/JedisMap.java#L95-L102 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.