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 |
|---|---|---|---|---|---|---|---|---|---|---|
amzn/ion-java | src/com/amazon/ion/Timestamp.java | Timestamp.addHour | public final Timestamp addHour(int amount) {
"""
Returns a timestamp relative to this one by the given number of hours.
<p>
This method always returns a Timestamp with at least MINUTE precision.
For example, adding one hour to {@code 2011T} results in
{@code 2011-01-01T01:00-00:00}. To receive a Timestamp that... | java | public final Timestamp addHour(int amount)
{
long delta = (long) amount * 60 * 60 * 1000;
return addMillisForPrecision(delta, Precision.MINUTE, false);
} | [
"public",
"final",
"Timestamp",
"addHour",
"(",
"int",
"amount",
")",
"{",
"long",
"delta",
"=",
"(",
"long",
")",
"amount",
"*",
"60",
"*",
"60",
"*",
"1000",
";",
"return",
"addMillisForPrecision",
"(",
"delta",
",",
"Precision",
".",
"MINUTE",
",",
... | Returns a timestamp relative to this one by the given number of hours.
<p>
This method always returns a Timestamp with at least MINUTE precision.
For example, adding one hour to {@code 2011T} results in
{@code 2011-01-01T01:00-00:00}. To receive a Timestamp that always
maintains the same precision as the original, use ... | [
"Returns",
"a",
"timestamp",
"relative",
"to",
"this",
"one",
"by",
"the",
"given",
"number",
"of",
"hours",
".",
"<p",
">",
"This",
"method",
"always",
"returns",
"a",
"Timestamp",
"with",
"at",
"least",
"MINUTE",
"precision",
".",
"For",
"example",
"addi... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/Timestamp.java#L2415-L2419 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/utils/BeanAccessor.java | BeanAccessor.walkFields | private static void walkFields(final Class<?> cls, final Map<String, Field> fieldMap) {
"""
指定したクラスの持つ全てのフィールドを再帰的に探索して取得する
@param cls 型
@param fieldMap {@literal Map<String, Field>j}
"""
if (cls.equals(Object.class)) {
return;
}
Class<?> superClass = cls.getSuperclass();
walkFields(superClass, ... | java | private static void walkFields(final Class<?> cls, final Map<String, Field> fieldMap) {
if (cls.equals(Object.class)) {
return;
}
Class<?> superClass = cls.getSuperclass();
walkFields(superClass, fieldMap);
Arrays.stream(cls.getDeclaredFields())
.filter(f -> !Modifier.isStatic(f.getModifiers()))
.f... | [
"private",
"static",
"void",
"walkFields",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"Map",
"<",
"String",
",",
"Field",
">",
"fieldMap",
")",
"{",
"if",
"(",
"cls",
".",
"equals",
"(",
"Object",
".",
"class",
")",
")",
"{",
"retur... | 指定したクラスの持つ全てのフィールドを再帰的に探索して取得する
@param cls 型
@param fieldMap {@literal Map<String, Field>j} | [
"指定したクラスの持つ全てのフィールドを再帰的に探索して取得する"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/utils/BeanAccessor.java#L103-L112 |
RestComm/jss7 | m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/M3UARouteManagement.java | M3UARouteManagement.removeRoute | protected void removeRoute(int dpc, int opc, int si, String asName) throws Exception {
"""
Removes the {@link AsImpl} from key (combination of DPC:OPC:Si)
@param dpc
@param opc
@param si
@param asName
@throws Exception If no As found, or this As is not serving this key
"""
AsImpl asImpl = null;
... | java | protected void removeRoute(int dpc, int opc, int si, String asName) throws Exception {
AsImpl asImpl = null;
for (FastList.Node<As> n = this.m3uaManagement.appServers.head(), end = this.m3uaManagement.appServers.tail(); (n = n
.getNext()) != end;) {
if (n.getValue().getName()... | [
"protected",
"void",
"removeRoute",
"(",
"int",
"dpc",
",",
"int",
"opc",
",",
"int",
"si",
",",
"String",
"asName",
")",
"throws",
"Exception",
"{",
"AsImpl",
"asImpl",
"=",
"null",
";",
"for",
"(",
"FastList",
".",
"Node",
"<",
"As",
">",
"n",
"=",... | Removes the {@link AsImpl} from key (combination of DPC:OPC:Si)
@param dpc
@param opc
@param si
@param asName
@throws Exception If no As found, or this As is not serving this key | [
"Removes",
"the",
"{",
"@link",
"AsImpl",
"}",
"from",
"key",
"(",
"combination",
"of",
"DPC",
":",
"OPC",
":",
"Si",
")"
] | train | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/M3UARouteManagement.java#L233-L265 |
rhiot/rhiot | gateway/components/camel-gpsd/src/main/java/io/rhiot/component/gpsd/GpsdHelper.java | GpsdHelper.consumeTPVObject | public static void consumeTPVObject(TPVObject tpv, Processor processor, GpsdEndpoint endpoint, ExceptionHandler exceptionHandler) {
"""
Process the TPVObject, all params required.
@param tpv The time-position-velocity object to process
@param processor Processor that handles the exchange.
@param endpoint Gpsd... | java | public static void consumeTPVObject(TPVObject tpv, Processor processor, GpsdEndpoint endpoint, ExceptionHandler exceptionHandler) {
// Simplify logging when https://github.com/taimos/GPSd4Java/pull/19 is merged into upstream.
LOG.debug("About to consume TPV object {},{} from {}", tpv.getLatitude(), tpv.... | [
"public",
"static",
"void",
"consumeTPVObject",
"(",
"TPVObject",
"tpv",
",",
"Processor",
"processor",
",",
"GpsdEndpoint",
"endpoint",
",",
"ExceptionHandler",
"exceptionHandler",
")",
"{",
"// Simplify logging when https://github.com/taimos/GPSd4Java/pull/19 is merged into ups... | Process the TPVObject, all params required.
@param tpv The time-position-velocity object to process
@param processor Processor that handles the exchange.
@param endpoint GpsdEndpoint receiving the exchange. | [
"Process",
"the",
"TPVObject",
"all",
"params",
"required",
"."
] | train | https://github.com/rhiot/rhiot/blob/82eac10e365f72bab9248b8c3bd0ec9a2fc0a721/gateway/components/camel-gpsd/src/main/java/io/rhiot/component/gpsd/GpsdHelper.java#L49-L66 |
fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.ensureValidACLAuthorization | private void ensureValidACLAuthorization(final FedoraResource resource, final Model inputModel) {
"""
This method does two things:
- Throws an exception if an authorization has both accessTo and accessToClass
- Adds a default accessTo target if an authorization has neither accessTo nor accessToClass
@param re... | java | private void ensureValidACLAuthorization(final FedoraResource resource, final Model inputModel) {
if (resource.isAcl()) {
final Set<Node> uniqueAuthSubjects = new HashSet<>();
inputModel.listStatements().forEachRemaining((final Statement s) -> {
LOGGER.debug("statement: s... | [
"private",
"void",
"ensureValidACLAuthorization",
"(",
"final",
"FedoraResource",
"resource",
",",
"final",
"Model",
"inputModel",
")",
"{",
"if",
"(",
"resource",
".",
"isAcl",
"(",
")",
")",
"{",
"final",
"Set",
"<",
"Node",
">",
"uniqueAuthSubjects",
"=",
... | This method does two things:
- Throws an exception if an authorization has both accessTo and accessToClass
- Adds a default accessTo target if an authorization has neither accessTo nor accessToClass
@param resource the fedora resource
@param inputModel to be checked and updated | [
"This",
"method",
"does",
"two",
"things",
":",
"-",
"Throws",
"an",
"exception",
"if",
"an",
"authorization",
"has",
"both",
"accessTo",
"and",
"accessToClass",
"-",
"Adds",
"a",
"default",
"accessTo",
"target",
"if",
"an",
"authorization",
"has",
"neither",
... | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L1033-L1059 |
zaproxy/zaproxy | src/org/parosproxy/paros/core/scanner/VariantCustom.java | VariantCustom.addParam | public void addParam(String name, String value, int type) {
"""
Support method to add a new param to this custom variant
@param name the param name
@param value the value of this parameter
@param type the type of this parameter
"""
// Current size usually is equal to the position
params.ad... | java | public void addParam(String name, String value, int type) {
// Current size usually is equal to the position
params.add(new NameValuePair(type, name, value, params.size()));
} | [
"public",
"void",
"addParam",
"(",
"String",
"name",
",",
"String",
"value",
",",
"int",
"type",
")",
"{",
"// Current size usually is equal to the position\r",
"params",
".",
"add",
"(",
"new",
"NameValuePair",
"(",
"type",
",",
"name",
",",
"value",
",",
"pa... | Support method to add a new param to this custom variant
@param name the param name
@param value the value of this parameter
@param type the type of this parameter | [
"Support",
"method",
"to",
"add",
"a",
"new",
"param",
"to",
"this",
"custom",
"variant"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/VariantCustom.java#L142-L145 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.eye | public SDVariable eye(String name, int rows, int cols, DataType dataType, int... batchDimension) {
"""
Generate an identity matrix with the specified number of rows and columns, with optional leading dims<br>
Example:<br>
batchShape: [3,3]<br>
numRows: 2<br>
numCols: 4<br>
returns a tensor of shape (3, 3, 2, ... | java | public SDVariable eye(String name, int rows, int cols, DataType dataType, int... batchDimension) {
SDVariable eye = new Eye(sd, rows, cols, dataType, batchDimension).outputVariables()[0];
return updateVariableNameAndReference(eye, name);
} | [
"public",
"SDVariable",
"eye",
"(",
"String",
"name",
",",
"int",
"rows",
",",
"int",
"cols",
",",
"DataType",
"dataType",
",",
"int",
"...",
"batchDimension",
")",
"{",
"SDVariable",
"eye",
"=",
"new",
"Eye",
"(",
"sd",
",",
"rows",
",",
"cols",
",",
... | Generate an identity matrix with the specified number of rows and columns, with optional leading dims<br>
Example:<br>
batchShape: [3,3]<br>
numRows: 2<br>
numCols: 4<br>
returns a tensor of shape (3, 3, 2, 4) that consists of 3 * 3 batches of (2,4)-shaped identity matrices:<br>
1 0 0 0<br>
0 1 0 0<br>
@param rows ... | [
"Generate",
"an",
"identity",
"matrix",
"with",
"the",
"specified",
"number",
"of",
"rows",
"and",
"columns",
"with",
"optional",
"leading",
"dims<br",
">",
"Example",
":",
"<br",
">",
"batchShape",
":",
"[",
"3",
"3",
"]",
"<br",
">",
"numRows",
":",
"2... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L1043-L1046 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/TimeZone.java | TimeZone.getCustomTimeZone | private static TimeZone getCustomTimeZone(String id) {
"""
Returns a new SimpleTimeZone for an ID of the form "GMT[+|-]hh[[:]mm]", or null.
"""
Matcher m = NoImagePreloadHolder.CUSTOM_ZONE_ID_PATTERN.matcher(id);
if (!m.matches()) {
return null;
}
int hour;
... | java | private static TimeZone getCustomTimeZone(String id) {
Matcher m = NoImagePreloadHolder.CUSTOM_ZONE_ID_PATTERN.matcher(id);
if (!m.matches()) {
return null;
}
int hour;
int minute = 0;
try {
hour = Integer.parseInt(m.group(1));
if (m.g... | [
"private",
"static",
"TimeZone",
"getCustomTimeZone",
"(",
"String",
"id",
")",
"{",
"Matcher",
"m",
"=",
"NoImagePreloadHolder",
".",
"CUSTOM_ZONE_ID_PATTERN",
".",
"matcher",
"(",
"id",
")",
";",
"if",
"(",
"!",
"m",
".",
"matches",
"(",
")",
")",
"{",
... | Returns a new SimpleTimeZone for an ID of the form "GMT[+|-]hh[[:]mm]", or null. | [
"Returns",
"a",
"new",
"SimpleTimeZone",
"for",
"an",
"ID",
"of",
"the",
"form",
"GMT",
"[",
"+",
"|",
"-",
"]",
"hh",
"[[",
":",
"]",
"mm",
"]",
"or",
"null",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/TimeZone.java#L578-L608 |
legsem/legstar.avro | legstar.avro.cob2avro/src/main/java/com/legstar/avro/cob2avro/io/ZosVarRdwDatumReader.java | ZosVarRdwDatumReader.getRawRdw | public static int getRawRdw(byte[] hostData, int start, int length) {
"""
RDW is a 4 bytes numeric where the first 2 bytes are the length of the
record (LL) including the 4 byte RDW.
@param hostData the mainframe data
@param start where the RDW starts
@param length the total size of the mainframe data
@retu... | java | public static int getRawRdw(byte[] hostData, int start, int length) {
if (length - start < RDW_LEN) {
throw new IllegalArgumentException("Not enough bytes for an RDW");
}
ByteBuffer buf = ByteBuffer.allocate(RDW_LEN);
buf.put(0, (byte) 0);
buf.put(1, (byte) 0);
... | [
"public",
"static",
"int",
"getRawRdw",
"(",
"byte",
"[",
"]",
"hostData",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"-",
"start",
"<",
"RDW_LEN",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Not enough byte... | RDW is a 4 bytes numeric where the first 2 bytes are the length of the
record (LL) including the 4 byte RDW.
@param hostData the mainframe data
@param start where the RDW starts
@param length the total size of the mainframe data
@return the integer content of the RDW | [
"RDW",
"is",
"a",
"4",
"bytes",
"numeric",
"where",
"the",
"first",
"2",
"bytes",
"are",
"the",
"length",
"of",
"the",
"record",
"(",
"LL",
")",
"including",
"the",
"4",
"byte",
"RDW",
"."
] | train | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.cob2avro/src/main/java/com/legstar/avro/cob2avro/io/ZosVarRdwDatumReader.java#L116-L127 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/tools/Hasher.java | Hasher.computeHash | public static byte[] computeHash(File file, MessageDigest digest,
long from, long until) throws IOException {
"""
Computes the hash value for the file bytes from offset <code>from</code>
until offset <code>until</code>, using the hash instance as defined by
the hash type.
@param file
the file to ... | java | public static byte[] computeHash(File file, MessageDigest digest,
long from, long until) throws IOException {
Preconditions.checkArgument(from >= 0, "negative offset");
Preconditions.checkArgument(until > from, "end offset is smaller or equal to start offset");
Preconditions.checkArg... | [
"public",
"static",
"byte",
"[",
"]",
"computeHash",
"(",
"File",
"file",
",",
"MessageDigest",
"digest",
",",
"long",
"from",
",",
"long",
"until",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"from",
">=",
"0",
",",
"\"n... | Computes the hash value for the file bytes from offset <code>from</code>
until offset <code>until</code>, using the hash instance as defined by
the hash type.
@param file
the file to compute the hash from
@param digest
the message digest instance
@param from
file offset to start from
@param until
file offset for the e... | [
"Computes",
"the",
"hash",
"value",
"for",
"the",
"file",
"bytes",
"from",
"offset",
"<code",
">",
"from<",
"/",
"code",
">",
"until",
"offset",
"<code",
">",
"until<",
"/",
"code",
">",
"using",
"the",
"hash",
"instance",
"as",
"defined",
"by",
"the",
... | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/tools/Hasher.java#L147-L166 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSMessageImpl.java | JSMessageImpl.getAssembledContent | public DataSlice getAssembledContent() {
"""
Locking: Requires the lock as it relies on, and may change, vital instance variable(s).
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "getAssembledContent");
DataSlice result = null;
// lock the message - we... | java | public DataSlice getAssembledContent() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "getAssembledContent");
DataSlice result = null;
// lock the message - we don't want someone clearing the contents while we're doing this
synchronized (getMessageLockArtefact... | [
"public",
"DataSlice",
"getAssembledContent",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"JmfTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getAssembledContent\"",
"... | Locking: Requires the lock as it relies on, and may change, vital instance variable(s). | [
"Locking",
":",
"Requires",
"the",
"lock",
"as",
"it",
"relies",
"on",
"and",
"may",
"change",
"vital",
"instance",
"variable",
"(",
"s",
")",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSMessageImpl.java#L1564-L1583 |
vincentk/joptimizer | src/main/java/com/joptimizer/optimizers/LPPrimalDualMethod.java | LPPrimalDualMethod.gradSum | protected DoubleMatrix1D gradSum(double t, DoubleMatrix1D fiX) {
"""
Calculates the second term of the first row of (11.55) "Convex Optimization".
@see "Convex Optimization, 11.55"
"""
DoubleMatrix1D gradSum = F1.make(getDim());
for(int i=0; i<dim; i++){
double d = 0;
d += 1. / (t * fiX.getQuic... | java | protected DoubleMatrix1D gradSum(double t, DoubleMatrix1D fiX) {
DoubleMatrix1D gradSum = F1.make(getDim());
for(int i=0; i<dim; i++){
double d = 0;
d += 1. / (t * fiX.getQuick(i));
d += -1. / (t * fiX.getQuick(getDim() + i));
gradSum.setQuick(i, d);
}
return gradSum;
} | [
"protected",
"DoubleMatrix1D",
"gradSum",
"(",
"double",
"t",
",",
"DoubleMatrix1D",
"fiX",
")",
"{",
"DoubleMatrix1D",
"gradSum",
"=",
"F1",
".",
"make",
"(",
"getDim",
"(",
")",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"dim",
";",... | Calculates the second term of the first row of (11.55) "Convex Optimization".
@see "Convex Optimization, 11.55" | [
"Calculates",
"the",
"second",
"term",
"of",
"the",
"first",
"row",
"of",
"(",
"11",
".",
"55",
")",
"Convex",
"Optimization",
"."
] | train | https://github.com/vincentk/joptimizer/blob/65064c1bb0b26c7261358021e4c93d06dd43564f/src/main/java/com/joptimizer/optimizers/LPPrimalDualMethod.java#L718-L727 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/BoundingBox.java | BoundingBox.fromCoordinates | @Deprecated
public static BoundingBox fromCoordinates(
@FloatRange(from = MIN_LONGITUDE, to = GeoJsonConstants.MAX_LONGITUDE) double west,
@FloatRange(from = MIN_LATITUDE, to = GeoJsonConstants.MAX_LATITUDE) double south,
@FloatRange(from = MIN_LONGITUDE, to = GeoJsonConstants.MAX_LONGITUDE) double east,
... | java | @Deprecated
public static BoundingBox fromCoordinates(
@FloatRange(from = MIN_LONGITUDE, to = GeoJsonConstants.MAX_LONGITUDE) double west,
@FloatRange(from = MIN_LATITUDE, to = GeoJsonConstants.MAX_LATITUDE) double south,
@FloatRange(from = MIN_LONGITUDE, to = GeoJsonConstants.MAX_LONGITUDE) double east,
... | [
"@",
"Deprecated",
"public",
"static",
"BoundingBox",
"fromCoordinates",
"(",
"@",
"FloatRange",
"(",
"from",
"=",
"MIN_LONGITUDE",
",",
"to",
"=",
"GeoJsonConstants",
".",
"MAX_LONGITUDE",
")",
"double",
"west",
",",
"@",
"FloatRange",
"(",
"from",
"=",
"MIN_... | Define a new instance of this class by passing in four coordinates in the same order they would
appear in the serialized GeoJson form. Limits are placed on the minimum and maximum coordinate
values which can exist and comply with the GeoJson spec.
@param west the left side of the bounding box when the map is facing d... | [
"Define",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"passing",
"in",
"four",
"coordinates",
"in",
"the",
"same",
"order",
"they",
"would",
"appear",
"in",
"the",
"serialized",
"GeoJson",
"form",
".",
"Limits",
"are",
"placed",
"on",
"the",
"mini... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/BoundingBox.java#L83-L90 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java | ParagraphVectors.similarityToLabel | public double similarityToLabel(LabelledDocument document, String label) {
"""
This method returns similarity of the document to specific label, based on mean value
@param document
@param label
@return
"""
if (document.getReferencedContent() != null) {
return similarityToLabel(document... | java | public double similarityToLabel(LabelledDocument document, String label) {
if (document.getReferencedContent() != null) {
return similarityToLabel(document.getReferencedContent(), label);
} else
return similarityToLabel(document.getContent(), label);
} | [
"public",
"double",
"similarityToLabel",
"(",
"LabelledDocument",
"document",
",",
"String",
"label",
")",
"{",
"if",
"(",
"document",
".",
"getReferencedContent",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"similarityToLabel",
"(",
"document",
".",
"getReferen... | This method returns similarity of the document to specific label, based on mean value
@param document
@param label
@return | [
"This",
"method",
"returns",
"similarity",
"of",
"the",
"document",
"to",
"specific",
"label",
"based",
"on",
"mean",
"value"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L681-L686 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/Swagger2MarkupConverter.java | Swagger2MarkupConverter.from | public static Builder from(Path swaggerPath) {
"""
Creates a Swagger2MarkupConverter.Builder using a local Path.
@param swaggerPath the local Path
@return a Swagger2MarkupConverter
"""
Validate.notNull(swaggerPath, "swaggerPath must not be null");
if (Files.notExists(swaggerPath)) {
... | java | public static Builder from(Path swaggerPath) {
Validate.notNull(swaggerPath, "swaggerPath must not be null");
if (Files.notExists(swaggerPath)) {
throw new IllegalArgumentException(String.format("swaggerPath does not exist: %s", swaggerPath));
}
try {
if (Files.is... | [
"public",
"static",
"Builder",
"from",
"(",
"Path",
"swaggerPath",
")",
"{",
"Validate",
".",
"notNull",
"(",
"swaggerPath",
",",
"\"swaggerPath must not be null\"",
")",
";",
"if",
"(",
"Files",
".",
"notExists",
"(",
"swaggerPath",
")",
")",
"{",
"throw",
... | Creates a Swagger2MarkupConverter.Builder using a local Path.
@param swaggerPath the local Path
@return a Swagger2MarkupConverter | [
"Creates",
"a",
"Swagger2MarkupConverter",
".",
"Builder",
"using",
"a",
"local",
"Path",
"."
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/Swagger2MarkupConverter.java#L104-L117 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata2/model/curves/DiscountCurveInterpolation.java | DiscountCurveInterpolation.createDiscountCurveFromMonteCarloLiborModel | public static DiscountCurveInterface createDiscountCurveFromMonteCarloLiborModel(String forwardCurveName, LIBORModelMonteCarloSimulationModel model, double startTime) throws CalculationException {
"""
Create a discount curve from forwards given by a LIBORMonteCarloModel. If the model uses multiple curves, return ... | java | public static DiscountCurveInterface createDiscountCurveFromMonteCarloLiborModel(String forwardCurveName, LIBORModelMonteCarloSimulationModel model, double startTime) throws CalculationException{
// Check if the LMM uses a discount curve which is created from a forward curve
if(model.getModel().getDiscountCurve()=... | [
"public",
"static",
"DiscountCurveInterface",
"createDiscountCurveFromMonteCarloLiborModel",
"(",
"String",
"forwardCurveName",
",",
"LIBORModelMonteCarloSimulationModel",
"model",
",",
"double",
"startTime",
")",
"throws",
"CalculationException",
"{",
"// Check if the LMM uses a d... | Create a discount curve from forwards given by a LIBORMonteCarloModel. If the model uses multiple curves, return its discount curve.
@param forwardCurveName name of the forward curve.
@param model Monte Carlo model providing the forwards.
@param startTime time at which the curve starts... | [
"Create",
"a",
"discount",
"curve",
"from",
"forwards",
"given",
"by",
"a",
"LIBORMonteCarloModel",
".",
"If",
"the",
"model",
"uses",
"multiple",
"curves",
"return",
"its",
"discount",
"curve",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata2/model/curves/DiscountCurveInterpolation.java#L401-L412 |
dkmfbk/knowledgestore | ks-server/src/main/java/eu/fbk/knowledgestore/triplestore/SelectQuery.java | SelectQuery.replaceDataset | public SelectQuery replaceDataset(@Nullable final Dataset dataset) {
"""
Replaces the dataset of this query with the one specified, returning the resulting
<tt>SelectQuery</tt> object.
@param dataset
the new dataset; as usual, <tt>null</tt> denotes the default dataset (all the
graphs)
@return the resulting ... | java | public SelectQuery replaceDataset(@Nullable final Dataset dataset) {
if (Objects.equal(this.dataset, dataset)) {
return this;
} else {
try {
return from(this.expression, dataset);
} catch (final ParseException ex) {
throw new Error("Une... | [
"public",
"SelectQuery",
"replaceDataset",
"(",
"@",
"Nullable",
"final",
"Dataset",
"dataset",
")",
"{",
"if",
"(",
"Objects",
".",
"equal",
"(",
"this",
".",
"dataset",
",",
"dataset",
")",
")",
"{",
"return",
"this",
";",
"}",
"else",
"{",
"try",
"{... | Replaces the dataset of this query with the one specified, returning the resulting
<tt>SelectQuery</tt> object.
@param dataset
the new dataset; as usual, <tt>null</tt> denotes the default dataset (all the
graphs)
@return the resulting <tt>SelectQuery</tt> object (possibly <tt>this</tt> if no change is
required) | [
"Replaces",
"the",
"dataset",
"of",
"this",
"query",
"with",
"the",
"one",
"specified",
"returning",
"the",
"resulting",
"<tt",
">",
"SelectQuery<",
"/",
"tt",
">",
"object",
"."
] | train | https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-server/src/main/java/eu/fbk/knowledgestore/triplestore/SelectQuery.java#L199-L210 |
alkacon/opencms-core | src/org/opencms/relations/CmsLinkUpdateUtil.java | CmsLinkUpdateUtil.updateNode | private static void updateNode(Element parent, String nodeName, String value, boolean cdata) {
"""
Updates the given xml node with the given value.<p>
@param parent the parent node
@param nodeName the node to update
@param value the value to use to update the given node, can be <code>null</code>
@param cdata... | java | private static void updateNode(Element parent, String nodeName, String value, boolean cdata) {
// get current node element
Element nodeElement = parent.element(nodeName);
if (value != null) {
if (nodeElement == null) {
// element wasn't there before, add element and ... | [
"private",
"static",
"void",
"updateNode",
"(",
"Element",
"parent",
",",
"String",
"nodeName",
",",
"String",
"value",
",",
"boolean",
"cdata",
")",
"{",
"// get current node element",
"Element",
"nodeElement",
"=",
"parent",
".",
"element",
"(",
"nodeName",
")... | Updates the given xml node with the given value.<p>
@param parent the parent node
@param nodeName the node to update
@param value the value to use to update the given node, can be <code>null</code>
@param cdata if the value should be in a CDATA section or not | [
"Updates",
"the",
"given",
"xml",
"node",
"with",
"the",
"given",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsLinkUpdateUtil.java#L169-L192 |
seedstack/jms-addon | src/main/java/org/seedstack/jms/internal/JmsPlugin.java | JmsPlugin.registerConnection | public void registerConnection(Connection connection, ConnectionDefinition connectionDefinition) {
"""
Register an existing JMS connection to be managed by the JMS plugin.
@param connection the connection.
@param connectionDefinition the connection definition.
"""
checkNotNull(connection)... | java | public void registerConnection(Connection connection, ConnectionDefinition connectionDefinition) {
checkNotNull(connection);
checkNotNull(connectionDefinition);
if (this.connectionDefinitions.putIfAbsent(connectionDefinition.getName(), connectionDefinition) != null) {
throw SeedExce... | [
"public",
"void",
"registerConnection",
"(",
"Connection",
"connection",
",",
"ConnectionDefinition",
"connectionDefinition",
")",
"{",
"checkNotNull",
"(",
"connection",
")",
";",
"checkNotNull",
"(",
"connectionDefinition",
")",
";",
"if",
"(",
"this",
".",
"conne... | Register an existing JMS connection to be managed by the JMS plugin.
@param connection the connection.
@param connectionDefinition the connection definition. | [
"Register",
"an",
"existing",
"JMS",
"connection",
"to",
"be",
"managed",
"by",
"the",
"JMS",
"plugin",
"."
] | train | https://github.com/seedstack/jms-addon/blob/d6014811daaac29f591b32bfd2358500fb25d804/src/main/java/org/seedstack/jms/internal/JmsPlugin.java#L299-L318 |
elki-project/elki | elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/MaterializeKNNAndRKNNPreprocessor.java | MaterializeKNNAndRKNNPreprocessor.affectedRkNN | protected ArrayDBIDs affectedRkNN(List<? extends Collection<DoubleDBIDPair>> extract, DBIDs remove) {
"""
Extracts and removes the DBIDs in the given collections.
@param extract a list of lists of DistanceResultPair to extract
@param remove the ids to remove
@return the DBIDs in the given collection
"""
... | java | protected ArrayDBIDs affectedRkNN(List<? extends Collection<DoubleDBIDPair>> extract, DBIDs remove) {
HashSetModifiableDBIDs ids = DBIDUtil.newHashSet();
for(Collection<DoubleDBIDPair> drps : extract) {
for(DoubleDBIDPair drp : drps) {
ids.add(drp);
}
}
ids.removeDBIDs(remove);
/... | [
"protected",
"ArrayDBIDs",
"affectedRkNN",
"(",
"List",
"<",
"?",
"extends",
"Collection",
"<",
"DoubleDBIDPair",
">",
">",
"extract",
",",
"DBIDs",
"remove",
")",
"{",
"HashSetModifiableDBIDs",
"ids",
"=",
"DBIDUtil",
".",
"newHashSet",
"(",
")",
";",
"for",
... | Extracts and removes the DBIDs in the given collections.
@param extract a list of lists of DistanceResultPair to extract
@param remove the ids to remove
@return the DBIDs in the given collection | [
"Extracts",
"and",
"removes",
"the",
"DBIDs",
"in",
"the",
"given",
"collections",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/MaterializeKNNAndRKNNPreprocessor.java#L307-L317 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/shared/environment/classloading/ThreadContextClassLoaderBuilder.java | ThreadContextClassLoaderBuilder.buildAndSet | public ThreadContextClassLoaderHolder buildAndSet() {
"""
<p>This method performs 2 things in order:</p>
<ol>
<li>Builds a ThreadContext ClassLoader from the URLs supplied to this Builder, and assigns the
newly built ClassLoader to the current Thread.</li>
<li>Stores the ThreadContextClassLoaderHolder for late... | java | public ThreadContextClassLoaderHolder buildAndSet() {
// Create the URLClassLoader from the supplied URLs
final URL[] allURLs = new URL[urlList.size()];
urlList.toArray(allURLs);
final URLClassLoader classLoader = new URLClassLoader(allURLs, originalClassLoader);
// Assign the ... | [
"public",
"ThreadContextClassLoaderHolder",
"buildAndSet",
"(",
")",
"{",
"// Create the URLClassLoader from the supplied URLs",
"final",
"URL",
"[",
"]",
"allURLs",
"=",
"new",
"URL",
"[",
"urlList",
".",
"size",
"(",
")",
"]",
";",
"urlList",
".",
"toArray",
"("... | <p>This method performs 2 things in order:</p>
<ol>
<li>Builds a ThreadContext ClassLoader from the URLs supplied to this Builder, and assigns the
newly built ClassLoader to the current Thread.</li>
<li>Stores the ThreadContextClassLoaderHolder for later restoration.</li>
</ol>
References to the original ThreadContextC... | [
"<p",
">",
"This",
"method",
"performs",
"2",
"things",
"in",
"order",
":",
"<",
"/",
"p",
">",
"<ol",
">",
"<li",
">",
"Builds",
"a",
"ThreadContext",
"ClassLoader",
"from",
"the",
"URLs",
"supplied",
"to",
"this",
"Builder",
"and",
"assigns",
"the",
... | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/environment/classloading/ThreadContextClassLoaderBuilder.java#L207-L240 |
phxql/argon2-jvm | src/main/java/de/mkammerer/argon2/Argon2Helper.java | Argon2Helper.findIterations | public static int findIterations(Argon2 argon2, long maxMillisecs, int memory, int parallelism, IterationLogger logger) {
"""
Finds the number of iterations so that the hash function takes at most the given number of milliseconds.
@param argon2 Argon2 instance.
@param maxMillisecs Maximum number of milli... | java | public static int findIterations(Argon2 argon2, long maxMillisecs, int memory, int parallelism, IterationLogger logger) {
char[] password = "password".toCharArray();
warmup(argon2, password);
long took;
int iterations = 0;
do {
iterations++;
long start =... | [
"public",
"static",
"int",
"findIterations",
"(",
"Argon2",
"argon2",
",",
"long",
"maxMillisecs",
",",
"int",
"memory",
",",
"int",
"parallelism",
",",
"IterationLogger",
"logger",
")",
"{",
"char",
"[",
"]",
"password",
"=",
"\"password\"",
".",
"toCharArray... | Finds the number of iterations so that the hash function takes at most the given number of milliseconds.
@param argon2 Argon2 instance.
@param maxMillisecs Maximum number of milliseconds the hash function must take.
@param memory Memory. See {@link Argon2#hash(int, int, int, char[])}.
@param parallelism P... | [
"Finds",
"the",
"number",
"of",
"iterations",
"so",
"that",
"the",
"hash",
"function",
"takes",
"at",
"most",
"the",
"given",
"number",
"of",
"milliseconds",
"."
] | train | https://github.com/phxql/argon2-jvm/blob/27a13907729e67e98cca53eba279e109b60f04f1/src/main/java/de/mkammerer/argon2/Argon2Helper.java#L57-L75 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/TemplatesApi.java | TemplatesApi.updateDocument | public EnvelopeDocument updateDocument(String accountId, String templateId, String documentId, EnvelopeDefinition envelopeDefinition) throws ApiException {
"""
Adds a document to a template document.
Adds the specified document to an existing template document.
@param accountId The external account number (int) ... | java | public EnvelopeDocument updateDocument(String accountId, String templateId, String documentId, EnvelopeDefinition envelopeDefinition) throws ApiException {
return updateDocument(accountId, templateId, documentId, envelopeDefinition, null);
} | [
"public",
"EnvelopeDocument",
"updateDocument",
"(",
"String",
"accountId",
",",
"String",
"templateId",
",",
"String",
"documentId",
",",
"EnvelopeDefinition",
"envelopeDefinition",
")",
"throws",
"ApiException",
"{",
"return",
"updateDocument",
"(",
"accountId",
",",
... | Adds a document to a template document.
Adds the specified document to an existing template document.
@param accountId The external account number (int) or account ID Guid. (required)
@param templateId The ID of the template being accessed. (required)
@param documentId The ID of the document being accessed. (required)
... | [
"Adds",
"a",
"document",
"to",
"a",
"template",
"document",
".",
"Adds",
"the",
"specified",
"document",
"to",
"an",
"existing",
"template",
"document",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/TemplatesApi.java#L2954-L2956 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Transformation2D.java | Transformation2D.setRotate | public void setRotate(double cosA, double sinA) {
"""
Sets rotation for this transformation.
When the axis Y is directed up and X is directed to the right, the
positive angle corresponds to the anti-clockwise rotation. When the axis
Y is directed down and X is directed to the right, the positive angle
corres... | java | public void setRotate(double cosA, double sinA) {
xx = cosA;
xy = -sinA;
xd = 0;
yx = sinA;
yy = cosA;
yd = 0;
} | [
"public",
"void",
"setRotate",
"(",
"double",
"cosA",
",",
"double",
"sinA",
")",
"{",
"xx",
"=",
"cosA",
";",
"xy",
"=",
"-",
"sinA",
";",
"xd",
"=",
"0",
";",
"yx",
"=",
"sinA",
";",
"yy",
"=",
"cosA",
";",
"yd",
"=",
"0",
";",
"}"
] | Sets rotation for this transformation.
When the axis Y is directed up and X is directed to the right, the
positive angle corresponds to the anti-clockwise rotation. When the axis
Y is directed down and X is directed to the right, the positive angle
corresponds to the clockwise rotation.
@param cosA
The rotation angle... | [
"Sets",
"rotation",
"for",
"this",
"transformation",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Transformation2D.java#L728-L735 |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/proxy/ClientPNCounterProxy.java | ClientPNCounterProxy.invokeAddInternal | private ClientMessage invokeAddInternal(long delta, boolean getBeforeUpdate,
List<Address> excludedAddresses,
HazelcastException lastException,
Address target) {
"""
Adds the {@code d... | java | private ClientMessage invokeAddInternal(long delta, boolean getBeforeUpdate,
List<Address> excludedAddresses,
HazelcastException lastException,
Address target) {
if (target == null... | [
"private",
"ClientMessage",
"invokeAddInternal",
"(",
"long",
"delta",
",",
"boolean",
"getBeforeUpdate",
",",
"List",
"<",
"Address",
">",
"excludedAddresses",
",",
"HazelcastException",
"lastException",
",",
"Address",
"target",
")",
"{",
"if",
"(",
"target",
"=... | Adds the {@code delta} and returns the value of the counter before the
update if {@code getBeforeUpdate} is {@code true} or the value after
the update if it is {@code false}.
It will invoke client messages recursively on viable replica addresses
until successful or the list of viable replicas is exhausted.
Replicas wit... | [
"Adds",
"the",
"{",
"@code",
"delta",
"}",
"and",
"returns",
"the",
"value",
"of",
"the",
"counter",
"before",
"the",
"update",
"if",
"{",
"@code",
"getBeforeUpdate",
"}",
"is",
"{",
"@code",
"true",
"}",
"or",
"the",
"value",
"after",
"the",
"update",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/proxy/ClientPNCounterProxy.java#L245-L269 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/CompareFixture.java | CompareFixture.countDifferencesBetweenIgnoreWhitespaceAnd | public int countDifferencesBetweenIgnoreWhitespaceAnd(String first, String second) {
"""
Determines number of differences (substrings that are not equal) between two strings,
ignoring differences in whitespace.
@param first first string to compare.
@param second second string to compare.
@return number of diff... | java | public int countDifferencesBetweenIgnoreWhitespaceAnd(String first, String second) {
String cleanFirst = allWhitespaceToSingleSpace(first);
String cleanSecond = allWhitespaceToSingleSpace(second);
return countDifferencesBetweenAnd(cleanFirst, cleanSecond);
} | [
"public",
"int",
"countDifferencesBetweenIgnoreWhitespaceAnd",
"(",
"String",
"first",
",",
"String",
"second",
")",
"{",
"String",
"cleanFirst",
"=",
"allWhitespaceToSingleSpace",
"(",
"first",
")",
";",
"String",
"cleanSecond",
"=",
"allWhitespaceToSingleSpace",
"(",
... | Determines number of differences (substrings that are not equal) between two strings,
ignoring differences in whitespace.
@param first first string to compare.
@param second second string to compare.
@return number of different substrings. | [
"Determines",
"number",
"of",
"differences",
"(",
"substrings",
"that",
"are",
"not",
"equal",
")",
"between",
"two",
"strings",
"ignoring",
"differences",
"in",
"whitespace",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/CompareFixture.java#L127-L131 |
ben-manes/caffeine | jcache/src/main/java/com/github/benmanes/caffeine/jcache/CacheProxy.java | CacheProxy.writeAllToCacheWriter | private @Nullable CacheWriterException writeAllToCacheWriter(Map<? extends K, ? extends V> map) {
"""
Writes all of the entries to the cache writer if write-through is enabled.
"""
if (!configuration.isWriteThrough() || map.isEmpty()) {
return null;
}
List<Cache.Entry<? extends K, ? extends V... | java | private @Nullable CacheWriterException writeAllToCacheWriter(Map<? extends K, ? extends V> map) {
if (!configuration.isWriteThrough() || map.isEmpty()) {
return null;
}
List<Cache.Entry<? extends K, ? extends V>> entries = map.entrySet().stream()
.map(entry -> new EntryProxy<>(entry.getKey(), ... | [
"private",
"@",
"Nullable",
"CacheWriterException",
"writeAllToCacheWriter",
"(",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"map",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"isWriteThrough",
"(",
")",
"||",
"map",
".",
"isEmpty"... | Writes all of the entries to the cache writer if write-through is enabled. | [
"Writes",
"all",
"of",
"the",
"entries",
"to",
"the",
"cache",
"writer",
"if",
"write",
"-",
"through",
"is",
"enabled",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/jcache/src/main/java/com/github/benmanes/caffeine/jcache/CacheProxy.java#L1008-L1029 |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/DeterminismHash.java | DeterminismHash.offerStatement | public void offerStatement(int stmtHash, int offset, ByteBuffer psetBuffer) {
"""
Update the overall hash. Add a pair of ints to the array
if the size isn't too large.
"""
m_inputCRC.update(stmtHash);
m_inputCRC.updateFromPosition(offset, psetBuffer);
if (m_hashCount < MAX_HASHES_COUN... | java | public void offerStatement(int stmtHash, int offset, ByteBuffer psetBuffer) {
m_inputCRC.update(stmtHash);
m_inputCRC.updateFromPosition(offset, psetBuffer);
if (m_hashCount < MAX_HASHES_COUNT) {
m_hashes[m_hashCount] = stmtHash;
m_hashes[m_hashCount + 1] = (int) m_input... | [
"public",
"void",
"offerStatement",
"(",
"int",
"stmtHash",
",",
"int",
"offset",
",",
"ByteBuffer",
"psetBuffer",
")",
"{",
"m_inputCRC",
".",
"update",
"(",
"stmtHash",
")",
";",
"m_inputCRC",
".",
"updateFromPosition",
"(",
"offset",
",",
"psetBuffer",
")",... | Update the overall hash. Add a pair of ints to the array
if the size isn't too large. | [
"Update",
"the",
"overall",
"hash",
".",
"Add",
"a",
"pair",
"of",
"ints",
"to",
"the",
"array",
"if",
"the",
"size",
"isn",
"t",
"too",
"large",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/DeterminismHash.java#L96-L105 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java | BasePrefetcher.buildPrefetchCriteriaSingleKey | private Criteria buildPrefetchCriteriaSingleKey(Collection ids, FieldDescriptor field) {
"""
Build the Criteria using IN(...) for single keys
@param ids collection of identities
@param field
@return Criteria
"""
Criteria crit = new Criteria();
ArrayList values = new ArrayList(ids.size());
... | java | private Criteria buildPrefetchCriteriaSingleKey(Collection ids, FieldDescriptor field)
{
Criteria crit = new Criteria();
ArrayList values = new ArrayList(ids.size());
Iterator iter = ids.iterator();
Identity id;
while (iter.hasNext())
{
id = (Ide... | [
"private",
"Criteria",
"buildPrefetchCriteriaSingleKey",
"(",
"Collection",
"ids",
",",
"FieldDescriptor",
"field",
")",
"{",
"Criteria",
"crit",
"=",
"new",
"Criteria",
"(",
")",
";",
"ArrayList",
"values",
"=",
"new",
"ArrayList",
"(",
"ids",
".",
"size",
"(... | Build the Criteria using IN(...) for single keys
@param ids collection of identities
@param field
@return Criteria | [
"Build",
"the",
"Criteria",
"using",
"IN",
"(",
"...",
")",
"for",
"single",
"keys"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java#L168-L195 |
lessthanoptimal/ddogleg | src/org/ddogleg/nn/alg/searches/KdTreeSearchNStandard.java | KdTreeSearchNStandard.findNeighbor | @Override
public void findNeighbor(P target, int searchN, FastQueue<KdTreeResult> results) {
"""
Finds the nodes which are closest to 'target' and within range of the maximum distance.
@param target A point
@param searchN Number of nearest-neighbors it will search for
@param results Storage for the found nei... | java | @Override
public void findNeighbor(P target, int searchN, FastQueue<KdTreeResult> results) {
if( searchN <= 0 )
throw new IllegalArgumentException("I'm sorry, but I refuse to search for less than or equal to 0 neighbors.");
if( tree.root == null )
return;
this.searchN = searchN;
this.target = target;
... | [
"@",
"Override",
"public",
"void",
"findNeighbor",
"(",
"P",
"target",
",",
"int",
"searchN",
",",
"FastQueue",
"<",
"KdTreeResult",
">",
"results",
")",
"{",
"if",
"(",
"searchN",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"I'm sorry... | Finds the nodes which are closest to 'target' and within range of the maximum distance.
@param target A point
@param searchN Number of nearest-neighbors it will search for
@param results Storage for the found neighbors | [
"Finds",
"the",
"nodes",
"which",
"are",
"closest",
"to",
"target",
"and",
"within",
"range",
"of",
"the",
"maximum",
"distance",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/nn/alg/searches/KdTreeSearchNStandard.java#L79-L92 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java | Strs.after | public static Betner after(String target, String separator) {
"""
Returns a {@code String} between matcher that matches any character in the given left and ending
@param target
@param separator
@return
"""
return betn(target).after(separator);
} | java | public static Betner after(String target, String separator) {
return betn(target).after(separator);
} | [
"public",
"static",
"Betner",
"after",
"(",
"String",
"target",
",",
"String",
"separator",
")",
"{",
"return",
"betn",
"(",
"target",
")",
".",
"after",
"(",
"separator",
")",
";",
"}"
] | Returns a {@code String} between matcher that matches any character in the given left and ending
@param target
@param separator
@return | [
"Returns",
"a",
"{",
"@code",
"String",
"}",
"between",
"matcher",
"that",
"matches",
"any",
"character",
"in",
"the",
"given",
"left",
"and",
"ending"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java#L466-L468 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/tx/recovery/RecoveryMgr.java | RecoveryMgr.logSetVal | public LogSeqNum logSetVal(Buffer buff, int offset, Constant newVal) {
"""
Writes a set value record to the log.
@param buff
the buffer containing the page
@param offset
the offset of the value in the page
@param newVal
the value to be written
@return the LSN of the log record, or -1 if updates to tempora... | java | public LogSeqNum logSetVal(Buffer buff, int offset, Constant newVal) {
if (enableLogging) {
BlockId blk = buff.block();
if (isTempBlock(blk))
return null;
return new SetValueRecord(txNum, blk, offset, buff.getVal(offset, newVal.getType()), newVal).writeToLog();
} else
return null;
} | [
"public",
"LogSeqNum",
"logSetVal",
"(",
"Buffer",
"buff",
",",
"int",
"offset",
",",
"Constant",
"newVal",
")",
"{",
"if",
"(",
"enableLogging",
")",
"{",
"BlockId",
"blk",
"=",
"buff",
".",
"block",
"(",
")",
";",
"if",
"(",
"isTempBlock",
"(",
"blk"... | Writes a set value record to the log.
@param buff
the buffer containing the page
@param offset
the offset of the value in the page
@param newVal
the value to be written
@return the LSN of the log record, or -1 if updates to temporary files | [
"Writes",
"a",
"set",
"value",
"record",
"to",
"the",
"log",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/tx/recovery/RecoveryMgr.java#L142-L150 |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRVerify.java | LRVerify.VerifyStrings | public static boolean VerifyStrings(String signature, String message, String publicKey) throws LRException {
"""
Converts input strings to input streams for the main verify function
@param signature String of the signature
@param message String of the message
@param publicKey String of the public key
@return... | java | public static boolean VerifyStrings(String signature, String message, String publicKey) throws LRException
{
// Check that none of the inputs are null
if (signature == null || message == null || publicKey == null)
{
throw new LRException(LRException.NULL_FIELD);
}
// Convert all inputs into input stream... | [
"public",
"static",
"boolean",
"VerifyStrings",
"(",
"String",
"signature",
",",
"String",
"message",
",",
"String",
"publicKey",
")",
"throws",
"LRException",
"{",
"// Check that none of the inputs are null",
"if",
"(",
"signature",
"==",
"null",
"||",
"message",
"... | Converts input strings to input streams for the main verify function
@param signature String of the signature
@param message String of the message
@param publicKey String of the public key
@return true if signing is verified, false if not
@throws LRException NULL_FIELD if any field is null, INPUT_STREAM_FAILED if any ... | [
"Converts",
"input",
"strings",
"to",
"input",
"streams",
"for",
"the",
"main",
"verify",
"function"
] | train | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRVerify.java#L69-L95 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/cache/impl/CacheProxyUtil.java | CacheProxyUtil.validateResults | public static void validateResults(Map<Integer, Object> results) {
"""
Cache clear response validator, loop on results to validate that no exception exists on the result map.
Throws the first exception in the map.
@param results map of {@link CacheClearResponse}.
"""
for (Object result : results.va... | java | public static void validateResults(Map<Integer, Object> results) {
for (Object result : results.values()) {
if (result != null && result instanceof CacheClearResponse) {
Object response = ((CacheClearResponse) result).getResponse();
if (response instanceof Throwable) ... | [
"public",
"static",
"void",
"validateResults",
"(",
"Map",
"<",
"Integer",
",",
"Object",
">",
"results",
")",
"{",
"for",
"(",
"Object",
"result",
":",
"results",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"result",
"!=",
"null",
"&&",
"result",
... | Cache clear response validator, loop on results to validate that no exception exists on the result map.
Throws the first exception in the map.
@param results map of {@link CacheClearResponse}. | [
"Cache",
"clear",
"response",
"validator",
"loop",
"on",
"results",
"to",
"validate",
"that",
"no",
"exception",
"exists",
"on",
"the",
"result",
"map",
".",
"Throws",
"the",
"first",
"exception",
"in",
"the",
"map",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/CacheProxyUtil.java#L52-L61 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendText | public DateTimeFormatterBuilder appendText(DateTimeFieldType fieldType) {
"""
Instructs the printer to emit a field value as text, and the
parser to expect text.
@param fieldType type of field to append
@return this DateTimeFormatterBuilder, for chaining
@throws IllegalArgumentException if field type is nul... | java | public DateTimeFormatterBuilder appendText(DateTimeFieldType fieldType) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
return append0(new TextField(fieldType, false));
} | [
"public",
"DateTimeFormatterBuilder",
"appendText",
"(",
"DateTimeFieldType",
"fieldType",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field type must not be null\"",
")",
";",
"}",
"return",
"append0",... | Instructs the printer to emit a field value as text, and the
parser to expect text.
@param fieldType type of field to append
@return this DateTimeFormatterBuilder, for chaining
@throws IllegalArgumentException if field type is null | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"field",
"value",
"as",
"text",
"and",
"the",
"parser",
"to",
"expect",
"text",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L534-L539 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java | DatabasesInner.listMetricDefinitions | public List<MetricDefinitionInner> listMetricDefinitions(String resourceGroupName, String serverName, String databaseName) {
"""
Returns database metric definitions.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API ... | java | public List<MetricDefinitionInner> listMetricDefinitions(String resourceGroupName, String serverName, String databaseName) {
return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body();
} | [
"public",
"List",
"<",
"MetricDefinitionInner",
">",
"listMetricDefinitions",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"listMetricDefinitionsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Returns database metric definitions.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@throws IllegalArgumentException ... | [
"Returns",
"database",
"metric",
"definitions",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L2388-L2390 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.scaleLocal | public Matrix4f scaleLocal(float x, float y, float z) {
"""
Pre-multiply scaling to this matrix by scaling the base axes by the given x,
y and z factors.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>S * M</code>. So when transforming... | java | public Matrix4f scaleLocal(float x, float y, float z) {
return scaleLocal(x, y, z, thisOrNew());
} | [
"public",
"Matrix4f",
"scaleLocal",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"return",
"scaleLocal",
"(",
"x",
",",
"y",
",",
"z",
",",
"thisOrNew",
"(",
")",
")",
";",
"}"
] | Pre-multiply scaling to this matrix by scaling the base axes by the given x,
y and z factors.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>S * M</code>. So when transforming a
vector <code>v</code> with the new matrix by using <code>S * M * v... | [
"Pre",
"-",
"multiply",
"scaling",
"to",
"this",
"matrix",
"by",
"scaling",
"the",
"base",
"axes",
"by",
"the",
"given",
"x",
"y",
"and",
"z",
"factors",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
"/",
"code",
">",
"is",
"<code",
">",
"this<",
"/",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L4964-L4966 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java | SetResponseHeadersHandler.setHeaderValues | public void setHeaderValues(String name,String[] values) {
"""
Set a multivalued header, every response handled will have
this header set with the provided values.
@param name The String name of the header.
@param values An Array of String values to use as the values for a Header.
"""
_fields.put(... | java | public void setHeaderValues(String name,String[] values)
{
_fields.put(name,Arrays.asList(values));
} | [
"public",
"void",
"setHeaderValues",
"(",
"String",
"name",
",",
"String",
"[",
"]",
"values",
")",
"{",
"_fields",
".",
"put",
"(",
"name",
",",
"Arrays",
".",
"asList",
"(",
"values",
")",
")",
";",
"}"
] | Set a multivalued header, every response handled will have
this header set with the provided values.
@param name The String name of the header.
@param values An Array of String values to use as the values for a Header. | [
"Set",
"a",
"multivalued",
"header",
"every",
"response",
"handled",
"will",
"have",
"this",
"header",
"set",
"with",
"the",
"provided",
"values",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java#L62-L65 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setChar | public static void setChar(MemorySegment[] segments, int offset, char value) {
"""
set char from segments.
@param segments target segments.
@param offset value offset.
"""
if (inFirstSegment(segments, offset, 2)) {
segments[0].putChar(offset, value);
} else {
setCharMultiSegments(segments, offset... | java | public static void setChar(MemorySegment[] segments, int offset, char value) {
if (inFirstSegment(segments, offset, 2)) {
segments[0].putChar(offset, value);
} else {
setCharMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setChar",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"char",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"2",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set char from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"char",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L1002-L1008 |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/nativecode/Bitmaps.java | Bitmaps.copyBitmap | public static void copyBitmap(Bitmap dest, Bitmap src) {
"""
This blits the pixel data from src to dest.
<p>The destination bitmap must have both a height and a width equal to the source. For maximum
speed stride should be equal as well.
<p>Both bitmaps must use the same {@link android.graphics.Bitmap.Config} f... | java | public static void copyBitmap(Bitmap dest, Bitmap src) {
Preconditions.checkArgument(src.getConfig() == dest.getConfig());
Preconditions.checkArgument(dest.isMutable());
Preconditions.checkArgument(dest.getWidth() == src.getWidth());
Preconditions.checkArgument(dest.getHeight() == src.getHeight());
... | [
"public",
"static",
"void",
"copyBitmap",
"(",
"Bitmap",
"dest",
",",
"Bitmap",
"src",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"src",
".",
"getConfig",
"(",
")",
"==",
"dest",
".",
"getConfig",
"(",
")",
")",
";",
"Preconditions",
".",
"che... | This blits the pixel data from src to dest.
<p>The destination bitmap must have both a height and a width equal to the source. For maximum
speed stride should be equal as well.
<p>Both bitmaps must use the same {@link android.graphics.Bitmap.Config} format.
<p>If the src is purgeable, it will be decoded as part of this... | [
"This",
"blits",
"the",
"pixel",
"data",
"from",
"src",
"to",
"dest",
".",
"<p",
">",
"The",
"destination",
"bitmap",
"must",
"have",
"both",
"a",
"height",
"and",
"a",
"width",
"equal",
"to",
"the",
"source",
".",
"For",
"maximum",
"speed",
"stride",
... | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/nativecode/Bitmaps.java#L39-L50 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getUntaggedImagesWithServiceResponseAsync | public Observable<ServiceResponse<List<Image>>> getUntaggedImagesWithServiceResponseAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) {
"""
Get untagged images for a given project iteration.
This API supports batching and range selection. By default it will only return f... | java | public Observable<ServiceResponse<List<Image>>> getUntaggedImagesWithServiceResponseAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"Image",
">",
">",
">",
"getUntaggedImagesWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"GetUntaggedImagesOptionalParameter",
"getUntaggedImagesOptionalParameter",
")",
"{",
"if",
"(",
"projectI... | Get untagged images for a given project iteration.
This API supports batching and range selection. By default it will only return first 50 images matching images.
Use the {take} and {skip} parameters to control how many images to return in a given batch.
@param projectId The project id
@param getUntaggedImagesOptional... | [
"Get",
"untagged",
"images",
"for",
"a",
"given",
"project",
"iteration",
".",
"This",
"API",
"supports",
"batching",
"and",
"range",
"selection",
".",
"By",
"default",
"it",
"will",
"only",
"return",
"first",
"50",
"images",
"matching",
"images",
".",
"Use"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L4833-L4846 |
atbashEE/atbash-config | geronimo-config/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionBean.java | ConfigInjectionBean.getConfigKey | static String getConfigKey(InjectionPoint ip, ConfigProperty configProperty) {
"""
Get the property key to use.
In case the {@link ConfigProperty#name()} is empty we will try to determine the key name from the InjectionPoint.
"""
String key = configProperty.name();
if (key.length() > 0) {
... | java | static String getConfigKey(InjectionPoint ip, ConfigProperty configProperty) {
String key = configProperty.name();
if (key.length() > 0) {
return key;
}
if (ip.getAnnotated() instanceof AnnotatedMember) {
AnnotatedMember member = (AnnotatedMember) ip.getAnnotated(... | [
"static",
"String",
"getConfigKey",
"(",
"InjectionPoint",
"ip",
",",
"ConfigProperty",
"configProperty",
")",
"{",
"String",
"key",
"=",
"configProperty",
".",
"name",
"(",
")",
";",
"if",
"(",
"key",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"return... | Get the property key to use.
In case the {@link ConfigProperty#name()} is empty we will try to determine the key name from the InjectionPoint. | [
"Get",
"the",
"property",
"key",
"to",
"use",
".",
"In",
"case",
"the",
"{"
] | train | https://github.com/atbashEE/atbash-config/blob/80c06c6e535957514ffb51380948ecd351d5068c/geronimo-config/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionBean.java#L170-L184 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DevicesStatusApi.java | DevicesStatusApi.getDeviceStatusAsync | public com.squareup.okhttp.Call getDeviceStatusAsync(String deviceId, Boolean includeSnapshot, Boolean includeSnapshotTimestamp, final ApiCallback<DeviceStatus> callback) throws ApiException {
"""
Get Device Status (asynchronously)
Get Device Status
@param deviceId Device ID. (required)
@param includeSnapshot I... | java | public com.squareup.okhttp.Call getDeviceStatusAsync(String deviceId, Boolean includeSnapshot, Boolean includeSnapshotTimestamp, final ApiCallback<DeviceStatus> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener pro... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"getDeviceStatusAsync",
"(",
"String",
"deviceId",
",",
"Boolean",
"includeSnapshot",
",",
"Boolean",
"includeSnapshotTimestamp",
",",
"final",
"ApiCallback",
"<",
"DeviceStatus",
">",
"callback",
")",
... | Get Device Status (asynchronously)
Get Device Status
@param deviceId Device ID. (required)
@param includeSnapshot Include device snapshot into the response (optional)
@param includeSnapshotTimestamp Include device snapshot timestamp into the response (optional)
@param callback The callback to be executed when the API c... | [
"Get",
"Device",
"Status",
"(",
"asynchronously",
")",
"Get",
"Device",
"Status"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DevicesStatusApi.java#L162-L187 |
milaboratory/milib | src/main/java/com/milaboratory/core/alignment/AlignmentTrimmer.java | AlignmentTrimmer.rightTrimAlignment | public static <S extends Sequence<S>> Alignment<S> rightTrimAlignment(Alignment<S> alignment,
AlignmentScoring<S> scoring) {
"""
Try increase total alignment score by partially (or fully) trimming it from right side. If score can't be
increa... | java | public static <S extends Sequence<S>> Alignment<S> rightTrimAlignment(Alignment<S> alignment,
AlignmentScoring<S> scoring) {
if (scoring instanceof LinearGapAlignmentScoring)
return rightTrimAlignment(alignment, (LinearGapAlign... | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"S",
">",
">",
"Alignment",
"<",
"S",
">",
"rightTrimAlignment",
"(",
"Alignment",
"<",
"S",
">",
"alignment",
",",
"AlignmentScoring",
"<",
"S",
">",
"scoring",
")",
"{",
"if",
"(",
"scoring",
... | Try increase total alignment score by partially (or fully) trimming it from right side. If score can't be
increased the same alignment will be returned.
@param alignment input alignment
@param scoring scoring
@return resulting alignment | [
"Try",
"increase",
"total",
"alignment",
"score",
"by",
"partially",
"(",
"or",
"fully",
")",
"trimming",
"it",
"from",
"right",
"side",
".",
"If",
"score",
"can",
"t",
"be",
"increased",
"the",
"same",
"alignment",
"will",
"be",
"returned",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/alignment/AlignmentTrimmer.java#L178-L186 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java | BitfinexApiCallbackListeners.onMyWalletEvent | public Closeable onMyWalletEvent(final BiConsumer<BitfinexAccountSymbol,Collection<BitfinexWallet>> listener) {
"""
registers listener for user account related events - wallet change events
@param listener of event
@return hook of this listener
"""
walletConsumers.offer(listener);
return () -... | java | public Closeable onMyWalletEvent(final BiConsumer<BitfinexAccountSymbol,Collection<BitfinexWallet>> listener) {
walletConsumers.offer(listener);
return () -> walletConsumers.remove(listener);
} | [
"public",
"Closeable",
"onMyWalletEvent",
"(",
"final",
"BiConsumer",
"<",
"BitfinexAccountSymbol",
",",
"Collection",
"<",
"BitfinexWallet",
">",
">",
"listener",
")",
"{",
"walletConsumers",
".",
"offer",
"(",
"listener",
")",
";",
"return",
"(",
")",
"->",
... | registers listener for user account related events - wallet change events
@param listener of event
@return hook of this listener | [
"registers",
"listener",
"for",
"user",
"account",
"related",
"events",
"-",
"wallet",
"change",
"events"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java#L138-L141 |
camunda/camunda-commons | typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Variables.untypedValue | public static TypedValue untypedValue(Object value) {
"""
Creates an untyped value, i.e. {@link TypedValue#getType()} returns <code>null</code>
for the returned instance.
"""
if (value instanceof TypedValue) {
return untypedValue(value, ((TypedValue) value).isTransient());
}
else return unty... | java | public static TypedValue untypedValue(Object value) {
if (value instanceof TypedValue) {
return untypedValue(value, ((TypedValue) value).isTransient());
}
else return untypedValue(value, false);
} | [
"public",
"static",
"TypedValue",
"untypedValue",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"TypedValue",
")",
"{",
"return",
"untypedValue",
"(",
"value",
",",
"(",
"(",
"TypedValue",
")",
"value",
")",
".",
"isTransient",
"(",
"... | Creates an untyped value, i.e. {@link TypedValue#getType()} returns <code>null</code>
for the returned instance. | [
"Creates",
"an",
"untyped",
"value",
"i",
".",
"e",
".",
"{"
] | train | https://github.com/camunda/camunda-commons/blob/bd3195db47c92c25717288fe9e6735f8e882f247/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java#L362-L367 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java | PactDslJsonArray.eachLike | public PactDslJsonArray eachLike(PactDslJsonRootValue value, int numberExamples) {
"""
Array of values that are not objects where each item must match the provided example
@param value Value to use to match each item
@param numberExamples number of examples to generate
"""
if (numberExamples == 0) {
... | java | public PactDslJsonArray eachLike(PactDslJsonRootValue value, int numberExamples) {
if (numberExamples == 0) {
throw new IllegalArgumentException("Testing Zero examples is unsafe. Please make sure to provide at least one " +
"example in the Pact provider implementation. See https://github.com/DiUS/pact... | [
"public",
"PactDslJsonArray",
"eachLike",
"(",
"PactDslJsonRootValue",
"value",
",",
"int",
"numberExamples",
")",
"{",
"if",
"(",
"numberExamples",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Testing Zero examples is unsafe. Please make sure ... | Array of values that are not objects where each item must match the provided example
@param value Value to use to match each item
@param numberExamples number of examples to generate | [
"Array",
"of",
"values",
"that",
"are",
"not",
"objects",
"where",
"each",
"item",
"must",
"match",
"the",
"provided",
"example"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java#L1034-L1045 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutionFlowDao.java | ExecutionFlowDao.fetchFlowHistory | public List<ExecutableFlow> fetchFlowHistory(final int projectId, final String flowId, final
long startTime) throws ExecutorManagerException {
"""
fetch flow execution history with specified {@code projectId}, {@code flowId} and flow start
time >= {@code startTime}
@return the list of flows meeting the speci... | java | public List<ExecutableFlow> fetchFlowHistory(final int projectId, final String flowId, final
long startTime) throws ExecutorManagerException {
try {
return this.dbOperator.query(FetchExecutableFlows.FETCH_EXECUTABLE_FLOW_BY_START_TIME,
new FetchExecutableFlows(), projectId, flowId, startTime);
... | [
"public",
"List",
"<",
"ExecutableFlow",
">",
"fetchFlowHistory",
"(",
"final",
"int",
"projectId",
",",
"final",
"String",
"flowId",
",",
"final",
"long",
"startTime",
")",
"throws",
"ExecutorManagerException",
"{",
"try",
"{",
"return",
"this",
".",
"dbOperato... | fetch flow execution history with specified {@code projectId}, {@code flowId} and flow start
time >= {@code startTime}
@return the list of flows meeting the specified criteria | [
"fetch",
"flow",
"execution",
"history",
"with",
"specified",
"{",
"@code",
"projectId",
"}",
"{",
"@code",
"flowId",
"}",
"and",
"flow",
"start",
"time",
">",
"=",
"{",
"@code",
"startTime",
"}"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionFlowDao.java#L127-L135 |
schallee/alib4j | jvm/src/main/java/net/darkmist/alib/jvm/JVMLauncher.java | JVMLauncher.getProcess | @Deprecated
public static Process getProcess(String mainClass, String... args) throws LauncherException, IOException {
"""
Get a process for a JVM. The class path for the JVM is computed
based on the class loaders for the main class.
@param mainClass Fully qualified class name of the main class
@param args Add... | java | @Deprecated
public static Process getProcess(String mainClass, String... args) throws LauncherException, IOException
{
return getProcessBuilder(mainClass, args).start();
} | [
"@",
"Deprecated",
"public",
"static",
"Process",
"getProcess",
"(",
"String",
"mainClass",
",",
"String",
"...",
"args",
")",
"throws",
"LauncherException",
",",
"IOException",
"{",
"return",
"getProcessBuilder",
"(",
"mainClass",
",",
"args",
")",
".",
"start"... | Get a process for a JVM. The class path for the JVM is computed
based on the class loaders for the main class.
@param mainClass Fully qualified class name of the main class
@param args Additional command line parameters
@return ProcessBuilder that has not been started.
@deprecated This acquires the mainClass class by u... | [
"Get",
"a",
"process",
"for",
"a",
"JVM",
".",
"The",
"class",
"path",
"for",
"the",
"JVM",
"is",
"computed",
"based",
"on",
"the",
"class",
"loaders",
"for",
"the",
"main",
"class",
"."
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/jvm/src/main/java/net/darkmist/alib/jvm/JVMLauncher.java#L252-L256 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.xdsl_options_ipv4_ipRange_GET | public OvhPrice xdsl_options_ipv4_ipRange_GET(net.minidev.ovh.api.price.xdsl.options.OvhIpv4Enum ipRange) throws IOException {
"""
Get the price of IPv4 options
REST: GET /price/xdsl/options/ipv4/{ipRange}
@param ipRange [required] The range of the IPv4
"""
String qPath = "/price/xdsl/options/ipv4/{ipRan... | java | public OvhPrice xdsl_options_ipv4_ipRange_GET(net.minidev.ovh.api.price.xdsl.options.OvhIpv4Enum ipRange) throws IOException {
String qPath = "/price/xdsl/options/ipv4/{ipRange}";
StringBuilder sb = path(qPath, ipRange);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPrice.clas... | [
"public",
"OvhPrice",
"xdsl_options_ipv4_ipRange_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"xdsl",
".",
"options",
".",
"OvhIpv4Enum",
"ipRange",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/price/xdsl/options... | Get the price of IPv4 options
REST: GET /price/xdsl/options/ipv4/{ipRange}
@param ipRange [required] The range of the IPv4 | [
"Get",
"the",
"price",
"of",
"IPv4",
"options"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L50-L55 |
op4j/op4j-jodatime | src/main/java/org/op4j/jodatime/functions/FnInterval.java | FnInterval.strFieldArrayToInterval | public static final Function<String[], Interval> strFieldArrayToInterval(String pattern, DateTimeZone dateTimeZone) {
"""
<p>
It converts the input {@link String} elements into an {@link Interval}.
The target {@link String} elements represent the start and end of the {@link Interval}.
</p>
<p>
The accepted ... | java | public static final Function<String[], Interval> strFieldArrayToInterval(String pattern, DateTimeZone dateTimeZone) {
return new StringFieldArrayToInterval(pattern, dateTimeZone);
} | [
"public",
"static",
"final",
"Function",
"<",
"String",
"[",
"]",
",",
"Interval",
">",
"strFieldArrayToInterval",
"(",
"String",
"pattern",
",",
"DateTimeZone",
"dateTimeZone",
")",
"{",
"return",
"new",
"StringFieldArrayToInterval",
"(",
"pattern",
",",
"dateTim... | <p>
It converts the input {@link String} elements into an {@link Interval}.
The target {@link String} elements represent the start and end of the {@link Interval}.
</p>
<p>
The accepted input String[] are:
</p>
<ul>
<li>year, month, day, year, month, day</li>
<li>year, month, day, hour, minute, year, month, day, hour,... | [
"<p",
">",
"It",
"converts",
"the",
"input",
"{",
"@link",
"String",
"}",
"elements",
"into",
"an",
"{",
"@link",
"Interval",
"}",
".",
"The",
"target",
"{",
"@link",
"String",
"}",
"elements",
"represent",
"the",
"start",
"and",
"end",
"of",
"the",
"{... | train | https://github.com/op4j/op4j-jodatime/blob/26e5b8cda8553fb3b5a4a64b3109dbbf5df21194/src/main/java/org/op4j/jodatime/functions/FnInterval.java#L376-L378 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/DateUtil.java | DateUtil.isToday | public static boolean isToday(String date, String format) {
"""
查询时间是否在今日
@param date 时间字符串
@param format 时间字符串的格式
@return 如果指定日期对象在今天则返回<code>true</code>
"""
String now = getFormatDate(SHORT);
String target = getFormatDate(SHORT, parse(date, format));
return now.equals(target);
... | java | public static boolean isToday(String date, String format) {
String now = getFormatDate(SHORT);
String target = getFormatDate(SHORT, parse(date, format));
return now.equals(target);
} | [
"public",
"static",
"boolean",
"isToday",
"(",
"String",
"date",
",",
"String",
"format",
")",
"{",
"String",
"now",
"=",
"getFormatDate",
"(",
"SHORT",
")",
";",
"String",
"target",
"=",
"getFormatDate",
"(",
"SHORT",
",",
"parse",
"(",
"date",
",",
"fo... | 查询时间是否在今日
@param date 时间字符串
@param format 时间字符串的格式
@return 如果指定日期对象在今天则返回<code>true</code> | [
"查询时间是否在今日"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/DateUtil.java#L240-L244 |
h2oai/h2o-3 | h2o-algos/src/main/java/hex/tree/Score.java | Score.makeModelMetrics | private ModelMetrics makeModelMetrics(SharedTreeModel model, Frame fr, Frame adaptedFr, Frame preds) {
"""
Run after the doAll scoring to convert the MetricsBuilder to a ModelMetrics
"""
ModelMetrics mm;
if (model._output.nclasses() == 2 && _computeGainsLift) {
assert preds != null : "Predictions... | java | private ModelMetrics makeModelMetrics(SharedTreeModel model, Frame fr, Frame adaptedFr, Frame preds) {
ModelMetrics mm;
if (model._output.nclasses() == 2 && _computeGainsLift) {
assert preds != null : "Predictions were pre-created";
mm = _mb.makeModelMetrics(model, fr, adaptedFr, preds);
} else ... | [
"private",
"ModelMetrics",
"makeModelMetrics",
"(",
"SharedTreeModel",
"model",
",",
"Frame",
"fr",
",",
"Frame",
"adaptedFr",
",",
"Frame",
"preds",
")",
"{",
"ModelMetrics",
"mm",
";",
"if",
"(",
"model",
".",
"_output",
".",
"nclasses",
"(",
")",
"==",
... | Run after the doAll scoring to convert the MetricsBuilder to a ModelMetrics | [
"Run",
"after",
"the",
"doAll",
"scoring",
"to",
"convert",
"the",
"MetricsBuilder",
"to",
"a",
"ModelMetrics"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/tree/Score.java#L142-L159 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.ipxeScript_POST | public OvhIpxe ipxeScript_POST(String description, String name, String script) throws IOException {
"""
Add an IPXE script
REST: POST /me/ipxeScript
@param script [required] Content of your IPXE script
@param description [required] A personnal description of this script
@param name [required] name of your sc... | java | public OvhIpxe ipxeScript_POST(String description, String name, String script) throws IOException {
String qPath = "/me/ipxeScript";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", description);
addBody(o, "name", name);
addBody(o, "script"... | [
"public",
"OvhIpxe",
"ipxeScript_POST",
"(",
"String",
"description",
",",
"String",
"name",
",",
"String",
"script",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/ipxeScript\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
"... | Add an IPXE script
REST: POST /me/ipxeScript
@param script [required] Content of your IPXE script
@param description [required] A personnal description of this script
@param name [required] name of your script | [
"Add",
"an",
"IPXE",
"script"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L976-L985 |
urish/gwt-titanium | src/main/java/org/urish/gwtit/client/util/Timers.java | Timers.setTimeout | public static Timer setTimeout(int milliseconds, TimerCallback callback) {
"""
Defines a one-shot timer.
@param milliseconds Time until the timeout callback fires
@param callback Callback to fire
@return The new timer object
"""
TimeoutTimer timeout = new TimeoutTimer();
timeout.setId(nativeSetTimeou... | java | public static Timer setTimeout(int milliseconds, TimerCallback callback) {
TimeoutTimer timeout = new TimeoutTimer();
timeout.setId(nativeSetTimeout(milliseconds, callback, timeout));
return timeout;
} | [
"public",
"static",
"Timer",
"setTimeout",
"(",
"int",
"milliseconds",
",",
"TimerCallback",
"callback",
")",
"{",
"TimeoutTimer",
"timeout",
"=",
"new",
"TimeoutTimer",
"(",
")",
";",
"timeout",
".",
"setId",
"(",
"nativeSetTimeout",
"(",
"milliseconds",
",",
... | Defines a one-shot timer.
@param milliseconds Time until the timeout callback fires
@param callback Callback to fire
@return The new timer object | [
"Defines",
"a",
"one",
"-",
"shot",
"timer",
"."
] | train | https://github.com/urish/gwt-titanium/blob/5b53a312093a84f235366932430f02006a570612/src/main/java/org/urish/gwtit/client/util/Timers.java#L114-L118 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/ObjectType.java | ObjectType.defineSynthesizedProperty | public final boolean defineSynthesizedProperty(String propertyName,
JSType type, Node propertyNode) {
"""
Defines a property whose type is on a synthesized object. These objects
don't actually exist in the user's program. They're just used for
bookkeeping in the type system.
"""
return defineProper... | java | public final boolean defineSynthesizedProperty(String propertyName,
JSType type, Node propertyNode) {
return defineProperty(propertyName, type, false, propertyNode);
} | [
"public",
"final",
"boolean",
"defineSynthesizedProperty",
"(",
"String",
"propertyName",
",",
"JSType",
"type",
",",
"Node",
"propertyNode",
")",
"{",
"return",
"defineProperty",
"(",
"propertyName",
",",
"type",
",",
"false",
",",
"propertyNode",
")",
";",
"}"... | Defines a property whose type is on a synthesized object. These objects
don't actually exist in the user's program. They're just used for
bookkeeping in the type system. | [
"Defines",
"a",
"property",
"whose",
"type",
"is",
"on",
"a",
"synthesized",
"object",
".",
"These",
"objects",
"don",
"t",
"actually",
"exist",
"in",
"the",
"user",
"s",
"program",
".",
"They",
"re",
"just",
"used",
"for",
"bookkeeping",
"in",
"the",
"t... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L385-L388 |
Harium/keel | src/main/java/com/harium/keel/core/helper/ColorHelper.java | ColorHelper.fromHSL | public static int fromHSL(float h, float s, float l) {
"""
Method to transform from HSL to RGB (this method sets alpha as 0xff)
@param h - hue
@param s - saturation
@param l - lightness
@return rgb
"""
int alpha = MAX_INT;
return fromHSL(h, s, l, alpha);
} | java | public static int fromHSL(float h, float s, float l) {
int alpha = MAX_INT;
return fromHSL(h, s, l, alpha);
} | [
"public",
"static",
"int",
"fromHSL",
"(",
"float",
"h",
",",
"float",
"s",
",",
"float",
"l",
")",
"{",
"int",
"alpha",
"=",
"MAX_INT",
";",
"return",
"fromHSL",
"(",
"h",
",",
"s",
",",
"l",
",",
"alpha",
")",
";",
"}"
] | Method to transform from HSL to RGB (this method sets alpha as 0xff)
@param h - hue
@param s - saturation
@param l - lightness
@return rgb | [
"Method",
"to",
"transform",
"from",
"HSL",
"to",
"RGB",
"(",
"this",
"method",
"sets",
"alpha",
"as",
"0xff",
")"
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/core/helper/ColorHelper.java#L451-L454 |
BioPAX/Paxtools | paxtools-core/src/main/java/org/biopax/paxtools/controller/Fetcher.java | Fetcher.fetch | public Set<BioPAXElement> fetch(final BioPAXElement bpe, int depth) {
"""
Recursively collects unique child objects from
BioPAX object type properties that pass
all the filters (as set via Constructor).
The #isSkipSubPathways flag is ignored.
Note: this method might return different objects with the same U... | java | public Set<BioPAXElement> fetch(final BioPAXElement bpe, int depth)
{
//a sanity check
if(depth <= 0) {
throw new IllegalArgumentException("fetch(..), not a positive 'depth':" + depth);
}
final Set<BioPAXElement> children = new HashSet<BioPAXElement>();
//create a simple traverser to collect direct chil... | [
"public",
"Set",
"<",
"BioPAXElement",
">",
"fetch",
"(",
"final",
"BioPAXElement",
"bpe",
",",
"int",
"depth",
")",
"{",
"//a sanity check",
"if",
"(",
"depth",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"fetch(..), not a positive '... | Recursively collects unique child objects from
BioPAX object type properties that pass
all the filters (as set via Constructor).
The #isSkipSubPathways flag is ignored.
Note: this method might return different objects with the same URI if such
are present among the child elements for some reason (for a self-integral ... | [
"Recursively",
"collects",
"unique",
"child",
"objects",
"from",
"BioPAX",
"object",
"type",
"properties",
"that",
"pass",
"all",
"the",
"filters",
"(",
"as",
"set",
"via",
"Constructor",
")",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/Fetcher.java#L175-L209 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.appendLikeCriteria | private void appendLikeCriteria(TableAlias alias, PathInfo pathInfo, LikeCriteria c, StringBuffer buf) {
"""
Answer the SQL-Clause for a LikeCriteria
@param c
@param buf
"""
appendColName(alias, pathInfo, c.isTranslateAttribute(), buf);
buf.append(c.getClause());
appendParameter(... | java | private void appendLikeCriteria(TableAlias alias, PathInfo pathInfo, LikeCriteria c, StringBuffer buf)
{
appendColName(alias, pathInfo, c.isTranslateAttribute(), buf);
buf.append(c.getClause());
appendParameter(c.getValue(), buf);
buf.append(m_platform.getEscapeClause(c));
... | [
"private",
"void",
"appendLikeCriteria",
"(",
"TableAlias",
"alias",
",",
"PathInfo",
"pathInfo",
",",
"LikeCriteria",
"c",
",",
"StringBuffer",
"buf",
")",
"{",
"appendColName",
"(",
"alias",
",",
"pathInfo",
",",
"c",
".",
"isTranslateAttribute",
"(",
")",
"... | Answer the SQL-Clause for a LikeCriteria
@param c
@param buf | [
"Answer",
"the",
"SQL",
"-",
"Clause",
"for",
"a",
"LikeCriteria"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L833-L840 |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java | AbstractInterceptor.createClassLevelAccumulators | private void createClassLevelAccumulators(OnDemandStatsProducer<T> producer, Class producerClass) {
"""
Create accumulators for class.
@param producer {@link OnDemandStatsProducer}
@param producerClass producer class
"""
//several @Accumulators in accumulators holder
Accumulates accAnnotati... | java | private void createClassLevelAccumulators(OnDemandStatsProducer<T> producer, Class producerClass) {
//several @Accumulators in accumulators holder
Accumulates accAnnotationHolder = AnnotationUtils.findAnnotation(producerClass, Accumulates.class);//(Accumulates) producerClass.getAnnotation(Accumulates.cl... | [
"private",
"void",
"createClassLevelAccumulators",
"(",
"OnDemandStatsProducer",
"<",
"T",
">",
"producer",
",",
"Class",
"producerClass",
")",
"{",
"//several @Accumulators in accumulators holder",
"Accumulates",
"accAnnotationHolder",
"=",
"AnnotationUtils",
".",
"findAnnot... | Create accumulators for class.
@param producer {@link OnDemandStatsProducer}
@param producerClass producer class | [
"Create",
"accumulators",
"for",
"class",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L181-L203 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java | HomographyDirectLinearTransform.addConics | protected int addConics(List<AssociatedPairConic> points , DMatrixRMaj A, int rows ) {
"""
<p>Adds the 9x9 matrix constraint for each pair of conics. To avoid O(N^2) growth the default option only
adds O(N) pairs. if only conics are used then a minimum of 3 is required. See [2].</p>
inv(C[1]')*(C[2]')*H - H*i... | java | protected int addConics(List<AssociatedPairConic> points , DMatrixRMaj A, int rows ) {
if( exhaustiveConics ) {
// adds an exhaustive set of linear conics
for (int i = 0; i < points.size(); i++) {
for (int j = i+1; j < points.size(); j++) {
rows = addConicPairConstraints(points.get(i),points.get(j),A,... | [
"protected",
"int",
"addConics",
"(",
"List",
"<",
"AssociatedPairConic",
">",
"points",
",",
"DMatrixRMaj",
"A",
",",
"int",
"rows",
")",
"{",
"if",
"(",
"exhaustiveConics",
")",
"{",
"// adds an exhaustive set of linear conics",
"for",
"(",
"int",
"i",
"=",
... | <p>Adds the 9x9 matrix constraint for each pair of conics. To avoid O(N^2) growth the default option only
adds O(N) pairs. if only conics are used then a minimum of 3 is required. See [2].</p>
inv(C[1]')*(C[2]')*H - H*invC[1]*C[2] == 0
Note: x' = H*x. C' is conic from the same view as x' and C from x. It can be show... | [
"<p",
">",
"Adds",
"the",
"9x9",
"matrix",
"constraint",
"for",
"each",
"pair",
"of",
"conics",
".",
"To",
"avoid",
"O",
"(",
"N^2",
")",
"growth",
"the",
"default",
"option",
"only",
"adds",
"O",
"(",
"N",
")",
"pairs",
".",
"if",
"only",
"conics",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java#L310-L329 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LaplaceDistribution.java | LaplaceDistribution.logpdf | public static double logpdf(double val, double rate) {
"""
PDF, static version
@param val Value to compute PDF at
@param rate Rate parameter (1/scale)
@return probability density
"""
return FastMath.log(.5 * rate) - rate * Math.abs(val);
} | java | public static double logpdf(double val, double rate) {
return FastMath.log(.5 * rate) - rate * Math.abs(val);
} | [
"public",
"static",
"double",
"logpdf",
"(",
"double",
"val",
",",
"double",
"rate",
")",
"{",
"return",
"FastMath",
".",
"log",
"(",
".5",
"*",
"rate",
")",
"-",
"rate",
"*",
"Math",
".",
"abs",
"(",
"val",
")",
";",
"}"
] | PDF, static version
@param val Value to compute PDF at
@param rate Rate parameter (1/scale)
@return probability density | [
"PDF",
"static",
"version"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LaplaceDistribution.java#L151-L153 |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/wrappers/matrix/PairSet.java | PairSet.indexOf | @Override
public int indexOf(Pair<T, I> element) {
"""
Provides position of element within the set.
<p>
It returns -1 if the element does not exist within the set.
@param element
element of the set
@return the element position
"""
return matrix.indexOf(
transactionToIndex(element.transaction),... | java | @Override
public int indexOf(Pair<T, I> element) {
return matrix.indexOf(
transactionToIndex(element.transaction),
itemToIndex(element.item));
} | [
"@",
"Override",
"public",
"int",
"indexOf",
"(",
"Pair",
"<",
"T",
",",
"I",
">",
"element",
")",
"{",
"return",
"matrix",
".",
"indexOf",
"(",
"transactionToIndex",
"(",
"element",
".",
"transaction",
")",
",",
"itemToIndex",
"(",
"element",
".",
"item... | Provides position of element within the set.
<p>
It returns -1 if the element does not exist within the set.
@param element
element of the set
@return the element position | [
"Provides",
"position",
"of",
"element",
"within",
"the",
"set",
".",
"<p",
">",
"It",
"returns",
"-",
"1",
"if",
"the",
"element",
"does",
"not",
"exist",
"within",
"the",
"set",
"."
] | train | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/wrappers/matrix/PairSet.java#L779-L784 |
dropbox/dropbox-sdk-java | examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxBrowse.java | DropboxBrowse.slurpUtf8Part | private static String slurpUtf8Part(HttpServletRequest request, HttpServletResponse response, String name, int maxLength)
throws IOException, ServletException {
"""
Reads in a single field of a multipart/form-data request. If the field is not present
or the field is longer than maxLength, we'll use t... | java | private static String slurpUtf8Part(HttpServletRequest request, HttpServletResponse response, String name, int maxLength)
throws IOException, ServletException
{
Part part = request.getPart(name);
if (part == null) {
response.sendError(400, "Form field " + jq(name) + " is miss... | [
"private",
"static",
"String",
"slurpUtf8Part",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"name",
",",
"int",
"maxLength",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"Part",
"part",
"=",
"request",
... | Reads in a single field of a multipart/form-data request. If the field is not present
or the field is longer than maxLength, we'll use the given HttpServletResponse to respond
with an error and then return null.
Otherwise, process it as UTF-8 bytes and return the equivalent String. | [
"Reads",
"in",
"a",
"single",
"field",
"of",
"a",
"multipart",
"/",
"form",
"-",
"data",
"request",
".",
"If",
"the",
"field",
"is",
"not",
"present",
"or",
"the",
"field",
"is",
"longer",
"than",
"maxLength",
"we",
"ll",
"use",
"the",
"given",
"HttpSe... | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxBrowse.java#L317-L343 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/ISMgr.java | ISMgr.setValue | public void setValue(ReloadableType rtype, Object instance, Object value, String name)
throws IllegalAccessException {
"""
Set the value of a field.
@param rtype the reloadabletype
@param instance the instance upon which to set the field
@param value the value to put into the field
@param name the name of... | java | public void setValue(ReloadableType rtype, Object instance, Object value, String name)
throws IllegalAccessException {
// System.err.println(">setValue(rtype=" + rtype + ",instance=" + instance + ",value=" + value + ",name=" + name + ")");
// Look up through our reloadable hierarchy to find it
FieldMember fi... | [
"public",
"void",
"setValue",
"(",
"ReloadableType",
"rtype",
",",
"Object",
"instance",
",",
"Object",
"value",
",",
"String",
"name",
")",
"throws",
"IllegalAccessException",
"{",
"//\t\tSystem.err.println(\">setValue(rtype=\" + rtype + \",instance=\" + instance + \",value=\"... | Set the value of a field.
@param rtype the reloadabletype
@param instance the instance upon which to set the field
@param value the value to put into the field
@param name the name of the field
@throws IllegalAccessException if there is a problem setting the field value | [
"Set",
"the",
"value",
"of",
"a",
"field",
"."
] | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/ISMgr.java#L168-L201 |
elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/PartialVAFile.java | PartialVAFile.calculateFullApproximation | protected VectorApproximation calculateFullApproximation(DBID id, V dv) {
"""
Calculate the VA file position given the existing borders.
@param id Object ID
@param dv Data vector
@return Vector approximation
"""
int[] approximation = new int[dv.getDimensionality()];
for(int d = 0; d < splitPartiti... | java | protected VectorApproximation calculateFullApproximation(DBID id, V dv) {
int[] approximation = new int[dv.getDimensionality()];
for(int d = 0; d < splitPartitions.length; d++) {
double[] split = daFiles.get(d).getSplitPositions();
final double val = dv.doubleValue(d);
final int lastBorderInde... | [
"protected",
"VectorApproximation",
"calculateFullApproximation",
"(",
"DBID",
"id",
",",
"V",
"dv",
")",
"{",
"int",
"[",
"]",
"approximation",
"=",
"new",
"int",
"[",
"dv",
".",
"getDimensionality",
"(",
")",
"]",
";",
"for",
"(",
"int",
"d",
"=",
"0",... | Calculate the VA file position given the existing borders.
@param id Object ID
@param dv Data vector
@return Vector approximation | [
"Calculate",
"the",
"VA",
"file",
"position",
"given",
"the",
"existing",
"borders",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/PartialVAFile.java#L193-L221 |
probedock/probedock-java | src/main/java/io/probedock/client/common/utils/Inflector.java | Inflector.forgeName | public static String forgeName(Class cl, Method m, ProbeTest methodAnnotation) {
"""
Forge a name from a class and a method. If an annotation is provided, then the method
content is used.
@param cl Class to get the name
@param m Method to get the name
@param methodAnnotation The method annotation to override... | java | public static String forgeName(Class cl, Method m, ProbeTest methodAnnotation) {
return forgeName(cl, m.getName(), methodAnnotation);
} | [
"public",
"static",
"String",
"forgeName",
"(",
"Class",
"cl",
",",
"Method",
"m",
",",
"ProbeTest",
"methodAnnotation",
")",
"{",
"return",
"forgeName",
"(",
"cl",
",",
"m",
".",
"getName",
"(",
")",
",",
"methodAnnotation",
")",
";",
"}"
] | Forge a name from a class and a method. If an annotation is provided, then the method
content is used.
@param cl Class to get the name
@param m Method to get the name
@param methodAnnotation The method annotation to override the normal forged name
@return The name forge and humanize | [
"Forge",
"a",
"name",
"from",
"a",
"class",
"and",
"a",
"method",
".",
"If",
"an",
"annotation",
"is",
"provided",
"then",
"the",
"method",
"content",
"is",
"used",
"."
] | train | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/common/utils/Inflector.java#L23-L25 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/transform/TransformerRegistry.java | TransformerRegistry.getHostRegistration | public TransformersSubRegistration getHostRegistration(final ModelVersionRange range) {
"""
Get the sub registry for the hosts.
@param range the version range
@return the sub registry
"""
final PathAddress address = PathAddress.EMPTY_ADDRESS.append(HOST);
return new TransformersSubRegistrat... | java | public TransformersSubRegistration getHostRegistration(final ModelVersionRange range) {
final PathAddress address = PathAddress.EMPTY_ADDRESS.append(HOST);
return new TransformersSubRegistrationImpl(range, domain, address);
} | [
"public",
"TransformersSubRegistration",
"getHostRegistration",
"(",
"final",
"ModelVersionRange",
"range",
")",
"{",
"final",
"PathAddress",
"address",
"=",
"PathAddress",
".",
"EMPTY_ADDRESS",
".",
"append",
"(",
"HOST",
")",
";",
"return",
"new",
"TransformersSubRe... | Get the sub registry for the hosts.
@param range the version range
@return the sub registry | [
"Get",
"the",
"sub",
"registry",
"for",
"the",
"hosts",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/TransformerRegistry.java#L174-L177 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getEventDetailedInfo | public void getEventDetailedInfo(String id, Callback<EventDetail> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on event detail API go <a href="https://wiki.guildwars2.com/wiki/API:1/event_details">here</a><br/>
@param id event id
@param callback callback that is going to... | java | public void getEventDetailedInfo(String id, Callback<EventDetail> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.ID, id));
gw2API.getEventDetailedInfo(id, GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getEventDetailedInfo",
"(",
"String",
"id",
",",
"Callback",
"<",
"EventDetail",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ParamType",
".",
"ID",
",... | For more info on event detail API go <a href="https://wiki.guildwars2.com/wiki/API:1/event_details">here</a><br/>
@param id event id
@param callback callback that is going to be used for {@link Call#enqueue(Callback)}
@throws GuildWars2Exception invalid id
@throws NullPointerException if given {@link Callback} ... | [
"For",
"more",
"info",
"on",
"event",
"detail",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"1",
"/",
"event_details",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">"
] | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L78-L81 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java | StructuredQueryBuilder.temporalPeriodRange | public StructuredQueryDefinition temporalPeriodRange(Axis[] axes, TemporalOperator operator,
Period[] periods, String... options) {
"""
Matches documents that have a value in the specified axis that matches the specified
periods using the specified operator.
... | java | public StructuredQueryDefinition temporalPeriodRange(Axis[] axes, TemporalOperator operator,
Period[] periods, String... options)
{
if ( axes == null ) throw new IllegalArgumentException("axes cannot be null");
if ( operator == null ) throw new IllegalArg... | [
"public",
"StructuredQueryDefinition",
"temporalPeriodRange",
"(",
"Axis",
"[",
"]",
"axes",
",",
"TemporalOperator",
"operator",
",",
"Period",
"[",
"]",
"periods",
",",
"String",
"...",
"options",
")",
"{",
"if",
"(",
"axes",
"==",
"null",
")",
"throw",
"n... | Matches documents that have a value in the specified axis that matches the specified
periods using the specified operator.
@param axes the set of axes of document temporal values used to determine which documents have
values that match this query
@param operator the operator used to determine if values in the axis matc... | [
"Matches",
"documents",
"that",
"have",
"a",
"value",
"in",
"the",
"specified",
"axis",
"that",
"matches",
"the",
"specified",
"periods",
"using",
"the",
"specified",
"operator",
"."
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L2802-L2809 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/util/ServiceBackedDataModel.java | ServiceBackedDataModel.callFetchService | protected void callFetchService (PagedRequest request, AsyncCallback<R> callback) {
"""
Calls the service to obtain data. Implementations should make a service call using the
callback provided. If needCount is set, the implementation should also request the total
number of items from the server (this is normally... | java | protected void callFetchService (PagedRequest request, AsyncCallback<R> callback)
{
callFetchService(request.offset, request.count, request.needCount, callback);
} | [
"protected",
"void",
"callFetchService",
"(",
"PagedRequest",
"request",
",",
"AsyncCallback",
"<",
"R",
">",
"callback",
")",
"{",
"callFetchService",
"(",
"request",
".",
"offset",
",",
"request",
".",
"count",
",",
"request",
".",
"needCount",
",",
"callbac... | Calls the service to obtain data. Implementations should make a service call using the
callback provided. If needCount is set, the implementation should also request the total
number of items from the server (this is normally done in the same call that requests a
page but may be optional for performance reasons). By de... | [
"Calls",
"the",
"service",
"to",
"obtain",
"data",
".",
"Implementations",
"should",
"make",
"a",
"service",
"call",
"using",
"the",
"callback",
"provided",
".",
"If",
"needCount",
"is",
"set",
"the",
"implementation",
"should",
"also",
"request",
"the",
"tota... | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/ServiceBackedDataModel.java#L154-L157 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addSummaryComment | public void addSummaryComment(Element element, Content htmltree) {
"""
Adds the summary content.
@param element the Element for which the summary will be generated
@param htmltree the documentation tree to which the summary will be added
"""
addSummaryComment(element, utils.getFirstSentenceTrees(el... | java | public void addSummaryComment(Element element, Content htmltree) {
addSummaryComment(element, utils.getFirstSentenceTrees(element), htmltree);
} | [
"public",
"void",
"addSummaryComment",
"(",
"Element",
"element",
",",
"Content",
"htmltree",
")",
"{",
"addSummaryComment",
"(",
"element",
",",
"utils",
".",
"getFirstSentenceTrees",
"(",
"element",
")",
",",
"htmltree",
")",
";",
"}"
] | Adds the summary content.
@param element the Element for which the summary will be generated
@param htmltree the documentation tree to which the summary will be added | [
"Adds",
"the",
"summary",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L1658-L1660 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/adwords/lib/utils/logging/ReportServiceLogger.java | ReportServiceLogger.appendMapAsString | private StringBuilder appendMapAsString(StringBuilder messageBuilder, Map<String, Object> map) {
"""
Converts the map of key/value pairs to a multi-line string (one line per key). Masks sensitive
information for a predefined set of header keys.
@param map a non-null Map
@return a non-null String
"""
f... | java | private StringBuilder appendMapAsString(StringBuilder messageBuilder, Map<String, Object> map) {
for (Entry<String, Object> mapEntry : map.entrySet()) {
Object headerValue = mapEntry.getValue();
// Perform a case-insensitive check if the header should be scrubbed.
if (SCRUBBED_HEADERS.contains(map... | [
"private",
"StringBuilder",
"appendMapAsString",
"(",
"StringBuilder",
"messageBuilder",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"Object",
">",
"mapEntry",
":",
"map",
".",
"entrySet",
"(",
"... | Converts the map of key/value pairs to a multi-line string (one line per key). Masks sensitive
information for a predefined set of header keys.
@param map a non-null Map
@return a non-null String | [
"Converts",
"the",
"map",
"of",
"key",
"/",
"value",
"pairs",
"to",
"a",
"multi",
"-",
"line",
"string",
"(",
"one",
"line",
"per",
"key",
")",
".",
"Masks",
"sensitive",
"information",
"for",
"a",
"predefined",
"set",
"of",
"header",
"keys",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/adwords/lib/utils/logging/ReportServiceLogger.java#L180-L190 |
ops4j/org.ops4j.base | ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java | PropertiesUtils.readProperties | public static Properties readProperties( InputStream stream, Properties mappings, boolean closeStream )
throws IOException {
"""
Read a set of properties from a property file provided as an Inputstream.
<p/>
Property files may reference symbolic properties in the form ${name}. Translations occur from bot... | java | public static Properties readProperties( InputStream stream, Properties mappings, boolean closeStream )
throws IOException
{
try
{
Properties p = new Properties();
p.load( stream );
mappings.putAll( p );
boolean doAgain = true;
whil... | [
"public",
"static",
"Properties",
"readProperties",
"(",
"InputStream",
"stream",
",",
"Properties",
"mappings",
",",
"boolean",
"closeStream",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Properties",
"p",
"=",
"new",
"Properties",
"(",
")",
";",
"p",
".",... | Read a set of properties from a property file provided as an Inputstream.
<p/>
Property files may reference symbolic properties in the form ${name}. Translations occur from both the
<code>mappings</code> properties as well as all values within the Properties that are being read.
</p>
<p/>
Example;
</p>
<code><pre>
Prop... | [
"Read",
"a",
"set",
"of",
"properties",
"from",
"a",
"property",
"file",
"provided",
"as",
"an",
"Inputstream",
".",
"<p",
"/",
">",
"Property",
"files",
"may",
"reference",
"symbolic",
"properties",
"in",
"the",
"form",
"$",
"{",
"name",
"}",
".",
"Tran... | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java#L97-L129 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONSerializer.java | JSONSerializer.toJava | public static Object toJava( JSON json, JsonConfig jsonConfig ) {
"""
Transform a JSON value to a java object.<br>
Depending on the configured values for conversion this will return a
DynaBean, a bean, a List, or and array.
@param json a JSON value
@param jsonConfig additional configuration
@return depends ... | java | public static Object toJava( JSON json, JsonConfig jsonConfig ) {
if( JSONUtils.isNull( json ) ){
return null;
}
Object object = null;
if( json instanceof JSONArray ){
if( jsonConfig.getArrayMode() == JsonConfig.MODE_OBJECT_ARRAY ){
object = JSONArray.toArray( (JS... | [
"public",
"static",
"Object",
"toJava",
"(",
"JSON",
"json",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"JSONUtils",
".",
"isNull",
"(",
"json",
")",
")",
"{",
"return",
"null",
";",
"}",
"Object",
"object",
"=",
"null",
";",
"if",
"(",
"j... | Transform a JSON value to a java object.<br>
Depending on the configured values for conversion this will return a
DynaBean, a bean, a List, or and array.
@param json a JSON value
@param jsonConfig additional configuration
@return depends on the nature of the source object (JSONObject, JSONArray,
JSONNull) and the conf... | [
"Transform",
"a",
"JSON",
"value",
"to",
"a",
"java",
"object",
".",
"<br",
">",
"Depending",
"on",
"the",
"configured",
"values",
"for",
"conversion",
"this",
"will",
"return",
"a",
"DynaBean",
"a",
"bean",
"a",
"List",
"or",
"and",
"array",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONSerializer.java#L55-L73 |
lets-blade/blade | src/main/java/com/blade/mvc/RouteContext.java | RouteContext.queryLong | public Long queryLong(String paramName, Long defaultValue) {
"""
Returns a request parameter for a Long type
@param paramName Parameter name
@param defaultValue default long value
@return Return Long parameter values
"""
return this.request.queryLong(paramName, defaultValue);
} | java | public Long queryLong(String paramName, Long defaultValue) {
return this.request.queryLong(paramName, defaultValue);
} | [
"public",
"Long",
"queryLong",
"(",
"String",
"paramName",
",",
"Long",
"defaultValue",
")",
"{",
"return",
"this",
".",
"request",
".",
"queryLong",
"(",
"paramName",
",",
"defaultValue",
")",
";",
"}"
] | Returns a request parameter for a Long type
@param paramName Parameter name
@param defaultValue default long value
@return Return Long parameter values | [
"Returns",
"a",
"request",
"parameter",
"for",
"a",
"Long",
"type"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/mvc/RouteContext.java#L215-L217 |
doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyNode.java | LazyNode.getDoubleValue | protected double getDoubleValue() throws LazyException {
"""
Parses the characters of this token and attempts to construct a double
value from them.
@return the double value if it could be parsed
@throws LazyException if the value could not be parsed
"""
double d=0.0;
String str=getStringValue();
tr... | java | protected double getDoubleValue() throws LazyException{
double d=0.0;
String str=getStringValue();
try{
d=Double.parseDouble(str);
}catch(NumberFormatException nfe){
// This basically can't happen since we already validate the numeric format when parsing
// throw new LazyException("'"+str+"' is not a v... | [
"protected",
"double",
"getDoubleValue",
"(",
")",
"throws",
"LazyException",
"{",
"double",
"d",
"=",
"0.0",
";",
"String",
"str",
"=",
"getStringValue",
"(",
")",
";",
"try",
"{",
"d",
"=",
"Double",
".",
"parseDouble",
"(",
"str",
")",
";",
"}",
"ca... | Parses the characters of this token and attempts to construct a double
value from them.
@return the double value if it could be parsed
@throws LazyException if the value could not be parsed | [
"Parses",
"the",
"characters",
"of",
"this",
"token",
"and",
"attempts",
"to",
"construct",
"a",
"double",
"value",
"from",
"them",
"."
] | train | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyNode.java#L386-L396 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByAddress2 | public Iterable<DUser> queryByAddress2(java.lang.String address2) {
"""
query-by method for field address2
@param address2 the specified attribute
@return an Iterable of DUsers for the specified address2
"""
return queryByField(null, DUserMapper.Field.ADDRESS2.getFieldName(), address2);
} | java | public Iterable<DUser> queryByAddress2(java.lang.String address2) {
return queryByField(null, DUserMapper.Field.ADDRESS2.getFieldName(), address2);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByAddress2",
"(",
"java",
".",
"lang",
".",
"String",
"address2",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"ADDRESS2",
".",
"getFieldName",
"(",
")",
",",
"addres... | query-by method for field address2
@param address2 the specified attribute
@return an Iterable of DUsers for the specified address2 | [
"query",
"-",
"by",
"method",
"for",
"field",
"address2"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L79-L81 |
cycorp/api-suite | core-api/src/main/java/com/cyc/session/exception/SessionManagerConfigurationException.java | SessionManagerConfigurationException.fromThrowable | public static SessionManagerConfigurationException fromThrowable(String message, Throwable cause) {
"""
Converts a Throwable to a SessionManagerConfigurationException with the specified detail message. If the
Throwable is a SessionManagerConfigurationException and if the Throwable's message is identical to the
o... | java | public static SessionManagerConfigurationException fromThrowable(String message, Throwable cause) {
return (cause instanceof SessionManagerConfigurationException && Objects.equals(message, cause.getMessage()))
? (SessionManagerConfigurationException) cause
: new SessionManagerC... | [
"public",
"static",
"SessionManagerConfigurationException",
"fromThrowable",
"(",
"String",
"message",
",",
"Throwable",
"cause",
")",
"{",
"return",
"(",
"cause",
"instanceof",
"SessionManagerConfigurationException",
"&&",
"Objects",
".",
"equals",
"(",
"message",
",",... | Converts a Throwable to a SessionManagerConfigurationException with the specified detail message. If the
Throwable is a SessionManagerConfigurationException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in
a new SessionMan... | [
"Converts",
"a",
"Throwable",
"to",
"a",
"SessionManagerConfigurationException",
"with",
"the",
"specified",
"detail",
"message",
".",
"If",
"the",
"Throwable",
"is",
"a",
"SessionManagerConfigurationException",
"and",
"if",
"the",
"Throwable",
"s",
"message",
"is",
... | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/exception/SessionManagerConfigurationException.java#L63-L67 |
networknt/light-4j | handler/src/main/java/com/networknt/handler/Handler.java | Handler.getNext | public static HttpHandler getNext(HttpServerExchange httpServerExchange, HttpHandler next) throws Exception {
"""
Returns the instance of the next handler, or the given next param if it's not
null.
@param httpServerExchange
The current requests server exchange.
@param next
If not null, return this.
@return... | java | public static HttpHandler getNext(HttpServerExchange httpServerExchange, HttpHandler next) throws Exception {
if (next != null) {
return next;
}
return getNext(httpServerExchange);
} | [
"public",
"static",
"HttpHandler",
"getNext",
"(",
"HttpServerExchange",
"httpServerExchange",
",",
"HttpHandler",
"next",
")",
"throws",
"Exception",
"{",
"if",
"(",
"next",
"!=",
"null",
")",
"{",
"return",
"next",
";",
"}",
"return",
"getNext",
"(",
"httpSe... | Returns the instance of the next handler, or the given next param if it's not
null.
@param httpServerExchange
The current requests server exchange.
@param next
If not null, return this.
@return The next handler in the chain, or next if it's not null.
@throws Exception exception | [
"Returns",
"the",
"instance",
"of",
"the",
"next",
"handler",
"or",
"the",
"given",
"next",
"param",
"if",
"it",
"s",
"not",
"null",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/handler/src/main/java/com/networknt/handler/Handler.java#L295-L300 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java | ZooKeeper.getData | public void getData(final String path, Watcher watcher, DataCallback cb,
Object ctx) {
"""
The Asynchronous version of getData. The request doesn't actually until
the asynchronous callback is called.
@see #getData(String, Watcher, Stat)
"""
verbotenThreadCheck();
final String cl... | java | public void getData(final String path, Watcher watcher, DataCallback cb,
Object ctx) {
verbotenThreadCheck();
final String clientPath = path;
PathUtils.validatePath(clientPath);
// the watch contains the un-chroot path
WatchRegistration wcb = null;
if (watche... | [
"public",
"void",
"getData",
"(",
"final",
"String",
"path",
",",
"Watcher",
"watcher",
",",
"DataCallback",
"cb",
",",
"Object",
"ctx",
")",
"{",
"verbotenThreadCheck",
"(",
")",
";",
"final",
"String",
"clientPath",
"=",
"path",
";",
"PathUtils",
".",
"v... | The Asynchronous version of getData. The request doesn't actually until
the asynchronous callback is called.
@see #getData(String, Watcher, Stat) | [
"The",
"Asynchronous",
"version",
"of",
"getData",
".",
"The",
"request",
"doesn",
"t",
"actually",
"until",
"the",
"asynchronous",
"callback",
"is",
"called",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java#L1009-L1031 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/GuardedByChecker.java | GuardedByChecker.isRWLock | private static boolean isRWLock(GuardedByExpression guard, VisitorState state) {
"""
Returns true if the lock expression corresponds to a {@code
java.util.concurrent.locks.ReadWriteLock}.
"""
Type guardType = guard.type();
if (guardType == null) {
return false;
}
Symbol rwLockSymbol = s... | java | private static boolean isRWLock(GuardedByExpression guard, VisitorState state) {
Type guardType = guard.type();
if (guardType == null) {
return false;
}
Symbol rwLockSymbol = state.getSymbolFromString(JUC_READ_WRITE_LOCK);
if (rwLockSymbol == null) {
return false;
}
return stat... | [
"private",
"static",
"boolean",
"isRWLock",
"(",
"GuardedByExpression",
"guard",
",",
"VisitorState",
"state",
")",
"{",
"Type",
"guardType",
"=",
"guard",
".",
"type",
"(",
")",
";",
"if",
"(",
"guardType",
"==",
"null",
")",
"{",
"return",
"false",
";",
... | Returns true if the lock expression corresponds to a {@code
java.util.concurrent.locks.ReadWriteLock}. | [
"Returns",
"true",
"if",
"the",
"lock",
"expression",
"corresponds",
"to",
"a",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/GuardedByChecker.java#L191-L203 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSetSpanner.java | UnicodeSetSpanner.replaceFrom | public String replaceFrom(CharSequence sequence, CharSequence replacement) {
"""
Replace all matching spans in sequence by the replacement,
counting by CountMethod.MIN_ELEMENTS using SpanCondition.SIMPLE.
The code alternates spans; see the class doc for {@link UnicodeSetSpanner} for a note about boundary conditi... | java | public String replaceFrom(CharSequence sequence, CharSequence replacement) {
return replaceFrom(sequence, replacement, CountMethod.MIN_ELEMENTS, SpanCondition.SIMPLE);
} | [
"public",
"String",
"replaceFrom",
"(",
"CharSequence",
"sequence",
",",
"CharSequence",
"replacement",
")",
"{",
"return",
"replaceFrom",
"(",
"sequence",
",",
"replacement",
",",
"CountMethod",
".",
"MIN_ELEMENTS",
",",
"SpanCondition",
".",
"SIMPLE",
")",
";",
... | Replace all matching spans in sequence by the replacement,
counting by CountMethod.MIN_ELEMENTS using SpanCondition.SIMPLE.
The code alternates spans; see the class doc for {@link UnicodeSetSpanner} for a note about boundary conditions.
@param sequence
charsequence to replace matching spans in.
@param replacement
repla... | [
"Replace",
"all",
"matching",
"spans",
"in",
"sequence",
"by",
"the",
"replacement",
"counting",
"by",
"CountMethod",
".",
"MIN_ELEMENTS",
"using",
"SpanCondition",
".",
"SIMPLE",
".",
"The",
"code",
"alternates",
"spans",
";",
"see",
"the",
"class",
"doc",
"f... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSetSpanner.java#L208-L210 |
google/gson | gson/src/main/java/com/google/gson/Gson.java | Gson.fromJson | @SuppressWarnings("unchecked")
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
"""
This method deserializes the Json read from the specified reader into an object of the
specified type. This method is useful if the specified object is a generic type. For
non-gener... | java | @SuppressWarnings("unchecked")
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
JsonReader jsonReader = newJsonReader(json);
T object = (T) fromJson(jsonReader, typeOfT);
assertFullConsumption(object, jsonReader);
return object;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"fromJson",
"(",
"Reader",
"json",
",",
"Type",
"typeOfT",
")",
"throws",
"JsonIOException",
",",
"JsonSyntaxException",
"{",
"JsonReader",
"jsonReader",
"=",
"newJsonReader",
"(",... | This method deserializes the Json read from the specified reader into an object of the
specified type. This method is useful if the specified object is a generic type. For
non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the Json in a
String form instead of a {@link Reader}, use {@link #fr... | [
"This",
"method",
"deserializes",
"the",
"Json",
"read",
"from",
"the",
"specified",
"reader",
"into",
"an",
"object",
"of",
"the",
"specified",
"type",
".",
"This",
"method",
"is",
"useful",
"if",
"the",
"specified",
"object",
"is",
"a",
"generic",
"type",
... | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/Gson.java#L894-L900 |
voldemort/voldemort | src/java/voldemort/client/ClientConfig.java | ClientConfig.setNodeBannagePeriod | @Deprecated
public ClientConfig setNodeBannagePeriod(int nodeBannagePeriod, TimeUnit unit) {
"""
The period of time to ban a node that gives an error on an operation.
@param nodeBannagePeriod The period of time to ban the node
@param unit The time unit of the given value
@deprecated Use {@link #setFailu... | java | @Deprecated
public ClientConfig setNodeBannagePeriod(int nodeBannagePeriod, TimeUnit unit) {
this.failureDetectorBannagePeriod = unit.toMillis(nodeBannagePeriod);
return this;
} | [
"@",
"Deprecated",
"public",
"ClientConfig",
"setNodeBannagePeriod",
"(",
"int",
"nodeBannagePeriod",
",",
"TimeUnit",
"unit",
")",
"{",
"this",
".",
"failureDetectorBannagePeriod",
"=",
"unit",
".",
"toMillis",
"(",
"nodeBannagePeriod",
")",
";",
"return",
"this",
... | The period of time to ban a node that gives an error on an operation.
@param nodeBannagePeriod The period of time to ban the node
@param unit The time unit of the given value
@deprecated Use {@link #setFailureDetectorBannagePeriod(long)} instead | [
"The",
"period",
"of",
"time",
"to",
"ban",
"a",
"node",
"that",
"gives",
"an",
"error",
"on",
"an",
"operation",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/ClientConfig.java#L721-L725 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java | TwitterEndpointServices.createAuthzHeaderForRequestTokenEndpoint | public String createAuthzHeaderForRequestTokenEndpoint(String callbackUrl, String endpointUrl) {
"""
Generates the Authorization header value required for a {@value TwitterConstants#TWITTER_ENDPOINT_REQUEST_TOKEN} endpoint
request. See {@link https://dev.twitter.com/oauth/reference/post/oauth/request_token} for d... | java | public String createAuthzHeaderForRequestTokenEndpoint(String callbackUrl, String endpointUrl) {
Map<String, String> parameters = populateRequestTokenEndpointAuthzHeaderParams(callbackUrl);
return signAndCreateAuthzHeader(endpointUrl, parameters);
} | [
"public",
"String",
"createAuthzHeaderForRequestTokenEndpoint",
"(",
"String",
"callbackUrl",
",",
"String",
"endpointUrl",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
"=",
"populateRequestTokenEndpointAuthzHeaderParams",
"(",
"callbackUrl",
")",
"... | Generates the Authorization header value required for a {@value TwitterConstants#TWITTER_ENDPOINT_REQUEST_TOKEN} endpoint
request. See {@link https://dev.twitter.com/oauth/reference/post/oauth/request_token} for details.
@param callbackUrl
@param endpointUrl
@return | [
"Generates",
"the",
"Authorization",
"header",
"value",
"required",
"for",
"a",
"{",
"@value",
"TwitterConstants#TWITTER_ENDPOINT_REQUEST_TOKEN",
"}",
"endpoint",
"request",
".",
"See",
"{",
"@link",
"https",
":",
"//",
"dev",
".",
"twitter",
".",
"com",
"/",
"o... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java#L425-L428 |
zaproxy/zaproxy | src/org/parosproxy/paros/view/WorkbenchPanel.java | WorkbenchPanel.addPanels | private static void addPanels(TabbedPanel2 tabbedPanel, List<AbstractPanel> panels, boolean visible) {
"""
Adds the given {@code panels} to the given {@code tabbedPanel} and whether they should be visible.
<p>
After adding all the panels the tabbed panel is revalidated.
@param tabbedPanel the tabbed panel to ... | java | private static void addPanels(TabbedPanel2 tabbedPanel, List<AbstractPanel> panels, boolean visible) {
for (AbstractPanel panel : panels) {
addPanel(tabbedPanel, panel, visible);
}
tabbedPanel.revalidate();
} | [
"private",
"static",
"void",
"addPanels",
"(",
"TabbedPanel2",
"tabbedPanel",
",",
"List",
"<",
"AbstractPanel",
">",
"panels",
",",
"boolean",
"visible",
")",
"{",
"for",
"(",
"AbstractPanel",
"panel",
":",
"panels",
")",
"{",
"addPanel",
"(",
"tabbedPanel",
... | Adds the given {@code panels} to the given {@code tabbedPanel} and whether they should be visible.
<p>
After adding all the panels the tabbed panel is revalidated.
@param tabbedPanel the tabbed panel to add the panels
@param panels the panels to add
@param visible {@code true} if the panel should be visible, {@code fa... | [
"Adds",
"the",
"given",
"{",
"@code",
"panels",
"}",
"to",
"the",
"given",
"{",
"@code",
"tabbedPanel",
"}",
"and",
"whether",
"they",
"should",
"be",
"visible",
".",
"<p",
">",
"After",
"adding",
"all",
"the",
"panels",
"the",
"tabbed",
"panel",
"is",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L878-L883 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java | BigtableInstanceAdminClient.create | public static BigtableInstanceAdminClient create(
@Nonnull String projectId, @Nonnull BigtableInstanceAdminStub stub) {
"""
Constructs an instance of BigtableInstanceAdminClient with the given project id and stub.
"""
return new BigtableInstanceAdminClient(projectId, stub);
} | java | public static BigtableInstanceAdminClient create(
@Nonnull String projectId, @Nonnull BigtableInstanceAdminStub stub) {
return new BigtableInstanceAdminClient(projectId, stub);
} | [
"public",
"static",
"BigtableInstanceAdminClient",
"create",
"(",
"@",
"Nonnull",
"String",
"projectId",
",",
"@",
"Nonnull",
"BigtableInstanceAdminStub",
"stub",
")",
"{",
"return",
"new",
"BigtableInstanceAdminClient",
"(",
"projectId",
",",
"stub",
")",
";",
"}"
... | Constructs an instance of BigtableInstanceAdminClient with the given project id and stub. | [
"Constructs",
"an",
"instance",
"of",
"BigtableInstanceAdminClient",
"with",
"the",
"given",
"project",
"id",
"and",
"stub",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java#L128-L131 |
JosePaumard/streams-utils | src/main/java/org/paumard/streams/StreamsUtils.java | StreamsUtils.shiftingWindowAveragingDouble | public static <E> DoubleStream shiftingWindowAveragingDouble(Stream<E> stream, int rollingFactor, ToDoubleFunction<? super E> mapper) {
"""
<p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps maps this stream to an <code>DoubleStream</code> that is then rolled... | java | public static <E> DoubleStream shiftingWindowAveragingDouble(Stream<E> stream, int rollingFactor, ToDoubleFunction<? super E> mapper) {
Objects.requireNonNull(stream);
Objects.requireNonNull(mapper);
DoubleStream doubleStream = stream.mapToDouble(mapper);
return shiftingWindowAveragingD... | [
"public",
"static",
"<",
"E",
">",
"DoubleStream",
"shiftingWindowAveragingDouble",
"(",
"Stream",
"<",
"E",
">",
"stream",
",",
"int",
"rollingFactor",
",",
"ToDoubleFunction",
"<",
"?",
"super",
"E",
">",
"mapper",
")",
"{",
"Objects",
".",
"requireNonNull",... | <p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps maps this stream to an <code>DoubleStream</code> that is then rolled following
the same principle as the <code>roll()</code> method. This steps builds a <code>Stream<DoubleStream></code>.
</p>
<p>Then the <co... | [
"<p",
">",
"Generates",
"a",
"stream",
"that",
"is",
"computed",
"from",
"a",
"provided",
"stream",
"following",
"two",
"steps",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"first",
"steps",
"maps",
"this",
"stream",
"to",
"an",
"<code",
">",
"DoubleStr... | train | https://github.com/JosePaumard/streams-utils/blob/56152574af0aca44c5f679761202a8f90984ab73/src/main/java/org/paumard/streams/StreamsUtils.java#L652-L658 |
PunchThrough/bean-sdk-android | sdk/src/main/java/com/punchthrough/bean/sdk/internal/upload/firmware/OADProfile.java | OADProfile.writeToCharacteristic | private boolean writeToCharacteristic(BluetoothGattCharacteristic charc, byte[] data) {
"""
Write to a OAD characteristic
@param charc The characteristic being inspected
@return true if it's the OAD Block characteristic
"""
charc.setValue(data);
boolean result = mGattClient.writeCharac... | java | private boolean writeToCharacteristic(BluetoothGattCharacteristic charc, byte[] data) {
charc.setValue(data);
boolean result = mGattClient.writeCharacteristic(charc);
if (result) {
Log.d(TAG, "Wrote to characteristic: " + charc.getUuid() +
", data: " + Arrays.toSt... | [
"private",
"boolean",
"writeToCharacteristic",
"(",
"BluetoothGattCharacteristic",
"charc",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"charc",
".",
"setValue",
"(",
"data",
")",
";",
"boolean",
"result",
"=",
"mGattClient",
".",
"writeCharacteristic",
"(",
"charc... | Write to a OAD characteristic
@param charc The characteristic being inspected
@return true if it's the OAD Block characteristic | [
"Write",
"to",
"a",
"OAD",
"characteristic"
] | train | https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/upload/firmware/OADProfile.java#L317-L328 |
Netflix/conductor | common/src/main/java/com/netflix/conductor/common/utils/RetryUtil.java | RetryUtil.retryOnException | @SuppressWarnings("Guava")
public T retryOnException(Supplier<T> supplierCommand,
Predicate<Throwable> throwablePredicate,
Predicate<T> resultRetryPredicate,
int retryCount,
String shortDescriptio... | java | @SuppressWarnings("Guava")
public T retryOnException(Supplier<T> supplierCommand,
Predicate<Throwable> throwablePredicate,
Predicate<T> resultRetryPredicate,
int retryCount,
String shortDescriptio... | [
"@",
"SuppressWarnings",
"(",
"\"Guava\"",
")",
"public",
"T",
"retryOnException",
"(",
"Supplier",
"<",
"T",
">",
"supplierCommand",
",",
"Predicate",
"<",
"Throwable",
">",
"throwablePredicate",
",",
"Predicate",
"<",
"T",
">",
"resultRetryPredicate",
",",
"in... | A helper method which has the ability to execute a flaky supplier function and retry in case of failures.
@param supplierCommand: Any function that is flaky and needs multiple retries.
@param throwablePredicate: A Guava {@link Predicate} housing the exceptional
criteria to perform informed filtering before retr... | [
"A",
"helper",
"method",
"which",
"has",
"the",
"ability",
"to",
"execute",
"a",
"flaky",
"supplier",
"function",
"and",
"retry",
"in",
"case",
"of",
"failures",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/common/src/main/java/com/netflix/conductor/common/utils/RetryUtil.java#L87-L126 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.read | public static String read(ReadableByteChannel channel, Charset charset) throws IORuntimeException {
"""
从流中读取内容,读取完毕后并不关闭流
@param channel 可读通道,读取完毕后并不关闭通道
@param charset 字符集
@return 内容
@throws IORuntimeException IO异常
@since 4.5.0
"""
FastByteArrayOutputStream out = read(channel);
return null == ch... | java | public static String read(ReadableByteChannel channel, Charset charset) throws IORuntimeException {
FastByteArrayOutputStream out = read(channel);
return null == charset ? out.toString() : out.toString(charset);
} | [
"public",
"static",
"String",
"read",
"(",
"ReadableByteChannel",
"channel",
",",
"Charset",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"FastByteArrayOutputStream",
"out",
"=",
"read",
"(",
"channel",
")",
";",
"return",
"null",
"==",
"charset",
"?",
"... | 从流中读取内容,读取完毕后并不关闭流
@param channel 可读通道,读取完毕后并不关闭通道
@param charset 字符集
@return 内容
@throws IORuntimeException IO异常
@since 4.5.0 | [
"从流中读取内容,读取完毕后并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L423-L426 |
icode/ameba | src/main/java/ameba/message/jackson/internal/JacksonUtils.java | JacksonUtils.configureGenerator | public static void configureGenerator(UriInfo uriInfo, JsonGenerator generator, boolean isDev) {
"""
<p>configureGenerator.</p>
@param uriInfo a {@link javax.ws.rs.core.UriInfo} object.
@param generator a {@link com.fasterxml.jackson.core.JsonGenerator} object.
@param isDev a boolean.
"""
Mu... | java | public static void configureGenerator(UriInfo uriInfo, JsonGenerator generator, boolean isDev) {
MultivaluedMap<String, String> params = uriInfo.getQueryParameters();
String pretty = params.getFirst("pretty");
if ("false".equalsIgnoreCase(pretty)) {
generator.setPrettyPrinter(null);
... | [
"public",
"static",
"void",
"configureGenerator",
"(",
"UriInfo",
"uriInfo",
",",
"JsonGenerator",
"generator",
",",
"boolean",
"isDev",
")",
"{",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"params",
"=",
"uriInfo",
".",
"getQueryParameters",
"(",
")",... | <p>configureGenerator.</p>
@param uriInfo a {@link javax.ws.rs.core.UriInfo} object.
@param generator a {@link com.fasterxml.jackson.core.JsonGenerator} object.
@param isDev a boolean. | [
"<p",
">",
"configureGenerator",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/jackson/internal/JacksonUtils.java#L116-L128 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.createSessionLoginToken | public Object createSessionLoginToken(Map<String, Object> queryParams) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Generate a session login token in scenarios in which MFA may or may not be required.
A session login token expires two minutes after creation.
@param queryParams
... | java | public Object createSessionLoginToken(Map<String, Object> queryParams) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return createSessionLoginToken(queryParams, null);
} | [
"public",
"Object",
"createSessionLoginToken",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"queryParams",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"return",
"createSessionLoginToken",
"(",
"queryParams",
","... | Generate a session login token in scenarios in which MFA may or may not be required.
A session login token expires two minutes after creation.
@param queryParams
Query Parameters (username_or_email, password, subdomain, return_to_url, ip_address, browser_id)
@return SessionTokenInfo or SessionTokenMFAInfo object if s... | [
"Generate",
"a",
"session",
"login",
"token",
"in",
"scenarios",
"in",
"which",
"MFA",
"may",
"or",
"may",
"not",
"be",
"required",
".",
"A",
"session",
"login",
"token",
"expires",
"two",
"minutes",
"after",
"creation",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L870-L872 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XRTreeFragSelectWrapper.java | XRTreeFragSelectWrapper.fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize) {
"""
This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corre... | java | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
((Expression)m_obj).fixupVariables(vars, globalsSize);
} | [
"public",
"void",
"fixupVariables",
"(",
"java",
".",
"util",
".",
"Vector",
"vars",
",",
"int",
"globalsSize",
")",
"{",
"(",
"(",
"Expression",
")",
"m_obj",
")",
".",
"fixupVariables",
"(",
"vars",
",",
"globalsSize",
")",
";",
"}"
] | This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector f... | [
"This",
"function",
"is",
"used",
"to",
"fixup",
"variables",
"from",
"QNames",
"to",
"stack",
"frame",
"indexes",
"at",
"stylesheet",
"build",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XRTreeFragSelectWrapper.java#L51-L54 |
aws/aws-sdk-java | aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53domains/model/GetDomainDetailResult.java | GetDomainDetailResult.getStatusList | public java.util.List<String> getStatusList() {
"""
<p>
An array of domain name status codes, also known as Extensible Provisioning Protocol (EPP) status codes.
</p>
<p>
ICANN, the organization that maintains a central database of domain names, has developed a set of domain name
status codes that tell you the... | java | public java.util.List<String> getStatusList() {
if (statusList == null) {
statusList = new com.amazonaws.internal.SdkInternalList<String>();
}
return statusList;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"getStatusList",
"(",
")",
"{",
"if",
"(",
"statusList",
"==",
"null",
")",
"{",
"statusList",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalList",
"<",
"String",
... | <p>
An array of domain name status codes, also known as Extensible Provisioning Protocol (EPP) status codes.
</p>
<p>
ICANN, the organization that maintains a central database of domain names, has developed a set of domain name
status codes that tell you the status of a variety of operations on a domain name, for examp... | [
"<p",
">",
"An",
"array",
"of",
"domain",
"name",
"status",
"codes",
"also",
"known",
"as",
"Extensible",
"Provisioning",
"Protocol",
"(",
"EPP",
")",
"status",
"codes",
".",
"<",
"/",
"p",
">",
"<p",
">",
"ICANN",
"the",
"organization",
"that",
"maintai... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53domains/model/GetDomainDetailResult.java#L1211-L1216 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.findByLtD_S | @Override
public List<CPInstance> findByLtD_S(Date displayDate, int status,
int start, int end) {
"""
Returns a range of all the cp instances where displayDate < ? and status = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <... | java | @Override
public List<CPInstance> findByLtD_S(Date displayDate, int status,
int start, int end) {
return findByLtD_S(displayDate, status, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPInstance",
">",
"findByLtD_S",
"(",
"Date",
"displayDate",
",",
"int",
"status",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByLtD_S",
"(",
"displayDate",
",",
"status",
",",
"start",
",",
"... | Returns a range of all the cp instances where displayDate < ? and status = ?.
<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 firs... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"instances",
"where",
"displayDate",
"<",
";",
"?",
";",
"and",
"status",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L5674-L5678 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/internal/EvaluateConcordantPairs.java | EvaluateConcordantPairs.computeTau | @Reference(authors = "F. J. Rohlf", title = "Methods of comparing classifications", //
booktitle = "Annual Review of Ecology and Systematics", //
url = "https://doi.org/10.1146/annurev.es.05.110174.000533", //
bibkey = "doi:10.1146/annurev.es.05.110174.000533")
public double computeTau(long c, long ... | java | @Reference(authors = "F. J. Rohlf", title = "Methods of comparing classifications", //
booktitle = "Annual Review of Ecology and Systematics", //
url = "https://doi.org/10.1146/annurev.es.05.110174.000533", //
bibkey = "doi:10.1146/annurev.es.05.110174.000533")
public double computeTau(long c, long ... | [
"@",
"Reference",
"(",
"authors",
"=",
"\"F. J. Rohlf\"",
",",
"title",
"=",
"\"Methods of comparing classifications\"",
",",
"//",
"booktitle",
"=",
"\"Annual Review of Ecology and Systematics\"",
",",
"//",
"url",
"=",
"\"https://doi.org/10.1146/annurev.es.05.110174.000533\""... | Compute the Tau correlation measure
@param c Concordant pairs
@param d Discordant pairs
@param m Total number of pairs
@param wd Number of within distances
@param bd Number of between distances
@return Gamma plus statistic | [
"Compute",
"the",
"Tau",
"correlation",
"measure"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/internal/EvaluateConcordantPairs.java#L280-L288 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/SheetRenderer.java | SheetRenderer.encodeHiddenInputs | private void encodeHiddenInputs(final ResponseWriter responseWriter, final Sheet sheet, final String clientId)
throws IOException {
"""
Encode hidden input fields
@param responseWriter
@param sheet
@param clientId
@throws IOException
"""
responseWriter.startElement("input", null);... | java | private void encodeHiddenInputs(final ResponseWriter responseWriter, final Sheet sheet, final String clientId)
throws IOException {
responseWriter.startElement("input", null);
responseWriter.writeAttribute("id", clientId + "_input", "id");
responseWriter.writeAttribute("name", cl... | [
"private",
"void",
"encodeHiddenInputs",
"(",
"final",
"ResponseWriter",
"responseWriter",
",",
"final",
"Sheet",
"sheet",
",",
"final",
"String",
"clientId",
")",
"throws",
"IOException",
"{",
"responseWriter",
".",
"startElement",
"(",
"\"input\"",
",",
"null",
... | Encode hidden input fields
@param responseWriter
@param sheet
@param clientId
@throws IOException | [
"Encode",
"hidden",
"input",
"fields"
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/SheetRenderer.java#L529-L577 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/BidiOrder.java | BidiOrder.setTypes | private void setTypes(int start, int limit, byte newType) {
"""
Set resultTypes from start up to (but not including) limit to newType.
"""
for (int i = start; i < limit; ++i) {
resultTypes[i] = newType;
}
} | java | private void setTypes(int start, int limit, byte newType) {
for (int i = start; i < limit; ++i) {
resultTypes[i] = newType;
}
} | [
"private",
"void",
"setTypes",
"(",
"int",
"start",
",",
"int",
"limit",
",",
"byte",
"newType",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"limit",
";",
"++",
"i",
")",
"{",
"resultTypes",
"[",
"i",
"]",
"=",
"newType",
";",
... | Set resultTypes from start up to (but not including) limit to newType. | [
"Set",
"resultTypes",
"from",
"start",
"up",
"to",
"(",
"but",
"not",
"including",
")",
"limit",
"to",
"newType",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/BidiOrder.java#L1059-L1063 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.