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 |
|---|---|---|---|---|---|---|---|---|---|---|
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java | SightResourcesImpl.setPublishStatus | public SightPublish setPublishStatus(long sightId, SightPublish sightPublish) throws SmartsheetException {
"""
Sets the publish status of a Sight and returns the new status, including the URLs of any enabled publishing.
It mirrors to the following Smartsheet REST API method: POST /sights/{sightId}/publish
@p... | java | public SightPublish setPublishStatus(long sightId, SightPublish sightPublish) throws SmartsheetException {
Util.throwIfNull(sightPublish);
return this.updateResource("sights/" + sightId + "/publish", SightPublish.class, sightPublish);
} | [
"public",
"SightPublish",
"setPublishStatus",
"(",
"long",
"sightId",
",",
"SightPublish",
"sightPublish",
")",
"throws",
"SmartsheetException",
"{",
"Util",
".",
"throwIfNull",
"(",
"sightPublish",
")",
";",
"return",
"this",
".",
"updateResource",
"(",
"\"sights/\... | Sets the publish status of a Sight and returns the new status, including the URLs of any enabled publishing.
It mirrors to the following Smartsheet REST API method: POST /sights/{sightId}/publish
@param sightId the Id of the Sight
@param sightPublish the SightPublish object containing publish status
@return the Sight... | [
"Sets",
"the",
"publish",
"status",
"of",
"a",
"Sight",
"and",
"returns",
"the",
"new",
"status",
"including",
"the",
"URLs",
"of",
"any",
"enabled",
"publishing",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java#L240-L243 |
JDBDT/jdbdt | src/main/java/org/jdbdt/DataSource.java | DataSource.proceedWithQuery | private void proceedWithQuery
(PreparedStatement queryStmt, DataSet ds) throws SQLException {
"""
Execute query.
@param queryStmt Query statement.
@param ds Target data set.
@throws SQLException if a database error occurs.
"""
if (queryArgs != null && queryArgs.length > 0) {
for (int i=0; i < qu... | java | private void proceedWithQuery
(PreparedStatement queryStmt, DataSet ds) throws SQLException {
if (queryArgs != null && queryArgs.length > 0) {
for (int i=0; i < queryArgs.length; i++) {
queryStmt.setObject(i + 1, queryArgs[i]);
}
}
try(ResultSet rs = queryStmt.executeQuery()) {
i... | [
"private",
"void",
"proceedWithQuery",
"(",
"PreparedStatement",
"queryStmt",
",",
"DataSet",
"ds",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"queryArgs",
"!=",
"null",
"&&",
"queryArgs",
".",
"length",
">",
"0",
")",
"{",
"for",
"(",
"int",
"i",
"=",... | Execute query.
@param queryStmt Query statement.
@param ds Target data set.
@throws SQLException if a database error occurs. | [
"Execute",
"query",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DataSource.java#L268-L285 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ConnectionTypesInner.java | ConnectionTypesInner.createOrUpdateAsync | public Observable<ConnectionTypeInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String connectionTypeName, ConnectionTypeCreateOrUpdateParameters parameters) {
"""
Create a connectiontype.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName ... | java | public Observable<ConnectionTypeInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String connectionTypeName, ConnectionTypeCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, connectionTypeName, parameter... | [
"public",
"Observable",
"<",
"ConnectionTypeInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"connectionTypeName",
",",
"ConnectionTypeCreateOrUpdateParameters",
"parameters",
")",
"{",
"return",
... | Create a connectiontype.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param connectionTypeName The parameters supplied to the create or update connectiontype operation.
@param parameters The parameters supplied to the create or update conne... | [
"Create",
"a",
"connectiontype",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ConnectionTypesInner.java#L310-L317 |
hal/core | gui/src/main/java/org/jboss/as/console/client/shared/subsys/undertow/ApplicationSecurityDomainResourceView.java | ApplicationSecurityDomainResourceView.populateRepackagedToCredentialReference | private void populateRepackagedToCredentialReference(ModelNode payload, String repackagedPropName, String propertyName) {
"""
create a flat node, copying the credential-reference complex attribute as regular attributes of the payload
"""
ModelNode value = payload.get(repackagedPropName);
if (pa... | java | private void populateRepackagedToCredentialReference(ModelNode payload, String repackagedPropName, String propertyName) {
ModelNode value = payload.get(repackagedPropName);
if (payload.hasDefined(repackagedPropName) && value.asString().trim().length() > 0) {
payload.get(CREDENTIAL_REFERENCE)... | [
"private",
"void",
"populateRepackagedToCredentialReference",
"(",
"ModelNode",
"payload",
",",
"String",
"repackagedPropName",
",",
"String",
"propertyName",
")",
"{",
"ModelNode",
"value",
"=",
"payload",
".",
"get",
"(",
"repackagedPropName",
")",
";",
"if",
"(",... | create a flat node, copying the credential-reference complex attribute as regular attributes of the payload | [
"create",
"a",
"flat",
"node",
"copying",
"the",
"credential",
"-",
"reference",
"complex",
"attribute",
"as",
"regular",
"attributes",
"of",
"the",
"payload"
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/shared/subsys/undertow/ApplicationSecurityDomainResourceView.java#L328-L334 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java | OperationsApi.getUsersAsync | public ApiAsyncSuccessResponse getUsersAsync(String aioId, Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid) throws ApiException {
"""
Get users.
Get [CfgPerson](https://docs.genesys.com/Docum... | java | public ApiAsyncSuccessResponse getUsersAsync(String aioId, Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid) throws ApiException {
ApiResponse<ApiAsyncSuccessResponse> resp = getUsersAsyncWi... | [
"public",
"ApiAsyncSuccessResponse",
"getUsersAsync",
"(",
"String",
"aioId",
",",
"Integer",
"limit",
",",
"Integer",
"offset",
",",
"String",
"order",
",",
"String",
"sortBy",
",",
"String",
"filterName",
",",
"String",
"filterParameters",
",",
"String",
"roles"... | Get users.
Get [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects based on the specified filters.
@param aioId A unique ID generated on the client (browser) when sending an API request that returns an asynchronous response. (required)
@param limit Limit the number of users ... | [
"Get",
"users",
".",
"Get",
"[",
"CfgPerson",
"]",
"(",
"https",
":",
"//",
"docs",
".",
"genesys",
".",
"com",
"/",
"Documentation",
"/",
"PSDK",
"/",
"latest",
"/",
"ConfigLayerRef",
"/",
"CfgPerson",
")",
"objects",
"based",
"on",
"the",
"specified",
... | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java#L651-L654 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/LevelRipConverter.java | LevelRipConverter.searchForTile | private static Tile searchForTile(MapTile map, ImageBuffer tileSprite, int x, int y) {
"""
Search current tile of image map by checking all surfaces.
@param map The destination map reference.
@param tileSprite The tiled sprite
@param x The location x.
@param y The location y.
@return The tile found.
"""... | java | private static Tile searchForTile(MapTile map, ImageBuffer tileSprite, int x, int y)
{
// Check each tile on each sheet
for (final Integer sheet : map.getSheets())
{
final Tile tile = checkTile(map, tileSprite, sheet, x, y);
if (tile != null)
{
... | [
"private",
"static",
"Tile",
"searchForTile",
"(",
"MapTile",
"map",
",",
"ImageBuffer",
"tileSprite",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"// Check each tile on each sheet",
"for",
"(",
"final",
"Integer",
"sheet",
":",
"map",
".",
"getSheets",
"(",
... | Search current tile of image map by checking all surfaces.
@param map The destination map reference.
@param tileSprite The tiled sprite
@param x The location x.
@param y The location y.
@return The tile found. | [
"Search",
"current",
"tile",
"of",
"image",
"map",
"by",
"checking",
"all",
"surfaces",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/LevelRipConverter.java#L156-L170 |
OpenTSDB/opentsdb | src/core/HistogramAggregationIterator.java | HistogramAggregationIterator.putDataPoint | private void putDataPoint(final int i, final HistogramDataPoint dp) {
"""
Puts the next data point of an iterator in the internal buffer.
@param i The index in {@link #iterators} of the iterator.
@param dp The last data point returned by that iterator.
"""
timestamps[i] = dp.timestamp();
values[i] ... | java | private void putDataPoint(final int i, final HistogramDataPoint dp) {
timestamps[i] = dp.timestamp();
values[i] = dp.clone();
} | [
"private",
"void",
"putDataPoint",
"(",
"final",
"int",
"i",
",",
"final",
"HistogramDataPoint",
"dp",
")",
"{",
"timestamps",
"[",
"i",
"]",
"=",
"dp",
".",
"timestamp",
"(",
")",
";",
"values",
"[",
"i",
"]",
"=",
"dp",
".",
"clone",
"(",
")",
";... | Puts the next data point of an iterator in the internal buffer.
@param i The index in {@link #iterators} of the iterator.
@param dp The last data point returned by that iterator. | [
"Puts",
"the",
"next",
"data",
"point",
"of",
"an",
"iterator",
"in",
"the",
"internal",
"buffer",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/HistogramAggregationIterator.java#L178-L181 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemValueOf.java | ElemValueOf.callChildVisitors | protected void callChildVisitors(XSLTVisitor visitor, boolean callAttrs) {
"""
Call the children visitors.
@param visitor The visitor whose appropriate method will be called.
"""
if(callAttrs)
m_selectExpression.getExpression().callVisitors(m_selectExpression, visitor);
super.callChildVisitors(visi... | java | protected void callChildVisitors(XSLTVisitor visitor, boolean callAttrs)
{
if(callAttrs)
m_selectExpression.getExpression().callVisitors(m_selectExpression, visitor);
super.callChildVisitors(visitor, callAttrs);
} | [
"protected",
"void",
"callChildVisitors",
"(",
"XSLTVisitor",
"visitor",
",",
"boolean",
"callAttrs",
")",
"{",
"if",
"(",
"callAttrs",
")",
"m_selectExpression",
".",
"getExpression",
"(",
")",
".",
"callVisitors",
"(",
"m_selectExpression",
",",
"visitor",
")",
... | Call the children visitors.
@param visitor The visitor whose appropriate method will be called. | [
"Call",
"the",
"children",
"visitors",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemValueOf.java#L282-L287 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/xspec/BS.java | BS.ifNotExists | public IfNotExistsFunction<BS> ifNotExists(byte[]... defaultValue) {
"""
Returns an <code>IfNotExistsFunction</code> object which represents an <a href=
"http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html"
>if_not_exists(path, operand)</a> function call where path refers t... | java | public IfNotExistsFunction<BS> ifNotExists(byte[]... defaultValue) {
return new IfNotExistsFunction<BS>(this, new LiteralOperand(
new LinkedHashSet<byte[]>(Arrays.asList(defaultValue))));
} | [
"public",
"IfNotExistsFunction",
"<",
"BS",
">",
"ifNotExists",
"(",
"byte",
"[",
"]",
"...",
"defaultValue",
")",
"{",
"return",
"new",
"IfNotExistsFunction",
"<",
"BS",
">",
"(",
"this",
",",
"new",
"LiteralOperand",
"(",
"new",
"LinkedHashSet",
"<",
"byte... | Returns an <code>IfNotExistsFunction</code> object which represents an <a href=
"http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html"
>if_not_exists(path, operand)</a> function call where path refers to that
of the current path operand; used for building expressions.
<pre>
"if_no... | [
"Returns",
"an",
"<code",
">",
"IfNotExistsFunction<",
"/",
"code",
">",
"object",
"which",
"represents",
"an",
"<a",
"href",
"=",
"http",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
".",
"com",
"/",
"amazondynamodb",
"/",
"latest",
"/",
"developerguide"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/xspec/BS.java#L237-L240 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/Sources.java | Sources.asFile | public static File asFile(Class<?> contextClass, String resourceName) {
"""
Returns the given source as a {@link File}
@param contextClass
@param resourceName
@return
"""
return new File(asURL(contextClass, resourceName).getFile());
} | java | public static File asFile(Class<?> contextClass, String resourceName) {
return new File(asURL(contextClass, resourceName).getFile());
} | [
"public",
"static",
"File",
"asFile",
"(",
"Class",
"<",
"?",
">",
"contextClass",
",",
"String",
"resourceName",
")",
"{",
"return",
"new",
"File",
"(",
"asURL",
"(",
"contextClass",
",",
"resourceName",
")",
".",
"getFile",
"(",
")",
")",
";",
"}"
] | Returns the given source as a {@link File}
@param contextClass
@param resourceName
@return | [
"Returns",
"the",
"given",
"source",
"as",
"a",
"{",
"@link",
"File",
"}"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/Sources.java#L181-L183 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/DateChangedHandler.java | DateChangedHandler.doRecordChange | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) {
"""
Called when a change is the record status is about to happen/has happened.
This method sets the field to the current time on an add or update.
@param field If this file change is due to a field, this is the field.
@param i... | java | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
{ // Write/Update a record
switch (iChangeType)
{
case DBConstants.FIELD_CHANGED_TYPE:
if (!onFieldChange)
break;
case DBConstants.REFRESH_TYPE:
... | [
"public",
"int",
"doRecordChange",
"(",
"FieldInfo",
"field",
",",
"int",
"iChangeType",
",",
"boolean",
"bDisplayOption",
")",
"{",
"// Write/Update a record",
"switch",
"(",
"iChangeType",
")",
"{",
"case",
"DBConstants",
".",
"FIELD_CHANGED_TYPE",
":",
"if",
"(... | Called when a change is the record status is about to happen/has happened.
This method sets the field to the current time on an add or update.
@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.
@... | [
"Called",
"when",
"a",
"change",
"is",
"the",
"record",
"status",
"is",
"about",
"to",
"happen",
"/",
"has",
"happened",
".",
"This",
"method",
"sets",
"the",
"field",
"to",
"the",
"current",
"time",
"on",
"an",
"add",
"or",
"update",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/DateChangedHandler.java#L97-L117 |
Indoqa/logspace | logspace-agent-api/src/main/java/io/logspace/agent/api/AgentControllerProvider.java | AgentControllerProvider.setDescription | public static synchronized void setDescription(InputStream inputStream) {
"""
Set the {@link AgentControllerDescription} by reading it from the given {@link InputStream} and close the InputStream
afterwards.<br>
<br>
This method expects the InputStream to provide a description in a format, that can be read by t... | java | public static synchronized void setDescription(InputStream inputStream) {
try {
setDescription(AgentControllerDescriptionFactory.read(inputStream));
} catch (IOException ioex) {
throw new AgentControllerInitializationException("Could not load logspace configuration.", ioex);
... | [
"public",
"static",
"synchronized",
"void",
"setDescription",
"(",
"InputStream",
"inputStream",
")",
"{",
"try",
"{",
"setDescription",
"(",
"AgentControllerDescriptionFactory",
".",
"read",
"(",
"inputStream",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"io... | Set the {@link AgentControllerDescription} by reading it from the given {@link InputStream} and close the InputStream
afterwards.<br>
<br>
This method expects the InputStream to provide a description in a format, that can be read by the
{@link AgentControllerDescriptionFactory}.<br>
This method will fail with an {@link... | [
"Set",
"the",
"{",
"@link",
"AgentControllerDescription",
"}",
"by",
"reading",
"it",
"from",
"the",
"given",
"{",
"@link",
"InputStream",
"}",
"and",
"close",
"the",
"InputStream",
"afterwards",
".",
"<br",
">",
"<br",
">",
"This",
"method",
"expects",
"the... | train | https://github.com/Indoqa/logspace/blob/781a3f1da0580542d7dd726cac8eafecb090663d/logspace-agent-api/src/main/java/io/logspace/agent/api/AgentControllerProvider.java#L115-L123 |
grails/grails-core | grails-core/src/main/groovy/grails/util/GrailsClassUtils.java | GrailsClassUtils.getPropertyForGetter | public static String getPropertyForGetter(String getterName, Class returnType) {
"""
Returns a property name equivalent for the given getter name and return type or null if it is not a valid getter. If not null
or empty the getter name is assumed to be a valid identifier.
@param getterName The getter name
@pa... | java | public static String getPropertyForGetter(String getterName, Class returnType) {
return GrailsNameUtils.getPropertyForGetter(getterName, returnType);
} | [
"public",
"static",
"String",
"getPropertyForGetter",
"(",
"String",
"getterName",
",",
"Class",
"returnType",
")",
"{",
"return",
"GrailsNameUtils",
".",
"getPropertyForGetter",
"(",
"getterName",
",",
"returnType",
")",
";",
"}"
] | Returns a property name equivalent for the given getter name and return type or null if it is not a valid getter. If not null
or empty the getter name is assumed to be a valid identifier.
@param getterName The getter name
@param returnType The type the method returns
@return The property name equivalent | [
"Returns",
"a",
"property",
"name",
"equivalent",
"for",
"the",
"given",
"getter",
"name",
"and",
"return",
"type",
"or",
"null",
"if",
"it",
"is",
"not",
"a",
"valid",
"getter",
".",
"If",
"not",
"null",
"or",
"empty",
"the",
"getter",
"name",
"is",
"... | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L917-L919 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.fromEC | public static JsonWebKey fromEC(KeyPair keyPair, Provider provider) {
"""
Converts EC key pair to JSON web key.
@param keyPair
EC key pair
@param provider
Java security provider
@return the JSON web key, converted from EC key pair.
"""
ECPublicKey apub = (ECPublicKey) keyPair.getPublic();
... | java | public static JsonWebKey fromEC(KeyPair keyPair, Provider provider) {
ECPublicKey apub = (ECPublicKey) keyPair.getPublic();
ECPoint point = apub.getW();
ECPrivateKey apriv = (ECPrivateKey) keyPair.getPrivate();
if (apriv != null) {
return new JsonWebKey().withKty(JsonWebKey... | [
"public",
"static",
"JsonWebKey",
"fromEC",
"(",
"KeyPair",
"keyPair",
",",
"Provider",
"provider",
")",
"{",
"ECPublicKey",
"apub",
"=",
"(",
"ECPublicKey",
")",
"keyPair",
".",
"getPublic",
"(",
")",
";",
"ECPoint",
"point",
"=",
"apub",
".",
"getW",
"("... | Converts EC key pair to JSON web key.
@param keyPair
EC key pair
@param provider
Java security provider
@return the JSON web key, converted from EC key pair. | [
"Converts",
"EC",
"key",
"pair",
"to",
"JSON",
"web",
"key",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L818-L833 |
apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/XmlParser.java | XmlParser.createNode | protected Node createNode(Node parent, Object name, Map attributes) {
"""
Creates a new node with the given parent, name, and attributes. The
default implementation returns an instance of
<code>groovy.util.Node</code>.
@param parent the parent node, or null if the node being created is the
root node
@pa... | java | protected Node createNode(Node parent, Object name, Map attributes) {
return new Node(parent, name, attributes);
} | [
"protected",
"Node",
"createNode",
"(",
"Node",
"parent",
",",
"Object",
"name",
",",
"Map",
"attributes",
")",
"{",
"return",
"new",
"Node",
"(",
"parent",
",",
"name",
",",
"attributes",
")",
";",
"}"
] | Creates a new node with the given parent, name, and attributes. The
default implementation returns an instance of
<code>groovy.util.Node</code>.
@param parent the parent node, or null if the node being created is the
root node
@param name an Object representing the name of the node (typically
an instance of ... | [
"Creates",
"a",
"new",
"node",
"with",
"the",
"given",
"parent",
"name",
"and",
"attributes",
".",
"The",
"default",
"implementation",
"returns",
"an",
"instance",
"of",
"<code",
">",
"groovy",
".",
"util",
".",
"Node<",
"/",
"code",
">",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/XmlParser.java#L473-L475 |
pravega/pravega | controller/src/main/java/io/pravega/controller/server/SegmentHelper.java | SegmentHelper.sealSegment | public CompletableFuture<Boolean> sealSegment(final String scope,
final String stream,
final long segmentId,
String delegationToken,
... | java | public CompletableFuture<Boolean> sealSegment(final String scope,
final String stream,
final long segmentId,
String delegationToken,
... | [
"public",
"CompletableFuture",
"<",
"Boolean",
">",
"sealSegment",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"long",
"segmentId",
",",
"String",
"delegationToken",
",",
"final",
"long",
"clientRequestId",
")",
"{",
"final",... | This method sends segment sealed message for the specified segment.
@param scope stream scope
@param stream stream name
@param segmentId number of segment to be sealed
@param delegationToken the token to be presented to segmentstore.
@param clientRequestId client-generated ... | [
"This",
"method",
"sends",
"segment",
"sealed",
"message",
"for",
"the",
"specified",
"segment",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/SegmentHelper.java#L276-L285 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/BigDecComparator.java | BigDecComparator.putNormalizedKey | @Override
public void putNormalizedKey(BigDecimal record, MemorySegment target, int offset, int len) {
"""
Adds a normalized key containing a normalized order of magnitude of the given record.
2 bits determine the sign (negative, zero, positive), 33 bits determine the magnitude.
This method adds at most 5 bytes... | java | @Override
public void putNormalizedKey(BigDecimal record, MemorySegment target, int offset, int len) {
final long signum = record.signum();
// order of magnitude
// smallest:
// scale = Integer.MAX, precision = 1 => SMALLEST_MAGNITUDE
// largest:
// scale = Integer.MIN, precision = Integer.MAX => LARGEST_... | [
"@",
"Override",
"public",
"void",
"putNormalizedKey",
"(",
"BigDecimal",
"record",
",",
"MemorySegment",
"target",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"final",
"long",
"signum",
"=",
"record",
".",
"signum",
"(",
")",
";",
"// order of magnit... | Adds a normalized key containing a normalized order of magnitude of the given record.
2 bits determine the sign (negative, zero, positive), 33 bits determine the magnitude.
This method adds at most 5 bytes that contain information. | [
"Adds",
"a",
"normalized",
"key",
"containing",
"a",
"normalized",
"order",
"of",
"magnitude",
"of",
"the",
"given",
"record",
".",
"2",
"bits",
"determine",
"the",
"sign",
"(",
"negative",
"zero",
"positive",
")",
"33",
"bits",
"determine",
"the",
"magnitud... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/BigDecComparator.java#L76-L112 |
fabric8io/fabric8-forge | addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java | MavenHelpers.getVersion | public static String getVersion(String groupId, String artifactId, String defaultVersion) {
"""
Returns the version from the list of pre-configured versions of common groupId/artifact pairs
"""
String answer = getVersion(groupId, artifactId);
if (Strings.isNullOrBlank(answer)) {
ans... | java | public static String getVersion(String groupId, String artifactId, String defaultVersion) {
String answer = getVersion(groupId, artifactId);
if (Strings.isNullOrBlank(answer)) {
answer = defaultVersion;
}
return answer;
} | [
"public",
"static",
"String",
"getVersion",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"defaultVersion",
")",
"{",
"String",
"answer",
"=",
"getVersion",
"(",
"groupId",
",",
"artifactId",
")",
";",
"if",
"(",
"Strings",
".",
"isNu... | Returns the version from the list of pre-configured versions of common groupId/artifact pairs | [
"Returns",
"the",
"version",
"from",
"the",
"list",
"of",
"pre",
"-",
"configured",
"versions",
"of",
"common",
"groupId",
"/",
"artifact",
"pairs"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L165-L171 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/util/ColumnTypeHelper.java | ColumnTypeHelper.getCastingValue | public static Object getCastingValue(ColumnType columnType, Object value) throws ExecutionException {
"""
Return a casting value adapt to columntType.
@param columnType the columnType.
@param value the value.
@return the casting value.
@throws ExecutionException if the casting is not possible.
"""
... | java | public static Object getCastingValue(ColumnType columnType, Object value) throws ExecutionException {
validateInput(columnType);
Object returnValue = null;
if (value != null) {
switch (columnType.getDataType()) {
case BIGINT:
ensureNumber(value);
... | [
"public",
"static",
"Object",
"getCastingValue",
"(",
"ColumnType",
"columnType",
",",
"Object",
"value",
")",
"throws",
"ExecutionException",
"{",
"validateInput",
"(",
"columnType",
")",
";",
"Object",
"returnValue",
"=",
"null",
";",
"if",
"(",
"value",
"!=",... | Return a casting value adapt to columntType.
@param columnType the columnType.
@param value the value.
@return the casting value.
@throws ExecutionException if the casting is not possible. | [
"Return",
"a",
"casting",
"value",
"adapt",
"to",
"columntType",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/util/ColumnTypeHelper.java#L50-L79 |
dita-ot/dita-ot | src/main/java/org/dita/dost/Processor.java | Processor.setProperty | public Processor setProperty(final String name, final String value) {
"""
Set property. Existing property mapping will be overridden.
@param name property name
@param value property value
@return this Process object
"""
args.put(name, value);
return this;
} | java | public Processor setProperty(final String name, final String value) {
args.put(name, value);
return this;
} | [
"public",
"Processor",
"setProperty",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"args",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Set property. Existing property mapping will be overridden.
@param name property name
@param value property value
@return this Process object | [
"Set",
"property",
".",
"Existing",
"property",
"mapping",
"will",
"be",
"overridden",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/Processor.java#L113-L116 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java | ArrayUtils.boundsCheck | public static void boundsCheck(int capacity, int index, int length) {
"""
Bounds check when copying to/from a buffer
@param capacity capacity of the buffer
@param index index of copying will start from/to
@param length length of the buffer that will be read/writen
"""
if (capacity < 0 || inde... | java | public static void boundsCheck(int capacity, int index, int length) {
if (capacity < 0 || index < 0 || length < 0 || (index > (capacity - length))) {
throw new IndexOutOfBoundsException(String.format("index=%d, length=%d, capacity=%d", index, length, capacity));
}
} | [
"public",
"static",
"void",
"boundsCheck",
"(",
"int",
"capacity",
",",
"int",
"index",
",",
"int",
"length",
")",
"{",
"if",
"(",
"capacity",
"<",
"0",
"||",
"index",
"<",
"0",
"||",
"length",
"<",
"0",
"||",
"(",
"index",
">",
"(",
"capacity",
"-... | Bounds check when copying to/from a buffer
@param capacity capacity of the buffer
@param index index of copying will start from/to
@param length length of the buffer that will be read/writen | [
"Bounds",
"check",
"when",
"copying",
"to",
"/",
"from",
"a",
"buffer"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java#L184-L188 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/jdeps/JdepsTask.java | JdepsTask.toTag | private String toTag(String name, Archive source, Analyzer.Type type) {
"""
If the given archive is JDK archive, this method returns the profile name
only if -profile option is specified; it accesses a private JDK API and
the returned value will have "JDK internal API" prefix
For non-JDK archives, this method... | java | private String toTag(String name, Archive source, Analyzer.Type type) {
if (!isJDKArchive(source)) {
return source.getName();
}
JDKArchive jdk = (JDKArchive)source;
boolean isExported = false;
if (type == CLASS || type == VERBOSE) {
isExported = jdk.isExp... | [
"private",
"String",
"toTag",
"(",
"String",
"name",
",",
"Archive",
"source",
",",
"Analyzer",
".",
"Type",
"type",
")",
"{",
"if",
"(",
"!",
"isJDKArchive",
"(",
"source",
")",
")",
"{",
"return",
"source",
".",
"getName",
"(",
")",
";",
"}",
"JDKA... | If the given archive is JDK archive, this method returns the profile name
only if -profile option is specified; it accesses a private JDK API and
the returned value will have "JDK internal API" prefix
For non-JDK archives, this method returns the file name of the archive. | [
"If",
"the",
"given",
"archive",
"is",
"JDK",
"archive",
"this",
"method",
"returns",
"the",
"profile",
"name",
"only",
"if",
"-",
"profile",
"option",
"is",
"specified",
";",
"it",
"accesses",
"a",
"private",
"JDK",
"API",
"and",
"the",
"returned",
"value... | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/jdeps/JdepsTask.java#L954-L973 |
apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopOutputFormatBase.java | HadoopOutputFormatBase.close | @Override
public void close() throws IOException {
"""
commit the task by moving the output file out from the temporary directory.
@throws java.io.IOException
"""
// enforce sequential close() calls
synchronized (CLOSE_MUTEX) {
try {
this.recordWriter.close(this.context);
} catch (InterruptedE... | java | @Override
public void close() throws IOException {
// enforce sequential close() calls
synchronized (CLOSE_MUTEX) {
try {
this.recordWriter.close(this.context);
} catch (InterruptedException e) {
throw new IOException("Could not close RecordReader.", e);
}
if (this.outputCommitter.needsTaskCo... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"// enforce sequential close() calls",
"synchronized",
"(",
"CLOSE_MUTEX",
")",
"{",
"try",
"{",
"this",
".",
"recordWriter",
".",
"close",
"(",
"this",
".",
"context",
")",
";... | commit the task by moving the output file out from the temporary directory.
@throws java.io.IOException | [
"commit",
"the",
"task",
"by",
"moving",
"the",
"output",
"file",
"out",
"from",
"the",
"temporary",
"directory",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopOutputFormatBase.java#L160-L188 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java | ServerSentEvents.fromStream | public static HttpResponse fromStream(Stream<? extends ServerSentEvent> contentStream,
Executor executor) {
"""
Creates a new Server-Sent Events stream from the specified {@link Stream}.
@param contentStream the {@link Stream} which publishes the objects supposed to sen... | java | public static HttpResponse fromStream(Stream<? extends ServerSentEvent> contentStream,
Executor executor) {
return fromStream(defaultHttpHeaders, contentStream, HttpHeaders.EMPTY_HEADERS, executor);
} | [
"public",
"static",
"HttpResponse",
"fromStream",
"(",
"Stream",
"<",
"?",
"extends",
"ServerSentEvent",
">",
"contentStream",
",",
"Executor",
"executor",
")",
"{",
"return",
"fromStream",
"(",
"defaultHttpHeaders",
",",
"contentStream",
",",
"HttpHeaders",
".",
... | Creates a new Server-Sent Events stream from the specified {@link Stream}.
@param contentStream the {@link Stream} which publishes the objects supposed to send as contents
@param executor the executor which iterates the stream | [
"Creates",
"a",
"new",
"Server",
"-",
"Sent",
"Events",
"stream",
"from",
"the",
"specified",
"{",
"@link",
"Stream",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java#L169-L172 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java | BigtableSession.createChannelPool | public static ManagedChannel createChannelPool(final String host, final BigtableOptions options)
throws IOException, GeneralSecurityException {
"""
Create a new {@link com.google.cloud.bigtable.grpc.io.ChannelPool}, with auth headers.
@param host a {@link String} object.
@param options a {@link BigtableO... | java | public static ManagedChannel createChannelPool(final String host, final BigtableOptions options)
throws IOException, GeneralSecurityException {
return createChannelPool(host, options, 1);
} | [
"public",
"static",
"ManagedChannel",
"createChannelPool",
"(",
"final",
"String",
"host",
",",
"final",
"BigtableOptions",
"options",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"return",
"createChannelPool",
"(",
"host",
",",
"options",
",",
... | Create a new {@link com.google.cloud.bigtable.grpc.io.ChannelPool}, with auth headers.
@param host a {@link String} object.
@param options a {@link BigtableOptions} object.
@return a {@link ChannelPool} object.
@throws IOException if any.
@throws GeneralSecurityException | [
"Create",
"a",
"new",
"{",
"@link",
"com",
".",
"google",
".",
"cloud",
".",
"bigtable",
".",
"grpc",
".",
"io",
".",
"ChannelPool",
"}",
"with",
"auth",
"headers",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java#L563-L566 |
mongodb/stitch-android-sdk | server/services/mongodb-remote/src/main/java/com/mongodb/stitch/server/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java | RemoteMongoCollectionImpl.findOneAndUpdate | public DocumentT findOneAndUpdate(final Bson filter, final Bson update) {
"""
Finds a document in the collection and performs the given update.
@param filter the query filter
@param update the update document
@return the resulting document
"""
return proxy.findOneAndUpdate(filter, update);
} | java | public DocumentT findOneAndUpdate(final Bson filter, final Bson update) {
return proxy.findOneAndUpdate(filter, update);
} | [
"public",
"DocumentT",
"findOneAndUpdate",
"(",
"final",
"Bson",
"filter",
",",
"final",
"Bson",
"update",
")",
"{",
"return",
"proxy",
".",
"findOneAndUpdate",
"(",
"filter",
",",
"update",
")",
";",
"}"
] | Finds a document in the collection and performs the given update.
@param filter the query filter
@param update the update document
@return the resulting document | [
"Finds",
"a",
"document",
"in",
"the",
"collection",
"and",
"performs",
"the",
"given",
"update",
"."
] | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/server/services/mongodb-remote/src/main/java/com/mongodb/stitch/server/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java#L368-L370 |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/routes/RouterImpl.java | RouterImpl.calculateRoute | private final Route calculateRoute(HttpMethod httpMethod, String requestUri/*, ActionInvoker invoker*//*,Injector injector*/) throws RouteException {
"""
It is not consistent that this particular injector handles implementations from both core and server
"""
if (routes == null) throw new IllegalStateEx... | java | private final Route calculateRoute(HttpMethod httpMethod, String requestUri/*, ActionInvoker invoker*//*,Injector injector*/) throws RouteException {
if (routes == null) throw new IllegalStateException("Routes have not been compiled. Call #compileRoutes() first");
final Route route = matchCusto... | [
"private",
"final",
"Route",
"calculateRoute",
"(",
"HttpMethod",
"httpMethod",
",",
"String",
"requestUri",
"/*, ActionInvoker invoker*/",
"/*,Injector injector*/",
")",
"throws",
"RouteException",
"{",
"if",
"(",
"routes",
"==",
"null",
")",
"throw",
"new",
"Illegal... | It is not consistent that this particular injector handles implementations from both core and server | [
"It",
"is",
"not",
"consistent",
"that",
"this",
"particular",
"injector",
"handles",
"implementations",
"from",
"both",
"core",
"and",
"server"
] | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/routes/RouterImpl.java#L82-L98 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonArray.java | JsonArray.addAll | @Override
public boolean addAll(int start, Collection<? extends Object> args) {
"""
Inserts the given objects at the given index in the array.
WARNING: While we attempt to guess the value type with {@link #isState(Object)}, it is error-prone, thus it is not advisable to use this method.
@oaram start The index... | java | @Override
public boolean addAll(int start, Collection<? extends Object> args) {
boolean result = false;
for (Object obj : args) {
result = true;
try {
add(start++, obj);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("index " + start + " is invalid type", e);
}
}
... | [
"@",
"Override",
"public",
"boolean",
"addAll",
"(",
"int",
"start",
",",
"Collection",
"<",
"?",
"extends",
"Object",
">",
"args",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"for",
"(",
"Object",
"obj",
":",
"args",
")",
"{",
"result",
"=",
"... | Inserts the given objects at the given index in the array.
WARNING: While we attempt to guess the value type with {@link #isState(Object)}, it is error-prone, thus it is not advisable to use this method.
@oaram start The index to insert at.
@param args
The values to insert. | [
"Inserts",
"the",
"given",
"objects",
"at",
"the",
"given",
"index",
"in",
"the",
"array",
".",
"WARNING",
":",
"While",
"we",
"attempt",
"to",
"guess",
"the",
"value",
"type",
"with",
"{",
"@link",
"#isState",
"(",
"Object",
")",
"}",
"it",
"is",
"err... | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonArray.java#L821-L833 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/lock/NullResourceLocksHolder.java | NullResourceLocksHolder.isLocked | public boolean isLocked(Session session, String path) {
"""
Checks if the node is locked.
@param session current session
@param path node path
@return true if the node is locked false if not
"""
String repoPath = session.getRepository().hashCode() + "/" + session.getWorkspace().getName() + "/" + pa... | java | public boolean isLocked(Session session, String path)
{
String repoPath = session.getRepository().hashCode() + "/" + session.getWorkspace().getName() + "/" + path;
if (nullResourceLocks.get(repoPath) != null)
{
return true;
}
return false;
} | [
"public",
"boolean",
"isLocked",
"(",
"Session",
"session",
",",
"String",
"path",
")",
"{",
"String",
"repoPath",
"=",
"session",
".",
"getRepository",
"(",
")",
".",
"hashCode",
"(",
")",
"+",
"\"/\"",
"+",
"session",
".",
"getWorkspace",
"(",
")",
"."... | Checks if the node is locked.
@param session current session
@param path node path
@return true if the node is locked false if not | [
"Checks",
"if",
"the",
"node",
"is",
"locked",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/lock/NullResourceLocksHolder.java#L104-L113 |
Appendium/objectlabkit | fxcalc/src/main/java/net/objectlab/kit/fxcalc/MajorCurrencyRankingImpl.java | MajorCurrencyRankingImpl.selectMajorCurrency | @Override
public String selectMajorCurrency(final String ccy1, final String ccy2) {
"""
Given 2 currencies, return the major one if there is one, otherwise returns the first currency.
"""
return ranks.getOrDefault(StringUtil.toUpperCase(ccy1), DEFAULT_UNRANKED_VALUE).intValue() <= ranks.getOrDefaul... | java | @Override
public String selectMajorCurrency(final String ccy1, final String ccy2) {
return ranks.getOrDefault(StringUtil.toUpperCase(ccy1), DEFAULT_UNRANKED_VALUE).intValue() <= ranks.getOrDefault(StringUtil.toUpperCase(ccy2), DEFAULT_UNRANKED_VALUE).intValue() ? ccy1
: ccy2;
} | [
"@",
"Override",
"public",
"String",
"selectMajorCurrency",
"(",
"final",
"String",
"ccy1",
",",
"final",
"String",
"ccy2",
")",
"{",
"return",
"ranks",
".",
"getOrDefault",
"(",
"StringUtil",
".",
"toUpperCase",
"(",
"ccy1",
")",
",",
"DEFAULT_UNRANKED_VALUE",
... | Given 2 currencies, return the major one if there is one, otherwise returns the first currency. | [
"Given",
"2",
"currencies",
"return",
"the",
"major",
"one",
"if",
"there",
"is",
"one",
"otherwise",
"returns",
"the",
"first",
"currency",
"."
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/fxcalc/src/main/java/net/objectlab/kit/fxcalc/MajorCurrencyRankingImpl.java#L38-L42 |
ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/action/WrappedAction.java | WrappedAction.getKeyForActionMap | private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke) {
"""
/*
Search the 3 InputMaps to find the KeyStroke binding.
1. WHEN_IN_FOCUSED_WINDOW,
2. WHEN_FOCUSED,
3. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
"""
for (int i = 0; i < 3; i++) {
InputMap inputMap = component.getInputMap(i);
... | java | private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke) {
for (int i = 0; i < 3; i++) {
InputMap inputMap = component.getInputMap(i);
if (inputMap != null) {
Object key = inputMap.get(keyStroke);
if (key != null) {
return key;
}
}
}
return null;
} | [
"private",
"Object",
"getKeyForActionMap",
"(",
"JComponent",
"component",
",",
"KeyStroke",
"keyStroke",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"InputMap",
"inputMap",
"=",
"component",
".",
"getInputMa... | /*
Search the 3 InputMaps to find the KeyStroke binding.
1. WHEN_IN_FOCUSED_WINDOW,
2. WHEN_FOCUSED,
3. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT | [
"/",
"*",
"Search",
"the",
"3",
"InputMaps",
"to",
"find",
"the",
"KeyStroke",
"binding",
".",
"1",
".",
"WHEN_IN_FOCUSED_WINDOW",
"2",
".",
"WHEN_FOCUSED",
"3",
".",
"WHEN_ANCESTOR_OF_FOCUSED_COMPONENT"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/action/WrappedAction.java#L74-L85 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/support/ReflectionUtils.java | ReflectionUtils.invokeMethod | public static Object invokeMethod(Method method, Object target) {
"""
Invoke the specified {@link Method} against the supplied target object with no arguments. The target object can be
{@code null} when invoking a static {@link Method}.
<p>
Thrown exceptions are handled via a call to {@link #handleReflectionExc... | java | public static Object invokeMethod(Method method, Object target) {
return invokeMethod(method, target, new Object[0]);
} | [
"public",
"static",
"Object",
"invokeMethod",
"(",
"Method",
"method",
",",
"Object",
"target",
")",
"{",
"return",
"invokeMethod",
"(",
"method",
",",
"target",
",",
"new",
"Object",
"[",
"0",
"]",
")",
";",
"}"
] | Invoke the specified {@link Method} against the supplied target object with no arguments. The target object can be
{@code null} when invoking a static {@link Method}.
<p>
Thrown exceptions are handled via a call to {@link #handleReflectionException}.
@param method the method to invoke
@param target the target object t... | [
"Invoke",
"the",
"specified",
"{",
"@link",
"Method",
"}",
"against",
"the",
"supplied",
"target",
"object",
"with",
"no",
"arguments",
".",
"The",
"target",
"object",
"can",
"be",
"{",
"@code",
"null",
"}",
"when",
"invoking",
"a",
"static",
"{",
"@link",... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/support/ReflectionUtils.java#L107-L109 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.mergeAdd | public SDVariable mergeAdd(String name, SDVariable... inputs) {
"""
Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i]
@param name Name of the output variable
@param inputs Input variables
@return Output variable
"""
validateSame... | java | public SDVariable mergeAdd(String name, SDVariable... inputs) {
validateSameType("mergeAdd", true, inputs);
SDVariable ret = f().mergeAdd(inputs);
return updateVariableNameAndReference(ret, name);
} | [
"public",
"SDVariable",
"mergeAdd",
"(",
"String",
"name",
",",
"SDVariable",
"...",
"inputs",
")",
"{",
"validateSameType",
"(",
"\"mergeAdd\"",
",",
"true",
",",
"inputs",
")",
";",
"SDVariable",
"ret",
"=",
"f",
"(",
")",
".",
"mergeAdd",
"(",
"inputs",... | Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i]
@param name Name of the output variable
@param inputs Input variables
@return Output variable | [
"Merge",
"add",
"function",
":",
"merges",
"an",
"arbitrary",
"number",
"of",
"equal",
"shaped",
"arrays",
"using",
"element",
"-",
"wise",
"addition",
":",
"out",
"=",
"sum_i",
"in",
"[",
"i",
"]"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L1727-L1731 |
brettonw/Bag | src/main/java/com/brettonw/bag/SourceAdapterHttp.java | SourceAdapterHttp.trustAllHosts | public static void trustAllHosts () {
"""
Sometimes a remote source is self-signed or not otherwise trusted
"""
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager () {
... | java | public static void trustAllHosts () {
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager () {
public X509Certificate[] getAcceptedIssuers () { return new X509Certificate[]{}; ... | [
"public",
"static",
"void",
"trustAllHosts",
"(",
")",
"{",
"// Create a trust manager that does not validate certificate chains\r",
"TrustManager",
"[",
"]",
"trustAllCerts",
"=",
"new",
"TrustManager",
"[",
"]",
"{",
"new",
"X509TrustManager",
"(",
")",
"{",
"public",... | Sometimes a remote source is self-signed or not otherwise trusted | [
"Sometimes",
"a",
"remote",
"source",
"is",
"self",
"-",
"signed",
"or",
"not",
"otherwise",
"trusted"
] | train | https://github.com/brettonw/Bag/blob/25c0ff74893b6c9a2c61bf0f97189ab82e0b2f56/src/main/java/com/brettonw/bag/SourceAdapterHttp.java#L113-L136 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/segment/serde/ComplexMetricSerde.java | ComplexMetricSerde.getSerializer | public GenericColumnSerializer getSerializer(SegmentWriteOutMedium segmentWriteOutMedium, String column) {
"""
This method provides the ability for a ComplexMetricSerde to control its own serialization.
For large column (i.e columns greater than {@link Integer#MAX_VALUE}) use
{@link LargeColumnSupportedComplexCo... | java | public GenericColumnSerializer getSerializer(SegmentWriteOutMedium segmentWriteOutMedium, String column)
{
return ComplexColumnSerializer.create(segmentWriteOutMedium, column, this.getObjectStrategy());
} | [
"public",
"GenericColumnSerializer",
"getSerializer",
"(",
"SegmentWriteOutMedium",
"segmentWriteOutMedium",
",",
"String",
"column",
")",
"{",
"return",
"ComplexColumnSerializer",
".",
"create",
"(",
"segmentWriteOutMedium",
",",
"column",
",",
"this",
".",
"getObjectStr... | This method provides the ability for a ComplexMetricSerde to control its own serialization.
For large column (i.e columns greater than {@link Integer#MAX_VALUE}) use
{@link LargeColumnSupportedComplexColumnSerializer}
@return an instance of GenericColumnSerializer used for serialization. | [
"This",
"method",
"provides",
"the",
"ability",
"for",
"a",
"ComplexMetricSerde",
"to",
"control",
"its",
"own",
"serialization",
".",
"For",
"large",
"column",
"(",
"i",
".",
"e",
"columns",
"greater",
"than",
"{",
"@link",
"Integer#MAX_VALUE",
"}",
")",
"u... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/segment/serde/ComplexMetricSerde.java#L120-L123 |
jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java | Ghprb.checkSkipBuildInString | private String checkSkipBuildInString(Map<Pattern, String> patterns, String string) {
"""
Checks for skip pattern in the passed string
@param patterns The map of Patter to String values
@param string The string we're looking for the phrase in
@return the skip value or null if we don't find it
"""
... | java | private String checkSkipBuildInString(Map<Pattern, String> patterns, String string) {
// check for skip build phrase in the passed string
if (!patterns.isEmpty() && StringUtils.isNotBlank(string)) {
for (Map.Entry<Pattern, String> e : patterns.entrySet()) {
if (e.getKey().mat... | [
"private",
"String",
"checkSkipBuildInString",
"(",
"Map",
"<",
"Pattern",
",",
"String",
">",
"patterns",
",",
"String",
"string",
")",
"{",
"// check for skip build phrase in the passed string",
"if",
"(",
"!",
"patterns",
".",
"isEmpty",
"(",
")",
"&&",
"String... | Checks for skip pattern in the passed string
@param patterns The map of Patter to String values
@param string The string we're looking for the phrase in
@return the skip value or null if we don't find it | [
"Checks",
"for",
"skip",
"pattern",
"in",
"the",
"passed",
"string"
] | train | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java#L184-L194 |
m-m-m/util | collection/src/main/java/net/sf/mmm/util/collection/impl/CollectionFactoryManagerImpl.java | CollectionFactoryManagerImpl.registerMapFactory | protected <MAP extends Map> MapFactory registerMapFactory(MapFactory<? extends MAP> factory, Class<MAP> mapInterface) {
"""
This method registers the given {@code factory} for the given {@code mapInterface}.
@param <MAP> is the generic type of the {@code mapInterface}.
@param factory is the {@link MapFactory} ... | java | protected <MAP extends Map> MapFactory registerMapFactory(MapFactory<? extends MAP> factory, Class<MAP> mapInterface) {
return this.mapFactoryMap.put(mapInterface, factory);
} | [
"protected",
"<",
"MAP",
"extends",
"Map",
">",
"MapFactory",
"registerMapFactory",
"(",
"MapFactory",
"<",
"?",
"extends",
"MAP",
">",
"factory",
",",
"Class",
"<",
"MAP",
">",
"mapInterface",
")",
"{",
"return",
"this",
".",
"mapFactoryMap",
".",
"put",
... | This method registers the given {@code factory} for the given {@code mapInterface}.
@param <MAP> is the generic type of the {@code mapInterface}.
@param factory is the {@link MapFactory} to register.
@param mapInterface is the interface of the associated {@link Map}. It has to be
{@link Class#isAssignableFrom(Class) a... | [
"This",
"method",
"registers",
"the",
"given",
"{",
"@code",
"factory",
"}",
"for",
"the",
"given",
"{",
"@code",
"mapInterface",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/collection/src/main/java/net/sf/mmm/util/collection/impl/CollectionFactoryManagerImpl.java#L147-L150 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/linear/NewGLMNET.java | NewGLMNET.getM_Bar_for_w0 | private double getM_Bar_for_w0(int n, int l, List<Vec> columnsOfX, double[] col_neg_class_sum, double col_neg_class_sum_bias) {
"""
When we perform a warm start, we want to train to the same point that we
would have if we had not done a warm start. But our stopping point is
based on the initial relative error. T... | java | private double getM_Bar_for_w0(int n, int l, List<Vec> columnsOfX, double[] col_neg_class_sum, double col_neg_class_sum_bias)
{
/**
* if w=0, then D_part[i] = 0.5 for all i
*/
final double D_part_i = 0.5;
//algo 3, Step 1.
double M_bar = 0;
... | [
"private",
"double",
"getM_Bar_for_w0",
"(",
"int",
"n",
",",
"int",
"l",
",",
"List",
"<",
"Vec",
">",
"columnsOfX",
",",
"double",
"[",
"]",
"col_neg_class_sum",
",",
"double",
"col_neg_class_sum_bias",
")",
"{",
"/**\n * if w=0, then D_part[i] = 0.5 for a... | When we perform a warm start, we want to train to the same point that we
would have if we had not done a warm start. But our stopping point is
based on the initial relative error. To get around that, this method
computes what the error would have been for the zero weight vector
@param n
@param l
@param columnsOfX
@para... | [
"When",
"we",
"perform",
"a",
"warm",
"start",
"we",
"want",
"to",
"train",
"to",
"the",
"same",
"point",
"that",
"we",
"would",
"have",
"if",
"we",
"had",
"not",
"done",
"a",
"warm",
"start",
".",
"But",
"our",
"stopping",
"point",
"is",
"based",
"o... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/NewGLMNET.java#L856-L899 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java | TasksImpl.updateAsync | public Observable<Void> updateAsync(String jobId, String taskId, TaskConstraints constraints, TaskUpdateOptions taskUpdateOptions) {
"""
Updates the properties of the specified task.
@param jobId The ID of the job containing the task.
@param taskId The ID of the task to update.
@param constraints Constraints ... | java | public Observable<Void> updateAsync(String jobId, String taskId, TaskConstraints constraints, TaskUpdateOptions taskUpdateOptions) {
return updateWithServiceResponseAsync(jobId, taskId, constraints, taskUpdateOptions).map(new Func1<ServiceResponseWithHeaders<Void, TaskUpdateHeaders>, Void>() {
@Over... | [
"public",
"Observable",
"<",
"Void",
">",
"updateAsync",
"(",
"String",
"jobId",
",",
"String",
"taskId",
",",
"TaskConstraints",
"constraints",
",",
"TaskUpdateOptions",
"taskUpdateOptions",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"jobId",
",",
"... | Updates the properties of the specified task.
@param jobId The ID of the job containing the task.
@param taskId The ID of the task to update.
@param constraints Constraints that apply to this task. If omitted, the task is given the default constraints. For multi-instance tasks, updating the retention time applies only... | [
"Updates",
"the",
"properties",
"of",
"the",
"specified",
"task",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java#L1511-L1518 |
crowmagnumb/s6-util | src/main/java/net/crowmagnumb/util/OsUtils.java | OsUtils.executeToFile | public static int executeToFile( final String[] command,
final File file,
final OutputStream stderr )
throws
IOException,
InterruptedException {
"""
Executes the given command, redirect... | java | public static int executeToFile( final String[] command,
final File file,
final OutputStream stderr )
throws
IOException,
InterruptedException
{
return executeToStreams( command,... | [
"public",
"static",
"int",
"executeToFile",
"(",
"final",
"String",
"[",
"]",
"command",
",",
"final",
"File",
"file",
",",
"final",
"OutputStream",
"stderr",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
"executeToStreams",
"(",
"com... | Executes the given command, redirecting stdout to the given file
and stderr to the given stream
@param command array of commands to run
@param file file to write stdout
@param stderr output stream for stderr
@return error code from system
@throws java.io.IOException if problems
@throws java.lang.InterruptedException i... | [
"Executes",
"the",
"given",
"command",
"redirecting",
"stdout",
"to",
"the",
"given",
"file",
"and",
"stderr",
"to",
"the",
"given",
"stream"
] | train | https://github.com/crowmagnumb/s6-util/blob/0f9969bc0809e8a617501fa57c135e9b3984fae0/src/main/java/net/crowmagnumb/util/OsUtils.java#L441-L449 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/util/Util.java | Util.copyData | public static int copyData(InputStream in, OutputStream out, int limit, int bufSize) throws IOException {
"""
Copies up to {@code limit} bytes of data from {@code in} to {@code out}.
<p>
May copy less than {@code limit} bytes if {@code in} does not have that much data available.
</p> <p>
Allocates a temporary ... | java | public static int copyData(InputStream in, OutputStream out, int limit, int bufSize) throws IOException {
if (bufSize < 1) {
throw new IllegalArgumentException("Invalid buffer size: " + bufSize);
}
byte[] buf = new byte[bufSize];
int total = 0;
while (limit < 0 || t... | [
"public",
"static",
"int",
"copyData",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
",",
"int",
"limit",
",",
"int",
"bufSize",
")",
"throws",
"IOException",
"{",
"if",
"(",
"bufSize",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Copies up to {@code limit} bytes of data from {@code in} to {@code out}.
<p>
May copy less than {@code limit} bytes if {@code in} does not have that much data available.
</p> <p>
Allocates a temporary memory buffer of {@code bufSize} bytes for this.
</p>
@param in
input stream to copy data from.
@param out
output stre... | [
"Copies",
"up",
"to",
"{",
"@code",
"limit",
"}",
"bytes",
"of",
"data",
"from",
"{",
"@code",
"in",
"}",
"to",
"{",
"@code",
"out",
"}",
".",
"<p",
">",
"May",
"copy",
"less",
"than",
"{",
"@code",
"limit",
"}",
"bytes",
"if",
"{",
"@code",
"in"... | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/util/Util.java#L599-L617 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODDynacache.java | HTODDynacache.readCacheIdsByRange | public Result readCacheIdsByRange(int index, int length) {
"""
***********************************************************************
readCacheIdsByRange()
This method is used by CacheMonitor to retrive the cache ids from the disk.
If index = 0, it starts the beginning. If index = 1, it means "next". If Index ... | java | public Result readCacheIdsByRange(int index, int length) {
Result result = readByRange(CACHE_ID_DATA, index, length, CHECK_EXPIRED, FILTER);
return result;
} | [
"public",
"Result",
"readCacheIdsByRange",
"(",
"int",
"index",
",",
"int",
"length",
")",
"{",
"Result",
"result",
"=",
"readByRange",
"(",
"CACHE_ID_DATA",
",",
"index",
",",
"length",
",",
"CHECK_EXPIRED",
",",
"FILTER",
")",
";",
"return",
"result",
";",... | ***********************************************************************
readCacheIdsByRange()
This method is used by CacheMonitor to retrive the cache ids from the disk.
If index = 0, it starts the beginning. If index = 1, it means "next". If Index = -1, it means "previous".
The length of the max number of templates to... | [
"***********************************************************************",
"readCacheIdsByRange",
"()",
"This",
"method",
"is",
"used",
"by",
"CacheMonitor",
"to",
"retrive",
"the",
"cache",
"ids",
"from",
"the",
"disk",
".",
"If",
"index",
"=",
"0",
"it",
"starts",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODDynacache.java#L1374-L1377 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java | Tile.getRight | public Tile getRight() {
"""
Returns the tile to the right of this tile.
@return tile to the right
"""
int x = tileX + 1;
if (x > getMaxTileNumber(this.zoomLevel)) {
x = 0;
}
return new Tile(x, this.tileY, this.zoomLevel, this.tileSize);
} | java | public Tile getRight() {
int x = tileX + 1;
if (x > getMaxTileNumber(this.zoomLevel)) {
x = 0;
}
return new Tile(x, this.tileY, this.zoomLevel, this.tileSize);
} | [
"public",
"Tile",
"getRight",
"(",
")",
"{",
"int",
"x",
"=",
"tileX",
"+",
"1",
";",
"if",
"(",
"x",
">",
"getMaxTileNumber",
"(",
"this",
".",
"zoomLevel",
")",
")",
"{",
"x",
"=",
"0",
";",
"}",
"return",
"new",
"Tile",
"(",
"x",
",",
"this"... | Returns the tile to the right of this tile.
@return tile to the right | [
"Returns",
"the",
"tile",
"to",
"the",
"right",
"of",
"this",
"tile",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L254-L260 |
Grasia/phatsim | phat-audio/src/main/java/phat/audio/AudioFactory.java | AudioFactory.makeAudioSpeakerSource | public AudioSpeakerSource makeAudioSpeakerSource(String nodeName, String textToSpeech, Vector3f location) {
"""
/*public AudioSource makeAudioSource(String name, String resource, Vector3f location) {
AudioNode audioNode = new AudioNode(assetManager, resource);
audioNode.setChannel(0);
audioNode.setPositional(tr... | java | public AudioSpeakerSource makeAudioSpeakerSource(String nodeName, String textToSpeech, Vector3f location) {
AudioSpeakerSource audioNode = createAudioSpeakingNode(textToSpeech);
audioNode.setPositional(true);
audioNode.setDirectional(false);
/*
audioNode.setInnerA... | [
"public",
"AudioSpeakerSource",
"makeAudioSpeakerSource",
"(",
"String",
"nodeName",
",",
"String",
"textToSpeech",
",",
"Vector3f",
"location",
")",
"{",
"AudioSpeakerSource",
"audioNode",
"=",
"createAudioSpeakingNode",
"(",
"textToSpeech",
")",
";",
"audioNode",
".",... | /*public AudioSource makeAudioSource(String name, String resource, Vector3f location) {
AudioNode audioNode = new AudioNode(assetManager, resource);
audioNode.setChannel(0);
audioNode.setPositional(true);
audioNode.setName(name);
audioNode.setLooping(true);
audioNode.setLocalTranslation(location);
audioNode.setVolume(0... | [
"/",
"*",
"public",
"AudioSource",
"makeAudioSource",
"(",
"String",
"name",
"String",
"resource",
"Vector3f",
"location",
")",
"{",
"AudioNode",
"audioNode",
"=",
"new",
"AudioNode",
"(",
"assetManager",
"resource",
")",
";",
"audioNode",
".",
"setChannel",
"("... | train | https://github.com/Grasia/phatsim/blob/2d4fc8189be9730b34c8e3e1a08fb4800e01c5df/phat-audio/src/main/java/phat/audio/AudioFactory.java#L109-L124 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.falsePositiveRate | public double falsePositiveRate(int classLabel, double edgeCase) {
"""
Returns the false positive rate for a given label
@param classLabel the label
@param edgeCase What to output in case of 0/0
@return fpr as a double
"""
double fpCount = falsePositives.getCount(classLabel);
double tnCo... | java | public double falsePositiveRate(int classLabel, double edgeCase) {
double fpCount = falsePositives.getCount(classLabel);
double tnCount = trueNegatives.getCount(classLabel);
return EvaluationUtils.falsePositiveRate((long) fpCount, (long) tnCount, edgeCase);
} | [
"public",
"double",
"falsePositiveRate",
"(",
"int",
"classLabel",
",",
"double",
"edgeCase",
")",
"{",
"double",
"fpCount",
"=",
"falsePositives",
".",
"getCount",
"(",
"classLabel",
")",
";",
"double",
"tnCount",
"=",
"trueNegatives",
".",
"getCount",
"(",
"... | Returns the false positive rate for a given label
@param classLabel the label
@param edgeCase What to output in case of 0/0
@return fpr as a double | [
"Returns",
"the",
"false",
"positive",
"rate",
"for",
"a",
"given",
"label"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L1048-L1053 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java | ConfigUtils.inetSocketAddress | public static InetSocketAddress inetSocketAddress(AbstractConfig config, String key) {
"""
Method is used to return an InetSocketAddress from a hostname:port string.
@param config config to read the value from
@param key key for the value
@return InetSocketAddress for the supplied string.
"""
Preco... | java | public static InetSocketAddress inetSocketAddress(AbstractConfig config, String key) {
Preconditions.checkNotNull(config, "config cannot be null");
String value = config.getString(key);
return parseInetSocketAddress(value);
} | [
"public",
"static",
"InetSocketAddress",
"inetSocketAddress",
"(",
"AbstractConfig",
"config",
",",
"String",
"key",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"config",
",",
"\"config cannot be null\"",
")",
";",
"String",
"value",
"=",
"config",
".",
"... | Method is used to return an InetSocketAddress from a hostname:port string.
@param config config to read the value from
@param key key for the value
@return InetSocketAddress for the supplied string. | [
"Method",
"is",
"used",
"to",
"return",
"an",
"InetSocketAddress",
"from",
"a",
"hostname",
":",
"port",
"string",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java#L116-L120 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/MapBindTransformation.java | MapBindTransformation.generateSerializeOnJackson | @Override
public void generateSerializeOnJackson(BindTypeContext context, MethodSpec.Builder methodBuilder, String serializerName, TypeName beanClass, String beanName, BindProperty property) {
"""
/* (non-Javadoc)
@see com.abubusoft.kripton.processor.bind.transform.BindTransform#generateSerializeOnJackson(com.ab... | java | @Override
public void generateSerializeOnJackson(BindTypeContext context, MethodSpec.Builder methodBuilder, String serializerName, TypeName beanClass, String beanName, BindProperty property) {
this.generateSerializeOnJacksonInternal(context, methodBuilder, serializerName, beanClass, beanName, property, false);
} | [
"@",
"Override",
"public",
"void",
"generateSerializeOnJackson",
"(",
"BindTypeContext",
"context",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"String",
"serializerName",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"BindProperty",
"prop... | /* (non-Javadoc)
@see com.abubusoft.kripton.processor.bind.transform.BindTransform#generateSerializeOnJackson(com.abubusoft.kripton.processor.bind.BindTypeContext, com.squareup.javapoet.MethodSpec.Builder, java.lang.String, com.squareup.javapoet.TypeName, java.lang.String, com.abubusoft.kripton.processor.bind.model.Bin... | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/MapBindTransformation.java#L241-L244 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java | MessageFormat.setFormatByArgumentName | public void setFormatByArgumentName(String argumentName, Format newFormat) {
"""
<strong>[icu]</strong> Sets the Format object to use for the format elements within the
previously set pattern string that use the given argument
name.
<p>
If the argument name is used for more than one format element
in the patt... | java | public void setFormatByArgumentName(String argumentName, Format newFormat) {
int argNumber = MessagePattern.validateArgumentName(argumentName);
if (argNumber < MessagePattern.ARG_NAME_NOT_NUMBER) {
return;
}
for (int partIndex = 0; (partIndex = nextTopLevelArgStart(partIndex)... | [
"public",
"void",
"setFormatByArgumentName",
"(",
"String",
"argumentName",
",",
"Format",
"newFormat",
")",
"{",
"int",
"argNumber",
"=",
"MessagePattern",
".",
"validateArgumentName",
"(",
"argumentName",
")",
";",
"if",
"(",
"argNumber",
"<",
"MessagePattern",
... | <strong>[icu]</strong> Sets the Format object to use for the format elements within the
previously set pattern string that use the given argument
name.
<p>
If the argument name is used for more than one format element
in the pattern string, then the new format is used for all such
format elements. If the argument name ... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Sets",
"the",
"Format",
"object",
"to",
"use",
"for",
"the",
"format",
"elements",
"within",
"the",
"previously",
"set",
"pattern",
"string",
"that",
"use",
"the",
"given",
"argument",
"name",
".... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java#L707-L717 |
spring-projects/spring-retry | src/main/java/org/springframework/retry/support/RetryTemplateBuilder.java | RetryTemplateBuilder.exponentialBackoff | public RetryTemplateBuilder exponentialBackoff(long initialInterval,
double multiplier, long maxInterval) {
"""
Use exponential backoff policy. The formula of backoff period:
<p>
{@code currentInterval = Math.min(initialInterval * Math.pow(multiplier, retryNum), maxInterval)}
<p>
(for first attempt retryNum... | java | public RetryTemplateBuilder exponentialBackoff(long initialInterval,
double multiplier, long maxInterval) {
return exponentialBackoff(initialInterval, multiplier, maxInterval, false);
} | [
"public",
"RetryTemplateBuilder",
"exponentialBackoff",
"(",
"long",
"initialInterval",
",",
"double",
"multiplier",
",",
"long",
"maxInterval",
")",
"{",
"return",
"exponentialBackoff",
"(",
"initialInterval",
",",
"multiplier",
",",
"maxInterval",
",",
"false",
")",... | Use exponential backoff policy. The formula of backoff period:
<p>
{@code currentInterval = Math.min(initialInterval * Math.pow(multiplier, retryNum), maxInterval)}
<p>
(for first attempt retryNum = 0)
@param initialInterval in milliseconds
@param multiplier see the formula above
@param maxInterval in milliseconds
@ret... | [
"Use",
"exponential",
"backoff",
"policy",
".",
"The",
"formula",
"of",
"backoff",
"period",
":",
"<p",
">",
"{"
] | train | https://github.com/spring-projects/spring-retry/blob/e2b0555f96594c2321990d0deeac45fc44d4f123/src/main/java/org/springframework/retry/support/RetryTemplateBuilder.java#L182-L185 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/service/utils/ServiceUtils.java | ServiceUtils.checkArgument | public static void checkArgument(boolean condition, String errorMessage) {
"""
Ensures the truth of an condition involving one or more parameters to the calling method.
@param condition a boolean expression
@param errorMessage The exception message use if the input condition is not valid
@throws com.netflix.c... | java | public static void checkArgument(boolean condition, String errorMessage){
if(!condition) {
throw new ApplicationException(ApplicationException.Code.INVALID_INPUT, errorMessage);
}
} | [
"public",
"static",
"void",
"checkArgument",
"(",
"boolean",
"condition",
",",
"String",
"errorMessage",
")",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"ApplicationException",
".",
"Code",
".",
"INVALID_INPUT",
",",... | Ensures the truth of an condition involving one or more parameters to the calling method.
@param condition a boolean expression
@param errorMessage The exception message use if the input condition is not valid
@throws com.netflix.conductor.core.execution.ApplicationException if input condition is not valid | [
"Ensures",
"the",
"truth",
"of",
"an",
"condition",
"involving",
"one",
"or",
"more",
"parameters",
"to",
"the",
"calling",
"method",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/service/utils/ServiceUtils.java#L50-L54 |
umano/AndroidSlidingUpPanel | library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java | ViewDragHelper.dispatchViewReleased | private void dispatchViewReleased(float xvel, float yvel) {
"""
Like all callback events this must happen on the UI thread, but release
involves some extra semantics. During a release (mReleaseInProgress)
is the only time it is valid to call {@link #settleCapturedViewAt(int, int)}
or {@link #flingCapturedView(i... | java | private void dispatchViewReleased(float xvel, float yvel) {
mReleaseInProgress = true;
mCallback.onViewReleased(mCapturedView, xvel, yvel);
mReleaseInProgress = false;
if (mDragState == STATE_DRAGGING) {
// onViewReleased didn't call a method that would have changed this. Go... | [
"private",
"void",
"dispatchViewReleased",
"(",
"float",
"xvel",
",",
"float",
"yvel",
")",
"{",
"mReleaseInProgress",
"=",
"true",
";",
"mCallback",
".",
"onViewReleased",
"(",
"mCapturedView",
",",
"xvel",
",",
"yvel",
")",
";",
"mReleaseInProgress",
"=",
"f... | Like all callback events this must happen on the UI thread, but release
involves some extra semantics. During a release (mReleaseInProgress)
is the only time it is valid to call {@link #settleCapturedViewAt(int, int)}
or {@link #flingCapturedView(int, int, int, int)}. | [
"Like",
"all",
"callback",
"events",
"this",
"must",
"happen",
"on",
"the",
"UI",
"thread",
"but",
"release",
"involves",
"some",
"extra",
"semantics",
".",
"During",
"a",
"release",
"(",
"mReleaseInProgress",
")",
"is",
"the",
"only",
"time",
"it",
"is",
... | train | https://github.com/umano/AndroidSlidingUpPanel/blob/45a460435b07e764138a700328836cafc1ed5c42/library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java#L799-L808 |
apereo/cas | support/cas-server-support-actions/src/main/java/org/apereo/cas/web/flow/GenerateServiceTicketAction.java | GenerateServiceTicketAction.newEvent | private Event newEvent(final String id, final Exception error) {
"""
New event based on the id, which contains an error attribute referring to the exception occurred.
@param id the id
@param error the error
@return the event
"""
return new EventFactorySupport().event(this, id, new LocalAttribut... | java | private Event newEvent(final String id, final Exception error) {
return new EventFactorySupport().event(this, id, new LocalAttributeMap<>("error", error));
} | [
"private",
"Event",
"newEvent",
"(",
"final",
"String",
"id",
",",
"final",
"Exception",
"error",
")",
"{",
"return",
"new",
"EventFactorySupport",
"(",
")",
".",
"event",
"(",
"this",
",",
"id",
",",
"new",
"LocalAttributeMap",
"<>",
"(",
"\"error\"",
","... | New event based on the id, which contains an error attribute referring to the exception occurred.
@param id the id
@param error the error
@return the event | [
"New",
"event",
"based",
"on",
"the",
"id",
"which",
"contains",
"an",
"error",
"attribute",
"referring",
"to",
"the",
"exception",
"occurred",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-actions/src/main/java/org/apereo/cas/web/flow/GenerateServiceTicketAction.java#L129-L131 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/IntHashTable.java | IntHashTable.lookup | public int lookup(Object key, int hash) {
"""
Find either the index of a key's value, or the index of an available space.
@param key The key to whose value you want to find.
@param hash The hash code of this key.
@return Either the index of the key's value, or an index pointing to
unoccupied space.
"""
... | java | public int lookup(Object key, int hash) {
Object node;
int hash1 = hash ^ (hash >>> 15);
int hash2 = (hash ^ (hash << 6)) | 1; //ensure coprimeness
int deleted = -1;
for (int i = hash1 & mask;; i = (i + hash2) & mask) {
node = objs[i];
if (node == key)
... | [
"public",
"int",
"lookup",
"(",
"Object",
"key",
",",
"int",
"hash",
")",
"{",
"Object",
"node",
";",
"int",
"hash1",
"=",
"hash",
"^",
"(",
"hash",
">>>",
"15",
")",
";",
"int",
"hash2",
"=",
"(",
"hash",
"^",
"(",
"hash",
"<<",
"6",
")",
")",... | Find either the index of a key's value, or the index of an available space.
@param key The key to whose value you want to find.
@param hash The hash code of this key.
@return Either the index of the key's value, or an index pointing to
unoccupied space. | [
"Find",
"either",
"the",
"index",
"of",
"a",
"key",
"s",
"value",
"or",
"the",
"index",
"of",
"an",
"available",
"space",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/IntHashTable.java#L89-L103 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java | Configurer.getNodeString | private String getNodeString(String attribute, String... path) {
"""
Get the string from a node.
@param attribute The attribute to get.
@param path The attribute node path.
@return The string found.
@throws LionEngineException If node not found.
"""
final Xml node = getNode(path);
return ... | java | private String getNodeString(String attribute, String... path)
{
final Xml node = getNode(path);
return node.readString(attribute);
} | [
"private",
"String",
"getNodeString",
"(",
"String",
"attribute",
",",
"String",
"...",
"path",
")",
"{",
"final",
"Xml",
"node",
"=",
"getNode",
"(",
"path",
")",
";",
"return",
"node",
".",
"readString",
"(",
"attribute",
")",
";",
"}"
] | Get the string from a node.
@param attribute The attribute to get.
@param path The attribute node path.
@return The string found.
@throws LionEngineException If node not found. | [
"Get",
"the",
"string",
"from",
"a",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java#L492-L496 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/database/DBAccessFactory.java | DBAccessFactory.createDBAccess | public static IDBAccess createDBAccess(DBType dbType, Properties properties) {
"""
create an IDBAccess (an accessor) for a specific database.
@param dbType the type of database to access. Can be
<br/>DBType.REMOTE or DBType.EMBEDDED or DBType.IN_MEMORY
@param properties to configure the database connection.
<b... | java | public static IDBAccess createDBAccess(DBType dbType, Properties properties) {
return createDBAccess(dbType, properties, null, null, null);
} | [
"public",
"static",
"IDBAccess",
"createDBAccess",
"(",
"DBType",
"dbType",
",",
"Properties",
"properties",
")",
"{",
"return",
"createDBAccess",
"(",
"dbType",
",",
"properties",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | create an IDBAccess (an accessor) for a specific database.
@param dbType the type of database to access. Can be
<br/>DBType.REMOTE or DBType.EMBEDDED or DBType.IN_MEMORY
@param properties to configure the database connection.
<br/>The appropriate database access class will pick the properties it needs.
<br/>See also: D... | [
"create",
"an",
"IDBAccess",
"(",
"an",
"accessor",
")",
"for",
"a",
"specific",
"database",
"."
] | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/database/DBAccessFactory.java#L61-L63 |
GerdHolz/TOVAL | src/de/invation/code/toval/os/WindowsUtils.java | WindowsUtils.registerFileExtension | @Override
public boolean registerFileExtension(String fileTypeName, String fileTypeExtension, String application) throws RegistryException, OSException {
"""
Registers a new file extension in the Windows registry.
@param fileTypeName Name of the file extension. Must be atomic, e.g.
<code>foocorp.fooapp.v1<... | java | @Override
public boolean registerFileExtension(String fileTypeName, String fileTypeExtension, String application) throws RegistryException, OSException {
if (!isApplicable()) {
return false;
}
// sanitize file extension
fileTypeExtension = sanitizeFileExtension(fileTypeE... | [
"@",
"Override",
"public",
"boolean",
"registerFileExtension",
"(",
"String",
"fileTypeName",
",",
"String",
"fileTypeExtension",
",",
"String",
"application",
")",
"throws",
"RegistryException",
",",
"OSException",
"{",
"if",
"(",
"!",
"isApplicable",
"(",
")",
"... | Registers a new file extension in the Windows registry.
@param fileTypeName Name of the file extension. Must be atomic, e.g.
<code>foocorp.fooapp.v1</code>.
@param fileTypeExtension File extension with leading dot, e.g.
<code>.bar</code>.
@param application Path to the application, which should open the new
file exten... | [
"Registers",
"a",
"new",
"file",
"extension",
"in",
"the",
"Windows",
"registry",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/os/WindowsUtils.java#L187-L213 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/AbstractQuery.java | AbstractQuery.addChangeListener | @NonNull
@Override
public ListenerToken addChangeListener(Executor executor, @NonNull QueryChangeListener listener) {
"""
Adds a query change listener with the dispatch queue on which changes
will be posted. If the dispatch queue is not specified, the changes will be
posted on the main queue.
@param e... | java | @NonNull
@Override
public ListenerToken addChangeListener(Executor executor, @NonNull QueryChangeListener listener) {
if (listener == null) { throw new IllegalArgumentException("listener cannot be null."); }
return liveQuery().addChangeListener(executor, listener);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"ListenerToken",
"addChangeListener",
"(",
"Executor",
"executor",
",",
"@",
"NonNull",
"QueryChangeListener",
"listener",
")",
"{",
"if",
"(",
"listener",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException... | Adds a query change listener with the dispatch queue on which changes
will be posted. If the dispatch queue is not specified, the changes will be
posted on the main queue.
@param executor The executor object that calls listener. If null, use default executor.
@param listener The listener to post changes.
@return An op... | [
"Adds",
"a",
"query",
"change",
"listener",
"with",
"the",
"dispatch",
"queue",
"on",
"which",
"changes",
"will",
"be",
"posted",
".",
"If",
"the",
"dispatch",
"queue",
"is",
"not",
"specified",
"the",
"changes",
"will",
"be",
"posted",
"on",
"the",
"main"... | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractQuery.java#L185-L190 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/PTSaxton2006.java | PTSaxton2006.getSLBDM | public static String getSLBDM(String[] soilParas) {
"""
For calculating SLBDM
@param soilParas should include 1. Sand weight percentage by layer
([0,100]%), 2. Clay weight percentage by layer ([0,100]%), 3. Organic
matter weight percentage by layer ([0,100]%), (= SLOC * 1.72), 4. Grave
weight percentage by l... | java | public static String getSLBDM(String[] soilParas) {
if (soilParas != null && soilParas.length >= 3) {
if (soilParas.length >= 4) {
return round(calcGravePlusDensity(soilParas[0], soilParas[1], soilParas[2], divide(soilParas[3], "100")), 2);
} else {
return... | [
"public",
"static",
"String",
"getSLBDM",
"(",
"String",
"[",
"]",
"soilParas",
")",
"{",
"if",
"(",
"soilParas",
"!=",
"null",
"&&",
"soilParas",
".",
"length",
">=",
"3",
")",
"{",
"if",
"(",
"soilParas",
".",
"length",
">=",
"4",
")",
"{",
"return... | For calculating SLBDM
@param soilParas should include 1. Sand weight percentage by layer
([0,100]%), 2. Clay weight percentage by layer ([0,100]%), 3. Organic
matter weight percentage by layer ([0,100]%), (= SLOC * 1.72), 4. Grave
weight percentage by layer ([0,100]%)
@return Soil bulk density when moist for layer, g/... | [
"For",
"calculating",
"SLBDM"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/PTSaxton2006.java#L101-L111 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.getSiteAnalysisSlotAsync | public Observable<DiagnosticAnalysisInner> getSiteAnalysisSlotAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot) {
"""
Get Site Analysis.
Get Site Analysis.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param site... | java | public Observable<DiagnosticAnalysisInner> getSiteAnalysisSlotAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot) {
return getSiteAnalysisSlotWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, slot).map(new Func1<Serv... | [
"public",
"Observable",
"<",
"DiagnosticAnalysisInner",
">",
"getSiteAnalysisSlotAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"diagnosticCategory",
",",
"String",
"analysisName",
",",
"String",
"slot",
")",
"{",
"return",
"getS... | Get Site Analysis.
Get Site Analysis.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@param analysisName Analysis Name
@param slot Slot - optional
@throws IllegalArgumentException thrown if parameters fail the v... | [
"Get",
"Site",
"Analysis",
".",
"Get",
"Site",
"Analysis",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L1768-L1775 |
alkacon/opencms-core | src/org/opencms/ade/contenteditor/CmsContentService.java | CmsContentService.getRdfaAttributes | public static String getRdfaAttributes(I_CmsXmlContentValue parentValue, String childNames) {
"""
Returns the RDF annotations required for in line editing.<p>
@param parentValue the parent XML content value
@param childNames the child attribute names separated by '|'
@return the RDFA
"""
String... | java | public static String getRdfaAttributes(I_CmsXmlContentValue parentValue, String childNames) {
String id = CmsContentDefinition.uuidToEntityId(
parentValue.getDocument().getFile().getStructureId(),
parentValue.getLocale().toString()) + "/" + parentValue.getPath();
String path = "... | [
"public",
"static",
"String",
"getRdfaAttributes",
"(",
"I_CmsXmlContentValue",
"parentValue",
",",
"String",
"childNames",
")",
"{",
"String",
"id",
"=",
"CmsContentDefinition",
".",
"uuidToEntityId",
"(",
"parentValue",
".",
"getDocument",
"(",
")",
".",
"getFile"... | Returns the RDF annotations required for in line editing.<p>
@param parentValue the parent XML content value
@param childNames the child attribute names separated by '|'
@return the RDFA | [
"Returns",
"the",
"RDF",
"annotations",
"required",
"for",
"in",
"line",
"editing",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/contenteditor/CmsContentService.java#L327-L347 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/alias/AliasType.java | AliasType.transformKey | private String transformKey(String key, String src, String tgt) {
"""
Uses the source and target wildcard masks to transform an input key.
@param key The input key.
@param src The source wildcard mask.
@param tgt The target wildcard mask.
@return The transformed key.
"""
StringBuilder sb = new St... | java | private String transformKey(String key, String src, String tgt) {
StringBuilder sb = new StringBuilder();
String[] srcTokens = src.split(WILDCARD_DELIM_REGEX);
String[] tgtTokens = tgt.split(WILDCARD_DELIM_REGEX);
int len = Math.max(srcTokens.length, tgtTokens.length);
int pos = ... | [
"private",
"String",
"transformKey",
"(",
"String",
"key",
",",
"String",
"src",
",",
"String",
"tgt",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"[",
"]",
"srcTokens",
"=",
"src",
".",
"split",
"(",
"WILDCARD_... | Uses the source and target wildcard masks to transform an input key.
@param key The input key.
@param src The source wildcard mask.
@param tgt The target wildcard mask.
@return The transformed key. | [
"Uses",
"the",
"source",
"and",
"target",
"wildcard",
"masks",
"to",
"transform",
"an",
"input",
"key",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/alias/AliasType.java#L117-L146 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java | NetUtil.getMacAddress | public static String getMacAddress(InetAddress inetAddress, String separator) {
"""
获得指定地址信息中的MAC地址
@param inetAddress {@link InetAddress}
@param separator 分隔符,推荐使用“-”或者“:”
@return MAC地址,用-分隔
"""
if (null == inetAddress) {
return null;
}
byte[] mac;
try {
mac = NetworkInterface.getBy... | java | public static String getMacAddress(InetAddress inetAddress, String separator) {
if (null == inetAddress) {
return null;
}
byte[] mac;
try {
mac = NetworkInterface.getByInetAddress(inetAddress).getHardwareAddress();
} catch (SocketException e) {
throw new UtilException(e);
}
if (null !... | [
"public",
"static",
"String",
"getMacAddress",
"(",
"InetAddress",
"inetAddress",
",",
"String",
"separator",
")",
"{",
"if",
"(",
"null",
"==",
"inetAddress",
")",
"{",
"return",
"null",
";",
"}",
"byte",
"[",
"]",
"mac",
";",
"try",
"{",
"mac",
"=",
... | 获得指定地址信息中的MAC地址
@param inetAddress {@link InetAddress}
@param separator 分隔符,推荐使用“-”或者“:”
@return MAC地址,用-分隔 | [
"获得指定地址信息中的MAC地址"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java#L432-L457 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.invokeSetter | public static void invokeSetter(Object object, String name, String value) throws NoSuchMethodException, Exception {
"""
Invoke setter method on given object instance. Setter name has format as accepted by
{@link Strings#getMethodAccessor(String, String)} and value string is converted to method parameter type usin... | java | public static void invokeSetter(Object object, String name, String value) throws NoSuchMethodException, Exception
{
String setterName = Strings.getMethodAccessor("set", name);
Class<?> clazz = object.getClass();
Method method = findMethod(clazz, setterName);
Class<?>[] parameterTypes = method.g... | [
"public",
"static",
"void",
"invokeSetter",
"(",
"Object",
"object",
",",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"NoSuchMethodException",
",",
"Exception",
"{",
"String",
"setterName",
"=",
"Strings",
".",
"getMethodAccessor",
"(",
"\"set\"",
"... | Invoke setter method on given object instance. Setter name has format as accepted by
{@link Strings#getMethodAccessor(String, String)} and value string is converted to method parameter type using
{@link Converter} facility. For this reason set parameter type should have a converter registered.
<p>
This method has no me... | [
"Invoke",
"setter",
"method",
"on",
"given",
"object",
"instance",
".",
"Setter",
"name",
"has",
"format",
"as",
"accepted",
"by",
"{",
"@link",
"Strings#getMethodAccessor",
"(",
"String",
"String",
")",
"}",
"and",
"value",
"string",
"is",
"converted",
"to",
... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L425-L437 |
mikepenz/Crossfader | library/src/main/java/com/mikepenz/crossfader/Crossfader.java | Crossfader.withStructure | public Crossfader withStructure(View first, int firstWidth, View second, int secondWidth) {
"""
define the default view and the slided view of the crossfader
@param first
@param firstWidth
@param second
@param secondWidth
@return
"""
withFirst(first, firstWidth);
withSecond(second, secon... | java | public Crossfader withStructure(View first, int firstWidth, View second, int secondWidth) {
withFirst(first, firstWidth);
withSecond(second, secondWidth);
return this;
} | [
"public",
"Crossfader",
"withStructure",
"(",
"View",
"first",
",",
"int",
"firstWidth",
",",
"View",
"second",
",",
"int",
"secondWidth",
")",
"{",
"withFirst",
"(",
"first",
",",
"firstWidth",
")",
";",
"withSecond",
"(",
"second",
",",
"secondWidth",
")",... | define the default view and the slided view of the crossfader
@param first
@param firstWidth
@param second
@param secondWidth
@return | [
"define",
"the",
"default",
"view",
"and",
"the",
"slided",
"view",
"of",
"the",
"crossfader"
] | train | https://github.com/mikepenz/Crossfader/blob/b2e1ee461bc3bcdd897d83f0fad950663bdc73b4/library/src/main/java/com/mikepenz/crossfader/Crossfader.java#L111-L115 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ClassGenericsUtil.java | ClassGenericsUtil.parameterizeOrAbort | @SuppressWarnings("unchecked")
public static <C> C parameterizeOrAbort(Class<?> c, Parameterization config) {
"""
Force parameterization method.
<p>
Please use this only in "runner" classes such as unit tests, since the
error handling is not very flexible.
@param <C> Type
@param c Class to instantiate
@p... | java | @SuppressWarnings("unchecked")
public static <C> C parameterizeOrAbort(Class<?> c, Parameterization config) {
try {
C ret = tryInstantiate((Class<C>) c, c, config);
if(ret == null) {
throw new AbortException("Could not instantiate class. Check parameters.");
}
return ret;
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"C",
">",
"C",
"parameterizeOrAbort",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"Parameterization",
"config",
")",
"{",
"try",
"{",
"C",
"ret",
"=",
"tryInstantiate",
"(",
"(",
"Cl... | Force parameterization method.
<p>
Please use this only in "runner" classes such as unit tests, since the
error handling is not very flexible.
@param <C> Type
@param c Class to instantiate
@param config Parameters
@return Instance or throw an AbortException | [
"Force",
"parameterization",
"method",
".",
"<p",
">",
"Please",
"use",
"this",
"only",
"in",
"runner",
"classes",
"such",
"as",
"unit",
"tests",
"since",
"the",
"error",
"handling",
"is",
"not",
"very",
"flexible",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ClassGenericsUtil.java#L200-L217 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java | OpenShiftManagedClustersInner.beginUpdateTagsAsync | public Observable<OpenShiftManagedClusterInner> beginUpdateTagsAsync(String resourceGroupName, String resourceName) {
"""
Updates tags on an OpenShift managed cluster.
Updates an OpenShift managed cluster with the specified tags.
@param resourceGroupName The name of the resource group.
@param resourceName The... | java | public Observable<OpenShiftManagedClusterInner> beginUpdateTagsAsync(String resourceGroupName, String resourceName) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<OpenShiftManagedClusterInner>, OpenShiftManagedClusterInner>() {
@Overri... | [
"public",
"Observable",
"<",
"OpenShiftManagedClusterInner",
">",
"beginUpdateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".... | Updates tags on an OpenShift managed cluster.
Updates an OpenShift managed cluster with the specified tags.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the OpenShift managed cluster resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | [
"Updates",
"tags",
"on",
"an",
"OpenShift",
"managed",
"cluster",
".",
"Updates",
"an",
"OpenShift",
"managed",
"cluster",
"with",
"the",
"specified",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java#L797-L804 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/FieldCriteria.java | FieldCriteria.buildLessCriteria | static FieldCriteria buildLessCriteria(Object anAttribute, Object aValue, UserAlias anAlias) {
"""
static FieldCriteria buildLessCriteria(Object anAttribute, Object aValue, String anAlias)
"""
return new FieldCriteria(anAttribute, aValue, LESS, anAlias);
} | java | static FieldCriteria buildLessCriteria(Object anAttribute, Object aValue, UserAlias anAlias)
{
return new FieldCriteria(anAttribute, aValue, LESS, anAlias);
} | [
"static",
"FieldCriteria",
"buildLessCriteria",
"(",
"Object",
"anAttribute",
",",
"Object",
"aValue",
",",
"UserAlias",
"anAlias",
")",
"{",
"return",
"new",
"FieldCriteria",
"(",
"anAttribute",
",",
"aValue",
",",
"LESS",
",",
"anAlias",
")",
";",
"}"
] | static FieldCriteria buildLessCriteria(Object anAttribute, Object aValue, String anAlias) | [
"static",
"FieldCriteria",
"buildLessCriteria",
"(",
"Object",
"anAttribute",
"Object",
"aValue",
"String",
"anAlias",
")"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/FieldCriteria.java#L56-L59 |
RallyTools/RallyRestToolkitForJava | src/main/java/com/rallydev/rest/request/CreateRequest.java | CreateRequest.toUrl | @Override
public String toUrl() {
"""
<p>Convert this request into a url compatible with the WSAPI.</p>
The current fetch and any other parameters will be included.
@return the url representing this request.
"""
List<NameValuePair> params = new ArrayList<NameValuePair>(getParams());
pa... | java | @Override
public String toUrl() {
List<NameValuePair> params = new ArrayList<NameValuePair>(getParams());
params.add(new BasicNameValuePair("fetch", getFetch().toString()));
return String.format("/%s/create.js?%s", type.toLowerCase().replaceAll(" ", ""),
URLEncodedUtils.for... | [
"@",
"Override",
"public",
"String",
"toUrl",
"(",
")",
"{",
"List",
"<",
"NameValuePair",
">",
"params",
"=",
"new",
"ArrayList",
"<",
"NameValuePair",
">",
"(",
"getParams",
"(",
")",
")",
";",
"params",
".",
"add",
"(",
"new",
"BasicNameValuePair",
"(... | <p>Convert this request into a url compatible with the WSAPI.</p>
The current fetch and any other parameters will be included.
@return the url representing this request. | [
"<p",
">",
"Convert",
"this",
"request",
"into",
"a",
"url",
"compatible",
"with",
"the",
"WSAPI",
".",
"<",
"/",
"p",
">",
"The",
"current",
"fetch",
"and",
"any",
"other",
"parameters",
"will",
"be",
"included",
"."
] | train | https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/request/CreateRequest.java#L68-L76 |
craftercms/commons | mongo/src/main/java/org/craftercms/commons/mongo/AbstractJongoRepository.java | AbstractJongoRepository.createSortQuery | protected String createSortQuery(final List<DefaultKeyValue<String, Boolean>> fields) {
"""
Creates a Sort query based on the fields.<br/>
Key of the map is the field <b>False=Desc,True=asc</b>
for the field, Respect order of the keys
@param fields Keys are fields, true if asc, false desc
@return Sorted Json... | java | protected String createSortQuery(final List<DefaultKeyValue<String, Boolean>> fields) {
StringBuilder builder = new StringBuilder("{");
Iterator<DefaultKeyValue<String, Boolean>> iter = fields.iterator();
while (iter.hasNext()) {
DefaultKeyValue<String, Boolean> field = iter.next();
... | [
"protected",
"String",
"createSortQuery",
"(",
"final",
"List",
"<",
"DefaultKeyValue",
"<",
"String",
",",
"Boolean",
">",
">",
"fields",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"\"{\"",
")",
";",
"Iterator",
"<",
"DefaultKeyVa... | Creates a Sort query based on the fields.<br/>
Key of the map is the field <b>False=Desc,True=asc</b>
for the field, Respect order of the keys
@param fields Keys are fields, true if asc, false desc
@return Sorted Json string with the query. | [
"Creates",
"a",
"Sort",
"query",
"based",
"on",
"the",
"fields",
".",
"<br",
"/",
">",
"Key",
"of",
"the",
"map",
"is",
"the",
"field",
"<b",
">",
"False",
"=",
"Desc",
"True",
"=",
"asc<",
"/",
"b",
">",
"for",
"the",
"field",
"Respect",
"order",
... | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/mongo/src/main/java/org/craftercms/commons/mongo/AbstractJongoRepository.java#L583-L603 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.api_credential_credentialId_application_GET | public OvhApplication api_credential_credentialId_application_GET(Long credentialId) throws IOException {
"""
Get this object properties
REST: GET /me/api/credential/{credentialId}/application
@param credentialId [required]
"""
String qPath = "/me/api/credential/{credentialId}/application";
StringBuild... | java | public OvhApplication api_credential_credentialId_application_GET(Long credentialId) throws IOException {
String qPath = "/me/api/credential/{credentialId}/application";
StringBuilder sb = path(qPath, credentialId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhApplication.cla... | [
"public",
"OvhApplication",
"api_credential_credentialId_application_GET",
"(",
"Long",
"credentialId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/api/credential/{credentialId}/application\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
","... | Get this object properties
REST: GET /me/api/credential/{credentialId}/application
@param credentialId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L500-L505 |
igniterealtime/Smack | smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java | AgentSession.setStatus | public void setStatus(Presence.Mode presenceMode, int maxChats, String status)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Sets the agent's current status with the workgroup. The presence mode affects how offers
are routed to the agent. The... | java | public void setStatus(Presence.Mode presenceMode, int maxChats, String status)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
if (!online) {
throw new IllegalStateException("Cannot set status when the agent is not online.");
... | [
"public",
"void",
"setStatus",
"(",
"Presence",
".",
"Mode",
"presenceMode",
",",
"int",
"maxChats",
",",
"String",
"status",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"if",
"(",
... | Sets the agent's current status with the workgroup. The presence mode affects how offers
are routed to the agent. The possible presence modes with their meanings are as follows:<ul>
<li>Presence.Mode.AVAILABLE -- (Default) the agent is available for more chats
(equivalent to Presence.Mode.CHAT).
<li>Presence.Mode.DO_N... | [
"Sets",
"the",
"agent",
"s",
"current",
"status",
"with",
"the",
"workgroup",
".",
"The",
"presence",
"mode",
"affects",
"how",
"offers",
"are",
"routed",
"to",
"the",
"agent",
".",
"The",
"possible",
"presence",
"modes",
"with",
"their",
"meanings",
"are",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java#L418-L450 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMessageFactoryImpl.java | JsMessageFactoryImpl.ensureSchemasAvailable | private final static int ensureSchemasAvailable(byte[] buffer, int offset, Object store) throws MessageRestoreFailedException {
"""
Utility method to extract the schema ids from a message buffer and, if a
message store is supplied, check that all the necessary schemas are available.
@param buffer The buffer c... | java | private final static int ensureSchemasAvailable(byte[] buffer, int offset, Object store) throws MessageRestoreFailedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "ensureSchemasAvailable", new Object[] {offset, store});
// If we have a message store we need to ensu... | [
"private",
"final",
"static",
"int",
"ensureSchemasAvailable",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"Object",
"store",
")",
"throws",
"MessageRestoreFailedException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
... | Utility method to extract the schema ids from a message buffer and, if a
message store is supplied, check that all the necessary schemas are available.
@param buffer The buffer containing the schema ids
@param offset The offset into the buffer where the schema ids start
@param store The MesasgeStore from which the... | [
"Utility",
"method",
"to",
"extract",
"the",
"schema",
"ids",
"from",
"a",
"message",
"buffer",
"and",
"if",
"a",
"message",
"store",
"is",
"supplied",
"check",
"that",
"all",
"the",
"necessary",
"schemas",
"are",
"available",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMessageFactoryImpl.java#L563-L582 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/json/JsonArray.java | JsonArray.set | public JsonArray set(int index, JsonValue value) {
"""
Replaces the element at the specified position in this array with the specified JSON value.
@param index
the index of the array element to replace
@param value
the value to be stored at the specified array position, must not be <code>null</code>
@return... | java | public JsonArray set(int index, JsonValue value) {
if (value == null) {
throw new NullPointerException("value is null");
}
values.set(index, value);
return this;
} | [
"public",
"JsonArray",
"set",
"(",
"int",
"index",
",",
"JsonValue",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"value is null\"",
")",
";",
"}",
"values",
".",
"set",
"(",
"index",
",",
... | Replaces the element at the specified position in this array with the specified JSON value.
@param index
the index of the array element to replace
@param value
the value to be stored at the specified array position, must not be <code>null</code>
@return the array itself, to enable method chaining
@throws IndexOutOfBou... | [
"Replaces",
"the",
"element",
"at",
"the",
"specified",
"position",
"in",
"this",
"array",
"with",
"the",
"specified",
"JSON",
"value",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/JsonArray.java#L366-L372 |
selenide/selenide | src/main/java/com/codeborne/selenide/impl/DownloadFileWithHttpRequest.java | DownloadFileWithHttpRequest.createTrustingHttpClient | protected CloseableHttpClient createTrustingHttpClient() throws IOException {
"""
configure HttpClient to ignore self-signed certs
as described here: http://literatejava.com/networks/ignore-ssl-certificate-errors-apache-httpclient-4-4/
"""
try {
HttpClientBuilder builder = HttpClientBuilder.create()... | java | protected CloseableHttpClient createTrustingHttpClient() throws IOException {
try {
HttpClientBuilder builder = HttpClientBuilder.create();
SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustAllStrategy()).build();
builder.setSSLContext(sslContext);
HostnameVer... | [
"protected",
"CloseableHttpClient",
"createTrustingHttpClient",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"HttpClientBuilder",
"builder",
"=",
"HttpClientBuilder",
".",
"create",
"(",
")",
";",
"SSLContext",
"sslContext",
"=",
"new",
"SSLContextBuilder",
"("... | configure HttpClient to ignore self-signed certs
as described here: http://literatejava.com/networks/ignore-ssl-certificate-errors-apache-httpclient-4-4/ | [
"configure",
"HttpClient",
"to",
"ignore",
"self",
"-",
"signed",
"certs",
"as",
"described",
"here",
":",
"http",
":",
"//",
"literatejava",
".",
"com",
"/",
"networks",
"/",
"ignore",
"-",
"ssl",
"-",
"certificate",
"-",
"errors",
"-",
"apache",
"-",
"... | train | https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/impl/DownloadFileWithHttpRequest.java#L132-L153 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/api/Table.java | Table.doWithRowPairs | public void doWithRowPairs(Consumer<RowPair> pairConsumer) {
"""
Applies the function in {@code pairConsumer} to each consecutive pairs of rows in the table
"""
if (isEmpty()) {
return;
}
Row row1 = new Row(this);
Row row2 = new Row(this);
RowPair pair = new ... | java | public void doWithRowPairs(Consumer<RowPair> pairConsumer) {
if (isEmpty()) {
return;
}
Row row1 = new Row(this);
Row row2 = new Row(this);
RowPair pair = new RowPair(row1, row2);
int max = rowCount();
for (int i = 1; i < max; i++) {
row1.a... | [
"public",
"void",
"doWithRowPairs",
"(",
"Consumer",
"<",
"RowPair",
">",
"pairConsumer",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"Row",
"row1",
"=",
"new",
"Row",
"(",
"this",
")",
";",
"Row",
"row2",
"=",
"new",
"R... | Applies the function in {@code pairConsumer} to each consecutive pairs of rows in the table | [
"Applies",
"the",
"function",
"in",
"{"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/api/Table.java#L1065-L1078 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java | ImmatureClass.sawOpcode | @Override
public void sawOpcode(int seen) {
"""
implements the visitor to check for calls to Throwable.printStackTrace()
@param seen the currently parsed opcode
"""
if ((seen == Const.INVOKEVIRTUAL) && "printStackTrace".equals(getNameConstantOperand())
&& SignatureBuilder.SIG_VOID_TO_VOID.equal... | java | @Override
public void sawOpcode(int seen) {
if ((seen == Const.INVOKEVIRTUAL) && "printStackTrace".equals(getNameConstantOperand())
&& SignatureBuilder.SIG_VOID_TO_VOID.equals(getSigConstantOperand())) {
bugReporter
.reportBug(new BugInstance(this, BugType.IMC_IMMATURE_CLASS_PRINTSTACKTRACE.name(),... | [
"@",
"Override",
"public",
"void",
"sawOpcode",
"(",
"int",
"seen",
")",
"{",
"if",
"(",
"(",
"seen",
"==",
"Const",
".",
"INVOKEVIRTUAL",
")",
"&&",
"\"printStackTrace\"",
".",
"equals",
"(",
"getNameConstantOperand",
"(",
")",
")",
"&&",
"SignatureBuilder"... | implements the visitor to check for calls to Throwable.printStackTrace()
@param seen the currently parsed opcode | [
"implements",
"the",
"visitor",
"to",
"check",
"for",
"calls",
"to",
"Throwable",
".",
"printStackTrace",
"()"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java#L253-L261 |
dita-ot/dita-ot | src/main/java/org/dita/dost/ProcessorFactory.java | ProcessorFactory.newProcessor | public Processor newProcessor(final String transtype) {
"""
Create new Processor to run DITA-OT
@param transtype transtype for the processor
@return new Processor instance
"""
if (ditaDir == null) {
throw new IllegalStateException();
}
if (!Configuration.transtypes.conta... | java | public Processor newProcessor(final String transtype) {
if (ditaDir == null) {
throw new IllegalStateException();
}
if (!Configuration.transtypes.contains(transtype)) {
throw new IllegalArgumentException("Transtype " + transtype + " not supported");
}
retu... | [
"public",
"Processor",
"newProcessor",
"(",
"final",
"String",
"transtype",
")",
"{",
"if",
"(",
"ditaDir",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"}",
"if",
"(",
"!",
"Configuration",
".",
"transtypes",
".",
"conta... | Create new Processor to run DITA-OT
@param transtype transtype for the processor
@return new Processor instance | [
"Create",
"new",
"Processor",
"to",
"run",
"DITA",
"-",
"OT"
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/ProcessorFactory.java#L53-L61 |
fcrepo3/fcrepo | fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/objecteditor/DatastreamsPane.java | DatastreamsPane.doNew | public void doNew(String[] dropdownMimeTypes, boolean makeSelected) {
"""
Set the content of the "New..." JPanel to a fresh new datastream entry
panel, and switch to it, if needed.
"""
int i = getTabIndex("New...");
m_tabbedPane
.setComponentAt(i, new NewDatastreamPane(dropdow... | java | public void doNew(String[] dropdownMimeTypes, boolean makeSelected) {
int i = getTabIndex("New...");
m_tabbedPane
.setComponentAt(i, new NewDatastreamPane(dropdownMimeTypes));
i = getTabIndex("New...");
m_tabbedPane.setToolTipTextAt(i, "Add a new datastream to this objec... | [
"public",
"void",
"doNew",
"(",
"String",
"[",
"]",
"dropdownMimeTypes",
",",
"boolean",
"makeSelected",
")",
"{",
"int",
"i",
"=",
"getTabIndex",
"(",
"\"New...\"",
")",
";",
"m_tabbedPane",
".",
"setComponentAt",
"(",
"i",
",",
"new",
"NewDatastreamPane",
... | Set the content of the "New..." JPanel to a fresh new datastream entry
panel, and switch to it, if needed. | [
"Set",
"the",
"content",
"of",
"the",
"New",
"...",
"JPanel",
"to",
"a",
"fresh",
"new",
"datastream",
"entry",
"panel",
"and",
"switch",
"to",
"it",
"if",
"needed",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/objecteditor/DatastreamsPane.java#L158-L170 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/ActionConfig.java | ActionConfig.imports | public static ActionConfig imports(Xml root) {
"""
Import the action data from node.
@param root The root node reference (must not be <code>null</code>).
@return The action data.
@throws LionEngineException If unable to read node.
"""
Check.notNull(root);
final Xml nodeAction = root.ge... | java | public static ActionConfig imports(Xml root)
{
Check.notNull(root);
final Xml nodeAction = root.getChild(NODE_ACTION);
final String name = nodeAction.readString(ATT_NAME);
final String description = nodeAction.readString(ATT_DESCRIPTION);
final int x = nodeAction.read... | [
"public",
"static",
"ActionConfig",
"imports",
"(",
"Xml",
"root",
")",
"{",
"Check",
".",
"notNull",
"(",
"root",
")",
";",
"final",
"Xml",
"nodeAction",
"=",
"root",
".",
"getChild",
"(",
"NODE_ACTION",
")",
";",
"final",
"String",
"name",
"=",
"nodeAc... | Import the action data from node.
@param root The root node reference (must not be <code>null</code>).
@return The action data.
@throws LionEngineException If unable to read node. | [
"Import",
"the",
"action",
"data",
"from",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/ActionConfig.java#L71-L84 |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/SolutionUtils.java | SolutionUtils.distanceBetweenSolutionsInObjectiveSpace | public static double distanceBetweenSolutionsInObjectiveSpace(DoubleSolution solutionI, DoubleSolution solutionJ) {
"""
Returns the distance between two solutions in the search space.
@param solutionI The first <code>Solution</code>.
@param solutionJ The second <code>Solution</code>.
@return the distance betw... | java | public static double distanceBetweenSolutionsInObjectiveSpace(DoubleSolution solutionI, DoubleSolution solutionJ) {
double distance = 0.0;
double diff;
for (int i = 0; i < solutionI.getNumberOfVariables(); i++) {
diff = solutionI.getVariableValue(i) - solutionJ.getVariableValue(i);
distance += ... | [
"public",
"static",
"double",
"distanceBetweenSolutionsInObjectiveSpace",
"(",
"DoubleSolution",
"solutionI",
",",
"DoubleSolution",
"solutionJ",
")",
"{",
"double",
"distance",
"=",
"0.0",
";",
"double",
"diff",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Returns the distance between two solutions in the search space.
@param solutionI The first <code>Solution</code>.
@param solutionJ The second <code>Solution</code>.
@return the distance between solutions. | [
"Returns",
"the",
"distance",
"between",
"two",
"solutions",
"in",
"the",
"search",
"space",
"."
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/SolutionUtils.java#L117-L127 |
haifengl/smile | math/src/main/java/smile/math/Math.java | Math.KullbackLeiblerDivergence | public static double KullbackLeiblerDivergence(SparseArray x, double[] y) {
"""
Kullback-Leibler divergence. The Kullback-Leibler divergence (also
information divergence, information gain, relative entropy, or KLIC)
is a non-symmetric measure of the difference between two probability
distributions P and Q. KL m... | java | public static double KullbackLeiblerDivergence(SparseArray x, double[] y) {
if (x.isEmpty()) {
throw new IllegalArgumentException("List x is empty.");
}
Iterator<SparseArray.Entry> iter = x.iterator();
boolean intersection = false;
double kl = 0.0;
while (it... | [
"public",
"static",
"double",
"KullbackLeiblerDivergence",
"(",
"SparseArray",
"x",
",",
"double",
"[",
"]",
"y",
")",
"{",
"if",
"(",
"x",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"List x is empty.\"",
")",
";",... | Kullback-Leibler divergence. The Kullback-Leibler divergence (also
information divergence, information gain, relative entropy, or KLIC)
is a non-symmetric measure of the difference between two probability
distributions P and Q. KL measures the expected number of extra bits
required to code samples from P when using a c... | [
"Kullback",
"-",
"Leibler",
"divergence",
".",
"The",
"Kullback",
"-",
"Leibler",
"divergence",
"(",
"also",
"information",
"divergence",
"information",
"gain",
"relative",
"entropy",
"or",
"KLIC",
")",
"is",
"a",
"non",
"-",
"symmetric",
"measure",
"of",
"the... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/Math.java#L2361-L2384 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.zone_zoneName_dynHost_record_id_PUT | public void zone_zoneName_dynHost_record_id_PUT(String zoneName, Long id, OvhDynHostRecord body) throws IOException {
"""
Alter this object properties
REST: PUT /domain/zone/{zoneName}/dynHost/record/{id}
@param body [required] New object properties
@param zoneName [required] The internal name of your zone
@... | java | public void zone_zoneName_dynHost_record_id_PUT(String zoneName, Long id, OvhDynHostRecord body) throws IOException {
String qPath = "/domain/zone/{zoneName}/dynHost/record/{id}";
StringBuilder sb = path(qPath, zoneName, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"zone_zoneName_dynHost_record_id_PUT",
"(",
"String",
"zoneName",
",",
"Long",
"id",
",",
"OvhDynHostRecord",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/zone/{zoneName}/dynHost/record/{id}\"",
";",
"StringBuilder",
"sb"... | Alter this object properties
REST: PUT /domain/zone/{zoneName}/dynHost/record/{id}
@param body [required] New object properties
@param zoneName [required] The internal name of your zone
@param id [required] Id of the object | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L412-L416 |
kiswanij/jk-util | src/main/java/com/jk/util/JKNumbersUtil.java | JKNumbersUtil.subAmounts | public static double subAmounts(final double n1, final double n2) {
"""
Sub amounts.
@param n1 the n 1
@param n2 the n 2
@return the double
"""
final BigDecimal b1 = new BigDecimal(n1);
final BigDecimal b2 = new BigDecimal(n2);
BigDecimal b3 = b1.subtract(b2);
b3 = b3.setScale(3, BigDecimal.RO... | java | public static double subAmounts(final double n1, final double n2) {
final BigDecimal b1 = new BigDecimal(n1);
final BigDecimal b2 = new BigDecimal(n2);
BigDecimal b3 = b1.subtract(b2);
b3 = b3.setScale(3, BigDecimal.ROUND_HALF_UP);
final double result = b3.doubleValue();
return result;
} | [
"public",
"static",
"double",
"subAmounts",
"(",
"final",
"double",
"n1",
",",
"final",
"double",
"n2",
")",
"{",
"final",
"BigDecimal",
"b1",
"=",
"new",
"BigDecimal",
"(",
"n1",
")",
";",
"final",
"BigDecimal",
"b2",
"=",
"new",
"BigDecimal",
"(",
"n2"... | Sub amounts.
@param n1 the n 1
@param n2 the n 2
@return the double | [
"Sub",
"amounts",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKNumbersUtil.java#L105-L112 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java | CoverageDataCore.getPixelValue | public short getPixelValue(GriddedTile griddedTile, Double value) {
"""
Get the "unsigned short" pixel value of the coverage data value
@param griddedTile
gridded tile
@param value
coverage data value
@return "unsigned short" pixel value
"""
int unsignedPixelValue = getUnsignedPixelValue(griddedTile, ... | java | public short getPixelValue(GriddedTile griddedTile, Double value) {
int unsignedPixelValue = getUnsignedPixelValue(griddedTile, value);
short pixelValue = getPixelValue(unsignedPixelValue);
return pixelValue;
} | [
"public",
"short",
"getPixelValue",
"(",
"GriddedTile",
"griddedTile",
",",
"Double",
"value",
")",
"{",
"int",
"unsignedPixelValue",
"=",
"getUnsignedPixelValue",
"(",
"griddedTile",
",",
"value",
")",
";",
"short",
"pixelValue",
"=",
"getPixelValue",
"(",
"unsig... | Get the "unsigned short" pixel value of the coverage data value
@param griddedTile
gridded tile
@param value
coverage data value
@return "unsigned short" pixel value | [
"Get",
"the",
"unsigned",
"short",
"pixel",
"value",
"of",
"the",
"coverage",
"data",
"value"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java#L1598-L1602 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/Orchestrator.java | Orchestrator.canRun | private boolean canRun(String flowName, String flowGroup, boolean allowConcurrentExecution) {
"""
Check if the flow instance is allowed to run.
@param flowName
@param flowGroup
@param allowConcurrentExecution
@return true if the {@link FlowSpec} allows concurrent executions or if no other instance of the flow ... | java | private boolean canRun(String flowName, String flowGroup, boolean allowConcurrentExecution) {
if (allowConcurrentExecution) {
return true;
} else {
return !flowStatusGenerator.isFlowRunning(flowName, flowGroup);
}
} | [
"private",
"boolean",
"canRun",
"(",
"String",
"flowName",
",",
"String",
"flowGroup",
",",
"boolean",
"allowConcurrentExecution",
")",
"{",
"if",
"(",
"allowConcurrentExecution",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
"return",
"!",
"flowStatusGener... | Check if the flow instance is allowed to run.
@param flowName
@param flowGroup
@param allowConcurrentExecution
@return true if the {@link FlowSpec} allows concurrent executions or if no other instance of the flow is currently RUNNING. | [
"Check",
"if",
"the",
"flow",
"instance",
"is",
"allowed",
"to",
"run",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/Orchestrator.java#L315-L321 |
SUSE/salt-netapi-client | src/main/java/com/suse/salt/netapi/calls/modules/File.java | File.getHash | public static LocalCall<String> getHash(String path, HashType form) {
"""
Get the hash sum of a file
@param path Path to the file or directory
@param form Desired sum format
@return The {@link LocalCall} object to make the call
"""
return getHash(path, Optional.of(form), Optiona... | java | public static LocalCall<String> getHash(String path, HashType form) {
return getHash(path, Optional.of(form), Optional.empty());
} | [
"public",
"static",
"LocalCall",
"<",
"String",
">",
"getHash",
"(",
"String",
"path",
",",
"HashType",
"form",
")",
"{",
"return",
"getHash",
"(",
"path",
",",
"Optional",
".",
"of",
"(",
"form",
")",
",",
"Optional",
".",
"empty",
"(",
")",
")",
";... | Get the hash sum of a file
@param path Path to the file or directory
@param form Desired sum format
@return The {@link LocalCall} object to make the call | [
"Get",
"the",
"hash",
"sum",
"of",
"a",
"file"
] | train | https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/calls/modules/File.java#L131-L133 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlUtils.java | CmsXmlUtils.concatXpath | public static String concatXpath(String prefix, String suffix) {
"""
Concatenates two Xpath expressions, ensuring that exactly one slash "/" is between them.<p>
Use this method if it's uncertain if the given arguments are starting or ending with
a slash "/".<p>
Examples:<br>
<code>"title", "subtitle"</code... | java | public static String concatXpath(String prefix, String suffix) {
if (suffix == null) {
// ensure suffix is not null
suffix = "";
} else {
if ((suffix.length() > 0) && (suffix.charAt(0) == '/')) {
// remove leading '/' form suffix
suffi... | [
"public",
"static",
"String",
"concatXpath",
"(",
"String",
"prefix",
",",
"String",
"suffix",
")",
"{",
"if",
"(",
"suffix",
"==",
"null",
")",
"{",
"// ensure suffix is not null",
"suffix",
"=",
"\"\"",
";",
"}",
"else",
"{",
"if",
"(",
"(",
"suffix",
... | Concatenates two Xpath expressions, ensuring that exactly one slash "/" is between them.<p>
Use this method if it's uncertain if the given arguments are starting or ending with
a slash "/".<p>
Examples:<br>
<code>"title", "subtitle"</code> becomes <code>title/subtitle</code><br>
<code>"title[1]/", "subtitle"</code> b... | [
"Concatenates",
"two",
"Xpath",
"expressions",
"ensuring",
"that",
"exactly",
"one",
"slash",
"/",
"is",
"between",
"them",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlUtils.java#L136-L157 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java | SessionDataManager.traverseTransientDescendants | private void traverseTransientDescendants(ItemData parent, int action, List<ItemState> ret)
throws RepositoryException {
"""
Calculate all transient descendants for the given parent node
@param parent
@param action
@param ret
@throws RepositoryException
"""
if (parent.isNode())
{
... | java | private void traverseTransientDescendants(ItemData parent, int action, List<ItemState> ret)
throws RepositoryException
{
if (parent.isNode())
{
if (action != MERGE_PROPS)
{
Collection<ItemState> childNodes = changesLog.getLastChildrenStates(parent, true);
... | [
"private",
"void",
"traverseTransientDescendants",
"(",
"ItemData",
"parent",
",",
"int",
"action",
",",
"List",
"<",
"ItemState",
">",
"ret",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"parent",
".",
"isNode",
"(",
")",
")",
"{",
"if",
"(",
"ac... | Calculate all transient descendants for the given parent node
@param parent
@param action
@param ret
@throws RepositoryException | [
"Calculate",
"all",
"transient",
"descendants",
"for",
"the",
"given",
"parent",
"node"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java#L2343-L2366 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/ModelRegistry.java | ModelRegistry.timestampFormat | void timestampFormat(DateFormat format, String... attributes) {
"""
Registers timestamp converters (Date -> String -> java.sql.Timestamp) for specified model attributes.
"""
convertWith(new DateToStringConverter(format), attributes);
convertWith(new StringToTimestampConverter(format), attribute... | java | void timestampFormat(DateFormat format, String... attributes) {
convertWith(new DateToStringConverter(format), attributes);
convertWith(new StringToTimestampConverter(format), attributes);
} | [
"void",
"timestampFormat",
"(",
"DateFormat",
"format",
",",
"String",
"...",
"attributes",
")",
"{",
"convertWith",
"(",
"new",
"DateToStringConverter",
"(",
"format",
")",
",",
"attributes",
")",
";",
"convertWith",
"(",
"new",
"StringToTimestampConverter",
"(",... | Registers timestamp converters (Date -> String -> java.sql.Timestamp) for specified model attributes. | [
"Registers",
"timestamp",
"converters",
"(",
"Date",
"-",
">",
"String",
"-",
">",
"java",
".",
"sql",
".",
"Timestamp",
")",
"for",
"specified",
"model",
"attributes",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/ModelRegistry.java#L80-L83 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectWorkplaceButtonStyle | public String buildSelectWorkplaceButtonStyle(String htmlAttributes) {
"""
Builds the html for the workplace button style select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the workplace button style select box
"""
int selectedIndex = Int... | java | public String buildSelectWorkplaceButtonStyle(String htmlAttributes) {
int selectedIndex = Integer.parseInt(getParamTabWpButtonStyle());
return buildSelectButtonStyle(htmlAttributes, selectedIndex);
} | [
"public",
"String",
"buildSelectWorkplaceButtonStyle",
"(",
"String",
"htmlAttributes",
")",
"{",
"int",
"selectedIndex",
"=",
"Integer",
".",
"parseInt",
"(",
"getParamTabWpButtonStyle",
"(",
")",
")",
";",
"return",
"buildSelectButtonStyle",
"(",
"htmlAttributes",
"... | Builds the html for the workplace button style select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the workplace button style select box | [
"Builds",
"the",
"html",
"for",
"the",
"workplace",
"button",
"style",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L1001-L1005 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java | CPRulePersistenceImpl.findByGroupId | @Override
public List<CPRule> findByGroupId(long groupId) {
"""
Returns all the cp rules where groupId = ?.
@param groupId the group ID
@return the matching cp rules
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPRule> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPRule",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp rules where groupId = ?.
@param groupId the group ID
@return the matching cp rules | [
"Returns",
"all",
"the",
"cp",
"rules",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java#L122-L125 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/classify/SeverityClassificationPulldownAction.java | SeverityClassificationPulldownAction.fillMenu | private void fillMenu() {
"""
Fill the drop-down menu. We allow the user to choose a severity from 1
(least severe) to 5 (most severe). Default is 3.
"""
// Create a selection listener to handle when the
// user selects a warning severity.
SelectionListener menuItemSelectionListener = ... | java | private void fillMenu() {
// Create a selection listener to handle when the
// user selects a warning severity.
SelectionListener menuItemSelectionListener = new SelectionAdapter() {
/*
* (non-Javadoc)
*
* @see
* org.eclipse.swt.eve... | [
"private",
"void",
"fillMenu",
"(",
")",
"{",
"// Create a selection listener to handle when the",
"// user selects a warning severity.",
"SelectionListener",
"menuItemSelectionListener",
"=",
"new",
"SelectionAdapter",
"(",
")",
"{",
"/*\n * (non-Javadoc)\n *... | Fill the drop-down menu. We allow the user to choose a severity from 1
(least severe) to 5 (most severe). Default is 3. | [
"Fill",
"the",
"drop",
"-",
"down",
"menu",
".",
"We",
"allow",
"the",
"user",
"to",
"choose",
"a",
"severity",
"from",
"1",
"(",
"least",
"severe",
")",
"to",
"5",
"(",
"most",
"severe",
")",
".",
"Default",
"is",
"3",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/classify/SeverityClassificationPulldownAction.java#L73-L125 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/ConnectionPoolDescriptor.java | ConnectionPoolDescriptor.addAttribute | public void addAttribute(String attributeName, String attributeValue) {
"""
Sets a custom configuration attribute.
@param attributeName the attribute name. Names starting with
{@link #JDBC_PROPERTY_NAME_PREFIX} will be used (without the prefix) by the
ConnectionFactory when creating connections from DriverManag... | java | public void addAttribute(String attributeName, String attributeValue)
{
if (attributeName != null && attributeName.startsWith(JDBC_PROPERTY_NAME_PREFIX))
{
final String jdbcPropertyName = attributeName.substring(JDBC_PROPERTY_NAME_LENGTH);
jdbcProperties.setProperty(jdbc... | [
"public",
"void",
"addAttribute",
"(",
"String",
"attributeName",
",",
"String",
"attributeValue",
")",
"{",
"if",
"(",
"attributeName",
"!=",
"null",
"&&",
"attributeName",
".",
"startsWith",
"(",
"JDBC_PROPERTY_NAME_PREFIX",
")",
")",
"{",
"final",
"String",
"... | Sets a custom configuration attribute.
@param attributeName the attribute name. Names starting with
{@link #JDBC_PROPERTY_NAME_PREFIX} will be used (without the prefix) by the
ConnectionFactory when creating connections from DriverManager
(not used for external DataSource connections). Names starting with
{@link #DBCP_... | [
"Sets",
"a",
"custom",
"configuration",
"attribute",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/ConnectionPoolDescriptor.java#L143-L159 |
apache/incubator-shardingsphere | sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/api/MasterSlaveDataSourceFactory.java | MasterSlaveDataSourceFactory.createDataSource | public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final MasterSlaveRuleConfiguration masterSlaveRuleConfig, final Properties props) throws SQLException {
"""
Create master-slave data source.
@param dataSourceMap data source map
@param masterSlaveRuleConfig master-slave rule... | java | public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final MasterSlaveRuleConfiguration masterSlaveRuleConfig, final Properties props) throws SQLException {
return new MasterSlaveDataSource(dataSourceMap, masterSlaveRuleConfig, props);
} | [
"public",
"static",
"DataSource",
"createDataSource",
"(",
"final",
"Map",
"<",
"String",
",",
"DataSource",
">",
"dataSourceMap",
",",
"final",
"MasterSlaveRuleConfiguration",
"masterSlaveRuleConfig",
",",
"final",
"Properties",
"props",
")",
"throws",
"SQLException",
... | Create master-slave data source.
@param dataSourceMap data source map
@param masterSlaveRuleConfig master-slave rule configuration
@param props props
@return master-slave data source
@throws SQLException SQL exception | [
"Create",
"master",
"-",
"slave",
"data",
"source",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/api/MasterSlaveDataSourceFactory.java#L48-L50 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java | CommerceWarehousePersistenceImpl.findByGroupId | @Override
public List<CommerceWarehouse> findByGroupId(long groupId, int start,
int end) {
"""
Returns a range of all the commerce warehouses where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not pr... | java | @Override
public List<CommerceWarehouse> findByGroupId(long groupId, int start,
int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceWarehouse",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce warehouses where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"warehouses",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L141-L145 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebProviderAuthenticatorProxy.java | WebProviderAuthenticatorProxy.getSSOAuthenticator | public WebAuthenticator getSSOAuthenticator(WebRequest webRequest, String ssoCookieName) {
"""
Create an instance of SSOAuthenticator.
@param webRequest
@return The SSOAuthenticator, or {@code null} if it could not be created.
"""
SecurityMetadata securityMetadata = webRequest.getSecurityMetadata()... | java | public WebAuthenticator getSSOAuthenticator(WebRequest webRequest, String ssoCookieName) {
SecurityMetadata securityMetadata = webRequest.getSecurityMetadata();
SecurityService securityService = securityServiceRef.getService();
SSOCookieHelper cookieHelper;
if (ssoCookieName != null) {
... | [
"public",
"WebAuthenticator",
"getSSOAuthenticator",
"(",
"WebRequest",
"webRequest",
",",
"String",
"ssoCookieName",
")",
"{",
"SecurityMetadata",
"securityMetadata",
"=",
"webRequest",
".",
"getSecurityMetadata",
"(",
")",
";",
"SecurityService",
"securityService",
"=",... | Create an instance of SSOAuthenticator.
@param webRequest
@return The SSOAuthenticator, or {@code null} if it could not be created. | [
"Create",
"an",
"instance",
"of",
"SSOAuthenticator",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebProviderAuthenticatorProxy.java#L387-L397 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.cosineSimilarity | public SDVariable cosineSimilarity(String name, SDVariable x, SDVariable y, int... dimensions) {
"""
Cosine similarity pairwise reduction operation. The output contains the cosine similarity for each tensor/subset
along the specified dimensions:<br>
out = (sum_i x[i] * y[i]) / ( sqrt(sum_i x[i]^2) * sqrt(sum_i y... | java | public SDVariable cosineSimilarity(String name, SDVariable x, SDVariable y, int... dimensions) {
validateNumerical("cosine similarity", x, y);
SDVariable cosim = f().cosineSimilarity(x, y, dimensions);
return updateVariableNameAndReference(cosim, name);
} | [
"public",
"SDVariable",
"cosineSimilarity",
"(",
"String",
"name",
",",
"SDVariable",
"x",
",",
"SDVariable",
"y",
",",
"int",
"...",
"dimensions",
")",
"{",
"validateNumerical",
"(",
"\"cosine similarity\"",
",",
"x",
",",
"y",
")",
";",
"SDVariable",
"cosim"... | Cosine similarity pairwise reduction operation. The output contains the cosine similarity for each tensor/subset
along the specified dimensions:<br>
out = (sum_i x[i] * y[i]) / ( sqrt(sum_i x[i]^2) * sqrt(sum_i y[i]^2)
@param x Input variable x
@param y Input variable y
@param dimensions Dimensions t... | [
"Cosine",
"similarity",
"pairwise",
"reduction",
"operation",
".",
"The",
"output",
"contains",
"the",
"cosine",
"similarity",
"for",
"each",
"tensor",
"/",
"subset",
"along",
"the",
"specified",
"dimensions",
":",
"<br",
">",
"out",
"=",
"(",
"sum_i",
"x",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L678-L682 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java | Log.strictWarning | public void strictWarning(DiagnosticPosition pos, String key, Object ... args) {
"""
Report a warning that cannot be suppressed.
@param pos The source position at which to report the warning.
@param key The key for the localized warning message.
@param args Fields of the warning message.
"""
... | java | public void strictWarning(DiagnosticPosition pos, String key, Object ... args) {
writeDiagnostic(diags.warning(null, source, pos, key, args));
nwarnings++;
} | [
"public",
"void",
"strictWarning",
"(",
"DiagnosticPosition",
"pos",
",",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"writeDiagnostic",
"(",
"diags",
".",
"warning",
"(",
"null",
",",
"source",
",",
"pos",
",",
"key",
",",
"args",
")",
")",... | Report a warning that cannot be suppressed.
@param pos The source position at which to report the warning.
@param key The key for the localized warning message.
@param args Fields of the warning message. | [
"Report",
"a",
"warning",
"that",
"cannot",
"be",
"suppressed",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java#L645-L648 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/wan/impl/WanEventCounters.java | WanEventCounters.removeCounter | public void removeCounter(String serviceName, String dataStructureName) {
"""
Removes the counter for the given {@code serviceName} and {@code dataStructureName}.
"""
for (WanPublisherEventCounters publisherWanCounterContainer : eventCounterMap.values()) {
publisherWanCounterContainer.remov... | java | public void removeCounter(String serviceName, String dataStructureName) {
for (WanPublisherEventCounters publisherWanCounterContainer : eventCounterMap.values()) {
publisherWanCounterContainer.removeCounter(serviceName, dataStructureName);
}
} | [
"public",
"void",
"removeCounter",
"(",
"String",
"serviceName",
",",
"String",
"dataStructureName",
")",
"{",
"for",
"(",
"WanPublisherEventCounters",
"publisherWanCounterContainer",
":",
"eventCounterMap",
".",
"values",
"(",
")",
")",
"{",
"publisherWanCounterContain... | Removes the counter for the given {@code serviceName} and {@code dataStructureName}. | [
"Removes",
"the",
"counter",
"for",
"the",
"given",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/wan/impl/WanEventCounters.java#L63-L67 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java | DatabaseUtils.dumpCurrentRow | public static void dumpCurrentRow(Cursor cursor, StringBuilder sb) {
"""
Prints the contents of a Cursor's current row to a StringBuilder.
@param cursor the cursor to print
@param sb the StringBuilder to print to
"""
String[] cols = cursor.getColumnNames();
sb.append("" + cursor.getPosition... | java | public static void dumpCurrentRow(Cursor cursor, StringBuilder sb) {
String[] cols = cursor.getColumnNames();
sb.append("" + cursor.getPosition() + " {\n");
int length = cols.length;
for (int i = 0; i < length; i++) {
String value;
try {
value = cu... | [
"public",
"static",
"void",
"dumpCurrentRow",
"(",
"Cursor",
"cursor",
",",
"StringBuilder",
"sb",
")",
"{",
"String",
"[",
"]",
"cols",
"=",
"cursor",
".",
"getColumnNames",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"\"",
"+",
"cursor",
".",
"getPositi... | Prints the contents of a Cursor's current row to a StringBuilder.
@param cursor the cursor to print
@param sb the StringBuilder to print to | [
"Prints",
"the",
"contents",
"of",
"a",
"Cursor",
"s",
"current",
"row",
"to",
"a",
"StringBuilder",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L571-L587 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.