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 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenHFT/Chronicle-Network | src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java | TcpChannelHub.proxyReply | public Wire proxyReply(long timeoutTime, final long tid) throws ConnectionDroppedException, TimeoutException {
"""
blocks for a message with the appropriate {@code tid}
@param timeoutTime the amount of time to wait ( in MS ) before a time out exceptions
@param tid the {@code tid} of the message that we... | java | public Wire proxyReply(long timeoutTime, final long tid) throws ConnectionDroppedException, TimeoutException {
try {
return tcpSocketConsumer.syncBlockingReadSocket(timeoutTime, tid);
} catch (ConnectionDroppedException e) {
closeSocket();
throw e;
} catch ... | [
"public",
"Wire",
"proxyReply",
"(",
"long",
"timeoutTime",
",",
"final",
"long",
"tid",
")",
"throws",
"ConnectionDroppedException",
",",
"TimeoutException",
"{",
"try",
"{",
"return",
"tcpSocketConsumer",
".",
"syncBlockingReadSocket",
"(",
"timeoutTime",
",",
"ti... | blocks for a message with the appropriate {@code tid}
@param timeoutTime the amount of time to wait ( in MS ) before a time out exceptions
@param tid the {@code tid} of the message that we are waiting for
@return the wire of the message with the {@code tid} | [
"blocks",
"for",
"a",
"message",
"with",
"the",
"appropriate",
"{",
"@code",
"tid",
"}"
] | train | https://github.com/OpenHFT/Chronicle-Network/blob/b50d232a1763b1400d5438c7925dce845e5c387a/src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java#L638-L652 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.writeObject | public static void writeObject(CodedOutputStream out, int order, FieldType type, Object o, boolean list)
throws IOException {
"""
Write object.
@param out the out
@param order the order
@param type the type
@param o the o
@param list the list
@throws IOException Signals that an I/O exception h... | java | public static void writeObject(CodedOutputStream out, int order, FieldType type, Object o, boolean list)
throws IOException {
writeObject(out, order, type, o, list, true);
} | [
"public",
"static",
"void",
"writeObject",
"(",
"CodedOutputStream",
"out",
",",
"int",
"order",
",",
"FieldType",
"type",
",",
"Object",
"o",
",",
"boolean",
"list",
")",
"throws",
"IOException",
"{",
"writeObject",
"(",
"out",
",",
"order",
",",
"type",
... | Write object.
@param out the out
@param order the order
@param type the type
@param o the o
@param list the list
@throws IOException Signals that an I/O exception has occurred. | [
"Write",
"object",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L731-L734 |
matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikTracker.java | PiwikTracker.sendBulkRequest | public HttpResponse sendBulkRequest(Iterable<PiwikRequest> requests, String authToken) throws IOException {
"""
Send multiple requests in a single HTTP call. More efficient than sending
several individual requests. Specify the AuthToken if parameters that require
an auth token is used.
@param requests the req... | java | public HttpResponse sendBulkRequest(Iterable<PiwikRequest> requests, String authToken) throws IOException{
if (authToken != null && authToken.length() != PiwikRequest.AUTH_TOKEN_LENGTH){
throw new IllegalArgumentException(authToken+" is not "+PiwikRequest.AUTH_TOKEN_LENGTH+" characters long.");
... | [
"public",
"HttpResponse",
"sendBulkRequest",
"(",
"Iterable",
"<",
"PiwikRequest",
">",
"requests",
",",
"String",
"authToken",
")",
"throws",
"IOException",
"{",
"if",
"(",
"authToken",
"!=",
"null",
"&&",
"authToken",
".",
"length",
"(",
")",
"!=",
"PiwikReq... | Send multiple requests in a single HTTP call. More efficient than sending
several individual requests. Specify the AuthToken if parameters that require
an auth token is used.
@param requests the requests to send
@param authToken specify if any of the parameters use require AuthToken
@return the response from these re... | [
"Send",
"multiple",
"requests",
"in",
"a",
"single",
"HTTP",
"call",
".",
"More",
"efficient",
"than",
"sending",
"several",
"individual",
"requests",
".",
"Specify",
"the",
"AuthToken",
"if",
"parameters",
"that",
"require",
"an",
"auth",
"token",
"is",
"used... | train | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikTracker.java#L119-L147 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/deepboof/ImageClassifierVggCifar10.java | ImageClassifierVggCifar10.loadModel | @Override
public void loadModel(File directory) throws IOException {
"""
Expects there to be two files in the provided directory:<br>
YuvStatistics.txt<br>
model.net<br>
@param directory Directory containing model files
@throws IOException Throw if anything goes wrong while reading data
"""
stats = D... | java | @Override
public void loadModel(File directory) throws IOException {
stats = DeepModelIO.load(new File(directory,"YuvStatistics.txt"));
SequenceAndParameters<Tensor_F32, Function<Tensor_F32>> sequence =
new ParseBinaryTorch7().parseIntoBoof(new File(directory,"model.net"));
network = sequence.createForwar... | [
"@",
"Override",
"public",
"void",
"loadModel",
"(",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"stats",
"=",
"DeepModelIO",
".",
"load",
"(",
"new",
"File",
"(",
"directory",
",",
"\"YuvStatistics.txt\"",
")",
")",
";",
"SequenceAndParameters",
"... | Expects there to be two files in the provided directory:<br>
YuvStatistics.txt<br>
model.net<br>
@param directory Directory containing model files
@throws IOException Throw if anything goes wrong while reading data | [
"Expects",
"there",
"to",
"be",
"two",
"files",
"in",
"the",
"provided",
"directory",
":",
"<br",
">",
"YuvStatistics",
".",
"txt<br",
">",
"model",
".",
"net<br",
">"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/deepboof/ImageClassifierVggCifar10.java#L72-L85 |
igniterealtime/Smack | smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/util/OpenPgpPubSubUtil.java | OpenPgpPubSubUtil.getOpenLeafNode | @SuppressWarnings("unchecked")
public static LeafNode getOpenLeafNode(PubSubManager pubSubManager, String nodeName)
throws PubSubException.NotALeafNodeException {
"""
Use reflection magic to get a {@link LeafNode} without doing a disco#info query.
This method is useful for fetching nodes that are ... | java | @SuppressWarnings("unchecked")
public static LeafNode getOpenLeafNode(PubSubManager pubSubManager, String nodeName)
throws PubSubException.NotALeafNodeException {
try {
// Get access to the PubSubManager's nodeMap
Field field = pubSubManager.getClass().getDeclaredField(... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"LeafNode",
"getOpenLeafNode",
"(",
"PubSubManager",
"pubSubManager",
",",
"String",
"nodeName",
")",
"throws",
"PubSubException",
".",
"NotALeafNodeException",
"{",
"try",
"{",
"// Get access to th... | Use reflection magic to get a {@link LeafNode} without doing a disco#info query.
This method is useful for fetching nodes that are configured with the access model 'open', since
some servers that announce support for that access model do not allow disco#info queries from contacts
which are not subscribed to the node ow... | [
"Use",
"reflection",
"magic",
"to",
"get",
"a",
"{",
"@link",
"LeafNode",
"}",
"without",
"doing",
"a",
"disco#info",
"query",
".",
"This",
"method",
"is",
"useful",
"for",
"fetching",
"nodes",
"that",
"are",
"configured",
"with",
"the",
"access",
"model",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/util/OpenPgpPubSubUtil.java#L423-L469 |
wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/TextViewWithCircularIndicator.java | TextViewWithCircularIndicator.createTextColor | private ColorStateList createTextColor(int accentColor, boolean darkMode) {
"""
Programmatically set the color state list (see mdtp_date_picker_year_selector)
@param accentColor pressed state text color
@param darkMode current theme mode
@return ColorStateList with pressed state
"""
int[][] states =... | java | private ColorStateList createTextColor(int accentColor, boolean darkMode) {
int[][] states = new int[][]{
new int[]{android.R.attr.state_pressed}, // pressed
new int[]{android.R.attr.state_selected}, // selected
new int[]{}
};
int[] colors = new in... | [
"private",
"ColorStateList",
"createTextColor",
"(",
"int",
"accentColor",
",",
"boolean",
"darkMode",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"states",
"=",
"new",
"int",
"[",
"]",
"[",
"]",
"{",
"new",
"int",
"[",
"]",
"{",
"android",
".",
"R",
".",
... | Programmatically set the color state list (see mdtp_date_picker_year_selector)
@param accentColor pressed state text color
@param darkMode current theme mode
@return ColorStateList with pressed state | [
"Programmatically",
"set",
"the",
"color",
"state",
"list",
"(",
"see",
"mdtp_date_picker_year_selector",
")"
] | train | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/TextViewWithCircularIndicator.java#L76-L88 |
FrodeRanders/java-vopn | src/main/java/org/gautelis/vopn/lang/DynamicLoader.java | DynamicLoader.createObject | public C createObject(String className, Class clazz, DynamicInitializer<C> di) throws ClassNotFoundException {
"""
Creates an instance from a Class.
<p>
Supports the use of a dynamic initializer
(see {@link org.gautelis.vopn.lang.DynamicInitializer}<C>)
"""
C object;
try {
... | java | public C createObject(String className, Class clazz, DynamicInitializer<C> di) throws ClassNotFoundException {
C object;
try {
object = (C) clazz.newInstance();
} catch (InstantiationException ie) {
String info = "Could not create " + description + " object: " + classNam... | [
"public",
"C",
"createObject",
"(",
"String",
"className",
",",
"Class",
"clazz",
",",
"DynamicInitializer",
"<",
"C",
">",
"di",
")",
"throws",
"ClassNotFoundException",
"{",
"C",
"object",
";",
"try",
"{",
"object",
"=",
"(",
"C",
")",
"clazz",
".",
"n... | Creates an instance from a Class.
<p>
Supports the use of a dynamic initializer
(see {@link org.gautelis.vopn.lang.DynamicInitializer}<C>) | [
"Creates",
"an",
"instance",
"from",
"a",
"Class",
".",
"<p",
">",
"Supports",
"the",
"use",
"of",
"a",
"dynamic",
"initializer",
"(",
"see",
"{"
] | train | https://github.com/FrodeRanders/java-vopn/blob/4c7b2f90201327af4eaa3cd46b3fee68f864e5cc/src/main/java/org/gautelis/vopn/lang/DynamicLoader.java#L290-L321 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaControllerManagement.java | JpaControllerManagement.handleAddUpdateActionStatus | private Action handleAddUpdateActionStatus(final JpaActionStatus actionStatus, final JpaAction action) {
"""
Sets {@link TargetUpdateStatus} based on given {@link ActionStatus}.
"""
String controllerId = null;
LOG.debug("handleAddUpdateActionStatus for action {}", action.getId());
// ... | java | private Action handleAddUpdateActionStatus(final JpaActionStatus actionStatus, final JpaAction action) {
String controllerId = null;
LOG.debug("handleAddUpdateActionStatus for action {}", action.getId());
// information status entry - check for a potential DOS attack
assertActionStatus... | [
"private",
"Action",
"handleAddUpdateActionStatus",
"(",
"final",
"JpaActionStatus",
"actionStatus",
",",
"final",
"JpaAction",
"action",
")",
"{",
"String",
"controllerId",
"=",
"null",
";",
"LOG",
".",
"debug",
"(",
"\"handleAddUpdateActionStatus for action {}\"",
","... | Sets {@link TargetUpdateStatus} based on given {@link ActionStatus}. | [
"Sets",
"{"
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaControllerManagement.java#L609-L643 |
JOML-CI/JOML | src/org/joml/Matrix3f.java | Matrix3f.rotationTowards | public Matrix3f rotationTowards(float dirX, float dirY, float dirZ, float upX, float upY, float upZ) {
"""
Set this matrix to a model transformation for a right-handed coordinate system,
that aligns the local <code>-z</code> axis with <code>center - eye</code>.
<p>
In order to apply the rotation transformation ... | java | public Matrix3f rotationTowards(float dirX, float dirY, float dirZ, float upX, float upY, float upZ) {
// Normalize direction
float invDirLength = 1.0f / (float) Math.sqrt(dirX * dirX + dirY * dirY + dirZ * dirZ);
float ndirX = dirX * invDirLength;
float ndirY = dirY * invDirLength;
... | [
"public",
"Matrix3f",
"rotationTowards",
"(",
"float",
"dirX",
",",
"float",
"dirY",
",",
"float",
"dirZ",
",",
"float",
"upX",
",",
"float",
"upY",
",",
"float",
"upZ",
")",
"{",
"// Normalize direction",
"float",
"invDirLength",
"=",
"1.0f",
"/",
"(",
"f... | Set this matrix to a model transformation for a right-handed coordinate system,
that aligns the local <code>-z</code> axis with <code>center - eye</code>.
<p>
In order to apply the rotation transformation to a previous existing transformation,
use {@link #rotateTowards(float, float, float, float, float, float) rotateTo... | [
"Set",
"this",
"matrix",
"to",
"a",
"model",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"aligns",
"the",
"local",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"axis",
"with",
"<code",
">",
"center",
"-",
"eye<",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3f.java#L4055-L4085 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockSender.java | BlockSender.sendBlock | public long sendBlock(DataOutputStream out, OutputStream baseStream,
DataTransferThrottler throttler) throws IOException {
"""
sendBlock() is used to read block and its metadata and stream the data to
either a client or to another datanode.
@param out stream to which the block is written to
... | java | public long sendBlock(DataOutputStream out, OutputStream baseStream,
DataTransferThrottler throttler) throws IOException {
return sendBlock(out, baseStream, throttler, null);
} | [
"public",
"long",
"sendBlock",
"(",
"DataOutputStream",
"out",
",",
"OutputStream",
"baseStream",
",",
"DataTransferThrottler",
"throttler",
")",
"throws",
"IOException",
"{",
"return",
"sendBlock",
"(",
"out",
",",
"baseStream",
",",
"throttler",
",",
"null",
")"... | sendBlock() is used to read block and its metadata and stream the data to
either a client or to another datanode.
@param out stream to which the block is written to
@param baseStream optional. if non-null, <code>out</code> is assumed to
be a wrapper over this stream. This enables optimizations for
sending the data, e... | [
"sendBlock",
"()",
"is",
"used",
"to",
"read",
"block",
"and",
"its",
"metadata",
"and",
"stream",
"the",
"data",
"to",
"either",
"a",
"client",
"or",
"to",
"another",
"datanode",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockSender.java#L326-L329 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/writable/WritableFactory.java | WritableFactory.writeWithType | public void writeWithType(Writable w, DataOutput dataOutput) throws IOException {
"""
A convenience method for writing a given Writable object to a DataOutput. The key is 1st written (a single short)
followed by the value from writable.
@param w Writable value
@param dataOutput DataOutput to write b... | java | public void writeWithType(Writable w, DataOutput dataOutput) throws IOException {
w.writeType(dataOutput);
w.write(dataOutput);
} | [
"public",
"void",
"writeWithType",
"(",
"Writable",
"w",
",",
"DataOutput",
"dataOutput",
")",
"throws",
"IOException",
"{",
"w",
".",
"writeType",
"(",
"dataOutput",
")",
";",
"w",
".",
"write",
"(",
"dataOutput",
")",
";",
"}"
] | A convenience method for writing a given Writable object to a DataOutput. The key is 1st written (a single short)
followed by the value from writable.
@param w Writable value
@param dataOutput DataOutput to write both key and value to
@throws IOException If an error occurs during writing to the DataOutput | [
"A",
"convenience",
"method",
"for",
"writing",
"a",
"given",
"Writable",
"object",
"to",
"a",
"DataOutput",
".",
"The",
"key",
"is",
"1st",
"written",
"(",
"a",
"single",
"short",
")",
"followed",
"by",
"the",
"value",
"from",
"writable",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/writable/WritableFactory.java#L108-L111 |
phax/ph-oton | ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java | AbstractWebPageForm.createEditToolbar | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createEditToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nonnull final DATATYPE aSelectedObject) {
"""
Create toolbar for editing an existing objec... | java | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createEditToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nonnull final DATATYPE aSelectedObject)
{
final Locale aDisplayLocale = aWPEC.getDisplayL... | [
"@",
"Nonnull",
"@",
"OverrideOnDemand",
"protected",
"TOOLBAR_TYPE",
"createEditToolbar",
"(",
"@",
"Nonnull",
"final",
"WPECTYPE",
"aWPEC",
",",
"@",
"Nonnull",
"final",
"FORM_TYPE",
"aForm",
",",
"@",
"Nonnull",
"final",
"DATATYPE",
"aSelectedObject",
")",
"{",... | Create toolbar for editing an existing object
@param aWPEC
The web page execution context. Never <code>null</code>.
@param aForm
The handled form. Never <code>null</code>.
@param aSelectedObject
The selected object. Never <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"toolbar",
"for",
"editing",
"an",
"existing",
"object"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java#L747-L767 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/math/RangeInteger.java | RangeInteger.removeIntersect | public Pair<RangeInteger,RangeInteger> removeIntersect(RangeInteger o) {
"""
Remove the intersection between this range and the given range, and return the range before and the range after the intersection.
"""
if (o.max < min || o.min > max) // o is outside: no intersection
return new Pair<>(copy(), nu... | java | public Pair<RangeInteger,RangeInteger> removeIntersect(RangeInteger o) {
if (o.max < min || o.min > max) // o is outside: no intersection
return new Pair<>(copy(), null);
if (o.min <= min) {
// nothing before
if (o.max >= max)
return new Pair<>(null, null); // o is fully overlapping this
retu... | [
"public",
"Pair",
"<",
"RangeInteger",
",",
"RangeInteger",
">",
"removeIntersect",
"(",
"RangeInteger",
"o",
")",
"{",
"if",
"(",
"o",
".",
"max",
"<",
"min",
"||",
"o",
".",
"min",
">",
"max",
")",
"// o is outside: no intersection\r",
"return",
"new",
"... | Remove the intersection between this range and the given range, and return the range before and the range after the intersection. | [
"Remove",
"the",
"intersection",
"between",
"this",
"range",
"and",
"the",
"given",
"range",
"and",
"return",
"the",
"range",
"before",
"and",
"the",
"range",
"after",
"the",
"intersection",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/math/RangeInteger.java#L83-L98 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java | PerceptronClassifier.trainAveragedPerceptron | private static LinearModel trainAveragedPerceptron(Instance[] instanceList, FeatureMap featureMap, int maxIteration) {
"""
平均感知机训练算法
@param instanceList 训练实例
@param featureMap 特征函数
@param maxIteration 训练迭代次数
"""
float[] parameter = new float[featureMap.size()];
double[] sum = new double[fe... | java | private static LinearModel trainAveragedPerceptron(Instance[] instanceList, FeatureMap featureMap, int maxIteration)
{
float[] parameter = new float[featureMap.size()];
double[] sum = new double[featureMap.size()];
int[] time = new int[featureMap.size()];
AveragedPerceptron model = ... | [
"private",
"static",
"LinearModel",
"trainAveragedPerceptron",
"(",
"Instance",
"[",
"]",
"instanceList",
",",
"FeatureMap",
"featureMap",
",",
"int",
"maxIteration",
")",
"{",
"float",
"[",
"]",
"parameter",
"=",
"new",
"float",
"[",
"featureMap",
".",
"size",
... | 平均感知机训练算法
@param instanceList 训练实例
@param featureMap 特征函数
@param maxIteration 训练迭代次数 | [
"平均感知机训练算法"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java#L79-L100 |
FXMisc/Flowless | src/main/java/org/fxmisc/flowless/CellPositioner.java | CellPositioner.placeEndFromStart | public C placeEndFromStart(int itemIndex, double endOffStart) {
"""
Properly resizes the cell's node, and sets its "layoutY" value, so that is the last visible
node in the viewport, and further offsets this value by {@code endOffStart}, so that
the node's <em>top</em> edge appears (if negative) "above," (if 0) "... | java | public C placeEndFromStart(int itemIndex, double endOffStart) {
C cell = getSizedCell(itemIndex);
relocate(cell, 0, endOffStart - orientation.length(cell));
cell.getNode().setVisible(true);
return cell;
} | [
"public",
"C",
"placeEndFromStart",
"(",
"int",
"itemIndex",
",",
"double",
"endOffStart",
")",
"{",
"C",
"cell",
"=",
"getSizedCell",
"(",
"itemIndex",
")",
";",
"relocate",
"(",
"cell",
",",
"0",
",",
"endOffStart",
"-",
"orientation",
".",
"length",
"("... | Properly resizes the cell's node, and sets its "layoutY" value, so that is the last visible
node in the viewport, and further offsets this value by {@code endOffStart}, so that
the node's <em>top</em> edge appears (if negative) "above," (if 0) "at," or (if negative) "below" the
viewport's "bottom" edge. See {@link Orie... | [
"Properly",
"resizes",
"the",
"cell",
"s",
"node",
"and",
"sets",
"its",
"layoutY",
"value",
"so",
"that",
"is",
"the",
"last",
"visible",
"node",
"in",
"the",
"viewport",
"and",
"further",
"offsets",
"this",
"value",
"by",
"{",
"@code",
"endOffStart",
"}"... | train | https://github.com/FXMisc/Flowless/blob/dce2269ebafed8f79203d00085af41f06f3083bc/src/main/java/org/fxmisc/flowless/CellPositioner.java#L152-L157 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.isNear | public boolean isNear(Point point, int fudge) {
"""
Determines if a point is on/near the curved arrow.
@param point
the point to check
@param fudge
the radius around the point that should be checked for the
presence of the curve
@return <TT>true</TT> if the point is on the curve within a certain
fudge fac... | java | public boolean isNear(Point point, int fudge) {
if (needsRefresh)
refreshCurve();
try {
if (bounds.contains(affineToText.inverseTransform(point, null)))
return true;
} catch (java.awt.geom.NoninvertibleTransformException e) {
} catch (NullPointerException e) {
System.err.println(e + " : " + bounds... | [
"public",
"boolean",
"isNear",
"(",
"Point",
"point",
",",
"int",
"fudge",
")",
"{",
"if",
"(",
"needsRefresh",
")",
"refreshCurve",
"(",
")",
";",
"try",
"{",
"if",
"(",
"bounds",
".",
"contains",
"(",
"affineToText",
".",
"inverseTransform",
"(",
"poin... | Determines if a point is on/near the curved arrow.
@param point
the point to check
@param fudge
the radius around the point that should be checked for the
presence of the curve
@return <TT>true</TT> if the point is on the curve within a certain
fudge factor, <TT>false</TT> otherwise | [
"Determines",
"if",
"a",
"point",
"is",
"on",
"/",
"near",
"the",
"curved",
"arrow",
"."
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L332-L345 |
b3dgs/lionengine | lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ToolsAwt.java | ToolsAwt.saveImage | public static void saveImage(BufferedImage image, OutputStream output) throws IOException {
"""
Save image to output stream.
@param image The image to save.
@param output The output stream.
@throws IOException If error when saving image.
"""
ImageIO.write(image, "png", output);
} | java | public static void saveImage(BufferedImage image, OutputStream output) throws IOException
{
ImageIO.write(image, "png", output);
} | [
"public",
"static",
"void",
"saveImage",
"(",
"BufferedImage",
"image",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"ImageIO",
".",
"write",
"(",
"image",
",",
"\"png\"",
",",
"output",
")",
";",
"}"
] | Save image to output stream.
@param image The image to save.
@param output The output stream.
@throws IOException If error when saving image. | [
"Save",
"image",
"to",
"output",
"stream",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ToolsAwt.java#L147-L150 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/ri/ReflectiveInterceptor.java | ReflectiveInterceptor.typeCheckFieldSet | private static void typeCheckFieldSet(Field field, Object value) throws IllegalAccessException {
"""
Perform a dynamic type check needed when setting a field value onto a field. Raises the appropriate exception
when the check fails and returns normally otherwise. This method should only be called for object types... | java | private static void typeCheckFieldSet(Field field, Object value) throws IllegalAccessException {
Class<?> fieldType = field.getType();
if (value == null) {
if (fieldType.isPrimitive()) {
throw Exceptions.illegalSetFieldTypeException(field, null, value);
}
}
else {
if (fieldType.isPrimitive()) {
... | [
"private",
"static",
"void",
"typeCheckFieldSet",
"(",
"Field",
"field",
",",
"Object",
"value",
")",
"throws",
"IllegalAccessException",
"{",
"Class",
"<",
"?",
">",
"fieldType",
"=",
"field",
".",
"getType",
"(",
")",
";",
"if",
"(",
"value",
"==",
"null... | Perform a dynamic type check needed when setting a field value onto a field. Raises the appropriate exception
when the check fails and returns normally otherwise. This method should only be called for object types. For
primitive types call the three parameter variant instead.
@throws IllegalAccessException | [
"Perform",
"a",
"dynamic",
"type",
"check",
"needed",
"when",
"setting",
"a",
"field",
"value",
"onto",
"a",
"field",
".",
"Raises",
"the",
"appropriate",
"exception",
"when",
"the",
"check",
"fails",
"and",
"returns",
"normally",
"otherwise",
".",
"This",
"... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/ri/ReflectiveInterceptor.java#L762-L778 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java | ManagedClustersInner.beginResetServicePrincipalProfileAsync | public Observable<Void> beginResetServicePrincipalProfileAsync(String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) {
"""
Reset Service Principal Profile of a managed cluster.
Update the service principal Profile for a managed cluster.
@param resourceGroupName The na... | java | public Observable<Void> beginResetServicePrincipalProfileAsync(String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) {
return beginResetServicePrincipalProfileWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<Void>, Voi... | [
"public",
"Observable",
"<",
"Void",
">",
"beginResetServicePrincipalProfileAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterServicePrincipalProfile",
"parameters",
")",
"{",
"return",
"beginResetServicePrincipalProfileWithServiceResp... | Reset Service Principal Profile of a managed cluster.
Update the service principal Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Reset Service Principal Profile operation... | [
"Reset",
"Service",
"Principal",
"Profile",
"of",
"a",
"managed",
"cluster",
".",
"Update",
"the",
"service",
"principal",
"Profile",
"for",
"a",
"managed",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java#L1608-L1615 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java | FastaAFPChainConverter.fastaToAfpChain | public static AFPChain fastaToAfpChain(SequencePair<Sequence<AminoAcidCompound>, AminoAcidCompound> alignment,
Structure structure1, Structure structure2) throws StructureException {
"""
Provided only for convenience.
@see #fastaToAfpChain(ProteinSequence, ProteinSequence, Structure, Structure)
@throws Stru... | java | public static AFPChain fastaToAfpChain(SequencePair<Sequence<AminoAcidCompound>, AminoAcidCompound> alignment,
Structure structure1, Structure structure2) throws StructureException {
List<AlignedSequence<Sequence<AminoAcidCompound>, AminoAcidCompound>> seqs = alignment.getAlignedSequences();
StringBuilder sb1 = ... | [
"public",
"static",
"AFPChain",
"fastaToAfpChain",
"(",
"SequencePair",
"<",
"Sequence",
"<",
"AminoAcidCompound",
">",
",",
"AminoAcidCompound",
">",
"alignment",
",",
"Structure",
"structure1",
",",
"Structure",
"structure2",
")",
"throws",
"StructureException",
"{"... | Provided only for convenience.
@see #fastaToAfpChain(ProteinSequence, ProteinSequence, Structure, Structure)
@throws StructureException | [
"Provided",
"only",
"for",
"convenience",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java#L310-L332 |
quattor/pan | panc/src/main/java/org/quattor/pan/ttemplate/BuildContext.java | BuildContext.setGlobalVariable | public void setGlobalVariable(String name, Element value) {
"""
Set the variable to the given value, preserving the status of the final
flag. This will unconditionally set the value without checking if the
value is final; be careful. The value must already exist.
"""
assert (name != null);
GlobalVariab... | java | public void setGlobalVariable(String name, Element value) {
assert (name != null);
GlobalVariable gvar = globalVariables.get(name);
gvar.setValue(value);
} | [
"public",
"void",
"setGlobalVariable",
"(",
"String",
"name",
",",
"Element",
"value",
")",
"{",
"assert",
"(",
"name",
"!=",
"null",
")",
";",
"GlobalVariable",
"gvar",
"=",
"globalVariables",
".",
"get",
"(",
"name",
")",
";",
"gvar",
".",
"setValue",
... | Set the variable to the given value, preserving the status of the final
flag. This will unconditionally set the value without checking if the
value is final; be careful. The value must already exist. | [
"Set",
"the",
"variable",
"to",
"the",
"given",
"value",
"preserving",
"the",
"status",
"of",
"the",
"final",
"flag",
".",
"This",
"will",
"unconditionally",
"set",
"the",
"value",
"without",
"checking",
"if",
"the",
"value",
"is",
"final",
";",
"be",
"car... | train | https://github.com/quattor/pan/blob/009934a603dd0c08d3fa4bb7d9389c380a916f54/panc/src/main/java/org/quattor/pan/ttemplate/BuildContext.java#L598-L604 |
alkacon/opencms-core | src/org/opencms/site/CmsSiteManagerImpl.java | CmsSiteManagerImpl.checkUUIDOfSiteRoot | private void checkUUIDOfSiteRoot(CmsSite site, CmsObject clone, CmsObject cms_offline) {
"""
Fetches UUID for given site root from online and offline repository.<p>
@param site to read and set UUID for
@param clone online CmsObject
@param cms_offline offline CmsObject
"""
CmsUUID id = null;
... | java | private void checkUUIDOfSiteRoot(CmsSite site, CmsObject clone, CmsObject cms_offline) {
CmsUUID id = null;
try {
id = clone.readResource(site.getSiteRoot()).getStructureId();
} catch (CmsException e) {
//Ok, site root not available for online repository.
}
... | [
"private",
"void",
"checkUUIDOfSiteRoot",
"(",
"CmsSite",
"site",
",",
"CmsObject",
"clone",
",",
"CmsObject",
"cms_offline",
")",
"{",
"CmsUUID",
"id",
"=",
"null",
";",
"try",
"{",
"id",
"=",
"clone",
".",
"readResource",
"(",
"site",
".",
"getSiteRoot",
... | Fetches UUID for given site root from online and offline repository.<p>
@param site to read and set UUID for
@param clone online CmsObject
@param cms_offline offline CmsObject | [
"Fetches",
"UUID",
"for",
"given",
"site",
"root",
"from",
"online",
"and",
"offline",
"repository",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteManagerImpl.java#L1646-L1667 |
cloudfoundry/uaa | server/src/main/java/org/cloudfoundry/identity/uaa/user/UaaUserApprovalHandler.java | UaaUserApprovalHandler.isApproved | @Override
public boolean isApproved(AuthorizationRequest authorizationRequest, Authentication userAuthentication) {
"""
Allows automatic approval for a white list of clients in the implicit
grant case.
@param authorizationRequest The authorization request.
@param userAuthentication the current user authen... | java | @Override
public boolean isApproved(AuthorizationRequest authorizationRequest, Authentication userAuthentication) {
// if (useTokenServices && super.isApproved(authorizationRequest, userAuthentication)) {
// return true;
// }
if (!userAuthentication.isAuthenticated()) {
... | [
"@",
"Override",
"public",
"boolean",
"isApproved",
"(",
"AuthorizationRequest",
"authorizationRequest",
",",
"Authentication",
"userAuthentication",
")",
"{",
"// if (useTokenServices && super.isApproved(authorizationRequest, userAuthentication)) {",
"// return true;",... | Allows automatic approval for a white list of clients in the implicit
grant case.
@param authorizationRequest The authorization request.
@param userAuthentication the current user authentication
@return Whether the specified request has been approved by the current
user. | [
"Allows",
"automatic",
"approval",
"for",
"a",
"white",
"list",
"of",
"clients",
"in",
"the",
"implicit",
"grant",
"case",
"."
] | train | https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/user/UaaUserApprovalHandler.java#L91-L112 |
adamfisk/dnsjava-fork | src/org/xbill/DNS/utils/HMAC.java | HMAC.verify | public boolean
verify(byte [] signature, boolean truncation_ok) {
"""
Verifies the data (computes the secure hash and compares it to the input)
@param signature The signature to compare against
@param truncation_ok If true, the signature may be truncated; only the
number of bytes in the provided signature are c... | java | public boolean
verify(byte [] signature, boolean truncation_ok) {
byte [] expected = sign();
if (truncation_ok && signature.length < expected.length) {
byte [] truncated = new byte[signature.length];
System.arraycopy(expected, 0, truncated, 0, truncated.length);
expected = truncated;
}
return Arrays.equals(si... | [
"public",
"boolean",
"verify",
"(",
"byte",
"[",
"]",
"signature",
",",
"boolean",
"truncation_ok",
")",
"{",
"byte",
"[",
"]",
"expected",
"=",
"sign",
"(",
")",
";",
"if",
"(",
"truncation_ok",
"&&",
"signature",
".",
"length",
"<",
"expected",
".",
... | Verifies the data (computes the secure hash and compares it to the input)
@param signature The signature to compare against
@param truncation_ok If true, the signature may be truncated; only the
number of bytes in the provided signature are compared.
@return true if the signature matches, false otherwise | [
"Verifies",
"the",
"data",
"(",
"computes",
"the",
"secure",
"hash",
"and",
"compares",
"it",
"to",
"the",
"input",
")"
] | train | https://github.com/adamfisk/dnsjava-fork/blob/69510a1cad0518badb19a6615724313bebc61f90/src/org/xbill/DNS/utils/HMAC.java#L154-L163 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/topic/topicAccess/TopicAccessManager.java | TopicAccessManager.checkAccessTopicFromControllers | boolean checkAccessTopicFromControllers(UserContext ctx, String topic, Iterable<JsTopicAccessController> accessControls) throws IllegalAccessException {
"""
Check if access topic is granted by accessControls
@param ctx
@param topic
@param accessControls
@return
@throws IllegalAccessException
"""
logger.... | java | boolean checkAccessTopicFromControllers(UserContext ctx, String topic, Iterable<JsTopicAccessController> accessControls) throws IllegalAccessException {
logger.debug("Looking for accessController for topic '{}' : '{}'", topic, accessControls);
boolean tacPresent = false;
if (null != accessControls) {
for (JsTo... | [
"boolean",
"checkAccessTopicFromControllers",
"(",
"UserContext",
"ctx",
",",
"String",
"topic",
",",
"Iterable",
"<",
"JsTopicAccessController",
">",
"accessControls",
")",
"throws",
"IllegalAccessException",
"{",
"logger",
".",
"debug",
"(",
"\"Looking for accessControl... | Check if access topic is granted by accessControls
@param ctx
@param topic
@param accessControls
@return
@throws IllegalAccessException | [
"Check",
"if",
"access",
"topic",
"is",
"granted",
"by",
"accessControls"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/topic/topicAccess/TopicAccessManager.java#L153-L163 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BooleanField.java | BooleanField.getSQLType | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) {
"""
Get the SQL type of this field.
Typically BOOLEAN or BYTE.
@param bIncludeLength Include the field length in this description.
@param properties Database properties to determine the SQL type.
"""
String strType = ... | java | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties)
{
String strType = (String)properties.get(DBSQLTypes.BOOLEAN);
if (strType == null)
strType = DBSQLTypes.BYTE; // The default SQL Type (Byte)
return strType;
} | [
"public",
"String",
"getSQLType",
"(",
"boolean",
"bIncludeLength",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strType",
"=",
"(",
"String",
")",
"properties",
".",
"get",
"(",
"DBSQLTypes",
".",
"BOOLEAN",
")",
";",
... | Get the SQL type of this field.
Typically BOOLEAN or BYTE.
@param bIncludeLength Include the field length in this description.
@param properties Database properties to determine the SQL type. | [
"Get",
"the",
"SQL",
"type",
"of",
"this",
"field",
".",
"Typically",
"BOOLEAN",
"or",
"BYTE",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BooleanField.java#L167-L173 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/Util.java | Util.flipBitmapRange | public static void flipBitmapRange(long[] bitmap, int start, int end) {
"""
flip bits at start, start+1,..., end-1
@param bitmap array of words to be modified
@param start first index to be modified (inclusive)
@param end last index to be modified (exclusive)
"""
if (start == end) {
return;
... | java | public static void flipBitmapRange(long[] bitmap, int start, int end) {
if (start == end) {
return;
}
int firstword = start / 64;
int endword = (end - 1) / 64;
bitmap[firstword] ^= ~(~0L << start);
for (int i = firstword; i < endword; i++) {
bitmap[i] = ~bitmap[i];
}
bitmap[e... | [
"public",
"static",
"void",
"flipBitmapRange",
"(",
"long",
"[",
"]",
"bitmap",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"start",
"==",
"end",
")",
"{",
"return",
";",
"}",
"int",
"firstword",
"=",
"start",
"/",
"64",
";",
"int"... | flip bits at start, start+1,..., end-1
@param bitmap array of words to be modified
@param start first index to be modified (inclusive)
@param end last index to be modified (exclusive) | [
"flip",
"bits",
"at",
"start",
"start",
"+",
"1",
"...",
"end",
"-",
"1"
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/Util.java#L288-L299 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java | SpiceServiceListenerNotifier.notifyObserversOfRequestAdded | public void notifyObserversOfRequestAdded(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) {
"""
Inform the observers of a request. The observers can optionally observe
the new request if required.
@param request the request that has been added to processing queue.
"""
Request... | java | public void notifyObserversOfRequestAdded(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) {
RequestProcessingContext requestProcessingContext = new RequestProcessingContext();
requestProcessingContext.setExecutionThread(Thread.currentThread());
requestProcessingContext.s... | [
"public",
"void",
"notifyObserversOfRequestAdded",
"(",
"CachedSpiceRequest",
"<",
"?",
">",
"request",
",",
"Set",
"<",
"RequestListener",
"<",
"?",
">",
">",
"requestListeners",
")",
"{",
"RequestProcessingContext",
"requestProcessingContext",
"=",
"new",
"RequestPr... | Inform the observers of a request. The observers can optionally observe
the new request if required.
@param request the request that has been added to processing queue. | [
"Inform",
"the",
"observers",
"of",
"a",
"request",
".",
"The",
"observers",
"can",
"optionally",
"observe",
"the",
"new",
"request",
"if",
"required",
"."
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L67-L72 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AbstractQueryHandler.java | AbstractQueryHandler.updateNodes | public void updateNodes(Iterator<String> remove, Iterator<NodeData> add) throws RepositoryException, IOException {
"""
This default implementation calls the individual {@link #deleteNode(String)}
and {@link #addNode(NodeData)} methods
for each entry in the iterators. First the nodes to remove are processed
then... | java | public void updateNodes(Iterator<String> remove, Iterator<NodeData> add) throws RepositoryException, IOException
{
while (remove.hasNext())
{
deleteNode(remove.next());
}
while (add.hasNext())
{
addNode(add.next());
}
} | [
"public",
"void",
"updateNodes",
"(",
"Iterator",
"<",
"String",
">",
"remove",
",",
"Iterator",
"<",
"NodeData",
">",
"add",
")",
"throws",
"RepositoryException",
",",
"IOException",
"{",
"while",
"(",
"remove",
".",
"hasNext",
"(",
")",
")",
"{",
"delete... | This default implementation calls the individual {@link #deleteNode(String)}
and {@link #addNode(NodeData)} methods
for each entry in the iterators. First the nodes to remove are processed
then the nodes to add.
@param remove uuids of nodes to remove.
@param add NodeStates to add.
@throws RepositoryException if an err... | [
"This",
"default",
"implementation",
"calls",
"the",
"individual",
"{",
"@link",
"#deleteNode",
"(",
"String",
")",
"}",
"and",
"{",
"@link",
"#addNode",
"(",
"NodeData",
")",
"}",
"methods",
"for",
"each",
"entry",
"in",
"the",
"iterators",
".",
"First",
... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AbstractQueryHandler.java#L141-L151 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/SQLConsumerLogMessages.java | SQLConsumerLogMessages.logFileCreation | public static void logFileCreation(final Logger logger, final String path) {
"""
Logs the creation of an output file.
@param logger
reference to the logger
@param path
path of the output file
"""
logger.logMessage(Level.INFO, "New File created:\t" + path);
} | java | public static void logFileCreation(final Logger logger, final String path)
{
logger.logMessage(Level.INFO, "New File created:\t" + path);
} | [
"public",
"static",
"void",
"logFileCreation",
"(",
"final",
"Logger",
"logger",
",",
"final",
"String",
"path",
")",
"{",
"logger",
".",
"logMessage",
"(",
"Level",
".",
"INFO",
",",
"\"New File created:\\t\"",
"+",
"path",
")",
";",
"}"
] | Logs the creation of an output file.
@param logger
reference to the logger
@param path
path of the output file | [
"Logs",
"the",
"creation",
"of",
"an",
"output",
"file",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/SQLConsumerLogMessages.java#L64-L68 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java | Shape.setElementWiseStride | public static void setElementWiseStride(DataBuffer buffer, int elementWiseStride) {
"""
Get the element wise stride for the
shape info buffer
@param buffer the buffer to get the element
wise stride from
@return the element wise stride for the buffer
"""
int length2 = shapeInfoLength(Shape.rank(buff... | java | public static void setElementWiseStride(DataBuffer buffer, int elementWiseStride) {
int length2 = shapeInfoLength(Shape.rank(buffer));
//if (1 > 0) throw new RuntimeException("setElementWiseStride called: [" + elementWiseStride + "], buffer: " + buffer);
buffer.put(length2 - 2, elementWiseStride... | [
"public",
"static",
"void",
"setElementWiseStride",
"(",
"DataBuffer",
"buffer",
",",
"int",
"elementWiseStride",
")",
"{",
"int",
"length2",
"=",
"shapeInfoLength",
"(",
"Shape",
".",
"rank",
"(",
"buffer",
")",
")",
";",
"//if (1 > 0) throw new RuntimeException(\"... | Get the element wise stride for the
shape info buffer
@param buffer the buffer to get the element
wise stride from
@return the element wise stride for the buffer | [
"Get",
"the",
"element",
"wise",
"stride",
"for",
"the",
"shape",
"info",
"buffer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java#L3086-L3090 |
ecclesia/kipeto | kipeto/src/main/java/de/ecclesia/kipeto/RepositoryResolver.java | RepositoryResolver.resolveRepos | private String resolveRepos(String localIp, Properties config) {
"""
Ermittelt anhand der lokalen IP-Adresse und der übergebenen
Konfiguration, welches Repository für den Update-Vorgang verwendet werden
soll.
"""
for (Object key : config.keySet()) {
String ipPraefix = (String) key;
String repos = con... | java | private String resolveRepos(String localIp, Properties config) {
for (Object key : config.keySet()) {
String ipPraefix = (String) key;
String repos = config.getProperty(ipPraefix);
if (localIp.startsWith(ipPraefix)) {
log.info("Local IP " + localIp + " starts with '{}', selecting [{}]", ipPraefix, repos... | [
"private",
"String",
"resolveRepos",
"(",
"String",
"localIp",
",",
"Properties",
"config",
")",
"{",
"for",
"(",
"Object",
"key",
":",
"config",
".",
"keySet",
"(",
")",
")",
"{",
"String",
"ipPraefix",
"=",
"(",
"String",
")",
"key",
";",
"String",
"... | Ermittelt anhand der lokalen IP-Adresse und der übergebenen
Konfiguration, welches Repository für den Update-Vorgang verwendet werden
soll. | [
"Ermittelt",
"anhand",
"der",
"lokalen",
"IP",
"-",
"Adresse",
"und",
"der",
"übergebenen",
"Konfiguration",
"welches",
"Repository",
"für",
"den",
"Update",
"-",
"Vorgang",
"verwendet",
"werden",
"soll",
"."
] | train | https://github.com/ecclesia/kipeto/blob/ea39a10ae4eaa550f71a856ab2f2845270a64913/kipeto/src/main/java/de/ecclesia/kipeto/RepositoryResolver.java#L180-L197 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/DescendantIterator.java | DescendantIterator.setRoot | public void setRoot(int context, Object environment) {
"""
Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation.
"""
super.setRoot(context, environment);
m_traverser = m_cdtm.getAxisTraverser(m_axis);
String... | java | public void setRoot(int context, Object environment)
{
super.setRoot(context, environment);
m_traverser = m_cdtm.getAxisTraverser(m_axis);
String localName = getLocalName();
String namespace = getNamespace();
int what = m_whatToShow;
// System.out.println("what: ");
// NodeTest.debugW... | [
"public",
"void",
"setRoot",
"(",
"int",
"context",
",",
"Object",
"environment",
")",
"{",
"super",
".",
"setRoot",
"(",
"context",
",",
"environment",
")",
";",
"m_traverser",
"=",
"m_cdtm",
".",
"getAxisTraverser",
"(",
"m_axis",
")",
";",
"String",
"lo... | Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation. | [
"Initialize",
"the",
"context",
"values",
"for",
"this",
"expression",
"after",
"it",
"is",
"cloned",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/DescendantIterator.java#L261-L283 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getGroupsBatch | public OneLoginResponse<Group> getGroupsBatch(HashMap<String, String> queryParameters, int batchSize, String afterCursor)
throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Get a batch of Groups
@param queryParameters Query parameters of the Resource
@param batchSize Size of the Ba... | java | public OneLoginResponse<Group> getGroupsBatch(HashMap<String, String> queryParameters, int batchSize, String afterCursor)
throws OAuthSystemException, OAuthProblemException, URISyntaxException {
ExtractionContext context = extractResourceBatch(queryParameters, batchSize, afterCursor, Constants.GET_GROUPS_URL);
L... | [
"public",
"OneLoginResponse",
"<",
"Group",
">",
"getGroupsBatch",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"queryParameters",
",",
"int",
"batchSize",
",",
"String",
"afterCursor",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
... | Get a batch of Groups
@param queryParameters Query parameters of the Resource
@param batchSize Size of the Batch
@param afterCursor Reference to continue collecting items of next page
@return OneLoginResponse of Group
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnectio... | [
"Get",
"a",
"batch",
"of",
"Groups"
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2293-L2299 |
google/error-prone-javac | src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassTranslator.java | ClassTranslator.translate | public ClassFile translate(ClassFile cf, Map<Object,Object> translations) {
"""
Create a new ClassFile from {@code cf}, such that for all entries
{@code k -\> v} in {@code translations},
each occurrence of {@code k} in {@code cf} will be replaced by {@code v}.
in
@param cf the class file to be pro... | java | public ClassFile translate(ClassFile cf, Map<Object,Object> translations) {
ClassFile cf2 = (ClassFile) translations.get(cf);
if (cf2 == null) {
ConstantPool constant_pool2 = translate(cf.constant_pool, translations);
Field[] fields2 = translate(cf.fields, cf.constant_pool, trans... | [
"public",
"ClassFile",
"translate",
"(",
"ClassFile",
"cf",
",",
"Map",
"<",
"Object",
",",
"Object",
">",
"translations",
")",
"{",
"ClassFile",
"cf2",
"=",
"(",
"ClassFile",
")",
"translations",
".",
"get",
"(",
"cf",
")",
";",
"if",
"(",
"cf2",
"=="... | Create a new ClassFile from {@code cf}, such that for all entries
{@code k -\> v} in {@code translations},
each occurrence of {@code k} in {@code cf} will be replaced by {@code v}.
in
@param cf the class file to be processed
@param translations the set of translations to be applied
@return a copy of {@code... | [
"Create",
"a",
"new",
"ClassFile",
"from",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassTranslator.java#L67-L97 |
JoeKerouac/utils | src/main/java/com/joe/utils/collection/CollectionUtil.java | CollectionUtil.permutations | public static <T> void permutations(List<List<T>> result, List<T> args, int index) {
"""
计算全排列
@param result 全排列结果集
@param args 要进行全排列的队列
@param index 全排列开始位置,例如如果index等于3则表示从下标3位置开始往后的所有数据进行全排列
@param <T> 要全排列的数据的类型
"""
if (index == args.size() - 2) {
List<T> temp1 = new ArrayL... | java | public static <T> void permutations(List<List<T>> result, List<T> args, int index) {
if (index == args.size() - 2) {
List<T> temp1 = new ArrayList<>(args.size());
temp1.addAll(args);
Collections.swap(temp1, index, index + 1);
result.add(temp1);
List<T>... | [
"public",
"static",
"<",
"T",
">",
"void",
"permutations",
"(",
"List",
"<",
"List",
"<",
"T",
">",
">",
"result",
",",
"List",
"<",
"T",
">",
"args",
",",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"==",
"args",
".",
"size",
"(",
")",
"-",
... | 计算全排列
@param result 全排列结果集
@param args 要进行全排列的队列
@param index 全排列开始位置,例如如果index等于3则表示从下标3位置开始往后的所有数据进行全排列
@param <T> 要全排列的数据的类型 | [
"计算全排列"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/collection/CollectionUtil.java#L440-L458 |
alkacon/opencms-core | src/org/opencms/search/documents/CmsDocumentContainerPage.java | CmsDocumentContainerPage.createDocument | @Override
public I_CmsSearchDocument createDocument(CmsObject cms, CmsResource resource, I_CmsSearchIndex index)
throws CmsException {
"""
Generates a new lucene document instance from contents of the given resource for the provided index.<p>
For container pages, we must not cache based on the container... | java | @Override
public I_CmsSearchDocument createDocument(CmsObject cms, CmsResource resource, I_CmsSearchIndex index)
throws CmsException {
// extract the content from the resource
I_CmsExtractionResult content = null;
if (index.isExtractingContent()) {
// do full text content e... | [
"@",
"Override",
"public",
"I_CmsSearchDocument",
"createDocument",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"I_CmsSearchIndex",
"index",
")",
"throws",
"CmsException",
"{",
"// extract the content from the resource",
"I_CmsExtractionResult",
"content",
... | Generates a new lucene document instance from contents of the given resource for the provided index.<p>
For container pages, we must not cache based on the container page content age,
since the content of the included elements may change any time. | [
"Generates",
"a",
"new",
"lucene",
"document",
"instance",
"from",
"contents",
"of",
"the",
"given",
"resource",
"for",
"the",
"provided",
"index",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/documents/CmsDocumentContainerPage.java#L85-L105 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/SubClass.java | SubClass.defineField | public void defineField(int modifier, String fieldName, TypeMirror type) {
"""
Define a new field.
@param modifier
@param fieldName
@param type
"""
DeclaredType dt = (DeclaredType)asType();
VariableBuilder builder = new VariableBuilder(this, fieldName, dt.getTypeArguments(), typeParameterM... | java | public void defineField(int modifier, String fieldName, TypeMirror type)
{
DeclaredType dt = (DeclaredType)asType();
VariableBuilder builder = new VariableBuilder(this, fieldName, dt.getTypeArguments(), typeParameterMap);
builder.addModifiers(modifier);
builder.setType(type);
... | [
"public",
"void",
"defineField",
"(",
"int",
"modifier",
",",
"String",
"fieldName",
",",
"TypeMirror",
"type",
")",
"{",
"DeclaredType",
"dt",
"=",
"(",
"DeclaredType",
")",
"asType",
"(",
")",
";",
"VariableBuilder",
"builder",
"=",
"new",
"VariableBuilder",... | Define a new field.
@param modifier
@param fieldName
@param type | [
"Define",
"a",
"new",
"field",
"."
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/SubClass.java#L620-L629 |
molgenis/molgenis | molgenis-jobs/src/main/java/org/molgenis/jobs/JobExecutor.java | JobExecutor.executeScheduledJob | @RunAsSystem
public void executeScheduledJob(String scheduledJobId) {
"""
Executes a {@link ScheduledJob} in the current thread.
@param scheduledJobId ID of the {@link ScheduledJob} to run
"""
ScheduledJob scheduledJob =
dataService.findOneById(SCHEDULED_JOB, scheduledJobId, ScheduledJob.class... | java | @RunAsSystem
public void executeScheduledJob(String scheduledJobId) {
ScheduledJob scheduledJob =
dataService.findOneById(SCHEDULED_JOB, scheduledJobId, ScheduledJob.class);
if (scheduledJob == null) {
throw new UnknownEntityException(SCHEDULED_JOB, scheduledJobId);
}
JobExecution jobEx... | [
"@",
"RunAsSystem",
"public",
"void",
"executeScheduledJob",
"(",
"String",
"scheduledJobId",
")",
"{",
"ScheduledJob",
"scheduledJob",
"=",
"dataService",
".",
"findOneById",
"(",
"SCHEDULED_JOB",
",",
"scheduledJobId",
",",
"ScheduledJob",
".",
"class",
")",
";",
... | Executes a {@link ScheduledJob} in the current thread.
@param scheduledJobId ID of the {@link ScheduledJob} to run | [
"Executes",
"a",
"{",
"@link",
"ScheduledJob",
"}",
"in",
"the",
"current",
"thread",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-jobs/src/main/java/org/molgenis/jobs/JobExecutor.java#L67-L86 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MemberMap.java | MemberMap.cloneExcluding | static MemberMap cloneExcluding(MemberMap source, MemberImpl... excludeMembers) {
"""
Creates clone of source {@code MemberMap}, excluding given members.
If source is empty, same map instance will be returned. If excluded members are empty or not present in
source, a new map will be created containing the same m... | java | static MemberMap cloneExcluding(MemberMap source, MemberImpl... excludeMembers) {
if (source.size() == 0) {
return source;
}
Map<Address, MemberImpl> addressMap = new LinkedHashMap<>(source.addressToMemberMap);
Map<String, MemberImpl> uuidMap = new LinkedHashMap<>(source.uui... | [
"static",
"MemberMap",
"cloneExcluding",
"(",
"MemberMap",
"source",
",",
"MemberImpl",
"...",
"excludeMembers",
")",
"{",
"if",
"(",
"source",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"source",
";",
"}",
"Map",
"<",
"Address",
",",
"MemberI... | Creates clone of source {@code MemberMap}, excluding given members.
If source is empty, same map instance will be returned. If excluded members are empty or not present in
source, a new map will be created containing the same members with source.
@param source source map
@param excludeMembers members to exclud... | [
"Creates",
"clone",
"of",
"source",
"{",
"@code",
"MemberMap",
"}",
"excluding",
"given",
"members",
".",
"If",
"source",
"is",
"empty",
"same",
"map",
"instance",
"will",
"be",
"returned",
".",
"If",
"excluded",
"members",
"are",
"empty",
"or",
"not",
"pr... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MemberMap.java#L115-L136 |
mikepenz/FastAdapter | library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java | AdapterUtil.addAllSubItems | public static <Item extends IItem> void addAllSubItems(Item item, List<Item> items) {
"""
Gets all subItems from a given parent item
@param item the parent from which we add all items
@param items the list in which we add the subItems
"""
if (item instanceof IExpandable && !((IExpandable) item).is... | java | public static <Item extends IItem> void addAllSubItems(Item item, List<Item> items) {
if (item instanceof IExpandable && !((IExpandable) item).isExpanded() && ((IExpandable) item).getSubItems() != null) {
List<Item> subItems = (List<Item>) ((IExpandable<Item, ?>) item).getSubItems();
Ite... | [
"public",
"static",
"<",
"Item",
"extends",
"IItem",
">",
"void",
"addAllSubItems",
"(",
"Item",
"item",
",",
"List",
"<",
"Item",
">",
"items",
")",
"{",
"if",
"(",
"item",
"instanceof",
"IExpandable",
"&&",
"!",
"(",
"(",
"IExpandable",
")",
"item",
... | Gets all subItems from a given parent item
@param item the parent from which we add all items
@param items the list in which we add the subItems | [
"Gets",
"all",
"subItems",
"from",
"a",
"given",
"parent",
"item"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java#L77-L87 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java | DevicesInner.getUpdateSummary | public UpdateSummaryInner getUpdateSummary(String deviceName, String resourceGroupName) {
"""
Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device.
@param deviceName The device name.
@param res... | java | public UpdateSummaryInner getUpdateSummary(String deviceName, String resourceGroupName) {
return getUpdateSummaryWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body();
} | [
"public",
"UpdateSummaryInner",
"getUpdateSummary",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"getUpdateSummaryWithServiceResponseAsync",
"(",
"deviceName",
",",
"resourceGroupName",
")",
".",
"toBlocking",
"(",
")",
".",
"sing... | Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the... | [
"Gets",
"information",
"about",
"the",
"availability",
"of",
"updates",
"based",
"on",
"the",
"last",
"scan",
"of",
"the",
"device",
".",
"It",
"also",
"gets",
"information",
"about",
"any",
"ongoing",
"download",
"or",
"install",
"jobs",
"on",
"the",
"devic... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L2011-L2013 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/actions/MpJwtFatActions.java | MpJwtFatActions.getJwtTokenUsingBuilder | public String getJwtTokenUsingBuilder(String testName, LibertyServer server, List<NameValuePair> extraClaims) throws Exception {
"""
anyone calling this method needs to add upn to the extraClaims that it passes in (if they need it)
"""
return getJwtTokenUsingBuilder(testName, server, "defaultJWT_withAu... | java | public String getJwtTokenUsingBuilder(String testName, LibertyServer server, List<NameValuePair> extraClaims) throws Exception {
return getJwtTokenUsingBuilder(testName, server, "defaultJWT_withAudience", extraClaims);
} | [
"public",
"String",
"getJwtTokenUsingBuilder",
"(",
"String",
"testName",
",",
"LibertyServer",
"server",
",",
"List",
"<",
"NameValuePair",
">",
"extraClaims",
")",
"throws",
"Exception",
"{",
"return",
"getJwtTokenUsingBuilder",
"(",
"testName",
",",
"server",
","... | anyone calling this method needs to add upn to the extraClaims that it passes in (if they need it) | [
"anyone",
"calling",
"this",
"method",
"needs",
"to",
"add",
"upn",
"to",
"the",
"extraClaims",
"that",
"it",
"passes",
"in",
"(",
"if",
"they",
"need",
"it",
")"
] | 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/actions/MpJwtFatActions.java#L112-L114 |
zaproxy/zaproxy | src/org/zaproxy/zap/spider/URLCanonicalizer.java | URLCanonicalizer.createSortedParameters | private static SortedSet<QueryParameter> createSortedParameters(final String queryString) {
"""
Creates a sorted set with all the parameters from the given {@code query}, ordered lexicographically by name and value.
@param queryString the query string
@return a sorted set with all parameters, or {@code null} i... | java | private static SortedSet<QueryParameter> createSortedParameters(final String queryString) {
if (queryString == null || queryString.isEmpty()) {
return null;
}
final String[] pairs = queryString.split("&");
final SortedSet<QueryParameter> params = new TreeSet<>();
for (final String pair : pairs) {
if (... | [
"private",
"static",
"SortedSet",
"<",
"QueryParameter",
">",
"createSortedParameters",
"(",
"final",
"String",
"queryString",
")",
"{",
"if",
"(",
"queryString",
"==",
"null",
"||",
"queryString",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"... | Creates a sorted set with all the parameters from the given {@code query}, ordered lexicographically by name and value.
@param queryString the query string
@return a sorted set with all parameters, or {@code null} if the query string is {@code null} or empty. | [
"Creates",
"a",
"sorted",
"set",
"with",
"all",
"the",
"parameters",
"from",
"the",
"given",
"{",
"@code",
"query",
"}",
"ordered",
"lexicographically",
"by",
"name",
"and",
"value",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/URLCanonicalizer.java#L402-L430 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLConnection.java | URLConnection.getHeaderFieldInt | public int getHeaderFieldInt(String name, int Default) {
"""
Returns the value of the named field parsed as a number.
<p>
This form of <code>getHeaderField</code> exists because some
connection types (e.g., <code>http-ng</code>) have pre-parsed
headers. Classes for that connection type can override this method... | java | public int getHeaderFieldInt(String name, int Default) {
String value = getHeaderField(name);
try {
return Integer.parseInt(value);
} catch (Exception e) { }
return Default;
} | [
"public",
"int",
"getHeaderFieldInt",
"(",
"String",
"name",
",",
"int",
"Default",
")",
"{",
"String",
"value",
"=",
"getHeaderField",
"(",
"name",
")",
";",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"value",
")",
";",
"}",
"catch",
"(",
... | Returns the value of the named field parsed as a number.
<p>
This form of <code>getHeaderField</code> exists because some
connection types (e.g., <code>http-ng</code>) have pre-parsed
headers. Classes for that connection type can override this method
and short-circuit the parsing.
@param name the name of the he... | [
"Returns",
"the",
"value",
"of",
"the",
"named",
"field",
"parsed",
"as",
"a",
"number",
".",
"<p",
">",
"This",
"form",
"of",
"<code",
">",
"getHeaderField<",
"/",
"code",
">",
"exists",
"because",
"some",
"connection",
"types",
"(",
"e",
".",
"g",
".... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLConnection.java#L602-L608 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/api/UIServer.java | UIServer.getInstance | public static synchronized UIServer getInstance(boolean multiSession, Function<String, StatsStorage> statsStorageProvider)
throws RuntimeException {
"""
Get (and, initialize if necessary) the UI server.
Singleton pattern - all calls to getInstance() will return the same UI instance.
@param multiSession i... | java | public static synchronized UIServer getInstance(boolean multiSession, Function<String, StatsStorage> statsStorageProvider)
throws RuntimeException {
if (uiServer == null || uiServer.isStopped()) {
PlayUIServer playUIServer = new PlayUIServer(PlayUIServer.DEFAULT_UI_PORT, multiSession);
... | [
"public",
"static",
"synchronized",
"UIServer",
"getInstance",
"(",
"boolean",
"multiSession",
",",
"Function",
"<",
"String",
",",
"StatsStorage",
">",
"statsStorageProvider",
")",
"throws",
"RuntimeException",
"{",
"if",
"(",
"uiServer",
"==",
"null",
"||",
"uiS... | Get (and, initialize if necessary) the UI server.
Singleton pattern - all calls to getInstance() will return the same UI instance.
@param multiSession in multi-session mode, multiple training sessions can be visualized in separate browser tabs.
<br/>URL path will include session ID as a parameter, i.e.: /train becomes ... | [
"Get",
"(",
"and",
"initialize",
"if",
"necessary",
")",
"the",
"UI",
"server",
".",
"Singleton",
"pattern",
"-",
"all",
"calls",
"to",
"getInstance",
"()",
"will",
"return",
"the",
"same",
"UI",
"instance",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/api/UIServer.java#L59-L81 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/math/ArrayMath.java | ArrayMath.sigLevelByApproxRand | public static double sigLevelByApproxRand(double[] A, double[] B, int iterations) {
"""
Takes a pair of arrays, A and B, which represent corresponding
outcomes of a pair of random variables: say, results for two different
classifiers on a sequence of inputs. Returns the estimated
probability that the differenc... | java | public static double sigLevelByApproxRand(double[] A, double[] B, int iterations) {
if (A.length == 0)
throw new IllegalArgumentException("Input arrays must not be empty!");
if (A.length != B.length)
throw new IllegalArgumentException("Input arrays must have equal length!");
if (iterations ... | [
"public",
"static",
"double",
"sigLevelByApproxRand",
"(",
"double",
"[",
"]",
"A",
",",
"double",
"[",
"]",
"B",
",",
"int",
"iterations",
")",
"{",
"if",
"(",
"A",
".",
"length",
"==",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Input... | Takes a pair of arrays, A and B, which represent corresponding
outcomes of a pair of random variables: say, results for two different
classifiers on a sequence of inputs. Returns the estimated
probability that the difference between the means of A and B is not
significant, that is, the significance level. This is com... | [
"Takes",
"a",
"pair",
"of",
"arrays",
"A",
"and",
"B",
"which",
"represent",
"corresponding",
"outcomes",
"of",
"a",
"pair",
"of",
"random",
"variables",
":",
"say",
"results",
"for",
"two",
"different",
"classifiers",
"on",
"a",
"sequence",
"of",
"inputs",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/math/ArrayMath.java#L1503-L1517 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201811/teamservice/CreateTeams.java | CreateTeams.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the TeamService.
TeamServiceInterface teamService = adManagerServices.get(session, TeamServiceInterface.class);
// Create a read/write team.
Team readWriteTeam = new Team()... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the TeamService.",
"TeamServiceInterface",
"teamService",
"=",
"adManagerServices",
".",
"get",
"(",
... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201811/teamservice/CreateTeams.java#L51-L78 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/math/IntMath.java | IntMath.checkedMultiply | public static int checkedMultiply(int a, int b) {
"""
Returns the product of {@code a} and {@code b}, provided it does not overflow.
@throws ArithmeticException if {@code a * b} overflows in signed {@code int} arithmetic
"""
long result = (long) a * b;
checkNoOverflow(result == (int) result);
re... | java | public static int checkedMultiply(int a, int b) {
long result = (long) a * b;
checkNoOverflow(result == (int) result);
return (int) result;
} | [
"public",
"static",
"int",
"checkedMultiply",
"(",
"int",
"a",
",",
"int",
"b",
")",
"{",
"long",
"result",
"=",
"(",
"long",
")",
"a",
"*",
"b",
";",
"checkNoOverflow",
"(",
"result",
"==",
"(",
"int",
")",
"result",
")",
";",
"return",
"(",
"int"... | Returns the product of {@code a} and {@code b}, provided it does not overflow.
@throws ArithmeticException if {@code a * b} overflows in signed {@code int} arithmetic | [
"Returns",
"the",
"product",
"of",
"{",
"@code",
"a",
"}",
"and",
"{",
"@code",
"b",
"}",
"provided",
"it",
"does",
"not",
"overflow",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/math/IntMath.java#L475-L479 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlGraphicsContext.java | VmlGraphicsContext.drawText | public void drawText(Object parent, String name, String text, Coordinate position, FontStyle style) {
"""
Draw a string of text onto the <code>GraphicsContext</code>.
@param parent
parent group object
@param name
The text's name.
@param text
The actual string content.
@param position
The upper left corne... | java | public void drawText(Object parent, String name, String text, Coordinate position, FontStyle style) {
if (isAttached()) {
Element element = helper.createOrUpdateElement(parent, name, "shape", null);
if (element != null) {
// Set position, style and content:
applyAbsolutePosition(element, position);
... | [
"public",
"void",
"drawText",
"(",
"Object",
"parent",
",",
"String",
"name",
",",
"String",
"text",
",",
"Coordinate",
"position",
",",
"FontStyle",
"style",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"Element",
"element",
"=",
"helper",
"."... | Draw a string of text onto the <code>GraphicsContext</code>.
@param parent
parent group object
@param name
The text's name.
@param text
The actual string content.
@param position
The upper left corner for the text to originate.
@param style
The styling object for the text. | [
"Draw",
"a",
"string",
"of",
"text",
"onto",
"the",
"<code",
">",
"GraphicsContext<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlGraphicsContext.java#L451-L466 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/AbstractInstallPlanJob.java | AbstractInstallPlanJob.installExtension | protected void installExtension(ExtensionId extensionId, String namespace, DefaultExtensionPlanTree parentBranch)
throws InstallException {
"""
Install provided extension.
@param extensionId the identifier of the extension to install
@param namespace the namespace where to install the extension
@param... | java | protected void installExtension(ExtensionId extensionId, String namespace, DefaultExtensionPlanTree parentBranch)
throws InstallException
{
installExtension(extensionId, false, namespace, parentBranch);
} | [
"protected",
"void",
"installExtension",
"(",
"ExtensionId",
"extensionId",
",",
"String",
"namespace",
",",
"DefaultExtensionPlanTree",
"parentBranch",
")",
"throws",
"InstallException",
"{",
"installExtension",
"(",
"extensionId",
",",
"false",
",",
"namespace",
",",
... | Install provided extension.
@param extensionId the identifier of the extension to install
@param namespace the namespace where to install the extension
@param parentBranch the children of the parent {@link DefaultExtensionPlanNode}
@throws InstallException error when trying to install provided extension | [
"Install",
"provided",
"extension",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/AbstractInstallPlanJob.java#L282-L286 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/JournalSet.java | JournalSet.getInputStream | public static EditLogInputStream getInputStream(JournalManager jm, long txid)
throws IOException {
"""
Get input stream from the given journal starting at txid.
Does not perform validation of the streams.
This should only be used for tailing inprogress streams!!!
"""
List<EditLogInputStream> stre... | java | public static EditLogInputStream getInputStream(JournalManager jm, long txid)
throws IOException {
List<EditLogInputStream> streams = new ArrayList<EditLogInputStream>();
jm.selectInputStreams(streams, txid, true, false);
if (streams.size() < 1) {
throw new IOException("Cannot obtain stream for ... | [
"public",
"static",
"EditLogInputStream",
"getInputStream",
"(",
"JournalManager",
"jm",
",",
"long",
"txid",
")",
"throws",
"IOException",
"{",
"List",
"<",
"EditLogInputStream",
">",
"streams",
"=",
"new",
"ArrayList",
"<",
"EditLogInputStream",
">",
"(",
")",
... | Get input stream from the given journal starting at txid.
Does not perform validation of the streams.
This should only be used for tailing inprogress streams!!! | [
"Get",
"input",
"stream",
"from",
"the",
"given",
"journal",
"starting",
"at",
"txid",
".",
"Does",
"not",
"perform",
"validation",
"of",
"the",
"streams",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/JournalSet.java#L1004-L1026 |
lestard/assertj-javafx | src/main/java/eu/lestard/assertj/javafx/api/FloatBindingAssert.java | FloatBindingAssert.hasValue | public FloatBindingAssert hasValue(Double expectedValue, Offset offset) {
"""
Verifies that the actual observable number has a value that is close to the given one by less then the given offset.
@param expectedValue the given value to compare the actual observables value to.
@param offset the given positive of... | java | public FloatBindingAssert hasValue(Double expectedValue, Offset offset){
new ObservableNumberValueAssertions(actual).hasValue(expectedValue, offset);
return this;
} | [
"public",
"FloatBindingAssert",
"hasValue",
"(",
"Double",
"expectedValue",
",",
"Offset",
"offset",
")",
"{",
"new",
"ObservableNumberValueAssertions",
"(",
"actual",
")",
".",
"hasValue",
"(",
"expectedValue",
",",
"offset",
")",
";",
"return",
"this",
";",
"}... | Verifies that the actual observable number has a value that is close to the given one by less then the given offset.
@param expectedValue the given value to compare the actual observables value to.
@param offset the given positive offset.
@return {@code this} assertion object.
@throws java.lang.NullPointerException ... | [
"Verifies",
"that",
"the",
"actual",
"observable",
"number",
"has",
"a",
"value",
"that",
"is",
"close",
"to",
"the",
"given",
"one",
"by",
"less",
"then",
"the",
"given",
"offset",
"."
] | train | https://github.com/lestard/assertj-javafx/blob/f6b4d22e542a5501c7c1c2fae8700b0f69b956c1/src/main/java/eu/lestard/assertj/javafx/api/FloatBindingAssert.java#L48-L52 |
wildfly-extras/wildfly-camel | common/src/main/java/org/wildfly/camel/utils/IllegalStateAssertion.java | IllegalStateAssertion.assertNotNull | public static <T> T assertNotNull(T value, String message) {
"""
Throws an IllegalStateException when the given value is null.
@return the value
"""
if (value == null)
throw new IllegalStateException(message);
return value;
} | java | public static <T> T assertNotNull(T value, String message) {
if (value == null)
throw new IllegalStateException(message);
return value;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"assertNotNull",
"(",
"T",
"value",
",",
"String",
"message",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"message",
")",
";",
"return",
"value",
";",
"}"
] | Throws an IllegalStateException when the given value is null.
@return the value | [
"Throws",
"an",
"IllegalStateException",
"when",
"the",
"given",
"value",
"is",
"null",
"."
] | train | https://github.com/wildfly-extras/wildfly-camel/blob/9ebd7e28574f277a6d5b583e8a4c357e1538c370/common/src/main/java/org/wildfly/camel/utils/IllegalStateAssertion.java#L48-L52 |
lordcodes/SnackbarBuilder | snackbarbuilder/src/main/java/com/github/andrewlord1990/snackbarbuilder/SnackbarWrapper.java | SnackbarWrapper.setAction | @NonNull
@SuppressWarnings("WeakerAccess")
public SnackbarWrapper setAction(@StringRes int actionText, OnClickListener actionClickListener) {
"""
Set the action to be displayed in the Snackbar and the callback to invoke when the action is clicked.
@param actionText String resource to display as an ... | java | @NonNull
@SuppressWarnings("WeakerAccess")
public SnackbarWrapper setAction(@StringRes int actionText, OnClickListener actionClickListener) {
snackbar.setAction(actionText, actionClickListener);
return this;
} | [
"@",
"NonNull",
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"SnackbarWrapper",
"setAction",
"(",
"@",
"StringRes",
"int",
"actionText",
",",
"OnClickListener",
"actionClickListener",
")",
"{",
"snackbar",
".",
"setAction",
"(",
"actionText",
","... | Set the action to be displayed in the Snackbar and the callback to invoke when the action is clicked.
@param actionText String resource to display as an action.
@param actionClickListener Callback to be invoked when the action is clicked.
@return This instance. | [
"Set",
"the",
"action",
"to",
"be",
"displayed",
"in",
"the",
"Snackbar",
"and",
"the",
"callback",
"to",
"invoke",
"when",
"the",
"action",
"is",
"clicked",
"."
] | train | https://github.com/lordcodes/SnackbarBuilder/blob/a104a753c78ed66940c19d295e141a521cf81d73/snackbarbuilder/src/main/java/com/github/andrewlord1990/snackbarbuilder/SnackbarWrapper.java#L148-L153 |
alkacon/opencms-core | src/org/opencms/publish/CmsPublishManager.java | CmsPublishManager.getPublishList | public CmsPublishList getPublishList(
CmsObject cms,
List<CmsResource> directPublishResources,
boolean directPublishSiblings) throws CmsException {
"""
Returns a publish list with all new/changed/deleted resources of the current (offline)
project that actually get published for a direct pu... | java | public CmsPublishList getPublishList(
CmsObject cms,
List<CmsResource> directPublishResources,
boolean directPublishSiblings) throws CmsException {
return getPublishList(cms, directPublishResources, directPublishSiblings, true);
} | [
"public",
"CmsPublishList",
"getPublishList",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"CmsResource",
">",
"directPublishResources",
",",
"boolean",
"directPublishSiblings",
")",
"throws",
"CmsException",
"{",
"return",
"getPublishList",
"(",
"cms",
",",
"directPubl... | Returns a publish list with all new/changed/deleted resources of the current (offline)
project that actually get published for a direct publish of a List of resources.<p>
@param cms the cms request context
@param directPublishResources the resources which will be directly published
@param directPublishSiblings <code>t... | [
"Returns",
"a",
"publish",
"list",
"with",
"all",
"new",
"/",
"changed",
"/",
"deleted",
"resources",
"of",
"the",
"current",
"(",
"offline",
")",
"project",
"that",
"actually",
"get",
"published",
"for",
"a",
"direct",
"publish",
"of",
"a",
"List",
"of",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishManager.java#L328-L334 |
BioPAX/Paxtools | paxtools-core/src/main/java/org/biopax/paxtools/controller/ObjectPropertyEditor.java | ObjectPropertyEditor.addRangeRestriction | public void addRangeRestriction(Class<? extends BioPAXElement> domain, Set<Class<? extends BioPAXElement>> ranges) {
"""
This method adds a range restriction to the property editor. e.g. All entityReferences of Proteins should be
ProteinReferences.
Note: All restrictions specified in the BioPAX specification i... | java | public void addRangeRestriction(Class<? extends BioPAXElement> domain, Set<Class<? extends BioPAXElement>> ranges)
{
this.restrictedRanges.put(domain, ranges);
} | [
"public",
"void",
"addRangeRestriction",
"(",
"Class",
"<",
"?",
"extends",
"BioPAXElement",
">",
"domain",
",",
"Set",
"<",
"Class",
"<",
"?",
"extends",
"BioPAXElement",
">",
">",
"ranges",
")",
"{",
"this",
".",
"restrictedRanges",
".",
"put",
"(",
"dom... | This method adds a range restriction to the property editor. e.g. All entityReferences of Proteins should be
ProteinReferences.
Note: All restrictions specified in the BioPAX specification is automatically created by the {@link EditorMap}
during initialization. Use this method if you need to add restrictions that are ... | [
"This",
"method",
"adds",
"a",
"range",
"restriction",
"to",
"the",
"property",
"editor",
".",
"e",
".",
"g",
".",
"All",
"entityReferences",
"of",
"Proteins",
"should",
"be",
"ProteinReferences",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/ObjectPropertyEditor.java#L141-L144 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/ECKey.java | ECKey.signMessage | public String signMessage(String message, @Nullable KeyParameter aesKey) throws KeyCrypterException {
"""
Signs a text message using the standard Bitcoin messaging signing format and returns the signature as a base64
encoded string.
@throws IllegalStateException if this ECKey does not have the private part.
@... | java | public String signMessage(String message, @Nullable KeyParameter aesKey) throws KeyCrypterException {
byte[] data = formatMessageForSigning(message);
Sha256Hash hash = Sha256Hash.twiceOf(data);
ECDSASignature sig = sign(hash, aesKey);
byte recId = findRecoveryId(hash, sig);
int h... | [
"public",
"String",
"signMessage",
"(",
"String",
"message",
",",
"@",
"Nullable",
"KeyParameter",
"aesKey",
")",
"throws",
"KeyCrypterException",
"{",
"byte",
"[",
"]",
"data",
"=",
"formatMessageForSigning",
"(",
"message",
")",
";",
"Sha256Hash",
"hash",
"=",... | Signs a text message using the standard Bitcoin messaging signing format and returns the signature as a base64
encoded string.
@throws IllegalStateException if this ECKey does not have the private part.
@throws KeyCrypterException if this ECKey is encrypted and no AESKey is provided or it does not decrypt the ECKey. | [
"Signs",
"a",
"text",
"message",
"using",
"the",
"standard",
"Bitcoin",
"messaging",
"signing",
"format",
"and",
"returns",
"the",
"signature",
"as",
"a",
"base64",
"encoded",
"string",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/ECKey.java#L872-L883 |
structr/structr | structr-rest/src/main/java/org/structr/rest/servlet/CsvServlet.java | CsvServlet.writeCsv | public static void writeCsv(final ResultStream<GraphObject> result, final Writer out, final String propertyView) throws IOException {
"""
Write list of objects to output
@param result
@param out
@param propertyView
@throws IOException
"""
final StringBuilder row = new StringBuilder();
boolean h... | java | public static void writeCsv(final ResultStream<GraphObject> result, final Writer out, final String propertyView) throws IOException {
final StringBuilder row = new StringBuilder();
boolean headerWritten = false;
for (final GraphObject obj : result) {
// Write column headers
if (!headerWritten... | [
"public",
"static",
"void",
"writeCsv",
"(",
"final",
"ResultStream",
"<",
"GraphObject",
">",
"result",
",",
"final",
"Writer",
"out",
",",
"final",
"String",
"propertyView",
")",
"throws",
"IOException",
"{",
"final",
"StringBuilder",
"row",
"=",
"new",
"Str... | Write list of objects to output
@param result
@param out
@param propertyView
@throws IOException | [
"Write",
"list",
"of",
"objects",
"to",
"output"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/servlet/CsvServlet.java#L607-L661 |
JodaOrg/joda-time | src/main/java/org/joda/time/LocalTime.java | LocalTime.fromMillisOfDay | public static LocalTime fromMillisOfDay(long millisOfDay, Chronology chrono) {
"""
Constructs a LocalTime from the specified millis of day using the
specified chronology.
<p>
The millisOfDay value may exceed the number of millis in one day,
but additional days will be ignored.
This method uses the UTC time zo... | java | public static LocalTime fromMillisOfDay(long millisOfDay, Chronology chrono) {
chrono = DateTimeUtils.getChronology(chrono).withUTC();
return new LocalTime(millisOfDay, chrono);
} | [
"public",
"static",
"LocalTime",
"fromMillisOfDay",
"(",
"long",
"millisOfDay",
",",
"Chronology",
"chrono",
")",
"{",
"chrono",
"=",
"DateTimeUtils",
".",
"getChronology",
"(",
"chrono",
")",
".",
"withUTC",
"(",
")",
";",
"return",
"new",
"LocalTime",
"(",
... | Constructs a LocalTime from the specified millis of day using the
specified chronology.
<p>
The millisOfDay value may exceed the number of millis in one day,
but additional days will be ignored.
This method uses the UTC time zone internally.
@param millisOfDay the number of milliseconds into a day to convert
@param c... | [
"Constructs",
"a",
"LocalTime",
"from",
"the",
"specified",
"millis",
"of",
"day",
"using",
"the",
"specified",
"chronology",
".",
"<p",
">",
"The",
"millisOfDay",
"value",
"may",
"exceed",
"the",
"number",
"of",
"millis",
"in",
"one",
"day",
"but",
"additio... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalTime.java#L204-L207 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/SerializationUtils.java | SerializationUtils.deserializeStateFromInputStream | public static <T extends State> void deserializeStateFromInputStream(InputStream is, T state) throws IOException {
"""
Deserialize/read a {@link State} instance from a file.
@param is {@link InputStream} containing the state.
@param state an empty {@link State} instance to deserialize into
@param <T> the {@li... | java | public static <T extends State> void deserializeStateFromInputStream(InputStream is, T state) throws IOException {
try (DataInputStream dis = (new DataInputStream(is))) {
state.readFields(dis);
}
} | [
"public",
"static",
"<",
"T",
"extends",
"State",
">",
"void",
"deserializeStateFromInputStream",
"(",
"InputStream",
"is",
",",
"T",
"state",
")",
"throws",
"IOException",
"{",
"try",
"(",
"DataInputStream",
"dis",
"=",
"(",
"new",
"DataInputStream",
"(",
"is... | Deserialize/read a {@link State} instance from a file.
@param is {@link InputStream} containing the state.
@param state an empty {@link State} instance to deserialize into
@param <T> the {@link State} object type
@throws IOException if it fails to deserialize the {@link State} instance | [
"Deserialize",
"/",
"read",
"a",
"{",
"@link",
"State",
"}",
"instance",
"from",
"a",
"file",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/SerializationUtils.java#L188-L192 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/io/ModbusRTUTransport.java | ModbusRTUTransport.readRequestData | private void readRequestData(int byteCount, BytesOutputStream out) throws IOException {
"""
Read the data for a request of a given fixed size
@param byteCount Byte count excluding the 2 byte CRC
@param out Output buffer to populate
@throws IOException If data cannot be read from the port
"""
... | java | private void readRequestData(int byteCount, BytesOutputStream out) throws IOException {
byteCount += 2;
byte inpBuf[] = new byte[byteCount];
readBytes(inpBuf, byteCount);
out.write(inpBuf, 0, byteCount);
} | [
"private",
"void",
"readRequestData",
"(",
"int",
"byteCount",
",",
"BytesOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"byteCount",
"+=",
"2",
";",
"byte",
"inpBuf",
"[",
"]",
"=",
"new",
"byte",
"[",
"byteCount",
"]",
";",
"readBytes",
"(",
"i... | Read the data for a request of a given fixed size
@param byteCount Byte count excluding the 2 byte CRC
@param out Output buffer to populate
@throws IOException If data cannot be read from the port | [
"Read",
"the",
"data",
"for",
"a",
"request",
"of",
"a",
"given",
"fixed",
"size"
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/io/ModbusRTUTransport.java#L56-L61 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java | LayoutRefiner.makeAtmBndQueues | private void makeAtmBndQueues(int[] path, int[] seqAt, IBond[] bndAt) {
"""
Internal - makes atom (seq) and bond priority queues for resolving
overlap. Only (acyclic - but not really) atoms and bonds in the shortest
path between the two atoms can resolve an overlap. We create prioritised
sequences of atoms/bond... | java | private void makeAtmBndQueues(int[] path, int[] seqAt, IBond[] bndAt) {
int len = path.length;
int i = (len - 1) / 2;
int j = i + 1;
int nSeqAt = 0;
int nBndAt = 0;
if (isOdd((path.length))) {
seqAt[nSeqAt++] = path[i--];
bndAt[nBndAt++] = bondMap.... | [
"private",
"void",
"makeAtmBndQueues",
"(",
"int",
"[",
"]",
"path",
",",
"int",
"[",
"]",
"seqAt",
",",
"IBond",
"[",
"]",
"bndAt",
")",
"{",
"int",
"len",
"=",
"path",
".",
"length",
";",
"int",
"i",
"=",
"(",
"len",
"-",
"1",
")",
"/",
"2",
... | Internal - makes atom (seq) and bond priority queues for resolving
overlap. Only (acyclic - but not really) atoms and bonds in the shortest
path between the two atoms can resolve an overlap. We create prioritised
sequences of atoms/bonds where the more central in the shortest path.
@param path shortest path between a... | [
"Internal",
"-",
"makes",
"atom",
"(",
"seq",
")",
"and",
"bond",
"priority",
"queues",
"for",
"resolving",
"overlap",
".",
"Only",
"(",
"acyclic",
"-",
"but",
"not",
"really",
")",
"atoms",
"and",
"bonds",
"in",
"the",
"shortest",
"path",
"between",
"th... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L959-L976 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Trigger.java | Trigger.evaluateTrigger | public static boolean evaluateTrigger(Trigger trigger, Double actualValue) {
"""
Evaluates the trigger against actualValue (passed as parameter).
@param trigger trigger to be evaluated.
@param actualValue value against the trigger to be evaluated.
@return true if the trigger should be fired so th... | java | public static boolean evaluateTrigger(Trigger trigger, Double actualValue) {
requireArgument(trigger != null, "Trigger cannot be null.");
requireArgument(actualValue != null, "Trigger cannot be evaulated against null.");
Double lowThreshold, highThreshold;
switch (trigger.type) {
... | [
"public",
"static",
"boolean",
"evaluateTrigger",
"(",
"Trigger",
"trigger",
",",
"Double",
"actualValue",
")",
"{",
"requireArgument",
"(",
"trigger",
"!=",
"null",
",",
"\"Trigger cannot be null.\"",
")",
";",
"requireArgument",
"(",
"actualValue",
"!=",
"null",
... | Evaluates the trigger against actualValue (passed as parameter).
@param trigger trigger to be evaluated.
@param actualValue value against the trigger to be evaluated.
@return true if the trigger should be fired so that notification will be sent otherwise false.
@throws SystemException If an error in eva... | [
"Evaluates",
"the",
"trigger",
"against",
"actualValue",
"(",
"passed",
"as",
"parameter",
")",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Trigger.java#L230-L262 |
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/SyncAgentsInner.java | SyncAgentsInner.createOrUpdate | public SyncAgentInner createOrUpdate(String resourceGroupName, String serverName, String syncAgentName, String syncDatabaseId) {
"""
Creates or updates a sync agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API ... | java | public SyncAgentInner createOrUpdate(String resourceGroupName, String serverName, String syncAgentName, String syncDatabaseId) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, syncAgentName, syncDatabaseId).toBlocking().last().body();
} | [
"public",
"SyncAgentInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"syncAgentName",
",",
"String",
"syncDatabaseId",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"se... | Creates or updates a sync agent.
@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 on which the sync agent is hosted.
@param syncAgentName The name of the sync agent.
... | [
"Creates",
"or",
"updates",
"a",
"sync",
"agent",
"."
] | 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/SyncAgentsInner.java#L289-L291 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java | Printer.createStandardPrinter | public static Printer createStandardPrinter(final Messages messages) {
"""
Create a printer with default i18n support provided by Messages. By default,
captured types ids are generated using hashcode.
@param messages Messages class to be used for i18n
@return printer visitor instance
"""
return ne... | java | public static Printer createStandardPrinter(final Messages messages) {
return new Printer() {
@Override
protected String localize(Locale locale, String key, Object... args) {
return messages.getLocalizedString(locale, key, args);
}
@Override
... | [
"public",
"static",
"Printer",
"createStandardPrinter",
"(",
"final",
"Messages",
"messages",
")",
"{",
"return",
"new",
"Printer",
"(",
")",
"{",
"@",
"Override",
"protected",
"String",
"localize",
"(",
"Locale",
"locale",
",",
"String",
"key",
",",
"Object",... | Create a printer with default i18n support provided by Messages. By default,
captured types ids are generated using hashcode.
@param messages Messages class to be used for i18n
@return printer visitor instance | [
"Create",
"a",
"printer",
"with",
"default",
"i18n",
"support",
"provided",
"by",
"Messages",
".",
"By",
"default",
"captured",
"types",
"ids",
"are",
"generated",
"using",
"hashcode",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java#L85-L96 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/beans10/BeansDescriptorImpl.java | BeansDescriptorImpl.addNamespace | public BeansDescriptor addNamespace(String name, String value) {
"""
Adds a new namespace
@return the current instance of <code>BeansDescriptor</code>
"""
model.attribute(name, value);
return this;
} | java | public BeansDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"BeansDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>BeansDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/beans10/BeansDescriptorImpl.java#L85-L89 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/OutboundSSLSelections.java | OutboundSSLSelections.doesHostMatch | private boolean doesHostMatch(String connectionObjHost, String remoteHost) {
"""
/*
Method to check if the hostname's match. Will check for domains to match
if the connectionObjHost parameter starts with "*."
"""
boolean match = false;
if (remoteHost.equalsIgnoreCase(connectionObjHost))
... | java | private boolean doesHostMatch(String connectionObjHost, String remoteHost) {
boolean match = false;
if (remoteHost.equalsIgnoreCase(connectionObjHost))
match = true;
return match;
} | [
"private",
"boolean",
"doesHostMatch",
"(",
"String",
"connectionObjHost",
",",
"String",
"remoteHost",
")",
"{",
"boolean",
"match",
"=",
"false",
";",
"if",
"(",
"remoteHost",
".",
"equalsIgnoreCase",
"(",
"connectionObjHost",
")",
")",
"match",
"=",
"true",
... | /*
Method to check if the hostname's match. Will check for domains to match
if the connectionObjHost parameter starts with "*." | [
"/",
"*",
"Method",
"to",
"check",
"if",
"the",
"hostname",
"s",
"match",
".",
"Will",
"check",
"for",
"domains",
"to",
"match",
"if",
"the",
"connectionObjHost",
"parameter",
"starts",
"with",
"*",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/OutboundSSLSelections.java#L471-L478 |
apache/groovy | src/main/groovy/groovy/lang/MetaClassImpl.java | MetaClassImpl.invokeMethod | public Object invokeMethod(Object object, String methodName, Object arguments) {
"""
Invoke a method on the given object with the given arguments.
@param object The object the method should be invoked on.
@param methodName The name of the method to invoke.
@param arguments The arguments to the invoked method ... | java | public Object invokeMethod(Object object, String methodName, Object arguments) {
if (arguments == null) {
return invokeMethod(object, methodName, MetaClassHelper.EMPTY_ARRAY);
}
if (arguments instanceof Tuple) {
Tuple tuple = (Tuple) arguments;
return invokeMe... | [
"public",
"Object",
"invokeMethod",
"(",
"Object",
"object",
",",
"String",
"methodName",
",",
"Object",
"arguments",
")",
"{",
"if",
"(",
"arguments",
"==",
"null",
")",
"{",
"return",
"invokeMethod",
"(",
"object",
",",
"methodName",
",",
"MetaClassHelper",
... | Invoke a method on the given object with the given arguments.
@param object The object the method should be invoked on.
@param methodName The name of the method to invoke.
@param arguments The arguments to the invoked method as null, a Tuple, an array or a single argument of any type.
@return The result of the method... | [
"Invoke",
"a",
"method",
"on",
"the",
"given",
"object",
"with",
"the",
"given",
"arguments",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/MetaClassImpl.java#L815-L828 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractSegment3F.java | AbstractSegment3F.intersectsSegmentCapsule | @Pure
public static boolean intersectsSegmentCapsule(
double sx1, double sy1, double sz1, double sx2, double sy2, double sz2,
double mx1, double my1, double mz1, double mx2, double my2, double mz2, double radius) {
"""
Tests if the capsule is intersecting a segment.
@param sx1 x coordinate of the first p... | java | @Pure
public static boolean intersectsSegmentCapsule(
double sx1, double sy1, double sz1, double sx2, double sy2, double sz2,
double mx1, double my1, double mz1, double mx2, double my2, double mz2, double radius) {
double d = distanceSquaredSegmentSegment(
sx1, sy1, sz1, sx2, sy2, sz2,
mx1, my1, mz1, m... | [
"@",
"Pure",
"public",
"static",
"boolean",
"intersectsSegmentCapsule",
"(",
"double",
"sx1",
",",
"double",
"sy1",
",",
"double",
"sz1",
",",
"double",
"sx2",
",",
"double",
"sy2",
",",
"double",
"sz2",
",",
"double",
"mx1",
",",
"double",
"my1",
",",
"... | Tests if the capsule is intersecting a segment.
@param sx1 x coordinate of the first point of the segment.
@param sy1 y coordinate of the first point of the segment.
@param sz1 z coordinate of the first point of the segment.
@param sx2 x coordinate of the second point of the segment.
@param sy2 y coordinate of the sec... | [
"Tests",
"if",
"the",
"capsule",
"is",
"intersecting",
"a",
"segment",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractSegment3F.java#L204-L212 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractNpmAnalyzer.java | AbstractNpmAnalyzer.processPackage | protected void processPackage(Engine engine, Dependency dependency, JsonArray jsonArray, String depType) {
"""
Processes a part of package.json (as defined by JsonArray) and update the
specified dependency with relevant info.
@param engine the dependency-check engine
@param dependency the Dependency to update... | java | protected void processPackage(Engine engine, Dependency dependency, JsonArray jsonArray, String depType) {
final JsonObjectBuilder builder = Json.createObjectBuilder();
jsonArray.getValuesAs(JsonString.class).forEach((str) -> {
builder.add(str.toString(), "");
} | [
"protected",
"void",
"processPackage",
"(",
"Engine",
"engine",
",",
"Dependency",
"dependency",
",",
"JsonArray",
"jsonArray",
",",
"String",
"depType",
")",
"{",
"final",
"JsonObjectBuilder",
"builder",
"=",
"Json",
".",
"createObjectBuilder",
"(",
")",
";",
"... | Processes a part of package.json (as defined by JsonArray) and update the
specified dependency with relevant info.
@param engine the dependency-check engine
@param dependency the Dependency to update
@param jsonArray the jsonArray to parse
@param depType the dependency type | [
"Processes",
"a",
"part",
"of",
"package",
".",
"json",
"(",
"as",
"defined",
"by",
"JsonArray",
")",
"and",
"update",
"the",
"specified",
"dependency",
"with",
"relevant",
"info",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractNpmAnalyzer.java#L171-L175 |
cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java | MmffAtomTypeMatcher.assignHydrogenTypes | private void assignHydrogenTypes(IAtomContainer container, String[] symbs, int[][] graph) {
"""
Hydrogen types, assigned based on the MMFFHDEF.PAR parent associations.
@param container input structure representation
@param symbs symbolic atom types
@param graph adjacency list graph
"""
for... | java | private void assignHydrogenTypes(IAtomContainer container, String[] symbs, int[][] graph) {
for (int v = 0; v < graph.length; v++) {
if (container.getAtom(v).getSymbol().equals("H") && graph[v].length == 1) {
int w = graph[v][0];
symbs[v] = this.hydrogenMap.get(symbs[... | [
"private",
"void",
"assignHydrogenTypes",
"(",
"IAtomContainer",
"container",
",",
"String",
"[",
"]",
"symbs",
",",
"int",
"[",
"]",
"[",
"]",
"graph",
")",
"{",
"for",
"(",
"int",
"v",
"=",
"0",
";",
"v",
"<",
"graph",
".",
"length",
";",
"v",
"+... | Hydrogen types, assigned based on the MMFFHDEF.PAR parent associations.
@param container input structure representation
@param symbs symbolic atom types
@param graph adjacency list graph | [
"Hydrogen",
"types",
"assigned",
"based",
"on",
"the",
"MMFFHDEF",
".",
"PAR",
"parent",
"associations",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java#L187-L194 |
ralscha/extdirectspring | src/main/java/ch/ralscha/extdirectspring/util/JsonHandler.java | JsonHandler.readValue | public Object readValue(InputStream is, Class<Object> clazz) {
"""
Converts a JSON string into an object. The input is read from an InputStream. In
case of an exception returns null and logs the exception.
@param is a InputStream
@param clazz class of object to create
@return the converted object, null if th... | java | public Object readValue(InputStream is, Class<Object> clazz) {
try {
return this.mapper.readValue(is, clazz);
}
catch (Exception e) {
LogFactory.getLog(JsonHandler.class).info("deserialize json to object", e);
return null;
}
} | [
"public",
"Object",
"readValue",
"(",
"InputStream",
"is",
",",
"Class",
"<",
"Object",
">",
"clazz",
")",
"{",
"try",
"{",
"return",
"this",
".",
"mapper",
".",
"readValue",
"(",
"is",
",",
"clazz",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")"... | Converts a JSON string into an object. The input is read from an InputStream. In
case of an exception returns null and logs the exception.
@param is a InputStream
@param clazz class of object to create
@return the converted object, null if there is an exception | [
"Converts",
"a",
"JSON",
"string",
"into",
"an",
"object",
".",
"The",
"input",
"is",
"read",
"from",
"an",
"InputStream",
".",
"In",
"case",
"of",
"an",
"exception",
"returns",
"null",
"and",
"logs",
"the",
"exception",
"."
] | train | https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/util/JsonHandler.java#L142-L150 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/iterable/S3Versions.java | S3Versions.forKey | public static S3Versions forKey(AmazonS3 s3, String bucketName, String key) {
"""
Constructs an iterable that covers the versions of a single Amazon S3
object.
@param s3
The Amazon S3 client.
@param bucketName
The bucket name.
@param key
The key.
@return An iterator for object version summaries.
"""
... | java | public static S3Versions forKey(AmazonS3 s3, String bucketName, String key) {
S3Versions versions = new S3Versions(s3, bucketName);
versions.key = key;
return versions;
} | [
"public",
"static",
"S3Versions",
"forKey",
"(",
"AmazonS3",
"s3",
",",
"String",
"bucketName",
",",
"String",
"key",
")",
"{",
"S3Versions",
"versions",
"=",
"new",
"S3Versions",
"(",
"s3",
",",
"bucketName",
")",
";",
"versions",
".",
"key",
"=",
"key",
... | Constructs an iterable that covers the versions of a single Amazon S3
object.
@param s3
The Amazon S3 client.
@param bucketName
The bucket name.
@param key
The key.
@return An iterator for object version summaries. | [
"Constructs",
"an",
"iterable",
"that",
"covers",
"the",
"versions",
"of",
"a",
"single",
"Amazon",
"S3",
"object",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/iterable/S3Versions.java#L96-L100 |
Wikidata/Wikidata-Toolkit | wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/WbEditingAction.java | WbEditingAction.wbSetClaim | public JsonNode wbSetClaim(String statement,
boolean bot, long baserevid, String summary)
throws IOException, MediaWikiApiErrorException {
"""
Executes the API action "wbsetclaim" for the given parameters.
@param statement
the JSON serialization of claim to add or delete.
@param bot
if true, edits wi... | java | public JsonNode wbSetClaim(String statement,
boolean bot, long baserevid, String summary)
throws IOException, MediaWikiApiErrorException {
Validate.notNull(statement,
"Statement parameter cannot be null when adding or changing a statement");
Map<String, String> parameters = new HashMap<String, Str... | [
"public",
"JsonNode",
"wbSetClaim",
"(",
"String",
"statement",
",",
"boolean",
"bot",
",",
"long",
"baserevid",
",",
"String",
"summary",
")",
"throws",
"IOException",
",",
"MediaWikiApiErrorException",
"{",
"Validate",
".",
"notNull",
"(",
"statement",
",",
"\... | Executes the API action "wbsetclaim" for the given parameters.
@param statement
the JSON serialization of claim to add or delete.
@param bot
if true, edits will be flagged as "bot edits" provided that
the logged in user is in the bot group; for regular users, the
flag will just be ignored
@param baserevid
the revision... | [
"Executes",
"the",
"API",
"action",
"wbsetclaim",
"for",
"the",
"given",
"parameters",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/WbEditingAction.java#L540-L551 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java | CommandExecutionSpec.copyToRemoteFile | @Given("^I outbound copy '(.+?)' through a ssh connection to '(.+?)'$")
public void copyToRemoteFile(String localPath, String remotePath) throws Exception {
"""
Copies file/s from local system to remote system
@param remotePath path where file is going to be copy
@param localPath path where file is locate... | java | @Given("^I outbound copy '(.+?)' through a ssh connection to '(.+?)'$")
public void copyToRemoteFile(String localPath, String remotePath) throws Exception {
commonspec.getRemoteSSHConnection().copyTo(localPath, remotePath);
} | [
"@",
"Given",
"(",
"\"^I outbound copy '(.+?)' through a ssh connection to '(.+?)'$\"",
")",
"public",
"void",
"copyToRemoteFile",
"(",
"String",
"localPath",
",",
"String",
"remotePath",
")",
"throws",
"Exception",
"{",
"commonspec",
".",
"getRemoteSSHConnection",
"(",
"... | Copies file/s from local system to remote system
@param remotePath path where file is going to be copy
@param localPath path where file is located
@throws Exception exception | [
"Copies",
"file",
"/",
"s",
"from",
"local",
"system",
"to",
"remote",
"system"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java#L91-L94 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java | JDBC4CallableStatement.setDate | @Override
public void setDate(String parameterName, Date x) throws SQLException {
"""
Sets the designated parameter to the given java.sql.Date value using the default time zone of the virtual machine that is running the application.
"""
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public void setDate(String parameterName, Date x) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setDate",
"(",
"String",
"parameterName",
",",
"Date",
"x",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Sets the designated parameter to the given java.sql.Date value using the default time zone of the virtual machine that is running the application. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"sql",
".",
"Date",
"value",
"using",
"the",
"default",
"time",
"zone",
"of",
"the",
"virtual",
"machine",
"that",
"is",
"running",
"the",
"application",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java#L719-L724 |
belaban/JGroups | src/org/jgroups/blocks/GridFile.java | GridFile.isChildOf | protected static boolean isChildOf(String parent, String child) {
"""
Verifies whether child is a child (dir or file) of parent
@param parent
@param child
@return True if child is a child, false otherwise
"""
if(parent == null || child == null)
return false;
if(!child.startsWith(... | java | protected static boolean isChildOf(String parent, String child) {
if(parent == null || child == null)
return false;
if(!child.startsWith(parent))
return false;
if(child.length() <= parent.length())
return false;
int from=parent.equals(File.separator)? ... | [
"protected",
"static",
"boolean",
"isChildOf",
"(",
"String",
"parent",
",",
"String",
"child",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
"||",
"child",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"!",
"child",
".",
"startsWith",
"(",
"par... | Verifies whether child is a child (dir or file) of parent
@param parent
@param child
@return True if child is a child, false otherwise | [
"Verifies",
"whether",
"child",
"is",
"a",
"child",
"(",
"dir",
"or",
"file",
")",
"of",
"parent"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/blocks/GridFile.java#L225-L237 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Fraction.java | Fraction.multipliedBy | public Fraction multipliedBy(final Fraction fraction) {
"""
<p>
Multiplies the value of this fraction by another, returning the result in reduced form.
</p>
@param fraction
the fraction to multiply by, must not be <code>null</code>
@return a <code>Fraction</code> instance with the resulting values
@throws ... | java | public Fraction multipliedBy(final Fraction fraction) {
if (fraction == null) {
throw new IllegalArgumentException("The fraction must not be null");
}
if (numerator == 0 || fraction.numerator == 0) {
return ZERO;
}
// knuth 4.5.1
// make sure we do... | [
"public",
"Fraction",
"multipliedBy",
"(",
"final",
"Fraction",
"fraction",
")",
"{",
"if",
"(",
"fraction",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The fraction must not be null\"",
")",
";",
"}",
"if",
"(",
"numerator",
"=="... | <p>
Multiplies the value of this fraction by another, returning the result in reduced form.
</p>
@param fraction
the fraction to multiply by, must not be <code>null</code>
@return a <code>Fraction</code> instance with the resulting values
@throws IllegalArgumentException
if the fraction is <code>null</code>
@throws Ar... | [
"<p",
">",
"Multiplies",
"the",
"value",
"of",
"this",
"fraction",
"by",
"another",
"returning",
"the",
"result",
"in",
"reduced",
"form",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Fraction.java#L927-L939 |
evernote/android-state | library/src/main/java/com/evernote/android/state/StateSaver.java | StateSaver.restoreInstanceState | @Nullable
public static <T extends View> Parcelable restoreInstanceState(@NonNull T target, @Nullable Parcelable state) {
"""
Restore the sate of the given view and return the super state of the parent class.
@param target The view containing fields annotated with {@link State}.
@param state The parcelabl... | java | @Nullable
public static <T extends View> Parcelable restoreInstanceState(@NonNull T target, @Nullable Parcelable state) {
return IMPL.restoreInstanceState(target, state);
} | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
"extends",
"View",
">",
"Parcelable",
"restoreInstanceState",
"(",
"@",
"NonNull",
"T",
"target",
",",
"@",
"Nullable",
"Parcelable",
"state",
")",
"{",
"return",
"IMPL",
".",
"restoreInstanceState",
"(",
"target"... | Restore the sate of the given view and return the super state of the parent class.
@param target The view containing fields annotated with {@link State}.
@param state The parcelable containing the view's state and its super sate.
@return The super state of teh parent class of the view. Usually it isn't {@code null}. | [
"Restore",
"the",
"sate",
"of",
"the",
"given",
"view",
"and",
"return",
"the",
"super",
"state",
"of",
"the",
"parent",
"class",
"."
] | train | https://github.com/evernote/android-state/blob/6d56c0c5709f330324ec23d39c3f70c9d59bf6d3/library/src/main/java/com/evernote/android/state/StateSaver.java#L74-L77 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java | Apptentive.getBodyFromApptentivePush | public static String getBodyFromApptentivePush(Map<String, String> data) {
"""
Use this method in your push receiver to get the notification body text you can use to
construct a {@link android.app.Notification} object.
@param data A {@link Map}<{@link String},{@link String}> containing the Apptentive Pus... | java | public static String getBodyFromApptentivePush(Map<String, String> data) {
try {
if (!ApptentiveInternal.checkRegistered()) {
return null;
}
if (data == null) {
return null;
}
return data.get(ApptentiveInternal.BODY_DEFAULT);
} catch (Exception e) {
ApptentiveLog.e(PUSH, e, "Exception whil... | [
"public",
"static",
"String",
"getBodyFromApptentivePush",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"data",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"ApptentiveInternal",
".",
"checkRegistered",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(... | Use this method in your push receiver to get the notification body text you can use to
construct a {@link android.app.Notification} object.
@param data A {@link Map}<{@link String},{@link String}> containing the Apptentive Push
data. Pass in what you receive in the the Service or BroadcastReceiver that is
used b... | [
"Use",
"this",
"method",
"in",
"your",
"push",
"receiver",
"to",
"get",
"the",
"notification",
"body",
"text",
"you",
"can",
"use",
"to",
"construct",
"a",
"{",
"@link",
"android",
".",
"app",
".",
"Notification",
"}",
"object",
"."
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java#L830-L844 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/storage/repository/FindOption.java | FindOption.get | public T get(@Nullable Map<FindOption<?>, ?> options) {
"""
Returns the value if this option exists in the specified {@code options} map.
Otherwise, the default value would be returned.
"""
if (options == null) {
return defaultValue();
}
@SuppressWarnings("unchecked")
... | java | public T get(@Nullable Map<FindOption<?>, ?> options) {
if (options == null) {
return defaultValue();
}
@SuppressWarnings("unchecked")
final T value = (T) options.get(this);
if (value == null) {
return defaultValue();
}
return value;
... | [
"public",
"T",
"get",
"(",
"@",
"Nullable",
"Map",
"<",
"FindOption",
"<",
"?",
">",
",",
"?",
">",
"options",
")",
"{",
"if",
"(",
"options",
"==",
"null",
")",
"{",
"return",
"defaultValue",
"(",
")",
";",
"}",
"@",
"SuppressWarnings",
"(",
"\"un... | Returns the value if this option exists in the specified {@code options} map.
Otherwise, the default value would be returned. | [
"Returns",
"the",
"value",
"if",
"this",
"option",
"exists",
"in",
"the",
"specified",
"{"
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/storage/repository/FindOption.java#L83-L95 |
ModeShape/modeshape | web/modeshape-webdav/src/main/java/org/modeshape/webdav/locking/ResourceLocks.java | ResourceLocks.generateTempLockedObjects | private LockedObject generateTempLockedObjects( String path ) {
"""
generates temporary LockedObjects for the resource at path and its parent folders. does not create new LockedObjects if
they already exist
@param path path to the (new) LockedObject
@return the LockedObject for path.
"""
if (!temp... | java | private LockedObject generateTempLockedObjects( String path ) {
if (!tempLocks.containsKey(path)) {
LockedObject returnObject = new LockedObject(this, path, temporary);
String parentPath = getParentPath(path);
if (parentPath != null) {
LockedObject parentLocke... | [
"private",
"LockedObject",
"generateTempLockedObjects",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"!",
"tempLocks",
".",
"containsKey",
"(",
"path",
")",
")",
"{",
"LockedObject",
"returnObject",
"=",
"new",
"LockedObject",
"(",
"this",
",",
"path",
",",
"... | generates temporary LockedObjects for the resource at path and its parent folders. does not create new LockedObjects if
they already exist
@param path path to the (new) LockedObject
@return the LockedObject for path. | [
"generates",
"temporary",
"LockedObjects",
"for",
"the",
"resource",
"at",
"path",
"and",
"its",
"parent",
"folders",
".",
"does",
"not",
"create",
"new",
"LockedObjects",
"if",
"they",
"already",
"exist"
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-webdav/src/main/java/org/modeshape/webdav/locking/ResourceLocks.java#L284-L297 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.addDelegateStaticMethod | public static MethodNode addDelegateStaticMethod(Expression delegate, ClassNode classNode, MethodNode delegateMethod, AnnotationNode markerAnnotation, Map<String, ClassNode> genericsPlaceholders, boolean noNullCheck) {
"""
Adds a static method to the given class node that delegates to the given method
and resolve... | java | public static MethodNode addDelegateStaticMethod(Expression delegate, ClassNode classNode, MethodNode delegateMethod, AnnotationNode markerAnnotation, Map<String, ClassNode> genericsPlaceholders, boolean noNullCheck) {
Parameter[] parameterTypes = delegateMethod.getParameters();
String declaredMethodNam... | [
"public",
"static",
"MethodNode",
"addDelegateStaticMethod",
"(",
"Expression",
"delegate",
",",
"ClassNode",
"classNode",
",",
"MethodNode",
"delegateMethod",
",",
"AnnotationNode",
"markerAnnotation",
",",
"Map",
"<",
"String",
",",
"ClassNode",
">",
"genericsPlacehol... | Adds a static method to the given class node that delegates to the given method
and resolves the object to invoke the method on from the given expression.
@param delegate The expression
@param classNode The class node
@param delegateMethod The delegate method
@param markerAnnotation A marker annotation to be added to ... | [
"Adds",
"a",
"static",
"method",
"to",
"the",
"given",
"class",
"node",
"that",
"delegates",
"to",
"the",
"given",
"method",
"and",
"resolves",
"the",
"object",
"to",
"invoke",
"the",
"method",
"on",
"from",
"the",
"given",
"expression",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L396-L434 |
alamkanak/Android-Week-View | library/src/main/java/com/alamkanak/weekview/WeekView.java | WeekView.isTimeAfterOrEquals | private boolean isTimeAfterOrEquals(Calendar time1, Calendar time2) {
"""
Checks if time1 occurs after (or at the same time) time2.
@param time1 The time to check.
@param time2 The time to check against.
@return true if time1 and time2 are equal or if time1 is after time2. Otherwise false.
"""
retur... | java | private boolean isTimeAfterOrEquals(Calendar time1, Calendar time2) {
return !(time1 == null || time2 == null) && time1.getTimeInMillis() >= time2.getTimeInMillis();
} | [
"private",
"boolean",
"isTimeAfterOrEquals",
"(",
"Calendar",
"time1",
",",
"Calendar",
"time2",
")",
"{",
"return",
"!",
"(",
"time1",
"==",
"null",
"||",
"time2",
"==",
"null",
")",
"&&",
"time1",
".",
"getTimeInMillis",
"(",
")",
">=",
"time2",
".",
"... | Checks if time1 occurs after (or at the same time) time2.
@param time1 The time to check.
@param time2 The time to check against.
@return true if time1 and time2 are equal or if time1 is after time2. Otherwise false. | [
"Checks",
"if",
"time1",
"occurs",
"after",
"(",
"or",
"at",
"the",
"same",
"time",
")",
"time2",
"."
] | train | https://github.com/alamkanak/Android-Week-View/blob/dc3f97d65d44785d1a761b52b58527c86c4eee1b/library/src/main/java/com/alamkanak/weekview/WeekView.java#L1209-L1211 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_tcp_farm_POST | public OvhBackendTcp serviceName_tcp_farm_POST(String serviceName, OvhBalanceTCPEnum balance, String displayName, Long port, OvhBackendProbe probe, OvhStickinessTCPEnum stickiness, Long vrackNetworkId, String zone) throws IOException {
"""
Add a new TCP Farm on your IP Load Balancing
REST: POST /ipLoadbalancing... | java | public OvhBackendTcp serviceName_tcp_farm_POST(String serviceName, OvhBalanceTCPEnum balance, String displayName, Long port, OvhBackendProbe probe, OvhStickinessTCPEnum stickiness, Long vrackNetworkId, String zone) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/tcp/farm";
StringBuilder sb = pat... | [
"public",
"OvhBackendTcp",
"serviceName_tcp_farm_POST",
"(",
"String",
"serviceName",
",",
"OvhBalanceTCPEnum",
"balance",
",",
"String",
"displayName",
",",
"Long",
"port",
",",
"OvhBackendProbe",
"probe",
",",
"OvhStickinessTCPEnum",
"stickiness",
",",
"Long",
"vrackN... | Add a new TCP Farm on your IP Load Balancing
REST: POST /ipLoadbalancing/{serviceName}/tcp/farm
@param balance [required] Load balancing algorithm. 'roundrobin' if null
@param zone [required] Zone of your farm
@param stickiness [required] Stickiness type. No stickiness if null
@param port [required] Port attached to y... | [
"Add",
"a",
"new",
"TCP",
"Farm",
"on",
"your",
"IP",
"Load",
"Balancing"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1547-L1560 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/StringUtil.java | StringUtil.fromBytes | public static String fromBytes(byte[] bytes) {
"""
converts a byte array into a string using the current process engines default charset as
returned by {@link ProcessEngineConfigurationImpl#getDefaultCharset()}
@param bytes the byte array
@return a string representing the bytes
"""
EnsureUtil.ensureAc... | java | public static String fromBytes(byte[] bytes) {
EnsureUtil.ensureActiveCommandContext("StringUtil.fromBytes");
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
return fromBytes(bytes, processEngineConfiguration.getProcessEngine());
} | [
"public",
"static",
"String",
"fromBytes",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"EnsureUtil",
".",
"ensureActiveCommandContext",
"(",
"\"StringUtil.fromBytes\"",
")",
";",
"ProcessEngineConfigurationImpl",
"processEngineConfiguration",
"=",
"Context",
".",
"getProc... | converts a byte array into a string using the current process engines default charset as
returned by {@link ProcessEngineConfigurationImpl#getDefaultCharset()}
@param bytes the byte array
@return a string representing the bytes | [
"converts",
"a",
"byte",
"array",
"into",
"a",
"string",
"using",
"the",
"current",
"process",
"engines",
"default",
"charset",
"as",
"returned",
"by",
"{",
"@link",
"ProcessEngineConfigurationImpl#getDefaultCharset",
"()",
"}"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/StringUtil.java#L109-L113 |
alkacon/opencms-core | src/org/opencms/file/wrapper/CmsObjectWrapper.java | CmsObjectWrapper.createResource | public CmsResource createResource(String resourcename, int type, byte[] content, List<CmsProperty> properties)
throws CmsException, CmsIllegalArgumentException {
"""
Creates a new resource of the given resource type with the provided content and properties.<p>
Iterates through all configured resource wrappe... | java | public CmsResource createResource(String resourcename, int type, byte[] content, List<CmsProperty> properties)
throws CmsException, CmsIllegalArgumentException {
CmsResource res = null;
// iterate through all wrappers and call "createResource" till one does not return null
List<I_CmsResour... | [
"public",
"CmsResource",
"createResource",
"(",
"String",
"resourcename",
",",
"int",
"type",
",",
"byte",
"[",
"]",
"content",
",",
"List",
"<",
"CmsProperty",
">",
"properties",
")",
"throws",
"CmsException",
",",
"CmsIllegalArgumentException",
"{",
"CmsResource... | Creates a new resource of the given resource type with the provided content and properties.<p>
Iterates through all configured resource wrappers till the first returns not <code>null</code>.<p>
@see I_CmsResourceWrapper#createResource(CmsObject, String, int, byte[], List)
@see CmsObject#createResource(String, int, by... | [
"Creates",
"a",
"new",
"resource",
"of",
"the",
"given",
"resource",
"type",
"with",
"the",
"provided",
"content",
"and",
"properties",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsObjectWrapper.java#L184-L206 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/codec/RTMPProtocolEncoder.java | RTMPProtocolEncoder.encodeHeader | public IoBuffer encodeHeader(Header header, Header lastHeader) {
"""
Encode RTMP header.
@param header
RTMP message header
@param lastHeader
Previous header
@return Encoded header data
"""
final IoBuffer result = IoBuffer.allocate(calculateHeaderSize(header, lastHeader));
encodeHeader(... | java | public IoBuffer encodeHeader(Header header, Header lastHeader) {
final IoBuffer result = IoBuffer.allocate(calculateHeaderSize(header, lastHeader));
encodeHeader(header, lastHeader, result);
return result;
} | [
"public",
"IoBuffer",
"encodeHeader",
"(",
"Header",
"header",
",",
"Header",
"lastHeader",
")",
"{",
"final",
"IoBuffer",
"result",
"=",
"IoBuffer",
".",
"allocate",
"(",
"calculateHeaderSize",
"(",
"header",
",",
"lastHeader",
")",
")",
";",
"encodeHeader",
... | Encode RTMP header.
@param header
RTMP message header
@param lastHeader
Previous header
@return Encoded header data | [
"Encode",
"RTMP",
"header",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMPProtocolEncoder.java#L402-L406 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.infof | public void infof(String format, Object... params) {
"""
Issue a formatted log message with a level of INFO.
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param params the parameters
"""
doLogf(Level.INFO, FQCN, format, params, null... | java | public void infof(String format, Object... params) {
doLogf(Level.INFO, FQCN, format, params, null);
} | [
"public",
"void",
"infof",
"(",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLogf",
"(",
"Level",
".",
"INFO",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"null",
")",
";",
"}"
] | Issue a formatted log message with a level of INFO.
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param params the parameters | [
"Issue",
"a",
"formatted",
"log",
"message",
"with",
"a",
"level",
"of",
"INFO",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1124-L1126 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/TransitionInflater.java | TransitionInflater.inflateTransitionManager | @Nullable
public TransitionManager inflateTransitionManager(int resource, @NonNull ViewGroup sceneRoot) {
"""
Loads a {@link TransitionManager} object from a resource
@param resource The resource id of the transition manager to load
@return The loaded TransitionManager object
@throws android.content.res.R... | java | @Nullable
public TransitionManager inflateTransitionManager(int resource, @NonNull ViewGroup sceneRoot) {
XmlResourceParser parser = mContext.getResources().getXml(resource);
try {
return createTransitionManagerFromXml(parser, Xml.asAttributeSet(parser), sceneRoot);
} catch (XmlP... | [
"@",
"Nullable",
"public",
"TransitionManager",
"inflateTransitionManager",
"(",
"int",
"resource",
",",
"@",
"NonNull",
"ViewGroup",
"sceneRoot",
")",
"{",
"XmlResourceParser",
"parser",
"=",
"mContext",
".",
"getResources",
"(",
")",
".",
"getXml",
"(",
"resourc... | Loads a {@link TransitionManager} object from a resource
@param resource The resource id of the transition manager to load
@return The loaded TransitionManager object
@throws android.content.res.Resources.NotFoundException when the
transition manager cannot be loaded | [
"Loads",
"a",
"{",
"@link",
"TransitionManager",
"}",
"object",
"from",
"a",
"resource"
] | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/TransitionInflater.java#L109-L127 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.transformEntry | public static boolean transformEntry(File zip, String path, ZipEntryTransformer transformer, File destZip) {
"""
Copies an existing ZIP file and transforms a given entry in it.
@param zip
an existing ZIP file (only read).
@param path
new ZIP entry path.
@param transformer
transformer for the given ZIP entr... | java | public static boolean transformEntry(File zip, String path, ZipEntryTransformer transformer, File destZip) {
if(zip.equals(destZip)){throw new IllegalArgumentException("Input (" +zip.getAbsolutePath()+ ") is the same as the destination!" +
"Please use the transformEntry method without destination for in... | [
"public",
"static",
"boolean",
"transformEntry",
"(",
"File",
"zip",
",",
"String",
"path",
",",
"ZipEntryTransformer",
"transformer",
",",
"File",
"destZip",
")",
"{",
"if",
"(",
"zip",
".",
"equals",
"(",
"destZip",
")",
")",
"{",
"throw",
"new",
"Illega... | Copies an existing ZIP file and transforms a given entry in it.
@param zip
an existing ZIP file (only read).
@param path
new ZIP entry path.
@param transformer
transformer for the given ZIP entry.
@param destZip
new ZIP file created.
@throws IllegalArgumentException if the destination is the same as the location
@retu... | [
"Copies",
"an",
"existing",
"ZIP",
"file",
"and",
"transforms",
"a",
"given",
"entry",
"in",
"it",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2777-L2781 |
samskivert/samskivert | src/main/java/com/samskivert/util/Folds.java | Folds.reduceLeft | public static <A> A reduceLeft (F<A,A> func, Iterable<? extends A> values) {
"""
Reduces the supplied values using the supplied function with a left fold.
@exception NoSuchElementException thrown if values does not contain at least one element.
"""
Iterator<? extends A> iter = values.iterator();
... | java | public static <A> A reduceLeft (F<A,A> func, Iterable<? extends A> values)
{
Iterator<? extends A> iter = values.iterator();
A zero = iter.next();
while (iter.hasNext()) {
zero = func.apply(zero, iter.next());
}
return zero;
} | [
"public",
"static",
"<",
"A",
">",
"A",
"reduceLeft",
"(",
"F",
"<",
"A",
",",
"A",
">",
"func",
",",
"Iterable",
"<",
"?",
"extends",
"A",
">",
"values",
")",
"{",
"Iterator",
"<",
"?",
"extends",
"A",
">",
"iter",
"=",
"values",
".",
"iterator"... | Reduces the supplied values using the supplied function with a left fold.
@exception NoSuchElementException thrown if values does not contain at least one element. | [
"Reduces",
"the",
"supplied",
"values",
"using",
"the",
"supplied",
"function",
"with",
"a",
"left",
"fold",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Folds.java#L43-L51 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/seo/CmsSeoOptionsDialog.java | CmsSeoOptionsDialog.saveAliases | public void saveAliases(final CmsUUID uuid, final List<CmsAliasBean> aliases) {
"""
Saves the aliases for a given page.<p>
@param uuid the page structure id
@param aliases the aliases to save
"""
final CmsRpcAction<Void> action = new CmsRpcAction<Void>() {
/**
* @see... | java | public void saveAliases(final CmsUUID uuid, final List<CmsAliasBean> aliases) {
final CmsRpcAction<Void> action = new CmsRpcAction<Void>() {
/**
* @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
*/
@Override
public void execute() {
... | [
"public",
"void",
"saveAliases",
"(",
"final",
"CmsUUID",
"uuid",
",",
"final",
"List",
"<",
"CmsAliasBean",
">",
"aliases",
")",
"{",
"final",
"CmsRpcAction",
"<",
"Void",
">",
"action",
"=",
"new",
"CmsRpcAction",
"<",
"Void",
">",
"(",
")",
"{",
"/**\... | Saves the aliases for a given page.<p>
@param uuid the page structure id
@param aliases the aliases to save | [
"Saves",
"the",
"aliases",
"for",
"a",
"given",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/seo/CmsSeoOptionsDialog.java#L237-L263 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxFile.java | BoxFile.canUploadVersion | public boolean canUploadVersion(String name, long fileSize) {
"""
Checks if a new version of the file can be uploaded with the specified name and size.
@param name the new name for the file.
@param fileSize the size of the new version content in bytes.
@return whether or not the file version can be uploaded.
... | java | public boolean canUploadVersion(String name, long fileSize) {
URL url = CONTENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "OPTIONS");
JsonObject preflightInfo = new JsonObject();
if (name != null) {
... | [
"public",
"boolean",
"canUploadVersion",
"(",
"String",
"name",
",",
"long",
"fileSize",
")",
"{",
"URL",
"url",
"=",
"CONTENT_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"getID",
"(",... | Checks if a new version of the file can be uploaded with the specified name and size.
@param name the new name for the file.
@param fileSize the size of the new version content in bytes.
@return whether or not the file version can be uploaded. | [
"Checks",
"if",
"a",
"new",
"version",
"of",
"the",
"file",
"can",
"be",
"uploaded",
"with",
"the",
"specified",
"name",
"and",
"size",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFile.java#L688-L715 |
threerings/nenya | core/src/main/java/com/threerings/geom/GeomUtil.java | GeomUtil.nearestToLine | public static Point nearestToLine (Point p1, Point p2, Point p3, Point n) {
"""
Computes the point nearest to the specified point <code>p3</code> on the line defined by the
two points <code>p1</code> and <code>p2</code>. The computed point is stored into
<code>n</code>. <em>Note:</em> <code>p1</code> and <code>... | java | public static Point nearestToLine (Point p1, Point p2, Point p3, Point n)
{
// see http://astronomy.swin.edu.au/~pbourke/geometry/pointline/ for a (not very good)
// explanation of the math
int Ax = p2.x - p1.x, Ay = p2.y - p1.y;
float u = (p3.x - p1.x) * Ax + (p3.y - p1.y) * Ay;
... | [
"public",
"static",
"Point",
"nearestToLine",
"(",
"Point",
"p1",
",",
"Point",
"p2",
",",
"Point",
"p3",
",",
"Point",
"n",
")",
"{",
"// see http://astronomy.swin.edu.au/~pbourke/geometry/pointline/ for a (not very good)",
"// explanation of the math",
"int",
"Ax",
"=",... | Computes the point nearest to the specified point <code>p3</code> on the line defined by the
two points <code>p1</code> and <code>p2</code>. The computed point is stored into
<code>n</code>. <em>Note:</em> <code>p1</code> and <code>p2</code> must not be coincident.
@param p1 one point on the line.
@param p2 another p... | [
"Computes",
"the",
"point",
"nearest",
"to",
"the",
"specified",
"point",
"<code",
">",
"p3<",
"/",
"code",
">",
"on",
"the",
"line",
"defined",
"by",
"the",
"two",
"points",
"<code",
">",
"p1<",
"/",
"code",
">",
"and",
"<code",
">",
"p2<",
"/",
"co... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L91-L101 |
dadoonet/fscrawler | framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java | FsCrawlerUtil.readDefaultJsonVersionedFile | public static String readDefaultJsonVersionedFile(Path config, String version, String type) throws IOException {
"""
Reads a mapping from config/_default/version/type.json file
@param config Root dir where we can find the configuration (default to ~/.fscrawler)
@param version Elasticsearch major version number... | java | public static String readDefaultJsonVersionedFile(Path config, String version, String type) throws IOException {
Path defaultConfigDir = config.resolve("_default");
try {
return readJsonVersionedFile(defaultConfigDir, version, type);
} catch (NoSuchFileException e) {
thro... | [
"public",
"static",
"String",
"readDefaultJsonVersionedFile",
"(",
"Path",
"config",
",",
"String",
"version",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"Path",
"defaultConfigDir",
"=",
"config",
".",
"resolve",
"(",
"\"_default\"",
")",
";",
"tr... | Reads a mapping from config/_default/version/type.json file
@param config Root dir where we can find the configuration (default to ~/.fscrawler)
@param version Elasticsearch major version number (only major digit is kept so for 2.3.4 it will be 2)
@param type The expected type (will be expanded to type.json)
@return t... | [
"Reads",
"a",
"mapping",
"from",
"config",
"/",
"_default",
"/",
"version",
"/",
"type",
".",
"json",
"file"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java#L81-L89 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/LocalExceptionMappingStrategy.java | LocalExceptionMappingStrategy.mapCSITransactionRolledBackException | @Override
public Exception
mapCSITransactionRolledBackException(EJSDeployedSupport s, CSITransactionRolledbackException ex)
throws com.ibm.websphere.csi.CSIException {
"""
This method does not apply to EJB 3.0 business interfaces. All mappings
should be ... | java | @Override
public Exception
mapCSITransactionRolledBackException(EJSDeployedSupport s, CSITransactionRolledbackException ex)
throws com.ibm.websphere.csi.CSIException
{
//d180095
// Ensure root is set before doing the mapping.
if (s.... | [
"@",
"Override",
"public",
"Exception",
"mapCSITransactionRolledBackException",
"(",
"EJSDeployedSupport",
"s",
",",
"CSITransactionRolledbackException",
"ex",
")",
"throws",
"com",
".",
"ibm",
".",
"websphere",
".",
"csi",
".",
"CSIException",
"{",
"//d180095",
"// E... | This method does not apply to EJB 3.0 business interfaces. All mappings
should be based on the EJB 2.1 specification, and the exceptions new
in EJB 3.0 should not be used, even for EJB 2.1 component interfaces
in an EJB 3.0 module. <p> | [
"This",
"method",
"does",
"not",
"apply",
"to",
"EJB",
"3",
".",
"0",
"business",
"interfaces",
".",
"All",
"mappings",
"should",
"be",
"based",
"on",
"the",
"EJB",
"2",
".",
"1",
"specification",
"and",
"the",
"exceptions",
"new",
"in",
"EJB",
"3",
".... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/LocalExceptionMappingStrategy.java#L490-L515 |
haifengl/smile | demo/src/main/java/smile/demo/projection/LDADemo.java | LDADemo.learn | public JComponent learn() {
"""
Execute the projection algorithm and return a swing JComponent representing
the clusters.
"""
double[][] data = dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
String[] names = dataset[datasetIndex].toArray(new String[dataset[datasetI... | java | public JComponent learn() {
double[][] data = dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
String[] names = dataset[datasetIndex].toArray(new String[dataset[datasetIndex].size()]);
if (names[0] == null) {
names = null;
}
int[] l... | [
"public",
"JComponent",
"learn",
"(",
")",
"{",
"double",
"[",
"]",
"[",
"]",
"data",
"=",
"dataset",
"[",
"datasetIndex",
"]",
".",
"toArray",
"(",
"new",
"double",
"[",
"dataset",
"[",
"datasetIndex",
"]",
".",
"size",
"(",
")",
"]",
"[",
"",
"]"... | Execute the projection algorithm and return a swing JComponent representing
the clusters. | [
"Execute",
"the",
"projection",
"algorithm",
"and",
"return",
"a",
"swing",
"JComponent",
"representing",
"the",
"clusters",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/demo/src/main/java/smile/demo/projection/LDADemo.java#L90-L124 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/PropertiesLoaderUtils.java | PropertiesLoaderUtils.fillProperties | public static void fillProperties(Properties props, String resourceName)
throws IOException {
"""
Fill the given properties from the specified class path resource (in ISO-8859-1 encoding).
<p>Merges properties if more than one resource of the same name
found in the class path.</p>
@param props the... | java | public static void fillProperties(Properties props, String resourceName)
throws IOException {
fillProperties(props, resourceName, AspectranClassLoader.getDefaultClassLoader());
} | [
"public",
"static",
"void",
"fillProperties",
"(",
"Properties",
"props",
",",
"String",
"resourceName",
")",
"throws",
"IOException",
"{",
"fillProperties",
"(",
"props",
",",
"resourceName",
",",
"AspectranClassLoader",
".",
"getDefaultClassLoader",
"(",
")",
")",... | Fill the given properties from the specified class path resource (in ISO-8859-1 encoding).
<p>Merges properties if more than one resource of the same name
found in the class path.</p>
@param props the Properties instance to load into
@param resourceName the name of the class path resource
@throws IOException if loadin... | [
"Fill",
"the",
"given",
"properties",
"from",
"the",
"specified",
"class",
"path",
"resource",
"(",
"in",
"ISO",
"-",
"8859",
"-",
"1",
"encoding",
")",
".",
"<p",
">",
"Merges",
"properties",
"if",
"more",
"than",
"one",
"resource",
"of",
"the",
"same",... | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/PropertiesLoaderUtils.java#L88-L91 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.