repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 194 | func_name stringlengths 6 111 | whole_func_string stringlengths 80 3.8k | language stringclasses 1
value | func_code_string stringlengths 80 3.8k | func_code_tokens listlengths 20 697 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 434 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
drewnoakes/metadata-extractor | Source/com/drew/metadata/Directory.java | Directory.setDate | public void setDate(int tagType, @NotNull java.util.Date value)
{
setObject(tagType, value);
} | java | public void setDate(int tagType, @NotNull java.util.Date value)
{
setObject(tagType, value);
} | [
"public",
"void",
"setDate",
"(",
"int",
"tagType",
",",
"@",
"NotNull",
"java",
".",
"util",
".",
"Date",
"value",
")",
"{",
"setObject",
"(",
"tagType",
",",
"value",
")",
";",
"}"
] | Sets a <code>java.util.Date</code> value for the specified tag.
@param tagType the tag's value as an int
@param value the value for the specified tag as a java.util.Date | [
"Sets",
"a",
"<code",
">",
"java",
".",
"util",
".",
"Date<",
"/",
"code",
">",
"value",
"for",
"the",
"specified",
"tag",
"."
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/metadata/Directory.java#L341-L344 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/BillingApi.java | BillingApi.updatePlan | public BillingPlanUpdateResponse updatePlan(String accountId, BillingPlanInformation billingPlanInformation, BillingApi.UpdatePlanOptions options) throws ApiException {
Object localVarPostBody = billingPlanInformation;
// verify the required parameter 'accountId' is set
if (accountId == null) {
... | java | public BillingPlanUpdateResponse updatePlan(String accountId, BillingPlanInformation billingPlanInformation, BillingApi.UpdatePlanOptions options) throws ApiException {
Object localVarPostBody = billingPlanInformation;
// verify the required parameter 'accountId' is set
if (accountId == null) {
... | [
"public",
"BillingPlanUpdateResponse",
"updatePlan",
"(",
"String",
"accountId",
",",
"BillingPlanInformation",
"billingPlanInformation",
",",
"BillingApi",
".",
"UpdatePlanOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localVarPostBody",
"=",
"billingP... | Updates the account billing plan.
Updates the billing plan information, billing address, and credit card information for the specified account.
@param accountId The external account number (int) or account ID Guid. (required)
@param billingPlanInformation (optional)
@param options for modifying the method behavior.
@r... | [
"Updates",
"the",
"account",
"billing",
"plan",
".",
"Updates",
"the",
"billing",
"plan",
"information",
"billing",
"address",
"and",
"credit",
"card",
"information",
"for",
"the",
"specified",
"account",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/BillingApi.java#L705-L741 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java | BigDecimalMath.acoth | public static BigDecimal acoth(BigDecimal x, MathContext mathContext) {
checkMathContext(mathContext);
MathContext mc = new MathContext(mathContext.getPrecision() + 6, mathContext.getRoundingMode());
BigDecimal result = log(x.add(ONE, mc).divide(x.subtract(ONE, mc), mc), mc).divide(TWO, mc);
return round(result... | java | public static BigDecimal acoth(BigDecimal x, MathContext mathContext) {
checkMathContext(mathContext);
MathContext mc = new MathContext(mathContext.getPrecision() + 6, mathContext.getRoundingMode());
BigDecimal result = log(x.add(ONE, mc).divide(x.subtract(ONE, mc), mc), mc).divide(TWO, mc);
return round(result... | [
"public",
"static",
"BigDecimal",
"acoth",
"(",
"BigDecimal",
"x",
",",
"MathContext",
"mathContext",
")",
"{",
"checkMathContext",
"(",
"mathContext",
")",
";",
"MathContext",
"mc",
"=",
"new",
"MathContext",
"(",
"mathContext",
".",
"getPrecision",
"(",
")",
... | Calculates the arc hyperbolic cotangens (inverse hyperbolic cotangens) of {@link BigDecimal} x.
<p>See: <a href="https://en.wikipedia.org/wiki/Hyperbolic_function">Wikipedia: Hyperbolic function</a></p>
@param x the {@link BigDecimal} to calculate the arc hyperbolic cotangens for
@param mathContext the {@link MathCon... | [
"Calculates",
"the",
"arc",
"hyperbolic",
"cotangens",
"(",
"inverse",
"hyperbolic",
"cotangens",
")",
"of",
"{",
"@link",
"BigDecimal",
"}",
"x",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java#L1659-L1664 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.beginGetAzureReachabilityReportAsync | public Observable<AzureReachabilityReportInner> beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) {
return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func... | java | public Observable<AzureReachabilityReportInner> beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) {
return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func... | [
"public",
"Observable",
"<",
"AzureReachabilityReportInner",
">",
"beginGetAzureReachabilityReportAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"AzureReachabilityReportParameters",
"parameters",
")",
"{",
"return",
"beginGetAzureReachabilit... | Gets the relative latency score for internet service providers from a specified location to Azure regions.
@param resourceGroupName The name of the network watcher resource group.
@param networkWatcherName The name of the network watcher resource.
@param parameters Parameters that determine Azure reachability report c... | [
"Gets",
"the",
"relative",
"latency",
"score",
"for",
"internet",
"service",
"providers",
"from",
"a",
"specified",
"location",
"to",
"Azure",
"regions",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L2410-L2417 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/ShakeAroundAPI.java | ShakeAroundAPI.deviceSearch | public static DeviceSearchResult deviceSearch(String accessToken,
DeviceSearch deviceSearch) {
return deviceSearch(accessToken, JsonUtil.toJSONString(deviceSearch));
} | java | public static DeviceSearchResult deviceSearch(String accessToken,
DeviceSearch deviceSearch) {
return deviceSearch(accessToken, JsonUtil.toJSONString(deviceSearch));
} | [
"public",
"static",
"DeviceSearchResult",
"deviceSearch",
"(",
"String",
"accessToken",
",",
"DeviceSearch",
"deviceSearch",
")",
"{",
"return",
"deviceSearch",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"deviceSearch",
")",
")",
";",
"}"
] | 查询设备列表
@param accessToken accessToken
@param deviceSearch deviceSearch
@return result | [
"查询设备列表"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ShakeAroundAPI.java#L506-L509 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/JsonRequestHandler.java | JsonRequestHandler.checkForModifiedSince | protected void checkForModifiedSince(MBeanServerExecutor pServerManager, JmxRequest pRequest)
throws NotChangedException {
int ifModifiedSince = pRequest.getParameterAsInt(ConfigKey.IF_MODIFIED_SINCE);
if (!pServerManager.hasMBeansListChangedSince(ifModifiedSince)) {
throw new No... | java | protected void checkForModifiedSince(MBeanServerExecutor pServerManager, JmxRequest pRequest)
throws NotChangedException {
int ifModifiedSince = pRequest.getParameterAsInt(ConfigKey.IF_MODIFIED_SINCE);
if (!pServerManager.hasMBeansListChangedSince(ifModifiedSince)) {
throw new No... | [
"protected",
"void",
"checkForModifiedSince",
"(",
"MBeanServerExecutor",
"pServerManager",
",",
"JmxRequest",
"pRequest",
")",
"throws",
"NotChangedException",
"{",
"int",
"ifModifiedSince",
"=",
"pRequest",
".",
"getParameterAsInt",
"(",
"ConfigKey",
".",
"IF_MODIFIED_S... | Check, whether the set of MBeans for any managed MBeanServer has been change since the timestamp
provided in the given request
@param pServerManager manager for all MBeanServers
@param pRequest the request from where to fetch the timestamp
@throws NotChangedException if there has been no REGISTER/UNREGISTER notificatio... | [
"Check",
"whether",
"the",
"set",
"of",
"MBeans",
"for",
"any",
"managed",
"MBeanServer",
"has",
"been",
"change",
"since",
"the",
"timestamp",
"provided",
"in",
"the",
"given",
"request"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/JsonRequestHandler.java#L208-L214 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/mem/serial/SDatabase.java | SDatabase.makeNewPTable | public PTable makeNewPTable(FieldList record, Object lookupKey)
{
InputStream istream = null;
try
{
if (lookupKey instanceof String)
istream = this.openSerialStream(record, (String)lookupKey);
if (istream != null)
{
ObjectIn... | java | public PTable makeNewPTable(FieldList record, Object lookupKey)
{
InputStream istream = null;
try
{
if (lookupKey instanceof String)
istream = this.openSerialStream(record, (String)lookupKey);
if (istream != null)
{
ObjectIn... | [
"public",
"PTable",
"makeNewPTable",
"(",
"FieldList",
"record",
",",
"Object",
"lookupKey",
")",
"{",
"InputStream",
"istream",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"lookupKey",
"instanceof",
"String",
")",
"istream",
"=",
"this",
".",
"openSerialStream",... | Create a raw data table for this table.
@param table The table to create a raw data table for.
@param key The lookup key that will be passed (on initialization) to the new raw data table.
@return The new raw data table. | [
"Create",
"a",
"raw",
"data",
"table",
"for",
"this",
"table",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/mem/serial/SDatabase.java#L67-L95 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.updateRelationsForResource | public void updateRelationsForResource(CmsRequestContext context, CmsResource resource, List<CmsLink> relations)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.updateRelationsForResource(dbc, resource, relations);
} catch... | java | public void updateRelationsForResource(CmsRequestContext context, CmsResource resource, List<CmsLink> relations)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.updateRelationsForResource(dbc, resource, relations);
} catch... | [
"public",
"void",
"updateRelationsForResource",
"(",
"CmsRequestContext",
"context",
",",
"CmsResource",
"resource",
",",
"List",
"<",
"CmsLink",
">",
"relations",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext... | Updates/Creates the relations for the given resource.<p>
@param context the current user context
@param resource the resource to update the relations for
@param relations the relations to update
@throws CmsException if something goes wrong
@see CmsDriverManager#updateRelationsForResource(CmsDbContext, CmsResource, L... | [
"Updates",
"/",
"Creates",
"the",
"relations",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L6490-L6504 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/LocalUnitsManager.java | LocalUnitsManager.unitMap | public static <T> T unitMap(Function<Map<String, List<Unit>>, T> function) {
readWriteLock.readLock().lock();
try {
return function.apply(Collections.unmodifiableMap(unitMap));
} finally {
readWriteLock.readLock().unlock();
}
} | java | public static <T> T unitMap(Function<Map<String, List<Unit>>, T> function) {
readWriteLock.readLock().lock();
try {
return function.apply(Collections.unmodifiableMap(unitMap));
} finally {
readWriteLock.readLock().unlock();
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"unitMap",
"(",
"Function",
"<",
"Map",
"<",
"String",
",",
"List",
"<",
"Unit",
">",
">",
",",
"T",
">",
"function",
")",
"{",
"readWriteLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",... | Iterate the {@link #unitMap local unit map} thread-safely.
This iteration is for you to read the map, not to modify the map.
@param function the function whatever you want to do with the unit map. | [
"Iterate",
"the",
"{",
"@link",
"#unitMap",
"local",
"unit",
"map",
"}",
"thread",
"-",
"safely",
".",
"This",
"iteration",
"is",
"for",
"you",
"to",
"read",
"the",
"map",
"not",
"to",
"modify",
"the",
"map",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/LocalUnitsManager.java#L213-L220 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.matchCondition | public SDVariable matchCondition(SDVariable in, Condition condition) {
return matchCondition(null, in, condition);
} | java | public SDVariable matchCondition(SDVariable in, Condition condition) {
return matchCondition(null, in, condition);
} | [
"public",
"SDVariable",
"matchCondition",
"(",
"SDVariable",
"in",
",",
"Condition",
"condition",
")",
"{",
"return",
"matchCondition",
"(",
"null",
",",
"in",
",",
"condition",
")",
";",
"}"
] | Returns a boolean mask of equal shape to the input, where the condition is satisfied - value 1 where satisfied, 0 otherwise
@param in Input variable
@param condition Condition
@return Boolean mask mariable | [
"Returns",
"a",
"boolean",
"mask",
"of",
"equal",
"shape",
"to",
"the",
"input",
"where",
"the",
"condition",
"is",
"satisfied",
"-",
"value",
"1",
"where",
"satisfied",
"0",
"otherwise"
] | 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#L974-L976 |
motown-io/motown | ocpp/websocket-json/src/main/java/io/motown/ocpp/websocketjson/wamp/WampMessageParser.java | WampMessageParser.parseMessage | public WampMessage parseMessage(ChargingStationId chargingStationId, Reader reader) throws IOException {
String rawMessage = this.convertToString(reader);
String trimmedMessage = this.removeBrackets(rawMessage);
//In case a payload is present, it always is the last part of the message
i... | java | public WampMessage parseMessage(ChargingStationId chargingStationId, Reader reader) throws IOException {
String rawMessage = this.convertToString(reader);
String trimmedMessage = this.removeBrackets(rawMessage);
//In case a payload is present, it always is the last part of the message
i... | [
"public",
"WampMessage",
"parseMessage",
"(",
"ChargingStationId",
"chargingStationId",
",",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"String",
"rawMessage",
"=",
"this",
".",
"convertToString",
"(",
"reader",
")",
";",
"String",
"trimmedMessage",
"=",... | Parses a CALL, RESULT, or ERROR message and constructs a WampMessage
@param chargingStationId sending the message
@param reader containing the message
@return WampMessage
@throws IOException in case the message could not be read
@throws IllegalArgumentException in case an unknown wamp messageType is encountered | [
"Parses",
"a",
"CALL",
"RESULT",
"or",
"ERROR",
"message",
"and",
"constructs",
"a",
"WampMessage"
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/ocpp/websocket-json/src/main/java/io/motown/ocpp/websocketjson/wamp/WampMessageParser.java#L42-L86 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java | HtmlTableRendererBase.renderCaptionFacet | protected void renderCaptionFacet(FacesContext facesContext, ResponseWriter writer, UIComponent component)
throws IOException
{
HtmlRendererUtils.renderTableCaption(facesContext, writer, component);
} | java | protected void renderCaptionFacet(FacesContext facesContext, ResponseWriter writer, UIComponent component)
throws IOException
{
HtmlRendererUtils.renderTableCaption(facesContext, writer, component);
} | [
"protected",
"void",
"renderCaptionFacet",
"(",
"FacesContext",
"facesContext",
",",
"ResponseWriter",
"writer",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"HtmlRendererUtils",
".",
"renderTableCaption",
"(",
"facesContext",
",",
"writer",
",",
... | Renders the caption facet.
@param facesContext the <code>FacesContext</code>.
@param writer the <code>ResponseWriter</code>.
@param component the parent <code>UIComponent</code> containing the facets.
@throws IOException if an exception occurs. | [
"Renders",
"the",
"caption",
"facet",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java#L220-L224 |
grails/grails-core | grails-encoder/src/main/groovy/org/grails/encoder/AbstractEncodedAppender.java | AbstractEncodedAppender.encodeAndWrite | protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, CharSequence input)
throws IOException {
Object encoded = encoder.encode(input);
if (encoded != null) {
String encodedStr = String.valueOf(encoded);
write(newEncodingState, encodedStr, 0, e... | java | protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, CharSequence input)
throws IOException {
Object encoded = encoder.encode(input);
if (encoded != null) {
String encodedStr = String.valueOf(encoded);
write(newEncodingState, encodedStr, 0, e... | [
"protected",
"void",
"encodeAndWrite",
"(",
"Encoder",
"encoder",
",",
"EncodingState",
"newEncodingState",
",",
"CharSequence",
"input",
")",
"throws",
"IOException",
"{",
"Object",
"encoded",
"=",
"encoder",
".",
"encode",
"(",
"input",
")",
";",
"if",
"(",
... | Encode and write input to buffer using a non-streaming encoder
@param encoder
the encoder to use
@param newEncodingState
the new encoding state after encoder has been applied
@param input
the input CharSequence
@throws IOException
Signals that an I/O exception has occurred. | [
"Encode",
"and",
"write",
"input",
"to",
"buffer",
"using",
"a",
"non",
"-",
"streaming",
"encoder"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/encoder/AbstractEncodedAppender.java#L192-L199 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.setFooter | public EmbedBuilder setFooter(String text, InputStream icon) {
delegate.setFooter(text, icon);
return this;
} | java | public EmbedBuilder setFooter(String text, InputStream icon) {
delegate.setFooter(text, icon);
return this;
} | [
"public",
"EmbedBuilder",
"setFooter",
"(",
"String",
"text",
",",
"InputStream",
"icon",
")",
"{",
"delegate",
".",
"setFooter",
"(",
"text",
",",
"icon",
")",
";",
"return",
"this",
";",
"}"
] | Sets the footer of the embed.
This method assumes the file type is "png"!
@param text The text of the footer.
@param icon The footer's icon.
@return The current instance in order to chain call methods. | [
"Sets",
"the",
"footer",
"of",
"the",
"embed",
".",
"This",
"method",
"assumes",
"the",
"file",
"type",
"is",
"png",
"!"
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L156-L159 |
threerings/nenya | core/src/main/java/com/threerings/media/AbstractMediaManager.java | AbstractMediaManager.viewLocationDidChange | public void viewLocationDidChange (int dx, int dy)
{
// let our media know
for (int ii = 0, ll = _media.size(); ii < ll; ii++) {
_media.get(ii).viewLocationDidChange(dx, dy);
}
} | java | public void viewLocationDidChange (int dx, int dy)
{
// let our media know
for (int ii = 0, ll = _media.size(); ii < ll; ii++) {
_media.get(ii).viewLocationDidChange(dx, dy);
}
} | [
"public",
"void",
"viewLocationDidChange",
"(",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"// let our media know",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"ll",
"=",
"_media",
".",
"size",
"(",
")",
";",
"ii",
"<",
"ll",
";",
"ii",
"++",
")",
"{",
... | Called by a {@link VirtualMediaPanel} when the view that contains our media is scrolled.
@param dx the scrolled distance in the x direction (in pixels).
@param dy the scrolled distance in the y direction (in pixels). | [
"Called",
"by",
"a",
"{",
"@link",
"VirtualMediaPanel",
"}",
"when",
"the",
"view",
"that",
"contains",
"our",
"media",
"is",
"scrolled",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMediaManager.java#L151-L157 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/aromaticity/Aromaticity.java | Aromaticity.findBonds | public Set<IBond> findBonds(IAtomContainer molecule) throws CDKException {
// build graph data-structures for fast cycle perception
final EdgeToBondMap bondMap = EdgeToBondMap.withSpaceFor(molecule);
final int[][] graph = GraphUtil.toAdjList(molecule, bondMap);
// initial ring/cycle se... | java | public Set<IBond> findBonds(IAtomContainer molecule) throws CDKException {
// build graph data-structures for fast cycle perception
final EdgeToBondMap bondMap = EdgeToBondMap.withSpaceFor(molecule);
final int[][] graph = GraphUtil.toAdjList(molecule, bondMap);
// initial ring/cycle se... | [
"public",
"Set",
"<",
"IBond",
">",
"findBonds",
"(",
"IAtomContainer",
"molecule",
")",
"throws",
"CDKException",
"{",
"// build graph data-structures for fast cycle perception",
"final",
"EdgeToBondMap",
"bondMap",
"=",
"EdgeToBondMap",
".",
"withSpaceFor",
"(",
"molecu... | Find the bonds of a {@code molecule} which this model determined were
aromatic.
<blockquote><pre>{@code
Aromaticity aromaticity = new Aromaticity(ElectronDonation.cdk(),
Cycles.all());
IAtomContainer container = ...;
try {
Set<IBond> bonds = aromaticity.findBonds(container);
int nAromaticBonds = bonds.... | [
"Find",
"the",
"bonds",
"of",
"a",
"{",
"@code",
"molecule",
"}",
"which",
"this",
"model",
"determined",
"were",
"aromatic",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/aromaticity/Aromaticity.java#L179-L209 |
shrinkwrap/resolver | api/src/main/java/org/jboss/shrinkwrap/resolver/api/Invokable.java | Invokable.invokeMethod | Object invokeMethod(String name, Class<?>[] parameterTypes, Object instance, Object[] parameters)
throws InvocationException {
try {
return findMethod(name, parameterTypes).invoke(instance, parameters);
} catch (IllegalAccessException e) {
throw new InvocationExceptio... | java | Object invokeMethod(String name, Class<?>[] parameterTypes, Object instance, Object[] parameters)
throws InvocationException {
try {
return findMethod(name, parameterTypes).invoke(instance, parameters);
} catch (IllegalAccessException e) {
throw new InvocationExceptio... | [
"Object",
"invokeMethod",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
",",
"Object",
"instance",
",",
"Object",
"[",
"]",
"parameters",
")",
"throws",
"InvocationException",
"{",
"try",
"{",
"return",
"findMethod",
"(",
... | Invokes method on class registered within {@link Invokable}. It looks also for superclasses
@param name name of the method
@param parameterTypes parameter types of the method
@param instance instance on which method is called, {@code null} for static methods
@param parameters parameters for method invocation
@return
@... | [
"Invokes",
"method",
"on",
"class",
"registered",
"within",
"{",
"@link",
"Invokable",
"}",
".",
"It",
"looks",
"also",
"for",
"superclasses"
] | train | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/api/src/main/java/org/jboss/shrinkwrap/resolver/api/Invokable.java#L97-L117 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java | ModelSerializer.addNormalizerToModel | public static void addNormalizerToModel(File f, Normalizer<?> normalizer) {
File tempFile = null;
try {
// copy existing model to temporary file
tempFile = DL4JFileUtils.createTempFile("dl4jModelSerializerTemp", "bin");
tempFile.deleteOnExit();
Files.copy(... | java | public static void addNormalizerToModel(File f, Normalizer<?> normalizer) {
File tempFile = null;
try {
// copy existing model to temporary file
tempFile = DL4JFileUtils.createTempFile("dl4jModelSerializerTemp", "bin");
tempFile.deleteOnExit();
Files.copy(... | [
"public",
"static",
"void",
"addNormalizerToModel",
"(",
"File",
"f",
",",
"Normalizer",
"<",
"?",
">",
"normalizer",
")",
"{",
"File",
"tempFile",
"=",
"null",
";",
"try",
"{",
"// copy existing model to temporary file",
"tempFile",
"=",
"DL4JFileUtils",
".",
"... | This method appends normalizer to a given persisted model.
PLEASE NOTE: File should be model file saved earlier with ModelSerializer
@param f
@param normalizer | [
"This",
"method",
"appends",
"normalizer",
"to",
"a",
"given",
"persisted",
"model",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java#L731-L772 |
jhades/jhades | jhades/src/main/java/org/jhades/model/ClasspathResources.java | ClasspathResources.sortByNumberOfVersionsDesc | public static void sortByNumberOfVersionsDesc(List<ClasspathResource> resources) {
// sort by number of version occurrences
Comparator<ClasspathResource> sortByNumberOfVersionsDesc = new Comparator<ClasspathResource>() {
@Override
public int compare(ClasspathResource resource1, C... | java | public static void sortByNumberOfVersionsDesc(List<ClasspathResource> resources) {
// sort by number of version occurrences
Comparator<ClasspathResource> sortByNumberOfVersionsDesc = new Comparator<ClasspathResource>() {
@Override
public int compare(ClasspathResource resource1, C... | [
"public",
"static",
"void",
"sortByNumberOfVersionsDesc",
"(",
"List",
"<",
"ClasspathResource",
">",
"resources",
")",
"{",
"// sort by number of version occurrences",
"Comparator",
"<",
"ClasspathResource",
">",
"sortByNumberOfVersionsDesc",
"=",
"new",
"Comparator",
"<",... | Takes a list of classpath resources and sorts them by the number of classpath versions.
The resources with the biggest number of versions will be first on the list.
@param resources to be sorted | [
"Takes",
"a",
"list",
"of",
"classpath",
"resources",
"and",
"sorts",
"them",
"by",
"the",
"number",
"of",
"classpath",
"versions",
"."
] | train | https://github.com/jhades/jhades/blob/51e20b7d67f51697f947fcab94494c93f6bf1b01/jhades/src/main/java/org/jhades/model/ClasspathResources.java#L53-L62 |
trellis-ldp/trellis | auth/basic/src/main/java/org/trellisldp/auth/basic/Credentials.java | Credentials.parse | public static Credentials parse(final String encoded) {
try {
final String decoded = new String(Base64.getDecoder().decode(encoded), UTF_8);
final String[] parts = decoded.split(":", 2);
if (parts.length == 2) {
return new Credentials(parts[0], parts[1]);
... | java | public static Credentials parse(final String encoded) {
try {
final String decoded = new String(Base64.getDecoder().decode(encoded), UTF_8);
final String[] parts = decoded.split(":", 2);
if (parts.length == 2) {
return new Credentials(parts[0], parts[1]);
... | [
"public",
"static",
"Credentials",
"parse",
"(",
"final",
"String",
"encoded",
")",
"{",
"try",
"{",
"final",
"String",
"decoded",
"=",
"new",
"String",
"(",
"Base64",
".",
"getDecoder",
"(",
")",
".",
"decode",
"(",
"encoded",
")",
",",
"UTF_8",
")",
... | Create a set of credentials.
@param encoded the encoded header
@return credentials or null on error | [
"Create",
"a",
"set",
"of",
"credentials",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/auth/basic/src/main/java/org/trellisldp/auth/basic/Credentials.java#L55-L66 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.getBooleanProperty | private static boolean getBooleanProperty(Function function, String propertyKey, boolean defaultValue) {
Object value = function.getProperty(propertyKey);
return value instanceof Boolean ? (Boolean)value : defaultValue;
} | java | private static boolean getBooleanProperty(Function function, String propertyKey, boolean defaultValue) {
Object value = function.getProperty(propertyKey);
return value instanceof Boolean ? (Boolean)value : defaultValue;
} | [
"private",
"static",
"boolean",
"getBooleanProperty",
"(",
"Function",
"function",
",",
"String",
"propertyKey",
",",
"boolean",
"defaultValue",
")",
"{",
"Object",
"value",
"=",
"function",
".",
"getProperty",
"(",
"propertyKey",
")",
";",
"return",
"value",
"i... | Return a boolean property of the function
@param function
@param propertyKey
@param defaultValue
@return | [
"Return",
"a",
"boolean",
"property",
"of",
"the",
"function"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L430-L433 |
calimero-project/calimero-core | src/tuwien/auto/calimero/mgmt/ManagementClientImpl.java | ManagementClientImpl.readProperty2 | List<byte[]> readProperty2(final Destination dst, final int objIndex, final int propertyId,
final int start, final int elements) throws KNXTimeoutException, KNXRemoteException,
KNXDisconnectException, KNXLinkClosedException, InterruptedException
{
return readProperty(dst, objIndex, propertyId, start, elements, f... | java | List<byte[]> readProperty2(final Destination dst, final int objIndex, final int propertyId,
final int start, final int elements) throws KNXTimeoutException, KNXRemoteException,
KNXDisconnectException, KNXLinkClosedException, InterruptedException
{
return readProperty(dst, objIndex, propertyId, start, elements, f... | [
"List",
"<",
"byte",
"[",
"]",
">",
"readProperty2",
"(",
"final",
"Destination",
"dst",
",",
"final",
"int",
"objIndex",
",",
"final",
"int",
"propertyId",
",",
"final",
"int",
"start",
",",
"final",
"int",
"elements",
")",
"throws",
"KNXTimeoutException",
... | as readProperty, but collects all responses until response timeout is reached | [
"as",
"readProperty",
"but",
"collects",
"all",
"responses",
"until",
"response",
"timeout",
"is",
"reached"
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/mgmt/ManagementClientImpl.java#L624-L629 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java | JDBC4CallableStatement.setBlob | @Override
public void setBlob(String parameterName, Blob x) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public void setBlob(String parameterName, Blob x) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setBlob",
"(",
"String",
"parameterName",
",",
"Blob",
"x",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Sets the designated parameter to the given java.sql.Blob object. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"sql",
".",
"Blob",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java#L623-L628 |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DObject.java | DObject.updateSet | public void updateSet (String setName, DSet.Entry entry)
{
requestEntryUpdate(setName, getSet(setName), entry);
} | java | public void updateSet (String setName, DSet.Entry entry)
{
requestEntryUpdate(setName, getSet(setName), entry);
} | [
"public",
"void",
"updateSet",
"(",
"String",
"setName",
",",
"DSet",
".",
"Entry",
"entry",
")",
"{",
"requestEntryUpdate",
"(",
"setName",
",",
"getSet",
"(",
"setName",
")",
",",
"entry",
")",
";",
"}"
] | Request to have the specified item updated in the specified DSet. | [
"Request",
"to",
"have",
"the",
"specified",
"item",
"updated",
"in",
"the",
"specified",
"DSet",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L275-L278 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java | TwitterEndpointServices.obtainRequestToken | public Map<String, Object> obtainRequestToken(SocialLoginConfig config, String callbackUrl) {
String endpointUrl = config.getRequestTokenUrl();
try {
SocialUtil.validateEndpointWithQuery(endpointUrl);
} catch (SocialLoginException e) {
return createErrorResponse("TWITTER... | java | public Map<String, Object> obtainRequestToken(SocialLoginConfig config, String callbackUrl) {
String endpointUrl = config.getRequestTokenUrl();
try {
SocialUtil.validateEndpointWithQuery(endpointUrl);
} catch (SocialLoginException e) {
return createErrorResponse("TWITTER... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"obtainRequestToken",
"(",
"SocialLoginConfig",
"config",
",",
"String",
"callbackUrl",
")",
"{",
"String",
"endpointUrl",
"=",
"config",
".",
"getRequestTokenUrl",
"(",
")",
";",
"try",
"{",
"SocialUtil",
".... | Invokes the {@value TwitterConstants#TWITTER_ENDPOINT_REQUEST_TOKEN} endpoint in order to obtain a request token. The
request is authorized for the consumer key set by the class and the callback URL provided to the method. The appropriate
consumer key must be set before invoking this method in order to obtain a request... | [
"Invokes",
"the",
"{",
"@value",
"TwitterConstants#TWITTER_ENDPOINT_REQUEST_TOKEN",
"}",
"endpoint",
"in",
"order",
"to",
"obtain",
"a",
"request",
"token",
".",
"The",
"request",
"is",
"authorized",
"for",
"the",
"consumer",
"key",
"set",
"by",
"the",
"class",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java#L914-L930 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java | SimpleDateFormat.fastZeroPaddingNumber | private void fastZeroPaddingNumber(StringBuffer buf, int value, int minDigits, int maxDigits) {
int limit = decimalBuf.length < maxDigits ? decimalBuf.length : maxDigits;
int index = limit - 1;
while (true) {
decimalBuf[index] = decDigits[(value % 10)];
value /= 10;
... | java | private void fastZeroPaddingNumber(StringBuffer buf, int value, int minDigits, int maxDigits) {
int limit = decimalBuf.length < maxDigits ? decimalBuf.length : maxDigits;
int index = limit - 1;
while (true) {
decimalBuf[index] = decDigits[(value % 10)];
value /= 10;
... | [
"private",
"void",
"fastZeroPaddingNumber",
"(",
"StringBuffer",
"buf",
",",
"int",
"value",
",",
"int",
"minDigits",
",",
"int",
"maxDigits",
")",
"{",
"int",
"limit",
"=",
"decimalBuf",
".",
"length",
"<",
"maxDigits",
"?",
"decimalBuf",
".",
"length",
":"... | /*
Lightweight zero padding integer number format function.
Note: This implementation is almost equivalent to format method in DateNumberFormat.
In the method zeroPaddingNumber above should be able to use the one in DateNumberFormat,
but, it does not help IBM J9's JIT to optimize the performance much. In simple repea... | [
"/",
"*",
"Lightweight",
"zero",
"padding",
"integer",
"number",
"format",
"function",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L2259-L2282 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.singleTap | public TouchActions singleTap(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new SingleTapAction(touchScreen, (Locatable) onElement));
}
tick(touchPointer.createPointerDown(0));
tick(touchPointer.createPointerUp(0));
return this;
} | java | public TouchActions singleTap(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new SingleTapAction(touchScreen, (Locatable) onElement));
}
tick(touchPointer.createPointerDown(0));
tick(touchPointer.createPointerUp(0));
return this;
} | [
"public",
"TouchActions",
"singleTap",
"(",
"WebElement",
"onElement",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"SingleTapAction",
"(",
"touchScreen",
",",
"(",
"Locatable",
")",
"onElement",
")",
")... | Allows the execution of single tap on the screen, analogous to click using a Mouse.
@param onElement the {@link WebElement} on the screen.
@return self | [
"Allows",
"the",
"execution",
"of",
"single",
"tap",
"on",
"the",
"screen",
"analogous",
"to",
"click",
"using",
"a",
"Mouse",
"."
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L54-L61 |
StripesFramework/stripes-stuff | src/main/java/org/stripesstuff/plugin/security/InstanceBasedSecurityManager.java | InstanceBasedSecurityManager.hasRoleName | protected Boolean hasRoleName(ActionBean bean, Method handler, String roleName)
{
// Let our superclass check if the user has the required role.
return super.hasRole(bean, handler, roleName);
} | java | protected Boolean hasRoleName(ActionBean bean, Method handler, String roleName)
{
// Let our superclass check if the user has the required role.
return super.hasRole(bean, handler, roleName);
} | [
"protected",
"Boolean",
"hasRoleName",
"(",
"ActionBean",
"bean",
",",
"Method",
"handler",
",",
"String",
"roleName",
")",
"{",
"// Let our superclass check if the user has the required role.",
"return",
"super",
".",
"hasRole",
"(",
"bean",
",",
"handler",
",",
"rol... | Checks to see if the user has an individual role by name. The default is to use the parent class and call
{@code super.hasRole(bean,roleName)}. When subclassing {@link InstanceBasedSecurityManager}, override
this method instead of {@link #hasRole(ActionBean, Method, String)} to keep using the EL expression logic but
ch... | [
"Checks",
"to",
"see",
"if",
"the",
"user",
"has",
"an",
"individual",
"role",
"by",
"name",
".",
"The",
"default",
"is",
"to",
"use",
"the",
"parent",
"class",
"and",
"call",
"{",
"@code",
"super",
".",
"hasRole",
"(",
"bean",
"roleName",
")",
"}",
... | train | https://github.com/StripesFramework/stripes-stuff/blob/51ad92b4bd5862ba34d7c18c5829fb00ea3a3811/src/main/java/org/stripesstuff/plugin/security/InstanceBasedSecurityManager.java#L106-L110 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/KeyStore.java | KeyStore.getInstance | public static KeyStore getInstance(String type)
throws KeyStoreException
{
try {
Object[] objs = Security.getImpl(type, "KeyStore", (String)null);
return new KeyStore((KeyStoreSpi)objs[0], (Provider)objs[1], type);
} catch (NoSuchAlgorithmException nsae) {
... | java | public static KeyStore getInstance(String type)
throws KeyStoreException
{
try {
Object[] objs = Security.getImpl(type, "KeyStore", (String)null);
return new KeyStore((KeyStoreSpi)objs[0], (Provider)objs[1], type);
} catch (NoSuchAlgorithmException nsae) {
... | [
"public",
"static",
"KeyStore",
"getInstance",
"(",
"String",
"type",
")",
"throws",
"KeyStoreException",
"{",
"try",
"{",
"Object",
"[",
"]",
"objs",
"=",
"Security",
".",
"getImpl",
"(",
"type",
",",
"\"KeyStore\"",
",",
"(",
"String",
")",
"null",
")",
... | Returns a keystore object of the specified type.
<p> This method traverses the list of registered security Providers,
starting with the most preferred Provider.
A new KeyStore object encapsulating the
KeyStoreSpi implementation from the first
Provider that supports the specified type is returned.
<p> Note that the li... | [
"Returns",
"a",
"keystore",
"object",
"of",
"the",
"specified",
"type",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/KeyStore.java#L651-L662 |
google/auto | common/src/main/java/com/google/auto/common/AnnotationMirrors.java | AnnotationMirrors.getAnnotationValue | public static AnnotationValue getAnnotationValue(
AnnotationMirror annotationMirror, String elementName) {
return getAnnotationElementAndValue(annotationMirror, elementName).getValue();
} | java | public static AnnotationValue getAnnotationValue(
AnnotationMirror annotationMirror, String elementName) {
return getAnnotationElementAndValue(annotationMirror, elementName).getValue();
} | [
"public",
"static",
"AnnotationValue",
"getAnnotationValue",
"(",
"AnnotationMirror",
"annotationMirror",
",",
"String",
"elementName",
")",
"{",
"return",
"getAnnotationElementAndValue",
"(",
"annotationMirror",
",",
"elementName",
")",
".",
"getValue",
"(",
")",
";",
... | Returns an {@link AnnotationValue} for the named element if such an element was
either declared in the usage represented by the provided {@link AnnotationMirror}, or if
such an element was defined with a default.
@throws IllegalArgumentException if no element is defined with the given elementName. | [
"Returns",
"an",
"{",
"@link",
"AnnotationValue",
"}",
"for",
"the",
"named",
"element",
"if",
"such",
"an",
"element",
"was",
"either",
"declared",
"in",
"the",
"usage",
"represented",
"by",
"the",
"provided",
"{",
"@link",
"AnnotationMirror",
"}",
"or",
"i... | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/common/src/main/java/com/google/auto/common/AnnotationMirrors.java#L112-L115 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.toVerticalString | public static <E> String toVerticalString(Counter<E> c, int k, String fmt, boolean swap) {
PriorityQueue<E> q = Counters.toPriorityQueue(c);
List<E> sortedKeys = q.toSortedList();
StringBuilder sb = new StringBuilder();
int i = 0;
for (Iterator<E> keyI = sortedKeys.iterator(); keyI.hasNext() &&... | java | public static <E> String toVerticalString(Counter<E> c, int k, String fmt, boolean swap) {
PriorityQueue<E> q = Counters.toPriorityQueue(c);
List<E> sortedKeys = q.toSortedList();
StringBuilder sb = new StringBuilder();
int i = 0;
for (Iterator<E> keyI = sortedKeys.iterator(); keyI.hasNext() &&... | [
"public",
"static",
"<",
"E",
">",
"String",
"toVerticalString",
"(",
"Counter",
"<",
"E",
">",
"c",
",",
"int",
"k",
",",
"String",
"fmt",
",",
"boolean",
"swap",
")",
"{",
"PriorityQueue",
"<",
"E",
">",
"q",
"=",
"Counters",
".",
"toPriorityQueue",
... | Returns a <code>String</code> representation of the <code>k</code> keys
with the largest counts in the given {@link Counter}, using the given
format string.
@param c
a Counter
@param k
how many keys to print
@param fmt
a format string, such as "%.0f\t%s" (do not include final "%n")
@param swap
whether the count should... | [
"Returns",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
"representation",
"of",
"the",
"<code",
">",
"k<",
"/",
"code",
">",
"keys",
"with",
"the",
"largest",
"counts",
"in",
"the",
"given",
"{",
"@link",
"Counter",
"}",
"using",
"the",
"given",
"fo... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1942-L1960 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Format.java | Format.atol | public static long atol( String s ) {
int i = 0;
while( i < s.length() && Character.isWhitespace(s.charAt(i)) ) {
i++;
}
if (i < s.length() && s.charAt(i) == '0') {
if (i + 1 < s.length() && (s.charAt(i + 1) == 'x' || s.charAt(i + 1) == 'X')) {
re... | java | public static long atol( String s ) {
int i = 0;
while( i < s.length() && Character.isWhitespace(s.charAt(i)) ) {
i++;
}
if (i < s.length() && s.charAt(i) == '0') {
if (i + 1 < s.length() && (s.charAt(i + 1) == 'x' || s.charAt(i + 1) == 'X')) {
re... | [
"public",
"static",
"long",
"atol",
"(",
"String",
"s",
")",
"{",
"int",
"i",
"=",
"0",
";",
"while",
"(",
"i",
"<",
"s",
".",
"length",
"(",
")",
"&&",
"Character",
".",
"isWhitespace",
"(",
"s",
".",
"charAt",
"(",
"i",
")",
")",
")",
"{",
... | Converts a string of digits (decimal, octal or hex) to a long integer
@param s a string
@return the numeric value of the prefix of s representing a
base 10 integer | [
"Converts",
"a",
"string",
"of",
"digits",
"(",
"decimal",
"octal",
"or",
"hex",
")",
"to",
"a",
"long",
"integer"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Format.java#L699-L714 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/IncidentUtil.java | IncidentUtil.dumpVmMetrics | public static void dumpVmMetrics(String incidentId)
{
PrintWriter writer = null;
try
{
String dumpFile = EventUtil.getDumpPathPrefix() + "/" +
INC_DUMP_FILE_NAME + incidentId + INC_DUMP_FILE_EXT;
final OutputStream outStream =
new GZIPOutputStream(new FileOut... | java | public static void dumpVmMetrics(String incidentId)
{
PrintWriter writer = null;
try
{
String dumpFile = EventUtil.getDumpPathPrefix() + "/" +
INC_DUMP_FILE_NAME + incidentId + INC_DUMP_FILE_EXT;
final OutputStream outStream =
new GZIPOutputStream(new FileOut... | [
"public",
"static",
"void",
"dumpVmMetrics",
"(",
"String",
"incidentId",
")",
"{",
"PrintWriter",
"writer",
"=",
"null",
";",
"try",
"{",
"String",
"dumpFile",
"=",
"EventUtil",
".",
"getDumpPathPrefix",
"(",
")",
"+",
"\"/\"",
"+",
"INC_DUMP_FILE_NAME",
"+",... | Dumps JVM metrics for this process.
@param incidentId incident id | [
"Dumps",
"JVM",
"metrics",
"for",
"this",
"process",
"."
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/IncidentUtil.java#L83-L151 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeFormatter.java | DateTimeFormatter.ofLocalizedDateTime | public static DateTimeFormatter ofLocalizedDateTime(FormatStyle dateStyle, FormatStyle timeStyle) {
Objects.requireNonNull(dateStyle, "dateStyle");
Objects.requireNonNull(timeStyle, "timeStyle");
return new DateTimeFormatterBuilder().appendLocalized(dateStyle, timeStyle)
.toForma... | java | public static DateTimeFormatter ofLocalizedDateTime(FormatStyle dateStyle, FormatStyle timeStyle) {
Objects.requireNonNull(dateStyle, "dateStyle");
Objects.requireNonNull(timeStyle, "timeStyle");
return new DateTimeFormatterBuilder().appendLocalized(dateStyle, timeStyle)
.toForma... | [
"public",
"static",
"DateTimeFormatter",
"ofLocalizedDateTime",
"(",
"FormatStyle",
"dateStyle",
",",
"FormatStyle",
"timeStyle",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"dateStyle",
",",
"\"dateStyle\"",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"ti... | Returns a locale specific date and time format for the ISO chronology.
<p>
This returns a formatter that will format or parse a date-time.
The exact format pattern used varies by locale.
<p>
The locale is determined from the formatter. The formatter returned directly by
this method will use the {@link Locale#getDefault... | [
"Returns",
"a",
"locale",
"specific",
"date",
"and",
"time",
"format",
"for",
"the",
"ISO",
"chronology",
".",
"<p",
">",
"This",
"returns",
"a",
"formatter",
"that",
"will",
"format",
"or",
"parse",
"a",
"date",
"-",
"time",
".",
"The",
"exact",
"format... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeFormatter.java#L671-L676 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.renameJob | public JenkinsServer renameJob(String oldJobName, String newJobName, Boolean crumbFlag) throws IOException {
renameJob(null, oldJobName, newJobName, crumbFlag);
return this;
} | java | public JenkinsServer renameJob(String oldJobName, String newJobName, Boolean crumbFlag) throws IOException {
renameJob(null, oldJobName, newJobName, crumbFlag);
return this;
} | [
"public",
"JenkinsServer",
"renameJob",
"(",
"String",
"oldJobName",
",",
"String",
"newJobName",
",",
"Boolean",
"crumbFlag",
")",
"throws",
"IOException",
"{",
"renameJob",
"(",
"null",
",",
"oldJobName",
",",
"newJobName",
",",
"crumbFlag",
")",
";",
"return"... | Rename a job
@param oldJobName existing job name.
@param newJobName The new job name.
@param crumbFlag <code>true</code> to add <b>crumbIssuer</b>
<code>false</code> otherwise.
@throws IOException In case of a failure. | [
"Rename",
"a",
"job"
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L874-L877 |
Prototik/HoloEverywhere | library/src/android/support/v7/internal/view/menu/MenuBuilder.java | MenuBuilder.removeItemAtInt | private void removeItemAtInt(int index, boolean updateChildrenOnMenuViews) {
if ((index < 0) || (index >= mItems.size())) {
return;
}
mItems.remove(index);
if (updateChildrenOnMenuViews) {
onItemsChanged(true);
}
} | java | private void removeItemAtInt(int index, boolean updateChildrenOnMenuViews) {
if ((index < 0) || (index >= mItems.size())) {
return;
}
mItems.remove(index);
if (updateChildrenOnMenuViews) {
onItemsChanged(true);
}
} | [
"private",
"void",
"removeItemAtInt",
"(",
"int",
"index",
",",
"boolean",
"updateChildrenOnMenuViews",
")",
"{",
"if",
"(",
"(",
"index",
"<",
"0",
")",
"||",
"(",
"index",
">=",
"mItems",
".",
"size",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"m... | Remove the item at the given index and optionally forces menu views to update.
@param index The index of the item to be removed. If this index is
invalid an exception is thrown.
@param updateChildrenOnMenuViews Whether to force update on menu views. Please make sure you
eventually call this after y... | [
"Remove",
"the",
"item",
"at",
"the",
"given",
"index",
"and",
"optionally",
"forces",
"menu",
"views",
"to",
"update",
"."
] | train | https://github.com/Prototik/HoloEverywhere/blob/b870abb5ab009a5a6dbab3fb855ec2854e35e125/library/src/android/support/v7/internal/view/menu/MenuBuilder.java#L520-L530 |
zxing/zxing | core/src/main/java/com/google/zxing/common/detector/WhiteRectangleDetector.java | WhiteRectangleDetector.centerEdges | private ResultPoint[] centerEdges(ResultPoint y, ResultPoint z,
ResultPoint x, ResultPoint t) {
//
// t t
// z x
// x OR z
// y y
//
float yi = y.getX();
float yj = y.getY();
... | java | private ResultPoint[] centerEdges(ResultPoint y, ResultPoint z,
ResultPoint x, ResultPoint t) {
//
// t t
// z x
// x OR z
// y y
//
float yi = y.getX();
float yj = y.getY();
... | [
"private",
"ResultPoint",
"[",
"]",
"centerEdges",
"(",
"ResultPoint",
"y",
",",
"ResultPoint",
"z",
",",
"ResultPoint",
"x",
",",
"ResultPoint",
"t",
")",
"{",
"//",
"// t t",
"// z x",
"// x OR z",
"// y ... | recenters the points of a constant distance towards the center
@param y bottom most point
@param z left most point
@param x right most point
@param t top most point
@return {@link ResultPoint}[] describing the corners of the rectangular
region. The first and last points are opposed on the diagonal, as
are the second a... | [
"recenters",
"the",
"points",
"of",
"a",
"constant",
"distance",
"towards",
"the",
"center"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/common/detector/WhiteRectangleDetector.java#L263-L295 |
gallandarakhneorg/afc | advanced/gis/gisinputoutput/src/main/java/org/arakhne/afc/gis/io/xml/XMLGISElementUtil.java | XMLGISElementUtil.writeMapElement | public static Element writeMapElement(MapElement primitive, XMLBuilder builder, XMLResources resources) throws IOException {
return writeMapElement(primitive, null, builder, resources);
} | java | public static Element writeMapElement(MapElement primitive, XMLBuilder builder, XMLResources resources) throws IOException {
return writeMapElement(primitive, null, builder, resources);
} | [
"public",
"static",
"Element",
"writeMapElement",
"(",
"MapElement",
"primitive",
",",
"XMLBuilder",
"builder",
",",
"XMLResources",
"resources",
")",
"throws",
"IOException",
"{",
"return",
"writeMapElement",
"(",
"primitive",
",",
"null",
",",
"builder",
",",
"r... | Write the XML description for the given map element.
@param primitive is the map element to output.
@param builder is the tool to create XML nodes.
@param resources is the tool that permits to gather the resources.
@return the XML node of the map element.
@throws IOException in case of error. | [
"Write",
"the",
"XML",
"description",
"for",
"the",
"given",
"map",
"element",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisinputoutput/src/main/java/org/arakhne/afc/gis/io/xml/XMLGISElementUtil.java#L140-L142 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/internal/document/DefinitionsDocument.java | DefinitionsDocument.applyDefinitionComponent | private void applyDefinitionComponent(MarkupDocBuilder markupDocBuilder, String definitionName, Model model) {
definitionComponent.apply(markupDocBuilder, DefinitionComponent.parameters(
definitionName,
model,
2));
} | java | private void applyDefinitionComponent(MarkupDocBuilder markupDocBuilder, String definitionName, Model model) {
definitionComponent.apply(markupDocBuilder, DefinitionComponent.parameters(
definitionName,
model,
2));
} | [
"private",
"void",
"applyDefinitionComponent",
"(",
"MarkupDocBuilder",
"markupDocBuilder",
",",
"String",
"definitionName",
",",
"Model",
"model",
")",
"{",
"definitionComponent",
".",
"apply",
"(",
"markupDocBuilder",
",",
"DefinitionComponent",
".",
"parameters",
"("... | Builds a concrete definition
@param markupDocBuilder the markupDocBuilder do use for output
@param definitionName the name of the definition
@param model the Swagger Model of the definition | [
"Builds",
"a",
"concrete",
"definition"
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/document/DefinitionsDocument.java#L159-L164 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java | VirtualWANsInner.updateTagsAsync | public Observable<VirtualWANInner> updateTagsAsync(String resourceGroupName, String virtualWANName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1<ServiceResponse<VirtualWANInner>, VirtualWANInner>() {
@Override
... | java | public Observable<VirtualWANInner> updateTagsAsync(String resourceGroupName, String virtualWANName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1<ServiceResponse<VirtualWANInner>, VirtualWANInner>() {
@Override
... | [
"public",
"Observable",
"<",
"VirtualWANInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualWANName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resour... | Updates a VirtualWAN tags.
@param resourceGroupName The resource group name of the VirtualWan.
@param virtualWANName The name of the VirtualWAN being updated.
@param tags Resource tags.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"a",
"VirtualWAN",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java#L475-L482 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.getMapEventJournalConfig | public EventJournalConfig getMapEventJournalConfig(String name) {
return ConfigUtils.getConfig(configPatternMatcher, mapEventJournalConfigs, name, EventJournalConfig.class,
new BiConsumer<EventJournalConfig, String>() {
@Override
public void accept(EventJo... | java | public EventJournalConfig getMapEventJournalConfig(String name) {
return ConfigUtils.getConfig(configPatternMatcher, mapEventJournalConfigs, name, EventJournalConfig.class,
new BiConsumer<EventJournalConfig, String>() {
@Override
public void accept(EventJo... | [
"public",
"EventJournalConfig",
"getMapEventJournalConfig",
"(",
"String",
"name",
")",
"{",
"return",
"ConfigUtils",
".",
"getConfig",
"(",
"configPatternMatcher",
",",
"mapEventJournalConfigs",
",",
"name",
",",
"EventJournalConfig",
".",
"class",
",",
"new",
"BiCon... | Returns the map event journal config for the given name, creating one
if necessary and adding it to the collection of known configurations.
<p>
The configuration is found by matching the configuration name
pattern to the provided {@code name} without the partition qualifier
(the part of the name after {@code '@'}).
If ... | [
"Returns",
"the",
"map",
"event",
"journal",
"config",
"for",
"the",
"given",
"name",
"creating",
"one",
"if",
"necessary",
"and",
"adding",
"it",
"to",
"the",
"collection",
"of",
"known",
"configurations",
".",
"<p",
">",
"The",
"configuration",
"is",
"foun... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L2817-L2828 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesInner.java | FavoritesInner.listAsync | public Observable<List<ApplicationInsightsComponentFavoriteInner>> listAsync(String resourceGroupName, String resourceName) {
return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<List<ApplicationInsightsComponentFavoriteInner>>, List<ApplicationInsightsComponentFavo... | java | public Observable<List<ApplicationInsightsComponentFavoriteInner>> listAsync(String resourceGroupName, String resourceName) {
return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<List<ApplicationInsightsComponentFavoriteInner>>, List<ApplicationInsightsComponentFavo... | [
"public",
"Observable",
"<",
"List",
"<",
"ApplicationInsightsComponentFavoriteInner",
">",
">",
"listAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceNam... | Gets a list of favorites defined within an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List&l... | [
"Gets",
"a",
"list",
"of",
"favorites",
"defined",
"within",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesInner.java#L120-L127 |
stapler/stapler | core/src/main/java/org/kohsuke/stapler/config/ConfigurationLoader.java | ConfigurationLoader.fromEnvironmentVariables | public static ConfigurationLoader fromEnvironmentVariables() throws IOException {
TreeMap<String, String> m = new TreeMap<String, String>(new Comparator<String>() {
public int compare(String o1, String o2) {
return o1.compareToIgnoreCase(o2);
}
});
m.putAl... | java | public static ConfigurationLoader fromEnvironmentVariables() throws IOException {
TreeMap<String, String> m = new TreeMap<String, String>(new Comparator<String>() {
public int compare(String o1, String o2) {
return o1.compareToIgnoreCase(o2);
}
});
m.putAl... | [
"public",
"static",
"ConfigurationLoader",
"fromEnvironmentVariables",
"(",
")",
"throws",
"IOException",
"{",
"TreeMap",
"<",
"String",
",",
"String",
">",
"m",
"=",
"new",
"TreeMap",
"<",
"String",
",",
"String",
">",
"(",
"new",
"Comparator",
"<",
"String",... | Creates {@link ConfigurationLoader} that uses environment variables as the source.
Since environment variables are often by convention all caps, while system properties
and other properties tend to be camel cased, this method creates a case-insensitive configuration
(that allows retrievals by both "path" and "PATH" to... | [
"Creates",
"{",
"@link",
"ConfigurationLoader",
"}",
"that",
"uses",
"environment",
"variables",
"as",
"the",
"source",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/src/main/java/org/kohsuke/stapler/config/ConfigurationLoader.java#L111-L119 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/mail/MailUtil.java | MailUtil.sendHtml | public static void sendHtml(Collection<String> tos, String subject, String content, File... files) {
send(tos, subject, content, true, files);
} | java | public static void sendHtml(Collection<String> tos, String subject, String content, File... files) {
send(tos, subject, content, true, files);
} | [
"public",
"static",
"void",
"sendHtml",
"(",
"Collection",
"<",
"String",
">",
"tos",
",",
"String",
"subject",
",",
"String",
"content",
",",
"File",
"...",
"files",
")",
"{",
"send",
"(",
"tos",
",",
"subject",
",",
"content",
",",
"true",
",",
"file... | 使用配置文件中设置的账户发送HTML邮件,发送给多人
@param tos 收件人列表
@param subject 标题
@param content 正文
@param files 附件列表
@since 3.2.0 | [
"使用配置文件中设置的账户发送HTML邮件,发送给多人"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/mail/MailUtil.java#L98-L100 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java | ContentKeyPoliciesInner.getPolicyPropertiesWithSecrets | public ContentKeyPolicyPropertiesInner getPolicyPropertiesWithSecrets(String resourceGroupName, String accountName, String contentKeyPolicyName) {
return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body();
} | java | public ContentKeyPolicyPropertiesInner getPolicyPropertiesWithSecrets(String resourceGroupName, String accountName, String contentKeyPolicyName) {
return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body();
} | [
"public",
"ContentKeyPolicyPropertiesInner",
"getPolicyPropertiesWithSecrets",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"contentKeyPolicyName",
")",
"{",
"return",
"getPolicyPropertiesWithSecretsWithServiceResponseAsync",
"(",
"resourceGroupN... | Get a Content Key Policy with secrets.
Get a Content Key Policy including secret values.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param contentKeyPolicyName The Content Key Policy name.
@throws IllegalArgumentException t... | [
"Get",
"a",
"Content",
"Key",
"Policy",
"with",
"secrets",
".",
"Get",
"a",
"Content",
"Key",
"Policy",
"including",
"secret",
"values",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java#L781-L783 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.getVnetGateway | public VnetGatewayInner getVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName) {
return getVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName).toBlocking().single().body();
} | java | public VnetGatewayInner getVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName) {
return getVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName).toBlocking().single().body();
} | [
"public",
"VnetGatewayInner",
"getVnetGateway",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"vnetName",
",",
"String",
"gatewayName",
")",
"{",
"return",
"getVnetGatewayWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
... | Get a Virtual Network gateway.
Get a Virtual Network gateway.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param vnetName Name of the Virtual Network.
@param gatewayName Name of the gateway. Only the 'primary' gateway is supported.
@throw... | [
"Get",
"a",
"Virtual",
"Network",
"gateway",
".",
"Get",
"a",
"Virtual",
"Network",
"gateway",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L3174-L3176 |
elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/evaluation/scores/ROCEvaluation.java | ROCEvaluation.computeROCAUC | public static <I extends ScoreIter> double computeROCAUC(Predicate<? super I> predicate, I iter) {
int poscnt = 0, negcnt = 0, pospre = 0, negpre = 0;
double acc = 0.;
while(iter.valid()) {
// positive or negative match?
do {
if(predicate.test(iter)) {
++poscnt;
}
... | java | public static <I extends ScoreIter> double computeROCAUC(Predicate<? super I> predicate, I iter) {
int poscnt = 0, negcnt = 0, pospre = 0, negpre = 0;
double acc = 0.;
while(iter.valid()) {
// positive or negative match?
do {
if(predicate.test(iter)) {
++poscnt;
}
... | [
"public",
"static",
"<",
"I",
"extends",
"ScoreIter",
">",
"double",
"computeROCAUC",
"(",
"Predicate",
"<",
"?",
"super",
"I",
">",
"predicate",
",",
"I",
"iter",
")",
"{",
"int",
"poscnt",
"=",
"0",
",",
"negcnt",
"=",
"0",
",",
"pospre",
"=",
"0",... | Compute the area under the ROC curve given a set of positive IDs and a
sorted list of (comparable, ID)s, where the comparable object is used to
decided when two objects are interchangeable.
@param <I> Iterator type
@param predicate Predicate to test for positive objects
@param iter Iterator over results, with ties.
@r... | [
"Compute",
"the",
"area",
"under",
"the",
"ROC",
"curve",
"given",
"a",
"set",
"of",
"positive",
"IDs",
"and",
"a",
"sorted",
"list",
"of",
"(",
"comparable",
"ID",
")",
"s",
"where",
"the",
"comparable",
"object",
"is",
"used",
"to",
"decided",
"when",
... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/evaluation/scores/ROCEvaluation.java#L113-L136 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/hashing/DataHasher.java | DataHasher.getHash | public final DataHash getHash() {
if (outputHash == null) {
byte[] hash = messageDigest.digest();
outputHash = new DataHash(algorithm, hash);
}
return outputHash;
} | java | public final DataHash getHash() {
if (outputHash == null) {
byte[] hash = messageDigest.digest();
outputHash = new DataHash(algorithm, hash);
}
return outputHash;
} | [
"public",
"final",
"DataHash",
"getHash",
"(",
")",
"{",
"if",
"(",
"outputHash",
"==",
"null",
")",
"{",
"byte",
"[",
"]",
"hash",
"=",
"messageDigest",
".",
"digest",
"(",
")",
";",
"outputHash",
"=",
"new",
"DataHash",
"(",
"algorithm",
",",
"hash",... | Gets the final hash value for the digest.
<p> This will not reset hash calculation.</p>
@return hashValue with computed hash value.
@throws HashException when exception occurs during hash calculation. | [
"Gets",
"the",
"final",
"hash",
"value",
"for",
"the",
"digest",
".",
"<p",
">",
"This",
"will",
"not",
"reset",
"hash",
"calculation",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/hashing/DataHasher.java#L268-L274 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/misc/TriangularSolver_DSCC.java | TriangularSolver_DSCC.solveL | public static void solveL(DMatrixSparseCSC L , double []x )
{
final int N = L.numCols;
int idx0 = L.col_idx[0];
for (int col = 0; col < N; col++) {
int idx1 = L.col_idx[col+1];
double x_j = x[col] /= L.nz_values[idx0];
for (int i = idx0+1; i < idx1; i++... | java | public static void solveL(DMatrixSparseCSC L , double []x )
{
final int N = L.numCols;
int idx0 = L.col_idx[0];
for (int col = 0; col < N; col++) {
int idx1 = L.col_idx[col+1];
double x_j = x[col] /= L.nz_values[idx0];
for (int i = idx0+1; i < idx1; i++... | [
"public",
"static",
"void",
"solveL",
"(",
"DMatrixSparseCSC",
"L",
",",
"double",
"[",
"]",
"x",
")",
"{",
"final",
"int",
"N",
"=",
"L",
".",
"numCols",
";",
"int",
"idx0",
"=",
"L",
".",
"col_idx",
"[",
"0",
"]",
";",
"for",
"(",
"int",
"col",... | Solves for a lower triangular matrix against a dense matrix. L*x = b
@param L Lower triangular matrix. Diagonal elements are assumed to be non-zero
@param x (Input) Solution matrix 'b'. (Output) matrix 'x' | [
"Solves",
"for",
"a",
"lower",
"triangular",
"matrix",
"against",
"a",
"dense",
"matrix",
".",
"L",
"*",
"x",
"=",
"b"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/misc/TriangularSolver_DSCC.java#L40-L57 |
LachlanMcKee/gsonpath | library/src/main/java/gsonpath/GsonPath.java | GsonPath.createTypeAdapterFactory | public static TypeAdapterFactory createTypeAdapterFactory(Class<? extends TypeAdapterFactory> clazz) {
String factoryClassName = clazz.getCanonicalName() + FACTORY_IMPLEMENTATION_SUFFIX;
try {
return (TypeAdapterFactory) Class.forName(factoryClassName).newInstance();
} catch (Excepti... | java | public static TypeAdapterFactory createTypeAdapterFactory(Class<? extends TypeAdapterFactory> clazz) {
String factoryClassName = clazz.getCanonicalName() + FACTORY_IMPLEMENTATION_SUFFIX;
try {
return (TypeAdapterFactory) Class.forName(factoryClassName).newInstance();
} catch (Excepti... | [
"public",
"static",
"TypeAdapterFactory",
"createTypeAdapterFactory",
"(",
"Class",
"<",
"?",
"extends",
"TypeAdapterFactory",
">",
"clazz",
")",
"{",
"String",
"factoryClassName",
"=",
"clazz",
".",
"getCanonicalName",
"(",
")",
"+",
"FACTORY_IMPLEMENTATION_SUFFIX",
... | Creates an instance of an {@link TypeAdapterFactory} implementation class that implements the input interface.
<p>
This factory is used to map the auto generated {@link com.google.gson.TypeAdapter} classes created using the
{@link gsonpath.AutoGsonAdapter} annotation.
<p>
Only a single use of reflection is used within ... | [
"Creates",
"an",
"instance",
"of",
"an",
"{",
"@link",
"TypeAdapterFactory",
"}",
"implementation",
"class",
"that",
"implements",
"the",
"input",
"interface",
".",
"<p",
">",
"This",
"factory",
"is",
"used",
"to",
"map",
"the",
"auto",
"generated",
"{",
"@l... | train | https://github.com/LachlanMcKee/gsonpath/blob/7462869521b163684d66a07feef0ddbadc8949b5/library/src/main/java/gsonpath/GsonPath.java#L29-L36 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserProfileHandlerImpl.java | UserProfileHandlerImpl.postSave | private void postSave(UserProfile userProfile, boolean isNew) throws Exception
{
for (UserProfileEventListener listener : listeners)
{
listener.postSave(userProfile, isNew);
}
} | java | private void postSave(UserProfile userProfile, boolean isNew) throws Exception
{
for (UserProfileEventListener listener : listeners)
{
listener.postSave(userProfile, isNew);
}
} | [
"private",
"void",
"postSave",
"(",
"UserProfile",
"userProfile",
",",
"boolean",
"isNew",
")",
"throws",
"Exception",
"{",
"for",
"(",
"UserProfileEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"postSave",
"(",
"userProfile",
",",
"isN... | Notifying listeners after profile creation.
@param userProfile
the user profile which is used in save operation
@param isNew
true if we have deal with new profile, otherwise it is false
which mean update operation is in progress
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"after",
"profile",
"creation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserProfileHandlerImpl.java#L427-L433 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.deserializeFsPermission | public static FsPermission deserializeFsPermission(State props, String propName, FsPermission defaultPermission) {
short mode = props.getPropAsShortWithRadix(propName, defaultPermission.toShort(),
ConfigurationKeys.PERMISSION_PARSING_RADIX);
return new FsPermission(mode);
} | java | public static FsPermission deserializeFsPermission(State props, String propName, FsPermission defaultPermission) {
short mode = props.getPropAsShortWithRadix(propName, defaultPermission.toShort(),
ConfigurationKeys.PERMISSION_PARSING_RADIX);
return new FsPermission(mode);
} | [
"public",
"static",
"FsPermission",
"deserializeFsPermission",
"(",
"State",
"props",
",",
"String",
"propName",
",",
"FsPermission",
"defaultPermission",
")",
"{",
"short",
"mode",
"=",
"props",
".",
"getPropAsShortWithRadix",
"(",
"propName",
",",
"defaultPermission... | Get {@link FsPermission} from a {@link State} object.
@param props A {@link State} containing properties.
@param propName The property name for the permission. If not contained in the given state,
defaultPermission will be used.
@param defaultPermission default permission if propName is not contained in props.
@return... | [
"Get",
"{",
"@link",
"FsPermission",
"}",
"from",
"a",
"{",
"@link",
"State",
"}",
"object",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L909-L913 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.createInternalDropShadowRounded | public Shape createInternalDropShadowRounded(final int x, final int y, final int w, final int h) {
final double radius = h / 2;
final int right = x + w;
final double bottom = y + radius;
path.reset();
// Upper edge.
path.moveTo(x, bottom);
path.quadTo(x, y, ... | java | public Shape createInternalDropShadowRounded(final int x, final int y, final int w, final int h) {
final double radius = h / 2;
final int right = x + w;
final double bottom = y + radius;
path.reset();
// Upper edge.
path.moveTo(x, bottom);
path.quadTo(x, y, ... | [
"public",
"Shape",
"createInternalDropShadowRounded",
"(",
"final",
"int",
"x",
",",
"final",
"int",
"y",
",",
"final",
"int",
"w",
",",
"final",
"int",
"h",
")",
"{",
"final",
"double",
"radius",
"=",
"h",
"/",
"2",
";",
"final",
"int",
"right",
"=",
... | Return a path for a rounded internal drop shadow. This is used for
progress bar tracks and search fields.
@param x the X coordinate of the upper-left corner of the shadow
@param y the Y coordinate of the upper-left corner of the shadow
@param w the width of the shadow
@param h the height of the rectangle
@return ... | [
"Return",
"a",
"path",
"for",
"a",
"rounded",
"internal",
"drop",
"shadow",
".",
"This",
"is",
"used",
"for",
"progress",
"bar",
"tracks",
"and",
"search",
"fields",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L409-L431 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java | CDKMCS.getOverlaps | public static List<IAtomContainer> getOverlaps(IAtomContainer sourceGraph, IAtomContainer targetGraph,
boolean shouldMatchBonds) throws CDKException {
List<List<CDKRMap>> rMapsList = search(sourceGraph, targetGraph, new BitSet(), new BitSet(), true, false,
shouldMatchBonds);
... | java | public static List<IAtomContainer> getOverlaps(IAtomContainer sourceGraph, IAtomContainer targetGraph,
boolean shouldMatchBonds) throws CDKException {
List<List<CDKRMap>> rMapsList = search(sourceGraph, targetGraph, new BitSet(), new BitSet(), true, false,
shouldMatchBonds);
... | [
"public",
"static",
"List",
"<",
"IAtomContainer",
">",
"getOverlaps",
"(",
"IAtomContainer",
"sourceGraph",
",",
"IAtomContainer",
"targetGraph",
",",
"boolean",
"shouldMatchBonds",
")",
"throws",
"CDKException",
"{",
"List",
"<",
"List",
"<",
"CDKRMap",
">>",
"r... | Returns all the maximal common substructure between 2 atom containers.
@param sourceGraph first molecule. Must not be an IQueryAtomContainer.
@param targetGraph second molecule. May be an IQueryAtomContainer.
@param shouldMatchBonds
@return the list of all the maximal common substructure
found projected of sou... | [
"Returns",
"all",
"the",
"maximal",
"common",
"substructure",
"between",
"2",
"atom",
"containers",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java#L398-L410 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/table/support/AbstractObjectTable.java | AbstractObjectTable.createTableModel | protected GlazedTableModel createTableModel(EventList eventList) {
return new GlazedTableModel(eventList, getColumnPropertyNames(),
modelId) {
protected TableFormat createTableFormat() {
return new DefaultAdvancedTableFormat();
}
};
} | java | protected GlazedTableModel createTableModel(EventList eventList) {
return new GlazedTableModel(eventList, getColumnPropertyNames(),
modelId) {
protected TableFormat createTableFormat() {
return new DefaultAdvancedTableFormat();
}
};
} | [
"protected",
"GlazedTableModel",
"createTableModel",
"(",
"EventList",
"eventList",
")",
"{",
"return",
"new",
"GlazedTableModel",
"(",
"eventList",
",",
"getColumnPropertyNames",
"(",
")",
",",
"modelId",
")",
"{",
"protected",
"TableFormat",
"createTableFormat",
"("... | Construct the table model for this table. The default implementation of
this creates a GlazedTableModel using an Advanced format.
@param eventList
on which to build the model
@return table model | [
"Construct",
"the",
"table",
"model",
"for",
"this",
"table",
".",
"The",
"default",
"implementation",
"of",
"this",
"creates",
"a",
"GlazedTableModel",
"using",
"an",
"Advanced",
"format",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/table/support/AbstractObjectTable.java#L463-L470 |
camunda/camunda-commons | logging/src/main/java/org/camunda/commons/logging/BaseLogger.java | BaseLogger.createLogger | public static <T extends BaseLogger> T createLogger(Class<T> loggerClass, String projectCode, String name, String componentId) {
try {
T logger = loggerClass.newInstance();
logger.projectCode = projectCode;
logger.componentId = componentId;
logger.delegateLogger = LoggerFactory.getLogger(nam... | java | public static <T extends BaseLogger> T createLogger(Class<T> loggerClass, String projectCode, String name, String componentId) {
try {
T logger = loggerClass.newInstance();
logger.projectCode = projectCode;
logger.componentId = componentId;
logger.delegateLogger = LoggerFactory.getLogger(nam... | [
"public",
"static",
"<",
"T",
"extends",
"BaseLogger",
">",
"T",
"createLogger",
"(",
"Class",
"<",
"T",
">",
"loggerClass",
",",
"String",
"projectCode",
",",
"String",
"name",
",",
"String",
"componentId",
")",
"{",
"try",
"{",
"T",
"logger",
"=",
"log... | Creates a new instance of the {@link BaseLogger Logger}.
@param loggerClass the type of the logger
@param projectCode the unique code for a complete project.
@param name the name of the slf4j logger to use.
@param componentId the unique id of the component. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"{",
"@link",
"BaseLogger",
"Logger",
"}",
"."
] | train | https://github.com/camunda/camunda-commons/blob/bd3195db47c92c25717288fe9e6735f8e882f247/logging/src/main/java/org/camunda/commons/logging/BaseLogger.java#L90-L106 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webserver.plugin.utility/src/com/ibm/ws/webserver/plugin/utility/utils/CommonMBeanConnection.java | CommonMBeanConnection.getMBeanServerConnection | private JMXConnector getMBeanServerConnection(String controllerHost, int controllerPort, HashMap<String, Object> environment) throws MalformedURLException, IOException {
JMXServiceURL serviceURL = new JMXServiceURL("REST", controllerHost, controllerPort, "/IBMJMXConnectorREST");
return new ClientProvide... | java | private JMXConnector getMBeanServerConnection(String controllerHost, int controllerPort, HashMap<String, Object> environment) throws MalformedURLException, IOException {
JMXServiceURL serviceURL = new JMXServiceURL("REST", controllerHost, controllerPort, "/IBMJMXConnectorREST");
return new ClientProvide... | [
"private",
"JMXConnector",
"getMBeanServerConnection",
"(",
"String",
"controllerHost",
",",
"int",
"controllerPort",
",",
"HashMap",
"<",
"String",
",",
"Object",
">",
"environment",
")",
"throws",
"MalformedURLException",
",",
"IOException",
"{",
"JMXServiceURL",
"s... | Get the MBeanServerConnection for the target controller host and port.
@param controllerHost
@param controllerPort
@param environment
@return
@throws MalformedURLException
@throws IOException | [
"Get",
"the",
"MBeanServerConnection",
"for",
"the",
"target",
"controller",
"host",
"and",
"port",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webserver.plugin.utility/src/com/ibm/ws/webserver/plugin/utility/utils/CommonMBeanConnection.java#L114-L117 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.loginWithEmail | @SuppressWarnings("WeakerAccess")
public AuthenticationRequest loginWithEmail(@NonNull String email, @NonNull String verificationCode) {
return loginWithEmail(email, verificationCode, EMAIL_CONNECTION);
} | java | @SuppressWarnings("WeakerAccess")
public AuthenticationRequest loginWithEmail(@NonNull String email, @NonNull String verificationCode) {
return loginWithEmail(email, verificationCode, EMAIL_CONNECTION);
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"AuthenticationRequest",
"loginWithEmail",
"(",
"@",
"NonNull",
"String",
"email",
",",
"@",
"NonNull",
"String",
"verificationCode",
")",
"{",
"return",
"loginWithEmail",
"(",
"email",
",",
"verificat... | Log in a user using an email and a verification code received via Email (Part of passwordless login flow)
By default it will try to authenticate using the "email" connection.
Example usage:
<pre>
{@code
client.loginWithEmail("{email}", "{code}")
.start(new BaseCallback<Credentials>() {
{@literal}Override
public void on... | [
"Log",
"in",
"a",
"user",
"using",
"an",
"email",
"and",
"a",
"verification",
"code",
"received",
"via",
"Email",
"(",
"Part",
"of",
"passwordless",
"login",
"flow",
")",
"By",
"default",
"it",
"will",
"try",
"to",
"authenticate",
"using",
"the",
"email",
... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L434-L437 |
MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/mapping/Mapper.java | Mapper.toDBObject | public DBObject toDBObject(final Object entity, final Map<Object, DBObject> involvedObjects) {
return toDBObject(entity, involvedObjects, true);
} | java | public DBObject toDBObject(final Object entity, final Map<Object, DBObject> involvedObjects) {
return toDBObject(entity, involvedObjects, true);
} | [
"public",
"DBObject",
"toDBObject",
"(",
"final",
"Object",
"entity",
",",
"final",
"Map",
"<",
"Object",
",",
"DBObject",
">",
"involvedObjects",
")",
"{",
"return",
"toDBObject",
"(",
"entity",
",",
"involvedObjects",
",",
"true",
")",
";",
"}"
] | Converts an entity (POJO) to a DBObject. A special field will be added to keep track of the class type.
@param entity The POJO
@param involvedObjects A Map of (already converted) POJOs
@return the DBObject | [
"Converts",
"an",
"entity",
"(",
"POJO",
")",
"to",
"a",
"DBObject",
".",
"A",
"special",
"field",
"will",
"be",
"added",
"to",
"keep",
"track",
"of",
"the",
"class",
"type",
"."
] | train | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/mapping/Mapper.java#L622-L624 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/util/TextFormatter.java | TextFormatter.appendEpochMillis | public static void appendEpochMillis(StringBuilder buf, long timeMillis) {
buf.append(dateTimeFormatter.format(Instant.ofEpochMilli(timeMillis)))
.append('(').append(timeMillis).append(')');
} | java | public static void appendEpochMillis(StringBuilder buf, long timeMillis) {
buf.append(dateTimeFormatter.format(Instant.ofEpochMilli(timeMillis)))
.append('(').append(timeMillis).append(')');
} | [
"public",
"static",
"void",
"appendEpochMillis",
"(",
"StringBuilder",
"buf",
",",
"long",
"timeMillis",
")",
"{",
"buf",
".",
"append",
"(",
"dateTimeFormatter",
".",
"format",
"(",
"Instant",
".",
"ofEpochMilli",
"(",
"timeMillis",
")",
")",
")",
".",
"app... | Formats the given epoch time in milliseconds to typical human-readable format
"yyyy-MM-dd'T'HH_mm:ss.SSSX" and appends it to the specified {@link StringBuilder}. | [
"Formats",
"the",
"given",
"epoch",
"time",
"in",
"milliseconds",
"to",
"typical",
"human",
"-",
"readable",
"format",
"yyyy",
"-",
"MM",
"-",
"dd",
"T",
"HH_mm",
":",
"ss",
".",
"SSSX",
"and",
"appends",
"it",
"to",
"the",
"specified",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/util/TextFormatter.java#L173-L176 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java | ApiOvhDedicatednas.serviceName_partition_partitionName_PUT | public void serviceName_partition_partitionName_PUT(String serviceName, String partitionName, OvhPartition body) throws IOException {
String qPath = "/dedicated/nas/{serviceName}/partition/{partitionName}";
StringBuilder sb = path(qPath, serviceName, partitionName);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void serviceName_partition_partitionName_PUT(String serviceName, String partitionName, OvhPartition body) throws IOException {
String qPath = "/dedicated/nas/{serviceName}/partition/{partitionName}";
StringBuilder sb = path(qPath, serviceName, partitionName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_partition_partitionName_PUT",
"(",
"String",
"serviceName",
",",
"String",
"partitionName",
",",
"OvhPartition",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/nas/{serviceName}/partition/{partitionName}\"",
";"... | Alter this object properties
REST: PUT /dedicated/nas/{serviceName}/partition/{partitionName}
@param body [required] New object properties
@param serviceName [required] The internal name of your storage
@param partitionName [required] the given name of partition | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java#L209-L213 |
sakserv/hadoop-mini-clusters | hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/InJvmContainerExecutor.java | InJvmContainerExecutor.doLaunchContainer | private void doLaunchContainer(Class<?> containerClass, Method mainMethod, String[] arguments) throws Exception {
if (logger.isInfoEnabled()) {
logger.info("Launching container for " + containerClass.getName()
+ " with arguments: " + Arrays.asList(arguments));
}
... | java | private void doLaunchContainer(Class<?> containerClass, Method mainMethod, String[] arguments) throws Exception {
if (logger.isInfoEnabled()) {
logger.info("Launching container for " + containerClass.getName()
+ " with arguments: " + Arrays.asList(arguments));
}
... | [
"private",
"void",
"doLaunchContainer",
"(",
"Class",
"<",
"?",
">",
"containerClass",
",",
"Method",
"mainMethod",
",",
"String",
"[",
"]",
"arguments",
")",
"throws",
"Exception",
"{",
"if",
"(",
"logger",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"logge... | Will invoke Container's main method blocking if necessary. This method
contains a hack that I am not proud of it, but given the fact that some
containers rely on System.exit to manage its life-cycle instead of proper
exit this will ensure that together with the
SystemExitDisallowingSecurityManager (see constructor of t... | [
"Will",
"invoke",
"Container",
"s",
"main",
"method",
"blocking",
"if",
"necessary",
".",
"This",
"method",
"contains",
"a",
"hack",
"that",
"I",
"am",
"not",
"proud",
"of",
"it",
"but",
"given",
"the",
"fact",
"that",
"some",
"containers",
"rely",
"on",
... | train | https://github.com/sakserv/hadoop-mini-clusters/blob/c3915274714b457cf7e1af62f2f289274510dc0b/hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/InJvmContainerExecutor.java#L257-L274 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SimpleRandomSampling.java | SimpleRandomSampling.xbarStd | public static double xbarStd(double std, int sampleN, int populationN) {
return Math.sqrt(xbarVariance(std*std, sampleN, populationN));
} | java | public static double xbarStd(double std, int sampleN, int populationN) {
return Math.sqrt(xbarVariance(std*std, sampleN, populationN));
} | [
"public",
"static",
"double",
"xbarStd",
"(",
"double",
"std",
",",
"int",
"sampleN",
",",
"int",
"populationN",
")",
"{",
"return",
"Math",
".",
"sqrt",
"(",
"xbarVariance",
"(",
"std",
"*",
"std",
",",
"sampleN",
",",
"populationN",
")",
")",
";",
"}... | Calculates Standard Deviation for Xbar for finite population size
@param std
@param sampleN
@param populationN
@return | [
"Calculates",
"Standard",
"Deviation",
"for",
"Xbar",
"for",
"finite",
"population",
"size"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SimpleRandomSampling.java#L190-L192 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeParamsForSinglePreparedEntry | protected void writeParamsForSinglePreparedEntry(StringBuilder sb, SortedMap<String, String> paramMap, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("(");
for (Map.Entry<String, String> paramEntry : paramMap.entrySet()) {
sb.append(paramEntry.getValue());
sb.... | java | protected void writeParamsForSinglePreparedEntry(StringBuilder sb, SortedMap<String, String> paramMap, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("(");
for (Map.Entry<String, String> paramEntry : paramMap.entrySet()) {
sb.append(paramEntry.getValue());
sb.... | [
"protected",
"void",
"writeParamsForSinglePreparedEntry",
"(",
"StringBuilder",
"sb",
",",
"SortedMap",
"<",
"String",
",",
"String",
">",
"paramMap",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"ap... | Write query parameters for PreparedStatement.
<p>default: Params:[(foo,100),(bar,101)],
@param sb StringBuilder to write
@param paramMap sorted parameters map
@param execInfo execution info
@param queryInfoList query info list
@since 1.4 | [
"Write",
"query",
"parameters",
"for",
"PreparedStatement",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L295-L303 |
Azure/azure-sdk-for-java | keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java | VaultsInner.beginPurgeDeleted | public void beginPurgeDeleted(String vaultName, String location) {
beginPurgeDeletedWithServiceResponseAsync(vaultName, location).toBlocking().single().body();
} | java | public void beginPurgeDeleted(String vaultName, String location) {
beginPurgeDeletedWithServiceResponseAsync(vaultName, location).toBlocking().single().body();
} | [
"public",
"void",
"beginPurgeDeleted",
"(",
"String",
"vaultName",
",",
"String",
"location",
")",
"{",
"beginPurgeDeletedWithServiceResponseAsync",
"(",
"vaultName",
",",
"location",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
... | Permanently deletes the specified vault. aka Purges the deleted Azure key vault.
@param vaultName The name of the soft-deleted vault.
@param location The location of the soft-deleted vault.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejecte... | [
"Permanently",
"deletes",
"the",
"specified",
"vault",
".",
"aka",
"Purges",
"the",
"deleted",
"Azure",
"key",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java#L1321-L1323 |
Appendium/objectlabkit | datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/AbstractIMMDateCalculator.java | AbstractIMMDateCalculator.getIMMDates | @Override
public List<E> getIMMDates(final E start, final E end) {
return getIMMDates(start, end, IMMPeriod.QUARTERLY);
} | java | @Override
public List<E> getIMMDates(final E start, final E end) {
return getIMMDates(start, end, IMMPeriod.QUARTERLY);
} | [
"@",
"Override",
"public",
"List",
"<",
"E",
">",
"getIMMDates",
"(",
"final",
"E",
"start",
",",
"final",
"E",
"end",
")",
"{",
"return",
"getIMMDates",
"(",
"start",
",",
"end",
",",
"IMMPeriod",
".",
"QUARTERLY",
")",
";",
"}"
] | Returns a list of IMM dates between 2 dates, it will exclude the start
date if it is an IMM date but would include the end date if it is an IMM
(same as IMMPeriod.QUARTERLY).
@param start
start of the interval, excluded
@param end
end of the interval, may be included.
@return list of IMM dates | [
"Returns",
"a",
"list",
"of",
"IMM",
"dates",
"between",
"2",
"dates",
"it",
"will",
"exclude",
"the",
"start",
"date",
"if",
"it",
"is",
"an",
"IMM",
"date",
"but",
"would",
"include",
"the",
"end",
"date",
"if",
"it",
"is",
"an",
"IMM",
"(",
"same"... | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/AbstractIMMDateCalculator.java#L120-L123 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_vm_vmId_GET | public OvhVm serviceName_datacenter_datacenterId_vm_vmId_GET(String serviceName, Long datacenterId, Long vmId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}";
StringBuilder sb = path(qPath, serviceName, datacenterId, vmId);
String resp = exec(qPath, "GET", ... | java | public OvhVm serviceName_datacenter_datacenterId_vm_vmId_GET(String serviceName, Long datacenterId, Long vmId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}";
StringBuilder sb = path(qPath, serviceName, datacenterId, vmId);
String resp = exec(qPath, "GET", ... | [
"public",
"OvhVm",
"serviceName_datacenter_datacenterId_vm_vmId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"Long",
"vmId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}\... | Get this object properties
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}
@param serviceName [required] Domain of the service
@param datacenterId [required]
@param vmId [required] Id of the virtual machine.
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2130-L2135 |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/task/OperatorTopologyStructImpl.java | OperatorTopologyStructImpl.nodesWithDataTakeUnsafe | private NodeStruct nodesWithDataTakeUnsafe() {
LOG.entering("OperatorTopologyStructImpl", "nodesWithDataTakeUnsafe");
try {
final NodeStruct child = nodesWithData.take();
LOG.exiting("OperatorTopologyStructImpl", "nodesWithDataTakeUnsafe", child);
return child;
} catch (final InterruptedE... | java | private NodeStruct nodesWithDataTakeUnsafe() {
LOG.entering("OperatorTopologyStructImpl", "nodesWithDataTakeUnsafe");
try {
final NodeStruct child = nodesWithData.take();
LOG.exiting("OperatorTopologyStructImpl", "nodesWithDataTakeUnsafe", child);
return child;
} catch (final InterruptedE... | [
"private",
"NodeStruct",
"nodesWithDataTakeUnsafe",
"(",
")",
"{",
"LOG",
".",
"entering",
"(",
"\"OperatorTopologyStructImpl\"",
",",
"\"nodesWithDataTakeUnsafe\"",
")",
";",
"try",
"{",
"final",
"NodeStruct",
"child",
"=",
"nodesWithData",
".",
"take",
"(",
")",
... | Retrieves and removes the head of {@code nodesWithData}, waiting if necessary until an element becomes available.
(Comment taken from {@link java.util.concurrent.BlockingQueue})
If interrupted while waiting, then throws a RuntimeException.
@return the head of this queue | [
"Retrieves",
"and",
"removes",
"the",
"head",
"of",
"{",
"@code",
"nodesWithData",
"}",
"waiting",
"if",
"necessary",
"until",
"an",
"element",
"becomes",
"available",
".",
"(",
"Comment",
"taken",
"from",
"{",
"@link",
"java",
".",
"util",
".",
"concurrent"... | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/task/OperatorTopologyStructImpl.java#L280-L290 |
jbake-org/jbake | jbake-core/src/main/java/org/jbake/app/FileUtil.java | FileUtil.isFileInDirectory | public static boolean isFileInDirectory(File file, File directory) throws IOException {
return (file.exists()
&& !file.isHidden()
&& directory.isDirectory()
&& file.getCanonicalPath().startsWith(directory.getCanonicalPath()));
} | java | public static boolean isFileInDirectory(File file, File directory) throws IOException {
return (file.exists()
&& !file.isHidden()
&& directory.isDirectory()
&& file.getCanonicalPath().startsWith(directory.getCanonicalPath()));
} | [
"public",
"static",
"boolean",
"isFileInDirectory",
"(",
"File",
"file",
",",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"return",
"(",
"file",
".",
"exists",
"(",
")",
"&&",
"!",
"file",
".",
"isHidden",
"(",
")",
"&&",
"directory",
".",
"i... | Utility method to determine if a given file is located somewhere in the directory provided.
@param file used to check if it is located in the provided directory.
@param directory to validate whether or not the provided file resides.
@return true if the file is somewhere in the provided directory, false if it is not.
@... | [
"Utility",
"method",
"to",
"determine",
"if",
"a",
"given",
"file",
"is",
"located",
"somewhere",
"in",
"the",
"directory",
"provided",
"."
] | train | https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/FileUtil.java#L241-L246 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/http/HtmlQuoting.java | HtmlQuoting.needsQuoting | public static boolean needsQuoting(String str) {
if (str == null) {
return false;
}
byte[] bytes = str.getBytes();
return needsQuoting(bytes, 0 , bytes.length);
} | java | public static boolean needsQuoting(String str) {
if (str == null) {
return false;
}
byte[] bytes = str.getBytes();
return needsQuoting(bytes, 0 , bytes.length);
} | [
"public",
"static",
"boolean",
"needsQuoting",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"byte",
"[",
"]",
"bytes",
"=",
"str",
".",
"getBytes",
"(",
")",
";",
"return",
"needsQuoting",
"("... | Does the given string need to be quoted?
@param str the string to check
@return does the string contain any of the active html characters? | [
"Does",
"the",
"given",
"string",
"need",
"to",
"be",
"quoted?"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/http/HtmlQuoting.java#L62-L68 |
geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/CreateIconChoicePopup.java | CreateIconChoicePopup.translateMarker | private ClickableMarkerShape translateMarker(ClickableMarkerShape shape, int amountOfMarkers) {
if (amountOfMarkers % imagePerRow != 0) {
int size = choiceListImageSize + 6;
shape.setTranslation(size * (amountOfMarkers % imagePerRow), size * (amountOfMarkers / imagePerRow));
}
return shape;
} | java | private ClickableMarkerShape translateMarker(ClickableMarkerShape shape, int amountOfMarkers) {
if (amountOfMarkers % imagePerRow != 0) {
int size = choiceListImageSize + 6;
shape.setTranslation(size * (amountOfMarkers % imagePerRow), size * (amountOfMarkers / imagePerRow));
}
return shape;
} | [
"private",
"ClickableMarkerShape",
"translateMarker",
"(",
"ClickableMarkerShape",
"shape",
",",
"int",
"amountOfMarkers",
")",
"{",
"if",
"(",
"amountOfMarkers",
"%",
"imagePerRow",
"!=",
"0",
")",
"{",
"int",
"size",
"=",
"choiceListImageSize",
"+",
"6",
";",
... | used for displaying marker SVG elements in a drawing area.
@param shape
@param amountOfMarkers
@return | [
"used",
"for",
"displaying",
"marker",
"SVG",
"elements",
"in",
"a",
"drawing",
"area",
"."
] | train | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/CreateIconChoicePopup.java#L351-L357 |
to2mbn/JMCCC | jmccc/src/main/java/org/to2mbn/jmccc/version/parsing/Versions.java | Versions.resolveAssets | public static Set<Asset> resolveAssets(MinecraftDirectory minecraftDir, String assets) throws IOException {
Objects.requireNonNull(minecraftDir);
Objects.requireNonNull(assets);
if (!minecraftDir.getAssetIndex(assets).isFile()) {
return null;
}
try {
return getVersionParser().parseAssetIndex(IOUtils.to... | java | public static Set<Asset> resolveAssets(MinecraftDirectory minecraftDir, String assets) throws IOException {
Objects.requireNonNull(minecraftDir);
Objects.requireNonNull(assets);
if (!minecraftDir.getAssetIndex(assets).isFile()) {
return null;
}
try {
return getVersionParser().parseAssetIndex(IOUtils.to... | [
"public",
"static",
"Set",
"<",
"Asset",
">",
"resolveAssets",
"(",
"MinecraftDirectory",
"minecraftDir",
",",
"String",
"assets",
")",
"throws",
"IOException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"minecraftDir",
")",
";",
"Objects",
".",
"requireNonNull",... | Resolves the asset index.
@param minecraftDir the minecraft directory
@param assets the name of the asset index, you can get this via
{@link Version#getAssets()}
@return the asset index, null if the asset index does not exist
@throws IOException if an I/O error has occurred during resolving asset
index
@throws NullPoi... | [
"Resolves",
"the",
"asset",
"index",
"."
] | train | https://github.com/to2mbn/JMCCC/blob/17e5b1b56ff18255cfd60976dca1a24598946647/jmccc/src/main/java/org/to2mbn/jmccc/version/parsing/Versions.java#L102-L114 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/img/ImageExtensions.java | ImageExtensions.getResized | public static BufferedImage getResized(final BufferedImage originalImage,
final String formatName, final int targetWidth, final int targetHeight) throws IOException
{
return read(resize(originalImage, formatName, targetWidth, targetHeight));
} | java | public static BufferedImage getResized(final BufferedImage originalImage,
final String formatName, final int targetWidth, final int targetHeight) throws IOException
{
return read(resize(originalImage, formatName, targetWidth, targetHeight));
} | [
"public",
"static",
"BufferedImage",
"getResized",
"(",
"final",
"BufferedImage",
"originalImage",
",",
"final",
"String",
"formatName",
",",
"final",
"int",
"targetWidth",
",",
"final",
"int",
"targetHeight",
")",
"throws",
"IOException",
"{",
"return",
"read",
"... | Resize the given BufferedImage and returns the resized BufferedImage.
@param originalImage
the original image
@param formatName
the format name
@param targetWidth
the target width
@param targetHeight
the target height
@return the resized
@throws IOException
Signals that an I/O exception has occurred. | [
"Resize",
"the",
"given",
"BufferedImage",
"and",
"returns",
"the",
"resized",
"BufferedImage",
"."
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/img/ImageExtensions.java#L188-L192 |
alkacon/opencms-core | src/org/opencms/workplace/CmsDialog.java | CmsDialog.dialogToggleStart | public String dialogToggleStart(String headline, String id, boolean show) {
StringBuffer result = new StringBuffer(512);
// set icon and style class to use: hide user permissions
String image = "plus.png";
String styleClass = "hide";
if (show) {
// show user permissi... | java | public String dialogToggleStart(String headline, String id, boolean show) {
StringBuffer result = new StringBuffer(512);
// set icon and style class to use: hide user permissions
String image = "plus.png";
String styleClass = "hide";
if (show) {
// show user permissi... | [
"public",
"String",
"dialogToggleStart",
"(",
"String",
"headline",
",",
"String",
"id",
",",
"boolean",
"show",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"512",
")",
";",
"// set icon and style class to use: hide user permissions",
"String"... | Builds the HTML code to fold and unfold a white-box.<p>
@param headline the heading to display
@param id the id of the toggle
@param show true if the white box is open at the beginning
@return HTML code to fold and unfold a white-box | [
"Builds",
"the",
"HTML",
"code",
"to",
"fold",
"and",
"unfold",
"a",
"white",
"-",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsDialog.java#L997-L1033 |
UrielCh/ovh-java-sdk | ovh-java-sdk-clusterhadoop/src/main/java/net/minidev/ovh/api/ApiOvhClusterhadoop.java | ApiOvhClusterhadoop.serviceName_node_hostname_role_type_GET | public OvhRole serviceName_node_hostname_role_type_GET(String serviceName, String hostname, net.minidev.ovh.api.cluster.hadoop.OvhRoleTypeEnum type) throws IOException {
String qPath = "/cluster/hadoop/{serviceName}/node/{hostname}/role/{type}";
StringBuilder sb = path(qPath, serviceName, hostname, type);
String ... | java | public OvhRole serviceName_node_hostname_role_type_GET(String serviceName, String hostname, net.minidev.ovh.api.cluster.hadoop.OvhRoleTypeEnum type) throws IOException {
String qPath = "/cluster/hadoop/{serviceName}/node/{hostname}/role/{type}";
StringBuilder sb = path(qPath, serviceName, hostname, type);
String ... | [
"public",
"OvhRole",
"serviceName_node_hostname_role_type_GET",
"(",
"String",
"serviceName",
",",
"String",
"hostname",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"cluster",
".",
"hadoop",
".",
"OvhRoleTypeEnum",
"type",
")",
"throws",
"IOException"... | Get this object properties
REST: GET /cluster/hadoop/{serviceName}/node/{hostname}/role/{type}
@param serviceName [required] The internal name of your cluster
@param hostname [required] Hostname of the node
@param type [required] Role name | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-clusterhadoop/src/main/java/net/minidev/ovh/api/ApiOvhClusterhadoop.java#L319-L324 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java | BigtableSession.createChannelPool | public static ManagedChannel createChannelPool(final String host, final BigtableOptions options,
int count) throws IOException, GeneralSecurityException {
final List<ClientInterceptor> interceptorList = new ArrayList<>();
ClientInterceptor credentialsInterceptor = CredentialInterceptorCache.getInstance()... | java | public static ManagedChannel createChannelPool(final String host, final BigtableOptions options,
int count) throws IOException, GeneralSecurityException {
final List<ClientInterceptor> interceptorList = new ArrayList<>();
ClientInterceptor credentialsInterceptor = CredentialInterceptorCache.getInstance()... | [
"public",
"static",
"ManagedChannel",
"createChannelPool",
"(",
"final",
"String",
"host",
",",
"final",
"BigtableOptions",
"options",
",",
"int",
"count",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"final",
"List",
"<",
"ClientInterceptor",
... | Create a new {@link com.google.cloud.bigtable.grpc.io.ChannelPool}, with auth headers.
@param host a {@link String} object specifying the host to connect to.
@param options a {@link BigtableOptions} object with the credentials, retry and other connection options.
@param count an int defining the number of channels to ... | [
"Create",
"a",
"new",
"{",
"@link",
"com",
".",
"google",
".",
"cloud",
".",
"bigtable",
".",
"grpc",
".",
"io",
".",
"ChannelPool",
"}",
"with",
"auth",
"headers",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java#L578-L602 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/instance/HazelcastInstanceFactory.java | HazelcastInstanceFactory.newHazelcastInstance | public static HazelcastInstance newHazelcastInstance(Config config, String instanceName, NodeContext nodeContext) {
if (config == null) {
config = new XmlConfigBuilder().build();
}
String name = getInstanceName(instanceName, config);
InstanceFuture future = new InstanceFutu... | java | public static HazelcastInstance newHazelcastInstance(Config config, String instanceName, NodeContext nodeContext) {
if (config == null) {
config = new XmlConfigBuilder().build();
}
String name = getInstanceName(instanceName, config);
InstanceFuture future = new InstanceFutu... | [
"public",
"static",
"HazelcastInstance",
"newHazelcastInstance",
"(",
"Config",
"config",
",",
"String",
"instanceName",
",",
"NodeContext",
"nodeContext",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"config",
"=",
"new",
"XmlConfigBuilder",
"(",
")",... | Creates a new Hazelcast instance.
@param config the configuration to use; if <code>null</code>, the set of defaults
as specified in the XSD for the configuration XML will be used.
@param instanceName the name of the {@link HazelcastInstance}
@param nodeContext the {@link NodeContext} to use
@return the configur... | [
"Creates",
"a",
"new",
"Hazelcast",
"instance",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/instance/HazelcastInstanceFactory.java#L194-L213 |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Reflect.java | Reflect.callProc | public static void callProc(Object instance, Class<?> type, String methodName, Class<?>[] types, Object... args) {
try {
final Method method = type.getDeclaredMethod(methodName, types);
method.setAccessible(true);
method.invoke(instance, args);
} catch (Exception exception) {
throw new Error(exception);... | java | public static void callProc(Object instance, Class<?> type, String methodName, Class<?>[] types, Object... args) {
try {
final Method method = type.getDeclaredMethod(methodName, types);
method.setAccessible(true);
method.invoke(instance, args);
} catch (Exception exception) {
throw new Error(exception);... | [
"public",
"static",
"void",
"callProc",
"(",
"Object",
"instance",
",",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
",",
"Object",
"...",
"args",
")",
"{",
"try",
"{",
"final",
"Method"... | Call the method.
@param instance the instance to call on.
@param type the type.
@param methodName the name of the method.
@param types the types of the parameters.
@param args the values of the arguments. | [
"Call",
"the",
"method",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Reflect.java#L77-L85 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java | ManagedClustersInner.beginResetAADProfileAsync | public Observable<Void> beginResetAADProfileAsync(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters) {
return beginResetAADProfileWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
... | java | public Observable<Void> beginResetAADProfileAsync(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters) {
return beginResetAADProfileWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
... | [
"public",
"Observable",
"<",
"Void",
">",
"beginResetAADProfileAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterAADProfile",
"parameters",
")",
"{",
"return",
"beginResetAADProfileWithServiceResponseAsync",
"(",
"resourceGroupName... | Reset AAD Profile of a managed cluster.
Update the AAD Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster.
@throws IllegalArg... | [
"Reset",
"AAD",
"Profile",
"of",
"a",
"managed",
"cluster",
".",
"Update",
"the",
"AAD",
"Profile",
"for",
"a",
"managed",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java#L1782-L1789 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.isCase | public static boolean isCase(Object caseValue, Object switchValue) {
if (caseValue.getClass().isArray()) {
return isCase(DefaultTypeTransformation.asCollection(caseValue), switchValue);
}
return caseValue.equals(switchValue);
} | java | public static boolean isCase(Object caseValue, Object switchValue) {
if (caseValue.getClass().isArray()) {
return isCase(DefaultTypeTransformation.asCollection(caseValue), switchValue);
}
return caseValue.equals(switchValue);
} | [
"public",
"static",
"boolean",
"isCase",
"(",
"Object",
"caseValue",
",",
"Object",
"switchValue",
")",
"{",
"if",
"(",
"caseValue",
".",
"getClass",
"(",
")",
".",
"isArray",
"(",
")",
")",
"{",
"return",
"isCase",
"(",
"DefaultTypeTransformation",
".",
"... | Method for overloading the behavior of the 'case' method in switch statements.
The default implementation handles arrays types but otherwise simply delegates
to Object#equals, but this may be overridden for other types. In this example:
<pre> switch( a ) {
case b: //some code
}</pre>
"some code" is called when <code>b.... | [
"Method",
"for",
"overloading",
"the",
"behavior",
"of",
"the",
"case",
"method",
"in",
"switch",
"statements",
".",
"The",
"default",
"implementation",
"handles",
"arrays",
"types",
"but",
"otherwise",
"simply",
"delegates",
"to",
"Object#equals",
"but",
"this",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L1110-L1115 |
weld/core | impl/src/main/java/org/jboss/weld/resolution/BeanTypeAssignabilityRules.java | BeanTypeAssignabilityRules.matches | private boolean matches(Class<?> type1, ParameterizedType type2) {
if (!type1.equals(Reflections.getRawType(type2))) {
return false;
}
return Types.isArrayOfUnboundedTypeVariablesOrObjects(type2.getActualTypeArguments());
} | java | private boolean matches(Class<?> type1, ParameterizedType type2) {
if (!type1.equals(Reflections.getRawType(type2))) {
return false;
}
return Types.isArrayOfUnboundedTypeVariablesOrObjects(type2.getActualTypeArguments());
} | [
"private",
"boolean",
"matches",
"(",
"Class",
"<",
"?",
">",
"type1",
",",
"ParameterizedType",
"type2",
")",
"{",
"if",
"(",
"!",
"type1",
".",
"equals",
"(",
"Reflections",
".",
"getRawType",
"(",
"type2",
")",
")",
")",
"{",
"return",
"false",
";",... | A parameterized bean type is considered assignable to a raw required type if the raw types
are identical and all type parameters of the bean type are either unbounded type variables or
java.lang.Object.
<p>
A raw bean type is considered assignable to a parameterized required type if the raw types are
identical and all ... | [
"A",
"parameterized",
"bean",
"type",
"is",
"considered",
"assignable",
"to",
"a",
"raw",
"required",
"type",
"if",
"the",
"raw",
"types",
"are",
"identical",
"and",
"all",
"type",
"parameters",
"of",
"the",
"bean",
"type",
"are",
"either",
"unbounded",
"typ... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/BeanTypeAssignabilityRules.java#L89-L94 |
redkale/redkale | src/org/redkale/convert/json/JsonWriter.java | JsonWriter.writeTo | public void writeTo(final boolean quote, final String value) {
int len = value.length();
expand(len + (quote ? 2 : 0));
if (quote) content[count++] = '"';
value.getChars(0, len, content, count);
count += len;
if (quote) content[count++] = '"';
} | java | public void writeTo(final boolean quote, final String value) {
int len = value.length();
expand(len + (quote ? 2 : 0));
if (quote) content[count++] = '"';
value.getChars(0, len, content, count);
count += len;
if (quote) content[count++] = '"';
} | [
"public",
"void",
"writeTo",
"(",
"final",
"boolean",
"quote",
",",
"final",
"String",
"value",
")",
"{",
"int",
"len",
"=",
"value",
".",
"length",
"(",
")",
";",
"expand",
"(",
"len",
"+",
"(",
"quote",
"?",
"2",
":",
"0",
")",
")",
";",
"if",
... | <b>注意:</b> 该String值不能为null且不会进行转义, 只用于不含需要转义字符的字符串,例如enum、double、BigInteger转换的String
@param quote 是否加双引号
@param value 非null且不含需要转义的字符的String值 | [
"<b",
">",
"注意:<",
"/",
"b",
">",
"该String值不能为null且不会进行转义,",
"只用于不含需要转义字符的字符串,例如enum、double、BigInteger转换的String"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/convert/json/JsonWriter.java#L91-L98 |
raphw/byte-buddy | byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Initialization.java | Initialization.getEntryPoint | public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, File root, Iterable<? extends File> classPath) {
if (entryPoint == null || entryPoint.length() == 0) {
throw new GradleException("Entry point name is not defined");
}
for (EntryPoint.Default entryPoint : EntryPo... | java | public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, File root, Iterable<? extends File> classPath) {
if (entryPoint == null || entryPoint.length() == 0) {
throw new GradleException("Entry point name is not defined");
}
for (EntryPoint.Default entryPoint : EntryPo... | [
"public",
"EntryPoint",
"getEntryPoint",
"(",
"ClassLoaderResolver",
"classLoaderResolver",
",",
"File",
"root",
",",
"Iterable",
"<",
"?",
"extends",
"File",
">",
"classPath",
")",
"{",
"if",
"(",
"entryPoint",
"==",
"null",
"||",
"entryPoint",
".",
"length",
... | Resolves this initialization to an entry point instance.
@param classLoaderResolver The class loader resolver to use if appropriate.
@param root The root file describing the current tasks classes.
@param classPath The class path of the current task.
@return A resolved entry point. | [
"Resolves",
"this",
"initialization",
"to",
"an",
"entry",
"point",
"instance",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Initialization.java#L61-L77 |
xiancloud/xian | xian-oauth20/xian-apifestOauth20/src/main/java/com/apifest/oauth20/ScopeService.java | ScopeService.getScopes | public String getScopes(HttpRequest req) throws OAuthException {
QueryStringDecoder dec = new QueryStringDecoder(req.uri());
Map<String, List<String>> queryParams = dec.parameters();
if (queryParams.containsKey("client_id")) {
return getScopes(queryParams.get("client_id").get(0));
... | java | public String getScopes(HttpRequest req) throws OAuthException {
QueryStringDecoder dec = new QueryStringDecoder(req.uri());
Map<String, List<String>> queryParams = dec.parameters();
if (queryParams.containsKey("client_id")) {
return getScopes(queryParams.get("client_id").get(0));
... | [
"public",
"String",
"getScopes",
"(",
"HttpRequest",
"req",
")",
"throws",
"OAuthException",
"{",
"QueryStringDecoder",
"dec",
"=",
"new",
"QueryStringDecoder",
"(",
"req",
".",
"uri",
"(",
")",
")",
";",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
"... | Returns either all scopes or scopes for a specific client_id passed as query parameter.
@param req request
@return string If query param client_id is passed, then the scopes for that client_id will be returned.
Otherwise, all available scopes will be returned in JSON format. | [
"Returns",
"either",
"all",
"scopes",
"or",
"scopes",
"for",
"a",
"specific",
"client_id",
"passed",
"as",
"query",
"parameter",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-oauth20/xian-apifestOauth20/src/main/java/com/apifest/oauth20/ScopeService.java#L108-L123 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java | JdbcCpoAdapter.getGroupType | protected <T> String getGroupType(T obj, String type, String name, Connection c) throws CpoException {
String retType = type;
long objCount;
if (JdbcCpoAdapter.PERSIST_GROUP.equals(retType)) {
objCount = existsObject(name, obj, c, null);
if (objCount == 0) {
retType = JdbcCpoAdapter.CR... | java | protected <T> String getGroupType(T obj, String type, String name, Connection c) throws CpoException {
String retType = type;
long objCount;
if (JdbcCpoAdapter.PERSIST_GROUP.equals(retType)) {
objCount = existsObject(name, obj, c, null);
if (objCount == 0) {
retType = JdbcCpoAdapter.CR... | [
"protected",
"<",
"T",
">",
"String",
"getGroupType",
"(",
"T",
"obj",
",",
"String",
"type",
",",
"String",
"name",
",",
"Connection",
"c",
")",
"throws",
"CpoException",
"{",
"String",
"retType",
"=",
"type",
";",
"long",
"objCount",
";",
"if",
"(",
... | DOCUMENT ME!
@param obj DOCUMENT ME!
@param type DOCUMENT ME!
@param name DOCUMENT ME!
@param c DOCUMENT ME!
@return DOCUMENT ME!
@throws CpoException DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java#L2019-L2036 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/AnnotationUtil.java | AnnotationUtil.getAnnotation | public static Annotation getAnnotation(Annotation[] annotations, Class<?> annotationClass) {
return Arrays.stream(annotations).filter(annotation -> annotation.annotationType().equals(annotationClass)).findFirst().orElse(null);
} | java | public static Annotation getAnnotation(Annotation[] annotations, Class<?> annotationClass) {
return Arrays.stream(annotations).filter(annotation -> annotation.annotationType().equals(annotationClass)).findFirst().orElse(null);
} | [
"public",
"static",
"Annotation",
"getAnnotation",
"(",
"Annotation",
"[",
"]",
"annotations",
",",
"Class",
"<",
"?",
">",
"annotationClass",
")",
"{",
"return",
"Arrays",
".",
"stream",
"(",
"annotations",
")",
".",
"filter",
"(",
"annotation",
"->",
"anno... | Gets annotation.
@param annotations the annotations
@param annotationClass the annotation class
@return the annotation | [
"Gets",
"annotation",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/AnnotationUtil.java#L18-L20 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/rocksdb/RocksDbWrapper.java | RocksDbWrapper.openReadOnly | public static RocksDbWrapper openReadOnly(String dirPath, DBOptions dbOptions,
ReadOptions readOptions) throws RocksDbException, IOException {
RocksDbWrapper rocksDbWrapper = new RocksDbWrapper(dirPath, true);
rocksDbWrapper.setDbOptions(dbOptions).setReadOptions(readOptions);
rocksD... | java | public static RocksDbWrapper openReadOnly(String dirPath, DBOptions dbOptions,
ReadOptions readOptions) throws RocksDbException, IOException {
RocksDbWrapper rocksDbWrapper = new RocksDbWrapper(dirPath, true);
rocksDbWrapper.setDbOptions(dbOptions).setReadOptions(readOptions);
rocksD... | [
"public",
"static",
"RocksDbWrapper",
"openReadOnly",
"(",
"String",
"dirPath",
",",
"DBOptions",
"dbOptions",
",",
"ReadOptions",
"readOptions",
")",
"throws",
"RocksDbException",
",",
"IOException",
"{",
"RocksDbWrapper",
"rocksDbWrapper",
"=",
"new",
"RocksDbWrapper"... | Open a {@link RocksDB} with specified options in read-only mode.
@param dirPath
existing {@link RocksDB} data directory
@param dbOptions
@param readOptions
@return
@throws RocksDBException
@throws IOException | [
"Open",
"a",
"{",
"@link",
"RocksDB",
"}",
"with",
"specified",
"options",
"in",
"read",
"-",
"only",
"mode",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/rocksdb/RocksDbWrapper.java#L104-L110 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.SymmetricKullbackLeibler | public static double SymmetricKullbackLeibler(double[] p, double[] q) {
double dist = 0;
for (int i = 0; i < p.length; i++) {
dist += (p[i] - q[i]) * (Math.log(p[i]) - Math.log(q[i]));
}
return dist;
} | java | public static double SymmetricKullbackLeibler(double[] p, double[] q) {
double dist = 0;
for (int i = 0; i < p.length; i++) {
dist += (p[i] - q[i]) * (Math.log(p[i]) - Math.log(q[i]));
}
return dist;
} | [
"public",
"static",
"double",
"SymmetricKullbackLeibler",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"dist",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";",
"i",
"++",
... | Gets the Symmetric Kullback-Leibler distance.
This metric is valid only for real and positive P and Q.
@param p P vector.
@param q Q vector.
@return The Symmetric Kullback Leibler distance between p and q. | [
"Gets",
"the",
"Symmetric",
"Kullback",
"-",
"Leibler",
"distance",
".",
"This",
"metric",
"is",
"valid",
"only",
"for",
"real",
"and",
"positive",
"P",
"and",
"Q",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L873-L880 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/CSSMinifierMojo.java | CSSMinifierMojo.fileCreated | @Override
public boolean fileCreated(File file) throws WatchingException {
if (stylesheets != null) {
try {
process(stylesheets);
} catch (MojoExecutionException e) {
throw new WatchingException("Error while aggregating or minifying CSS resources", fil... | java | @Override
public boolean fileCreated(File file) throws WatchingException {
if (stylesheets != null) {
try {
process(stylesheets);
} catch (MojoExecutionException e) {
throw new WatchingException("Error while aggregating or minifying CSS resources", fil... | [
"@",
"Override",
"public",
"boolean",
"fileCreated",
"(",
"File",
"file",
")",
"throws",
"WatchingException",
"{",
"if",
"(",
"stylesheets",
"!=",
"null",
")",
"{",
"try",
"{",
"process",
"(",
"stylesheets",
")",
";",
"}",
"catch",
"(",
"MojoExecutionExcepti... | Minifies the created files.
@param file is the file.
@return {@literal false} if the pipeline processing must be interrupted for this event. Most watchers should
return {@literal true} to let other watchers be notified.
@throws org.wisdom.maven.WatchingException if the watcher failed to process the given file. | [
"Minifies",
"the",
"created",
"files",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/CSSMinifierMojo.java#L295-L307 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/config/MergePolicyValidator.java | MergePolicyValidator.checkMapMergePolicyWhenStatisticsAreDisabled | private static void checkMapMergePolicyWhenStatisticsAreDisabled(String mergePolicyClass, List<Class> requiredMergeTypes) {
for (Class<?> requiredMergeType : requiredMergeTypes) {
if (MergingLastStoredTime.class.isAssignableFrom(requiredMergeType)
|| MergingExpirationTime.class.i... | java | private static void checkMapMergePolicyWhenStatisticsAreDisabled(String mergePolicyClass, List<Class> requiredMergeTypes) {
for (Class<?> requiredMergeType : requiredMergeTypes) {
if (MergingLastStoredTime.class.isAssignableFrom(requiredMergeType)
|| MergingExpirationTime.class.i... | [
"private",
"static",
"void",
"checkMapMergePolicyWhenStatisticsAreDisabled",
"(",
"String",
"mergePolicyClass",
",",
"List",
"<",
"Class",
">",
"requiredMergeTypes",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"requiredMergeType",
":",
"requiredMergeTypes",
")",
"... | Checks if the configured merge policy requires merge types, which are just available if map statistics are enabled.
@param mergePolicyClass the name of the configured merge policy class
@param requiredMergeTypes the required merge types of the configured merge policy | [
"Checks",
"if",
"the",
"configured",
"merge",
"policy",
"requires",
"merge",
"types",
"which",
"are",
"just",
"available",
"if",
"map",
"statistics",
"are",
"enabled",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/MergePolicyValidator.java#L164-L173 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.matchesPattern | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalPatternArgumentException.class })
public static <T extends CharSequence> T matchesPattern(@Nonnull final Pattern pattern, @Nonnull final T chars) {
return matchesPattern(pattern, chars, EMPTY_ARGUMENT_NAME);
} | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalPatternArgumentException.class })
public static <T extends CharSequence> T matchesPattern(@Nonnull final Pattern pattern, @Nonnull final T chars) {
return matchesPattern(pattern, chars, EMPTY_ARGUMENT_NAME);
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalPatternArgumentException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"matchesPattern",
"(",
"@",
"Nonnull"... | Ensures that a readable sequence of {@code char} values matches a specified pattern. If the given character
sequence does not match against the passed pattern, an {@link IllegalPatternArgumentException} will be thrown.
<p>
We recommend to use the overloaded method {@link Check#matchesPattern(Pattern, CharSequence, Str... | [
"Ensures",
"that",
"a",
"readable",
"sequence",
"of",
"{",
"@code",
"char",
"}",
"values",
"matches",
"a",
"specified",
"pattern",
".",
"If",
"the",
"given",
"character",
"sequence",
"does",
"not",
"match",
"against",
"the",
"passed",
"pattern",
"an",
"{",
... | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1776-L1780 |
mozilla/rhino | src/org/mozilla/javascript/Context.java | Context.newArray | public Scriptable newArray(Scriptable scope, int length)
{
NativeArray result = new NativeArray(length);
ScriptRuntime.setBuiltinProtoAndParent(result, scope,
TopLevel.Builtins.Array);
return result;
} | java | public Scriptable newArray(Scriptable scope, int length)
{
NativeArray result = new NativeArray(length);
ScriptRuntime.setBuiltinProtoAndParent(result, scope,
TopLevel.Builtins.Array);
return result;
} | [
"public",
"Scriptable",
"newArray",
"(",
"Scriptable",
"scope",
",",
"int",
"length",
")",
"{",
"NativeArray",
"result",
"=",
"new",
"NativeArray",
"(",
"length",
")",
";",
"ScriptRuntime",
".",
"setBuiltinProtoAndParent",
"(",
"result",
",",
"scope",
",",
"To... | Create an array with a specified initial length.
<p>
@param scope the scope to create the object in
@param length the initial length (JavaScript arrays may have
additional properties added dynamically).
@return the new array object | [
"Create",
"an",
"array",
"with",
"a",
"specified",
"initial",
"length",
".",
"<p",
">"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Context.java#L1694-L1700 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/PrefHelper.java | PrefHelper.setActionTotalCount | public void setActionTotalCount(String action, int count) {
ArrayList<String> actions = getActions();
if (!actions.contains(action)) {
actions.add(action);
setActions(actions);
}
setInteger(KEY_TOTAL_BASE + action, count);
} | java | public void setActionTotalCount(String action, int count) {
ArrayList<String> actions = getActions();
if (!actions.contains(action)) {
actions.add(action);
setActions(actions);
}
setInteger(KEY_TOTAL_BASE + action, count);
} | [
"public",
"void",
"setActionTotalCount",
"(",
"String",
"action",
",",
"int",
"count",
")",
"{",
"ArrayList",
"<",
"String",
">",
"actions",
"=",
"getActions",
"(",
")",
";",
"if",
"(",
"!",
"actions",
".",
"contains",
"(",
"action",
")",
")",
"{",
"ac... | <p>Sets the count of total number of times that the specified action has been carried out
during the current session, as defined in preferences.</p>
@param action - A {@link String} value containing the name of the action to return the
count for.
@param count - An {@link Integer} value containing the total number of ... | [
"<p",
">",
"Sets",
"the",
"count",
"of",
"total",
"number",
"of",
"times",
"that",
"the",
"specified",
"action",
"has",
"been",
"carried",
"out",
"during",
"the",
"current",
"session",
"as",
"defined",
"in",
"preferences",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/PrefHelper.java#L834-L841 |
liferay/com-liferay-commerce | commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/persistence/impl/CommerceTaxMethodPersistenceImpl.java | CommerceTaxMethodPersistenceImpl.removeByG_E | @Override
public CommerceTaxMethod removeByG_E(long groupId, String engineKey)
throws NoSuchTaxMethodException {
CommerceTaxMethod commerceTaxMethod = findByG_E(groupId, engineKey);
return remove(commerceTaxMethod);
} | java | @Override
public CommerceTaxMethod removeByG_E(long groupId, String engineKey)
throws NoSuchTaxMethodException {
CommerceTaxMethod commerceTaxMethod = findByG_E(groupId, engineKey);
return remove(commerceTaxMethod);
} | [
"@",
"Override",
"public",
"CommerceTaxMethod",
"removeByG_E",
"(",
"long",
"groupId",
",",
"String",
"engineKey",
")",
"throws",
"NoSuchTaxMethodException",
"{",
"CommerceTaxMethod",
"commerceTaxMethod",
"=",
"findByG_E",
"(",
"groupId",
",",
"engineKey",
")",
";",
... | Removes the commerce tax method where groupId = ? and engineKey = ? from the database.
@param groupId the group ID
@param engineKey the engine key
@return the commerce tax method that was removed | [
"Removes",
"the",
"commerce",
"tax",
"method",
"where",
"groupId",
"=",
"?",
";",
"and",
"engineKey",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/persistence/impl/CommerceTaxMethodPersistenceImpl.java#L770-L776 |
syphr42/prom | src/main/java/org/syphr/prom/PropertiesManager.java | PropertiesManager.isReferencing | public boolean isReferencing(T property1, T property2)
{
return getEvaluator().isReferencing(getRawProperty(property1),
getTranslator().getPropertyName(property2),
getRetriever());
} | java | public boolean isReferencing(T property1, T property2)
{
return getEvaluator().isReferencing(getRawProperty(property1),
getTranslator().getPropertyName(property2),
getRetriever());
} | [
"public",
"boolean",
"isReferencing",
"(",
"T",
"property1",
",",
"T",
"property2",
")",
"{",
"return",
"getEvaluator",
"(",
")",
".",
"isReferencing",
"(",
"getRawProperty",
"(",
"property1",
")",
",",
"getTranslator",
"(",
")",
".",
"getPropertyName",
"(",
... | Determine whether or not one property holds references to another property.
@param property1
the property to check for references
@param property2
the target referenced property
@return <code>true</code> if the first property references the second;
<code>false</code> otherwise | [
"Determine",
"whether",
"or",
"not",
"one",
"property",
"holds",
"references",
"to",
"another",
"property",
"."
] | train | https://github.com/syphr42/prom/blob/074d67c4ebb3afb0b163fcb0bc4826ee577ac803/src/main/java/org/syphr/prom/PropertiesManager.java#L709-L714 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newParseException | public static ParseException newParseException(String message, Object... args) {
return newParseException(null, message, args);
} | java | public static ParseException newParseException(String message, Object... args) {
return newParseException(null, message, args);
} | [
"public",
"static",
"ParseException",
"newParseException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newParseException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link ParseException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link ParseException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@link Stri... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"ParseException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L731-L733 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java | XmlSchemaParser.getAttributeValue | public static String getAttributeValue(final Node elementNode, final String attrName)
{
final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);
if (attrNode == null || "".equals(attrNode.getNodeValue()))
{
throw new IllegalStateException(
... | java | public static String getAttributeValue(final Node elementNode, final String attrName)
{
final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);
if (attrNode == null || "".equals(attrNode.getNodeValue()))
{
throw new IllegalStateException(
... | [
"public",
"static",
"String",
"getAttributeValue",
"(",
"final",
"Node",
"elementNode",
",",
"final",
"String",
"attrName",
")",
"{",
"final",
"Node",
"attrNode",
"=",
"elementNode",
".",
"getAttributes",
"(",
")",
".",
"getNamedItemNS",
"(",
"null",
",",
"att... | Helper function that throws an exception when the attribute is not set.
@param elementNode that should have the attribute
@param attrName that is to be looked up
@return value of the attribute
@throws IllegalArgumentException if the attribute is not present | [
"Helper",
"function",
"that",
"throws",
"an",
"exception",
"when",
"the",
"attribute",
"is",
"not",
"set",
"."
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L280-L291 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java | ValueFileIOHelper.writeStreamedValue | protected long writeStreamedValue(File file, ValueData value) throws IOException
{
long size;
// stream Value
if (value instanceof StreamPersistedValueData)
{
StreamPersistedValueData streamed = (StreamPersistedValueData)value;
if (streamed.isPersisted())
... | java | protected long writeStreamedValue(File file, ValueData value) throws IOException
{
long size;
// stream Value
if (value instanceof StreamPersistedValueData)
{
StreamPersistedValueData streamed = (StreamPersistedValueData)value;
if (streamed.isPersisted())
... | [
"protected",
"long",
"writeStreamedValue",
"(",
"File",
"file",
",",
"ValueData",
"value",
")",
"throws",
"IOException",
"{",
"long",
"size",
";",
"// stream Value\r",
"if",
"(",
"value",
"instanceof",
"StreamPersistedValueData",
")",
"{",
"StreamPersistedValueData",
... | Write streamed value to a file.
@param file
File
@param value
ValueData
@return size of wrote content
@throws IOException
if error occurs | [
"Write",
"streamed",
"value",
"to",
"a",
"file",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java#L121-L176 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_requestBoost_POST | public OvhTask serviceName_requestBoost_POST(String serviceName, OvhOfferEnum offer) throws IOException {
String qPath = "/hosting/web/{serviceName}/requestBoost";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "offer", offer);
String resp = e... | java | public OvhTask serviceName_requestBoost_POST(String serviceName, OvhOfferEnum offer) throws IOException {
String qPath = "/hosting/web/{serviceName}/requestBoost";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "offer", offer);
String resp = e... | [
"public",
"OvhTask",
"serviceName_requestBoost_POST",
"(",
"String",
"serviceName",
",",
"OvhOfferEnum",
"offer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/requestBoost\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPa... | Allows you to boost your offer.
REST: POST /hosting/web/{serviceName}/requestBoost
@param offer [required] The boost offer of your choice. Set to null to disable boost.
@param serviceName [required] The internal name of your hosting | [
"Allows",
"you",
"to",
"boost",
"your",
"offer",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1575-L1582 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/filter/Filter.java | Filter.andExists | public final Filter<S> andExists(String propertyName, Filter<?> subFilter) {
ChainedProperty<S> prop = new FilterParser<S>(mType, propertyName).parseChainedProperty();
return and(ExistsFilter.build(prop, subFilter, false));
} | java | public final Filter<S> andExists(String propertyName, Filter<?> subFilter) {
ChainedProperty<S> prop = new FilterParser<S>(mType, propertyName).parseChainedProperty();
return and(ExistsFilter.build(prop, subFilter, false));
} | [
"public",
"final",
"Filter",
"<",
"S",
">",
"andExists",
"(",
"String",
"propertyName",
",",
"Filter",
"<",
"?",
">",
"subFilter",
")",
"{",
"ChainedProperty",
"<",
"S",
">",
"prop",
"=",
"new",
"FilterParser",
"<",
"S",
">",
"(",
"mType",
",",
"proper... | Returns a combined filter instance that accepts records which are only
accepted by this filter and the "exists" test applied to a join.
@param propertyName join property name, which may be a chained property
@param subFilter sub-filter to apply to join, which may be null to test
for any existing
@return canonical Filt... | [
"Returns",
"a",
"combined",
"filter",
"instance",
"that",
"accepts",
"records",
"which",
"are",
"only",
"accepted",
"by",
"this",
"filter",
"and",
"the",
"exists",
"test",
"applied",
"to",
"a",
"join",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/filter/Filter.java#L304-L307 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.