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 |
|---|---|---|---|---|---|---|---|---|---|---|
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolFactory.java | PoolFactory.createPool | public static Pool createPool(String type, ConnectionManager cm, PoolConfiguration pc) {
"""
Create a pool
@param type The type
@param cm The connection manager
@param pc The pool configuration
@return The pool
"""
if (type == null || type.equals(""))
return new DefaultPool(cm, pc);
t... | java | public static Pool createPool(String type, ConnectionManager cm, PoolConfiguration pc)
{
if (type == null || type.equals(""))
return new DefaultPool(cm, pc);
type = type.toLowerCase(Locale.US);
switch (type)
{
case "default":
return new DefaultPool(cm, pc... | [
"public",
"static",
"Pool",
"createPool",
"(",
"String",
"type",
",",
"ConnectionManager",
"cm",
",",
"PoolConfiguration",
"pc",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"||",
"type",
".",
"equals",
"(",
"\"\"",
")",
")",
"return",
"new",
"DefaultPool",
... | Create a pool
@param type The type
@param cm The connection manager
@param pc The pool configuration
@return The pool | [
"Create",
"a",
"pool"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolFactory.java#L74-L105 |
sahan/DroidBallet | droidballet/src/main/java/com/lonepulse/droidballet/detector/VerticalMotionDetector.java | VerticalMotionDetector.processVerticalDirection | private VERTICAL_DIRECTION processVerticalDirection(float[] output, float midRangeHigh, float midRangeLow) {
"""
<p>Determines the {@link VERTICAL_DIRECTION} of the motion and trims the
sensor reading on the Y-Axis to within the bounds handled by the the
motion detector.
@param output
the smoothed sensor val... | java | private VERTICAL_DIRECTION processVerticalDirection(float[] output, float midRangeHigh, float midRangeLow) {
output[1] = (output[1] < 0)? 0.0f : output[1];
if (output[1] < midRangeLow) {
output[1] *= -1;
return VERTICAL_DIRECTION.UP;
}
else if (output[1] > midRangeHigh) {
return VERTICAL_DIRECTI... | [
"private",
"VERTICAL_DIRECTION",
"processVerticalDirection",
"(",
"float",
"[",
"]",
"output",
",",
"float",
"midRangeHigh",
",",
"float",
"midRangeLow",
")",
"{",
"output",
"[",
"1",
"]",
"=",
"(",
"output",
"[",
"1",
"]",
"<",
"0",
")",
"?",
"0.0f",
":... | <p>Determines the {@link VERTICAL_DIRECTION} of the motion and trims the
sensor reading on the Y-Axis to within the bounds handled by the the
motion detector.
@param output
the smoothed sensor values
@param midRangeHigh
the upperbound of the mid-range which correlates with {@link VERTICAL_DIRECTION#NONE}
@param midR... | [
"<p",
">",
"Determines",
"the",
"{",
"@link",
"VERTICAL_DIRECTION",
"}",
"of",
"the",
"motion",
"and",
"trims",
"the",
"sensor",
"reading",
"on",
"the",
"Y",
"-",
"Axis",
"to",
"within",
"the",
"bounds",
"handled",
"by",
"the",
"the",
"motion",
"detector",... | train | https://github.com/sahan/DroidBallet/blob/c6001c9e933cb2c8dbcabe1ae561678b31b10b62/droidballet/src/main/java/com/lonepulse/droidballet/detector/VerticalMotionDetector.java#L143-L160 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java | GeneratedDConnectionDaoImpl.queryByProviderId | public Iterable<DConnection> queryByProviderId(java.lang.String providerId) {
"""
query-by method for field providerId
@param providerId the specified attribute
@return an Iterable of DConnections for the specified providerId
"""
return queryByField(null, DConnectionMapper.Field.PROVIDERID.getFieldName()... | java | public Iterable<DConnection> queryByProviderId(java.lang.String providerId) {
return queryByField(null, DConnectionMapper.Field.PROVIDERID.getFieldName(), providerId);
} | [
"public",
"Iterable",
"<",
"DConnection",
">",
"queryByProviderId",
"(",
"java",
".",
"lang",
".",
"String",
"providerId",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DConnectionMapper",
".",
"Field",
".",
"PROVIDERID",
".",
"getFieldName",
"(",
")"... | query-by method for field providerId
@param providerId the specified attribute
@return an Iterable of DConnections for the specified providerId | [
"query",
"-",
"by",
"method",
"for",
"field",
"providerId"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L115-L117 |
airlift/slice | src/main/java/io/airlift/slice/SliceUtf8.java | SliceUtf8.countCodePoints | public static int countCodePoints(Slice utf8, int offset, int length) {
"""
Counts the code points within UTF-8 encoded slice up to {@code length}.
<p>
Note: This method does not explicitly check for valid UTF-8, and may
return incorrect results or throw an exception for invalid UTF-8.
"""
checkPosi... | java | public static int countCodePoints(Slice utf8, int offset, int length)
{
checkPositionIndexes(offset, offset + length, utf8.length());
// Quick exit if empty string
if (length == 0) {
return 0;
}
int continuationBytesCount = 0;
// Length rounded to 8 byte... | [
"public",
"static",
"int",
"countCodePoints",
"(",
"Slice",
"utf8",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"checkPositionIndexes",
"(",
"offset",
",",
"offset",
"+",
"length",
",",
"utf8",
".",
"length",
"(",
")",
")",
";",
"// Quick exit if... | Counts the code points within UTF-8 encoded slice up to {@code length}.
<p>
Note: This method does not explicitly check for valid UTF-8, and may
return incorrect results or throw an exception for invalid UTF-8. | [
"Counts",
"the",
"code",
"points",
"within",
"UTF",
"-",
"8",
"encoded",
"slice",
"up",
"to",
"{"
] | train | https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/SliceUtf8.java#L114-L145 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/GenericSorting.java | GenericSorting.upper_bound | private static int upper_bound(int first, int last, int x, IntComparator comp) {
"""
Performs a binary search on an already-sorted range: finds the last
position where an element can be inserted without violating the ordering.
Sorting is by a user-supplied comparison function.
@param array Array containing t... | java | private static int upper_bound(int first, int last, int x, IntComparator comp) {
//if (comp==null) throw new NullPointerException();
int len = last - first;
while (len > 0) {
int half = len / 2;
int middle = first + half;
if (comp.compare(x, middle)<0) {
len = half;
}
else {
first = middle ... | [
"private",
"static",
"int",
"upper_bound",
"(",
"int",
"first",
",",
"int",
"last",
",",
"int",
"x",
",",
"IntComparator",
"comp",
")",
"{",
"//if (comp==null) throw new NullPointerException();\r",
"int",
"len",
"=",
"last",
"-",
"first",
";",
"while",
"(",
"l... | Performs a binary search on an already-sorted range: finds the last
position where an element can be inserted without violating the ordering.
Sorting is by a user-supplied comparison function.
@param array Array containing the range.
@param first Beginning of the range.
@param last One past the end of the ran... | [
"Performs",
"a",
"binary",
"search",
"on",
"an",
"already",
"-",
"sorted",
"range",
":",
"finds",
"the",
"last",
"position",
"where",
"an",
"element",
"can",
"be",
"inserted",
"without",
"violating",
"the",
"ordering",
".",
"Sorting",
"is",
"by",
"a",
"use... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/GenericSorting.java#L443-L458 |
BlueBrain/bluima | modules/bluima_jsre/src/main/java/org/itc/irst/tcc/sre/kernel/expl/AbstractMapping.java | AbstractMapping.map | public VectorSet map(ExampleSet data, FeatureIndex[] index)
throws IllegalArgumentException {
"""
/*
protected int maxDimension(SparseVector[] subspaces) { int max = 0; for
(int i=0;i<subspaces.length;i++) { if (subspaces[i].size() > max) max =
subspaces[i].size(); } // end for i
return max; } //... | java | public VectorSet map(ExampleSet data, FeatureIndex[] index)
throws IllegalArgumentException {
// logger.debug("AbstractMapping.map");
boolean b = (data instanceof SentenceSetCopy);
if (!b) {
throw new IllegalArgumentException();
}
VectorSet result = new ... | [
"public",
"VectorSet",
"map",
"(",
"ExampleSet",
"data",
",",
"FeatureIndex",
"[",
"]",
"index",
")",
"throws",
"IllegalArgumentException",
"{",
"// logger.debug(\"AbstractMapping.map\");",
"boolean",
"b",
"=",
"(",
"data",
"instanceof",
"SentenceSetCopy",
")",
";",
... | /*
protected int maxDimension(SparseVector[] subspaces) { int max = 0; for
(int i=0;i<subspaces.length;i++) { if (subspaces[i].size() > max) max =
subspaces[i].size(); } // end for i
return max; } // end maxDimension | [
"/",
"*",
"protected",
"int",
"maxDimension",
"(",
"SparseVector",
"[]",
"subspaces",
")",
"{",
"int",
"max",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i<subspaces",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"subspaces",
"[",... | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_jsre/src/main/java/org/itc/irst/tcc/sre/kernel/expl/AbstractMapping.java#L76-L106 |
citrusframework/citrus | modules/citrus-http/src/main/java/com/consol/citrus/http/message/HttpMessage.java | HttpMessage.fromResponseData | public static HttpMessage fromResponseData(final String responseData) {
"""
Reads response from complete response dump.
@param responseData The response dump to parse
@return The parsed dump as HttpMessage
"""
try (final BufferedReader reader = new BufferedReader(new StringReader(responseData))) {
... | java | public static HttpMessage fromResponseData(final String responseData) {
try (final BufferedReader reader = new BufferedReader(new StringReader(responseData))) {
final HttpMessage response = new HttpMessage();
final String[] statusLine = reader.readLine().split("\\s");
if (st... | [
"public",
"static",
"HttpMessage",
"fromResponseData",
"(",
"final",
"String",
"responseData",
")",
"{",
"try",
"(",
"final",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"StringReader",
"(",
"responseData",
")",
")",
")",
"{",
"final",
... | Reads response from complete response dump.
@param responseData The response dump to parse
@return The parsed dump as HttpMessage | [
"Reads",
"response",
"from",
"complete",
"response",
"dump",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/message/HttpMessage.java#L538-L555 |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JesqueUtils.java | JesqueUtils.materializeJob | public static Object materializeJob(final Job job, final Map<String, Class<?>> jobTypes)
throws UnpermittedJobException, Exception {
"""
Materializes a job by looking up {@link Job#getClassName()} in the
provided map of job types.
@param job
the job to materialize
@param jobTypes
a map of String... | java | public static Object materializeJob(final Job job, final Map<String, Class<?>> jobTypes)
throws UnpermittedJobException, Exception {
final String className = job.getClassName();
final Class<?> clazz = jobTypes.get(className);
if (clazz == null) {
throw new UnpermittedJobE... | [
"public",
"static",
"Object",
"materializeJob",
"(",
"final",
"Job",
"job",
",",
"final",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"jobTypes",
")",
"throws",
"UnpermittedJobException",
",",
"Exception",
"{",
"final",
"String",
"className",
"="... | Materializes a job by looking up {@link Job#getClassName()} in the
provided map of job types.
@param job
the job to materialize
@param jobTypes
a map of String names to Java types
@return the materialized job
@throws UnpermittedJobException
if there was not a non-null mapping in jobTypes for the class
name
@throws Exc... | [
"Materializes",
"a",
"job",
"by",
"looking",
"up",
"{",
"@link",
"Job#getClassName",
"()",
"}",
"in",
"the",
"provided",
"map",
"of",
"job",
"types",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JesqueUtils.java#L404-L416 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/Slice.java | Slice.setBytes | public void setBytes(int index, byte[] source, int sourceIndex, int length) {
"""
Transfers the specified source array's data to this buffer starting at
the specified absolute {@code index}.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0},
if the specified {@code srcInd... | java | public void setBytes(int index, byte[] source, int sourceIndex, int length)
{
checkPositionIndexes(index, index + length, this.length);
checkPositionIndexes(sourceIndex, sourceIndex + length, source.length);
index += offset;
System.arraycopy(source, sourceIndex, data, index, length);... | [
"public",
"void",
"setBytes",
"(",
"int",
"index",
",",
"byte",
"[",
"]",
"source",
",",
"int",
"sourceIndex",
",",
"int",
"length",
")",
"{",
"checkPositionIndexes",
"(",
"index",
",",
"index",
"+",
"length",
",",
"this",
".",
"length",
")",
";",
"che... | Transfers the specified source array's data to this buffer starting at
the specified absolute {@code index}.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0},
if the specified {@code srcIndex} is less than {@code 0},
if {@code index + length} is greater than
{@code this.capacity}... | [
"Transfers",
"the",
"specified",
"source",
"array",
"s",
"data",
"to",
"this",
"buffer",
"starting",
"at",
"the",
"specified",
"absolute",
"{",
"@code",
"index",
"}",
"."
] | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L382-L388 |
blackdoor/blackdoor | src/main/java/black/door/util/CSV.java | CSV.cacheFile | public void cacheFile() {
"""
load the entire CSV file into memory for much faster access
subsequent use of getField will not use file access and will occur in constant time
"""
if (orientation == Orientation.INV)
cache = new String[fields][elements];
else
cache = new String[elements][fields];
int... | java | public void cacheFile() {
if (orientation == Orientation.INV)
cache = new String[fields][elements];
else
cache = new String[elements][fields];
int x = 0, y = 0;
Scanner file = null;
try {
file = new Scanner(csvFile);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.pri... | [
"public",
"void",
"cacheFile",
"(",
")",
"{",
"if",
"(",
"orientation",
"==",
"Orientation",
".",
"INV",
")",
"cache",
"=",
"new",
"String",
"[",
"fields",
"]",
"[",
"elements",
"]",
";",
"else",
"cache",
"=",
"new",
"String",
"[",
"elements",
"]",
"... | load the entire CSV file into memory for much faster access
subsequent use of getField will not use file access and will occur in constant time | [
"load",
"the",
"entire",
"CSV",
"file",
"into",
"memory",
"for",
"much",
"faster",
"access",
"subsequent",
"use",
"of",
"getField",
"will",
"not",
"use",
"file",
"access",
"and",
"will",
"occur",
"in",
"constant",
"time"
] | train | https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/util/CSV.java#L58-L86 |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/config/xml/SendSoapFaultActionParser.java | SendSoapFaultActionParser.parseFaultDetail | private void parseFaultDetail(BeanDefinitionBuilder builder, Element faultElement) {
"""
Parses the fault detail element.
@param builder
@param faultElement the fault DOM element.
"""
List<Element> faultDetailElements = DomUtils.getChildElementsByTagName(faultElement, "fault-detail");
List<... | java | private void parseFaultDetail(BeanDefinitionBuilder builder, Element faultElement) {
List<Element> faultDetailElements = DomUtils.getChildElementsByTagName(faultElement, "fault-detail");
List<String> faultDetails = new ArrayList<String>();
List<String> faultDetailResourcePaths = new ArrayList<St... | [
"private",
"void",
"parseFaultDetail",
"(",
"BeanDefinitionBuilder",
"builder",
",",
"Element",
"faultElement",
")",
"{",
"List",
"<",
"Element",
">",
"faultDetailElements",
"=",
"DomUtils",
".",
"getChildElementsByTagName",
"(",
"faultElement",
",",
"\"fault-detail\"",... | Parses the fault detail element.
@param builder
@param faultElement the fault DOM element. | [
"Parses",
"the",
"fault",
"detail",
"element",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/config/xml/SendSoapFaultActionParser.java#L79-L107 |
jenkinsci/jenkins | core/src/main/java/hudson/node_monitors/NodeMonitorUpdater.java | NodeMonitorUpdater.onOnline | @Override
public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException {
"""
Triggers the update with 5 seconds quiet period, to avoid triggering data check too often
when multiple agents become online at about the same time.
"""
synchronized(this) {
... | java | @Override
public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException {
synchronized(this) {
future.cancel(false);
future = Timer.get().schedule(MONITOR_UPDATER, 5, TimeUnit.SECONDS);
}
} | [
"@",
"Override",
"public",
"void",
"onOnline",
"(",
"Computer",
"c",
",",
"TaskListener",
"listener",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"future",
".",
"cancel",
"(",
"false",
")",
";",
"fut... | Triggers the update with 5 seconds quiet period, to avoid triggering data check too often
when multiple agents become online at about the same time. | [
"Triggers",
"the",
"update",
"with",
"5",
"seconds",
"quiet",
"period",
"to",
"avoid",
"triggering",
"data",
"check",
"too",
"often",
"when",
"multiple",
"agents",
"become",
"online",
"at",
"about",
"the",
"same",
"time",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/node_monitors/NodeMonitorUpdater.java#L39-L45 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectPropertyAssertionAxiomImpl_CustomFieldSerializer.java | OWLObjectPropertyAssertionAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLObjectPropertyAssertionAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@lin... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLObjectPropertyAssertionAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLObjectPropertyAssertionAxiomImpl",
"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/OWLObjectPropertyAssertionAxiomImpl_CustomFieldSerializer.java#L101-L104 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java | AbstractLogger.enter | protected EntryMessage enter(final String fqcn, final Message message) {
"""
Logs entry to a method with location information.
@param fqcn
The fully qualified class name of the <b>caller</b>.
@param message
the Message.
@since 2.6
"""
EntryMessage flowMessage = null;
if (isEnabled(Level.... | java | protected EntryMessage enter(final String fqcn, final Message message) {
EntryMessage flowMessage = null;
if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, flowMessage = flowMessageFactory.newEntryMessage(message),
... | [
"protected",
"EntryMessage",
"enter",
"(",
"final",
"String",
"fqcn",
",",
"final",
"Message",
"message",
")",
"{",
"EntryMessage",
"flowMessage",
"=",
"null",
";",
"if",
"(",
"isEnabled",
"(",
"Level",
".",
"TRACE",
",",
"ENTRY_MARKER",
",",
"(",
"Object",
... | Logs entry to a method with location information.
@param fqcn
The fully qualified class name of the <b>caller</b>.
@param message
the Message.
@since 2.6 | [
"Logs",
"entry",
"to",
"a",
"method",
"with",
"location",
"information",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java#L571-L578 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/Sheet.java | Sheet.getLocalValue | public Object getLocalValue(final String rowKey, final int col) {
"""
Retrieves the submitted value for the rowKey and col.
@param row
@param col
@return
"""
return localValues.get(new SheetRowColIndex(rowKey, col));
} | java | public Object getLocalValue(final String rowKey, final int col) {
return localValues.get(new SheetRowColIndex(rowKey, col));
} | [
"public",
"Object",
"getLocalValue",
"(",
"final",
"String",
"rowKey",
",",
"final",
"int",
"col",
")",
"{",
"return",
"localValues",
".",
"get",
"(",
"new",
"SheetRowColIndex",
"(",
"rowKey",
",",
"col",
")",
")",
";",
"}"
] | Retrieves the submitted value for the rowKey and col.
@param row
@param col
@return | [
"Retrieves",
"the",
"submitted",
"value",
"for",
"the",
"rowKey",
"and",
"col",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/Sheet.java#L302-L304 |
wildfly-swarm-archive/ARCHIVE-wildfly-swarm | batch-jberet/api/src/main/java/org/wildfly/swarm/batch/jberet/BatchFraction.java | BatchFraction.threadPool | public BatchFraction threadPool(final int maxThreads, final int keepAliveTime, final TimeUnit keepAliveUnits) {
"""
Creates a new thread-pool using the {@linkplain #DEFAULT_THREAD_POOL_NAME default name} that can be used for batch jobs.
@param keepAliveTime the time to keep threads alive
@param keepAliveUnits... | java | public BatchFraction threadPool(final int maxThreads, final int keepAliveTime, final TimeUnit keepAliveUnits) {
return threadPool(DEFAULT_THREAD_POOL_NAME, maxThreads, keepAliveTime, keepAliveUnits);
} | [
"public",
"BatchFraction",
"threadPool",
"(",
"final",
"int",
"maxThreads",
",",
"final",
"int",
"keepAliveTime",
",",
"final",
"TimeUnit",
"keepAliveUnits",
")",
"{",
"return",
"threadPool",
"(",
"DEFAULT_THREAD_POOL_NAME",
",",
"maxThreads",
",",
"keepAliveTime",
... | Creates a new thread-pool using the {@linkplain #DEFAULT_THREAD_POOL_NAME default name} that can be used for batch jobs.
@param keepAliveTime the time to keep threads alive
@param keepAliveUnits the time unit for the keep alive time
@return this fraction | [
"Creates",
"a",
"new",
"thread",
"-",
"pool",
"using",
"the",
"{",
"@linkplain",
"#DEFAULT_THREAD_POOL_NAME",
"default",
"name",
"}",
"that",
"can",
"be",
"used",
"for",
"batch",
"jobs",
"."
] | train | https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/batch-jberet/api/src/main/java/org/wildfly/swarm/batch/jberet/BatchFraction.java#L167-L169 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.userInGroup | public boolean userInGroup(CmsDbContext dbc, String username, String groupname, boolean readRoles)
throws CmsException {
"""
Returns <code>true</code> if a user is member of the given group.<p>
@param dbc the current database context
@param username the name of the user to check
@param groupname the name ... | java | public boolean userInGroup(CmsDbContext dbc, String username, String groupname, boolean readRoles)
throws CmsException {
List<CmsGroup> groups = getGroupsOfUser(dbc, username, readRoles);
for (int i = 0; i < groups.size(); i++) {
CmsGroup group = groups.get(i);
if (groupname... | [
"public",
"boolean",
"userInGroup",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"username",
",",
"String",
"groupname",
",",
"boolean",
"readRoles",
")",
"throws",
"CmsException",
"{",
"List",
"<",
"CmsGroup",
">",
"groups",
"=",
"getGroupsOfUser",
"(",
"dbc",
... | Returns <code>true</code> if a user is member of the given group.<p>
@param dbc the current database context
@param username the name of the user to check
@param groupname the name of the group to check
@param readRoles if to read roles or groups
@return <code>true</code>, if the user is in the group, <code>false</co... | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"a",
"user",
"is",
"member",
"of",
"the",
"given",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9548-L9559 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalReader.java | JournalReader.readCharactersUntilEndOfArgument | private String readCharactersUntilEndOfArgument(XMLEventReader reader,
QName tagName,
String methodName,
String argumentName,
... | java | private String readCharactersUntilEndOfArgument(XMLEventReader reader,
QName tagName,
String methodName,
String argumentName,
... | [
"private",
"String",
"readCharactersUntilEndOfArgument",
"(",
"XMLEventReader",
"reader",
",",
"QName",
"tagName",
",",
"String",
"methodName",
",",
"String",
"argumentName",
",",
"String",
"argumentType",
")",
"throws",
"XMLStreamException",
",",
"JournalException",
"{... | Loop through a series of character events, accumulating the data into a
String. The character events should be terminated by an EndTagEvent with
the expected tag name. | [
"Loop",
"through",
"a",
"series",
"of",
"character",
"events",
"accumulating",
"the",
"data",
"into",
"a",
"String",
".",
"The",
"character",
"events",
"should",
"be",
"terminated",
"by",
"an",
"EndTagEvent",
"with",
"the",
"expected",
"tag",
"name",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalReader.java#L455-L476 |
Azure/azure-sdk-for-java | recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/VaultExtendedInfosInner.java | VaultExtendedInfosInner.createOrUpdateAsync | public Observable<VaultExtendedInfoResourceInner> createOrUpdateAsync(String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceResourceExtendedInfoDetails) {
"""
Create vault extended info.
@param resourceGroupName The name of the resource group where the recovery services vault is pre... | java | public Observable<VaultExtendedInfoResourceInner> createOrUpdateAsync(String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceResourceExtendedInfoDetails) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, resourceResourceExtendedInfoDetails).map(new Func1<S... | [
"public",
"Observable",
"<",
"VaultExtendedInfoResourceInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vaultName",
",",
"VaultExtendedInfoResourceInner",
"resourceResourceExtendedInfoDetails",
")",
"{",
"return",
"createOrUpdateWithServiceR... | Create vault extended info.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param vaultName The name of the recovery services vault.
@param resourceResourceExtendedInfoDetails Details of ResourceExtendedInfo
@throws IllegalArgumentException thrown if parameters fa... | [
"Create",
"vault",
"extended",
"info",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/VaultExtendedInfosInner.java#L196-L203 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java | SerializedCheckpointData.fromDeque | public static <T> SerializedCheckpointData[] fromDeque(
ArrayDeque<Tuple2<Long, Set<T>>> checkpoints,
TypeSerializer<T> serializer) throws IOException {
"""
Converts a list of checkpoints with elements into an array of SerializedCheckpointData.
@param checkpoints The checkpoints to be converted into IdsCh... | java | public static <T> SerializedCheckpointData[] fromDeque(
ArrayDeque<Tuple2<Long, Set<T>>> checkpoints,
TypeSerializer<T> serializer) throws IOException {
return fromDeque(checkpoints, serializer, new DataOutputSerializer(128));
} | [
"public",
"static",
"<",
"T",
">",
"SerializedCheckpointData",
"[",
"]",
"fromDeque",
"(",
"ArrayDeque",
"<",
"Tuple2",
"<",
"Long",
",",
"Set",
"<",
"T",
">",
">",
">",
"checkpoints",
",",
"TypeSerializer",
"<",
"T",
">",
"serializer",
")",
"throws",
"I... | Converts a list of checkpoints with elements into an array of SerializedCheckpointData.
@param checkpoints The checkpoints to be converted into IdsCheckpointData.
@param serializer The serializer to serialize the IDs.
@param <T> The type of the ID.
@return An array of serializable SerializedCheckpointData, one per ent... | [
"Converts",
"a",
"list",
"of",
"checkpoints",
"with",
"elements",
"into",
"an",
"array",
"of",
"SerializedCheckpointData",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java#L98-L102 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java | JdbcCpoAdapter.updateObject | @Override
public <T> long updateObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
"""
Update the Object in the datasource. The CpoAdapter will check to see if the object exists in the datasource. If it
e... | java | @Override
public <T> long updateObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
return processUpdateGroup(obj, JdbcCpoAdapter.UPDATE_GROUP, name, wheres, orderBy, nativeExpressions);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"long",
"updateObject",
"(",
"String",
"name",
",",
"T",
"obj",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
",",
"Collection",
"<",
"CpoNativeFunction",
... | Update the Object in the datasource. The CpoAdapter will check to see if the object exists in the datasource. If it
exists then the object will be updated. If it does not exist, an exception will be thrown
<p/>
<pre>Example:
<code>
<p/>
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
<p/>
try {
cpo... | [
"Update",
"the",
"Object",
"in",
"the",
"datasource",
".",
"The",
"CpoAdapter",
"will",
"check",
"to",
"see",
"if",
"the",
"object",
"exists",
"in",
"the",
"datasource",
".",
"If",
"it",
"exists",
"then",
"the",
"object",
"will",
"be",
"updated",
".",
"I... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java#L1832-L1835 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java | LegacyBehavior.determinePropagatingExecutionOnEnd | public static PvmExecutionImpl determinePropagatingExecutionOnEnd(PvmExecutionImpl propagatingExecution, Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping) {
"""
Tolerates the broken execution trees fixed with CAM-3727 where there may be more
ancestor scope executions than ancestor flow scopes;
In that... | java | public static PvmExecutionImpl determinePropagatingExecutionOnEnd(PvmExecutionImpl propagatingExecution, Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping) {
if (!propagatingExecution.isScope()) {
// non-scope executions may end in the "wrong" flow scope
return propagatingExecution;
}
el... | [
"public",
"static",
"PvmExecutionImpl",
"determinePropagatingExecutionOnEnd",
"(",
"PvmExecutionImpl",
"propagatingExecution",
",",
"Map",
"<",
"ScopeImpl",
",",
"PvmExecutionImpl",
">",
"activityExecutionMapping",
")",
"{",
"if",
"(",
"!",
"propagatingExecution",
".",
"i... | Tolerates the broken execution trees fixed with CAM-3727 where there may be more
ancestor scope executions than ancestor flow scopes;
In that case, the argument execution is removed, the parent execution of the argument
is returned such that one level of mismatch is corrected.
Note that this does not necessarily skip... | [
"Tolerates",
"the",
"broken",
"execution",
"trees",
"fixed",
"with",
"CAM",
"-",
"3727",
"where",
"there",
"may",
"be",
"more",
"ancestor",
"scope",
"executions",
"than",
"ancestor",
"flow",
"scopes",
";"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L382-L400 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Functions.java | Functions.mapDoubles | public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> mapDoubles(DoubleUnaryOperator b) {
"""
/*
Fluent transform operation using primitive types
e.g.
<pre>
{@code
import static cyclops.ReactiveSeq.mapDoubles;
ReactiveSeq.ofDoubles(1d,2d,3d)
.to(mapDoubles(i->i*2));
//[2d,4... | java | public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> mapDoubles(DoubleUnaryOperator b){
return a->a.doubles(i->i,s->s.map(b));
} | [
"public",
"static",
"Function",
"<",
"?",
"super",
"ReactiveSeq",
"<",
"Double",
">",
",",
"?",
"extends",
"ReactiveSeq",
"<",
"Double",
">",
">",
"mapDoubles",
"(",
"DoubleUnaryOperator",
"b",
")",
"{",
"return",
"a",
"->",
"a",
".",
"doubles",
"(",
"i"... | /*
Fluent transform operation using primitive types
e.g.
<pre>
{@code
import static cyclops.ReactiveSeq.mapDoubles;
ReactiveSeq.ofDoubles(1d,2d,3d)
.to(mapDoubles(i->i*2));
//[2d,4d,6d]
}
</pre> | [
"/",
"*",
"Fluent",
"transform",
"operation",
"using",
"primitive",
"types",
"e",
".",
"g",
".",
"<pre",
">",
"{",
"@code",
"import",
"static",
"cyclops",
".",
"ReactiveSeq",
".",
"mapDoubles",
";"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Functions.java#L499-L502 |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/PositionMap.java | PositionMap.put | public void put(int key, E value) {
"""
Adds a mapping from the specified key to the specified value,
replacing the previous mapping from the specified key if there
was one.
"""
int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
if (i >= 0) {
mValues[i] = value;
} ... | java | public void put(int key, E value) {
int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
if (i >= 0) {
mValues[i] = value;
} else {
i = ~i;
if (i < mSize && mValues[i] == DELETED) {
mKeys[i] = key;
mValues[i] = value;
... | [
"public",
"void",
"put",
"(",
"int",
"key",
",",
"E",
"value",
")",
"{",
"int",
"i",
"=",
"ContainerHelpers",
".",
"binarySearch",
"(",
"mKeys",
",",
"mSize",
",",
"key",
")",
";",
"if",
"(",
"i",
">=",
"0",
")",
"{",
"mValues",
"[",
"i",
"]",
... | Adds a mapping from the specified key to the specified value,
replacing the previous mapping from the specified key if there
was one. | [
"Adds",
"a",
"mapping",
"from",
"the",
"specified",
"key",
"to",
"the",
"specified",
"value",
"replacing",
"the",
"previous",
"mapping",
"from",
"the",
"specified",
"key",
"if",
"there",
"was",
"one",
"."
] | train | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/PositionMap.java#L181-L226 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/date/DateCaster.java | DateCaster.toDateSimple | public static DateTime toDateSimple(String str, short convertingType, boolean alsoMonthString, TimeZone timeZone, DateTime defaultValue) {
"""
converts the given string to a date following simple and fast parsing rules (no international
formats)
@param str
@param convertingType one of the following values: - ... | java | public static DateTime toDateSimple(String str, short convertingType, boolean alsoMonthString, TimeZone timeZone, DateTime defaultValue) {
str = StringUtil.trim(str, "");
DateString ds = new DateString(str);
// Timestamp
if (ds.isCurrent('{') && ds.isLast('}')) {
return _toDateSimpleTS(ds, timeZone, defaultVa... | [
"public",
"static",
"DateTime",
"toDateSimple",
"(",
"String",
"str",
",",
"short",
"convertingType",
",",
"boolean",
"alsoMonthString",
",",
"TimeZone",
"timeZone",
",",
"DateTime",
"defaultValue",
")",
"{",
"str",
"=",
"StringUtil",
".",
"trim",
"(",
"str",
... | converts the given string to a date following simple and fast parsing rules (no international
formats)
@param str
@param convertingType one of the following values: - CONVERTING_TYPE_NONE: number are not
converted at all - CONVERTING_TYPE_YEAR: integers are handled as years -
CONVERTING_TYPE_OFFSET: numbers are handle... | [
"converts",
"the",
"given",
"string",
"to",
"a",
"date",
"following",
"simple",
"and",
"fast",
"parsing",
"rules",
"(",
"no",
"international",
"formats",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/date/DateCaster.java#L831-L844 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.stringTemplate | public static StringTemplate stringTemplate(Template template, Object... args) {
"""
Create a new Template expression
@param template template
@param args template parameters
@return template expression
"""
return stringTemplate(template, ImmutableList.copyOf(args));
} | java | public static StringTemplate stringTemplate(Template template, Object... args) {
return stringTemplate(template, ImmutableList.copyOf(args));
} | [
"public",
"static",
"StringTemplate",
"stringTemplate",
"(",
"Template",
"template",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"stringTemplate",
"(",
"template",
",",
"ImmutableList",
".",
"copyOf",
"(",
"args",
")",
")",
";",
"}"
] | Create a new Template expression
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L924-L926 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.getKeyPair | public static KeyPair getKeyPair(String type, InputStream in, char[] password, String alias) {
"""
从KeyStore中获取私钥公钥
@param type 类型
@param in {@link InputStream} 如果想从文件读取.keystore文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@param password 密码
@param alias 别名
@return {@link KeyPair}
@since 4.4.1
... | java | public static KeyPair getKeyPair(String type, InputStream in, char[] password, String alias) {
final KeyStore keyStore = readKeyStore(type, in, password);
return getKeyPair(keyStore, password, alias);
} | [
"public",
"static",
"KeyPair",
"getKeyPair",
"(",
"String",
"type",
",",
"InputStream",
"in",
",",
"char",
"[",
"]",
"password",
",",
"String",
"alias",
")",
"{",
"final",
"KeyStore",
"keyStore",
"=",
"readKeyStore",
"(",
"type",
",",
"in",
",",
"password"... | 从KeyStore中获取私钥公钥
@param type 类型
@param in {@link InputStream} 如果想从文件读取.keystore文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@param password 密码
@param alias 别名
@return {@link KeyPair}
@since 4.4.1 | [
"从KeyStore中获取私钥公钥"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L592-L595 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Getter.java | Getter.getView | public View getView(String id, int index) {
"""
Returns a {@code View} with a given id.
@param id the id of the {@link View} to return
@param index the index of the {@link View}. {@code 0} if only one is available
@return a {@code View} with a given id
"""
View viewToReturn = null;
Context targetConte... | java | public View getView(String id, int index){
View viewToReturn = null;
Context targetContext = instrumentation.getTargetContext();
String packageName = targetContext.getPackageName();
int viewId = targetContext.getResources().getIdentifier(id, "id", packageName);
if(viewId != 0){
viewToReturn = getView(vi... | [
"public",
"View",
"getView",
"(",
"String",
"id",
",",
"int",
"index",
")",
"{",
"View",
"viewToReturn",
"=",
"null",
";",
"Context",
"targetContext",
"=",
"instrumentation",
".",
"getTargetContext",
"(",
")",
";",
"String",
"packageName",
"=",
"targetContext"... | Returns a {@code View} with a given id.
@param id the id of the {@link View} to return
@param index the index of the {@link View}. {@code 0} if only one is available
@return a {@code View} with a given id | [
"Returns",
"a",
"{",
"@code",
"View",
"}",
"with",
"a",
"given",
"id",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Getter.java#L140-L161 |
Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/RequestCounter.java | RequestCounter.invoke | public <T> T invoke(Runnable r, T result) throws Exception {
"""
Wrap the given service call with the {@link RequestCounter}
to count the number of calls made.
@param r the {@link Runnable} to attempt
@param result what to return after <code>r</code> succeeds
@return result
@throws Exception if <code>c</c... | java | public <T> T invoke(Runnable r, T result) throws Exception {
try {
r.run();
succeed();
return result;
} catch (Exception e) {
fail();
throw e;
}
} | [
"public",
"<",
"T",
">",
"T",
"invoke",
"(",
"Runnable",
"r",
",",
"T",
"result",
")",
"throws",
"Exception",
"{",
"try",
"{",
"r",
".",
"run",
"(",
")",
";",
"succeed",
"(",
")",
";",
"return",
"result",
";",
"}",
"catch",
"(",
"Exception",
"e",... | Wrap the given service call with the {@link RequestCounter}
to count the number of calls made.
@param r the {@link Runnable} to attempt
@param result what to return after <code>r</code> succeeds
@return result
@throws Exception if <code>c</code> throws one during
execution | [
"Wrap",
"the",
"given",
"service",
"call",
"with",
"the",
"{",
"@link",
"RequestCounter",
"}",
"to",
"count",
"the",
"number",
"of",
"calls",
"made",
".",
"@param",
"r",
"the",
"{",
"@link",
"Runnable",
"}",
"to",
"attempt",
"@param",
"result",
"what",
"... | train | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/RequestCounter.java#L91-L100 |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java | DssatXFileOutput.getDataList | private ArrayList<HashMap> getDataList(Map expData, String blockName, String dataListName) {
"""
Get sub data array from experiment data object
@param expData experiment data holder
@param blockName top level block name
@param dataListName sub array name
@return sub data array
"""
HashMap dataBlo... | java | private ArrayList<HashMap> getDataList(Map expData, String blockName, String dataListName) {
HashMap dataBlock = getObjectOr(expData, blockName, new HashMap());
return getObjectOr(dataBlock, dataListName, new ArrayList<HashMap>());
} | [
"private",
"ArrayList",
"<",
"HashMap",
">",
"getDataList",
"(",
"Map",
"expData",
",",
"String",
"blockName",
",",
"String",
"dataListName",
")",
"{",
"HashMap",
"dataBlock",
"=",
"getObjectOr",
"(",
"expData",
",",
"blockName",
",",
"new",
"HashMap",
"(",
... | Get sub data array from experiment data object
@param expData experiment data holder
@param blockName top level block name
@param dataListName sub array name
@return sub data array | [
"Get",
"sub",
"data",
"array",
"from",
"experiment",
"data",
"object"
] | train | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java#L1552-L1555 |
barend/java-iban | src/main/java/nl/garvelink/iban/Modulo97.java | Modulo97.calculateCheckDigits | public static int calculateCheckDigits(CharSequence input) {
"""
Calculates the check digits to be used in a MOD97 checked string.
@param input the input; the characters at indices 2 and 3 <strong>must</strong> be {@code '0'}. The input must
also satisfy the criteria defined in {@link #checksum(CharSequence)}.
... | java | public static int calculateCheckDigits(CharSequence input) {
if (input == null || input.length() < 5 || input.charAt(2) != '0' || input.charAt(3) != '0') {
throw new IllegalArgumentException("The input must be non-null, have a minimum length of five characters, and the characters at indices 2 and 3 ... | [
"public",
"static",
"int",
"calculateCheckDigits",
"(",
"CharSequence",
"input",
")",
"{",
"if",
"(",
"input",
"==",
"null",
"||",
"input",
".",
"length",
"(",
")",
"<",
"5",
"||",
"input",
".",
"charAt",
"(",
"2",
")",
"!=",
"'",
"'",
"||",
"input",... | Calculates the check digits to be used in a MOD97 checked string.
@param input the input; the characters at indices 2 and 3 <strong>must</strong> be {@code '0'}. The input must
also satisfy the criteria defined in {@link #checksum(CharSequence)}.
@return the check digits to be used at indices 2 and 3 to make the input ... | [
"Calculates",
"the",
"check",
"digits",
"to",
"be",
"used",
"in",
"a",
"MOD97",
"checked",
"string",
"."
] | train | https://github.com/barend/java-iban/blob/88150c21885f9be01016c004a6e02783c11f3b3c/src/main/java/nl/garvelink/iban/Modulo97.java#L70-L75 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java | SVGAndroidRenderer.realignMarkerMid | private MarkerVector realignMarkerMid(MarkerVector lastPos, MarkerVector thisPos, MarkerVector nextPos) {
"""
/*
This was one of the ambiguous markers. Try to see if we can find a better direction for
it, now that we have more info available on the neighbouring marker positions.
"""
// Check the temp... | java | private MarkerVector realignMarkerMid(MarkerVector lastPos, MarkerVector thisPos, MarkerVector nextPos)
{
// Check the temporary marker vector against the incoming vector
float dot = dotProduct(thisPos.dx, thisPos.dy, (thisPos.x - lastPos.x), (thisPos.y - lastPos.y));
if (dot == 0f) {
... | [
"private",
"MarkerVector",
"realignMarkerMid",
"(",
"MarkerVector",
"lastPos",
",",
"MarkerVector",
"thisPos",
",",
"MarkerVector",
"nextPos",
")",
"{",
"// Check the temporary marker vector against the incoming vector\r",
"float",
"dot",
"=",
"dotProduct",
"(",
"thisPos",
... | /*
This was one of the ambiguous markers. Try to see if we can find a better direction for
it, now that we have more info available on the neighbouring marker positions. | [
"/",
"*",
"This",
"was",
"one",
"of",
"the",
"ambiguous",
"markers",
".",
"Try",
"to",
"see",
"if",
"we",
"can",
"find",
"a",
"better",
"direction",
"for",
"it",
"now",
"that",
"we",
"have",
"more",
"info",
"available",
"on",
"the",
"neighbouring",
"ma... | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L3052-L3072 |
calimero-project/calimero-core | src/tuwien/auto/calimero/knxnetip/util/Srp.java | Srp.withService | public static Srp withService(final int familyId, final int familyVersion) {
"""
Creates a search request parameter block to limit the extended search request to KNXnet/IP router
or server devices with the given service family and corresponding family version. The mandatory flag
of the SRP is not set.
@param ... | java | public static Srp withService(final int familyId, final int familyVersion) {
return new Srp(Type.SelectByService, true, (byte) familyId, (byte) familyVersion);
} | [
"public",
"static",
"Srp",
"withService",
"(",
"final",
"int",
"familyId",
",",
"final",
"int",
"familyVersion",
")",
"{",
"return",
"new",
"Srp",
"(",
"Type",
".",
"SelectByService",
",",
"true",
",",
"(",
"byte",
")",
"familyId",
",",
"(",
"byte",
")",... | Creates a search request parameter block to limit the extended search request to KNXnet/IP router
or server devices with the given service family and corresponding family version. The mandatory flag
of the SRP is not set.
@param familyId the family ID used in the in the search request parameter block
@param familyVers... | [
"Creates",
"a",
"search",
"request",
"parameter",
"block",
"to",
"limit",
"the",
"extended",
"search",
"request",
"to",
"KNXnet",
"/",
"IP",
"router",
"or",
"server",
"devices",
"with",
"the",
"given",
"service",
"family",
"and",
"corresponding",
"family",
"ve... | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/util/Srp.java#L213-L215 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPP8Reader.java | MPP8Reader.processAssignmentData | private void processAssignmentData() throws IOException {
"""
This method extracts and collates resource assignment data.
@throws IOException
"""
DirectoryEntry assnDir = (DirectoryEntry) m_projectDir.getEntry("TBkndAssn");
FixFix assnFixedData = new FixFix(204, new DocumentInputStream(((Documen... | java | private void processAssignmentData() throws IOException
{
DirectoryEntry assnDir = (DirectoryEntry) m_projectDir.getEntry("TBkndAssn");
FixFix assnFixedData = new FixFix(204, new DocumentInputStream(((DocumentEntry) assnDir.getEntry("FixFix 0"))));
if (assnFixedData.getDiff() != 0 || (assnFixedDa... | [
"private",
"void",
"processAssignmentData",
"(",
")",
"throws",
"IOException",
"{",
"DirectoryEntry",
"assnDir",
"=",
"(",
"DirectoryEntry",
")",
"m_projectDir",
".",
"getEntry",
"(",
"\"TBkndAssn\"",
")",
";",
"FixFix",
"assnFixedData",
"=",
"new",
"FixFix",
"(",... | This method extracts and collates resource assignment data.
@throws IOException | [
"This",
"method",
"extracts",
"and",
"collates",
"resource",
"assignment",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP8Reader.java#L1095-L1145 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addAnnotationInfo | public void addAnnotationInfo(Element element, Content htmltree) {
"""
Adds the annotatation types for the given element.
@param element the package to write annotations for
@param htmltree the content tree to which the annotation types will be added
"""
addAnnotationInfo(element, element.getAnnota... | java | public void addAnnotationInfo(Element element, Content htmltree) {
addAnnotationInfo(element, element.getAnnotationMirrors(), htmltree);
} | [
"public",
"void",
"addAnnotationInfo",
"(",
"Element",
"element",
",",
"Content",
"htmltree",
")",
"{",
"addAnnotationInfo",
"(",
"element",
",",
"element",
".",
"getAnnotationMirrors",
"(",
")",
",",
"htmltree",
")",
";",
"}"
] | Adds the annotatation types for the given element.
@param element the package to write annotations for
@param htmltree the content tree to which the annotation types will be added | [
"Adds",
"the",
"annotatation",
"types",
"for",
"the",
"given",
"element",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L2243-L2245 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/QuickReplyFactory.java | QuickReplyFactory.createQuickReplyLocation | public static QuickReply createQuickReplyLocation(String title,
String payload, String imageUrl) {
"""
Creates a {@link QuickReply} with a location.
@param title
the {@link QuickReply#title}.
@param payload
the {@link QuickReply#payload}.
@param imageUrl
the {@link QuickReply#imageUrl}.
@return a {@lin... | java | public static QuickReply createQuickReplyLocation(String title,
String payload, String imageUrl) {
return new QuickReply(title, payload, imageUrl);
} | [
"public",
"static",
"QuickReply",
"createQuickReplyLocation",
"(",
"String",
"title",
",",
"String",
"payload",
",",
"String",
"imageUrl",
")",
"{",
"return",
"new",
"QuickReply",
"(",
"title",
",",
"payload",
",",
"imageUrl",
")",
";",
"}"
] | Creates a {@link QuickReply} with a location.
@param title
the {@link QuickReply#title}.
@param payload
the {@link QuickReply#payload}.
@param imageUrl
the {@link QuickReply#imageUrl}.
@return a {@link QuickReply} object. | [
"Creates",
"a",
"{",
"@link",
"QuickReply",
"}",
"with",
"a",
"location",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/QuickReplyFactory.java#L77-L80 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/WorkItem.java | WorkItem.addSecondaryTypesToPattern | private static String addSecondaryTypesToPattern(IFile file, String fileName, String classNamePattern) {
"""
Add secondary types patterns (not nested in the type itself but contained
in the java file)
@param fileName
java file name (not path!) without .java suffix
@param classNamePattern
non null pattern fo... | java | private static String addSecondaryTypesToPattern(IFile file, String fileName, String classNamePattern) {
ICompilationUnit cu = JavaCore.createCompilationUnitFrom(file);
if (cu == null) {
FindbugsPlugin.getDefault().logError(
"NULL compilation unit for " + file + ", FB ana... | [
"private",
"static",
"String",
"addSecondaryTypesToPattern",
"(",
"IFile",
"file",
",",
"String",
"fileName",
",",
"String",
"classNamePattern",
")",
"{",
"ICompilationUnit",
"cu",
"=",
"JavaCore",
".",
"createCompilationUnitFrom",
"(",
"file",
")",
";",
"if",
"("... | Add secondary types patterns (not nested in the type itself but contained
in the java file)
@param fileName
java file name (not path!) without .java suffix
@param classNamePattern
non null pattern for all matching .class file names
@return modified classNamePattern, if there are more then one type
defined in the java ... | [
"Add",
"secondary",
"types",
"patterns",
"(",
"not",
"nested",
"in",
"the",
"type",
"itself",
"but",
"contained",
"in",
"the",
"java",
"file",
")"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/WorkItem.java#L202-L228 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/Actions.java | Actions.doubleClick | public Actions doubleClick(WebElement target) {
"""
Performs a double-click at middle of the given element. Equivalent to:
<i>Actions.moveToElement(element).doubleClick()</i>
@param target Element to move to.
@return A self reference.
"""
if (isBuildingActions()) {
action.addAction(new DoubleCli... | java | public Actions doubleClick(WebElement target) {
if (isBuildingActions()) {
action.addAction(new DoubleClickAction(jsonMouse, (Locatable) target));
}
return moveInTicks(target, 0, 0)
.clickInTicks(LEFT)
.clickInTicks(LEFT);
} | [
"public",
"Actions",
"doubleClick",
"(",
"WebElement",
"target",
")",
"{",
"if",
"(",
"isBuildingActions",
"(",
")",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"DoubleClickAction",
"(",
"jsonMouse",
",",
"(",
"Locatable",
")",
"target",
")",
")",
";... | Performs a double-click at middle of the given element. Equivalent to:
<i>Actions.moveToElement(element).doubleClick()</i>
@param target Element to move to.
@return A self reference. | [
"Performs",
"a",
"double",
"-",
"click",
"at",
"middle",
"of",
"the",
"given",
"element",
".",
"Equivalent",
"to",
":",
"<i",
">",
"Actions",
".",
"moveToElement",
"(",
"element",
")",
".",
"doubleClick",
"()",
"<",
"/",
"i",
">"
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L330-L338 |
google/closure-compiler | src/com/google/javascript/refactoring/RefactoringUtils.java | RefactoringUtils.isInClosurizedFile | public static boolean isInClosurizedFile(Node node, NodeMetadata metadata) {
"""
Looks for a goog.require(), goog.provide() or goog.module() call in the node's file.
"""
Node script = NodeUtil.getEnclosingScript(node);
if (script == null) {
return false;
}
Node child = script.getFirstCh... | java | public static boolean isInClosurizedFile(Node node, NodeMetadata metadata) {
Node script = NodeUtil.getEnclosingScript(node);
if (script == null) {
return false;
}
Node child = script.getFirstChild();
while (child != null) {
if (NodeUtil.isExprCall(child)) {
if (Matchers.googRe... | [
"public",
"static",
"boolean",
"isInClosurizedFile",
"(",
"Node",
"node",
",",
"NodeMetadata",
"metadata",
")",
"{",
"Node",
"script",
"=",
"NodeUtil",
".",
"getEnclosingScript",
"(",
"node",
")",
";",
"if",
"(",
"script",
"==",
"null",
")",
"{",
"return",
... | Looks for a goog.require(), goog.provide() or goog.module() call in the node's file. | [
"Looks",
"for",
"a",
"goog",
".",
"require",
"()",
"goog",
".",
"provide",
"()",
"or",
"goog",
".",
"module",
"()",
"call",
"in",
"the",
"node",
"s",
"file",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/refactoring/RefactoringUtils.java#L26-L46 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java | PebbleKit.closeAppOnPebble | public static void closeAppOnPebble(final Context context, final UUID watchappUuid)
throws IllegalArgumentException {
"""
Send a message to the connected Pebble to close an application identified by a UUID. If this application is not
currently running, the message is ignored.
@param context
The co... | java | public static void closeAppOnPebble(final Context context, final UUID watchappUuid)
throws IllegalArgumentException {
if (watchappUuid == null) {
throw new IllegalArgumentException("uuid cannot be null");
}
final Intent stopAppIntent = new Intent(INTENT_APP_STOP);
... | [
"public",
"static",
"void",
"closeAppOnPebble",
"(",
"final",
"Context",
"context",
",",
"final",
"UUID",
"watchappUuid",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"watchappUuid",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Send a message to the connected Pebble to close an application identified by a UUID. If this application is not
currently running, the message is ignored.
@param context
The context used to send the broadcast.
@param watchappUuid
A UUID uniquely identifying the target application. UUIDs for the stock kit applications ... | [
"Send",
"a",
"message",
"to",
"the",
"connected",
"Pebble",
"to",
"close",
"an",
"application",
"identified",
"by",
"a",
"UUID",
".",
"If",
"this",
"application",
"is",
"not",
"currently",
"running",
"the",
"message",
"is",
"ignored",
"."
] | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java#L237-L247 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/EntityLockService.java | EntityLockService.newReadLock | public IEntityLock newReadLock(EntityIdentifier entityID, String owner)
throws LockingException {
"""
Returns a read lock for the <code>IBasicEntity</code> and owner.
@return org.apereo.portal.concurrency.locking.IEntityLock
@param entityID EntityIdentifier
@param owner String
@exception LockingE... | java | public IEntityLock newReadLock(EntityIdentifier entityID, String owner)
throws LockingException {
return lockService.newLock(
entityID.getType(), entityID.getKey(), IEntityLockService.READ_LOCK, owner);
} | [
"public",
"IEntityLock",
"newReadLock",
"(",
"EntityIdentifier",
"entityID",
",",
"String",
"owner",
")",
"throws",
"LockingException",
"{",
"return",
"lockService",
".",
"newLock",
"(",
"entityID",
".",
"getType",
"(",
")",
",",
"entityID",
".",
"getKey",
"(",
... | Returns a read lock for the <code>IBasicEntity</code> and owner.
@return org.apereo.portal.concurrency.locking.IEntityLock
@param entityID EntityIdentifier
@param owner String
@exception LockingException | [
"Returns",
"a",
"read",
"lock",
"for",
"the",
"<code",
">",
"IBasicEntity<",
"/",
"code",
">",
"and",
"owner",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/EntityLockService.java#L145-L149 |
jamesagnew/hapi-fhir | hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Newline_To_Br.java | Newline_To_Br.apply | @Override
public Object apply(Object value, Object... params) {
"""
/*
newline_to_br(input)
Add <br /> tags in front of all newlines in input string
"""
return super.asString(value).replaceAll("[\n]", "<br />\n");
} | java | @Override
public Object apply(Object value, Object... params) {
return super.asString(value).replaceAll("[\n]", "<br />\n");
} | [
"@",
"Override",
"public",
"Object",
"apply",
"(",
"Object",
"value",
",",
"Object",
"...",
"params",
")",
"{",
"return",
"super",
".",
"asString",
"(",
"value",
")",
".",
"replaceAll",
"(",
"\"[\\n]\"",
",",
"\"<br />\\n\"",
")",
";",
"}"
] | /*
newline_to_br(input)
Add <br /> tags in front of all newlines in input string | [
"/",
"*",
"newline_to_br",
"(",
"input",
")"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Newline_To_Br.java#L10-L14 |
lightblue-platform/lightblue-migrator | jiff/src/main/java/jcmp/DocCompare.java | DocCompare.addArrayIdentity | public void addArrayIdentity(String array, String... identities) {
"""
Adds a group of fields that can uniquely identify array elements for
object arrays
@param array The name of the array field
@param identities The fields of the array element that can identiy an
element
In the following document: <... | java | public void addArrayIdentity(String array, String... identities) {
arrayIdentities.put(array, new ArrayIdentityFields(identities));
} | [
"public",
"void",
"addArrayIdentity",
"(",
"String",
"array",
",",
"String",
"...",
"identities",
")",
"{",
"arrayIdentities",
".",
"put",
"(",
"array",
",",
"new",
"ArrayIdentityFields",
"(",
"identities",
")",
")",
";",
"}"
] | Adds a group of fields that can uniquely identify array elements for
object arrays
@param array The name of the array field
@param identities The fields of the array element that can identiy an
element
In the following document: <pre>
{
...
"aField": [
{ "_id":1,"field":...},
{ "_id":2,"field":...}
]
}
<pre>
the... | [
"Adds",
"a",
"group",
"of",
"fields",
"that",
"can",
"uniquely",
"identify",
"array",
"elements",
"for",
"object",
"arrays"
] | train | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/jiff/src/main/java/jcmp/DocCompare.java#L464-L466 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/AxesWalker.java | AxesWalker.callVisitors | public void callVisitors(ExpressionOwner owner, XPathVisitor visitor) {
"""
This will traverse the heararchy, calling the visitor for
each member. If the called visitor method returns
false, the subtree should not be called.
@param owner The owner of the visitor, where that path may be
rewritten if needed.
... | java | public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
if(visitor.visitStep(owner, this))
{
callPredicateVisitors(visitor);
if(null != m_nextWalker)
{
m_nextWalker.callVisitors(this, visitor);
}
}
} | [
"public",
"void",
"callVisitors",
"(",
"ExpressionOwner",
"owner",
",",
"XPathVisitor",
"visitor",
")",
"{",
"if",
"(",
"visitor",
".",
"visitStep",
"(",
"owner",
",",
"this",
")",
")",
"{",
"callPredicateVisitors",
"(",
"visitor",
")",
";",
"if",
"(",
"nu... | This will traverse the heararchy, calling the visitor for
each member. If the called visitor method returns
false, the subtree should not be called.
@param owner The owner of the visitor, where that path may be
rewritten if needed.
@param visitor The visitor whose appropriate method will be called. | [
"This",
"will",
"traverse",
"the",
"heararchy",
"calling",
"the",
"visitor",
"for",
"each",
"member",
".",
"If",
"the",
"called",
"visitor",
"method",
"returns",
"false",
"the",
"subtree",
"should",
"not",
"be",
"called",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/AxesWalker.java#L520-L530 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/policy/conditions/ConditionFactory.java | ConditionFactory.newRefererCondition | public static Condition newRefererCondition(StringComparisonType comparisonType, String value) {
"""
Constructs a new access control policy condition that tests the incoming
request's referer field against the specified value, using the specified
comparison type.
@param comparisonType
The type of string comp... | java | public static Condition newRefererCondition(StringComparisonType comparisonType, String value) {
return new StringCondition(comparisonType, REFERER_CONDITION_KEY, value);
} | [
"public",
"static",
"Condition",
"newRefererCondition",
"(",
"StringComparisonType",
"comparisonType",
",",
"String",
"value",
")",
"{",
"return",
"new",
"StringCondition",
"(",
"comparisonType",
",",
"REFERER_CONDITION_KEY",
",",
"value",
")",
";",
"}"
] | Constructs a new access control policy condition that tests the incoming
request's referer field against the specified value, using the specified
comparison type.
@param comparisonType
The type of string comparison to perform when testing an
incoming request's referer field with the specified value.
@param value
The v... | [
"Constructs",
"a",
"new",
"access",
"control",
"policy",
"condition",
"that",
"tests",
"the",
"incoming",
"request",
"s",
"referer",
"field",
"against",
"the",
"specified",
"value",
"using",
"the",
"specified",
"comparison",
"type",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/policy/conditions/ConditionFactory.java#L171-L173 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.addCrossFriends | public ResponseWrapper addCrossFriends(String username, CrossFriendPayload payload)
throws APIConnectionException, APIRequestException {
"""
Add users from cross app.
@param username Necessary
@param payload CrossFriendPayload
@return No content
@throws APIConnectionException connect exception
@th... | java | public ResponseWrapper addCrossFriends(String username, CrossFriendPayload payload)
throws APIConnectionException, APIRequestException {
return _crossAppClient.addCrossFriends(username, payload);
} | [
"public",
"ResponseWrapper",
"addCrossFriends",
"(",
"String",
"username",
",",
"CrossFriendPayload",
"payload",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_crossAppClient",
".",
"addCrossFriends",
"(",
"username",
",",
"payload",... | Add users from cross app.
@param username Necessary
@param payload CrossFriendPayload
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Add",
"users",
"from",
"cross",
"app",
"."
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L671-L674 |
samskivert/pythagoras | src/main/java/pythagoras/f/Rectangles.java | Rectangles.pointRectDistanceSq | public static float pointRectDistanceSq (IRectangle r, IPoint p) {
"""
Returns the squared Euclidean distance between the given point and the nearest point inside
the bounds of the given rectangle. If the supplied point is inside the rectangle, the
distance will be zero.
"""
Point p2 = closestInterio... | java | public static float pointRectDistanceSq (IRectangle r, IPoint p) {
Point p2 = closestInteriorPoint(r, p);
return Points.distanceSq(p.x(), p.y(), p2.x, p2.y);
} | [
"public",
"static",
"float",
"pointRectDistanceSq",
"(",
"IRectangle",
"r",
",",
"IPoint",
"p",
")",
"{",
"Point",
"p2",
"=",
"closestInteriorPoint",
"(",
"r",
",",
"p",
")",
";",
"return",
"Points",
".",
"distanceSq",
"(",
"p",
".",
"x",
"(",
")",
","... | Returns the squared Euclidean distance between the given point and the nearest point inside
the bounds of the given rectangle. If the supplied point is inside the rectangle, the
distance will be zero. | [
"Returns",
"the",
"squared",
"Euclidean",
"distance",
"between",
"the",
"given",
"point",
"and",
"the",
"nearest",
"point",
"inside",
"the",
"bounds",
"of",
"the",
"given",
"rectangle",
".",
"If",
"the",
"supplied",
"point",
"is",
"inside",
"the",
"rectangle",... | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Rectangles.java#L58-L61 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/AbstractSQLQuery.java | AbstractSQLQuery.onException | protected void onException(SQLListenerContextImpl context, Exception e) {
"""
Called to make the call back to listeners when an exception happens
@param context the current context in play
@param e the exception
"""
context.setException(e);
listeners.exception(context);
} | java | protected void onException(SQLListenerContextImpl context, Exception e) {
context.setException(e);
listeners.exception(context);
} | [
"protected",
"void",
"onException",
"(",
"SQLListenerContextImpl",
"context",
",",
"Exception",
"e",
")",
"{",
"context",
".",
"setException",
"(",
"e",
")",
";",
"listeners",
".",
"exception",
"(",
"context",
")",
";",
"}"
] | Called to make the call back to listeners when an exception happens
@param context the current context in play
@param e the exception | [
"Called",
"to",
"make",
"the",
"call",
"back",
"to",
"listeners",
"when",
"an",
"exception",
"happens"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/AbstractSQLQuery.java#L235-L238 |
apache/groovy | src/main/groovy/groovy/lang/ProxyMetaClass.java | ProxyMetaClass.getProperty | public Object getProperty(Class aClass, Object object, String property, boolean b, boolean b1) {
"""
Interceptors the call to getProperty if a PropertyAccessInterceptor is
available
@param object the object to invoke the getter on
@param property the property name
@return the value of the property
"""
... | java | public Object getProperty(Class aClass, Object object, String property, boolean b, boolean b1) {
if (null == interceptor) {
return super.getProperty(aClass, object, property, b, b1);
}
if (interceptor instanceof PropertyAccessInterceptor) {
PropertyAccessInterceptor pae =... | [
"public",
"Object",
"getProperty",
"(",
"Class",
"aClass",
",",
"Object",
"object",
",",
"String",
"property",
",",
"boolean",
"b",
",",
"boolean",
"b1",
")",
"{",
"if",
"(",
"null",
"==",
"interceptor",
")",
"{",
"return",
"super",
".",
"getProperty",
"... | Interceptors the call to getProperty if a PropertyAccessInterceptor is
available
@param object the object to invoke the getter on
@param property the property name
@return the value of the property | [
"Interceptors",
"the",
"call",
"to",
"getProperty",
"if",
"a",
"PropertyAccessInterceptor",
"is",
"available"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/ProxyMetaClass.java#L176-L190 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookJsonRestClient.java | FacebookJsonRestClient.parseCallResult | protected Object parseCallResult(InputStream data, IFacebookMethod method)
throws FacebookException, IOException {
"""
Parses the result of an API call from JSON into Java Objects.
@param data an InputStream with the results of a request to the Facebook servers
@param method the method
@return a Java Object... | java | protected Object parseCallResult(InputStream data, IFacebookMethod method)
throws FacebookException, IOException {
Object json = JSONValue.parse(new InputStreamReader(data));
if (isDebug()) {
log(method.methodName() + ": " + (null != json ? json.toString() : "null"));
}
if (json instanceof JS... | [
"protected",
"Object",
"parseCallResult",
"(",
"InputStream",
"data",
",",
"IFacebookMethod",
"method",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"Object",
"json",
"=",
"JSONValue",
".",
"parse",
"(",
"new",
"InputStreamReader",
"(",
"data",
")"... | Parses the result of an API call from JSON into Java Objects.
@param data an InputStream with the results of a request to the Facebook servers
@param method the method
@return a Java Object
@throws FacebookException if <code>data</code> represents an error
@throws IOException if <code>data</code> is not readable
@see J... | [
"Parses",
"the",
"result",
"of",
"an",
"API",
"call",
"from",
"JSON",
"into",
"Java",
"Objects",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookJsonRestClient.java#L151-L167 |
protostuff/protostuff | protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java | XmlIOUtil.writeListTo | public static <T> void writeListTo(OutputStream out, List<T> messages, Schema<T> schema)
throws IOException {
"""
Serializes the {@code messages} into the {@link OutputStream} using the given schema.
"""
writeListTo(out, messages, schema, DEFAULT_OUTPUT_FACTORY);
} | java | public static <T> void writeListTo(OutputStream out, List<T> messages, Schema<T> schema)
throws IOException
{
writeListTo(out, messages, schema, DEFAULT_OUTPUT_FACTORY);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"writeListTo",
"(",
"OutputStream",
"out",
",",
"List",
"<",
"T",
">",
"messages",
",",
"Schema",
"<",
"T",
">",
"schema",
")",
"throws",
"IOException",
"{",
"writeListTo",
"(",
"out",
",",
"messages",
",",
"s... | Serializes the {@code messages} into the {@link OutputStream} using the given schema. | [
"Serializes",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java#L458-L462 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/linear/NewGLMNET.java | NewGLMNET.setC | @WarmParameter(prefLowToHigh = true)
public void setC(double C) {
"""
Sets the regularization term, where smaller values indicate a larger
regularization penalty.
@param C the positive regularization term
"""
if(C <= 0 || Double.isInfinite(C) || Double.isNaN(C))
throw new IllegalArg... | java | @WarmParameter(prefLowToHigh = true)
public void setC(double C)
{
if(C <= 0 || Double.isInfinite(C) || Double.isNaN(C))
throw new IllegalArgumentException("Regularization term C must be a positive value, not " + C);
this.C = C;
} | [
"@",
"WarmParameter",
"(",
"prefLowToHigh",
"=",
"true",
")",
"public",
"void",
"setC",
"(",
"double",
"C",
")",
"{",
"if",
"(",
"C",
"<=",
"0",
"||",
"Double",
".",
"isInfinite",
"(",
"C",
")",
"||",
"Double",
".",
"isNaN",
"(",
"C",
")",
")",
"... | Sets the regularization term, where smaller values indicate a larger
regularization penalty.
@param C the positive regularization term | [
"Sets",
"the",
"regularization",
"term",
"where",
"smaller",
"values",
"indicate",
"a",
"larger",
"regularization",
"penalty",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/NewGLMNET.java#L156-L162 |
davidcarboni/restolino | src/main/java/com/github/davidcarboni/restolino/Configuration.java | Configuration.configureClassesReloadable | void configureClassesReloadable(String path) {
"""
Configures dynamic class reloading. This is most useful for development
(rather than deployment). This typically reloads classes from the
<code>target/classes/...</code> directory of your development project.
<p/>
NB This provides an efficient development work... | java | void configureClassesReloadable(String path) {
try {
// Set up reloading:
Path classesPath = FileSystems.getDefault().getPath(path);
classesUrl = classesPath.toUri().toURL();
} catch (IOException e) {
throw new RuntimeException("Error starting class reloa... | [
"void",
"configureClassesReloadable",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"// Set up reloading:",
"Path",
"classesPath",
"=",
"FileSystems",
".",
"getDefault",
"(",
")",
".",
"getPath",
"(",
"path",
")",
";",
"classesUrl",
"=",
"classesPath",
".",
"to... | Configures dynamic class reloading. This is most useful for development
(rather than deployment). This typically reloads classes from the
<code>target/classes/...</code> directory of your development project.
<p/>
NB This provides an efficient development workflow, allowing you to see
code changes without having to red... | [
"Configures",
"dynamic",
"class",
"reloading",
".",
"This",
"is",
"most",
"useful",
"for",
"development",
"(",
"rather",
"than",
"deployment",
")",
".",
"This",
"typically",
"reloads",
"classes",
"from",
"the",
"<code",
">",
"target",
"/",
"classes",
"/",
".... | train | https://github.com/davidcarboni/restolino/blob/3f84ece1bd016fbb597c624d46fcca5a2580a33d/src/main/java/com/github/davidcarboni/restolino/Configuration.java#L342-L351 |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/ftp/FtpUtil.java | FtpUtil.initEndpointDirectory | public static void initEndpointDirectory(MuleContext muleContext, String endpointName) throws Exception {
"""
Ensures that the directory exists and is writable by deleting the
directory and then recreate it.
@param muleContext
@param endpointName
@throws Exception
"""
logger.info("Init directory for e... | java | public static void initEndpointDirectory(MuleContext muleContext, String endpointName) throws Exception {
logger.info("Init directory for endpoint: {}", endpointName);
FTPClient ftpClient = null;
try {
ftpClient = getFtpClient(muleContext, endpointName);
EndpointURI endpointURI = getImmutableEndpoint... | [
"public",
"static",
"void",
"initEndpointDirectory",
"(",
"MuleContext",
"muleContext",
",",
"String",
"endpointName",
")",
"throws",
"Exception",
"{",
"logger",
".",
"info",
"(",
"\"Init directory for endpoint: {}\"",
",",
"endpointName",
")",
";",
"FTPClient",
"ftpC... | Ensures that the directory exists and is writable by deleting the
directory and then recreate it.
@param muleContext
@param endpointName
@throws Exception | [
"Ensures",
"that",
"the",
"directory",
"exists",
"and",
"is",
"writable",
"by",
"deleting",
"the",
"directory",
"and",
"then",
"recreate",
"it",
"."
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/ftp/FtpUtil.java#L54-L84 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/PullFileLoader.java | PullFileLoader.loadAncestorGlobalConfigs | private Config loadAncestorGlobalConfigs(Path path, Config sysProps) throws IOException {
"""
Load at most one *.properties files from path and each ancestor of path up to and including {@link #rootDirectory}.
Higher directories will serve as fallback for lower directories, and sysProps will serve as fallback for... | java | private Config loadAncestorGlobalConfigs(Path path, Config sysProps) throws IOException {
Config config = sysProps;
if (!PathUtils.isAncestor(this.rootDirectory, path)) {
log.warn(String.format("Loaded path %s is not a descendant of root path %s. Cannot load global properties.",
path, this.root... | [
"private",
"Config",
"loadAncestorGlobalConfigs",
"(",
"Path",
"path",
",",
"Config",
"sysProps",
")",
"throws",
"IOException",
"{",
"Config",
"config",
"=",
"sysProps",
";",
"if",
"(",
"!",
"PathUtils",
".",
"isAncestor",
"(",
"this",
".",
"rootDirectory",
",... | Load at most one *.properties files from path and each ancestor of path up to and including {@link #rootDirectory}.
Higher directories will serve as fallback for lower directories, and sysProps will serve as fallback for all of them.
@throws IOException | [
"Load",
"at",
"most",
"one",
"*",
".",
"properties",
"files",
"from",
"path",
"and",
"each",
"ancestor",
"of",
"path",
"up",
"to",
"and",
"including",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PullFileLoader.java#L226-L246 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/text/TokenStream.java | TokenStream.consumeInteger | public int consumeInteger() throws ParsingException, IllegalStateException {
"""
Convert the value of this token to an integer, return it, and move to the next token.
@return the current token's value, converted to an integer
@throws ParsingException if there is no such token to consume, or if the token cannot... | java | public int consumeInteger() throws ParsingException, IllegalStateException {
if (completed) throwNoMoreContent();
// Get the value from the current token ...
String value = currentToken().value();
try {
int result = Integer.parseInt(value);
moveToNextToken();
... | [
"public",
"int",
"consumeInteger",
"(",
")",
"throws",
"ParsingException",
",",
"IllegalStateException",
"{",
"if",
"(",
"completed",
")",
"throwNoMoreContent",
"(",
")",
";",
"// Get the value from the current token ...",
"String",
"value",
"=",
"currentToken",
"(",
... | Convert the value of this token to an integer, return it, and move to the next token.
@return the current token's value, converted to an integer
@throws ParsingException if there is no such token to consume, or if the token cannot be converted to an integer
@throws IllegalStateException if this method was called befor... | [
"Convert",
"the",
"value",
"of",
"this",
"token",
"to",
"an",
"integer",
"return",
"it",
"and",
"move",
"to",
"the",
"next",
"token",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/text/TokenStream.java#L480-L493 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/csv/CsvToSqlExtensions.java | CsvToSqlExtensions.getCsvFileAsSqlInsertScript | public static String getCsvFileAsSqlInsertScript(final String tableName, final CsvBean csvBean) {
"""
Gets the csv file as sql insert script.
@param tableName
the table name
@param csvBean
the csv bean
@return the csv file as sql insert script
"""
return getCsvFileAsSqlInsertScript(tableName, csvBean,... | java | public static String getCsvFileAsSqlInsertScript(final String tableName, final CsvBean csvBean)
{
return getCsvFileAsSqlInsertScript(tableName, csvBean, true, true);
} | [
"public",
"static",
"String",
"getCsvFileAsSqlInsertScript",
"(",
"final",
"String",
"tableName",
",",
"final",
"CsvBean",
"csvBean",
")",
"{",
"return",
"getCsvFileAsSqlInsertScript",
"(",
"tableName",
",",
"csvBean",
",",
"true",
",",
"true",
")",
";",
"}"
] | Gets the csv file as sql insert script.
@param tableName
the table name
@param csvBean
the csv bean
@return the csv file as sql insert script | [
"Gets",
"the",
"csv",
"file",
"as",
"sql",
"insert",
"script",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/csv/CsvToSqlExtensions.java#L75-L78 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.updateDocument | public void updateDocument(String accountId, String envelopeId, String documentId, EnvelopesApi.UpdateDocumentOptions options) throws ApiException {
"""
Adds a document to an existing draft envelope.
Adds a document to an existing draft envelope.
@param accountId The external account number (int) or account ID G... | java | public void updateDocument(String accountId, String envelopeId, String documentId, EnvelopesApi.UpdateDocumentOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missin... | [
"public",
"void",
"updateDocument",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"String",
"documentId",
",",
"EnvelopesApi",
".",
"UpdateDocumentOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localVarPostBody",
"=",
"\"{}\"",
"... | Adds a document to an existing draft envelope.
Adds a document to an existing draft envelope.
@param accountId The external account number (int) or account ID Guid. (required)
@param envelopeId The envelopeId Guid of the envelope being accessed. (required)
@param documentId The ID of the document being accessed. (requi... | [
"Adds",
"a",
"document",
"to",
"an",
"existing",
"draft",
"envelope",
".",
"Adds",
"a",
"document",
"to",
"an",
"existing",
"draft",
"envelope",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L4986-L5034 |
h2oai/h2o-3 | h2o-algos/src/main/java/hex/word2vec/WordVectorTrainer.java | WordVectorTrainer.calcLearningRate | private static float calcLearningRate(float initLearningRate, int epochs, long totalProcessed, long vocabWordCount) {
"""
Calculates a new global learning rate for the next round
of map/reduce calls.
The learning rate is a coefficient that controls the amount that
newly learned information affects current learn... | java | private static float calcLearningRate(float initLearningRate, int epochs, long totalProcessed, long vocabWordCount) {
float rate = initLearningRate * (1 - totalProcessed / (float) (epochs * vocabWordCount + 1));
if (rate < initLearningRate * LEARNING_RATE_MIN_FACTOR) rate = initLearningRate * LEARNING_RATE_MIN_... | [
"private",
"static",
"float",
"calcLearningRate",
"(",
"float",
"initLearningRate",
",",
"int",
"epochs",
",",
"long",
"totalProcessed",
",",
"long",
"vocabWordCount",
")",
"{",
"float",
"rate",
"=",
"initLearningRate",
"*",
"(",
"1",
"-",
"totalProcessed",
"/",... | Calculates a new global learning rate for the next round
of map/reduce calls.
The learning rate is a coefficient that controls the amount that
newly learned information affects current learned information. | [
"Calculates",
"a",
"new",
"global",
"learning",
"rate",
"for",
"the",
"next",
"round",
"of",
"map",
"/",
"reduce",
"calls",
".",
"The",
"learning",
"rate",
"is",
"a",
"coefficient",
"that",
"controls",
"the",
"amount",
"that",
"newly",
"learned",
"informatio... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/word2vec/WordVectorTrainer.java#L187-L191 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java | Transforms.cosineSim | public static double cosineSim(@NonNull INDArray d1, @NonNull INDArray d2) {
"""
Cosine similarity
@param d1 the first vector
@param d2 the second vector
@return the cosine similarities between the 2 arrays
"""
return Nd4j.getExecutioner().exec(new CosineSimilarity(d1, d2)).getDouble(0);
} | java | public static double cosineSim(@NonNull INDArray d1, @NonNull INDArray d2) {
return Nd4j.getExecutioner().exec(new CosineSimilarity(d1, d2)).getDouble(0);
} | [
"public",
"static",
"double",
"cosineSim",
"(",
"@",
"NonNull",
"INDArray",
"d1",
",",
"@",
"NonNull",
"INDArray",
"d2",
")",
"{",
"return",
"Nd4j",
".",
"getExecutioner",
"(",
")",
".",
"exec",
"(",
"new",
"CosineSimilarity",
"(",
"d1",
",",
"d2",
")",
... | Cosine similarity
@param d1 the first vector
@param d2 the second vector
@return the cosine similarities between the 2 arrays | [
"Cosine",
"similarity"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L69-L71 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/CFFFontSubset.java | CFFFontSubset.BuildIndexHeader | protected void BuildIndexHeader(int Count,int Offsize,int First) {
"""
Function Build the header of an index
@param Count the count field of the index
@param Offsize the offsize field of the index
@param First the first offset of the index
"""
// Add the count field
OutputList.addLast(new UInt16Item((ch... | java | protected void BuildIndexHeader(int Count,int Offsize,int First)
{
// Add the count field
OutputList.addLast(new UInt16Item((char)Count)); // count
// Add the offsize field
OutputList.addLast(new UInt8Item((char)Offsize)); // offSize
// Add the first offset according to the offsize
switch(Offsize){
... | [
"protected",
"void",
"BuildIndexHeader",
"(",
"int",
"Count",
",",
"int",
"Offsize",
",",
"int",
"First",
")",
"{",
"// Add the count field",
"OutputList",
".",
"addLast",
"(",
"new",
"UInt16Item",
"(",
"(",
"char",
")",
"Count",
")",
")",
";",
"// count",
... | Function Build the header of an index
@param Count the count field of the index
@param Offsize the offsize field of the index
@param First the first offset of the index | [
"Function",
"Build",
"the",
"header",
"of",
"an",
"index"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/CFFFontSubset.java#L1244-L1267 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.addProjectMember | public GitlabProjectMember addProjectMember(GitlabProject project, GitlabUser user, GitlabAccessLevel accessLevel) throws IOException {
"""
Add a project member.
@param project the GitlabProject
@param user the GitlabUser
@param accessLevel the GitlabAccessLevel
@return the GitlabProjectMember
@t... | java | public GitlabProjectMember addProjectMember(GitlabProject project, GitlabUser user, GitlabAccessLevel accessLevel) throws IOException {
return addProjectMember(project.getId(), user.getId(), accessLevel);
} | [
"public",
"GitlabProjectMember",
"addProjectMember",
"(",
"GitlabProject",
"project",
",",
"GitlabUser",
"user",
",",
"GitlabAccessLevel",
"accessLevel",
")",
"throws",
"IOException",
"{",
"return",
"addProjectMember",
"(",
"project",
".",
"getId",
"(",
")",
",",
"u... | Add a project member.
@param project the GitlabProject
@param user the GitlabUser
@param accessLevel the GitlabAccessLevel
@return the GitlabProjectMember
@throws IOException on gitlab api call error | [
"Add",
"a",
"project",
"member",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3028-L3030 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/util/Resource.java | Resource.resourceExist | private static boolean resourceExist(ExternalContext externalContext, String path) {
"""
doesnt exist. Otherwise, the URL will fail on the first access.
"""
if ("/".equals(path))
{
// The root context exists always
return true;
}
Object ctx = externalCont... | java | private static boolean resourceExist(ExternalContext externalContext, String path)
{
if ("/".equals(path))
{
// The root context exists always
return true;
}
Object ctx = externalContext.getContext();
if (ctx instanceof ServletContext)
{
... | [
"private",
"static",
"boolean",
"resourceExist",
"(",
"ExternalContext",
"externalContext",
",",
"String",
"path",
")",
"{",
"if",
"(",
"\"/\"",
".",
"equals",
"(",
"path",
")",
")",
"{",
"// The root context exists always",
"return",
"true",
";",
"}",
"Object",... | doesnt exist. Otherwise, the URL will fail on the first access. | [
"doesnt",
"exist",
".",
"Otherwise",
"the",
"URL",
"will",
"fail",
"on",
"the",
"first",
"access",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/util/Resource.java#L89-L116 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getCharacterSpecialization | public void getCharacterSpecialization(String API, String name, Callback<CharacterSpecialization> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on Character Specialization API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Specialization">here</a><br/>
Give user the... | java | public void getCharacterSpecialization(String API, String name, Callback<CharacterSpecialization> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacterSpecialization(name, API).enqueue(callback);
... | [
"public",
"void",
"getCharacterSpecialization",
"(",
"String",
"API",
",",
"String",
"name",
",",
"Callback",
"<",
"CharacterSpecialization",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChe... | For more info on Character Specialization API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Specialization">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param API API key
@param na... | [
"For",
"more",
"info",
"on",
"Character",
"Specialization",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"characters#Specialization",
">",
"here<",
"/",
"a",
">",
"<b... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L845-L848 |
Waikato/moa | moa/src/main/java/com/github/javacliparser/AbstractClassOption.java | AbstractClassOption.classToCLIString | public static String classToCLIString(Class<?> aClass, Class<?> requiredType) {
"""
Gets the command line interface text of the class.
@param aClass the class
@param requiredType the class type
@return the command line interface text of the class
"""
String className = aClass.getName();
St... | java | public static String classToCLIString(Class<?> aClass, Class<?> requiredType) {
String className = aClass.getName();
String packageName = requiredType.getPackage().getName();
if (className.startsWith(packageName)) {
// cut off package name
className = className.substring(... | [
"public",
"static",
"String",
"classToCLIString",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"Class",
"<",
"?",
">",
"requiredType",
")",
"{",
"String",
"className",
"=",
"aClass",
".",
"getName",
"(",
")",
";",
"String",
"packageName",
"=",
"requiredType... | Gets the command line interface text of the class.
@param aClass the class
@param requiredType the class type
@return the command line interface text of the class | [
"Gets",
"the",
"command",
"line",
"interface",
"text",
"of",
"the",
"class",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/com/github/javacliparser/AbstractClassOption.java#L188-L203 |
broadinstitute/barclay | src/main/java/org/broadinstitute/barclay/utils/Utils.java | Utils.prettyPrintWarningMessage | private static void prettyPrintWarningMessage(final List<String> results, final String message) {
"""
pretty print the warning message supplied
@param results the pretty printed message
@param message the message
"""
for (final String line: message.split("\\r?\\n")) {
final StringBuilde... | java | private static void prettyPrintWarningMessage(final List<String> results, final String message) {
for (final String line: message.split("\\r?\\n")) {
final StringBuilder builder = new StringBuilder(line);
while (builder.length() > TEXT_WARNING_WIDTH) {
int space = getLast... | [
"private",
"static",
"void",
"prettyPrintWarningMessage",
"(",
"final",
"List",
"<",
"String",
">",
"results",
",",
"final",
"String",
"message",
")",
"{",
"for",
"(",
"final",
"String",
"line",
":",
"message",
".",
"split",
"(",
"\"\\\\r?\\\\n\"",
")",
")",... | pretty print the warning message supplied
@param results the pretty printed message
@param message the message | [
"pretty",
"print",
"the",
"warning",
"message",
"supplied"
] | train | https://github.com/broadinstitute/barclay/blob/7e56d725766b0da3baff23e79a31c3d01c3589c2/src/main/java/org/broadinstitute/barclay/utils/Utils.java#L79-L90 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/internal/DefaultURLTemplatesFactory.java | DefaultURLTemplatesFactory.getTemplateNameByRef | public String getTemplateNameByRef( String refGroupName, String key ) {
"""
Returns URL template name of the given type (by key) from the
desired reference group.
@param refGroupName name of a group of templates from the config file.
@param key type of the template
@return template name
"""
... | java | public String getTemplateNameByRef( String refGroupName, String key )
{
assert _urlTemplates != null : "The template config file has not been loaded.";
if ( _urlTemplates == null )
{
return null;
}
String ref = _urlTemplates.getTemplateNameByRef( refGroupName, k... | [
"public",
"String",
"getTemplateNameByRef",
"(",
"String",
"refGroupName",
",",
"String",
"key",
")",
"{",
"assert",
"_urlTemplates",
"!=",
"null",
":",
"\"The template config file has not been loaded.\"",
";",
"if",
"(",
"_urlTemplates",
"==",
"null",
")",
"{",
"re... | Returns URL template name of the given type (by key) from the
desired reference group.
@param refGroupName name of a group of templates from the config file.
@param key type of the template
@return template name | [
"Returns",
"URL",
"template",
"name",
"of",
"the",
"given",
"type",
"(",
"by",
"key",
")",
"from",
"the",
"desired",
"reference",
"group",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/internal/DefaultURLTemplatesFactory.java#L126-L149 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/SegmentKeyCache.java | SegmentKeyCache.includeExistingKey | long includeExistingKey(UUID keyHash, long segmentOffset, int generation) {
"""
Updates the contents of a Cache Entry associated with the given Segment Id and KeyHash. This method cannot be
used to remove values.
This method should be used for processing existing keys (that have already been indexed), as oppos... | java | long includeExistingKey(UUID keyHash, long segmentOffset, int generation) {
Preconditions.checkArgument(segmentOffset >= 0, "segmentOffset must be non-negative.");
short hashGroup = getHashGroup(keyHash);
CacheEntry entry;
synchronized (this) {
CacheBucketOffset tailOffset = ... | [
"long",
"includeExistingKey",
"(",
"UUID",
"keyHash",
",",
"long",
"segmentOffset",
",",
"int",
"generation",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"segmentOffset",
">=",
"0",
",",
"\"segmentOffset must be non-negative.\"",
")",
";",
"short",
"hashGr... | Updates the contents of a Cache Entry associated with the given Segment Id and KeyHash. This method cannot be
used to remove values.
This method should be used for processing existing keys (that have already been indexed), as opposed from processing
new (un-indexed) keys.
@param keyHash A UUID representing the ... | [
"Updates",
"the",
"contents",
"of",
"a",
"Cache",
"Entry",
"associated",
"with",
"the",
"given",
"Segment",
"Id",
"and",
"KeyHash",
".",
"This",
"method",
"cannot",
"be",
"used",
"to",
"remove",
"values",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/SegmentKeyCache.java#L186-L203 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_tasks_GET | public ArrayList<Long> packName_tasks_GET(String packName, String function, OvhTaskStatusEnum status) throws IOException {
"""
Tasks scheduled for this pack
REST: GET /pack/xdsl/{packName}/tasks
@param function [required] Filter the value of function property (=)
@param status [required] Filter the value of s... | java | public ArrayList<Long> packName_tasks_GET(String packName, String function, OvhTaskStatusEnum status) throws IOException {
String qPath = "/pack/xdsl/{packName}/tasks";
StringBuilder sb = path(qPath, packName);
query(sb, "function", function);
query(sb, "status", status);
String resp = exec(qPath, "GET", sb.t... | [
"public",
"ArrayList",
"<",
"Long",
">",
"packName_tasks_GET",
"(",
"String",
"packName",
",",
"String",
"function",
",",
"OvhTaskStatusEnum",
"status",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/pack/xdsl/{packName}/tasks\"",
";",
"StringBuilder",... | Tasks scheduled for this pack
REST: GET /pack/xdsl/{packName}/tasks
@param function [required] Filter the value of function property (=)
@param status [required] Filter the value of status property (=)
@param packName [required] The internal name of your pack | [
"Tasks",
"scheduled",
"for",
"this",
"pack"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L773-L780 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/ValueElement.java | ValueElement.toInt | public JcNumber toInt() {
"""
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>convert the argument to an integer, return a <b>JcNumber</b>, if the conversion fails return NULL</i></div>
<br/>
"""
JcNumber ret = new Jc... | java | public JcNumber toInt() {
JcNumber ret = new JcNumber(null, this,
new FunctionInstance(FUNCTION.Common.TOINT, 1));
QueryRecorder.recordInvocationConditional(this, "toInt", ret);
return ret;
} | [
"public",
"JcNumber",
"toInt",
"(",
")",
"{",
"JcNumber",
"ret",
"=",
"new",
"JcNumber",
"(",
"null",
",",
"this",
",",
"new",
"FunctionInstance",
"(",
"FUNCTION",
".",
"Common",
".",
"TOINT",
",",
"1",
")",
")",
";",
"QueryRecorder",
".",
"recordInvocat... | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>convert the argument to an integer, return a <b>JcNumber</b>, if the conversion fails return NULL</i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/ValueElement.java#L60-L65 |
oasp/oasp4j | modules/basic/src/main/java/io/oasp/module/basic/common/api/config/SimpleConfigProperties.java | SimpleConfigProperties.getChild | protected ConfigProperties getChild(String key, boolean create) {
"""
@see #getChild(String)
@param key the key of the requested child.
@param create - {@code true} to create if not exits, {@code false} otherwise.
@return the requested child.
"""
if ((key == null) || (key.isEmpty())) {
return t... | java | protected ConfigProperties getChild(String key, boolean create) {
if ((key == null) || (key.isEmpty())) {
return this;
}
if (key.indexOf(KEY_SEPARATOR) > 0) {
String[] segments = key.split("\\.");
return getChild(create, segments);
}
SimpleConfigProperties result = this.childMap.g... | [
"protected",
"ConfigProperties",
"getChild",
"(",
"String",
"key",
",",
"boolean",
"create",
")",
"{",
"if",
"(",
"(",
"key",
"==",
"null",
")",
"||",
"(",
"key",
".",
"isEmpty",
"(",
")",
")",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"key"... | @see #getChild(String)
@param key the key of the requested child.
@param create - {@code true} to create if not exits, {@code false} otherwise.
@return the requested child. | [
"@see",
"#getChild",
"(",
"String",
")"
] | train | https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/basic/src/main/java/io/oasp/module/basic/common/api/config/SimpleConfigProperties.java#L90-L110 |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/DriverFactory.java | DriverFactory.generateWebDriver | private WebDriver generateWebDriver(String driverName) throws TechnicalException {
"""
Generates a selenium webdriver following a name given in parameter.
By default a chrome driver is generated.
@param driverName
The name of the web driver to generate
@return
An instance a web driver whose type is provided... | java | private WebDriver generateWebDriver(String driverName) throws TechnicalException {
WebDriver driver;
if (IE.equals(driverName)) {
driver = generateIEDriver();
} else if (CHROME.equals(driverName)) {
driver = generateGoogleChromeDriver();
} else if (FIREFOX.e... | [
"private",
"WebDriver",
"generateWebDriver",
"(",
"String",
"driverName",
")",
"throws",
"TechnicalException",
"{",
"WebDriver",
"driver",
";",
"if",
"(",
"IE",
".",
"equals",
"(",
"driverName",
")",
")",
"{",
"driver",
"=",
"generateIEDriver",
"(",
")",
";",
... | Generates a selenium webdriver following a name given in parameter.
By default a chrome driver is generated.
@param driverName
The name of the web driver to generate
@return
An instance a web driver whose type is provided by driver name given in parameter
@throws TechnicalException
if an error occured when Webdriver s... | [
"Generates",
"a",
"selenium",
"webdriver",
"following",
"a",
"name",
"given",
"in",
"parameter",
".",
"By",
"default",
"a",
"chrome",
"driver",
"is",
"generated",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/DriverFactory.java#L253-L270 |
joniles/mpxj | src/main/java/net/sf/mpxj/fasttrack/FastTrackUtility.java | FastTrackUtility.getDouble | public static final Double getDouble(byte[] data, int offset) {
"""
This method reads an eight byte double from the input array.
@param data the input array
@param offset offset of double data in the array
@return double value
"""
Double result = null;
long longValue = getLong(data, offset);
... | java | public static final Double getDouble(byte[] data, int offset)
{
Double result = null;
long longValue = getLong(data, offset);
if (longValue != NULL_DOUBLE)
{
double doubleValue = Double.longBitsToDouble(longValue);
if (!Double.isNaN(doubleValue))
{
resul... | [
"public",
"static",
"final",
"Double",
"getDouble",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"Double",
"result",
"=",
"null",
";",
"long",
"longValue",
"=",
"getLong",
"(",
"data",
",",
"offset",
")",
";",
"if",
"(",
"longValue",
... | This method reads an eight byte double from the input array.
@param data the input array
@param offset offset of double data in the array
@return double value | [
"This",
"method",
"reads",
"an",
"eight",
"byte",
"double",
"from",
"the",
"input",
"array",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/fasttrack/FastTrackUtility.java#L131-L144 |
mqlight/java-mqlight | mqlight/src/main/java/com/ibm/mqlight/api/impl/network/NettyNetworkService.java | NettyNetworkService.getBootstrap | private static synchronized Bootstrap getBootstrap(final boolean secure, final ChannelHandler handler) {
"""
Request a {@link Bootstrap} for obtaining a {@link Channel} and track
that the workerGroup is being used.
@param secure
a {@code boolean} indicating whether or not a secure channel
will be required
@... | java | private static synchronized Bootstrap getBootstrap(final boolean secure, final ChannelHandler handler) {
final String methodName = "getBootstrap";
logger.entry(methodName, secure);
++useCount;
if (useCount == 1) {
EventLoopGroup workerGroup = new NioEventLoopGroup();
... | [
"private",
"static",
"synchronized",
"Bootstrap",
"getBootstrap",
"(",
"final",
"boolean",
"secure",
",",
"final",
"ChannelHandler",
"handler",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"getBootstrap\"",
";",
"logger",
".",
"entry",
"(",
"methodName",
",",... | Request a {@link Bootstrap} for obtaining a {@link Channel} and track
that the workerGroup is being used.
@param secure
a {@code boolean} indicating whether or not a secure channel
will be required
@param handler a {@link ChannelHandler} to use for serving the requests.
@return a netty {@link Bootstrap} object suitabl... | [
"Request",
"a",
"{",
"@link",
"Bootstrap",
"}",
"for",
"obtaining",
"a",
"{",
"@link",
"Channel",
"}",
"and",
"track",
"that",
"the",
"workerGroup",
"is",
"being",
"used",
"."
] | train | https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/network/NettyNetworkService.java#L443-L469 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentPersistenceImpl.java | CommerceShipmentPersistenceImpl.findByGroupId | @Override
public List<CommerceShipment> findByGroupId(long groupId, int start, int end) {
"""
Returns a range of all the commerce shipments where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primar... | java | @Override
public List<CommerceShipment> findByGroupId(long groupId, int start, int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceShipment",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce shipments where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set.... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"shipments",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentPersistenceImpl.java#L139-L142 |
ehcache/ehcache3 | core/src/main/java/org/ehcache/core/spi/service/ServiceUtils.java | ServiceUtils.findSingletonAmongst | public static <T> T findSingletonAmongst(Class<T> clazz, Collection<?> instances) {
"""
Find the only expected instance of {@code clazz} among the {@code instances}.
@param clazz searched class
@param instances instances looked at
@param <T> type of the searched instance
@return the compatible instance or nu... | java | public static <T> T findSingletonAmongst(Class<T> clazz, Collection<?> instances) {
return findOptionalAmongst(clazz, instances)
.orElse(null);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"findSingletonAmongst",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Collection",
"<",
"?",
">",
"instances",
")",
"{",
"return",
"findOptionalAmongst",
"(",
"clazz",
",",
"instances",
")",
".",
"orElse",
"(",
"null... | Find the only expected instance of {@code clazz} among the {@code instances}.
@param clazz searched class
@param instances instances looked at
@param <T> type of the searched instance
@return the compatible instance or null if none are found
@throws IllegalArgumentException if more than one matching instance | [
"Find",
"the",
"only",
"expected",
"instance",
"of",
"{",
"@code",
"clazz",
"}",
"among",
"the",
"{",
"@code",
"instances",
"}",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/spi/service/ServiceUtils.java#L75-L78 |
jenkinsci/jenkins | core/src/main/java/hudson/model/ChoiceParameterDefinition.java | ChoiceParameterDefinition.setChoices | @DataBoundSetter
@Restricted(NoExternalUse.class) // this is terrible enough without being used anywhere
public void setChoices(Object choices) {
"""
Set the list of choices. Legal arguments are String (in which case the arguments gets split into lines) and Collection
which sets the list of legal paramete... | java | @DataBoundSetter
@Restricted(NoExternalUse.class) // this is terrible enough without being used anywhere
public void setChoices(Object choices) {
if (choices instanceof String) {
setChoicesText((String) choices);
return;
}
if (choices instanceof List) {
... | [
"@",
"DataBoundSetter",
"@",
"Restricted",
"(",
"NoExternalUse",
".",
"class",
")",
"// this is terrible enough without being used anywhere",
"public",
"void",
"setChoices",
"(",
"Object",
"choices",
")",
"{",
"if",
"(",
"choices",
"instanceof",
"String",
")",
"{",
... | Set the list of choices. Legal arguments are String (in which case the arguments gets split into lines) and Collection
which sets the list of legal parameters to the String representations of the argument's non-null entries.
See JENKINS-26143 for background.
This retains the compatibility with the legacy String 'choi... | [
"Set",
"the",
"list",
"of",
"choices",
".",
"Legal",
"arguments",
"are",
"String",
"(",
"in",
"which",
"case",
"the",
"arguments",
"gets",
"split",
"into",
"lines",
")",
"and",
"Collection",
"which",
"sets",
"the",
"list",
"of",
"legal",
"parameters",
"to"... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ChoiceParameterDefinition.java#L88-L106 |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.readOptionalMonth | private Month readOptionalMonth(JSONObject json, String key) {
"""
Read an optional month value (stored as string) form a JSON Object.
@param json the JSON object to read from.
@param key the key for the month value in the provided JSON object.
@return the month or null if reading the month fails.
"""
... | java | private Month readOptionalMonth(JSONObject json, String key) {
try {
String str = json.getString(key);
return Month.valueOf(str);
} catch (JSONException | IllegalArgumentException e) {
LOG.debug("Reading optional JSON month failed. Default to provided default value."... | [
"private",
"Month",
"readOptionalMonth",
"(",
"JSONObject",
"json",
",",
"String",
"key",
")",
"{",
"try",
"{",
"String",
"str",
"=",
"json",
".",
"getString",
"(",
"key",
")",
";",
"return",
"Month",
".",
"valueOf",
"(",
"str",
")",
";",
"}",
"catch",... | Read an optional month value (stored as string) form a JSON Object.
@param json the JSON object to read from.
@param key the key for the month value in the provided JSON object.
@return the month or null if reading the month fails. | [
"Read",
"an",
"optional",
"month",
"value",
"(",
"stored",
"as",
"string",
")",
"form",
"a",
"JSON",
"Object",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L367-L376 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/PlotBoxTLSmall.java | PlotBoxTLSmall.getBufferedImage | public BufferedImage getBufferedImage(int width, int height) {
"""
Get a buffered image of this chart
@param width The width of the image
@param height The height of the image
@return A buffered image of this chart.
"""
BufferedImage bi = chart.createBufferedImage(width, height);
return bi;
} | java | public BufferedImage getBufferedImage(int width, int height) {
BufferedImage bi = chart.createBufferedImage(width, height);
return bi;
} | [
"public",
"BufferedImage",
"getBufferedImage",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"BufferedImage",
"bi",
"=",
"chart",
".",
"createBufferedImage",
"(",
"width",
",",
"height",
")",
";",
"return",
"bi",
";",
"}"
] | Get a buffered image of this chart
@param width The width of the image
@param height The height of the image
@return A buffered image of this chart. | [
"Get",
"a",
"buffered",
"image",
"of",
"this",
"chart"
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/PlotBoxTLSmall.java#L193-L196 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java | JsonUtil.put | public static void put(Writer writer, Character value) throws IOException {
"""
Writes the given value with the given writer, sanitizing with {@link #sanitize(String)} as a valid JSON-formatted data.
@param writer
@param value
@throws IOException
@author vvakame
"""
if (value == null) {
writer.write("... | java | public static void put(Writer writer, Character value) throws IOException {
if (value == null) {
writer.write("null");
} else {
writer.write("\"");
writer.write(sanitize(value));
writer.write("\"");
}
} | [
"public",
"static",
"void",
"put",
"(",
"Writer",
"writer",
",",
"Character",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"writer",
".",
"write",
"(",
"\"null\"",
")",
";",
"}",
"else",
"{",
"writer",
".",
... | Writes the given value with the given writer, sanitizing with {@link #sanitize(String)} as a valid JSON-formatted data.
@param writer
@param value
@throws IOException
@author vvakame | [
"Writes",
"the",
"given",
"value",
"with",
"the",
"given",
"writer",
"sanitizing",
"with",
"{"
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java#L195-L203 |
apache/groovy | subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java | SwingGroovyMethods.leftShift | public static JPopupMenu leftShift(JPopupMenu self, GString gstr) {
"""
Overloads the left shift operator to provide an easy way to add
components to a popupMenu.<p>
@param self a JPopupMenu
@param gstr a GString to be added to the popupMenu.
@return same popupMenu, after the value was added to it.
@since 1... | java | public static JPopupMenu leftShift(JPopupMenu self, GString gstr) {
self.add(gstr.toString());
return self;
} | [
"public",
"static",
"JPopupMenu",
"leftShift",
"(",
"JPopupMenu",
"self",
",",
"GString",
"gstr",
")",
"{",
"self",
".",
"add",
"(",
"gstr",
".",
"toString",
"(",
")",
")",
";",
"return",
"self",
";",
"}"
] | Overloads the left shift operator to provide an easy way to add
components to a popupMenu.<p>
@param self a JPopupMenu
@param gstr a GString to be added to the popupMenu.
@return same popupMenu, after the value was added to it.
@since 1.6.4 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"an",
"easy",
"way",
"to",
"add",
"components",
"to",
"a",
"popupMenu",
".",
"<p",
">"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java#L952-L955 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/sites/CmsSitesWebserverDialog.java | CmsSitesWebserverDialog.getParameter | private String getParameter(Map<String, String> params, String key, String defaultValue) {
"""
Returns a parameter value from the module parameters,
or a given default value in case the parameter is not set.<p>
@param params the parameter map to get a value from
@param key the parameter to return the value fo... | java | private String getParameter(Map<String, String> params, String key, String defaultValue) {
String value = params.get(key);
return (value != null) ? value : defaultValue;
} | [
"private",
"String",
"getParameter",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"params",
".",
"get",
"(",
"key",
")",
";",
"return",
"(",
"value",
"!=... | Returns a parameter value from the module parameters,
or a given default value in case the parameter is not set.<p>
@param params the parameter map to get a value from
@param key the parameter to return the value for
@param defaultValue the default value in case there is no value stored for this key
@return the param... | [
"Returns",
"a",
"parameter",
"value",
"from",
"the",
"module",
"parameters",
"or",
"a",
"given",
"default",
"value",
"in",
"case",
"the",
"parameter",
"is",
"not",
"set",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/sites/CmsSitesWebserverDialog.java#L429-L433 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java | CmsForm.updateFieldValidationStatus | protected void updateFieldValidationStatus(String fieldId, CmsValidationResult result) {
"""
Applies a validation result to a form field.<p>
@param fieldId the field id to which the validation result should be applied
@param result the result of the validation operation
"""
I_CmsFormField field = ... | java | protected void updateFieldValidationStatus(String fieldId, CmsValidationResult result) {
I_CmsFormField field = m_fields.get(fieldId);
updateFieldValidationStatus(field, result);
} | [
"protected",
"void",
"updateFieldValidationStatus",
"(",
"String",
"fieldId",
",",
"CmsValidationResult",
"result",
")",
"{",
"I_CmsFormField",
"field",
"=",
"m_fields",
".",
"get",
"(",
"fieldId",
")",
";",
"updateFieldValidationStatus",
"(",
"field",
",",
"result"... | Applies a validation result to a form field.<p>
@param fieldId the field id to which the validation result should be applied
@param result the result of the validation operation | [
"Applies",
"a",
"validation",
"result",
"to",
"a",
"form",
"field",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java#L520-L524 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/server/ServerImpl.java | ServerImpl.getOrCreateChannelCategory | public ChannelCategory getOrCreateChannelCategory(JsonNode data) {
"""
Gets or creates a channel category.
@param data The json data of the channel.
@return The server text channel.
"""
long id = Long.parseLong(data.get("id").asText());
ChannelType type = ChannelType.fromId(data.get("type")... | java | public ChannelCategory getOrCreateChannelCategory(JsonNode data) {
long id = Long.parseLong(data.get("id").asText());
ChannelType type = ChannelType.fromId(data.get("type").asInt());
synchronized (this) {
if (type == ChannelType.CHANNEL_CATEGORY) {
return getChannelCa... | [
"public",
"ChannelCategory",
"getOrCreateChannelCategory",
"(",
"JsonNode",
"data",
")",
"{",
"long",
"id",
"=",
"Long",
".",
"parseLong",
"(",
"data",
".",
"get",
"(",
"\"id\"",
")",
".",
"asText",
"(",
")",
")",
";",
"ChannelType",
"type",
"=",
"ChannelT... | Gets or creates a channel category.
@param data The json data of the channel.
@return The server text channel. | [
"Gets",
"or",
"creates",
"a",
"channel",
"category",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/server/ServerImpl.java#L600-L610 |
AgNO3/jcifs-ng | src/main/java/jcifs/smb/NtlmPasswordAuthenticator.java | NtlmPasswordAuthenticator.getUserSessionKey | public void getUserSessionKey ( CIFSContext tc, byte[] chlng, byte[] dest, int offset ) throws SmbException {
"""
Calculates the effective user session key.
@param tc
context to use
@param chlng
The server challenge.
@param dest
The destination array in which the user session key will be
placed.
@param o... | java | public void getUserSessionKey ( CIFSContext tc, byte[] chlng, byte[] dest, int offset ) throws SmbException {
try {
MessageDigest md4 = Crypto.getMD4();
md4.update(Strings.getUNIBytes(this.password));
switch ( tc.getConfig().getLanManCompatibility() ) {
case 0:
... | [
"public",
"void",
"getUserSessionKey",
"(",
"CIFSContext",
"tc",
",",
"byte",
"[",
"]",
"chlng",
",",
"byte",
"[",
"]",
"dest",
",",
"int",
"offset",
")",
"throws",
"SmbException",
"{",
"try",
"{",
"MessageDigest",
"md4",
"=",
"Crypto",
".",
"getMD4",
"(... | Calculates the effective user session key.
@param tc
context to use
@param chlng
The server challenge.
@param dest
The destination array in which the user session key will be
placed.
@param offset
The offset in the destination array at which the
session key will start.
@throws SmbException | [
"Calculates",
"the",
"effective",
"user",
"session",
"key",
"."
] | train | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/smb/NtlmPasswordAuthenticator.java#L495-L536 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java | CommonOps_ZDRM.stripReal | public static DMatrixRMaj stripReal(ZMatrixD1 input , DMatrixRMaj output ) {
"""
Places the real component of the input matrix into the output matrix.
@param input Complex matrix. Not modified.
@param output real matrix. Modified.
"""
if( output == null ) {
output = new DMatrixRMaj(inpu... | java | public static DMatrixRMaj stripReal(ZMatrixD1 input , DMatrixRMaj output ) {
if( output == null ) {
output = new DMatrixRMaj(input.numRows,input.numCols);
} else if( input.numCols != output.numCols || input.numRows != output.numRows ) {
throw new IllegalArgumentException("The mat... | [
"public",
"static",
"DMatrixRMaj",
"stripReal",
"(",
"ZMatrixD1",
"input",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"input",
".",
"numRows",
",",
"input",
".",
"numCols",... | Places the real component of the input matrix into the output matrix.
@param input Complex matrix. Not modified.
@param output real matrix. Modified. | [
"Places",
"the",
"real",
"component",
"of",
"the",
"input",
"matrix",
"into",
"the",
"output",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java#L164-L177 |
knowm/XChange | xchange-cryptopia/src/main/java/org/knowm/xchange/cryptopia/CryptopiaAdapters.java | CryptopiaAdapters.adaptTicker | public static Ticker adaptTicker(CryptopiaTicker cryptopiaTicker, CurrencyPair currencyPair) {
"""
Adapts a CryptopiaTicker to a Ticker Object
@param cryptopiaTicker The exchange specific ticker
@param currencyPair (e.g. BTC/USD)
@return The XChange ticker
"""
return new Ticker.Builder()
.curr... | java | public static Ticker adaptTicker(CryptopiaTicker cryptopiaTicker, CurrencyPair currencyPair) {
return new Ticker.Builder()
.currencyPair(currencyPair)
.last(cryptopiaTicker.getLast())
.bid(cryptopiaTicker.getBid())
.ask(cryptopiaTicker.getAsk())
.high(cryptopiaTicker.getHigh(... | [
"public",
"static",
"Ticker",
"adaptTicker",
"(",
"CryptopiaTicker",
"cryptopiaTicker",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"return",
"new",
"Ticker",
".",
"Builder",
"(",
")",
".",
"currencyPair",
"(",
"currencyPair",
")",
".",
"last",
"(",
"cryptopi... | Adapts a CryptopiaTicker to a Ticker Object
@param cryptopiaTicker The exchange specific ticker
@param currencyPair (e.g. BTC/USD)
@return The XChange ticker | [
"Adapts",
"a",
"CryptopiaTicker",
"to",
"a",
"Ticker",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-cryptopia/src/main/java/org/knowm/xchange/cryptopia/CryptopiaAdapters.java#L84-L95 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/apple/XcodeProjectWriter.java | XcodeProjectWriter.createPBXBuildFile | private static PBXObjectRef createPBXBuildFile(final PBXObjectRef fileRef, final Map settings) {
"""
Create PBXBuildFile.
@param fileRef
source file.
@param settings
build settings.
@return PBXBuildFile.
"""
final Map map = new HashMap();
map.put("fileRef", fileRef);
map.put("isa", "PBXBuild... | java | private static PBXObjectRef createPBXBuildFile(final PBXObjectRef fileRef, final Map settings) {
final Map map = new HashMap();
map.put("fileRef", fileRef);
map.put("isa", "PBXBuildFile");
if (settings != null) {
map.put("settings", settings);
}
return new PBXObjectRef(map);
} | [
"private",
"static",
"PBXObjectRef",
"createPBXBuildFile",
"(",
"final",
"PBXObjectRef",
"fileRef",
",",
"final",
"Map",
"settings",
")",
"{",
"final",
"Map",
"map",
"=",
"new",
"HashMap",
"(",
")",
";",
"map",
".",
"put",
"(",
"\"fileRef\"",
",",
"fileRef",... | Create PBXBuildFile.
@param fileRef
source file.
@param settings
build settings.
@return PBXBuildFile. | [
"Create",
"PBXBuildFile",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/XcodeProjectWriter.java#L135-L143 |
sdl/Testy | src/main/java/com/sdl/selenium/web/XPathBuilder.java | XPathBuilder.setAttribute | @SuppressWarnings("unchecked")
public <T extends XPathBuilder> T setAttribute(final String attribute, String value, final SearchType... searchTypes) {
"""
<p><b>Used for finding element process (to generate xpath address)</b></p>
<p>Result Example:</p>
<pre>
//*[@placeholder='Search']
</pre>
@param attr... | java | @SuppressWarnings("unchecked")
public <T extends XPathBuilder> T setAttribute(final String attribute, String value, final SearchType... searchTypes) {
if (attribute != null) {
if (value == null) {
this.attribute.remove(attribute);
} else {
this.attribu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"XPathBuilder",
">",
"T",
"setAttribute",
"(",
"final",
"String",
"attribute",
",",
"String",
"value",
",",
"final",
"SearchType",
"...",
"searchTypes",
")",
"{",
"if",
"(",
"... | <p><b>Used for finding element process (to generate xpath address)</b></p>
<p>Result Example:</p>
<pre>
//*[@placeholder='Search']
</pre>
@param attribute eg. placeholder
@param value eg. Search
@param searchTypes accept only SearchType.EQUALS, SearchType.CONTAINS, SearchType.STARTS_WITH, SearchType.TRIM
@para... | [
"<p",
">",
"<b",
">",
"Used",
"for",
"finding",
"element",
"process",
"(",
"to",
"generate",
"xpath",
"address",
")",
"<",
"/",
"b",
">",
"<",
"/",
"p",
">",
"<p",
">",
"Result",
"Example",
":",
"<",
"/",
"p",
">",
"<pre",
">",
"//",
"*",
"[",
... | train | https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/web/XPathBuilder.java#L661-L671 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java | DocPath.forClass | public static DocPath forClass(Utils utils, TypeElement typeElement) {
"""
Return the path for a class.
For example, if the class is java.lang.Object,
the path is java/lang/Object.html.
"""
return (typeElement == null)
? empty
: forPackage(utils.containingPackage(typeE... | java | public static DocPath forClass(Utils utils, TypeElement typeElement) {
return (typeElement == null)
? empty
: forPackage(utils.containingPackage(typeElement)).resolve(forName(utils, typeElement));
} | [
"public",
"static",
"DocPath",
"forClass",
"(",
"Utils",
"utils",
",",
"TypeElement",
"typeElement",
")",
"{",
"return",
"(",
"typeElement",
"==",
"null",
")",
"?",
"empty",
":",
"forPackage",
"(",
"utils",
".",
"containingPackage",
"(",
"typeElement",
")",
... | Return the path for a class.
For example, if the class is java.lang.Object,
the path is java/lang/Object.html. | [
"Return",
"the",
"path",
"for",
"a",
"class",
".",
"For",
"example",
"if",
"the",
"class",
"is",
"java",
".",
"lang",
".",
"Object",
"the",
"path",
"is",
"java",
"/",
"lang",
"/",
"Object",
".",
"html",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java#L61-L65 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java | ReactionSetManipulator.getRelevantReactionsAsReactant | public static IReactionSet getRelevantReactionsAsReactant(IReactionSet reactSet, IAtomContainer molecule) {
"""
Get all Reactions object containing a Molecule as a Reactant from a set
of Reactions.
@param reactSet The set of reaction to inspect
@param molecule The molecule to find as a reactant
@return ... | java | public static IReactionSet getRelevantReactionsAsReactant(IReactionSet reactSet, IAtomContainer molecule) {
IReactionSet newReactSet = reactSet.getBuilder().newInstance(IReactionSet.class);
for (IReaction reaction : reactSet.reactions()) {
for (IAtomContainer atomContainer : reaction.getReac... | [
"public",
"static",
"IReactionSet",
"getRelevantReactionsAsReactant",
"(",
"IReactionSet",
"reactSet",
",",
"IAtomContainer",
"molecule",
")",
"{",
"IReactionSet",
"newReactSet",
"=",
"reactSet",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IReactionSet",
".... | Get all Reactions object containing a Molecule as a Reactant from a set
of Reactions.
@param reactSet The set of reaction to inspect
@param molecule The molecule to find as a reactant
@return The IReactionSet | [
"Get",
"all",
"Reactions",
"object",
"containing",
"a",
"Molecule",
"as",
"a",
"Reactant",
"from",
"a",
"set",
"of",
"Reactions",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java#L163-L170 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/ProbeManagerImpl.java | ProbeManagerImpl.buildListenersFromAnnotated | Set<ProbeListener> buildListenersFromAnnotated(Object monitor) {
"""
Create a set of {@link ProbeListener}s that delegate annotated
methods on the specified monitor.
@return the set of listeners to activate
"""
Set<ProbeListener> listeners = new HashSet<ProbeListener>();
Class<?> clazz = m... | java | Set<ProbeListener> buildListenersFromAnnotated(Object monitor) {
Set<ProbeListener> listeners = new HashSet<ProbeListener>();
Class<?> clazz = monitor.getClass();
for (Method method : ReflectionHelper.getMethods(clazz)) {
ProbeSite probeSite = method.getAnnotation(ProbeSite.class);
... | [
"Set",
"<",
"ProbeListener",
">",
"buildListenersFromAnnotated",
"(",
"Object",
"monitor",
")",
"{",
"Set",
"<",
"ProbeListener",
">",
"listeners",
"=",
"new",
"HashSet",
"<",
"ProbeListener",
">",
"(",
")",
";",
"Class",
"<",
"?",
">",
"clazz",
"=",
"moni... | Create a set of {@link ProbeListener}s that delegate annotated
methods on the specified monitor.
@return the set of listeners to activate | [
"Create",
"a",
"set",
"of",
"{",
"@link",
"ProbeListener",
"}",
"s",
"that",
"delegate",
"annotated",
"methods",
"on",
"the",
"specified",
"monitor",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/ProbeManagerImpl.java#L384-L415 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java | MathBindings.copySign | public static DoubleBinding copySign(final ObservableDoubleValue magnitude, double sign) {
"""
Binding for {@link java.lang.Math#copySign(double, double)}
@param magnitude the parameter providing the magnitude of the result
@param sign the parameter providing the sign of the result
@return a value with the... | java | public static DoubleBinding copySign(final ObservableDoubleValue magnitude, double sign) {
return createDoubleBinding(() -> Math.copySign(magnitude.get(), sign), magnitude);
} | [
"public",
"static",
"DoubleBinding",
"copySign",
"(",
"final",
"ObservableDoubleValue",
"magnitude",
",",
"double",
"sign",
")",
"{",
"return",
"createDoubleBinding",
"(",
"(",
")",
"->",
"Math",
".",
"copySign",
"(",
"magnitude",
".",
"get",
"(",
")",
",",
... | Binding for {@link java.lang.Math#copySign(double, double)}
@param magnitude the parameter providing the magnitude of the result
@param sign the parameter providing the sign of the result
@return a value with the magnitude of {@code magnitude}
and the sign of {@code sign}. | [
"Binding",
"for",
"{",
"@link",
"java",
".",
"lang",
".",
"Math#copySign",
"(",
"double",
"double",
")",
"}"
] | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L287-L289 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/db/dao/AbstractHibernateDao.java | AbstractHibernateDao.updateByHql | public int updateByHql(String secondHalfOfHql, Object[] paramValues, Type[] paramTypes) {
"""
Update by criteria specified as HQL
@param secondHalfOfHql
@param paramValues
@param paramTypes
@return the number of records updated
"""
StringBuilder queryStr = new StringBuilder();
queryStr.append("up... | java | public int updateByHql(String secondHalfOfHql, Object[] paramValues, Type[] paramTypes){
StringBuilder queryStr = new StringBuilder();
queryStr.append("update ")
.append(this.clazz.getName())
.append(" ");
if (secondHalfOfHql != null){
queryStr.append(secondHalfOfHql);
}
S... | [
"public",
"int",
"updateByHql",
"(",
"String",
"secondHalfOfHql",
",",
"Object",
"[",
"]",
"paramValues",
",",
"Type",
"[",
"]",
"paramTypes",
")",
"{",
"StringBuilder",
"queryStr",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"queryStr",
".",
"append",
"(",
... | Update by criteria specified as HQL
@param secondHalfOfHql
@param paramValues
@param paramTypes
@return the number of records updated | [
"Update",
"by",
"criteria",
"specified",
"as",
"HQL"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/dao/AbstractHibernateDao.java#L455-L468 |
ReactiveX/RxNetty | rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/sse/ServerSentEvent.java | ServerSentEvent.withEventType | public static ServerSentEvent withEventType(ByteBuf eventType, ByteBuf data) {
"""
Creates a {@link ServerSentEvent} instance with an event type.
@param eventType Type for the event.
@param data Data for the event.
@return The {@link ServerSentEvent} instance.
"""
return new ServerSentEvent(null... | java | public static ServerSentEvent withEventType(ByteBuf eventType, ByteBuf data) {
return new ServerSentEvent(null, eventType, data);
} | [
"public",
"static",
"ServerSentEvent",
"withEventType",
"(",
"ByteBuf",
"eventType",
",",
"ByteBuf",
"data",
")",
"{",
"return",
"new",
"ServerSentEvent",
"(",
"null",
",",
"eventType",
",",
"data",
")",
";",
"}"
] | Creates a {@link ServerSentEvent} instance with an event type.
@param eventType Type for the event.
@param data Data for the event.
@return The {@link ServerSentEvent} instance. | [
"Creates",
"a",
"{",
"@link",
"ServerSentEvent",
"}",
"instance",
"with",
"an",
"event",
"type",
"."
] | train | https://github.com/ReactiveX/RxNetty/blob/a7ca9a9c1d544a79c82f7b17036daf6958bf1cd6/rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/sse/ServerSentEvent.java#L264-L266 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/recurrent/KerasRnnUtils.java | KerasRnnUtils.getRecurrentDropout | public static double getRecurrentDropout(KerasLayerConfiguration conf, Map<String, Object> layerConfig)
throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException {
"""
Get recurrent weight dropout from Keras layer configuration.
Non-zero dropout rates are currently not supporte... | java | public static double getRecurrentDropout(KerasLayerConfiguration conf, Map<String, Object> layerConfig)
throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
doub... | [
"public",
"static",
"double",
"getRecurrentDropout",
"(",
"KerasLayerConfiguration",
"conf",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
")",
"throws",
"UnsupportedKerasConfigurationException",
",",
"InvalidKerasConfigurationException",
"{",
"Map",
"<",
... | Get recurrent weight dropout from Keras layer configuration.
Non-zero dropout rates are currently not supported.
@param conf KerasLayerConfiguration
@param layerConfig dictionary containing Keras layer properties
@return recurrent dropout rate
@throws InvalidKerasConfigurationException Invalid Keras configurati... | [
"Get",
"recurrent",
"weight",
"dropout",
"from",
"Keras",
"layer",
"configuration",
".",
"Non",
"-",
"zero",
"dropout",
"rates",
"are",
"currently",
"not",
"supported",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/recurrent/KerasRnnUtils.java#L59-L74 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.setCustomForDefaultProfile | protected static boolean setCustomForDefaultProfile(String pathName, Boolean isResponse, String customData) {
"""
set custom request/response for the default profile's default client
@param pathName friendly name of path
@param isResponse true for response, false for request
@param customData custom response/... | java | protected static boolean setCustomForDefaultProfile(String pathName, Boolean isResponse, String customData) {
try {
JSONObject profile = getDefaultProfile();
String profileName = profile.getString("name");
Client client = new Client(profileName, false);
return cli... | [
"protected",
"static",
"boolean",
"setCustomForDefaultProfile",
"(",
"String",
"pathName",
",",
"Boolean",
"isResponse",
",",
"String",
"customData",
")",
"{",
"try",
"{",
"JSONObject",
"profile",
"=",
"getDefaultProfile",
"(",
")",
";",
"String",
"profileName",
"... | set custom request/response for the default profile's default client
@param pathName friendly name of path
@param isResponse true for response, false for request
@param customData custom response/request data
@return true if success, false otherwise | [
"set",
"custom",
"request",
"/",
"response",
"for",
"the",
"default",
"profile",
"s",
"default",
"client"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L852-L862 |
Omertron/api-moviemeter | src/main/java/com/omertron/moviemeter/MovieMeterApi.java | MovieMeterApi.readJsonObject | private <T> T readJsonObject(final String url, final Class<T> object) throws MovieMeterException {
"""
Get the information for a URL and process into an object
@param <T> The class of the object
@param url The URL to retrieve
@param object The class of object to map the URL to
@return The correctly mapped ob... | java | private <T> T readJsonObject(final String url, final Class<T> object) throws MovieMeterException {
final String page = requestWebPage(url);
if (StringUtils.isNotBlank(page)) {
try {
return mapper.readValue(page, object);
} catch (IOException ex) {
... | [
"private",
"<",
"T",
">",
"T",
"readJsonObject",
"(",
"final",
"String",
"url",
",",
"final",
"Class",
"<",
"T",
">",
"object",
")",
"throws",
"MovieMeterException",
"{",
"final",
"String",
"page",
"=",
"requestWebPage",
"(",
"url",
")",
";",
"if",
"(",
... | Get the information for a URL and process into an object
@param <T> The class of the object
@param url The URL to retrieve
@param object The class of object to map the URL to
@return The correctly mapped object
@throws MovieMeterException | [
"Get",
"the",
"information",
"for",
"a",
"URL",
"and",
"process",
"into",
"an",
"object"
] | train | https://github.com/Omertron/api-moviemeter/blob/7531a0ca2f720d324ae5c48c76d2228f85e42222/src/main/java/com/omertron/moviemeter/MovieMeterApi.java#L197-L207 |
PrashamTrivedi/SharedPreferenceInspector | sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java | SharedPreferenceUtils.putInt | public void putInt(String key, int value) {
"""
put the int value to shared preference
@param key
the name of the preference to save
@param value
the name of the preference to modify.
@see android.content.SharedPreferences#edit()#putInt(String, int)
"""
sharedPreferences.edit().putInt(key, value).co... | java | public void putInt(String key, int value) {
sharedPreferences.edit().putInt(key, value).commit();
} | [
"public",
"void",
"putInt",
"(",
"String",
"key",
",",
"int",
"value",
")",
"{",
"sharedPreferences",
".",
"edit",
"(",
")",
".",
"putInt",
"(",
"key",
",",
"value",
")",
".",
"commit",
"(",
")",
";",
"}"
] | put the int value to shared preference
@param key
the name of the preference to save
@param value
the name of the preference to modify.
@see android.content.SharedPreferences#edit()#putInt(String, int) | [
"put",
"the",
"int",
"value",
"to",
"shared",
"preference"
] | train | https://github.com/PrashamTrivedi/SharedPreferenceInspector/blob/c04d567c4d0fc5e0f8cda308ca85df19c6b3b838/sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java#L445-L447 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/BarcodeDatamatrix.java | BarcodeDatamatrix.generate | public int generate(String text) throws UnsupportedEncodingException {
"""
Creates a barcode. The <CODE>String</CODE> is interpreted with the ISO-8859-1 encoding
@param text the text
@return the status of the generation. It can be one of this values:
<p>
<CODE>DM_NO_ERROR</CODE> - no error.<br>
<CODE>DM_ERROR... | java | public int generate(String text) throws UnsupportedEncodingException {
byte[] t = text.getBytes("iso-8859-1");
return generate(t, 0, t.length);
} | [
"public",
"int",
"generate",
"(",
"String",
"text",
")",
"throws",
"UnsupportedEncodingException",
"{",
"byte",
"[",
"]",
"t",
"=",
"text",
".",
"getBytes",
"(",
"\"iso-8859-1\"",
")",
";",
"return",
"generate",
"(",
"t",
",",
"0",
",",
"t",
".",
"length... | Creates a barcode. The <CODE>String</CODE> is interpreted with the ISO-8859-1 encoding
@param text the text
@return the status of the generation. It can be one of this values:
<p>
<CODE>DM_NO_ERROR</CODE> - no error.<br>
<CODE>DM_ERROR_TEXT_TOO_BIG</CODE> - the text is too big for the symbology capabilities.<br>
<CODE>... | [
"Creates",
"a",
"barcode",
".",
"The",
"<CODE",
">",
"String<",
"/",
"CODE",
">",
"is",
"interpreted",
"with",
"the",
"ISO",
"-",
"8859",
"-",
"1",
"encoding"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/BarcodeDatamatrix.java#L686-L689 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.