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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.setCertificateIssuer | public IssuerBundle setCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) {
"""
Sets the specified certificate issuer.
The SetCertificateIssuer operation adds or updates the specified certi... | java | public IssuerBundle setCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) {
return setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizati... | [
"public",
"IssuerBundle",
"setCertificateIssuer",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"issuerName",
",",
"String",
"provider",
",",
"IssuerCredentials",
"credentials",
",",
"OrganizationDetails",
"organizationDetails",
",",
"IssuerAttributes",
"attributes",
")",
... | Sets the specified certificate issuer.
The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param issuerName The name of the issuer.
@param p... | [
"Sets",
"the",
"specified",
"certificate",
"issuer",
".",
"The",
"SetCertificateIssuer",
"operation",
"adds",
"or",
"updates",
"the",
"specified",
"certificate",
"issuer",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"setissuers",
"permission",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L5999-L6001 |
javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/Utilities.java | Utilities.createParagraphTitle | public static JLabel createParagraphTitle(String title, String iconName) {
"""
Création d'un JLabel de paragraphe.
@param title String
@param iconName String
@return JLabel
"""
final JLabel label = new JLabel(title);
label.setIcon(ImageIconCache.getScaledImageIcon(iconName, 24, 24));
label.setFont(... | java | public static JLabel createParagraphTitle(String title, String iconName) {
final JLabel label = new JLabel(title);
label.setIcon(ImageIconCache.getScaledImageIcon(iconName, 24, 24));
label.setFont(label.getFont().deriveFont(Font.BOLD, label.getFont().getSize() + 4));
// séparateur avec composants au-dessus ... | [
"public",
"static",
"JLabel",
"createParagraphTitle",
"(",
"String",
"title",
",",
"String",
"iconName",
")",
"{",
"final",
"JLabel",
"label",
"=",
"new",
"JLabel",
"(",
"title",
")",
";",
"label",
".",
"setIcon",
"(",
"ImageIconCache",
".",
"getScaledImageIco... | Création d'un JLabel de paragraphe.
@param title String
@param iconName String
@return JLabel | [
"Création",
"d",
"un",
"JLabel",
"de",
"paragraphe",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/Utilities.java#L74-L81 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_device_profile.java | ns_device_profile.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_device_profile_responses result = (ns_device_profile_responses) serv... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_device_profile_responses result = (ns_device_profile_responses) service.get_payload_formatter().string_to_resource(ns_device_profile_responses.class, response);
if(result.errorcode != 0)
{
if (... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_device_profile_responses",
"result",
"=",
"(",
"ns_device_profile_responses",
")",
"service",
".",
"get_pa... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_device_profile.java#L238-L255 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.countLockedResources | public int countLockedResources(CmsRequestContext context, CmsUUID id)
throws CmsException, CmsRoleViolationException {
"""
Counts the locked resources in this project.<p>
@param context the current request context
@param id the id of the project
@return the amount of locked resources in this project
... | java | public int countLockedResources(CmsRequestContext context, CmsUUID id)
throws CmsException, CmsRoleViolationException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsProject project = null;
int result = 0;
try {
project = m_driverManager.readProject(dbc... | [
"public",
"int",
"countLockedResources",
"(",
"CmsRequestContext",
"context",
",",
"CmsUUID",
"id",
")",
"throws",
"CmsException",
",",
"CmsRoleViolationException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
... | Counts the locked resources in this project.<p>
@param context the current request context
@param id the id of the project
@return the amount of locked resources in this project
@throws CmsException if something goes wrong
@throws CmsRoleViolationException if the current user does not have management access to the p... | [
"Counts",
"the",
"locked",
"resources",
"in",
"this",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L855-L877 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/AmountFormats.java | AmountFormats.wordBased | public static String wordBased(Period period, Duration duration, Locale locale) {
"""
Formats a period and duration to a string in a localized word-based format.
<p>
This returns a word-based format for the period.
The year and month are printed as supplied unless the signs differ, in which case they are normal... | java | public static String wordBased(Period period, Duration duration, Locale locale) {
Objects.requireNonNull(period, "period must not be null");
Objects.requireNonNull(duration, "duration must not be null");
Objects.requireNonNull(locale, "locale must not be null");
ResourceBundle bundle = R... | [
"public",
"static",
"String",
"wordBased",
"(",
"Period",
"period",
",",
"Duration",
"duration",
",",
"Locale",
"locale",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"period",
",",
"\"period must not be null\"",
")",
";",
"Objects",
".",
"requireNonNull",
"... | Formats a period and duration to a string in a localized word-based format.
<p>
This returns a word-based format for the period.
The year and month are printed as supplied unless the signs differ, in which case they are normalized.
The words are configured in a resource bundle text file -
{@code org.threeten.extra.word... | [
"Formats",
"a",
"period",
"and",
"duration",
"to",
"a",
"string",
"in",
"a",
"localized",
"word",
"-",
"based",
"format",
".",
"<p",
">",
"This",
"returns",
"a",
"word",
"-",
"based",
"format",
"for",
"the",
"period",
".",
"The",
"year",
"and",
"month"... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/AmountFormats.java#L239-L272 |
alipay/sofa-rpc | extension-impl/registry-sofa/src/main/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistryHelper.java | SofaRegistryHelper.getKeyPairs | private static String getKeyPairs(String key, Object value) {
"""
Gets key pairs.
@param key the key
@param value the value
@return the key pairs
"""
if (value != null) {
return "&" + key + "=" + value.toString();
} else {
return StringUtils.EMPTY;
}
} | java | private static String getKeyPairs(String key, Object value) {
if (value != null) {
return "&" + key + "=" + value.toString();
} else {
return StringUtils.EMPTY;
}
} | [
"private",
"static",
"String",
"getKeyPairs",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"\"&\"",
"+",
"key",
"+",
"\"=\"",
"+",
"value",
".",
"toString",
"(",
")",
";",
"}",
"else",
... | Gets key pairs.
@param key the key
@param value the value
@return the key pairs | [
"Gets",
"key",
"pairs",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-sofa/src/main/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistryHelper.java#L237-L243 |
bazaarvoice/emodb | mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java | EmoSerDe.getRawValue | private Object getRawValue(String columnName, Row row) {
"""
Returns the value for a given row. Hierarchical elements can be reached using paths like keys. For example:
<code>getRawValue("about/~id")</code>
is roughly equivalent to returning:
<code>row.getMap().get("about").get("~id")</code>
with add... | java | private Object getRawValue(String columnName, Row row) {
try {
return getRawValue(columnName, row.getMap());
} catch (ColumnNotFoundException e) {
// Check if there is an implicit column override then return it
try {
ImplicitColumn implicitColumn = Imp... | [
"private",
"Object",
"getRawValue",
"(",
"String",
"columnName",
",",
"Row",
"row",
")",
"{",
"try",
"{",
"return",
"getRawValue",
"(",
"columnName",
",",
"row",
".",
"getMap",
"(",
")",
")",
";",
"}",
"catch",
"(",
"ColumnNotFoundException",
"e",
")",
"... | Returns the value for a given row. Hierarchical elements can be reached using paths like keys. For example:
<code>getRawValue("about/~id")</code>
is roughly equivalent to returning:
<code>row.getMap().get("about").get("~id")</code>
with additional null and type checking along the path.
Additionally, most intrins... | [
"Returns",
"the",
"value",
"for",
"a",
"given",
"row",
".",
"Hierarchical",
"elements",
"can",
"be",
"reached",
"using",
"paths",
"like",
"keys",
".",
"For",
"example",
":"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java#L187-L200 |
wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/StandaloneCommandBuilder.java | StandaloneCommandBuilder.setDebug | public StandaloneCommandBuilder setDebug(final boolean suspend, final int port) {
"""
Sets the debug JPDA remote socket debugging argument.
@param suspend {@code true} to suspend otherwise {@code false}
@param port the port to listen on
@return the builder
"""
debugArg = String.format(DEBUG_F... | java | public StandaloneCommandBuilder setDebug(final boolean suspend, final int port) {
debugArg = String.format(DEBUG_FORMAT, (suspend ? "y" : "n"), port);
return this;
} | [
"public",
"StandaloneCommandBuilder",
"setDebug",
"(",
"final",
"boolean",
"suspend",
",",
"final",
"int",
"port",
")",
"{",
"debugArg",
"=",
"String",
".",
"format",
"(",
"DEBUG_FORMAT",
",",
"(",
"suspend",
"?",
"\"y\"",
":",
"\"n\"",
")",
",",
"port",
"... | Sets the debug JPDA remote socket debugging argument.
@param suspend {@code true} to suspend otherwise {@code false}
@param port the port to listen on
@return the builder | [
"Sets",
"the",
"debug",
"JPDA",
"remote",
"socket",
"debugging",
"argument",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/StandaloneCommandBuilder.java#L233-L236 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TETxLifeCycleInfo.java | TETxLifeCycleInfo.traceSetTxCommon | public static void traceSetTxCommon(int opType, String txId, String desc) {
"""
This is called by the EJB container server code to write a
set transaction record to the trace log, if enabled.
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf =... | java | public static void traceSetTxCommon(int opType, String txId, String desc)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(TxLifeCycle_Set_Tx_Type_Str).append(DataDelimiter)
... | [
"public",
"static",
"void",
"traceSetTxCommon",
"(",
"int",
"opType",
",",
"String",
"txId",
",",
"String",
"desc",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringB... | This is called by the EJB container server code to write a
set transaction record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"set",
"transaction",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TETxLifeCycleInfo.java#L29-L43 |
Impetus/Kundera | src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/index/Neo4JIndexManager.java | Neo4JIndexManager.updateNodeIndex | public void updateNodeIndex(EntityMetadata entityMetadata, GraphDatabaseService graphDb, Node node, MetamodelImpl metaModel) {
"""
If node auto-indexing is disabled, Update index for this node manually
@param entityMetadata
@param graphDb
@param autoIndexing
@param node
"""
if (!isNodeAutoIndexin... | java | public void updateNodeIndex(EntityMetadata entityMetadata, GraphDatabaseService graphDb, Node node, MetamodelImpl metaModel)
{
if (!isNodeAutoIndexingEnabled(graphDb) && entityMetadata.isIndexable())
{
Index<Node> nodeIndex = graphDb.index().forNodes(entityMetadata.getIndexName());
... | [
"public",
"void",
"updateNodeIndex",
"(",
"EntityMetadata",
"entityMetadata",
",",
"GraphDatabaseService",
"graphDb",
",",
"Node",
"node",
",",
"MetamodelImpl",
"metaModel",
")",
"{",
"if",
"(",
"!",
"isNodeAutoIndexingEnabled",
"(",
"graphDb",
")",
"&&",
"entityMet... | If node auto-indexing is disabled, Update index for this node manually
@param entityMetadata
@param graphDb
@param autoIndexing
@param node | [
"If",
"node",
"auto",
"-",
"indexing",
"is",
"disabled",
"Update",
"index",
"for",
"this",
"node",
"manually"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/index/Neo4JIndexManager.java#L161-L174 |
vigna/Sux4J | src/it/unimi/dsi/sux4j/io/ChunkedHashStore.java | ChunkedHashStore.addAll | public void addAll(final Iterator<? extends T> elements, final LongIterator values, final boolean requiresValue2CountMap) throws IOException {
"""
Adds the elements returned by an iterator to this store, associating them with specified values,
possibly building the associated value frequency map.
@param elemen... | java | public void addAll(final Iterator<? extends T> elements, final LongIterator values, final boolean requiresValue2CountMap) throws IOException {
if (pl != null) {
pl.expectedUpdates = -1;
pl.start("Adding elements...");
}
final long[] triple = new long[3];
while(elements.hasNext()) {
Hashes.spooky4(trans... | [
"public",
"void",
"addAll",
"(",
"final",
"Iterator",
"<",
"?",
"extends",
"T",
">",
"elements",
",",
"final",
"LongIterator",
"values",
",",
"final",
"boolean",
"requiresValue2CountMap",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pl",
"!=",
"null",
")",... | Adds the elements returned by an iterator to this store, associating them with specified values,
possibly building the associated value frequency map.
@param elements an iterator returning elements.
@param values an iterator on values parallel to {@code elements}.
@param requiresValue2CountMap whether to build the val... | [
"Adds",
"the",
"elements",
"returned",
"by",
"an",
"iterator",
"to",
"this",
"store",
"associating",
"them",
"with",
"specified",
"values",
"possibly",
"building",
"the",
"associated",
"value",
"frequency",
"map",
"."
] | train | https://github.com/vigna/Sux4J/blob/d57de8fa897c7d273e0e6dae7a3274174f175a5f/src/it/unimi/dsi/sux4j/io/ChunkedHashStore.java#L345-L358 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/engine/CommonsMetadataEngine.java | CommonsMetadataEngine.alterCatalog | @Override
public final void alterCatalog(ClusterName targetCluster, CatalogName catalogName, Map<Selector, Selector> options)
throws UnsupportedException, ExecutionException {
"""
Alter options in an existing table.
@param targetCluster the target cluster where the catalog will be altered.
@par... | java | @Override
public final void alterCatalog(ClusterName targetCluster, CatalogName catalogName, Map<Selector, Selector> options)
throws UnsupportedException, ExecutionException {
try {
connectionHandler.startJob(targetCluster.getName());
if (logger.isDebugEnabled()) {
... | [
"@",
"Override",
"public",
"final",
"void",
"alterCatalog",
"(",
"ClusterName",
"targetCluster",
",",
"CatalogName",
"catalogName",
",",
"Map",
"<",
"Selector",
",",
"Selector",
">",
"options",
")",
"throws",
"UnsupportedException",
",",
"ExecutionException",
"{",
... | Alter options in an existing table.
@param targetCluster the target cluster where the catalog will be altered.
@param catalogName the catalog name
@param options the options
@throws UnsupportedException if the operation is not supported
@throws ExecutionException if any error happen during the execution | [
"Alter",
"options",
"in",
"an",
"existing",
"table",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/engine/CommonsMetadataEngine.java#L301-L321 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/gfx/GeometryPath.java | GeometryPath.moveCoordinate | public void moveCoordinate(Coordinate coordinate, int index) {
"""
Move the coordinate at the specified index.
@param coordinate the new coordinate
@param index
"""
if (index < coordinates.length) {
coordinates[index] = (Coordinate) coordinate.clone();
}
setCoordinates(coordinates);
} | java | public void moveCoordinate(Coordinate coordinate, int index) {
if (index < coordinates.length) {
coordinates[index] = (Coordinate) coordinate.clone();
}
setCoordinates(coordinates);
} | [
"public",
"void",
"moveCoordinate",
"(",
"Coordinate",
"coordinate",
",",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"coordinates",
".",
"length",
")",
"{",
"coordinates",
"[",
"index",
"]",
"=",
"(",
"Coordinate",
")",
"coordinate",
".",
"clone",
... | Move the coordinate at the specified index.
@param coordinate the new coordinate
@param index | [
"Move",
"the",
"coordinate",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/gfx/GeometryPath.java#L154-L159 |
beangle/beangle3 | struts/s2/src/main/java/org/beangle/struts2/view/component/Component.java | Component.stripExpressionIfAltSyntax | public static String stripExpressionIfAltSyntax(ValueStack stack, String expr) {
"""
If altsyntax (%{...}) is applied, simply strip the "%{" and "}" off.
@param stack
the ValueStack where the context value is searched for.
@param expr
the expression (must be not null)
@return the stripped expression if altS... | java | public static String stripExpressionIfAltSyntax(ValueStack stack, String expr) {
if (altSyntax(stack)) {
// does the expression start with %{ and end with }? if so, just cut
// it off!
if (expr.startsWith("%{") && expr.endsWith("}")) { return expr.substring(2, expr.length() - 1); }
}
retur... | [
"public",
"static",
"String",
"stripExpressionIfAltSyntax",
"(",
"ValueStack",
"stack",
",",
"String",
"expr",
")",
"{",
"if",
"(",
"altSyntax",
"(",
"stack",
")",
")",
"{",
"// does the expression start with %{ and end with }? if so, just cut",
"// it off!",
"if",
"(",... | If altsyntax (%{...}) is applied, simply strip the "%{" and "}" off.
@param stack
the ValueStack where the context value is searched for.
@param expr
the expression (must be not null)
@return the stripped expression if altSyntax is enabled. Otherwise the
parameter expression is returned as is. | [
"If",
"altsyntax",
"(",
"%",
"{",
"...",
"}",
")",
"is",
"applied",
"simply",
"strip",
"the",
"%",
"{",
"and",
"}",
"off",
"."
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/struts/s2/src/main/java/org/beangle/struts2/view/component/Component.java#L252-L259 |
Sciss/abc4j | abc/src/main/java/abc/ui/swing/ScoreTemplate.java | ScoreTemplate.setTextAttributes | public void setTextAttributes(byte[] fields, Hashtable attrib) {
"""
Sets the text attributes of several fields
@param fields
one of {@link ScoreElements} constants
@param attrib
Map of attributes
@see java.awt.font.TextAttribute
"""
for (byte field : fields) {
getFieldInfos(field)... | java | public void setTextAttributes(byte[] fields, Hashtable attrib) {
for (byte field : fields) {
getFieldInfos(field).m_textAttributes = attrib;
}
notifyListeners();
} | [
"public",
"void",
"setTextAttributes",
"(",
"byte",
"[",
"]",
"fields",
",",
"Hashtable",
"attrib",
")",
"{",
"for",
"(",
"byte",
"field",
":",
"fields",
")",
"{",
"getFieldInfos",
"(",
"field",
")",
".",
"m_textAttributes",
"=",
"attrib",
";",
"}",
"not... | Sets the text attributes of several fields
@param fields
one of {@link ScoreElements} constants
@param attrib
Map of attributes
@see java.awt.font.TextAttribute | [
"Sets",
"the",
"text",
"attributes",
"of",
"several",
"fields"
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/ScoreTemplate.java#L881-L886 |
CloudBees-community/syslog-java-client | src/main/java/com/cloudbees/syslog/util/InternalLogger.java | InternalLogger.log | public synchronized void log(@Nullable Level level, @Nullable String msg, @Nullable Throwable t) {
"""
synchronize for the {@link java.text.SimpleDateFormat}.
@param level
@param msg
@param t
"""
if (!isLoggable(level))
return;
System.err.println(df.format(new Date()) + " [" + ... | java | public synchronized void log(@Nullable Level level, @Nullable String msg, @Nullable Throwable t) {
if (!isLoggable(level))
return;
System.err.println(df.format(new Date()) + " [" + Thread.currentThread().getName() + "] " + name + " - " + level.getName() + ": " + msg);
if (t != null)
... | [
"public",
"synchronized",
"void",
"log",
"(",
"@",
"Nullable",
"Level",
"level",
",",
"@",
"Nullable",
"String",
"msg",
",",
"@",
"Nullable",
"Throwable",
"t",
")",
"{",
"if",
"(",
"!",
"isLoggable",
"(",
"level",
")",
")",
"return",
";",
"System",
"."... | synchronize for the {@link java.text.SimpleDateFormat}.
@param level
@param msg
@param t | [
"synchronize",
"for",
"the",
"{",
"@link",
"java",
".",
"text",
".",
"SimpleDateFormat",
"}",
"."
] | train | https://github.com/CloudBees-community/syslog-java-client/blob/41e01206e4ce17c6d225ffb443bf19792a3f3c3a/src/main/java/com/cloudbees/syslog/util/InternalLogger.java#L119-L126 |
mapbox/mapbox-events-android | libcore/src/main/java/com/mapbox/android/core/crashreporter/CrashReport.java | CrashReport.put | public synchronized void put(@NonNull String key, @Nullable String value) {
"""
Add key value pair to report
@param key valid non-empty key
@param value valid string value or null
"""
if (value == null) {
putNull(key);
return;
}
try {
this.content.put(key, value);
} cat... | java | public synchronized void put(@NonNull String key, @Nullable String value) {
if (value == null) {
putNull(key);
return;
}
try {
this.content.put(key, value);
} catch (JSONException je) {
Log.e(TAG, "Failed json encode value: " + String.valueOf(value));
}
} | [
"public",
"synchronized",
"void",
"put",
"(",
"@",
"NonNull",
"String",
"key",
",",
"@",
"Nullable",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"putNull",
"(",
"key",
")",
";",
"return",
";",
"}",
"try",
"{",
"this",
"... | Add key value pair to report
@param key valid non-empty key
@param value valid string value or null | [
"Add",
"key",
"value",
"pair",
"to",
"report"
] | train | https://github.com/mapbox/mapbox-events-android/blob/5b5ca7e04cb8fab31a8dc040b6e7521f930a58a4/libcore/src/main/java/com/mapbox/android/core/crashreporter/CrashReport.java#L39-L50 |
jbundle/jbundle | base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/BaseMessageTransport.java | BaseMessageTransport.createExternalMessage | public ExternalMessage createExternalMessage(BaseMessage message, Object rawData) {
"""
Get the external message container for this Internal message.
Typically, the overriding class supplies a default format for the transport type.
<br/>NOTE: The message header from the internal message is copied, but not the me... | java | public ExternalMessage createExternalMessage(BaseMessage message, Object rawData)
{
ExternalTrxMessage externalTrxMessage = null;
TrxMessageHeader trxMessageHeader = (TrxMessageHeader)message.getMessageHeader();
String strMessageClass = null;
if (trxMessageHeader != null)
... | [
"public",
"ExternalMessage",
"createExternalMessage",
"(",
"BaseMessage",
"message",
",",
"Object",
"rawData",
")",
"{",
"ExternalTrxMessage",
"externalTrxMessage",
"=",
"null",
";",
"TrxMessageHeader",
"trxMessageHeader",
"=",
"(",
"TrxMessageHeader",
")",
"message",
"... | Get the external message container for this Internal message.
Typically, the overriding class supplies a default format for the transport type.
<br/>NOTE: The message header from the internal message is copied, but not the message itself.
@param rawData The raw data
@param The internalTrxMessage that I will convert to ... | [
"Get",
"the",
"external",
"message",
"container",
"for",
"this",
"Internal",
"message",
".",
"Typically",
"the",
"overriding",
"class",
"supplies",
"a",
"default",
"format",
"for",
"the",
"transport",
"type",
".",
"<br",
"/",
">",
"NOTE",
":",
"The",
"messag... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/BaseMessageTransport.java#L451-L463 |
googleads/googleads-java-lib | extensions/adwords_rate_limiter/src/main/java/com/google/api/ads/adwords/extension/ratelimiter/ApiServicesRetryStrategy.java | ApiServicesRetryStrategy.calcWaitTime | private long calcWaitTime(long clientCustomerId, @Nullable Throwable throwable) {
"""
Calculate the wait time (in millis) before next AdWords API call is allowed.
"""
long nowInMillis = dateProvider.getNowInMillis();
long waitForMillis = 0L;
waitForMillis = Math.max(waitForMillis, tokenWaitUntil.g... | java | private long calcWaitTime(long clientCustomerId, @Nullable Throwable throwable) {
long nowInMillis = dateProvider.getNowInMillis();
long waitForMillis = 0L;
waitForMillis = Math.max(waitForMillis, tokenWaitUntil.get() - nowInMillis);
waitForMillis = Math.max(waitForMillis, getAccountWaitTime(clientCust... | [
"private",
"long",
"calcWaitTime",
"(",
"long",
"clientCustomerId",
",",
"@",
"Nullable",
"Throwable",
"throwable",
")",
"{",
"long",
"nowInMillis",
"=",
"dateProvider",
".",
"getNowInMillis",
"(",
")",
";",
"long",
"waitForMillis",
"=",
"0L",
";",
"waitForMilli... | Calculate the wait time (in millis) before next AdWords API call is allowed. | [
"Calculate",
"the",
"wait",
"time",
"(",
"in",
"millis",
")",
"before",
"next",
"AdWords",
"API",
"call",
"is",
"allowed",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/extensions/adwords_rate_limiter/src/main/java/com/google/api/ads/adwords/extension/ratelimiter/ApiServicesRetryStrategy.java#L177-L193 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AuditDto.java | AuditDto.transformToDto | public static AuditDto transformToDto(Audit audit) {
"""
Converts the audit entity to DTO.
@param audit The audit entity.
@return The audit DTO.
@throws WebApplicationException If an error occurs.
"""
if (audit == null) {
throw new WebApplicationException("Null entity object ... | java | public static AuditDto transformToDto(Audit audit) {
if (audit == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
AuditDto auditDto = new AuditDto();
try {
auditDto.setId(audit.... | [
"public",
"static",
"AuditDto",
"transformToDto",
"(",
"Audit",
"audit",
")",
"{",
"if",
"(",
"audit",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"Status",
".",
"INTERNAL_SE... | Converts the audit entity to DTO.
@param audit The audit entity.
@return The audit DTO.
@throws WebApplicationException If an error occurs. | [
"Converts",
"the",
"audit",
"entity",
"to",
"DTO",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AuditDto.java#L74-L91 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/transactional/TransactionTopologyBuilder.java | TransactionTopologyBuilder.setSpoutWithAck | public SpoutDeclarer setSpoutWithAck(String id, IRichSpout spout, Number parallelismHint) {
"""
Build spout to provide the compatibility with Storm's ack mechanism
@param id spout Id
@param spout
@return
"""
return setSpout(id, new AckTransactionSpout(spout), parallelismHint);
} | java | public SpoutDeclarer setSpoutWithAck(String id, IRichSpout spout, Number parallelismHint) {
return setSpout(id, new AckTransactionSpout(spout), parallelismHint);
} | [
"public",
"SpoutDeclarer",
"setSpoutWithAck",
"(",
"String",
"id",
",",
"IRichSpout",
"spout",
",",
"Number",
"parallelismHint",
")",
"{",
"return",
"setSpout",
"(",
"id",
",",
"new",
"AckTransactionSpout",
"(",
"spout",
")",
",",
"parallelismHint",
")",
";",
... | Build spout to provide the compatibility with Storm's ack mechanism
@param id spout Id
@param spout
@return | [
"Build",
"spout",
"to",
"provide",
"the",
"compatibility",
"with",
"Storm",
"s",
"ack",
"mechanism"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/transactional/TransactionTopologyBuilder.java#L117-L119 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/AbstrStrMatcher.java | AbstrStrMatcher.joinWith | public String joinWith(String separator, Object... join) {
"""
Returns a new string that append the specified string
to the delegate string with specified separator
@param join
@return
"""
return Joiner.on(separator).join(delegate.get(), EMPTY, join);
} | java | public String joinWith(String separator, Object... join) {
return Joiner.on(separator).join(delegate.get(), EMPTY, join);
} | [
"public",
"String",
"joinWith",
"(",
"String",
"separator",
",",
"Object",
"...",
"join",
")",
"{",
"return",
"Joiner",
".",
"on",
"(",
"separator",
")",
".",
"join",
"(",
"delegate",
".",
"get",
"(",
")",
",",
"EMPTY",
",",
"join",
")",
";",
"}"
] | Returns a new string that append the specified string
to the delegate string with specified separator
@param join
@return | [
"Returns",
"a",
"new",
"string",
"that",
"append",
"the",
"specified",
"string",
"to",
"the",
"delegate",
"string",
"with",
"specified",
"separator"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/AbstrStrMatcher.java#L88-L90 |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java | AbstractMessageHandler.executeRequest | protected <T, A> AsyncFuture<T> executeRequest(final ManagementRequest<T, A> request, final Channel channel, final ActiveOperation<T, A> support) {
"""
Execute a request.
@param request the request
@param channel the channel
@param support the request support
@return the future result
"""
assert ... | java | protected <T, A> AsyncFuture<T> executeRequest(final ManagementRequest<T, A> request, final Channel channel, final ActiveOperation<T, A> support) {
assert support != null;
updateChannelRef(support, channel);
final Integer requestId = this.requestID.incrementAndGet();
final ActiveRequest<... | [
"protected",
"<",
"T",
",",
"A",
">",
"AsyncFuture",
"<",
"T",
">",
"executeRequest",
"(",
"final",
"ManagementRequest",
"<",
"T",
",",
"A",
">",
"request",
",",
"final",
"Channel",
"channel",
",",
"final",
"ActiveOperation",
"<",
"T",
",",
"A",
">",
"... | Execute a request.
@param request the request
@param channel the channel
@param support the request support
@return the future result | [
"Execute",
"a",
"request",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java#L260-L275 |
craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addDirectory | public void addDirectory( final String path, final int permissions, final Directive directive, final String uname, final String gname) throws NoSuchAlgorithmException, IOException {
"""
Adds the directory to the repository.
@param path the absolute path to add as a directory.
@param permissions the mode of the... | java | public void addDirectory( final String path, final int permissions, final Directive directive, final String uname, final String gname) throws NoSuchAlgorithmException, IOException {
contents.addDirectory( path, permissions, directive, uname, gname);
} | [
"public",
"void",
"addDirectory",
"(",
"final",
"String",
"path",
",",
"final",
"int",
"permissions",
",",
"final",
"Directive",
"directive",
",",
"final",
"String",
"uname",
",",
"final",
"String",
"gname",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOExc... | Adds the directory to the repository.
@param path the absolute path to add as a directory.
@param permissions the mode of the directory in standard three octet notation.
@param directive directive indicating special handling for this file.
@param uname user owner of the directory
@param gname group owner of the direct... | [
"Adds",
"the",
"directory",
"to",
"the",
"repository",
"."
] | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L1094-L1096 |
fuinorg/units4j | src/main/java/org/fuin/units4j/assertionrules/Utils.java | Utils.findOverrideMethods | public static List<MethodInfo> findOverrideMethods(final Index index, final MethodInfo method) {
"""
Returns a list of all methods the given one overrides. Such methods can be found in interfaces and super classes.
@param index
Index with all known classes.
@param method
Method signature to find.
@return ... | java | public static List<MethodInfo> findOverrideMethods(final Index index, final MethodInfo method) {
return findOverrideMethods(index, method.declaringClass(), method, 0);
} | [
"public",
"static",
"List",
"<",
"MethodInfo",
">",
"findOverrideMethods",
"(",
"final",
"Index",
"index",
",",
"final",
"MethodInfo",
"method",
")",
"{",
"return",
"findOverrideMethods",
"(",
"index",
",",
"method",
".",
"declaringClass",
"(",
")",
",",
"meth... | Returns a list of all methods the given one overrides. Such methods can be found in interfaces and super classes.
@param index
Index with all known classes.
@param method
Method signature to find.
@return List of methods the given one overrides. | [
"Returns",
"a",
"list",
"of",
"all",
"methods",
"the",
"given",
"one",
"overrides",
".",
"Such",
"methods",
"can",
"be",
"found",
"in",
"interfaces",
"and",
"super",
"classes",
"."
] | train | https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/assertionrules/Utils.java#L122-L126 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java | EnvironmentsInner.beginResetPasswordAsync | public Observable<Void> beginResetPasswordAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) {
"""
Resets the user password on an environment This operation can take a while to complete.
@param ... | java | public Observable<Void> beginResetPasswordAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) {
return beginResetPasswordWithServiceResponseAsync(resourceGroupName, labAccountName, labName, envir... | [
"public",
"Observable",
"<",
"Void",
">",
"beginResetPasswordAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
",",
"String",
"environmentName",
",",
"ResetPasswordPayload",
"r... | Resets the user password on an environment This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Setting.
@param environmentNa... | [
"Resets",
"the",
"user",
"password",
"on",
"an",
"environment",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java#L1309-L1316 |
alkacon/opencms-core | src/org/opencms/site/CmsSiteMatcher.java | CmsSiteMatcher.forDifferentScheme | public CmsSiteMatcher forDifferentScheme(String scheme) {
"""
Generates a site matcher equivalent to this one but with a different scheme.<p>
@param scheme the new scheme
@return the new site matcher
"""
try {
URI uri = new URI(getUrl());
URI changedUri = new URI(scheme, ur... | java | public CmsSiteMatcher forDifferentScheme(String scheme) {
try {
URI uri = new URI(getUrl());
URI changedUri = new URI(scheme, uri.getAuthority(), uri.getPath(), uri.getQuery(), uri.getFragment());
CmsSiteMatcher res = new CmsSiteMatcher(changedUri.toString(), m_timeOffset);
... | [
"public",
"CmsSiteMatcher",
"forDifferentScheme",
"(",
"String",
"scheme",
")",
"{",
"try",
"{",
"URI",
"uri",
"=",
"new",
"URI",
"(",
"getUrl",
"(",
")",
")",
";",
"URI",
"changedUri",
"=",
"new",
"URI",
"(",
"scheme",
",",
"uri",
".",
"getAuthority",
... | Generates a site matcher equivalent to this one but with a different scheme.<p>
@param scheme the new scheme
@return the new site matcher | [
"Generates",
"a",
"site",
"matcher",
"equivalent",
"to",
"this",
"one",
"but",
"with",
"a",
"different",
"scheme",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteMatcher.java#L242-L254 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraPMFileWriter.java | PrimaveraPMFileWriter.populateSortedCustomFieldsList | private void populateSortedCustomFieldsList () {
"""
Populate a sorted list of custom fields to ensure that these fields
are written to the file in a consistent order.
"""
m_sortedCustomFieldsList = new ArrayList<CustomField>();
for (CustomField field : m_projectFile.getCustomFields())
{
... | java | private void populateSortedCustomFieldsList ()
{
m_sortedCustomFieldsList = new ArrayList<CustomField>();
for (CustomField field : m_projectFile.getCustomFields())
{
FieldType fieldType = field.getFieldType();
if (fieldType != null)
{
m_sortedCustomFieldsList.... | [
"private",
"void",
"populateSortedCustomFieldsList",
"(",
")",
"{",
"m_sortedCustomFieldsList",
"=",
"new",
"ArrayList",
"<",
"CustomField",
">",
"(",
")",
";",
"for",
"(",
"CustomField",
"field",
":",
"m_projectFile",
".",
"getCustomFields",
"(",
")",
")",
"{",... | Populate a sorted list of custom fields to ensure that these fields
are written to the file in a consistent order. | [
"Populate",
"a",
"sorted",
"list",
"of",
"custom",
"fields",
"to",
"ensure",
"that",
"these",
"fields",
"are",
"written",
"to",
"the",
"file",
"in",
"a",
"consistent",
"order",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraPMFileWriter.java#L1098-L1122 |
networknt/light-4j | dump/src/main/java/com/networknt/dump/DumpHelper.java | DumpHelper.logResult | static void logResult(Map<String, Object> result, DumpConfig config) {
"""
A help method to log result pojo
@param result the map contains info that needs to be logged
"""
Consumer<String> loggerFunc = getLoggerFuncBasedOnLevel(config.getLogLevel());
if(config.isUseJson()) {
logRes... | java | static void logResult(Map<String, Object> result, DumpConfig config) {
Consumer<String> loggerFunc = getLoggerFuncBasedOnLevel(config.getLogLevel());
if(config.isUseJson()) {
logResultUsingJson(result, loggerFunc);
} else {
int startLevel = -1;
StringBuilder s... | [
"static",
"void",
"logResult",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
",",
"DumpConfig",
"config",
")",
"{",
"Consumer",
"<",
"String",
">",
"loggerFunc",
"=",
"getLoggerFuncBasedOnLevel",
"(",
"config",
".",
"getLogLevel",
"(",
")",
")",
... | A help method to log result pojo
@param result the map contains info that needs to be logged | [
"A",
"help",
"method",
"to",
"log",
"result",
"pojo"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/DumpHelper.java#L39-L49 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.popupsupport/src/main/java/org/carewebframework/ui/popupsupport/PopupSupport.java | PopupSupport.eventCallback | @SuppressWarnings("deprecation")
@Override
public void eventCallback(String eventName, Object eventData) {
"""
Popup event handler - display popup dialog upon receipt.
@param eventName Name of popupEvent
@param eventData May either be an encoded string (for backward compatibility) or a PopupData
insta... | java | @SuppressWarnings("deprecation")
@Override
public void eventCallback(String eventName, Object eventData) {
try {
PopupData popupData = null;
if (eventData instanceof PopupData) {
popupData = (PopupData) eventData;
} else {
... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"Override",
"public",
"void",
"eventCallback",
"(",
"String",
"eventName",
",",
"Object",
"eventData",
")",
"{",
"try",
"{",
"PopupData",
"popupData",
"=",
"null",
";",
"if",
"(",
"eventData",
"instanc... | Popup event handler - display popup dialog upon receipt.
@param eventName Name of popupEvent
@param eventData May either be an encoded string (for backward compatibility) or a PopupData
instance. | [
"Popup",
"event",
"handler",
"-",
"display",
"popup",
"dialog",
"upon",
"receipt",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.popupsupport/src/main/java/org/carewebframework/ui/popupsupport/PopupSupport.java#L110-L138 |
gresrun/jesque | src/main/java/net/greghaines/jesque/worker/WorkerImpl.java | WorkerImpl.recoverFromException | protected void recoverFromException(final String curQueue, final Exception ex) {
"""
Handle an exception that was thrown from inside {@link #poll()}.
@param curQueue the name of the queue that was being processed when the exception was thrown
@param ex the exception that was thrown
"""
final Recove... | java | protected void recoverFromException(final String curQueue, final Exception ex) {
final RecoveryStrategy recoveryStrategy = this.exceptionHandlerRef.get().onException(this, ex, curQueue);
switch (recoveryStrategy) {
case RECONNECT:
LOG.info("Reconnecting to Redis in response to except... | [
"protected",
"void",
"recoverFromException",
"(",
"final",
"String",
"curQueue",
",",
"final",
"Exception",
"ex",
")",
"{",
"final",
"RecoveryStrategy",
"recoveryStrategy",
"=",
"this",
".",
"exceptionHandlerRef",
".",
"get",
"(",
")",
".",
"onException",
"(",
"... | Handle an exception that was thrown from inside {@link #poll()}.
@param curQueue the name of the queue that was being processed when the exception was thrown
@param ex the exception that was thrown | [
"Handle",
"an",
"exception",
"that",
"was",
"thrown",
"from",
"inside",
"{",
"@link",
"#poll",
"()",
"}",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java#L527-L558 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/interpolate/FactoryInterpolation.java | FactoryInterpolation.createPixelS | public static <T extends ImageGray<T>> InterpolatePixelS<T>
createPixelS(double min, double max, InterpolationType type, BorderType borderType , ImageDataType dataType ) {
"""
Returns {@link InterpolatePixelS} of the specified type.
@param min Minimum possible pixel value. Inclusive.
@param max Maximum possi... | java | public static <T extends ImageGray<T>> InterpolatePixelS<T>
createPixelS(double min, double max, InterpolationType type, BorderType borderType , ImageDataType dataType )
{
Class t = ImageDataType.typeToSingleClass(dataType);
return createPixelS(min,max,type,borderType,t);
} | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"InterpolatePixelS",
"<",
"T",
">",
"createPixelS",
"(",
"double",
"min",
",",
"double",
"max",
",",
"InterpolationType",
"type",
",",
"BorderType",
"borderType",
",",
"ImageDataType",
... | Returns {@link InterpolatePixelS} of the specified type.
@param min Minimum possible pixel value. Inclusive.
@param max Maximum possible pixel value. Inclusive.
@param type Type of interpolation.
@param dataType Type of gray-scale image
@return Interpolation for single band image | [
"Returns",
"{",
"@link",
"InterpolatePixelS",
"}",
"of",
"the",
"specified",
"type",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/interpolate/FactoryInterpolation.java#L46-L53 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/AbstractSQLQuery.java | AbstractSQLQuery.startContext | protected SQLListenerContextImpl startContext(Connection connection, QueryMetadata metadata) {
"""
Called to create and start a new SQL Listener context
@param connection the database connection
@param metadata the meta data for that context
@return the newly started context
"""
SQLListenerConte... | java | protected SQLListenerContextImpl startContext(Connection connection, QueryMetadata metadata) {
SQLListenerContextImpl context = new SQLListenerContextImpl(metadata, connection);
if (parentContext != null) {
context.setData(PARENT_CONTEXT, parentContext);
}
listeners.start(con... | [
"protected",
"SQLListenerContextImpl",
"startContext",
"(",
"Connection",
"connection",
",",
"QueryMetadata",
"metadata",
")",
"{",
"SQLListenerContextImpl",
"context",
"=",
"new",
"SQLListenerContextImpl",
"(",
"metadata",
",",
"connection",
")",
";",
"if",
"(",
"par... | Called to create and start a new SQL Listener context
@param connection the database connection
@param metadata the meta data for that context
@return the newly started context | [
"Called",
"to",
"create",
"and",
"start",
"a",
"new",
"SQL",
"Listener",
"context"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/AbstractSQLQuery.java#L220-L227 |
Red5/red5-io | src/main/java/org/red5/io/object/Serializer.java | Serializer.writeObjectType | @SuppressWarnings("all")
protected static boolean writeObjectType(Output out, Object obj) {
"""
Write typed object to the output
@param out
Output writer
@param obj
Object type to write
@return <tt>true</tt> if the object has been written, otherwise <tt>false</tt>
"""
if (obj instanceof Obje... | java | @SuppressWarnings("all")
protected static boolean writeObjectType(Output out, Object obj) {
if (obj instanceof ObjectMap || obj instanceof BeanMap) {
out.writeObject((Map) obj);
} else if (obj instanceof Map) {
out.writeMap((Map) obj);
} else if (obj instanceof Record... | [
"@",
"SuppressWarnings",
"(",
"\"all\"",
")",
"protected",
"static",
"boolean",
"writeObjectType",
"(",
"Output",
"out",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"ObjectMap",
"||",
"obj",
"instanceof",
"BeanMap",
")",
"{",
"out",
".",
... | Write typed object to the output
@param out
Output writer
@param obj
Object type to write
@return <tt>true</tt> if the object has been written, otherwise <tt>false</tt> | [
"Write",
"typed",
"object",
"to",
"the",
"output"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/object/Serializer.java#L330-L342 |
hawkular/hawkular-commons | hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java | WebSocketHelper.sendSync | public void sendSync(Session session, BasicMessageWithExtraData<? extends BasicMessage> message)
throws IOException {
"""
Delegates to either {@link #sendBasicMessageSync(Session, BasicMessage)} or
{@link #sendBinarySync(Session, InputStream)} based on {@code message.getBinaryData() == null}.
@para... | java | public void sendSync(Session session, BasicMessageWithExtraData<? extends BasicMessage> message)
throws IOException {
BinaryData binary = message.getBinaryData();
if (binary == null) {
sendBasicMessageSync(session, message.getBasicMessage());
} else {
// there... | [
"public",
"void",
"sendSync",
"(",
"Session",
"session",
",",
"BasicMessageWithExtraData",
"<",
"?",
"extends",
"BasicMessage",
">",
"message",
")",
"throws",
"IOException",
"{",
"BinaryData",
"binary",
"=",
"message",
".",
"getBinaryData",
"(",
")",
";",
"if",
... | Delegates to either {@link #sendBasicMessageSync(Session, BasicMessage)} or
{@link #sendBinarySync(Session, InputStream)} based on {@code message.getBinaryData() == null}.
@param session the session to send to
@param message the message to send
@throws IOException | [
"Delegates",
"to",
"either",
"{",
"@link",
"#sendBasicMessageSync",
"(",
"Session",
"BasicMessage",
")",
"}",
"or",
"{",
"@link",
"#sendBinarySync",
"(",
"Session",
"InputStream",
")",
"}",
"based",
"on",
"{",
"@code",
"message",
".",
"getBinaryData",
"()",
"=... | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java#L93-L104 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.writeAttributeList | public void writeAttributeList(OutputStream out, AttributeList value) throws IOException {
"""
Encode an AttributeList instance as JSON:
[ {
"name" : String,
"value" : POJO
}* ]
@param out The stream to write JSON to
@param value The AttributeList instance to encode. Can be null,
but its Attribute items c... | java | public void writeAttributeList(OutputStream out, AttributeList value) throws IOException {
// AttributeList has no known sub-class.
writeStartArray(out);
if (value != null) {
for (Attribute item : value.asList()) {
writeArrayItem(out);
writeStartObject... | [
"public",
"void",
"writeAttributeList",
"(",
"OutputStream",
"out",
",",
"AttributeList",
"value",
")",
"throws",
"IOException",
"{",
"// AttributeList has no known sub-class.",
"writeStartArray",
"(",
"out",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"... | Encode an AttributeList instance as JSON:
[ {
"name" : String,
"value" : POJO
}* ]
@param out The stream to write JSON to
@param value The AttributeList instance to encode. Can be null,
but its Attribute items can't be null.
@throws IOException If an I/O error occurs
@see #readAttributeList(InputStream) | [
"Encode",
"an",
"AttributeList",
"instance",
"as",
"JSON",
":",
"[",
"{",
"name",
":",
"String",
"value",
":",
"POJO",
"}",
"*",
"]"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1350-L1363 |
markzhai/AndroidPerformanceMonitor | blockcanary-android/src/main/java/com/github/moduth/blockcanary/ui/BlockCanaryUi.java | BlockCanaryUi.dpToPixel | static float dpToPixel(float dp, Resources resources) {
"""
Converts from device independent pixels (dp or dip) to
device dependent pixels. This method returns the input
multiplied by the display's density. The result is not
rounded nor clamped.
The value returned by this method is well suited for
drawing w... | java | static float dpToPixel(float dp, Resources resources) {
DisplayMetrics metrics = resources.getDisplayMetrics();
return metrics.density * dp;
} | [
"static",
"float",
"dpToPixel",
"(",
"float",
"dp",
",",
"Resources",
"resources",
")",
"{",
"DisplayMetrics",
"metrics",
"=",
"resources",
".",
"getDisplayMetrics",
"(",
")",
";",
"return",
"metrics",
".",
"density",
"*",
"dp",
";",
"}"
] | Converts from device independent pixels (dp or dip) to
device dependent pixels. This method returns the input
multiplied by the display's density. The result is not
rounded nor clamped.
The value returned by this method is well suited for
drawing with the Canvas API but should not be used to
set layout dimensions.
@p... | [
"Converts",
"from",
"device",
"independent",
"pixels",
"(",
"dp",
"or",
"dip",
")",
"to",
"device",
"dependent",
"pixels",
".",
"This",
"method",
"returns",
"the",
"input",
"multiplied",
"by",
"the",
"display",
"s",
"density",
".",
"The",
"result",
"is",
"... | train | https://github.com/markzhai/AndroidPerformanceMonitor/blob/ed688391cdf95742892ce61494736667cf5baf08/blockcanary-android/src/main/java/com/github/moduth/blockcanary/ui/BlockCanaryUi.java#L47-L50 |
alkacon/opencms-core | src/org/opencms/util/CmsFileUtil.java | CmsFileUtil.checkResources | public static void checkResources(CmsObject cms, List<String> resources) throws CmsIllegalArgumentException {
"""
Checks if all resources are present.<p>
@param cms an initialized OpenCms user context which must have read access to all resources
@param resources a list of vfs resource names to check
@throws... | java | public static void checkResources(CmsObject cms, List<String> resources) throws CmsIllegalArgumentException {
StringBuffer result = new StringBuffer(128);
ListIterator<String> it = resources.listIterator();
while (it.hasNext()) {
String resourcePath = it.next();
try {
... | [
"public",
"static",
"void",
"checkResources",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"String",
">",
"resources",
")",
"throws",
"CmsIllegalArgumentException",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"128",
")",
";",
"ListIterator",
"<... | Checks if all resources are present.<p>
@param cms an initialized OpenCms user context which must have read access to all resources
@param resources a list of vfs resource names to check
@throws CmsIllegalArgumentException in case not all resources exist or can be read with the given OpenCms user context | [
"Checks",
"if",
"all",
"resources",
"are",
"present",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsFileUtil.java#L170-L191 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/WorldGame.java | WorldGame.loadFromFile | public final void loadFromFile(Media media) {
"""
Load world from the specified file.
@param media The input media.
@throws LionEngineException If error on loading from file.
"""
try (FileReading reading = new FileReading(media))
{
loading(reading);
}
catch (fina... | java | public final void loadFromFile(Media media)
{
try (FileReading reading = new FileReading(media))
{
loading(reading);
}
catch (final IOException exception)
{
throw new LionEngineException(exception, media, "Error on loading from file !");
}
... | [
"public",
"final",
"void",
"loadFromFile",
"(",
"Media",
"media",
")",
"{",
"try",
"(",
"FileReading",
"reading",
"=",
"new",
"FileReading",
"(",
"media",
")",
")",
"{",
"loading",
"(",
"reading",
")",
";",
"}",
"catch",
"(",
"final",
"IOException",
"exc... | Load world from the specified file.
@param media The input media.
@throws LionEngineException If error on loading from file. | [
"Load",
"world",
"from",
"the",
"specified",
"file",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/WorldGame.java#L159-L169 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java | MultiChangeBuilder.insertText | public MultiChangeBuilder<PS, SEG, S> insertText(int position, String text) {
"""
Inserts the given text at the given position.
@param position The position to insert the text.
@param text The text to insert.
"""
return replaceText(position, position, text);
} | java | public MultiChangeBuilder<PS, SEG, S> insertText(int position, String text) {
return replaceText(position, position, text);
} | [
"public",
"MultiChangeBuilder",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"insertText",
"(",
"int",
"position",
",",
"String",
"text",
")",
"{",
"return",
"replaceText",
"(",
"position",
",",
"position",
",",
"text",
")",
";",
"}"
] | Inserts the given text at the given position.
@param position The position to insert the text.
@param text The text to insert. | [
"Inserts",
"the",
"given",
"text",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java#L140-L142 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/WriteOnChangeHandler.java | WriteOnChangeHandler.syncClonedListener | public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) {
"""
Set this cloned listener to the same state at this listener.
@param field The field this new listener will be added to.
@param The new listener to sync to this.
@param Has the init method been called?
@return ... | java | public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled)
{
if (!bInitCalled)
((WriteOnChangeHandler)listener).init(null, m_bRefreshAfterWrite);
return super.syncClonedListener(field, listener, true);
} | [
"public",
"boolean",
"syncClonedListener",
"(",
"BaseField",
"field",
",",
"FieldListener",
"listener",
",",
"boolean",
"bInitCalled",
")",
"{",
"if",
"(",
"!",
"bInitCalled",
")",
"(",
"(",
"WriteOnChangeHandler",
")",
"listener",
")",
".",
"init",
"(",
"null... | Set this cloned listener to the same state at this listener.
@param field The field this new listener will be added to.
@param The new listener to sync to this.
@param Has the init method been called?
@return True if I called init. | [
"Set",
"this",
"cloned",
"listener",
"to",
"the",
"same",
"state",
"at",
"this",
"listener",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/WriteOnChangeHandler.java#L69-L74 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java | VpnSitesInner.beginCreateOrUpdate | public VpnSiteInner beginCreateOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) {
"""
Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite.
@param resourceGroupName The resource group name of the VpnSite.
@param vpnSiteName The name of the VpnSi... | java | public VpnSiteInner beginCreateOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().single().body();
} | [
"public",
"VpnSiteInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vpnSiteName",
",",
"VpnSiteInner",
"vpnSiteParameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vpnSiteName",
",",
... | Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite.
@param resourceGroupName The resource group name of the VpnSite.
@param vpnSiteName The name of the VpnSite being created or updated.
@param vpnSiteParameters Parameters supplied to create or update VpnSite.
@throws IllegalArgumentExcept... | [
"Creates",
"a",
"VpnSite",
"resource",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"VpnSite",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java#L286-L288 |
HeidelTime/heideltime | src/de/unihd/dbs/uima/reader/tempeval2reader/Tempeval2Reader.java | Tempeval2Reader.addTokenAnnotation | public Integer addTokenAnnotation(String tokenString, String fileId, Integer sentId, Integer tokId, Integer positionCounter, JCas jcas) {
"""
Add token annotation to jcas
@param tokenString
@param fileId
@param tokId
@param positionCounter
@param jcas
@return
"""
Token token = new Token(jcas);
if (!(... | java | public Integer addTokenAnnotation(String tokenString, String fileId, Integer sentId, Integer tokId, Integer positionCounter, JCas jcas){
Token token = new Token(jcas);
if (!((sentId == newTokSentNumber) && (tokId == newTokSentNumber))){
if(USE_SPACES) // in chinese, there are no spaces, so the +1 correction is u... | [
"public",
"Integer",
"addTokenAnnotation",
"(",
"String",
"tokenString",
",",
"String",
"fileId",
",",
"Integer",
"sentId",
",",
"Integer",
"tokId",
",",
"Integer",
"positionCounter",
",",
"JCas",
"jcas",
")",
"{",
"Token",
"token",
"=",
"new",
"Token",
"(",
... | Add token annotation to jcas
@param tokenString
@param fileId
@param tokId
@param positionCounter
@param jcas
@return | [
"Add",
"token",
"annotation",
"to",
"jcas"
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/reader/tempeval2reader/Tempeval2Reader.java#L391-L409 |
zaproxy/zaproxy | src/org/parosproxy/paros/network/GenericMethod.java | GenericMethod.setParameter | public void setParameter(String parameterName, String parameterValue) {
"""
Sets the value of parameter with parameterName to parameterValue. This method
does not preserve the initial insertion order.
@param parameterName name of the parameter
@param parameterValue value of the parameter
@since 2.0
"""... | java | public void setParameter(String parameterName, String parameterValue) {
log.trace("enter PostMethod.setParameter(String, String)");
removeParameter(parameterName);
addParameter(parameterName, parameterValue);
} | [
"public",
"void",
"setParameter",
"(",
"String",
"parameterName",
",",
"String",
"parameterValue",
")",
"{",
"log",
".",
"trace",
"(",
"\"enter PostMethod.setParameter(String, String)\"",
")",
";",
"removeParameter",
"(",
"parameterName",
")",
";",
"addParameter",
"("... | Sets the value of parameter with parameterName to parameterValue. This method
does not preserve the initial insertion order.
@param parameterName name of the parameter
@param parameterValue value of the parameter
@since 2.0 | [
"Sets",
"the",
"value",
"of",
"parameter",
"with",
"parameterName",
"to",
"parameterValue",
".",
"This",
"method",
"does",
"not",
"preserve",
"the",
"initial",
"insertion",
"order",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/GenericMethod.java#L151-L156 |
jqm4gwt/jqm4gwt | plugins/datatables/src/main/java/com/sksamuel/jqm4gwt/plugins/datatables/JQMDataTable.java | JQMDataTable.setUseParentHeight | public void setUseParentHeight(boolean useParentHeight) {
"""
Takes all parent height. Only works when scrollY is set to some value, for example: 1px
<br> And scrollY value will be used as min-height for scrolling area.
"""
this.useParentHeight = useParentHeight;
if (this.useParentHeight) {
... | java | public void setUseParentHeight(boolean useParentHeight) {
this.useParentHeight = useParentHeight;
if (this.useParentHeight) {
if (useParentHeightDrawHandler == null) {
useParentHeightDrawHandler = new DrawHandler() {
@Override
public v... | [
"public",
"void",
"setUseParentHeight",
"(",
"boolean",
"useParentHeight",
")",
"{",
"this",
".",
"useParentHeight",
"=",
"useParentHeight",
";",
"if",
"(",
"this",
".",
"useParentHeight",
")",
"{",
"if",
"(",
"useParentHeightDrawHandler",
"==",
"null",
")",
"{"... | Takes all parent height. Only works when scrollY is set to some value, for example: 1px
<br> And scrollY value will be used as min-height for scrolling area. | [
"Takes",
"all",
"parent",
"height",
".",
"Only",
"works",
"when",
"scrollY",
"is",
"set",
"to",
"some",
"value",
"for",
"example",
":",
"1px",
"<br",
">",
"And",
"scrollY",
"value",
"will",
"be",
"used",
"as",
"min",
"-",
"height",
"for",
"scrolling",
... | train | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/plugins/datatables/src/main/java/com/sksamuel/jqm4gwt/plugins/datatables/JQMDataTable.java#L802-L824 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java | UtilWavelet.transformDimension | public static ImageDimension transformDimension( ImageBase orig , int level ) {
"""
Returns dimension which is required for the transformed image in a multilevel
wavelet transform.
"""
return transformDimension(orig.width,orig.height,level);
} | java | public static ImageDimension transformDimension( ImageBase orig , int level )
{
return transformDimension(orig.width,orig.height,level);
} | [
"public",
"static",
"ImageDimension",
"transformDimension",
"(",
"ImageBase",
"orig",
",",
"int",
"level",
")",
"{",
"return",
"transformDimension",
"(",
"orig",
".",
"width",
",",
"orig",
".",
"height",
",",
"level",
")",
";",
"}"
] | Returns dimension which is required for the transformed image in a multilevel
wavelet transform. | [
"Returns",
"dimension",
"which",
"is",
"required",
"for",
"the",
"transformed",
"image",
"in",
"a",
"multilevel",
"wavelet",
"transform",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L93-L96 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryProxy.java | UserRegistryProxy.mergeSearchResults | private SearchResult mergeSearchResults(SearchResult inDest, SearchResult source) {
"""
Merges the <code>source</code> SearchResult into the <code>dest</code> SearchResult.
The merge of the List is a union of both lists.
The merge of hasMore is via logical OR.
@param inDest SearchResult object
@param source ... | java | private SearchResult mergeSearchResults(SearchResult inDest, SearchResult source) {
List<String> list = inDest.getList();
list.addAll(source.getList());
boolean hasMore = inDest.hasMore() || source.hasMore();
return new SearchResult(list, hasMore);
} | [
"private",
"SearchResult",
"mergeSearchResults",
"(",
"SearchResult",
"inDest",
",",
"SearchResult",
"source",
")",
"{",
"List",
"<",
"String",
">",
"list",
"=",
"inDest",
".",
"getList",
"(",
")",
";",
"list",
".",
"addAll",
"(",
"source",
".",
"getList",
... | Merges the <code>source</code> SearchResult into the <code>dest</code> SearchResult.
The merge of the List is a union of both lists.
The merge of hasMore is via logical OR.
@param inDest SearchResult object
@param source SearchResult object
@return a merged SearchResult. | [
"Merges",
"the",
"<code",
">",
"source<",
"/",
"code",
">",
"SearchResult",
"into",
"the",
"<code",
">",
"dest<",
"/",
"code",
">",
"SearchResult",
".",
"The",
"merge",
"of",
"the",
"List",
"is",
"a",
"union",
"of",
"both",
"lists",
".",
"The",
"merge"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryProxy.java#L347-L352 |
facebookarchive/hadoop-20 | src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java | Gridmix.writeInputData | protected void writeInputData(long genbytes, Path ioPath)
throws IOException, InterruptedException {
"""
Write random bytes at the path provided.
@see org.apache.hadoop.mapred.gridmix.GenerateData
"""
final Configuration conf = getConf();
final GridmixJob genData = new GenerateData(conf, ioPath,... | java | protected void writeInputData(long genbytes, Path ioPath)
throws IOException, InterruptedException {
final Configuration conf = getConf();
final GridmixJob genData = new GenerateData(conf, ioPath, genbytes);
submitter.add(genData);
LOG.info("Generating " + StringUtils.humanReadableInt(genbytes) +
... | [
"protected",
"void",
"writeInputData",
"(",
"long",
"genbytes",
",",
"Path",
"ioPath",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"final",
"Configuration",
"conf",
"=",
"getConf",
"(",
")",
";",
"final",
"GridmixJob",
"genData",
"=",
"new",
... | Write random bytes at the path provided.
@see org.apache.hadoop.mapred.gridmix.GenerateData | [
"Write",
"random",
"bytes",
"at",
"the",
"path",
"provided",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java#L93-L111 |
apereo/cas | core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/TicketGrantingTicketImpl.java | TicketGrantingTicketImpl.grantServiceTicket | @Override
public synchronized ServiceTicket grantServiceTicket(final String id, final Service service, final ExpirationPolicy expirationPolicy,
final boolean credentialProvided, final boolean onlyTrackMostRecentSession) {
"""
{@inheritDoc}
<p>The state ... | java | @Override
public synchronized ServiceTicket grantServiceTicket(final String id, final Service service, final ExpirationPolicy expirationPolicy,
final boolean credentialProvided, final boolean onlyTrackMostRecentSession) {
val serviceTicket = new Servi... | [
"@",
"Override",
"public",
"synchronized",
"ServiceTicket",
"grantServiceTicket",
"(",
"final",
"String",
"id",
",",
"final",
"Service",
"service",
",",
"final",
"ExpirationPolicy",
"expirationPolicy",
",",
"final",
"boolean",
"credentialProvided",
",",
"final",
"bool... | {@inheritDoc}
<p>The state of the ticket is affected by this operation and the
ticket will be considered used. The state update subsequently may
impact the ticket expiration policy in that, depending on the policy
configuration, the ticket may be considered expired. | [
"{"
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/TicketGrantingTicketImpl.java#L151-L157 |
google/closure-templates | java/src/com/google/template/soy/sharedpasses/render/RenderVisitor.java | RenderVisitor.lazyEval | private SoyValueProvider lazyEval(final ExprNode expr, final SoyNode node) {
"""
A lazy wrapper around {@link #eval}.
<p>Useful for {@code {let ...}} and {@code {param ...}} commands where the expression may be
defined before being used.
"""
return new SoyAbstractCachingValueProvider() {
@Overrid... | java | private SoyValueProvider lazyEval(final ExprNode expr, final SoyNode node) {
return new SoyAbstractCachingValueProvider() {
@Override
protected SoyValue compute() {
return eval(expr, node);
}
@Override
public RenderResult status() {
return RenderResult.done();
}
... | [
"private",
"SoyValueProvider",
"lazyEval",
"(",
"final",
"ExprNode",
"expr",
",",
"final",
"SoyNode",
"node",
")",
"{",
"return",
"new",
"SoyAbstractCachingValueProvider",
"(",
")",
"{",
"@",
"Override",
"protected",
"SoyValue",
"compute",
"(",
")",
"{",
"return... | A lazy wrapper around {@link #eval}.
<p>Useful for {@code {let ...}} and {@code {param ...}} commands where the expression may be
defined before being used. | [
"A",
"lazy",
"wrapper",
"around",
"{",
"@link",
"#eval",
"}",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/sharedpasses/render/RenderVisitor.java#L804-L816 |
JoeKerouac/utils | src/main/java/com/joe/utils/img/ImgUtil.java | ImgUtil.compression | public static BufferedImage compression(BufferedImage src, int widthScale, int heightScale) {
"""
缩放图片
@param src 图片源
@param widthScale 宽度缩放比例
@param heightScale 高度缩放比列
@return 缩放后的图片(会变模糊)
"""
int oldWidth = src.getWidth();
int oldHeight = src.getHeight();
int width = ol... | java | public static BufferedImage compression(BufferedImage src, int widthScale, int heightScale) {
int oldWidth = src.getWidth();
int oldHeight = src.getHeight();
int width = oldWidth / widthScale + ((oldWidth % widthScale) > 0 ? 1 : 0);
int height = oldHeight / heightScale + ((oldHeight % he... | [
"public",
"static",
"BufferedImage",
"compression",
"(",
"BufferedImage",
"src",
",",
"int",
"widthScale",
",",
"int",
"heightScale",
")",
"{",
"int",
"oldWidth",
"=",
"src",
".",
"getWidth",
"(",
")",
";",
"int",
"oldHeight",
"=",
"src",
".",
"getHeight",
... | 缩放图片
@param src 图片源
@param widthScale 宽度缩放比例
@param heightScale 高度缩放比列
@return 缩放后的图片(会变模糊) | [
"缩放图片"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/img/ImgUtil.java#L177-L193 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/type/AbstractManagedType.java | AbstractManagedType.isBindable | private <E> boolean isBindable(Bindable<?> attribute, Class<E> elementType) {
"""
Checks if is bindable.
@param <E>
the element type
@param attribute
the attribute
@param elementType
the element type
@return true, if is bindable
"""
return attribute != null && attribute.getBindableJavaType().e... | java | private <E> boolean isBindable(Bindable<?> attribute, Class<E> elementType)
{
return attribute != null && attribute.getBindableJavaType().equals(elementType);
} | [
"private",
"<",
"E",
">",
"boolean",
"isBindable",
"(",
"Bindable",
"<",
"?",
">",
"attribute",
",",
"Class",
"<",
"E",
">",
"elementType",
")",
"{",
"return",
"attribute",
"!=",
"null",
"&&",
"attribute",
".",
"getBindableJavaType",
"(",
")",
".",
"equa... | Checks if is bindable.
@param <E>
the element type
@param attribute
the attribute
@param elementType
the element type
@return true, if is bindable | [
"Checks",
"if",
"is",
"bindable",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/type/AbstractManagedType.java#L1079-L1082 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/factory/AbstractObjectFactory.java | AbstractObjectFactory.resolveConstructor | protected Constructor resolveConstructor(final Class<?> objectType, final Class... parameterTypes) {
"""
Resolves the Class constructor with the given signature as determined by the parameter types.
@param objectType the Class from which the constructor is resolved.
@param parameterTypes the array of Class typ... | java | protected Constructor resolveConstructor(final Class<?> objectType, final Class... parameterTypes) {
try {
return objectType.getConstructor(parameterTypes);
}
catch (NoSuchMethodException e) {
if (!ArrayUtils.isEmpty(parameterTypes)) {
Constructor constructor = resolveCompatibleConstruct... | [
"protected",
"Constructor",
"resolveConstructor",
"(",
"final",
"Class",
"<",
"?",
">",
"objectType",
",",
"final",
"Class",
"...",
"parameterTypes",
")",
"{",
"try",
"{",
"return",
"objectType",
".",
"getConstructor",
"(",
"parameterTypes",
")",
";",
"}",
"ca... | Resolves the Class constructor with the given signature as determined by the parameter types.
@param objectType the Class from which the constructor is resolved.
@param parameterTypes the array of Class types determining the resolved constructor's signature.
@return a Constructor from the specified class with a matchi... | [
"Resolves",
"the",
"Class",
"constructor",
"with",
"the",
"given",
"signature",
"as",
"determined",
"by",
"the",
"parameter",
"types",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/factory/AbstractObjectFactory.java#L136-L151 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/WorkWrapper.java | WorkWrapper.addWorkContext | public void addWorkContext(Class<? extends WorkContext> workContextClass, WorkContext workContext) {
"""
Adds new work context.
@param workContext new work context
@param workContextClass work context class
"""
if (workContextClass == null)
{
throw new IllegalArgumentException("Work co... | java | public void addWorkContext(Class<? extends WorkContext> workContextClass, WorkContext workContext)
{
if (workContextClass == null)
{
throw new IllegalArgumentException("Work context class is null");
}
if (workContext == null)
{
throw new IllegalArgumentException("Work... | [
"public",
"void",
"addWorkContext",
"(",
"Class",
"<",
"?",
"extends",
"WorkContext",
">",
"workContextClass",
",",
"WorkContext",
"workContext",
")",
"{",
"if",
"(",
"workContextClass",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\... | Adds new work context.
@param workContext new work context
@param workContextClass work context class | [
"Adds",
"new",
"work",
"context",
"."
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/WorkWrapper.java#L522-L543 |
wwadge/bonecp | bonecp/src/main/java/com/jolbox/bonecp/BoneCPConfig.java | BoneCPConfig.setIdleMaxAge | public void setIdleMaxAge(long idleMaxAge, TimeUnit timeUnit) {
"""
Sets Idle max age.
The time, for a connection to remain unused before it is closed off. Do not use aggressive values here!
@param idleMaxAge time after which a connection is closed off
@param timeUnit idleMaxAge time granularity.
"""
th... | java | public void setIdleMaxAge(long idleMaxAge, TimeUnit timeUnit) {
this.idleMaxAgeInSeconds = TimeUnit.SECONDS.convert(idleMaxAge, checkNotNull(timeUnit));
} | [
"public",
"void",
"setIdleMaxAge",
"(",
"long",
"idleMaxAge",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"this",
".",
"idleMaxAgeInSeconds",
"=",
"TimeUnit",
".",
"SECONDS",
".",
"convert",
"(",
"idleMaxAge",
",",
"checkNotNull",
"(",
"timeUnit",
")",
")",
";",
... | Sets Idle max age.
The time, for a connection to remain unused before it is closed off. Do not use aggressive values here!
@param idleMaxAge time after which a connection is closed off
@param timeUnit idleMaxAge time granularity. | [
"Sets",
"Idle",
"max",
"age",
"."
] | train | https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/BoneCPConfig.java#L490-L492 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_regionAvailable_GET | public ArrayList<OvhAvailableRegion> project_serviceName_regionAvailable_GET(String serviceName) throws IOException {
"""
List the regions on which you can ask an access to
REST: GET /cloud/project/{serviceName}/regionAvailable
@param serviceName [required] Public Cloud project
"""
String qPath = "/cloud... | java | public ArrayList<OvhAvailableRegion> project_serviceName_regionAvailable_GET(String serviceName) throws IOException {
String qPath = "/cloud/project/{serviceName}/regionAvailable";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t18);
} | [
"public",
"ArrayList",
"<",
"OvhAvailableRegion",
">",
"project_serviceName_regionAvailable_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/regionAvailable\"",
";",
"StringBuilder",
"sb",
"=",
"p... | List the regions on which you can ask an access to
REST: GET /cloud/project/{serviceName}/regionAvailable
@param serviceName [required] Public Cloud project | [
"List",
"the",
"regions",
"on",
"which",
"you",
"can",
"ask",
"an",
"access",
"to"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1575-L1580 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java | JsiiEngine.invokeCallbackMethod | private JsonNode invokeCallbackMethod(final InvokeRequest req, final String cookie) {
"""
Invokes an override for a method.
@param req The request
@param cookie The cookie
@return The method's return value
"""
Object obj = this.getObject(req.getObjref());
Method method = this.findCallbackMet... | java | private JsonNode invokeCallbackMethod(final InvokeRequest req, final String cookie) {
Object obj = this.getObject(req.getObjref());
Method method = this.findCallbackMethod(obj.getClass(), cookie);
final Class<?>[] argTypes = method.getParameterTypes();
final Object[] args = new Object[a... | [
"private",
"JsonNode",
"invokeCallbackMethod",
"(",
"final",
"InvokeRequest",
"req",
",",
"final",
"String",
"cookie",
")",
"{",
"Object",
"obj",
"=",
"this",
".",
"getObject",
"(",
"req",
".",
"getObjref",
"(",
")",
")",
";",
"Method",
"method",
"=",
"thi... | Invokes an override for a method.
@param req The request
@param cookie The cookie
@return The method's return value | [
"Invokes",
"an",
"override",
"for",
"a",
"method",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java#L361-L372 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java | ClassUseMapper.mapAnnotations | private <T extends ProgramElementDoc> void mapAnnotations(Map<String,List<T>> map, Object doc,
T holder) {
"""
Map the AnnotationType to the ProgramElementDocs that use them as
type parameters.
@param map the map the insert the information into.
@param doc the doc whose type parameters are being c... | java | private <T extends ProgramElementDoc> void mapAnnotations(Map<String,List<T>> map, Object doc,
T holder) {
AnnotationDesc[] annotations;
boolean isPackage = false;
if (doc instanceof ProgramElementDoc) {
annotations = ((ProgramElementDoc) doc).annotations();
} els... | [
"private",
"<",
"T",
"extends",
"ProgramElementDoc",
">",
"void",
"mapAnnotations",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"T",
">",
">",
"map",
",",
"Object",
"doc",
",",
"T",
"holder",
")",
"{",
"AnnotationDesc",
"[",
"]",
"annotations",
";",
"... | Map the AnnotationType to the ProgramElementDocs that use them as
type parameters.
@param map the map the insert the information into.
@param doc the doc whose type parameters are being checked.
@param holder the holder that owns the type parameters. | [
"Map",
"the",
"AnnotationType",
"to",
"the",
"ProgramElementDocs",
"that",
"use",
"them",
"as",
"type",
"parameters",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java#L436-L457 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.serviceName_users_login_PUT | public void serviceName_users_login_PUT(String serviceName, String login, OvhUser body) throws IOException {
"""
Alter this object properties
REST: PUT /sms/{serviceName}/users/{login}
@param body [required] New object properties
@param serviceName [required] The internal name of your SMS offer
@param login ... | java | public void serviceName_users_login_PUT(String serviceName, String login, OvhUser body) throws IOException {
String qPath = "/sms/{serviceName}/users/{login}";
StringBuilder sb = path(qPath, serviceName, login);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_users_login_PUT",
"(",
"String",
"serviceName",
",",
"String",
"login",
",",
"OvhUser",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sms/{serviceName}/users/{login}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Alter this object properties
REST: PUT /sms/{serviceName}/users/{login}
@param body [required] New object properties
@param serviceName [required] The internal name of your SMS offer
@param login [required] The sms user login | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L690-L694 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirLongsSketch.java | ReservoirLongsSketch.downsampledCopy | ReservoirLongsSketch downsampledCopy(final int maxK) {
"""
temporary violation of maxK, we're avoiding violating it at all.
"""
final ReservoirLongsSketch rls = new ReservoirLongsSketch(maxK, rf_);
for (final long l: getSamples()) {
// Pretending old implicit weights are all 1. Not true in genera... | java | ReservoirLongsSketch downsampledCopy(final int maxK) {
final ReservoirLongsSketch rls = new ReservoirLongsSketch(maxK, rf_);
for (final long l: getSamples()) {
// Pretending old implicit weights are all 1. Not true in general, but they're all
// equal so update should work properly as long as we upd... | [
"ReservoirLongsSketch",
"downsampledCopy",
"(",
"final",
"int",
"maxK",
")",
"{",
"final",
"ReservoirLongsSketch",
"rls",
"=",
"new",
"ReservoirLongsSketch",
"(",
"maxK",
",",
"rf_",
")",
";",
"for",
"(",
"final",
"long",
"l",
":",
"getSamples",
"(",
")",
")... | temporary violation of maxK, we're avoiding violating it at all. | [
"temporary",
"violation",
"of",
"maxK",
"we",
"re",
"avoiding",
"violating",
"it",
"at",
"all",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirLongsSketch.java#L530-L544 |
Metatavu/edelphi | edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/querydata/QueryQuestionOptionAnswerDAO.java | QueryQuestionOptionAnswerDAO.findTextByQueryReplyAndQueryField | public String findTextByQueryReplyAndQueryField(QueryReply queryReply, QueryField queryField) {
"""
Finds answer text by query reply and query field
@param queryReply reply
@param queryField field
@return answer text
"""
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBu... | java | public String findTextByQueryReplyAndQueryField(QueryReply queryReply, QueryField queryField) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<String> criteria = criteriaBuilder.createQuery(String.class);
Root<QueryQ... | [
"public",
"String",
"findTextByQueryReplyAndQueryField",
"(",
"QueryReply",
"queryReply",
",",
"QueryField",
"queryField",
")",
"{",
"EntityManager",
"entityManager",
"=",
"getEntityManager",
"(",
")",
";",
"CriteriaBuilder",
"criteriaBuilder",
"=",
"entityManager",
".",
... | Finds answer text by query reply and query field
@param queryReply reply
@param queryField field
@return answer text | [
"Finds",
"answer",
"text",
"by",
"query",
"reply",
"and",
"query",
"field"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/querydata/QueryQuestionOptionAnswerDAO.java#L45-L63 |
pressgang-ccms/PressGangCCMSQuery | src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java | BaseFilterQueryBuilder.addSizeLessThanCondition | protected void addSizeLessThanCondition(final String propertyName, final Integer size) {
"""
Add a Field Search Condition that will check if the size of a collection in an entity is less than the specified size.
@param propertyName The name of the collection as defined in the Entity mapping class.
@param size ... | java | protected void addSizeLessThanCondition(final String propertyName, final Integer size) {
final Expression<Integer> propertySizeExpression = getCriteriaBuilder().size(getRootPath().get(propertyName).as(Set.class));
fieldConditions.add(getCriteriaBuilder().lt(propertySizeExpression, size));
} | [
"protected",
"void",
"addSizeLessThanCondition",
"(",
"final",
"String",
"propertyName",
",",
"final",
"Integer",
"size",
")",
"{",
"final",
"Expression",
"<",
"Integer",
">",
"propertySizeExpression",
"=",
"getCriteriaBuilder",
"(",
")",
".",
"size",
"(",
"getRoo... | Add a Field Search Condition that will check if the size of a collection in an entity is less than the specified size.
@param propertyName The name of the collection as defined in the Entity mapping class.
@param size The size that the collection should be less than. | [
"Add",
"a",
"Field",
"Search",
"Condition",
"that",
"will",
"check",
"if",
"the",
"size",
"of",
"a",
"collection",
"in",
"an",
"entity",
"is",
"less",
"than",
"the",
"specified",
"size",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java#L281-L284 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlUtils.java | CmsXmlUtils.unmarshalHelper | public static Document unmarshalHelper(InputSource source, EntityResolver resolver, boolean validate)
throws CmsXmlException {
"""
Helper to unmarshal (read) xml contents from an input source into a document.<p>
Using this method ensures that the OpenCms XML entity resolver is used.<p>
Important: The enc... | java | public static Document unmarshalHelper(InputSource source, EntityResolver resolver, boolean validate)
throws CmsXmlException {
if (null == source) {
throw new CmsXmlException(Messages.get().container(Messages.ERR_UNMARSHALLING_XML_DOC_1, "source==null!"));
}
try {
S... | [
"public",
"static",
"Document",
"unmarshalHelper",
"(",
"InputSource",
"source",
",",
"EntityResolver",
"resolver",
",",
"boolean",
"validate",
")",
"throws",
"CmsXmlException",
"{",
"if",
"(",
"null",
"==",
"source",
")",
"{",
"throw",
"new",
"CmsXmlException",
... | Helper to unmarshal (read) xml contents from an input source into a document.<p>
Using this method ensures that the OpenCms XML entity resolver is used.<p>
Important: The encoding provided will NOT be used during unmarshalling,
the XML parser will do this on the base of the information in the source String.
The encod... | [
"Helper",
"to",
"unmarshal",
"(",
"read",
")",
"xml",
"contents",
"from",
"an",
"input",
"source",
"into",
"a",
"document",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlUtils.java#L768-L800 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.scaleAroundLocal | public Matrix4d scaleAroundLocal(double sx, double sy, double sz, double ox, double oy, double oz) {
"""
Pre-multiply scaling to this matrix by scaling the base axes by the given sx,
sy and sz factors while using <code>(ox, oy, oz)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix ... | java | public Matrix4d scaleAroundLocal(double sx, double sy, double sz, double ox, double oy, double oz) {
return scaleAroundLocal(sx, sy, sz, ox, oy, oz, this);
} | [
"public",
"Matrix4d",
"scaleAroundLocal",
"(",
"double",
"sx",
",",
"double",
"sy",
",",
"double",
"sz",
",",
"double",
"ox",
",",
"double",
"oy",
",",
"double",
"oz",
")",
"{",
"return",
"scaleAroundLocal",
"(",
"sx",
",",
"sy",
",",
"sz",
",",
"ox",
... | Pre-multiply scaling to this matrix by scaling the base axes by the given sx,
sy and sz factors while using <code>(ox, oy, oz)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>S * M</code>. So when transforming a
vec... | [
"Pre",
"-",
"multiply",
"scaling",
"to",
"this",
"matrix",
"by",
"scaling",
"the",
"base",
"axes",
"by",
"the",
"given",
"sx",
"sy",
"and",
"sz",
"factors",
"while",
"using",
"<code",
">",
"(",
"ox",
"oy",
"oz",
")",
"<",
"/",
"code",
">",
"as",
"t... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L4656-L4658 |
Samsung/GearVRf | GVRf/Extensions/3DCursor/3DCursorLibrary/src/main/java/org/gearvrf/io/cursor3d/Cursor.java | Cursor.setPosition | public void setPosition(float x, float y, float z) {
"""
Set a new Cursor position if active and enabled.
@param x x value of the position
@param y y value of the position
@param z z value of the position
"""
if (isActive()) {
mIODevice.setPosition(x, y, z);
}
} | java | public void setPosition(float x, float y, float z) {
if (isActive()) {
mIODevice.setPosition(x, y, z);
}
} | [
"public",
"void",
"setPosition",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"if",
"(",
"isActive",
"(",
")",
")",
"{",
"mIODevice",
".",
"setPosition",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
"}",
"}"
] | Set a new Cursor position if active and enabled.
@param x x value of the position
@param y y value of the position
@param z z value of the position | [
"Set",
"a",
"new",
"Cursor",
"position",
"if",
"active",
"and",
"enabled",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/3DCursor/3DCursorLibrary/src/main/java/org/gearvrf/io/cursor3d/Cursor.java#L201-L205 |
thorntail/thorntail | plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java | GradleDependencyResolutionHelper.determinePluginVersion | public static String determinePluginVersion() {
"""
Parse the plugin definition file and extract the version details from it.
"""
if (pluginVersion == null) {
final String fileName = "META-INF/gradle-plugins/thorntail.properties";
ClassLoader loader = Thread.currentThread().getC... | java | public static String determinePluginVersion() {
if (pluginVersion == null) {
final String fileName = "META-INF/gradle-plugins/thorntail.properties";
ClassLoader loader = Thread.currentThread().getContextClassLoader();
String version;
try (InputStream stream = load... | [
"public",
"static",
"String",
"determinePluginVersion",
"(",
")",
"{",
"if",
"(",
"pluginVersion",
"==",
"null",
")",
"{",
"final",
"String",
"fileName",
"=",
"\"META-INF/gradle-plugins/thorntail.properties\"",
";",
"ClassLoader",
"loader",
"=",
"Thread",
".",
"curr... | Parse the plugin definition file and extract the version details from it. | [
"Parse",
"the",
"plugin",
"definition",
"file",
"and",
"extract",
"the",
"version",
"details",
"from",
"it",
"."
] | train | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java#L67-L82 |
openengsb/openengsb | api/ekb/src/main/java/org/openengsb/core/ekb/api/transformation/TransformationDescription.java | TransformationDescription.padField | public void padField(String sourceField, String targetField, String length, String character, String direction) {
"""
Adds a pad step to the transformation description. The source and the target field need to be of String type.
Performs padding operation on the string of the source field and writes the result to ... | java | public void padField(String sourceField, String targetField, String length, String character, String direction) {
TransformationStep step = new TransformationStep();
step.setSourceFields(sourceField);
step.setTargetField(targetField);
step.setOperationParameter(TransformationConstants.PA... | [
"public",
"void",
"padField",
"(",
"String",
"sourceField",
",",
"String",
"targetField",
",",
"String",
"length",
",",
"String",
"character",
",",
"String",
"direction",
")",
"{",
"TransformationStep",
"step",
"=",
"new",
"TransformationStep",
"(",
")",
";",
... | Adds a pad step to the transformation description. The source and the target field need to be of String type.
Performs padding operation on the string of the source field and writes the result to the target field. The
length describes to which size the padding should be done, the pad character describes which character... | [
"Adds",
"a",
"pad",
"step",
"to",
"the",
"transformation",
"description",
".",
"The",
"source",
"and",
"the",
"target",
"field",
"need",
"to",
"be",
"of",
"String",
"type",
".",
"Performs",
"padding",
"operation",
"on",
"the",
"string",
"of",
"the",
"sourc... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/transformation/TransformationDescription.java#L244-L253 |
BlueBrain/bluima | modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java | diff_match_patch.match_main | public static int match_main(String text, String pattern, int loc) {
"""
Locate the best instance of 'pattern' in 'text' near 'loc'. Returns -1 if
no match found.
@param text
The text to search.
@param pattern
The pattern to search for.
@param loc
The location to search around.
@return Best match index o... | java | public static int match_main(String text, String pattern, int loc) {
// Check for null inputs.
if (text == null || pattern == null) {
throw new IllegalArgumentException("Null inputs. (match_main)");
}
loc = Math.max(0, Math.min(loc, text.length()));
if (text.equals(p... | [
"public",
"static",
"int",
"match_main",
"(",
"String",
"text",
",",
"String",
"pattern",
",",
"int",
"loc",
")",
"{",
"// Check for null inputs.",
"if",
"(",
"text",
"==",
"null",
"||",
"pattern",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExce... | Locate the best instance of 'pattern' in 'text' near 'loc'. Returns -1 if
no match found.
@param text
The text to search.
@param pattern
The pattern to search for.
@param loc
The location to search around.
@return Best match index or -1. | [
"Locate",
"the",
"best",
"instance",
"of",
"pattern",
"in",
"text",
"near",
"loc",
".",
"Returns",
"-",
"1",
"if",
"no",
"match",
"found",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java#L1681-L1703 |
kite-sdk/kite | kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/manager/DefaultSchemaManager.java | DefaultSchemaManager.getManagedSchema | private ManagedSchema getManagedSchema(String tableName, String entityName) {
"""
Get the ManagedSchema entity for the tableName, entityName managed schema.
@param tableName
The table name of the managed schema.
@param entityName
The entity name of the managed schema.
@return The ManagedSchema entity
@thro... | java | private ManagedSchema getManagedSchema(String tableName, String entityName) {
ManagedSchema managedSchema = getManagedSchemaFromSchemaMap(tableName,
entityName);
if (managedSchema == null) {
refreshManagedSchemaCache(tableName, entityName);
managedSchema = getManagedSchemaFromSchemaMap(table... | [
"private",
"ManagedSchema",
"getManagedSchema",
"(",
"String",
"tableName",
",",
"String",
"entityName",
")",
"{",
"ManagedSchema",
"managedSchema",
"=",
"getManagedSchemaFromSchemaMap",
"(",
"tableName",
",",
"entityName",
")",
";",
"if",
"(",
"managedSchema",
"==",
... | Get the ManagedSchema entity for the tableName, entityName managed schema.
@param tableName
The table name of the managed schema.
@param entityName
The entity name of the managed schema.
@return The ManagedSchema entity
@throws SchemaNotFoundException | [
"Get",
"the",
"ManagedSchema",
"entity",
"for",
"the",
"tableName",
"entityName",
"managed",
"schema",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/manager/DefaultSchemaManager.java#L487-L500 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/engine/TemplateManager.java | TemplateManager.applyPreProcessorsIfNeeded | private TemplateModel applyPreProcessorsIfNeeded(final ITemplateContext context, final TemplateModel templateModel) {
"""
/*
This method manually applies preprocessors to template models that have just been parsed or obtained from
cache. This is needed for fragments, just before these fragments (coming from temp... | java | private TemplateModel applyPreProcessorsIfNeeded(final ITemplateContext context, final TemplateModel templateModel) {
final TemplateData templateData = templateModel.getTemplateData();
if (this.configuration.getPreProcessors(templateData.getTemplateMode()).isEmpty()) {
return templateModel... | [
"private",
"TemplateModel",
"applyPreProcessorsIfNeeded",
"(",
"final",
"ITemplateContext",
"context",
",",
"final",
"TemplateModel",
"templateModel",
")",
"{",
"final",
"TemplateData",
"templateData",
"=",
"templateModel",
".",
"getTemplateData",
"(",
")",
";",
"if",
... | /*
This method manually applies preprocessors to template models that have just been parsed or obtained from
cache. This is needed for fragments, just before these fragments (coming from templates, not simply parsed
text) are returned to whoever needs them (usually the fragment insertion mechanism).
NOTE that PRE-PROC... | [
"/",
"*",
"This",
"method",
"manually",
"applies",
"preprocessors",
"to",
"template",
"models",
"that",
"have",
"just",
"been",
"parsed",
"or",
"obtained",
"from",
"cache",
".",
"This",
"is",
"needed",
"for",
"fragments",
"just",
"before",
"these",
"fragments"... | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/engine/TemplateManager.java#L345-L366 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/reflection/Reflector.java | Reflector.translateArrayIndex | private int translateArrayIndex(int index, int length) throws ReflectorException {
"""
Utility method that translates an array index, either positive or negative,
into its positive representation. The method ensures that the index is within
array bounds, then it translates negative indexes to their positive
cou... | java | private int translateArrayIndex(int index, int length) throws ReflectorException {
if(!(index > 0 ? index < length : Math.abs(index) <= Math.abs(length))) {
logger.error("index ({}) must be less than number of elements ({})", index, length);
throw new ReflectorException("index must be less than number of elemen... | [
"private",
"int",
"translateArrayIndex",
"(",
"int",
"index",
",",
"int",
"length",
")",
"throws",
"ReflectorException",
"{",
"if",
"(",
"!",
"(",
"index",
">",
"0",
"?",
"index",
"<",
"length",
":",
"Math",
".",
"abs",
"(",
"index",
")",
"<=",
"Math",... | Utility method that translates an array index, either positive or negative,
into its positive representation. The method ensures that the index is within
array bounds, then it translates negative indexes to their positive
counterparts according to the simple rule that element at index -1 is the
last element in the arra... | [
"Utility",
"method",
"that",
"translates",
"an",
"array",
"index",
"either",
"positive",
"or",
"negative",
"into",
"its",
"positive",
"representation",
".",
"The",
"method",
"ensures",
"that",
"the",
"index",
"is",
"within",
"array",
"bounds",
"then",
"it",
"t... | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/reflection/Reflector.java#L463-L478 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/Utils.java | Utils.stringifyPrompts | public static String stringifyPrompts(Prompt[] prompts) {
"""
Stringify an array of {@link Prompt}.
@param prompts
An array of {@link Prompt}. If {@code null} is given,
{@code null} is returned.
@return
A string containing lower-case prompt names using
white spaces as the delimiter.
@since 2.5
"""... | java | public static String stringifyPrompts(Prompt[] prompts)
{
if (prompts == null)
{
return null;
}
String[] array = new String[prompts.length];
for (int i = 0; i < prompts.length; ++i)
{
array[i] = (prompts[i] == null) ? null : prompt... | [
"public",
"static",
"String",
"stringifyPrompts",
"(",
"Prompt",
"[",
"]",
"prompts",
")",
"{",
"if",
"(",
"prompts",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"[",
"]",
"array",
"=",
"new",
"String",
"[",
"prompts",
".",
"length",
... | Stringify an array of {@link Prompt}.
@param prompts
An array of {@link Prompt}. If {@code null} is given,
{@code null} is returned.
@return
A string containing lower-case prompt names using
white spaces as the delimiter.
@since 2.5 | [
"Stringify",
"an",
"array",
"of",
"{",
"@link",
"Prompt",
"}",
"."
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/Utils.java#L226-L241 |
HtmlUnit/htmlunit-cssparser | src/main/java/com/gargoylesoftware/css/parser/ParserUtils.java | ParserUtils.trimBy | public static String trimBy(final StringBuilder s, final int left, final int right) {
"""
Remove the given number of chars from start and end.
There is no parameter checking, the caller has to take care of this.
@param s the StringBuilder
@param left no of chars to be removed from start
@param right no of ch... | java | public static String trimBy(final StringBuilder s, final int left, final int right) {
return s.substring(left, s.length() - right);
} | [
"public",
"static",
"String",
"trimBy",
"(",
"final",
"StringBuilder",
"s",
",",
"final",
"int",
"left",
",",
"final",
"int",
"right",
")",
"{",
"return",
"s",
".",
"substring",
"(",
"left",
",",
"s",
".",
"length",
"(",
")",
"-",
"right",
")",
";",
... | Remove the given number of chars from start and end.
There is no parameter checking, the caller has to take care of this.
@param s the StringBuilder
@param left no of chars to be removed from start
@param right no of chars to be removed from end
@return the trimmed string | [
"Remove",
"the",
"given",
"number",
"of",
"chars",
"from",
"start",
"and",
"end",
".",
"There",
"is",
"no",
"parameter",
"checking",
"the",
"caller",
"has",
"to",
"take",
"care",
"of",
"this",
"."
] | train | https://github.com/HtmlUnit/htmlunit-cssparser/blob/384e4170737169b5b4c87c5766495d9b8a6d3866/src/main/java/com/gargoylesoftware/css/parser/ParserUtils.java#L36-L38 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/DatagramChannelImpl.java | DatagramChannelImpl.translateAndSetInterestOps | public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) {
"""
Translates an interest operation set into a native poll event set
"""
int newOps = 0;
if ((ops & SelectionKey.OP_READ) != 0)
newOps |= PollArrayWrapper.POLLIN;
if ((ops & SelectionKey.OP_WRITE) != 0)... | java | public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) {
int newOps = 0;
if ((ops & SelectionKey.OP_READ) != 0)
newOps |= PollArrayWrapper.POLLIN;
if ((ops & SelectionKey.OP_WRITE) != 0)
newOps |= PollArrayWrapper.POLLOUT;
if ((ops & SelectionKey.OP... | [
"public",
"void",
"translateAndSetInterestOps",
"(",
"int",
"ops",
",",
"SelectionKeyImpl",
"sk",
")",
"{",
"int",
"newOps",
"=",
"0",
";",
"if",
"(",
"(",
"ops",
"&",
"SelectionKey",
".",
"OP_READ",
")",
"!=",
"0",
")",
"newOps",
"|=",
"PollArrayWrapper",... | Translates an interest operation set into a native poll event set | [
"Translates",
"an",
"interest",
"operation",
"set",
"into",
"a",
"native",
"poll",
"event",
"set"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/DatagramChannelImpl.java#L876-L886 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/spi/impl/eventservice/impl/EventServiceSegment.java | EventServiceSegment.pingNotifiableEventListenerInternal | private void pingNotifiableEventListenerInternal(Object object, String topic, Registration registration, boolean register) {
"""
Notifies the object of an event in the lifecycle of the listener. The listener may have
been registered or deregistered. The object must implement {@link NotifiableEventListener} if
it... | java | private void pingNotifiableEventListenerInternal(Object object, String topic, Registration registration, boolean register) {
if (!(object instanceof NotifiableEventListener)) {
return;
}
NotifiableEventListener listener = ((NotifiableEventListener) object);
if (register) {
... | [
"private",
"void",
"pingNotifiableEventListenerInternal",
"(",
"Object",
"object",
",",
"String",
"topic",
",",
"Registration",
"registration",
",",
"boolean",
"register",
")",
"{",
"if",
"(",
"!",
"(",
"object",
"instanceof",
"NotifiableEventListener",
")",
")",
... | Notifies the object of an event in the lifecycle of the listener. The listener may have
been registered or deregistered. The object must implement {@link NotifiableEventListener} if
it wants to be notified.
@param object the object to notified. It must implement {@link NotifiableEventListener} to be notified
@pa... | [
"Notifies",
"the",
"object",
"of",
"an",
"event",
"in",
"the",
"lifecycle",
"of",
"the",
"listener",
".",
"The",
"listener",
"may",
"have",
"been",
"registered",
"or",
"deregistered",
".",
"The",
"object",
"must",
"implement",
"{",
"@link",
"NotifiableEventLis... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/eventservice/impl/EventServiceSegment.java#L101-L112 |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/system/ProcessorUtils.java | ProcessorUtils.getNumCores | public static int getNumCores() {
"""
http://stackoverflow.com/questions/7962155/how-can-you-detect-a-dual-core-cpu-on-an-android-device-from-code
Gets the number of cores available in this device, across all processors.
Requires: Ability to peruse the file system at "/sys/devices/system/cpu"
@return The number... | java | public static int getNumCores() {
//Private Class to display only CPU devices in the directory listing
class CpuFilter implements FileFilter {
@Override
public boolean accept(File pathname) {
//Check if filename is "cpu", followed by a single digit number
if(Pattern.matches("cpu[0-9]", pathname... | [
"public",
"static",
"int",
"getNumCores",
"(",
")",
"{",
"//Private Class to display only CPU devices in the directory listing",
"class",
"CpuFilter",
"implements",
"FileFilter",
"{",
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"File",
"pathname",
")",
"{",
"//... | http://stackoverflow.com/questions/7962155/how-can-you-detect-a-dual-core-cpu-on-an-android-device-from-code
Gets the number of cores available in this device, across all processors.
Requires: Ability to peruse the file system at "/sys/devices/system/cpu"
@return The number of cores, or Runtime.getRuntime().availablePr... | [
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"7962155",
"/",
"how",
"-",
"can",
"-",
"you",
"-",
"detect",
"-",
"a",
"-",
"dual",
"-",
"core",
"-",
"cpu",
"-",
"on",
"-",
"an",
"-",
"android",
"-",
"device",
"-",
"from",... | train | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/system/ProcessorUtils.java#L16-L47 |
jayantk/jklol | src/com/jayantkrish/jklol/cfg/CfgParser.java | CfgParser.parseMarginal | public CfgParseChart parseMarginal(List<?> terminals, Object root, boolean useSumProduct) {
"""
Compute the marginal distribution over all grammar entries conditioned on
the given sequence of terminals.
"""
CfgParseChart chart = createParseChart(terminals, useSumProduct);
Factor rootFactor = TableFact... | java | public CfgParseChart parseMarginal(List<?> terminals, Object root, boolean useSumProduct) {
CfgParseChart chart = createParseChart(terminals, useSumProduct);
Factor rootFactor = TableFactor.pointDistribution(parentVar,
parentVar.outcomeArrayToAssignment(root));
return marginal(chart, terminals, root... | [
"public",
"CfgParseChart",
"parseMarginal",
"(",
"List",
"<",
"?",
">",
"terminals",
",",
"Object",
"root",
",",
"boolean",
"useSumProduct",
")",
"{",
"CfgParseChart",
"chart",
"=",
"createParseChart",
"(",
"terminals",
",",
"useSumProduct",
")",
";",
"Factor",
... | Compute the marginal distribution over all grammar entries conditioned on
the given sequence of terminals. | [
"Compute",
"the",
"marginal",
"distribution",
"over",
"all",
"grammar",
"entries",
"conditioned",
"on",
"the",
"given",
"sequence",
"of",
"terminals",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParser.java#L133-L138 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.sendDTMF | public void sendDTMF(String connId, String digits) throws WorkspaceApiException {
"""
Send DTMF digits to the specified call. You can send DTMF digits individually with multiple requests or together with multiple digits in one request.
@param connId The connection ID of the call.
@param digits The DTMF digits to... | java | public void sendDTMF(String connId, String digits) throws WorkspaceApiException {
this.sendDTMF(connId, digits, null, null);
} | [
"public",
"void",
"sendDTMF",
"(",
"String",
"connId",
",",
"String",
"digits",
")",
"throws",
"WorkspaceApiException",
"{",
"this",
".",
"sendDTMF",
"(",
"connId",
",",
"digits",
",",
"null",
",",
"null",
")",
";",
"}"
] | Send DTMF digits to the specified call. You can send DTMF digits individually with multiple requests or together with multiple digits in one request.
@param connId The connection ID of the call.
@param digits The DTMF digits to send to the call. | [
"Send",
"DTMF",
"digits",
"to",
"the",
"specified",
"call",
".",
"You",
"can",
"send",
"DTMF",
"digits",
"individually",
"with",
"multiple",
"requests",
"or",
"together",
"with",
"multiple",
"digits",
"in",
"one",
"request",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L1124-L1126 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java | Task.transitionState | private boolean transitionState(ExecutionState currentState, ExecutionState newState, Throwable cause) {
"""
Try to transition the execution state from the current state to the new state.
@param currentState of the execution
@param newState of the execution
@param cause of the transition change or null
@retu... | java | private boolean transitionState(ExecutionState currentState, ExecutionState newState, Throwable cause) {
if (STATE_UPDATER.compareAndSet(this, currentState, newState)) {
if (cause == null) {
LOG.info("{} ({}) switched from {} to {}.", taskNameWithSubtask, executionId, currentState, newState);
} else {
L... | [
"private",
"boolean",
"transitionState",
"(",
"ExecutionState",
"currentState",
",",
"ExecutionState",
"newState",
",",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"STATE_UPDATER",
".",
"compareAndSet",
"(",
"this",
",",
"currentState",
",",
"newState",
")",
")",
... | Try to transition the execution state from the current state to the new state.
@param currentState of the execution
@param newState of the execution
@param cause of the transition change or null
@return true if the transition was successful, otherwise false | [
"Try",
"to",
"transition",
"the",
"execution",
"state",
"from",
"the",
"current",
"state",
"to",
"the",
"new",
"state",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java#L962-L974 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/price/Price.java | Price.createFromNetAmount | @Nonnull
public static Price createFromNetAmount (@Nonnull final ECurrency eCurrency,
@Nonnull final BigDecimal aNetAmount,
@Nonnull final IVATItem aVATItem) {
"""
Create a price from a net amount.
@param eCurrency
Currency... | java | @Nonnull
public static Price createFromNetAmount (@Nonnull final ECurrency eCurrency,
@Nonnull final BigDecimal aNetAmount,
@Nonnull final IVATItem aVATItem)
{
return new Price (eCurrency, aNetAmount, aVATItem);
} | [
"@",
"Nonnull",
"public",
"static",
"Price",
"createFromNetAmount",
"(",
"@",
"Nonnull",
"final",
"ECurrency",
"eCurrency",
",",
"@",
"Nonnull",
"final",
"BigDecimal",
"aNetAmount",
",",
"@",
"Nonnull",
"final",
"IVATItem",
"aVATItem",
")",
"{",
"return",
"new",... | Create a price from a net amount.
@param eCurrency
Currency to use. May not be <code>null</code>.
@param aNetAmount
The net amount to use. May not be <code>null</code>.
@param aVATItem
The VAT item to use. May not be <code>null</code>.
@return The created {@link Price} | [
"Create",
"a",
"price",
"from",
"a",
"net",
"amount",
"."
] | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/price/Price.java#L229-L235 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.segmentMax | public SDVariable segmentMax(String name, SDVariable data, SDVariable segmentIds) {
"""
Segment max operation.<br>
If data = [3, 6, 1, 4, 9, 2, 8]<br>
segmentIds = [0, 0, 1, 1, 1, 2, 2]<br>
then output = [6, 9, 8] = [max(3,6), max(1,4,9), max(2,8)]<br>
Note that the segment IDs must be sorted from smalles... | java | public SDVariable segmentMax(String name, SDVariable data, SDVariable segmentIds) {
validateNumerical("segmentMax", "data", data);
validateInteger("segmentMax", "segmentIds", segmentIds);
SDVariable ret = f().segmentMax(data, segmentIds);
return updateVariableNameAndReference(ret, name);... | [
"public",
"SDVariable",
"segmentMax",
"(",
"String",
"name",
",",
"SDVariable",
"data",
",",
"SDVariable",
"segmentIds",
")",
"{",
"validateNumerical",
"(",
"\"segmentMax\"",
",",
"\"data\"",
",",
"data",
")",
";",
"validateInteger",
"(",
"\"segmentMax\"",
",",
... | Segment max operation.<br>
If data = [3, 6, 1, 4, 9, 2, 8]<br>
segmentIds = [0, 0, 1, 1, 1, 2, 2]<br>
then output = [6, 9, 8] = [max(3,6), max(1,4,9), max(2,8)]<br>
Note that the segment IDs must be sorted from smallest to largest segment.
See {@link #unsortedSegmentMax(String, SDVariable, SDVariable, int)}
for th... | [
"Segment",
"max",
"operation",
".",
"<br",
">",
"If",
"data",
"=",
"[",
"3",
"6",
"1",
"4",
"9",
"2",
"8",
"]",
"<br",
">",
"segmentIds",
"=",
"[",
"0",
"0",
"1",
"1",
"1",
"2",
"2",
"]",
"<br",
">",
"then",
"output",
"=",
"[",
"6",
"9",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L2214-L2219 |
aws/aws-sdk-java | aws-java-sdk-iot1clickprojects/src/main/java/com/amazonaws/services/iot1clickprojects/model/CreatePlacementRequest.java | CreatePlacementRequest.withAttributes | public CreatePlacementRequest withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
Optional user-defined key/value pairs providing contextual data (such as location or function) for the placement.
</p>
@param attributes
Optional user-defined key/value pairs providing contextual data (such as lo... | java | public CreatePlacementRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"CreatePlacementRequest",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Optional user-defined key/value pairs providing contextual data (such as location or function) for the placement.
</p>
@param attributes
Optional user-defined key/value pairs providing contextual data (such as location or function) for the
placement.
@return Returns a reference to this object so that method calls ... | [
"<p",
">",
"Optional",
"user",
"-",
"defined",
"key",
"/",
"value",
"pairs",
"providing",
"contextual",
"data",
"(",
"such",
"as",
"location",
"or",
"function",
")",
"for",
"the",
"placement",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot1clickprojects/src/main/java/com/amazonaws/services/iot1clickprojects/model/CreatePlacementRequest.java#L165-L168 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/internal/InternalWindowProcessFunction.java | InternalWindowProcessFunction.open | public void open(Context<K, W> ctx) throws Exception {
"""
Initialization method for the function. It is called before the actual working methods.
"""
this.ctx = ctx;
this.windowAssigner.open(ctx);
} | java | public void open(Context<K, W> ctx) throws Exception {
this.ctx = ctx;
this.windowAssigner.open(ctx);
} | [
"public",
"void",
"open",
"(",
"Context",
"<",
"K",
",",
"W",
">",
"ctx",
")",
"throws",
"Exception",
"{",
"this",
".",
"ctx",
"=",
"ctx",
";",
"this",
".",
"windowAssigner",
".",
"open",
"(",
"ctx",
")",
";",
"}"
] | Initialization method for the function. It is called before the actual working methods. | [
"Initialization",
"method",
"for",
"the",
"function",
".",
"It",
"is",
"called",
"before",
"the",
"actual",
"working",
"methods",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/internal/InternalWindowProcessFunction.java#L58-L61 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/concurrent/JRebirth.java | JRebirth.runIntoJTPSync | public static void runIntoJTPSync(final JRebirthRunnable runnable, final long... timeout) {
"""
Run into the JRebirth Thread Pool [JTP] <b>Synchronously</b>.
Be careful this method can be called through any thread.
@param runnable the task to run
@param timeout the optional timeout value after which the thr... | java | public static void runIntoJTPSync(final JRebirthRunnable runnable, final long... timeout) {
final SyncRunnable sync = new SyncRunnable(runnable);
if (JRebirth.isJTPSlot()) {
// We are into a JTP slot so just run it synchronously
sync.run();
// Be careful in this case... | [
"public",
"static",
"void",
"runIntoJTPSync",
"(",
"final",
"JRebirthRunnable",
"runnable",
",",
"final",
"long",
"...",
"timeout",
")",
"{",
"final",
"SyncRunnable",
"sync",
"=",
"new",
"SyncRunnable",
"(",
"runnable",
")",
";",
"if",
"(",
"JRebirth",
".",
... | Run into the JRebirth Thread Pool [JTP] <b>Synchronously</b>.
Be careful this method can be called through any thread.
@param runnable the task to run
@param timeout the optional timeout value after which the thread will be released (default is 1000 ms) | [
"Run",
"into",
"the",
"JRebirth",
"Thread",
"Pool",
"[",
"JTP",
"]",
"<b",
">",
"Synchronously<",
"/",
"b",
">",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/concurrent/JRebirth.java#L392-L405 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.searchSynonyms | public JSONObject searchSynonyms(SynonymQuery query, RequestOptions requestOptions) throws AlgoliaException, JSONException {
"""
Search for synonyms
@param query the query
@param requestOptions Options to pass to this request
"""
JSONObject body = new JSONObject().put("query", query.getQuerySt... | java | public JSONObject searchSynonyms(SynonymQuery query, RequestOptions requestOptions) throws AlgoliaException, JSONException {
JSONObject body = new JSONObject().put("query", query.getQueryString());
if (query.hasTypes()) {
StringBuilder type = new StringBuilder();
boolean first = true;
for (Syn... | [
"public",
"JSONObject",
"searchSynonyms",
"(",
"SynonymQuery",
"query",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
",",
"JSONException",
"{",
"JSONObject",
"body",
"=",
"new",
"JSONObject",
"(",
")",
".",
"put",
"(",
"\"query\"",
"... | Search for synonyms
@param query the query
@param requestOptions Options to pass to this request | [
"Search",
"for",
"synonyms"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1431-L1453 |
sebastiangraf/treetank | interfacemodules/filelistener/src/main/java/org/treetank/filelistener/file/Filelistener.java | Filelistener.watchParents | private void watchParents(Path p, String until) throws IOException {
"""
Watch parent folders of this file until the root listener path has been
reached.
@param p
@param until
@throws IOException
"""
if (p.getParent() != null && !until.equals(p.getParent().toString())) {
watchDir(p.ge... | java | private void watchParents(Path p, String until) throws IOException {
if (p.getParent() != null && !until.equals(p.getParent().toString())) {
watchDir(p.getParent().toFile());
watchParents(p.getParent(), until);
}
} | [
"private",
"void",
"watchParents",
"(",
"Path",
"p",
",",
"String",
"until",
")",
"throws",
"IOException",
"{",
"if",
"(",
"p",
".",
"getParent",
"(",
")",
"!=",
"null",
"&&",
"!",
"until",
".",
"equals",
"(",
"p",
".",
"getParent",
"(",
")",
".",
... | Watch parent folders of this file until the root listener path has been
reached.
@param p
@param until
@throws IOException | [
"Watch",
"parent",
"folders",
"of",
"this",
"file",
"until",
"the",
"root",
"listener",
"path",
"has",
"been",
"reached",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/filelistener/src/main/java/org/treetank/filelistener/file/Filelistener.java#L201-L206 |
carewebframework/carewebframework-core | org.carewebframework.help-parent/org.carewebframework.help.lucene/src/main/java/org/carewebframework/help/lucene/HelpSearchService.java | HelpSearchService.indexDocument | private void indexDocument(HelpModule helpModule, Resource resource) throws Exception {
"""
Index an HTML text file resource.
@param helpModule The help module owning the resource.
@param resource The HTML text file resource.
@throws Exception Unspecified exception.
"""
String title = getTitle(res... | java | private void indexDocument(HelpModule helpModule, Resource resource) throws Exception {
String title = getTitle(resource);
try (InputStream is = resource.getInputStream()) {
Document document = new Document();
document.add(new TextField("module", helpModule.getLocalizedI... | [
"private",
"void",
"indexDocument",
"(",
"HelpModule",
"helpModule",
",",
"Resource",
"resource",
")",
"throws",
"Exception",
"{",
"String",
"title",
"=",
"getTitle",
"(",
"resource",
")",
";",
"try",
"(",
"InputStream",
"is",
"=",
"resource",
".",
"getInputSt... | Index an HTML text file resource.
@param helpModule The help module owning the resource.
@param resource The HTML text file resource.
@throws Exception Unspecified exception. | [
"Index",
"an",
"HTML",
"text",
"file",
"resource",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.lucene/src/main/java/org/carewebframework/help/lucene/HelpSearchService.java#L305-L317 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyTypeRegistry.java | PropertyTypeRegistry.add | public void add(String typeName, PropertySerializer<?> serializer, Class<? extends PropertyEditorBase<?>> editorClass) {
"""
Registers a property type.
@param typeName The name of the property type as used in the plug-in declaration.
@param serializer Serializer for this property type (may be null).
@param ed... | java | public void add(String typeName, PropertySerializer<?> serializer, Class<? extends PropertyEditorBase<?>> editorClass) {
if (get(typeName) == null) {
register(new PropertyType(typeName, serializer, editorClass));
}
} | [
"public",
"void",
"add",
"(",
"String",
"typeName",
",",
"PropertySerializer",
"<",
"?",
">",
"serializer",
",",
"Class",
"<",
"?",
"extends",
"PropertyEditorBase",
"<",
"?",
">",
">",
"editorClass",
")",
"{",
"if",
"(",
"get",
"(",
"typeName",
")",
"=="... | Registers a property type.
@param typeName The name of the property type as used in the plug-in declaration.
@param serializer Serializer for this property type (may be null).
@param editorClass The property editor class to use to edit this property's value. | [
"Registers",
"a",
"property",
"type",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyTypeRegistry.java#L94-L98 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java | ImageLoader.loadImageSync | public Bitmap loadImageSync(String uri, ImageSize targetImageSize) {
"""
Loads and decodes image synchronously.<br />
Default display image options
{@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) from
configuration} will be used.<br />
<b>NOTE:</b> {@link #init(Imag... | java | public Bitmap loadImageSync(String uri, ImageSize targetImageSize) {
return loadImageSync(uri, targetImageSize, null);
} | [
"public",
"Bitmap",
"loadImageSync",
"(",
"String",
"uri",
",",
"ImageSize",
"targetImageSize",
")",
"{",
"return",
"loadImageSync",
"(",
"uri",
",",
"targetImageSize",
",",
"null",
")",
";",
"}"
] | Loads and decodes image synchronously.<br />
Default display image options
{@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) from
configuration} will be used.<br />
<b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call
@param uri ... | [
"Loads",
"and",
"decodes",
"image",
"synchronously",
".",
"<br",
"/",
">",
"Default",
"display",
"image",
"options",
"{",
"@linkplain",
"ImageLoaderConfiguration",
".",
"Builder#defaultDisplayImageOptions",
"(",
"DisplayImageOptions",
")",
"from",
"configuration",
"}",
... | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java#L576-L578 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.getTypeReferenceForName | protected static Type getTypeReferenceForName(String className, String... genericTypes) {
"""
Returns the Type reference corresponding to the given class.
@param className The class name
@param genericTypes The generic types
@return The {@link Type}
"""
String referenceString = getTypeDescripto... | java | protected static Type getTypeReferenceForName(String className, String... genericTypes) {
String referenceString = getTypeDescriptor(className, genericTypes);
return Type.getType(referenceString);
} | [
"protected",
"static",
"Type",
"getTypeReferenceForName",
"(",
"String",
"className",
",",
"String",
"...",
"genericTypes",
")",
"{",
"String",
"referenceString",
"=",
"getTypeDescriptor",
"(",
"className",
",",
"genericTypes",
")",
";",
"return",
"Type",
".",
"ge... | Returns the Type reference corresponding to the given class.
@param className The class name
@param genericTypes The generic types
@return The {@link Type} | [
"Returns",
"the",
"Type",
"reference",
"corresponding",
"to",
"the",
"given",
"class",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L404-L407 |
jenkinsci/github-plugin | src/main/java/com/cloudbees/jenkins/GitHubWebHook.java | GitHubWebHook.doIndex | @SuppressWarnings("unused")
@RequirePostWithGHHookPayload
public void doIndex(@Nonnull @GHEventHeader GHEvent event, @Nonnull @GHEventPayload String payload) {
"""
Receives the webhook call
@param event GH event type. Never null
@param payload Payload from hook. Never blank
"""
GHSubscrib... | java | @SuppressWarnings("unused")
@RequirePostWithGHHookPayload
public void doIndex(@Nonnull @GHEventHeader GHEvent event, @Nonnull @GHEventPayload String payload) {
GHSubscriberEvent subscriberEvent =
new GHSubscriberEvent(SCMEvent.originOf(Stapler.getCurrentRequest()), event, payload);
... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"@",
"RequirePostWithGHHookPayload",
"public",
"void",
"doIndex",
"(",
"@",
"Nonnull",
"@",
"GHEventHeader",
"GHEvent",
"event",
",",
"@",
"Nonnull",
"@",
"GHEventPayload",
"String",
"payload",
")",
"{",
"GHSubscrib... | Receives the webhook call
@param event GH event type. Never null
@param payload Payload from hook. Never blank | [
"Receives",
"the",
"webhook",
"call"
] | train | https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/com/cloudbees/jenkins/GitHubWebHook.java#L117-L125 |
mike706574/java-map-support | src/main/java/fun/mike/map/alpha/Get.java | Get.requiredString | public static <T> String requiredString(Map<String, T> map, String key) {
"""
Validates that the value from {@code map} for the given {@code key} is
present and a string. Returns the value when valid; otherwise, throws an
{@code IllegalArgumentException}.
@param map a map
@param key a key
@param <T> the type ... | java | public static <T> String requiredString(Map<String, T> map, String key) {
return requiredStringOfType(map, key, "string");
} | [
"public",
"static",
"<",
"T",
">",
"String",
"requiredString",
"(",
"Map",
"<",
"String",
",",
"T",
">",
"map",
",",
"String",
"key",
")",
"{",
"return",
"requiredStringOfType",
"(",
"map",
",",
"key",
",",
"\"string\"",
")",
";",
"}"
] | Validates that the value from {@code map} for the given {@code key} is
present and a string. Returns the value when valid; otherwise, throws an
{@code IllegalArgumentException}.
@param map a map
@param key a key
@param <T> the type of value
@return the string value
@throws java.util.NoSuchElementException if the requir... | [
"Validates",
"that",
"the",
"value",
"from",
"{"
] | train | https://github.com/mike706574/java-map-support/blob/7cb09f34c24adfaca73ad25a3c3e05abec72eafe/src/main/java/fun/mike/map/alpha/Get.java#L87-L89 |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/Batch.java | Batch.createFetcher | private Later<JsonNode> createFetcher() {
"""
Constructs the batch query and executes it, possibly asynchronously.
@return an asynchronous handle to the raw batch result, whatever it may be.
"""
final RequestBuilder call = new GraphRequestBuilder(getGraphEndpoint(), HttpMethod.POST, this.timeout, this.retr... | java | private Later<JsonNode> createFetcher() {
final RequestBuilder call = new GraphRequestBuilder(getGraphEndpoint(), HttpMethod.POST, this.timeout, this.retries);
// This actually creates the correct JSON structure as an array
String batchValue = JSONUtils.toJSON(this.graphRequests, this.mapper);
if (log.i... | [
"private",
"Later",
"<",
"JsonNode",
">",
"createFetcher",
"(",
")",
"{",
"final",
"RequestBuilder",
"call",
"=",
"new",
"GraphRequestBuilder",
"(",
"getGraphEndpoint",
"(",
")",
",",
"HttpMethod",
".",
"POST",
",",
"this",
".",
"timeout",
",",
"this",
".",
... | Constructs the batch query and executes it, possibly asynchronously.
@return an asynchronous handle to the raw batch result, whatever it may be. | [
"Constructs",
"the",
"batch",
"query",
"and",
"executes",
"it",
"possibly",
"asynchronously",
"."
] | train | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L398-L442 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/TypesafeConfigUtils.java | TypesafeConfigUtils.getValueList | public static ConfigList getValueList(Config config, String path) {
"""
Get a configuration as list of Values. Return {@code null} if missing or wrong type.
@param config
@param path
@return
"""
try {
return config.getList(path);
} catch (ConfigException.Missing | ConfigExcepti... | java | public static ConfigList getValueList(Config config, String path) {
try {
return config.getList(path);
} catch (ConfigException.Missing | ConfigException.WrongType e) {
if (e instanceof ConfigException.WrongType) {
LOGGER.warn(e.getMessage(), e);
}
... | [
"public",
"static",
"ConfigList",
"getValueList",
"(",
"Config",
"config",
",",
"String",
"path",
")",
"{",
"try",
"{",
"return",
"config",
".",
"getList",
"(",
"path",
")",
";",
"}",
"catch",
"(",
"ConfigException",
".",
"Missing",
"|",
"ConfigException",
... | Get a configuration as list of Values. Return {@code null} if missing or wrong type.
@param config
@param path
@return | [
"Get",
"a",
"configuration",
"as",
"list",
"of",
"Values",
".",
"Return",
"{",
"@code",
"null",
"}",
"if",
"missing",
"or",
"wrong",
"type",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/TypesafeConfigUtils.java#L912-L921 |
rubenlagus/TelegramBots | telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/BaseAbilityBot.java | BaseAbilityBot.reportCommands | public Ability reportCommands() {
"""
<p>
Format of the report:
<p>
[command1] - [description1]
<p>
[command2] - [description2]
<p>
...
<p>
Once you invoke it, the bot will send the available commands to the chat. This is a public ability so anyone can invoke it.
<p>
Usage: <code>/commands</code>
@re... | java | public Ability reportCommands() {
return builder()
.name(REPORT)
.locality(ALL)
.privacy(CREATOR)
.input(0)
.action(ctx -> {
String commands = abilities.entrySet().stream()
.filter(entry -> nonNull(entry.getValue().info()))
.map(entry -> ... | [
"public",
"Ability",
"reportCommands",
"(",
")",
"{",
"return",
"builder",
"(",
")",
".",
"name",
"(",
"REPORT",
")",
".",
"locality",
"(",
"ALL",
")",
".",
"privacy",
"(",
"CREATOR",
")",
".",
"input",
"(",
"0",
")",
".",
"action",
"(",
"ctx",
"->... | <p>
Format of the report:
<p>
[command1] - [description1]
<p>
[command2] - [description2]
<p>
...
<p>
Once you invoke it, the bot will send the available commands to the chat. This is a public ability so anyone can invoke it.
<p>
Usage: <code>/commands</code>
@return the ability to report commands defined by the child... | [
"<p",
">",
"Format",
"of",
"the",
"report",
":",
"<p",
">",
"[",
"command1",
"]",
"-",
"[",
"description1",
"]",
"<p",
">",
"[",
"command2",
"]",
"-",
"[",
"description2",
"]",
"<p",
">",
"...",
"<p",
">",
"Once",
"you",
"invoke",
"it",
"the",
"b... | train | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/BaseAbilityBot.java#L304-L325 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/view/MotionEventUtils.java | MotionEventUtils.getVerticalMotionDirection | public static MotionDirection getVerticalMotionDirection(MotionEvent e1, MotionEvent e2, float threshold) {
"""
Calculate the vertical move motion direction.
@param e1 start point of the motion.
@param e2 end point of the motion.
@param threshold threshold to detect the motion.
@return the motion direction for... | java | public static MotionDirection getVerticalMotionDirection(MotionEvent e1, MotionEvent e2, float threshold) {
float delta = getVerticalMotionRawDelta(e1, e2);
return getVerticalMotionDirection(delta, threshold);
} | [
"public",
"static",
"MotionDirection",
"getVerticalMotionDirection",
"(",
"MotionEvent",
"e1",
",",
"MotionEvent",
"e2",
",",
"float",
"threshold",
")",
"{",
"float",
"delta",
"=",
"getVerticalMotionRawDelta",
"(",
"e1",
",",
"e2",
")",
";",
"return",
"getVertical... | Calculate the vertical move motion direction.
@param e1 start point of the motion.
@param e2 end point of the motion.
@param threshold threshold to detect the motion.
@return the motion direction for the vertical axis. | [
"Calculate",
"the",
"vertical",
"move",
"motion",
"direction",
"."
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/view/MotionEventUtils.java#L96-L99 |
aws/aws-sdk-java | aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/MessageMD5ChecksumHandler.java | MessageMD5ChecksumHandler.updateLengthAndBytes | private static void updateLengthAndBytes(MessageDigest digest, ByteBuffer binaryValue) {
"""
Update the digest using a sequence of bytes that consists of the length (in 4 bytes) of the
input ByteBuffer and all the bytes it contains.
"""
ByteBuffer readOnlyBuffer = binaryValue.asReadOnlyBuffer();
... | java | private static void updateLengthAndBytes(MessageDigest digest, ByteBuffer binaryValue) {
ByteBuffer readOnlyBuffer = binaryValue.asReadOnlyBuffer();
int size = readOnlyBuffer.remaining();
ByteBuffer lengthBytes = ByteBuffer.allocate(INTEGER_SIZE_IN_BYTES).putInt(size);
digest.update(leng... | [
"private",
"static",
"void",
"updateLengthAndBytes",
"(",
"MessageDigest",
"digest",
",",
"ByteBuffer",
"binaryValue",
")",
"{",
"ByteBuffer",
"readOnlyBuffer",
"=",
"binaryValue",
".",
"asReadOnlyBuffer",
"(",
")",
";",
"int",
"size",
"=",
"readOnlyBuffer",
".",
... | Update the digest using a sequence of bytes that consists of the length (in 4 bytes) of the
input ByteBuffer and all the bytes it contains. | [
"Update",
"the",
"digest",
"using",
"a",
"sequence",
"of",
"bytes",
"that",
"consists",
"of",
"the",
"length",
"(",
"in",
"4",
"bytes",
")",
"of",
"the",
"input",
"ByteBuffer",
"and",
"all",
"the",
"bytes",
"it",
"contains",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/MessageMD5ChecksumHandler.java#L280-L286 |
elvishew/xLog | library/src/main/java/com/elvishew/xlog/flattener/PatternFlattener.java | PatternFlattener.parseLevelParameter | static LevelFiller parseLevelParameter(String wrappedParameter, String trimmedParameter) {
"""
Try to create a level filler if the given parameter is a level parameter.
@return created level filler, or null if the given parameter is not a level parameter
"""
if (trimmedParameter.equals(PARAMETER_LEVEL_S... | java | static LevelFiller parseLevelParameter(String wrappedParameter, String trimmedParameter) {
if (trimmedParameter.equals(PARAMETER_LEVEL_SHORT)) {
return new LevelFiller(wrappedParameter, trimmedParameter, false);
} else if (trimmedParameter.equals(PARAMETER_LEVEL_LONG)) {
return new LevelFiller(wrapp... | [
"static",
"LevelFiller",
"parseLevelParameter",
"(",
"String",
"wrappedParameter",
",",
"String",
"trimmedParameter",
")",
"{",
"if",
"(",
"trimmedParameter",
".",
"equals",
"(",
"PARAMETER_LEVEL_SHORT",
")",
")",
"{",
"return",
"new",
"LevelFiller",
"(",
"wrappedPa... | Try to create a level filler if the given parameter is a level parameter.
@return created level filler, or null if the given parameter is not a level parameter | [
"Try",
"to",
"create",
"a",
"level",
"filler",
"if",
"the",
"given",
"parameter",
"is",
"a",
"level",
"parameter",
"."
] | train | https://github.com/elvishew/xLog/blob/c6fb95555ce619d3e527f5ba6c45d4d247c5a838/library/src/main/java/com/elvishew/xlog/flattener/PatternFlattener.java#L207-L214 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.createPolygonOptions | public static PolygonOptions createPolygonOptions(FeatureStyle featureStyle, float density) {
"""
Create new polygon options populated with the feature style
@param featureStyle feature style
@param density display density: {@link android.util.DisplayMetrics#density}
@return polygon options populated wit... | java | public static PolygonOptions createPolygonOptions(FeatureStyle featureStyle, float density) {
PolygonOptions polygonOptions = new PolygonOptions();
setFeatureStyle(polygonOptions, featureStyle, density);
return polygonOptions;
} | [
"public",
"static",
"PolygonOptions",
"createPolygonOptions",
"(",
"FeatureStyle",
"featureStyle",
",",
"float",
"density",
")",
"{",
"PolygonOptions",
"polygonOptions",
"=",
"new",
"PolygonOptions",
"(",
")",
";",
"setFeatureStyle",
"(",
"polygonOptions",
",",
"featu... | Create new polygon options populated with the feature style
@param featureStyle feature style
@param density display density: {@link android.util.DisplayMetrics#density}
@return polygon options populated with the feature style | [
"Create",
"new",
"polygon",
"options",
"populated",
"with",
"the",
"feature",
"style"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L551-L557 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/util/ShareSheetStyle.java | ShareSheetStyle.setMoreOptionStyle | public ShareSheetStyle setMoreOptionStyle(Drawable icon, String label) {
"""
<p> Set the icon and label for the option to expand the application list to see more options.
Default label is set to "More" </p>
@param icon Drawable to set as the icon for more option. Default icon is system menu_more icon.
@param... | java | public ShareSheetStyle setMoreOptionStyle(Drawable icon, String label) {
moreOptionIcon_ = icon;
moreOptionText_ = label;
return this;
} | [
"public",
"ShareSheetStyle",
"setMoreOptionStyle",
"(",
"Drawable",
"icon",
",",
"String",
"label",
")",
"{",
"moreOptionIcon_",
"=",
"icon",
";",
"moreOptionText_",
"=",
"label",
";",
"return",
"this",
";",
"}"
] | <p> Set the icon and label for the option to expand the application list to see more options.
Default label is set to "More" </p>
@param icon Drawable to set as the icon for more option. Default icon is system menu_more icon.
@param label A {@link String} with value for the more option label. Default label is "More"
... | [
"<p",
">",
"Set",
"the",
"icon",
"and",
"label",
"for",
"the",
"option",
"to",
"expand",
"the",
"application",
"list",
"to",
"see",
"more",
"options",
".",
"Default",
"label",
"is",
"set",
"to",
"More",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/ShareSheetStyle.java#L90-L94 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.