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 |
|---|---|---|---|---|---|---|---|---|---|---|
SG-O/miIO | src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java | Vacuum.installSoundpack | public VacuumSounpackInstallState installSoundpack(String url, String md5, int soundId) throws CommandExecutionException {
"""
Install a new soundpack to the device.
@param url The url the soundpack should be downloaded from.
@param md5 The md5 checksum of the new soundpack.
@param soundId The ID of the soundpa... | java | public VacuumSounpackInstallState installSoundpack(String url, String md5, int soundId) throws CommandExecutionException {
if (url == null || md5 == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
JSONObject install = new JSONObject();
install.put("... | [
"public",
"VacuumSounpackInstallState",
"installSoundpack",
"(",
"String",
"url",
",",
"String",
"md5",
",",
"int",
"soundId",
")",
"throws",
"CommandExecutionException",
"{",
"if",
"(",
"url",
"==",
"null",
"||",
"md5",
"==",
"null",
")",
"throw",
"new",
"Com... | Install a new soundpack to the device.
@param url The url the soundpack should be downloaded from.
@param md5 The md5 checksum of the new soundpack.
@param soundId The ID of the soundpacks language.
@return The current installation status.
@throws CommandExecutionException When there has been a error during the communi... | [
"Install",
"a",
"new",
"soundpack",
"to",
"the",
"device",
"."
] | train | https://github.com/SG-O/miIO/blob/f352dbd2a699d2cdb1b412ca5e6cbb0c38ca779b/src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java#L517-L526 |
zaproxy/zaproxy | src/org/zaproxy/zap/spider/URLCanonicalizer.java | URLCanonicalizer.buildCleanedParametersURIRepresentation | public static String buildCleanedParametersURIRepresentation(org.apache.commons.httpclient.URI uri,
SpiderParam.HandleParametersOption handleParameters, boolean handleODataParametersVisited) throws URIException {
"""
Builds a String representation of the URI with cleaned parameters, that can be used when checki... | java | public static String buildCleanedParametersURIRepresentation(org.apache.commons.httpclient.URI uri,
SpiderParam.HandleParametersOption handleParameters, boolean handleODataParametersVisited) throws URIException {
// If the option is set to use all the information, just use the default string representation
if (h... | [
"public",
"static",
"String",
"buildCleanedParametersURIRepresentation",
"(",
"org",
".",
"apache",
".",
"commons",
".",
"httpclient",
".",
"URI",
"uri",
",",
"SpiderParam",
".",
"HandleParametersOption",
"handleParameters",
",",
"boolean",
"handleODataParametersVisited",... | Builds a String representation of the URI with cleaned parameters, that can be used when checking if an
URI was already visited. The URI provided as a parameter should be already cleaned and canonicalized,
so it should be build with a result from {@link #getCanonicalURL(String)}.
<p>
When building the URI representati... | [
"Builds",
"a",
"String",
"representation",
"of",
"the",
"URI",
"with",
"cleaned",
"parameters",
"that",
"can",
"be",
"used",
"when",
"checking",
"if",
"an",
"URI",
"was",
"already",
"visited",
".",
"The",
"URI",
"provided",
"as",
"a",
"parameter",
"should",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/URLCanonicalizer.java#L222-L252 |
alexa/alexa-skills-kit-sdk-for-java | ask-sdk-core/src/com/amazon/ask/response/ResponseBuilder.java | ResponseBuilder.addConfirmSlotDirective | public ResponseBuilder addConfirmSlotDirective(String slotName, Intent updatedIntent) {
"""
Adds a Dialog {@link ConfirmSlotDirective} to the response.
@param slotName name of slot to elicit
@param updatedIntent updated intent
@return response builder
"""
ConfirmSlotDirective confirmSlotDirective ... | java | public ResponseBuilder addConfirmSlotDirective(String slotName, Intent updatedIntent) {
ConfirmSlotDirective confirmSlotDirective = ConfirmSlotDirective.builder()
.withSlotToConfirm(slotName)
.withUpdatedIntent(updatedIntent)
.build();
return addDirective(... | [
"public",
"ResponseBuilder",
"addConfirmSlotDirective",
"(",
"String",
"slotName",
",",
"Intent",
"updatedIntent",
")",
"{",
"ConfirmSlotDirective",
"confirmSlotDirective",
"=",
"ConfirmSlotDirective",
".",
"builder",
"(",
")",
".",
"withSlotToConfirm",
"(",
"slotName",
... | Adds a Dialog {@link ConfirmSlotDirective} to the response.
@param slotName name of slot to elicit
@param updatedIntent updated intent
@return response builder | [
"Adds",
"a",
"Dialog",
"{",
"@link",
"ConfirmSlotDirective",
"}",
"to",
"the",
"response",
"."
] | train | https://github.com/alexa/alexa-skills-kit-sdk-for-java/blob/c49194da0693898c70f3f2c4a372f5a12da04e3e/ask-sdk-core/src/com/amazon/ask/response/ResponseBuilder.java#L302-L308 |
SvenEwald/xmlbeam | src/main/java/org/xmlbeam/ProjectionInvocationHandler.java | ProjectionInvocationHandler.findTargetComponentType | private static Class<?> findTargetComponentType(final Method method) {
"""
When reading collections, determine the collection component type.
@param method
@return
"""
final Class<?> returnType = method.getReturnType();
if (returnType.isArray()) {
return method.getReturnType().g... | java | private static Class<?> findTargetComponentType(final Method method) {
final Class<?> returnType = method.getReturnType();
if (returnType.isArray()) {
return method.getReturnType().getComponentType();
}
if (!(List.class.equals(returnType) || (Map.class.equals(returnType)) ||... | [
"private",
"static",
"Class",
"<",
"?",
">",
"findTargetComponentType",
"(",
"final",
"Method",
"method",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"returnType",
"=",
"method",
".",
"getReturnType",
"(",
")",
";",
"if",
"(",
"returnType",
".",
"isArray",
... | When reading collections, determine the collection component type.
@param method
@return | [
"When",
"reading",
"collections",
"determine",
"the",
"collection",
"component",
"type",
"."
] | train | https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/ProjectionInvocationHandler.java#L921-L942 |
lamydev/Android-Notification | core/src/zemin/notification/NotificationRemote.java | NotificationRemote.getActionIntent | public PendingIntent getActionIntent(NotificationEntry entry, NotificationEntry.Action act) {
"""
Create an PendingIntent to be fired when the notification action is invoked.
@see android.app.Notification#addAction(int, CharSequence, PendingIntent)
@param entry
@param act
@return PendingIntent
"""
... | java | public PendingIntent getActionIntent(NotificationEntry entry, NotificationEntry.Action act) {
Intent intent = new Intent(ACTION_ACTION);
intent.putExtra(KEY_ENTRY_ID, entry.ID);
intent.putExtra(KEY_ACTION_ID, entry.mActions.indexOf(act));
return PendingIntent.getBroadcast(mContext, genId... | [
"public",
"PendingIntent",
"getActionIntent",
"(",
"NotificationEntry",
"entry",
",",
"NotificationEntry",
".",
"Action",
"act",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"ACTION_ACTION",
")",
";",
"intent",
".",
"putExtra",
"(",
"KEY_ENTRY_ID",
"... | Create an PendingIntent to be fired when the notification action is invoked.
@see android.app.Notification#addAction(int, CharSequence, PendingIntent)
@param entry
@param act
@return PendingIntent | [
"Create",
"an",
"PendingIntent",
"to",
"be",
"fired",
"when",
"the",
"notification",
"action",
"is",
"invoked",
"."
] | train | https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationRemote.java#L158-L163 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/training/CenterLossOutputLayer.java | CenterLossOutputLayer.computeScoreForExamples | @Override
public INDArray computeScoreForExamples(double fullNetRegTerm, LayerWorkspaceMgr workspaceMgr) {
"""
Compute the score for each example individually, after labels and input have been set.
@param fullNetRegTerm Regularization term for the entire network (or, 0.0 to not include regularization)
@ret... | java | @Override
public INDArray computeScoreForExamples(double fullNetRegTerm, LayerWorkspaceMgr workspaceMgr) {
if (input == null || labels == null)
throw new IllegalStateException("Cannot calculate score without input and labels " + layerId());
INDArray preOut = preOutput2d(false, workspaceM... | [
"@",
"Override",
"public",
"INDArray",
"computeScoreForExamples",
"(",
"double",
"fullNetRegTerm",
",",
"LayerWorkspaceMgr",
"workspaceMgr",
")",
"{",
"if",
"(",
"input",
"==",
"null",
"||",
"labels",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"("... | Compute the score for each example individually, after labels and input have been set.
@param fullNetRegTerm Regularization term for the entire network (or, 0.0 to not include regularization)
@return A column INDArray of shape [numExamples,1], where entry i is the score of the ith example | [
"Compute",
"the",
"score",
"for",
"each",
"example",
"individually",
"after",
"labels",
"and",
"input",
"have",
"been",
"set",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/training/CenterLossOutputLayer.java#L103-L124 |
Talend/tesb-rt-se | examples/tesb/rent-a-car/app-reservation/src/main/java/org/talend/esb/client/app/CarRentalClientGui.java | CarRentalClientGui.createAndShowGUI | private static void createAndShowGUI(CarSearchModel searchModel, CarReserveModel reserveModel) {
"""
Create the GUI and show it. For thread safety,
this method should be invoked from the
event-dispatching thread.
"""
//Create and set up the window.
JFrame appFrame = new JFrame(Messages.CarRe... | java | private static void createAndShowGUI(CarSearchModel searchModel, CarReserveModel reserveModel) {
//Create and set up the window.
JFrame appFrame = new JFrame(Messages.CarRentalClient_Title);
appFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
// Display the window centered on th... | [
"private",
"static",
"void",
"createAndShowGUI",
"(",
"CarSearchModel",
"searchModel",
",",
"CarReserveModel",
"reserveModel",
")",
"{",
"//Create and set up the window.",
"JFrame",
"appFrame",
"=",
"new",
"JFrame",
"(",
"Messages",
".",
"CarRentalClient_Title",
")",
";... | Create the GUI and show it. For thread safety,
this method should be invoked from the
event-dispatching thread. | [
"Create",
"the",
"GUI",
"and",
"show",
"it",
".",
"For",
"thread",
"safety",
"this",
"method",
"should",
"be",
"invoked",
"from",
"the",
"event",
"-",
"dispatching",
"thread",
"."
] | train | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/examples/tesb/rent-a-car/app-reservation/src/main/java/org/talend/esb/client/app/CarRentalClientGui.java#L455-L471 |
Waikato/moa | moa/src/main/java/moa/classifiers/meta/AccuracyUpdatedEnsemble.java | AccuracyUpdatedEnsemble.computeMse | protected double computeMse(Classifier learner, Instances chunk) {
"""
Computes the MSE of a learner for a given chunk of examples.
@param learner classifier to compute error
@param chunk chunk of examples
@return the computed error.
"""
double mse_i = 0;
double f_ci;
double voteSum;
for (in... | java | protected double computeMse(Classifier learner, Instances chunk) {
double mse_i = 0;
double f_ci;
double voteSum;
for (int i = 0; i < chunk.numInstances(); i++) {
try {
voteSum = 0;
for (double element : learner.getVotesForInstance(chunk.instance(i))) {
voteSum += element;
}
... | [
"protected",
"double",
"computeMse",
"(",
"Classifier",
"learner",
",",
"Instances",
"chunk",
")",
"{",
"double",
"mse_i",
"=",
"0",
";",
"double",
"f_ci",
";",
"double",
"voteSum",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"chunk",
".",
... | Computes the MSE of a learner for a given chunk of examples.
@param learner classifier to compute error
@param chunk chunk of examples
@return the computed error. | [
"Computes",
"the",
"MSE",
"of",
"a",
"learner",
"for",
"a",
"given",
"chunk",
"of",
"examples",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/meta/AccuracyUpdatedEnsemble.java#L251-L279 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/Assert.java | Assert.checkNonNull | public static <T> T checkNonNull(T t, Supplier<String> msg) {
"""
Equivalent to
assert (o != null) : msg.get();
Note: message string is computed lazily.
"""
if (t == null)
error(msg.get());
return t;
} | java | public static <T> T checkNonNull(T t, Supplier<String> msg) {
if (t == null)
error(msg.get());
return t;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"checkNonNull",
"(",
"T",
"t",
",",
"Supplier",
"<",
"String",
">",
"msg",
")",
"{",
"if",
"(",
"t",
"==",
"null",
")",
"error",
"(",
"msg",
".",
"get",
"(",
")",
")",
";",
"return",
"t",
";",
"}"
] | Equivalent to
assert (o != null) : msg.get();
Note: message string is computed lazily. | [
"Equivalent",
"to",
"assert",
"(",
"o",
"!",
"=",
"null",
")",
":",
"msg",
".",
"get",
"()",
";",
"Note",
":",
"message",
"string",
"is",
"computed",
"lazily",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Assert.java#L145-L149 |
colin-lee/mybatis-spring-support | src/main/java/com/github/mybatis/util/UnicodeFormatter.java | UnicodeFormatter.toInt | private static int toInt(String str, int defaultVal) {
"""
字符串转换为int,避免运行时异常
@param str 待处理字符串
@param defaultVal 默认值
@return 转换失败返回指定默认值
"""
try {
return Integer.parseInt(str.trim());
} catch (Exception e) {
return defaultVal;
}
} | java | private static int toInt(String str, int defaultVal) {
try {
return Integer.parseInt(str.trim());
} catch (Exception e) {
return defaultVal;
}
} | [
"private",
"static",
"int",
"toInt",
"(",
"String",
"str",
",",
"int",
"defaultVal",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"str",
".",
"trim",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"... | 字符串转换为int,避免运行时异常
@param str 待处理字符串
@param defaultVal 默认值
@return 转换失败返回指定默认值 | [
"字符串转换为int,避免运行时异常"
] | train | https://github.com/colin-lee/mybatis-spring-support/blob/de412e98d00e9a012c0619778fa1a61832863b82/src/main/java/com/github/mybatis/util/UnicodeFormatter.java#L137-L143 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.lookupPrincipal | public I_CmsPrincipal lookupPrincipal(CmsDbContext dbc, CmsUUID principalId) {
"""
Lookup and read the user or group with the given UUID.<p>
@param dbc the current database context
@param principalId the UUID of the principal to lookup
@return the principal (group or user) if found, otherwise <code>null</co... | java | public I_CmsPrincipal lookupPrincipal(CmsDbContext dbc, CmsUUID principalId) {
try {
CmsGroup group = getUserDriver(dbc).readGroup(dbc, principalId);
if (group != null) {
return group;
}
} catch (Exception e) {
// ignore this exception
... | [
"public",
"I_CmsPrincipal",
"lookupPrincipal",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUUID",
"principalId",
")",
"{",
"try",
"{",
"CmsGroup",
"group",
"=",
"getUserDriver",
"(",
"dbc",
")",
".",
"readGroup",
"(",
"dbc",
",",
"principalId",
")",
";",
"if",
"(",... | Lookup and read the user or group with the given UUID.<p>
@param dbc the current database context
@param principalId the UUID of the principal to lookup
@return the principal (group or user) if found, otherwise <code>null</code> | [
"Lookup",
"and",
"read",
"the",
"user",
"or",
"group",
"with",
"the",
"given",
"UUID",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L5640-L5661 |
realtime-framework/RealtimeMessaging-Java | library/src/main/java/ibt/ortc/api/Strings.java | Strings.randomString | public static String randomString(int length) {
"""
Generates a random alphanumeric string
@param length Number of characters the random string contains
@return String with the specified length
"""
// CAUSE: If-Else Statements Should Use Braces
if (length < 1) {
throw new IllegalA... | java | public static String randomString(int length) {
// CAUSE: If-Else Statements Should Use Braces
if (length < 1) {
throw new IllegalArgumentException(String.format("length < 1: %s", length));
}
char[] buf = new char[length];
return nextString(buf);
} | [
"public",
"static",
"String",
"randomString",
"(",
"int",
"length",
")",
"{",
"// CAUSE: If-Else Statements Should Use Braces",
"if",
"(",
"length",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"length < 1: %s\... | Generates a random alphanumeric string
@param length Number of characters the random string contains
@return String with the specified length | [
"Generates",
"a",
"random",
"alphanumeric",
"string"
] | train | https://github.com/realtime-framework/RealtimeMessaging-Java/blob/cae0dfd01567a2d9e55a0849c0c9b09ad4b2cc08/library/src/main/java/ibt/ortc/api/Strings.java#L49-L58 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br_broker/br_broker_snmpmanager.java | br_broker_snmpmanager.addmanager | public static br_broker_snmpmanager addmanager(nitro_service client, br_broker_snmpmanager resource) throws Exception {
"""
<pre>
Use this operation to add snmp manager to Repeater.
</pre>
"""
return ((br_broker_snmpmanager[]) resource.perform_operation(client, "addmanager"))[0];
} | java | public static br_broker_snmpmanager addmanager(nitro_service client, br_broker_snmpmanager resource) throws Exception
{
return ((br_broker_snmpmanager[]) resource.perform_operation(client, "addmanager"))[0];
} | [
"public",
"static",
"br_broker_snmpmanager",
"addmanager",
"(",
"nitro_service",
"client",
",",
"br_broker_snmpmanager",
"resource",
")",
"throws",
"Exception",
"{",
"return",
"(",
"(",
"br_broker_snmpmanager",
"[",
"]",
")",
"resource",
".",
"perform_operation",
"(",... | <pre>
Use this operation to add snmp manager to Repeater.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"add",
"snmp",
"manager",
"to",
"Repeater",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br_broker/br_broker_snmpmanager.java#L147-L150 |
actframework/actframework | src/main/java/act/inject/param/ParamValueLoaderService.java | ParamValueLoaderService.findHandlerMethodAnnotation | private ParamValueLoader findHandlerMethodAnnotation(final Class<? extends Annotation> annoType, ActContext<?> ctx) {
"""
Returns a `ParamValueLoader` that load annotation from:
* the handler method
* the current method (might be a intercepter method)
@param annoType
the annotation type
@param ctx
the curr... | java | private ParamValueLoader findHandlerMethodAnnotation(final Class<? extends Annotation> annoType, ActContext<?> ctx) {
if (null == ctx) {
return ParamValueLoader.NIL;
}
return new ParamValueLoader.NonCacheable() {
@Override
public Object load(Object bean, ActCo... | [
"private",
"ParamValueLoader",
"findHandlerMethodAnnotation",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annoType",
",",
"ActContext",
"<",
"?",
">",
"ctx",
")",
"{",
"if",
"(",
"null",
"==",
"ctx",
")",
"{",
"return",
"ParamValueLoader",
... | Returns a `ParamValueLoader` that load annotation from:
* the handler method
* the current method (might be a intercepter method)
@param annoType
the annotation type
@param ctx
the current {@link ActContext}
@return a `ParamValueLoader` instance | [
"Returns",
"a",
"ParamValueLoader",
"that",
"load",
"annotation",
"from",
":",
"*",
"the",
"handler",
"method",
"*",
"the",
"current",
"method",
"(",
"might",
"be",
"a",
"intercepter",
"method",
")"
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/inject/param/ParamValueLoaderService.java#L402-L420 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java | ClassHash.setMethodHash | public void setMethodHash(XMethod method, byte[] methodHash) {
"""
Set method hash for given method.
@param method
the method
@param methodHash
the method hash
"""
methodHashMap.put(method, new MethodHash(method.getName(), method.getSignature(), method.isStatic(), methodHash));
} | java | public void setMethodHash(XMethod method, byte[] methodHash) {
methodHashMap.put(method, new MethodHash(method.getName(), method.getSignature(), method.isStatic(), methodHash));
} | [
"public",
"void",
"setMethodHash",
"(",
"XMethod",
"method",
",",
"byte",
"[",
"]",
"methodHash",
")",
"{",
"methodHashMap",
".",
"put",
"(",
"method",
",",
"new",
"MethodHash",
"(",
"method",
".",
"getName",
"(",
")",
",",
"method",
".",
"getSignature",
... | Set method hash for given method.
@param method
the method
@param methodHash
the method hash | [
"Set",
"method",
"hash",
"for",
"given",
"method",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java#L93-L95 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/convert/RadioConverter.java | RadioConverter.init | public void init(Converter converter, Object objTarget, boolean bTrueIfMatch) {
"""
Constructor.
@param converter The next converter in the converter chain.
@param strTarget If the radio button is set, set this converter to this target string.
@param bTrueIfMatch If true, sets value on setState(true), otherwise... | java | public void init(Converter converter, Object objTarget, boolean bTrueIfMatch)
{
super.init(converter, null, null);
m_objTarget = objTarget;
m_bTrueIfMatch = bTrueIfMatch;
} | [
"public",
"void",
"init",
"(",
"Converter",
"converter",
",",
"Object",
"objTarget",
",",
"boolean",
"bTrueIfMatch",
")",
"{",
"super",
".",
"init",
"(",
"converter",
",",
"null",
",",
"null",
")",
";",
"m_objTarget",
"=",
"objTarget",
";",
"m_bTrueIfMatch",... | Constructor.
@param converter The next converter in the converter chain.
@param strTarget If the radio button is set, set this converter to this target string.
@param bTrueIfMatch If true, sets value on setState(true), otherwise sets it to blank. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/RadioConverter.java#L60-L65 |
jbundle/jbundle | thin/base/thread/src/main/java/org/jbundle/thin/base/thread/TaskScheduler.java | TaskScheduler.startPageWorker | public static SyncWorker startPageWorker(SyncPage syncPage, SyncNotify syncNotify, Runnable swingPageLoader, Map<String,Object> map, boolean bManageCursor) {
"""
Start a task that calls the syncNotify 'done' method when the screen is done displaying.
This class is a platform-neutral implementation of SwinSyncPage... | java | public static SyncWorker startPageWorker(SyncPage syncPage, SyncNotify syncNotify, Runnable swingPageLoader, Map<String,Object> map, boolean bManageCursor)
{
SyncWorker syncWorker = (SyncWorker)ClassServiceUtility.getClassService().makeObjectFromClassName(JAVA_WORKER);
if (syncWorker == null)
... | [
"public",
"static",
"SyncWorker",
"startPageWorker",
"(",
"SyncPage",
"syncPage",
",",
"SyncNotify",
"syncNotify",
",",
"Runnable",
"swingPageLoader",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"boolean",
"bManageCursor",
")",
"{",
"SyncWorker",
... | Start a task that calls the syncNotify 'done' method when the screen is done displaying.
This class is a platform-neutral implementation of SwinSyncPageWorker that
guarantees a page has displayed before doing a compute-intensive task. | [
"Start",
"a",
"task",
"that",
"calls",
"the",
"syncNotify",
"done",
"method",
"when",
"the",
"screen",
"is",
"done",
"displaying",
".",
"This",
"class",
"is",
"a",
"platform",
"-",
"neutral",
"implementation",
"of",
"SwinSyncPageWorker",
"that",
"guarantees",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/thread/src/main/java/org/jbundle/thin/base/thread/TaskScheduler.java#L279-L292 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.findMap | public @NotNull <K,V> Map<K, V> findMap(@NotNull Class<K> keyType,
@NotNull Class<V> valueType,
@NotNull SqlQuery query) {
"""
Executes a query that returns at least two values and creates a map from the results,
using the first value as the ke... | java | public @NotNull <K,V> Map<K, V> findMap(@NotNull Class<K> keyType,
@NotNull Class<V> valueType,
@NotNull SqlQuery query) {
return executeQuery(new MapResultSetProcessor<>(keyType, valueType, instantiatorRegistry), query);
} | [
"public",
"@",
"NotNull",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"findMap",
"(",
"@",
"NotNull",
"Class",
"<",
"K",
">",
"keyType",
",",
"@",
"NotNull",
"Class",
"<",
"V",
">",
"valueType",
",",
"@",
"NotNull",
"SqlQuery",
"quer... | Executes a query that returns at least two values and creates a map from the results,
using the first value as the key and rest of the values for instantiating {@code V}.
<p>If the keys of the result are not distinct, the result contains the last binding of given key. | [
"Executes",
"a",
"query",
"that",
"returns",
"at",
"least",
"two",
"values",
"and",
"creates",
"a",
"map",
"from",
"the",
"results",
"using",
"the",
"first",
"value",
"as",
"the",
"key",
"and",
"rest",
"of",
"the",
"values",
"for",
"instantiating",
"{",
... | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L563-L567 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CSVUtil.java | CSVUtil.importCSV | @SuppressWarnings("rawtypes")
public static <E extends Exception> long importCSV(final InputStream is, long offset, final long count, final Try.Predicate<String[], E> filter,
final PreparedStatement stmt, final int batchSize, final int batchInterval, final Map<String, ? extends Type> columnTypeMap)
... | java | @SuppressWarnings("rawtypes")
public static <E extends Exception> long importCSV(final InputStream is, long offset, final long count, final Try.Predicate<String[], E> filter,
final PreparedStatement stmt, final int batchSize, final int batchInterval, final Map<String, ? extends Type> columnTypeMap)
... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"<",
"E",
"extends",
"Exception",
">",
"long",
"importCSV",
"(",
"final",
"InputStream",
"is",
",",
"long",
"offset",
",",
"final",
"long",
"count",
",",
"final",
"Try",
".",
"Predicate",... | Imports the data from CSV to database.
@param is
@param offset
@param count
@param filter
@param stmt the column order in the sql must be consistent with the column order in the CSV file.
@param batchSize
@param batchInterval
@param columnTypeMap
@return | [
"Imports",
"the",
"data",
"from",
"CSV",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L1406-L1412 |
Netflix/conductor | grpc-client/src/main/java/com/netflix/conductor/client/grpc/WorkflowClient.java | WorkflowClient.skipTaskFromWorkflow | public void skipTaskFromWorkflow(String workflowId, String taskReferenceName) {
"""
Skips a given task from a current RUNNING workflow
@param workflowId the id of the workflow instance
@param taskReferenceName the reference name of the task to be skipped
"""
Preconditions.checkArgument(Strin... | java | public void skipTaskFromWorkflow(String workflowId, String taskReferenceName) {
Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
Preconditions.checkArgument(StringUtils.isNotBlank(taskReferenceName), "Task reference name cannot be blank");
stub.skip... | [
"public",
"void",
"skipTaskFromWorkflow",
"(",
"String",
"workflowId",
",",
"String",
"taskReferenceName",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"workflowId",
")",
",",
"\"workflow id cannot be blank\"",
")",
";",... | Skips a given task from a current RUNNING workflow
@param workflowId the id of the workflow instance
@param taskReferenceName the reference name of the task to be skipped | [
"Skips",
"a",
"given",
"task",
"from",
"a",
"current",
"RUNNING",
"workflow"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/grpc-client/src/main/java/com/netflix/conductor/client/grpc/WorkflowClient.java#L188-L196 |
lindar-open/well-rested-client | src/main/java/com/lindar/wellrested/WellRestedRequest.java | WellRestedRequest.globalHeaders | public WellRestedRequest globalHeaders(Map<String, String> globalHeaders) {
"""
Use this method to add some global headers to the WellRestedRequest object.
These headers are going to be added on every request you make. <br/>
A good use for this method is setting a global authentication header or a content type h... | java | public WellRestedRequest globalHeaders(Map<String, String> globalHeaders) {
this.globalHeaders = WellRestedUtil.buildHeaders(globalHeaders);
return this;
} | [
"public",
"WellRestedRequest",
"globalHeaders",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"globalHeaders",
")",
"{",
"this",
".",
"globalHeaders",
"=",
"WellRestedUtil",
".",
"buildHeaders",
"(",
"globalHeaders",
")",
";",
"return",
"this",
";",
"}"
] | Use this method to add some global headers to the WellRestedRequest object.
These headers are going to be added on every request you make. <br/>
A good use for this method is setting a global authentication header or a content type header. | [
"Use",
"this",
"method",
"to",
"add",
"some",
"global",
"headers",
"to",
"the",
"WellRestedRequest",
"object",
".",
"These",
"headers",
"are",
"going",
"to",
"be",
"added",
"on",
"every",
"request",
"you",
"make",
".",
"<br",
"/",
">",
"A",
"good",
"use"... | train | https://github.com/lindar-open/well-rested-client/blob/d87542f747cd624e3ce0cdc8230f51836326596b/src/main/java/com/lindar/wellrested/WellRestedRequest.java#L102-L105 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkAssert | private Environment checkAssert(Stmt.Assert stmt, Environment environment, EnclosingScope scope) {
"""
Type check an assertion statement. This requires checking that the expression
being asserted is well-formed and has boolean type. An assert statement can
affect the resulting environment in certain cases, such ... | java | private Environment checkAssert(Stmt.Assert stmt, Environment environment, EnclosingScope scope) {
return checkCondition(stmt.getCondition(), true, environment);
} | [
"private",
"Environment",
"checkAssert",
"(",
"Stmt",
".",
"Assert",
"stmt",
",",
"Environment",
"environment",
",",
"EnclosingScope",
"scope",
")",
"{",
"return",
"checkCondition",
"(",
"stmt",
".",
"getCondition",
"(",
")",
",",
"true",
",",
"environment",
"... | Type check an assertion statement. This requires checking that the expression
being asserted is well-formed and has boolean type. An assert statement can
affect the resulting environment in certain cases, such as when a type test
is assert. For example, after <code>assert x is int</code> the environment
will regard <co... | [
"Type",
"check",
"an",
"assertion",
"statement",
".",
"This",
"requires",
"checking",
"that",
"the",
"expression",
"being",
"asserted",
"is",
"well",
"-",
"formed",
"and",
"has",
"boolean",
"type",
".",
"An",
"assert",
"statement",
"can",
"affect",
"the",
"r... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L353-L355 |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoClientFactory.java | MongoClientFactory.createMongoClient | public MongoClient createMongoClient(MongoClientOptions options) {
"""
Creates a {@link MongoClient} using the given {@code options}. If the environment
contains a {@code local.mongo.port} property, it is used to configure a client to
an embedded MongoDB instance.
@param options the options
@return the Mongo c... | java | public MongoClient createMongoClient(MongoClientOptions options) {
Integer embeddedPort = getEmbeddedPort();
if (embeddedPort != null) {
return createEmbeddedMongoClient(options, embeddedPort);
}
return createNetworkMongoClient(options);
} | [
"public",
"MongoClient",
"createMongoClient",
"(",
"MongoClientOptions",
"options",
")",
"{",
"Integer",
"embeddedPort",
"=",
"getEmbeddedPort",
"(",
")",
";",
"if",
"(",
"embeddedPort",
"!=",
"null",
")",
"{",
"return",
"createEmbeddedMongoClient",
"(",
"options",
... | Creates a {@link MongoClient} using the given {@code options}. If the environment
contains a {@code local.mongo.port} property, it is used to configure a client to
an embedded MongoDB instance.
@param options the options
@return the Mongo client | [
"Creates",
"a",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoClientFactory.java#L62-L68 |
lessthanoptimal/ddogleg | src/org/ddogleg/optimization/math/HessianSchurComplement_DSCC.java | HessianSchurComplement_DSCC.computeHessian | @Override
public void computeHessian(DMatrixSparseCSC jacLeft , DMatrixSparseCSC jacRight) {
"""
Compuets the Hessian in block form
@param jacLeft (Input) Left side of Jacobian
@param jacRight (Input) Right side of Jacobian
"""
A.reshape(jacLeft.numCols,jacLeft.numCols,1);
B.reshape(jacLeft.numCols,jacR... | java | @Override
public void computeHessian(DMatrixSparseCSC jacLeft , DMatrixSparseCSC jacRight) {
A.reshape(jacLeft.numCols,jacLeft.numCols,1);
B.reshape(jacLeft.numCols,jacRight.numCols,1);
D.reshape(jacRight.numCols,jacRight.numCols,1);
// take advantage of the inner product's symmetry when possible to reduce
... | [
"@",
"Override",
"public",
"void",
"computeHessian",
"(",
"DMatrixSparseCSC",
"jacLeft",
",",
"DMatrixSparseCSC",
"jacRight",
")",
"{",
"A",
".",
"reshape",
"(",
"jacLeft",
".",
"numCols",
",",
"jacLeft",
".",
"numCols",
",",
"1",
")",
";",
"B",
".",
"resh... | Compuets the Hessian in block form
@param jacLeft (Input) Left side of Jacobian
@param jacRight (Input) Right side of Jacobian | [
"Compuets",
"the",
"Hessian",
"in",
"block",
"form"
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/optimization/math/HessianSchurComplement_DSCC.java#L60-L73 |
roskart/dropwizard-jaxws | dropwizard-jaxws/src/main/java/com/roskart/dropwizard/jaxws/JAXWSBundle.java | JAXWSBundle.publishEndpoint | public Endpoint publishEndpoint(String path, Object service, BasicAuthentication authentication) {
"""
Publish JAX-WS protected endpoint using Dropwizard BasicAuthentication. EndpointBuilder is published relative
to the CXF servlet path.
@param path Relative endpoint path.
@param service Service implementation.... | java | public Endpoint publishEndpoint(String path, Object service, BasicAuthentication authentication) {
return this.publishEndpoint(path, service, authentication, null);
} | [
"public",
"Endpoint",
"publishEndpoint",
"(",
"String",
"path",
",",
"Object",
"service",
",",
"BasicAuthentication",
"authentication",
")",
"{",
"return",
"this",
".",
"publishEndpoint",
"(",
"path",
",",
"service",
",",
"authentication",
",",
"null",
")",
";",... | Publish JAX-WS protected endpoint using Dropwizard BasicAuthentication. EndpointBuilder is published relative
to the CXF servlet path.
@param path Relative endpoint path.
@param service Service implementation.
@param authentication BasicAuthentication implementation.
@return javax.xml.ws.Endpoint
@deprecated Use the {... | [
"Publish",
"JAX",
"-",
"WS",
"protected",
"endpoint",
"using",
"Dropwizard",
"BasicAuthentication",
".",
"EndpointBuilder",
"is",
"published",
"relative",
"to",
"the",
"CXF",
"servlet",
"path",
".",
"@param",
"path",
"Relative",
"endpoint",
"path",
".",
"@param",
... | train | https://github.com/roskart/dropwizard-jaxws/blob/972eb63ba9626f3282d4a1d6127dc2b60b28f2bc/dropwizard-jaxws/src/main/java/com/roskart/dropwizard/jaxws/JAXWSBundle.java#L124-L126 |
zaproxy/zaproxy | src/org/parosproxy/paros/view/WorkbenchPanel.java | WorkbenchPanel.getTabbedSelect | public TabbedPanel2 getTabbedSelect() {
"""
Gets the tabbed panel that has the {@link PanelType#SELECT SELECT} panels.
<p>
Direct access/manipulation of the tabbed panel is discouraged, the changes done to it might be lost while changing
layouts.
@return the tabbed panel of the {@code work} panels, never {@c... | java | public TabbedPanel2 getTabbedSelect() {
if (tabbedSelect == null) {
tabbedSelect = new TabbedPanel2();
tabbedSelect.setPreferredSize(new Dimension(200, 400));
tabbedSelect.setName("tabbedSelect");
tabbedSelect.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
}
return tabbedSelect;
} | [
"public",
"TabbedPanel2",
"getTabbedSelect",
"(",
")",
"{",
"if",
"(",
"tabbedSelect",
"==",
"null",
")",
"{",
"tabbedSelect",
"=",
"new",
"TabbedPanel2",
"(",
")",
";",
"tabbedSelect",
".",
"setPreferredSize",
"(",
"new",
"Dimension",
"(",
"200",
",",
"400"... | Gets the tabbed panel that has the {@link PanelType#SELECT SELECT} panels.
<p>
Direct access/manipulation of the tabbed panel is discouraged, the changes done to it might be lost while changing
layouts.
@return the tabbed panel of the {@code work} panels, never {@code null}
@see #addPanel(AbstractPanel, PanelType) | [
"Gets",
"the",
"tabbed",
"panel",
"that",
"has",
"the",
"{",
"@link",
"PanelType#SELECT",
"SELECT",
"}",
"panels",
".",
"<p",
">",
"Direct",
"access",
"/",
"manipulation",
"of",
"the",
"tabbed",
"panel",
"is",
"discouraged",
"the",
"changes",
"done",
"to",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L814-L823 |
thorntail/wildfly-config-api | generator/src/main/java/org/wildfly/swarm/config/generator/model/ResourceDescription.java | ResourceDescription.getChildDescription | public ResourceDescription getChildDescription(String type, String name) {
"""
Looks for the description of a specific child resource.
@param type The type of the child resource
@param name The name of the instance
@return the description of the specific child resource or {@link #EMPTY} if no such resource exis... | java | public ResourceDescription getChildDescription(String type, String name) {
if (hasChildrenDefined()) {
List<Property> children = get("children").asPropertyList();
for (Property child : children) {
if (type.equals(child.getName()) && child.getValue().hasDefined(MODEL_DESCR... | [
"public",
"ResourceDescription",
"getChildDescription",
"(",
"String",
"type",
",",
"String",
"name",
")",
"{",
"if",
"(",
"hasChildrenDefined",
"(",
")",
")",
"{",
"List",
"<",
"Property",
">",
"children",
"=",
"get",
"(",
"\"children\"",
")",
".",
"asPrope... | Looks for the description of a specific child resource.
@param type The type of the child resource
@param name The name of the instance
@return the description of the specific child resource or {@link #EMPTY} if no such resource exists. | [
"Looks",
"for",
"the",
"description",
"of",
"a",
"specific",
"child",
"resource",
"."
] | train | https://github.com/thorntail/wildfly-config-api/blob/ddb3f3bcb7b85b22c6371415546f567bc44493db/generator/src/main/java/org/wildfly/swarm/config/generator/model/ResourceDescription.java#L137-L152 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/hadoop/TokenUtils.java | TokenUtils.getHadoopTokens | public static void getHadoopTokens(final State state, Optional<File> tokenFile, Credentials cred)
throws IOException, InterruptedException {
"""
Get Hadoop tokens (tokens for job history server, job tracker and HDFS) using Kerberos keytab.
@param state A {@link State} object that should contain property {... | java | public static void getHadoopTokens(final State state, Optional<File> tokenFile, Credentials cred)
throws IOException, InterruptedException {
Preconditions.checkArgument(state.contains(KEYTAB_USER), "Missing required property " + KEYTAB_USER);
Preconditions.checkArgument(state.contains(KEYTAB_LOCATION), "... | [
"public",
"static",
"void",
"getHadoopTokens",
"(",
"final",
"State",
"state",
",",
"Optional",
"<",
"File",
">",
"tokenFile",
",",
"Credentials",
"cred",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
... | Get Hadoop tokens (tokens for job history server, job tracker and HDFS) using Kerberos keytab.
@param state A {@link State} object that should contain property {@link #USER_TO_PROXY},
{@link #KEYTAB_USER} and {@link #KEYTAB_LOCATION}. To obtain tokens for
other namenodes, use property {@link #OTHER_NAMENODES} with com... | [
"Get",
"Hadoop",
"tokens",
"(",
"tokens",
"for",
"job",
"history",
"server",
"job",
"tracker",
"and",
"HDFS",
")",
"using",
"Kerberos",
"keytab",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/hadoop/TokenUtils.java#L144-L167 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.saveImage | public static void saveImage(BufferedImage img, String fileName) {
"""
Saves the {@link BufferedImage} to the specified file. The image type of the output is determined by
the name's extension. By default the file is saved using {@link ImageIO#write(RenderedImage, String, File)}}
but if that fails then it will... | java | public static void saveImage(BufferedImage img, String fileName) {
try {
String type;
String a[] = fileName.split("[.]");
if (a.length > 0) {
type = a[a.length - 1];
} else {
type = "jpg";
}
if( !ImageIO.write(img, type, new File(fileName)) ) {
if( fileName.endsWith("ppm") || fileName.e... | [
"public",
"static",
"void",
"saveImage",
"(",
"BufferedImage",
"img",
",",
"String",
"fileName",
")",
"{",
"try",
"{",
"String",
"type",
";",
"String",
"a",
"[",
"]",
"=",
"fileName",
".",
"split",
"(",
"\"[.]\"",
")",
";",
"if",
"(",
"a",
".",
"leng... | Saves the {@link BufferedImage} to the specified file. The image type of the output is determined by
the name's extension. By default the file is saved using {@link ImageIO#write(RenderedImage, String, File)}}
but if that fails then it will see if it can save it using BoofCV native code for PPM and PGM.
@param img I... | [
"Saves",
"the",
"{",
"@link",
"BufferedImage",
"}",
"to",
"the",
"specified",
"file",
".",
"The",
"image",
"type",
"of",
"the",
"output",
"is",
"determined",
"by",
"the",
"name",
"s",
"extension",
".",
"By",
"default",
"the",
"file",
"is",
"saved",
"usin... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L151-L174 |
contentful/contentful.java | src/main/java/com/contentful/java/cda/LocalizedResource.java | LocalizedResource.setField | @SuppressWarnings("unchecked")
public void setField(String locale, String key, Object value) {
"""
Internal method for updating contents of a field.
<p>
This method is used by the SDK to generate objects based on raw fields.
<b>Do not use this field to update data on Contentful. Take a look at the CMA-SDK f... | java | @SuppressWarnings("unchecked")
public void setField(String locale, String key, Object value) {
((Map<String, Object>) fields.get(key)).put(locale, value);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"setField",
"(",
"String",
"locale",
",",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"fields",
".",
"get",
"(",
"key"... | Internal method for updating contents of a field.
<p>
This method is used by the SDK to generate objects based on raw fields.
<b>Do not use this field to update data on Contentful. Take a look at the CMA-SDK for that.</b>
@param locale locale to be updated.
@param key the key of the field to be updated.
@param val... | [
"Internal",
"method",
"for",
"updating",
"contents",
"of",
"a",
"field",
".",
"<p",
">",
"This",
"method",
"is",
"used",
"by",
"the",
"SDK",
"to",
"generate",
"objects",
"based",
"on",
"raw",
"fields",
"."
] | train | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/LocalizedResource.java#L102-L105 |
xm-online/xm-commons | xm-commons-config/src/main/java/com/icthh/xm/commons/config/client/repository/kafka/ConfigTopicConsumer.java | ConfigTopicConsumer.consumeEvent | @Retryable(maxAttemptsExpression = "$ {
"""
Consume tenant command event message.
@param message the tenant command event message
"""application.retry.max-attempts}",
backoff = @Backoff(delayExpression = "${application.retry.delay}",
multiplierExpression = "${application.retry.multiplier... | java | @Retryable(maxAttemptsExpression = "${application.retry.max-attempts}",
backoff = @Backoff(delayExpression = "${application.retry.delay}",
multiplierExpression = "${application.retry.multiplier}"))
public void consumeEvent(ConsumerRecord<String, String> message) {
MdcUtils.putRid();
... | [
"@",
"Retryable",
"(",
"maxAttemptsExpression",
"=",
"\"${application.retry.max-attempts}\"",
",",
"backoff",
"=",
"@",
"Backoff",
"(",
"delayExpression",
"=",
"\"${application.retry.delay}\"",
",",
"multiplierExpression",
"=",
"\"${application.retry.multiplier}\"",
")",
")",... | Consume tenant command event message.
@param message the tenant command event message | [
"Consume",
"tenant",
"command",
"event",
"message",
"."
] | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-config/src/main/java/com/icthh/xm/commons/config/client/repository/kafka/ConfigTopicConsumer.java#L32-L51 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesInner.java | InboundNatRulesInner.createOrUpdateAsync | public Observable<InboundNatRuleInner> createOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) {
"""
Creates or updates a load balancer inbound nat rule.
@param resourceGroupName The name of the resource group.
@param loadB... | java | public Observable<InboundNatRuleInner> createOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters... | [
"public",
"Observable",
"<",
"InboundNatRuleInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"loadBalancerName",
",",
"String",
"inboundNatRuleName",
",",
"InboundNatRuleInner",
"inboundNatRuleParameters",
")",
"{",
"return",
"createOrU... | Creates or updates a load balancer inbound nat rule.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param inboundNatRuleName The name of the inbound nat rule.
@param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule o... | [
"Creates",
"or",
"updates",
"a",
"load",
"balancer",
"inbound",
"nat",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesInner.java#L601-L608 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.getDiscussions | public List<GitlabDiscussion> getDiscussions(GitlabMergeRequest mergeRequest) throws IOException {
"""
Get the discussions from a merge request.
<a href="https://docs.gitlab.com/ce/api/discussions.html#list-project-merge-request-discussions">https://docs.gitlab.com/ce/api/discussions.html#list-project-merge-reque... | java | public List<GitlabDiscussion> getDiscussions(GitlabMergeRequest mergeRequest) throws IOException {
String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() +
GitlabMergeRequest.URL + "/" + mergeRequest.getIid() +
GitlabDiscussion.URL;
GitlabDiscussion[] dis... | [
"public",
"List",
"<",
"GitlabDiscussion",
">",
"getDiscussions",
"(",
"GitlabMergeRequest",
"mergeRequest",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"mergeRequest",
".",
"getProjectId",
"(",
")",... | Get the discussions from a merge request.
<a href="https://docs.gitlab.com/ce/api/discussions.html#list-project-merge-request-discussions">https://docs.gitlab.com/ce/api/discussions.html#list-project-merge-request-discussions</a>
@param mergeRequest to fetch the discussions from.
@return The discussions contained in ... | [
"Get",
"the",
"discussions",
"from",
"a",
"merge",
"request",
".",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"gitlab",
".",
"com",
"/",
"ce",
"/",
"api",
"/",
"discussions",
".",
"html#list",
"-",
"project",
"-",
"merge",
"-",
"request",
"-... | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L1729-L1736 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java | JobLeaderService.addJob | public void addJob(final JobID jobId, final String defaultTargetAddress) throws Exception {
"""
Add the given job to be monitored. This means that the service tries to detect leaders for
this job and then tries to establish a connection to it.
@param jobId identifying the job to monitor
@param defaultTargetAd... | java | public void addJob(final JobID jobId, final String defaultTargetAddress) throws Exception {
Preconditions.checkState(JobLeaderService.State.STARTED == state, "The service is currently not running.");
LOG.info("Add job {} for job leader monitoring.", jobId);
final LeaderRetrievalService leaderRetrievalService = ... | [
"public",
"void",
"addJob",
"(",
"final",
"JobID",
"jobId",
",",
"final",
"String",
"defaultTargetAddress",
")",
"throws",
"Exception",
"{",
"Preconditions",
".",
"checkState",
"(",
"JobLeaderService",
".",
"State",
".",
"STARTED",
"==",
"state",
",",
"\"The ser... | Add the given job to be monitored. This means that the service tries to detect leaders for
this job and then tries to establish a connection to it.
@param jobId identifying the job to monitor
@param defaultTargetAddress of the job leader
@throws Exception if an error occurs while starting the leader retrieval service | [
"Add",
"the",
"given",
"job",
"to",
"be",
"monitored",
".",
"This",
"means",
"that",
"the",
"service",
"tries",
"to",
"detect",
"leaders",
"for",
"this",
"job",
"and",
"then",
"tries",
"to",
"establish",
"a",
"connection",
"to",
"it",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java#L190-L209 |
EdwardRaff/JSAT | JSAT/src/jsat/utils/QuickSort.java | QuickSort.swapC | public static void swapC(double[] array, int i, int j) {
"""
Conditional swap, only swaps the values if array[i] > array[j]
@param array the array to potentially swap values in
@param i the 1st index
@param j the 2nd index
"""
double tmp_i= array[i];
double tmp_j = array[j];
... | java | public static void swapC(double[] array, int i, int j)
{
double tmp_i= array[i];
double tmp_j = array[j];
if(tmp_i > tmp_j)
{
array[i] = tmp_j;
array[j] = tmp_i;
}
} | [
"public",
"static",
"void",
"swapC",
"(",
"double",
"[",
"]",
"array",
",",
"int",
"i",
",",
"int",
"j",
")",
"{",
"double",
"tmp_i",
"=",
"array",
"[",
"i",
"]",
";",
"double",
"tmp_j",
"=",
"array",
"[",
"j",
"]",
";",
"if",
"(",
"tmp_i",
">"... | Conditional swap, only swaps the values if array[i] > array[j]
@param array the array to potentially swap values in
@param i the 1st index
@param j the 2nd index | [
"Conditional",
"swap",
"only",
"swaps",
"the",
"values",
"if",
"array",
"[",
"i",
"]",
">",
";",
"array",
"[",
"j",
"]"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/QuickSort.java#L92-L102 |
jbundle/jbundle | thin/base/thread/src/main/java/org/jbundle/thin/base/thread/PrivateTaskScheduler.java | PrivateTaskScheduler.sameJob | public boolean sameJob(AutoTask jobAtIndex, AutoTask jobToAdd) {
"""
Do these two jobs match?
@param propJobAtIndex
@param propJobToAdd
@return
"""
Map<String, Object> propJobAtIndex = jobAtIndex.getProperties();
Map<String, Object> propJobToAdd = jobToAdd.getProperties();
if (propJ... | java | public boolean sameJob(AutoTask jobAtIndex, AutoTask jobToAdd)
{
Map<String, Object> propJobAtIndex = jobAtIndex.getProperties();
Map<String, Object> propJobToAdd = jobToAdd.getProperties();
if (propJobAtIndex.size() != propJobToAdd.size())
return false;
boolean bSameJob... | [
"public",
"boolean",
"sameJob",
"(",
"AutoTask",
"jobAtIndex",
",",
"AutoTask",
"jobToAdd",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"propJobAtIndex",
"=",
"jobAtIndex",
".",
"getProperties",
"(",
")",
";",
"Map",
"<",
"String",
",",
"Object",
"... | Do these two jobs match?
@param propJobAtIndex
@param propJobToAdd
@return | [
"Do",
"these",
"two",
"jobs",
"match?"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/thread/src/main/java/org/jbundle/thin/base/thread/PrivateTaskScheduler.java#L235-L255 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java | CheckArg.isNonNegative | public static void isNonNegative( int argument,
String name ) {
"""
Check that the argument is non-negative (>=0).
@param argument The argument
@param name The name of the argument
@throws IllegalArgumentException If argument is negative (<0)
"""
if (argument ... | java | public static void isNonNegative( int argument,
String name ) {
if (argument < 0) {
throw new IllegalArgumentException(CommonI18n.argumentMayNotBeNegative.text(name, argument));
}
} | [
"public",
"static",
"void",
"isNonNegative",
"(",
"int",
"argument",
",",
"String",
"name",
")",
"{",
"if",
"(",
"argument",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"CommonI18n",
".",
"argumentMayNotBeNegative",
".",
"text",
"(",
... | Check that the argument is non-negative (>=0).
@param argument The argument
@param name The name of the argument
@throws IllegalArgumentException If argument is negative (<0) | [
"Check",
"that",
"the",
"argument",
"is",
"non",
"-",
"negative",
"(",
">",
"=",
"0",
")",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java#L154-L159 |
jbundle/jbundle | thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/TaskProxy.java | TaskProxy.createRemoteSendQueue | public RemoteSendQueue createRemoteSendQueue(String strQueueName, String strQueueType) throws RemoteException {
"""
Create a new remote send queue.
@param strQueueName The queue name.
@param strQueueType The queue type (see MessageConstants).
"""
BaseTransport transport = this.createProxyTransport(CR... | java | public RemoteSendQueue createRemoteSendQueue(String strQueueName, String strQueueType) throws RemoteException
{
BaseTransport transport = this.createProxyTransport(CREATE_REMOTE_SEND_QUEUE);
transport.addParam(MessageConstants.QUEUE_NAME, strQueueName);
transport.addParam(MessageConstants.QU... | [
"public",
"RemoteSendQueue",
"createRemoteSendQueue",
"(",
"String",
"strQueueName",
",",
"String",
"strQueueType",
")",
"throws",
"RemoteException",
"{",
"BaseTransport",
"transport",
"=",
"this",
".",
"createProxyTransport",
"(",
"CREATE_REMOTE_SEND_QUEUE",
")",
";",
... | Create a new remote send queue.
@param strQueueName The queue name.
@param strQueueType The queue type (see MessageConstants). | [
"Create",
"a",
"new",
"remote",
"send",
"queue",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/TaskProxy.java#L142-L149 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/CustomizableFocusTraversalPolicy.java | CustomizableFocusTraversalPolicy.customizeFocusTraversalOrder | public static void customizeFocusTraversalOrder(JComponent container, java.util.List componentsInOrder) {
"""
Sets a custom focus traversal order for the given container. Child
components for which there is no order specified will receive focus after
components that do have an order specified in the standard "la... | java | public static void customizeFocusTraversalOrder(JComponent container, java.util.List componentsInOrder) {
for (Iterator i = componentsInOrder.iterator(); i.hasNext();) {
Component comp = (Component)i.next();
if (comp.getParent() != container) {
throw new IllegalArgumentEx... | [
"public",
"static",
"void",
"customizeFocusTraversalOrder",
"(",
"JComponent",
"container",
",",
"java",
".",
"util",
".",
"List",
"componentsInOrder",
")",
"{",
"for",
"(",
"Iterator",
"i",
"=",
"componentsInOrder",
".",
"iterator",
"(",
")",
";",
"i",
".",
... | Sets a custom focus traversal order for the given container. Child
components for which there is no order specified will receive focus after
components that do have an order specified in the standard "layout"
order.
@param container
the container
@param componentsInOrder
a list of child components in the order that th... | [
"Sets",
"a",
"custom",
"focus",
"traversal",
"order",
"for",
"the",
"given",
"container",
".",
"Child",
"components",
"for",
"which",
"there",
"is",
"no",
"order",
"specified",
"will",
"receive",
"focus",
"after",
"components",
"that",
"do",
"have",
"an",
"o... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/CustomizableFocusTraversalPolicy.java#L53-L61 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForWebElement | public boolean waitForWebElement(By by, int timeout, boolean scroll) {
"""
Waits for a WebElement matching the specified By object.
@param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
@param timeout the the amount of time in milliseconds to wait
@param scroll {@code true} if... | java | public boolean waitForWebElement(By by, int timeout, boolean scroll){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForWebElement("+by+", "+timeout+", "+scroll+")");
}
return (waiter.waitForWebElement(by, 0, timeout, scroll) != null);
} | [
"public",
"boolean",
"waitForWebElement",
"(",
"By",
"by",
",",
"int",
"timeout",
",",
"boolean",
"scroll",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"waitForWebElement(\"... | Waits for a WebElement matching the specified By object.
@param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
@param timeout the the amount of time in milliseconds to wait
@param scroll {@code true} if scrolling should be performed
@return {@code true} if the {@link WebElement} is dis... | [
"Waits",
"for",
"a",
"WebElement",
"matching",
"the",
"specified",
"By",
"object",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L682-L688 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.getGeneralGuildInfo | public Guild getGeneralGuildInfo(String id) throws GuildWars2Exception {
"""
For more info on guild API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id">here</a><br/>
Get guild info for the given guild id
@param id {@link Guild#id}
@return list of guild info
@throws GuildWars2Exception see {@lin... | java | public Guild getGeneralGuildInfo(String id) throws GuildWars2Exception {
isParamValid(new ParamChecker(ParamType.GUILD, id));
try {
Response<Guild> response = gw2API.getGeneralGuildInfo(id).execute();
if (!response.isSuccessful()) throwError(response.code(), response.errorBody());
return response.body();
... | [
"public",
"Guild",
"getGeneralGuildInfo",
"(",
"String",
"id",
")",
"throws",
"GuildWars2Exception",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ParamType",
".",
"GUILD",
",",
"id",
")",
")",
";",
"try",
"{",
"Response",
"<",
"Guild",
">",
"respon... | For more info on guild API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id">here</a><br/>
Get guild info for the given guild id
@param id {@link Guild#id}
@return list of guild info
@throws GuildWars2Exception see {@link ErrorCode} for detail
@see Guild guild info | [
"For",
"more",
"info",
"on",
"guild",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"guild",
"/",
":",
"id",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"G... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L1927-L1936 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java | CommonMpJwtFat.setBadIssuerExpectations | public Expectations setBadIssuerExpectations(LibertyServer server) throws Exception {
"""
Set expectations for tests that have bad issuers
@return Expectations
@throws Exception
"""
Expectations expectations = new Expectations();
expectations.addExpectation(new ResponseStatusExpectation(Ht... | java | public Expectations setBadIssuerExpectations(LibertyServer server) throws Exception {
Expectations expectations = new Expectations();
expectations.addExpectation(new ResponseStatusExpectation(HttpServletResponse.SC_UNAUTHORIZED));
expectations.addExpectation(new ServerMessageExpectation(server... | [
"public",
"Expectations",
"setBadIssuerExpectations",
"(",
"LibertyServer",
"server",
")",
"throws",
"Exception",
"{",
"Expectations",
"expectations",
"=",
"new",
"Expectations",
"(",
")",
";",
"expectations",
".",
"addExpectation",
"(",
"new",
"ResponseStatusExpectatio... | Set expectations for tests that have bad issuers
@return Expectations
@throws Exception | [
"Set",
"expectations",
"for",
"tests",
"that",
"have",
"bad",
"issuers"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java#L300-L310 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java | GenericGenerators.addIntegers | public static InsnList addIntegers(InsnList lhs, InsnList rhs) {
"""
Adds two integers together and puts the result on to the stack.
@param lhs instructions to generate the first operand -- must leave an int on the stack
@param rhs instructions to generate the second operand -- must leave an int on the stack
@r... | java | public static InsnList addIntegers(InsnList lhs, InsnList rhs) {
Validate.notNull(lhs);
Validate.notNull(rhs);
InsnList ret = new InsnList();
ret.add(lhs);
ret.add(rhs);
ret.add(new InsnNode(Opcodes.IADD));
return ret;
} | [
"public",
"static",
"InsnList",
"addIntegers",
"(",
"InsnList",
"lhs",
",",
"InsnList",
"rhs",
")",
"{",
"Validate",
".",
"notNull",
"(",
"lhs",
")",
";",
"Validate",
".",
"notNull",
"(",
"rhs",
")",
";",
"InsnList",
"ret",
"=",
"new",
"InsnList",
"(",
... | Adds two integers together and puts the result on to the stack.
@param lhs instructions to generate the first operand -- must leave an int on the stack
@param rhs instructions to generate the second operand -- must leave an int on the stack
@return instructions to add the two numbers together -- will leave an int on th... | [
"Adds",
"two",
"integers",
"together",
"and",
"puts",
"the",
"result",
"on",
"to",
"the",
"stack",
"."
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L568-L579 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/glazedlists/GlazedListsSupport.java | GlazedListsSupport.makeTableFormat | public static TableFormat makeTableFormat(final TableDescription desc) {
"""
Conversion of RCP TableDescription to GlazedLists TableFormat
@param desc
@return AdvancedWritableTableFormat
"""
return new AdvancedWritableTableFormat()
{
public Class getColumnClass(int i)
... | java | public static TableFormat makeTableFormat(final TableDescription desc)
{
return new AdvancedWritableTableFormat()
{
public Class getColumnClass(int i)
{
return desc.getType(i);
}
public Comparator getColumnComparator(int i)
... | [
"public",
"static",
"TableFormat",
"makeTableFormat",
"(",
"final",
"TableDescription",
"desc",
")",
"{",
"return",
"new",
"AdvancedWritableTableFormat",
"(",
")",
"{",
"public",
"Class",
"getColumnClass",
"(",
"int",
"i",
")",
"{",
"return",
"desc",
".",
"getTy... | Conversion of RCP TableDescription to GlazedLists TableFormat
@param desc
@return AdvancedWritableTableFormat | [
"Conversion",
"of",
"RCP",
"TableDescription",
"to",
"GlazedLists",
"TableFormat"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/glazedlists/GlazedListsSupport.java#L48-L100 |
VoltDB/voltdb | src/frontend/org/voltdb/StatsAgent.java | StatsAgent.aggregateProcedureStats | private VoltTable[] aggregateProcedureStats(VoltTable[] baseStats) {
"""
Produce PROCEDURE aggregation of PROCEDURE subselector
Basically it leaves out the rows that were not labeled as "<ALL>".
"""
if (baseStats == null || baseStats.length != 1) {
return baseStats;
}
Volt... | java | private VoltTable[] aggregateProcedureStats(VoltTable[] baseStats)
{
if (baseStats == null || baseStats.length != 1) {
return baseStats;
}
VoltTable result = new VoltTable(
new ColumnInfo("TIMESTAMP", VoltType.BIGINT),
new ColumnInfo(VoltSystemProcedure.C... | [
"private",
"VoltTable",
"[",
"]",
"aggregateProcedureStats",
"(",
"VoltTable",
"[",
"]",
"baseStats",
")",
"{",
"if",
"(",
"baseStats",
"==",
"null",
"||",
"baseStats",
".",
"length",
"!=",
"1",
")",
"{",
"return",
"baseStats",
";",
"}",
"VoltTable",
"resu... | Produce PROCEDURE aggregation of PROCEDURE subselector
Basically it leaves out the rows that were not labeled as "<ALL>". | [
"Produce",
"PROCEDURE",
"aggregation",
"of",
"PROCEDURE",
"subselector",
"Basically",
"it",
"leaves",
"out",
"the",
"rows",
"that",
"were",
"not",
"labeled",
"as",
"<ALL",
">",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/StatsAgent.java#L130-L184 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/trees/DecisionStump.java | DecisionStump.trainC | public List<ClassificationDataSet> trainC(ClassificationDataSet dataPoints, Set<Integer> options) {
"""
This is a helper function that does the work of training this stump. It may be
called directly by other classes that are creating decision trees to avoid
redundant repackaging of lists.
@param dataPoints th... | java | public List<ClassificationDataSet> trainC(ClassificationDataSet dataPoints, Set<Integer> options)
{
return trainC(dataPoints, options, false);
} | [
"public",
"List",
"<",
"ClassificationDataSet",
">",
"trainC",
"(",
"ClassificationDataSet",
"dataPoints",
",",
"Set",
"<",
"Integer",
">",
"options",
")",
"{",
"return",
"trainC",
"(",
"dataPoints",
",",
"options",
",",
"false",
")",
";",
"}"
] | This is a helper function that does the work of training this stump. It may be
called directly by other classes that are creating decision trees to avoid
redundant repackaging of lists.
@param dataPoints the lists of datapoint to train on, paired with the true category of each training point
@param options the set of ... | [
"This",
"is",
"a",
"helper",
"function",
"that",
"does",
"the",
"work",
"of",
"training",
"this",
"stump",
".",
"It",
"may",
"be",
"called",
"directly",
"by",
"other",
"classes",
"that",
"are",
"creating",
"decision",
"trees",
"to",
"avoid",
"redundant",
"... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/trees/DecisionStump.java#L373-L376 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/publickey/SshPublicKeyFileFactory.java | SshPublicKeyFileFactory.convertFile | public static void convertFile(File keyFile, int toFormat, File toFile)
throws IOException {
"""
Take a file in any of the supported public key formats and convert to the
requested format.
@param keyFile
@param toFormat
@param toFile
@throws IOException
"""
SshPublicKeyFile pub = parse(new FileInp... | java | public static void convertFile(File keyFile, int toFormat, File toFile)
throws IOException {
SshPublicKeyFile pub = parse(new FileInputStream(keyFile));
createFile(pub.toPublicKey(), pub.getComment(), toFormat, toFile);
} | [
"public",
"static",
"void",
"convertFile",
"(",
"File",
"keyFile",
",",
"int",
"toFormat",
",",
"File",
"toFile",
")",
"throws",
"IOException",
"{",
"SshPublicKeyFile",
"pub",
"=",
"parse",
"(",
"new",
"FileInputStream",
"(",
"keyFile",
")",
")",
";",
"creat... | Take a file in any of the supported public key formats and convert to the
requested format.
@param keyFile
@param toFormat
@param toFile
@throws IOException | [
"Take",
"a",
"file",
"in",
"any",
"of",
"the",
"supported",
"public",
"key",
"formats",
"and",
"convert",
"to",
"the",
"requested",
"format",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/publickey/SshPublicKeyFileFactory.java#L247-L252 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setFeatureStyle | public static boolean setFeatureStyle(PolylineOptions polylineOptions, FeatureStyle featureStyle, float density) {
"""
Set the feature style into the polyline options
@param polylineOptions polyline options
@param featureStyle feature style
@param density display density: {@link android.util.Displa... | java | public static boolean setFeatureStyle(PolylineOptions polylineOptions, FeatureStyle featureStyle, float density) {
boolean featureStyleSet = false;
if (featureStyle != null) {
featureStyleSet = setStyle(polylineOptions, featureStyle.getStyle(), density);
}
return feature... | [
"public",
"static",
"boolean",
"setFeatureStyle",
"(",
"PolylineOptions",
"polylineOptions",
",",
"FeatureStyle",
"featureStyle",
",",
"float",
"density",
")",
"{",
"boolean",
"featureStyleSet",
"=",
"false",
";",
"if",
"(",
"featureStyle",
"!=",
"null",
")",
"{",... | Set the feature style into the polyline options
@param polylineOptions polyline options
@param featureStyle feature style
@param density display density: {@link android.util.DisplayMetrics#density}
@return true if style was set into the polyline options | [
"Set",
"the",
"feature",
"style",
"into",
"the",
"polyline",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L429-L440 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/convert/MergeConverter.java | MergeConverter.addMergeField | public void addMergeField(String strFileName, String strLinkFileName, int iFieldSeq) {
"""
/*
Add a file/converter pair.
@param strFileName The target record name.
@param strLinkFileName The File name to use if the target file name is the current file.
@param iFieldSeq The field sequence of the field in thie r... | java | public void addMergeField(String strFileName, String strLinkFileName, int iFieldSeq)
{
this.checkArray();
m_vArray.addElement(new InfoList(strFileName, strLinkFileName, iFieldSeq, null));
} | [
"public",
"void",
"addMergeField",
"(",
"String",
"strFileName",
",",
"String",
"strLinkFileName",
",",
"int",
"iFieldSeq",
")",
"{",
"this",
".",
"checkArray",
"(",
")",
";",
"m_vArray",
".",
"addElement",
"(",
"new",
"InfoList",
"(",
"strFileName",
",",
"s... | /*
Add a file/converter pair.
@param strFileName The target record name.
@param strLinkFileName The File name to use if the target file name is the current file.
@param iFieldSeq The field sequence of the field in thie record to return. | [
"/",
"*",
"Add",
"a",
"file",
"/",
"converter",
"pair",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/MergeConverter.java#L257-L261 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addConstraintsPatternMessage | public FessMessages addConstraintsPatternMessage(String property, String regexp) {
"""
Add the created action message for the key 'constraints.Pattern.message' with parameters.
<pre>
message: {item} must match "{regexp}".
</pre>
@param property The property name for the message. (NotNull)
@param regexp The pa... | java | public FessMessages addConstraintsPatternMessage(String property, String regexp) {
assertPropertyNotNull(property);
add(property, new UserMessage(CONSTRAINTS_Pattern_MESSAGE, regexp));
return this;
} | [
"public",
"FessMessages",
"addConstraintsPatternMessage",
"(",
"String",
"property",
",",
"String",
"regexp",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"CONSTRAINTS_Pattern_MESSAGE",
",",
"r... | Add the created action message for the key 'constraints.Pattern.message' with parameters.
<pre>
message: {item} must match "{regexp}".
</pre>
@param property The property name for the message. (NotNull)
@param regexp The parameter regexp for message. (NotNull)
@return this. (NotNull) | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"constraints",
".",
"Pattern",
".",
"message",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"{",
"item",
"}",
"must",
"match",
"{",
"regexp",
"}",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L768-L772 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/attribute/StringAttribute.java | StringAttribute.wildCardEq | public Operation wildCardEq(String pattern) {
"""
Wild cards can include * and ?, which mean 'zero or many' and 'exactly one' character respectively.
A wild card can be escaped using single-quote. A single-quote must be escaped with another single quote
Examples:
"a?b*" matches "acbdefg" and "agb", but not "ab"... | java | public Operation wildCardEq(String pattern)
{
if (pattern == null)
{
return this.isNull();
}
AnalyzedWildcardPattern wildcardPattern = WildcardParser.getAnalyzedPattern(pattern, null);
if (wildcardPattern.getPlain() != null)
{
return t... | [
"public",
"Operation",
"wildCardEq",
"(",
"String",
"pattern",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"return",
"this",
".",
"isNull",
"(",
")",
";",
"}",
"AnalyzedWildcardPattern",
"wildcardPattern",
"=",
"WildcardParser",
".",
"getAnalyzedPa... | Wild cards can include * and ?, which mean 'zero or many' and 'exactly one' character respectively.
A wild card can be escaped using single-quote. A single-quote must be escaped with another single quote
Examples:
"a?b*" matches "acbdefg" and "agb", but not "ab"
"a'*" matches "a*" (a followed with the star character)
"... | [
"Wild",
"cards",
"can",
"include",
"*",
"and",
"?",
"which",
"mean",
"zero",
"or",
"many",
"and",
"exactly",
"one",
"character",
"respectively",
".",
"A",
"wild",
"card",
"can",
"be",
"escaped",
"using",
"single",
"-",
"quote",
".",
"A",
"single",
"-",
... | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/attribute/StringAttribute.java#L172-L197 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotInfo.java | SnapshotInfo.of | public static SnapshotInfo of(SnapshotId snapshotId, DiskId source) {
"""
Returns a {@code SnapshotInfo} object given the snapshot identity and a source disk identity.
"""
return newBuilder(snapshotId, source).build();
} | java | public static SnapshotInfo of(SnapshotId snapshotId, DiskId source) {
return newBuilder(snapshotId, source).build();
} | [
"public",
"static",
"SnapshotInfo",
"of",
"(",
"SnapshotId",
"snapshotId",
",",
"DiskId",
"source",
")",
"{",
"return",
"newBuilder",
"(",
"snapshotId",
",",
"source",
")",
".",
"build",
"(",
")",
";",
"}"
] | Returns a {@code SnapshotInfo} object given the snapshot identity and a source disk identity. | [
"Returns",
"a",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotInfo.java#L451-L453 |
reactor/reactor-netty | src/main/java/reactor/netty/tcp/SslProvider.java | SslProvider.addHandlerConfigurator | public static SslProvider addHandlerConfigurator(
SslProvider provider, Consumer<? super SslHandler> handlerConfigurator) {
"""
Creates a new {@link SslProvider SslProvider} with a prepending handler
configurator callback to inject default settings to an existing provider
configuration.
@return a new SslPr... | java | public static SslProvider addHandlerConfigurator(
SslProvider provider, Consumer<? super SslHandler> handlerConfigurator) {
Objects.requireNonNull(provider, "provider");
Objects.requireNonNull(handlerConfigurator, "handlerConfigurator");
return new SslProvider(provider, handlerConfigurator);
} | [
"public",
"static",
"SslProvider",
"addHandlerConfigurator",
"(",
"SslProvider",
"provider",
",",
"Consumer",
"<",
"?",
"super",
"SslHandler",
">",
"handlerConfigurator",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"provider",
",",
"\"provider\"",
")",
";",
"... | Creates a new {@link SslProvider SslProvider} with a prepending handler
configurator callback to inject default settings to an existing provider
configuration.
@return a new SslProvider | [
"Creates",
"a",
"new",
"{",
"@link",
"SslProvider",
"SslProvider",
"}",
"with",
"a",
"prepending",
"handler",
"configurator",
"callback",
"to",
"inject",
"default",
"settings",
"to",
"an",
"existing",
"provider",
"configuration",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/SslProvider.java#L76-L81 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java | XMLProperties.getProperty | public String getProperty(String pKey, String pDefaultValue) {
"""
Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if t... | java | public String getProperty(String pKey, String pDefaultValue) {
// Had to override this because Properties uses super.get()...
String value = (String) get(pKey); // Safe cast, see get(Object)
if (value != null) {
return value;
}
return ((defaults != null)
? defaults.getP... | [
"public",
"String",
"getProperty",
"(",
"String",
"pKey",
",",
"String",
"pDefaultValue",
")",
"{",
"// Had to override this because Properties uses super.get()...\r",
"String",
"value",
"=",
"(",
"String",
")",
"get",
"(",
"pKey",
")",
";",
"// Safe cast, see get(Objec... | Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the property is not found.
@param pKey the hashtable key.
@par... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java#L624-L635 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/cache/keyproviders/BasicAuthCacheKeyProvider.java | BasicAuthCacheKeyProvider.createLookupKey | public static String createLookupKey(String realm, String userid) {
"""
Creates a key to be used with the AuthCacheService.
The parameters must not be null, otherwise a null key is returned.
@param realm
@param userid
@return
"""
String key = null;
if (realm != null && userid != null) {
... | java | public static String createLookupKey(String realm, String userid) {
String key = null;
if (realm != null && userid != null) {
key = realm + KEY_SEPARATOR + userid;
}
return key;
} | [
"public",
"static",
"String",
"createLookupKey",
"(",
"String",
"realm",
",",
"String",
"userid",
")",
"{",
"String",
"key",
"=",
"null",
";",
"if",
"(",
"realm",
"!=",
"null",
"&&",
"userid",
"!=",
"null",
")",
"{",
"key",
"=",
"realm",
"+",
"KEY_SEPA... | Creates a key to be used with the AuthCacheService.
The parameters must not be null, otherwise a null key is returned.
@param realm
@param userid
@return | [
"Creates",
"a",
"key",
"to",
"be",
"used",
"with",
"the",
"AuthCacheService",
".",
"The",
"parameters",
"must",
"not",
"be",
"null",
"otherwise",
"a",
"null",
"key",
"is",
"returned",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/cache/keyproviders/BasicAuthCacheKeyProvider.java#L132-L138 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/QueryStringSigner.java | QueryStringSigner.calculateStringToSignV1 | private String calculateStringToSignV1(Map<String, List<String>> parameters) {
"""
Calculates string to sign for signature version 1.
@param parameters
request parameters
@return String to sign
"""
StringBuilder data = new StringBuilder();
SortedMap<String, List<String>> sorted =
... | java | private String calculateStringToSignV1(Map<String, List<String>> parameters) {
StringBuilder data = new StringBuilder();
SortedMap<String, List<String>> sorted =
new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER);
sorted.putAll(parameters);
for (Map.Entry<Strin... | [
"private",
"String",
"calculateStringToSignV1",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"parameters",
")",
"{",
"StringBuilder",
"data",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"SortedMap",
"<",
"String",
",",
"List",
"<",
"Str... | Calculates string to sign for signature version 1.
@param parameters
request parameters
@return String to sign | [
"Calculates",
"string",
"to",
"sign",
"for",
"signature",
"version",
"1",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/QueryStringSigner.java#L109-L123 |
apache/incubator-gobblin | gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/store/hdfs/SimpleHadoopFilesystemConfigStoreFactory.java | SimpleHadoopFilesystemConfigStoreFactory.createFileSystemURI | private URI createFileSystemURI(URI configKey) throws URISyntaxException, IOException {
"""
Creates a Hadoop FS {@link URI} given a user-specified configKey. If the given configKey does not have an authority,
a default one is used instead, provided by the default root path.
"""
// Validate the scheme
... | java | private URI createFileSystemURI(URI configKey) throws URISyntaxException, IOException {
// Validate the scheme
String configKeyScheme = configKey.getScheme();
if (!configKeyScheme.startsWith(getSchemePrefix())) {
throw new IllegalArgumentException(
String.format("Scheme for configKey \"%s\" ... | [
"private",
"URI",
"createFileSystemURI",
"(",
"URI",
"configKey",
")",
"throws",
"URISyntaxException",
",",
"IOException",
"{",
"// Validate the scheme",
"String",
"configKeyScheme",
"=",
"configKey",
".",
"getScheme",
"(",
")",
";",
"if",
"(",
"!",
"configKeyScheme... | Creates a Hadoop FS {@link URI} given a user-specified configKey. If the given configKey does not have an authority,
a default one is used instead, provided by the default root path. | [
"Creates",
"a",
"Hadoop",
"FS",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/store/hdfs/SimpleHadoopFilesystemConfigStoreFactory.java#L208-L221 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperations.java | KnowledgeOperations.setOutputs | public static void setOutputs(Message message, KnowledgeOperation operation, Map<String, Object> contextOverrides) {
"""
Sets the outputs.
@param message the message
@param operation the operation
@param contextOverrides the context overrides
"""
try {
setOutputsOrFaults(message, opera... | java | public static void setOutputs(Message message, KnowledgeOperation operation, Map<String, Object> contextOverrides) {
try {
setOutputsOrFaults(message, operation.getOutputExpressionMappings(), contextOverrides, RESULT, false);
} catch (Exception e) {
setOutputsOrFaults(message, op... | [
"public",
"static",
"void",
"setOutputs",
"(",
"Message",
"message",
",",
"KnowledgeOperation",
"operation",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"contextOverrides",
")",
"{",
"try",
"{",
"setOutputsOrFaults",
"(",
"message",
",",
"operation",
".",
"... | Sets the outputs.
@param message the message
@param operation the operation
@param contextOverrides the context overrides | [
"Sets",
"the",
"outputs",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperations.java#L273-L279 |
frostwire/frostwire-jlibtorrent | src/main/java/com/frostwire/jlibtorrent/Files.java | Files.bytes | public static byte[] bytes(File file) throws IOException {
"""
Reads the contents of a file into a byte array.
The file is always closed.
@param file the file to read, must not be {@code null}
@return the file contents, never {@code null}
@throws IOException in case of an I/O error
@since 1.1
"""
... | java | public static byte[] bytes(File file) throws IOException {
InputStream in = null;
try {
in = openInputStream(file);
return toByteArray(in, file.length());
} finally {
closeQuietly(in);
}
} | [
"public",
"static",
"byte",
"[",
"]",
"bytes",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"InputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"openInputStream",
"(",
"file",
")",
";",
"return",
"toByteArray",
"(",
"in",
",",
"fil... | Reads the contents of a file into a byte array.
The file is always closed.
@param file the file to read, must not be {@code null}
@return the file contents, never {@code null}
@throws IOException in case of an I/O error
@since 1.1 | [
"Reads",
"the",
"contents",
"of",
"a",
"file",
"into",
"a",
"byte",
"array",
".",
"The",
"file",
"is",
"always",
"closed",
"."
] | train | https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/Files.java#L38-L46 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java | JacksonDBCollection.findOne | public T findOne(T query, T fields) {
"""
Returns a single object from this collection matching the query.
@param query the query object
@param fields an object for which every non null field will be returned
@return the object found, or <code>null</code> if no such object exists
"""
return findO... | java | public T findOne(T query, T fields) {
return findOne(query, fields, getReadPreference());
} | [
"public",
"T",
"findOne",
"(",
"T",
"query",
",",
"T",
"fields",
")",
"{",
"return",
"findOne",
"(",
"query",
",",
"fields",
",",
"getReadPreference",
"(",
")",
")",
";",
"}"
] | Returns a single object from this collection matching the query.
@param query the query object
@param fields an object for which every non null field will be returned
@return the object found, or <code>null</code> if no such object exists | [
"Returns",
"a",
"single",
"object",
"from",
"this",
"collection",
"matching",
"the",
"query",
"."
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java#L913-L915 |
cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java | Expr.setPrimitive | public void setPrimitive(Type type, int val) {
"""
Set the primitive value of this atom expression.
@param type the type of expression
@param val the value to check
"""
if (type.hasValue()) {
this.type = type;
this.value = val;
this.left = null;
this... | java | public void setPrimitive(Type type, int val) {
if (type.hasValue()) {
this.type = type;
this.value = val;
this.left = null;
this.right = null;
this.query = null;
} else {
throw new IllegalArgumentException("Value provided for non-va... | [
"public",
"void",
"setPrimitive",
"(",
"Type",
"type",
",",
"int",
"val",
")",
"{",
"if",
"(",
"type",
".",
"hasValue",
"(",
")",
")",
"{",
"this",
".",
"type",
"=",
"type",
";",
"this",
".",
"value",
"=",
"val",
";",
"this",
".",
"left",
"=",
... | Set the primitive value of this atom expression.
@param type the type of expression
@param val the value to check | [
"Set",
"the",
"primitive",
"value",
"of",
"this",
"atom",
"expression",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java#L558-L569 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplaceUserInfoBlock.java | CmsWorkplaceUserInfoBlock.addEntry | public void addEntry(String key, String type, String widget, String params, String optional) {
"""
Creates a new entry.<p>
@param key the additional information key
@param type the class name of the stored data type
@param widget the widget class name
@param params the widget parameters
@param optional if o... | java | public void addEntry(String key, String type, String widget, String params, String optional) {
m_entries.add(new CmsWorkplaceUserInfoEntry(key, type, widget, params, optional));
} | [
"public",
"void",
"addEntry",
"(",
"String",
"key",
",",
"String",
"type",
",",
"String",
"widget",
",",
"String",
"params",
",",
"String",
"optional",
")",
"{",
"m_entries",
".",
"add",
"(",
"new",
"CmsWorkplaceUserInfoEntry",
"(",
"key",
",",
"type",
","... | Creates a new entry.<p>
@param key the additional information key
@param type the class name of the stored data type
@param widget the widget class name
@param params the widget parameters
@param optional if optional | [
"Creates",
"a",
"new",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceUserInfoBlock.java#L63-L66 |
Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.apply | public String apply(final JsonParser jp) throws IOException {
"""
returns a String read from the JsonParser argument's current position.
The returned value may be interned at the app scope to reduce heap
consumption
@param jp
@return a possibly interned String
@throws IOException
"""
return appl... | java | public String apply(final JsonParser jp) throws IOException {
return apply(jp, CacheScope.APPLICATION_SCOPE, null);
} | [
"public",
"String",
"apply",
"(",
"final",
"JsonParser",
"jp",
")",
"throws",
"IOException",
"{",
"return",
"apply",
"(",
"jp",
",",
"CacheScope",
".",
"APPLICATION_SCOPE",
",",
"null",
")",
";",
"}"
] | returns a String read from the JsonParser argument's current position.
The returned value may be interned at the app scope to reduce heap
consumption
@param jp
@return a possibly interned String
@throws IOException | [
"returns",
"a",
"String",
"read",
"from",
"the",
"JsonParser",
"argument",
"s",
"current",
"position",
".",
"The",
"returned",
"value",
"may",
"be",
"interned",
"at",
"the",
"app",
"scope",
"to",
"reduce",
"heap",
"consumption"
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L191-L193 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java | MapExtensions.operator_remove | @Inline(value = "$1.remove($2.getKey(), $2.getValue())", statementExpression = true)
public static <K, V> boolean operator_remove(Map<K, V> map, Pair<? extends K, ? extends V> entry) {
"""
Remove the given pair into the map.
<p>
If the given key is inside the map, but is not mapped to the given value, the
ma... | java | @Inline(value = "$1.remove($2.getKey(), $2.getValue())", statementExpression = true)
public static <K, V> boolean operator_remove(Map<K, V> map, Pair<? extends K, ? extends V> entry) {
//TODO use the JRE 1.8 API: map.remove(entry.getKey(), entry.getValue());
final K key = entry.getKey();
final V storedValue = ma... | [
"@",
"Inline",
"(",
"value",
"=",
"\"$1.remove($2.getKey(), $2.getValue())\"",
",",
"statementExpression",
"=",
"true",
")",
"public",
"static",
"<",
"K",
",",
"V",
">",
"boolean",
"operator_remove",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Pair",
... | Remove the given pair into the map.
<p>
If the given key is inside the map, but is not mapped to the given value, the
map will not be changed.
</p>
@param <K> type of the map keys.
@param <V> type of the map values.
@param map the map to update.
@param entry the entry (key, value) to remove from the map.
@return {@co... | [
"Remove",
"the",
"given",
"pair",
"into",
"the",
"map",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java#L226-L237 |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/util/StringUtils.java | StringUtils.stringifyValue | public static String stringifyValue(Param param, ObjectMapper mapper) {
"""
Stringify the parameter value in an appropriate way. Note that Facebook fucks up dates by using unix time-since-epoch
some places and ISO-8601 others. However, maybe unix times always work as parameters?
"""
assert !(param instance... | java | public static String stringifyValue(Param param, ObjectMapper mapper) {
assert !(param instanceof BinaryParam);
if (param.value instanceof String)
return (String)param.value;
if (param.value instanceof Date)
return Long.toString(((Date)param.value).getTime() / 1000);
else if (param.value instanc... | [
"public",
"static",
"String",
"stringifyValue",
"(",
"Param",
"param",
",",
"ObjectMapper",
"mapper",
")",
"{",
"assert",
"!",
"(",
"param",
"instanceof",
"BinaryParam",
")",
";",
"if",
"(",
"param",
".",
"value",
"instanceof",
"String",
")",
"return",
"(",
... | Stringify the parameter value in an appropriate way. Note that Facebook fucks up dates by using unix time-since-epoch
some places and ISO-8601 others. However, maybe unix times always work as parameters? | [
"Stringify",
"the",
"parameter",
"value",
"in",
"an",
"appropriate",
"way",
".",
"Note",
"that",
"Facebook",
"fucks",
"up",
"dates",
"by",
"using",
"unix",
"time",
"-",
"since",
"-",
"epoch",
"some",
"places",
"and",
"ISO",
"-",
"8601",
"others",
".",
"H... | train | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/util/StringUtils.java#L70-L81 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/wires/handlers/impl/WiresDockingControlImpl.java | WiresDockingControlImpl.getCloserMagnet | private WiresMagnet getCloserMagnet(final WiresShape shape, final WiresContainer parent, final boolean allowOverlap) {
"""
Reurn the closer magnet
@param shape
@param parent
@param allowOverlap should allow overlapping docked shape or not
@return closer magnet or null if none are available
"""
fina... | java | private WiresMagnet getCloserMagnet(final WiresShape shape, final WiresContainer parent, final boolean allowOverlap)
{
final WiresShape parentShape = (WiresShape) parent;
final MagnetManager.Magnets magnets = parentShape.getMagnets();
final Point2D shapeLocation = shape.getComputedLocation()... | [
"private",
"WiresMagnet",
"getCloserMagnet",
"(",
"final",
"WiresShape",
"shape",
",",
"final",
"WiresContainer",
"parent",
",",
"final",
"boolean",
"allowOverlap",
")",
"{",
"final",
"WiresShape",
"parentShape",
"=",
"(",
"WiresShape",
")",
"parent",
";",
"final"... | Reurn the closer magnet
@param shape
@param parent
@param allowOverlap should allow overlapping docked shape or not
@return closer magnet or null if none are available | [
"Reurn",
"the",
"closer",
"magnet"
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/wires/handlers/impl/WiresDockingControlImpl.java#L215-L245 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_output_elasticsearch_alias_aliasId_index_POST | public OvhOperation serviceName_output_elasticsearch_alias_aliasId_index_POST(String serviceName, String aliasId, String indexId) throws IOException {
"""
Attach a elasticsearch index to specified elasticsearch alias
REST: POST /dbaas/logs/{serviceName}/output/elasticsearch/alias/{aliasId}/index
@param service... | java | public OvhOperation serviceName_output_elasticsearch_alias_aliasId_index_POST(String serviceName, String aliasId, String indexId) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/output/elasticsearch/alias/{aliasId}/index";
StringBuilder sb = path(qPath, serviceName, aliasId);
HashMap<String, Object... | [
"public",
"OvhOperation",
"serviceName_output_elasticsearch_alias_aliasId_index_POST",
"(",
"String",
"serviceName",
",",
"String",
"aliasId",
",",
"String",
"indexId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/logs/{serviceName}/output/elasticsearch/... | Attach a elasticsearch index to specified elasticsearch alias
REST: POST /dbaas/logs/{serviceName}/output/elasticsearch/alias/{aliasId}/index
@param serviceName [required] Service name
@param aliasId [required] Alias ID
@param indexId [required] Index ID | [
"Attach",
"a",
"elasticsearch",
"index",
"to",
"specified",
"elasticsearch",
"alias"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L1597-L1604 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/WorkspaceApi.java | WorkspaceApi.destroy | public void destroy(long disconnectRequestTimeout) throws WorkspaceApiException {
"""
Ends the current agent's session. This request logs out the agent on all activated channels, ends the HTTP session,
and cleans up related resources. After you end the session, you'll need to make a login request before making an... | java | public void destroy(long disconnectRequestTimeout) throws WorkspaceApiException {
try {
if (this.workspaceInitialized) {
notifications.disconnect(disconnectRequestTimeout);
sessionApi.logout();
}
} catch (Exception e) {
throw new... | [
"public",
"void",
"destroy",
"(",
"long",
"disconnectRequestTimeout",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"if",
"(",
"this",
".",
"workspaceInitialized",
")",
"{",
"notifications",
".",
"disconnect",
"(",
"disconnectRequestTimeout",
")",
";",
... | Ends the current agent's session. This request logs out the agent on all activated channels, ends the HTTP session,
and cleans up related resources. After you end the session, you'll need to make a login request before making any
new calls to the API.
@param disconnectRequestTimeout The timeout in ms to wait for the di... | [
"Ends",
"the",
"current",
"agent",
"s",
"session",
".",
"This",
"request",
"logs",
"out",
"the",
"agent",
"on",
"all",
"activated",
"channels",
"ends",
"the",
"HTTP",
"session",
"and",
"cleans",
"up",
"related",
"resources",
".",
"After",
"you",
"end",
"th... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/WorkspaceApi.java#L354-L365 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/EventMetadataUtils.java | EventMetadataUtils.appendTaskStateValues | private static void appendTaskStateValues(List<TaskState> taskStates, StringBuffer sb, String key) {
"""
Append values for the given key from all {@link TaskState}s
@param sb a {@link StringBuffer} to hold the output
@param key the key of the values to retrieve
"""
// Add task failure messages in a group... | java | private static void appendTaskStateValues(List<TaskState> taskStates, StringBuffer sb, String key) {
// Add task failure messages in a group followed by task failure exceptions
for (TaskState taskState : taskStates) {
if (taskState.contains(key)) {
if (sb.length() != 0) {
sb.append(",");... | [
"private",
"static",
"void",
"appendTaskStateValues",
"(",
"List",
"<",
"TaskState",
">",
"taskStates",
",",
"StringBuffer",
"sb",
",",
"String",
"key",
")",
"{",
"// Add task failure messages in a group followed by task failure exceptions",
"for",
"(",
"TaskState",
"task... | Append values for the given key from all {@link TaskState}s
@param sb a {@link StringBuffer} to hold the output
@param key the key of the values to retrieve | [
"Append",
"values",
"for",
"the",
"given",
"key",
"from",
"all",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/EventMetadataUtils.java#L64-L74 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_runtime_POST | public OvhTask serviceName_runtime_POST(String serviceName, String appBootstrap, OvhEnvEnum appEnv, String[] attachedDomains, Boolean isDefault, String name, String publicDir, OvhTypeEnum type) throws IOException {
"""
Request the creation of a new runtime configuration
REST: POST /hosting/web/{serviceName}/run... | java | public OvhTask serviceName_runtime_POST(String serviceName, String appBootstrap, OvhEnvEnum appEnv, String[] attachedDomains, Boolean isDefault, String name, String publicDir, OvhTypeEnum type) throws IOException {
String qPath = "/hosting/web/{serviceName}/runtime";
StringBuilder sb = path(qPath, serviceName);
H... | [
"public",
"OvhTask",
"serviceName_runtime_POST",
"(",
"String",
"serviceName",
",",
"String",
"appBootstrap",
",",
"OvhEnvEnum",
"appEnv",
",",
"String",
"[",
"]",
"attachedDomains",
",",
"Boolean",
"isDefault",
",",
"String",
"name",
",",
"String",
"publicDir",
"... | Request the creation of a new runtime configuration
REST: POST /hosting/web/{serviceName}/runtime
@param isDefault [required] Set if the runtime configuration is the one by default for the hosting
@param appEnv [required] The client application environment
@param publicDir [required] The client application public dire... | [
"Request",
"the",
"creation",
"of",
"a",
"new",
"runtime",
"configuration"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L374-L387 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Collator.java | Collator.doCompare | @Deprecated
protected int doCompare(CharSequence left, CharSequence right) {
"""
Compares two CharSequences.
The base class just calls compare(left.toString(), right.toString()).
Subclasses should instead implement this method and have the String API call this method.
@deprecated This API is ICU internal on... | java | @Deprecated
protected int doCompare(CharSequence left, CharSequence right) {
return compare(left.toString(), right.toString());
} | [
"@",
"Deprecated",
"protected",
"int",
"doCompare",
"(",
"CharSequence",
"left",
",",
"CharSequence",
"right",
")",
"{",
"return",
"compare",
"(",
"left",
".",
"toString",
"(",
")",
",",
"right",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Compares two CharSequences.
The base class just calls compare(left.toString(), right.toString()).
Subclasses should instead implement this method and have the String API call this method.
@deprecated This API is ICU internal only.
@hide original deprecated declaration
@hide draft / provisional / internal are hidden on ... | [
"Compares",
"two",
"CharSequences",
".",
"The",
"base",
"class",
"just",
"calls",
"compare",
"(",
"left",
".",
"toString",
"()",
"right",
".",
"toString",
"()",
")",
".",
"Subclasses",
"should",
"instead",
"implement",
"this",
"method",
"and",
"have",
"the",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Collator.java#L1210-L1213 |
graknlabs/grakn | server/src/server/kb/concept/ElementFactory.java | ElementFactory.addVertexElement | public VertexElement addVertexElement(Schema.BaseType baseType) {
"""
Creates a new Vertex in the graph and builds a VertexElement which wraps the newly created vertex
@param baseType The Schema.BaseType
@return a new VertexElement
"""
Vertex vertex = graph.addVertex(baseType.name());
retur... | java | public VertexElement addVertexElement(Schema.BaseType baseType) {
Vertex vertex = graph.addVertex(baseType.name());
return new VertexElement(tx, vertex);
} | [
"public",
"VertexElement",
"addVertexElement",
"(",
"Schema",
".",
"BaseType",
"baseType",
")",
"{",
"Vertex",
"vertex",
"=",
"graph",
".",
"addVertex",
"(",
"baseType",
".",
"name",
"(",
")",
")",
";",
"return",
"new",
"VertexElement",
"(",
"tx",
",",
"ve... | Creates a new Vertex in the graph and builds a VertexElement which wraps the newly created vertex
@param baseType The Schema.BaseType
@return a new VertexElement | [
"Creates",
"a",
"new",
"Vertex",
"in",
"the",
"graph",
"and",
"builds",
"a",
"VertexElement",
"which",
"wraps",
"the",
"newly",
"created",
"vertex"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/concept/ElementFactory.java#L308-L311 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java | JaxbUtils.createCollectionElement | protected static <T> JAXBElement createCollectionElement(String rootName, Collection<T> c) {
"""
Create a JAXBElement containing a JAXBCollection. Needed for marshalling a generic collection
without a seperate wrapper class.
@param rootName Name of the XML root element
@return JAXBElement containing the given... | java | protected static <T> JAXBElement createCollectionElement(String rootName, Collection<T> c) {
JAXBCollection collection = new JAXBCollection(c);
return new JAXBElement<>(new QName(rootName), JAXBCollection.class, collection);
} | [
"protected",
"static",
"<",
"T",
">",
"JAXBElement",
"createCollectionElement",
"(",
"String",
"rootName",
",",
"Collection",
"<",
"T",
">",
"c",
")",
"{",
"JAXBCollection",
"collection",
"=",
"new",
"JAXBCollection",
"(",
"c",
")",
";",
"return",
"new",
"JA... | Create a JAXBElement containing a JAXBCollection. Needed for marshalling a generic collection
without a seperate wrapper class.
@param rootName Name of the XML root element
@return JAXBElement containing the given Collection, wrapped in a JAXBCollection. | [
"Create",
"a",
"JAXBElement",
"containing",
"a",
"JAXBCollection",
".",
"Needed",
"for",
"marshalling",
"a",
"generic",
"collection",
"without",
"a",
"seperate",
"wrapper",
"class",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java#L478-L481 |
aws/aws-sdk-java | aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java | StepFunctionBuilder.lte | public static TimestampLessThanOrEqualCondition.Builder lte(String variable, Date expectedValue) {
"""
Binary condition for Timestamp less than or equal to comparison. Dates are converted to ISO8601 UTC timestamps.
@param variable The JSONPath expression that determines which piece of the input document is... | java | public static TimestampLessThanOrEqualCondition.Builder lte(String variable, Date expectedValue) {
return TimestampLessThanOrEqualCondition.builder().variable(variable).expectedValue(expectedValue);
} | [
"public",
"static",
"TimestampLessThanOrEqualCondition",
".",
"Builder",
"lte",
"(",
"String",
"variable",
",",
"Date",
"expectedValue",
")",
"{",
"return",
"TimestampLessThanOrEqualCondition",
".",
"builder",
"(",
")",
".",
"variable",
"(",
"variable",
")",
".",
... | Binary condition for Timestamp less than or equal to comparison. Dates are converted to ISO8601 UTC timestamps.
@param variable The JSONPath expression that determines which piece of the input document is used for the comparison.
@param expectedValue The expected value for this condition.
@see <a href="https://st... | [
"Binary",
"condition",
"for",
"Timestamp",
"less",
"than",
"or",
"equal",
"to",
"comparison",
".",
"Dates",
"are",
"converted",
"to",
"ISO8601",
"UTC",
"timestamps",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java#L452-L454 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java | RevisionApi.getMapping | private int getMapping(final String mapping, final int revisionCounter) {
"""
This method returns the correct mapping of the given input.
@param mapping
mapping sequence
@param revisionCounter
index to map
@return mapped index
"""
String tempA, tempB;
int length = 0;
int revC =... | java | private int getMapping(final String mapping, final int revisionCounter)
{
String tempA, tempB;
int length = 0;
int revC = -1, mapC = -1;
int index, max = mapping.length();
while (length < max && revC < revisionCounter) {
// Read revisionCounter
ind... | [
"private",
"int",
"getMapping",
"(",
"final",
"String",
"mapping",
",",
"final",
"int",
"revisionCounter",
")",
"{",
"String",
"tempA",
",",
"tempB",
";",
"int",
"length",
"=",
"0",
";",
"int",
"revC",
"=",
"-",
"1",
",",
"mapC",
"=",
"-",
"1",
";",
... | This method returns the correct mapping of the given input.
@param mapping
mapping sequence
@param revisionCounter
index to map
@return mapped index | [
"This",
"method",
"returns",
"the",
"correct",
"mapping",
"of",
"the",
"given",
"input",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1666-L1703 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/authentication/support/DefaultLdapAccountStateHandler.java | DefaultLdapAccountStateHandler.handleWarning | protected void handleWarning(final AccountState.Warning warning, final AuthenticationResponse response,
final PasswordPolicyConfiguration configuration, final List<MessageDescriptor> messages) {
"""
Handle an account state warning produced by ldaptive account state machinery.
<p>
... | java | protected void handleWarning(final AccountState.Warning warning, final AuthenticationResponse response,
final PasswordPolicyConfiguration configuration, final List<MessageDescriptor> messages) {
LOGGER.debug("Handling account state warning [{}]", warning);
if (warning ... | [
"protected",
"void",
"handleWarning",
"(",
"final",
"AccountState",
".",
"Warning",
"warning",
",",
"final",
"AuthenticationResponse",
"response",
",",
"final",
"PasswordPolicyConfiguration",
"configuration",
",",
"final",
"List",
"<",
"MessageDescriptor",
">",
"message... | Handle an account state warning produced by ldaptive account state machinery.
<p>
Override this method to provide custom warning message handling.
@param warning the account state warning messages.
@param response Ldaptive authentication response.
@param configuration Password policy configuration.
@param m... | [
"Handle",
"an",
"account",
"state",
"warning",
"produced",
"by",
"ldaptive",
"account",
"state",
"machinery",
".",
"<p",
">",
"Override",
"this",
"method",
"to",
"provide",
"custom",
"warning",
"message",
"handling",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/authentication/support/DefaultLdapAccountStateHandler.java#L144-L175 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdClient.java | MessageBirdClient.listConversationMessages | public ConversationMessageList listConversationMessages(
final String conversationId
) throws UnauthorizedException, GeneralException {
"""
Gets a ConversationMessage listing with default pagination options.
@param conversationId Conversation to get messages for.
@return List of messages.
"... | java | public ConversationMessageList listConversationMessages(
final String conversationId
) throws UnauthorizedException, GeneralException {
final int offset = 0;
final int limit = 10;
return listConversationMessages(conversationId, offset, limit);
} | [
"public",
"ConversationMessageList",
"listConversationMessages",
"(",
"final",
"String",
"conversationId",
")",
"throws",
"UnauthorizedException",
",",
"GeneralException",
"{",
"final",
"int",
"offset",
"=",
"0",
";",
"final",
"int",
"limit",
"=",
"10",
";",
"return... | Gets a ConversationMessage listing with default pagination options.
@param conversationId Conversation to get messages for.
@return List of messages. | [
"Gets",
"a",
"ConversationMessage",
"listing",
"with",
"default",
"pagination",
"options",
"."
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L799-L806 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java | RingPlacer.placeRingSubstituents | public IAtomContainer placeRingSubstituents(IRingSet rs, double bondLength) {
"""
Positions the aliphatic substituents of a ring system
@param rs The RingSystem for which the substituents are to be laid out
@return A list of atoms that where laid out
"""
logger.debug("RingPlacer.placeRingSubstit... | java | public IAtomContainer placeRingSubstituents(IRingSet rs, double bondLength) {
logger.debug("RingPlacer.placeRingSubstituents() start");
IRing ring = null;
IAtom atom = null;
IRingSet rings = null;
IAtomContainer unplacedPartners = rs.getBuilder().newInstance(IAtomContainer.class)... | [
"public",
"IAtomContainer",
"placeRingSubstituents",
"(",
"IRingSet",
"rs",
",",
"double",
"bondLength",
")",
"{",
"logger",
".",
"debug",
"(",
"\"RingPlacer.placeRingSubstituents() start\"",
")",
";",
"IRing",
"ring",
"=",
"null",
";",
"IAtom",
"atom",
"=",
"null... | Positions the aliphatic substituents of a ring system
@param rs The RingSystem for which the substituents are to be laid out
@return A list of atoms that where laid out | [
"Positions",
"the",
"aliphatic",
"substituents",
"of",
"a",
"ring",
"system"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java#L187-L227 |
haraldk/TwelveMonkeys | imageio/imageio-hdr/src/main/java/com/twelvemonkeys/imageio/plugins/hdr/RGBE.java | RGBE.readPixels | public static void readPixels(DataInput in, float[] data, int numpixels) throws IOException {
"""
Simple read routine. Will not correctly handle run length encoding.
"""
byte[] rgbe = new byte[4];
float[] rgb = new float[3];
int offset = 0;
while (numpixels-- > 0) {
... | java | public static void readPixels(DataInput in, float[] data, int numpixels) throws IOException {
byte[] rgbe = new byte[4];
float[] rgb = new float[3];
int offset = 0;
while (numpixels-- > 0) {
in.readFully(rgbe);
rgbe2float(rgb, rgbe, 0);
data[offset+... | [
"public",
"static",
"void",
"readPixels",
"(",
"DataInput",
"in",
",",
"float",
"[",
"]",
"data",
",",
"int",
"numpixels",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"rgbe",
"=",
"new",
"byte",
"[",
"4",
"]",
";",
"float",
"[",
"]",
"rgb",
... | Simple read routine. Will not correctly handle run length encoding. | [
"Simple",
"read",
"routine",
".",
"Will",
"not",
"correctly",
"handle",
"run",
"length",
"encoding",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-hdr/src/main/java/com/twelvemonkeys/imageio/plugins/hdr/RGBE.java#L189-L203 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toCollection | public static Collection toCollection(Object o) throws PageException {
"""
cast a Object to a Collection
@param o Object to cast
@return casted Collection
@throws PageException
"""
if (o instanceof Collection) return (Collection) o;
else if (o instanceof Node) return XMLCaster.toXMLStruct((Node) o, fals... | java | public static Collection toCollection(Object o) throws PageException {
if (o instanceof Collection) return (Collection) o;
else if (o instanceof Node) return XMLCaster.toXMLStruct((Node) o, false);
else if (o instanceof Map) {
return MapAsStruct.toStruct((Map) o, true);// StructImpl((Map)o);
}
else if (o inst... | [
"public",
"static",
"Collection",
"toCollection",
"(",
"Object",
"o",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"Collection",
")",
"return",
"(",
"Collection",
")",
"o",
";",
"else",
"if",
"(",
"o",
"instanceof",
"Node",
")",
"retu... | cast a Object to a Collection
@param o Object to cast
@return casted Collection
@throws PageException | [
"cast",
"a",
"Object",
"to",
"a",
"Collection"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L4082-L4095 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/BootstrapTools.java | BootstrapTools.substituteDeprecatedConfigKey | public static void substituteDeprecatedConfigKey(Configuration config, String deprecated, String designated) {
"""
Sets the value of a new config key to the value of a deprecated config key.
@param config Config to write
@param deprecated The old config key
@param designated The new config key
"""
// set ... | java | public static void substituteDeprecatedConfigKey(Configuration config, String deprecated, String designated) {
// set the designated key only if it is not set already
if (!config.containsKey(designated)) {
final String valueForDeprecated = config.getString(deprecated, null);
if (valueForDeprecated != null) {
... | [
"public",
"static",
"void",
"substituteDeprecatedConfigKey",
"(",
"Configuration",
"config",
",",
"String",
"deprecated",
",",
"String",
"designated",
")",
"{",
"// set the designated key only if it is not set already",
"if",
"(",
"!",
"config",
".",
"containsKey",
"(",
... | Sets the value of a new config key to the value of a deprecated config key.
@param config Config to write
@param deprecated The old config key
@param designated The new config key | [
"Sets",
"the",
"value",
"of",
"a",
"new",
"config",
"key",
"to",
"the",
"value",
"of",
"a",
"deprecated",
"config",
"key",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/BootstrapTools.java#L329-L337 |
jenkinsci/jenkins | core/src/main/java/hudson/util/ByteBuffer.java | ByteBuffer.newInputStream | public InputStream newInputStream() {
"""
Creates an {@link InputStream} that reads from the underlying buffer.
"""
return new InputStream() {
private int pos = 0;
public int read() throws IOException {
synchronized(ByteBuffer.this) {
if(pos>=... | java | public InputStream newInputStream() {
return new InputStream() {
private int pos = 0;
public int read() throws IOException {
synchronized(ByteBuffer.this) {
if(pos>=size) return -1;
return buf[pos++];
}
... | [
"public",
"InputStream",
"newInputStream",
"(",
")",
"{",
"return",
"new",
"InputStream",
"(",
")",
"{",
"private",
"int",
"pos",
"=",
"0",
";",
"public",
"int",
"read",
"(",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"ByteBuffer",
".",
"this"... | Creates an {@link InputStream} that reads from the underlying buffer. | [
"Creates",
"an",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ByteBuffer.java#L87-L124 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.lookupPrincipal | public I_CmsPrincipal lookupPrincipal(CmsDbContext dbc, String principalName) {
"""
Lookup and read the user or group with the given name.<p>
@param dbc the current database context
@param principalName the name of the principal to lookup
@return the principal (group or user) if found, otherwise <code>null<... | java | public I_CmsPrincipal lookupPrincipal(CmsDbContext dbc, String principalName) {
try {
CmsGroup group = getUserDriver(dbc).readGroup(dbc, principalName);
if (group != null) {
return group;
}
} catch (Exception e) {
// ignore this exception
... | [
"public",
"I_CmsPrincipal",
"lookupPrincipal",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"principalName",
")",
"{",
"try",
"{",
"CmsGroup",
"group",
"=",
"getUserDriver",
"(",
"dbc",
")",
".",
"readGroup",
"(",
"dbc",
",",
"principalName",
")",
";",
"if",
"... | Lookup and read the user or group with the given name.<p>
@param dbc the current database context
@param principalName the name of the principal to lookup
@return the principal (group or user) if found, otherwise <code>null</code> | [
"Lookup",
"and",
"read",
"the",
"user",
"or",
"group",
"with",
"the",
"given",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L5671-L5692 |
UrielCh/ovh-java-sdk | ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java | ApiOvhMsServices.serviceName_account_userPrincipalName_exchange_GET | public OvhExchangeInformation serviceName_account_userPrincipalName_exchange_GET(String serviceName, String userPrincipalName) throws IOException {
"""
Get this object properties
REST: GET /msServices/{serviceName}/account/{userPrincipalName}/exchange
@param serviceName [required] The internal name of your Act... | java | public OvhExchangeInformation serviceName_account_userPrincipalName_exchange_GET(String serviceName, String userPrincipalName) throws IOException {
String qPath = "/msServices/{serviceName}/account/{userPrincipalName}/exchange";
StringBuilder sb = path(qPath, serviceName, userPrincipalName);
String resp = exec(qP... | [
"public",
"OvhExchangeInformation",
"serviceName_account_userPrincipalName_exchange_GET",
"(",
"String",
"serviceName",
",",
"String",
"userPrincipalName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/msServices/{serviceName}/account/{userPrincipalName}/exchange\"",... | Get this object properties
REST: GET /msServices/{serviceName}/account/{userPrincipalName}/exchange
@param serviceName [required] The internal name of your Active Directory organization
@param userPrincipalName [required] User Principal Name
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java#L386-L391 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java | BitsUtil.nextSetBit | public static int nextSetBit(long v, int start) {
"""
Find the next set bit.
@param v Value to process
@param start Start position (inclusive)
@return Position of next set bit, or -1.
"""
if(start >= Long.SIZE) {
return -1;
}
start = start < 0 ? 0 : start;
long cur = v & (LONG_ALL_BI... | java | public static int nextSetBit(long v, int start) {
if(start >= Long.SIZE) {
return -1;
}
start = start < 0 ? 0 : start;
long cur = v & (LONG_ALL_BITS << start);
return cur == 0 ? -1 : cur == LONG_ALL_BITS ? 0 : Long.numberOfTrailingZeros(cur);
} | [
"public",
"static",
"int",
"nextSetBit",
"(",
"long",
"v",
",",
"int",
"start",
")",
"{",
"if",
"(",
"start",
">=",
"Long",
".",
"SIZE",
")",
"{",
"return",
"-",
"1",
";",
"}",
"start",
"=",
"start",
"<",
"0",
"?",
"0",
":",
"start",
";",
"long... | Find the next set bit.
@param v Value to process
@param start Start position (inclusive)
@return Position of next set bit, or -1. | [
"Find",
"the",
"next",
"set",
"bit",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java#L1307-L1314 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java | Rational.Pochhammer | public Rational Pochhammer(final BigInteger n) {
"""
Compute Pochhammer's symbol (this)_n.
@param n The number of product terms in the evaluation.
@return Gamma(this+n)/Gamma(this) = this*(this+1)*...*(this+n-1).
"""
if (n.compareTo(BigInteger.ZERO) < 0) {
return null;
} else if... | java | public Rational Pochhammer(final BigInteger n) {
if (n.compareTo(BigInteger.ZERO) < 0) {
return null;
} else if (n.compareTo(BigInteger.ZERO) == 0) {
return Rational.ONE;
} else {
/* initialize results with the current value
*/
Rationa... | [
"public",
"Rational",
"Pochhammer",
"(",
"final",
"BigInteger",
"n",
")",
"{",
"if",
"(",
"n",
".",
"compareTo",
"(",
"BigInteger",
".",
"ZERO",
")",
"<",
"0",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"n",
".",
"compareTo",
"(",
"Bi... | Compute Pochhammer's symbol (this)_n.
@param n The number of product terms in the evaluation.
@return Gamma(this+n)/Gamma(this) = this*(this+1)*...*(this+n-1). | [
"Compute",
"Pochhammer",
"s",
"symbol",
"(",
"this",
")",
"_n",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L557-L572 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/CertificatesInner.java | CertificatesInner.getByResourceGroup | public CertificateInner getByResourceGroup(String resourceGroupName, String name) {
"""
Get a certificate.
Get a certificate.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the certificate.
@throws IllegalArgumentException thrown if parameters fail the ... | java | public CertificateInner getByResourceGroup(String resourceGroupName, String name) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body();
} | [
"public",
"CertificateInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"("... | Get a certificate.
Get a certificate.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the certificate.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeExcep... | [
"Get",
"a",
"certificate",
".",
"Get",
"a",
"certificate",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/CertificatesInner.java#L346-L348 |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java | JsonUtils.getNode | public static Node getNode(Object root, Path path) {
"""
Returns node with given path.
@param root
@param path
@return
"""
return path.getNode(convertToJson(root, "actual"));
} | java | public static Node getNode(Object root, Path path) {
return path.getNode(convertToJson(root, "actual"));
} | [
"public",
"static",
"Node",
"getNode",
"(",
"Object",
"root",
",",
"Path",
"path",
")",
"{",
"return",
"path",
".",
"getNode",
"(",
"convertToJson",
"(",
"root",
",",
"\"actual\"",
")",
")",
";",
"}"
] | Returns node with given path.
@param root
@param path
@return | [
"Returns",
"node",
"with",
"given",
"path",
"."
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java#L92-L94 |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java | DecoratorProxyFactory.createDelegateInitializerCode | private void createDelegateInitializerCode(ClassMethod classMethod, MethodInformation initializerMethodInfo, int delegateParameterPosition) {
"""
When creates the delegate initializer code when the delegate is injected
into a method.
<p/>
super initializer method is called first, and then _initMH is called
@... | java | private void createDelegateInitializerCode(ClassMethod classMethod, MethodInformation initializerMethodInfo, int delegateParameterPosition) {
final CodeAttribute b = classMethod.getCodeAttribute();
// we need to push all the parameters on the stack to call the corresponding
// superclass argumen... | [
"private",
"void",
"createDelegateInitializerCode",
"(",
"ClassMethod",
"classMethod",
",",
"MethodInformation",
"initializerMethodInfo",
",",
"int",
"delegateParameterPosition",
")",
"{",
"final",
"CodeAttribute",
"b",
"=",
"classMethod",
".",
"getCodeAttribute",
"(",
")... | When creates the delegate initializer code when the delegate is injected
into a method.
<p/>
super initializer method is called first, and then _initMH is called
@param initializerMethodInfo
@param delegateParameterPosition
@return | [
"When",
"creates",
"the",
"delegate",
"initializer",
"code",
"when",
"the",
"delegate",
"is",
"injected",
"into",
"a",
"method",
".",
"<p",
"/",
">",
"super",
"initializer",
"method",
"is",
"called",
"first",
"and",
"then",
"_initMH",
"is",
"called"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java#L226-L259 |
joachimvda/jtransfo | core/src/main/java/org/jtransfo/internal/ConverterHelper.java | ConverterHelper.getToConverter | public ToConverter getToConverter(Class toClass, Class domainClass) throws JTransfoException {
"""
Build the descriptor for conversion between given object types.
@param toClass transfer object class, contains the annotations for the conversion
@param domainClass domain class as other side of conversion
@retu... | java | public ToConverter getToConverter(Class toClass, Class domainClass) throws JTransfoException {
ToConverter converter = withPreConverter(toClass);
List<SyntheticField> domainFields = reflectionHelper.getSyntheticFields(domainClass);
for (Field field : reflectionHelper.getFields(toClass)) {
... | [
"public",
"ToConverter",
"getToConverter",
"(",
"Class",
"toClass",
",",
"Class",
"domainClass",
")",
"throws",
"JTransfoException",
"{",
"ToConverter",
"converter",
"=",
"withPreConverter",
"(",
"toClass",
")",
";",
"List",
"<",
"SyntheticField",
">",
"domainFields... | Build the descriptor for conversion between given object types.
@param toClass transfer object class, contains the annotations for the conversion
@param domainClass domain class as other side of conversion
@return conversion descriptor
@throws JTransfoException cannot build converter | [
"Build",
"the",
"descriptor",
"for",
"conversion",
"between",
"given",
"object",
"types",
"."
] | train | https://github.com/joachimvda/jtransfo/blob/eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8/core/src/main/java/org/jtransfo/internal/ConverterHelper.java#L57-L85 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageStatistics.java | ImageStatistics.meanDiffSq | public static double meanDiffSq(GrayF32 imgA, GrayF32 imgB ) {
"""
<p>Computes the mean squared error (MSE) between the two images.</p>
@param imgA first image. Not modified.
@param imgB second image. Not modified.
@return error between the two images.
"""
InputSanityCheck.checkSameShape(imgA,imgB);
i... | java | public static double meanDiffSq(GrayF32 imgA, GrayF32 imgB ) {
InputSanityCheck.checkSameShape(imgA,imgB);
if(BoofConcurrency.USE_CONCURRENT) {
return ImplImageStatistics_MT.meanDiffSq(imgA.data,imgA.startIndex,imgA.stride, imgB.data,imgB.startIndex,imgB.stride,imgA.height, imgA.width);
} else {
return Impl... | [
"public",
"static",
"double",
"meanDiffSq",
"(",
"GrayF32",
"imgA",
",",
"GrayF32",
"imgB",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"imgA",
",",
"imgB",
")",
";",
"if",
"(",
"BoofConcurrency",
".",
"USE_CONCURRENT",
")",
"{",
"return",
"Imp... | <p>Computes the mean squared error (MSE) between the two images.</p>
@param imgA first image. Not modified.
@param imgB second image. Not modified.
@return error between the two images. | [
"<p",
">",
"Computes",
"the",
"mean",
"squared",
"error",
"(",
"MSE",
")",
"between",
"the",
"two",
"images",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageStatistics.java#L1518-L1525 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/EncryptionProtectorsInner.java | EncryptionProtectorsInner.createOrUpdateAsync | public Observable<EncryptionProtectorInner> createOrUpdateAsync(String resourceGroupName, String serverName, EncryptionProtectorInner parameters) {
"""
Updates an existing encryption protector.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the... | java | public Observable<EncryptionProtectorInner> createOrUpdateAsync(String resourceGroupName, String serverName, EncryptionProtectorInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<EncryptionProtectorInner>, EncryptionProtecto... | [
"public",
"Observable",
"<",
"EncryptionProtectorInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"EncryptionProtectorInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGro... | Updates an existing encryption protector.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param parameters The requested encryption protector resource state.
@thro... | [
"Updates",
"an",
"existing",
"encryption",
"protector",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/EncryptionProtectorsInner.java#L333-L340 |
pedrovgs/Renderers | renderers/src/main/java/com/pedrogomez/renderers/VPRendererAdapter.java | VPRendererAdapter.instantiateItem | @Override public Object instantiateItem(ViewGroup parent, int position) {
"""
Main method of VPRendererAdapter. This method has the responsibility of update the
RendererBuilder values and create or recycle a new Renderer. Once the renderer has been
obtained the RendereBuilder will call the render method in the r... | java | @Override public Object instantiateItem(ViewGroup parent, int position) {
T content = getItem(position);
rendererBuilder.withContent(content);
rendererBuilder.withParent(parent);
rendererBuilder.withLayoutInflater(LayoutInflater.from(parent.getContext()));
Renderer<T> renderer = ... | [
"@",
"Override",
"public",
"Object",
"instantiateItem",
"(",
"ViewGroup",
"parent",
",",
"int",
"position",
")",
"{",
"T",
"content",
"=",
"getItem",
"(",
"position",
")",
";",
"rendererBuilder",
".",
"withContent",
"(",
"content",
")",
";",
"rendererBuilder",... | Main method of VPRendererAdapter. This method has the responsibility of update the
RendererBuilder values and create or recycle a new Renderer. Once the renderer has been
obtained the RendereBuilder will call the render method in the renderer and will return the
Renderer root view to the ViewPager.
If RendererBuilder ... | [
"Main",
"method",
"of",
"VPRendererAdapter",
".",
"This",
"method",
"has",
"the",
"responsibility",
"of",
"update",
"the",
"RendererBuilder",
"values",
"and",
"create",
"or",
"recycle",
"a",
"new",
"Renderer",
".",
"Once",
"the",
"renderer",
"has",
"been",
"ob... | train | https://github.com/pedrovgs/Renderers/blob/7477fb6e3984468b32b59c8520b66afb765081ea/renderers/src/main/java/com/pedrogomez/renderers/VPRendererAdapter.java#L66-L80 |
jsurfer/JsonSurfer | jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java | JsonSurfer.collectAll | public Collection<Object> collectAll(String json, JsonPath... paths) {
"""
Collect all matched value into a collection
@param json Json string
@param paths JsonPath
@return collection
"""
return collectAll(json, Object.class, paths);
} | java | public Collection<Object> collectAll(String json, JsonPath... paths) {
return collectAll(json, Object.class, paths);
} | [
"public",
"Collection",
"<",
"Object",
">",
"collectAll",
"(",
"String",
"json",
",",
"JsonPath",
"...",
"paths",
")",
"{",
"return",
"collectAll",
"(",
"json",
",",
"Object",
".",
"class",
",",
"paths",
")",
";",
"}"
] | Collect all matched value into a collection
@param json Json string
@param paths JsonPath
@return collection | [
"Collect",
"all",
"matched",
"value",
"into",
"a",
"collection"
] | train | https://github.com/jsurfer/JsonSurfer/blob/52bd75a453338b86e115092803da140bf99cee62/jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java#L272-L274 |
tvesalainen/lpg | src/main/java/org/vesalainen/regex/CharRange.java | CharRange.removeOverlap | public static List<CharRange> removeOverlap(CharRange r1, CharRange r2) {
"""
Returns a list of ranges that together gather the same characters as r1 and r2.
None of the resulting ranges doesn't intersect each other.
@param r1
@param r2
@return
"""
assert r1.intersect(r2);
List<CharRange>... | java | public static List<CharRange> removeOverlap(CharRange r1, CharRange r2)
{
assert r1.intersect(r2);
List<CharRange> list = new ArrayList<CharRange>();
Set<Integer> set = new TreeSet<Integer>();
set.add(r1.getFrom());
set.add(r1.getTo());
set.add(r2.getFrom());
... | [
"public",
"static",
"List",
"<",
"CharRange",
">",
"removeOverlap",
"(",
"CharRange",
"r1",
",",
"CharRange",
"r2",
")",
"{",
"assert",
"r1",
".",
"intersect",
"(",
"r2",
")",
";",
"List",
"<",
"CharRange",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"C... | Returns a list of ranges that together gather the same characters as r1 and r2.
None of the resulting ranges doesn't intersect each other.
@param r1
@param r2
@return | [
"Returns",
"a",
"list",
"of",
"ranges",
"that",
"together",
"gather",
"the",
"same",
"characters",
"as",
"r1",
"and",
"r2",
".",
"None",
"of",
"the",
"resulting",
"ranges",
"doesn",
"t",
"intersect",
"each",
"other",
"."
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/regex/CharRange.java#L154-L173 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java | ClustersInner.getByResourceGroupAsync | public Observable<ClusterInner> getByResourceGroupAsync(String resourceGroupName, String clusterName) {
"""
Gets the specified cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation... | java | public Observable<ClusterInner> getByResourceGroupAsync(String resourceGroupName, String clusterName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1<ServiceResponse<ClusterInner>, ClusterInner>() {
@Override
public ClusterInner call(Serv... | [
"public",
"Observable",
"<",
"ClusterInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
")",
".",
"map",
... | Gets the specified cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ClusterInner object | [
"Gets",
"the",
"specified",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java#L689-L696 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxTrash.java | BoxTrash.restoreFolder | public BoxFolder.Info restoreFolder(String folderID, String newName, String newParentID) {
"""
Restores a trashed folder to a new location with a new name.
@param folderID the ID of the trashed folder.
@param newName an optional new name to give the folder. This can be null to use the folder's original ... | java | public BoxFolder.Info restoreFolder(String folderID, String newName, String newParentID) {
JsonObject requestJSON = new JsonObject();
if (newName != null) {
requestJSON.add("name", newName);
}
if (newParentID != null) {
JsonObject parent = new JsonObject();
... | [
"public",
"BoxFolder",
".",
"Info",
"restoreFolder",
"(",
"String",
"folderID",
",",
"String",
"newName",
",",
"String",
"newParentID",
")",
"{",
"JsonObject",
"requestJSON",
"=",
"new",
"JsonObject",
"(",
")",
";",
"if",
"(",
"newName",
"!=",
"null",
")",
... | Restores a trashed folder to a new location with a new name.
@param folderID the ID of the trashed folder.
@param newName an optional new name to give the folder. This can be null to use the folder's original name.
@param newParentID an optional new parent ID for the folder. This can be null to use the folder... | [
"Restores",
"a",
"trashed",
"folder",
"to",
"a",
"new",
"location",
"with",
"a",
"new",
"name",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L118-L139 |
duracloud/duracloud | snapshotstorageprovider/src/main/java/org/duracloud/snapshottask/snapshot/SpaceModifyingSnapshotTaskRunner.java | SpaceModifyingSnapshotTaskRunner.storeSnapshotProps | protected void storeSnapshotProps(String spaceId, String serializedProps) {
"""
Stores a set of snapshot properties in the given space as a properties file.
@param spaceId the space in which the properties file should be stored
@param serializedProps properties in serialized format
"""
Inpu... | java | protected void storeSnapshotProps(String spaceId, String serializedProps) {
InputStream propsStream;
try {
propsStream = IOUtil.writeStringToStream(serializedProps);
} catch (IOException e) {
throw new TaskException("Unable to build stream from serialized " +
... | [
"protected",
"void",
"storeSnapshotProps",
"(",
"String",
"spaceId",
",",
"String",
"serializedProps",
")",
"{",
"InputStream",
"propsStream",
";",
"try",
"{",
"propsStream",
"=",
"IOUtil",
".",
"writeStringToStream",
"(",
"serializedProps",
")",
";",
"}",
"catch"... | Stores a set of snapshot properties in the given space as a properties file.
@param spaceId the space in which the properties file should be stored
@param serializedProps properties in serialized format | [
"Stores",
"a",
"set",
"of",
"snapshot",
"properties",
"in",
"the",
"given",
"space",
"as",
"a",
"properties",
"file",
"."
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/snapshotstorageprovider/src/main/java/org/duracloud/snapshottask/snapshot/SpaceModifyingSnapshotTaskRunner.java#L79-L99 |
liaochong/spring-boot-starter-converter | src/main/java/com/github/liaochong/converter/core/BeansConvertStrategy.java | BeansConvertStrategy.convertBean | private static <T, U> U convertBean(T source, Class<U> targetClass, Handler handler) {
"""
单个Bean转换
@throws ConvertException 转换异常
@param source 被转换对象
@param targetClass 需要转换到的类型
@param handler 转换处理者
@param <T> 转换前的类型
@param <U> 转换后的类型
@return 结果
"""
try {
if (Objects.isNull(sourc... | java | private static <T, U> U convertBean(T source, Class<U> targetClass, Handler handler) {
try {
if (Objects.isNull(source)) {
return null;
}
return targetClass.cast(handler.getMethod().invoke(handler.getHandler(), source));
} catch (IllegalAccessException... | [
"private",
"static",
"<",
"T",
",",
"U",
">",
"U",
"convertBean",
"(",
"T",
"source",
",",
"Class",
"<",
"U",
">",
"targetClass",
",",
"Handler",
"handler",
")",
"{",
"try",
"{",
"if",
"(",
"Objects",
".",
"isNull",
"(",
"source",
")",
")",
"{",
... | 单个Bean转换
@throws ConvertException 转换异常
@param source 被转换对象
@param targetClass 需要转换到的类型
@param handler 转换处理者
@param <T> 转换前的类型
@param <U> 转换后的类型
@return 结果 | [
"单个Bean转换"
] | train | https://github.com/liaochong/spring-boot-starter-converter/blob/a36bea44bd23330a6f43b0372906a804a09285c5/src/main/java/com/github/liaochong/converter/core/BeansConvertStrategy.java#L158-L167 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java | GVRShadowMap.makePerspShadowCamera | static GVRPerspectiveCamera makePerspShadowCamera(GVRPerspectiveCamera centerCam, float coneAngle) {
"""
Adds a perspective camera constructed from the designated
perspective camera to describe the shadow projection.
This type of camera is used for shadows generated by spot lights.
@param centerCam GVRPerspecti... | java | static GVRPerspectiveCamera makePerspShadowCamera(GVRPerspectiveCamera centerCam, float coneAngle)
{
GVRPerspectiveCamera camera = new GVRPerspectiveCamera(centerCam.getGVRContext());
float near = centerCam.getNearClippingDistance();
float far = centerCam.getFarClippingDistance();
c... | [
"static",
"GVRPerspectiveCamera",
"makePerspShadowCamera",
"(",
"GVRPerspectiveCamera",
"centerCam",
",",
"float",
"coneAngle",
")",
"{",
"GVRPerspectiveCamera",
"camera",
"=",
"new",
"GVRPerspectiveCamera",
"(",
"centerCam",
".",
"getGVRContext",
"(",
")",
")",
";",
... | Adds a perspective camera constructed from the designated
perspective camera to describe the shadow projection.
This type of camera is used for shadows generated by spot lights.
@param centerCam GVRPerspectiveCamera to derive shadow projection from
@param coneAngle spot light cone angle
@return Perspective camera to us... | [
"Adds",
"a",
"perspective",
"camera",
"constructed",
"from",
"the",
"designated",
"perspective",
"camera",
"to",
"describe",
"the",
"shadow",
"projection",
".",
"This",
"type",
"of",
"camera",
"is",
"used",
"for",
"shadows",
"generated",
"by",
"spot",
"lights",
... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java#L116-L127 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.