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 |
|---|---|---|---|---|---|---|---|---|---|---|
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java | StylesContainer.writeMasterPageStyles | public void writeMasterPageStyles(final XMLUtil util, final Appendable appendable)
throws IOException {
"""
Write master page styles. The master page style always belong to to styles
.xml/master-styles (3.15.4)
@param util an util
@param appendable the destination
@throws IOException if an I/O ... | java | public void writeMasterPageStyles(final XMLUtil util, final Appendable appendable)
throws IOException {
for (final MasterPageStyle ps : this.masterPageStylesContainer.getValues()) {
ps.appendXMLToMasterStyle(util, appendable);
}
} | [
"public",
"void",
"writeMasterPageStyles",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"Appendable",
"appendable",
")",
"throws",
"IOException",
"{",
"for",
"(",
"final",
"MasterPageStyle",
"ps",
":",
"this",
".",
"masterPageStylesContainer",
".",
"getValues",
... | Write master page styles. The master page style always belong to to styles
.xml/master-styles (3.15.4)
@param util an util
@param appendable the destination
@throws IOException if an I/O error occurs | [
"Write",
"master",
"page",
"styles",
".",
"The",
"master",
"page",
"style",
"always",
"belong",
"to",
"to",
"styles",
".",
"xml",
"/",
"master",
"-",
"styles",
"(",
"3",
".",
"15",
".",
"4",
")"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java#L413-L418 |
cdapio/tigon | tigon-yarn/src/main/java/co/cask/tigon/conf/Configuration.java | Configuration.getEnum | public <T extends Enum<T>> T getEnum(String name, T defaultValue) {
"""
Return value matching this enumerated type.
@param name Property name
@param defaultValue Value returned if no mapping exists
@throws IllegalArgumentException If mapping is illegal for the type
provided
"""
final String val = get(n... | java | public <T extends Enum<T>> T getEnum(String name, T defaultValue) {
final String val = get(name);
return null == val
? defaultValue
: Enum.valueOf(defaultValue.getDeclaringClass(), val);
} | [
"public",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"getEnum",
"(",
"String",
"name",
",",
"T",
"defaultValue",
")",
"{",
"final",
"String",
"val",
"=",
"get",
"(",
"name",
")",
";",
"return",
"null",
"==",
"val",
"?",
"defaultValue",
"... | Return value matching this enumerated type.
@param name Property name
@param defaultValue Value returned if no mapping exists
@throws IllegalArgumentException If mapping is illegal for the type
provided | [
"Return",
"value",
"matching",
"this",
"enumerated",
"type",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/conf/Configuration.java#L923-L928 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/LeftAligner.java | LeftAligner.isValidBase | static boolean isValidBase(char base, boolean acceptAmbiguous) {
"""
Only accepts as a valid base A, C, G and T
or IUPAC ambiguous if enabled
@param base
@return
"""
boolean isValidBase = PRECISE_BASES.contains(base);
if (!isValidBase && acceptAmbiguous) {
isValidBase = N.equals(... | java | static boolean isValidBase(char base, boolean acceptAmbiguous) {
boolean isValidBase = PRECISE_BASES.contains(base);
if (!isValidBase && acceptAmbiguous) {
isValidBase = N.equals(base) || AMBIGUOUS_BASES.contains(base);
}
return isValidBase;
} | [
"static",
"boolean",
"isValidBase",
"(",
"char",
"base",
",",
"boolean",
"acceptAmbiguous",
")",
"{",
"boolean",
"isValidBase",
"=",
"PRECISE_BASES",
".",
"contains",
"(",
"base",
")",
";",
"if",
"(",
"!",
"isValidBase",
"&&",
"acceptAmbiguous",
")",
"{",
"i... | Only accepts as a valid base A, C, G and T
or IUPAC ambiguous if enabled
@param base
@return | [
"Only",
"accepts",
"as",
"a",
"valid",
"base",
"A",
"C",
"G",
"and",
"T",
"or",
"IUPAC",
"ambiguous",
"if",
"enabled"
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/LeftAligner.java#L124-L130 |
apache/groovy | src/main/groovy/groovy/lang/MetaClassImpl.java | MetaClassImpl.addMetaMethod | public void addMetaMethod(MetaMethod method) {
"""
adds a MetaMethod to this class. WARNING: this method will not
do the neccessary steps for multimethod logic and using this
method doesn't mean, that a method added here is replacing another
method from a parent class completely. These steps are usually done
b... | java | public void addMetaMethod(MetaMethod method) {
if (isInitialized()) {
throw new RuntimeException("Already initialized, cannot add new method: " + method);
}
final CachedClass declaringClass = method.getDeclaringClass();
addMetaMethodToIndex(method, metaMethodIndex.getHeader(... | [
"public",
"void",
"addMetaMethod",
"(",
"MetaMethod",
"method",
")",
"{",
"if",
"(",
"isInitialized",
"(",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Already initialized, cannot add new method: \"",
"+",
"method",
")",
";",
"}",
"final",
"CachedCla... | adds a MetaMethod to this class. WARNING: this method will not
do the neccessary steps for multimethod logic and using this
method doesn't mean, that a method added here is replacing another
method from a parent class completely. These steps are usually done
by initialize, which means if you need these steps, you have ... | [
"adds",
"a",
"MetaMethod",
"to",
"this",
"class",
".",
"WARNING",
":",
"this",
"method",
"will",
"not",
"do",
"the",
"neccessary",
"steps",
"for",
"multimethod",
"logic",
"and",
"using",
"this",
"method",
"doesn",
"t",
"mean",
"that",
"a",
"method",
"added... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/MetaClassImpl.java#L3051-L3058 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java | AjaxHelper.registerContainer | static AjaxOperation registerContainer(final String triggerId, final String containerId,
final List<String> containerContentIds) {
"""
This internal method is used to register an arbitrary target container. It must only used by components which
contain implicit AJAX capability.
@param triggerId the id of th... | java | static AjaxOperation registerContainer(final String triggerId, final String containerId,
final List<String> containerContentIds) {
AjaxOperation operation = new AjaxOperation(triggerId, containerContentIds);
operation.setTargetContainerId(containerId);
operation.setAction(AjaxOperation.AjaxAction.REPLACE_CONTE... | [
"static",
"AjaxOperation",
"registerContainer",
"(",
"final",
"String",
"triggerId",
",",
"final",
"String",
"containerId",
",",
"final",
"List",
"<",
"String",
">",
"containerContentIds",
")",
"{",
"AjaxOperation",
"operation",
"=",
"new",
"AjaxOperation",
"(",
"... | This internal method is used to register an arbitrary target container. It must only used by components which
contain implicit AJAX capability.
@param triggerId the id of the trigger that will cause the component to be painted.
@param containerId the target container id. This is not necessarily a WComponent id.
@param... | [
"This",
"internal",
"method",
"is",
"used",
"to",
"register",
"an",
"arbitrary",
"target",
"container",
".",
"It",
"must",
"only",
"used",
"by",
"components",
"which",
"contain",
"implicit",
"AJAX",
"capability",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L146-L153 |
ontop/ontop | core/obda/src/main/java/it/unibz/inf/ontop/spec/ontology/impl/OntologyBuilderImpl.java | OntologyBuilderImpl.addSubPropertyOfAxiom | @Override
public void addSubPropertyOfAxiom(ObjectPropertyExpression ope1, ObjectPropertyExpression ope2) throws InconsistentOntologyException {
"""
Normalizes and adds an object subproperty axiom
<p>
SubObjectPropertyOf := 'SubObjectPropertyOf' '(' axiomAnnotations
ObjectPropertyExpression ObjectPropertyEx... | java | @Override
public void addSubPropertyOfAxiom(ObjectPropertyExpression ope1, ObjectPropertyExpression ope2) throws InconsistentOntologyException {
checkSignature(ope1);
checkSignature(ope2);
objectPropertyAxioms.addInclusion(ope1, ope2);
} | [
"@",
"Override",
"public",
"void",
"addSubPropertyOfAxiom",
"(",
"ObjectPropertyExpression",
"ope1",
",",
"ObjectPropertyExpression",
"ope2",
")",
"throws",
"InconsistentOntologyException",
"{",
"checkSignature",
"(",
"ope1",
")",
";",
"checkSignature",
"(",
"ope2",
")"... | Normalizes and adds an object subproperty axiom
<p>
SubObjectPropertyOf := 'SubObjectPropertyOf' '(' axiomAnnotations
ObjectPropertyExpression ObjectPropertyExpression ')'
<p>
Implements rule [O1]:<br>
- ignore the axiom if the first argument is owl:bottomObjectProperty
or the second argument is owl:topObjectProperty<b... | [
"Normalizes",
"and",
"adds",
"an",
"object",
"subproperty",
"axiom",
"<p",
">",
"SubObjectPropertyOf",
":",
"=",
"SubObjectPropertyOf",
"(",
"axiomAnnotations",
"ObjectPropertyExpression",
"ObjectPropertyExpression",
")",
"<p",
">",
"Implements",
"rule",
"[",
"O1",
"]... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/obda/src/main/java/it/unibz/inf/ontop/spec/ontology/impl/OntologyBuilderImpl.java#L268-L273 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/internal/RecordedQueryPlayer.java | RecordedQueryPlayer.replayGenericQuery | public GDomainQuery replayGenericQuery(RecordedQuery recordedQuery, IGenericDomainAccess domainAccess) {
"""
Create a generic domain query from a recorded query.
@param recordedQuery
@param domainAccess
@return
"""
Boolean br_old = null;
GDomainQuery query;
try {
if (!Settings.TEST_MODE) {
br_o... | java | public GDomainQuery replayGenericQuery(RecordedQuery recordedQuery, IGenericDomainAccess domainAccess) {
Boolean br_old = null;
GDomainQuery query;
try {
if (!Settings.TEST_MODE) {
br_old = QueryRecorder.blockRecording.get();
if (this.createNew)
QueryRecorder.blockRecording.set(Boolean.FALSE);
... | [
"public",
"GDomainQuery",
"replayGenericQuery",
"(",
"RecordedQuery",
"recordedQuery",
",",
"IGenericDomainAccess",
"domainAccess",
")",
"{",
"Boolean",
"br_old",
"=",
"null",
";",
"GDomainQuery",
"query",
";",
"try",
"{",
"if",
"(",
"!",
"Settings",
".",
"TEST_MO... | Create a generic domain query from a recorded query.
@param recordedQuery
@param domainAccess
@return | [
"Create",
"a",
"generic",
"domain",
"query",
"from",
"a",
"recorded",
"query",
"."
] | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/internal/RecordedQueryPlayer.java#L107-L133 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractAddStepHandler.java | AbstractAddStepHandler.populateModel | protected void populateModel(final ModelNode operation, final Resource resource) throws OperationFailedException {
"""
Populate the given resource in the persistent configuration model based on the values in the given operation.
This method is invoked during {@link org.jboss.as.controller.OperationContext.Stage#... | java | protected void populateModel(final ModelNode operation, final Resource resource) throws OperationFailedException {
populateModel(operation, resource.getModel());
} | [
"protected",
"void",
"populateModel",
"(",
"final",
"ModelNode",
"operation",
",",
"final",
"Resource",
"resource",
")",
"throws",
"OperationFailedException",
"{",
"populateModel",
"(",
"operation",
",",
"resource",
".",
"getModel",
"(",
")",
")",
";",
"}"
] | Populate the given resource in the persistent configuration model based on the values in the given operation.
This method is invoked during {@link org.jboss.as.controller.OperationContext.Stage#MODEL}.
<p>
This default implementation simply calls {@link #populateModel(ModelNode, org.jboss.dmr.ModelNode)}.
@param opera... | [
"Populate",
"the",
"given",
"resource",
"in",
"the",
"persistent",
"configuration",
"model",
"based",
"on",
"the",
"values",
"in",
"the",
"given",
"operation",
".",
"This",
"method",
"is",
"invoked",
"during",
"{",
"@link",
"org",
".",
"jboss",
".",
"as",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAddStepHandler.java#L236-L238 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.ortho2DLH | public Matrix4f ortho2DLH(float left, float right, float bottom, float top) {
"""
Apply an orthographic projection transformation for a left-handed coordinate system to this matrix.
<p>
This method is equivalent to calling {@link #orthoLH(float, float, float, float, float, float) orthoLH()} with
<code>zNear=-1<... | java | public Matrix4f ortho2DLH(float left, float right, float bottom, float top) {
return ortho2DLH(left, right, bottom, top, thisOrNew());
} | [
"public",
"Matrix4f",
"ortho2DLH",
"(",
"float",
"left",
",",
"float",
"right",
",",
"float",
"bottom",
",",
"float",
"top",
")",
"{",
"return",
"ortho2DLH",
"(",
"left",
",",
"right",
",",
"bottom",
",",
"top",
",",
"thisOrNew",
"(",
")",
")",
";",
... | Apply an orthographic projection transformation for a left-handed coordinate system to this matrix.
<p>
This method is equivalent to calling {@link #orthoLH(float, float, float, float, float, float) orthoLH()} with
<code>zNear=-1</code> and <code>zFar=+1</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <co... | [
"Apply",
"an",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"to",
"this",
"matrix",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#orthoLH",
"(",
"float",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L7965-L7967 |
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.queryByCity | public Iterable<DContact> queryByCity(Object parent, java.lang.String city) {
"""
query-by method for field city
@param city the specified attribute
@return an Iterable of DContacts for the specified city
"""
return queryByField(parent, DContactMapper.Field.CITY.getFieldName(), city);
} | java | public Iterable<DContact> queryByCity(Object parent, java.lang.String city) {
return queryByField(parent, DContactMapper.Field.CITY.getFieldName(), city);
} | [
"public",
"Iterable",
"<",
"DContact",
">",
"queryByCity",
"(",
"Object",
"parent",
",",
"java",
".",
"lang",
".",
"String",
"city",
")",
"{",
"return",
"queryByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"CITY",
".",
"getFieldName",
"... | query-by method for field city
@param city the specified attribute
@return an Iterable of DContacts for the specified city | [
"query",
"-",
"by",
"method",
"for",
"field",
"city"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L106-L108 |
facebookarchive/swift | swift-service/src/main/java/com/facebook/swift/service/ThriftClientManager.java | ThriftClientManager.getRemoteAddress | public HostAndPort getRemoteAddress(Object client) {
"""
Returns the remote address that a Swift client is connected to
@throws IllegalArgumentException if the client is not a Swift client or is not connected
through an internet socket
"""
NiftyClientChannel niftyChannel = getNiftyChannel(client);
... | java | public HostAndPort getRemoteAddress(Object client)
{
NiftyClientChannel niftyChannel = getNiftyChannel(client);
try {
Channel nettyChannel = niftyChannel.getNettyChannel();
SocketAddress address = nettyChannel.getRemoteAddress();
InetSocketAddress inetAddress = (... | [
"public",
"HostAndPort",
"getRemoteAddress",
"(",
"Object",
"client",
")",
"{",
"NiftyClientChannel",
"niftyChannel",
"=",
"getNiftyChannel",
"(",
"client",
")",
";",
"try",
"{",
"Channel",
"nettyChannel",
"=",
"niftyChannel",
".",
"getNettyChannel",
"(",
")",
";"... | Returns the remote address that a Swift client is connected to
@throws IllegalArgumentException if the client is not a Swift client or is not connected
through an internet socket | [
"Returns",
"the",
"remote",
"address",
"that",
"a",
"Swift",
"client",
"is",
"connected",
"to"
] | train | https://github.com/facebookarchive/swift/blob/3f1f098a50d6106f50cd6fe1c361dd373ede0197/swift-service/src/main/java/com/facebook/swift/service/ThriftClientManager.java#L335-L348 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/sfot/SparseFlowObjectTracker.java | SparseFlowObjectTracker.update | public boolean update( Image input , RectangleRotate_F64 output ) {
"""
Given the input image compute the new location of the target region and store the results in output.
@param input next image in the sequence.
@param output Storage for the output.
@return true if tracking is successful
"""
if( trac... | java | public boolean update( Image input , RectangleRotate_F64 output ) {
if( trackLost )
return false;
trackFeatures(input, region);
// See if there are enough points remaining. use of config.numberOfSamples is some what arbitrary
if( pairs.size() < config.numberOfSamples ) {
System.out.println("Lack of sa... | [
"public",
"boolean",
"update",
"(",
"Image",
"input",
",",
"RectangleRotate_F64",
"output",
")",
"{",
"if",
"(",
"trackLost",
")",
"return",
"false",
";",
"trackFeatures",
"(",
"input",
",",
"region",
")",
";",
"// See if there are enough points remaining. use of c... | Given the input image compute the new location of the target region and store the results in output.
@param input next image in the sequence.
@param output Storage for the output.
@return true if tracking is successful | [
"Given",
"the",
"input",
"image",
"compute",
"the",
"new",
"location",
"of",
"the",
"target",
"region",
"and",
"store",
"the",
"results",
"in",
"output",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/sfot/SparseFlowObjectTracker.java#L136-L186 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatterBuilder.java | PeriodFormatterBuilder.appendSeparator | public PeriodFormatterBuilder appendSeparator(String text) {
"""
Append a separator, which is output if fields are printed both before
and after the separator.
<p>
For example, <code>builder.appendDays().appendSeparator(",").appendHours()</code>
will only output the comma if both the days and hours fields are ... | java | public PeriodFormatterBuilder appendSeparator(String text) {
return appendSeparator(text, text, null, true, true);
} | [
"public",
"PeriodFormatterBuilder",
"appendSeparator",
"(",
"String",
"text",
")",
"{",
"return",
"appendSeparator",
"(",
"text",
",",
"text",
",",
"null",
",",
"true",
",",
"true",
")",
";",
"}"
] | Append a separator, which is output if fields are printed both before
and after the separator.
<p>
For example, <code>builder.appendDays().appendSeparator(",").appendHours()</code>
will only output the comma if both the days and hours fields are output.
<p>
The text will be parsed case-insensitively.
<p>
Note: appendin... | [
"Append",
"a",
"separator",
"which",
"is",
"output",
"if",
"fields",
"are",
"printed",
"both",
"before",
"and",
"after",
"the",
"separator",
".",
"<p",
">",
"For",
"example",
"<code",
">",
"builder",
".",
"appendDays",
"()",
".",
"appendSeparator",
"(",
")... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java#L727-L729 |
googleapis/google-api-java-client | google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential.java | GoogleAccountCredential.usingAudience | public static GoogleAccountCredential usingAudience(Context context, String audience) {
"""
Sets the audience scope to use with Google Cloud Endpoints.
@param context context
@param audience audience
@return new instance
"""
Preconditions.checkArgument(audience.length() != 0);
return new GoogleAcc... | java | public static GoogleAccountCredential usingAudience(Context context, String audience) {
Preconditions.checkArgument(audience.length() != 0);
return new GoogleAccountCredential(context, "audience:" + audience);
} | [
"public",
"static",
"GoogleAccountCredential",
"usingAudience",
"(",
"Context",
"context",
",",
"String",
"audience",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"audience",
".",
"length",
"(",
")",
"!=",
"0",
")",
";",
"return",
"new",
"GoogleAccountC... | Sets the audience scope to use with Google Cloud Endpoints.
@param context context
@param audience audience
@return new instance | [
"Sets",
"the",
"audience",
"scope",
"to",
"use",
"with",
"Google",
"Cloud",
"Endpoints",
"."
] | train | https://github.com/googleapis/google-api-java-client/blob/88decfd14fc40cae6eb6729a45c7d56a1132e450/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential.java#L125-L128 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.createGroup | public CmsGroup createGroup(String name, String description) throws Exception {
"""
Creates a group.<p>
@param name the name of the new group
@param description the description of the new group
@return the created group
@throws Exception if something goes wrong
@see CmsObject#createGroup(String, String, int... | java | public CmsGroup createGroup(String name, String description) throws Exception {
return m_cms.createGroup(name, description, I_CmsPrincipal.FLAG_ENABLED, null);
} | [
"public",
"CmsGroup",
"createGroup",
"(",
"String",
"name",
",",
"String",
"description",
")",
"throws",
"Exception",
"{",
"return",
"m_cms",
".",
"createGroup",
"(",
"name",
",",
"description",
",",
"I_CmsPrincipal",
".",
"FLAG_ENABLED",
",",
"null",
")",
";"... | Creates a group.<p>
@param name the name of the new group
@param description the description of the new group
@return the created group
@throws Exception if something goes wrong
@see CmsObject#createGroup(String, String, int, String) | [
"Creates",
"a",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L352-L355 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java | MetadataService.removeToken | public CompletableFuture<Revision> removeToken(Author author, String projectName, String appId) {
"""
Removes the {@link Token} of the specified {@code appId} from the specified {@code projectName}.
It also removes every token permission belonging to {@link Token} from every {@link RepositoryMetadata}.
"""
... | java | public CompletableFuture<Revision> removeToken(Author author, String projectName, String appId) {
requireNonNull(author, "author");
requireNonNull(projectName, "projectName");
requireNonNull(appId, "appId");
return removeToken(projectName, author, appId, false);
} | [
"public",
"CompletableFuture",
"<",
"Revision",
">",
"removeToken",
"(",
"Author",
"author",
",",
"String",
"projectName",
",",
"String",
"appId",
")",
"{",
"requireNonNull",
"(",
"author",
",",
"\"author\"",
")",
";",
"requireNonNull",
"(",
"projectName",
",",
... | Removes the {@link Token} of the specified {@code appId} from the specified {@code projectName}.
It also removes every token permission belonging to {@link Token} from every {@link RepositoryMetadata}. | [
"Removes",
"the",
"{"
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java#L370-L376 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/inf/BruteForceInferencer.java | BruteForceInferencer.getProductOfAllFactors | private static VarTensor getProductOfAllFactors(FactorGraph fg, Algebra s) {
"""
Gets the product of all the factors in the factor graph. If working in
the log-domain, this will do factor addition.
@return The product of all the factors.
"""
VarTensor joint = new VarTensor(s, new VarSet(), s.one())... | java | private static VarTensor getProductOfAllFactors(FactorGraph fg, Algebra s) {
VarTensor joint = new VarTensor(s, new VarSet(), s.one());
for (int a=0; a<fg.getNumFactors(); a++) {
Factor f = fg.getFactor(a);
VarTensor factor = safeNewVarTensor(s, f);
assert !factor.con... | [
"private",
"static",
"VarTensor",
"getProductOfAllFactors",
"(",
"FactorGraph",
"fg",
",",
"Algebra",
"s",
")",
"{",
"VarTensor",
"joint",
"=",
"new",
"VarTensor",
"(",
"s",
",",
"new",
"VarSet",
"(",
")",
",",
"s",
".",
"one",
"(",
")",
")",
";",
"for... | Gets the product of all the factors in the factor graph. If working in
the log-domain, this will do factor addition.
@return The product of all the factors. | [
"Gets",
"the",
"product",
"of",
"all",
"the",
"factors",
"in",
"the",
"factor",
"graph",
".",
"If",
"working",
"in",
"the",
"log",
"-",
"domain",
"this",
"will",
"do",
"factor",
"addition",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/inf/BruteForceInferencer.java#L53-L62 |
Netflix/conductor | mysql-persistence/src/main/java/com/netflix/conductor/dao/mysql/MySQLBaseDAO.java | MySQLBaseDAO.getWithTransaction | protected <R> R getWithTransaction(TransactionalFunction<R> function) {
"""
Initialize a new transactional {@link Connection} from {@link #dataSource} and pass it to {@literal function}.
<p>
Successful executions of {@literal function} will result in a commit and return of
{@link TransactionalFunction#apply(Con... | java | protected <R> R getWithTransaction(TransactionalFunction<R> function) {
Instant start = Instant.now();
LazyToString callingMethod = getCallingMethod();
logger.trace("{} : starting transaction", callingMethod);
try(Connection tx = dataSource.getConnection()) {
boolean previou... | [
"protected",
"<",
"R",
">",
"R",
"getWithTransaction",
"(",
"TransactionalFunction",
"<",
"R",
">",
"function",
")",
"{",
"Instant",
"start",
"=",
"Instant",
".",
"now",
"(",
")",
";",
"LazyToString",
"callingMethod",
"=",
"getCallingMethod",
"(",
")",
";",
... | Initialize a new transactional {@link Connection} from {@link #dataSource} and pass it to {@literal function}.
<p>
Successful executions of {@literal function} will result in a commit and return of
{@link TransactionalFunction#apply(Connection)}.
<p>
If any {@link Throwable} thrown from {@code TransactionalFunction#app... | [
"Initialize",
"a",
"new",
"transactional",
"{",
"@link",
"Connection",
"}",
"from",
"{",
"@link",
"#dataSource",
"}",
"and",
"pass",
"it",
"to",
"{",
"@literal",
"function",
"}",
".",
"<p",
">",
"Successful",
"executions",
"of",
"{",
"@literal",
"function",
... | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/mysql-persistence/src/main/java/com/netflix/conductor/dao/mysql/MySQLBaseDAO.java#L89-L112 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/core/liblas/LiblasWrapper.java | LiblasWrapper.loadNativeLibrary | public static String loadNativeLibrary( String nativeLibPath, String libName ) {
"""
Loads the native libs creating the native wrapper.
@param nativeLibPath the path to add or <code>null</code>.
@param libName the lib name or <code>null</code>, in which case "las_c" is used.
@return <code>null</code>, if the ... | java | public static String loadNativeLibrary( String nativeLibPath, String libName ) {
try {
String name = "las_c";
if (libName == null)
libName = name;
if (nativeLibPath != null) {
NativeLibrary.addSearchPath(libName, nativeLibPath);
}
... | [
"public",
"static",
"String",
"loadNativeLibrary",
"(",
"String",
"nativeLibPath",
",",
"String",
"libName",
")",
"{",
"try",
"{",
"String",
"name",
"=",
"\"las_c\"",
";",
"if",
"(",
"libName",
"==",
"null",
")",
"libName",
"=",
"name",
";",
"if",
"(",
"... | Loads the native libs creating the native wrapper.
@param nativeLibPath the path to add or <code>null</code>.
@param libName the lib name or <code>null</code>, in which case "las_c" is used.
@return <code>null</code>, if the lib could be loaded, the error string else. | [
"Loads",
"the",
"native",
"libs",
"creating",
"the",
"native",
"wrapper",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/core/liblas/LiblasWrapper.java#L55-L68 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java | Value.timestampArray | public static Value timestampArray(@Nullable Iterable<Timestamp> v) {
"""
Returns an {@code ARRAY<TIMESTAMP>} value.
@param v the source of element values. This may be {@code null} to produce a value for which
{@code isNull()} is {@code true}. Individual elements may also be {@code null}.
"""
return ne... | java | public static Value timestampArray(@Nullable Iterable<Timestamp> v) {
return new TimestampArrayImpl(v == null, v == null ? null : immutableCopyOf(v));
} | [
"public",
"static",
"Value",
"timestampArray",
"(",
"@",
"Nullable",
"Iterable",
"<",
"Timestamp",
">",
"v",
")",
"{",
"return",
"new",
"TimestampArrayImpl",
"(",
"v",
"==",
"null",
",",
"v",
"==",
"null",
"?",
"null",
":",
"immutableCopyOf",
"(",
"v",
"... | Returns an {@code ARRAY<TIMESTAMP>} value.
@param v the source of element values. This may be {@code null} to produce a value for which
{@code isNull()} is {@code true}. Individual elements may also be {@code null}. | [
"Returns",
"an",
"{",
"@code",
"ARRAY<TIMESTAMP",
">",
"}",
"value",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java#L312-L314 |
zafarkhaja/jsemver | src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java | ExpressionParser.versionFor | private Version versionFor(int major, int minor, int patch) {
"""
Creates a {@code Version} instance for the
specified major, minor and patch versions.
@param major the major version number
@param minor the minor version number
@param patch the patch version number
@return the version for the specified majo... | java | private Version versionFor(int major, int minor, int patch) {
return Version.forIntegers(major, minor, patch);
} | [
"private",
"Version",
"versionFor",
"(",
"int",
"major",
",",
"int",
"minor",
",",
"int",
"patch",
")",
"{",
"return",
"Version",
".",
"forIntegers",
"(",
"major",
",",
"minor",
",",
"patch",
")",
";",
"}"
] | Creates a {@code Version} instance for the
specified major, minor and patch versions.
@param major the major version number
@param minor the minor version number
@param patch the patch version number
@return the version for the specified major, minor and patch versions | [
"Creates",
"a",
"{",
"@code",
"Version",
"}",
"instance",
"for",
"the",
"specified",
"major",
"minor",
"and",
"patch",
"versions",
"."
] | train | https://github.com/zafarkhaja/jsemver/blob/1f4996ea3dab06193c378fd66fd4f8fdc8334cc6/src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java#L482-L484 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java | OmemoMessageBuilder.setMessage | private void setMessage(String message) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, UnsupportedEncodingException, BadPaddingException, IllegalBlockSizeException {
"""
Encrypt the message with the aes key.
Move the AuthTag from the end of the ci... | java | private void setMessage(String message) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, UnsupportedEncodingException, BadPaddingException, IllegalBlockSizeException {
if (message == null) {
return;
}
// Encrypt messag... | [
"private",
"void",
"setMessage",
"(",
"String",
"message",
")",
"throws",
"NoSuchPaddingException",
",",
"NoSuchAlgorithmException",
",",
"InvalidAlgorithmParameterException",
",",
"InvalidKeyException",
",",
"UnsupportedEncodingException",
",",
"BadPaddingException",
",",
"I... | Encrypt the message with the aes key.
Move the AuthTag from the end of the cipherText to the end of the messageKey afterwards.
This prevents an attacker which compromised one recipient device to switch out the cipherText for other recipients.
@see <a href="https://conversations.im/omemo/audit.pdf">OMEMO security audit<... | [
"Encrypt",
"the",
"message",
"with",
"the",
"aes",
"key",
".",
"Move",
"the",
"AuthTag",
"from",
"the",
"end",
"of",
"the",
"cipherText",
"to",
"the",
"end",
"of",
"the",
"messageKey",
"afterwards",
".",
"This",
"prevents",
"an",
"attacker",
"which",
"comp... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java#L157-L181 |
knowm/XChange | xchange-wex/src/main/java/org/knowm/xchange/wex/v3/service/WexMarketDataServiceRaw.java | WexMarketDataServiceRaw.getBTCETrades | public WexTradesWrapper getBTCETrades(String pairs, int size) throws IOException {
"""
Get recent trades from exchange
@param pairs Dash-delimited string of currency pairs to retrieve (e.g. "btc_usd-ltc_btc")
@param size Integer value from 1 to 2000 -> get corresponding number of items
@return WexTradesWrappe... | java | public WexTradesWrapper getBTCETrades(String pairs, int size) throws IOException {
size = size < 1 ? 1 : (size > FULL_SIZE ? FULL_SIZE : size);
return btce.getTrades(pairs.toLowerCase(), size, 1);
} | [
"public",
"WexTradesWrapper",
"getBTCETrades",
"(",
"String",
"pairs",
",",
"int",
"size",
")",
"throws",
"IOException",
"{",
"size",
"=",
"size",
"<",
"1",
"?",
"1",
":",
"(",
"size",
">",
"FULL_SIZE",
"?",
"FULL_SIZE",
":",
"size",
")",
";",
"return",
... | Get recent trades from exchange
@param pairs Dash-delimited string of currency pairs to retrieve (e.g. "btc_usd-ltc_btc")
@param size Integer value from 1 to 2000 -> get corresponding number of items
@return WexTradesWrapper object
@throws IOException | [
"Get",
"recent",
"trades",
"from",
"exchange"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-wex/src/main/java/org/knowm/xchange/wex/v3/service/WexMarketDataServiceRaw.java#L64-L69 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RoutesInner.java | RoutesInner.createOrUpdate | public RouteInner createOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) {
"""
Creates or updates a route in the specified route table.
@param resourceGroupName The name of the resource group.
@param routeTableName The name of the route table.
@param rout... | java | public RouteInner createOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().last().body();
} | [
"public",
"RouteInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeTableName",
",",
"String",
"routeName",
",",
"RouteInner",
"routeParameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"r... | Creates or updates a route in the specified route table.
@param resourceGroupName The name of the resource group.
@param routeTableName The name of the route table.
@param routeName The name of the route.
@param routeParameters Parameters supplied to the create or update route operation.
@throws IllegalArgumentExcepti... | [
"Creates",
"or",
"updates",
"a",
"route",
"in",
"the",
"specified",
"route",
"table",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RoutesInner.java#L362-L364 |
michael-rapp/AndroidPreferenceActivity | example/src/main/java/de/mrapp/android/preference/activity/example/fragment/BehaviorPreferenceFragment.java | BehaviorPreferenceFragment.createOverrideBackButtonChangeListener | private OnPreferenceChangeListener createOverrideBackButtonChangeListener() {
"""
Creates a listener, which allows to adapt the behavior of the {@link PreferenceActivity} when
the value, which determines, whether the action bar's back button should be overwritten, has
been changed.
@return The listener, which... | java | private OnPreferenceChangeListener createOverrideBackButtonChangeListener() {
return new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(final Preference preference, final Object newValue) {
if (newValue != null) {
boolean o... | [
"private",
"OnPreferenceChangeListener",
"createOverrideBackButtonChangeListener",
"(",
")",
"{",
"return",
"new",
"OnPreferenceChangeListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onPreferenceChange",
"(",
"final",
"Preference",
"preference",
",",
"fina... | Creates a listener, which allows to adapt the behavior of the {@link PreferenceActivity} when
the value, which determines, whether the action bar's back button should be overwritten, has
been changed.
@return The listener, which has been created, as an instance of the type {@link
OnPreferenceChangeListener} | [
"Creates",
"a",
"listener",
"which",
"allows",
"to",
"adapt",
"the",
"behavior",
"of",
"the",
"{",
"@link",
"PreferenceActivity",
"}",
"when",
"the",
"value",
"which",
"determines",
"whether",
"the",
"action",
"bar",
"s",
"back",
"button",
"should",
"be",
"o... | train | https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/fragment/BehaviorPreferenceFragment.java#L44-L59 |
alkacon/opencms-core | src/org/opencms/loader/CmsTemplateContextManager.java | CmsTemplateContextManager.getContextInfoBean | public CmsTemplateContextInfo getContextInfoBean(CmsObject cms, HttpServletRequest request) {
"""
Creates a bean with information about the current template context, for use in the client-side code.<p>
@param cms the current CMS context
@param request the current request
@return the bean with the template c... | java | public CmsTemplateContextInfo getContextInfoBean(CmsObject cms, HttpServletRequest request) {
CmsTemplateContextInfo result = new CmsTemplateContextInfo();
CmsTemplateContext context = (CmsTemplateContext)request.getAttribute(ATTR_TEMPLATE_CONTEXT);
if (context != null) {
resul... | [
"public",
"CmsTemplateContextInfo",
"getContextInfoBean",
"(",
"CmsObject",
"cms",
",",
"HttpServletRequest",
"request",
")",
"{",
"CmsTemplateContextInfo",
"result",
"=",
"new",
"CmsTemplateContextInfo",
"(",
")",
";",
"CmsTemplateContext",
"context",
"=",
"(",
"CmsTem... | Creates a bean with information about the current template context, for use in the client-side code.<p>
@param cms the current CMS context
@param request the current request
@return the bean with the template context information | [
"Creates",
"a",
"bean",
"with",
"information",
"about",
"the",
"current",
"template",
"context",
"for",
"use",
"in",
"the",
"client",
"-",
"side",
"code",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsTemplateContextManager.java#L165-L203 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPPAbstractTimephasedWorkNormaliser.java | MPPAbstractTimephasedWorkNormaliser.getAssignmentWork | private Duration getAssignmentWork(ProjectCalendar calendar, TimephasedWork assignment) {
"""
Retrieves the pro-rata work carried out on a given day.
@param calendar current calendar
@param assignment current assignment.
@return assignment work duration
"""
Date assignmentStart = assignment.getStart... | java | private Duration getAssignmentWork(ProjectCalendar calendar, TimephasedWork assignment)
{
Date assignmentStart = assignment.getStart();
Date splitStart = assignmentStart;
Date splitFinishTime = calendar.getFinishTime(splitStart);
Date splitFinish = DateHelper.setTime(splitStart, splitFinishT... | [
"private",
"Duration",
"getAssignmentWork",
"(",
"ProjectCalendar",
"calendar",
",",
"TimephasedWork",
"assignment",
")",
"{",
"Date",
"assignmentStart",
"=",
"assignment",
".",
"getStart",
"(",
")",
";",
"Date",
"splitStart",
"=",
"assignmentStart",
";",
"Date",
... | Retrieves the pro-rata work carried out on a given day.
@param calendar current calendar
@param assignment current assignment.
@return assignment work duration | [
"Retrieves",
"the",
"pro",
"-",
"rata",
"work",
"carried",
"out",
"on",
"a",
"given",
"day",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPAbstractTimephasedWorkNormaliser.java#L260-L277 |
jenkinsci/jenkins | core/src/main/java/hudson/model/UpdateCenter.java | UpdateCenter.getPlugin | public @CheckForNull Plugin getPlugin(String artifactId, @CheckForNull VersionNumber minVersion) {
"""
Gets the plugin with the given name from the first {@link UpdateSite} to contain it.
@return Discovered {@link Plugin}. {@code null} if it cannot be found
"""
if (minVersion == null) {
re... | java | public @CheckForNull Plugin getPlugin(String artifactId, @CheckForNull VersionNumber minVersion) {
if (minVersion == null) {
return getPlugin(artifactId);
}
for (UpdateSite s : sites) {
Plugin p = s.getPlugin(artifactId);
if (p!=null) {
if (min... | [
"public",
"@",
"CheckForNull",
"Plugin",
"getPlugin",
"(",
"String",
"artifactId",
",",
"@",
"CheckForNull",
"VersionNumber",
"minVersion",
")",
"{",
"if",
"(",
"minVersion",
"==",
"null",
")",
"{",
"return",
"getPlugin",
"(",
"artifactId",
")",
";",
"}",
"f... | Gets the plugin with the given name from the first {@link UpdateSite} to contain it.
@return Discovered {@link Plugin}. {@code null} if it cannot be found | [
"Gets",
"the",
"plugin",
"with",
"the",
"given",
"name",
"from",
"the",
"first",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateCenter.java#L639-L651 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.escapeUriPath | public static void escapeUriPath(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform am URI path <strong>escape</strong> operation
on a <tt>Reader</tt> input using <tt>UTF-8</tt> as encoding,
writing results to a <tt>Writer</tt>.
</p>
<p>
The following are the only allo... | java | public static void escapeUriPath(final Reader reader, final Writer writer)
throws IOException {
escapeUriPath(reader, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"escapeUriPath",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeUriPath",
"(",
"reader",
",",
"writer",
",",
"DEFAULT_ENCODING",
")",
";",
"}"
] | <p>
Perform am URI path <strong>escape</strong> operation
on a <tt>Reader</tt> input using <tt>UTF-8</tt> as encoding,
writing results to a <tt>Writer</tt>.
</p>
<p>
The following are the only allowed chars in an URI path (will not be escaped):
</p>
<ul>
<li><tt>A-Z a-z 0-9</tt></li>
<li><tt>- . _ ~</tt></li>
<li><tt>!... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
"/",
"tt",
">",
"as",
"encoding",
"writing",
"r... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L797-L800 |
adyliu/jafka | src/main/java/io/jafka/utils/Utils.java | Utils.openChannel | @SuppressWarnings("resource")
public static FileChannel openChannel(File file, boolean mutable) throws IOException {
"""
open a readable or writeable FileChannel
@param file file object
@param mutable writeable
@return open the FileChannel
@throws IOException any io exception
"""
if (mutab... | java | @SuppressWarnings("resource")
public static FileChannel openChannel(File file, boolean mutable) throws IOException {
if (mutable) {
return new RandomAccessFile(file, "rw").getChannel();
}
return new FileInputStream(file).getChannel();
} | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"public",
"static",
"FileChannel",
"openChannel",
"(",
"File",
"file",
",",
"boolean",
"mutable",
")",
"throws",
"IOException",
"{",
"if",
"(",
"mutable",
")",
"{",
"return",
"new",
"RandomAccessFile",
"(",
"f... | open a readable or writeable FileChannel
@param file file object
@param mutable writeable
@return open the FileChannel
@throws IOException any io exception | [
"open",
"a",
"readable",
"or",
"writeable",
"FileChannel"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/utils/Utils.java#L420-L426 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHttpFilePut | public void doHttpFilePut(String url, HttpResponse result, Map<String, Object> headers, File file) {
"""
Performs PUT to supplied url of a file as binary data.
@param url url to post to.
@param result result containing request, its response will be filled.
@param headers headers to add.
@param file file contai... | java | public void doHttpFilePut(String url, HttpResponse result, Map<String, Object> headers, File file) {
httpClient.put(url, result, headers, file);
} | [
"public",
"void",
"doHttpFilePut",
"(",
"String",
"url",
",",
"HttpResponse",
"result",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"File",
"file",
")",
"{",
"httpClient",
".",
"put",
"(",
"url",
",",
"result",
",",
"headers",
",",
"... | Performs PUT to supplied url of a file as binary data.
@param url url to post to.
@param result result containing request, its response will be filled.
@param headers headers to add.
@param file file containing binary data to post. | [
"Performs",
"PUT",
"to",
"supplied",
"url",
"of",
"a",
"file",
"as",
"binary",
"data",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L307-L309 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.setCertificateIssuer | public IssuerBundle setCertificateIssuer(String vaultBaseUrl, String issuerName, String provider) {
"""
Sets the specified certificate issuer.
The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission.
@param vaultBaseUrl... | java | public IssuerBundle setCertificateIssuer(String vaultBaseUrl, String issuerName, String provider) {
return setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider).toBlocking().single().body();
} | [
"public",
"IssuerBundle",
"setCertificateIssuer",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"issuerName",
",",
"String",
"provider",
")",
"{",
"return",
"setCertificateIssuerWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"issuerName",
",",
"provider",
")",
"."... | Sets the specified certificate issuer.
The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param issuerName The name of the issuer.
@param p... | [
"Sets",
"the",
"specified",
"certificate",
"issuer",
".",
"The",
"SetCertificateIssuer",
"operation",
"adds",
"or",
"updates",
"the",
"specified",
"certificate",
"issuer",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"setissuers",
"permission",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L5900-L5902 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.el.3.0/src/javax/el/ELContext.java | ELContext.notifyPropertyResolved | public void notifyPropertyResolved(Object base, Object property) {
"""
Notify interested listeners that a property has been resolved.
@param base The object on which the property was resolved
@param property The property that was resolved
@since EL 3.0
"""
for (EvaluationListener listener : ... | java | public void notifyPropertyResolved(Object base, Object property) {
for (EvaluationListener listener : listeners) {
try {
listener.propertyResolved(this, base, property);
} catch (Throwable t) {
Util.handleThrowable(t);
// Ignore - no option... | [
"public",
"void",
"notifyPropertyResolved",
"(",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"for",
"(",
"EvaluationListener",
"listener",
":",
"listeners",
")",
"{",
"try",
"{",
"listener",
".",
"propertyResolved",
"(",
"this",
",",
"base",
",",
... | Notify interested listeners that a property has been resolved.
@param base The object on which the property was resolved
@param property The property that was resolved
@since EL 3.0 | [
"Notify",
"interested",
"listeners",
"that",
"a",
"property",
"has",
"been",
"resolved",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.el.3.0/src/javax/el/ELContext.java#L205-L214 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/component/basic/AbstractComponent.java | AbstractComponent.createWave | private Wave createWave(final WaveGroup waveGroup, final WaveType waveType, final Class<?> componentClass, final WaveData<?>... waveData) {
"""
Build a wave object.
@param waveGroup the group of the wave
@param waveType the type of the wave
@param componentClass the component class if any
@param waveData wav... | java | private Wave createWave(final WaveGroup waveGroup, final WaveType waveType, final Class<?> componentClass, final WaveData<?>... waveData) {
final Wave wave = wave()
.waveGroup(waveGroup)
.waveType(waveType)
.fromCla... | [
"private",
"Wave",
"createWave",
"(",
"final",
"WaveGroup",
"waveGroup",
",",
"final",
"WaveType",
"waveType",
",",
"final",
"Class",
"<",
"?",
">",
"componentClass",
",",
"final",
"WaveData",
"<",
"?",
">",
"...",
"waveData",
")",
"{",
"final",
"Wave",
"w... | Build a wave object.
@param waveGroup the group of the wave
@param waveType the type of the wave
@param componentClass the component class if any
@param waveData wave data to use
@return the wave built | [
"Build",
"a",
"wave",
"object",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/component/basic/AbstractComponent.java#L311-L324 |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.getFieldGetter | private static CtMethod getFieldGetter(CtField field, CtClass clazz) throws NotFoundException {
"""
Returns the getter to a given field of the given class object and returns null if there is no getter for the
given field defined.
"""
if (field == null) {
return null;
}
retu... | java | private static CtMethod getFieldGetter(CtField field, CtClass clazz) throws NotFoundException {
if (field == null) {
return null;
}
return getFieldGetter(field, clazz, false);
} | [
"private",
"static",
"CtMethod",
"getFieldGetter",
"(",
"CtField",
"field",
",",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"getFieldGetter",
"(",
"field",
",... | Returns the getter to a given field of the given class object and returns null if there is no getter for the
given field defined. | [
"Returns",
"the",
"getter",
"to",
"a",
"given",
"field",
"of",
"the",
"given",
"class",
"object",
"and",
"returns",
"null",
"if",
"there",
"is",
"no",
"getter",
"for",
"the",
"given",
"field",
"defined",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L435-L440 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.getComputeNodeRemoteDesktop | public String getComputeNodeRemoteDesktop(String poolId, String nodeId) throws BatchErrorException, IOException {
"""
Gets a Remote Desktop Protocol (RDP) file for the specified node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node for which to get a Re... | java | public String getComputeNodeRemoteDesktop(String poolId, String nodeId) throws BatchErrorException, IOException {
return getComputeNodeRemoteDesktop(poolId, nodeId, null);
} | [
"public",
"String",
"getComputeNodeRemoteDesktop",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"getComputeNodeRemoteDesktop",
"(",
"poolId",
",",
"nodeId",
",",
"null",
")",
";",
"}"
] | Gets a Remote Desktop Protocol (RDP) file for the specified node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node for which to get a Remote Desktop file.
@return The RDP file contents.
@throws BatchErrorException Exception thrown when an error response is recei... | [
"Gets",
"a",
"Remote",
"Desktop",
"Protocol",
"(",
"RDP",
")",
"file",
"for",
"the",
"specified",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L441-L443 |
dwdyer/reportng | reportng/src/java/main/org/uncommons/reportng/AbstractReporter.java | AbstractReporter.copyStream | protected void copyStream(File outputDirectory,
InputStream stream,
String targetFileName) throws IOException {
"""
Helper method to copy the contents of a stream to a file.
@param outputDirectory The directory in which the new file is created.
@param s... | java | protected void copyStream(File outputDirectory,
InputStream stream,
String targetFileName) throws IOException
{
File resourceFile = new File(outputDirectory, targetFileName);
BufferedReader reader = null;
Writer writer = null;
... | [
"protected",
"void",
"copyStream",
"(",
"File",
"outputDirectory",
",",
"InputStream",
"stream",
",",
"String",
"targetFileName",
")",
"throws",
"IOException",
"{",
"File",
"resourceFile",
"=",
"new",
"File",
"(",
"outputDirectory",
",",
"targetFileName",
")",
";"... | Helper method to copy the contents of a stream to a file.
@param outputDirectory The directory in which the new file is created.
@param stream The stream to copy.
@param targetFileName The file to write the stream contents to.
@throws IOException If the stream cannot be copied. | [
"Helper",
"method",
"to",
"copy",
"the",
"contents",
"of",
"a",
"stream",
"to",
"a",
"file",
"."
] | train | https://github.com/dwdyer/reportng/blob/df11f9cd9ab3fb5847fbba94ed3098ae0448f770/reportng/src/java/main/org/uncommons/reportng/AbstractReporter.java#L168-L200 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/transform/Transformation.java | Transformation.addParameter | public void addParameter(String name, Object value) {
"""
Add a named parameter.
@param name name of the parameter - must not be null
@param value value of the parameter - may be null
"""
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
... | java | public void addParameter(String name, Object value) {
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
params.put(name, value);
} | [
"public",
"void",
"addParameter",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"name must not be null\"",
")",
";",
"}",
"params",
".",
"put",
"(",
"n... | Add a named parameter.
@param name name of the parameter - must not be null
@param value value of the parameter - may be null | [
"Add",
"a",
"named",
"parameter",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/transform/Transformation.java#L105-L110 |
biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.getTranscriptDNASequence | public static DNASequence getTranscriptDNASequence(TwoBitFacade twoBitFacade, GeneChromosomePosition gcp) throws Exception {
"""
Extracts the DNA sequence transcribed from the input genetic coordinates.
@param twoBitFacade the facade that provide an access to a 2bit file
@param gcp The container with chromosom... | java | public static DNASequence getTranscriptDNASequence(TwoBitFacade twoBitFacade, GeneChromosomePosition gcp) throws Exception {
return getTranscriptDNASequence(twoBitFacade,gcp.getChromosome(),gcp.getExonStarts(), gcp.getExonEnds(), gcp.getCdsStart(), gcp.getCdsEnd(), gcp.getOrientation());
} | [
"public",
"static",
"DNASequence",
"getTranscriptDNASequence",
"(",
"TwoBitFacade",
"twoBitFacade",
",",
"GeneChromosomePosition",
"gcp",
")",
"throws",
"Exception",
"{",
"return",
"getTranscriptDNASequence",
"(",
"twoBitFacade",
",",
"gcp",
".",
"getChromosome",
"(",
"... | Extracts the DNA sequence transcribed from the input genetic coordinates.
@param twoBitFacade the facade that provide an access to a 2bit file
@param gcp The container with chromosomal positions
@return the DNA sequence transcribed from the input genetic coordinates | [
"Extracts",
"the",
"DNA",
"sequence",
"transcribed",
"from",
"the",
"input",
"genetic",
"coordinates",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L939-L941 |
tvbarthel/BlurDialogFragment | lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/RenderScriptBlurHelper.java | RenderScriptBlurHelper.doBlur | public static Bitmap doBlur(Bitmap sentBitmap, int radius, boolean canReuseInBitmap, Context context) {
"""
blur a given bitmap
@param sentBitmap bitmap to blur
@param radius blur radius
@param canReuseInBitmap true if bitmap must be reused without blur
@param context used by RenderS... | java | public static Bitmap doBlur(Bitmap sentBitmap, int radius, boolean canReuseInBitmap, Context context) {
Bitmap bitmap;
if (canReuseInBitmap) {
bitmap = sentBitmap;
} else {
bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
}
if (bitmap.getConfig() ... | [
"public",
"static",
"Bitmap",
"doBlur",
"(",
"Bitmap",
"sentBitmap",
",",
"int",
"radius",
",",
"boolean",
"canReuseInBitmap",
",",
"Context",
"context",
")",
"{",
"Bitmap",
"bitmap",
";",
"if",
"(",
"canReuseInBitmap",
")",
"{",
"bitmap",
"=",
"sentBitmap",
... | blur a given bitmap
@param sentBitmap bitmap to blur
@param radius blur radius
@param canReuseInBitmap true if bitmap must be reused without blur
@param context used by RenderScript, can be null if RenderScript disabled
@return blurred bitmap | [
"blur",
"a",
"given",
"bitmap"
] | train | https://github.com/tvbarthel/BlurDialogFragment/blob/0afc03c98ea144e1f5b0eb6e510ba6440499111d/lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/RenderScriptBlurHelper.java#L38-L71 |
elibom/jogger | src/main/java/com/elibom/jogger/http/servlet/multipart/ParameterParser.java | ParameterParser.isOneOf | private boolean isOneOf(char ch, final char[] charray) {
"""
Tests if the given character is present in the array of characters.
@param ch the character to test for presense in the array of characters
@param charray the array of characters to test against
@return <tt>true</tt> if the character is present in... | java | private boolean isOneOf(char ch, final char[] charray) {
boolean result = false;
for (int i = 0; i < charray.length; i++) {
if (ch == charray[i]) {
result = true;
break;
}
}
return result;
} | [
"private",
"boolean",
"isOneOf",
"(",
"char",
"ch",
",",
"final",
"char",
"[",
"]",
"charray",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"charray",
".",
"length",
";",
"i",
"++",
")",
"{",
... | Tests if the given character is present in the array of characters.
@param ch the character to test for presense in the array of characters
@param charray the array of characters to test against
@return <tt>true</tt> if the character is present in the array of characters, <tt>false</tt> otherwise. | [
"Tests",
"if",
"the",
"given",
"character",
"is",
"present",
"in",
"the",
"array",
"of",
"characters",
"."
] | train | https://github.com/elibom/jogger/blob/d5892ff45e76328d444a68b5a38c26e7bdd0692b/src/main/java/com/elibom/jogger/http/servlet/multipart/ParameterParser.java#L115-L124 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.beforeClosingBrace | public void beforeClosingBrace(StringBuilder sb, boolean pretty, String indent, String... attributeNames) {
"""
Override in subclasses in order to inject custom content into Json just before the closing brace.
<p>To keep the formatting, it is recommended to implement this method as the example below.
<blockq... | java | public void beforeClosingBrace(StringBuilder sb, boolean pretty, String indent, String... attributeNames) {
StringWriter writer = new StringWriter();
beforeClosingBrace(pretty, indent, writer);
sb.append(writer.toString());
} | [
"public",
"void",
"beforeClosingBrace",
"(",
"StringBuilder",
"sb",
",",
"boolean",
"pretty",
",",
"String",
"indent",
",",
"String",
"...",
"attributeNames",
")",
"{",
"StringWriter",
"writer",
"=",
"new",
"StringWriter",
"(",
")",
";",
"beforeClosingBrace",
"(... | Override in subclasses in order to inject custom content into Json just before the closing brace.
<p>To keep the formatting, it is recommended to implement this method as the example below.
<blockquote><pre>
sb.append(',');
if (pretty) { sb.append('\n').append(indent); }
sb.append("\"test\":\"...\"");
</pre></blockqu... | [
"Override",
"in",
"subclasses",
"in",
"order",
"to",
"inject",
"custom",
"content",
"into",
"Json",
"just",
"before",
"the",
"closing",
"brace",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L1178-L1182 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/index/IndexSettingsReader.java | IndexSettingsReader.readUpdateSettings | public static String readUpdateSettings(String root, String index) {
"""
Read index settings
@param root dir within the classpath
@param index index name
@return Update Settings
"""
return readSettings(root, index, Defaults.UpdateIndexSettingsFileName);
} | java | public static String readUpdateSettings(String root, String index) {
return readSettings(root, index, Defaults.UpdateIndexSettingsFileName);
} | [
"public",
"static",
"String",
"readUpdateSettings",
"(",
"String",
"root",
",",
"String",
"index",
")",
"{",
"return",
"readSettings",
"(",
"root",
",",
"index",
",",
"Defaults",
".",
"UpdateIndexSettingsFileName",
")",
";",
"}"
] | Read index settings
@param root dir within the classpath
@param index index name
@return Update Settings | [
"Read",
"index",
"settings"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/index/IndexSettingsReader.java#L80-L82 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/format/FastDatePrinter.java | FastDatePrinter.selectNumberRule | protected NumberRule selectNumberRule(final int field, final int padding) {
"""
<p>
Gets an appropriate rule for the padding required.
</p>
@param field the field to get a rule for
@param padding the padding required
@return a new rule with the correct padding
"""
switch (padding) {
case 1:
ret... | java | protected NumberRule selectNumberRule(final int field, final int padding) {
switch (padding) {
case 1:
return new UnpaddedNumberField(field);
case 2:
return new TwoDigitNumberField(field);
default:
return new PaddedNumberField(field, padding);
}
} | [
"protected",
"NumberRule",
"selectNumberRule",
"(",
"final",
"int",
"field",
",",
"final",
"int",
"padding",
")",
"{",
"switch",
"(",
"padding",
")",
"{",
"case",
"1",
":",
"return",
"new",
"UnpaddedNumberField",
"(",
"field",
")",
";",
"case",
"2",
":",
... | <p>
Gets an appropriate rule for the padding required.
</p>
@param field the field to get a rule for
@param padding the padding required
@return a new rule with the correct padding | [
"<p",
">",
"Gets",
"an",
"appropriate",
"rule",
"for",
"the",
"padding",
"required",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDatePrinter.java#L275-L284 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LogGammaDistribution.java | LogGammaDistribution.quantile | public static double quantile(double p, double k, double theta, double shift) {
"""
Compute probit (inverse cdf) for LogGamma distributions.
@param p Probability
@param k k, alpha aka. "shape" parameter
@param theta Theta = 1.0/Beta aka. "scaling" parameter
@param shift Shift parameter
@return Probit for Ga... | java | public static double quantile(double p, double k, double theta, double shift) {
return FastMath.exp(GammaDistribution.quantile(p, k, theta)) + shift;
} | [
"public",
"static",
"double",
"quantile",
"(",
"double",
"p",
",",
"double",
"k",
",",
"double",
"theta",
",",
"double",
"shift",
")",
"{",
"return",
"FastMath",
".",
"exp",
"(",
"GammaDistribution",
".",
"quantile",
"(",
"p",
",",
"k",
",",
"theta",
"... | Compute probit (inverse cdf) for LogGamma distributions.
@param p Probability
@param k k, alpha aka. "shape" parameter
@param theta Theta = 1.0/Beta aka. "scaling" parameter
@param shift Shift parameter
@return Probit for Gamma distribution | [
"Compute",
"probit",
"(",
"inverse",
"cdf",
")",
"for",
"LogGamma",
"distributions",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LogGammaDistribution.java#L223-L225 |
apache/incubator-gobblin | gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/r2/R2RestRequestBuilder.java | R2RestRequestBuilder.addPayload | protected int addPayload(RestRequestBuilder builder, String payload) {
"""
Add payload to request. By default, payload is sent as application/json
"""
if (payload == null || payload.length() == 0) {
return 0;
}
builder.setHeader(RestConstants.HEADER_CONTENT_TYPE, RestConstants.HEADER_VALUE_A... | java | protected int addPayload(RestRequestBuilder builder, String payload) {
if (payload == null || payload.length() == 0) {
return 0;
}
builder.setHeader(RestConstants.HEADER_CONTENT_TYPE, RestConstants.HEADER_VALUE_APPLICATION_JSON);
try {
DataMap data = JACKSON_DATA_CODEC.stringToMap(payload);... | [
"protected",
"int",
"addPayload",
"(",
"RestRequestBuilder",
"builder",
",",
"String",
"payload",
")",
"{",
"if",
"(",
"payload",
"==",
"null",
"||",
"payload",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"builder",
".",
"set... | Add payload to request. By default, payload is sent as application/json | [
"Add",
"payload",
"to",
"request",
".",
"By",
"default",
"payload",
"is",
"sent",
"as",
"application",
"/",
"json"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/r2/R2RestRequestBuilder.java#L107-L121 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/Type1Font.java | Type1Font.writeFont | void writeFont(PdfWriter writer, PdfIndirectReference ref, Object params[]) throws DocumentException, IOException {
"""
Outputs to the writer the font dictionaries and streams.
@param writer the writer for this document
@param ref the font indirect reference
@param params several parameters that depend on the f... | java | void writeFont(PdfWriter writer, PdfIndirectReference ref, Object params[]) throws DocumentException, IOException {
int firstChar = ((Integer)params[0]).intValue();
int lastChar = ((Integer)params[1]).intValue();
byte shortTag[] = (byte[])params[2];
boolean subsetp = ((Boolean)params[3])... | [
"void",
"writeFont",
"(",
"PdfWriter",
"writer",
",",
"PdfIndirectReference",
"ref",
",",
"Object",
"params",
"[",
"]",
")",
"throws",
"DocumentException",
",",
"IOException",
"{",
"int",
"firstChar",
"=",
"(",
"(",
"Integer",
")",
"params",
"[",
"0",
"]",
... | Outputs to the writer the font dictionaries and streams.
@param writer the writer for this document
@param ref the font indirect reference
@param params several parameters that depend on the font type
@throws IOException on error
@throws DocumentException error in generating the object | [
"Outputs",
"to",
"the",
"writer",
"the",
"font",
"dictionaries",
"and",
"streams",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/Type1Font.java#L653-L679 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IterableExtensions.java | IterableExtensions.findLast | public static <T> T findLast(Iterable<T> iterable, Functions.Function1<? super T, Boolean> predicate) {
"""
Finds the last element in the given iterable that fulfills the predicate. If none is found or the iterable is
empty, <code>null</code> is returned.
@param iterable
the iterable. May not be <code>null</c... | java | public static <T> T findLast(Iterable<T> iterable, Functions.Function1<? super T, Boolean> predicate) {
if (predicate == null)
throw new NullPointerException("predicate");
if (iterable instanceof List<?>) {
List<T> list = (List<T>) iterable;
ListIterator<T> iterator = list.listIterator(list.size());
whi... | [
"public",
"static",
"<",
"T",
">",
"T",
"findLast",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Functions",
".",
"Function1",
"<",
"?",
"super",
"T",
",",
"Boolean",
">",
"predicate",
")",
"{",
"if",
"(",
"predicate",
"==",
"null",
")",
"throw"... | Finds the last element in the given iterable that fulfills the predicate. If none is found or the iterable is
empty, <code>null</code> is returned.
@param iterable
the iterable. May not be <code>null</code>.
@param predicate
the predicate. May not be <code>null</code>.
@return the last element in the iterable for whic... | [
"Finds",
"the",
"last",
"element",
"in",
"the",
"given",
"iterable",
"that",
"fulfills",
"the",
"predicate",
".",
"If",
"none",
"is",
"found",
"or",
"the",
"iterable",
"is",
"empty",
"<code",
">",
"null<",
"/",
"code",
">",
"is",
"returned",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IterableExtensions.java#L94-L109 |
apache/flink | flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/data/PythonSingleInputSender.java | PythonSingleInputSender.sendBuffer | public int sendBuffer(SingleElementPushBackIterator<IN> input) throws IOException {
"""
Extracts records from an iterator and writes them to the memory-mapped file. This method assumes that all values
in the iterator are of the same type. This method does NOT take care of synchronization. The caller must
guarant... | java | public int sendBuffer(SingleElementPushBackIterator<IN> input) throws IOException {
if (serializer == null) {
IN value = input.next();
serializer = getSerializer(value);
input.pushBack(value);
}
return sendBuffer(input, serializer);
} | [
"public",
"int",
"sendBuffer",
"(",
"SingleElementPushBackIterator",
"<",
"IN",
">",
"input",
")",
"throws",
"IOException",
"{",
"if",
"(",
"serializer",
"==",
"null",
")",
"{",
"IN",
"value",
"=",
"input",
".",
"next",
"(",
")",
";",
"serializer",
"=",
... | Extracts records from an iterator and writes them to the memory-mapped file. This method assumes that all values
in the iterator are of the same type. This method does NOT take care of synchronization. The caller must
guarantee that the file may be written to before calling this method.
@param input iterator containin... | [
"Extracts",
"records",
"from",
"an",
"iterator",
"and",
"writes",
"them",
"to",
"the",
"memory",
"-",
"mapped",
"file",
".",
"This",
"method",
"assumes",
"that",
"all",
"values",
"in",
"the",
"iterator",
"are",
"of",
"the",
"same",
"type",
".",
"This",
"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/data/PythonSingleInputSender.java#L49-L56 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsAttributeHandler.java | CmsAttributeHandler.addComplexChoiceValue | private void addComplexChoiceValue(CmsAttributeValueView reference, List<String> choicePath) {
"""
Adds a new complex value which corresponds to a choice element.<p>
@param reference the reference view
@param choicePath the path of choice attribute names
"""
CmsEntity value = m_entityBackEnd.cre... | java | private void addComplexChoiceValue(CmsAttributeValueView reference, List<String> choicePath) {
CmsEntity value = m_entityBackEnd.createEntity(null, getAttributeType().getId());
CmsEntity parentValue = value;
for (String attributeChoice : choicePath) {
CmsType choiceType = m_ent... | [
"private",
"void",
"addComplexChoiceValue",
"(",
"CmsAttributeValueView",
"reference",
",",
"List",
"<",
"String",
">",
"choicePath",
")",
"{",
"CmsEntity",
"value",
"=",
"m_entityBackEnd",
".",
"createEntity",
"(",
"null",
",",
"getAttributeType",
"(",
")",
".",
... | Adds a new complex value which corresponds to a choice element.<p>
@param reference the reference view
@param choicePath the path of choice attribute names | [
"Adds",
"a",
"new",
"complex",
"value",
"which",
"corresponds",
"to",
"a",
"choice",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsAttributeHandler.java#L1177-L1201 |
craterdog/java-security-framework | java-secure-messaging-api/src/main/java/craterdog/security/MessageCryptex.java | MessageCryptex.decryptString | public final String decryptString(SecretKey sharedKey, byte[] encryptedString) {
"""
This method decrypts a string using a shared key.
@param sharedKey The shared key used for the encryption.
@param encryptedString The encrypted string.
@return The decrypted string.
"""
logger.entry();
t... | java | public final String decryptString(SecretKey sharedKey, byte[] encryptedString) {
logger.entry();
try (ByteArrayInputStream input = new ByteArrayInputStream(encryptedString);
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
decryptStream(sharedKey, input, outp... | [
"public",
"final",
"String",
"decryptString",
"(",
"SecretKey",
"sharedKey",
",",
"byte",
"[",
"]",
"encryptedString",
")",
"{",
"logger",
".",
"entry",
"(",
")",
";",
"try",
"(",
"ByteArrayInputStream",
"input",
"=",
"new",
"ByteArrayInputStream",
"(",
"encry... | This method decrypts a string using a shared key.
@param sharedKey The shared key used for the encryption.
@param encryptedString The encrypted string.
@return The decrypted string. | [
"This",
"method",
"decrypts",
"a",
"string",
"using",
"a",
"shared",
"key",
"."
] | train | https://github.com/craterdog/java-security-framework/blob/a5634c19812d473b608bc11060f5cbb4b4b0b5da/java-secure-messaging-api/src/main/java/craterdog/security/MessageCryptex.java#L170-L185 |
lessthanoptimal/ddogleg | src/org/ddogleg/clustering/gmm/GaussianGmm_F64.java | GaussianGmm_F64.addCovariance | public void addCovariance( double[] difference , double responsibility ) {
"""
Helper function for computing Gaussian parameters. Adds the difference between point and mean to covariance,
adjusted by the weight.
"""
int N = mean.numRows;
for (int i = 0; i < N; i++) {
for (int j = i; j < N; j++) {
... | java | public void addCovariance( double[] difference , double responsibility ) {
int N = mean.numRows;
for (int i = 0; i < N; i++) {
for (int j = i; j < N; j++) {
covariance.data[i*N+j] += responsibility*difference[i]*difference[j];
}
}
for (int i = 0; i < N; i++) {
for (int j = 0; j < i; j++) {
cov... | [
"public",
"void",
"addCovariance",
"(",
"double",
"[",
"]",
"difference",
",",
"double",
"responsibility",
")",
"{",
"int",
"N",
"=",
"mean",
".",
"numRows",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N",
";",
"i",
"++",
")",
"{",
"fo... | Helper function for computing Gaussian parameters. Adds the difference between point and mean to covariance,
adjusted by the weight. | [
"Helper",
"function",
"for",
"computing",
"Gaussian",
"parameters",
".",
"Adds",
"the",
"difference",
"between",
"point",
"and",
"mean",
"to",
"covariance",
"adjusted",
"by",
"the",
"weight",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/clustering/gmm/GaussianGmm_F64.java#L73-L86 |
duracloud/snapshot | snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java | SnapshotResource.updateHistory | @Path(" {
"""
Updates a snapshot's history
@param snapshotId - a snapshot's ID or it's alternate ID
@param params - JSON object that contains the history String and a
Boolean of whether this request is using a snapshot's ID
or an alternate ID
@return
"""snapshotId}/history")
@POST
@Consumes(... | java | @Path("{snapshotId}/history")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updateHistory(@PathParam("snapshotId") String snapshotId,
UpdateSnapshotHistoryBridgeParameters params) {
try {
if (params... | [
"@",
"Path",
"(",
"\"{snapshotId}/history\"",
")",
"@",
"POST",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"updateHistory",
"(",
"@",
"PathParam",
"(",
... | Updates a snapshot's history
@param snapshotId - a snapshot's ID or it's alternate ID
@param params - JSON object that contains the history String and a
Boolean of whether this request is using a snapshot's ID
or an alternate ID
@return | [
"Updates",
"a",
"snapshot",
"s",
"history"
] | train | https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java#L653-L709 |
ykrasik/jaci | jaci-cli-core/src/main/java/com/github/ykrasik/jaci/cli/hierarchy/CliSystemCommandFactory.java | CliSystemCommandFactory.from | public static CliDirectory from(CliCommandHierarchy hierarchy) {
"""
Create a directory containing all system commands. It is convenient to store all system commands in a directory.
Most system commands require an already built {@link CliCommandHierarchy}, but system commands are also a part
of the CliCommandHie... | java | public static CliDirectory from(CliCommandHierarchy hierarchy) {
final Identifier identifier = new Identifier("system", "System commands");
final CliSystemCommandFactory factory = new CliSystemCommandFactory(hierarchy);
return CliDirectory.from(
identifier,
factory.create... | [
"public",
"static",
"CliDirectory",
"from",
"(",
"CliCommandHierarchy",
"hierarchy",
")",
"{",
"final",
"Identifier",
"identifier",
"=",
"new",
"Identifier",
"(",
"\"system\"",
",",
"\"System commands\"",
")",
";",
"final",
"CliSystemCommandFactory",
"factory",
"=",
... | Create a directory containing all system commands. It is convenient to store all system commands in a directory.
Most system commands require an already built {@link CliCommandHierarchy}, but system commands are also a part
of the CliCommandHierarchy, creating a circular dependency. This is resolved in the CliCommandHi... | [
"Create",
"a",
"directory",
"containing",
"all",
"system",
"commands",
".",
"It",
"is",
"convenient",
"to",
"store",
"all",
"system",
"commands",
"in",
"a",
"directory",
".",
"Most",
"system",
"commands",
"require",
"an",
"already",
"built",
"{",
"@link",
"C... | train | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-cli-core/src/main/java/com/github/ykrasik/jaci/cli/hierarchy/CliSystemCommandFactory.java#L125-L134 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/util/BeanDefinitionParserUtils.java | BeanDefinitionParserUtils.registerBean | public static BeanDefinitionHolder registerBean(String beanId, Class<?> beanClass, ParserContext parserContext, boolean shouldFireEvents) {
"""
Creates new bean definition from bean class and registers new bean in parser registry.
Returns bean definition holder.
@param beanId
@param beanClass
@param parserCont... | java | public static BeanDefinitionHolder registerBean(String beanId, Class<?> beanClass, ParserContext parserContext, boolean shouldFireEvents) {
return registerBean(beanId, BeanDefinitionBuilder.genericBeanDefinition(beanClass).getBeanDefinition(), parserContext, shouldFireEvents);
} | [
"public",
"static",
"BeanDefinitionHolder",
"registerBean",
"(",
"String",
"beanId",
",",
"Class",
"<",
"?",
">",
"beanClass",
",",
"ParserContext",
"parserContext",
",",
"boolean",
"shouldFireEvents",
")",
"{",
"return",
"registerBean",
"(",
"beanId",
",",
"BeanD... | Creates new bean definition from bean class and registers new bean in parser registry.
Returns bean definition holder.
@param beanId
@param beanClass
@param parserContext
@param shouldFireEvents | [
"Creates",
"new",
"bean",
"definition",
"from",
"bean",
"class",
"and",
"registers",
"new",
"bean",
"in",
"parser",
"registry",
".",
"Returns",
"bean",
"definition",
"holder",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/util/BeanDefinitionParserUtils.java#L118-L120 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java | FileUtilities.writeFile | public static void writeFile( String text, File file ) throws IOException {
"""
Write text to a file in one line.
@param text the text to write.
@param file the file to write to.
@throws IOException
"""
try (BufferedWriter bw = new BufferedWriter(new FileWriter(file))) {
bw.write(te... | java | public static void writeFile( String text, File file ) throws IOException {
try (BufferedWriter bw = new BufferedWriter(new FileWriter(file))) {
bw.write(text);
}
} | [
"public",
"static",
"void",
"writeFile",
"(",
"String",
"text",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"BufferedWriter",
"bw",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWriter",
"(",
"file",
")",
")",
")",
"{",
"bw",
"."... | Write text to a file in one line.
@param text the text to write.
@param file the file to write to.
@throws IOException | [
"Write",
"text",
"to",
"a",
"file",
"in",
"one",
"line",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java#L218-L223 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/lang/RegexUtils.java | RegexUtils.matchesAny | public static boolean matchesAny(String str, List<String> regexes) {
"""
Returns true if the string matches (full match) any of the specified regexes.
@param str the string to match
@param regexes the regexes used for matching
@return true if the string matches (full match) one or more of the regexe... | java | public static boolean matchesAny(String str, List<String> regexes) {
return matchesAny(str, regexes, true);
} | [
"public",
"static",
"boolean",
"matchesAny",
"(",
"String",
"str",
",",
"List",
"<",
"String",
">",
"regexes",
")",
"{",
"return",
"matchesAny",
"(",
"str",
",",
"regexes",
",",
"true",
")",
";",
"}"
] | Returns true if the string matches (full match) any of the specified regexes.
@param str the string to match
@param regexes the regexes used for matching
@return true if the string matches (full match) one or more of the regexes | [
"Returns",
"true",
"if",
"the",
"string",
"matches",
"(",
"full",
"match",
")",
"any",
"of",
"the",
"specified",
"regexes",
"."
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/lang/RegexUtils.java#L61-L63 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/util/JMSServices.java | JMSServices.sendTextMessage | public void sendTextMessage(String queueName, String message, int delaySeconds)
throws NamingException, JMSException, ServiceLocatorException {
"""
Sends a JMS text message to a local queue.
@param queueName
local queues are based on logical queue names
@param message
the message string
@param d... | java | public void sendTextMessage(String queueName, String message, int delaySeconds)
throws NamingException, JMSException, ServiceLocatorException {
sendTextMessage(null, queueName, message, delaySeconds, null);
} | [
"public",
"void",
"sendTextMessage",
"(",
"String",
"queueName",
",",
"String",
"message",
",",
"int",
"delaySeconds",
")",
"throws",
"NamingException",
",",
"JMSException",
",",
"ServiceLocatorException",
"{",
"sendTextMessage",
"(",
"null",
",",
"queueName",
",",
... | Sends a JMS text message to a local queue.
@param queueName
local queues are based on logical queue names
@param message
the message string
@param delaySeconds
0 for immediate
@throws ServiceLocatorException | [
"Sends",
"a",
"JMS",
"text",
"message",
"to",
"a",
"local",
"queue",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/util/JMSServices.java#L117-L120 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpUtil.java | HttpUtil.urlWithForm | public static String urlWithForm(String url, String queryString, Charset charset, boolean isEncode) {
"""
将表单数据字符串加到URL中(用于GET表单提交)
@param url URL
@param queryString 表单数据字符串
@param charset 编码
@param isEncode 是否对键和值做转义处理
@return 拼接后的字符串
"""
if (StrUtil.isBlank(queryString)) {
// 无额外参数
if (StrU... | java | public static String urlWithForm(String url, String queryString, Charset charset, boolean isEncode) {
if (StrUtil.isBlank(queryString)) {
// 无额外参数
if (StrUtil.contains(url, '?')) {
// url中包含参数
return isEncode ? encodeParams(url, charset) : url;
}
return url;
}
// 始终有参数
final StrB... | [
"public",
"static",
"String",
"urlWithForm",
"(",
"String",
"url",
",",
"String",
"queryString",
",",
"Charset",
"charset",
",",
"boolean",
"isEncode",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"queryString",
")",
")",
"{",
"// 无额外参数\r",
"if",
"... | 将表单数据字符串加到URL中(用于GET表单提交)
@param url URL
@param queryString 表单数据字符串
@param charset 编码
@param isEncode 是否对键和值做转义处理
@return 拼接后的字符串 | [
"将表单数据字符串加到URL中(用于GET表单提交)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L623-L653 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.getServiceHealthStatus | @Given("^I get service '(.+?)' health status in cluster '(.+?)' and save it in variable '(.+?)'")
public void getServiceHealthStatus(String service, String cluster, String envVar) throws Exception {
"""
Get service health status
@param service name of the service to be checked
@param cluster URI of the clu... | java | @Given("^I get service '(.+?)' health status in cluster '(.+?)' and save it in variable '(.+?)'")
public void getServiceHealthStatus(String service, String cluster, String envVar) throws Exception {
String health = commonspec.retrieveHealthServiceStatus(service, cluster);
ThreadProperty.set(envVar,... | [
"@",
"Given",
"(",
"\"^I get service '(.+?)' health status in cluster '(.+?)' and save it in variable '(.+?)'\"",
")",
"public",
"void",
"getServiceHealthStatus",
"(",
"String",
"service",
",",
"String",
"cluster",
",",
"String",
"envVar",
")",
"throws",
"Exception",
"{",
"... | Get service health status
@param service name of the service to be checked
@param cluster URI of the cluster
@param envVar environment variable where to store result
@throws Exception exception * | [
"Get",
"service",
"health",
"status"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L351-L356 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/identity/GenerateEntityIdOnTheClient.java | GenerateEntityIdOnTheClient.tryGetIdFromInstance | public boolean tryGetIdFromInstance(Object entity, Reference<String> idHolder) {
"""
Attempts to get the document key from an instance
@param entity Entity to get id from
@param idHolder output parameter which holds document id
@return true if id was read from entity
"""
if (entity == null) {
... | java | public boolean tryGetIdFromInstance(Object entity, Reference<String> idHolder) {
if (entity == null) {
throw new IllegalArgumentException("Entity cannot be null");
}
try {
Field identityProperty = getIdentityProperty(entity.getClass());
if (identityProperty !=... | [
"public",
"boolean",
"tryGetIdFromInstance",
"(",
"Object",
"entity",
",",
"Reference",
"<",
"String",
">",
"idHolder",
")",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Entity cannot be null\"",
")",
";",... | Attempts to get the document key from an instance
@param entity Entity to get id from
@param idHolder output parameter which holds document id
@return true if id was read from entity | [
"Attempts",
"to",
"get",
"the",
"document",
"key",
"from",
"an",
"instance"
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/identity/GenerateEntityIdOnTheClient.java#L30-L48 |
protegeproject/jpaul | src/main/java/jpaul/Constraints/SetConstraints/SetConstraints.java | SetConstraints.addCtSource | public void addCtSource(Collection<T> ct, SVar<T> s) {
"""
Adds an constraint of the form "constant set
<code>ct</code> is included in the set <code>s</code>".
"""
this.add(new CtConstraint<SVar<T>,Set<T>>(new LinkedHashSet<T>(ct), s));
} | java | public void addCtSource(Collection<T> ct, SVar<T> s) {
this.add(new CtConstraint<SVar<T>,Set<T>>(new LinkedHashSet<T>(ct), s));
} | [
"public",
"void",
"addCtSource",
"(",
"Collection",
"<",
"T",
">",
"ct",
",",
"SVar",
"<",
"T",
">",
"s",
")",
"{",
"this",
".",
"add",
"(",
"new",
"CtConstraint",
"<",
"SVar",
"<",
"T",
">",
",",
"Set",
"<",
"T",
">",
">",
"(",
"new",
"LinkedH... | Adds an constraint of the form "constant set
<code>ct</code> is included in the set <code>s</code>". | [
"Adds",
"an",
"constraint",
"of",
"the",
"form",
""",
";",
"constant",
"set",
"<code",
">",
"ct<",
"/",
"code",
">",
"is",
"included",
"in",
"the",
"set",
"<code",
">",
"s<",
"/",
"code",
">",
""",
";",
"."
] | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Constraints/SetConstraints/SetConstraints.java#L32-L34 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/windowing/Window.java | Window.cancelAll | public List<WindowFuture<K,R,P>> cancelAll() {
"""
Cancels (completes) all requests. Any callers/threads waiting for completion
will be signaled. Also, since this frees up all slots in the window, all
callers/threads blocked with pending offers will be signaled to continue.
@return A list of all futures that we... | java | public List<WindowFuture<K,R,P>> cancelAll() {
if (this.futures.size() <= 0) {
return null;
}
List<WindowFuture<K,R,P>> cancelled = new ArrayList<WindowFuture<K,R,P>>();
long now = System.currentTimeMillis();
this.lock.lock();
try {
// che... | [
"public",
"List",
"<",
"WindowFuture",
"<",
"K",
",",
"R",
",",
"P",
">",
">",
"cancelAll",
"(",
")",
"{",
"if",
"(",
"this",
".",
"futures",
".",
"size",
"(",
")",
"<=",
"0",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"WindowFuture",
"... | Cancels (completes) all requests. Any callers/threads waiting for completion
will be signaled. Also, since this frees up all slots in the window, all
callers/threads blocked with pending offers will be signaled to continue.
@return A list of all futures that were cancelled.
@throws InterruptedException Thrown if the ca... | [
"Cancels",
"(",
"completes",
")",
"all",
"requests",
".",
"Any",
"callers",
"/",
"threads",
"waiting",
"for",
"completion",
"will",
"be",
"signaled",
".",
"Also",
"since",
"this",
"frees",
"up",
"all",
"slots",
"in",
"the",
"window",
"all",
"callers",
"/",... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/windowing/Window.java#L633-L657 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java | KnowledgeSwitchYardScanner.toPropertiesModel | protected PropertiesModel toPropertiesModel(Property[] propertyAnnotations, KnowledgeNamespace knowledgeNamespace) {
"""
Converts property annotations to properties model.
@param propertyAnnotations propertyAnnotations
@param knowledgeNamespace knowledgeNamespace
@return model
"""
if (propertyAnno... | java | protected PropertiesModel toPropertiesModel(Property[] propertyAnnotations, KnowledgeNamespace knowledgeNamespace) {
if (propertyAnnotations == null || propertyAnnotations.length == 0) {
return null;
}
PropertiesModel propertiesModel = new V1PropertiesModel(knowledgeNamespace.uri());... | [
"protected",
"PropertiesModel",
"toPropertiesModel",
"(",
"Property",
"[",
"]",
"propertyAnnotations",
",",
"KnowledgeNamespace",
"knowledgeNamespace",
")",
"{",
"if",
"(",
"propertyAnnotations",
"==",
"null",
"||",
"propertyAnnotations",
".",
"length",
"==",
"0",
")"... | Converts property annotations to properties model.
@param propertyAnnotations propertyAnnotations
@param knowledgeNamespace knowledgeNamespace
@return model | [
"Converts",
"property",
"annotations",
"to",
"properties",
"model",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java#L345-L363 |
paypal/SeLion | client/src/main/java/com/paypal/selion/configuration/LocalConfig.java | LocalConfig.printConfigValues | public synchronized void printConfigValues(String testName) {
"""
Prints the configuration values associated with the LocalConfig. Used for logging/debug.
@param testName
The <test> to which this configuration pertains to.
"""
if (baseConfig.isEmpty()) {
return;
}
... | java | public synchronized void printConfigValues(String testName) {
if (baseConfig.isEmpty()) {
return;
}
StringBuilder builder = new StringBuilder(String.format("Configuration for <%s>: {", testName));
boolean isFirst = true;
for (ConfigProperty configProperty : ConfigPr... | [
"public",
"synchronized",
"void",
"printConfigValues",
"(",
"String",
"testName",
")",
"{",
"if",
"(",
"baseConfig",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"String",
".",
"format"... | Prints the configuration values associated with the LocalConfig. Used for logging/debug.
@param testName
The <test> to which this configuration pertains to. | [
"Prints",
"the",
"configuration",
"values",
"associated",
"with",
"the",
"LocalConfig",
".",
"Used",
"for",
"logging",
"/",
"debug",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/configuration/LocalConfig.java#L193-L211 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/SoftDeleteHandler.java | SoftDeleteHandler.doRecordChange | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) {
"""
Called when a change is the record status is about to happen/has happened.
On an add or lock, makes sure the main key field is set to the current main target field
so it will be a child of the current main record.
@param f... | java | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
{ // Read a valid record
if (iChangeType == DBConstants.DELETE_TYPE)
if ((this.getOwner().getEditMode() & DBConstants.EDIT_ADD) != DBConstants.EDIT_ADD)
if (this.isSoftDeleteThisRecord())
... | [
"public",
"int",
"doRecordChange",
"(",
"FieldInfo",
"field",
",",
"int",
"iChangeType",
",",
"boolean",
"bDisplayOption",
")",
"{",
"// Read a valid record",
"if",
"(",
"iChangeType",
"==",
"DBConstants",
".",
"DELETE_TYPE",
")",
"if",
"(",
"(",
"this",
".",
... | Called when a change is the record status is about to happen/has happened.
On an add or lock, makes sure the main key field is set to the current main target field
so it will be a child of the current main record.
@param field If this file change is due to a field, this is the field.
@param iChangeType The type of chan... | [
"Called",
"when",
"a",
"change",
"is",
"the",
"record",
"status",
"is",
"about",
"to",
"happen",
"/",
"has",
"happened",
".",
"On",
"an",
"add",
"or",
"lock",
"makes",
"sure",
"the",
"main",
"key",
"field",
"is",
"set",
"to",
"the",
"current",
"main",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/SoftDeleteHandler.java#L120-L140 |
akquinet/needle | src/main/java/de/akquinet/jbosscc/needle/junit/NeedleRule.java | NeedleRule.apply | @Override
public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
"""
{@inheritDoc} Before evaluation of the base statement, the test instance
will initialized.
"""
Statement appliedStatement = base;
for (MethodRule rule : methodRuleChain) {
... | java | @Override
public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
Statement appliedStatement = base;
for (MethodRule rule : methodRuleChain) {
appliedStatement = rule.apply(appliedStatement, method, target);
}
return statement(ap... | [
"@",
"Override",
"public",
"Statement",
"apply",
"(",
"final",
"Statement",
"base",
",",
"final",
"FrameworkMethod",
"method",
",",
"final",
"Object",
"target",
")",
"{",
"Statement",
"appliedStatement",
"=",
"base",
";",
"for",
"(",
"MethodRule",
"rule",
":",... | {@inheritDoc} Before evaluation of the base statement, the test instance
will initialized. | [
"{"
] | train | https://github.com/akquinet/needle/blob/8b411c521246b8212882485edc01644f9aac7e24/src/main/java/de/akquinet/jbosscc/needle/junit/NeedleRule.java#L64-L73 |
sagiegurari/fax4j | src/main/java/org/fax4j/util/SpiUtil.java | SpiUtil.copyPropertiesToMap | public static void copyPropertiesToMap(Properties source,Map<String,String> target) {
"""
This function copies all mappings from source properties to target map.
@param source
The source properties
@param target
The target map to populate
"""
if(source!=null)
{
//convert t... | java | public static void copyPropertiesToMap(Properties source,Map<String,String> target)
{
if(source!=null)
{
//convert to map
Iterator<Entry<Object,Object>> iterator=source.entrySet().iterator();
Entry<Object,Object> entry=null;
String key=null;
... | [
"public",
"static",
"void",
"copyPropertiesToMap",
"(",
"Properties",
"source",
",",
"Map",
"<",
"String",
",",
"String",
">",
"target",
")",
"{",
"if",
"(",
"source",
"!=",
"null",
")",
"{",
"//convert to map",
"Iterator",
"<",
"Entry",
"<",
"Object",
","... | This function copies all mappings from source properties to target map.
@param source
The source properties
@param target
The target map to populate | [
"This",
"function",
"copies",
"all",
"mappings",
"from",
"source",
"properties",
"to",
"target",
"map",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/SpiUtil.java#L81-L103 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapApi.java | MapApi.getMapUnsafe | public static <A, B> Map<A, B> getMapUnsafe(final Map map, final Object... path) {
"""
Get map value by path.
@param <A> map key type
@param <B> map value type
@param map subject
@param path nodes to walk in map
@return value
"""
return getUnsafe(map, Map.class, path);
} | java | public static <A, B> Map<A, B> getMapUnsafe(final Map map, final Object... path) {
return getUnsafe(map, Map.class, path);
} | [
"public",
"static",
"<",
"A",
",",
"B",
">",
"Map",
"<",
"A",
",",
"B",
">",
"getMapUnsafe",
"(",
"final",
"Map",
"map",
",",
"final",
"Object",
"...",
"path",
")",
"{",
"return",
"getUnsafe",
"(",
"map",
",",
"Map",
".",
"class",
",",
"path",
")... | Get map value by path.
@param <A> map key type
@param <B> map value type
@param map subject
@param path nodes to walk in map
@return value | [
"Get",
"map",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapApi.java#L223-L225 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.evaluate | public void evaluate(MultiDataSetIterator iterator, Map<String,List<IEvaluation>> variableEvals, Map<String,Integer> predictionLabelMapping) {
"""
Perform evaluation using classes such as {@link org.nd4j.evaluation.classification.Evaluation} for classifier outputs
and {@link org.nd4j.evaluation.regression.Regress... | java | public void evaluate(MultiDataSetIterator iterator, Map<String,List<IEvaluation>> variableEvals, Map<String,Integer> predictionLabelMapping){
Preconditions.checkState(trainingConfig != null, "Training config has not been set");
Preconditions.checkState(variableEvals.keySet().equals(predictionLabelMappi... | [
"public",
"void",
"evaluate",
"(",
"MultiDataSetIterator",
"iterator",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"IEvaluation",
">",
">",
"variableEvals",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"predictionLabelMapping",
")",
"{",
"Preconditions",
"... | Perform evaluation using classes such as {@link org.nd4j.evaluation.classification.Evaluation} for classifier outputs
and {@link org.nd4j.evaluation.regression.RegressionEvaluation} for regression outputs.<br>
<br>
<b>Example: classifier evaluation</b><br>
Predictions variable name: "softmaxOutput"<br>
Evaluations to p... | [
"Perform",
"evaluation",
"using",
"classes",
"such",
"as",
"{",
"@link",
"org",
".",
"nd4j",
".",
"evaluation",
".",
"classification",
".",
"Evaluation",
"}",
"for",
"classifier",
"outputs",
"and",
"{",
"@link",
"org",
".",
"nd4j",
".",
"evaluation",
".",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L1826-L1853 |
bwaldvogel/liblinear-java | src/main/java/de/bwaldvogel/liblinear/Parameter.java | Parameter.setWeights | public void setWeights(double[] weights, int[] weightLabels) {
"""
<p>nr_weight, weight_label, and weight are used to change the penalty
for some classes (If the weight for a class is not changed, it is
set to 1). This is useful for training classifier using unbalanced
input data or with asymmetric misclassific... | java | public void setWeights(double[] weights, int[] weightLabels) {
if (weights == null) throw new IllegalArgumentException("'weight' must not be null");
if (weightLabels == null || weightLabels.length != weights.length)
throw new IllegalArgumentException("'weightLabels' must have same length as ... | [
"public",
"void",
"setWeights",
"(",
"double",
"[",
"]",
"weights",
",",
"int",
"[",
"]",
"weightLabels",
")",
"{",
"if",
"(",
"weights",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"'weight' must not be null\"",
")",
";",
"if",
"("... | <p>nr_weight, weight_label, and weight are used to change the penalty
for some classes (If the weight for a class is not changed, it is
set to 1). This is useful for training classifier using unbalanced
input data or with asymmetric misclassification cost.</p>
<p>Each weight[i] corresponds to weight_label[i], meaning ... | [
"<p",
">",
"nr_weight",
"weight_label",
"and",
"weight",
"are",
"used",
"to",
"change",
"the",
"penalty",
"for",
"some",
"classes",
"(",
"If",
"the",
"weight",
"for",
"a",
"class",
"is",
"not",
"changed",
"it",
"is",
"set",
"to",
"1",
")",
".",
"This",... | train | https://github.com/bwaldvogel/liblinear-java/blob/02b228c23a1e3490ba1f703813b09153c8901c2e/src/main/java/de/bwaldvogel/liblinear/Parameter.java#L68-L74 |
knowm/XChange | xchange-wex/src/main/java/org/knowm/xchange/wex/v3/service/WexMarketDataServiceRaw.java | WexMarketDataServiceRaw.getBTCEDepth | public WexDepthWrapper getBTCEDepth(String pairs, int size) throws IOException {
"""
Get market depth from exchange
@param pairs Dash-delimited string of currency pairs to retrieve (e.g. "btc_usd-ltc_btc")
@param size Integer value from 1 to 2000 -> get corresponding number of items
@return WexDepthWrapper ob... | java | public WexDepthWrapper getBTCEDepth(String pairs, int size) throws IOException {
if (size < 1) {
size = 1;
}
if (size > FULL_SIZE) {
size = FULL_SIZE;
}
return btce.getDepth(pairs.toLowerCase(), size, 1);
} | [
"public",
"WexDepthWrapper",
"getBTCEDepth",
"(",
"String",
"pairs",
",",
"int",
"size",
")",
"throws",
"IOException",
"{",
"if",
"(",
"size",
"<",
"1",
")",
"{",
"size",
"=",
"1",
";",
"}",
"if",
"(",
"size",
">",
"FULL_SIZE",
")",
"{",
"size",
"=",... | Get market depth from exchange
@param pairs Dash-delimited string of currency pairs to retrieve (e.g. "btc_usd-ltc_btc")
@param size Integer value from 1 to 2000 -> get corresponding number of items
@return WexDepthWrapper object
@throws IOException | [
"Get",
"market",
"depth",
"from",
"exchange"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-wex/src/main/java/org/knowm/xchange/wex/v3/service/WexMarketDataServiceRaw.java#L43-L54 |
Pi4J/pi4j | pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/pca/PCA9685GpioProvider.java | PCA9685GpioProvider.setPwm | @Override
public void setPwm(Pin pin, int duration) {
"""
Set pulse duration in microseconds.<br>
Make sure duration doesn't exceed period time(1'000'000/freq)!
@param pin represents channel 0..15
@param duration pulse duration in microseconds
"""
int offPosition = calculateOffPositionForPulse... | java | @Override
public void setPwm(Pin pin, int duration) {
int offPosition = calculateOffPositionForPulseDuration(duration);
setPwm(pin, 0, offPosition);
} | [
"@",
"Override",
"public",
"void",
"setPwm",
"(",
"Pin",
"pin",
",",
"int",
"duration",
")",
"{",
"int",
"offPosition",
"=",
"calculateOffPositionForPulseDuration",
"(",
"duration",
")",
";",
"setPwm",
"(",
"pin",
",",
"0",
",",
"offPosition",
")",
";",
"}... | Set pulse duration in microseconds.<br>
Make sure duration doesn't exceed period time(1'000'000/freq)!
@param pin represents channel 0..15
@param duration pulse duration in microseconds | [
"Set",
"pulse",
"duration",
"in",
"microseconds",
".",
"<br",
">",
"Make",
"sure",
"duration",
"doesn",
"t",
"exceed",
"period",
"time",
"(",
"1",
"000",
"000",
"/",
"freq",
")",
"!"
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/pca/PCA9685GpioProvider.java#L167-L171 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.lockRandomAccessFile | public static FileLock lockRandomAccessFile(final RandomAccessFile file, final int tryLockMax, final long tryWaitMillis)
throws LockingFailedException {
"""
Lock the file.
@param file
File to lock - Cannot be <code>null</code>.
@param tryLockMax
Number of tries to lock before throwing an excepti... | java | public static FileLock lockRandomAccessFile(final RandomAccessFile file, final int tryLockMax, final long tryWaitMillis)
throws LockingFailedException {
checkNotNull("file", file);
final FileChannel channel = file.getChannel();
int tryCount = 0;
while (tryCount < t... | [
"public",
"static",
"FileLock",
"lockRandomAccessFile",
"(",
"final",
"RandomAccessFile",
"file",
",",
"final",
"int",
"tryLockMax",
",",
"final",
"long",
"tryWaitMillis",
")",
"throws",
"LockingFailedException",
"{",
"checkNotNull",
"(",
"\"file\"",
",",
"file",
")... | Lock the file.
@param file
File to lock - Cannot be <code>null</code>.
@param tryLockMax
Number of tries to lock before throwing an exception.
@param tryWaitMillis
Milliseconds to sleep between retries.
@return FileLock.
@throws LockingFailedException
Locking the file failed. | [
"Lock",
"the",
"file",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1250-L1278 |
ManfredTremmel/gwt-bean-validators | gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/Assert.java | Assert.notNull | public static void notNull(@Nullable final Object object, final String message) {
"""
Assert that an object is not {@code null}.
<pre class="code">
Assert.notNull(clazz, "The class must not be null");
</pre>
@param object the object to check
@param message the exception message to use if the assertion fai... | java | public static void notNull(@Nullable final Object object, final String message) {
if (object == null) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"notNull",
"(",
"@",
"Nullable",
"final",
"Object",
"object",
",",
"final",
"String",
"message",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
")",
";",
"}",
... | Assert that an object is not {@code null}.
<pre class="code">
Assert.notNull(clazz, "The class must not be null");
</pre>
@param object the object to check
@param message the exception message to use if the assertion fails
@throws IllegalArgumentException if the object is {@code null} | [
"Assert",
"that",
"an",
"object",
"is",
"not",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/Assert.java#L216-L220 |
zzsrv/torrent-utils | src/main/java/cc/vcode/util/Constants.java | Constants.compareVersions | public static int compareVersions(String version_1, String version_2) {
"""
compare two version strings of form n.n.n.n (e.g. 1.2.3.4)
@param version_1
@param version_2
@return -ve -> version_1 lower, 0 = same, +ve -> version_1 higher
"""
for (int j = 0; j < Math.min(version_2.length(), version_1.length... | java | public static int compareVersions(String version_1, String version_2)
{
for (int j = 0; j < Math.min(version_2.length(), version_1.length()); j++)
{
char v1_c = version_1.charAt(j);
char v2_c = version_2.charAt(j);
if (v1_c == v2_c)
{
continue;
}
if (v2_c == '.')
{
// version1 hig... | [
"public",
"static",
"int",
"compareVersions",
"(",
"String",
"version_1",
",",
"String",
"version_2",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"Math",
".",
"min",
"(",
"version_2",
".",
"length",
"(",
")",
",",
"version_1",
".",
"le... | compare two version strings of form n.n.n.n (e.g. 1.2.3.4)
@param version_1
@param version_2
@return -ve -> version_1 lower, 0 = same, +ve -> version_1 higher | [
"compare",
"two",
"version",
"strings",
"of",
"form",
"n",
".",
"n",
".",
"n",
".",
"n",
"(",
"e",
".",
"g",
".",
"1",
".",
"2",
".",
"3",
".",
"4",
")"
] | train | https://github.com/zzsrv/torrent-utils/blob/70ba8bccd5af1ed7a18c42c61ad409256e9865f3/src/main/java/cc/vcode/util/Constants.java#L160-L198 |
neo4j/neo4j-java-driver | driver/src/main/java/org/neo4j/driver/internal/util/CertificateTool.java | CertificateTool.loadX509Cert | public static void loadX509Cert( File certFile, KeyStore keyStore ) throws GeneralSecurityException, IOException {
"""
Load the certificates written in X.509 format in a file to a key store.
@param certFile
@param keyStore
@throws GeneralSecurityException
@throws IOException
"""
try ( BufferedInp... | java | public static void loadX509Cert( File certFile, KeyStore keyStore ) throws GeneralSecurityException, IOException
{
try ( BufferedInputStream inputStream = new BufferedInputStream( new FileInputStream( certFile ) ) )
{
CertificateFactory certFactory = CertificateFactory.getInstance( "X.50... | [
"public",
"static",
"void",
"loadX509Cert",
"(",
"File",
"certFile",
",",
"KeyStore",
"keyStore",
")",
"throws",
"GeneralSecurityException",
",",
"IOException",
"{",
"try",
"(",
"BufferedInputStream",
"inputStream",
"=",
"new",
"BufferedInputStream",
"(",
"new",
"Fi... | Load the certificates written in X.509 format in a file to a key store.
@param certFile
@param keyStore
@throws GeneralSecurityException
@throws IOException | [
"Load",
"the",
"certificates",
"written",
"in",
"X",
".",
"509",
"format",
"in",
"a",
"file",
"to",
"a",
"key",
"store",
"."
] | train | https://github.com/neo4j/neo4j-java-driver/blob/8dad6c48251fa1ab7017e72d9998a24fa2337a22/driver/src/main/java/org/neo4j/driver/internal/util/CertificateTool.java#L113-L140 |
codecentric/zucchini | zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/token/TokenList.java | TokenList.tokenTypesMatch | private boolean tokenTypesMatch(Token token1, Token token2, Class<? extends Token> tokenType) {
"""
Checks whether both tokens have the specified type.
@param token1 The first token to check.
@param token2 The second token to check.
@param tokenType The type that both tokens must have.
@return {@litera... | java | private boolean tokenTypesMatch(Token token1, Token token2, Class<? extends Token> tokenType) {
return tokenType.isAssignableFrom(token1.getClass()) && tokenType.isAssignableFrom(token2.getClass());
} | [
"private",
"boolean",
"tokenTypesMatch",
"(",
"Token",
"token1",
",",
"Token",
"token2",
",",
"Class",
"<",
"?",
"extends",
"Token",
">",
"tokenType",
")",
"{",
"return",
"tokenType",
".",
"isAssignableFrom",
"(",
"token1",
".",
"getClass",
"(",
")",
")",
... | Checks whether both tokens have the specified type.
@param token1 The first token to check.
@param token2 The second token to check.
@param tokenType The type that both tokens must have.
@return {@literal true} if both tokens have the specified type, and {@literal false} otherwise. | [
"Checks",
"whether",
"both",
"tokens",
"have",
"the",
"specified",
"type",
"."
] | train | https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-bdd/src/main/java/de/codecentric/zucchini/bdd/resolver/token/TokenList.java#L197-L199 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java | HashtableOnDisk.updatePointer | private void updatePointer(long next_ptr, long next_value)
throws IOException,
EOFException {
"""
************************************************************************
Seek to the "next" pointer for the HashtableEntry pointing to "me"
because I've been reallocated.
***... | java | private void updatePointer(long next_ptr, long next_value)
throws IOException,
EOFException {
filemgr.seek(next_ptr);
filemgr.writeLong(next_value);
} | [
"private",
"void",
"updatePointer",
"(",
"long",
"next_ptr",
",",
"long",
"next_value",
")",
"throws",
"IOException",
",",
"EOFException",
"{",
"filemgr",
".",
"seek",
"(",
"next_ptr",
")",
";",
"filemgr",
".",
"writeLong",
"(",
"next_value",
")",
";",
"}"
] | ************************************************************************
Seek to the "next" pointer for the HashtableEntry pointing to "me"
because I've been reallocated.
*********************************************************************** | [
"************************************************************************",
"Seek",
"to",
"the",
"next",
"pointer",
"for",
"the",
"HashtableEntry",
"pointing",
"to",
"me",
"because",
"I",
"ve",
"been",
"reallocated",
".",
"*********************************************************... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java#L1459-L1464 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/block/component/ColorComponent.java | ColorComponent.getStateFromMeta | @Override
public IBlockState getStateFromMeta(Block block, IBlockState state, int meta) {
"""
Get the {@link IBlockState} from the metadata
@param block the block
@param state the state
@param meta the meta
@return the state from meta
"""
return state.withProperty(getProperty(), EnumDyeColor.byMetadat... | java | @Override
public IBlockState getStateFromMeta(Block block, IBlockState state, int meta)
{
return state.withProperty(getProperty(), EnumDyeColor.byMetadata(meta));
} | [
"@",
"Override",
"public",
"IBlockState",
"getStateFromMeta",
"(",
"Block",
"block",
",",
"IBlockState",
"state",
",",
"int",
"meta",
")",
"{",
"return",
"state",
".",
"withProperty",
"(",
"getProperty",
"(",
")",
",",
"EnumDyeColor",
".",
"byMetadata",
"(",
... | Get the {@link IBlockState} from the metadata
@param block the block
@param state the state
@param meta the meta
@return the state from meta | [
"Get",
"the",
"{",
"@link",
"IBlockState",
"}",
"from",
"the",
"metadata"
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/block/component/ColorComponent.java#L177-L181 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsFileTable.java | CmsFileTable.updateItem | private void updateItem(CmsUUID itemId, boolean remove) {
"""
Updates the given item in the file table.<p>
@param itemId the item id
@param remove true if the item should be removed only
"""
if (remove) {
String idStr = itemId != null ? itemId.toString() : null;
m_container... | java | private void updateItem(CmsUUID itemId, boolean remove) {
if (remove) {
String idStr = itemId != null ? itemId.toString() : null;
m_container.removeItem(idStr);
return;
}
CmsObject cms = A_CmsUI.getCmsObject();
try {
CmsResource resource ... | [
"private",
"void",
"updateItem",
"(",
"CmsUUID",
"itemId",
",",
"boolean",
"remove",
")",
"{",
"if",
"(",
"remove",
")",
"{",
"String",
"idStr",
"=",
"itemId",
"!=",
"null",
"?",
"itemId",
".",
"toString",
"(",
")",
":",
"null",
";",
"m_container",
"."... | Updates the given item in the file table.<p>
@param itemId the item id
@param remove true if the item should be removed only | [
"Updates",
"the",
"given",
"item",
"in",
"the",
"file",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsFileTable.java#L1038-L1057 |
nutzam/nutzboot | nutzboot-starter/nutzboot-starter-fastdfs/src/main/java/org/nutz/boot/starter/fastdfs/FastdfsService.java | FastdfsService.uploadImage | public String uploadImage(byte[] image, byte[] watermark, String ext, Map<String, String> metaInfo, float opacity, int pos, int margin) {
"""
上传图片并生成缩略图、水印图
@param image 原图
@param watermark 水印图
@param ext 后缀名
@param metaInfo 元信息
@param opacity 透明度
@param pos 位置
@param margin 水印距离四周的边... | java | public String uploadImage(byte[] image, byte[] watermark, String ext, Map<String, String> metaInfo, float opacity, int pos, int margin) {
String path = "";
TrackerServer trackerServer = null;
StorageClient1 storageClient1 = null;
ByteArrayOutputStream thumbOs = new ByteArrayOutputStream(... | [
"public",
"String",
"uploadImage",
"(",
"byte",
"[",
"]",
"image",
",",
"byte",
"[",
"]",
"watermark",
",",
"String",
"ext",
",",
"Map",
"<",
"String",
",",
"String",
">",
"metaInfo",
",",
"float",
"opacity",
",",
"int",
"pos",
",",
"int",
"margin",
... | 上传图片并生成缩略图、水印图
@param image 原图
@param watermark 水印图
@param ext 后缀名
@param metaInfo 元信息
@param opacity 透明度
@param pos 位置
@param margin 水印距离四周的边距 默认为0
@return | [
"上传图片并生成缩略图、水印图"
] | train | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-starter/nutzboot-starter-fastdfs/src/main/java/org/nutz/boot/starter/fastdfs/FastdfsService.java#L436-L480 |
michel-kraemer/bson4jackson | src/main/java/de/undercouch/bson4jackson/BsonParser.java | BsonParser.readTimestamp | protected Timestamp readTimestamp() throws IOException {
"""
Reads a timestamp object from the input stream
@return the timestamp
@throws IOException if the timestamp could not be read
"""
int inc = _in.readInt();
int time = _in.readInt();
return new Timestamp(time, inc);
} | java | protected Timestamp readTimestamp() throws IOException {
int inc = _in.readInt();
int time = _in.readInt();
return new Timestamp(time, inc);
} | [
"protected",
"Timestamp",
"readTimestamp",
"(",
")",
"throws",
"IOException",
"{",
"int",
"inc",
"=",
"_in",
".",
"readInt",
"(",
")",
";",
"int",
"time",
"=",
"_in",
".",
"readInt",
"(",
")",
";",
"return",
"new",
"Timestamp",
"(",
"time",
",",
"inc",... | Reads a timestamp object from the input stream
@return the timestamp
@throws IOException if the timestamp could not be read | [
"Reads",
"a",
"timestamp",
"object",
"from",
"the",
"input",
"stream"
] | train | https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/BsonParser.java#L607-L611 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsElementView.java | CmsElementView.getTitle | public String getTitle(CmsObject cms, Locale locale) {
"""
Returns the element view title.<p>
@param cms the cms context
@param locale the locale
@return the title
"""
if (m_titleKey == null) {
return m_title;
} else {
return OpenCms.getWorkplaceManager().getMess... | java | public String getTitle(CmsObject cms, Locale locale) {
if (m_titleKey == null) {
return m_title;
} else {
return OpenCms.getWorkplaceManager().getMessages(locale).key(m_titleKey);
}
} | [
"public",
"String",
"getTitle",
"(",
"CmsObject",
"cms",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"m_titleKey",
"==",
"null",
")",
"{",
"return",
"m_title",
";",
"}",
"else",
"{",
"return",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getM... | Returns the element view title.<p>
@param cms the cms context
@param locale the locale
@return the title | [
"Returns",
"the",
"element",
"view",
"title",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsElementView.java#L247-L254 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java | AppsImpl.importMethodWithServiceResponseAsync | public Observable<ServiceResponse<UUID>> importMethodWithServiceResponseAsync(LuisApp luisApp, ImportMethodAppsOptionalParameter importMethodOptionalParameter) {
"""
Imports an application to LUIS, the application's structure should be included in in the request body.
@param luisApp A LUIS application structure... | java | public Observable<ServiceResponse<UUID>> importMethodWithServiceResponseAsync(LuisApp luisApp, ImportMethodAppsOptionalParameter importMethodOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"UUID",
">",
">",
"importMethodWithServiceResponseAsync",
"(",
"LuisApp",
"luisApp",
",",
"ImportMethodAppsOptionalParameter",
"importMethodOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"client",
".",
"endpoin... | Imports an application to LUIS, the application's structure should be included in in the request body.
@param luisApp A LUIS application structure.
@param importMethodOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameter... | [
"Imports",
"an",
"application",
"to",
"LUIS",
"the",
"application",
"s",
"structure",
"should",
"be",
"included",
"in",
"in",
"the",
"request",
"body",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java#L441-L452 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DefaultInternalConfiguration.java | DefaultInternalConfiguration.parseStringArray | private String[] parseStringArray(final String list) {
"""
Splits the given comma-delimited string into an an array. Leading/trailing spaces in list items will be trimmed.
@param list the String to split.
@return the split version of the list.
"""
StringTokenizer tokenizer = new StringTokenizer(list, ","... | java | private String[] parseStringArray(final String list) {
StringTokenizer tokenizer = new StringTokenizer(list, ",", false);
int length = tokenizer.countTokens();
String[] arr = new String[length];
for (int i = 0; tokenizer.hasMoreElements(); i++) {
arr[i] = cleanSpaces(tokenizer.nextToken());
}
return ar... | [
"private",
"String",
"[",
"]",
"parseStringArray",
"(",
"final",
"String",
"list",
")",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"list",
",",
"\",\"",
",",
"false",
")",
";",
"int",
"length",
"=",
"tokenizer",
".",
"countToken... | Splits the given comma-delimited string into an an array. Leading/trailing spaces in list items will be trimmed.
@param list the String to split.
@return the split version of the list. | [
"Splits",
"the",
"given",
"comma",
"-",
"delimited",
"string",
"into",
"an",
"an",
"array",
".",
"Leading",
"/",
"trailing",
"spaces",
"in",
"list",
"items",
"will",
"be",
"trimmed",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DefaultInternalConfiguration.java#L189-L199 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/TransactWriteItemsResult.java | TransactWriteItemsResult.withItemCollectionMetrics | public TransactWriteItemsResult withItemCollectionMetrics(java.util.Map<String, java.util.List<ItemCollectionMetrics>> itemCollectionMetrics) {
"""
<p>
A list of tables that were processed by <code>TransactWriteItems</code> and, for each table, information about
any item collections that were affected by individ... | java | public TransactWriteItemsResult withItemCollectionMetrics(java.util.Map<String, java.util.List<ItemCollectionMetrics>> itemCollectionMetrics) {
setItemCollectionMetrics(itemCollectionMetrics);
return this;
} | [
"public",
"TransactWriteItemsResult",
"withItemCollectionMetrics",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"ItemCollectionMetrics",
">",
">",
"itemCollectionMetrics",
")",
"{",
"setItemCollectionMetrics",
"(",... | <p>
A list of tables that were processed by <code>TransactWriteItems</code> and, for each table, information about
any item collections that were affected by individual <code>UpdateItem</code>, <code>PutItem</code> or
<code>DeleteItem</code> operations.
</p>
@param itemCollectionMetrics
A list of tables that were proc... | [
"<p",
">",
"A",
"list",
"of",
"tables",
"that",
"were",
"processed",
"by",
"<code",
">",
"TransactWriteItems<",
"/",
"code",
">",
"and",
"for",
"each",
"table",
"information",
"about",
"any",
"item",
"collections",
"that",
"were",
"affected",
"by",
"individu... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/TransactWriteItemsResult.java#L167-L170 |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/spatialite/SpatialiteWKBReader.java | SpatialiteWKBReader.setSRID | private Geometry setSRID( Geometry g, int SRID ) {
"""
Sets the SRID, if it was specified in the WKB
@param g the geometry to update
@return the geometry with an updated SRID value, if required
"""
if (SRID != 0)
g.setSRID(SRID);
return g;
} | java | private Geometry setSRID( Geometry g, int SRID ) {
if (SRID != 0)
g.setSRID(SRID);
return g;
} | [
"private",
"Geometry",
"setSRID",
"(",
"Geometry",
"g",
",",
"int",
"SRID",
")",
"{",
"if",
"(",
"SRID",
"!=",
"0",
")",
"g",
".",
"setSRID",
"(",
"SRID",
")",
";",
"return",
"g",
";",
"}"
] | Sets the SRID, if it was specified in the WKB
@param g the geometry to update
@return the geometry with an updated SRID value, if required | [
"Sets",
"the",
"SRID",
"if",
"it",
"was",
"specified",
"in",
"the",
"WKB"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/spatialite/SpatialiteWKBReader.java#L298-L302 |
neo4j/neo4j-java-driver | driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java | DriverFactory.createSessionFactory | protected SessionFactory createSessionFactory( ConnectionProvider connectionProvider, RetryLogic retryLogic,
Config config ) {
"""
Creates new {@link SessionFactory}.
<p>
<b>This method is protected only for testing</b>
"""
return new SessionFactoryImpl( connectionProvider, retryLogic, co... | java | protected SessionFactory createSessionFactory( ConnectionProvider connectionProvider, RetryLogic retryLogic,
Config config )
{
return new SessionFactoryImpl( connectionProvider, retryLogic, config );
} | [
"protected",
"SessionFactory",
"createSessionFactory",
"(",
"ConnectionProvider",
"connectionProvider",
",",
"RetryLogic",
"retryLogic",
",",
"Config",
"config",
")",
"{",
"return",
"new",
"SessionFactoryImpl",
"(",
"connectionProvider",
",",
"retryLogic",
",",
"config",
... | Creates new {@link SessionFactory}.
<p>
<b>This method is protected only for testing</b> | [
"Creates",
"new",
"{"
] | train | https://github.com/neo4j/neo4j-java-driver/blob/8dad6c48251fa1ab7017e72d9998a24fa2337a22/driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java#L247-L251 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/storage/PayloadSender.java | PayloadSender.sendPayload | synchronized boolean sendPayload(final PayloadData payload) {
"""
Sends payload asynchronously. Returns boolean flag immediately indicating if payload send was
scheduled
@throws IllegalArgumentException is payload is null
"""
if (payload == null) {
throw new IllegalArgumentException("Payload is null")... | java | synchronized boolean sendPayload(final PayloadData payload) {
if (payload == null) {
throw new IllegalArgumentException("Payload is null");
}
// we don't allow concurrent payload sending
if (isSendingPayload()) {
return false;
}
// we mark the sender as "busy" so no other payloads would be sent unti... | [
"synchronized",
"boolean",
"sendPayload",
"(",
"final",
"PayloadData",
"payload",
")",
"{",
"if",
"(",
"payload",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Payload is null\"",
")",
";",
"}",
"// we don't allow concurrent payload sendi... | Sends payload asynchronously. Returns boolean flag immediately indicating if payload send was
scheduled
@throws IllegalArgumentException is payload is null | [
"Sends",
"payload",
"asynchronously",
".",
"Returns",
"boolean",
"flag",
"immediately",
"indicating",
"if",
"payload",
"send",
"was",
"scheduled"
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/PayloadSender.java#L67-L98 |
ppicas/custom-typeface | library/src/main/java/cat/ppicas/customtypeface/CustomTypefaceFactory.java | CustomTypefaceFactory.createView | private View createView(String name, String prefix, Context context, AttributeSet attrs)
throws ClassNotFoundException, InflateException {
"""
Low-level function for instantiating a view by name. This attempts to
instantiate a view class of the given <var>name</var> found in this
LayoutInflater's Cla... | java | private View createView(String name, String prefix, Context context, AttributeSet attrs)
throws ClassNotFoundException, InflateException {
Constructor<? extends View> constructor = CONSTRUCTOR_MAP.get(name);
Class<? extends View> clazz = null;
try {
if (constructor == n... | [
"private",
"View",
"createView",
"(",
"String",
"name",
",",
"String",
"prefix",
",",
"Context",
"context",
",",
"AttributeSet",
"attrs",
")",
"throws",
"ClassNotFoundException",
",",
"InflateException",
"{",
"Constructor",
"<",
"?",
"extends",
"View",
">",
"con... | Low-level function for instantiating a view by name. This attempts to
instantiate a view class of the given <var>name</var> found in this
LayoutInflater's ClassLoader.
<p>
There are two things that can happen in an error case: either the
exception describing the error will be thrown, or a null will be
returned. You mu... | [
"Low",
"-",
"level",
"function",
"for",
"instantiating",
"a",
"view",
"by",
"name",
".",
"This",
"attempts",
"to",
"instantiate",
"a",
"view",
"class",
"of",
"the",
"given",
"<var",
">",
"name<",
"/",
"var",
">",
"found",
"in",
"this",
"LayoutInflater",
... | train | https://github.com/ppicas/custom-typeface/blob/3a2a68cc8584a72076c545a8b7c9f741f6002241/library/src/main/java/cat/ppicas/customtypeface/CustomTypefaceFactory.java#L173-L217 |
VoltDB/voltdb | src/frontend/org/voltdb/ClientAppBase.java | ClientAppBase.printLogStatic | protected static void printLogStatic(String className, String msg, Object...args) {
"""
The static method to print a log message to the console.
@param className Name of the class that prints this message.
@param msg The log message that needs to be printed.
@param args The arguments that may be needed for form... | java | protected static void printLogStatic(String className, String msg, Object...args) {
if (args != null) {
msg = String.format(msg, args);
}
String header = String.format("%s [%s] ",
ZonedDateTime.now().format(TIME_FORMAT),
className);
System.out... | [
"protected",
"static",
"void",
"printLogStatic",
"(",
"String",
"className",
",",
"String",
"msg",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"args",
"!=",
"null",
")",
"{",
"msg",
"=",
"String",
".",
"format",
"(",
"msg",
",",
"args",
")",
"... | The static method to print a log message to the console.
@param className Name of the class that prints this message.
@param msg The log message that needs to be printed.
@param args The arguments that may be needed for formatting the message. | [
"The",
"static",
"method",
"to",
"print",
"a",
"log",
"message",
"to",
"the",
"console",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ClientAppBase.java#L53-L63 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/extract/QueryBasedExtractor.java | QueryBasedExtractor.setRangePredicates | private void setRangePredicates(String watermarkColumn, WatermarkType watermarkType, long lwmValue, long hwmValue) {
"""
range predicates for watermark column and transaction columns.
@param watermarkColumn name of the column used as watermark
@param watermarkType watermark type
@param lwmValue estimated low ... | java | private void setRangePredicates(String watermarkColumn, WatermarkType watermarkType, long lwmValue, long hwmValue) {
log.debug("Getting range predicates");
String lwmOperator = partition.isLowWatermarkInclusive() ? ">=" : ">";
String hwmOperator = (partition.isLastPartition() || partition.isHighWatermarkInc... | [
"private",
"void",
"setRangePredicates",
"(",
"String",
"watermarkColumn",
",",
"WatermarkType",
"watermarkType",
",",
"long",
"lwmValue",
",",
"long",
"hwmValue",
")",
"{",
"log",
".",
"debug",
"(",
"\"Getting range predicates\"",
")",
";",
"String",
"lwmOperator",... | range predicates for watermark column and transaction columns.
@param watermarkColumn name of the column used as watermark
@param watermarkType watermark type
@param lwmValue estimated low watermark value
@param hwmValue estimated high watermark value | [
"range",
"predicates",
"for",
"watermark",
"column",
"and",
"transaction",
"columns",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/extract/QueryBasedExtractor.java#L411-L428 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/AbstractConnectionManager.java | AbstractConnectionManager.setDriverClassName | public void setDriverClassName(String driver) {
"""
sets the driver class name. This is used in conjunction with the JDBC connection string
@param driver the driver class name, for example "com.sybase.jdbc4.jdbc.SybDriver"
"""
try
{
this.driver = (Driver) Class.forName(driver).n... | java | public void setDriverClassName(String driver)
{
try
{
this.driver = (Driver) Class.forName(driver).newInstance();
}
catch (Exception e)
{
throw new RuntimeException("Unable to load driver: " + driver, e);
}
} | [
"public",
"void",
"setDriverClassName",
"(",
"String",
"driver",
")",
"{",
"try",
"{",
"this",
".",
"driver",
"=",
"(",
"Driver",
")",
"Class",
".",
"forName",
"(",
"driver",
")",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
... | sets the driver class name. This is used in conjunction with the JDBC connection string
@param driver the driver class name, for example "com.sybase.jdbc4.jdbc.SybDriver" | [
"sets",
"the",
"driver",
"class",
"name",
".",
"This",
"is",
"used",
"in",
"conjunction",
"with",
"the",
"JDBC",
"connection",
"string"
] | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/AbstractConnectionManager.java#L434-L444 |
groovy/groovy-core | src/main/groovy/lang/Binding.java | Binding.setProperty | public void setProperty(String property, Object newValue) {
"""
Overloaded to make variables appear as bean properties or via the subscript operator
"""
/** @todo we should check if we have the property with the metaClass instead of try/catch */
try {
super.setProperty(property, ne... | java | public void setProperty(String property, Object newValue) {
/** @todo we should check if we have the property with the metaClass instead of try/catch */
try {
super.setProperty(property, newValue);
}
catch (MissingPropertyException e) {
setVariable(property, newV... | [
"public",
"void",
"setProperty",
"(",
"String",
"property",
",",
"Object",
"newValue",
")",
"{",
"/** @todo we should check if we have the property with the metaClass instead of try/catch */",
"try",
"{",
"super",
".",
"setProperty",
"(",
"property",
",",
"newValue",
")",
... | Overloaded to make variables appear as bean properties or via the subscript operator | [
"Overloaded",
"to",
"make",
"variables",
"appear",
"as",
"bean",
"properties",
"or",
"via",
"the",
"subscript",
"operator"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/Binding.java#L113-L121 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java | VelocityUtil.toFile | public static void toFile(Template template, VelocityContext context, String destPath) {
"""
生成文件
@param template 模板
@param context 模板上下文
@param destPath 目标路径(绝对)
"""
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(destPath, Velocity.getProperty(Velocity.INPUT_ENCODING).toStrin... | java | public static void toFile(Template template, VelocityContext context, String destPath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(destPath, Velocity.getProperty(Velocity.INPUT_ENCODING).toString(), false);
merge(template, context, writer);
} catch (IORuntimeException e) {
t... | [
"public",
"static",
"void",
"toFile",
"(",
"Template",
"template",
",",
"VelocityContext",
"context",
",",
"String",
"destPath",
")",
"{",
"PrintWriter",
"writer",
"=",
"null",
";",
"try",
"{",
"writer",
"=",
"FileUtil",
".",
"getPrintWriter",
"(",
"destPath",... | 生成文件
@param template 模板
@param context 模板上下文
@param destPath 目标路径(绝对) | [
"生成文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java#L165-L175 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java | UriUtils.encodeQuery | public static String encodeQuery(String query, String encoding) throws UnsupportedEncodingException {
"""
Encodes the given URI query with the given encoding.
@param query the query to be encoded
@param encoding the character encoding to encode to
@return the encoded query
@throws UnsupportedEncodingException ... | java | public static String encodeQuery(String query, String encoding) throws UnsupportedEncodingException {
return HierarchicalUriComponents.encodeUriComponent(query, encoding, HierarchicalUriComponents.Type.QUERY);
} | [
"public",
"static",
"String",
"encodeQuery",
"(",
"String",
"query",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"HierarchicalUriComponents",
".",
"encodeUriComponent",
"(",
"query",
",",
"encoding",
",",
"HierarchicalUriComp... | Encodes the given URI query with the given encoding.
@param query the query to be encoded
@param encoding the character encoding to encode to
@return the encoded query
@throws UnsupportedEncodingException when the given encoding parameter is not supported | [
"Encodes",
"the",
"given",
"URI",
"query",
"with",
"the",
"given",
"encoding",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java#L296-L298 |
czyzby/gdx-lml | kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/scene2d/Actors.java | Actors.addActors | public static void addActors(final Stage stage, final Iterable<Actor> actors) {
"""
Null-safe utility for adding multiple actors to the stage.
@param stage will contain the actors.
@param actors will be added to the stage. Can be null.
"""
if (actors != null) {
for (final Actor actor : ... | java | public static void addActors(final Stage stage, final Iterable<Actor> actors) {
if (actors != null) {
for (final Actor actor : actors) {
stage.addActor(actor);
}
}
} | [
"public",
"static",
"void",
"addActors",
"(",
"final",
"Stage",
"stage",
",",
"final",
"Iterable",
"<",
"Actor",
">",
"actors",
")",
"{",
"if",
"(",
"actors",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"Actor",
"actor",
":",
"actors",
")",
"{",
"st... | Null-safe utility for adding multiple actors to the stage.
@param stage will contain the actors.
@param actors will be added to the stage. Can be null. | [
"Null",
"-",
"safe",
"utility",
"for",
"adding",
"multiple",
"actors",
"to",
"the",
"stage",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/scene2d/Actors.java#L41-L47 |
Javen205/IJPay | src/main/java/com/jpay/weixin/api/hb/RedHbApi.java | RedHbApi.getHbInfo | public static String getHbInfo(Map<String, String> params, String certPath, String certPassword) {
"""
根据商户订单号查询信息
@param params 请求参数
@param certPath 证书文件目录
@param certPassword 证书密码
@return {String}
"""
return HttpUtils.postSSL(getHbInfo, PaymentKit.toXml(params), certPath, certPassword);
} | java | public static String getHbInfo(Map<String, String> params, String certPath, String certPassword) {
return HttpUtils.postSSL(getHbInfo, PaymentKit.toXml(params), certPath, certPassword);
} | [
"public",
"static",
"String",
"getHbInfo",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"String",
"certPath",
",",
"String",
"certPassword",
")",
"{",
"return",
"HttpUtils",
".",
"postSSL",
"(",
"getHbInfo",
",",
"PaymentKit",
".",
"toXml",
... | 根据商户订单号查询信息
@param params 请求参数
@param certPath 证书文件目录
@param certPassword 证书密码
@return {String} | [
"根据商户订单号查询信息"
] | train | https://github.com/Javen205/IJPay/blob/78da6be4b70675abc6a41df74817532fa257ef29/src/main/java/com/jpay/weixin/api/hb/RedHbApi.java#L45-L47 |
EdwardRaff/JSAT | JSAT/src/jsat/datatransform/LinearTransform.java | LinearTransform.setRange | public void setRange(double A, double B) {
"""
Sets the min and max value to scale the data to. If given in the wrong order, this method will swap them
@param A the maximum value for the transformed data set
@param B the minimum value for the transformed data set
"""
if(A == B)
throw new ... | java | public void setRange(double A, double B)
{
if(A == B)
throw new RuntimeException("Values must be different");
else if(B > A)
{
double tmp = A;
A = B;
B = tmp;
}
this.A = A;
this.B = B;
} | [
"public",
"void",
"setRange",
"(",
"double",
"A",
",",
"double",
"B",
")",
"{",
"if",
"(",
"A",
"==",
"B",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"Values must be different\"",
")",
";",
"else",
"if",
"(",
"B",
">",
"A",
")",
"{",
"double",
"... | Sets the min and max value to scale the data to. If given in the wrong order, this method will swap them
@param A the maximum value for the transformed data set
@param B the minimum value for the transformed data set | [
"Sets",
"the",
"min",
"and",
"max",
"value",
"to",
"scale",
"the",
"data",
"to",
".",
"If",
"given",
"in",
"the",
"wrong",
"order",
"this",
"method",
"will",
"swap",
"them"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/datatransform/LinearTransform.java#L94-L106 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.