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 |
|---|---|---|---|---|---|---|---|---|---|---|
finmath/finmath-lib | src/main/java6/net/finmath/marketdata/model/curves/DiscountCurveNelsonSiegelSvensson.java | DiscountCurveNelsonSiegelSvensson.getDiscountFactor | @Override
public double getDiscountFactor(AnalyticModelInterface model, double maturity) {
"""
Return the discount factor within a given model context for a given maturity.
@param model The model used as a context (not required for this class).
@param maturity The maturity in terms of ACT/365 daycount form this... | java | @Override
public double getDiscountFactor(AnalyticModelInterface model, double maturity)
{
// Change time scale
maturity *= timeScaling;
double beta1 = parameter[0];
double beta2 = parameter[1];
double beta3 = parameter[2];
double beta4 = parameter[3];
double tau1 = parameter[4];
double tau2 = para... | [
"@",
"Override",
"public",
"double",
"getDiscountFactor",
"(",
"AnalyticModelInterface",
"model",
",",
"double",
"maturity",
")",
"{",
"// Change time scale",
"maturity",
"*=",
"timeScaling",
";",
"double",
"beta1",
"=",
"parameter",
"[",
"0",
"]",
";",
"double",
... | Return the discount factor within a given model context for a given maturity.
@param model The model used as a context (not required for this class).
@param maturity The maturity in terms of ACT/365 daycount form this curve reference date. Note that this parameter might get rescaled to a different time parameter.
@see ... | [
"Return",
"the",
"discount",
"factor",
"within",
"a",
"given",
"model",
"context",
"for",
"a",
"given",
"maturity",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/marketdata/model/curves/DiscountCurveNelsonSiegelSvensson.java#L71-L93 |
protostuff/protostuff | protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeCollectionFieldFactory.java | RuntimeCollectionFieldFactory.createCollectionInlineV | private static <T> Field<T> createCollectionInlineV(int number,
String name, java.lang.reflect.Field f,
MessageFactory messageFactory, final Delegate<Object> inline) {
"""
/*
private static final ObjectSchema OBJECT_COLLECTION_VALUE_SCHEMA = new ObjectSchema() {
@SuppressWarnings("unche... | java | private static <T> Field<T> createCollectionInlineV(int number,
String name, java.lang.reflect.Field f,
MessageFactory messageFactory, final Delegate<Object> inline)
{
final Accessor accessor = AF.create(f);
return new RuntimeCollectionField<T, Object>(inline.getFieldType(),
... | [
"private",
"static",
"<",
"T",
">",
"Field",
"<",
"T",
">",
"createCollectionInlineV",
"(",
"int",
"number",
",",
"String",
"name",
",",
"java",
".",
"lang",
".",
"reflect",
".",
"Field",
"f",
",",
"MessageFactory",
"messageFactory",
",",
"final",
"Delegat... | /*
private static final ObjectSchema OBJECT_COLLECTION_VALUE_SCHEMA = new ObjectSchema() {
@SuppressWarnings("unchecked") protected void setValue(Object value, Object owner) { // the owner will always be
a Collection ((Collection<Object>)owner).add(value); } }; | [
"/",
"*",
"private",
"static",
"final",
"ObjectSchema",
"OBJECT_COLLECTION_VALUE_SCHEMA",
"=",
"new",
"ObjectSchema",
"()",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeCollectionFieldFactory.java#L77-L128 |
CloudSlang/cs-actions | cs-xml/src/main/java/io/cloudslang/content/xml/services/ApplyXslTransformationService.java | ApplyXslTransformationService.readSource | private Source readSource(String xmlDocument, String features) throws Exception {
"""
Reads the xml content from a file, URL or string.
@param xmlDocument xml document as String, path or URL
@return the resulting xml after validation
@throws Exception in case something went wrong
"""
if (xmlDocume... | java | private Source readSource(String xmlDocument, String features) throws Exception {
if (xmlDocument.startsWith(Constants.Inputs.HTTP_PREFIX_STRING) || xmlDocument.startsWith(Constants.Inputs.HTTPS_PREFIX_STRING)) {
URL xmlUrl = new URL(xmlDocument);
InputStream xmlStream = xmlUrl.openStrea... | [
"private",
"Source",
"readSource",
"(",
"String",
"xmlDocument",
",",
"String",
"features",
")",
"throws",
"Exception",
"{",
"if",
"(",
"xmlDocument",
".",
"startsWith",
"(",
"Constants",
".",
"Inputs",
".",
"HTTP_PREFIX_STRING",
")",
"||",
"xmlDocument",
".",
... | Reads the xml content from a file, URL or string.
@param xmlDocument xml document as String, path or URL
@return the resulting xml after validation
@throws Exception in case something went wrong | [
"Reads",
"the",
"xml",
"content",
"from",
"a",
"file",
"URL",
"or",
"string",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-xml/src/main/java/io/cloudslang/content/xml/services/ApplyXslTransformationService.java#L74-L89 |
wcm-io/wcm-io-wcm | ui/granite/src/main/java/io/wcm/wcm/ui/granite/components/pathfield/ColumnView.java | ColumnView.getDataSource | private DataSource getDataSource(ComponentHelper cmp, Resource resource) {
"""
Get data source to list children of given resource.
@param cmp Component helper
@param resource Given resource
@return Data source
"""
try {
/*
* by default the path is read from request "path" parameter
*... | java | private DataSource getDataSource(ComponentHelper cmp, Resource resource) {
try {
/*
* by default the path is read from request "path" parameter
* here we overwrite it via a synthetic resource because the path may be overwritten by validation logic
* to ensure the path is not beyond the co... | [
"private",
"DataSource",
"getDataSource",
"(",
"ComponentHelper",
"cmp",
",",
"Resource",
"resource",
")",
"{",
"try",
"{",
"/*\n * by default the path is read from request \"path\" parameter\n * here we overwrite it via a synthetic resource because the path may be overwritten ... | Get data source to list children of given resource.
@param cmp Component helper
@param resource Given resource
@return Data source | [
"Get",
"data",
"source",
"to",
"list",
"children",
"of",
"given",
"resource",
"."
] | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/ui/granite/src/main/java/io/wcm/wcm/ui/granite/components/pathfield/ColumnView.java#L132-L146 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/support/ParseTreeUtils.java | ParseTreeUtils.findNodeByLabel | public static <V> Node<V> findNodeByLabel(List<Node<V>> parents, String labelPrefix) {
"""
Returns the first node underneath the given parents which matches the given label prefix.
If parents is null or empty or no node is found the method returns null.
@param parents the parent Nodes to look through
@par... | java | public static <V> Node<V> findNodeByLabel(List<Node<V>> parents, String labelPrefix) {
return findNode(parents, new LabelPrefixPredicate<V>(labelPrefix));
} | [
"public",
"static",
"<",
"V",
">",
"Node",
"<",
"V",
">",
"findNodeByLabel",
"(",
"List",
"<",
"Node",
"<",
"V",
">",
">",
"parents",
",",
"String",
"labelPrefix",
")",
"{",
"return",
"findNode",
"(",
"parents",
",",
"new",
"LabelPrefixPredicate",
"<",
... | Returns the first node underneath the given parents which matches the given label prefix.
If parents is null or empty or no node is found the method returns null.
@param parents the parent Nodes to look through
@param labelPrefix the label prefix to look for
@return the Node if found or null if not found | [
"Returns",
"the",
"first",
"node",
"underneath",
"the",
"given",
"parents",
"which",
"matches",
"the",
"given",
"label",
"prefix",
".",
"If",
"parents",
"is",
"null",
"or",
"empty",
"or",
"no",
"node",
"is",
"found",
"the",
"method",
"returns",
"null",
"."... | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/support/ParseTreeUtils.java#L194-L196 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/PTSaxton2006.java | PTSaxton2006.calcAdjustedMoisture33Kpa | public static String calcAdjustedMoisture33Kpa(String slsnd, String slcly, String omPct, String df) {
"""
Equation 9 for calculating 33 kPa moisture, adjusted density,([0,100]%)
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic... | java | public static String calcAdjustedMoisture33Kpa(String slsnd, String slcly, String omPct, String df) {
String mt33 = calcMoisture33Kpa(slsnd, slcly, omPct);
String satMt = calcSaturatedMoisture(slsnd, slcly, omPct);
String adjSatMt = calcAdjustedSaturatedMoisture(slsnd, slcly, omPct, df);
... | [
"public",
"static",
"String",
"calcAdjustedMoisture33Kpa",
"(",
"String",
"slsnd",
",",
"String",
"slcly",
",",
"String",
"omPct",
",",
"String",
"df",
")",
"{",
"String",
"mt33",
"=",
"calcMoisture33Kpa",
"(",
"slsnd",
",",
"slcly",
",",
"omPct",
")",
";",
... | Equation 9 for calculating 33 kPa moisture, adjusted density,([0,100]%)
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage by layer ([0,100]%), (=
SLOC * 1.72)
@param df Density adjustment Factor (0.9–1.3) | [
"Equation",
"9",
"for",
"calculating",
"33",
"kPa",
"moisture",
"adjusted",
"density",
"(",
"[",
"0",
"100",
"]",
"%",
")"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/PTSaxton2006.java#L283-L291 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy1st | public static <T1, T2> BiConsumer<T1, T2> spy1st(BiConsumer<T1, T2> consumer, Box<T1> param1) {
"""
Proxies a binary consumer spying for first parameter.
@param <T1> the consumer first parameter type
@param <T2> the consumer second parameter type
@param consumer the consumer that will be spied
@param param1 ... | java | public static <T1, T2> BiConsumer<T1, T2> spy1st(BiConsumer<T1, T2> consumer, Box<T1> param1) {
return spy(consumer, param1, Box.<T2>empty());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
">",
"BiConsumer",
"<",
"T1",
",",
"T2",
">",
"spy1st",
"(",
"BiConsumer",
"<",
"T1",
",",
"T2",
">",
"consumer",
",",
"Box",
"<",
"T1",
">",
"param1",
")",
"{",
"return",
"spy",
"(",
"consumer",
",",
"pa... | Proxies a binary consumer spying for first parameter.
@param <T1> the consumer first parameter type
@param <T2> the consumer second parameter type
@param consumer the consumer that will be spied
@param param1 a box that will be containing the first spied parameter
@return the proxied consumer | [
"Proxies",
"a",
"binary",
"consumer",
"spying",
"for",
"first",
"parameter",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L362-L364 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/PmiRegistry.java | PmiRegistry.addModuleInfo | public synchronized static boolean addModuleInfo(String moduleID, String modulePrefix) {
"""
For user to add customized module:
create module config, add to hash table
"""
if (PerfModules.addModuleInfo(modulePrefix + moduleID) != null)
return true;
else
return false;
... | java | public synchronized static boolean addModuleInfo(String moduleID, String modulePrefix) {
if (PerfModules.addModuleInfo(modulePrefix + moduleID) != null)
return true;
else
return false;
} | [
"public",
"synchronized",
"static",
"boolean",
"addModuleInfo",
"(",
"String",
"moduleID",
",",
"String",
"modulePrefix",
")",
"{",
"if",
"(",
"PerfModules",
".",
"addModuleInfo",
"(",
"modulePrefix",
"+",
"moduleID",
")",
"!=",
"null",
")",
"return",
"true",
... | For user to add customized module:
create module config, add to hash table | [
"For",
"user",
"to",
"add",
"customized",
"module",
":",
"create",
"module",
"config",
"add",
"to",
"hash",
"table"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/PmiRegistry.java#L338-L343 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java | JedisUtils.newShardedJedisPool | public static ShardedJedisPool newShardedJedisPool(JedisPoolConfig poolConfig,
String hostsAndPorts) {
"""
Create a new {@link ShardedJedisPool} with specified pool configs.
@param poolConfig
@param hostsAndPorts
format {@code host1:port1,host2:port2,...}, default Redis port is used if not
specif... | java | public static ShardedJedisPool newShardedJedisPool(JedisPoolConfig poolConfig,
String hostsAndPorts) {
return newShardedJedisPool(poolConfig, hostsAndPorts, null, Protocol.DEFAULT_TIMEOUT);
} | [
"public",
"static",
"ShardedJedisPool",
"newShardedJedisPool",
"(",
"JedisPoolConfig",
"poolConfig",
",",
"String",
"hostsAndPorts",
")",
"{",
"return",
"newShardedJedisPool",
"(",
"poolConfig",
",",
"hostsAndPorts",
",",
"null",
",",
"Protocol",
".",
"DEFAULT_TIMEOUT",... | Create a new {@link ShardedJedisPool} with specified pool configs.
@param poolConfig
@param hostsAndPorts
format {@code host1:port1,host2:port2,...}, default Redis port is used if not
specified
@return | [
"Create",
"a",
"new",
"{",
"@link",
"ShardedJedisPool",
"}",
"with",
"specified",
"pool",
"configs",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java#L352-L355 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/transport/netty/AuthHandler.java | AuthHandler.handleListMechsResponse | private void handleListMechsResponse(final ChannelHandlerContext ctx, final ByteBuf msg) throws Exception {
"""
Helper method to parse the list of supported SASL mechs and dispatch the initial auth request following.
"""
String remote = ctx.channel().remoteAddress().toString();
String[] supportedMechan... | java | private void handleListMechsResponse(final ChannelHandlerContext ctx, final ByteBuf msg) throws Exception {
String remote = ctx.channel().remoteAddress().toString();
String[] supportedMechanisms = SaslListMechsResponse.supportedMechs(msg);
if (supportedMechanisms.length == 0) {
throw new Authenticatio... | [
"private",
"void",
"handleListMechsResponse",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"final",
"ByteBuf",
"msg",
")",
"throws",
"Exception",
"{",
"String",
"remote",
"=",
"ctx",
".",
"channel",
"(",
")",
".",
"remoteAddress",
"(",
")",
".",
"toStrin... | Helper method to parse the list of supported SASL mechs and dispatch the initial auth request following. | [
"Helper",
"method",
"to",
"parse",
"the",
"list",
"of",
"supported",
"SASL",
"mechs",
"and",
"dispatch",
"the",
"initial",
"auth",
"request",
"following",
"."
] | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/transport/netty/AuthHandler.java#L192-L221 |
CloudSlang/cs-actions | cs-commons/src/main/java/io/cloudslang/content/utils/BooleanUtilities.java | BooleanUtilities.toBoolean | public static boolean toBoolean(@Nullable final String booleanStr, final boolean defaultValue) {
"""
If the string is null or empty string, it returns the defaultValue otherwise it returns the boolean value (see tooBoolean)
@param booleanStr the string to convert to boolean
@param defaultValue the default va... | java | public static boolean toBoolean(@Nullable final String booleanStr, final boolean defaultValue) {
return StringUtils.isNoneEmpty(booleanStr) ? toBoolean(booleanStr) : defaultValue;
} | [
"public",
"static",
"boolean",
"toBoolean",
"(",
"@",
"Nullable",
"final",
"String",
"booleanStr",
",",
"final",
"boolean",
"defaultValue",
")",
"{",
"return",
"StringUtils",
".",
"isNoneEmpty",
"(",
"booleanStr",
")",
"?",
"toBoolean",
"(",
"booleanStr",
")",
... | If the string is null or empty string, it returns the defaultValue otherwise it returns the boolean value (see tooBoolean)
@param booleanStr the string to convert to boolean
@param defaultValue the default value if the string is empty or null
@return true if the booleanStr is 'true', false if it's 'false'
@throws Il... | [
"If",
"the",
"string",
"is",
"null",
"or",
"empty",
"string",
"it",
"returns",
"the",
"defaultValue",
"otherwise",
"it",
"returns",
"the",
"boolean",
"value",
"(",
"see",
"tooBoolean",
")"
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-commons/src/main/java/io/cloudslang/content/utils/BooleanUtilities.java#L83-L85 |
google/closure-compiler | src/com/google/javascript/jscomp/FindModuleDependencies.java | FindModuleDependencies.getEs6ModuleNameFromImportNode | private String getEs6ModuleNameFromImportNode(NodeTraversal t, Node n) {
"""
Get the module name from an import node (import or export statement).
"""
String importName = n.getLastChild().getString();
boolean isNamespaceImport = importName.startsWith("goog:");
if (isNamespaceImport) {
// Allo... | java | private String getEs6ModuleNameFromImportNode(NodeTraversal t, Node n) {
String importName = n.getLastChild().getString();
boolean isNamespaceImport = importName.startsWith("goog:");
if (isNamespaceImport) {
// Allow importing Closure namespace objects (e.g. from goog.provide or goog.module) as
... | [
"private",
"String",
"getEs6ModuleNameFromImportNode",
"(",
"NodeTraversal",
"t",
",",
"Node",
"n",
")",
"{",
"String",
"importName",
"=",
"n",
".",
"getLastChild",
"(",
")",
".",
"getString",
"(",
")",
";",
"boolean",
"isNamespaceImport",
"=",
"importName",
"... | Get the module name from an import node (import or export statement). | [
"Get",
"the",
"module",
"name",
"from",
"an",
"import",
"node",
"(",
"import",
"or",
"export",
"statement",
")",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FindModuleDependencies.java#L234-L254 |
calimero-project/calimero-core | src/tuwien/auto/calimero/link/KNXNetworkLinkIP.java | KNXNetworkLinkIP.newRoutingLink | public static KNXNetworkLinkIP newRoutingLink(final NetworkInterface netIf, final InetAddress mcGroup,
final KNXMediumSettings settings) throws KNXException {
"""
Creates a new network link using the {@link KNXnetIPRouting} protocol, with the local endpoint specified by a
network interface.
@param netIf loca... | java | public static KNXNetworkLinkIP newRoutingLink(final NetworkInterface netIf, final InetAddress mcGroup,
final KNXMediumSettings settings) throws KNXException
{
return new KNXNetworkLinkIP(ROUTING, new KNXnetIPRouting(netIf, mcGroup), settings);
} | [
"public",
"static",
"KNXNetworkLinkIP",
"newRoutingLink",
"(",
"final",
"NetworkInterface",
"netIf",
",",
"final",
"InetAddress",
"mcGroup",
",",
"final",
"KNXMediumSettings",
"settings",
")",
"throws",
"KNXException",
"{",
"return",
"new",
"KNXNetworkLinkIP",
"(",
"R... | Creates a new network link using the {@link KNXnetIPRouting} protocol, with the local endpoint specified by a
network interface.
@param netIf local network interface used to join the multicast group and for sending, use <code>null</code> for
the host's default multicast interface
@param mcGroup address of the multicas... | [
"Creates",
"a",
"new",
"network",
"link",
"using",
"the",
"{",
"@link",
"KNXnetIPRouting",
"}",
"protocol",
"with",
"the",
"local",
"endpoint",
"specified",
"by",
"a",
"network",
"interface",
"."
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/link/KNXNetworkLinkIP.java#L156-L160 |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setFragment | public static void setFragment (@Nonnull final Marshaller aMarshaller, final boolean bFragment) {
"""
Set the standard property for marshalling a fragment only.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param bFragment
the value to be set
"""
_setProperty (... | java | public static void setFragment (@Nonnull final Marshaller aMarshaller, final boolean bFragment)
{
_setProperty (aMarshaller, Marshaller.JAXB_FRAGMENT, Boolean.valueOf (bFragment));
} | [
"public",
"static",
"void",
"setFragment",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"final",
"boolean",
"bFragment",
")",
"{",
"_setProperty",
"(",
"aMarshaller",
",",
"Marshaller",
".",
"JAXB_FRAGMENT",
",",
"Boolean",
".",
"valueOf",
"("... | Set the standard property for marshalling a fragment only.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param bFragment
the value to be set | [
"Set",
"the",
"standard",
"property",
"for",
"marshalling",
"a",
"fragment",
"only",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L187-L190 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/StatementManager.java | StatementManager.bindDelete | public void bindDelete(PreparedStatement stmt, ClassDescriptor cld, Object obj) throws SQLException {
"""
binds the objects primary key and locking values to the statement, BRJ
"""
if (cld.getDeleteProcedure() != null)
{
this.bindProcedure(stmt, cld, obj, cld.getDeleteProcedure()... | java | public void bindDelete(PreparedStatement stmt, ClassDescriptor cld, Object obj) throws SQLException
{
if (cld.getDeleteProcedure() != null)
{
this.bindProcedure(stmt, cld, obj, cld.getDeleteProcedure());
}
else
{
int index = 1;
Val... | [
"public",
"void",
"bindDelete",
"(",
"PreparedStatement",
"stmt",
",",
"ClassDescriptor",
"cld",
",",
"Object",
"obj",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"cld",
".",
"getDeleteProcedure",
"(",
")",
"!=",
"null",
")",
"{",
"this",
".",
"bindProced... | binds the objects primary key and locking values to the statement, BRJ | [
"binds",
"the",
"objects",
"primary",
"key",
"and",
"locking",
"values",
"to",
"the",
"statement",
"BRJ"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java#L149-L177 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteEntity | public OperationStatus deleteEntity(UUID appId, String versionId, UUID entityId) {
"""
Deletes an entity extractor from the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the va... | java | public OperationStatus deleteEntity(UUID appId, String versionId, UUID entityId) {
return deleteEntityWithServiceResponseAsync(appId, versionId, entityId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deleteEntity",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
")",
"{",
"return",
"deleteEntityWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"entityId",
")",
".",
"toBlocking",
"(",
")",
... | Deletes an entity extractor from the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws Runti... | [
"Deletes",
"an",
"entity",
"extractor",
"from",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L3565-L3567 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java | HBaseDataHandler.onFindKeyOnly | private FilterList onFindKeyOnly(FilterList filterList, boolean isFindKeyOnly) {
"""
On find key only.
@param filterList
the filter list
@param isFindKeyOnly
the is find key only
@return the filter list
"""
if (isFindKeyOnly)
{
if (filterList == null)
{
... | java | private FilterList onFindKeyOnly(FilterList filterList, boolean isFindKeyOnly)
{
if (isFindKeyOnly)
{
if (filterList == null)
{
filterList = new FilterList();
}
filterList.addFilter(new KeyOnlyFilter());
}
return filterL... | [
"private",
"FilterList",
"onFindKeyOnly",
"(",
"FilterList",
"filterList",
",",
"boolean",
"isFindKeyOnly",
")",
"{",
"if",
"(",
"isFindKeyOnly",
")",
"{",
"if",
"(",
"filterList",
"==",
"null",
")",
"{",
"filterList",
"=",
"new",
"FilterList",
"(",
")",
";"... | On find key only.
@param filterList
the filter list
@param isFindKeyOnly
the is find key only
@return the filter list | [
"On",
"find",
"key",
"only",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java#L184-L195 |
google/closure-compiler | src/com/google/javascript/jscomp/SourceMapResolver.java | SourceMapResolver.extractBase64String | @Nullable
private static String extractBase64String(String url) {
"""
Based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
@param url
@return String or null.
"""
if (url.startsWith(BASE64_URL_PREFIX) && url.contains(BASE64_START)) {
int base64StartIndex = url.indexO... | java | @Nullable
private static String extractBase64String(String url) {
if (url.startsWith(BASE64_URL_PREFIX) && url.contains(BASE64_START)) {
int base64StartIndex = url.indexOf(BASE64_START);
String mediaType = url.substring(BASE64_URL_PREFIX.length(), base64StartIndex);
if (ACCEPTED_MEDIA_TYPES.cont... | [
"@",
"Nullable",
"private",
"static",
"String",
"extractBase64String",
"(",
"String",
"url",
")",
"{",
"if",
"(",
"url",
".",
"startsWith",
"(",
"BASE64_URL_PREFIX",
")",
"&&",
"url",
".",
"contains",
"(",
"BASE64_START",
")",
")",
"{",
"int",
"base64StartIn... | Based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
@param url
@return String or null. | [
"Based",
"on",
"https",
":",
"//",
"developer",
".",
"mozilla",
".",
"org",
"/",
"en",
"-",
"US",
"/",
"docs",
"/",
"Web",
"/",
"HTTP",
"/",
"Basics_of_HTTP",
"/",
"Data_URIs"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/SourceMapResolver.java#L71-L83 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/GroupService.java | GroupService.inewGroup | private IEntityGroup inewGroup(Class<?> type, String serviceName) throws GroupsException {
"""
Returns a new <code>IEntityGroup</code> for the given Class with an unused key.
@return org.apereo.portal.groups.IEntityGroup
"""
try {
return compositeGroupService.newGroup(type, parseServiceN... | java | private IEntityGroup inewGroup(Class<?> type, String serviceName) throws GroupsException {
try {
return compositeGroupService.newGroup(type, parseServiceName(serviceName));
} catch (InvalidNameException ine) {
throw new GroupsException("GroupService.inewGroup(): invalid service n... | [
"private",
"IEntityGroup",
"inewGroup",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"serviceName",
")",
"throws",
"GroupsException",
"{",
"try",
"{",
"return",
"compositeGroupService",
".",
"newGroup",
"(",
"type",
",",
"parseServiceName",
"(",
"serviceN... | Returns a new <code>IEntityGroup</code> for the given Class with an unused key.
@return org.apereo.portal.groups.IEntityGroup | [
"Returns",
"a",
"new",
"<code",
">",
"IEntityGroup<",
"/",
"code",
">",
"for",
"the",
"given",
"Class",
"with",
"an",
"unused",
"key",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/GroupService.java#L319-L325 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslRequestWithoutPath.java | PactDslRequestWithoutPath.withFileUpload | public PactDslRequestWithoutPath withFileUpload(String partName, String fileName, String fileContentType, byte[] data)
throws IOException {
"""
Sets up a file upload request. This will add the correct content type header to the request
@param partName This is the name of the part in the multipart body.
@pa... | java | public PactDslRequestWithoutPath withFileUpload(String partName, String fileName, String fileContentType, byte[] data)
throws IOException {
setupFileUpload(partName, fileName, fileContentType, data);
return this;
} | [
"public",
"PactDslRequestWithoutPath",
"withFileUpload",
"(",
"String",
"partName",
",",
"String",
"fileName",
",",
"String",
"fileContentType",
",",
"byte",
"[",
"]",
"data",
")",
"throws",
"IOException",
"{",
"setupFileUpload",
"(",
"partName",
",",
"fileName",
... | Sets up a file upload request. This will add the correct content type header to the request
@param partName This is the name of the part in the multipart body.
@param fileName This is the name of the file that was uploaded
@param fileContentType This is the content type of the uploaded file
@param data This is the actu... | [
"Sets",
"up",
"a",
"file",
"upload",
"request",
".",
"This",
"will",
"add",
"the",
"correct",
"content",
"type",
"header",
"to",
"the",
"request"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslRequestWithoutPath.java#L284-L288 |
alkacon/opencms-core | src/org/opencms/file/CmsResource.java | CmsResource.getPathPart | public static String getPathPart(String resource, int level) {
"""
Returns the name of a parent folder of the given resource,
that is either minus levels up
from the current folder, or that is plus levels down from the
root folder.<p>
@param resource the name of a resource
@param level of levels to walk up ... | java | public static String getPathPart(String resource, int level) {
resource = getFolderPath(resource);
String result = null;
int pos = 0, count = 0;
if (level >= 0) {
// Walk down from the root folder /
while ((count < level) && (pos > -1)) {
count++;... | [
"public",
"static",
"String",
"getPathPart",
"(",
"String",
"resource",
",",
"int",
"level",
")",
"{",
"resource",
"=",
"getFolderPath",
"(",
"resource",
")",
";",
"String",
"result",
"=",
"null",
";",
"int",
"pos",
"=",
"0",
",",
"count",
"=",
"0",
";... | Returns the name of a parent folder of the given resource,
that is either minus levels up
from the current folder, or that is plus levels down from the
root folder.<p>
@param resource the name of a resource
@param level of levels to walk up or down
@return the name of a parent folder of the given resource | [
"Returns",
"the",
"name",
"of",
"a",
"parent",
"folder",
"of",
"the",
"given",
"resource",
"that",
"is",
"either",
"minus",
"levels",
"up",
"from",
"the",
"current",
"folder",
"or",
"that",
"is",
"plus",
"levels",
"down",
"from",
"the",
"root",
"folder",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsResource.java#L700-L727 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.unpackEntry | public static boolean unpackEntry(InputStream is, String name, File file) throws IOException {
"""
Unpacks a single file from a ZIP stream to a file.
@param is
ZIP stream.
@param name
entry name.
@param file
target file to be created or overwritten.
@return <code>true</code> if the entry was found and unp... | java | public static boolean unpackEntry(InputStream is, String name, File file) throws IOException {
return handle(is, name, new FileUnpacker(file));
} | [
"public",
"static",
"boolean",
"unpackEntry",
"(",
"InputStream",
"is",
",",
"String",
"name",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"return",
"handle",
"(",
"is",
",",
"name",
",",
"new",
"FileUnpacker",
"(",
"file",
")",
")",
";",
"}"... | Unpacks a single file from a ZIP stream to a file.
@param is
ZIP stream.
@param name
entry name.
@param file
target file to be created or overwritten.
@return <code>true</code> if the entry was found and unpacked,
<code>false</code> if the entry was not found.
@throws java.io.IOException if file is not found or writin... | [
"Unpacks",
"a",
"single",
"file",
"from",
"a",
"ZIP",
"stream",
"to",
"a",
"file",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L432-L434 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/FunctionType.java | FunctionType.setPrototype | final boolean setPrototype(ObjectType prototype, Node propertyNode) {
"""
Sets the prototype.
@param prototype the prototype. If this value is {@code null} it will silently be discarded.
"""
if (prototype == null) {
return false;
}
// getInstanceType fails if the function is not a construc... | java | final boolean setPrototype(ObjectType prototype, Node propertyNode) {
if (prototype == null) {
return false;
}
// getInstanceType fails if the function is not a constructor
if (isConstructor() && prototype == getInstanceType()) {
return false;
}
return setPrototypeNoCheck(prototype, ... | [
"final",
"boolean",
"setPrototype",
"(",
"ObjectType",
"prototype",
",",
"Node",
"propertyNode",
")",
"{",
"if",
"(",
"prototype",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"// getInstanceType fails if the function is not a constructor",
"if",
"(",
"isCon... | Sets the prototype.
@param prototype the prototype. If this value is {@code null} it will silently be discarded. | [
"Sets",
"the",
"prototype",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/FunctionType.java#L485-L494 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerUsagesInner.java | ServerUsagesInner.listByServerAsync | public Observable<List<ServerUsageInner>> listByServerAsync(String resourceGroupName, String serverName) {
"""
Returns server usages.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverNam... | java | public Observable<List<ServerUsageInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<ServerUsageInner>>, List<ServerUsageInner>>() {
@Override
public List<S... | [
"public",
"Observable",
"<",
"List",
"<",
"ServerUsageInner",
">",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
... | Returns server usages.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observa... | [
"Returns",
"server",
"usages",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerUsagesInner.java#L96-L103 |
kiegroup/drools | kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/decisiontables/DecisionTableImpl.java | DecisionTableImpl.matches | private boolean matches(EvaluationContext ctx, Object[] params, DTDecisionRule rule) {
"""
Checks if the parameters match a single rule
@param ctx
@param params
@param rule
@return
"""
for( int i = 0; i < params.length; i++ ) {
CompiledExpression compiledInput = inputs.get(i).getCompile... | java | private boolean matches(EvaluationContext ctx, Object[] params, DTDecisionRule rule) {
for( int i = 0; i < params.length; i++ ) {
CompiledExpression compiledInput = inputs.get(i).getCompiledInput();
if ( compiledInput instanceof CompiledFEELExpression) {
ctx.setValue("?",... | [
"private",
"boolean",
"matches",
"(",
"EvaluationContext",
"ctx",
",",
"Object",
"[",
"]",
"params",
",",
"DTDecisionRule",
"rule",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"params",
".",
"length",
";",
"i",
"++",
")",
"{",
"Compile... | Checks if the parameters match a single rule
@param ctx
@param params
@param rule
@return | [
"Checks",
"if",
"the",
"parameters",
"match",
"a",
"single",
"rule"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/decisiontables/DecisionTableImpl.java#L269-L280 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java | StylesheetHandler.notationDecl | public void notationDecl(String name, String publicId, String systemId) {
"""
Receive notification of a notation declaration.
<p>By default, do nothing. Application writers may override this
method in a subclass if they wish to keep track of the notations
declared in a document.</p>
@param name The notati... | java | public void notationDecl(String name, String publicId, String systemId)
{
getCurrentProcessor().notationDecl(this, name, publicId, systemId);
} | [
"public",
"void",
"notationDecl",
"(",
"String",
"name",
",",
"String",
"publicId",
",",
"String",
"systemId",
")",
"{",
"getCurrentProcessor",
"(",
")",
".",
"notationDecl",
"(",
"this",
",",
"name",
",",
"publicId",
",",
"systemId",
")",
";",
"}"
] | Receive notification of a notation declaration.
<p>By default, do nothing. Application writers may override this
method in a subclass if they wish to keep track of the notations
declared in a document.</p>
@param name The notation name.
@param publicId The notation public identifier, or null if not
available.
@param... | [
"Receive",
"notification",
"of",
"a",
"notation",
"declaration",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L330-L333 |
BeholderTAF/beholder-selenium | src/main/java/br/ufmg/dcc/saotome/beholder/selenium/ui/SeleniumComponent.java | SeleniumComponent.setElement | public final void setElement(final WebElement element) {
"""
The Selenium-Webdriver element that represents the component HTML of the
simulated page.
@param element WebElement object
"""
if (element == null) {
throw new IllegalArgumentException(String.format(ErrorMessages.ERROR_TEMPLATE_VARIABLE_NULL... | java | public final void setElement(final WebElement element) {
if (element == null) {
throw new IllegalArgumentException(String.format(ErrorMessages.ERROR_TEMPLATE_VARIABLE_NULL,"element"));
}
this.element = element;
validateElementTag();
validateAttributes();
} | [
"public",
"final",
"void",
"setElement",
"(",
"final",
"WebElement",
"element",
")",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"ErrorMessages",
".",
"ERROR_TEMPLATE_VARIABLE_... | The Selenium-Webdriver element that represents the component HTML of the
simulated page.
@param element WebElement object | [
"The",
"Selenium",
"-",
"Webdriver",
"element",
"that",
"represents",
"the",
"component",
"HTML",
"of",
"the",
"simulated",
"page",
"."
] | train | https://github.com/BeholderTAF/beholder-selenium/blob/8dc999e74a9c3f5c09e4e68ea0ef5634cdb760ee/src/main/java/br/ufmg/dcc/saotome/beholder/selenium/ui/SeleniumComponent.java#L107-L117 |
google/flogger | api/src/main/java/com/google/common/flogger/LogContext.java | LogContext.addMetadata | protected final <T> void addMetadata(MetadataKey<T> key, T value) {
"""
Adds the given key/value pair to this logging context. If the key cannot be repeated, and
there is already a value for the key in the metadata, then the existing value is replaced,
otherwise the value is added at the end of the metadata.
... | java | protected final <T> void addMetadata(MetadataKey<T> key, T value) {
if (metadata == null) {
metadata = new MutableMetadata();
}
metadata.addValue(key, value);
} | [
"protected",
"final",
"<",
"T",
">",
"void",
"addMetadata",
"(",
"MetadataKey",
"<",
"T",
">",
"key",
",",
"T",
"value",
")",
"{",
"if",
"(",
"metadata",
"==",
"null",
")",
"{",
"metadata",
"=",
"new",
"MutableMetadata",
"(",
")",
";",
"}",
"metadata... | Adds the given key/value pair to this logging context. If the key cannot be repeated, and
there is already a value for the key in the metadata, then the existing value is replaced,
otherwise the value is added at the end of the metadata.
@param key the metadata key (see {@link LogData}).
@param value the metadata valu... | [
"Adds",
"the",
"given",
"key",
"/",
"value",
"pair",
"to",
"this",
"logging",
"context",
".",
"If",
"the",
"key",
"cannot",
"be",
"repeated",
"and",
"there",
"is",
"already",
"a",
"value",
"for",
"the",
"key",
"in",
"the",
"metadata",
"then",
"the",
"e... | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/LogContext.java#L414-L419 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/io/async/Timer.java | Timer.insertSlot | public TimeSlot insertSlot(long newSlotTimeout, TimeSlot slot) {
"""
Create a new time slot with a given timeout time, and add this new
time slot in front of an existing time slot in the list.
@param newSlotTimeout
- timeout time for the new time slot
@param slot
- existing time slot
@return TimeSlot - tim... | java | public TimeSlot insertSlot(long newSlotTimeout, TimeSlot slot) {
// this routine assumes the list is not empty
TimeSlot retSlot = new TimeSlot(newSlotTimeout);
retSlot.nextEntry = slot;
retSlot.prevEntry = slot.prevEntry;
if (retSlot.prevEntry != null) {
retSlot.pre... | [
"public",
"TimeSlot",
"insertSlot",
"(",
"long",
"newSlotTimeout",
",",
"TimeSlot",
"slot",
")",
"{",
"// this routine assumes the list is not empty",
"TimeSlot",
"retSlot",
"=",
"new",
"TimeSlot",
"(",
"newSlotTimeout",
")",
";",
"retSlot",
".",
"nextEntry",
"=",
"... | Create a new time slot with a given timeout time, and add this new
time slot in front of an existing time slot in the list.
@param newSlotTimeout
- timeout time for the new time slot
@param slot
- existing time slot
@return TimeSlot - time slot that was created and added | [
"Create",
"a",
"new",
"time",
"slot",
"with",
"a",
"given",
"timeout",
"time",
"and",
"add",
"this",
"new",
"time",
"slot",
"in",
"front",
"of",
"an",
"existing",
"time",
"slot",
"in",
"the",
"list",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/io/async/Timer.java#L314-L330 |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/UpdateAppRequest.java | UpdateAppRequest.withAttributes | public UpdateAppRequest withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
One or more user-defined key/value pairs to be added to the stack attributes.
</p>
@param attributes
One or more user-defined key/value pairs to be added to the stack attributes.
@return Returns a reference to this ob... | java | public UpdateAppRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"UpdateAppRequest",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
One or more user-defined key/value pairs to be added to the stack attributes.
</p>
@param attributes
One or more user-defined key/value pairs to be added to the stack attributes.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"One",
"or",
"more",
"user",
"-",
"defined",
"key",
"/",
"value",
"pairs",
"to",
"be",
"added",
"to",
"the",
"stack",
"attributes",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/UpdateAppRequest.java#L629-L632 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java | StringUtil.isCJK | public static boolean isCJK(String str, int beginIndex, int endIndex) {
"""
check if the specified string is all CJK chars
@param str
@param beginIndex
@param endIndex
@return boolean
"""
for ( int j = beginIndex; j < endIndex; j++ ) {
if ( ! isCJKChar(str.charAt(j)) ) {
... | java | public static boolean isCJK(String str, int beginIndex, int endIndex)
{
for ( int j = beginIndex; j < endIndex; j++ ) {
if ( ! isCJKChar(str.charAt(j)) ) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"isCJK",
"(",
"String",
"str",
",",
"int",
"beginIndex",
",",
"int",
"endIndex",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"beginIndex",
";",
"j",
"<",
"endIndex",
";",
"j",
"++",
")",
"{",
"if",
"(",
"!",
"isCJKChar",
"... | check if the specified string is all CJK chars
@param str
@param beginIndex
@param endIndex
@return boolean | [
"check",
"if",
"the",
"specified",
"string",
"is",
"all",
"CJK",
"chars"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java#L353-L362 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationServiceCache.java | ClassificationServiceCache.isClassificationLinkedToFileModel | static boolean isClassificationLinkedToFileModel(GraphRewrite event, ClassificationModel classificationModel, FileModel fileModel) {
"""
Indicates whether or not the given {@link FileModel} is already attached to the {@link ClassificationModel}.
Note that this assumes all {@link ClassificationModel} attachments... | java | static boolean isClassificationLinkedToFileModel(GraphRewrite event, ClassificationModel classificationModel, FileModel fileModel)
{
String key = getClassificationFileModelCacheKey(classificationModel, fileModel);
Boolean linked = getCache(event).get(key);
if (linked == null)
{
... | [
"static",
"boolean",
"isClassificationLinkedToFileModel",
"(",
"GraphRewrite",
"event",
",",
"ClassificationModel",
"classificationModel",
",",
"FileModel",
"fileModel",
")",
"{",
"String",
"key",
"=",
"getClassificationFileModelCacheKey",
"(",
"classificationModel",
",",
"... | Indicates whether or not the given {@link FileModel} is already attached to the {@link ClassificationModel}.
Note that this assumes all {@link ClassificationModel} attachments are handled via the {@link ClassificationService}.
Outside of tests, this should be a safe assumption to make. | [
"Indicates",
"whether",
"or",
"not",
"the",
"given",
"{",
"@link",
"FileModel",
"}",
"is",
"already",
"attached",
"to",
"the",
"{",
"@link",
"ClassificationModel",
"}",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationServiceCache.java#L44-L59 |
vincentk/joptimizer | src/main/java/com/joptimizer/util/Utils.java | Utils.calculateScaledResidual | public static double calculateScaledResidual(DoubleMatrix2D A, DoubleMatrix1D x, DoubleMatrix1D b) {
"""
Calculate the scaled residual
<br> ||Ax-b||_oo/( ||A||_oo . ||x||_oo + ||b||_oo ), with
<br> ||x||_oo = max(||x[i]||)
"""
double residual = -Double.MAX_VALUE;
double nix = Algebra.DEFAULT.normInfini... | java | public static double calculateScaledResidual(DoubleMatrix2D A, DoubleMatrix1D x, DoubleMatrix1D b){
double residual = -Double.MAX_VALUE;
double nix = Algebra.DEFAULT.normInfinity(x);
double nib = Algebra.DEFAULT.normInfinity(b);
if(Double.compare(nix, 0.)==0 && Double.compare(nib, 0.)==0){
return 0;
... | [
"public",
"static",
"double",
"calculateScaledResidual",
"(",
"DoubleMatrix2D",
"A",
",",
"DoubleMatrix1D",
"x",
",",
"DoubleMatrix1D",
"b",
")",
"{",
"double",
"residual",
"=",
"-",
"Double",
".",
"MAX_VALUE",
";",
"double",
"nix",
"=",
"Algebra",
".",
"DEFAU... | Calculate the scaled residual
<br> ||Ax-b||_oo/( ||A||_oo . ||x||_oo + ||b||_oo ), with
<br> ||x||_oo = max(||x[i]||) | [
"Calculate",
"the",
"scaled",
"residual",
"<br",
">",
"||Ax",
"-",
"b||_oo",
"/",
"(",
"||A||_oo",
".",
"||x||_oo",
"+",
"||b||_oo",
")",
"with",
"<br",
">",
"||x||_oo",
"=",
"max",
"(",
"||x",
"[",
"i",
"]",
"||",
")"
] | train | https://github.com/vincentk/joptimizer/blob/65064c1bb0b26c7261358021e4c93d06dd43564f/src/main/java/com/joptimizer/util/Utils.java#L146-L160 |
javers/javers | javers-core/src/main/java/org/javers/core/JaversBuilder.java | JaversBuilder.registerValueWithCustomToString | public <T> JaversBuilder registerValueWithCustomToString(Class<T> valueClass, Function<T, String> toString) {
"""
For complex <code>ValueType</code> classes that are used as Entity Id.
<br/><br/>
Registers a custom <code>toString</code> function that will be used for creating
<code>GlobalId</code> for Entitie... | java | public <T> JaversBuilder registerValueWithCustomToString(Class<T> valueClass, Function<T, String> toString) {
argumentsAreNotNull(valueClass, toString);
if (!clientsClassDefinitions.containsKey(valueClass)){
registerType(new ValueDefinition(valueClass));
}
ValueDefinition de... | [
"public",
"<",
"T",
">",
"JaversBuilder",
"registerValueWithCustomToString",
"(",
"Class",
"<",
"T",
">",
"valueClass",
",",
"Function",
"<",
"T",
",",
"String",
">",
"toString",
")",
"{",
"argumentsAreNotNull",
"(",
"valueClass",
",",
"toString",
")",
";",
... | For complex <code>ValueType</code> classes that are used as Entity Id.
<br/><br/>
Registers a custom <code>toString</code> function that will be used for creating
<code>GlobalId</code> for Entities,
instead of default {@link ReflectionUtil#reflectiveToString(Object)}.
<br/><br/>
For example:
<pre>
class Entity {
... | [
"For",
"complex",
"<code",
">",
"ValueType<",
"/",
"code",
">",
"classes",
"that",
"are",
"used",
"as",
"Entity",
"Id",
".",
"<br",
"/",
">",
"<br",
"/",
">"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/core/JaversBuilder.java#L444-L454 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageBandMath.java | ImageBandMath.stdDev | public static void stdDev(Planar<GrayF32> input, GrayF32 output, @Nullable GrayF32 avg) {
"""
Computes the standard deviation for each pixel across all bands in the {@link Planar}
image.
@param input Planar image - not modified
@param output Gray scale image containing average pixel values - modified
@p... | java | public static void stdDev(Planar<GrayF32> input, GrayF32 output, @Nullable GrayF32 avg) {
stdDev(input,output,avg,0,input.getNumBands() - 1);
} | [
"public",
"static",
"void",
"stdDev",
"(",
"Planar",
"<",
"GrayF32",
">",
"input",
",",
"GrayF32",
"output",
",",
"@",
"Nullable",
"GrayF32",
"avg",
")",
"{",
"stdDev",
"(",
"input",
",",
"output",
",",
"avg",
",",
"0",
",",
"input",
".",
"getNumBands"... | Computes the standard deviation for each pixel across all bands in the {@link Planar}
image.
@param input Planar image - not modified
@param output Gray scale image containing average pixel values - modified
@param avg Input Gray scale image containing average image. Can be null | [
"Computes",
"the",
"standard",
"deviation",
"for",
"each",
"pixel",
"across",
"all",
"bands",
"in",
"the",
"{"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageBandMath.java#L1025-L1027 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java | EdmondsMaximumMatching.parent | private int parent(BitSet ancestors, int curr) {
"""
Access the next ancestor in a tree of the forest. Note we go back two
places at once as we only need check 'even' vertices.
@param ancestors temporary set which fills up the path we traversed
@param curr the current even vertex in the tree
@return the... | java | private int parent(BitSet ancestors, int curr) {
curr = dsf.getRoot(curr);
ancestors.set(curr);
int parent = dsf.getRoot(even[curr]);
if (parent == curr) return curr; // root of tree
ancestors.set(parent);
return dsf.getRoot(odd[parent]);
} | [
"private",
"int",
"parent",
"(",
"BitSet",
"ancestors",
",",
"int",
"curr",
")",
"{",
"curr",
"=",
"dsf",
".",
"getRoot",
"(",
"curr",
")",
";",
"ancestors",
".",
"set",
"(",
"curr",
")",
";",
"int",
"parent",
"=",
"dsf",
".",
"getRoot",
"(",
"even... | Access the next ancestor in a tree of the forest. Note we go back two
places at once as we only need check 'even' vertices.
@param ancestors temporary set which fills up the path we traversed
@param curr the current even vertex in the tree
@return the next 'even' vertex | [
"Access",
"the",
"next",
"ancestor",
"in",
"a",
"tree",
"of",
"the",
"forest",
".",
"Note",
"we",
"go",
"back",
"two",
"places",
"at",
"once",
"as",
"we",
"only",
"need",
"check",
"even",
"vertices",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java#L252-L259 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java | FolderResourcesImpl.getFolder | public Folder getFolder(long folderId, EnumSet<SourceInclusion> includes) throws SmartsheetException {
"""
Get a folder.
It mirrors to the following Smartsheet REST API method: GET /folder/{id}
Exceptions:
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : ... | java | public Folder getFolder(long folderId, EnumSet<SourceInclusion> includes) throws SmartsheetException {
String path = "folders/" + folderId;
HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("include", QueryUtil.generateCommaSeparatedList(includes));
path ... | [
"public",
"Folder",
"getFolder",
"(",
"long",
"folderId",
",",
"EnumSet",
"<",
"SourceInclusion",
">",
"includes",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"folders/\"",
"+",
"folderId",
";",
"HashMap",
"<",
"String",
",",
"Object",
... | Get a folder.
It mirrors to the following Smartsheet REST API method: GET /folder/{id}
Exceptions:
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ResourceNotFoundException : if the resource can ... | [
"Get",
"a",
"folder",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java#L77-L84 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java | QrCodePositionPatternDetector.setLensDistortion | public void setLensDistortion(int width , int height ,
@Nullable LensDistortionNarrowFOV model ) {
"""
<p>Specifies transforms which can be used to change coordinates from distorted to undistorted and the opposite
coordinates. The undistorted image is never explicitly created.</p>
@param width Input... | java | public void setLensDistortion(int width , int height ,
@Nullable LensDistortionNarrowFOV model )
{
interpolate = FactoryInterpolation.bilinearPixelS(
squareDetector.getInputType(), BorderType.EXTENDED);
if( model != null ) {
PixelTransform<Point2D_F32> distToUndist = new PointToPixelTransform_F32... | [
"public",
"void",
"setLensDistortion",
"(",
"int",
"width",
",",
"int",
"height",
",",
"@",
"Nullable",
"LensDistortionNarrowFOV",
"model",
")",
"{",
"interpolate",
"=",
"FactoryInterpolation",
".",
"bilinearPixelS",
"(",
"squareDetector",
".",
"getInputType",
"(",
... | <p>Specifies transforms which can be used to change coordinates from distorted to undistorted and the opposite
coordinates. The undistorted image is never explicitly created.</p>
@param width Input image width. Used in sanity check only.
@param height Input image height. Used in sanity check only.
@param model dist... | [
"<p",
">",
"Specifies",
"transforms",
"which",
"can",
"be",
"used",
"to",
"change",
"coordinates",
"from",
"distorted",
"to",
"undistorted",
"and",
"the",
"opposite",
"coordinates",
".",
"The",
"undistorted",
"image",
"is",
"never",
"explicitly",
"created",
".",... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java#L159-L177 |
jeroenvanmaanen/bridge-pattern | src/main/java/org/leialearns/bridge/Static.java | Static.getFarObject | public static <FT extends FarObject<NT>, NT> FT getFarObject(NT nearObject, Class<FT> farType) {
"""
Returns the far object that corresponds to the given near object in a type safe way.
@param nearObject The near object
@param farType The class that represents the type of the far object
@param <FT> The type of ... | java | public static <FT extends FarObject<NT>, NT> FT getFarObject(NT nearObject, Class<FT> farType) {
return nearObject == null ? null : farType.cast(getFarObject(nearObject));
} | [
"public",
"static",
"<",
"FT",
"extends",
"FarObject",
"<",
"NT",
">",
",",
"NT",
">",
"FT",
"getFarObject",
"(",
"NT",
"nearObject",
",",
"Class",
"<",
"FT",
">",
"farType",
")",
"{",
"return",
"nearObject",
"==",
"null",
"?",
"null",
":",
"farType",
... | Returns the far object that corresponds to the given near object in a type safe way.
@param nearObject The near object
@param farType The class that represents the type of the far object
@param <FT> The type of the far object
@param <NT> The type of the near object
@return The far object that corresponds to the given n... | [
"Returns",
"the",
"far",
"object",
"that",
"corresponds",
"to",
"the",
"given",
"near",
"object",
"in",
"a",
"type",
"safe",
"way",
"."
] | train | https://github.com/jeroenvanmaanen/bridge-pattern/blob/55bd2de8cff800a1a97e26e97d3600e6dfb00b59/src/main/java/org/leialearns/bridge/Static.java#L30-L32 |
citrusframework/citrus | modules/citrus-kafka/src/main/java/com/consol/citrus/kafka/embedded/EmbeddedKafkaServer.java | EmbeddedKafkaServer.createBrokerProperties | protected Properties createBrokerProperties(String zooKeeperConnect, int kafkaServerPort, File logDir) {
"""
Creates Kafka broker properties.
@param zooKeeperConnect
@param kafkaServerPort
@param logDir
@return
"""
Properties props = new Properties();
props.put(KafkaConfig.BrokerIdProp(), ... | java | protected Properties createBrokerProperties(String zooKeeperConnect, int kafkaServerPort, File logDir) {
Properties props = new Properties();
props.put(KafkaConfig.BrokerIdProp(), "0");
props.put(KafkaConfig.ZkConnectProp(), zooKeeperConnect);
props.put(KafkaConfig.ZkConnectionTimeoutMs... | [
"protected",
"Properties",
"createBrokerProperties",
"(",
"String",
"zooKeeperConnect",
",",
"int",
"kafkaServerPort",
",",
"File",
"logDir",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"props",
".",
"put",
"(",
"KafkaConfig",
".",
... | Creates Kafka broker properties.
@param zooKeeperConnect
@param kafkaServerPort
@param logDir
@return | [
"Creates",
"Kafka",
"broker",
"properties",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-kafka/src/main/java/com/consol/citrus/kafka/embedded/EmbeddedKafkaServer.java#L242-L266 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optSerializable | @Nullable
@SuppressWarnings("unchecked") // Bundle#getSerializable(String) returns Serializable object so it is safe to cast to a type which extends Serializable.
public static <T extends Serializable> T optSerializable(@Nullable Bundle bundle, @Nullable String key) {
"""
Returns a optional {@link java.io.... | java | @Nullable
@SuppressWarnings("unchecked") // Bundle#getSerializable(String) returns Serializable object so it is safe to cast to a type which extends Serializable.
public static <T extends Serializable> T optSerializable(@Nullable Bundle bundle, @Nullable String key) {
return optSerializable(bundle, key,... | [
"@",
"Nullable",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// Bundle#getSerializable(String) returns Serializable object so it is safe to cast to a type which extends Serializable.",
"public",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"T",
"optSerializable",
"(... | Returns a optional {@link java.io.Serializable}. In other words, returns the value mapped by key if it exists and is a {@link java.io.Serializable}.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will return ... | [
"Returns",
"a",
"optional",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L781-L785 |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/ObjectDiff.java | ObjectDiff.updateDiff | private void updateDiff() throws EDBException {
"""
checks for start state and end state which key/value pairs are in common and which have been changed, added or
deleted
"""
List<String> keyList = loadKeyList();
for (String key : keyList) {
if (key.equals("id") || key.equals("pre... | java | private void updateDiff() throws EDBException {
List<String> keyList = loadKeyList();
for (String key : keyList) {
if (key.equals("id") || key.equals("prevTimestamp") || key.equals("timestamp")) {
continue;
}
Object first = startState.get(key);
... | [
"private",
"void",
"updateDiff",
"(",
")",
"throws",
"EDBException",
"{",
"List",
"<",
"String",
">",
"keyList",
"=",
"loadKeyList",
"(",
")",
";",
"for",
"(",
"String",
"key",
":",
"keyList",
")",
"{",
"if",
"(",
"key",
".",
"equals",
"(",
"\"id\"",
... | checks for start state and end state which key/value pairs are in common and which have been changed, added or
deleted | [
"checks",
"for",
"start",
"state",
"and",
"end",
"state",
"which",
"key",
"/",
"value",
"pairs",
"are",
"in",
"common",
"and",
"which",
"have",
"been",
"changed",
"added",
"or",
"deleted"
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/ObjectDiff.java#L68-L85 |
apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanAjaxAPIClient.java | AzkabanAjaxAPIClient.authenticateAndGetSessionId | public static String authenticateAndGetSessionId(String username, String password, String azkabanServerUrl)
throws IOException, EncoderException {
"""
*
Authenticate a user and obtain a session.id from response. Once a session.id has been obtained,
until the session expires, this id can be used to do any A... | java | public static String authenticateAndGetSessionId(String username, String password, String azkabanServerUrl)
throws IOException, EncoderException {
// Create post request
Map<String, String> params = Maps.newHashMap();
params.put("action", "login");
params.put("username", username);
params.put(... | [
"public",
"static",
"String",
"authenticateAndGetSessionId",
"(",
"String",
"username",
",",
"String",
"password",
",",
"String",
"azkabanServerUrl",
")",
"throws",
"IOException",
",",
"EncoderException",
"{",
"// Create post request",
"Map",
"<",
"String",
",",
"Stri... | *
Authenticate a user and obtain a session.id from response. Once a session.id has been obtained,
until the session expires, this id can be used to do any API requests with a proper permission granted.
A session expires if user log's out, changes machine, browser or location, if Azkaban is restarted,
or if the session ... | [
"*",
"Authenticate",
"a",
"user",
"and",
"obtain",
"a",
"session",
".",
"id",
"from",
"response",
".",
"Once",
"a",
"session",
".",
"id",
"has",
"been",
"obtained",
"until",
"the",
"session",
"expires",
"this",
"id",
"can",
"be",
"used",
"to",
"do",
"a... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanAjaxAPIClient.java#L84-L93 |
cerner/beadledom | client/resteasy-client/src/main/java/com/cerner/beadledom/client/resteasy/BeadledomResteasyClientBuilder.java | BeadledomResteasyClientBuilder.keyStore | @Override
public BeadledomResteasyClientBuilder keyStore(KeyStore keyStore, char[] password) {
"""
Sets the default SSL key store to be used if a {@link ClientHttpEngine} isn't
specified via {@link #setHttpEngine(ClientHttpEngine)}.
<p>If a {@link ClientHttpEngine} is specified via {@link #setHttpEngine(Clie... | java | @Override
public BeadledomResteasyClientBuilder keyStore(KeyStore keyStore, char[] password) {
this.clientKeyStore = keyStore;
this.clientPrivateKeyPassword = new String(password);
return this;
} | [
"@",
"Override",
"public",
"BeadledomResteasyClientBuilder",
"keyStore",
"(",
"KeyStore",
"keyStore",
",",
"char",
"[",
"]",
"password",
")",
"{",
"this",
".",
"clientKeyStore",
"=",
"keyStore",
";",
"this",
".",
"clientPrivateKeyPassword",
"=",
"new",
"String",
... | Sets the default SSL key store to be used if a {@link ClientHttpEngine} isn't
specified via {@link #setHttpEngine(ClientHttpEngine)}.
<p>If a {@link ClientHttpEngine} is specified via {@link #setHttpEngine(ClientHttpEngine)},
then this property will be ignored.
<p>{@inheritDoc}
@return this builder | [
"Sets",
"the",
"default",
"SSL",
"key",
"store",
"to",
"be",
"used",
"if",
"a",
"{",
"@link",
"ClientHttpEngine",
"}",
"isn",
"t",
"specified",
"via",
"{",
"@link",
"#setHttpEngine",
"(",
"ClientHttpEngine",
")",
"}",
"."
] | train | https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/client/resteasy-client/src/main/java/com/cerner/beadledom/client/resteasy/BeadledomResteasyClientBuilder.java#L410-L415 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java | WebDriverHelper.isValuePresentInDropDown | public boolean isValuePresentInDropDown(final By by, final String value) {
"""
Checks if the VALUE is present in the drop-down. This considers the VALUE
attribute of the option, not the actual display text. <br/>
For example if we have the following situation: <select id="test">
<option value="4">Ju... | java | public boolean isValuePresentInDropDown(final By by, final String value) {
WebElement element = driver.findElement(by);
StringBuilder builder = new StringBuilder(".//option[@value = ");
builder.append(escapeQuotes(value));
builder.append("]");
List<WebElement> options = element.findElements(By.xpath(builder
... | [
"public",
"boolean",
"isValuePresentInDropDown",
"(",
"final",
"By",
"by",
",",
"final",
"String",
"value",
")",
"{",
"WebElement",
"element",
"=",
"driver",
".",
"findElement",
"(",
"by",
")",
";",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",... | Checks if the VALUE is present in the drop-down. This considers the VALUE
attribute of the option, not the actual display text. <br/>
For example if we have the following situation: <select id="test">
<option value="4">June</option> </select> we will call
the method as follows: isValuePresentInD... | [
"Checks",
"if",
"the",
"VALUE",
"is",
"present",
"in",
"the",
"drop",
"-",
"down",
".",
"This",
"considers",
"the",
"VALUE",
"attribute",
"of",
"the",
"option",
"not",
"the",
"actual",
"display",
"text",
".",
"<br",
"/",
">",
"For",
"example",
"if",
"w... | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java#L583-L593 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java | Configuration.getChar | public char getChar(String name, char defaultValue) {
"""
Get the char value of the <code>name</code> property, <code>null</code> if
no such property exists.
Values are processed for <a href="#VariableExpansion">variable expansion</a>
before being returned.
@param name the property name.
@return the value... | java | public char getChar(String name, char defaultValue) {
return getProps().getProperty(name, String.valueOf(defaultValue)).charAt(0);
} | [
"public",
"char",
"getChar",
"(",
"String",
"name",
",",
"char",
"defaultValue",
")",
"{",
"return",
"getProps",
"(",
")",
".",
"getProperty",
"(",
"name",
",",
"String",
".",
"valueOf",
"(",
"defaultValue",
")",
")",
".",
"charAt",
"(",
"0",
")",
";",... | Get the char value of the <code>name</code> property, <code>null</code> if
no such property exists.
Values are processed for <a href="#VariableExpansion">variable expansion</a>
before being returned.
@param name the property name.
@return the value of the <code>name</code> property,
or null if no such property exists... | [
"Get",
"the",
"char",
"value",
"of",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"no",
"such",
"property",
"exists",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java#L417-L419 |
cryptomator/cryptofs | src/main/java/org/cryptomator/cryptofs/ConflictResolver.java | ConflictResolver.resolveDirectoryConflictTrivially | private boolean resolveDirectoryConflictTrivially(Path canonicalPath, Path conflictingPath) throws IOException {
"""
Tries to resolve a conflicting directory file without renaming the file. If successful, only the file with the canonical path will exist afterwards.
@param canonicalPath The path to the original ... | java | private boolean resolveDirectoryConflictTrivially(Path canonicalPath, Path conflictingPath) throws IOException {
if (!Files.exists(canonicalPath)) {
Files.move(conflictingPath, canonicalPath, StandardCopyOption.ATOMIC_MOVE);
return true;
} else if (hasSameDirFileContent(conflictingPath, canonicalPath)) {
/... | [
"private",
"boolean",
"resolveDirectoryConflictTrivially",
"(",
"Path",
"canonicalPath",
",",
"Path",
"conflictingPath",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"Files",
".",
"exists",
"(",
"canonicalPath",
")",
")",
"{",
"Files",
".",
"move",
"(",
... | Tries to resolve a conflicting directory file without renaming the file. If successful, only the file with the canonical path will exist afterwards.
@param canonicalPath The path to the original (conflict-free) directory file (must not exist).
@param conflictingPath The path to the potentially conflicting file (known ... | [
"Tries",
"to",
"resolve",
"a",
"conflicting",
"directory",
"file",
"without",
"renaming",
"the",
"file",
".",
"If",
"successful",
"only",
"the",
"file",
"with",
"the",
"canonical",
"path",
"will",
"exist",
"afterwards",
"."
] | train | https://github.com/cryptomator/cryptofs/blob/67fc1a4950dd1c150cd2e2c75bcabbeb7c9ac82e/src/main/java/org/cryptomator/cryptofs/ConflictResolver.java#L140-L152 |
apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/crypto/EncryptionConfigParser.java | EncryptionConfigParser.getConfigForBranch | public static Map<String, Object> getConfigForBranch(EntityType entityType, WorkUnitState workUnitState) {
"""
Retrieve encryption configuration for the branch the WorKUnitState represents
@param entityType Type of entity we are retrieving config for
@param workUnitState State for the object querying config
@re... | java | public static Map<String, Object> getConfigForBranch(EntityType entityType, WorkUnitState workUnitState) {
return getConfigForBranch(entityType, null, workUnitState);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"getConfigForBranch",
"(",
"EntityType",
"entityType",
",",
"WorkUnitState",
"workUnitState",
")",
"{",
"return",
"getConfigForBranch",
"(",
"entityType",
",",
"null",
",",
"workUnitState",
")",
";",
... | Retrieve encryption configuration for the branch the WorKUnitState represents
@param entityType Type of entity we are retrieving config for
@param workUnitState State for the object querying config
@return A list of encryption properties or null if encryption isn't configured | [
"Retrieve",
"encryption",
"configuration",
"for",
"the",
"branch",
"the",
"WorKUnitState",
"represents"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/crypto/EncryptionConfigParser.java#L101-L103 |
stackify/stackify-api-java | src/main/java/com/stackify/api/common/lang/Throwables.java | Throwables.toErrorItem | public static ErrorItem toErrorItem(final String logMessage, final String className, final String methodName, final int lineNumber) {
"""
Create an error item from a simple log message (without an explicit exception)
@param logMessage The log message
@param className The class that logged the message
@param met... | java | public static ErrorItem toErrorItem(final String logMessage, final String className, final String methodName, final int lineNumber) {
ErrorItem.Builder builder = ErrorItem.newBuilder();
builder.message(logMessage);
builder.errorType("StringException");
builder.sourceMethod(className + "." + methodName);
... | [
"public",
"static",
"ErrorItem",
"toErrorItem",
"(",
"final",
"String",
"logMessage",
",",
"final",
"String",
"className",
",",
"final",
"String",
"methodName",
",",
"final",
"int",
"lineNumber",
")",
"{",
"ErrorItem",
".",
"Builder",
"builder",
"=",
"ErrorItem"... | Create an error item from a simple log message (without an explicit exception)
@param logMessage The log message
@param className The class that logged the message
@param methodName The method that logged the message
@param lineNumber The line number that logged the message
@return The error item | [
"Create",
"an",
"error",
"item",
"from",
"a",
"simple",
"log",
"message",
"(",
"without",
"an",
"explicit",
"exception",
")"
] | train | https://github.com/stackify/stackify-api-java/blob/d3000b7c87ed53a88b302939b0c88405d63d7b67/src/main/java/com/stackify/api/common/lang/Throwables.java#L166-L200 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/toolbar/CmsToolbarGoBackButton.java | CmsToolbarGoBackButton.goBack | public static void goBack(final String returnCode) {
"""
Opens the publish dialog without changes check.<p>
@param returnCode the return code previously passed to the sitemap editor
"""
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(returnCode)) {
CmsRpcAction<CmsReturnLinkInfo> goBackAct... | java | public static void goBack(final String returnCode) {
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(returnCode)) {
CmsRpcAction<CmsReturnLinkInfo> goBackAction = new CmsRpcAction<CmsReturnLinkInfo>() {
@Override
public void execute() {
start(300, ... | [
"public",
"static",
"void",
"goBack",
"(",
"final",
"String",
"returnCode",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isNotEmptyOrWhitespaceOnly",
"(",
"returnCode",
")",
")",
"{",
"CmsRpcAction",
"<",
"CmsReturnLinkInfo",
">",
"goBackAction",
"=",
"new",
"Cms... | Opens the publish dialog without changes check.<p>
@param returnCode the return code previously passed to the sitemap editor | [
"Opens",
"the",
"publish",
"dialog",
"without",
"changes",
"check",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/toolbar/CmsToolbarGoBackButton.java#L88-L125 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/MfpDiagnostics.java | MfpDiagnostics.dumpJmfSlices | private void dumpJmfSlices(IncidentStream is, List<DataSlice> slices) {
"""
user data - so we only dump at most the first 4K bytes of each slice.
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "dumpJmfSlices");
if (slices != null) {
try {
is.writeLin... | java | private void dumpJmfSlices(IncidentStream is, List<DataSlice> slices) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "dumpJmfSlices");
if (slices != null) {
try {
is.writeLine("JMF data slices", SibTr.formatSlices(slices, getDiagnosticDataLimitInt()));
}
... | [
"private",
"void",
"dumpJmfSlices",
"(",
"IncidentStream",
"is",
",",
"List",
"<",
"DataSlice",
">",
"slices",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"ent... | user data - so we only dump at most the first 4K bytes of each slice. | [
"user",
"data",
"-",
"so",
"we",
"only",
"dump",
"at",
"most",
"the",
"first",
"4K",
"bytes",
"of",
"each",
"slice",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/MfpDiagnostics.java#L230-L247 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsPositionBean.java | CmsPositionBean.containsPoint | public boolean containsPoint(int x, int y) {
"""
Checks if the rectangle defined by this bean contains the given point.<p>
@param x the horizontal coordinate
@param y the vertical coordinate
@return true if this object contains the given point
"""
return isInRangeInclusive(getLeft(), (getLeft()... | java | public boolean containsPoint(int x, int y) {
return isInRangeInclusive(getLeft(), (getLeft() + getWidth()) - 1, x)
&& isInRangeInclusive(getTop(), (getTop() + getHeight()) - 1, y);
} | [
"public",
"boolean",
"containsPoint",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"return",
"isInRangeInclusive",
"(",
"getLeft",
"(",
")",
",",
"(",
"getLeft",
"(",
")",
"+",
"getWidth",
"(",
")",
")",
"-",
"1",
",",
"x",
")",
"&&",
"isInRangeInclus... | Checks if the rectangle defined by this bean contains the given point.<p>
@param x the horizontal coordinate
@param y the vertical coordinate
@return true if this object contains the given point | [
"Checks",
"if",
"the",
"rectangle",
"defined",
"by",
"this",
"bean",
"contains",
"the",
"given",
"point",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsPositionBean.java#L398-L402 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/ScopeContainer.java | ScopeContainer.registerDestructionCallback | @Override
public void registerDestructionCallback(String name, Runnable callback) {
"""
Register a bean destruction callback.
@param name Bean name.
@param callback Callback.
"""
synchronized (this) {
destructionCallbacks.put(name, callback);
}
} | java | @Override
public void registerDestructionCallback(String name, Runnable callback) {
synchronized (this) {
destructionCallbacks.put(name, callback);
}
} | [
"@",
"Override",
"public",
"void",
"registerDestructionCallback",
"(",
"String",
"name",
",",
"Runnable",
"callback",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"destructionCallbacks",
".",
"put",
"(",
"name",
",",
"callback",
")",
";",
"}",
"}"
] | Register a bean destruction callback.
@param name Bean name.
@param callback Callback. | [
"Register",
"a",
"bean",
"destruction",
"callback",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/ScopeContainer.java#L79-L84 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java | SecureCredentialsManager.checkAuthenticationResult | public boolean checkAuthenticationResult(int requestCode, int resultCode) {
"""
Checks the result after showing the LockScreen to the user.
Must be called from the {@link Activity#onActivityResult(int, int, Intent)} method with the received parameters.
It's safe to call this method even if {@link SecureCredentia... | java | public boolean checkAuthenticationResult(int requestCode, int resultCode) {
if (requestCode != authenticationRequestCode || decryptCallback == null) {
return false;
}
if (resultCode == Activity.RESULT_OK) {
continueGetCredentials(decryptCallback);
} else {
... | [
"public",
"boolean",
"checkAuthenticationResult",
"(",
"int",
"requestCode",
",",
"int",
"resultCode",
")",
"{",
"if",
"(",
"requestCode",
"!=",
"authenticationRequestCode",
"||",
"decryptCallback",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",... | Checks the result after showing the LockScreen to the user.
Must be called from the {@link Activity#onActivityResult(int, int, Intent)} method with the received parameters.
It's safe to call this method even if {@link SecureCredentialsManager#requireAuthentication(Activity, int, String, String)} was unsuccessful.
@par... | [
"Checks",
"the",
"result",
"after",
"showing",
"the",
"LockScreen",
"to",
"the",
"user",
".",
"Must",
"be",
"called",
"from",
"the",
"{",
"@link",
"Activity#onActivityResult",
"(",
"int",
"int",
"Intent",
")",
"}",
"method",
"with",
"the",
"received",
"param... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java#L117-L128 |
samskivert/samskivert | src/main/java/com/samskivert/util/PrefsConfig.java | PrefsConfig.setValue | public void setValue (String name, float value) {
"""
Sets the value of the specified preference, overriding the value defined in the
configuration files shipped with the application.
"""
Float oldValue = null;
if (_prefs.get(name, null) != null || _props.getProperty(name) != null) {
... | java | public void setValue (String name, float value)
{
Float oldValue = null;
if (_prefs.get(name, null) != null || _props.getProperty(name) != null) {
oldValue = Float.valueOf(_prefs.getFloat(name, super.getValue(name, 0f)));
}
_prefs.putFloat(name, value);
_propsup.... | [
"public",
"void",
"setValue",
"(",
"String",
"name",
",",
"float",
"value",
")",
"{",
"Float",
"oldValue",
"=",
"null",
";",
"if",
"(",
"_prefs",
".",
"get",
"(",
"name",
",",
"null",
")",
"!=",
"null",
"||",
"_props",
".",
"getProperty",
"(",
"name"... | Sets the value of the specified preference, overriding the value defined in the
configuration files shipped with the application. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"preference",
"overriding",
"the",
"value",
"defined",
"in",
"the",
"configuration",
"files",
"shipped",
"with",
"the",
"application",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/PrefsConfig.java#L99-L108 |
Waikato/moa | moa/src/main/java/moa/clusterers/streamkm/Point.java | Point.costOfPoint | public double costOfPoint(int k, Point[] centres) {
"""
Computes the cost of this point with the given array of centres centres[] (of size k)
"""
double nearestCost = -1.0;
for(int j=0; j<k; j++){
double distance = 0.0;
int l = 0;
for(l=0;l<this.dimension;l++){
//Centroid coordinate of the poi... | java | public double costOfPoint(int k, Point[] centres){
double nearestCost = -1.0;
for(int j=0; j<k; j++){
double distance = 0.0;
int l = 0;
for(l=0;l<this.dimension;l++){
//Centroid coordinate of the point
double centroidCoordinatePoint;
if(this.weight != 0.0){
centroidCoordinatePoint = this.c... | [
"public",
"double",
"costOfPoint",
"(",
"int",
"k",
",",
"Point",
"[",
"]",
"centres",
")",
"{",
"double",
"nearestCost",
"=",
"-",
"1.0",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"k",
";",
"j",
"++",
")",
"{",
"double",
"distance",
... | Computes the cost of this point with the given array of centres centres[] (of size k) | [
"Computes",
"the",
"cost",
"of",
"this",
"point",
"with",
"the",
"given",
"array",
"of",
"centres",
"centres",
"[]",
"(",
"of",
"size",
"k",
")"
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/streamkm/Point.java#L90-L119 |
Alluxio/alluxio | job/server/src/main/java/alluxio/job/migrate/MigrateDefinition.java | MigrateDefinition.computeTargetPath | private static String computeTargetPath(String path, String source, String destination)
throws Exception {
"""
Computes the path that the given path should end up at when source is migrated to destination.
@param path a path to migrate which must be a descendent path of the source path,
e.g. /src/file
@... | java | private static String computeTargetPath(String path, String source, String destination)
throws Exception {
String relativePath = PathUtils.subtractPaths(path, source);
return PathUtils.concatPath(destination, relativePath);
} | [
"private",
"static",
"String",
"computeTargetPath",
"(",
"String",
"path",
",",
"String",
"source",
",",
"String",
"destination",
")",
"throws",
"Exception",
"{",
"String",
"relativePath",
"=",
"PathUtils",
".",
"subtractPaths",
"(",
"path",
",",
"source",
")",
... | Computes the path that the given path should end up at when source is migrated to destination.
@param path a path to migrate which must be a descendent path of the source path,
e.g. /src/file
@param source the base source path being migrated, e.g. /src
@param destination the path to migrate to, e.g. /dst/src
@return t... | [
"Computes",
"the",
"path",
"that",
"the",
"given",
"path",
"should",
"end",
"up",
"at",
"when",
"source",
"is",
"migrated",
"to",
"destination",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/server/src/main/java/alluxio/job/migrate/MigrateDefinition.java#L218-L222 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Currency.java | Currency.getName | public String getName(ULocale locale, int nameStyle, String pluralCount,
boolean[] isChoiceFormat) {
"""
Returns the display name for the given currency in the
given locale. For example, the SYMBOL_NAME for the USD
currency object in the en_US locale is "$".
The PLURAL_LONG_NAME for the USD currenc... | java | public String getName(ULocale locale, int nameStyle, String pluralCount,
boolean[] isChoiceFormat) {
if (nameStyle != PLURAL_LONG_NAME) {
return getName(locale, nameStyle, isChoiceFormat);
}
// We no longer support choice format
if (isChoiceFormat != null) {
... | [
"public",
"String",
"getName",
"(",
"ULocale",
"locale",
",",
"int",
"nameStyle",
",",
"String",
"pluralCount",
",",
"boolean",
"[",
"]",
"isChoiceFormat",
")",
"{",
"if",
"(",
"nameStyle",
"!=",
"PLURAL_LONG_NAME",
")",
"{",
"return",
"getName",
"(",
"local... | Returns the display name for the given currency in the
given locale. For example, the SYMBOL_NAME for the USD
currency object in the en_US locale is "$".
The PLURAL_LONG_NAME for the USD currency object when the currency
amount is plural is "US dollars", such as in "3.00 US dollars";
while the PLURAL_LONG_NAME for the... | [
"Returns",
"the",
"display",
"name",
"for",
"the",
"given",
"currency",
"in",
"the",
"given",
"locale",
".",
"For",
"example",
"the",
"SYMBOL_NAME",
"for",
"the",
"USD",
"currency",
"object",
"in",
"the",
"en_US",
"locale",
"is",
"$",
".",
"The",
"PLURAL_L... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Currency.java#L575-L588 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/authorization/providers/PoliciesCache.java | PoliciesCache.fromFile | public static PoliciesCache fromFile(File singleFile, Set<Attribute> forcedContext) {
"""
Create a cache from a single file source
@param singleFile file
@return cache
"""
return fromSourceProvider(YamlProvider.getFileProvider(singleFile), forcedContext);
} | java | public static PoliciesCache fromFile(File singleFile, Set<Attribute> forcedContext) {
return fromSourceProvider(YamlProvider.getFileProvider(singleFile), forcedContext);
} | [
"public",
"static",
"PoliciesCache",
"fromFile",
"(",
"File",
"singleFile",
",",
"Set",
"<",
"Attribute",
">",
"forcedContext",
")",
"{",
"return",
"fromSourceProvider",
"(",
"YamlProvider",
".",
"getFileProvider",
"(",
"singleFile",
")",
",",
"forcedContext",
")"... | Create a cache from a single file source
@param singleFile file
@return cache | [
"Create",
"a",
"cache",
"from",
"a",
"single",
"file",
"source"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/authorization/providers/PoliciesCache.java#L155-L157 |
UrielCh/ovh-java-sdk | ovh-java-sdk-licenseoffice/src/main/java/net/minidev/ovh/api/ApiOvhLicenseoffice.java | ApiOvhLicenseoffice.serviceName_user_activationEmail_GET | public OvhOfficeUser serviceName_user_activationEmail_GET(String serviceName, String activationEmail) throws IOException {
"""
Get this object properties
REST: GET /license/office/{serviceName}/user/{activationEmail}
@param serviceName [required] The unique identifier of your Office service
@param activationE... | java | public OvhOfficeUser serviceName_user_activationEmail_GET(String serviceName, String activationEmail) throws IOException {
String qPath = "/license/office/{serviceName}/user/{activationEmail}";
StringBuilder sb = path(qPath, serviceName, activationEmail);
String resp = exec(qPath, "GET", sb.toString(), null);
r... | [
"public",
"OvhOfficeUser",
"serviceName_user_activationEmail_GET",
"(",
"String",
"serviceName",
",",
"String",
"activationEmail",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/license/office/{serviceName}/user/{activationEmail}\"",
";",
"StringBuilder",
"sb",
... | Get this object properties
REST: GET /license/office/{serviceName}/user/{activationEmail}
@param serviceName [required] The unique identifier of your Office service
@param activationEmail [required] Email used to activate Microsoft Office | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-licenseoffice/src/main/java/net/minidev/ovh/api/ApiOvhLicenseoffice.java#L150-L155 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/operation/DbOperationManager.java | DbOperationManager.addSortedModifications | protected void addSortedModifications(List<DbOperation> flush) {
"""
Adds a correctly ordered list of UPDATE and DELETE operations to the flush.
@param flush
"""
// calculate sorted set of all modified entity types
SortedSet<Class<?>> modifiedEntityTypes = new TreeSet<Class<?>>(MODIFICATION_TYPE_COMP... | java | protected void addSortedModifications(List<DbOperation> flush) {
// calculate sorted set of all modified entity types
SortedSet<Class<?>> modifiedEntityTypes = new TreeSet<Class<?>>(MODIFICATION_TYPE_COMPARATOR);
modifiedEntityTypes.addAll(updates.keySet());
modifiedEntityTypes.addAll(deletes.keySet())... | [
"protected",
"void",
"addSortedModifications",
"(",
"List",
"<",
"DbOperation",
">",
"flush",
")",
"{",
"// calculate sorted set of all modified entity types",
"SortedSet",
"<",
"Class",
"<",
"?",
">",
">",
"modifiedEntityTypes",
"=",
"new",
"TreeSet",
"<",
"Class",
... | Adds a correctly ordered list of UPDATE and DELETE operations to the flush.
@param flush | [
"Adds",
"a",
"correctly",
"ordered",
"list",
"of",
"UPDATE",
"and",
"DELETE",
"operations",
"to",
"the",
"flush",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/operation/DbOperationManager.java#L156-L180 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/scheduler/JobScheduler.java | JobScheduler.runJob | public void runJob(Properties jobProps, JobListener jobListener)
throws JobException {
"""
Run a job.
<p>
This method runs the job immediately without going through the Quartz scheduler.
This is particularly useful for testing.
</p>
@param jobProps Job configuration properties
@param jobListener {@... | java | public void runJob(Properties jobProps, JobListener jobListener)
throws JobException {
try {
runJob(jobProps, jobListener, buildJobLauncher(jobProps));
} catch (Exception e) {
throw new JobException("Failed to run job " + jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY), e);
}
} | [
"public",
"void",
"runJob",
"(",
"Properties",
"jobProps",
",",
"JobListener",
"jobListener",
")",
"throws",
"JobException",
"{",
"try",
"{",
"runJob",
"(",
"jobProps",
",",
"jobListener",
",",
"buildJobLauncher",
"(",
"jobProps",
")",
")",
";",
"}",
"catch",
... | Run a job.
<p>
This method runs the job immediately without going through the Quartz scheduler.
This is particularly useful for testing.
</p>
@param jobProps Job configuration properties
@param jobListener {@link JobListener} used for callback, can be <em>null</em> if no callback is needed.
@throws JobException when ... | [
"Run",
"a",
"job",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/scheduler/JobScheduler.java#L432-L439 |
pravega/pravega | segmentstore/contracts/src/main/java/io/pravega/segmentstore/contracts/tables/TableEntry.java | TableEntry.notExists | public static TableEntry notExists(@NonNull ArrayView key, @NonNull ArrayView value) {
"""
Creates a new instance of the TableEntry class that indicates the Key must not previously exist.
@param key The Key.
@param value The Value.
@return newly created TableEntry if one for the key does not already exist... | java | public static TableEntry notExists(@NonNull ArrayView key, @NonNull ArrayView value) {
return new TableEntry(TableKey.notExists(key), value);
} | [
"public",
"static",
"TableEntry",
"notExists",
"(",
"@",
"NonNull",
"ArrayView",
"key",
",",
"@",
"NonNull",
"ArrayView",
"value",
")",
"{",
"return",
"new",
"TableEntry",
"(",
"TableKey",
".",
"notExists",
"(",
"key",
")",
",",
"value",
")",
";",
"}"
] | Creates a new instance of the TableEntry class that indicates the Key must not previously exist.
@param key The Key.
@param value The Value.
@return newly created TableEntry if one for the key does not already exist. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"TableEntry",
"class",
"that",
"indicates",
"the",
"Key",
"must",
"not",
"previously",
"exist",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/contracts/src/main/java/io/pravega/segmentstore/contracts/tables/TableEntry.java#L55-L57 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | FSDirectory.unprotectedHardLinkTo | boolean unprotectedHardLinkTo(String src, String dst, long timestamp)
throws QuotaExceededException, FileNotFoundException {
"""
hard link the dst path to the src path
@param src source path
@param dst destination path
@param timestamp The modification timestamp for the dst's parent directory
@return true ... | java | boolean unprotectedHardLinkTo(String src, String dst, long timestamp)
throws QuotaExceededException, FileNotFoundException {
return unprotectedHardLinkTo(src, null, null, null, dst, null, null, null, timestamp);
} | [
"boolean",
"unprotectedHardLinkTo",
"(",
"String",
"src",
",",
"String",
"dst",
",",
"long",
"timestamp",
")",
"throws",
"QuotaExceededException",
",",
"FileNotFoundException",
"{",
"return",
"unprotectedHardLinkTo",
"(",
"src",
",",
"null",
",",
"null",
",",
"nul... | hard link the dst path to the src path
@param src source path
@param dst destination path
@param timestamp The modification timestamp for the dst's parent directory
@return true if the hardLink succeeds; false otherwise
@throws QuotaExceededException if the operation violates any quota limit
@throws FileNotFoundExcept... | [
"hard",
"link",
"the",
"dst",
"path",
"to",
"the",
"src",
"path"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L596-L599 |
remkop/picocli | src/main/java/picocli/CommandLine.java | CommandLine.setHelpSectionMap | public CommandLine setHelpSectionMap(Map<String, IHelpSectionRenderer> map) {
"""
Sets the map of section keys and renderers used to construct the usage help message.
<p>The specified setting will be registered with this {@code CommandLine} and the full hierarchy of its
subcommands and nested sub-subcommands <em... | java | public CommandLine setHelpSectionMap(Map<String, IHelpSectionRenderer> map) {
getCommandSpec().usageMessage().sectionMap(map);
for (CommandLine command : getCommandSpec().subcommands().values()) {
command.setHelpSectionMap(map);
}
return this;
} | [
"public",
"CommandLine",
"setHelpSectionMap",
"(",
"Map",
"<",
"String",
",",
"IHelpSectionRenderer",
">",
"map",
")",
"{",
"getCommandSpec",
"(",
")",
".",
"usageMessage",
"(",
")",
".",
"sectionMap",
"(",
"map",
")",
";",
"for",
"(",
"CommandLine",
"comman... | Sets the map of section keys and renderers used to construct the usage help message.
<p>The specified setting will be registered with this {@code CommandLine} and the full hierarchy of its
subcommands and nested sub-subcommands <em>at the moment this method is called</em>. Subcommands added
later will have the default ... | [
"Sets",
"the",
"map",
"of",
"section",
"keys",
"and",
"renderers",
"used",
"to",
"construct",
"the",
"usage",
"help",
"message",
".",
"<p",
">",
"The",
"specified",
"setting",
"will",
"be",
"registered",
"with",
"this",
"{"
] | train | https://github.com/remkop/picocli/blob/3c5384f0d12817401d1921c3013c1282e2edcab2/src/main/java/picocli/CommandLine.java#L448-L454 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java | DateFormatSymbols.setLocale | final void setLocale(ULocale valid, ULocale actual) {
"""
Sets information about the locales that were used to create this
object. If the object was not constructed from locale data,
both arguments should be set to null. Otherwise, neither
should be null. The actual locale must be at the same level or
less ... | java | final void setLocale(ULocale valid, ULocale actual) {
// Change the following to an assertion later
if ((valid == null) != (actual == null)) {
///CLOVER:OFF
throw new IllegalArgumentException();
///CLOVER:ON
}
// Another check we could do is that the a... | [
"final",
"void",
"setLocale",
"(",
"ULocale",
"valid",
",",
"ULocale",
"actual",
")",
"{",
"// Change the following to an assertion later",
"if",
"(",
"(",
"valid",
"==",
"null",
")",
"!=",
"(",
"actual",
"==",
"null",
")",
")",
"{",
"///CLOVER:OFF",
"throw",
... | Sets information about the locales that were used to create this
object. If the object was not constructed from locale data,
both arguments should be set to null. Otherwise, neither
should be null. The actual locale must be at the same level or
less specific than the valid locale. This method is intended
for use by... | [
"Sets",
"information",
"about",
"the",
"locales",
"that",
"were",
"used",
"to",
"create",
"this",
"object",
".",
"If",
"the",
"object",
"was",
"not",
"constructed",
"from",
"locale",
"data",
"both",
"arguments",
"should",
"be",
"set",
"to",
"null",
".",
"O... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java#L2437-L2448 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/TransitionManager.java | TransitionManager.beginDelayedTransition | public static void beginDelayedTransition(final @NonNull ViewGroup sceneRoot, @Nullable Transition transition) {
"""
Convenience method to animate to a new scene defined by all changes within
the given scene root between calling this method and the next rendering frame.
Calling this method causes TransitionManag... | java | public static void beginDelayedTransition(final @NonNull ViewGroup sceneRoot, @Nullable Transition transition) {
if (!sPendingTransitions.contains(sceneRoot) && ViewUtils.isLaidOut(sceneRoot, true)) {
if (Transition.DBG) {
Log.d(LOG_TAG, "beginDelayedTransition: root, transition = " ... | [
"public",
"static",
"void",
"beginDelayedTransition",
"(",
"final",
"@",
"NonNull",
"ViewGroup",
"sceneRoot",
",",
"@",
"Nullable",
"Transition",
"transition",
")",
"{",
"if",
"(",
"!",
"sPendingTransitions",
".",
"contains",
"(",
"sceneRoot",
")",
"&&",
"ViewUt... | Convenience method to animate to a new scene defined by all changes within
the given scene root between calling this method and the next rendering frame.
Calling this method causes TransitionManager to capture current values in the
scene root and then post a request to run a transition on the next frame.
At that time, ... | [
"Convenience",
"method",
"to",
"animate",
"to",
"a",
"new",
"scene",
"defined",
"by",
"all",
"changes",
"within",
"the",
"given",
"scene",
"root",
"between",
"calling",
"this",
"method",
"and",
"the",
"next",
"rendering",
"frame",
".",
"Calling",
"this",
"me... | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/TransitionManager.java#L431-L446 |
JRebirth/JRebirth | org.jrebirth.af/presentation/src/main/java/org/jrebirth/af/presentation/ui/stack/SlideStackModel.java | SlideStackModel.displaySlide | @SuppressWarnings("unchecked")
private void displaySlide(final Slide slide, final boolean isReverse) {
"""
Display a slide.
@param slide the slide to display
@param isReverse indicate the direction (next or previous slide)
"""
synchronized (this) {
try {
LOGGER.trac... | java | @SuppressWarnings("unchecked")
private void displaySlide(final Slide slide, final boolean isReverse) {
synchronized (this) {
try {
LOGGER.trace("Display slide N°" + slide.getPage() + " reverse=" + isReverse);
SlideModel<SlideStep> previousSlideModel = null;
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"displaySlide",
"(",
"final",
"Slide",
"slide",
",",
"final",
"boolean",
"isReverse",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"try",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Display ... | Display a slide.
@param slide the slide to display
@param isReverse indicate the direction (next or previous slide) | [
"Display",
"a",
"slide",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/presentation/src/main/java/org/jrebirth/af/presentation/ui/stack/SlideStackModel.java#L142-L199 |
ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/dialect/impl/Mysql2SQLDialectAdapter.java | Mysql2SQLDialectAdapter.sqlRegex | @Override
public String sqlRegex(String columnname, String pattern, boolean caseinSensitive, boolean multiLine, boolean dotAllMode) {
"""
Based on information in MySQL 5. 1 manual at
http://dev.mysql.com/doc/refman/5.1/en/regexp.html
and
http://dev.mysql.com/doc/refman/5.1/en/pattern-matching.html
"""
... | java | @Override
public String sqlRegex(String columnname, String pattern, boolean caseinSensitive, boolean multiLine, boolean dotAllMode) {
Pattern quotes = Pattern.compile("[\"`\\['].*[\"`\\]']");
if(quotes.matcher(pattern).matches() ) {
pattern = pattern.substring(1, pattern.length() - 1); // remove the
// e... | [
"@",
"Override",
"public",
"String",
"sqlRegex",
"(",
"String",
"columnname",
",",
"String",
"pattern",
",",
"boolean",
"caseinSensitive",
",",
"boolean",
"multiLine",
",",
"boolean",
"dotAllMode",
")",
"{",
"Pattern",
"quotes",
"=",
"Pattern",
".",
"compile",
... | Based on information in MySQL 5. 1 manual at
http://dev.mysql.com/doc/refman/5.1/en/regexp.html
and
http://dev.mysql.com/doc/refman/5.1/en/pattern-matching.html | [
"Based",
"on",
"information",
"in",
"MySQL",
"5",
".",
"1",
"manual",
"at",
"http",
":",
"//",
"dev",
".",
"mysql",
".",
"com",
"/",
"doc",
"/",
"refman",
"/",
"5",
".",
"1",
"/",
"en",
"/",
"regexp",
".",
"html",
"and",
"http",
":",
"//",
"dev... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/dialect/impl/Mysql2SQLDialectAdapter.java#L185-L198 |
arquillian/arquillian-algeron | common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java | GitOperations.cloneRepository | public Git cloneRepository(String remoteUrl, Path localPath, String username, String password) {
"""
Clones a private remote git repository. Caller is responsible of closing git repository.
@param remoteUrl
to connect.
@param localPath
where to clone the repo.
@param username
to connect
@param password
t... | java | public Git cloneRepository(String remoteUrl, Path localPath, String username, String password) {
try {
return Git.cloneRepository()
.setURI(remoteUrl)
.setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password))
.setDirectory(lo... | [
"public",
"Git",
"cloneRepository",
"(",
"String",
"remoteUrl",
",",
"Path",
"localPath",
",",
"String",
"username",
",",
"String",
"password",
")",
"{",
"try",
"{",
"return",
"Git",
".",
"cloneRepository",
"(",
")",
".",
"setURI",
"(",
"remoteUrl",
")",
"... | Clones a private remote git repository. Caller is responsible of closing git repository.
@param remoteUrl
to connect.
@param localPath
where to clone the repo.
@param username
to connect
@param password
to connect
@return Git instance. Caller is responsible to close the connection. | [
"Clones",
"a",
"private",
"remote",
"git",
"repository",
".",
"Caller",
"is",
"responsible",
"of",
"closing",
"git",
"repository",
"."
] | train | https://github.com/arquillian/arquillian-algeron/blob/ec79372defdafe99ab2f7bb696f1c1eabdbbacb6/common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java#L496-L506 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrInvalidMethodSignException | public static void assertTrueOrInvalidMethodSignException(boolean expression, SQLiteModelMethod method,
String messageFormat, Object... args) {
"""
Assert true or invalid method sign exception.
@param expression
the expression
@param method
the method
@param messageFormat
the message format
@param args... | java | public static void assertTrueOrInvalidMethodSignException(boolean expression, SQLiteModelMethod method,
String messageFormat, Object... args) {
if (!expression)
throw (new InvalidMethodSignException(method, String.format(messageFormat, args)));
} | [
"public",
"static",
"void",
"assertTrueOrInvalidMethodSignException",
"(",
"boolean",
"expression",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"messageFormat",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"throw",
"(",
"new",
... | Assert true or invalid method sign exception.
@param expression
the expression
@param method
the method
@param messageFormat
the message format
@param args
the args | [
"Assert",
"true",
"or",
"invalid",
"method",
"sign",
"exception",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L87-L91 |
xebia-france/xebia-logfilter-extras | src/main/java/fr/xebia/extras/filters/logfilters/RequestLoggerFilter.java | RequestLoggerFilter.dumpResponse | private void dumpResponse(final HttpServletResponseLoggingWrapper response, final int id) {
"""
This method handles the dumping of the reponse body, status code and headers if needed
@param response ResponseWrapper that handled the response populated by the webapp
@param id Generated unique identifier fo... | java | private void dumpResponse(final HttpServletResponseLoggingWrapper response, final int id) {
final StringWriter stringWriter = new StringWriter();
final PrintWriter printWriter = new PrintWriter(stringWriter);
printWriter.print("-- ID: ");
printWriter.println(id);
printWriter.prin... | [
"private",
"void",
"dumpResponse",
"(",
"final",
"HttpServletResponseLoggingWrapper",
"response",
",",
"final",
"int",
"id",
")",
"{",
"final",
"StringWriter",
"stringWriter",
"=",
"new",
"StringWriter",
"(",
")",
";",
"final",
"PrintWriter",
"printWriter",
"=",
"... | This method handles the dumping of the reponse body, status code and headers if needed
@param response ResponseWrapper that handled the response populated by the webapp
@param id Generated unique identifier for the request/response couple | [
"This",
"method",
"handles",
"the",
"dumping",
"of",
"the",
"reponse",
"body",
"status",
"code",
"and",
"headers",
"if",
"needed"
] | train | https://github.com/xebia-france/xebia-logfilter-extras/blob/b1112329816d7f28fdba214425da8f15338a7157/src/main/java/fr/xebia/extras/filters/logfilters/RequestLoggerFilter.java#L140-L173 |
landawn/AbacusUtil | src/com/landawn/abacus/util/URLEncodedUtil.java | URLEncodedUtil.encUserInfo | static void encUserInfo(final StringBuilder sb, final String content, final Charset charset) {
"""
Encode a String using the {@link #USERINFO} set of characters.
<p>
Used by URIBuilder to encode the userinfo segment.
@param content
the string to encode, does not convert space to '+'
@param charset
the charse... | java | static void encUserInfo(final StringBuilder sb, final String content, final Charset charset) {
urlEncode(sb, content, charset, USERINFO, false);
} | [
"static",
"void",
"encUserInfo",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"String",
"content",
",",
"final",
"Charset",
"charset",
")",
"{",
"urlEncode",
"(",
"sb",
",",
"content",
",",
"charset",
",",
"USERINFO",
",",
"false",
")",
";",
"}"
] | Encode a String using the {@link #USERINFO} set of characters.
<p>
Used by URIBuilder to encode the userinfo segment.
@param content
the string to encode, does not convert space to '+'
@param charset
the charset to use
@return the encoded string | [
"Encode",
"a",
"String",
"using",
"the",
"{",
"@link",
"#USERINFO",
"}",
"set",
"of",
"characters",
".",
"<p",
">",
"Used",
"by",
"URIBuilder",
"to",
"encode",
"the",
"userinfo",
"segment",
".",
"@param",
"content",
"the",
"string",
"to",
"encode",
"does",... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/URLEncodedUtil.java#L514-L516 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java | SerializerBase.addAttribute | public void addAttribute(String name, final String value) {
"""
Adds the given attribute to the set of collected attributes,
but only if there is a currently open element.
@param name the attribute's qualified name
@param value the value of the attribute
"""
if (m_elemContext.m_startTagOpen)
... | java | public void addAttribute(String name, final String value)
{
if (m_elemContext.m_startTagOpen)
{
final String patchedName = patchName(name);
final String localName = getLocalName(patchedName);
final String uri = getNamespaceURI(patchedName, false);
add... | [
"public",
"void",
"addAttribute",
"(",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"m_elemContext",
".",
"m_startTagOpen",
")",
"{",
"final",
"String",
"patchedName",
"=",
"patchName",
"(",
"name",
")",
";",
"final",
"String",
"... | Adds the given attribute to the set of collected attributes,
but only if there is a currently open element.
@param name the attribute's qualified name
@param value the value of the attribute | [
"Adds",
"the",
"given",
"attribute",
"to",
"the",
"set",
"of",
"collected",
"attributes",
"but",
"only",
"if",
"there",
"is",
"a",
"currently",
"open",
"element",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L444-L454 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java | XMLCharHelper.isInvalidXMLCDATAChar | public static boolean isInvalidXMLCDATAChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c) {
"""
Check if the passed character is invalid for a CDATA node.
@param eXMLVersion
XML version to be used. May not be <code>null</code>.
@param c
char to check
@return <code>true</code> if the char is... | java | public static boolean isInvalidXMLCDATAChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c)
{
switch (eXMLVersion)
{
case XML_10:
return INVALID_VALUE_CHAR_XML10.get (c);
case XML_11:
return INVALID_CDATA_VALUE_CHAR_XML11.get (c);
case HTML:
return INVA... | [
"public",
"static",
"boolean",
"isInvalidXMLCDATAChar",
"(",
"@",
"Nonnull",
"final",
"EXMLSerializeVersion",
"eXMLVersion",
",",
"final",
"int",
"c",
")",
"{",
"switch",
"(",
"eXMLVersion",
")",
"{",
"case",
"XML_10",
":",
"return",
"INVALID_VALUE_CHAR_XML10",
".... | Check if the passed character is invalid for a CDATA node.
@param eXMLVersion
XML version to be used. May not be <code>null</code>.
@param c
char to check
@return <code>true</code> if the char is invalid | [
"Check",
"if",
"the",
"passed",
"character",
"is",
"invalid",
"for",
"a",
"CDATA",
"node",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java#L867-L880 |
xm-online/xm-commons | xm-commons-lep/src/main/java/com/icthh/xm/commons/lep/spring/LepServiceHandler.java | LepServiceHandler.onMethodInvoke | @SuppressWarnings("squid:S00112") //suppress throwable warning
public Object onMethodInvoke(Class<?> targetType, Object target, Method method, Object[] args) throws Throwable {
"""
Processes a LEP method invocation on a proxy instance and returns
the result. This method will be invoked on an invocation handl... | java | @SuppressWarnings("squid:S00112") //suppress throwable warning
public Object onMethodInvoke(Class<?> targetType, Object target, Method method, Object[] args) throws Throwable {
LepService typeLepService = targetType.getAnnotation(LepService.class);
Objects.requireNonNull(typeLepService, "No " + LepS... | [
"@",
"SuppressWarnings",
"(",
"\"squid:S00112\"",
")",
"//suppress throwable warning",
"public",
"Object",
"onMethodInvoke",
"(",
"Class",
"<",
"?",
">",
"targetType",
",",
"Object",
"target",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throw... | Processes a LEP method invocation on a proxy instance and returns
the result. This method will be invoked on an invocation handler
when a method is invoked on a proxy instance that it is
associated with.
@param targetType type of LEP service (interface, concrete class)
@param target target LEP service object, can... | [
"Processes",
"a",
"LEP",
"method",
"invocation",
"on",
"a",
"proxy",
"instance",
"and",
"returns",
"the",
"result",
".",
"This",
"method",
"will",
"be",
"invoked",
"on",
"an",
"invocation",
"handler",
"when",
"a",
"method",
"is",
"invoked",
"on",
"a",
"pro... | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-lep/src/main/java/com/icthh/xm/commons/lep/spring/LepServiceHandler.java#L64-L91 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/BinaryHashBucketArea.java | BinaryHashBucketArea.insertToBucket | boolean insertToBucket(int hashCode, int pointer, boolean spillingAllowed, boolean sizeAddAndCheckResize) throws IOException {
"""
Insert into bucket by hashCode and pointer.
@return return false when spill own partition.
"""
final int posHashCode = findBucket(hashCode);
// get the bucket for the given ha... | java | boolean insertToBucket(int hashCode, int pointer, boolean spillingAllowed, boolean sizeAddAndCheckResize) throws IOException {
final int posHashCode = findBucket(hashCode);
// get the bucket for the given hash code
final int bucketArrayPos = posHashCode >> table.bucketsPerSegmentBits;
final int bucketInSegmentP... | [
"boolean",
"insertToBucket",
"(",
"int",
"hashCode",
",",
"int",
"pointer",
",",
"boolean",
"spillingAllowed",
",",
"boolean",
"sizeAddAndCheckResize",
")",
"throws",
"IOException",
"{",
"final",
"int",
"posHashCode",
"=",
"findBucket",
"(",
"hashCode",
")",
";",
... | Insert into bucket by hashCode and pointer.
@return return false when spill own partition. | [
"Insert",
"into",
"bucket",
"by",
"hashCode",
"and",
"pointer",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/BinaryHashBucketArea.java#L436-L443 |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/PersistenceStrategy.java | PersistenceStrategy.getPerKindStrategy | private static PersistenceStrategy<?, ?, ?> getPerKindStrategy(EmbeddedCacheManager externalCacheManager, URL configUrl, JtaPlatform platform) {
"""
Returns the "per-kind" persistence strategy. Three caches will be used: one for entities, one for associations
and one for id sources.
"""
OnePerKindKeyProvide... | java | private static PersistenceStrategy<?, ?, ?> getPerKindStrategy(EmbeddedCacheManager externalCacheManager, URL configUrl, JtaPlatform platform) {
OnePerKindKeyProvider keyProvider = new OnePerKindKeyProvider();
OnePerKindCacheManager cacheManager = externalCacheManager != null ?
new OnePerKindCacheManager( exte... | [
"private",
"static",
"PersistenceStrategy",
"<",
"?",
",",
"?",
",",
"?",
">",
"getPerKindStrategy",
"(",
"EmbeddedCacheManager",
"externalCacheManager",
",",
"URL",
"configUrl",
",",
"JtaPlatform",
"platform",
")",
"{",
"OnePerKindKeyProvider",
"keyProvider",
"=",
... | Returns the "per-kind" persistence strategy. Three caches will be used: one for entities, one for associations
and one for id sources. | [
"Returns",
"the",
"per",
"-",
"kind",
"persistence",
"strategy",
".",
"Three",
"caches",
"will",
"be",
"used",
":",
"one",
"for",
"entities",
"one",
"for",
"associations",
"and",
"one",
"for",
"id",
"sources",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/PersistenceStrategy.java#L93-L101 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getAlgName | private String getAlgName(int ch, int choice) {
"""
Gets the algorithmic name for the argument character
@param ch character to determine name for
@param choice name choice
@return the algorithmic name or null if not found
"""
/* Only the normative character name can be algorithmic. */
if (c... | java | private String getAlgName(int ch, int choice)
{
/* Only the normative character name can be algorithmic. */
if (choice == UCharacterNameChoice.UNICODE_CHAR_NAME ||
choice == UCharacterNameChoice.EXTENDED_CHAR_NAME
) {
// index in terms integer index
synchr... | [
"private",
"String",
"getAlgName",
"(",
"int",
"ch",
",",
"int",
"choice",
")",
"{",
"/* Only the normative character name can be algorithmic. */",
"if",
"(",
"choice",
"==",
"UCharacterNameChoice",
".",
"UNICODE_CHAR_NAME",
"||",
"choice",
"==",
"UCharacterNameChoice",
... | Gets the algorithmic name for the argument character
@param ch character to determine name for
@param choice name choice
@return the algorithmic name or null if not found | [
"Gets",
"the",
"algorithmic",
"name",
"for",
"the",
"argument",
"character"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1185-L1205 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/instance/InstanceManager.java | InstanceManager.unregisterTaskManager | public void unregisterTaskManager(InstanceID instanceId, boolean terminated) {
"""
Unregisters the TaskManager with the given instance id. Unregistering means to mark
the given instance as dead and notify {@link InstanceListener} about the dead instance.
@param instanceId TaskManager which is about to be marke... | java | public void unregisterTaskManager(InstanceID instanceId, boolean terminated){
Instance instance = registeredHostsById.get(instanceId);
if (instance != null){
registeredHostsById.remove(instance.getId());
registeredHostsByResource.remove(instance.getTaskManagerID());
if (terminated) {
deadHosts.add(in... | [
"public",
"void",
"unregisterTaskManager",
"(",
"InstanceID",
"instanceId",
",",
"boolean",
"terminated",
")",
"{",
"Instance",
"instance",
"=",
"registeredHostsById",
".",
"get",
"(",
"instanceId",
")",
";",
"if",
"(",
"instance",
"!=",
"null",
")",
"{",
"reg... | Unregisters the TaskManager with the given instance id. Unregistering means to mark
the given instance as dead and notify {@link InstanceListener} about the dead instance.
@param instanceId TaskManager which is about to be marked dead. | [
"Unregisters",
"the",
"TaskManager",
"with",
"the",
"given",
"instance",
"id",
".",
"Unregistering",
"means",
"to",
"mark",
"the",
"given",
"instance",
"as",
"dead",
"and",
"notify",
"{",
"@link",
"InstanceListener",
"}",
"about",
"the",
"dead",
"instance",
".... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/InstanceManager.java#L201-L225 |
apereo/cas | support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java | OAuth20Utils.produceErrorView | public static ModelAndView produceErrorView(final Exception e) {
"""
Produce error view model and view.
@param e the e
@return the model and view
"""
return new ModelAndView(OAuth20Constants.ERROR_VIEW, CollectionUtils.wrap("rootCauseException", e));
} | java | public static ModelAndView produceErrorView(final Exception e) {
return new ModelAndView(OAuth20Constants.ERROR_VIEW, CollectionUtils.wrap("rootCauseException", e));
} | [
"public",
"static",
"ModelAndView",
"produceErrorView",
"(",
"final",
"Exception",
"e",
")",
"{",
"return",
"new",
"ModelAndView",
"(",
"OAuth20Constants",
".",
"ERROR_VIEW",
",",
"CollectionUtils",
".",
"wrap",
"(",
"\"rootCauseException\"",
",",
"e",
")",
")",
... | Produce error view model and view.
@param e the e
@return the model and view | [
"Produce",
"error",
"view",
"model",
"and",
"view",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java#L164-L166 |
facebookarchive/hadoop-20 | src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyUgiManager.java | ProxyUgiManager.getUgi | private static UnixUserGroupInformation getUgi(String userName)
throws IOException {
"""
Get the ugi for a user by running shell command "id -Gn"
@param userName name of the user
@return ugi of the user
@throws IOException if encounter any error while running the command
"""
if (userName == null... | java | private static UnixUserGroupInformation getUgi(String userName)
throws IOException {
if (userName == null || !USERNAME_PATTERN.matcher(userName).matches())
throw new IOException("Invalid username=" + userName);
String[] cmd = new String[] { "bash", "-c", "id -Gn '" + userName + "'"};
String[] gr... | [
"private",
"static",
"UnixUserGroupInformation",
"getUgi",
"(",
"String",
"userName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"userName",
"==",
"null",
"||",
"!",
"USERNAME_PATTERN",
".",
"matcher",
"(",
"userName",
")",
".",
"matches",
"(",
")",
")",
... | Get the ugi for a user by running shell command "id -Gn"
@param userName name of the user
@return ugi of the user
@throws IOException if encounter any error while running the command | [
"Get",
"the",
"ugi",
"for",
"a",
"user",
"by",
"running",
"shell",
"command",
"id",
"-",
"Gn"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyUgiManager.java#L103-L110 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/container/impl/deployment/StartProcessEngineStep.java | StartProcessEngineStep.configurePlugins | protected void configurePlugins(ProcessEngineConfigurationImpl configuration, ProcessEngineXml processEngineXml, ClassLoader classLoader) {
"""
<p>Instantiates and applies all {@link ProcessEnginePlugin}s defined in the processEngineXml
"""
for (ProcessEnginePluginXml pluginXml : processEngineXml.getPlugi... | java | protected void configurePlugins(ProcessEngineConfigurationImpl configuration, ProcessEngineXml processEngineXml, ClassLoader classLoader) {
for (ProcessEnginePluginXml pluginXml : processEngineXml.getPlugins()) {
// create plugin instance
Class<? extends ProcessEnginePlugin> pluginClass = loadClass(plu... | [
"protected",
"void",
"configurePlugins",
"(",
"ProcessEngineConfigurationImpl",
"configuration",
",",
"ProcessEngineXml",
"processEngineXml",
",",
"ClassLoader",
"classLoader",
")",
"{",
"for",
"(",
"ProcessEnginePluginXml",
"pluginXml",
":",
"processEngineXml",
".",
"getPl... | <p>Instantiates and applies all {@link ProcessEnginePlugin}s defined in the processEngineXml | [
"<p",
">",
"Instantiates",
"and",
"applies",
"all",
"{"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/container/impl/deployment/StartProcessEngineStep.java#L133-L148 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/util/XMLContentHandler.java | XMLContentHandler.characters | @Override
public void characters(final char[] chr, final int start, final int length) throws SAXException {
"""
Detects text by trimming the effective content of the char array.
"""
final String text = new String(chr).substring(start, start + length);
LOG.trace("characters; '{}'", text);
... | java | @Override
public void characters(final char[] chr, final int start, final int length) throws SAXException {
final String text = new String(chr).substring(start, start + length);
LOG.trace("characters; '{}'", text);
final String trimmedText = text.trim();
LOG.info("text: '{}'", trimm... | [
"@",
"Override",
"public",
"void",
"characters",
"(",
"final",
"char",
"[",
"]",
"chr",
",",
"final",
"int",
"start",
",",
"final",
"int",
"length",
")",
"throws",
"SAXException",
"{",
"final",
"String",
"text",
"=",
"new",
"String",
"(",
"chr",
")",
"... | Detects text by trimming the effective content of the char array. | [
"Detects",
"text",
"by",
"trimming",
"the",
"effective",
"content",
"of",
"the",
"char",
"array",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/util/XMLContentHandler.java#L291-L299 |
twitter/cloudhopper-commons | ch-commons-xbean/src/main/java/com/cloudhopper/commons/xbean/util/PropertiesReplacementUtil.java | PropertiesReplacementUtil.loadProperties | static public Properties loadProperties(Properties base, File file) throws IOException {
"""
Loads the given file into a Properties object.
@param base Properties that should override those loaded from the file
@param file The file to load
@return Properties loaded from the file
"""
FileReader reader = new... | java | static public Properties loadProperties(Properties base, File file) throws IOException {
FileReader reader = new FileReader(file);
Properties props = new Properties();
props.load(reader);
if (base != null) props.putAll(base);
reader.close();
return props;
} | [
"static",
"public",
"Properties",
"loadProperties",
"(",
"Properties",
"base",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"FileReader",
"reader",
"=",
"new",
"FileReader",
"(",
"file",
")",
";",
"Properties",
"props",
"=",
"new",
"Properties",
"("... | Loads the given file into a Properties object.
@param base Properties that should override those loaded from the file
@param file The file to load
@return Properties loaded from the file | [
"Loads",
"the",
"given",
"file",
"into",
"a",
"Properties",
"object",
"."
] | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-xbean/src/main/java/com/cloudhopper/commons/xbean/util/PropertiesReplacementUtil.java#L170-L177 |
prestodb/presto | presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloTableManager.java | AccumuloTableManager.ensureNamespace | public void ensureNamespace(String schema) {
"""
Ensures the given Accumulo namespace exist, creating it if necessary
@param schema Presto schema (Accumulo namespace)
"""
try {
// If the table schema is not "default" and the namespace does not exist, create it
if (!schema.equ... | java | public void ensureNamespace(String schema)
{
try {
// If the table schema is not "default" and the namespace does not exist, create it
if (!schema.equals(DEFAULT) && !connector.namespaceOperations().exists(schema)) {
connector.namespaceOperations().create(schema);
... | [
"public",
"void",
"ensureNamespace",
"(",
"String",
"schema",
")",
"{",
"try",
"{",
"// If the table schema is not \"default\" and the namespace does not exist, create it",
"if",
"(",
"!",
"schema",
".",
"equals",
"(",
"DEFAULT",
")",
"&&",
"!",
"connector",
".",
"nam... | Ensures the given Accumulo namespace exist, creating it if necessary
@param schema Presto schema (Accumulo namespace) | [
"Ensures",
"the",
"given",
"Accumulo",
"namespace",
"exist",
"creating",
"it",
"if",
"necessary"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloTableManager.java#L60-L75 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/MathUtils.java | MathUtils.rectangularPrismSurfaceArea | public static double rectangularPrismSurfaceArea(final double length, final double height, final double width) {
"""
Calculates the surface area of a rectangular prism;
@param length a double value indicating the length of the rectangular prism (x axis).
@param height a double value indicating the height of th... | java | public static double rectangularPrismSurfaceArea(final double length, final double height, final double width) {
return ((2 * length * height) + (2 * length * width) + (2 * height * width));
} | [
"public",
"static",
"double",
"rectangularPrismSurfaceArea",
"(",
"final",
"double",
"length",
",",
"final",
"double",
"height",
",",
"final",
"double",
"width",
")",
"{",
"return",
"(",
"(",
"2",
"*",
"length",
"*",
"height",
")",
"+",
"(",
"2",
"*",
"l... | Calculates the surface area of a rectangular prism;
@param length a double value indicating the length of the rectangular prism (x axis).
@param height a double value indicating the height of the rectangular prism (y axis).
@param width a double value indicating the width of the rectangular prism (z axis).
@return the... | [
"Calculates",
"the",
"surface",
"area",
"of",
"a",
"rectangular",
"prism",
";"
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/MathUtils.java#L364-L366 |
apache/incubator-heron | storm-compatibility/src/java/backtype/storm/task/TopologyContext.java | TopologyContext.registerMetric | @SuppressWarnings("unchecked")
public <T extends IMetric> T registerMetric(String name, T metric, int timeBucketSizeInSecs) {
"""
/*
Register a IMetric instance.
Storm will then call getValueAndReset on the metric every timeBucketSizeInSecs
and the returned value is sent to all metrics consumers.
You must ca... | java | @SuppressWarnings("unchecked")
public <T extends IMetric> T registerMetric(String name, T metric, int timeBucketSizeInSecs) {
MetricDelegate d = new MetricDelegate(metric);
delegate.registerMetric(name, d, timeBucketSizeInSecs);
return metric;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"IMetric",
">",
"T",
"registerMetric",
"(",
"String",
"name",
",",
"T",
"metric",
",",
"int",
"timeBucketSizeInSecs",
")",
"{",
"MetricDelegate",
"d",
"=",
"new",
"MetricDelegat... | /*
Register a IMetric instance.
Storm will then call getValueAndReset on the metric every timeBucketSizeInSecs
and the returned value is sent to all metrics consumers.
You must call this during IBolt::prepare or ISpout::open.
@return The IMetric argument unchanged. | [
"/",
"*",
"Register",
"a",
"IMetric",
"instance",
".",
"Storm",
"will",
"then",
"call",
"getValueAndReset",
"on",
"the",
"metric",
"every",
"timeBucketSizeInSecs",
"and",
"the",
"returned",
"value",
"is",
"sent",
"to",
"all",
"metrics",
"consumers",
".",
"You"... | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/storm-compatibility/src/java/backtype/storm/task/TopologyContext.java#L263-L268 |
yatechorg/jedis-utils | src/main/java/org/yatech/jedis/collections/JedisSortedSet.java | JedisSortedSet.addAll | public long addAll(final Map<String, Double> scoredMember) {
"""
Adds to this set all of the elements in the specified map of members and their score.
@param scoredMember the members to add together with their scores
@return the number of members actually added
"""
return doWithJedis(new JedisCallabl... | java | public long addAll(final Map<String, Double> scoredMember) {
return doWithJedis(new JedisCallable<Long>() {
@Override
public Long call(Jedis jedis) {
return jedis.zadd(getKey(), scoredMember);
}
});
} | [
"public",
"long",
"addAll",
"(",
"final",
"Map",
"<",
"String",
",",
"Double",
">",
"scoredMember",
")",
"{",
"return",
"doWithJedis",
"(",
"new",
"JedisCallable",
"<",
"Long",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Long",
"call",
"(",
"Jedis",
... | Adds to this set all of the elements in the specified map of members and their score.
@param scoredMember the members to add together with their scores
@return the number of members actually added | [
"Adds",
"to",
"this",
"set",
"all",
"of",
"the",
"elements",
"in",
"the",
"specified",
"map",
"of",
"members",
"and",
"their",
"score",
"."
] | train | https://github.com/yatechorg/jedis-utils/blob/1951609fa6697df4f69be76e7d66b9284924bd97/src/main/java/org/yatech/jedis/collections/JedisSortedSet.java#L174-L181 |
ixa-ehu/ixa-pipe-pos | src/main/java/eus/ixa/ixa/pipe/lemma/dict/DictionaryLemmatizer.java | DictionaryLemmatizer.apply | public String apply(final String word, final String postag) {
"""
Lookup lemma in a dictionary. Outputs "O" if not found.
@param word the token
@param postag the postag
@return the lemma
"""
String lemma = null;
final List<String> keys = this.getDictKeys(word, postag);
// lookup lemma as value o... | java | public String apply(final String word, final String postag) {
String lemma = null;
final List<String> keys = this.getDictKeys(word, postag);
// lookup lemma as value of the map
final String keyValue = this.dictMap.get(keys);
if (keyValue != null) {
lemma = keyValue;
} else {
lemma = ... | [
"public",
"String",
"apply",
"(",
"final",
"String",
"word",
",",
"final",
"String",
"postag",
")",
"{",
"String",
"lemma",
"=",
"null",
";",
"final",
"List",
"<",
"String",
">",
"keys",
"=",
"this",
".",
"getDictKeys",
"(",
"word",
",",
"postag",
")",... | Lookup lemma in a dictionary. Outputs "O" if not found.
@param word the token
@param postag the postag
@return the lemma | [
"Lookup",
"lemma",
"in",
"a",
"dictionary",
".",
"Outputs",
"O",
"if",
"not",
"found",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/lemma/dict/DictionaryLemmatizer.java#L108-L119 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/ConstantPoolScanner.java | ConstantPoolScanner.accessUtf8 | private String accessUtf8(int cpIndex) {
"""
Return the UTF8 at the specified index in the constant pool. The data found at the constant pool for that index
may not have been unpacked yet if this is the first access of the string. If not unpacked the constant pool entry
is a pair of ints in an array representing... | java | private String accessUtf8(int cpIndex) {
Object object = cpdata[cpIndex];
if (object instanceof String) {
return (String) object;
}
int[] ptrAndLen = (int[]) object;
String value;
try {
value = new String(classbytes, ptrAndLen[0], ptrAndLen[1], "UTF8");
}
catch (UnsupportedEncodingException e) {
... | [
"private",
"String",
"accessUtf8",
"(",
"int",
"cpIndex",
")",
"{",
"Object",
"object",
"=",
"cpdata",
"[",
"cpIndex",
"]",
";",
"if",
"(",
"object",
"instanceof",
"String",
")",
"{",
"return",
"(",
"String",
")",
"object",
";",
"}",
"int",
"[",
"]",
... | Return the UTF8 at the specified index in the constant pool. The data found at the constant pool for that index
may not have been unpacked yet if this is the first access of the string. If not unpacked the constant pool entry
is a pair of ints in an array representing the offset and length within the classbytes where t... | [
"Return",
"the",
"UTF8",
"at",
"the",
"specified",
"index",
"in",
"the",
"constant",
"pool",
".",
"The",
"data",
"found",
"at",
"the",
"constant",
"pool",
"for",
"that",
"index",
"may",
"not",
"have",
"been",
"unpacked",
"yet",
"if",
"this",
"is",
"the",... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/ConstantPoolScanner.java#L157-L173 |
grpc/grpc-java | examples/example-tls/src/main/java/io/grpc/examples/helloworldtls/HelloWorldClientTls.java | HelloWorldClientTls.main | public static void main(String[] args) throws Exception {
"""
Greet server. If provided, the first element of {@code args} is the name to use in the
greeting.
"""
if (args.length < 2 || args.length == 4 || args.length > 5) {
System.out.println("USAGE: HelloWorldClientTls host port [trustC... | java | public static void main(String[] args) throws Exception {
if (args.length < 2 || args.length == 4 || args.length > 5) {
System.out.println("USAGE: HelloWorldClientTls host port [trustCertCollectionFilePath] " +
"[clientCertChainFilePath clientPrivateKeyFilePath]\n Note: clientC... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"if",
"(",
"args",
".",
"length",
"<",
"2",
"||",
"args",
".",
"length",
"==",
"4",
"||",
"args",
".",
"length",
">",
"5",
")",
"{",
"System",
"... | Greet server. If provided, the first element of {@code args} is the name to use in the
greeting. | [
"Greet",
"server",
".",
"If",
"provided",
"the",
"first",
"element",
"of",
"{"
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/examples/example-tls/src/main/java/io/grpc/examples/helloworldtls/HelloWorldClientTls.java#L103-L137 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java | ItemCounter.getAndSet | public long getAndSet(T item, long value) {
"""
Set counter for item and return previous value
@param item
@param value
@return
"""
MutableLong entry = map.get(item);
if (entry == null) {
entry = MutableLong.valueOf(value);
map.put(item, entry);
total +... | java | public long getAndSet(T item, long value) {
MutableLong entry = map.get(item);
if (entry == null) {
entry = MutableLong.valueOf(value);
map.put(item, entry);
total += value;
return 0;
}
long oldValue = entry.value;
total = total -... | [
"public",
"long",
"getAndSet",
"(",
"T",
"item",
",",
"long",
"value",
")",
"{",
"MutableLong",
"entry",
"=",
"map",
".",
"get",
"(",
"item",
")",
";",
"if",
"(",
"entry",
"==",
"null",
")",
"{",
"entry",
"=",
"MutableLong",
".",
"valueOf",
"(",
"v... | Set counter for item and return previous value
@param item
@param value
@return | [
"Set",
"counter",
"for",
"item",
"and",
"return",
"previous",
"value"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java#L166-L180 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.onSetReadRepairChance | private void onSetReadRepairChance(CfDef cfDef, Properties cfProperties, StringBuilder builder) {
"""
On set read repair chance.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder
"""
String dclocalReadRepairChance = cfProperties.getProperty(CassandraConsta... | java | private void onSetReadRepairChance(CfDef cfDef, Properties cfProperties, StringBuilder builder)
{
String dclocalReadRepairChance = cfProperties.getProperty(CassandraConstants.DCLOCAL_READ_REPAIR_CHANCE);
if (dclocalReadRepairChance != null)
{
try
{
if ... | [
"private",
"void",
"onSetReadRepairChance",
"(",
"CfDef",
"cfDef",
",",
"Properties",
"cfProperties",
",",
"StringBuilder",
"builder",
")",
"{",
"String",
"dclocalReadRepairChance",
"=",
"cfProperties",
".",
"getProperty",
"(",
"CassandraConstants",
".",
"DCLOCAL_READ_R... | On set read repair chance.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder | [
"On",
"set",
"read",
"repair",
"chance",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L2366-L2390 |
gondor/kbop | src/main/java/org/pacesys/kbop/internal/AbstractKeyedObjectPool.java | AbstractKeyedObjectPool.createFuture | protected PoolWaitFuture<E> createFuture(final PoolKey<K> key) {
"""
Creates a Future which will wait for the Keyed Object to become available or timeout
@param key the Pool Key
@return PoolWaitFuture
"""
return new PoolWaitFuture<E>(lock) {
protected E getPoolObject(long timeout, TimeUnit unit) throws ... | java | protected PoolWaitFuture<E> createFuture(final PoolKey<K> key) {
return new PoolWaitFuture<E>(lock) {
protected E getPoolObject(long timeout, TimeUnit unit) throws IOException, InterruptedException, TimeoutException {
return getBlockingUntilAvailableOrTimeout(key, timeout, unit, this);
}
};
} | [
"protected",
"PoolWaitFuture",
"<",
"E",
">",
"createFuture",
"(",
"final",
"PoolKey",
"<",
"K",
">",
"key",
")",
"{",
"return",
"new",
"PoolWaitFuture",
"<",
"E",
">",
"(",
"lock",
")",
"{",
"protected",
"E",
"getPoolObject",
"(",
"long",
"timeout",
","... | Creates a Future which will wait for the Keyed Object to become available or timeout
@param key the Pool Key
@return PoolWaitFuture | [
"Creates",
"a",
"Future",
"which",
"will",
"wait",
"for",
"the",
"Keyed",
"Object",
"to",
"become",
"available",
"or",
"timeout"
] | train | https://github.com/gondor/kbop/blob/a176fd845f1e146610f03a1cb3cb0d661ebf4faa/src/main/java/org/pacesys/kbop/internal/AbstractKeyedObjectPool.java#L89-L95 |
loadimpact/loadimpact-sdk-java | src/main/java/com/loadimpact/util/Parameters.java | Parameters.get | public String get(String key, String defaultValue) {
"""
Returns the value associated with the key, or the given default value.
@param key key to find
@param defaultValue if not found
@return value
"""
String value = parameters.get(key);
return StringUtils.isBlank(value) ? default... | java | public String get(String key, String defaultValue) {
String value = parameters.get(key);
return StringUtils.isBlank(value) ? defaultValue : value;
} | [
"public",
"String",
"get",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"parameters",
".",
"get",
"(",
"key",
")",
";",
"return",
"StringUtils",
".",
"isBlank",
"(",
"value",
")",
"?",
"defaultValue",
":",
"value... | Returns the value associated with the key, or the given default value.
@param key key to find
@param defaultValue if not found
@return value | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"key",
"or",
"the",
"given",
"default",
"value",
"."
] | train | https://github.com/loadimpact/loadimpact-sdk-java/blob/49af80b768c5453266414108b0d30a0fc01b8cef/src/main/java/com/loadimpact/util/Parameters.java#L84-L87 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java | NodeSet.insertNode | public void insertNode(Node n, int pos) {
"""
Insert a node at a given position.
@param n Node to be added
@param pos Offset at which the node is to be inserted,
with 0 being the first position.
@throws RuntimeException thrown if this NodeSet is not of
a mutable type.
"""
if (!m_mutable)
thro... | java | public void insertNode(Node n, int pos)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
insertElementAt(n, pos);
} | [
"public",
"void",
"insertNode",
"(",
"Node",
"n",
",",
"int",
"pos",
")",
"{",
"if",
"(",
"!",
"m_mutable",
")",
"throw",
"new",
"RuntimeException",
"(",
"XSLMessages",
".",
"createXPATHMessage",
"(",
"XPATHErrorResources",
".",
"ER_NODESET_NOT_MUTABLE",
",",
... | Insert a node at a given position.
@param n Node to be added
@param pos Offset at which the node is to be inserted,
with 0 being the first position.
@throws RuntimeException thrown if this NodeSet is not of
a mutable type. | [
"Insert",
"a",
"node",
"at",
"a",
"given",
"position",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java#L397-L404 |
Drivemode/TypefaceHelper | TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java | TypefaceHelper.setTypeface | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public <F extends android.app.Fragment> void setTypeface(F fragment, String typefaceName) {
"""
Set the typeface to the all text views belong to the fragment.
Make sure to call this method after fragment view creation.
If you use fragments in the support package,
call ... | java | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public <F extends android.app.Fragment> void setTypeface(F fragment, String typefaceName) {
setTypeface(fragment, typefaceName, 0);
} | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"public",
"<",
"F",
"extends",
"android",
".",
"app",
".",
"Fragment",
">",
"void",
"setTypeface",
"(",
"F",
"fragment",
",",
"String",
"typefaceName",
")",
"{",
"setTypeface",
"(... | Set the typeface to the all text views belong to the fragment.
Make sure to call this method after fragment view creation.
If you use fragments in the support package,
call {@link com.drivemode.android.typeface.TypefaceHelper#supportSetTypeface(android.support.v4.app.Fragment, String)} instead.
@param fragment the frag... | [
"Set",
"the",
"typeface",
"to",
"the",
"all",
"text",
"views",
"belong",
"to",
"the",
"fragment",
".",
"Make",
"sure",
"to",
"call",
"this",
"method",
"after",
"fragment",
"view",
"creation",
".",
"If",
"you",
"use",
"fragments",
"in",
"the",
"support",
... | train | https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java#L359-L362 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java | TemplateVariableManager.generateTableEntries | void generateTableEntries(CodeBuilder ga) {
"""
Write a local variable table entry for every registered variable.
"""
for (Variable var : allVariables) {
try {
var.local.tableEntry(ga);
} catch (Throwable t) {
throw new RuntimeException("unable to write table entry for: " + var.... | java | void generateTableEntries(CodeBuilder ga) {
for (Variable var : allVariables) {
try {
var.local.tableEntry(ga);
} catch (Throwable t) {
throw new RuntimeException("unable to write table entry for: " + var.local, t);
}
}
} | [
"void",
"generateTableEntries",
"(",
"CodeBuilder",
"ga",
")",
"{",
"for",
"(",
"Variable",
"var",
":",
"allVariables",
")",
"{",
"try",
"{",
"var",
".",
"local",
".",
"tableEntry",
"(",
"ga",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
... | Write a local variable table entry for every registered variable. | [
"Write",
"a",
"local",
"variable",
"table",
"entry",
"for",
"every",
"registered",
"variable",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java#L415-L423 |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java | VisualizeImageData.regionBorders | public static void regionBorders( GrayS32 pixelToRegion , int borderColor ,
Bitmap output , byte[] storage) {
"""
Draws border pixels of each region using the specified color.
@param pixelToRegion Conversion from pixel to region
@param borderColor RGB value of border pixel
@param output Where the o... | java | public static void regionBorders( GrayS32 pixelToRegion , int borderColor ,
Bitmap output , byte[] storage) {
if( storage == null )
storage = declareStorage(output,null);
GrayU8 binary = new GrayU8(pixelToRegion.width,pixelToRegion.height);
ImageSegmentationOps.markRegionBorders(pixelToRegion, bina... | [
"public",
"static",
"void",
"regionBorders",
"(",
"GrayS32",
"pixelToRegion",
",",
"int",
"borderColor",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"if",
"(",
"storage",
"==",
"null",
")",
"storage",
"=",
"declareStorage",
"(",
"o... | Draws border pixels of each region using the specified color.
@param pixelToRegion Conversion from pixel to region
@param borderColor RGB value of border pixel
@param output Where the output is written to
@param storage Optional working buffer for Bitmap image. Can be null. | [
"Draws",
"border",
"pixels",
"of",
"each",
"region",
"using",
"the",
"specified",
"color",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java#L584-L606 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.