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 |
|---|---|---|---|---|---|---|---|---|---|---|
azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java | QuartzScheduler.resumeJobIfPresent | public synchronized boolean resumeJobIfPresent(final String jobName, final String groupName)
throws SchedulerException {
"""
Resume a job.
@param jobName
@param groupName
@return true the job has been resumed, no if the job doesn't exist.
@throws SchedulerException
"""
if (ifJobExist(jobName, gro... | java | public synchronized boolean resumeJobIfPresent(final String jobName, final String groupName)
throws SchedulerException {
if (ifJobExist(jobName, groupName)) {
this.scheduler.resumeJob(new JobKey(jobName, groupName));
return true;
} else {
return false;
}
} | [
"public",
"synchronized",
"boolean",
"resumeJobIfPresent",
"(",
"final",
"String",
"jobName",
",",
"final",
"String",
"groupName",
")",
"throws",
"SchedulerException",
"{",
"if",
"(",
"ifJobExist",
"(",
"jobName",
",",
"groupName",
")",
")",
"{",
"this",
".",
... | Resume a job.
@param jobName
@param groupName
@return true the job has been resumed, no if the job doesn't exist.
@throws SchedulerException | [
"Resume",
"a",
"job",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java#L135-L143 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | GrailsDomainBinder.getTableName | protected String getTableName(PersistentEntity domainClass, String sessionFactoryBeanName) {
"""
Evaluates the table name for the given property
@param domainClass The domain class to evaluate
@return The table name
"""
Mapping m = getMapping(domainClass);
String tableName = null;
i... | java | protected String getTableName(PersistentEntity domainClass, String sessionFactoryBeanName) {
Mapping m = getMapping(domainClass);
String tableName = null;
if (m != null && m.getTableName() != null) {
tableName = m.getTableName();
}
if (tableName == null) {
... | [
"protected",
"String",
"getTableName",
"(",
"PersistentEntity",
"domainClass",
",",
"String",
"sessionFactoryBeanName",
")",
"{",
"Mapping",
"m",
"=",
"getMapping",
"(",
"domainClass",
")",
";",
"String",
"tableName",
"=",
"null",
";",
"if",
"(",
"m",
"!=",
"n... | Evaluates the table name for the given property
@param domainClass The domain class to evaluate
@return The table name | [
"Evaluates",
"the",
"table",
"name",
"for",
"the",
"given",
"property"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L1199-L1217 |
VoltDB/voltdb | src/frontend/org/voltdb/ProcedurePartitionData.java | ProcedurePartitionData.fromPartitionInfoString | public static ProcedurePartitionData fromPartitionInfoString(String partitionInfoString) {
"""
For Testing usage ONLY.
From a partition information string to @ProcedurePartitionData
string format:
1) String.format("%s.%s: %s", tableName, columnName, parameterNo)
1) String.format("%s.%s: %s, %s.%s: %s", tableNa... | java | public static ProcedurePartitionData fromPartitionInfoString(String partitionInfoString) {
if (partitionInfoString == null || partitionInfoString.trim().isEmpty()) {
return new ProcedurePartitionData();
}
String[] partitionInfoParts = new String[0];
partitionInfoParts = part... | [
"public",
"static",
"ProcedurePartitionData",
"fromPartitionInfoString",
"(",
"String",
"partitionInfoString",
")",
"{",
"if",
"(",
"partitionInfoString",
"==",
"null",
"||",
"partitionInfoString",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return... | For Testing usage ONLY.
From a partition information string to @ProcedurePartitionData
string format:
1) String.format("%s.%s: %s", tableName, columnName, parameterNo)
1) String.format("%s.%s: %s, %s.%s: %s", tableName, columnName, parameterNo, tableName2, columnName2, parameterNo2)
@return | [
"For",
"Testing",
"usage",
"ONLY",
".",
"From",
"a",
"partition",
"information",
"string",
"to"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ProcedurePartitionData.java#L107-L141 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java | InternalTextureLoader.getTexture | public Texture getTexture(ImageData dataSource, int filter) throws IOException {
"""
Get a texture from a image file
@param dataSource The image data to generate the texture from
@param filter The filter to use when scaling the texture
@return The texture created
@throws IOException Indicates the texture is ... | java | public Texture getTexture(ImageData dataSource, int filter) throws IOException
{
int target = SGL.GL_TEXTURE_2D;
ByteBuffer textureBuffer;
textureBuffer = dataSource.getImageBufferData();
// create the texture ID for this texture
int textureID = createTextureID(); ... | [
"public",
"Texture",
"getTexture",
"(",
"ImageData",
"dataSource",
",",
"int",
"filter",
")",
"throws",
"IOException",
"{",
"int",
"target",
"=",
"SGL",
".",
"GL_TEXTURE_2D",
";",
"ByteBuffer",
"textureBuffer",
";",
"textureBuffer",
"=",
"dataSource",
".",
"getI... | Get a texture from a image file
@param dataSource The image data to generate the texture from
@param filter The filter to use when scaling the texture
@return The texture created
@throws IOException Indicates the texture is too big for the hardware | [
"Get",
"a",
"texture",
"from",
"a",
"image",
"file"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java#L385-L453 |
nightcode/yaranga | core/src/org/nightcode/common/base/Hexs.java | Hexs.fromByteArray | public String fromByteArray(byte[] bytes) {
"""
Returns a hexadecimal string representation of each bytes of {@code bytes}.
@param bytes a bytes to convert
@return a hexadecimal string representation of each bytes of {@code bytes}
"""
java.util.Objects.requireNonNull(bytes, "bytes");
return fromByt... | java | public String fromByteArray(byte[] bytes) {
java.util.Objects.requireNonNull(bytes, "bytes");
return fromByteArray(bytes, 0, bytes.length);
} | [
"public",
"String",
"fromByteArray",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"java",
".",
"util",
".",
"Objects",
".",
"requireNonNull",
"(",
"bytes",
",",
"\"bytes\"",
")",
";",
"return",
"fromByteArray",
"(",
"bytes",
",",
"0",
",",
"bytes",
".",
"... | Returns a hexadecimal string representation of each bytes of {@code bytes}.
@param bytes a bytes to convert
@return a hexadecimal string representation of each bytes of {@code bytes} | [
"Returns",
"a",
"hexadecimal",
"string",
"representation",
"of",
"each",
"bytes",
"of",
"{",
"@code",
"bytes",
"}",
"."
] | train | https://github.com/nightcode/yaranga/blob/f02cf8d8bcd365b6b1d55638938631a00e9ee808/core/src/org/nightcode/common/base/Hexs.java#L64-L67 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addErrorsCouldNotOpenOnSystem | public FessMessages addErrorsCouldNotOpenOnSystem(String property, String arg0) {
"""
Add the created action message for the key 'errors.could_not_open_on_system' with parameters.
<pre>
message: Could not open {0}. <br/>Please check if the file is associated with an application.
</pre>
@param property Th... | java | public FessMessages addErrorsCouldNotOpenOnSystem(String property, String arg0) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_could_not_open_on_system, arg0));
return this;
} | [
"public",
"FessMessages",
"addErrorsCouldNotOpenOnSystem",
"(",
"String",
"property",
",",
"String",
"arg0",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"ERRORS_could_not_open_on_system",
",",
... | Add the created action message for the key 'errors.could_not_open_on_system' with parameters.
<pre>
message: Could not open {0}. <br/>Please check if the file is associated with an application.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull... | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"errors",
".",
"could_not_open_on_system",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"Could",
"not",
"open",
"{",
"0",
"}",
".",
"<",
";",
"br",
"/",
">",
";",
"Please",... | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L1418-L1422 |
GCRC/nunaliit | nunaliit2-search/src/main/java/ca/carleton/gcrc/search/Searches.java | Searches.findHoverMedia | public JSONObject findHoverMedia(String place_id) throws Exception {
"""
Finds and returns the media to be played/displayed when a
name is visited. This information is fetched from the contributions
table, where the file use is marked as 'hover'.
@param place_id Place id of visited feature
@return
@throws Exc... | java | public JSONObject findHoverMedia(String place_id) throws Exception {
String featuresTable = new String(getFeaturesTableName());
List<SelectedColumn> selectFields = new Vector<SelectedColumn>();
selectFields.add( new SelectedColumn(SelectedColumn.Type.INTEGER, "place_id") );
selectFields.add( new SelectedCol... | [
"public",
"JSONObject",
"findHoverMedia",
"(",
"String",
"place_id",
")",
"throws",
"Exception",
"{",
"String",
"featuresTable",
"=",
"new",
"String",
"(",
"getFeaturesTableName",
"(",
")",
")",
";",
"List",
"<",
"SelectedColumn",
">",
"selectFields",
"=",
"new"... | Finds and returns the media to be played/displayed when a
name is visited. This information is fetched from the contributions
table, where the file use is marked as 'hover'.
@param place_id Place id of visited feature
@return
@throws Exception | [
"Finds",
"and",
"returns",
"the",
"media",
"to",
"be",
"played",
"/",
"displayed",
"when",
"a",
"name",
"is",
"visited",
".",
"This",
"information",
"is",
"fetched",
"from",
"the",
"contributions",
"table",
"where",
"the",
"file",
"use",
"is",
"marked",
"a... | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-search/src/main/java/ca/carleton/gcrc/search/Searches.java#L584-L601 |
hortonworks/dstream | dstream-tez/src/main/java/io/dstream/tez/utils/HadoopUtils.java | HadoopUtils.createLocalResource | public static LocalResource createLocalResource(FileSystem fs, Path provisionedResourcePath) {
"""
Creates a single {@link LocalResource} for the provisioned resource identified with {@link Path}
@param fs
@param provisionedResourcePath
@return
"""
try {
FileStatus scFileStatus = fs.getFileStatus(pro... | java | public static LocalResource createLocalResource(FileSystem fs, Path provisionedResourcePath){
try {
FileStatus scFileStatus = fs.getFileStatus(provisionedResourcePath);
LocalResource localResource = LocalResource.newInstance(
ConverterUtils.getYarnUrlFromURI(provisionedResourcePath.toUri()),
LocalReso... | [
"public",
"static",
"LocalResource",
"createLocalResource",
"(",
"FileSystem",
"fs",
",",
"Path",
"provisionedResourcePath",
")",
"{",
"try",
"{",
"FileStatus",
"scFileStatus",
"=",
"fs",
".",
"getFileStatus",
"(",
"provisionedResourcePath",
")",
";",
"LocalResource",... | Creates a single {@link LocalResource} for the provisioned resource identified with {@link Path}
@param fs
@param provisionedResourcePath
@return | [
"Creates",
"a",
"single",
"{",
"@link",
"LocalResource",
"}",
"for",
"the",
"provisioned",
"resource",
"identified",
"with",
"{",
"@link",
"Path",
"}"
] | train | https://github.com/hortonworks/dstream/blob/3a106c0f14725b028fe7fe2dbc660406d9a5f142/dstream-tez/src/main/java/io/dstream/tez/utils/HadoopUtils.java#L98-L111 |
Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java | Asset.unlinkContentKey | public static EntityUnlinkOperation unlinkContentKey(String assetId,
String contentKeyId) {
"""
unlink a content key.
@param assetId
the asset id
@param contentKeyId
the content key id
@return the entity action operation
"""
return new EntityUnlinkOperation(ENTITY_SET, assetId, "Cont... | java | public static EntityUnlinkOperation unlinkContentKey(String assetId,
String contentKeyId) {
return new EntityUnlinkOperation(ENTITY_SET, assetId, "ContentKeys", contentKeyId);
} | [
"public",
"static",
"EntityUnlinkOperation",
"unlinkContentKey",
"(",
"String",
"assetId",
",",
"String",
"contentKeyId",
")",
"{",
"return",
"new",
"EntityUnlinkOperation",
"(",
"ENTITY_SET",
",",
"assetId",
",",
"\"ContentKeys\"",
",",
"contentKeyId",
")",
";",
"}... | unlink a content key.
@param assetId
the asset id
@param contentKeyId
the content key id
@return the entity action operation | [
"unlink",
"a",
"content",
"key",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java#L349-L352 |
SeleniumHQ/fluent-selenium | java/src/main/java/org/seleniumhq/selenium/fluent/FluentSelect.java | FluentSelect.deselectByValue | public FluentSelect deselectByValue(final String value) {
"""
<p>
Deselect all options that have a value matching the argument. That is, when given "foo" this
would deselect an option like:
</p>
<option value="foo">Bar</option>
@param value The value to match against
"""
executeAndWr... | java | public FluentSelect deselectByValue(final String value) {
executeAndWrapReThrowIfNeeded(new DeselectByValue(value), Context.singular(context, "deselectByValue", null, value), true);
return new FluentSelect(super.delegate, currentElement.getFound(), this.context, monitor, booleanInsteadOfNotFoundExceptio... | [
"public",
"FluentSelect",
"deselectByValue",
"(",
"final",
"String",
"value",
")",
"{",
"executeAndWrapReThrowIfNeeded",
"(",
"new",
"DeselectByValue",
"(",
"value",
")",
",",
"Context",
".",
"singular",
"(",
"context",
",",
"\"deselectByValue\"",
",",
"null",
","... | <p>
Deselect all options that have a value matching the argument. That is, when given "foo" this
would deselect an option like:
</p>
<option value="foo">Bar</option>
@param value The value to match against | [
"<p",
">",
"Deselect",
"all",
"options",
"that",
"have",
"a",
"value",
"matching",
"the",
"argument",
".",
"That",
"is",
"when",
"given",
"foo",
"this",
"would",
"deselect",
"an",
"option",
"like",
":",
"<",
"/",
"p",
">",
"<",
";",
"option",
"value"... | train | https://github.com/SeleniumHQ/fluent-selenium/blob/fcb171471a7d1abb2800bcbca21b3ae3e6c12472/java/src/main/java/org/seleniumhq/selenium/fluent/FluentSelect.java#L137-L140 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildMethodInfo | public void buildMethodInfo(XMLNode node, Content methodsContentTree) throws DocletException {
"""
Build the information for the method.
@param node the XML element that specifies which components to document
@param methodsContentTree content tree to which the documentation will be added
@throws DocletExcepti... | java | public void buildMethodInfo(XMLNode node, Content methodsContentTree) throws DocletException {
if(configuration.nocomment){
return;
}
buildChildren(node, methodsContentTree);
} | [
"public",
"void",
"buildMethodInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"methodsContentTree",
")",
"throws",
"DocletException",
"{",
"if",
"(",
"configuration",
".",
"nocomment",
")",
"{",
"return",
";",
"}",
"buildChildren",
"(",
"node",
",",
"methodsConte... | Build the information for the method.
@param node the XML element that specifies which components to document
@param methodsContentTree content tree to which the documentation will be added
@throws DocletException if there is a problem while building the documentation | [
"Build",
"the",
"information",
"for",
"the",
"method",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java#L343-L348 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateUtils.java | DateUtils.setSeconds | public static Date setSeconds(final Date date, final int amount) {
"""
Sets the seconds field to a date returning a new object.
The original {@code Date} is unchanged.
@param date the date, not null
@param amount the amount to set
@return a new {@code Date} set with the specified value
@throws IllegalArgum... | java | public static Date setSeconds(final Date date, final int amount) {
return set(date, Calendar.SECOND, amount);
} | [
"public",
"static",
"Date",
"setSeconds",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"amount",
")",
"{",
"return",
"set",
"(",
"date",
",",
"Calendar",
".",
"SECOND",
",",
"amount",
")",
";",
"}"
] | Sets the seconds field to a date returning a new object.
The original {@code Date} is unchanged.
@param date the date, not null
@param amount the amount to set
@return a new {@code Date} set with the specified value
@throws IllegalArgumentException if the date is null
@since 2.4 | [
"Sets",
"the",
"seconds",
"field",
"to",
"a",
"date",
"returning",
"a",
"new",
"object",
".",
"The",
"original",
"{",
"@code",
"Date",
"}",
"is",
"unchanged",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L616-L618 |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.findOrCreateNode | public Node findOrCreateNode( Session session,
String path,
String defaultNodeType,
String finalNodeType ) throws RepositoryException {
"""
Get or create a node at the specified path.
@param session the JCR ses... | java | public Node findOrCreateNode( Session session,
String path,
String defaultNodeType,
String finalNodeType ) throws RepositoryException {
isNotNull(session, "session");
Node root = session.getRootNode();
... | [
"public",
"Node",
"findOrCreateNode",
"(",
"Session",
"session",
",",
"String",
"path",
",",
"String",
"defaultNodeType",
",",
"String",
"finalNodeType",
")",
"throws",
"RepositoryException",
"{",
"isNotNull",
"(",
"session",
",",
"\"session\"",
")",
";",
"Node",
... | Get or create a node at the specified path.
@param session the JCR session. may not be null
@param path the path of the desired node to be found or created. may not be null
@param defaultNodeType the default node type. may be null
@param finalNodeType the optional final node type. may be null
@return the existing or n... | [
"Get",
"or",
"create",
"a",
"node",
"at",
"the",
"specified",
"path",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L371-L378 |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java | ExceptionFactory.clientVersionAlreadyExistsException | public static final ClientVersionAlreadyExistsException clientVersionAlreadyExistsException(String clientName, String version) {
"""
Creates an exception from an client name.
@param clientName the client name
@param version the version
@return the exception
"""
return new ClientVersionAlreadyExistsE... | java | public static final ClientVersionAlreadyExistsException clientVersionAlreadyExistsException(String clientName, String version) {
return new ClientVersionAlreadyExistsException(Messages.i18n.format("clientVersionAlreadyExists", clientName, version)); //$NON-NLS-1$
} | [
"public",
"static",
"final",
"ClientVersionAlreadyExistsException",
"clientVersionAlreadyExistsException",
"(",
"String",
"clientName",
",",
"String",
"version",
")",
"{",
"return",
"new",
"ClientVersionAlreadyExistsException",
"(",
"Messages",
".",
"i18n",
".",
"format",
... | Creates an exception from an client name.
@param clientName the client name
@param version the version
@return the exception | [
"Creates",
"an",
"exception",
"from",
"an",
"client",
"name",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java#L147-L149 |
liyiorg/weixin-popular | src/main/java/weixin/popular/client/LocalHttpClient.java | LocalHttpClient.executeXmlResult | public static <T> T executeXmlResult(HttpUriRequest request,Class<T> clazz,String sign_type,String key) {
"""
数据返回自动XML对象解析
@param request request
@param clazz clazz
@param sign_type 数据返回验证签名类型
@param key 数据返回验证签名key
@param <T> T
@return result
@since 2.8.5
"""
return execute(request,XmlResponseHandle... | java | public static <T> T executeXmlResult(HttpUriRequest request,Class<T> clazz,String sign_type,String key){
return execute(request,XmlResponseHandler.createResponseHandler(clazz,sign_type,key));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"executeXmlResult",
"(",
"HttpUriRequest",
"request",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"sign_type",
",",
"String",
"key",
")",
"{",
"return",
"execute",
"(",
"request",
",",
"XmlResponseHandler",
... | 数据返回自动XML对象解析
@param request request
@param clazz clazz
@param sign_type 数据返回验证签名类型
@param key 数据返回验证签名key
@param <T> T
@return result
@since 2.8.5 | [
"数据返回自动XML对象解析"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/client/LocalHttpClient.java#L180-L182 |
thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traj/math/ConfinedDiffusionMSDCurveFit.java | ConfinedDiffusionMSDCurveFit.doFit | public void doFit(double[] xdata, double[] ydata, boolean reduced) {
"""
Fits the curve y = a*(1-b*exp((-4*D)*(x/a)*c)) to the x- and y data.
The parameters have the follow meaning:
@param xdata
@param ydata
"""
CurveFitter fitter = new CurveFitter(xdata, ydata);
if(reduced==false){
double ia = ... | java | public void doFit(double[] xdata, double[] ydata, boolean reduced){
CurveFitter fitter = new CurveFitter(xdata, ydata);
if(reduced==false){
double ia = Double.isNaN(initA)?0:initA;
double ib = Double.isNaN(initB)?0:initB;
double ic = Double.isNaN(initC)?0:initC;
double id = Double.isNaN(initD)?0:i... | [
"public",
"void",
"doFit",
"(",
"double",
"[",
"]",
"xdata",
",",
"double",
"[",
"]",
"ydata",
",",
"boolean",
"reduced",
")",
"{",
"CurveFitter",
"fitter",
"=",
"new",
"CurveFitter",
"(",
"xdata",
",",
"ydata",
")",
";",
"if",
"(",
"reduced",
"==",
... | Fits the curve y = a*(1-b*exp((-4*D)*(x/a)*c)) to the x- and y data.
The parameters have the follow meaning:
@param xdata
@param ydata | [
"Fits",
"the",
"curve",
"y",
"=",
"a",
"*",
"(",
"1",
"-",
"b",
"*",
"exp",
"((",
"-",
"4",
"*",
"D",
")",
"*",
"(",
"x",
"/",
"a",
")",
"*",
"c",
"))",
"to",
"the",
"x",
"-",
"and",
"y",
"data",
".",
"The",
"parameters",
"have",
"the",
... | train | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traj/math/ConfinedDiffusionMSDCurveFit.java#L65-L94 |
craterdog/java-primitive-types | src/main/java/craterdog/primitives/Probability.java | Probability.xor | static public Probability xor(Probability probability1, Probability probability2) {
"""
This function returns the logical exclusive disjunction of the specified probabilities. The value
of the logical exclusive disjunction of two probabilities is sans(P, Q) + sans(Q, P).
@param probability1 The first probabil... | java | static public Probability xor(Probability probability1, Probability probability2) {
double p1 = probability1.value;
double p2 = probability2.value;
return new Probability(p1 * (1.0d - p2) + p2 * (1.0d - p1));
} | [
"static",
"public",
"Probability",
"xor",
"(",
"Probability",
"probability1",
",",
"Probability",
"probability2",
")",
"{",
"double",
"p1",
"=",
"probability1",
".",
"value",
";",
"double",
"p2",
"=",
"probability2",
".",
"value",
";",
"return",
"new",
"Probab... | This function returns the logical exclusive disjunction of the specified probabilities. The value
of the logical exclusive disjunction of two probabilities is sans(P, Q) + sans(Q, P).
@param probability1 The first probability.
@param probability2 The second probability.
@return The logical exclusive disjunction of th... | [
"This",
"function",
"returns",
"the",
"logical",
"exclusive",
"disjunction",
"of",
"the",
"specified",
"probabilities",
".",
"The",
"value",
"of",
"the",
"logical",
"exclusive",
"disjunction",
"of",
"two",
"probabilities",
"is",
"sans",
"(",
"P",
"Q",
")",
"+"... | train | https://github.com/craterdog/java-primitive-types/blob/730f9bceacfac69f99b094464a7da5747c07a59e/src/main/java/craterdog/primitives/Probability.java#L193-L197 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.setString | public <T extends Model> T setString(String attributeName, Object value) {
"""
Sets attribute value as <code>String</code>.
If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class
<code>java.lang.String</code>, given the value is an instance of <code>S</code>... | java | public <T extends Model> T setString(String attributeName, Object value) {
Converter<Object, String> converter = modelRegistryLocal.converterForValue(attributeName, value, String.class);
return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toString(value));
} | [
"public",
"<",
"T",
"extends",
"Model",
">",
"T",
"setString",
"(",
"String",
"attributeName",
",",
"Object",
"value",
")",
"{",
"Converter",
"<",
"Object",
",",
"String",
">",
"converter",
"=",
"modelRegistryLocal",
".",
"converterForValue",
"(",
"attributeNa... | Sets attribute value as <code>String</code>.
If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class
<code>java.lang.String</code>, given the value is an instance of <code>S</code>, then it will be used,
otherwise performs a conversion using {@link Convert#toString(... | [
"Sets",
"attribute",
"value",
"as",
"<code",
">",
"String<",
"/",
"code",
">",
".",
"If",
"there",
"is",
"a",
"{",
"@link",
"Converter",
"}",
"registered",
"for",
"the",
"attribute",
"that",
"converts",
"from",
"Class",
"<code",
">",
"S<",
"/",
"code",
... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L1710-L1713 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java | DurationFormatUtils.formatDuration | public static String formatDuration(final long durationMillis, final String format, final boolean padWithZeros) {
"""
<p>Formats the time gap as a string, using the specified format.
Padding the left hand side of numbers with zeroes is optional.</p>
<p>This method formats durations using the days and lower fie... | java | public static String formatDuration(final long durationMillis, final String format, final boolean padWithZeros) {
Validate.inclusiveBetween(0, Long.MAX_VALUE, durationMillis, "durationMillis must not be negative");
final Token[] tokens = lexx(format);
long days = 0;
long hours ... | [
"public",
"static",
"String",
"formatDuration",
"(",
"final",
"long",
"durationMillis",
",",
"final",
"String",
"format",
",",
"final",
"boolean",
"padWithZeros",
")",
"{",
"Validate",
".",
"inclusiveBetween",
"(",
"0",
",",
"Long",
".",
"MAX_VALUE",
",",
"dur... | <p>Formats the time gap as a string, using the specified format.
Padding the left hand side of numbers with zeroes is optional.</p>
<p>This method formats durations using the days and lower fields of the
format pattern. Months and larger are not used.</p>
@param durationMillis the duration to format
@param format t... | [
"<p",
">",
"Formats",
"the",
"time",
"gap",
"as",
"a",
"string",
"using",
"the",
"specified",
"format",
".",
"Padding",
"the",
"left",
"hand",
"side",
"of",
"numbers",
"with",
"zeroes",
"is",
"optional",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java#L132-L161 |
fabric8io/fabric8-forge | addons/introspection/src/main/java/io/fabric8/forge/introspection/util/ReflectionHelper.java | ReflectionHelper.invokeMethod | public static Object invokeMethod(Method method, Object instance, Object... parameters) {
"""
A helper method to invoke a method via reflection and wrap any exceptions
as {@link RuntimeException} instances
@param method the method to invoke
@param instance the object instance (or null for static methods... | java | public static Object invokeMethod(Method method, Object instance, Object... parameters) {
if (method == null) {
return null;
}
try {
return method.invoke(instance, parameters);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
... | [
"public",
"static",
"Object",
"invokeMethod",
"(",
"Method",
"method",
",",
"Object",
"instance",
",",
"Object",
"...",
"parameters",
")",
"{",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"method",
".",
... | A helper method to invoke a method via reflection and wrap any exceptions
as {@link RuntimeException} instances
@param method the method to invoke
@param instance the object instance (or null for static methods)
@param parameters the parameters to the method
@return the result of the method invocation | [
"A",
"helper",
"method",
"to",
"invoke",
"a",
"method",
"via",
"reflection",
"and",
"wrap",
"any",
"exceptions",
"as",
"{",
"@link",
"RuntimeException",
"}",
"instances"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/introspection/src/main/java/io/fabric8/forge/introspection/util/ReflectionHelper.java#L33-L44 |
StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/viewholder/EfficientViewHolder.java | EfficientViewHolder.setTag | public void setTag(int viewId, int key, Object tag) {
"""
Equivalent to calling View.setTag
@param viewId The id of the view whose tag should change
@param key The key identifying the tag
@param tag An Object to tag the view with
"""
ViewHelper.setTag(mCacheView, viewId, key, tag);
} | java | public void setTag(int viewId, int key, Object tag) {
ViewHelper.setTag(mCacheView, viewId, key, tag);
} | [
"public",
"void",
"setTag",
"(",
"int",
"viewId",
",",
"int",
"key",
",",
"Object",
"tag",
")",
"{",
"ViewHelper",
".",
"setTag",
"(",
"mCacheView",
",",
"viewId",
",",
"key",
",",
"tag",
")",
";",
"}"
] | Equivalent to calling View.setTag
@param viewId The id of the view whose tag should change
@param key The key identifying the tag
@param tag An Object to tag the view with | [
"Equivalent",
"to",
"calling",
"View",
".",
"setTag"
] | train | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/viewholder/EfficientViewHolder.java#L294-L296 |
talsma-ict/umldoclet | src/main/java/nl/talsmasoftware/umldoclet/javadoc/TypeNameVisitor.java | TypeNameVisitor._visit | private TypeName _visit(TypeMirror type, Void parameter) {
"""
Internal variant of {@link #visit(TypeMirror, Object)} for calls from inside this visitor itself.
<p>
Main purpose of this method is to limit the endless recursion that would result for types such as
{@code <T extends Comparable<T>>}
@param type ... | java | private TypeName _visit(TypeMirror type, Void parameter) {
if (VISITED.get().add(type)) try {
return super.visit(type, parameter);
} finally {
VISITED.get().remove(type);
if (VISITED.get().isEmpty()) VISITED.remove();
}
return defaultAction(type, param... | [
"private",
"TypeName",
"_visit",
"(",
"TypeMirror",
"type",
",",
"Void",
"parameter",
")",
"{",
"if",
"(",
"VISITED",
".",
"get",
"(",
")",
".",
"add",
"(",
"type",
")",
")",
"try",
"{",
"return",
"super",
".",
"visit",
"(",
"type",
",",
"parameter",... | Internal variant of {@link #visit(TypeMirror, Object)} for calls from inside this visitor itself.
<p>
Main purpose of this method is to limit the endless recursion that would result for types such as
{@code <T extends Comparable<T>>}
@param type The type to visit.
@param parameter The parameter (ignored by our vi... | [
"Internal",
"variant",
"of",
"{",
"@link",
"#visit",
"(",
"TypeMirror",
"Object",
")",
"}",
"for",
"calls",
"from",
"inside",
"this",
"visitor",
"itself",
".",
"<p",
">",
"Main",
"purpose",
"of",
"this",
"method",
"is",
"to",
"limit",
"the",
"endless",
"... | train | https://github.com/talsma-ict/umldoclet/blob/373b23f2646603fddca4a495e9eccbb4a4491fdf/src/main/java/nl/talsmasoftware/umldoclet/javadoc/TypeNameVisitor.java#L64-L72 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.selectJavaDateTimeFormatFromMomentJSFormatOrDefault | public static String selectJavaDateTimeFormatFromMomentJSFormatOrDefault(Locale locale, String momentJSFormat, boolean withDate, boolean withTime) {
"""
Selects the Date Pattern to use based on the given Locale if the input
format is null
@param locale
Locale (may be the result of a call to selectLocale)
@pa... | java | public static String selectJavaDateTimeFormatFromMomentJSFormatOrDefault(Locale locale, String momentJSFormat, boolean withDate, boolean withTime) {
if (momentJSFormat == null) {
String dateFormat = "";
if (withDate) {
dateFormat = ((SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, locale)).to... | [
"public",
"static",
"String",
"selectJavaDateTimeFormatFromMomentJSFormatOrDefault",
"(",
"Locale",
"locale",
",",
"String",
"momentJSFormat",
",",
"boolean",
"withDate",
",",
"boolean",
"withTime",
")",
"{",
"if",
"(",
"momentJSFormat",
"==",
"null",
")",
"{",
"Str... | Selects the Date Pattern to use based on the given Locale if the input
format is null
@param locale
Locale (may be the result of a call to selectLocale)
@param momentJSFormat
Input format String
@return Date Pattern eg. dd/MM/yyyy | [
"Selects",
"the",
"Date",
"Pattern",
"to",
"use",
"based",
"on",
"the",
"given",
"Locale",
"if",
"the",
"input",
"format",
"is",
"null"
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L537-L558 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/DataSinkTask.java | DataSinkTask.initOutputFormat | private void initOutputFormat() {
"""
Initializes the OutputFormat implementation and configuration.
@throws RuntimeException
Throws if instance of OutputFormat implementation can not be
obtained.
"""
if (this.userCodeClassLoader == null) {
try {
this.userCodeClassLoader = LibraryCacheManager.get... | java | private void initOutputFormat() {
if (this.userCodeClassLoader == null) {
try {
this.userCodeClassLoader = LibraryCacheManager.getClassLoader(getEnvironment().getJobID());
} catch (IOException ioe) {
throw new RuntimeException("Library cache manager could not be instantiated.", ioe);
}
}
// obtai... | [
"private",
"void",
"initOutputFormat",
"(",
")",
"{",
"if",
"(",
"this",
".",
"userCodeClassLoader",
"==",
"null",
")",
"{",
"try",
"{",
"this",
".",
"userCodeClassLoader",
"=",
"LibraryCacheManager",
".",
"getClassLoader",
"(",
"getEnvironment",
"(",
")",
"."... | Initializes the OutputFormat implementation and configuration.
@throws RuntimeException
Throws if instance of OutputFormat implementation can not be
obtained. | [
"Initializes",
"the",
"OutputFormat",
"implementation",
"and",
"configuration",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/DataSinkTask.java#L268-L302 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/capacity/CapacityFactory.java | CapacityFactory.loadDecrementer | private static CapacityDecrementer loadDecrementer(Extension decrementer, ClassLoaderPlugin classLoaderPlugin) {
"""
Load the decrementer
@param decrementer The incrementer metadata to load as class instance
@param classLoaderPlugin class loader plugin to use to load class
@return The decrementer
"""
... | java | private static CapacityDecrementer loadDecrementer(Extension decrementer, ClassLoaderPlugin classLoaderPlugin)
{
Object result = loadExtension(decrementer, classLoaderPlugin);
if (result != null && result instanceof CapacityDecrementer)
{
return (CapacityDecrementer)result;
}
... | [
"private",
"static",
"CapacityDecrementer",
"loadDecrementer",
"(",
"Extension",
"decrementer",
",",
"ClassLoaderPlugin",
"classLoaderPlugin",
")",
"{",
"Object",
"result",
"=",
"loadExtension",
"(",
"decrementer",
",",
"classLoaderPlugin",
")",
";",
"if",
"(",
"resul... | Load the decrementer
@param decrementer The incrementer metadata to load as class instance
@param classLoaderPlugin class loader plugin to use to load class
@return The decrementer | [
"Load",
"the",
"decrementer"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/capacity/CapacityFactory.java#L169-L181 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/dnd/CmsDNDHandler.java | CmsDNDHandler.animateCancel | protected void animateCancel(final I_CmsDraggable draggable, final I_CmsDNDController controller) {
"""
Clears the drag process with a move animation of the drag element to it's original position.<p>
@param draggable the draggable
@param controller the drag and drop controller
"""
controller.onAni... | java | protected void animateCancel(final I_CmsDraggable draggable, final I_CmsDNDController controller) {
controller.onAnimationStart(draggable, null, this);
stopDragging();
Command callback = new Command() {
/**
* @see com.google.gwt.user.client.Command#execute()
... | [
"protected",
"void",
"animateCancel",
"(",
"final",
"I_CmsDraggable",
"draggable",
",",
"final",
"I_CmsDNDController",
"controller",
")",
"{",
"controller",
".",
"onAnimationStart",
"(",
"draggable",
",",
"null",
",",
"this",
")",
";",
"stopDragging",
"(",
")",
... | Clears the drag process with a move animation of the drag element to it's original position.<p>
@param draggable the draggable
@param controller the drag and drop controller | [
"Clears",
"the",
"drag",
"process",
"with",
"a",
"move",
"animation",
"of",
"the",
"drag",
"element",
"to",
"it",
"s",
"original",
"position",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/dnd/CmsDNDHandler.java#L776-L793 |
groovyfx-project/groovyfx | src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java | FXBindableASTTransformation.createSetterStatement | protected Statement createSetterStatement(PropertyNode fxProperty) {
"""
Creates the body of a setter method for the original property that is actually backed by a
JavaFX *Property instance:
<p>
Object $property = this.someProperty()
$property.setValue(value)
@param fxProperty The original Groovy property t... | java | protected Statement createSetterStatement(PropertyNode fxProperty) {
String fxPropertyGetter = getFXPropertyGetterName(fxProperty);
VariableExpression thisExpression = VariableExpression.THIS_EXPRESSION;
ArgumentListExpression emptyArgs = ArgumentListExpression.EMPTY_ARGUMENTS;
MethodCa... | [
"protected",
"Statement",
"createSetterStatement",
"(",
"PropertyNode",
"fxProperty",
")",
"{",
"String",
"fxPropertyGetter",
"=",
"getFXPropertyGetterName",
"(",
"fxProperty",
")",
";",
"VariableExpression",
"thisExpression",
"=",
"VariableExpression",
".",
"THIS_EXPRESSIO... | Creates the body of a setter method for the original property that is actually backed by a
JavaFX *Property instance:
<p>
Object $property = this.someProperty()
$property.setValue(value)
@param fxProperty The original Groovy property that we're creating a setter for.
@return A Statement that is the body of the new set... | [
"Creates",
"the",
"body",
"of",
"a",
"setter",
"method",
"for",
"the",
"original",
"property",
"that",
"is",
"actually",
"backed",
"by",
"a",
"JavaFX",
"*",
"Property",
"instance",
":",
"<p",
">",
"Object",
"$property",
"=",
"this",
".",
"someProperty",
"(... | train | https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L598-L609 |
denisneuling/apitrary.jar | apitrary-orm/apitrary-orm-core/src/main/java/com/apitrary/orm/core/unmarshalling/JsonResponseConsumer.java | JsonResponseConsumer.onBoolean | protected void onBoolean(Boolean bool, String fieldName, JsonParser jp) {
"""
<p>
onBoolean.
</p>
@param bool
a {@link java.lang.Boolean} object.
@param fieldName
a {@link java.lang.String} object.
@param jp
a {@link org.codehaus.jackson.JsonParser} object.
"""
log.trace(fieldName + " " + bool);
} | java | protected void onBoolean(Boolean bool, String fieldName, JsonParser jp) {
log.trace(fieldName + " " + bool);
} | [
"protected",
"void",
"onBoolean",
"(",
"Boolean",
"bool",
",",
"String",
"fieldName",
",",
"JsonParser",
"jp",
")",
"{",
"log",
".",
"trace",
"(",
"fieldName",
"+",
"\" \"",
"+",
"bool",
")",
";",
"}"
] | <p>
onBoolean.
</p>
@param bool
a {@link java.lang.Boolean} object.
@param fieldName
a {@link java.lang.String} object.
@param jp
a {@link org.codehaus.jackson.JsonParser} object. | [
"<p",
">",
"onBoolean",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-orm/apitrary-orm-core/src/main/java/com/apitrary/orm/core/unmarshalling/JsonResponseConsumer.java#L218-L220 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/collections/MapUtils.java | MapUtils.valueTransformer | public static <K, V1, V2> Maps.EntryTransformer<K, V1, V2> valueTransformer(
final Function<? super V1, V2> valueFunction) {
"""
Creates a {@link com.google.common.collect.Maps.EntryTransformer} which applies the supplied
{@link Function} to map entry values.
"""
checkNotNull(valueFunction);
ret... | java | public static <K, V1, V2> Maps.EntryTransformer<K, V1, V2> valueTransformer(
final Function<? super V1, V2> valueFunction) {
checkNotNull(valueFunction);
return new Maps.EntryTransformer<K, V1, V2>() {
@Override
public V2 transformEntry(final K key, final V1 value) {
return valueFuncti... | [
"public",
"static",
"<",
"K",
",",
"V1",
",",
"V2",
">",
"Maps",
".",
"EntryTransformer",
"<",
"K",
",",
"V1",
",",
"V2",
">",
"valueTransformer",
"(",
"final",
"Function",
"<",
"?",
"super",
"V1",
",",
"V2",
">",
"valueFunction",
")",
"{",
"checkNot... | Creates a {@link com.google.common.collect.Maps.EntryTransformer} which applies the supplied
{@link Function} to map entry values. | [
"Creates",
"a",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/collections/MapUtils.java#L539-L548 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.makeMap | public static Map makeMap(Mapper mapper, Iterator i) {
"""
Create a new Map by using the iterator objects as keys, and the mapping result as values. Discard keys which
return null values from the mapper.
@param mapper a Mapper to map the values
@param i Iterator
@return a new Map with values mapped
... | java | public static Map makeMap(Mapper mapper, Iterator i) {
return makeMap(mapper, i, false);
} | [
"public",
"static",
"Map",
"makeMap",
"(",
"Mapper",
"mapper",
",",
"Iterator",
"i",
")",
"{",
"return",
"makeMap",
"(",
"mapper",
",",
"i",
",",
"false",
")",
";",
"}"
] | Create a new Map by using the iterator objects as keys, and the mapping result as values. Discard keys which
return null values from the mapper.
@param mapper a Mapper to map the values
@param i Iterator
@return a new Map with values mapped | [
"Create",
"a",
"new",
"Map",
"by",
"using",
"the",
"iterator",
"objects",
"as",
"keys",
"and",
"the",
"mapping",
"result",
"as",
"values",
".",
"Discard",
"keys",
"which",
"return",
"null",
"values",
"from",
"the",
"mapper",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L548-L550 |
trajano/caliper | caliper/src/main/java/com/google/caliper/memory/ObjectExplorer.java | ObjectExplorer.exploreObject | public static <T> T exploreObject(Object rootObject, ObjectVisitor<T> visitor) {
"""
Explores an object graph (defined by a root object and whatever is
reachable through it, following non-static fields) while using an
{@link ObjectVisitor} to both control the traversal and return a value.
<p>Equivalent to {@c... | java | public static <T> T exploreObject(Object rootObject, ObjectVisitor<T> visitor) {
return exploreObject(rootObject, visitor, EnumSet.noneOf(Feature.class));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"exploreObject",
"(",
"Object",
"rootObject",
",",
"ObjectVisitor",
"<",
"T",
">",
"visitor",
")",
"{",
"return",
"exploreObject",
"(",
"rootObject",
",",
"visitor",
",",
"EnumSet",
".",
"noneOf",
"(",
"Feature",
"."... | Explores an object graph (defined by a root object and whatever is
reachable through it, following non-static fields) while using an
{@link ObjectVisitor} to both control the traversal and return a value.
<p>Equivalent to {@code exploreObject(rootObject, visitor,
EnumSet.noneOf(Feature.class))}.
@param <T> the type o... | [
"Explores",
"an",
"object",
"graph",
"(",
"defined",
"by",
"a",
"root",
"object",
"and",
"whatever",
"is",
"reachable",
"through",
"it",
"following",
"non",
"-",
"static",
"fields",
")",
"while",
"using",
"an",
"{",
"@link",
"ObjectVisitor",
"}",
"to",
"bo... | train | https://github.com/trajano/caliper/blob/a8bcfd84fa9d7b893b3edfadc3b13240ae5cd658/caliper/src/main/java/com/google/caliper/memory/ObjectExplorer.java#L68-L70 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.loadFilters | protected boolean loadFilters(final boolean cleanOnFail, boolean asynchronous) {
"""
Loads the bloom filters
@param cleanOnFail clean everything if an error occurs
@param asynchronous make the bloom filters loading asynchronous
@return <code>true</code> if the filters could be loaded successfully, <code>false</... | java | protected boolean loadFilters(final boolean cleanOnFail, boolean asynchronous)
{
if (!filtersSupported.get())
{
if (LOG.isWarnEnabled())
{
LOG.warn("The bloom filters are not supported therefore they cannot be reloaded");
}
return false;
}
filte... | [
"protected",
"boolean",
"loadFilters",
"(",
"final",
"boolean",
"cleanOnFail",
",",
"boolean",
"asynchronous",
")",
"{",
"if",
"(",
"!",
"filtersSupported",
".",
"get",
"(",
")",
")",
"{",
"if",
"(",
"LOG",
".",
"isWarnEnabled",
"(",
")",
")",
"{",
"LOG"... | Loads the bloom filters
@param cleanOnFail clean everything if an error occurs
@param asynchronous make the bloom filters loading asynchronous
@return <code>true</code> if the filters could be loaded successfully, <code>false</code> otherwise. | [
"Loads",
"the",
"bloom",
"filters"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L2640-L2670 |
sagiegurari/fax4j | src/main/java/org/fax4j/bridge/AbstractVendorPolicy.java | AbstractVendorPolicy.invokePolicyForResponse | public boolean invokePolicyForResponse(Object requestDataHolder,FaxJob faxJob) {
"""
This function invokes the vendor policy.<br>
The policy may charge a customer for the service, or validate the user
has permissions to invoke the action and so on.<br>
In case the policy takes over the flow and the fax bridge s... | java | public boolean invokePolicyForResponse(Object requestDataHolder,FaxJob faxJob)
{
if(requestDataHolder==null)
{
throw new FaxException("Request data holder not provided.");
}
if(faxJob==null)
{
throw new FaxException("Fax job not provided.");
}
... | [
"public",
"boolean",
"invokePolicyForResponse",
"(",
"Object",
"requestDataHolder",
",",
"FaxJob",
"faxJob",
")",
"{",
"if",
"(",
"requestDataHolder",
"==",
"null",
")",
"{",
"throw",
"new",
"FaxException",
"(",
"\"Request data holder not provided.\"",
")",
";",
"}"... | This function invokes the vendor policy.<br>
The policy may charge a customer for the service, or validate the user
has permissions to invoke the action and so on.<br>
In case the policy takes over the flow and the fax bridge should not
be invoked, this method should return false.
@param requestDataHolder
The reques... | [
"This",
"function",
"invokes",
"the",
"vendor",
"policy",
".",
"<br",
">",
"The",
"policy",
"may",
"charge",
"a",
"customer",
"for",
"the",
"service",
"or",
"validate",
"the",
"user",
"has",
"permissions",
"to",
"invoke",
"the",
"action",
"and",
"so",
"on"... | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/bridge/AbstractVendorPolicy.java#L132-L147 |
shevek/qemu-java | qemu-exec/src/main/java/org/anarres/qemu/exec/util/QEmuIdAllocator.java | QEmuIdAllocator.newPciAddresses | @Nonnull
public String newPciAddresses(@Nonnegative int count, @Nonnull String separator) {
"""
Returns a comma-separated list of new PCI addresses.
@param count How many addresses to return.
@param separator The separator to use between addresses.
@return A separated String of new PCI addresses.
"""
... | java | @Nonnull
public String newPciAddresses(@Nonnegative int count, @Nonnull String separator) {
StringBuilder buf = new StringBuilder();
for (int i = 0; i < count; i++) {
if (i > 0)
buf.append(separator);
buf.append(newPciAddress());
}
return buf.t... | [
"@",
"Nonnull",
"public",
"String",
"newPciAddresses",
"(",
"@",
"Nonnegative",
"int",
"count",
",",
"@",
"Nonnull",
"String",
"separator",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";... | Returns a comma-separated list of new PCI addresses.
@param count How many addresses to return.
@param separator The separator to use between addresses.
@return A separated String of new PCI addresses. | [
"Returns",
"a",
"comma",
"-",
"separated",
"list",
"of",
"new",
"PCI",
"addresses",
"."
] | train | https://github.com/shevek/qemu-java/blob/ef4cc2c991df36d5f450b49ec8e341f6ed3362f2/qemu-exec/src/main/java/org/anarres/qemu/exec/util/QEmuIdAllocator.java#L61-L70 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/ds/DsParser.java | DsParser.storeSecurity | protected void storeSecurity(DsSecurity s, XMLStreamWriter writer) throws Exception {
"""
Store security
@param s The security
@param writer The writer
@exception Exception Thrown if an error occurs
"""
writer.writeStartElement(XML.ELEMENT_SECURITY);
if (s.getUserName() != null)
{
... | java | protected void storeSecurity(DsSecurity s, XMLStreamWriter writer) throws Exception
{
writer.writeStartElement(XML.ELEMENT_SECURITY);
if (s.getUserName() != null)
{
writer.writeStartElement(XML.ELEMENT_USER_NAME);
writer.writeCharacters(s.getValue(XML.ELEMENT_USER_NAME, s.getUser... | [
"protected",
"void",
"storeSecurity",
"(",
"DsSecurity",
"s",
",",
"XMLStreamWriter",
"writer",
")",
"throws",
"Exception",
"{",
"writer",
".",
"writeStartElement",
"(",
"XML",
".",
"ELEMENT_SECURITY",
")",
";",
"if",
"(",
"s",
".",
"getUserName",
"(",
")",
... | Store security
@param s The security
@param writer The writer
@exception Exception Thrown if an error occurs | [
"Store",
"security"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/ds/DsParser.java#L1928-L1955 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassUtils.java | ClassUtils.getClass | @GwtIncompatible("incompatible method")
public static Class<?> getClass(final String className, final boolean initialize) throws ClassNotFoundException {
"""
Returns the class represented by {@code className} using the
current thread's context class loader. This implementation supports the
syntaxes "{@code j... | java | @GwtIncompatible("incompatible method")
public static Class<?> getClass(final String className, final boolean initialize) throws ClassNotFoundException {
final ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
final ClassLoader loader = contextCL == null ? ClassUtils.class.getC... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"Class",
"<",
"?",
">",
"getClass",
"(",
"final",
"String",
"className",
",",
"final",
"boolean",
"initialize",
")",
"throws",
"ClassNotFoundException",
"{",
"final",
"ClassLoader",
"... | Returns the class represented by {@code className} using the
current thread's context class loader. This implementation supports the
syntaxes "{@code java.util.Map.Entry[]}", "{@code java.util.Map$Entry[]}",
"{@code [Ljava.util.Map.Entry;}", and "{@code [Ljava.util.Map$Entry;}".
@param className the class name
@param... | [
"Returns",
"the",
"class",
"represented",
"by",
"{",
"@code",
"className",
"}",
"using",
"the",
"current",
"thread",
"s",
"context",
"class",
"loader",
".",
"This",
"implementation",
"supports",
"the",
"syntaxes",
"{",
"@code",
"java",
".",
"util",
".",
"Map... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L1069-L1074 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.purgeJspRepository | public void purgeJspRepository() throws Exception {
"""
Purges the jsp repository.<p>
@throws Exception if something goes wrong
@see org.opencms.flex.CmsFlexCache#cmsEvent(org.opencms.main.CmsEvent)
"""
OpenCms.fireCmsEvent(
new CmsEvent(I_CmsEventListener.EVENT_FLEX_PURGE_JSP_REPOSI... | java | public void purgeJspRepository() throws Exception {
OpenCms.fireCmsEvent(
new CmsEvent(I_CmsEventListener.EVENT_FLEX_PURGE_JSP_REPOSITORY, new HashMap<String, Object>()));
} | [
"public",
"void",
"purgeJspRepository",
"(",
")",
"throws",
"Exception",
"{",
"OpenCms",
".",
"fireCmsEvent",
"(",
"new",
"CmsEvent",
"(",
"I_CmsEventListener",
".",
"EVENT_FLEX_PURGE_JSP_REPOSITORY",
",",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
... | Purges the jsp repository.<p>
@throws Exception if something goes wrong
@see org.opencms.flex.CmsFlexCache#cmsEvent(org.opencms.main.CmsEvent) | [
"Purges",
"the",
"jsp",
"repository",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L1175-L1179 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/util/MultipartByterangesEntity.java | MultipartByterangesEntity.print | private void print(String s, OutputStream ostream) throws IOException {
"""
Writes string into stream.
@param s string
@param ostream stream
@throws IOException {@link IOException}
"""
int length = s.length();
for (int i = 0; i < length; i++)
{
char c = s.charAt(i);
ost... | java | private void print(String s, OutputStream ostream) throws IOException
{
int length = s.length();
for (int i = 0; i < length; i++)
{
char c = s.charAt(i);
ostream.write(c);
}
} | [
"private",
"void",
"print",
"(",
"String",
"s",
",",
"OutputStream",
"ostream",
")",
"throws",
"IOException",
"{",
"int",
"length",
"=",
"s",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
... | Writes string into stream.
@param s string
@param ostream stream
@throws IOException {@link IOException} | [
"Writes",
"string",
"into",
"stream",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/util/MultipartByterangesEntity.java#L143-L151 |
jbundle/jbundle | main/db/src/main/java/org/jbundle/main/user/db/UpdateResourcePermissionHandler.java | UpdateResourcePermissionHandler.doRecordChange | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) {
"""
Called when a change is the record status is about to happen/has happened.
@param field If this file change is due to a field, this is the field.
@param iChangeType The type of change that occurred.
@param bDisplayOption I... | java | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
{
if ((iChangeType == DBConstants.AFTER_UPDATE_TYPE)
|| (iChangeType == DBConstants.AFTER_ADD_TYPE)
|| (iChangeType == DBConstants.AFTER_DELETE_TYPE))
{
if (this.getOwner().getFiel... | [
"public",
"int",
"doRecordChange",
"(",
"FieldInfo",
"field",
",",
"int",
"iChangeType",
",",
"boolean",
"bDisplayOption",
")",
"{",
"if",
"(",
"(",
"iChangeType",
"==",
"DBConstants",
".",
"AFTER_UPDATE_TYPE",
")",
"||",
"(",
"iChangeType",
"==",
"DBConstants",... | Called when a change is the record status is about to happen/has happened.
@param field If this file change is due to a field, this is the field.
@param iChangeType The type of change that occurred.
@param bDisplayOption If true, display any changes.
@return an error code.
ADD_TYPE - Before a write.
UPDATE_TYPE - Befor... | [
"Called",
"when",
"a",
"change",
"is",
"the",
"record",
"status",
"is",
"about",
"to",
"happen",
"/",
"has",
"happened",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/db/src/main/java/org/jbundle/main/user/db/UpdateResourcePermissionHandler.java#L68-L78 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/ClassNode.java | ClassNode.getDeclaredMethod | public MethodNode getDeclaredMethod(String name, Parameter[] parameters) {
"""
Finds a method matching the given name and parameters in this class.
@return the method matching the given name and parameters or null
"""
for (MethodNode method : getDeclaredMethods(name)) {
if (parametersEq... | java | public MethodNode getDeclaredMethod(String name, Parameter[] parameters) {
for (MethodNode method : getDeclaredMethods(name)) {
if (parametersEqual(method.getParameters(), parameters)) {
return method;
}
}
return null;
} | [
"public",
"MethodNode",
"getDeclaredMethod",
"(",
"String",
"name",
",",
"Parameter",
"[",
"]",
"parameters",
")",
"{",
"for",
"(",
"MethodNode",
"method",
":",
"getDeclaredMethods",
"(",
"name",
")",
")",
"{",
"if",
"(",
"parametersEqual",
"(",
"method",
".... | Finds a method matching the given name and parameters in this class.
@return the method matching the given name and parameters or null | [
"Finds",
"a",
"method",
"matching",
"the",
"given",
"name",
"and",
"parameters",
"in",
"this",
"class",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/ClassNode.java#L929-L936 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddOperations.java | AddOperations.getPayloadShape | public static Shape getPayloadShape(Map<String, Shape> c2jShapes, Shape outputShape) {
"""
If there is a member in the output shape that is explicitly marked as the payload (with the
payload trait) this method returns the target shape of that member. Otherwise this method
returns null.
@param c2jShapes
All C... | java | public static Shape getPayloadShape(Map<String, Shape> c2jShapes, Shape outputShape) {
if (outputShape.getPayload() == null) {
return null;
}
Member payloadMember = outputShape.getMembers().get(outputShape.getPayload());
return c2jShapes.get(payloadMember.getShape());
} | [
"public",
"static",
"Shape",
"getPayloadShape",
"(",
"Map",
"<",
"String",
",",
"Shape",
">",
"c2jShapes",
",",
"Shape",
"outputShape",
")",
"{",
"if",
"(",
"outputShape",
".",
"getPayload",
"(",
")",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
... | If there is a member in the output shape that is explicitly marked as the payload (with the
payload trait) this method returns the target shape of that member. Otherwise this method
returns null.
@param c2jShapes
All C2J shapes
@param outputShape
Output shape of operation that may contain a member designated as the pa... | [
"If",
"there",
"is",
"a",
"member",
"in",
"the",
"output",
"shape",
"that",
"is",
"explicitly",
"marked",
"as",
"the",
"payload",
"(",
"with",
"the",
"payload",
"trait",
")",
"this",
"method",
"returns",
"the",
"target",
"shape",
"of",
"that",
"member",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddOperations.java#L169-L175 |
umano/AndroidSlidingUpPanel | library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java | ViewDragHelper.settleCapturedViewAt | public boolean settleCapturedViewAt(int finalLeft, int finalTop) {
"""
Settle the captured view at the given (left, top) position.
The appropriate velocity from prior motion will be taken into account.
If this method returns true, the caller should invoke {@link #continueSettling(boolean)}
on each subsequent fr... | java | public boolean settleCapturedViewAt(int finalLeft, int finalTop) {
if (!mReleaseInProgress) {
throw new IllegalStateException("Cannot settleCapturedViewAt outside of a call to " +
"Callback#onViewReleased");
}
return forceSettleCapturedViewAt(finalLeft, finalTop,... | [
"public",
"boolean",
"settleCapturedViewAt",
"(",
"int",
"finalLeft",
",",
"int",
"finalTop",
")",
"{",
"if",
"(",
"!",
"mReleaseInProgress",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot settleCapturedViewAt outside of a call to \"",
"+",
"\"Callbac... | Settle the captured view at the given (left, top) position.
The appropriate velocity from prior motion will be taken into account.
If this method returns true, the caller should invoke {@link #continueSettling(boolean)}
on each subsequent frame to continue the motion until it returns false. If this method
returns false... | [
"Settle",
"the",
"captured",
"view",
"at",
"the",
"given",
"(",
"left",
"top",
")",
"position",
".",
"The",
"appropriate",
"velocity",
"from",
"prior",
"motion",
"will",
"be",
"taken",
"into",
"account",
".",
"If",
"this",
"method",
"returns",
"true",
"the... | train | https://github.com/umano/AndroidSlidingUpPanel/blob/45a460435b07e764138a700328836cafc1ed5c42/library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java#L587-L596 |
icode/ameba | src/main/java/ameba/db/ebean/support/ModelResourceStructure.java | ModelResourceStructure.deleteModel | protected boolean deleteModel(MODEL_ID id, boolean permanent) throws Exception {
"""
delete a model
@param id model id
@param permanent a boolean.
@return if true delete from physical device, if logical delete return false, response status 202
@throws java.lang.Exception if any.
"""
if (pe... | java | protected boolean deleteModel(MODEL_ID id, boolean permanent) throws Exception {
if (permanent) {
server.deletePermanent(modelType, id);
} else {
server.delete(modelType, id);
}
return permanent;
} | [
"protected",
"boolean",
"deleteModel",
"(",
"MODEL_ID",
"id",
",",
"boolean",
"permanent",
")",
"throws",
"Exception",
"{",
"if",
"(",
"permanent",
")",
"{",
"server",
".",
"deletePermanent",
"(",
"modelType",
",",
"id",
")",
";",
"}",
"else",
"{",
"server... | delete a model
@param id model id
@param permanent a boolean.
@return if true delete from physical device, if logical delete return false, response status 202
@throws java.lang.Exception if any. | [
"delete",
"a",
"model"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/support/ModelResourceStructure.java#L521-L528 |
jenkinsci/jenkins | core/src/main/java/jenkins/org/apache/commons/validator/routines/DomainValidator.java | DomainValidator.isValidInfrastructureTld | public boolean isValidInfrastructureTld(String iTld) {
"""
Returns true if the specified <code>String</code> matches any
IANA-defined infrastructure top-level domain. Leading dots are
ignored if present. The search is case-insensitive.
@param iTld the parameter to check for infrastructure TLD status, not null
... | java | public boolean isValidInfrastructureTld(String iTld) {
final String key = chompLeadingDot(unicodeToASCII(iTld).toLowerCase(Locale.ENGLISH));
return arrayContains(INFRASTRUCTURE_TLDS, key);
} | [
"public",
"boolean",
"isValidInfrastructureTld",
"(",
"String",
"iTld",
")",
"{",
"final",
"String",
"key",
"=",
"chompLeadingDot",
"(",
"unicodeToASCII",
"(",
"iTld",
")",
".",
"toLowerCase",
"(",
"Locale",
".",
"ENGLISH",
")",
")",
";",
"return",
"arrayConta... | Returns true if the specified <code>String</code> matches any
IANA-defined infrastructure top-level domain. Leading dots are
ignored if present. The search is case-insensitive.
@param iTld the parameter to check for infrastructure TLD status, not null
@return true if the parameter is an infrastructure TLD | [
"Returns",
"true",
"if",
"the",
"specified",
"<code",
">",
"String<",
"/",
"code",
">",
"matches",
"any",
"IANA",
"-",
"defined",
"infrastructure",
"top",
"-",
"level",
"domain",
".",
"Leading",
"dots",
"are",
"ignored",
"if",
"present",
".",
"The",
"searc... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/org/apache/commons/validator/routines/DomainValidator.java#L220-L223 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.updateAsync | public Observable<Void> updateAsync(String jobId, JobUpdateParameter jobUpdateParameter) {
"""
Updates the properties of the specified job.
This fully replaces all the updatable properties of the job. For example, if the job has constraints associated with it and if constraints is not specified with this request,... | java | public Observable<Void> updateAsync(String jobId, JobUpdateParameter jobUpdateParameter) {
return updateWithServiceResponseAsync(jobId, jobUpdateParameter).map(new Func1<ServiceResponseWithHeaders<Void, JobUpdateHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHeaders<Vo... | [
"public",
"Observable",
"<",
"Void",
">",
"updateAsync",
"(",
"String",
"jobId",
",",
"JobUpdateParameter",
"jobUpdateParameter",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"jobId",
",",
"jobUpdateParameter",
")",
".",
"map",
"(",
"new",
"Func1",
"... | Updates the properties of the specified job.
This fully replaces all the updatable properties of the job. For example, if the job has constraints associated with it and if constraints is not specified with this request, then the Batch service will remove the existing constraints.
@param jobId The ID of the job whose p... | [
"Updates",
"the",
"properties",
"of",
"the",
"specified",
"job",
".",
"This",
"fully",
"replaces",
"all",
"the",
"updatable",
"properties",
"of",
"the",
"job",
".",
"For",
"example",
"if",
"the",
"job",
"has",
"constraints",
"associated",
"with",
"it",
"and"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L1098-L1105 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.restoreSecret | public SecretBundle restoreSecret(String vaultBaseUrl, byte[] secretBundleBackup) {
"""
Restores a backed up secret to a vault.
Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.
@param vaultBaseUrl The vault name, for example https://myvault.... | java | public SecretBundle restoreSecret(String vaultBaseUrl, byte[] secretBundleBackup) {
return restoreSecretWithServiceResponseAsync(vaultBaseUrl, secretBundleBackup).toBlocking().single().body();
} | [
"public",
"SecretBundle",
"restoreSecret",
"(",
"String",
"vaultBaseUrl",
",",
"byte",
"[",
"]",
"secretBundleBackup",
")",
"{",
"return",
"restoreSecretWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"secretBundleBackup",
")",
".",
"toBlocking",
"(",
")",
".",
... | Restores a backed up secret to a vault.
Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param secretBundleBackup The backup blob associated with a secret bundle.
@thr... | [
"Restores",
"a",
"backed",
"up",
"secret",
"to",
"a",
"vault",
".",
"Restores",
"a",
"backed",
"up",
"secret",
"and",
"all",
"its",
"versions",
"to",
"a",
"vault",
".",
"This",
"operation",
"requires",
"the",
"secrets",
"/",
"restore",
"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#L4994-L4996 |
alkacon/opencms-core | src/org/opencms/configuration/CmsParameterConfiguration.java | CmsParameterConfiguration.putAll | @Override
public void putAll(Map<? extends String, ? extends String> other) {
"""
Merges this parameter configuration with the provided other parameter configuration.<p>
The difference form a simple <code>Map<String, String></code> is that for the parameter
configuration, the values of the keys in b... | java | @Override
public void putAll(Map<? extends String, ? extends String> other) {
for (String key : other.keySet()) {
boolean tokenize = false;
if (other instanceof CmsParameterConfiguration) {
Object o = ((CmsParameterConfiguration)other).getObject(key);
... | [
"@",
"Override",
"public",
"void",
"putAll",
"(",
"Map",
"<",
"?",
"extends",
"String",
",",
"?",
"extends",
"String",
">",
"other",
")",
"{",
"for",
"(",
"String",
"key",
":",
"other",
".",
"keySet",
"(",
")",
")",
"{",
"boolean",
"tokenize",
"=",
... | Merges this parameter configuration with the provided other parameter configuration.<p>
The difference form a simple <code>Map<String, String></code> is that for the parameter
configuration, the values of the keys in both maps are merged and kept in the Object store
as a List.<p>
As result, <code>this</code> co... | [
"Merges",
"this",
"parameter",
"configuration",
"with",
"the",
"provided",
"other",
"parameter",
"configuration",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsParameterConfiguration.java#L779-L792 |
aoindustries/ao-encoding | src/main/java/com/aoindustries/encoding/ChainWriter.java | ChainWriter.writeHtmlImagePreloadJavaScript | public static void writeHtmlImagePreloadJavaScript(String url, Appendable out) throws IOException {
"""
Prints a JavaScript script that will preload the image at the provided URL.
@param url This should be the URL-encoded URL, but with only a standalone ampersand (&) as parameter separator
(not &amp;)
... | java | public static void writeHtmlImagePreloadJavaScript(String url, Appendable out) throws IOException {
out.append("<script type='text/javascript'>\n"
+ " var img=new Image();\n"
+ " img.src=\"");
// Escape for javascript
StringBuilder javascript = new StringBuilder(url.length());
encodeTextInJavaScript(u... | [
"public",
"static",
"void",
"writeHtmlImagePreloadJavaScript",
"(",
"String",
"url",
",",
"Appendable",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"append",
"(",
"\"<script type='text/javascript'>\\n\"",
"+",
"\" var img=new Image();\\n\"",
"+",
"\" img.src=\... | Prints a JavaScript script that will preload the image at the provided URL.
@param url This should be the URL-encoded URL, but with only a standalone ampersand (&) as parameter separator
(not &amp;) | [
"Prints",
"a",
"JavaScript",
"script",
"that",
"will",
"preload",
"the",
"image",
"at",
"the",
"provided",
"URL",
"."
] | train | https://github.com/aoindustries/ao-encoding/blob/54eeb8ff58ab7b44bb02549bbe2572625b449e4e/src/main/java/com/aoindustries/encoding/ChainWriter.java#L718-L729 |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java | ConvertBitmap.grayToBitmap | public static void grayToBitmap( ImageGray input , Bitmap output , byte[] storage) {
"""
Converts ImageGray into Bitmap.
@see #declareStorage(android.graphics.Bitmap, byte[])
@param input Input gray scale image.
@param output Output Bitmap image.
@param storage Byte array used for internal storage. If null... | java | public static void grayToBitmap( ImageGray input , Bitmap output , byte[] storage) {
if( input instanceof GrayU8 )
grayToBitmap((GrayU8)input,output,storage);
else if( input instanceof GrayF32 )
grayToBitmap((GrayF32)input,output,storage);
else
throw new IllegalArgumentException("Unsupported BoofCV Type:... | [
"public",
"static",
"void",
"grayToBitmap",
"(",
"ImageGray",
"input",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"if",
"(",
"input",
"instanceof",
"GrayU8",
")",
"grayToBitmap",
"(",
"(",
"GrayU8",
")",
"input",
",",
"output",
... | Converts ImageGray into Bitmap.
@see #declareStorage(android.graphics.Bitmap, byte[])
@param input Input gray scale image.
@param output Output Bitmap image.
@param storage Byte array used for internal storage. If null it will be declared internally. | [
"Converts",
"ImageGray",
"into",
"Bitmap",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L251-L258 |
detro/ghostdriver | binding/java/src/main/java/org/openqa/selenium/phantomjs/PhantomJSDriverService.java | PhantomJSDriverService.findGhostDriver | protected static File findGhostDriver(Capabilities desiredCapabilities, String docsLink, String downloadLink) {
"""
Find the GhostDriver main file (i.e. {@code "main.js"}).
<br>
Looks into the Capabilities and the System Properties for
{@link PhantomJSDriverService#PHANTOMJS_GHOSTDRIVER_PATH_PROPERTY}.
<br>
N... | java | protected static File findGhostDriver(Capabilities desiredCapabilities, String docsLink, String downloadLink) {
// Recover path to GhostDriver from the System Properties or the Capabilities
String ghostdriverpath;
if (desiredCapabilities != null &&
desiredCapabilities.getCapabili... | [
"protected",
"static",
"File",
"findGhostDriver",
"(",
"Capabilities",
"desiredCapabilities",
",",
"String",
"docsLink",
",",
"String",
"downloadLink",
")",
"{",
"// Recover path to GhostDriver from the System Properties or the Capabilities",
"String",
"ghostdriverpath",
";",
"... | Find the GhostDriver main file (i.e. {@code "main.js"}).
<br>
Looks into the Capabilities and the System Properties for
{@link PhantomJSDriverService#PHANTOMJS_GHOSTDRIVER_PATH_PROPERTY}.
<br>
NOTE: If both the Capability and the System Property are set, the Capability takes priority.
@param desiredCapabilities Capabi... | [
"Find",
"the",
"GhostDriver",
"main",
"file",
"(",
"i",
".",
"e",
".",
"{",
"@code",
"main",
".",
"js",
"}",
")",
".",
"<br",
">",
"Looks",
"into",
"the",
"Capabilities",
"and",
"the",
"System",
"Properties",
"for",
"{",
"@link",
"PhantomJSDriverService#... | train | https://github.com/detro/ghostdriver/blob/fe3063d52f47ec2781d43970452595c42f729ebf/binding/java/src/main/java/org/openqa/selenium/phantomjs/PhantomJSDriverService.java#L286-L314 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/AbsDiff.java | AbsDiff.moveToFollowingNode | private boolean moveToFollowingNode(final INodeReadTrx paramRtx, final ERevision paramRevision)
throws TTIOException {
"""
Move to next following node.
@param paramRtx
the {@link IReadTransaction} to use
@param paramRevision
the {@link ERevision} constant
@return true, if cursor moved, false otherwi... | java | private boolean moveToFollowingNode(final INodeReadTrx paramRtx, final ERevision paramRevision)
throws TTIOException {
boolean moved = false;
while (!((ITreeStructData)paramRtx.getNode()).hasRightSibling()
&& ((ITreeStructData)paramRtx.getNode()).hasParent() && paramRtx.getNode().get... | [
"private",
"boolean",
"moveToFollowingNode",
"(",
"final",
"INodeReadTrx",
"paramRtx",
",",
"final",
"ERevision",
"paramRevision",
")",
"throws",
"TTIOException",
"{",
"boolean",
"moved",
"=",
"false",
";",
"while",
"(",
"!",
"(",
"(",
"ITreeStructData",
")",
"p... | Move to next following node.
@param paramRtx
the {@link IReadTransaction} to use
@param paramRevision
the {@link ERevision} constant
@return true, if cursor moved, false otherwise
@throws TTIOException | [
"Move",
"to",
"next",
"following",
"node",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/AbsDiff.java#L245-L269 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AbstractFullProjection.java | AbstractFullProjection.projectRelativeScaledToDataSpace | @Override
public <NV extends NumberVector> NV projectRelativeScaledToDataSpace(double[] v, NumberVector.Factory<NV> prototype) {
"""
Project a relative vector from scaled space to data space.
@param <NV> Vector type
@param v relative vector in scaled space
@param prototype Object factory
@return relative v... | java | @Override
public <NV extends NumberVector> NV projectRelativeScaledToDataSpace(double[] v, NumberVector.Factory<NV> prototype) {
final int dim = v.length;
double[] vec = new double[dim];
for(int d = 0; d < dim; d++) {
vec[d] = scales[d].getRelativeUnscaled(v[d]);
}
return prototype.newNumber... | [
"@",
"Override",
"public",
"<",
"NV",
"extends",
"NumberVector",
">",
"NV",
"projectRelativeScaledToDataSpace",
"(",
"double",
"[",
"]",
"v",
",",
"NumberVector",
".",
"Factory",
"<",
"NV",
">",
"prototype",
")",
"{",
"final",
"int",
"dim",
"=",
"v",
".",
... | Project a relative vector from scaled space to data space.
@param <NV> Vector type
@param v relative vector in scaled space
@param prototype Object factory
@return relative vector in data space | [
"Project",
"a",
"relative",
"vector",
"from",
"scaled",
"space",
"to",
"data",
"space",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AbstractFullProjection.java#L201-L209 |
googlegenomics/dataflow-java | src/main/java/com/google/cloud/genomics/dataflow/functions/verifybamid/Solver.java | Solver.gridSearch | static Interval gridSearch(UnivariateFunction fn, double start,
double end, double step) {
"""
Runs a grid search for the maximum value of a univariate function.
@param fn the likelihood function to minimize
@param start lower bound of the interval to search
@param end upper bound of the interval to sea... | java | static Interval gridSearch(UnivariateFunction fn, double start,
double end, double step) {
double lowMax = start; // lower bound on interval surrounding alphaMax
double alphaMax = start - step;
double likMax = 0.0;
double lastAlpha = start;
double alpha = start;
while (alpha < end) {
... | [
"static",
"Interval",
"gridSearch",
"(",
"UnivariateFunction",
"fn",
",",
"double",
"start",
",",
"double",
"end",
",",
"double",
"step",
")",
"{",
"double",
"lowMax",
"=",
"start",
";",
"// lower bound on interval surrounding alphaMax",
"double",
"alphaMax",
"=",
... | Runs a grid search for the maximum value of a univariate function.
@param fn the likelihood function to minimize
@param start lower bound of the interval to search
@param end upper bound of the interval to search
@param step grid step size
@return an Interval bracketing the minimum | [
"Runs",
"a",
"grid",
"search",
"for",
"the",
"maximum",
"value",
"of",
"a",
"univariate",
"function",
"."
] | train | https://github.com/googlegenomics/dataflow-java/blob/ef2c56ed1a6397843c55102748b8c2b12aaa4772/src/main/java/com/google/cloud/genomics/dataflow/functions/verifybamid/Solver.java#L42-L70 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java | GenericGenerators.forEach | public static InsnList forEach(Variable counterVar, Variable arrayLenVar, InsnList array, InsnList action) {
"""
For each element in an object array, performs an action.
@param counterVar parameter used to keep track of count in loop
@param arrayLenVar parameter used to keep track of array length
@param array o... | java | public static InsnList forEach(Variable counterVar, Variable arrayLenVar, InsnList array, InsnList action) {
Validate.notNull(counterVar);
Validate.notNull(arrayLenVar);
Validate.notNull(array);
Validate.notNull(action);
Validate.isTrue(counterVar.getType().equals(Type.INT_TYPE))... | [
"public",
"static",
"InsnList",
"forEach",
"(",
"Variable",
"counterVar",
",",
"Variable",
"arrayLenVar",
",",
"InsnList",
"array",
",",
"InsnList",
"action",
")",
"{",
"Validate",
".",
"notNull",
"(",
"counterVar",
")",
";",
"Validate",
".",
"notNull",
"(",
... | For each element in an object array, performs an action.
@param counterVar parameter used to keep track of count in loop
@param arrayLenVar parameter used to keep track of array length
@param array object array instruction list -- must leave an array on the stack
@param action action to perform on each element -- eleme... | [
"For",
"each",
"element",
"in",
"an",
"object",
"array",
"performs",
"an",
"action",
"."
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L702-L751 |
btrplace/scheduler | json/src/main/java/org/btrplace/json/model/view/network/NetworkConverter.java | NetworkConverter.switchesFromJSON | public void switchesFromJSON(Network net, JSONArray a) throws JSONConverterException {
"""
Convert a JSON array of switches to a Java List of switches.
@param net the network to populate
@param a the json array
"""
for (Object o : a) {
net.newSwitch(requiredInt((JSONObject) o, "id"), read... | java | public void switchesFromJSON(Network net, JSONArray a) throws JSONConverterException {
for (Object o : a) {
net.newSwitch(requiredInt((JSONObject) o, "id"), readCapacity((JSONObject) o));
}
} | [
"public",
"void",
"switchesFromJSON",
"(",
"Network",
"net",
",",
"JSONArray",
"a",
")",
"throws",
"JSONConverterException",
"{",
"for",
"(",
"Object",
"o",
":",
"a",
")",
"{",
"net",
".",
"newSwitch",
"(",
"requiredInt",
"(",
"(",
"JSONObject",
")",
"o",
... | Convert a JSON array of switches to a Java List of switches.
@param net the network to populate
@param a the json array | [
"Convert",
"a",
"JSON",
"array",
"of",
"switches",
"to",
"a",
"Java",
"List",
"of",
"switches",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/model/view/network/NetworkConverter.java#L242-L246 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/EventCollector.java | EventCollector.addManagementGraph | void addManagementGraph(final JobID jobID, final ManagementGraph managementGraph) {
"""
Adds a {@link ManagementGraph} to the map of recently created management graphs.
@param jobID
the ID of the job the management graph belongs to
@param managementGraph
the management graph to be added
"""
synchroniz... | java | void addManagementGraph(final JobID jobID, final ManagementGraph managementGraph) {
synchronized (this.recentManagementGraphs) {
this.recentManagementGraphs.put(jobID, managementGraph);
}
} | [
"void",
"addManagementGraph",
"(",
"final",
"JobID",
"jobID",
",",
"final",
"ManagementGraph",
"managementGraph",
")",
"{",
"synchronized",
"(",
"this",
".",
"recentManagementGraphs",
")",
"{",
"this",
".",
"recentManagementGraphs",
".",
"put",
"(",
"jobID",
",",
... | Adds a {@link ManagementGraph} to the map of recently created management graphs.
@param jobID
the ID of the job the management graph belongs to
@param managementGraph
the management graph to be added | [
"Adds",
"a",
"{",
"@link",
"ManagementGraph",
"}",
"to",
"the",
"map",
"of",
"recently",
"created",
"management",
"graphs",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/EventCollector.java#L568-L573 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/property/CmsPropertySubmitHandler.java | CmsPropertySubmitHandler.checkContains | private boolean checkContains(String fieldName, String... propNames) {
"""
Check if a field name belongs to one of a given list of properties.<p>
@param fieldName the field name
@param propNames the property names
@return true if the field name matches one of the property names
"""
for (String ... | java | private boolean checkContains(String fieldName, String... propNames) {
for (String propName : propNames) {
if (fieldName.contains("/" + propName + "/")) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"checkContains",
"(",
"String",
"fieldName",
",",
"String",
"...",
"propNames",
")",
"{",
"for",
"(",
"String",
"propName",
":",
"propNames",
")",
"{",
"if",
"(",
"fieldName",
".",
"contains",
"(",
"\"/\"",
"+",
"propName",
"+",
"\"/\... | Check if a field name belongs to one of a given list of properties.<p>
@param fieldName the field name
@param propNames the property names
@return true if the field name matches one of the property names | [
"Check",
"if",
"a",
"field",
"name",
"belongs",
"to",
"one",
"of",
"a",
"given",
"list",
"of",
"properties",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/property/CmsPropertySubmitHandler.java#L182-L190 |
james-hu/jabb-core | src/main/java/net/sf/jabb/spring/rest/AbstractRestClient.java | AbstractRestClient.buildRequestRetryHandler | protected HttpRequestRetryHandler buildRequestRetryHandler(int retryCount,
boolean requestSentRetryEnabled, boolean retryUnknownHostException, boolean retryConnectException,
BackoffStrategy backoffStrategy, WaitStrategy waitStrategy,
IdempotentPredicate idempotentPredicate, Class<? extends IOException>... ex... | java | protected HttpRequestRetryHandler buildRequestRetryHandler(int retryCount,
boolean requestSentRetryEnabled, boolean retryUnknownHostException, boolean retryConnectException,
BackoffStrategy backoffStrategy, WaitStrategy waitStrategy,
IdempotentPredicate idempotentPredicate, Class<? extends IOException>... ex... | [
"protected",
"HttpRequestRetryHandler",
"buildRequestRetryHandler",
"(",
"int",
"retryCount",
",",
"boolean",
"requestSentRetryEnabled",
",",
"boolean",
"retryUnknownHostException",
",",
"boolean",
"retryConnectException",
",",
"BackoffStrategy",
"backoffStrategy",
",",
"WaitSt... | Build a <code>HttpRequestRetryHandler</code>.
The returned <code>HttpRequestRetryHandler</code> will not retry on <code>InterruptedIOException</code> and <code>SSLException</code>.
@param retryCount how many times to retry; 0 means no retries
@param backoffStrategy how should retries to backoff from previous ones
@par... | [
"Build",
"a",
"<code",
">",
"HttpRequestRetryHandler<",
"/",
"code",
">",
".",
"The",
"returned",
"<code",
">",
"HttpRequestRetryHandler<",
"/",
"code",
">",
"will",
"not",
"retry",
"on",
"<code",
">",
"InterruptedIOException<",
"/",
"code",
">",
"and",
"<code... | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/spring/rest/AbstractRestClient.java#L320-L339 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/Where.java | Where.ne | public Where<T, ID> ne(String columnName, Object value) throws SQLException {
"""
Add a '<>' clause so the column must be not-equal-to the value.
"""
addClause(new SimpleComparison(columnName, findColumnFieldType(columnName), value,
SimpleComparison.NOT_EQUAL_TO_OPERATION));
return this;
} | java | public Where<T, ID> ne(String columnName, Object value) throws SQLException {
addClause(new SimpleComparison(columnName, findColumnFieldType(columnName), value,
SimpleComparison.NOT_EQUAL_TO_OPERATION));
return this;
} | [
"public",
"Where",
"<",
"T",
",",
"ID",
">",
"ne",
"(",
"String",
"columnName",
",",
"Object",
"value",
")",
"throws",
"SQLException",
"{",
"addClause",
"(",
"new",
"SimpleComparison",
"(",
"columnName",
",",
"findColumnFieldType",
"(",
"columnName",
")",
",... | Add a '<>' clause so the column must be not-equal-to the value. | [
"Add",
"a",
"<",
";",
">",
";",
"clause",
"so",
"the",
"column",
"must",
"be",
"not",
"-",
"equal",
"-",
"to",
"the",
"value",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/Where.java#L326-L330 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.homographyRefine | public static RefineEpipolar homographyRefine(double tol , int maxIterations , EpipolarError type ) {
"""
Creates a non-linear optimizer for refining estimates of homography matrices.
@see HomographyResidualSampson
@see HomographyResidualTransfer
@param tol Tolerance for convergence. Try 1e-8
@param maxIt... | java | public static RefineEpipolar homographyRefine(double tol , int maxIterations , EpipolarError type ) {
ModelObservationResidualN residuals;
switch( type ) {
case SIMPLE:
residuals = new HomographyResidualTransfer();
break;
case SAMPSON:
residuals = new HomographyResidualSampson();
break;
d... | [
"public",
"static",
"RefineEpipolar",
"homographyRefine",
"(",
"double",
"tol",
",",
"int",
"maxIterations",
",",
"EpipolarError",
"type",
")",
"{",
"ModelObservationResidualN",
"residuals",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"SIMPLE",
":",
"residuals",... | Creates a non-linear optimizer for refining estimates of homography matrices.
@see HomographyResidualSampson
@see HomographyResidualTransfer
@param tol Tolerance for convergence. Try 1e-8
@param maxIterations Maximum number of iterations it will perform. Try 100 or more.
@return Homography refinement | [
"Creates",
"a",
"non",
"-",
"linear",
"optimizer",
"for",
"refining",
"estimates",
"of",
"homography",
"matrices",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L211-L227 |
jcuda/jcufft | JCufftJava/src/main/java/jcuda/jcufft/JCufft.java | JCufft.cufftExecD2Z | public static int cufftExecD2Z(cufftHandle plan, Pointer rIdata, Pointer cOdata) {
"""
<pre>
Executes a CUFFT real-to-complex (implicitly forward) transform plan
for double precision values.
cufftResult cufftExecD2Z( cufftHandle plan, cufftDoubleReal *idata, cufftDoubleComplex *odata );
CUFFT uses as input... | java | public static int cufftExecD2Z(cufftHandle plan, Pointer rIdata, Pointer cOdata)
{
return checkResult(cufftExecD2ZNative(plan, rIdata, cOdata));
} | [
"public",
"static",
"int",
"cufftExecD2Z",
"(",
"cufftHandle",
"plan",
",",
"Pointer",
"rIdata",
",",
"Pointer",
"cOdata",
")",
"{",
"return",
"checkResult",
"(",
"cufftExecD2ZNative",
"(",
"plan",
",",
"rIdata",
",",
"cOdata",
")",
")",
";",
"}"
] | <pre>
Executes a CUFFT real-to-complex (implicitly forward) transform plan
for double precision values.
cufftResult cufftExecD2Z( cufftHandle plan, cufftDoubleReal *idata, cufftDoubleComplex *odata );
CUFFT uses as input data the GPU memory pointed to by the idata
parameter. This function stores the non-redundant Fou... | [
"<pre",
">",
"Executes",
"a",
"CUFFT",
"real",
"-",
"to",
"-",
"complex",
"(",
"implicitly",
"forward",
")",
"transform",
"plan",
"for",
"double",
"precision",
"values",
"."
] | train | https://github.com/jcuda/jcufft/blob/833c87ffb0864f7ee7270fddef8af57f48939b3a/JCufftJava/src/main/java/jcuda/jcufft/JCufft.java#L1488-L1491 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java | SparkComputationGraph.evaluateRegressionMDS | public <T extends RegressionEvaluation> T evaluateRegressionMDS(JavaRDD<MultiDataSet> data, int minibatchSize) {
"""
Evaluate the network (regression performance) in a distributed manner on the provided data
@param data Data to evaluate
@param minibatchSize Minibatch size to use when doing performing evaluatio... | java | public <T extends RegressionEvaluation> T evaluateRegressionMDS(JavaRDD<MultiDataSet> data, int minibatchSize) {
return (T)doEvaluationMDS(data, minibatchSize, new org.deeplearning4j.eval.RegressionEvaluation())[0];
} | [
"public",
"<",
"T",
"extends",
"RegressionEvaluation",
">",
"T",
"evaluateRegressionMDS",
"(",
"JavaRDD",
"<",
"MultiDataSet",
">",
"data",
",",
"int",
"minibatchSize",
")",
"{",
"return",
"(",
"T",
")",
"doEvaluationMDS",
"(",
"data",
",",
"minibatchSize",
",... | Evaluate the network (regression performance) in a distributed manner on the provided data
@param data Data to evaluate
@param minibatchSize Minibatch size to use when doing performing evaluation
@return {@link RegressionEvaluation} instance with regression performance | [
"Evaluate",
"the",
"network",
"(",
"regression",
"performance",
")",
"in",
"a",
"distributed",
"manner",
"on",
"the",
"provided",
"data"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java#L754-L756 |
mapcode-foundation/mapcode-java | src/main/java/com/mapcode/Point.java | Point.distanceInMeters | public static double distanceInMeters(@Nonnull final Point p1, @Nonnull final Point p2) {
"""
Calculate the distance between two points. This algorithm does not take the curvature of the Earth into
account, so it only works for small distance up to, say 200 km, and not too close to the poles.
@param p1 Point 1... | java | public static double distanceInMeters(@Nonnull final Point p1, @Nonnull final Point p2) {
checkNonnull("p1", p1);
checkNonnull("p2", p2);
final Point from;
final Point to;
if (p1.getLonDeg() <= p2.getLonDeg()) {
from = p1;
to = p2;
} else {
... | [
"public",
"static",
"double",
"distanceInMeters",
"(",
"@",
"Nonnull",
"final",
"Point",
"p1",
",",
"@",
"Nonnull",
"final",
"Point",
"p2",
")",
"{",
"checkNonnull",
"(",
"\"p1\"",
",",
"p1",
")",
";",
"checkNonnull",
"(",
"\"p2\"",
",",
"p2",
")",
";",
... | Calculate the distance between two points. This algorithm does not take the curvature of the Earth into
account, so it only works for small distance up to, say 200 km, and not too close to the poles.
@param p1 Point 1.
@param p2 Point 2.
@return Straight distance between p1 and p2. Only accurate for small distances up... | [
"Calculate",
"the",
"distance",
"between",
"two",
"points",
".",
"This",
"algorithm",
"does",
"not",
"take",
"the",
"curvature",
"of",
"the",
"Earth",
"into",
"account",
"so",
"it",
"only",
"works",
"for",
"small",
"distance",
"up",
"to",
"say",
"200",
"km... | train | https://github.com/mapcode-foundation/mapcode-java/blob/f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8/src/main/java/com/mapcode/Point.java#L173-L201 |
wcm-io/wcm-io-wcm | ui/granite/src/main/java/io/wcm/wcm/ui/granite/components/pathfield/ColumnView.java | ColumnView.getRootColumn | private static Column getRootColumn(Resource rootResource, String itemResourceType) {
"""
Generate extra column representing the root resource.
@param rootResource Root resource
@param itemResourceType Item resource type
@return Column
"""
/*
* Put a special path for columnId to avoid having the sa... | java | private static Column getRootColumn(Resource rootResource, String itemResourceType) {
/*
* Put a special path for columnId to avoid having the same columnId with the next column to avoid breaking the contract of columnId.
* The contract of columnId is that it should be a path of the current column, i.e. t... | [
"private",
"static",
"Column",
"getRootColumn",
"(",
"Resource",
"rootResource",
",",
"String",
"itemResourceType",
")",
"{",
"/*\n * Put a special path for columnId to avoid having the same columnId with the next column to avoid breaking the contract of columnId.\n * The contract of... | Generate extra column representing the root resource.
@param rootResource Root resource
@param itemResourceType Item resource type
@return Column | [
"Generate",
"extra",
"column",
"representing",
"the",
"root",
"resource",
"."
] | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/ui/granite/src/main/java/io/wcm/wcm/ui/granite/components/pathfield/ColumnView.java#L190-L208 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ejs/ras/hpel/HpelSystemStream.java | HpelSystemStream.redirectStreams | public static void redirectStreams() {
"""
This method redirects the System.* stream to the repository.
It will print header if a implementation of logHeader is provided
"""
try {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
... | java | public static void redirectStreams() {
try {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
HpelSystemStream newErr = new HpelSystemStream("SystemErr");
System.setErr(newErr);
HpelSystem... | [
"public",
"static",
"void",
"redirectStreams",
"(",
")",
"{",
"try",
"{",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Object",
">",
"(",
")",
"{",
"public",
"Object",
"run",
"(",
")",
"{",
"HpelSystemStream",
"newErr",
"=",... | This method redirects the System.* stream to the repository.
It will print header if a implementation of logHeader is provided | [
"This",
"method",
"redirects",
"the",
"System",
".",
"*",
"stream",
"to",
"the",
"repository",
".",
"It",
"will",
"print",
"header",
"if",
"a",
"implementation",
"of",
"logHeader",
"is",
"provided"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ejs/ras/hpel/HpelSystemStream.java#L1019-L1035 |
apereo/cas | support/cas-server-support-otp-mfa-core/src/main/java/org/apereo/cas/otp/util/QRUtils.java | QRUtils.generateQRCode | @SneakyThrows
public static void generateQRCode(final OutputStream stream, final String key,
final int width, final int height) {
"""
Generate qr code.
@param stream the stream
@param key the key
@param width the width
@param height the height
"""
val... | java | @SneakyThrows
public static void generateQRCode(final OutputStream stream, final String key,
final int width, final int height) {
val hintMap = new EnumMap<EncodeHintType, Object>(EncodeHintType.class);
hintMap.put(EncodeHintType.CHARACTER_SET, StandardCharsets.... | [
"@",
"SneakyThrows",
"public",
"static",
"void",
"generateQRCode",
"(",
"final",
"OutputStream",
"stream",
",",
"final",
"String",
"key",
",",
"final",
"int",
"width",
",",
"final",
"int",
"height",
")",
"{",
"val",
"hintMap",
"=",
"new",
"EnumMap",
"<",
"... | Generate qr code.
@param stream the stream
@param key the key
@param width the width
@param height the height | [
"Generate",
"qr",
"code",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-otp-mfa-core/src/main/java/org/apereo/cas/otp/util/QRUtils.java#L43-L70 |
gitblit/fathom | fathom-security/src/main/java/fathom/realm/Account.java | Account.checkRoles | public void checkRoles(Collection<String> roleIdentifiers) throws AuthorizationException {
"""
Asserts this Account has all of the specified roles by returning quietly if they do or throwing an
{@link fathom.authz.AuthorizationException} if they do not.
@param roleIdentifiers roleIdentifiers the application-sp... | java | public void checkRoles(Collection<String> roleIdentifiers) throws AuthorizationException {
if (!hasRoles(roleIdentifiers)) {
throw new AuthorizationException("'{}' does not have the roles {}", toString(), roleIdentifiers);
}
} | [
"public",
"void",
"checkRoles",
"(",
"Collection",
"<",
"String",
">",
"roleIdentifiers",
")",
"throws",
"AuthorizationException",
"{",
"if",
"(",
"!",
"hasRoles",
"(",
"roleIdentifiers",
")",
")",
"{",
"throw",
"new",
"AuthorizationException",
"(",
"\"'{}' does n... | Asserts this Account has all of the specified roles by returning quietly if they do or throwing an
{@link fathom.authz.AuthorizationException} if they do not.
@param roleIdentifiers roleIdentifiers the application-specific role identifiers to check (usually role ids or role names).
@throws AuthorizationException fatho... | [
"Asserts",
"this",
"Account",
"has",
"all",
"of",
"the",
"specified",
"roles",
"by",
"returning",
"quietly",
"if",
"they",
"do",
"or",
"throwing",
"an",
"{",
"@link",
"fathom",
".",
"authz",
".",
"AuthorizationException",
"}",
"if",
"they",
"do",
"not",
".... | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security/src/main/java/fathom/realm/Account.java#L421-L425 |
alkacon/opencms-core | src/org/opencms/ui/apps/dbmanager/CmsDbPropertiesApp.java | CmsDbPropertiesApp.addNewPropertyButton | private void addNewPropertyButton(final CmsPropertyTable table) {
"""
Button for adding new property.<p>
@param table table to be updated
"""
Button add = CmsToolBar.createButton(
FontOpenCms.WAND,
CmsVaadinUtils.getMessageText(Messages.GUI_DATABASEAPP_PROPERTY_NEW_CAPTION_0))... | java | private void addNewPropertyButton(final CmsPropertyTable table) {
Button add = CmsToolBar.createButton(
FontOpenCms.WAND,
CmsVaadinUtils.getMessageText(Messages.GUI_DATABASEAPP_PROPERTY_NEW_CAPTION_0));
add.addClickListener(new ClickListener() {
private static final... | [
"private",
"void",
"addNewPropertyButton",
"(",
"final",
"CmsPropertyTable",
"table",
")",
"{",
"Button",
"add",
"=",
"CmsToolBar",
".",
"createButton",
"(",
"FontOpenCms",
".",
"WAND",
",",
"CmsVaadinUtils",
".",
"getMessageText",
"(",
"Messages",
".",
"GUI_DATAB... | Button for adding new property.<p>
@param table table to be updated | [
"Button",
"for",
"adding",
"new",
"property",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/dbmanager/CmsDbPropertiesApp.java#L117-L136 |
io7m/jproperties | com.io7m.jproperties.core/src/main/java/com/io7m/jproperties/JProperties.java | JProperties.getBigDecimal | public static BigDecimal getBigDecimal(
final Properties properties,
final String key)
throws JPropertyNonexistent,
JPropertyIncorrectType {
"""
<p> Returns the real value associated with {@code key} in the
properties referenced by {@code properties}. </p>
@param properties The loaded propertie... | java | public static BigDecimal getBigDecimal(
final Properties properties,
final String key)
throws JPropertyNonexistent,
JPropertyIncorrectType
{
Objects.requireNonNull(properties, "Properties");
Objects.requireNonNull(key, "Key");
final String text = getString(properties, key);
return par... | [
"public",
"static",
"BigDecimal",
"getBigDecimal",
"(",
"final",
"Properties",
"properties",
",",
"final",
"String",
"key",
")",
"throws",
"JPropertyNonexistent",
",",
"JPropertyIncorrectType",
"{",
"Objects",
".",
"requireNonNull",
"(",
"properties",
",",
"\"Properti... | <p> Returns the real value associated with {@code key} in the
properties referenced by {@code properties}. </p>
@param properties The loaded properties.
@param key The requested key.
@return The value associated with the key, parsed as an real.
@throws JPropertyNonexistent If the key does not exist in the g... | [
"<p",
">",
"Returns",
"the",
"real",
"value",
"associated",
"with",
"{",
"@code",
"key",
"}",
"in",
"the",
"properties",
"referenced",
"by",
"{",
"@code",
"properties",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/io7m/jproperties/blob/b188b8fd87b3b078f1e2b564a9ed5996db0becfd/com.io7m.jproperties.core/src/main/java/com/io7m/jproperties/JProperties.java#L79-L90 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/DbPro.java | DbPro.queryColumn | public <T> T queryColumn(String sql, Object... paras) {
"""
Execute sql query just return one column.
@param <T> the type of the column that in your sql's select statement
@param sql an SQL statement that may contain one or more '?' IN parameter placeholders
@param paras the parameters of sql
@return <T> T
... | java | public <T> T queryColumn(String sql, Object... paras) {
List<T> result = query(sql, paras);
if (result.size() > 0) {
T temp = result.get(0);
if (temp instanceof Object[])
throw new ActiveRecordException("Only ONE COLUMN can be queried.");
return temp;
}
return null;
} | [
"public",
"<",
"T",
">",
"T",
"queryColumn",
"(",
"String",
"sql",
",",
"Object",
"...",
"paras",
")",
"{",
"List",
"<",
"T",
">",
"result",
"=",
"query",
"(",
"sql",
",",
"paras",
")",
";",
"if",
"(",
"result",
".",
"size",
"(",
")",
">",
"0",... | Execute sql query just return one column.
@param <T> the type of the column that in your sql's select statement
@param sql an SQL statement that may contain one or more '?' IN parameter placeholders
@param paras the parameters of sql
@return <T> T | [
"Execute",
"sql",
"query",
"just",
"return",
"one",
"column",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/DbPro.java#L137-L146 |
geomajas/geomajas-project-client-gwt2 | plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java | TileBasedLayerClient.createOsmLayer | @Deprecated
public OsmLayer createOsmLayer(String id, TileConfiguration conf, List<String> urls) {
"""
Create a new OSM layer with URLs to OSM tile services.
<p/>
The URLs should have placeholders for the x- and y-coordinate and tile level in the form of {x}, {y}, {z}.
The file extension of the tiles should be... | java | @Deprecated
public OsmLayer createOsmLayer(String id, TileConfiguration conf, List<String> urls) {
OsmLayer layer = new OsmLayer(id, conf);
layer.addUrls(urls);
return layer;
} | [
"@",
"Deprecated",
"public",
"OsmLayer",
"createOsmLayer",
"(",
"String",
"id",
",",
"TileConfiguration",
"conf",
",",
"List",
"<",
"String",
">",
"urls",
")",
"{",
"OsmLayer",
"layer",
"=",
"new",
"OsmLayer",
"(",
"id",
",",
"conf",
")",
";",
"layer",
"... | Create a new OSM layer with URLs to OSM tile services.
<p/>
The URLs should have placeholders for the x- and y-coordinate and tile level in the form of {x}, {y}, {z}.
The file extension of the tiles should be part of the URL.
@param id The unique ID of the layer.
@param conf The tile configuration.
@param urls The U... | [
"Create",
"a",
"new",
"OSM",
"layer",
"with",
"URLs",
"to",
"OSM",
"tile",
"services",
".",
"<p",
"/",
">",
"The",
"URLs",
"should",
"have",
"placeholders",
"for",
"the",
"x",
"-",
"and",
"y",
"-",
"coordinate",
"and",
"tile",
"level",
"in",
"the",
"... | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java#L206-L211 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.uploadContent | public void uploadContent(@NonNull final String folder, @NonNull final ContentData data, @Nullable Callback<ComapiResult<UploadContentResponse>> callback) {
"""
Upload content data.
@param folder Folder name to put the file in.
@param data Content data.
@param callback Callback with the details of uploa... | java | public void uploadContent(@NonNull final String folder, @NonNull final ContentData data, @Nullable Callback<ComapiResult<UploadContentResponse>> callback) {
adapter.adapt(uploadContent(folder, data), callback);
} | [
"public",
"void",
"uploadContent",
"(",
"@",
"NonNull",
"final",
"String",
"folder",
",",
"@",
"NonNull",
"final",
"ContentData",
"data",
",",
"@",
"Nullable",
"Callback",
"<",
"ComapiResult",
"<",
"UploadContentResponse",
">",
">",
"callback",
")",
"{",
"adap... | Upload content data.
@param folder Folder name to put the file in.
@param data Content data.
@param callback Callback with the details of uploaded content. | [
"Upload",
"content",
"data",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L752-L754 |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/turn/TurnUtils.java | TurnUtils.generatePassword | public static char[] generatePassword(String username, Key sharedSecret, String algorithm) {
"""
This function generates the secret key based on the procedure described in
https://tools.ietf.org/html/draft-uberti-rtcweb-turn-rest-00#section-2.2
@param username - the username of the API
@param sharedSecret - t... | java | public static char[] generatePassword(String username, Key sharedSecret, String algorithm) {
byte[] key = sharedSecret.getEncoded();
Mac hmac;
try {
hmac = Mac.getInstance(algorithm);
SecretKeySpec signingKey = new SecretKeySpec(key, algorithm);
hmac.init(sign... | [
"public",
"static",
"char",
"[",
"]",
"generatePassword",
"(",
"String",
"username",
",",
"Key",
"sharedSecret",
",",
"String",
"algorithm",
")",
"{",
"byte",
"[",
"]",
"key",
"=",
"sharedSecret",
".",
"getEncoded",
"(",
")",
";",
"Mac",
"hmac",
";",
"tr... | This function generates the secret key based on the procedure described in
https://tools.ietf.org/html/draft-uberti-rtcweb-turn-rest-00#section-2.2
@param username - the username of the API
@param sharedSecret - the shared secret used by the TURN server as well
@param algorithm - the algorithm. COTURN only supports Hm... | [
"This",
"function",
"generates",
"the",
"secret",
"key",
"based",
"on",
"the",
"procedure",
"described",
"in",
"https",
":",
"//",
"tools",
".",
"ietf",
".",
"org",
"/",
"html",
"/",
"draft",
"-",
"uberti",
"-",
"rtcweb",
"-",
"turn",
"-",
"rest",
"-",... | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/turn/TurnUtils.java#L55-L67 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java | ResourceBundlesHandlerImpl.joinAndPostProcessBundle | private void joinAndPostProcessBundle(JoinableResourceBundle bundle, BundleProcessingStatus status) {
"""
Join and post process the bundle taking in account all its variants.
@param bundle
the bundle
@param status
the bundle processing status
"""
JoinableResourceBundleContent store;
List<Map<String,... | java | private void joinAndPostProcessBundle(JoinableResourceBundle bundle, BundleProcessingStatus status) {
JoinableResourceBundleContent store;
List<Map<String, String>> allVariants = VariantUtils.getAllVariants(bundle.getVariants());
// Add the default bundle variant (the non variant one)
allVariants.add(null);
... | [
"private",
"void",
"joinAndPostProcessBundle",
"(",
"JoinableResourceBundle",
"bundle",
",",
"BundleProcessingStatus",
"status",
")",
"{",
"JoinableResourceBundleContent",
"store",
";",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"allVariants",
"=",
... | Join and post process the bundle taking in account all its variants.
@param bundle
the bundle
@param status
the bundle processing status | [
"Join",
"and",
"post",
"process",
"the",
"bundle",
"taking",
"in",
"account",
"all",
"its",
"variants",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java#L1292-L1307 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/deduplicate/DeduplicateFunctionHelper.java | DeduplicateFunctionHelper.processFirstRow | static void processFirstRow(BaseRow currentRow, ValueState<Boolean> state, Collector<BaseRow> out)
throws Exception {
"""
Processes element to deduplicate on keys, sends current element if it is first row.
@param currentRow latest row received by deduplicate function
@param state state of function
@param o... | java | static void processFirstRow(BaseRow currentRow, ValueState<Boolean> state, Collector<BaseRow> out)
throws Exception {
// Check message should be accumulate
Preconditions.checkArgument(BaseRowUtil.isAccumulateMsg(currentRow));
// ignore record with timestamp bigger than preRow
if (state.value() != null) {
... | [
"static",
"void",
"processFirstRow",
"(",
"BaseRow",
"currentRow",
",",
"ValueState",
"<",
"Boolean",
">",
"state",
",",
"Collector",
"<",
"BaseRow",
">",
"out",
")",
"throws",
"Exception",
"{",
"// Check message should be accumulate",
"Preconditions",
".",
"checkAr... | Processes element to deduplicate on keys, sends current element if it is first row.
@param currentRow latest row received by deduplicate function
@param state state of function
@param out underlying collector
@throws Exception | [
"Processes",
"element",
"to",
"deduplicate",
"on",
"keys",
"sends",
"current",
"element",
"if",
"it",
"is",
"first",
"row",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/deduplicate/DeduplicateFunctionHelper.java#L66-L76 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java | CommonOps_DDF2.subtract | public static void subtract( DMatrix2 a , DMatrix2 b , DMatrix2 c ) {
"""
<p>Performs the following operation:<br>
<br>
c = a - b <br>
c<sub>i</sub> = a<sub>i</sub> - b<sub>i</sub> <br>
</p>
<p>
Vector C can be the same instance as Vector A and/or B.
</p>
@param a A Vector. Not modified.
@param b A Ve... | java | public static void subtract( DMatrix2 a , DMatrix2 b , DMatrix2 c ) {
c.a1 = a.a1 - b.a1;
c.a2 = a.a2 - b.a2;
} | [
"public",
"static",
"void",
"subtract",
"(",
"DMatrix2",
"a",
",",
"DMatrix2",
"b",
",",
"DMatrix2",
"c",
")",
"{",
"c",
".",
"a1",
"=",
"a",
".",
"a1",
"-",
"b",
".",
"a1",
";",
"c",
".",
"a2",
"=",
"a",
".",
"a2",
"-",
"b",
".",
"a2",
";"... | <p>Performs the following operation:<br>
<br>
c = a - b <br>
c<sub>i</sub> = a<sub>i</sub> - b<sub>i</sub> <br>
</p>
<p>
Vector C can be the same instance as Vector A and/or B.
</p>
@param a A Vector. Not modified.
@param b A Vector. Not modified.
@param c A Vector where the results are stored. Modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"a",
"-",
"b",
"<br",
">",
"c<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"-",
"b<sub",
">",
"i<",
"/",
"sub",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L143-L146 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/CmsModelPageTreeItem.java | CmsModelPageTreeItem.handleEdit | void handleEdit(CmsClientSitemapEntry editEntry, final String newTitle) {
"""
Handles direct editing of the gallery title.<p>
@param editEntry the edit entry
@param newTitle the new title
"""
if (CmsStringUtil.isEmpty(newTitle)) {
String dialogTitle = Messages.get().key(Messages.GUI_ED... | java | void handleEdit(CmsClientSitemapEntry editEntry, final String newTitle) {
if (CmsStringUtil.isEmpty(newTitle)) {
String dialogTitle = Messages.get().key(Messages.GUI_EDIT_TITLE_ERROR_DIALOG_TITLE_0);
String dialogText = Messages.get().key(Messages.GUI_TITLE_CANT_BE_EMPTY_0);
... | [
"void",
"handleEdit",
"(",
"CmsClientSitemapEntry",
"editEntry",
",",
"final",
"String",
"newTitle",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmpty",
"(",
"newTitle",
")",
")",
"{",
"String",
"dialogTitle",
"=",
"Messages",
".",
"get",
"(",
")",
".",
... | Handles direct editing of the gallery title.<p>
@param editEntry the edit entry
@param newTitle the new title | [
"Handles",
"direct",
"editing",
"of",
"the",
"gallery",
"title",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/CmsModelPageTreeItem.java#L219-L240 |
aaberg/sql2o | core/src/main/java/org/sql2o/Sql2o.java | Sql2o.runInTransaction | public void runInTransaction(StatementRunnable runnable, Object argument, int isolationLevel) {
"""
Calls the {@link StatementRunnable#run(Connection, Object)} method on the {@link StatementRunnable} parameter. All statements
run on the {@link Connection} instance in the {@link StatementRunnable#run(Connection, O... | java | public void runInTransaction(StatementRunnable runnable, Object argument, int isolationLevel){
Connection connection = this.beginTransaction(isolationLevel);
connection.setRollbackOnException(false);
try {
runnable.run(connection, argument);
} catch (Throwable throwable) {
... | [
"public",
"void",
"runInTransaction",
"(",
"StatementRunnable",
"runnable",
",",
"Object",
"argument",
",",
"int",
"isolationLevel",
")",
"{",
"Connection",
"connection",
"=",
"this",
".",
"beginTransaction",
"(",
"isolationLevel",
")",
";",
"connection",
".",
"se... | Calls the {@link StatementRunnable#run(Connection, Object)} method on the {@link StatementRunnable} parameter. All statements
run on the {@link Connection} instance in the {@link StatementRunnable#run(Connection, Object) run} method will be
executed in a transaction. The transaction will automatically be committed if t... | [
"Calls",
"the",
"{"
] | train | https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/Sql2o.java#L374-L386 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesUnion.java | HeapArrayOfDoublesUnion.heapifyUnion | static ArrayOfDoublesUnion heapifyUnion(final Memory mem, final long seed) {
"""
This is to create an instance given a serialized form and a custom seed
@param mem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a>
@retu... | java | static ArrayOfDoublesUnion heapifyUnion(final Memory mem, final long seed) {
final SerializerDeserializer.SketchType type = SerializerDeserializer.getSketchType(mem);
// compatibility with version 0.9.1 and lower
if (type == SerializerDeserializer.SketchType.ArrayOfDoublesQuickSelectSketch) {
final A... | [
"static",
"ArrayOfDoublesUnion",
"heapifyUnion",
"(",
"final",
"Memory",
"mem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"SerializerDeserializer",
".",
"SketchType",
"type",
"=",
"SerializerDeserializer",
".",
"getSketchType",
"(",
"mem",
")",
";",
"// com... | This is to create an instance given a serialized form and a custom seed
@param mem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a>
@return a ArrayOfDoublesUnion on the Java heap | [
"This",
"is",
"to",
"create",
"an",
"instance",
"given",
"a",
"serialized",
"form",
"and",
"a",
"custom",
"seed"
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesUnion.java#L38-L62 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java | AssetFiltersInner.createOrUpdateAsync | public Observable<AssetFilterInner> createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) {
"""
Create or update an Asset Filter.
Creates or updates an Asset Filter associated with the specified Asset.
@param resourceGroupName The na... | java | public Observable<AssetFilterInner> createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters).map(new Func1<ServiceResponse... | [
"public",
"Observable",
"<",
"AssetFilterInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"assetName",
",",
"String",
"filterName",
",",
"AssetFilterInner",
"parameters",
")",
"{",
"return",
"createOr... | Create or update an Asset Filter.
Creates or updates an Asset Filter associated with the specified Asset.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param assetName The Asset name.
@param filterName The Asset Filter name
@... | [
"Create",
"or",
"update",
"an",
"Asset",
"Filter",
".",
"Creates",
"or",
"updates",
"an",
"Asset",
"Filter",
"associated",
"with",
"the",
"specified",
"Asset",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java#L379-L386 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java | Ftp.upload | @Override
public boolean upload(String path, File file) {
"""
上传文件到指定目录,可选:
<pre>
1. path为null或""上传到当前路径
2. path为相对路径则相对于当前路径的子路径
3. path为绝对路径则上传到此路径
</pre>
@param path 服务端路径,可以为{@code null} 或者相对路径或绝对路径
@param file 文件
@return 是否上传成功
"""
Assert.notNull(file, "file to upload is null !");
retu... | java | @Override
public boolean upload(String path, File file) {
Assert.notNull(file, "file to upload is null !");
return upload(path, file.getName(), file);
} | [
"@",
"Override",
"public",
"boolean",
"upload",
"(",
"String",
"path",
",",
"File",
"file",
")",
"{",
"Assert",
".",
"notNull",
"(",
"file",
",",
"\"file to upload is null !\"",
")",
";",
"return",
"upload",
"(",
"path",
",",
"file",
".",
"getName",
"(",
... | 上传文件到指定目录,可选:
<pre>
1. path为null或""上传到当前路径
2. path为相对路径则相对于当前路径的子路径
3. path为绝对路径则上传到此路径
</pre>
@param path 服务端路径,可以为{@code null} 或者相对路径或绝对路径
@param file 文件
@return 是否上传成功 | [
"上传文件到指定目录,可选:"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java#L362-L366 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletResponse.java | MockHttpServletResponse.setDateHeader | @Override
public void setDateHeader(final String name, final long value) {
"""
Sets a date header.
@param name the header name.
@param value the header value.
"""
headers.put(name, String.valueOf(value));
} | java | @Override
public void setDateHeader(final String name, final long value) {
headers.put(name, String.valueOf(value));
} | [
"@",
"Override",
"public",
"void",
"setDateHeader",
"(",
"final",
"String",
"name",
",",
"final",
"long",
"value",
")",
"{",
"headers",
".",
"put",
"(",
"name",
",",
"String",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"}"
] | Sets a date header.
@param name the header name.
@param value the header value. | [
"Sets",
"a",
"date",
"header",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletResponse.java#L175-L178 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/URLRewriterService.java | URLRewriterService.unregisterURLRewriter | public static void unregisterURLRewriter( ServletRequest request, URLRewriter rewriter ) {
"""
Unregister the URLRewriter (remove from the list) from the request.
@param request the current ServletRequest.
@param rewriter the URLRewriter to unregister
@see #registerURLRewriter
"""
if ( rewriter ==... | java | public static void unregisterURLRewriter( ServletRequest request, URLRewriter rewriter )
{
if ( rewriter == null ) { return; }
ArrayList/*< URLRewriter >*/ rewriters = getRewriters( request );
if ( rewriters == null )
{
return;
}
else
{
... | [
"public",
"static",
"void",
"unregisterURLRewriter",
"(",
"ServletRequest",
"request",
",",
"URLRewriter",
"rewriter",
")",
"{",
"if",
"(",
"rewriter",
"==",
"null",
")",
"{",
"return",
";",
"}",
"ArrayList",
"/*< URLRewriter >*/",
"rewriters",
"=",
"getRewriters"... | Unregister the URLRewriter (remove from the list) from the request.
@param request the current ServletRequest.
@param rewriter the URLRewriter to unregister
@see #registerURLRewriter | [
"Unregister",
"the",
"URLRewriter",
"(",
"remove",
"from",
"the",
"list",
")",
"from",
"the",
"request",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/URLRewriterService.java#L296-L315 |
wouterd/docker-maven-plugin | src/main/java/net/wouterdanes/docker/remoteapi/MiscService.java | MiscService.getVersionInfo | public DockerVersionInfo getVersionInfo() {
"""
Returns the Docker version information
@return a {@link DockerVersionInfo} instance describing this docker installation.
"""
String json = getServiceEndPoint()
.path("/version")
.request(MediaType.APPLICATION_JSON_TYPE)
... | java | public DockerVersionInfo getVersionInfo() {
String json = getServiceEndPoint()
.path("/version")
.request(MediaType.APPLICATION_JSON_TYPE)
.get(String.class);
return toObject(json, DockerVersionInfo.class);
} | [
"public",
"DockerVersionInfo",
"getVersionInfo",
"(",
")",
"{",
"String",
"json",
"=",
"getServiceEndPoint",
"(",
")",
".",
"path",
"(",
"\"/version\"",
")",
".",
"request",
"(",
"MediaType",
".",
"APPLICATION_JSON_TYPE",
")",
".",
"get",
"(",
"String",
".",
... | Returns the Docker version information
@return a {@link DockerVersionInfo} instance describing this docker installation. | [
"Returns",
"the",
"Docker",
"version",
"information"
] | train | https://github.com/wouterd/docker-maven-plugin/blob/ea15f9e6c273989bb91f4228fb52cb73d00e07b3/src/main/java/net/wouterdanes/docker/remoteapi/MiscService.java#L69-L76 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdClient.java | MessageBirdClient.sendFlashMessage | public MessageResponse sendFlashMessage(final String originator, final String body, final List<BigInteger> recipients) throws UnauthorizedException, GeneralException {
"""
Convenient function to send a simple flash message to a list of recipients
@param originator Originator of the message, this will get trunca... | java | public MessageResponse sendFlashMessage(final String originator, final String body, final List<BigInteger> recipients) throws UnauthorizedException, GeneralException {
final Message message = new Message(originator, body, recipients);
message.setType(MsgType.flash);
return messageBirdService.sen... | [
"public",
"MessageResponse",
"sendFlashMessage",
"(",
"final",
"String",
"originator",
",",
"final",
"String",
"body",
",",
"final",
"List",
"<",
"BigInteger",
">",
"recipients",
")",
"throws",
"UnauthorizedException",
",",
"GeneralException",
"{",
"final",
"Message... | Convenient function to send a simple flash message to a list of recipients
@param originator Originator of the message, this will get truncated to 11 chars
@param body Body of the message
@param recipients List of recipients
@return MessageResponse
@throws UnauthorizedException if client is unauthorized
@throws ... | [
"Convenient",
"function",
"to",
"send",
"a",
"simple",
"flash",
"message",
"to",
"a",
"list",
"of",
"recipients"
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L185-L189 |
aws/aws-sdk-java | aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/validation/ValidationContext.java | ValidationContext.assertStringNotEmpty | public void assertStringNotEmpty(String propertyValue, String propertyName) {
"""
Asserts the string is not null and not empty, reporting to {@link ProblemReporter} with this context if it is.
@param propertyValue Value to assert on.
@param propertyName Name of property.
"""
if (StringUtils.isNull... | java | public void assertStringNotEmpty(String propertyValue, String propertyName) {
if (StringUtils.isNullOrEmpty(propertyValue)) {
problemReporter.report(new Problem(this, String.format("%s is a required property.", propertyName)));
}
} | [
"public",
"void",
"assertStringNotEmpty",
"(",
"String",
"propertyValue",
",",
"String",
"propertyName",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"propertyValue",
")",
")",
"{",
"problemReporter",
".",
"report",
"(",
"new",
"Problem",
"(",
... | Asserts the string is not null and not empty, reporting to {@link ProblemReporter} with this context if it is.
@param propertyValue Value to assert on.
@param propertyName Name of property. | [
"Asserts",
"the",
"string",
"is",
"not",
"null",
"and",
"not",
"empty",
"reporting",
"to",
"{",
"@link",
"ProblemReporter",
"}",
"with",
"this",
"context",
"if",
"it",
"is",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/validation/ValidationContext.java#L78-L82 |
czyzby/gdx-lml | lml/src/main/java/com/github/czyzby/lml/util/LmlApplicationListener.java | LmlApplicationListener.createDtdSchema | protected void createDtdSchema(final LmlParser parser, final Appendable appendable) throws Exception {
"""
This is a utility method that allows you to hook up into DTD generation process or even modify it completely.
This method is called by {@link #saveDtdSchema(FileHandle)} after the parser was already set to n... | java | protected void createDtdSchema(final LmlParser parser, final Appendable appendable) throws Exception {
Dtd.saveSchema(parser, appendable);
} | [
"protected",
"void",
"createDtdSchema",
"(",
"final",
"LmlParser",
"parser",
",",
"final",
"Appendable",
"appendable",
")",
"throws",
"Exception",
"{",
"Dtd",
".",
"saveSchema",
"(",
"parser",
",",
"appendable",
")",
";",
"}"
] | This is a utility method that allows you to hook up into DTD generation process or even modify it completely.
This method is called by {@link #saveDtdSchema(FileHandle)} after the parser was already set to non-strict. By
default, this method calls standard DTD utility method: {@link Dtd#saveSchema(LmlParser, Appendable... | [
"This",
"is",
"a",
"utility",
"method",
"that",
"allows",
"you",
"to",
"hook",
"up",
"into",
"DTD",
"generation",
"process",
"or",
"even",
"modify",
"it",
"completely",
".",
"This",
"method",
"is",
"called",
"by",
"{",
"@link",
"#saveDtdSchema",
"(",
"File... | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/lml/src/main/java/com/github/czyzby/lml/util/LmlApplicationListener.java#L154-L156 |
radkovo/Pdf2Dom | src/main/java/org/fit/pdfdom/PDFDomTree.java | PDFDomTree.createRectangleElement | protected Element createRectangleElement(float x, float y, float width, float height, boolean stroke, boolean fill) {
"""
Creates an element that represents a rectangle drawn at the specified coordinates in the page.
@param x the X coordinate of the rectangle
@param y the Y coordinate of the rectangle
@param wi... | java | protected Element createRectangleElement(float x, float y, float width, float height, boolean stroke, boolean fill)
{
float lineWidth = transformWidth(getGraphicsState().getLineWidth());
float wcor = stroke ? lineWidth : 0.0f;
float strokeOffset = wcor == 0 ? 0 : wcor / 2;
width = width... | [
"protected",
"Element",
"createRectangleElement",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"width",
",",
"float",
"height",
",",
"boolean",
"stroke",
",",
"boolean",
"fill",
")",
"{",
"float",
"lineWidth",
"=",
"transformWidth",
"(",
"getGraphicsSta... | Creates an element that represents a rectangle drawn at the specified coordinates in the page.
@param x the X coordinate of the rectangle
@param y the Y coordinate of the rectangle
@param width the width of the rectangle
@param height the height of the rectangle
@param stroke should there be a stroke around?
@param fil... | [
"Creates",
"an",
"element",
"that",
"represents",
"a",
"rectangle",
"drawn",
"at",
"the",
"specified",
"coordinates",
"in",
"the",
"page",
"."
] | train | https://github.com/radkovo/Pdf2Dom/blob/12e52b80eca7f57fc41e6ed895bf1db72c38da53/src/main/java/org/fit/pdfdom/PDFDomTree.java#L338-L369 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsWorkplaceEditorManager.java | CmsWorkplaceEditorManager.getDefaultEditorUri | protected String getDefaultEditorUri(CmsRequestContext context, String resourceType, String userAgent) {
"""
Returns the default editor URI for the current resource type.<p>
@param context the request context
@param resourceType the current resource type
@param userAgent the user agent String that identifies ... | java | protected String getDefaultEditorUri(CmsRequestContext context, String resourceType, String userAgent) {
SortedMap<Float, CmsWorkplaceEditorConfiguration> filteredEditors = filterEditorsForResourceType(resourceType);
while (filteredEditors.size() > 0) {
// get the configuration with the low... | [
"protected",
"String",
"getDefaultEditorUri",
"(",
"CmsRequestContext",
"context",
",",
"String",
"resourceType",
",",
"String",
"userAgent",
")",
"{",
"SortedMap",
"<",
"Float",
",",
"CmsWorkplaceEditorConfiguration",
">",
"filteredEditors",
"=",
"filterEditorsForResourc... | Returns the default editor URI for the current resource type.<p>
@param context the request context
@param resourceType the current resource type
@param userAgent the user agent String that identifies the browser
@return a valid default editor URI for the resource type or null, if no editor matches | [
"Returns",
"the",
"default",
"editor",
"URI",
"for",
"the",
"current",
"resource",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsWorkplaceEditorManager.java#L352-L371 |
cdk/cdk | storage/io/src/main/java/org/openscience/cdk/geometry/ZMatrixTools.java | ZMatrixTools.zmatrixToCartesian | public static Point3d[] zmatrixToCartesian(double[] distances, int[] first_atoms, double[] angles,
int[] second_atoms, double[] dihedrals, int[] third_atoms) {
"""
Takes the given Z Matrix coordinates and converts them to cartesian coordinates.
The first Atom end up in the origin, the second on on the... | java | public static Point3d[] zmatrixToCartesian(double[] distances, int[] first_atoms, double[] angles,
int[] second_atoms, double[] dihedrals, int[] third_atoms) {
Point3d[] cartesianCoords = new Point3d[distances.length];
for (int index = 0; index < distances.length; index++) {
if (... | [
"public",
"static",
"Point3d",
"[",
"]",
"zmatrixToCartesian",
"(",
"double",
"[",
"]",
"distances",
",",
"int",
"[",
"]",
"first_atoms",
",",
"double",
"[",
"]",
"angles",
",",
"int",
"[",
"]",
"second_atoms",
",",
"double",
"[",
"]",
"dihedrals",
",",
... | Takes the given Z Matrix coordinates and converts them to cartesian coordinates.
The first Atom end up in the origin, the second on on the x axis, and the third
one in the XY plane. The rest is added by applying the Zmatrix distances, angles
and dihedrals. Angles are in degrees.
@param distances Array of distance ... | [
"Takes",
"the",
"given",
"Z",
"Matrix",
"coordinates",
"and",
"converts",
"them",
"to",
"cartesian",
"coordinates",
".",
"The",
"first",
"Atom",
"end",
"up",
"in",
"the",
"origin",
"the",
"second",
"on",
"on",
"the",
"x",
"axis",
"and",
"the",
"third",
"... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/io/src/main/java/org/openscience/cdk/geometry/ZMatrixTools.java#L57-L91 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java | HttpFields.formatDate | public static String formatDate(Calendar calendar, boolean cookie) {
"""
Format HTTP date
"EEE, dd MMM yyyy HH:mm:ss 'GMT'" or
"EEE, dd-MMM-yy HH:mm:ss 'GMT'"for cookies
"""
StringBuffer buf = new StringBuffer(32);
formatDate(buf,calendar,cookie);
return buf.toString();
} | java | public static String formatDate(Calendar calendar, boolean cookie)
{
StringBuffer buf = new StringBuffer(32);
formatDate(buf,calendar,cookie);
return buf.toString();
} | [
"public",
"static",
"String",
"formatDate",
"(",
"Calendar",
"calendar",
",",
"boolean",
"cookie",
")",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
"32",
")",
";",
"formatDate",
"(",
"buf",
",",
"calendar",
",",
"cookie",
")",
";",
"return... | Format HTTP date
"EEE, dd MMM yyyy HH:mm:ss 'GMT'" or
"EEE, dd-MMM-yy HH:mm:ss 'GMT'"for cookies | [
"Format",
"HTTP",
"date",
"EEE",
"dd",
"MMM",
"yyyy",
"HH",
":",
"mm",
":",
"ss",
"GMT",
"or",
"EEE",
"dd",
"-",
"MMM",
"-",
"yy",
"HH",
":",
"mm",
":",
"ss",
"GMT",
"for",
"cookies"
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java#L331-L336 |
lunisolar/magma | magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/supplier/LLongSupplierBuilder.java | LLongSupplierBuilder.withHandling | @Nonnull
public final LLongSupplierBuilder withHandling(@Nonnull HandlingInstructions<RuntimeException, RuntimeException> handling) {
"""
One of ways of creating builder. In most cases (considering all _functional_ builders) it requires to provide generic parameters (in most cases redundantly)
"""
Null.nonN... | java | @Nonnull
public final LLongSupplierBuilder withHandling(@Nonnull HandlingInstructions<RuntimeException, RuntimeException> handling) {
Null.nonNullArg(handling, "handling");
if (this.handling != null) {
throw new UnsupportedOperationException("Handling is already set for this builder.");
}
this.handling = ha... | [
"@",
"Nonnull",
"public",
"final",
"LLongSupplierBuilder",
"withHandling",
"(",
"@",
"Nonnull",
"HandlingInstructions",
"<",
"RuntimeException",
",",
"RuntimeException",
">",
"handling",
")",
"{",
"Null",
".",
"nonNullArg",
"(",
"handling",
",",
"\"handling\"",
")",... | One of ways of creating builder. In most cases (considering all _functional_ builders) it requires to provide generic parameters (in most cases redundantly) | [
"One",
"of",
"ways",
"of",
"creating",
"builder",
".",
"In",
"most",
"cases",
"(",
"considering",
"all",
"_functional_",
"builders",
")",
"it",
"requires",
"to",
"provide",
"generic",
"parameters",
"(",
"in",
"most",
"cases",
"redundantly",
")"
] | train | https://github.com/lunisolar/magma/blob/83809c6d1a33d913aec6c49920251e4f0be8b213/magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/supplier/LLongSupplierBuilder.java#L96-L104 |
structurizr/java | structurizr-core/src/com/structurizr/model/SoftwareSystem.java | SoftwareSystem.addContainer | @Nonnull
public Container addContainer(@Nonnull String name, String description, String technology) {
"""
Adds a container with the specified name, description and technology
@param name the name of the container (e.g. "Web Application")
@param description a short description/list of responsibilitie... | java | @Nonnull
public Container addContainer(@Nonnull String name, String description, String technology) {
return getModel().addContainer(this, name, description, technology);
} | [
"@",
"Nonnull",
"public",
"Container",
"addContainer",
"(",
"@",
"Nonnull",
"String",
"name",
",",
"String",
"description",
",",
"String",
"technology",
")",
"{",
"return",
"getModel",
"(",
")",
".",
"addContainer",
"(",
"this",
",",
"name",
",",
"descriptio... | Adds a container with the specified name, description and technology
@param name the name of the container (e.g. "Web Application")
@param description a short description/list of responsibilities
@param technology the technoogy choice (e.g. "Spring MVC", "Java EE", etc)
@return the newly created Container inst... | [
"Adds",
"a",
"container",
"with",
"the",
"specified",
"name",
"description",
"and",
"technology"
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/SoftwareSystem.java#L86-L89 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/io/scan/AnnotationClassReader.java | AnnotationClassReader.readLabel | protected Label readLabel(int offset, Label[] labels) {
"""
Returns the label corresponding to the given offset. The default
implementation of this method creates a label for the given offset if it
has not been already created.
@param offset a bytecode offset in a method.
@param labels the already created la... | java | protected Label readLabel(int offset, Label[] labels) {
// SPRING PATCH: leniently handle offset mismatch
if (offset >= labels.length) {
return new Label();
}
// END OF PATCH
if (labels[offset] == null) {
labels[offset] = new Label();
}
ret... | [
"protected",
"Label",
"readLabel",
"(",
"int",
"offset",
",",
"Label",
"[",
"]",
"labels",
")",
"{",
"// SPRING PATCH: leniently handle offset mismatch",
"if",
"(",
"offset",
">=",
"labels",
".",
"length",
")",
"{",
"return",
"new",
"Label",
"(",
")",
";",
"... | Returns the label corresponding to the given offset. The default
implementation of this method creates a label for the given offset if it
has not been already created.
@param offset a bytecode offset in a method.
@param labels the already created labels, indexed by their offset. If a
label already exists for offset th... | [
"Returns",
"the",
"label",
"corresponding",
"to",
"the",
"given",
"offset",
".",
"The",
"default",
"implementation",
"of",
"this",
"method",
"creates",
"a",
"label",
"for",
"the",
"given",
"offset",
"if",
"it",
"has",
"not",
"been",
"already",
"created",
"."... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/io/scan/AnnotationClassReader.java#L746-L756 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/util/PdfGsUtilities.java | PdfGsUtilities.mergePdf | public static void mergePdf(File[] inputPdfFiles, File outputPdfFile) {
"""
Merges PDF files.
@param inputPdfFiles array of input files
@param outputPdfFile output file
"""
//get Ghostscript instance
Ghostscript gs = Ghostscript.getInstance();
//prepare Ghostscript interpreter ... | java | public static void mergePdf(File[] inputPdfFiles, File outputPdfFile) {
//get Ghostscript instance
Ghostscript gs = Ghostscript.getInstance();
//prepare Ghostscript interpreter parameters
//refer to Ghostscript documentation for parameter usage
//gs -sDEVICE=pdfwrite -dNOP... | [
"public",
"static",
"void",
"mergePdf",
"(",
"File",
"[",
"]",
"inputPdfFiles",
",",
"File",
"outputPdfFile",
")",
"{",
"//get Ghostscript instance\r",
"Ghostscript",
"gs",
"=",
"Ghostscript",
".",
"getInstance",
"(",
")",
";",
"//prepare Ghostscript interpreter param... | Merges PDF files.
@param inputPdfFiles array of input files
@param outputPdfFile output file | [
"Merges",
"PDF",
"files",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/PdfGsUtilities.java#L269-L311 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/JMapper.java | JMapper.getDestinationWithoutControl | public D getDestinationWithoutControl(D destination,final S source) {
"""
This Method returns the destination given in input enriched with data contained in source given in input<br>
with this setting:
<table summary = "">
<tr>
<td><code>NullPointerControl</code></td><td><code>NOT_ANY</code></td>
</tr><tr>
<... | java | public D getDestinationWithoutControl(D destination,final S source){
try {
return mapper.vVNotAllAll(destination, source);
} catch (Exception e) {
JmapperLog.error(e);
}
return null;
} | [
"public",
"D",
"getDestinationWithoutControl",
"(",
"D",
"destination",
",",
"final",
"S",
"source",
")",
"{",
"try",
"{",
"return",
"mapper",
".",
"vVNotAllAll",
"(",
"destination",
",",
"source",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
... | This Method returns the destination given in input enriched with data contained in source given in input<br>
with this setting:
<table summary = "">
<tr>
<td><code>NullPointerControl</code></td><td><code>NOT_ANY</code></td>
</tr><tr>
<td><code>MappingType</code> of Destination</td><td><code>ALL_FIELDS</code></td>
</tr>... | [
"This",
"Method",
"returns",
"the",
"destination",
"given",
"in",
"input",
"enriched",
"with",
"data",
"contained",
"in",
"source",
"given",
"in",
"input<br",
">",
"with",
"this",
"setting",
":",
"<table",
"summary",
"=",
">",
"<tr",
">",
"<td",
">",
"<cod... | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/JMapper.java#L175-L182 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ModelConstraints.java | ModelConstraints.checkReferenceForeignkeys | private void checkReferenceForeignkeys(ModelDef modelDef, String checkLevel) throws ConstraintException {
"""
Checks the foreignkeys of all references in the model.
@param modelDef The model
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintExcep... | java | private void checkReferenceForeignkeys(ModelDef modelDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
ClassDescriptorDef classDef;
ReferenceDescriptorDef refDef;
for (Iterator it = mod... | [
"private",
"void",
"checkReferenceForeignkeys",
"(",
"ModelDef",
"modelDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"CHECKLEVEL_NONE",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"ClassDescriptor... | Checks the foreignkeys of all references in the model.
@param modelDef The model
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintException If the value for foreignkey is invalid | [
"Checks",
"the",
"foreignkeys",
"of",
"all",
"references",
"in",
"the",
"model",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ModelConstraints.java#L600-L622 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.isActivityMatching | private boolean isActivityMatching(Class<? extends Activity> activityClass, Activity currentActivity) {
"""
Compares Activity classes.
@param activityClass the Activity class to compare
@param currentActivity the Activity that is currently active
@return true if Activity classes match
"""
if(currentAc... | java | private boolean isActivityMatching(Class<? extends Activity> activityClass, Activity currentActivity){
if(currentActivity != null && currentActivity.getClass().equals(activityClass)) {
return true;
}
return false;
} | [
"private",
"boolean",
"isActivityMatching",
"(",
"Class",
"<",
"?",
"extends",
"Activity",
">",
"activityClass",
",",
"Activity",
"currentActivity",
")",
"{",
"if",
"(",
"currentActivity",
"!=",
"null",
"&&",
"currentActivity",
".",
"getClass",
"(",
")",
".",
... | Compares Activity classes.
@param activityClass the Activity class to compare
@param currentActivity the Activity that is currently active
@return true if Activity classes match | [
"Compares",
"Activity",
"classes",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L171-L176 |
loldevs/riotapi | rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/PlayerStatsService.java | PlayerStatsService.getAggregatedStats | public AggregatedStats getAggregatedStats(long id, GameMode gameMode, Season season) {
"""
Retrieve a player's stats
@param id The id of the player
@param gameMode The game mode to check
@param season The season to check
@return Stats
"""
return client.sendRpcAndWait(SERVICE, "getAggregatedStats", ... | java | public AggregatedStats getAggregatedStats(long id, GameMode gameMode, Season season) {
return client.sendRpcAndWait(SERVICE, "getAggregatedStats", id, gameMode, season.numeric);
} | [
"public",
"AggregatedStats",
"getAggregatedStats",
"(",
"long",
"id",
",",
"GameMode",
"gameMode",
",",
"Season",
"season",
")",
"{",
"return",
"client",
".",
"sendRpcAndWait",
"(",
"SERVICE",
",",
"\"getAggregatedStats\"",
",",
"id",
",",
"gameMode",
",",
"seas... | Retrieve a player's stats
@param id The id of the player
@param gameMode The game mode to check
@param season The season to check
@return Stats | [
"Retrieve",
"a",
"player",
"s",
"stats"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/PlayerStatsService.java#L74-L76 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/StringUtilities.java | StringUtilities.similarLevenshtein | public static double similarLevenshtein(String s1, String s2) {
"""
Checks to see how similar two strings are using the Levenshtein distance algorithm.
@param s1 The first string to compare against.
@param s2 The second string to compare against.
@return A value between 0 and 1.0, where 1.0 is an exact match ... | java | public static double similarLevenshtein(String s1, String s2) {
if (s1.equals(s2)) {
return 1.0;
}
// Make sure s1 is the longest string
if (s1.length() < s2.length()) {
String swap = s1;
s1 = s2;
s2 = swap;
}
int bigLengt... | [
"public",
"static",
"double",
"similarLevenshtein",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"s1",
".",
"equals",
"(",
"s2",
")",
")",
"{",
"return",
"1.0",
";",
"}",
"// Make sure s1 is the longest string",
"if",
"(",
"s1",
".",
"l... | Checks to see how similar two strings are using the Levenshtein distance algorithm.
@param s1 The first string to compare against.
@param s2 The second string to compare against.
@return A value between 0 and 1.0, where 1.0 is an exact match and 0 is no match at all. | [
"Checks",
"to",
"see",
"how",
"similar",
"two",
"strings",
"are",
"using",
"the",
"Levenshtein",
"distance",
"algorithm",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/StringUtilities.java#L365-L379 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.