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 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.json4j/src/com/ibm/json/java/JSONArray.java | JSONArray.parse | static public JSONArray parse(InputStream is) throws IOException {
"""
Convert a stream of JSONArray text into JSONArray form.
@param is The inputStream from which to read the JSON. It will assume the input stream is in UTF-8 and read it as such.
@return The contructed JSONArray Object.
@throws IOEXception T... | java | static public JSONArray parse(InputStream is) throws IOException {
InputStreamReader isr = null;
try
{
isr = new InputStreamReader(is, "UTF-8");
}
catch (Exception ex)
{
isr = new InputStreamReader(is);
}
return parse(isr);
} | [
"static",
"public",
"JSONArray",
"parse",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"InputStreamReader",
"isr",
"=",
"null",
";",
"try",
"{",
"isr",
"=",
"new",
"InputStreamReader",
"(",
"is",
",",
"\"UTF-8\"",
")",
";",
"}",
"catch",
"(... | Convert a stream of JSONArray text into JSONArray form.
@param is The inputStream from which to read the JSON. It will assume the input stream is in UTF-8 and read it as such.
@return The contructed JSONArray Object.
@throws IOEXception Thrown if an underlying IO error from the stream occurs, or if malformed JSON is ... | [
"Convert",
"a",
"stream",
"of",
"JSONArray",
"text",
"into",
"JSONArray",
"form",
".",
"@param",
"is",
"The",
"inputStream",
"from",
"which",
"to",
"read",
"the",
"JSON",
".",
"It",
"will",
"assume",
"the",
"input",
"stream",
"is",
"in",
"UTF",
"-",
"8",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/java/JSONArray.java#L121-L132 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDLoss.java | SDLoss.softmaxCrossEntropy | public SDVariable softmaxCrossEntropy(String name, @NonNull SDVariable label, @NonNull SDVariable predictions, @NonNull LossReduce lossReduce) {
"""
See {@link #softmaxCrossEntropy(String, SDVariable, SDVariable, SDVariable, LossReduce, double)}.
"""
return softmaxCrossEntropy(name, label, predictions,... | java | public SDVariable softmaxCrossEntropy(String name, @NonNull SDVariable label, @NonNull SDVariable predictions, @NonNull LossReduce lossReduce) {
return softmaxCrossEntropy(name, label, predictions, null, lossReduce, SoftmaxCrossEntropyLoss.DEFAULT_LABEL_SMOOTHING);
} | [
"public",
"SDVariable",
"softmaxCrossEntropy",
"(",
"String",
"name",
",",
"@",
"NonNull",
"SDVariable",
"label",
",",
"@",
"NonNull",
"SDVariable",
"predictions",
",",
"@",
"NonNull",
"LossReduce",
"lossReduce",
")",
"{",
"return",
"softmaxCrossEntropy",
"(",
"na... | See {@link #softmaxCrossEntropy(String, SDVariable, SDVariable, SDVariable, LossReduce, double)}. | [
"See",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDLoss.java#L479-L481 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.containsAnyEntry | public static boolean containsAnyEntry(File zip, String[] names) {
"""
Checks if the ZIP file contains any of the given entries.
@param zip
ZIP file.
@param names
entry names.
@return <code>true</code> if the ZIP file contains any of the given
entries.
"""
ZipFile zf = null;
try {
zf = ne... | java | public static boolean containsAnyEntry(File zip, String[] names) {
ZipFile zf = null;
try {
zf = new ZipFile(zip);
for (int i = 0; i < names.length; i++) {
if (zf.getEntry(names[i]) != null) {
return true;
}
}
return false;
}
catch (IOException e) {
... | [
"public",
"static",
"boolean",
"containsAnyEntry",
"(",
"File",
"zip",
",",
"String",
"[",
"]",
"names",
")",
"{",
"ZipFile",
"zf",
"=",
"null",
";",
"try",
"{",
"zf",
"=",
"new",
"ZipFile",
"(",
"zip",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Checks if the ZIP file contains any of the given entries.
@param zip
ZIP file.
@param names
entry names.
@return <code>true</code> if the ZIP file contains any of the given
entries. | [
"Checks",
"if",
"the",
"ZIP",
"file",
"contains",
"any",
"of",
"the",
"given",
"entries",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L155-L172 |
h2oai/h2o-2 | src/main/java/water/api/Models.java | Models.summarizeSpeeDRFModel | private static void summarizeSpeeDRFModel(ModelSummary summary, hex.singlenoderf.SpeeDRFModel model) {
"""
Summarize fields which are specific to hex.drf.DRF.SpeeDRFModel.
"""
// add generic fields such as column names
summarizeModelCommonFields(summary, model);
summary.model_algorithm = "Random F... | java | private static void summarizeSpeeDRFModel(ModelSummary summary, hex.singlenoderf.SpeeDRFModel model) {
// add generic fields such as column names
summarizeModelCommonFields(summary, model);
summary.model_algorithm = "Random Forest";
JsonObject all_params = (model.get_params()).toJSON();
summary.cr... | [
"private",
"static",
"void",
"summarizeSpeeDRFModel",
"(",
"ModelSummary",
"summary",
",",
"hex",
".",
"singlenoderf",
".",
"SpeeDRFModel",
"model",
")",
"{",
"// add generic fields such as column names",
"summarizeModelCommonFields",
"(",
"summary",
",",
"model",
")",
... | Summarize fields which are specific to hex.drf.DRF.SpeeDRFModel. | [
"Summarize",
"fields",
"which",
"are",
"specific",
"to",
"hex",
".",
"drf",
".",
"DRF",
".",
"SpeeDRFModel",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/Models.java#L289-L299 |
Stratio/bdt | src/main/java/com/stratio/qa/utils/MongoDBUtils.java | MongoDBUtils.insertDocIntoMongoDBCollection | public void insertDocIntoMongoDBCollection(String collection, String document) {
"""
Insert document in a MongoDB Collection.
@param collection
@param document
"""
DBObject dbObject = (DBObject) JSON.parse(document);
this.dataBase.getCollection(collection).insert(dbObject);
} | java | public void insertDocIntoMongoDBCollection(String collection, String document) {
DBObject dbObject = (DBObject) JSON.parse(document);
this.dataBase.getCollection(collection).insert(dbObject);
} | [
"public",
"void",
"insertDocIntoMongoDBCollection",
"(",
"String",
"collection",
",",
"String",
"document",
")",
"{",
"DBObject",
"dbObject",
"=",
"(",
"DBObject",
")",
"JSON",
".",
"parse",
"(",
"document",
")",
";",
"this",
".",
"dataBase",
".",
"getCollecti... | Insert document in a MongoDB Collection.
@param collection
@param document | [
"Insert",
"document",
"in",
"a",
"MongoDB",
"Collection",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/MongoDBUtils.java#L223-L228 |
reactor/reactor-netty | src/main/java/reactor/netty/http/client/HttpClient.java | HttpClient.wiretap | public final HttpClient wiretap(boolean enable) {
"""
Apply or remove a wire logger configuration using {@link HttpClient} category
and {@code DEBUG} logger level
@param enable Specifies whether the wire logger configuration will be added to
the pipeline
@return a new {@link HttpClient}
"""
if (enable)... | java | public final HttpClient wiretap(boolean enable) {
if (enable) {
return tcpConfiguration(tcpClient -> tcpClient.bootstrap(b -> BootstrapHandlers.updateLogSupport(b, LOGGING_HANDLER)));
}
else {
return tcpConfiguration(tcpClient -> tcpClient.bootstrap(
b -> BootstrapHandlers.removeConfiguration(b, ... | [
"public",
"final",
"HttpClient",
"wiretap",
"(",
"boolean",
"enable",
")",
"{",
"if",
"(",
"enable",
")",
"{",
"return",
"tcpConfiguration",
"(",
"tcpClient",
"->",
"tcpClient",
".",
"bootstrap",
"(",
"b",
"->",
"BootstrapHandlers",
".",
"updateLogSupport",
"(... | Apply or remove a wire logger configuration using {@link HttpClient} category
and {@code DEBUG} logger level
@param enable Specifies whether the wire logger configuration will be added to
the pipeline
@return a new {@link HttpClient} | [
"Apply",
"or",
"remove",
"a",
"wire",
"logger",
"configuration",
"using",
"{",
"@link",
"HttpClient",
"}",
"category",
"and",
"{",
"@code",
"DEBUG",
"}",
"logger",
"level"
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/client/HttpClient.java#L813-L821 |
roboconf/roboconf-platform | miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/TextUtils.java | TextUtils.findRegionFromSelection | public static SelectionRange findRegionFromSelection( String fullText, int selectionOffset, int selectionLength ) {
"""
Finds the region that includes both the given selection and entire lines.
<p>
Invalid values for the selection settings are fixed by this method.
</p>
@param fullText the full text
@param ... | java | public static SelectionRange findRegionFromSelection( String fullText, int selectionOffset, int selectionLength ) {
// Find the whole lines that match the selection (start)
int newSselectionOffset = TextUtils.fixSelectionOffset( fullText, selectionOffset );
// Modifying the offset can make the length slide => u... | [
"public",
"static",
"SelectionRange",
"findRegionFromSelection",
"(",
"String",
"fullText",
",",
"int",
"selectionOffset",
",",
"int",
"selectionLength",
")",
"{",
"// Find the whole lines that match the selection (start)",
"int",
"newSselectionOffset",
"=",
"TextUtils",
".",... | Finds the region that includes both the given selection and entire lines.
<p>
Invalid values for the selection settings are fixed by this method.
</p>
@param fullText the full text
@param selectionOffset the selection's offset
@param selectionLength the selection's length
@return a non-null selection range | [
"Finds",
"the",
"region",
"that",
"includes",
"both",
"the",
"given",
"selection",
"and",
"entire",
"lines",
".",
"<p",
">",
"Invalid",
"values",
"for",
"the",
"selection",
"settings",
"are",
"fixed",
"by",
"this",
"method",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/TextUtils.java#L71-L84 |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/support/HtmlElementUtils.java | HtmlElementUtils.locateElement | public static RemoteWebElement locateElement(String locator, ParentTraits parent) {
"""
Parses locator string to identify the proper By subclass before calling Selenium
{@link WebElement#findElement(By)} to locate the web element nested within the parent web element.
@param locator
String that represents the ... | java | public static RemoteWebElement locateElement(String locator, ParentTraits parent) {
logger.entering(new Object[] { locator, parent });
Preconditions.checkArgument(StringUtils.isNotBlank(locator), INVALID_LOCATOR_ERR_MSG);
Preconditions.checkArgument(parent != null, INVALID_PARENT_ERR_MSG);
... | [
"public",
"static",
"RemoteWebElement",
"locateElement",
"(",
"String",
"locator",
",",
"ParentTraits",
"parent",
")",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"locator",
",",
"parent",
"}",
")",
";",
"Preconditions",
".",
"checkA... | Parses locator string to identify the proper By subclass before calling Selenium
{@link WebElement#findElement(By)} to locate the web element nested within the parent web element.
@param locator
String that represents the means to locate this element (could be id/name/xpath/css locator).
@param parent
{@link ParentTra... | [
"Parses",
"locator",
"string",
"to",
"identify",
"the",
"proper",
"By",
"subclass",
"before",
"calling",
"Selenium",
"{",
"@link",
"WebElement#findElement",
"(",
"By",
")",
"}",
"to",
"locate",
"the",
"web",
"element",
"nested",
"within",
"the",
"parent",
"web... | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/support/HtmlElementUtils.java#L78-L85 |
facebook/fresco | samples/zoomable/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java | DefaultZoomableController.mapViewToImage | public PointF mapViewToImage(PointF viewPoint) {
"""
Maps point from view-absolute to image-relative coordinates.
This takes into account the zoomable transformation.
"""
float[] points = mTempValues;
points[0] = viewPoint.x;
points[1] = viewPoint.y;
mActiveTransform.invert(mActiveTransformInv... | java | public PointF mapViewToImage(PointF viewPoint) {
float[] points = mTempValues;
points[0] = viewPoint.x;
points[1] = viewPoint.y;
mActiveTransform.invert(mActiveTransformInverse);
mActiveTransformInverse.mapPoints(points, 0, points, 0, 1);
mapAbsoluteToRelative(points, points, 1);
return new ... | [
"public",
"PointF",
"mapViewToImage",
"(",
"PointF",
"viewPoint",
")",
"{",
"float",
"[",
"]",
"points",
"=",
"mTempValues",
";",
"points",
"[",
"0",
"]",
"=",
"viewPoint",
".",
"x",
";",
"points",
"[",
"1",
"]",
"=",
"viewPoint",
".",
"y",
";",
"mAc... | Maps point from view-absolute to image-relative coordinates.
This takes into account the zoomable transformation. | [
"Maps",
"point",
"from",
"view",
"-",
"absolute",
"to",
"image",
"-",
"relative",
"coordinates",
".",
"This",
"takes",
"into",
"account",
"the",
"zoomable",
"transformation",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/samples/zoomable/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java#L284-L292 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/CheckRangeHandler.java | CheckRangeHandler.init | public void init(BaseField field, double dStartRange, double dEndRange) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param dStartRange Start of range (inclusive).
@param dEndRange End of range (inclusive).
"""
super.init(field);
... | java | public void init(BaseField field, double dStartRange, double dEndRange)
{
super.init(field);
m_dStartRange = dStartRange;
m_dEndRange = dEndRange;
m_bScreenMove = true;
m_bInitMove = false;
m_bReadMove = false;
} | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"double",
"dStartRange",
",",
"double",
"dEndRange",
")",
"{",
"super",
".",
"init",
"(",
"field",
")",
";",
"m_dStartRange",
"=",
"dStartRange",
";",
"m_dEndRange",
"=",
"dEndRange",
";",
"m_bScreenM... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param dStartRange Start of range (inclusive).
@param dEndRange End of range (inclusive). | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/CheckRangeHandler.java#L82-L91 |
forge/core | parser-java/api/src/main/java/org/jboss/forge/addon/parser/java/beans/FieldOperations.java | FieldOperations.addFieldTo | public FieldSource<JavaClassSource> addFieldTo(final JavaClassSource targetClass, final String fieldType,
final String fieldName, Visibility visibility, boolean withGetter, boolean withSetter,
String... annotations) {
"""
Adds the field, updating the toString(). If specified, adds a getter,... | java | public FieldSource<JavaClassSource> addFieldTo(final JavaClassSource targetClass, final String fieldType,
final String fieldName, Visibility visibility, boolean withGetter, boolean withSetter,
String... annotations)
{
return addFieldTo(targetClass, fieldType, fieldName, visibility, with... | [
"public",
"FieldSource",
"<",
"JavaClassSource",
">",
"addFieldTo",
"(",
"final",
"JavaClassSource",
"targetClass",
",",
"final",
"String",
"fieldType",
",",
"final",
"String",
"fieldName",
",",
"Visibility",
"visibility",
",",
"boolean",
"withGetter",
",",
"boolean... | Adds the field, updating the toString(). If specified, adds a getter, a setter or both.
@param targetClass The class which the field will be added to
@param fieldType The type of the field
@param fieldName The name of the field
@param visibility The visibility of the newly created field
@param withGetter Specifies whe... | [
"Adds",
"the",
"field",
"updating",
"the",
"toString",
"()",
".",
"If",
"specified",
"adds",
"a",
"getter",
"a",
"setter",
"or",
"both",
"."
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/parser-java/api/src/main/java/org/jboss/forge/addon/parser/java/beans/FieldOperations.java#L127-L132 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java | PtoPOutputHandler.sendNotFlushedMessage | public void sendNotFlushedMessage(SIBUuid8 ignore, SIBUuid12 streamID, long requestID)
throws SIResourceException {
"""
/* (non-Javadoc)
@see com.ibm.ws.sib.processor.impl.interfaces.DownstreamControl#sendNotFlushedMessage(com.ibm.ws.sib.utils.SIBUuid12)
Sends an 'I am not flushed' message in response to a ... | java | public void sendNotFlushedMessage(SIBUuid8 ignore, SIBUuid12 streamID, long requestID)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendNotFlushedMessage",
new Object[]{ignore, streamID, new Long(requestID)});
ControlNotFlu... | [
"public",
"void",
"sendNotFlushedMessage",
"(",
"SIBUuid8",
"ignore",
",",
"SIBUuid12",
"streamID",
",",
"long",
"requestID",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEna... | /* (non-Javadoc)
@see com.ibm.ws.sib.processor.impl.interfaces.DownstreamControl#sendNotFlushedMessage(com.ibm.ws.sib.utils.SIBUuid12)
Sends an 'I am not flushed' message in response to a query from a target | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")",
"@see",
"com",
".",
"ibm",
".",
"ws",
".",
"sib",
".",
"processor",
".",
"impl",
".",
"interfaces",
".",
"DownstreamControl#sendNotFlushedMessage",
"(",
"com",
".",
"ibm",
".",
"ws",
".",
"sib",
".",
"utils",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java#L1938-L1966 |
roboconf/roboconf-platform | core/roboconf-agent/src/main/java/net/roboconf/agent/internal/AgentProperties.java | AgentProperties.updatedField | private static String updatedField( Properties props, String fieldName ) {
"""
Gets a property and updates it to prevent escaped characters.
@param props the IAAS properties.
@param fieldName the name of the field to read.
@return an updated string
"""
String property = props.getProperty( fieldName );
... | java | private static String updatedField( Properties props, String fieldName ) {
String property = props.getProperty( fieldName );
if( property != null )
property = property.replace( "\\:", ":" );
return property;
} | [
"private",
"static",
"String",
"updatedField",
"(",
"Properties",
"props",
",",
"String",
"fieldName",
")",
"{",
"String",
"property",
"=",
"props",
".",
"getProperty",
"(",
"fieldName",
")",
";",
"if",
"(",
"property",
"!=",
"null",
")",
"property",
"=",
... | Gets a property and updates it to prevent escaped characters.
@param props the IAAS properties.
@param fieldName the name of the field to read.
@return an updated string | [
"Gets",
"a",
"property",
"and",
"updates",
"it",
"to",
"prevent",
"escaped",
"characters",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent/src/main/java/net/roboconf/agent/internal/AgentProperties.java#L213-L220 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.orthoSymmetric | public Matrix4d orthoSymmetric(double width, double height, double zNear, double zFar) {
"""
Apply a symmetric orthographic projection transformation for a right-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix.
<p>
This method is equivalent to calling {@link #ortho(do... | java | public Matrix4d orthoSymmetric(double width, double height, double zNear, double zFar) {
return orthoSymmetric(width, height, zNear, zFar, false, this);
} | [
"public",
"Matrix4d",
"orthoSymmetric",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
")",
"{",
"return",
"orthoSymmetric",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",
",",
"false",
",",
"this",... | Apply a symmetric orthographic projection transformation for a right-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix.
<p>
This method is equivalent to calling {@link #ortho(double, double, double, double, double, double) ortho()} with
<code>left=-width/2</code>, <code>right=+... | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"1",
"]",
"<",
"/",
"code",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L10223-L10225 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.createOrUpdateAsync | public Observable<GenericResourceInner> createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
"""
Creates a resource.
@param resourceGroupName The name of the reso... | java | public Observable<GenericResourceInner> createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, reso... | [
"public",
"Observable",
"<",
"GenericResourceInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceProviderNamespace",
",",
"String",
"parentResourcePath",
",",
"String",
"resourceType",
",",
"String",
"resourceName",
",",
"String... | Creates a resource.
@param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
@param resourceProviderNamespace The namespace of the resource provider.
@param parentResourcePath The parent resource identity.
@param resourceType The resource type of the resource to create.
@... | [
"Creates",
"a",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L1329-L1336 |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java | ShowCumulatedProducersAction.setAccumulatorAttributes | private void setAccumulatorAttributes(List<String> accumulatorIds, HttpServletRequest request) throws APIException {
"""
Sets accumulator specific attributes, required to show accumulator charts on page.
@param accumulatorIds Accumulator IDs, tied to given producers
@param request {@link HttpServletRequest}
... | java | private void setAccumulatorAttributes(List<String> accumulatorIds, HttpServletRequest request) throws APIException {
if (accumulatorIds == null || accumulatorIds.isEmpty()) {
return;
}
request.setAttribute("accumulatorsPresent", Boolean.TRUE);
//create multiple graphs with ... | [
"private",
"void",
"setAccumulatorAttributes",
"(",
"List",
"<",
"String",
">",
"accumulatorIds",
",",
"HttpServletRequest",
"request",
")",
"throws",
"APIException",
"{",
"if",
"(",
"accumulatorIds",
"==",
"null",
"||",
"accumulatorIds",
".",
"isEmpty",
"(",
")",... | Sets accumulator specific attributes, required to show accumulator charts on page.
@param accumulatorIds Accumulator IDs, tied to given producers
@param request {@link HttpServletRequest} | [
"Sets",
"accumulator",
"specific",
"attributes",
"required",
"to",
"show",
"accumulator",
"charts",
"on",
"page",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java#L143-L162 |
craterdog/java-primitive-types | src/main/java/craterdog/primitives/Probability.java | Probability.and | static public Probability and(Probability probability1, Probability probability2) {
"""
This function returns the logical conjunction of the specified probabilities. The value
of the logical conjunction of two probabilities is P * Q.
@param probability1 The first probability.
@param probability2 The second p... | java | static public Probability and(Probability probability1, Probability probability2) {
double p1 = probability1.value;
double p2 = probability2.value;
return new Probability(p1 * p2);
} | [
"static",
"public",
"Probability",
"and",
"(",
"Probability",
"probability1",
",",
"Probability",
"probability2",
")",
"{",
"double",
"p1",
"=",
"probability1",
".",
"value",
";",
"double",
"p2",
"=",
"probability2",
".",
"value",
";",
"return",
"new",
"Probab... | This function returns the logical conjunction of the specified probabilities. The value
of the logical conjunction of two probabilities is P * Q.
@param probability1 The first probability.
@param probability2 The second probability.
@return The logical conjunction of the two probabilities. | [
"This",
"function",
"returns",
"the",
"logical",
"conjunction",
"of",
"the",
"specified",
"probabilities",
".",
"The",
"value",
"of",
"the",
"logical",
"conjunction",
"of",
"two",
"probabilities",
"is",
"P",
"*",
"Q",
"."
] | train | https://github.com/craterdog/java-primitive-types/blob/730f9bceacfac69f99b094464a7da5747c07a59e/src/main/java/craterdog/primitives/Probability.java#L148-L152 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/independentsamples/Fisher.java | Fisher.getPvalue | public static double getPvalue(int n11, int ndot1, int ndot2, int n1dot, int n2dot) {
"""
Calculates the p-value of null Hypothesis
@param n11
@param ndot1
@param ndot2
@param n1dot
@param n2dot
@return
"""
int originalN11=n11;
int n=ndot1+ndot2;
int min=Math.max(0,n1dot+ndot1... | java | public static double getPvalue(int n11, int ndot1, int ndot2, int n1dot, int n2dot) {
int originalN11=n11;
int n=ndot1+ndot2;
int min=Math.max(0,n1dot+ndot1-n);
int max=Math.min(n1dot,ndot1);
Set<Integer> combinations = new HashSet<>();
combinations.add(originalN11);
... | [
"public",
"static",
"double",
"getPvalue",
"(",
"int",
"n11",
",",
"int",
"ndot1",
",",
"int",
"ndot2",
",",
"int",
"n1dot",
",",
"int",
"n2dot",
")",
"{",
"int",
"originalN11",
"=",
"n11",
";",
"int",
"n",
"=",
"ndot1",
"+",
"ndot2",
";",
"int",
"... | Calculates the p-value of null Hypothesis
@param n11
@param ndot1
@param ndot2
@param n1dot
@param n2dot
@return | [
"Calculates",
"the",
"p",
"-",
"value",
"of",
"null",
"Hypothesis"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/independentsamples/Fisher.java#L40-L78 |
greenrobot/essentials | java-essentials/src/main/java/org/greenrobot/essentials/StringUtils.java | StringUtils.ellipsize | public static String ellipsize(String text, int maxLength, String end) {
"""
Cuts the string at the end if it's longer than maxLength and appends the given end string to it. The length of
the resulting string is always less or equal to the given maxLength. It's valid to pass a null text; in this
case null is ret... | java | public static String ellipsize(String text, int maxLength, String end) {
if (text != null && text.length() > maxLength) {
return text.substring(0, maxLength - end.length()) + end;
}
return text;
} | [
"public",
"static",
"String",
"ellipsize",
"(",
"String",
"text",
",",
"int",
"maxLength",
",",
"String",
"end",
")",
"{",
"if",
"(",
"text",
"!=",
"null",
"&&",
"text",
".",
"length",
"(",
")",
">",
"maxLength",
")",
"{",
"return",
"text",
".",
"sub... | Cuts the string at the end if it's longer than maxLength and appends the given end string to it. The length of
the resulting string is always less or equal to the given maxLength. It's valid to pass a null text; in this
case null is returned. | [
"Cuts",
"the",
"string",
"at",
"the",
"end",
"if",
"it",
"s",
"longer",
"than",
"maxLength",
"and",
"appends",
"the",
"given",
"end",
"string",
"to",
"it",
".",
"The",
"length",
"of",
"the",
"resulting",
"string",
"is",
"always",
"less",
"or",
"equal",
... | train | https://github.com/greenrobot/essentials/blob/31eaaeb410174004196c9ef9c9469e0d02afd94b/java-essentials/src/main/java/org/greenrobot/essentials/StringUtils.java#L228-L233 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java | UnionQueryAnalyzer.pruneKeys | private boolean pruneKeys(List<Set<ChainedProperty<S>>> keys, ChainedProperty<S> property) {
"""
Removes the given property from all keys, returning true if any key has
zero properties as a result.
"""
boolean result = false;
for (Set<ChainedProperty<S>> key : keys) {
key.remo... | java | private boolean pruneKeys(List<Set<ChainedProperty<S>>> keys, ChainedProperty<S> property) {
boolean result = false;
for (Set<ChainedProperty<S>> key : keys) {
key.remove(property);
if (key.size() == 0) {
result = true;
continue;
... | [
"private",
"boolean",
"pruneKeys",
"(",
"List",
"<",
"Set",
"<",
"ChainedProperty",
"<",
"S",
">",
">",
">",
"keys",
",",
"ChainedProperty",
"<",
"S",
">",
"property",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"for",
"(",
"Set",
"<",
"ChainedPr... | Removes the given property from all keys, returning true if any key has
zero properties as a result. | [
"Removes",
"the",
"given",
"property",
"from",
"all",
"keys",
"returning",
"true",
"if",
"any",
"key",
"has",
"zero",
"properties",
"as",
"a",
"result",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java#L306-L318 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.fundamentalRefine | public static RefineEpipolar fundamentalRefine(double tol , int maxIterations , EpipolarError type ) {
"""
Creates a non-linear optimizer for refining estimates of fundamental or essential matrices.
@see boofcv.alg.geo.f.FundamentalResidualSampson
@see boofcv.alg.geo.f.FundamentalResidualSimple
@param tol T... | java | public static RefineEpipolar fundamentalRefine(double tol , int maxIterations , EpipolarError type )
{
switch( type ) {
case SAMPSON:
return new LeastSquaresFundamental(tol,maxIterations,true);
case SIMPLE:
return new LeastSquaresFundamental(tol,maxIterations,false);
}
throw new IllegalArgumentExc... | [
"public",
"static",
"RefineEpipolar",
"fundamentalRefine",
"(",
"double",
"tol",
",",
"int",
"maxIterations",
",",
"EpipolarError",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"SAMPSON",
":",
"return",
"new",
"LeastSquaresFundamental",
"(",
"tol",... | Creates a non-linear optimizer for refining estimates of fundamental or essential matrices.
@see boofcv.alg.geo.f.FundamentalResidualSampson
@see boofcv.alg.geo.f.FundamentalResidualSimple
@param tol Tolerance for convergence. Try 1e-8
@param maxIterations Maximum number of iterations it will perform. Try 100 or mo... | [
"Creates",
"a",
"non",
"-",
"linear",
"optimizer",
"for",
"refining",
"estimates",
"of",
"fundamental",
"or",
"essential",
"matrices",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L370-L380 |
roboconf/roboconf-platform | miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ApplicationWsDelegate.java | ApplicationWsDelegate.bindApplication | public void bindApplication( String applicationName, String boundTplName, String boundApp )
throws ApplicationWsException {
"""
Binds an application for external exports.
@param applicationName the application name
@param boundTplName the template name (no qualifier as it does not make sense for external export... | java | public void bindApplication( String applicationName, String boundTplName, String boundApp )
throws ApplicationWsException {
this.logger.finer( "Creating a binding for external exports in " + applicationName + "..." );
WebResource path = this.resource.path( UrlConstants.APP )
.path( applicationName ).path( "b... | [
"public",
"void",
"bindApplication",
"(",
"String",
"applicationName",
",",
"String",
"boundTplName",
",",
"String",
"boundApp",
")",
"throws",
"ApplicationWsException",
"{",
"this",
".",
"logger",
".",
"finer",
"(",
"\"Creating a binding for external exports in \"",
"+... | Binds an application for external exports.
@param applicationName the application name
@param boundTplName the template name (no qualifier as it does not make sense for external exports)
@param boundApp the name of the application (instance of <code>tplName</code>)
@throws ApplicationWsException if something went wrong | [
"Binds",
"an",
"application",
"for",
"external",
"exports",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ApplicationWsDelegate.java#L380-L392 |
OpenBEL/openbel-framework | org.openbel.framework.api/src/main/java/org/openbel/framework/api/DefaultOrthologize.java | DefaultOrthologize.inferOrthologs | private static Pair<Map<Integer, TermParameter>, Map<Integer, TermParameter>> inferOrthologs(
Kam kam, KAMStore kAMStore, SpeciesDialect dialect,
EdgeFilter inferf, Set<KamNode> species,
Map<KamNode, KamNode> ortho) {
"""
Infers orthologous {@link KamEdge edges} downstream and u... | java | private static Pair<Map<Integer, TermParameter>, Map<Integer, TermParameter>> inferOrthologs(
Kam kam, KAMStore kAMStore, SpeciesDialect dialect,
EdgeFilter inferf, Set<KamNode> species,
Map<KamNode, KamNode> ortho) {
final List<org.openbel.framework.common.model.Namespace> ... | [
"private",
"static",
"Pair",
"<",
"Map",
"<",
"Integer",
",",
"TermParameter",
">",
",",
"Map",
"<",
"Integer",
",",
"TermParameter",
">",
">",
"inferOrthologs",
"(",
"Kam",
"kam",
",",
"KAMStore",
"kAMStore",
",",
"SpeciesDialect",
"dialect",
",",
"EdgeFilt... | Infers orthologous {@link KamEdge edges} downstream and upstream from
all {@link KamNode species replacement nodes}.
@param kam {@link Kam}
@param inferf {@link EdgeFilter}
@param species {@link Set} of {@link Integer} species replacement node
ids | [
"Infers",
"orthologous",
"{",
"@link",
"KamEdge",
"edges",
"}",
"downstream",
"and",
"upstream",
"from",
"all",
"{",
"@link",
"KamNode",
"species",
"replacement",
"nodes",
"}",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.api/src/main/java/org/openbel/framework/api/DefaultOrthologize.java#L227-L256 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/ChangeObjects.java | ChangeObjects.setCountToDefault | public final static void setCountToDefault(PolymerNotation polymer, int position) {
"""
method to set the count of a MonomerNotation to default (=1)
@param polymer
PolymerNotation
@param position
position of the MonomerNotation
"""
polymer.getPolymerElements().getListOfElements().get(position).setCoun... | java | public final static void setCountToDefault(PolymerNotation polymer, int position) {
polymer.getPolymerElements().getListOfElements().get(position).setCount("1");
} | [
"public",
"final",
"static",
"void",
"setCountToDefault",
"(",
"PolymerNotation",
"polymer",
",",
"int",
"position",
")",
"{",
"polymer",
".",
"getPolymerElements",
"(",
")",
".",
"getListOfElements",
"(",
")",
".",
"get",
"(",
"position",
")",
".",
"setCount"... | method to set the count of a MonomerNotation to default (=1)
@param polymer
PolymerNotation
@param position
position of the MonomerNotation | [
"method",
"to",
"set",
"the",
"count",
"of",
"a",
"MonomerNotation",
"to",
"default",
"(",
"=",
"1",
")"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/ChangeObjects.java#L364-L366 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.get | public String get(String key, String defaultValue) {
"""
Returns the String value for the given key.
If the key does not exist it will return the given default value.
"""
addToDefaults(key, defaultValue);
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return value;
... | java | public String get(String key, String defaultValue) {
addToDefaults(key, defaultValue);
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return value;
}
} | [
"public",
"String",
"get",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"defaultValue",
")",
";",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"re... | Returns the String value for the given key.
If the key does not exist it will return the given default value. | [
"Returns",
"the",
"String",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exist",
"it",
"will",
"return",
"the",
"given",
"default",
"value",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L260-L268 |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/Vertigo.java | Vertigo.deployNetwork | public Vertigo deployNetwork(String cluster, JsonObject network) {
"""
Deploys a json network to a specific cluster.<p>
The JSON network configuration will be converted to a {@link NetworkConfig} before
being deployed to the cluster. The conversion is done synchronously, so if the
configuration is invalid the... | java | public Vertigo deployNetwork(String cluster, JsonObject network) {
return deployNetwork(cluster, network, null);
} | [
"public",
"Vertigo",
"deployNetwork",
"(",
"String",
"cluster",
",",
"JsonObject",
"network",
")",
"{",
"return",
"deployNetwork",
"(",
"cluster",
",",
"network",
",",
"null",
")",
";",
"}"
] | Deploys a json network to a specific cluster.<p>
The JSON network configuration will be converted to a {@link NetworkConfig} before
being deployed to the cluster. The conversion is done synchronously, so if the
configuration is invalid then this method may throw an exception.
@param cluster The cluster to which to de... | [
"Deploys",
"a",
"json",
"network",
"to",
"a",
"specific",
"cluster",
".",
"<p",
">"
] | train | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/Vertigo.java#L500-L502 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericUtils.java | GenericUtils.skipToChars | static public int skipToChars(byte[] data, int start, byte[] targets) {
"""
Utility method to skip past data in an array until it runs out of space
or finds one of the the target characters.
@param data
@param start
@param targets
@return int (return index, equals data.length if not found)
"""
i... | java | static public int skipToChars(byte[] data, int start, byte[] targets) {
int index = start;
int y = 0;
byte current;
for (; index < data.length; index++) {
current = data[index];
for (y = 0; y < targets.length; y++) {
if (current == targets[y]) {
... | [
"static",
"public",
"int",
"skipToChars",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"start",
",",
"byte",
"[",
"]",
"targets",
")",
"{",
"int",
"index",
"=",
"start",
";",
"int",
"y",
"=",
"0",
";",
"byte",
"current",
";",
"for",
"(",
";",
"inde... | Utility method to skip past data in an array until it runs out of space
or finds one of the the target characters.
@param data
@param start
@param targets
@return int (return index, equals data.length if not found) | [
"Utility",
"method",
"to",
"skip",
"past",
"data",
"in",
"an",
"array",
"until",
"it",
"runs",
"out",
"of",
"space",
"or",
"finds",
"one",
"of",
"the",
"the",
"target",
"characters",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericUtils.java#L1104-L1117 |
i-net-software/jlessc | src/com/inet/lib/less/LessParser.java | LessParser.parseUrlParam | private Operation parseUrlParam() {
"""
Parse the parameter of an "url" function which has some curious fallbacks.
@return the parameter of the function
"""
StringBuilder builder = cachesBuilder;
builder.setLength( 0 );
Operation op = new Operation( reader, new ValueExpression( reade... | java | private Operation parseUrlParam() {
StringBuilder builder = cachesBuilder;
builder.setLength( 0 );
Operation op = new Operation( reader, new ValueExpression( reader, relativeURL.getPath() ), ';' );
for( ;; ) {
char ch = read();
switch( ch ) {
case ... | [
"private",
"Operation",
"parseUrlParam",
"(",
")",
"{",
"StringBuilder",
"builder",
"=",
"cachesBuilder",
";",
"builder",
".",
"setLength",
"(",
"0",
")",
";",
"Operation",
"op",
"=",
"new",
"Operation",
"(",
"reader",
",",
"new",
"ValueExpression",
"(",
"re... | Parse the parameter of an "url" function which has some curious fallbacks.
@return the parameter of the function | [
"Parse",
"the",
"parameter",
"of",
"an",
"url",
"function",
"which",
"has",
"some",
"curious",
"fallbacks",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/LessParser.java#L1080-L1115 |
vRallev/ECC-25519 | ECC-25519-Java/src/main/java/djb/Curve25519.java | Curve25519.mula32 | private static final int mula32(byte[] p, byte[] x, byte[] y, int t, int z) {
"""
/* p += x * y * z where z is a small integer
x is size 32, y is size t, p is size 32+t
y is allowed to overlap with p+32 if you don't care about the upper half
"""
final int n = 31;
int w = 0;
int i = 0;
for (; i < t; ... | java | private static final int mula32(byte[] p, byte[] x, byte[] y, int t, int z) {
final int n = 31;
int w = 0;
int i = 0;
for (; i < t; i++) {
int zy = z * (y[i] & 0xFF);
w += mula_small(p, p, i, x, n, zy) +
(p[i+n] & 0xFF) + zy * (x[n] & 0xFF);
p[i+n] = (byte)w;
w >>= 8;
}
p[i+n] = (byte)(w + (... | [
"private",
"static",
"final",
"int",
"mula32",
"(",
"byte",
"[",
"]",
"p",
",",
"byte",
"[",
"]",
"x",
",",
"byte",
"[",
"]",
"y",
",",
"int",
"t",
",",
"int",
"z",
")",
"{",
"final",
"int",
"n",
"=",
"31",
";",
"int",
"w",
"=",
"0",
";",
... | /* p += x * y * z where z is a small integer
x is size 32, y is size t, p is size 32+t
y is allowed to overlap with p+32 if you don't care about the upper half | [
"/",
"*",
"p",
"+",
"=",
"x",
"*",
"y",
"*",
"z",
"where",
"z",
"is",
"a",
"small",
"integer",
"x",
"is",
"size",
"32",
"y",
"is",
"size",
"t",
"p",
"is",
"size",
"32",
"+",
"t",
"y",
"is",
"allowed",
"to",
"overlap",
"with",
"p",
"+",
"32"... | train | https://github.com/vRallev/ECC-25519/blob/5c4297933aabfa4fbe7675e36d6d923ffd22e2cb/ECC-25519-Java/src/main/java/djb/Curve25519.java#L315-L328 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ServletStartedListener.java | ServletStartedListener.updateSecurityMetadata | private void updateSecurityMetadata(SecurityMetadata securityMetadataFromDD, WebAppConfig webAppConfig) {
"""
Updates the security metadata object (which at this time only has the deployment descriptor info)
with the webAppConfig information comprising all sources.
@param securityMetadataFromDD the security me... | java | private void updateSecurityMetadata(SecurityMetadata securityMetadataFromDD, WebAppConfig webAppConfig) {
for (Iterator<IServletConfig> it = webAppConfig.getServletInfos(); it.hasNext();) {
IServletConfig servletConfig = it.next();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEn... | [
"private",
"void",
"updateSecurityMetadata",
"(",
"SecurityMetadata",
"securityMetadataFromDD",
",",
"WebAppConfig",
"webAppConfig",
")",
"{",
"for",
"(",
"Iterator",
"<",
"IServletConfig",
">",
"it",
"=",
"webAppConfig",
".",
"getServletInfos",
"(",
")",
";",
"it",... | Updates the security metadata object (which at this time only has the deployment descriptor info)
with the webAppConfig information comprising all sources.
@param securityMetadataFromDD the security metadata processed from the deployment descriptor
@param webAppConfig the web app configuration provided by the web cont... | [
"Updates",
"the",
"security",
"metadata",
"object",
"(",
"which",
"at",
"this",
"time",
"only",
"has",
"the",
"deployment",
"descriptor",
"info",
")",
"with",
"the",
"webAppConfig",
"information",
"comprising",
"all",
"sources",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ServletStartedListener.java#L211-L220 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.lowerCase | public static String lowerCase(final String str, final Locale locale) {
"""
<p>Converts a String to lower case as per {@link String#toLowerCase(Locale)}.</p>
<p>A {@code null} input String returns {@code null}.</p>
<pre>
StringUtils.lowerCase(null, Locale.ENGLISH) = null
StringUtils.lowerCase("", Locale.E... | java | public static String lowerCase(final String str, final Locale locale) {
if (str == null) {
return null;
}
return str.toLowerCase(locale);
} | [
"public",
"static",
"String",
"lowerCase",
"(",
"final",
"String",
"str",
",",
"final",
"Locale",
"locale",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"str",
".",
"toLowerCase",
"(",
"locale",
")",
";",
... | <p>Converts a String to lower case as per {@link String#toLowerCase(Locale)}.</p>
<p>A {@code null} input String returns {@code null}.</p>
<pre>
StringUtils.lowerCase(null, Locale.ENGLISH) = null
StringUtils.lowerCase("", Locale.ENGLISH) = ""
StringUtils.lowerCase("aBc", Locale.ENGLISH) = "abc"
</pre>
@param str... | [
"<p",
">",
"Converts",
"a",
"String",
"to",
"lower",
"case",
"as",
"per",
"{",
"@link",
"String#toLowerCase",
"(",
"Locale",
")",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L6690-L6695 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINKHDBSCANLinearMemory.java | SLINKHDBSCANLinearMemory.step4 | private void step4(DBIDRef id, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, DBIDs processedIDs) {
"""
Fourth step: Actualize the clusters if necessary
@param id the id of the current object
@param pi Pi data store
@param lambda Lambda data store
@param processedIDs the already processed ids
... | java | private void step4(DBIDRef id, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, DBIDs processedIDs) {
DBIDVar p_i = DBIDUtil.newVar();
// for i = 1..n
for(DBIDIter it = processedIDs.iter(); it.valid(); it.advance()) {
double l_i = lambda.doubleValue(it);
pi.assignVar(it, p_i); // p_i = ... | [
"private",
"void",
"step4",
"(",
"DBIDRef",
"id",
",",
"WritableDBIDDataStore",
"pi",
",",
"WritableDoubleDataStore",
"lambda",
",",
"DBIDs",
"processedIDs",
")",
"{",
"DBIDVar",
"p_i",
"=",
"DBIDUtil",
".",
"newVar",
"(",
")",
";",
"// for i = 1..n",
"for",
"... | Fourth step: Actualize the clusters if necessary
@param id the id of the current object
@param pi Pi data store
@param lambda Lambda data store
@param processedIDs the already processed ids | [
"Fourth",
"step",
":",
"Actualize",
"the",
"clusters",
"if",
"necessary"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINKHDBSCANLinearMemory.java#L215-L229 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Point.java | Point.setXY | public void setXY(double x, double y) {
"""
Set the X and Y coordinate of the point.
@param x
X coordinate of the point.
@param y
Y coordinate of the point.
"""
_touch();
if (m_attributes == null)
_setToDefault();
m_attributes[0] = x;
m_attributes[1] = y;
} | java | public void setXY(double x, double y) {
_touch();
if (m_attributes == null)
_setToDefault();
m_attributes[0] = x;
m_attributes[1] = y;
} | [
"public",
"void",
"setXY",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"_touch",
"(",
")",
";",
"if",
"(",
"m_attributes",
"==",
"null",
")",
"_setToDefault",
"(",
")",
";",
"m_attributes",
"[",
"0",
"]",
"=",
"x",
";",
"m_attributes",
"[",
"... | Set the X and Y coordinate of the point.
@param x
X coordinate of the point.
@param y
Y coordinate of the point. | [
"Set",
"the",
"X",
"and",
"Y",
"coordinate",
"of",
"the",
"point",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Point.java#L572-L580 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/ReferenceEntityLockService.java | ReferenceEntityLockService.isLocked | private boolean isLocked(Class entityType, String entityKey, Integer lockType)
throws LockingException {
"""
Answers if the entity represented by entityType and entityKey has one or more locks. Param
<code>lockType</code> can be null.
@param entityType
@param entityKey
@param lockType (optional)
... | java | private boolean isLocked(Class entityType, String entityKey, Integer lockType)
throws LockingException {
IEntityLock[] locks = retrieveLocks(entityType, entityKey, lockType);
return locks.length > 0;
} | [
"private",
"boolean",
"isLocked",
"(",
"Class",
"entityType",
",",
"String",
"entityKey",
",",
"Integer",
"lockType",
")",
"throws",
"LockingException",
"{",
"IEntityLock",
"[",
"]",
"locks",
"=",
"retrieveLocks",
"(",
"entityType",
",",
"entityKey",
",",
"lockT... | Answers if the entity represented by entityType and entityKey has one or more locks. Param
<code>lockType</code> can be null.
@param entityType
@param entityKey
@param lockType (optional)
@exception org.apereo.portal.concurrency.LockingException | [
"Answers",
"if",
"the",
"entity",
"represented",
"by",
"entityType",
"and",
"entityKey",
"has",
"one",
"or",
"more",
"locks",
".",
"Param",
"<code",
">",
"lockType<",
"/",
"code",
">",
"can",
"be",
"null",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/ReferenceEntityLockService.java#L202-L206 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java | SyntheticStorableReferenceBuilder.generateSafeMethodName | private String generateSafeMethodName(StorableInfo info, String prefix) {
"""
Generates a property name which doesn't clash with any already defined.
"""
Class type = info.getStorableType();
// Try a few times to generate a unique name. There's nothing special
// about choosing 100... | java | private String generateSafeMethodName(StorableInfo info, String prefix) {
Class type = info.getStorableType();
// Try a few times to generate a unique name. There's nothing special
// about choosing 100 as the limit.
int value = 0;
for (int i = 0; i < 100; i++) {
... | [
"private",
"String",
"generateSafeMethodName",
"(",
"StorableInfo",
"info",
",",
"String",
"prefix",
")",
"{",
"Class",
"type",
"=",
"info",
".",
"getStorableType",
"(",
")",
";",
"// Try a few times to generate a unique name. There's nothing special\r",
"// about choosing ... | Generates a property name which doesn't clash with any already defined. | [
"Generates",
"a",
"property",
"name",
"which",
"doesn",
"t",
"clash",
"with",
"any",
"already",
"defined",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java#L523-L539 |
Whiley/WhileyCompiler | src/main/java/wyil/interpreter/Interpreter.java | Interpreter.checkInvariants | public void checkInvariants(CallStack frame, Expr... invariants) {
"""
Evaluate zero or more conditional expressions, and check whether any is
false. If so, raise an exception indicating a runtime fault.
@param frame
@param context
@param invariants
"""
for (int i = 0; i != invariants.length; ++i) {
... | java | public void checkInvariants(CallStack frame, Expr... invariants) {
for (int i = 0; i != invariants.length; ++i) {
RValue.Bool b = executeExpression(BOOL_T, invariants[i], frame);
if (b == RValue.False) {
// FIXME: need to do more here
throw new AssertionError();
}
}
} | [
"public",
"void",
"checkInvariants",
"(",
"CallStack",
"frame",
",",
"Expr",
"...",
"invariants",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"!=",
"invariants",
".",
"length",
";",
"++",
"i",
")",
"{",
"RValue",
".",
"Bool",
"b",
"=",
"e... | Evaluate zero or more conditional expressions, and check whether any is
false. If so, raise an exception indicating a runtime fault.
@param frame
@param context
@param invariants | [
"Evaluate",
"zero",
"or",
"more",
"conditional",
"expressions",
"and",
"check",
"whether",
"any",
"is",
"false",
".",
"If",
"so",
"raise",
"an",
"exception",
"indicating",
"a",
"runtime",
"fault",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L1258-L1266 |
samskivert/pythagoras | src/main/java/pythagoras/f/Quaternion.java | Quaternion.fromAnglesXZ | public Quaternion fromAnglesXZ (float x, float z) {
"""
Sets this quaternion to one that first rotates about x by the specified number of radians,
then rotates about z by the specified number of radians.
"""
float hx = x * 0.5f, hz = z * 0.5f;
float sx = FloatMath.sin(hx), cx = FloatMath.cos(h... | java | public Quaternion fromAnglesXZ (float x, float z) {
float hx = x * 0.5f, hz = z * 0.5f;
float sx = FloatMath.sin(hx), cx = FloatMath.cos(hx);
float sz = FloatMath.sin(hz), cz = FloatMath.cos(hz);
return set(cz*sx, sz*sx, sz*cx, cz*cx);
} | [
"public",
"Quaternion",
"fromAnglesXZ",
"(",
"float",
"x",
",",
"float",
"z",
")",
"{",
"float",
"hx",
"=",
"x",
"*",
"0.5f",
",",
"hz",
"=",
"z",
"*",
"0.5f",
";",
"float",
"sx",
"=",
"FloatMath",
".",
"sin",
"(",
"hx",
")",
",",
"cx",
"=",
"F... | Sets this quaternion to one that first rotates about x by the specified number of radians,
then rotates about z by the specified number of radians. | [
"Sets",
"this",
"quaternion",
"to",
"one",
"that",
"first",
"rotates",
"about",
"x",
"by",
"the",
"specified",
"number",
"of",
"radians",
"then",
"rotates",
"about",
"z",
"by",
"the",
"specified",
"number",
"of",
"radians",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Quaternion.java#L184-L189 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.undoChanges | public void undoChanges(CmsRequestContext context, CmsResource resource, CmsResource.CmsResourceUndoMode mode)
throws CmsException, CmsSecurityException {
"""
Undos all changes in the resource by restoring the version from the
online project to the current offline project.<p>
@param context the current req... | java | public void undoChanges(CmsRequestContext context, CmsResource resource, CmsResource.CmsResourceUndoMode mode)
throws CmsException, CmsSecurityException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
checkOfflineProject(dbc);
checkPermissions(dbc, resou... | [
"public",
"void",
"undoChanges",
"(",
"CmsRequestContext",
"context",
",",
"CmsResource",
"resource",
",",
"CmsResource",
".",
"CmsResourceUndoMode",
"mode",
")",
"throws",
"CmsException",
",",
"CmsSecurityException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory... | Undos all changes in the resource by restoring the version from the
online project to the current offline project.<p>
@param context the current request context
@param resource the name of the resource to apply this operation to
@param mode the undo mode, one of the <code>{@link CmsResource}#UNDO_XXX</code> constants
... | [
"Undos",
"all",
"changes",
"in",
"the",
"resource",
"by",
"restoring",
"the",
"version",
"from",
"the",
"online",
"project",
"to",
"the",
"current",
"offline",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L6240-L6258 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java | ScenarioPortrayal.addTimeChart | public void addTimeChart(String chartID, String xAxisLabel, String yAxisLabel) throws ShanksException {
"""
Add a chart to the simulation
@param chartID
@param xAxisLabel
@param yAxisLabel
@throws ShanksException
"""
if (!this.timeCharts.containsKey(chartID)) {
TimeSeriesChartGenera... | java | public void addTimeChart(String chartID, String xAxisLabel, String yAxisLabel) throws ShanksException {
if (!this.timeCharts.containsKey(chartID)) {
TimeSeriesChartGenerator chart = new TimeSeriesChartGenerator();
chart.setTitle(chartID);
chart.setXAxisLabel(xAxisLabel);
... | [
"public",
"void",
"addTimeChart",
"(",
"String",
"chartID",
",",
"String",
"xAxisLabel",
",",
"String",
"yAxisLabel",
")",
"throws",
"ShanksException",
"{",
"if",
"(",
"!",
"this",
".",
"timeCharts",
".",
"containsKey",
"(",
"chartID",
")",
")",
"{",
"TimeSe... | Add a chart to the simulation
@param chartID
@param xAxisLabel
@param yAxisLabel
@throws ShanksException | [
"Add",
"a",
"chart",
"to",
"the",
"simulation"
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java#L137-L147 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java | MBeanRegistry.tokenize | private int tokenize(StringBuilder sb, String path, int index) {
"""
This takes a path, such as /a/b/c, and converts it to
name0=a,name1=b,name2=c
"""
String[] tokens = path.split("/");
for (String s: tokens) {
if (s.length()==0)
continue;
sb.append("nam... | java | private int tokenize(StringBuilder sb, String path, int index){
String[] tokens = path.split("/");
for (String s: tokens) {
if (s.length()==0)
continue;
sb.append("name").append(index++)
.append("=").append(s).append(",");
}
ret... | [
"private",
"int",
"tokenize",
"(",
"StringBuilder",
"sb",
",",
"String",
"path",
",",
"int",
"index",
")",
"{",
"String",
"[",
"]",
"tokens",
"=",
"path",
".",
"split",
"(",
"\"/\"",
")",
";",
"for",
"(",
"String",
"s",
":",
"tokens",
")",
"{",
"if... | This takes a path, such as /a/b/c, and converts it to
name0=a,name1=b,name2=c | [
"This",
"takes",
"a",
"path",
"such",
"as",
"/",
"a",
"/",
"b",
"/",
"c",
"and",
"converts",
"it",
"to",
"name0",
"=",
"a",
"name1",
"=",
"b",
"name2",
"=",
"c"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java#L167-L176 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Signature.java | Signature.prependArgs | public Signature prependArgs(String[] names, Class<?>... types) {
"""
Prepend arguments (names + types) to the signature.
@param names the names of the arguments
@param types the types of the arguments
@return a new signature with the added arguments
"""
String[] newArgNames = new String[argNames.... | java | public Signature prependArgs(String[] names, Class<?>... types) {
String[] newArgNames = new String[argNames.length + names.length];
System.arraycopy(argNames, 0, newArgNames, names.length, argNames.length);
System.arraycopy(names, 0, newArgNames, 0, names.length);
MethodType newMethodTy... | [
"public",
"Signature",
"prependArgs",
"(",
"String",
"[",
"]",
"names",
",",
"Class",
"<",
"?",
">",
"...",
"types",
")",
"{",
"String",
"[",
"]",
"newArgNames",
"=",
"new",
"String",
"[",
"argNames",
".",
"length",
"+",
"names",
".",
"length",
"]",
... | Prepend arguments (names + types) to the signature.
@param names the names of the arguments
@param types the types of the arguments
@return a new signature with the added arguments | [
"Prepend",
"arguments",
"(",
"names",
"+",
"types",
")",
"to",
"the",
"signature",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L234-L240 |
pressgang-ccms/PressGangCCMSQuery | src/main/java/org/jboss/pressgang/ccms/filter/utils/JPAUtils.java | JPAUtils.copyFetches | public static void copyFetches(Fetch<?, ?> from, Fetch<?, ?> to) {
"""
Copy Fetches
@param from source Fetch
@param to dest Fetch
"""
for (Fetch<?, ?> f : from.getFetches()) {
Fetch<?, ?> toFetch = to.fetch(f.getAttribute().getName());
// recursively copy fetches
... | java | public static void copyFetches(Fetch<?, ?> from, Fetch<?, ?> to) {
for (Fetch<?, ?> f : from.getFetches()) {
Fetch<?, ?> toFetch = to.fetch(f.getAttribute().getName());
// recursively copy fetches
copyFetches(f, toFetch);
}
} | [
"public",
"static",
"void",
"copyFetches",
"(",
"Fetch",
"<",
"?",
",",
"?",
">",
"from",
",",
"Fetch",
"<",
"?",
",",
"?",
">",
"to",
")",
"{",
"for",
"(",
"Fetch",
"<",
"?",
",",
"?",
">",
"f",
":",
"from",
".",
"getFetches",
"(",
")",
")",... | Copy Fetches
@param from source Fetch
@param to dest Fetch | [
"Copy",
"Fetches"
] | train | https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/utils/JPAUtils.java#L302-L308 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/widget/element/Element.java | Element.waitForCommand | protected void waitForCommand(ITimerCallback callback, long timeout) throws WidgetTimeoutException {
"""
wait for timeout amount of time
@param callback
@param timeout
@throws WidgetTimeoutException
"""
WaitForConditionTimer t = new WaitForConditionTimer(getByLocator(), callback);
t.waitUntil(timeout)... | java | protected void waitForCommand(ITimerCallback callback, long timeout) throws WidgetTimeoutException {
WaitForConditionTimer t = new WaitForConditionTimer(getByLocator(), callback);
t.waitUntil(timeout);
} | [
"protected",
"void",
"waitForCommand",
"(",
"ITimerCallback",
"callback",
",",
"long",
"timeout",
")",
"throws",
"WidgetTimeoutException",
"{",
"WaitForConditionTimer",
"t",
"=",
"new",
"WaitForConditionTimer",
"(",
"getByLocator",
"(",
")",
",",
"callback",
")",
";... | wait for timeout amount of time
@param callback
@param timeout
@throws WidgetTimeoutException | [
"wait",
"for",
"timeout",
"amount",
"of",
"time"
] | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/widget/element/Element.java#L797-L800 |
alkacon/opencms-core | src/org/opencms/ade/galleries/CmsPreviewService.java | CmsPreviewService.readResourceInfo | public void readResourceInfo(CmsObject cms, CmsResource resource, CmsResourceInfoBean resInfo, String locale)
throws CmsException {
"""
Retrieves the resource information and puts it into the provided resource info bean.<p>
@param cms the initialized cms object
@param resource the resource
@param resInfo ... | java | public void readResourceInfo(CmsObject cms, CmsResource resource, CmsResourceInfoBean resInfo, String locale)
throws CmsException {
I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(resource.getTypeId());
Locale wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
... | [
"public",
"void",
"readResourceInfo",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"CmsResourceInfoBean",
"resInfo",
",",
"String",
"locale",
")",
"throws",
"CmsException",
"{",
"I_CmsResourceType",
"type",
"=",
"OpenCms",
".",
"getResourceManager",
... | Retrieves the resource information and puts it into the provided resource info bean.<p>
@param cms the initialized cms object
@param resource the resource
@param resInfo the resource info bean
@param locale the content locale
@throws CmsException if something goes wrong | [
"Retrieves",
"the",
"resource",
"information",
"and",
"puts",
"it",
"into",
"the",
"provided",
"resource",
"info",
"bean",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/galleries/CmsPreviewService.java#L274-L326 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java | JBBPOut.Bin | public JBBPOut Bin(final Object object, final JBBPCustomFieldWriter customFieldWriter) throws IOException {
"""
Save fields of an object marked by Bin annotation. Fields will be ordered
through {@link Bin#outOrder()} field, NB! By default Java doesn't keep field
outOrder. Ordered fields of class will be saved in... | java | public JBBPOut Bin(final Object object, final JBBPCustomFieldWriter customFieldWriter) throws IOException {
if (this.processCommands) {
this.processObject(object, null, customFieldWriter);
}
return this;
} | [
"public",
"JBBPOut",
"Bin",
"(",
"final",
"Object",
"object",
",",
"final",
"JBBPCustomFieldWriter",
"customFieldWriter",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"processCommands",
")",
"{",
"this",
".",
"processObject",
"(",
"object",
",",
... | Save fields of an object marked by Bin annotation. Fields will be ordered
through {@link Bin#outOrder()} field, NB! By default Java doesn't keep field
outOrder. Ordered fields of class will be saved into internal cache for speed
but the cache can be reset through {@link #resetInsideClassCache()}
@param object ... | [
"Save",
"fields",
"of",
"an",
"object",
"marked",
"by",
"Bin",
"annotation",
".",
"Fields",
"will",
"be",
"ordered",
"through",
"{",
"@link",
"Bin#outOrder",
"()",
"}",
"field",
"NB!",
"By",
"default",
"Java",
"doesn",
"t",
"keep",
"field",
"outOrder",
"."... | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java#L1029-L1035 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java | SdkUtils.setColorForInitialsThumb | public static void setColorForInitialsThumb(TextView initialsView, int position) {
"""
Sets the thumb color that displays users initials
@param initialsView TextView used to display number of collaborators
@param position Used to pick a material color from an array
"""
int backgroundColor = THU... | java | public static void setColorForInitialsThumb(TextView initialsView, int position) {
int backgroundColor = THUMB_COLORS[(position) % THUMB_COLORS.length];
setColorsThumb(initialsView, backgroundColor, Color.WHITE);
} | [
"public",
"static",
"void",
"setColorForInitialsThumb",
"(",
"TextView",
"initialsView",
",",
"int",
"position",
")",
"{",
"int",
"backgroundColor",
"=",
"THUMB_COLORS",
"[",
"(",
"position",
")",
"%",
"THUMB_COLORS",
".",
"length",
"]",
";",
"setColorsThumb",
"... | Sets the thumb color that displays users initials
@param initialsView TextView used to display number of collaborators
@param position Used to pick a material color from an array | [
"Sets",
"the",
"thumb",
"color",
"that",
"displays",
"users",
"initials"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L617-L620 |
Pkmmte/PkRSS | pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java | PkRSS.saveFavorite | public boolean saveFavorite(Article article, boolean favorite) {
"""
Saves/Deletes an {@link Article} object to the favorites database.
@param article Article object to save.
@param favorite Whether to save or delete. {@code true} to save; {@code false} to delete.
@return {@code true} if successful, {@code fals... | java | public boolean saveFavorite(Article article, boolean favorite) {
long time = System.currentTimeMillis();
log("Adding article " + article.getId() + " to favorites...");
try {
if (favorite)
favoriteDatabase.add(article);
else
favoriteDatabase.delete(article);
}
catch (Exception e) {
log("Error ... | [
"public",
"boolean",
"saveFavorite",
"(",
"Article",
"article",
",",
"boolean",
"favorite",
")",
"{",
"long",
"time",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"log",
"(",
"\"Adding article \"",
"+",
"article",
".",
"getId",
"(",
")",
"+",
"\... | Saves/Deletes an {@link Article} object to the favorites database.
@param article Article object to save.
@param favorite Whether to save or delete. {@code true} to save; {@code false} to delete.
@return {@code true} if successful, {@code false} if otherwise. | [
"Saves",
"/",
"Deletes",
"an",
"{"
] | train | https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java#L351-L366 |
nobuoka/android-lib-ZXingCaptureActivity | src/main/java/info/vividcode/android/zxing/CaptureActivityIntents.java | CaptureActivityIntents.setDecodeHintAllowedLengths | public static void setDecodeHintAllowedLengths(Intent intent, int[] lengths) {
"""
Set allowed lengths of encoded data.
@param intent Target intent.
@param lengths allowed lengths.
"""
intent.putExtra(DecodeHintType.ALLOWED_LENGTHS.name(), lengths);
} | java | public static void setDecodeHintAllowedLengths(Intent intent, int[] lengths) {
intent.putExtra(DecodeHintType.ALLOWED_LENGTHS.name(), lengths);
} | [
"public",
"static",
"void",
"setDecodeHintAllowedLengths",
"(",
"Intent",
"intent",
",",
"int",
"[",
"]",
"lengths",
")",
"{",
"intent",
".",
"putExtra",
"(",
"DecodeHintType",
".",
"ALLOWED_LENGTHS",
".",
"name",
"(",
")",
",",
"lengths",
")",
";",
"}"
] | Set allowed lengths of encoded data.
@param intent Target intent.
@param lengths allowed lengths. | [
"Set",
"allowed",
"lengths",
"of",
"encoded",
"data",
"."
] | train | https://github.com/nobuoka/android-lib-ZXingCaptureActivity/blob/17aaa7cf75520d3f2e03db9796b7e8c1d1f1b1e6/src/main/java/info/vividcode/android/zxing/CaptureActivityIntents.java#L80-L82 |
OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.process | private static void process(String targetTool, String[] args) {
"""
Executes the target tool
@param targetTool the name of the target tool to execute
@param args The command line arguments minus the tool name
"""
if("mkmetric".equals(targetTool)) {
shift(args);
}
if(!"tsd".equals(targetToo... | java | private static void process(String targetTool, String[] args) {
if("mkmetric".equals(targetTool)) {
shift(args);
}
if(!"tsd".equals(targetTool)) {
try {
COMMANDS.get(targetTool).getDeclaredMethod("main", String[].class).invoke(null, new Object[] {args});
} catch(Exception x) ... | [
"private",
"static",
"void",
"process",
"(",
"String",
"targetTool",
",",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"\"mkmetric\"",
".",
"equals",
"(",
"targetTool",
")",
")",
"{",
"shift",
"(",
"args",
")",
";",
"}",
"if",
"(",
"!",
"\"tsd\""... | Executes the target tool
@param targetTool the name of the target tool to execute
@param args The command line arguments minus the tool name | [
"Executes",
"the",
"target",
"tool"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L159-L173 |
netty/netty | common/src/main/java/io/netty/util/internal/SystemPropertyUtil.java | SystemPropertyUtil.get | public static String get(final String key, String def) {
"""
Returns the value of the Java system property with the specified
{@code key}, while falling back to the specified default value if
the property access fails.
@return the property value.
{@code def} if there's no such property or if an access to the... | java | public static String get(final String key, String def) {
if (key == null) {
throw new NullPointerException("key");
}
if (key.isEmpty()) {
throw new IllegalArgumentException("key must not be empty.");
}
String value = null;
try {
if (Sy... | [
"public",
"static",
"String",
"get",
"(",
"final",
"String",
"key",
",",
"String",
"def",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"key\"",
")",
";",
"}",
"if",
"(",
"key",
".",
"isEmpty",
"("... | Returns the value of the Java system property with the specified
{@code key}, while falling back to the specified default value if
the property access fails.
@return the property value.
{@code def} if there's no such property or if an access to the
specified property is not allowed. | [
"Returns",
"the",
"value",
"of",
"the",
"Java",
"system",
"property",
"with",
"the",
"specified",
"{",
"@code",
"key",
"}",
"while",
"falling",
"back",
"to",
"the",
"specified",
"default",
"value",
"if",
"the",
"property",
"access",
"fails",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/SystemPropertyUtil.java#L58-L87 |
kiegroup/jbpm | jbpm-audit/src/main/java/org/jbpm/process/audit/AuditLoggerFactory.java | AuditLoggerFactory.newJMSInstance | public static AbstractAuditLogger newJMSInstance(boolean transacted, ConnectionFactory connFactory, Queue queue) {
"""
Creates new instance of JMS audit logger based on given connection factory and queue.
NOTE: this will build the logger but it is not registered directly on a session: once received,
it will need... | java | public static AbstractAuditLogger newJMSInstance(boolean transacted, ConnectionFactory connFactory, Queue queue) {
AsyncAuditLogProducer logger = new AsyncAuditLogProducer();
logger.setTransacted(transacted);
logger.setConnectionFactory(connFactory);
logger.setQueue(queue);
... | [
"public",
"static",
"AbstractAuditLogger",
"newJMSInstance",
"(",
"boolean",
"transacted",
",",
"ConnectionFactory",
"connFactory",
",",
"Queue",
"queue",
")",
"{",
"AsyncAuditLogProducer",
"logger",
"=",
"new",
"AsyncAuditLogProducer",
"(",
")",
";",
"logger",
".",
... | Creates new instance of JMS audit logger based on given connection factory and queue.
NOTE: this will build the logger but it is not registered directly on a session: once received,
it will need to be registered as an event listener
@param transacted determines if JMS session is transacted or not
@param connFactory con... | [
"Creates",
"new",
"instance",
"of",
"JMS",
"audit",
"logger",
"based",
"on",
"given",
"connection",
"factory",
"and",
"queue",
".",
"NOTE",
":",
"this",
"will",
"build",
"the",
"logger",
"but",
"it",
"is",
"not",
"registered",
"directly",
"on",
"a",
"sessi... | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-audit/src/main/java/org/jbpm/process/audit/AuditLoggerFactory.java#L197-L204 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java | GrafeasV1Beta1Client.createOccurrence | public final Occurrence createOccurrence(ProjectName parent, Occurrence occurrence) {
"""
Creates a new occurrence.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Occurrence occurrence = Occurr... | java | public final Occurrence createOccurrence(ProjectName parent, Occurrence occurrence) {
CreateOccurrenceRequest request =
CreateOccurrenceRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setOccurrence(occurrence)
.build();
return createOccurr... | [
"public",
"final",
"Occurrence",
"createOccurrence",
"(",
"ProjectName",
"parent",
",",
"Occurrence",
"occurrence",
")",
"{",
"CreateOccurrenceRequest",
"request",
"=",
"CreateOccurrenceRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
"==",
"n... | Creates a new occurrence.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Occurrence occurrence = Occurrence.newBuilder().build();
Occurrence response = grafeasV1Beta1Client.createOccurrence(parent, occurre... | [
"Creates",
"a",
"new",
"occurrence",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java#L542-L550 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/SliceInput.java | SliceInput.readBytes | public void readBytes(OutputStream out, int length)
throws IOException {
"""
Transfers this buffer's data to the specified stream starting at the
current {@code position}.
@param length the number of bytes to transfer
@throws IndexOutOfBoundsException if {@code length} is greater than {@code this.... | java | public void readBytes(OutputStream out, int length)
throws IOException
{
slice.getBytes(position, out, length);
position += length;
} | [
"public",
"void",
"readBytes",
"(",
"OutputStream",
"out",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"slice",
".",
"getBytes",
"(",
"position",
",",
"out",
",",
"length",
")",
";",
"position",
"+=",
"length",
";",
"}"
] | Transfers this buffer's data to the specified stream starting at the
current {@code position}.
@param length the number of bytes to transfer
@throws IndexOutOfBoundsException if {@code length} is greater than {@code this.available()}
@throws java.io.IOException if the specified stream threw an exception during I/O | [
"Transfers",
"this",
"buffer",
"s",
"data",
"to",
"the",
"specified",
"stream",
"starting",
"at",
"the",
"current",
"{",
"@code",
"position",
"}",
"."
] | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/SliceInput.java#L365-L370 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/Layout.java | Layout.getChildSize | public float getChildSize(final int dataIndex, final Axis axis) {
"""
Calculate the child size along the axis
@param dataIndex data index
@param axis {@link Axis}
@return child size
"""
float size = 0;
Widget child = mContainer.get(dataIndex);
if (child != null) {
switch ... | java | public float getChildSize(final int dataIndex, final Axis axis) {
float size = 0;
Widget child = mContainer.get(dataIndex);
if (child != null) {
switch (axis) {
case X:
size = child.getLayoutWidth();
break;
case ... | [
"public",
"float",
"getChildSize",
"(",
"final",
"int",
"dataIndex",
",",
"final",
"Axis",
"axis",
")",
"{",
"float",
"size",
"=",
"0",
";",
"Widget",
"child",
"=",
"mContainer",
".",
"get",
"(",
"dataIndex",
")",
";",
"if",
"(",
"child",
"!=",
"null",... | Calculate the child size along the axis
@param dataIndex data index
@param axis {@link Axis}
@return child size | [
"Calculate",
"the",
"child",
"size",
"along",
"the",
"axis"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/Layout.java#L161-L180 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java | ModuleIndexWriter.addModulesList | protected void addModulesList(Collection<ModuleElement> modules, Content tbody) {
"""
Adds list of modules in the index table. Generate link to each module.
@param tbody the documentation tree to which the list will be added
"""
boolean altColor = true;
for (ModuleElement mdle : modules) {
... | java | protected void addModulesList(Collection<ModuleElement> modules, Content tbody) {
boolean altColor = true;
for (ModuleElement mdle : modules) {
if (!mdle.isUnnamed()) {
Content moduleLinkContent = getModuleLink(mdle, new StringContent(mdle.getQualifiedName().toString()));
... | [
"protected",
"void",
"addModulesList",
"(",
"Collection",
"<",
"ModuleElement",
">",
"modules",
",",
"Content",
"tbody",
")",
"{",
"boolean",
"altColor",
"=",
"true",
";",
"for",
"(",
"ModuleElement",
"mdle",
":",
"modules",
")",
"{",
"if",
"(",
"!",
"mdle... | Adds list of modules in the index table. Generate link to each module.
@param tbody the documentation tree to which the list will be added | [
"Adds",
"list",
"of",
"modules",
"in",
"the",
"index",
"table",
".",
"Generate",
"link",
"to",
"each",
"module",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java#L167-L183 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.storeSettings | static void storeSettings(HttpSession session, CmsWorkplaceSettings settings) {
"""
Stores the settings in the given session.<p>
@param session the session to store the settings in
@param settings the settings
"""
// save the workplace settings in the session
session.setAttribute(CmsWorkpl... | java | static void storeSettings(HttpSession session, CmsWorkplaceSettings settings) {
// save the workplace settings in the session
session.setAttribute(CmsWorkplaceManager.SESSION_WORKPLACE_SETTINGS, settings);
} | [
"static",
"void",
"storeSettings",
"(",
"HttpSession",
"session",
",",
"CmsWorkplaceSettings",
"settings",
")",
"{",
"// save the workplace settings in the session",
"session",
".",
"setAttribute",
"(",
"CmsWorkplaceManager",
".",
"SESSION_WORKPLACE_SETTINGS",
",",
"settings"... | Stores the settings in the given session.<p>
@param session the session to store the settings in
@param settings the settings | [
"Stores",
"the",
"settings",
"in",
"the",
"given",
"session",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L1012-L1016 |
weld/core | impl/src/main/java/org/jboss/weld/util/collections/WeldCollections.java | WeldCollections.putIfAbsent | public static <K, V> V putIfAbsent(Map<K, V> map, K key, V value) {
"""
Utility method for working with maps. Unlike {@link Map#putIfAbsent(Object, Object)} this method always returns the value that ends up store in the map
which is either the old value (if any was present) or the new value (if it was stored in t... | java | public static <K, V> V putIfAbsent(Map<K, V> map, K key, V value) {
V old = map.putIfAbsent(key, value);
if (old != null) {
return old;
}
return value;
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"putIfAbsent",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"K",
"key",
",",
"V",
"value",
")",
"{",
"V",
"old",
"=",
"map",
".",
"putIfAbsent",
"(",
"key",
",",
"value",
")",
";",
"if",
... | Utility method for working with maps. Unlike {@link Map#putIfAbsent(Object, Object)} this method always returns the value that ends up store in the map
which is either the old value (if any was present) or the new value (if it was stored in the map).
@param map the map
@param key the key
@param value the value
@return... | [
"Utility",
"method",
"for",
"working",
"with",
"maps",
".",
"Unlike",
"{",
"@link",
"Map#putIfAbsent",
"(",
"Object",
"Object",
")",
"}",
"this",
"method",
"always",
"returns",
"the",
"value",
"that",
"ends",
"up",
"store",
"in",
"the",
"map",
"which",
"is... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/WeldCollections.java#L125-L131 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/MultiPointHandler.java | MultiPointHandler.getLength | @Override
public int getLength(Object geometry) {
"""
Calcuates the record length of this object.
@return int The length of the record that this shapepoint will take up in a shapefile
"""
MultiPoint mp = (MultiPoint) geometry;
int length;
if (shapeType... | java | @Override
public int getLength(Object geometry) {
MultiPoint mp = (MultiPoint) geometry;
int length;
if (shapeType == ShapeType.MULTIPOINT) {
// two doubles per coord (16 * numgeoms) + 40 for header
length = (mp.ge... | [
"@",
"Override",
"public",
"int",
"getLength",
"(",
"Object",
"geometry",
")",
"{",
"MultiPoint",
"mp",
"=",
"(",
"MultiPoint",
")",
"geometry",
";",
"int",
"length",
";",
"if",
"(",
"shapeType",
"==",
"ShapeType",
".",
"MULTIPOINT",
")",
"{",
"// two doub... | Calcuates the record length of this object.
@return int The length of the record that this shapepoint will take up in a shapefile | [
"Calcuates",
"the",
"record",
"length",
"of",
"this",
"object",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/MultiPointHandler.java#L69-L90 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parsePointMetadata | private void parsePointMetadata(JsonParser jp) throws IOException, SQLException {
"""
Parses a point and check if it's wellformated
Syntax:
{ "type": "Point", "coordinates": [100.0, 0.0] }
@param jp
@throws IOException
"""
jp.nextToken(); // FIELD_NAME coordinates
String coord... | java | private void parsePointMetadata(JsonParser jp) throws IOException, SQLException {
jp.nextToken(); // FIELD_NAME coordinates
String coordinatesField = jp.getText();
if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) {
jp.nextToken(); // START_ARRAY [ to parse the... | [
"private",
"void",
"parsePointMetadata",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"// FIELD_NAME coordinates ",
"String",
"coordinatesField",
"=",
"jp",
".",
"getText",
"(",
")",... | Parses a point and check if it's wellformated
Syntax:
{ "type": "Point", "coordinates": [100.0, 0.0] }
@param jp
@throws IOException | [
"Parses",
"a",
"point",
"and",
"check",
"if",
"it",
"s",
"wellformated"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L429-L438 |
yanzhenjie/AndPermission | support/src/main/java/com/yanzhenjie/permission/AndPermission.java | AndPermission.getFileUri | public static Uri getFileUri(android.app.Fragment fragment, File file) {
"""
Get compatible Android 7.0 and lower versions of Uri.
@param fragment {@link android.app.Fragment}.
@param file apk file.
@return uri.
"""
return getFileUri(fragment.getActivity(), file);
} | java | public static Uri getFileUri(android.app.Fragment fragment, File file) {
return getFileUri(fragment.getActivity(), file);
} | [
"public",
"static",
"Uri",
"getFileUri",
"(",
"android",
".",
"app",
".",
"Fragment",
"fragment",
",",
"File",
"file",
")",
"{",
"return",
"getFileUri",
"(",
"fragment",
".",
"getActivity",
"(",
")",
",",
"file",
")",
";",
"}"
] | Get compatible Android 7.0 and lower versions of Uri.
@param fragment {@link android.app.Fragment}.
@param file apk file.
@return uri. | [
"Get",
"compatible",
"Android",
"7",
".",
"0",
"and",
"lower",
"versions",
"of",
"Uri",
"."
] | train | https://github.com/yanzhenjie/AndPermission/blob/bbfaaecdb8ecf0f2aa270d80c0b88d022dddda7c/support/src/main/java/com/yanzhenjie/permission/AndPermission.java#L350-L352 |
twilliamson/mogwee-logging | src/main/java/com/mogwee/logging/Logger.java | Logger.warnDebug | public final void warnDebug(final Throwable cause, final String message) {
"""
Logs a message and stack trace if DEBUG logging is enabled
or a formatted message and exception description if WARN logging is enabled.
@param cause an exception to print stack trace of if DEBUG logging is enabled
@param message ... | java | public final void warnDebug(final Throwable cause, final String message)
{
logDebug(Level.WARN, cause, message);
} | [
"public",
"final",
"void",
"warnDebug",
"(",
"final",
"Throwable",
"cause",
",",
"final",
"String",
"message",
")",
"{",
"logDebug",
"(",
"Level",
".",
"WARN",
",",
"cause",
",",
"message",
")",
";",
"}"
] | Logs a message and stack trace if DEBUG logging is enabled
or a formatted message and exception description if WARN logging is enabled.
@param cause an exception to print stack trace of if DEBUG logging is enabled
@param message a message | [
"Logs",
"a",
"message",
"and",
"stack",
"trace",
"if",
"DEBUG",
"logging",
"is",
"enabled",
"or",
"a",
"formatted",
"message",
"and",
"exception",
"description",
"if",
"WARN",
"logging",
"is",
"enabled",
"."
] | train | https://github.com/twilliamson/mogwee-logging/blob/30b99c2649de455432d956a8f6a74316de4cd62c/src/main/java/com/mogwee/logging/Logger.java#L381-L384 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DCEventSource.java | DCEventSource.shouldInvalidate | public boolean shouldInvalidate (Object id, int sourceOfInvalidation, int causeOfInvalidation) {
"""
The listeners are called when the preInvalidate method is invoked.
@param event The invalidation event to be pre-invalidated.
"""
boolean retVal = true;
if (preInvalidationListenerCount > 0) {
... | java | public boolean shouldInvalidate (Object id, int sourceOfInvalidation, int causeOfInvalidation) {
boolean retVal = true;
if (preInvalidationListenerCount > 0) {
// In external implementation, catch any exceptions and process
try {
retVal = currentPreInvalidationListener.shouldInv... | [
"public",
"boolean",
"shouldInvalidate",
"(",
"Object",
"id",
",",
"int",
"sourceOfInvalidation",
",",
"int",
"causeOfInvalidation",
")",
"{",
"boolean",
"retVal",
"=",
"true",
";",
"if",
"(",
"preInvalidationListenerCount",
">",
"0",
")",
"{",
"// In external imp... | The listeners are called when the preInvalidate method is invoked.
@param event The invalidation event to be pre-invalidated. | [
"The",
"listeners",
"are",
"called",
"when",
"the",
"preInvalidate",
"method",
"is",
"invoked",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DCEventSource.java#L148-L164 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSubDataPropertyOfAxiomImpl_CustomFieldSerializer.java | OWLSubDataPropertyOfAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLSubDataPropertyOfAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLSubDataPropertyOfAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLSubDataPropertyOfAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSubDataPropertyOfAxiomImpl_CustomFieldSerializer.java#L97-L100 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginSetVpnclientIpsecParametersAsync | public Observable<VpnClientIPsecParametersInner> beginSetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) {
"""
The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network g... | java | public Observable<VpnClientIPsecParametersInner> beginSetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) {
return beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, v... | [
"public",
"Observable",
"<",
"VpnClientIPsecParametersInner",
">",
"beginSetVpnclientIpsecParametersAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"VpnClientIPsecParametersInner",
"vpnclientIpsecParams",
")",
"{",
"return",
"beginSetV... | The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@par... | [
"The",
"Set",
"VpnclientIpsecParameters",
"operation",
"sets",
"the",
"vpnclient",
"ipsec",
"policy",
"for",
"P2S",
"client",
"of",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"through",
"Network",
"resource",
"provider",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L2761-L2768 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java | MapTileCollisionRendererModel.renderCollision | private void renderCollision(Graphic g, TileCollision tile, int x, int y) {
"""
Render the collision function.
@param g The graphic output.
@param tile The tile reference.
@param x The horizontal render location.
@param y The vertical render location.
"""
for (final CollisionFormula collision : ... | java | private void renderCollision(Graphic g, TileCollision tile, int x, int y)
{
for (final CollisionFormula collision : tile.getCollisionFormulas())
{
final ImageBuffer buffer = collisionCache.get(collision);
if (buffer != null)
{
g.drawImage(bu... | [
"private",
"void",
"renderCollision",
"(",
"Graphic",
"g",
",",
"TileCollision",
"tile",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"for",
"(",
"final",
"CollisionFormula",
"collision",
":",
"tile",
".",
"getCollisionFormulas",
"(",
")",
")",
"{",
"final"... | Render the collision function.
@param g The graphic output.
@param tile The tile reference.
@param x The horizontal render location.
@param y The vertical render location. | [
"Render",
"the",
"collision",
"function",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java#L174-L184 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/DefaultBeanContext.java | DefaultBeanContext.getBean | @UsedByGeneratedCode
public @Nonnull <T> T getBean(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType) {
"""
Get a bean of the given type.
@param resolutionContext The bean context resolution
@param beanType The bean type
@param <T> The bean type parameter... | java | @UsedByGeneratedCode
public @Nonnull <T> T getBean(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType) {
ArgumentUtils.requireNonNull("beanType", beanType);
return getBeanInternal(resolutionContext, beanType, null, true, true);
} | [
"@",
"UsedByGeneratedCode",
"public",
"@",
"Nonnull",
"<",
"T",
">",
"T",
"getBean",
"(",
"@",
"Nullable",
"BeanResolutionContext",
"resolutionContext",
",",
"@",
"Nonnull",
"Class",
"<",
"T",
">",
"beanType",
")",
"{",
"ArgumentUtils",
".",
"requireNonNull",
... | Get a bean of the given type.
@param resolutionContext The bean context resolution
@param beanType The bean type
@param <T> The bean type parameter
@return The found bean | [
"Get",
"a",
"bean",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/DefaultBeanContext.java#L996-L1000 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/HerokuAPI.java | HerokuAPI.getReleaseInfo | public Release getReleaseInfo(String appName, String releaseName) {
"""
Information about a specific release.
@param appName App name. See {@link #listApps} for a list of apps that can be used.
@param releaseName Release name. See {@link #listReleases} for a list of the app's releases.
@return the release objec... | java | public Release getReleaseInfo(String appName, String releaseName) {
return connection.execute(new ReleaseInfo(appName, releaseName), apiKey);
} | [
"public",
"Release",
"getReleaseInfo",
"(",
"String",
"appName",
",",
"String",
"releaseName",
")",
"{",
"return",
"connection",
".",
"execute",
"(",
"new",
"ReleaseInfo",
"(",
"appName",
",",
"releaseName",
")",
",",
"apiKey",
")",
";",
"}"
] | Information about a specific release.
@param appName App name. See {@link #listApps} for a list of apps that can be used.
@param releaseName Release name. See {@link #listReleases} for a list of the app's releases.
@return the release object | [
"Information",
"about",
"a",
"specific",
"release",
"."
] | train | https://github.com/heroku/heroku.jar/blob/d9e52991293159498c10c498c6f91fcdd637378e/heroku-api/src/main/java/com/heroku/api/HerokuAPI.java#L293-L295 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraSchemaMgr.java | CassandraSchemaMgr.createKeyspace | public void createKeyspace(DBConn dbConn, String keyspace) {
"""
Create a new keyspace with the given name. The keyspace is created with parameters
defined for our DBService instance, if any. This method should be used with a
no-keyspace DB connection.
@param dbConn Database connection to use.
@param keys... | java | public void createKeyspace(DBConn dbConn, String keyspace) {
m_logger.info("Creating Keyspace '{}'", keyspace);
try {
KsDef ksDef = setKeySpaceOptions(keyspace);
dbConn.getClientSession().system_add_keyspace(ksDef);
waitForSchemaPropagation(dbConn);
... | [
"public",
"void",
"createKeyspace",
"(",
"DBConn",
"dbConn",
",",
"String",
"keyspace",
")",
"{",
"m_logger",
".",
"info",
"(",
"\"Creating Keyspace '{}'\"",
",",
"keyspace",
")",
";",
"try",
"{",
"KsDef",
"ksDef",
"=",
"setKeySpaceOptions",
"(",
"keyspace",
"... | Create a new keyspace with the given name. The keyspace is created with parameters
defined for our DBService instance, if any. This method should be used with a
no-keyspace DB connection.
@param dbConn Database connection to use.
@param keyspace Name of new keyspace. | [
"Create",
"a",
"new",
"keyspace",
"with",
"the",
"given",
"name",
".",
"The",
"keyspace",
"is",
"created",
"with",
"parameters",
"defined",
"for",
"our",
"DBService",
"instance",
"if",
"any",
".",
"This",
"method",
"should",
"be",
"used",
"with",
"a",
"no"... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraSchemaMgr.java#L80-L92 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.rotateYXZ | public Matrix4x3f rotateYXZ(Vector3f angles) {
"""
Apply rotation of <code>angles.y</code> radians about the Y axis, followed by a rotation of <code>angles.x</code> radians about the X axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate... | java | public Matrix4x3f rotateYXZ(Vector3f angles) {
return rotateYXZ(angles.y, angles.x, angles.z);
} | [
"public",
"Matrix4x3f",
"rotateYXZ",
"(",
"Vector3f",
"angles",
")",
"{",
"return",
"rotateYXZ",
"(",
"angles",
".",
"y",
",",
"angles",
".",
"x",
",",
"angles",
".",
"z",
")",
";",
"}"
] | Apply rotation of <code>angles.y</code> radians about the Y axis, followed by a rotation of <code>angles.x</code> radians about the X axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter... | [
"Apply",
"rotation",
"of",
"<code",
">",
"angles",
".",
"y<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angles",
".",
"x<",
"/",
"code",
">",
"radians",
"about",
"the",
"X",
"axi... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L3713-L3715 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/normalization/KerasBatchNormalization.java | KerasBatchNormalization.getEpsFromConfig | private double getEpsFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException {
"""
Get BatchNormalization epsilon parameter from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return epsilon
@throws InvalidKerasConfigurationExceptio... | java | private double getEpsFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
if (!innerConfig.containsKey(LAYER_FIELD_EPSILON))
throw new InvalidKerasConfigurat... | [
"private",
"double",
"getEpsFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
")",
"throws",
"InvalidKerasConfigurationException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"innerConfig",
"=",
"KerasLayerUtils",
".",
"getInnerLayerConfi... | Get BatchNormalization epsilon parameter from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return epsilon
@throws InvalidKerasConfigurationException Invalid Keras config | [
"Get",
"BatchNormalization",
"epsilon",
"parameter",
"from",
"Keras",
"layer",
"configuration",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/normalization/KerasBatchNormalization.java#L236-L242 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transaction.cdi/src/com/ibm/tx/jta/cdi/interceptors/Never.java | Never.never | @AroundInvoke
public Object never(final InvocationContext context) throws Exception {
"""
<p>If called outside a transaction context, managed bean method execution
must then continue outside a transaction context.</p>
<p>If called inside a transaction context, a TransactionalException with
a nested InvalidT... | java | @AroundInvoke
public Object never(final InvocationContext context) throws Exception {
if (getUOWM().getUOWType() == UOWSynchronizationRegistry.UOW_TYPE_GLOBAL_TRANSACTION) {
throw new TransactionalException("TxType.NEVER method called within a global tx", new InvalidTransactionException());
... | [
"@",
"AroundInvoke",
"public",
"Object",
"never",
"(",
"final",
"InvocationContext",
"context",
")",
"throws",
"Exception",
"{",
"if",
"(",
"getUOWM",
"(",
")",
".",
"getUOWType",
"(",
")",
"==",
"UOWSynchronizationRegistry",
".",
"UOW_TYPE_GLOBAL_TRANSACTION",
")... | <p>If called outside a transaction context, managed bean method execution
must then continue outside a transaction context.</p>
<p>If called inside a transaction context, a TransactionalException with
a nested InvalidTransactionException must be thrown.</p> | [
"<p",
">",
"If",
"called",
"outside",
"a",
"transaction",
"context",
"managed",
"bean",
"method",
"execution",
"must",
"then",
"continue",
"outside",
"a",
"transaction",
"context",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"called",
"inside",
"a",
"transac... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transaction.cdi/src/com/ibm/tx/jta/cdi/interceptors/Never.java#L37-L46 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ws/ffdc/DiagnosticModule.java | DiagnosticModule.invokeDiagnosticMethod | private final void invokeDiagnosticMethod(Method m, Throwable ex, IncidentStream ffdcis, Object callerThis, Object[] catcherObjects, String sourceId) {
"""
Invoke dump method
@param m
The method to be invoked
@param ex
The exception causing the incident
@param ffdcis
The incident stream on which to report
... | java | private final void invokeDiagnosticMethod(Method m, Throwable ex, IncidentStream ffdcis, Object callerThis, Object[] catcherObjects, String sourceId) {
try {
m.invoke(this, new Object[] { ex, ffdcis, callerThis, catcherObjects, sourceId });
ffdcis.writeLine("+ Data for directive [" + m.... | [
"private",
"final",
"void",
"invokeDiagnosticMethod",
"(",
"Method",
"m",
",",
"Throwable",
"ex",
",",
"IncidentStream",
"ffdcis",
",",
"Object",
"callerThis",
",",
"Object",
"[",
"]",
"catcherObjects",
",",
"String",
"sourceId",
")",
"{",
"try",
"{",
"m",
"... | Invoke dump method
@param m
The method to be invoked
@param ex
The exception causing the incident
@param ffdcis
The incident stream on which to report
@param callerThis
The object reporting the incident
@param catcherObjects
Any additional interesting objects
@param sourceId
The sourceid of the class reporting the pro... | [
"Invoke",
"dump",
"method"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/ffdc/DiagnosticModule.java#L267-L275 |
kiegroup/droolsjbpm-knowledge | kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorIO.java | DeploymentDescriptorIO.toXml | public static String toXml(DeploymentDescriptor descriptor) {
"""
Serializes descriptor instance to XML
@param descriptor descriptor to be serialized
@return xml representation of descriptor as string
"""
try {
Marshaller marshaller = getContext().createMarshaller();
marshall... | java | public static String toXml(DeploymentDescriptor descriptor) {
try {
Marshaller marshaller = getContext().createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://www.jboss.org/... | [
"public",
"static",
"String",
"toXml",
"(",
"DeploymentDescriptor",
"descriptor",
")",
"{",
"try",
"{",
"Marshaller",
"marshaller",
"=",
"getContext",
"(",
")",
".",
"createMarshaller",
"(",
")",
";",
"marshaller",
".",
"setProperty",
"(",
"Marshaller",
".",
"... | Serializes descriptor instance to XML
@param descriptor descriptor to be serialized
@return xml representation of descriptor as string | [
"Serializes",
"descriptor",
"instance",
"to",
"XML"
] | train | https://github.com/kiegroup/droolsjbpm-knowledge/blob/fbe6de817c9f27cd4f6ef07e808e5c7bc946d4e5/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorIO.java#L68-L87 |
apache/predictionio-sdk-java | client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java | EventClient.unsetItem | public String unsetItem(String iid, List<String> properties, DateTime eventTime)
throws ExecutionException, InterruptedException, IOException {
"""
Unsets properties of a item. The list must not be empty.
@param iid ID of the item
@param properties a list of all the properties to unset
@param eventTime ... | java | public String unsetItem(String iid, List<String> properties, DateTime eventTime)
throws ExecutionException, InterruptedException, IOException {
return createEvent(unsetItemAsFuture(iid, properties, eventTime));
} | [
"public",
"String",
"unsetItem",
"(",
"String",
"iid",
",",
"List",
"<",
"String",
">",
"properties",
",",
"DateTime",
"eventTime",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
",",
"IOException",
"{",
"return",
"createEvent",
"(",
"unsetItemA... | Unsets properties of a item. The list must not be empty.
@param iid ID of the item
@param properties a list of all the properties to unset
@param eventTime timestamp of the event
@return ID of this event | [
"Unsets",
"properties",
"of",
"a",
"item",
".",
"The",
"list",
"must",
"not",
"be",
"empty",
"."
] | train | https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L541-L544 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java | MathUtil.approximateBinomialCoefficient | public static double approximateBinomialCoefficient(int n, int k) {
"""
Binomial coefficent, also known as "n choose k").
@param n Total number of samples. n > 0
@param k Number of elements to choose. <code>n >= k</code>,
<code>k >= 0</code>
@return n! / (k! * (n-k)!)
"""
final int m = max(k... | java | public static double approximateBinomialCoefficient(int n, int k) {
final int m = max(k, n - k);
long temp = 1;
for(int i = n, j = 1; i > m; i--, j++) {
temp = temp * i / j;
}
return temp;
} | [
"public",
"static",
"double",
"approximateBinomialCoefficient",
"(",
"int",
"n",
",",
"int",
"k",
")",
"{",
"final",
"int",
"m",
"=",
"max",
"(",
"k",
",",
"n",
"-",
"k",
")",
";",
"long",
"temp",
"=",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"n",
... | Binomial coefficent, also known as "n choose k").
@param n Total number of samples. n > 0
@param k Number of elements to choose. <code>n >= k</code>,
<code>k >= 0</code>
@return n! / (k! * (n-k)!) | [
"Binomial",
"coefficent",
"also",
"known",
"as",
"n",
"choose",
"k",
")",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java#L269-L276 |
bazaarvoice/emodb | common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/TimeUUIDs.java | TimeUUIDs.compareTimestamps | public static int compareTimestamps(UUID uuid1, UUID uuid2) {
"""
Compare the embedded timestamps of the given UUIDs. This is used when it is OK to return
an equality based on timestamps alone
@throws UnsupportedOperationException if either uuid is not a timestamp UUID
"""
return Longs.compare(uuid1.... | java | public static int compareTimestamps(UUID uuid1, UUID uuid2) {
return Longs.compare(uuid1.timestamp(), uuid2.timestamp());
} | [
"public",
"static",
"int",
"compareTimestamps",
"(",
"UUID",
"uuid1",
",",
"UUID",
"uuid2",
")",
"{",
"return",
"Longs",
".",
"compare",
"(",
"uuid1",
".",
"timestamp",
"(",
")",
",",
"uuid2",
".",
"timestamp",
"(",
")",
")",
";",
"}"
] | Compare the embedded timestamps of the given UUIDs. This is used when it is OK to return
an equality based on timestamps alone
@throws UnsupportedOperationException if either uuid is not a timestamp UUID | [
"Compare",
"the",
"embedded",
"timestamps",
"of",
"the",
"given",
"UUIDs",
".",
"This",
"is",
"used",
"when",
"it",
"is",
"OK",
"to",
"return",
"an",
"equality",
"based",
"on",
"timestamps",
"alone"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/TimeUUIDs.java#L176-L178 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ElemDesc.java | ElemDesc.isAttrFlagSet | public boolean isAttrFlagSet(String name, int flags) {
"""
Tell if any of the bits of interest are set for a named attribute type.
@param name non-null reference to attribute name, in any case.
@param flags flag mask.
@return true if any of the flags are set for the named attribute.
"""
return (... | java | public boolean isAttrFlagSet(String name, int flags)
{
return (null != m_attrs)
? ((m_attrs.getIgnoreCase(name) & flags) != 0)
: false;
} | [
"public",
"boolean",
"isAttrFlagSet",
"(",
"String",
"name",
",",
"int",
"flags",
")",
"{",
"return",
"(",
"null",
"!=",
"m_attrs",
")",
"?",
"(",
"(",
"m_attrs",
".",
"getIgnoreCase",
"(",
"name",
")",
"&",
"flags",
")",
"!=",
"0",
")",
":",
"false"... | Tell if any of the bits of interest are set for a named attribute type.
@param name non-null reference to attribute name, in any case.
@param flags flag mask.
@return true if any of the flags are set for the named attribute. | [
"Tell",
"if",
"any",
"of",
"the",
"bits",
"of",
"interest",
"are",
"set",
"for",
"a",
"named",
"attribute",
"type",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ElemDesc.java#L173-L178 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/CertificatesInner.java | CertificatesInner.listByAutomationAccountAsync | public Observable<Page<CertificateInner>> listByAutomationAccountAsync(final String resourceGroupName, final String automationAccountName) {
"""
Retrieve a list of certificates.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws I... | java | public Observable<Page<CertificateInner>> listByAutomationAccountAsync(final String resourceGroupName, final String automationAccountName) {
return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName)
.map(new Func1<ServiceResponse<Page<CertificateInner>>, Page<C... | [
"public",
"Observable",
"<",
"Page",
"<",
"CertificateInner",
">",
">",
"listByAutomationAccountAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"automationAccountName",
")",
"{",
"return",
"listByAutomationAccountWithServiceResponseAsync",
"(",
... | Retrieve a list of certificates.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<CertificateInner> object | [
"Retrieve",
"a",
"list",
"of",
"certificates",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/CertificatesInner.java#L522-L530 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java | GenericsUtils.buildWildcardType | public static GenericsType buildWildcardType(final ClassNode... types) {
"""
Generates a wildcard generic type in order to be used for checks against class nodes.
See {@link GenericsType#isCompatibleWith(org.codehaus.groovy.ast.ClassNode)}.
@param types the type to be used as the wildcard upper bound
@return ... | java | public static GenericsType buildWildcardType(final ClassNode... types) {
ClassNode base = ClassHelper.makeWithoutCaching("?");
GenericsType gt = new GenericsType(base, types, null);
gt.setWildcard(true);
return gt;
} | [
"public",
"static",
"GenericsType",
"buildWildcardType",
"(",
"final",
"ClassNode",
"...",
"types",
")",
"{",
"ClassNode",
"base",
"=",
"ClassHelper",
".",
"makeWithoutCaching",
"(",
"\"?\"",
")",
";",
"GenericsType",
"gt",
"=",
"new",
"GenericsType",
"(",
"base... | Generates a wildcard generic type in order to be used for checks against class nodes.
See {@link GenericsType#isCompatibleWith(org.codehaus.groovy.ast.ClassNode)}.
@param types the type to be used as the wildcard upper bound
@return a wildcard generics type | [
"Generates",
"a",
"wildcard",
"generic",
"type",
"in",
"order",
"to",
"be",
"used",
"for",
"checks",
"against",
"class",
"nodes",
".",
"See",
"{",
"@link",
"GenericsType#isCompatibleWith",
"(",
"org",
".",
"codehaus",
".",
"groovy",
".",
"ast",
".",
"ClassNo... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java#L141-L146 |
before/uadetector | modules/uadetector-resources/src/main/java/net/sf/uadetector/service/UADetectorServiceFactory.java | UADetectorServiceFactory.getOnlineUpdatingParser | public static UserAgentStringParser getOnlineUpdatingParser(final URL dataUrl, final URL versionUrl, final URL fallbackDataUrl, final URL fallbackVersionUrl) {
"""
Returns an implementation of {@link UserAgentStringParser} which checks at regular intervals for new versions of
<em>UAS data</em> (also known as data... | java | public static UserAgentStringParser getOnlineUpdatingParser(final URL dataUrl, final URL versionUrl, final URL fallbackDataUrl, final URL fallbackVersionUrl) {
return OnlineUpdatingParserHolder.getParser(dataUrl, versionUrl, getCustomFallbackXmlDataStore(fallbackDataUrl, fallbackVersionUrl));
} | [
"public",
"static",
"UserAgentStringParser",
"getOnlineUpdatingParser",
"(",
"final",
"URL",
"dataUrl",
",",
"final",
"URL",
"versionUrl",
",",
"final",
"URL",
"fallbackDataUrl",
",",
"final",
"URL",
"fallbackVersionUrl",
")",
"{",
"return",
"OnlineUpdatingParserHolder"... | Returns an implementation of {@link UserAgentStringParser} which checks at regular intervals for new versions of
<em>UAS data</em> (also known as database). When newer data available, it automatically loads and updates it.
<p>
At initialization time the returned parser will be loaded with the <em>UAS data</em> of this... | [
"Returns",
"an",
"implementation",
"of",
"{",
"@link",
"UserAgentStringParser",
"}",
"which",
"checks",
"at",
"regular",
"intervals",
"for",
"new",
"versions",
"of",
"<em",
">",
"UAS",
"data<",
"/",
"em",
">",
"(",
"also",
"known",
"as",
"database",
")",
"... | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-resources/src/main/java/net/sf/uadetector/service/UADetectorServiceFactory.java#L288-L290 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateUtils.java | DateUtils.getFragmentInMilliseconds | @GwtIncompatible("incompatible method")
public static long getFragmentInMilliseconds(final Calendar calendar, final int fragment) {
"""
<p>Returns the number of milliseconds within the
fragment. All datefields greater than the fragment will be ignored.</p>
<p>Asking the milliseconds of any date will only ret... | java | @GwtIncompatible("incompatible method")
public static long getFragmentInMilliseconds(final Calendar calendar, final int fragment) {
return getFragment(calendar, fragment, TimeUnit.MILLISECONDS);
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"long",
"getFragmentInMilliseconds",
"(",
"final",
"Calendar",
"calendar",
",",
"final",
"int",
"fragment",
")",
"{",
"return",
"getFragment",
"(",
"calendar",
",",
"fragment",
",",
"... | <p>Returns the number of milliseconds within the
fragment. All datefields greater than the fragment will be ignored.</p>
<p>Asking the milliseconds of any date will only return the number of milliseconds
of the current second (resulting in a number between 0 and 999). This
method will retrieve the number of millisecon... | [
"<p",
">",
"Returns",
"the",
"number",
"of",
"milliseconds",
"within",
"the",
"fragment",
".",
"All",
"datefields",
"greater",
"than",
"the",
"fragment",
"will",
"be",
"ignored",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L1491-L1494 |
lucee/Lucee | core/src/main/java/lucee/runtime/config/ConfigImpl.java | ConfigImpl.setTempDirectory | protected void setTempDirectory(String strTempDirectory, boolean flush) throws ExpressionException {
"""
sets the temp directory
@param strTempDirectory temp directory
@throws ExpressionException
"""
setTempDirectory(resources.getResource(strTempDirectory), flush);
} | java | protected void setTempDirectory(String strTempDirectory, boolean flush) throws ExpressionException {
setTempDirectory(resources.getResource(strTempDirectory), flush);
} | [
"protected",
"void",
"setTempDirectory",
"(",
"String",
"strTempDirectory",
",",
"boolean",
"flush",
")",
"throws",
"ExpressionException",
"{",
"setTempDirectory",
"(",
"resources",
".",
"getResource",
"(",
"strTempDirectory",
")",
",",
"flush",
")",
";",
"}"
] | sets the temp directory
@param strTempDirectory temp directory
@throws ExpressionException | [
"sets",
"the",
"temp",
"directory"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigImpl.java#L1624-L1626 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | @SuppressWarnings("unchecked")
public static List<Float> getAt(float[] array, Collection indices) {
"""
Support the subscript operator with a collection for a float array
@param array a float array
@param indices a collection of indices for the items to retrieve
@return list of the floats at the given ind... | java | @SuppressWarnings("unchecked")
public static List<Float> getAt(float[] array, Collection indices) {
return primitiveArrayGet(array, indices);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"Float",
">",
"getAt",
"(",
"float",
"[",
"]",
"array",
",",
"Collection",
"indices",
")",
"{",
"return",
"primitiveArrayGet",
"(",
"array",
",",
"indices",
")",
";",
"}"
... | Support the subscript operator with a collection for a float array
@param array a float array
@param indices a collection of indices for the items to retrieve
@return list of the floats at the given indices
@since 1.0 | [
"Support",
"the",
"subscript",
"operator",
"with",
"a",
"collection",
"for",
"a",
"float",
"array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L14003-L14006 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PropertiesSynonymProvider.java | PropertiesSynonymProvider.addSynonym | private static void addSynonym(String term, String synonym, Map<String, String[]> synonyms) {
"""
Adds a synonym definition to the map.
@param term the term
@param synonym synonym for <code>term</code>.
@param synonyms the Map containing the synonyms.
"""
term = term.toLowerCase();
String... | java | private static void addSynonym(String term, String synonym, Map<String, String[]> synonyms)
{
term = term.toLowerCase();
String[] syns = synonyms.get(term);
if (syns == null)
{
syns = new String[]{synonym};
}
else
{
String[] tmp = new String[syns.length + 1... | [
"private",
"static",
"void",
"addSynonym",
"(",
"String",
"term",
",",
"String",
"synonym",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"synonyms",
")",
"{",
"term",
"=",
"term",
".",
"toLowerCase",
"(",
")",
";",
"String",
"[",
"]",
"sy... | Adds a synonym definition to the map.
@param term the term
@param synonym synonym for <code>term</code>.
@param synonyms the Map containing the synonyms. | [
"Adds",
"a",
"synonym",
"definition",
"to",
"the",
"map",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PropertiesSynonymProvider.java#L176-L192 |
E7du/jfinal-ext3 | src/main/java/com/jfinal/ext/kit/PageViewKit.java | PageViewKit.getJSPPageView | public static String getJSPPageView(String dir, String viewPath, String pageName) {
"""
获取页面
@param dir 所在目录
@param viewPath view路径
@param pageName view名字
@return
"""
return getPageView(dir, viewPath, pageName, JSP);
} | java | public static String getJSPPageView(String dir, String viewPath, String pageName){
return getPageView(dir, viewPath, pageName, JSP);
} | [
"public",
"static",
"String",
"getJSPPageView",
"(",
"String",
"dir",
",",
"String",
"viewPath",
",",
"String",
"pageName",
")",
"{",
"return",
"getPageView",
"(",
"dir",
",",
"viewPath",
",",
"pageName",
",",
"JSP",
")",
";",
"}"
] | 获取页面
@param dir 所在目录
@param viewPath view路径
@param pageName view名字
@return | [
"获取页面"
] | train | https://github.com/E7du/jfinal-ext3/blob/8ffcbd150fd50c72852bb778bd427b5eb19254dc/src/main/java/com/jfinal/ext/kit/PageViewKit.java#L203-L205 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java | JsonRpcHttpAsyncClient.addHeaders | private void addHeaders(HttpRequest request, Map<String, String> headers) {
"""
Set the request headers.
@param request the request object
@param headers to be used
"""
for (Map.Entry<String, String> key : headers.entrySet()) {
request.addHeader(key.getKey(), key.getValue());
}
} | java | private void addHeaders(HttpRequest request, Map<String, String> headers) {
for (Map.Entry<String, String> key : headers.entrySet()) {
request.addHeader(key.getKey(), key.getValue());
}
} | [
"private",
"void",
"addHeaders",
"(",
"HttpRequest",
"request",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"key",
":",
"headers",
".",
"entrySet",
"(",
")",
... | Set the request headers.
@param request the request object
@param headers to be used | [
"Set",
"the",
"request",
"headers",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java#L261-L265 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.leftShift | public static StringBuffer leftShift(String self, Object value) {
"""
Overloads the left shift operator to provide an easy way to append multiple
objects as string representations to a String.
@param self a String
@param value an Object
@return a StringBuffer built from this string
@since 1.0
"""
... | java | public static StringBuffer leftShift(String self, Object value) {
return new StringBuffer(self).append(value);
} | [
"public",
"static",
"StringBuffer",
"leftShift",
"(",
"String",
"self",
",",
"Object",
"value",
")",
"{",
"return",
"new",
"StringBuffer",
"(",
"self",
")",
".",
"append",
"(",
"value",
")",
";",
"}"
] | Overloads the left shift operator to provide an easy way to append multiple
objects as string representations to a String.
@param self a String
@param value an Object
@return a StringBuffer built from this string
@since 1.0 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"an",
"easy",
"way",
"to",
"append",
"multiple",
"objects",
"as",
"string",
"representations",
"to",
"a",
"String",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L1926-L1928 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_freedom_GET | public ArrayList<String> serviceName_freedom_GET(String serviceName, net.minidev.ovh.api.hosting.web.freedom.OvhStatusEnum status) throws IOException {
"""
Freedom linked to this hosting account
REST: GET /hosting/web/{serviceName}/freedom
@param status [required] Filter the value of status property (=)
@para... | java | public ArrayList<String> serviceName_freedom_GET(String serviceName, net.minidev.ovh.api.hosting.web.freedom.OvhStatusEnum status) throws IOException {
String qPath = "/hosting/web/{serviceName}/freedom";
StringBuilder sb = path(qPath, serviceName);
query(sb, "status", status);
String resp = exec(qPath, "GET", ... | [
"public",
"ArrayList",
"<",
"String",
">",
"serviceName_freedom_GET",
"(",
"String",
"serviceName",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"hosting",
".",
"web",
".",
"freedom",
".",
"OvhStatusEnum",
"status",
")",
"throws",
"IOException",
... | Freedom linked to this hosting account
REST: GET /hosting/web/{serviceName}/freedom
@param status [required] Filter the value of status property (=)
@param serviceName [required] The internal name of your hosting | [
"Freedom",
"linked",
"to",
"this",
"hosting",
"account"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L626-L632 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Utils.java | Utils.compileMustache | public static String compileMustache(Map<String, Object> context, String template) {
"""
Compiles a mustache template with a given scope (map of fields and values).
@param context a map of fields and values
@param template a Mustache template
@return the compiled template string
"""
if (context == null ||... | java | public static String compileMustache(Map<String, Object> context, String template) {
if (context == null || StringUtils.isBlank(template)) {
return "";
}
Writer writer = new StringWriter();
try {
Mustache.compiler().escapeHTML(false).emptyStringIsFalse(true).compile(template).execute(context, writer);
}... | [
"public",
"static",
"String",
"compileMustache",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"context",
",",
"String",
"template",
")",
"{",
"if",
"(",
"context",
"==",
"null",
"||",
"StringUtils",
".",
"isBlank",
"(",
"template",
")",
")",
"{",
"retu... | Compiles a mustache template with a given scope (map of fields and values).
@param context a map of fields and values
@param template a Mustache template
@return the compiled template string | [
"Compiles",
"a",
"mustache",
"template",
"with",
"a",
"given",
"scope",
"(",
"map",
"of",
"fields",
"and",
"values",
")",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Utils.java#L284-L299 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java | AbstractQueryProtocol.cancelCurrentQuery | @Override
public void cancelCurrentQuery() throws SQLException {
"""
Cancels the current query - clones the current protocol and executes a query using the new
connection.
@throws SQLException never thrown
"""
try (MasterProtocol copiedProtocol = new MasterProtocol(urlParser, new GlobalStateInfo(),
... | java | @Override
public void cancelCurrentQuery() throws SQLException {
try (MasterProtocol copiedProtocol = new MasterProtocol(urlParser, new GlobalStateInfo(),
new ReentrantLock())) {
copiedProtocol.setHostAddress(getHostAddress());
copiedProtocol.connect();
//no lock, because there is alread... | [
"@",
"Override",
"public",
"void",
"cancelCurrentQuery",
"(",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"MasterProtocol",
"copiedProtocol",
"=",
"new",
"MasterProtocol",
"(",
"urlParser",
",",
"new",
"GlobalStateInfo",
"(",
")",
",",
"new",
"ReentrantLock",
... | Cancels the current query - clones the current protocol and executes a query using the new
connection.
@throws SQLException never thrown | [
"Cancels",
"the",
"current",
"query",
"-",
"clones",
"the",
"current",
"protocol",
"and",
"executes",
"a",
"query",
"using",
"the",
"new",
"connection",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1270-L1280 |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/ShareableResource.java | ShareableResource.setCapacity | public ShareableResource setCapacity(Node n, int val) {
"""
Set the resource consumption of a node.
@param n the node
@param val the value to set
@return the current resource
"""
if (val < 0) {
throw new IllegalArgumentException(String.format("The '%s' capacity of node '%s' must be >= 0", rcId... | java | public ShareableResource setCapacity(Node n, int val) {
if (val < 0) {
throw new IllegalArgumentException(String.format("The '%s' capacity of node '%s' must be >= 0", rcId, n));
}
nodesCapacity.put(n, val);
return this;
} | [
"public",
"ShareableResource",
"setCapacity",
"(",
"Node",
"n",
",",
"int",
"val",
")",
"{",
"if",
"(",
"val",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"The '%s' capacity of node '%s' must be >= 0\"",
"... | Set the resource consumption of a node.
@param n the node
@param val the value to set
@return the current resource | [
"Set",
"the",
"resource",
"consumption",
"of",
"a",
"node",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/ShareableResource.java#L177-L183 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/ops4j/pax/logging/slf4j/Slf4jLoggerFactory.java | Slf4jLoggerFactory.getLogger | public Logger getLogger(String name) {
"""
Return an appropriate {@link org.slf4j.Logger} instance as specified by the <code>name</code> parameter.
<p>
Null-valued name arguments are considered invalid.
<p>
Certain extremely simple logging systems, e.g. NOP, may always return the same logger instance regar... | java | public Logger getLogger(String name)
{
PaxLogger paxLogger;
if (m_paxLogging == null)
{
paxLogger = FallbackLogFactory.createFallbackLog(null, name);
}
else
{
paxLogger = m_paxLogging.getLogger(name, Slf4jLogger.SLF4J_FQCN);
}
S... | [
"public",
"Logger",
"getLogger",
"(",
"String",
"name",
")",
"{",
"PaxLogger",
"paxLogger",
";",
"if",
"(",
"m_paxLogging",
"==",
"null",
")",
"{",
"paxLogger",
"=",
"FallbackLogFactory",
".",
"createFallbackLog",
"(",
"null",
",",
"name",
")",
";",
"}",
"... | Return an appropriate {@link org.slf4j.Logger} instance as specified by the <code>name</code> parameter.
<p>
Null-valued name arguments are considered invalid.
<p>
Certain extremely simple logging systems, e.g. NOP, may always return the same logger instance regardless of the
requested name.
@param name the name of ... | [
"Return",
"an",
"appropriate",
"{",
"@link",
"org",
".",
"slf4j",
".",
"Logger",
"}",
"instance",
"as",
"specified",
"by",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"parameter",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/ops4j/pax/logging/slf4j/Slf4jLoggerFactory.java#L77-L96 |
strator-dev/greenpepper | greenpepper-open/extensions-external/php/src/main/java/com/greenpepper/phpsud/phpDriver/PHPDriverHelper.java | PHPDriverHelper.copyFile | public static File copyFile(InputStream is, boolean deleteOnExit) throws IOException {
"""
<p>copyFile.</p>
@param is a {@link java.io.InputStream} object.
@param deleteOnExit a boolean.
@return a {@link java.io.File} object.
@throws java.io.IOException if any.
"""
File f = File.createTempFile("php", "... | java | public static File copyFile(InputStream is, boolean deleteOnExit) throws IOException {
File f = File.createTempFile("php", ".php");
if (deleteOnExit) {
f.deleteOnExit();
}
FileWriter fw = new FileWriter(f);
copyFile(new BufferedReader(new InputStreamReader(is)), new BufferedWriter(fw));
is.close();
fw.... | [
"public",
"static",
"File",
"copyFile",
"(",
"InputStream",
"is",
",",
"boolean",
"deleteOnExit",
")",
"throws",
"IOException",
"{",
"File",
"f",
"=",
"File",
".",
"createTempFile",
"(",
"\"php\"",
",",
"\".php\"",
")",
";",
"if",
"(",
"deleteOnExit",
")",
... | <p>copyFile.</p>
@param is a {@link java.io.InputStream} object.
@param deleteOnExit a boolean.
@return a {@link java.io.File} object.
@throws java.io.IOException if any. | [
"<p",
">",
"copyFile",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/extensions-external/php/src/main/java/com/greenpepper/phpsud/phpDriver/PHPDriverHelper.java#L143-L153 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmUtils.java | XsdAsmUtils.generateClass | static ClassWriter generateClass(String className, String superName, String[] interfaces, String signature, int classModifiers, String apiName) {
"""
Generates an empty class.
@param className The classes name.
@param superName The super object, which the class extends from.
@param interfaces The name of the in... | java | static ClassWriter generateClass(String className, String superName, String[] interfaces, String signature, int classModifiers, String apiName) {
ClassWriter classWriter = new ClassWriter(0);
if (interfaces != null){
for (int i = 0; i < interfaces.length; i++) {
interfaces[i... | [
"static",
"ClassWriter",
"generateClass",
"(",
"String",
"className",
",",
"String",
"superName",
",",
"String",
"[",
"]",
"interfaces",
",",
"String",
"signature",
",",
"int",
"classModifiers",
",",
"String",
"apiName",
")",
"{",
"ClassWriter",
"classWriter",
"... | Generates an empty class.
@param className The classes name.
@param superName The super object, which the class extends from.
@param interfaces The name of the interfaces which this class implements.
@param classModifiers The modifiers to the class.
@return A class writer that will be used to write the remaining inform... | [
"Generates",
"an",
"empty",
"class",
"."
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmUtils.java#L514-L526 |
haifengl/smile | math/src/main/java/smile/sort/SortUtils.java | SortUtils.siftDown | public static <T extends Comparable<? super T>> void siftDown(T[] arr, int k, int n) {
"""
To restore the max-heap condition when a node's priority is decreased.
We move down the heap, exchanging the node at position k with the larger
of that node's two children if necessary and stopping when the node at
k is n... | java | public static <T extends Comparable<? super T>> void siftDown(T[] arr, int k, int n) {
while (2*k <= n) {
int j = 2 * k;
if (j < n && arr[j].compareTo(arr[j + 1]) < 0) {
j++;
}
if (arr[k].compareTo(arr[j]) >= 0) {
break;
... | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
"super",
"T",
">",
">",
"void",
"siftDown",
"(",
"T",
"[",
"]",
"arr",
",",
"int",
"k",
",",
"int",
"n",
")",
"{",
"while",
"(",
"2",
"*",
"k",
"<=",
"n",
")",
"{",
"int",
"j",
... | To restore the max-heap condition when a node's priority is decreased.
We move down the heap, exchanging the node at position k with the larger
of that node's two children if necessary and stopping when the node at
k is not smaller than either child or the bottom is reached. Note that
if n is even and k is n/2, then th... | [
"To",
"restore",
"the",
"max",
"-",
"heap",
"condition",
"when",
"a",
"node",
"s",
"priority",
"is",
"decreased",
".",
"We",
"move",
"down",
"the",
"heap",
"exchanging",
"the",
"node",
"at",
"position",
"k",
"with",
"the",
"larger",
"of",
"that",
"node",... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/sort/SortUtils.java#L195-L207 |
davidmoten/rxjava-extras | src/main/java/com/github/davidmoten/rx/Transformers.java | Transformers.doOnFirst | public static <T> Transformer<T, T> doOnFirst(final Action1<? super T> action) {
"""
Returns a {@link Transformer} that applied to a source {@link Observable}
calls the given action on the first onNext emission.
@param action
is performed on first onNext
@param <T>
the generic type of the Observable being t... | java | public static <T> Transformer<T, T> doOnFirst(final Action1<? super T> action) {
return doOnNext(1, action);
} | [
"public",
"static",
"<",
"T",
">",
"Transformer",
"<",
"T",
",",
"T",
">",
"doOnFirst",
"(",
"final",
"Action1",
"<",
"?",
"super",
"T",
">",
"action",
")",
"{",
"return",
"doOnNext",
"(",
"1",
",",
"action",
")",
";",
"}"
] | Returns a {@link Transformer} that applied to a source {@link Observable}
calls the given action on the first onNext emission.
@param action
is performed on first onNext
@param <T>
the generic type of the Observable being transformed
@return Transformer that applied to a source Observable calls the given
action on the... | [
"Returns",
"a",
"{",
"@link",
"Transformer",
"}",
"that",
"applied",
"to",
"a",
"source",
"{",
"@link",
"Observable",
"}",
"calls",
"the",
"given",
"action",
"on",
"the",
"first",
"onNext",
"emission",
"."
] | train | https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L648-L650 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/FieldReaderWriter.java | FieldReaderWriter.setValue | public void setValue(Object instance, Object newValue, ISMgr stateManager) throws IllegalAccessException {
"""
Set the value of an instance field on the specified instance to the specified value. If a state manager is passed
in things can be done in a more optimal way, otherwise the state manager has to be discov... | java | public void setValue(Object instance, Object newValue, ISMgr stateManager) throws IllegalAccessException {
if (typeDescriptor.isReloadable()) {
if (stateManager == null) {
// Look it up using reflection
stateManager = findInstanceStateManager(instance);
}
String declaringTypeName = typeDescriptor.get... | [
"public",
"void",
"setValue",
"(",
"Object",
"instance",
",",
"Object",
"newValue",
",",
"ISMgr",
"stateManager",
")",
"throws",
"IllegalAccessException",
"{",
"if",
"(",
"typeDescriptor",
".",
"isReloadable",
"(",
")",
")",
"{",
"if",
"(",
"stateManager",
"==... | Set the value of an instance field on the specified instance to the specified value. If a state manager is passed
in things can be done in a more optimal way, otherwise the state manager has to be discovered from the instance.
@param instance the object instance upon which to set the field
@param newValue the new valu... | [
"Set",
"the",
"value",
"of",
"an",
"instance",
"field",
"on",
"the",
"specified",
"instance",
"to",
"the",
"specified",
"value",
".",
"If",
"a",
"state",
"manager",
"is",
"passed",
"in",
"things",
"can",
"be",
"done",
"in",
"a",
"more",
"optimal",
"way",... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/FieldReaderWriter.java#L63-L90 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/tools/Tools.java | Tools.getBitextRules | public static List<BitextRule> getBitextRules(Language source,
Language target) throws IOException, ParserConfigurationException, SAXException {
"""
Gets default bitext rules for a given pair of languages
@param source Source language.
@param target Target language.
@return List of Bitext rules
"""... | java | public static List<BitextRule> getBitextRules(Language source,
Language target) throws IOException, ParserConfigurationException, SAXException {
return getBitextRules(source, target, null);
} | [
"public",
"static",
"List",
"<",
"BitextRule",
">",
"getBitextRules",
"(",
"Language",
"source",
",",
"Language",
"target",
")",
"throws",
"IOException",
",",
"ParserConfigurationException",
",",
"SAXException",
"{",
"return",
"getBitextRules",
"(",
"source",
",",
... | Gets default bitext rules for a given pair of languages
@param source Source language.
@param target Target language.
@return List of Bitext rules | [
"Gets",
"default",
"bitext",
"rules",
"for",
"a",
"given",
"pair",
"of",
"languages"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/tools/Tools.java#L109-L112 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/Layout.java | Layout.onLayoutApplied | public void onLayoutApplied(final WidgetContainer container, final Vector3Axis viewPortSize) {
"""
Called when the layout is applied to the data
@param container WidgetContainer to access the org.gearvrf.org.gearvrf.widgetlib in the layout
@param viewPortSize View port for data set
"""
mContainer = c... | java | public void onLayoutApplied(final WidgetContainer container, final Vector3Axis viewPortSize) {
mContainer = container;
mViewPort.setSize(viewPortSize);
if (mContainer != null) {
mContainer.onLayoutChanged(this);
}
} | [
"public",
"void",
"onLayoutApplied",
"(",
"final",
"WidgetContainer",
"container",
",",
"final",
"Vector3Axis",
"viewPortSize",
")",
"{",
"mContainer",
"=",
"container",
";",
"mViewPort",
".",
"setSize",
"(",
"viewPortSize",
")",
";",
"if",
"(",
"mContainer",
"!... | Called when the layout is applied to the data
@param container WidgetContainer to access the org.gearvrf.org.gearvrf.widgetlib in the layout
@param viewPortSize View port for data set | [
"Called",
"when",
"the",
"layout",
"is",
"applied",
"to",
"the",
"data"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/Layout.java#L109-L115 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/IOUtils.java | IOUtils.copyBytes | public static void copyBytes(final InputStream in, final OutputStream out) throws IOException {
"""
Copies from one stream to another. <strong>closes the input and output
streams at the end</strong>.
@param in
InputStream to read from
@param out
OutputStream to write to
@throws IOException
thrown if an I/... | java | public static void copyBytes(final InputStream in, final OutputStream out) throws IOException {
copyBytes(in, out, BLOCKSIZE, true);
} | [
"public",
"static",
"void",
"copyBytes",
"(",
"final",
"InputStream",
"in",
",",
"final",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"copyBytes",
"(",
"in",
",",
"out",
",",
"BLOCKSIZE",
",",
"true",
")",
";",
"}"
] | Copies from one stream to another. <strong>closes the input and output
streams at the end</strong>.
@param in
InputStream to read from
@param out
OutputStream to write to
@throws IOException
thrown if an I/O error occurs while copying | [
"Copies",
"from",
"one",
"stream",
"to",
"another",
".",
"<strong",
">",
"closes",
"the",
"input",
"and",
"output",
"streams",
"at",
"the",
"end<",
"/",
"strong",
">",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/IOUtils.java#L90-L92 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.