repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/common/lib/factory/BaseAdsServiceClientFactory.java | BaseAdsServiceClientFactory.getServiceClientAsInterface | public <T> T getServiceClientAsInterface(S adsSession, Class<T> interfaceClass)
throws ServiceException {
"""
Gets a client given a session and the class of the desired stub interface.
@param adsSession the session associated with the desired
client
@param interfaceClass the class type of the desired cl... | java | public <T> T getServiceClientAsInterface(S adsSession, Class<T> interfaceClass)
throws ServiceException {
return adsServiceClientFactory.getServiceClient(adsSession, interfaceClass);
} | [
"public",
"<",
"T",
">",
"T",
"getServiceClientAsInterface",
"(",
"S",
"adsSession",
",",
"Class",
"<",
"T",
">",
"interfaceClass",
")",
"throws",
"ServiceException",
"{",
"return",
"adsServiceClientFactory",
".",
"getServiceClient",
"(",
"adsSession",
",",
"inter... | Gets a client given a session and the class of the desired stub interface.
@param adsSession the session associated with the desired
client
@param interfaceClass the class type of the desired client
@return a client for the specified ads service | [
"Gets",
"a",
"client",
"given",
"a",
"session",
"and",
"the",
"class",
"of",
"the",
"desired",
"stub",
"interface",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/factory/BaseAdsServiceClientFactory.java#L79-L82 |
kiegroup/jbpm | jbpm-services/jbpm-services-cdi/src/main/java/org/jbpm/services/cdi/impl/manager/InjectableRegisterableItemsFactory.java | InjectableRegisterableItemsFactory.getFactory | public static RegisterableItemsFactory getFactory(BeanManager beanManager, AbstractAuditLogger auditlogger) {
"""
Allows us to create an instance of this class dynamically via <code>BeanManager</code>. This is useful in case multiple
independent instances are required on runtime and that need cannot be satisfied ... | java | public static RegisterableItemsFactory getFactory(BeanManager beanManager, AbstractAuditLogger auditlogger) {
InjectableRegisterableItemsFactory instance = getInstanceByType(beanManager, InjectableRegisterableItemsFactory.class, new Annotation[]{});
instance.setAuditlogger(auditlogger);
return i... | [
"public",
"static",
"RegisterableItemsFactory",
"getFactory",
"(",
"BeanManager",
"beanManager",
",",
"AbstractAuditLogger",
"auditlogger",
")",
"{",
"InjectableRegisterableItemsFactory",
"instance",
"=",
"getInstanceByType",
"(",
"beanManager",
",",
"InjectableRegisterableItem... | Allows us to create an instance of this class dynamically via <code>BeanManager</code>. This is useful in case multiple
independent instances are required on runtime and that need cannot be satisfied with regular CDI practices.
@param beanManager - bean manager instance of the container
@param auditlogger - <code>Abstr... | [
"Allows",
"us",
"to",
"create",
"an",
"instance",
"of",
"this",
"class",
"dynamically",
"via",
"<code",
">",
"BeanManager<",
"/",
"code",
">",
".",
"This",
"is",
"useful",
"in",
"case",
"multiple",
"independent",
"instances",
"are",
"required",
"on",
"runtim... | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-services/jbpm-services-cdi/src/main/java/org/jbpm/services/cdi/impl/manager/InjectableRegisterableItemsFactory.java#L290-L294 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withDates | public Interval withDates(LocalDate startDate, LocalDate endDate) {
"""
Returns a new interval based on this interval but with a different start
and end date.
@param startDate the new start date
@param endDate the new end date
@return a new interval
"""
requireNonNull(startDate);
requireN... | java | public Interval withDates(LocalDate startDate, LocalDate endDate) {
requireNonNull(startDate);
requireNonNull(endDate);
return new Interval(startDate, this.startTime, endDate, this.endTime, this.zoneId);
} | [
"public",
"Interval",
"withDates",
"(",
"LocalDate",
"startDate",
",",
"LocalDate",
"endDate",
")",
"{",
"requireNonNull",
"(",
"startDate",
")",
";",
"requireNonNull",
"(",
"endDate",
")",
";",
"return",
"new",
"Interval",
"(",
"startDate",
",",
"this",
".",
... | Returns a new interval based on this interval but with a different start
and end date.
@param startDate the new start date
@param endDate the new end date
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"start",
"and",
"end",
"date",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L278-L282 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java | CompositeDialogPage.decoratePageTitle | protected String decoratePageTitle(DialogPage page, String title) {
"""
Decorates the page title of the given <code>DialogPage</code>.
<p>
Can be overridden to provide additional decorations.
<p>
The default implementation returns a html with an indication whether the
page is complete or incomplete
@param ... | java | protected String decoratePageTitle(DialogPage page, String title) {
return LabelUtils.htmlBlock("<center>" + title + "<sup><font size=-3 color=red>"
+ (page.isPageComplete() ? "" : "*"));
} | [
"protected",
"String",
"decoratePageTitle",
"(",
"DialogPage",
"page",
",",
"String",
"title",
")",
"{",
"return",
"LabelUtils",
".",
"htmlBlock",
"(",
"\"<center>\"",
"+",
"title",
"+",
"\"<sup><font size=-3 color=red>\"",
"+",
"(",
"page",
".",
"isPageComplete",
... | Decorates the page title of the given <code>DialogPage</code>.
<p>
Can be overridden to provide additional decorations.
<p>
The default implementation returns a html with an indication whether the
page is complete or incomplete
@param page the page
@param title the title
@return the decorated page title | [
"Decorates",
"the",
"page",
"title",
"of",
"the",
"given",
"<code",
">",
"DialogPage<",
"/",
"code",
">",
".",
"<p",
">",
"Can",
"be",
"overridden",
"to",
"provide",
"additional",
"decorations",
".",
"<p",
">",
"The",
"default",
"implementation",
"returns",
... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java#L285-L288 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java | PathUtils.compareWithoutSchemeAndAuthority | public static boolean compareWithoutSchemeAndAuthority(Path path1, Path path2) {
"""
Compare two path without shedme and authority (the prefix)
@param path1
@param path2
@return
"""
return PathUtils.getPathWithoutSchemeAndAuthority(path1).equals(getPathWithoutSchemeAndAuthority(path2));
} | java | public static boolean compareWithoutSchemeAndAuthority(Path path1, Path path2) {
return PathUtils.getPathWithoutSchemeAndAuthority(path1).equals(getPathWithoutSchemeAndAuthority(path2));
} | [
"public",
"static",
"boolean",
"compareWithoutSchemeAndAuthority",
"(",
"Path",
"path1",
",",
"Path",
"path2",
")",
"{",
"return",
"PathUtils",
".",
"getPathWithoutSchemeAndAuthority",
"(",
"path1",
")",
".",
"equals",
"(",
"getPathWithoutSchemeAndAuthority",
"(",
"pa... | Compare two path without shedme and authority (the prefix)
@param path1
@param path2
@return | [
"Compare",
"two",
"path",
"without",
"shedme",
"and",
"authority",
"(",
"the",
"prefix",
")"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java#L208-L210 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsFormatterConfiguration.java | CmsFormatterConfiguration.matchFormatter | public static boolean matchFormatter(I_CmsFormatterBean formatter, Set<String> types, int width) {
"""
Checks whether the given formatter bean matches the container types, width and nested flag.<p>
@param formatter the formatter bean
@param types the container types
@param width the container width
@return... | java | public static boolean matchFormatter(I_CmsFormatterBean formatter, Set<String> types, int width) {
if (formatter.isMatchAll()) {
return true;
}
if (formatter.isTypeFormatter()) {
return !Sets.intersection(types, formatter.getContainerTypes()).isEmpty();
} else {
... | [
"public",
"static",
"boolean",
"matchFormatter",
"(",
"I_CmsFormatterBean",
"formatter",
",",
"Set",
"<",
"String",
">",
"types",
",",
"int",
"width",
")",
"{",
"if",
"(",
"formatter",
".",
"isMatchAll",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"i... | Checks whether the given formatter bean matches the container types, width and nested flag.<p>
@param formatter the formatter bean
@param types the container types
@param width the container width
@return <code>true</code> in case the formatter matches | [
"Checks",
"whether",
"the",
"given",
"formatter",
"bean",
"matches",
"the",
"container",
"types",
"width",
"and",
"nested",
"flag",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsFormatterConfiguration.java#L249-L260 |
mguymon/naether | src/main/java/com/tobedevoured/naether/PathClassLoader.java | PathClassLoader.execStaticMethod | public Object execStaticMethod( String className, String methodName ) throws ClassLoaderException {
"""
Helper for executing static methods on a Class
@param className String fully qualified class
@param methodName String method name
@return Object result
@throws ClassLoaderException exception
"""
... | java | public Object execStaticMethod( String className, String methodName ) throws ClassLoaderException {
return execStaticMethod( className, methodName, null );
} | [
"public",
"Object",
"execStaticMethod",
"(",
"String",
"className",
",",
"String",
"methodName",
")",
"throws",
"ClassLoaderException",
"{",
"return",
"execStaticMethod",
"(",
"className",
",",
"methodName",
",",
"null",
")",
";",
"}"
] | Helper for executing static methods on a Class
@param className String fully qualified class
@param methodName String method name
@return Object result
@throws ClassLoaderException exception | [
"Helper",
"for",
"executing",
"static",
"methods",
"on",
"a",
"Class"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/PathClassLoader.java#L207-L209 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/util/BaseHttpClientGenerator.java | BaseHttpClientGenerator.createWebSocketCall | public WebSocketCall createWebSocketCall(String url, Map<String, String> headers) {
"""
Creates a websocket that connects to the given URL.
@param url where the websocket server is
@param headers headers to pass in the connect request
@return the websocket
"""
String base64Credentials = buildBase6... | java | public WebSocketCall createWebSocketCall(String url, Map<String, String> headers) {
String base64Credentials = buildBase64Credentials();
Request.Builder requestBuilder = new Request.Builder()
.url(url)
.addHeader("Authorization", "Basic " + base64Credentials)
... | [
"public",
"WebSocketCall",
"createWebSocketCall",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"String",
"base64Credentials",
"=",
"buildBase64Credentials",
"(",
")",
";",
"Request",
".",
"Builder",
"requestBuilder",
... | Creates a websocket that connects to the given URL.
@param url where the websocket server is
@param headers headers to pass in the connect request
@return the websocket | [
"Creates",
"a",
"websocket",
"that",
"connects",
"to",
"the",
"given",
"URL",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/util/BaseHttpClientGenerator.java#L264-L281 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java | DefaultApplicationObjectConfigurer.configureImage | protected void configureImage(ImageConfigurable configurable, String objectName) {
"""
Sets the image of the given object. The image is loaded from this
instance's {@link ImageSource} using a key in the format
<pre>
<objectName>.image
</pre>
If the image source cannot find an image under that key, t... | java | protected void configureImage(ImageConfigurable configurable, String objectName) {
Assert.notNull(configurable, "configurable");
Assert.notNull(objectName, "objectName");
Image image = loadImage(objectName, IMAGE_KEY);
if (image != null) {
configurable.setImage(image);
}
} | [
"protected",
"void",
"configureImage",
"(",
"ImageConfigurable",
"configurable",
",",
"String",
"objectName",
")",
"{",
"Assert",
".",
"notNull",
"(",
"configurable",
",",
"\"configurable\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"objectName",
",",
"\"objectNam... | Sets the image of the given object. The image is loaded from this
instance's {@link ImageSource} using a key in the format
<pre>
<objectName>.image
</pre>
If the image source cannot find an image under that key, the object's
image will be set to null.
@param configurable The object to be configured. Must not b... | [
"Sets",
"the",
"image",
"of",
"the",
"given",
"object",
".",
"The",
"image",
"is",
"loaded",
"from",
"this",
"instance",
"s",
"{",
"@link",
"ImageSource",
"}",
"using",
"a",
"key",
"in",
"the",
"format"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java#L497-L506 |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/GetMaintenanceWindowTaskResult.java | GetMaintenanceWindowTaskResult.withTaskParameters | public GetMaintenanceWindowTaskResult withTaskParameters(java.util.Map<String, MaintenanceWindowTaskParameterValueExpression> taskParameters) {
"""
<p>
The parameters to pass to the task when it runs.
</p>
<note>
<p>
<code>TaskParameters</code> has been deprecated. To specify parameters to pass to a task when... | java | public GetMaintenanceWindowTaskResult withTaskParameters(java.util.Map<String, MaintenanceWindowTaskParameterValueExpression> taskParameters) {
setTaskParameters(taskParameters);
return this;
} | [
"public",
"GetMaintenanceWindowTaskResult",
"withTaskParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"MaintenanceWindowTaskParameterValueExpression",
">",
"taskParameters",
")",
"{",
"setTaskParameters",
"(",
"taskParameters",
")",
";",
"return",
... | <p>
The parameters to pass to the task when it runs.
</p>
<note>
<p>
<code>TaskParameters</code> has been deprecated. To specify parameters to pass to a task when it runs, instead
use the <code>Parameters</code> option in the <code>TaskInvocationParameters</code> structure. For information
about how Systems Manager han... | [
"<p",
">",
"The",
"parameters",
"to",
"pass",
"to",
"the",
"task",
"when",
"it",
"runs",
".",
"<",
"/",
"p",
">",
"<note",
">",
"<p",
">",
"<code",
">",
"TaskParameters<",
"/",
"code",
">",
"has",
"been",
"deprecated",
".",
"To",
"specify",
"paramete... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/GetMaintenanceWindowTaskResult.java#L511-L514 |
shrinkwrap/descriptors | api-base/src/main/java/org/jboss/shrinkwrap/descriptor/api/DescriptorInstantiator.java | DescriptorInstantiator.createFromUserView | static <T extends Descriptor> T createFromUserView(final Class<T> userViewClass, String descriptorName)
throws IllegalArgumentException {
"""
Creates a new {@link Descriptor} instance of the specified user view type. Will consult a configuration file
visible to the {@link Thread} Context {@link ClassLoade... | java | static <T extends Descriptor> T createFromUserView(final Class<T> userViewClass, String descriptorName)
throws IllegalArgumentException {
// Get the construction information
final DescriptorConstructionInfo info = getDescriptorConstructionInfoForUserView(userViewClass);
@SuppressWarning... | [
"static",
"<",
"T",
"extends",
"Descriptor",
">",
"T",
"createFromUserView",
"(",
"final",
"Class",
"<",
"T",
">",
"userViewClass",
",",
"String",
"descriptorName",
")",
"throws",
"IllegalArgumentException",
"{",
"// Get the construction information",
"final",
"Descri... | Creates a new {@link Descriptor} instance of the specified user view type. Will consult a configuration file
visible to the {@link Thread} Context {@link ClassLoader} named "META-INF/services/$fullyQualfiedClassName" which
should contain a key=value format with the keys {@link DescriptorInstantiator#KEY_IMPL_CLASS_NAME... | [
"Creates",
"a",
"new",
"{",
"@link",
"Descriptor",
"}",
"instance",
"of",
"the",
"specified",
"user",
"view",
"type",
".",
"Will",
"consult",
"a",
"configuration",
"file",
"visible",
"to",
"the",
"{",
"@link",
"Thread",
"}",
"Context",
"{",
"@link",
"Class... | train | https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/api-base/src/main/java/org/jboss/shrinkwrap/descriptor/api/DescriptorInstantiator.java#L85-L102 |
to2mbn/JMCCC | jmccc-yggdrasil-authenticator/src/main/java/org/to2mbn/jmccc/auth/yggdrasil/YggdrasilAuthenticator.java | YggdrasilAuthenticator.refreshWithToken | public synchronized void refreshWithToken(String clientToken, String accessToken) throws AuthenticationException {
"""
Refreshes the current session manually using token.
@param clientToken the client token
@param accessToken the access token
@throws AuthenticationException If an exception occurs during the
... | java | public synchronized void refreshWithToken(String clientToken, String accessToken) throws AuthenticationException {
authResult = authenticationService.refresh(Objects.requireNonNull(clientToken), Objects.requireNonNull(accessToken));
} | [
"public",
"synchronized",
"void",
"refreshWithToken",
"(",
"String",
"clientToken",
",",
"String",
"accessToken",
")",
"throws",
"AuthenticationException",
"{",
"authResult",
"=",
"authenticationService",
".",
"refresh",
"(",
"Objects",
".",
"requireNonNull",
"(",
"cl... | Refreshes the current session manually using token.
@param clientToken the client token
@param accessToken the access token
@throws AuthenticationException If an exception occurs during the
authentication | [
"Refreshes",
"the",
"current",
"session",
"manually",
"using",
"token",
"."
] | train | https://github.com/to2mbn/JMCCC/blob/17e5b1b56ff18255cfd60976dca1a24598946647/jmccc-yggdrasil-authenticator/src/main/java/org/to2mbn/jmccc/auth/yggdrasil/YggdrasilAuthenticator.java#L397-L399 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegmentFactory.java | MemorySegmentFactory.allocateUnpooledOffHeapMemory | public static MemorySegment allocateUnpooledOffHeapMemory(int size, Object owner) {
"""
Allocates some unpooled off-heap memory and creates a new memory segment that
represents that memory.
@param size The size of the off-heap memory segment to allocate.
@param owner The owner to associate with the off-heap m... | java | public static MemorySegment allocateUnpooledOffHeapMemory(int size, Object owner) {
ByteBuffer memory = ByteBuffer.allocateDirect(size);
return wrapPooledOffHeapMemory(memory, owner);
} | [
"public",
"static",
"MemorySegment",
"allocateUnpooledOffHeapMemory",
"(",
"int",
"size",
",",
"Object",
"owner",
")",
"{",
"ByteBuffer",
"memory",
"=",
"ByteBuffer",
".",
"allocateDirect",
"(",
"size",
")",
";",
"return",
"wrapPooledOffHeapMemory",
"(",
"memory",
... | Allocates some unpooled off-heap memory and creates a new memory segment that
represents that memory.
@param size The size of the off-heap memory segment to allocate.
@param owner The owner to associate with the off-heap memory segment.
@return A new memory segment, backed by unpooled off-heap memory. | [
"Allocates",
"some",
"unpooled",
"off",
"-",
"heap",
"memory",
"and",
"creates",
"a",
"new",
"memory",
"segment",
"that",
"represents",
"that",
"memory",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegmentFactory.java#L85-L88 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getSummonerSpellListDro | public Future<SummonerSpellList> getSummonerSpellListDro(SpellData data, String version, String locale, boolean dataById) {
"""
<p>
Get a list of all summoner spells as returned by the API
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param data Additional informat... | java | public Future<SummonerSpellList> getSummonerSpellListDro(SpellData data, String version, String locale, boolean dataById) {
return new DummyFuture<>(handler.getSummonerSpellListDro(data, version, locale, dataById));
} | [
"public",
"Future",
"<",
"SummonerSpellList",
">",
"getSummonerSpellListDro",
"(",
"SpellData",
"data",
",",
"String",
"version",
",",
"String",
"locale",
",",
"boolean",
"dataById",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",
".",
"getSummon... | <p>
Get a list of all summoner spells as returned by the API
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param data Additional information to retrieve
@param version Data dragon version for returned data
@param locale Locale code for returned data
@param dataById If speci... | [
"<p",
">",
"Get",
"a",
"list",
"of",
"all",
"summoner",
"spells",
"as",
"returned",
"by",
"the",
"API",
"<",
"/",
"p",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"the",
"rate",
"limit",
"and",
"is",
"not",
"affected",
"by",
"the",
"thr... | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L741-L743 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java | ConfigClient.createSink | public final LogSink createSink(ParentName parent, LogSink sink) {
"""
Creates a sink that exports specified log entries to a destination. The export of
newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
permitted to write to the destination. A sink can export log entries o... | java | public final LogSink createSink(ParentName parent, LogSink sink) {
CreateSinkRequest request =
CreateSinkRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setSink(sink)
.build();
return createSink(request);
} | [
"public",
"final",
"LogSink",
"createSink",
"(",
"ParentName",
"parent",
",",
"LogSink",
"sink",
")",
"{",
"CreateSinkRequest",
"request",
"=",
"CreateSinkRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
"==",
"null",
"?",
"null",
":",
... | Creates a sink that exports specified log entries to a destination. The export of
newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
permitted to write to the destination. A sink can export log entries only from the resource
owning the sink.
<p>Sample code:
<pre><code>
try (Conf... | [
"Creates",
"a",
"sink",
"that",
"exports",
"specified",
"log",
"entries",
"to",
"a",
"destination",
".",
"The",
"export",
"of",
"newly",
"-",
"ingested",
"log",
"entries",
"begins",
"immediately",
"unless",
"the",
"sink",
"s",
"writer_identity",
"is",
"not",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java#L431-L439 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/StringUtils.java | StringUtils.join | @SuppressWarnings("rawtypes")
public static String join(final Collection coll, final String delim) {
"""
Assemble all elements in collection to a string.
@param coll -
java.util.List
@param delim -
Description of the Parameter
@return java.lang.String
"""
final StringBuilder buff = new Strin... | java | @SuppressWarnings("rawtypes")
public static String join(final Collection coll, final String delim) {
final StringBuilder buff = new StringBuilder(256);
Iterator iter;
if ((coll == null) || coll.isEmpty()) {
return "";
}
iter = coll.iterator();
while (ite... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"String",
"join",
"(",
"final",
"Collection",
"coll",
",",
"final",
"String",
"delim",
")",
"{",
"final",
"StringBuilder",
"buff",
"=",
"new",
"StringBuilder",
"(",
"256",
")",
";",
"Iter... | Assemble all elements in collection to a string.
@param coll -
java.util.List
@param delim -
Description of the Parameter
@return java.lang.String | [
"Assemble",
"all",
"elements",
"in",
"collection",
"to",
"a",
"string",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L42-L61 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/config/MergePolicyValidator.java | MergePolicyValidator.checkMergePolicySupportsInMemoryFormat | public static boolean checkMergePolicySupportsInMemoryFormat(String name, Object mergePolicy, InMemoryFormat inMemoryFormat,
boolean failFast, ILogger logger) {
"""
Checks if the given {@link InMemoryFormat} can be merged by the given
{@code mergePolicy} instance.
<p>
When a wrong policy is detected... | java | public static boolean checkMergePolicySupportsInMemoryFormat(String name, Object mergePolicy, InMemoryFormat inMemoryFormat,
boolean failFast, ILogger logger) {
if (inMemoryFormat != NATIVE) {
return true;
}
if (mergePolicy instanceof SplitBrainMergePolicy) {
... | [
"public",
"static",
"boolean",
"checkMergePolicySupportsInMemoryFormat",
"(",
"String",
"name",
",",
"Object",
"mergePolicy",
",",
"InMemoryFormat",
"inMemoryFormat",
",",
"boolean",
"failFast",
",",
"ILogger",
"logger",
")",
"{",
"if",
"(",
"inMemoryFormat",
"!=",
... | Checks if the given {@link InMemoryFormat} can be merged by the given
{@code mergePolicy} instance.
<p>
When a wrong policy is detected, it does one of two things:
if {@code failFast} is {@code true} and the cluster version is 3.10 or later,
it throws an {@link InvalidConfigurationException}, otherwise it logs a warnin... | [
"Checks",
"if",
"the",
"given",
"{",
"@link",
"InMemoryFormat",
"}",
"can",
"be",
"merged",
"by",
"the",
"given",
"{",
"@code",
"mergePolicy",
"}",
"instance",
".",
"<p",
">",
"When",
"a",
"wrong",
"policy",
"is",
"detected",
"it",
"does",
"one",
"of",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/MergePolicyValidator.java#L63-L76 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.addPersonFaceFromStream | public PersistedFace addPersonFaceFromStream(String personGroupId, UUID personId, byte[] image, AddPersonFaceFromStreamOptionalParameter addPersonFaceFromStreamOptionalParameter) {
"""
Add a representative face to a person for identification. The input face is specified as an image with a targetFace rectangle.
... | java | public PersistedFace addPersonFaceFromStream(String personGroupId, UUID personId, byte[] image, AddPersonFaceFromStreamOptionalParameter addPersonFaceFromStreamOptionalParameter) {
return addPersonFaceFromStreamWithServiceResponseAsync(personGroupId, personId, image, addPersonFaceFromStreamOptionalParameter).to... | [
"public",
"PersistedFace",
"addPersonFaceFromStream",
"(",
"String",
"personGroupId",
",",
"UUID",
"personId",
",",
"byte",
"[",
"]",
"image",
",",
"AddPersonFaceFromStreamOptionalParameter",
"addPersonFaceFromStreamOptionalParameter",
")",
"{",
"return",
"addPersonFaceFromSt... | Add a representative face to a person for identification. The input face is specified as an image with a targetFace rectangle.
@param personGroupId Id referencing a particular person group.
@param personId Id referencing a particular person.
@param image An image stream.
@param addPersonFaceFromStreamOptionalParameter... | [
"Add",
"a",
"representative",
"face",
"to",
"a",
"person",
"for",
"identification",
".",
"The",
"input",
"face",
"is",
"specified",
"as",
"an",
"image",
"with",
"a",
"targetFace",
"rectangle",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L1371-L1373 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.removeResourceFromUsersPubList | public void removeResourceFromUsersPubList(CmsRequestContext context, Collection<CmsUUID> structureIds)
throws CmsException {
"""
Removes the given resource to the given user's publish list.<p>
@param context the request context
@param structureIds the collection of structure IDs to remove
@throws CmsEx... | java | public void removeResourceFromUsersPubList(CmsRequestContext context, Collection<CmsUUID> structureIds)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.removeResourceFromUsersPubList(dbc, context.getCurrentUser().getId(), structur... | [
"public",
"void",
"removeResourceFromUsersPubList",
"(",
"CmsRequestContext",
"context",
",",
"Collection",
"<",
"CmsUUID",
">",
"structureIds",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
... | Removes the given resource to the given user's publish list.<p>
@param context the request context
@param structureIds the collection of structure IDs to remove
@throws CmsException if something goes wrong | [
"Removes",
"the",
"given",
"resource",
"to",
"the",
"given",
"user",
"s",
"publish",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L5646-L5664 |
geomajas/geomajas-project-server | plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java | PdfContext.strokeRectangle | public void strokeRectangle(Rectangle rect, Color color, float linewidth) {
"""
Draw a rectangular boundary with this color and linewidth.
@param rect
rectangle
@param color
color
@param linewidth
line width
"""
strokeRectangle(rect, color, linewidth, null);
} | java | public void strokeRectangle(Rectangle rect, Color color, float linewidth) {
strokeRectangle(rect, color, linewidth, null);
} | [
"public",
"void",
"strokeRectangle",
"(",
"Rectangle",
"rect",
",",
"Color",
"color",
",",
"float",
"linewidth",
")",
"{",
"strokeRectangle",
"(",
"rect",
",",
"color",
",",
"linewidth",
",",
"null",
")",
";",
"}"
] | Draw a rectangular boundary with this color and linewidth.
@param rect
rectangle
@param color
color
@param linewidth
line width | [
"Draw",
"a",
"rectangular",
"boundary",
"with",
"this",
"color",
"and",
"linewidth",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java#L205-L207 |
JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.convertLocalToUTC | public long convertLocalToUTC(long instantLocal, boolean strict, long originalInstantUTC) {
"""
Converts a local instant to a standard UTC instant with the same
local time attempting to use the same offset as the original.
<p>
This conversion is used after performing a calculation
where the calculation was don... | java | public long convertLocalToUTC(long instantLocal, boolean strict, long originalInstantUTC) {
int offsetOriginal = getOffset(originalInstantUTC);
long instantUTC = instantLocal - offsetOriginal;
int offsetLocalFromOriginal = getOffset(instantUTC);
if (offsetLocalFromOriginal == offsetOrigi... | [
"public",
"long",
"convertLocalToUTC",
"(",
"long",
"instantLocal",
",",
"boolean",
"strict",
",",
"long",
"originalInstantUTC",
")",
"{",
"int",
"offsetOriginal",
"=",
"getOffset",
"(",
"originalInstantUTC",
")",
";",
"long",
"instantUTC",
"=",
"instantLocal",
"-... | Converts a local instant to a standard UTC instant with the same
local time attempting to use the same offset as the original.
<p>
This conversion is used after performing a calculation
where the calculation was done using a simple local zone.
Whenever possible, the same offset as the original offset will be used.
This... | [
"Converts",
"a",
"local",
"instant",
"to",
"a",
"standard",
"UTC",
"instant",
"with",
"the",
"same",
"local",
"time",
"attempting",
"to",
"use",
"the",
"same",
"offset",
"as",
"the",
"original",
".",
"<p",
">",
"This",
"conversion",
"is",
"used",
"after",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L984-L992 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/repair/Differencer.java | Differencer.run | public void run() {
"""
Compares our trees, and triggers repairs for any ranges that mismatch.
"""
// compare trees, and collect differences
differences.addAll(MerkleTree.difference(r1.tree, r2.tree));
// choose a repair method based on the significance of the difference
String... | java | public void run()
{
// compare trees, and collect differences
differences.addAll(MerkleTree.difference(r1.tree, r2.tree));
// choose a repair method based on the significance of the difference
String format = String.format("[repair #%s] Endpoints %s and %s %%s for %s", desc.sessionI... | [
"public",
"void",
"run",
"(",
")",
"{",
"// compare trees, and collect differences",
"differences",
".",
"addAll",
"(",
"MerkleTree",
".",
"difference",
"(",
"r1",
".",
"tree",
",",
"r2",
".",
"tree",
")",
")",
";",
"// choose a repair method based on the significan... | Compares our trees, and triggers repairs for any ranges that mismatch. | [
"Compares",
"our",
"trees",
"and",
"triggers",
"repairs",
"for",
"any",
"ranges",
"that",
"mismatch",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/repair/Differencer.java#L58-L76 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/AttributeConstraintRule.java | AttributeConstraintRule.validateMaxDecimal | private boolean validateMaxDecimal(Object validationObject, Annotation annotate) {
"""
Checks whether a given value is a valid maximum decimal digit when compared to given value
or not
@param validationObject
@param annotate
@return
"""
if (validationObject != null)
{
try
... | java | private boolean validateMaxDecimal(Object validationObject, Annotation annotate)
{
if (validationObject != null)
{
try
{
if (checkvalidDeciDigitTypes(validationObject.getClass()))
{
BigDecimal maxValue = NumberUtils.createBi... | [
"private",
"boolean",
"validateMaxDecimal",
"(",
"Object",
"validationObject",
",",
"Annotation",
"annotate",
")",
"{",
"if",
"(",
"validationObject",
"!=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"checkvalidDeciDigitTypes",
"(",
"validationObject",
".",
"getClas... | Checks whether a given value is a valid maximum decimal digit when compared to given value
or not
@param validationObject
@param annotate
@return | [
"Checks",
"whether",
"a",
"given",
"value",
"is",
"a",
"valid",
"maximum",
"decimal",
"digit",
"when",
"compared",
"to",
"given",
"value",
"or",
"not"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/AttributeConstraintRule.java#L520-L545 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java | Client.buildRMST | @SuppressWarnings("WeakerAccess")
public NumberField buildRMST(Message.MenuIdentifier targetMenu, CdjStatus.TrackSourceSlot slot,
CdjStatus.TrackType trackType) {
"""
<p>Build the <em>R:M:S:T</em> parameter that begins many queries.</p>
<p>Many request messages take, as thei... | java | @SuppressWarnings("WeakerAccess")
public NumberField buildRMST(Message.MenuIdentifier targetMenu, CdjStatus.TrackSourceSlot slot,
CdjStatus.TrackType trackType) {
return buildRMST(posingAsPlayer, targetMenu, slot, trackType);
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"NumberField",
"buildRMST",
"(",
"Message",
".",
"MenuIdentifier",
"targetMenu",
",",
"CdjStatus",
".",
"TrackSourceSlot",
"slot",
",",
"CdjStatus",
".",
"TrackType",
"trackType",
")",
"{",
"return",
... | <p>Build the <em>R:M:S:T</em> parameter that begins many queries.</p>
<p>Many request messages take, as their first argument, a 4-byte value where each byte has a special meaning.
The first byte is the player number of the requesting player. The second identifies the menu into which
the response is being loaded, as de... | [
"<p",
">",
"Build",
"the",
"<em",
">",
"R",
":",
"M",
":",
"S",
":",
"T<",
"/",
"em",
">",
"parameter",
"that",
"begins",
"many",
"queries",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L328-L332 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java | SerializationUtils.fromJson | public static <T> T fromJson(JsonNode json, Class<T> clazz, ClassLoader classLoader) {
"""
Deserialize a {@link JsonNode}, with custom class loader.
@param json
@param clazz
@return
@since 0.6.2
"""
if (json == null) {
return null;
}
ClassLoader oldClassLoader = Thread... | java | public static <T> T fromJson(JsonNode json, Class<T> clazz, ClassLoader classLoader) {
if (json == null) {
return null;
}
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
if (classLoader != null) {
Thread.currentThread().setContextClass... | [
"public",
"static",
"<",
"T",
">",
"T",
"fromJson",
"(",
"JsonNode",
"json",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"json",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ClassLoader",
"old... | Deserialize a {@link JsonNode}, with custom class loader.
@param json
@param clazz
@return
@since 0.6.2 | [
"Deserialize",
"a",
"{",
"@link",
"JsonNode",
"}",
"with",
"custom",
"class",
"loader",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java#L726-L750 |
spotbugs/spotbugs | eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/BugResolution.java | BugResolution.isApplicable | public boolean isApplicable(IMarker marker) {
"""
If getApplicabilityVisitor() is overwritten, this checks
to see if this resolution applies to the code at the given marker.
@param marker
@return true if this resolution should be visible to the user at the given marker
"""
ASTVisitor prescanVisito... | java | public boolean isApplicable(IMarker marker) {
ASTVisitor prescanVisitor = getApplicabilityVisitor();
if (prescanVisitor instanceof ApplicabilityVisitor) { //this has an implicit null check
return findApplicability(prescanVisitor, marker);
}
return true;
} | [
"public",
"boolean",
"isApplicable",
"(",
"IMarker",
"marker",
")",
"{",
"ASTVisitor",
"prescanVisitor",
"=",
"getApplicabilityVisitor",
"(",
")",
";",
"if",
"(",
"prescanVisitor",
"instanceof",
"ApplicabilityVisitor",
")",
"{",
"//this has an implicit null check",
"ret... | If getApplicabilityVisitor() is overwritten, this checks
to see if this resolution applies to the code at the given marker.
@param marker
@return true if this resolution should be visible to the user at the given marker | [
"If",
"getApplicabilityVisitor",
"()",
"is",
"overwritten",
"this",
"checks",
"to",
"see",
"if",
"this",
"resolution",
"applies",
"to",
"the",
"code",
"at",
"the",
"given",
"marker",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/BugResolution.java#L493-L499 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ns_ip.java | ns_ns_ip.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_ns_ip_responses result = (ns_ns_ip_responses) service.get_payload_fo... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_ns_ip_responses result = (ns_ns_ip_responses) service.get_payload_formatter().string_to_resource(ns_ns_ip_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_ns_ip_responses",
"result",
"=",
"(",
"ns_ns_ip_responses",
")",
"service",
".",
"get_payload_formatter",
... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ns_ip.java#L298-L315 |
racc/typesafeconfig-guice | src/main/java/com/github/racc/tscg/TypesafeConfigModule.java | TypesafeConfigModule.fromConfigUsingClasspathScanner | public static TypesafeConfigModule fromConfigUsingClasspathScanner(Config config, String ...scannerSpec) {
"""
Scans the specified packages for annotated classes, and applies Config values to them.
@param config the Config to derive values from
@return The constructed TypesafeConfigModule.
"""
return new... | java | public static TypesafeConfigModule fromConfigUsingClasspathScanner(Config config, String ...scannerSpec) {
return new TypesafeConfigModule(config, new FastClasspathScanningReflector(scannerSpec));
} | [
"public",
"static",
"TypesafeConfigModule",
"fromConfigUsingClasspathScanner",
"(",
"Config",
"config",
",",
"String",
"...",
"scannerSpec",
")",
"{",
"return",
"new",
"TypesafeConfigModule",
"(",
"config",
",",
"new",
"FastClasspathScanningReflector",
"(",
"scannerSpec",... | Scans the specified packages for annotated classes, and applies Config values to them.
@param config the Config to derive values from
@return The constructed TypesafeConfigModule. | [
"Scans",
"the",
"specified",
"packages",
"for",
"annotated",
"classes",
"and",
"applies",
"Config",
"values",
"to",
"them",
"."
] | train | https://github.com/racc/typesafeconfig-guice/blob/95e383ced94fe59f4a651d043f9d1764bc618a94/src/main/java/com/github/racc/tscg/TypesafeConfigModule.java#L99-L101 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/CharacterEncoder.java | CharacterEncoder.readFully | protected int readFully(InputStream in, byte buffer[])
throws java.io.IOException {
"""
This method works around the bizarre semantics of BufferedInputStream's
read method.
"""
for (int i = 0; i < buffer.length; i++) {
int q = in.read();
if (q == -1)
ret... | java | protected int readFully(InputStream in, byte buffer[])
throws java.io.IOException {
for (int i = 0; i < buffer.length; i++) {
int q = in.read();
if (q == -1)
return i;
buffer[i] = (byte)q;
}
return buffer.length;
} | [
"protected",
"int",
"readFully",
"(",
"InputStream",
"in",
",",
"byte",
"buffer",
"[",
"]",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"buffer",
".",
"length",
";",
"i",
"++",
")",
... | This method works around the bizarre semantics of BufferedInputStream's
read method. | [
"This",
"method",
"works",
"around",
"the",
"bizarre",
"semantics",
"of",
"BufferedInputStream",
"s",
"read",
"method",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/CharacterEncoder.java#L124-L133 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/AgentPoolsInner.java | AgentPoolsInner.createOrUpdateAsync | public Observable<AgentPoolInner> createOrUpdateAsync(String resourceGroupName, String managedClusterName, String agentPoolName, AgentPoolInner parameters) {
"""
Creates or updates an agent pool.
Creates or updates an agent pool in the specified managed cluster.
@param resourceGroupName The name of the resourc... | java | public Observable<AgentPoolInner> createOrUpdateAsync(String resourceGroupName, String managedClusterName, String agentPoolName, AgentPoolInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, managedClusterName, agentPoolName, parameters).map(new Func1<ServiceResponse<AgentPoolInn... | [
"public",
"Observable",
"<",
"AgentPoolInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedClusterName",
",",
"String",
"agentPoolName",
",",
"AgentPoolInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsy... | Creates or updates an agent pool.
Creates or updates an agent pool in the specified managed cluster.
@param resourceGroupName The name of the resource group.
@param managedClusterName The name of the managed cluster resource.
@param agentPoolName The name of the agent pool.
@param parameters Parameters supplied to the... | [
"Creates",
"or",
"updates",
"an",
"agent",
"pool",
".",
"Creates",
"or",
"updates",
"an",
"agent",
"pool",
"in",
"the",
"specified",
"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/AgentPoolsInner.java#L359-L366 |
liyiorg/weixin-popular | src/main/java/weixin/popular/client/HttpClientFactory.java | HttpClientFactory.createKeyMaterialHttpClient | public static CloseableHttpClient createKeyMaterialHttpClient(KeyStore keystore,String keyPassword,int timeout,int retryExecutionCount) {
"""
Key store 类型HttpClient
@param keystore keystore
@param keyPassword keyPassword
@param timeout timeout
@param retryExecutionCount retryExecutionCount
@return CloseableHt... | java | public static CloseableHttpClient createKeyMaterialHttpClient(KeyStore keystore,String keyPassword,int timeout,int retryExecutionCount) {
return createKeyMaterialHttpClient(keystore, keyPassword, supportedProtocols,timeout,retryExecutionCount);
} | [
"public",
"static",
"CloseableHttpClient",
"createKeyMaterialHttpClient",
"(",
"KeyStore",
"keystore",
",",
"String",
"keyPassword",
",",
"int",
"timeout",
",",
"int",
"retryExecutionCount",
")",
"{",
"return",
"createKeyMaterialHttpClient",
"(",
"keystore",
",",
"keyPa... | Key store 类型HttpClient
@param keystore keystore
@param keyPassword keyPassword
@param timeout timeout
@param retryExecutionCount retryExecutionCount
@return CloseableHttpClient | [
"Key",
"store",
"类型HttpClient"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/client/HttpClientFactory.java#L83-L85 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationBuilder.java | CollationBuilder.findCommonNode | private int findCommonNode(int index, int strength) {
"""
Finds the node which implies or contains a common=05 weight of the given strength
(secondary or tertiary), if the current node is stronger.
Skips weaker nodes and tailored nodes if the current node is stronger
and is followed by an explicit-common-weight... | java | private int findCommonNode(int index, int strength) {
assert(Collator.SECONDARY <= strength && strength <= Collator.TERTIARY);
long node = nodes.elementAti(index);
if(strengthFromNode(node) >= strength) {
// The current node is no stronger.
return index;
}
... | [
"private",
"int",
"findCommonNode",
"(",
"int",
"index",
",",
"int",
"strength",
")",
"{",
"assert",
"(",
"Collator",
".",
"SECONDARY",
"<=",
"strength",
"&&",
"strength",
"<=",
"Collator",
".",
"TERTIARY",
")",
";",
"long",
"node",
"=",
"nodes",
".",
"e... | Finds the node which implies or contains a common=05 weight of the given strength
(secondary or tertiary), if the current node is stronger.
Skips weaker nodes and tailored nodes if the current node is stronger
and is followed by an explicit-common-weight node.
Always returns the input index if that node is no stronger ... | [
"Finds",
"the",
"node",
"which",
"implies",
"or",
"contains",
"a",
"common",
"=",
"05",
"weight",
"of",
"the",
"given",
"strength",
"(",
"secondary",
"or",
"tertiary",
")",
"if",
"the",
"current",
"node",
"is",
"stronger",
".",
"Skips",
"weaker",
"nodes",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationBuilder.java#L754-L778 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/PluginExtractor.java | PluginExtractor.getBuildPluginVersion | public static String getBuildPluginVersion(AbstractWisdomMojo mojo, String plugin) {
"""
Retrieves the plugin version from Maven Project.
@param mojo the mojo
@param plugin the artifact id of the plugin
@return the version, {@code null} if the Maven Project does not used the given plugin
"""
Lis... | java | public static String getBuildPluginVersion(AbstractWisdomMojo mojo, String plugin) {
List<Plugin> plugins = mojo.project.getBuildPlugins();
for (Plugin plug : plugins) {
if (plug.getArtifactId().equals(plugin)) {
return plug.getVersion();
}
}
// No... | [
"public",
"static",
"String",
"getBuildPluginVersion",
"(",
"AbstractWisdomMojo",
"mojo",
",",
"String",
"plugin",
")",
"{",
"List",
"<",
"Plugin",
">",
"plugins",
"=",
"mojo",
".",
"project",
".",
"getBuildPlugins",
"(",
")",
";",
"for",
"(",
"Plugin",
"plu... | Retrieves the plugin version from Maven Project.
@param mojo the mojo
@param plugin the artifact id of the plugin
@return the version, {@code null} if the Maven Project does not used the given plugin | [
"Retrieves",
"the",
"plugin",
"version",
"from",
"Maven",
"Project",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/PluginExtractor.java#L43-L52 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/JSONObject.java | JSONObject.toJSONString | public static String toJSONString(Map<String, ? extends Object> map, JSONStyle compression) {
"""
Convert a map to JSON text. The result is a JSON object. If this map is
also a JSONAware, JSONAware specific behaviours will be omitted at this
top level.
@see net.minidev.json.JSONValue#toJSONString(Object)
@... | java | public static String toJSONString(Map<String, ? extends Object> map, JSONStyle compression) {
StringBuilder sb = new StringBuilder();
try {
writeJSON(map, sb, compression);
} catch (IOException e) {
// can not append on a StringBuilder
}
return sb.toString();
} | [
"public",
"static",
"String",
"toJSONString",
"(",
"Map",
"<",
"String",
",",
"?",
"extends",
"Object",
">",
"map",
",",
"JSONStyle",
"compression",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"{",
"writeJSON",
"(",
... | Convert a map to JSON text. The result is a JSON object. If this map is
also a JSONAware, JSONAware specific behaviours will be omitted at this
top level.
@see net.minidev.json.JSONValue#toJSONString(Object)
@param map
@return JSON text, or "null" if map is null. | [
"Convert",
"a",
"map",
"to",
"JSON",
"text",
".",
"The",
"result",
"is",
"a",
"JSON",
"object",
".",
"If",
"this",
"map",
"is",
"also",
"a",
"JSONAware",
"JSONAware",
"specific",
"behaviours",
"will",
"be",
"omitted",
"at",
"this",
"top",
"level",
"."
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/JSONObject.java#L71-L79 |
graknlabs/grakn | server/src/graql/executor/ComputeExecutor.java | ComputeExecutor.runComputeDegree | private Stream<ConceptSetMeasure> runComputeDegree(GraqlCompute.Centrality query) {
"""
The Graql compute centrality using degree query run method
@return a Answer containing the centrality count map
"""
Set<Label> targetTypeLabels;
// Check if ofType is valid before returning emptyMap
... | java | private Stream<ConceptSetMeasure> runComputeDegree(GraqlCompute.Centrality query) {
Set<Label> targetTypeLabels;
// Check if ofType is valid before returning emptyMap
if (query.of().isEmpty()) {
targetTypeLabels = scopeTypeLabels(query);
} else {
targetTypeLabels... | [
"private",
"Stream",
"<",
"ConceptSetMeasure",
">",
"runComputeDegree",
"(",
"GraqlCompute",
".",
"Centrality",
"query",
")",
"{",
"Set",
"<",
"Label",
">",
"targetTypeLabels",
";",
"// Check if ofType is valid before returning emptyMap",
"if",
"(",
"query",
".",
"of"... | The Graql compute centrality using degree query run method
@return a Answer containing the centrality count map | [
"The",
"Graql",
"compute",
"centrality",
"using",
"degree",
"query",
"run",
"method"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/executor/ComputeExecutor.java#L381-L416 |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java | SystemInputJson.asFunctionInputDef | private static FunctionInputDef asFunctionInputDef( String functionName, JsonObject json) {
"""
Returns the FunctionInputDef represented by the given JSON object.
"""
FunctionInputDef functionInputDef;
try
{
functionInputDef = new FunctionInputDef( validIdentifier( functionName));
... | java | private static FunctionInputDef asFunctionInputDef( String functionName, JsonObject json)
{
FunctionInputDef functionInputDef;
try
{
functionInputDef = new FunctionInputDef( validIdentifier( functionName));
// Get function annotations
Optional.ofNullable( json.getJsonObject( ... | [
"private",
"static",
"FunctionInputDef",
"asFunctionInputDef",
"(",
"String",
"functionName",
",",
"JsonObject",
"json",
")",
"{",
"FunctionInputDef",
"functionInputDef",
";",
"try",
"{",
"functionInputDef",
"=",
"new",
"FunctionInputDef",
"(",
"validIdentifier",
"(",
... | Returns the FunctionInputDef represented by the given JSON object. | [
"Returns",
"the",
"FunctionInputDef",
"represented",
"by",
"the",
"given",
"JSON",
"object",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java#L203-L245 |
JadiraOrg/jadira | jms/src/main/java/org/jadira/jms/container/BatchedMessageListenerContainer.java | BatchedMessageListenerContainer.commitIfNecessary | protected void commitIfNecessary(Session session, List<Message> messages) throws JMSException {
"""
Variant of {@link AbstractMessageListenerContainer#commitIfNecessary(Session, Message)} that performs the activity for a batch of messages.
@param session the JMS Session to commit
@param messages the messages to ... | java | protected void commitIfNecessary(Session session, List<Message> messages) throws JMSException {
// Commit session or acknowledge message.
if (session.getTransacted()) {
// Commit necessary - but avoid commit call within a JTA transaction.
if (isSessionLocallyTransacted(session)) ... | [
"protected",
"void",
"commitIfNecessary",
"(",
"Session",
"session",
",",
"List",
"<",
"Message",
">",
"messages",
")",
"throws",
"JMSException",
"{",
"// Commit session or acknowledge message.",
"if",
"(",
"session",
".",
"getTransacted",
"(",
")",
")",
"{",
"// ... | Variant of {@link AbstractMessageListenerContainer#commitIfNecessary(Session, Message)} that performs the activity for a batch of messages.
@param session the JMS Session to commit
@param messages the messages to acknowledge
@throws javax.jms.JMSException in case of commit failure | [
"Variant",
"of",
"{"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/jms/src/main/java/org/jadira/jms/container/BatchedMessageListenerContainer.java#L346-L359 |
ag-gipp/MathMLTools | mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/result/SubMatch.java | SubMatch.computeAssessment | double computeAssessment(MathNode refTree, MathNode compTree) {
"""
This method is still in testing.
<br/>
This method assesses the similarity value between two partial trees.
The measurement consists of a product from their depth and coverage distance.
@param refTree partial reference tree (or full tree)
... | java | double computeAssessment(MathNode refTree, MathNode compTree) {
int absDiff = Math.abs(refTree.getDepth() - compTree.getDepth());
int maxDepth = compTree.getMaxDepth() + 1;
double depthWeight = 1 - (double) absDiff / (double) maxDepth;
return depthWeight * coverage;
} | [
"double",
"computeAssessment",
"(",
"MathNode",
"refTree",
",",
"MathNode",
"compTree",
")",
"{",
"int",
"absDiff",
"=",
"Math",
".",
"abs",
"(",
"refTree",
".",
"getDepth",
"(",
")",
"-",
"compTree",
".",
"getDepth",
"(",
")",
")",
";",
"int",
"maxDepth... | This method is still in testing.
<br/>
This method assesses the similarity value between two partial trees.
The measurement consists of a product from their depth and coverage distance.
@param refTree partial reference tree (or full tree)
@param compTree partial comparison tree (or full tree)
@return value between 0 ... | [
"This",
"method",
"is",
"still",
"in",
"testing",
".",
"<br",
"/",
">",
"This",
"method",
"assesses",
"the",
"similarity",
"value",
"between",
"two",
"partial",
"trees",
".",
"The",
"measurement",
"consists",
"of",
"a",
"product",
"from",
"their",
"depth",
... | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/result/SubMatch.java#L59-L64 |
auth0/auth0-java | src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java | LogEventFilter.withCheckpoint | public LogEventFilter withCheckpoint(String from, int take) {
"""
Filter by checkpoint
@param from the log event id to start retrieving logs from.
@param take the limit of items to retrieve.
@return this filter instance
"""
parameters.put("from", from);
parameters.put("take", take);
... | java | public LogEventFilter withCheckpoint(String from, int take) {
parameters.put("from", from);
parameters.put("take", take);
return this;
} | [
"public",
"LogEventFilter",
"withCheckpoint",
"(",
"String",
"from",
",",
"int",
"take",
")",
"{",
"parameters",
".",
"put",
"(",
"\"from\"",
",",
"from",
")",
";",
"parameters",
".",
"put",
"(",
"\"take\"",
",",
"take",
")",
";",
"return",
"this",
";",
... | Filter by checkpoint
@param from the log event id to start retrieving logs from.
@param take the limit of items to retrieve.
@return this filter instance | [
"Filter",
"by",
"checkpoint"
] | train | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java#L15-L19 |
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/IbanFormatedValidator.java | IbanFormatedValidator.isValid | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
"""
{@inheritDoc} check if given string is a valid IBAN.
@see javax.validation.ConstraintValidator#isValid(java.lang.Object,
javax.validation.ConstraintValidatorContext)
"""
final String valueAsSt... | java | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
final String valueAsString = Objects.toString(pvalue, null);
if (StringUtils.isEmpty(valueAsString)) {
// empty field is ok
return true;
}
if (valueAsString.length() < IBAN_LENGTH_MIN |... | [
"@",
"Override",
"public",
"final",
"boolean",
"isValid",
"(",
"final",
"Object",
"pvalue",
",",
"final",
"ConstraintValidatorContext",
"pcontext",
")",
"{",
"final",
"String",
"valueAsString",
"=",
"Objects",
".",
"toString",
"(",
"pvalue",
",",
"null",
")",
... | {@inheritDoc} check if given string is a valid IBAN.
@see javax.validation.ConstraintValidator#isValid(java.lang.Object,
javax.validation.ConstraintValidatorContext) | [
"{",
"@inheritDoc",
"}",
"check",
"if",
"given",
"string",
"is",
"a",
"valid",
"IBAN",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/IbanFormatedValidator.java#L75-L99 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.appendUtf8String | public static File appendUtf8String(String content, String path) throws IORuntimeException {
"""
将String写入文件,UTF-8编码追加模式
@param content 写入的内容
@param path 文件路径
@return 写入的文件
@throws IORuntimeException IO异常
@since 3.1.2
"""
return appendString(content, path, CharsetUtil.CHARSET_UTF_8);
} | java | public static File appendUtf8String(String content, String path) throws IORuntimeException {
return appendString(content, path, CharsetUtil.CHARSET_UTF_8);
} | [
"public",
"static",
"File",
"appendUtf8String",
"(",
"String",
"content",
",",
"String",
"path",
")",
"throws",
"IORuntimeException",
"{",
"return",
"appendString",
"(",
"content",
",",
"path",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8",
")",
";",
"}"
] | 将String写入文件,UTF-8编码追加模式
@param content 写入的内容
@param path 文件路径
@return 写入的文件
@throws IORuntimeException IO异常
@since 3.1.2 | [
"将String写入文件,UTF",
"-",
"8编码追加模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2774-L2776 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java | CollectionExtensions.operator_remove | @Inline(value="$1.remove($2)")
public static <E> boolean operator_remove(Collection<? super E> collection, E value) {
"""
The operator mapping from {@code -=} to {@link Collection#remove(Object)}. Returns <code>true</code> if the
collection changed due to this operation.
@param collection
the to-be-changed c... | java | @Inline(value="$1.remove($2)")
public static <E> boolean operator_remove(Collection<? super E> collection, E value) {
return collection.remove(value);
} | [
"@",
"Inline",
"(",
"value",
"=",
"\"$1.remove($2)\"",
")",
"public",
"static",
"<",
"E",
">",
"boolean",
"operator_remove",
"(",
"Collection",
"<",
"?",
"super",
"E",
">",
"collection",
",",
"E",
"value",
")",
"{",
"return",
"collection",
".",
"remove",
... | The operator mapping from {@code -=} to {@link Collection#remove(Object)}. Returns <code>true</code> if the
collection changed due to this operation.
@param collection
the to-be-changed collection. May not be <code>null</code>.
@param value
the value that should be removed from the collection.
@return <code>true</code... | [
"The",
"operator",
"mapping",
"from",
"{",
"@code",
"-",
"=",
"}",
"to",
"{",
"@link",
"Collection#remove",
"(",
"Object",
")",
"}",
".",
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"collection",
"changed",
"due",
"to",
"this",
"op... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java#L82-L85 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.readBestUrlName | public String readBestUrlName(CmsUUID id, Locale locale, List<Locale> defaultLocales) throws CmsException {
"""
Reads the newest URL name which is mapped to the given structure id.<p>
If the structure id is not mapped to any name, null will be returned.<p>
@param id the structure id for which the newest mapp... | java | public String readBestUrlName(CmsUUID id, Locale locale, List<Locale> defaultLocales) throws CmsException {
return m_securityManager.readBestUrlName(m_context, id, locale, defaultLocales);
} | [
"public",
"String",
"readBestUrlName",
"(",
"CmsUUID",
"id",
",",
"Locale",
"locale",
",",
"List",
"<",
"Locale",
">",
"defaultLocales",
")",
"throws",
"CmsException",
"{",
"return",
"m_securityManager",
".",
"readBestUrlName",
"(",
"m_context",
",",
"id",
",",
... | Reads the newest URL name which is mapped to the given structure id.<p>
If the structure id is not mapped to any name, null will be returned.<p>
@param id the structure id for which the newest mapped name should be returned
@param locale the locale for which the URL name should be selected if possible
@param defaultL... | [
"Reads",
"the",
"newest",
"URL",
"name",
"which",
"is",
"mapped",
"to",
"the",
"given",
"structure",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L2360-L2363 |
Netflix/Nicobar | nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java | ClassPathUtils.getJarPathFromUrl | public static Path getJarPathFromUrl(URL jarUrl) {
"""
Find the jar containing the given resource.
@param jarUrl URL that came from a jar that needs to be parsed
@return {@link Path} to the Jar containing the resource.
"""
try {
String pathString = jarUrl.getPath();
// for J... | java | public static Path getJarPathFromUrl(URL jarUrl) {
try {
String pathString = jarUrl.getPath();
// for Jar URL, the path is in the form of: file:/path/to/groovy/myJar.jar!/path/to/resource/myResource.txt
int endIndex = pathString.lastIndexOf("!");
return Paths.get(... | [
"public",
"static",
"Path",
"getJarPathFromUrl",
"(",
"URL",
"jarUrl",
")",
"{",
"try",
"{",
"String",
"pathString",
"=",
"jarUrl",
".",
"getPath",
"(",
")",
";",
"// for Jar URL, the path is in the form of: file:/path/to/groovy/myJar.jar!/path/to/resource/myResource.txt",
... | Find the jar containing the given resource.
@param jarUrl URL that came from a jar that needs to be parsed
@return {@link Path} to the Jar containing the resource. | [
"Find",
"the",
"jar",
"containing",
"the",
"given",
"resource",
"."
] | train | https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java#L120-L129 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/dateTimePicker/DateTimePickerRenderer.java | DateTimePickerRenderer.getDateAsString | public static String getDateAsString(FacesContext fc, DateTimePicker dtp, Object value, String javaFormatString, Locale locale) {
"""
Get date in string format
@param fc The FacesContext
@param dtp the DateTimePicker component
@param value The date to display
@param javaFormatString The format string as define... | java | public static String getDateAsString(FacesContext fc, DateTimePicker dtp, Object value, String javaFormatString, Locale locale) {
if (value == null) {
return null;
}
Converter converter = dtp.getConverter();
return converter == null ?
getInternalDateAsString(value, javaFormatString, locale)
:
c... | [
"public",
"static",
"String",
"getDateAsString",
"(",
"FacesContext",
"fc",
",",
"DateTimePicker",
"dtp",
",",
"Object",
"value",
",",
"String",
"javaFormatString",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"nul... | Get date in string format
@param fc The FacesContext
@param dtp the DateTimePicker component
@param value The date to display
@param javaFormatString The format string as defined by the SimpleDateFormat syntax
@param locale The locale
@return null if the value is null. | [
"Get",
"date",
"in",
"string",
"format"
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/dateTimePicker/DateTimePickerRenderer.java#L106-L117 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/ValueElement.java | ValueElement.toFloat | public JcNumber toFloat() {
"""
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>convert the argument to a float, return a <b>JcNumber</b>, if the conversion fails return NULL</i></div>
<br/>
"""
JcNumber ret = new JcN... | java | public JcNumber toFloat() {
JcNumber ret = new JcNumber(null, this,
new FunctionInstance(FUNCTION.Common.TOFLOAT, 1));
QueryRecorder.recordInvocationConditional(this, "toFloat", ret);
return ret;
} | [
"public",
"JcNumber",
"toFloat",
"(",
")",
"{",
"JcNumber",
"ret",
"=",
"new",
"JcNumber",
"(",
"null",
",",
"this",
",",
"new",
"FunctionInstance",
"(",
"FUNCTION",
".",
"Common",
".",
"TOFLOAT",
",",
"1",
")",
")",
";",
"QueryRecorder",
".",
"recordInv... | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>convert the argument to a float, return a <b>JcNumber</b>, if the conversion fails return NULL</i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/ValueElement.java#L72-L77 |
baratine/baratine | framework/src/main/java/com/caucho/v5/ramp/db/DatabaseServiceRamp.java | DatabaseServiceRamp.findOne | @Override
public void findOne(String sql, Result<Cursor> result, Object ...args) {
"""
Queries for a single result in the database.
@param sql the select query
@param result holder for the result
@param args arguments to the select
"""
_kraken.query(sql).findOne(result, args);
} | java | @Override
public void findOne(String sql, Result<Cursor> result, Object ...args)
{
_kraken.query(sql).findOne(result, args);
} | [
"@",
"Override",
"public",
"void",
"findOne",
"(",
"String",
"sql",
",",
"Result",
"<",
"Cursor",
">",
"result",
",",
"Object",
"...",
"args",
")",
"{",
"_kraken",
".",
"query",
"(",
"sql",
")",
".",
"findOne",
"(",
"result",
",",
"args",
")",
";",
... | Queries for a single result in the database.
@param sql the select query
@param result holder for the result
@param args arguments to the select | [
"Queries",
"for",
"a",
"single",
"result",
"in",
"the",
"database",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/ramp/db/DatabaseServiceRamp.java#L118-L122 |
twilio/twilio-java | src/main/java/com/twilio/rest/wireless/v1/sim/UsageRecordReader.java | UsageRecordReader.nextPage | @Override
public Page<UsageRecord> nextPage(final Page<UsageRecord> page,
final TwilioRestClient client) {
"""
Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page
"""... | java | @Override
public Page<UsageRecord> nextPage(final Page<UsageRecord> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.WIRELESS.toString(),
client.ge... | [
"@",
"Override",
"public",
"Page",
"<",
"UsageRecord",
">",
"nextPage",
"(",
"final",
"Page",
"<",
"UsageRecord",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
... | Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page | [
"Retrieve",
"the",
"next",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/wireless/v1/sim/UsageRecordReader.java#L132-L143 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/AttributeConstraintRule.java | AttributeConstraintRule.validateMaxValue | private boolean validateMaxValue(Object validationObject, Annotation annotate) {
"""
Checks whether a given value is lesser than given max value or not
@param validationObject
@param annotate
@return
"""
if (checkNullObject(validationObject))
{
return true;
}
L... | java | private boolean validateMaxValue(Object validationObject, Annotation annotate)
{
if (checkNullObject(validationObject))
{
return true;
}
Long maxValue = ((Max) annotate).value();
if (checkvalidDigitTypes(validationObject.getClass()))
{
if ((Nu... | [
"private",
"boolean",
"validateMaxValue",
"(",
"Object",
"validationObject",
",",
"Annotation",
"annotate",
")",
"{",
"if",
"(",
"checkNullObject",
"(",
"validationObject",
")",
")",
"{",
"return",
"true",
";",
"}",
"Long",
"maxValue",
"=",
"(",
"(",
"Max",
... | Checks whether a given value is lesser than given max value or not
@param validationObject
@param annotate
@return | [
"Checks",
"whether",
"a",
"given",
"value",
"is",
"lesser",
"than",
"given",
"max",
"value",
"or",
"not"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/AttributeConstraintRule.java#L428-L447 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.plus | public static String plus(Number value, String right) {
"""
Appends a String to the string representation of this number.
@param value a Number
@param right a String
@return a String
@since 1.0
"""
return DefaultGroovyMethods.toString(value) + right;
} | java | public static String plus(Number value, String right) {
return DefaultGroovyMethods.toString(value) + right;
} | [
"public",
"static",
"String",
"plus",
"(",
"Number",
"value",
",",
"String",
"right",
")",
"{",
"return",
"DefaultGroovyMethods",
".",
"toString",
"(",
"value",
")",
"+",
"right",
";",
"}"
] | Appends a String to the string representation of this number.
@param value a Number
@param right a String
@return a String
@since 1.0 | [
"Appends",
"a",
"String",
"to",
"the",
"string",
"representation",
"of",
"this",
"number",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L2337-L2339 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/MetricReportReporter.java | MetricReportReporter.serializeValue | protected Metric serializeValue(String name, Number value, String... path) {
"""
Converts a single key-value pair into a metric.
@param name name of the metric
@param value value of the metric to report
@param path additional suffixes to further identify the meaning of the reported value
@return a {@link org... | java | protected Metric serializeValue(String name, Number value, String... path) {
return new Metric(MetricRegistry.name(name, path), value.doubleValue());
} | [
"protected",
"Metric",
"serializeValue",
"(",
"String",
"name",
",",
"Number",
"value",
",",
"String",
"...",
"path",
")",
"{",
"return",
"new",
"Metric",
"(",
"MetricRegistry",
".",
"name",
"(",
"name",
",",
"path",
")",
",",
"value",
".",
"doubleValue",
... | Converts a single key-value pair into a metric.
@param name name of the metric
@param value value of the metric to report
@param path additional suffixes to further identify the meaning of the reported value
@return a {@link org.apache.gobblin.metrics.Metric}. | [
"Converts",
"a",
"single",
"key",
"-",
"value",
"pair",
"into",
"a",
"metric",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/MetricReportReporter.java#L243-L245 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/text/FormatUtils.java | FormatUtils.messageFormat | protected static String messageFormat(String textPattern, Object... args) {
"""
Formats the given {@link String} of text using the {@link MessageFormat} class.
@param textPattern {@link String} text pattern to format.
@param args array of {@link Object} arguments to apply to the text pattern.
@return a format... | java | protected static String messageFormat(String textPattern, Object... args) {
return MessageFormat.format(textPattern, args);
} | [
"protected",
"static",
"String",
"messageFormat",
"(",
"String",
"textPattern",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"MessageFormat",
".",
"format",
"(",
"textPattern",
",",
"args",
")",
";",
"}"
] | Formats the given {@link String} of text using the {@link MessageFormat} class.
@param textPattern {@link String} text pattern to format.
@param args array of {@link Object} arguments to apply to the text pattern.
@return a formatted {@link String} of text with the arguments applied to the text pattern
using the {@lin... | [
"Formats",
"the",
"given",
"{",
"@link",
"String",
"}",
"of",
"text",
"using",
"the",
"{",
"@link",
"MessageFormat",
"}",
"class",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/text/FormatUtils.java#L56-L58 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNodes.java | PeerEurekaNodes.isInstanceURL | public boolean isInstanceURL(String url, InstanceInfo instance) {
"""
Checks if the given service url matches the supplied instance
@param url the service url of the replica node that the check is made.
@param instance the instance to check the service url against
@return true, if the url represents the suppl... | java | public boolean isInstanceURL(String url, InstanceInfo instance) {
String hostName = hostFromUrl(url);
String myInfoComparator = instance.getHostName();
if (clientConfig.getTransportConfig().applicationsResolverUseIp()) {
myInfoComparator = instance.getIPAddr();
}
retu... | [
"public",
"boolean",
"isInstanceURL",
"(",
"String",
"url",
",",
"InstanceInfo",
"instance",
")",
"{",
"String",
"hostName",
"=",
"hostFromUrl",
"(",
"url",
")",
";",
"String",
"myInfoComparator",
"=",
"instance",
".",
"getHostName",
"(",
")",
";",
"if",
"("... | Checks if the given service url matches the supplied instance
@param url the service url of the replica node that the check is made.
@param instance the instance to check the service url against
@return true, if the url represents the supplied instance, false otherwise. | [
"Checks",
"if",
"the",
"given",
"service",
"url",
"matches",
"the",
"supplied",
"instance"
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNodes.java#L250-L257 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BidiLine.java | BidiLine.getSingleRun | static void getSingleRun(Bidi bidi, byte level) {
"""
/* in trivial cases there is only one trivial run; called by getRuns()
"""
/* simple, single-run case */
bidi.runs = bidi.simpleRuns;
bidi.runCount = 1;
/* fill and reorder the single run */
bidi.runs[0] = new BidiRu... | java | static void getSingleRun(Bidi bidi, byte level) {
/* simple, single-run case */
bidi.runs = bidi.simpleRuns;
bidi.runCount = 1;
/* fill and reorder the single run */
bidi.runs[0] = new BidiRun(0, bidi.length, level);
} | [
"static",
"void",
"getSingleRun",
"(",
"Bidi",
"bidi",
",",
"byte",
"level",
")",
"{",
"/* simple, single-run case */",
"bidi",
".",
"runs",
"=",
"bidi",
".",
"simpleRuns",
";",
"bidi",
".",
"runCount",
"=",
"1",
";",
"/* fill and reorder the single run */",
"bi... | /* in trivial cases there is only one trivial run; called by getRuns() | [
"/",
"*",
"in",
"trivial",
"cases",
"there",
"is",
"only",
"one",
"trivial",
"run",
";",
"called",
"by",
"getRuns",
"()"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BidiLine.java#L322-L329 |
tvesalainen/util | util/src/main/java/org/vesalainen/ui/LineDrawer.java | LineDrawer.fillWidth | public static void fillWidth(double x0, double y0, double derivateX, double derivateY, double width, PlotOperator plot) {
"""
Draws orthogonal to derivate width length line having center at (x0, y0).
@param x0
@param y0
@param derivateX
@param derivateY
@param width
@param plot
"""
double halfWi... | java | public static void fillWidth(double x0, double y0, double derivateX, double derivateY, double width, PlotOperator plot)
{
double halfWidth = width/2.0;
if (Math.abs(derivateY) <= Double.MIN_VALUE)
{
drawLine((int)(x0), (int)(y0+halfWidth), (int)(x0), (int)(y0-halfWidth), plo... | [
"public",
"static",
"void",
"fillWidth",
"(",
"double",
"x0",
",",
"double",
"y0",
",",
"double",
"derivateX",
",",
"double",
"derivateY",
",",
"double",
"width",
",",
"PlotOperator",
"plot",
")",
"{",
"double",
"halfWidth",
"=",
"width",
"/",
"2.0",
";",
... | Draws orthogonal to derivate width length line having center at (x0, y0).
@param x0
@param y0
@param derivateX
@param derivateY
@param width
@param plot | [
"Draws",
"orthogonal",
"to",
"derivate",
"width",
"length",
"line",
"having",
"center",
"at",
"(",
"x0",
"y0",
")",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/ui/LineDrawer.java#L48-L63 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java | SymmetryAxes.updateAxis | public void updateAxis(Integer index, Matrix4d newAxis) {
"""
Updates an axis of symmetry, after the superposition changed.
@param index old axis index
@param newAxis
"""
axes.get(index).setOperator(newAxis);
} | java | public void updateAxis(Integer index, Matrix4d newAxis){
axes.get(index).setOperator(newAxis);
} | [
"public",
"void",
"updateAxis",
"(",
"Integer",
"index",
",",
"Matrix4d",
"newAxis",
")",
"{",
"axes",
".",
"get",
"(",
"index",
")",
".",
"setOperator",
"(",
"newAxis",
")",
";",
"}"
] | Updates an axis of symmetry, after the superposition changed.
@param index old axis index
@param newAxis | [
"Updates",
"an",
"axis",
"of",
"symmetry",
"after",
"the",
"superposition",
"changed",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java#L252-L254 |
lucee/Lucee | core/src/main/java/lucee/commons/lang/ClassUtil.java | ClassUtil.loadClass | public static Class loadClass(ClassLoader cl, String className) throws ClassException {
"""
loads a class from a specified Classloader with given classname
@param className
@param cl
@return matching Class
@throws ClassException
"""
Set<Throwable> exceptions = new HashSet<Throwable>();
Class clazz = l... | java | public static Class loadClass(ClassLoader cl, String className) throws ClassException {
Set<Throwable> exceptions = new HashSet<Throwable>();
Class clazz = loadClass(cl, className, null, exceptions);
if (clazz != null) return clazz;
String msg = "cannot load class through its string name, because no definition f... | [
"public",
"static",
"Class",
"loadClass",
"(",
"ClassLoader",
"cl",
",",
"String",
"className",
")",
"throws",
"ClassException",
"{",
"Set",
"<",
"Throwable",
">",
"exceptions",
"=",
"new",
"HashSet",
"<",
"Throwable",
">",
"(",
")",
";",
"Class",
"clazz",
... | loads a class from a specified Classloader with given classname
@param className
@param cl
@return matching Class
@throws ClassException | [
"loads",
"a",
"class",
"from",
"a",
"specified",
"Classloader",
"with",
"given",
"classname"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/ClassUtil.java#L267-L288 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAToken2.java | LTPAToken2.validateExpiration | public final void validateExpiration() throws TokenExpiredException {
"""
Checks if the token has expired.
@throws TokenExpiredException
"""
Date d = new Date();
Date expD = new Date(getExpiration());
boolean expired = d.after(expD);
if (TraceComponent.isAnyTracingEnabled() &... | java | public final void validateExpiration() throws TokenExpiredException {
Date d = new Date();
Date expD = new Date(getExpiration());
boolean expired = d.after(expD);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(this, tc, "Current time = " + d + ", ... | [
"public",
"final",
"void",
"validateExpiration",
"(",
")",
"throws",
"TokenExpiredException",
"{",
"Date",
"d",
"=",
"new",
"Date",
"(",
")",
";",
"Date",
"expD",
"=",
"new",
"Date",
"(",
"getExpiration",
"(",
")",
")",
";",
"boolean",
"expired",
"=",
"d... | Checks if the token has expired.
@throws TokenExpiredException | [
"Checks",
"if",
"the",
"token",
"has",
"expired",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAToken2.java#L301-L315 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.passOver | @Conditioned
@Quand("Je passe au dessus de '(.*)-(.*)'[\\.|\\?]")
@When("I pass over '(.*)-(.*)'[\\.|\\?]")
public void passOver(String page, String elementName, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
"""
Simulates the mouse over a html element
@param... | java | @Conditioned
@Quand("Je passe au dessus de '(.*)-(.*)'[\\.|\\?]")
@When("I pass over '(.*)-(.*)'[\\.|\\?]")
public void passOver(String page, String elementName, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
passOver(Page.getInstance(page).getPageElementByK... | [
"@",
"Conditioned",
"@",
"Quand",
"(",
"\"Je passe au dessus de '(.*)-(.*)'[\\\\.|\\\\?]\"",
")",
"@",
"When",
"(",
"\"I pass over '(.*)-(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"passOver",
"(",
"String",
"page",
",",
"String",
"elementName",
",",
"List",
"<",
"G... | Simulates the mouse over a html element
@param page
The concerned page of elementName
@param elementName
Is target element
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@throws TechnicalException
is throws if you have a technical err... | [
"Simulates",
"the",
"mouse",
"over",
"a",
"html",
"element"
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L500-L505 |
EXIficient/exificient-core | src/main/java/com/siemens/ct/exi/core/values/DateTimeValue.java | DateTimeValue.setTime | protected static void setTime(int time, Calendar cal) {
"""
Sets hour, minute and second of the given calendar making use of of the
time representation defined in EXI format
@param time
time
@param cal
calendar
"""
// ((Hour * 64) + Minutes) * 64 + seconds
int hour = time / (64 * 64);
time -= hour... | java | protected static void setTime(int time, Calendar cal) {
// ((Hour * 64) + Minutes) * 64 + seconds
int hour = time / (64 * 64);
time -= hour * (64 * 64);
int minute = time / 64;
time -= minute * 64; // second
cal.set(Calendar.HOUR_OF_DAY, hour);
cal.set(Calendar.MINUTE, minute);
cal.set(Calendar.SECOND, ... | [
"protected",
"static",
"void",
"setTime",
"(",
"int",
"time",
",",
"Calendar",
"cal",
")",
"{",
"// ((Hour * 64) + Minutes) * 64 + seconds",
"int",
"hour",
"=",
"time",
"/",
"(",
"64",
"*",
"64",
")",
";",
"time",
"-=",
"hour",
"*",
"(",
"64",
"*",
"64",... | Sets hour, minute and second of the given calendar making use of of the
time representation defined in EXI format
@param time
time
@param cal
calendar | [
"Sets",
"hour",
"minute",
"and",
"second",
"of",
"the",
"given",
"calendar",
"making",
"use",
"of",
"of",
"the",
"time",
"representation",
"defined",
"in",
"EXI",
"format"
] | train | https://github.com/EXIficient/exificient-core/blob/b6026c5fd39e9cc3d7874caa20f084e264e0ddc7/src/main/java/com/siemens/ct/exi/core/values/DateTimeValue.java#L505-L514 |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/EdgeEffect.java | EdgeEffect.setSize | public void setSize(int width, int height) {
"""
Set the size of this edge effect in pixels.
@param width Effect width in pixels
@param height Effect height in pixels
"""
final float r = width * 0.75f / SIN;
final float y = COS * r;
final float h = r - y;
final float or = h... | java | public void setSize(int width, int height) {
final float r = width * 0.75f / SIN;
final float y = COS * r;
final float h = r - y;
final float or = height * 0.75f / SIN;
final float oy = COS * or;
final float oh = or - oy;
mRadius = r;
mBaseGlowScale = h >... | [
"public",
"void",
"setSize",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"final",
"float",
"r",
"=",
"width",
"*",
"0.75f",
"/",
"SIN",
";",
"final",
"float",
"y",
"=",
"COS",
"*",
"r",
";",
"final",
"float",
"h",
"=",
"r",
"-",
"y",
"... | Set the size of this edge effect in pixels.
@param width Effect width in pixels
@param height Effect height in pixels | [
"Set",
"the",
"size",
"of",
"this",
"edge",
"effect",
"in",
"pixels",
"."
] | train | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/EdgeEffect.java#L87-L99 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java | AbstractFrameModelingVisitor.modelInstruction | public void modelInstruction(Instruction ins, int numWordsConsumed, int numWordsProduced, Value pushValue) {
"""
Primitive to model the stack effect of a single instruction, explicitly
specifying the value to be pushed on the stack.
@param ins
the Instruction to model
@param numWordsConsumed
number of stack... | java | public void modelInstruction(Instruction ins, int numWordsConsumed, int numWordsProduced, Value pushValue) {
if (frame.getStackDepth() < numWordsConsumed) {
try {
throw new IllegalArgumentException(" asked to pop " + numWordsConsumed + " stack elements but only "
... | [
"public",
"void",
"modelInstruction",
"(",
"Instruction",
"ins",
",",
"int",
"numWordsConsumed",
",",
"int",
"numWordsProduced",
",",
"Value",
"pushValue",
")",
"{",
"if",
"(",
"frame",
".",
"getStackDepth",
"(",
")",
"<",
"numWordsConsumed",
")",
"{",
"try",
... | Primitive to model the stack effect of a single instruction, explicitly
specifying the value to be pushed on the stack.
@param ins
the Instruction to model
@param numWordsConsumed
number of stack words consumed
@param numWordsProduced
number of stack words produced
@param pushValue
value to push on the stack | [
"Primitive",
"to",
"model",
"the",
"stack",
"effect",
"of",
"a",
"single",
"instruction",
"explicitly",
"specifying",
"the",
"value",
"to",
"be",
"pushed",
"on",
"the",
"stack",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java#L390-L411 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/Duration.java | Duration.plus | private Duration plus(long secondsToAdd, long nanosToAdd) {
"""
Returns a copy of this duration with the specified duration added.
<p>
This instance is immutable and unaffected by this method call.
@param secondsToAdd the seconds to add, positive or negative
@param nanosToAdd the nanos to add, positive or ... | java | private Duration plus(long secondsToAdd, long nanosToAdd) {
if ((secondsToAdd | nanosToAdd) == 0) {
return this;
}
long epochSec = Jdk8Methods.safeAdd(seconds, secondsToAdd);
epochSec = Jdk8Methods.safeAdd(epochSec, nanosToAdd / NANOS_PER_SECOND);
nanosToAdd = nanosTo... | [
"private",
"Duration",
"plus",
"(",
"long",
"secondsToAdd",
",",
"long",
"nanosToAdd",
")",
"{",
"if",
"(",
"(",
"secondsToAdd",
"|",
"nanosToAdd",
")",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"epochSec",
"=",
"Jdk8Methods",
".",
"safeAd... | Returns a copy of this duration with the specified duration added.
<p>
This instance is immutable and unaffected by this method call.
@param secondsToAdd the seconds to add, positive or negative
@param nanosToAdd the nanos to add, positive or negative
@return a {@code Duration} based on this duration with the specif... | [
"Returns",
"a",
"copy",
"of",
"this",
"duration",
"with",
"the",
"specified",
"duration",
"added",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/Duration.java#L748-L757 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsCheckableDatePanel.java | CmsCheckableDatePanel.setDatesWithCheckState | public void setDatesWithCheckState(Collection<CmsPair<Date, Boolean>> datesWithCheckInfo) {
"""
Set dates with the provided check states.
@param datesWithCheckInfo the dates to set, accompanied with the check state to set.
"""
SortedSet<Date> dates = new TreeSet<>();
m_checkBoxes.clear();
... | java | public void setDatesWithCheckState(Collection<CmsPair<Date, Boolean>> datesWithCheckInfo) {
SortedSet<Date> dates = new TreeSet<>();
m_checkBoxes.clear();
for (CmsPair<Date, Boolean> p : datesWithCheckInfo) {
addCheckBox(p.getFirst(), p.getSecond().booleanValue());
dates... | [
"public",
"void",
"setDatesWithCheckState",
"(",
"Collection",
"<",
"CmsPair",
"<",
"Date",
",",
"Boolean",
">",
">",
"datesWithCheckInfo",
")",
"{",
"SortedSet",
"<",
"Date",
">",
"dates",
"=",
"new",
"TreeSet",
"<>",
"(",
")",
";",
"m_checkBoxes",
".",
"... | Set dates with the provided check states.
@param datesWithCheckInfo the dates to set, accompanied with the check state to set. | [
"Set",
"dates",
"with",
"the",
"provided",
"check",
"states",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsCheckableDatePanel.java#L255-L265 |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/solution/util/RepairDoubleSolutionAtBounds.java | RepairDoubleSolutionAtBounds.repairSolutionVariableValue | public double repairSolutionVariableValue(double value, double lowerBound, double upperBound) {
"""
Checks if the value is between its bounds; if not, the lower or upper bound is returned
@param value The value to be checked
@param lowerBound
@param upperBound
@return The same value if it is in the limits or a... | java | public double repairSolutionVariableValue(double value, double lowerBound, double upperBound) {
if (lowerBound > upperBound) {
throw new JMetalException("The lower bound (" + lowerBound + ") is greater than the "
+ "upper bound (" + upperBound+")") ;
}
double result = value ;
if (value ... | [
"public",
"double",
"repairSolutionVariableValue",
"(",
"double",
"value",
",",
"double",
"lowerBound",
",",
"double",
"upperBound",
")",
"{",
"if",
"(",
"lowerBound",
">",
"upperBound",
")",
"{",
"throw",
"new",
"JMetalException",
"(",
"\"The lower bound (\"",
"+... | Checks if the value is between its bounds; if not, the lower or upper bound is returned
@param value The value to be checked
@param lowerBound
@param upperBound
@return The same value if it is in the limits or a repaired value otherwise | [
"Checks",
"if",
"the",
"value",
"is",
"between",
"its",
"bounds",
";",
"if",
"not",
"the",
"lower",
"or",
"upper",
"bound",
"is",
"returned"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/solution/util/RepairDoubleSolutionAtBounds.java#L18-L33 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/products/ProductPropertyUrl.java | ProductPropertyUrl.deletePropertyUrl | public static MozuUrl deletePropertyUrl(String attributeFQN, String productCode) {
"""
Get Resource Url for DeleteProperty
@param attributeFQN Fully qualified name for an attribute.
@param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product.
@... | java | public static MozuUrl deletePropertyUrl(String attributeFQN, String productCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/Properties/{attributeFQN}");
formatter.formatUrl("attributeFQN", attributeFQN);
formatter.formatUrl("productCode", productCode);
... | [
"public",
"static",
"MozuUrl",
"deletePropertyUrl",
"(",
"String",
"attributeFQN",
",",
"String",
"productCode",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/products/{productCode}/Properties/{attributeFQN}\"",
")",
";... | Get Resource Url for DeleteProperty
@param attributeFQN Fully qualified name for an attribute.
@param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteProperty"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/products/ProductPropertyUrl.java#L170-L176 |
deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/chunk/NDArrayMessageChunk.java | NDArrayMessageChunk.fromBuffer | public static NDArrayMessageChunk fromBuffer(ByteBuffer byteBuffer, NDArrayMessage.MessageType type) {
"""
Returns a chunk given the passed in {@link ByteBuffer}
NOTE THAT THIS WILL MODIFY THE PASSED IN BYTEBUFFER's POSITION.
@param byteBuffer the byte buffer to extract the chunk from
@return the ndarray mess... | java | public static NDArrayMessageChunk fromBuffer(ByteBuffer byteBuffer, NDArrayMessage.MessageType type) {
int numChunks = byteBuffer.getInt();
int chunkSize = byteBuffer.getInt();
int idLength = byteBuffer.getInt();
byte[] id = new byte[idLength];
byteBuffer.get(id);
String ... | [
"public",
"static",
"NDArrayMessageChunk",
"fromBuffer",
"(",
"ByteBuffer",
"byteBuffer",
",",
"NDArrayMessage",
".",
"MessageType",
"type",
")",
"{",
"int",
"numChunks",
"=",
"byteBuffer",
".",
"getInt",
"(",
")",
";",
"int",
"chunkSize",
"=",
"byteBuffer",
"."... | Returns a chunk given the passed in {@link ByteBuffer}
NOTE THAT THIS WILL MODIFY THE PASSED IN BYTEBUFFER's POSITION.
@param byteBuffer the byte buffer to extract the chunk from
@return the ndarray message chunk based on the passed in {@link ByteBuffer} | [
"Returns",
"a",
"chunk",
"given",
"the",
"passed",
"in",
"{",
"@link",
"ByteBuffer",
"}",
"NOTE",
"THAT",
"THIS",
"WILL",
"MODIFY",
"THE",
"PASSED",
"IN",
"BYTEBUFFER",
"s",
"POSITION",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/chunk/NDArrayMessageChunk.java#L120-L133 |
finnyb/javampd | src/main/java/org/bff/javampd/admin/MPDAdmin.java | MPDAdmin.fireOutputChangeEvent | protected synchronized void fireOutputChangeEvent(OUTPUT_EVENT event) {
"""
Sends the appropriate {@link org.bff.javampd.playlist.PlaylistChangeEvent} to all registered
{@link org.bff.javampd.playlist.PlaylistChangeListener}.
@param event the event id to send
"""
OutputChangeEvent oce = new OutputC... | java | protected synchronized void fireOutputChangeEvent(OUTPUT_EVENT event) {
OutputChangeEvent oce = new OutputChangeEvent(this, event);
for (OutputChangeListener pcl : outputListeners) {
pcl.outputChanged(oce);
}
} | [
"protected",
"synchronized",
"void",
"fireOutputChangeEvent",
"(",
"OUTPUT_EVENT",
"event",
")",
"{",
"OutputChangeEvent",
"oce",
"=",
"new",
"OutputChangeEvent",
"(",
"this",
",",
"event",
")",
";",
"for",
"(",
"OutputChangeListener",
"pcl",
":",
"outputListeners",... | Sends the appropriate {@link org.bff.javampd.playlist.PlaylistChangeEvent} to all registered
{@link org.bff.javampd.playlist.PlaylistChangeListener}.
@param event the event id to send | [
"Sends",
"the",
"appropriate",
"{",
"@link",
"org",
".",
"bff",
".",
"javampd",
".",
"playlist",
".",
"PlaylistChangeEvent",
"}",
"to",
"all",
"registered",
"{",
"@link",
"org",
".",
"bff",
".",
"javampd",
".",
"playlist",
".",
"PlaylistChangeListener",
"}",... | train | https://github.com/finnyb/javampd/blob/186736e85fc238b4208cc9ee23373f9249376b4c/src/main/java/org/bff/javampd/admin/MPDAdmin.java#L167-L173 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSchema.java | JSchema.getCompatibility | public CompatibilityMap getCompatibility(JSchema access) throws JMFSchemaViolationException {
"""
Find the CompatibilityMap from a given access JSchema to this JSchema
@param access the JSchema that is intended to be used as the access schema
@return the desired CompatibilityMap if the schemas are compatible. ... | java | public CompatibilityMap getCompatibility(JSchema access) throws JMFSchemaViolationException {
CompatibilityMap ans = null;
if (compMaps == null)
compMaps = new HashedArray(COMP_MAP_BUCKETS, 2);
else
ans = (CompatibilityMap)compMaps.get(access.getID());
if (ans != null)
return ans;
... | [
"public",
"CompatibilityMap",
"getCompatibility",
"(",
"JSchema",
"access",
")",
"throws",
"JMFSchemaViolationException",
"{",
"CompatibilityMap",
"ans",
"=",
"null",
";",
"if",
"(",
"compMaps",
"==",
"null",
")",
"compMaps",
"=",
"new",
"HashedArray",
"(",
"COMP_... | Find the CompatibilityMap from a given access JSchema to this JSchema
@param access the JSchema that is intended to be used as the access schema
@return the desired CompatibilityMap if the schemas are compatible. This method
never returns null.
@exception SchemaViolationException if the the JSchemas are not compatibl... | [
"Find",
"the",
"CompatibilityMap",
"from",
"a",
"given",
"access",
"JSchema",
"to",
"this",
"JSchema"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSchema.java#L319-L330 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsAdditionalInfosDialog.java | CmsAdditionalInfosDialog.addInfoLayout | HorizontalLayout addInfoLayout(String key, Object value, boolean editable) {
"""
Get horizontal layout with key, value from additional info.<p>
@param key key
@param value value
@param editable boolean
@return HorizontalLayout
"""
HorizontalLayout res = new HorizontalLayout();
res.setWid... | java | HorizontalLayout addInfoLayout(String key, Object value, boolean editable) {
HorizontalLayout res = new HorizontalLayout();
res.setWidth("100%");
res.setSpacing(true);
TextField keyField = new TextField();
keyField.setValue(key);
keyField.setEnabled(editable);
k... | [
"HorizontalLayout",
"addInfoLayout",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"boolean",
"editable",
")",
"{",
"HorizontalLayout",
"res",
"=",
"new",
"HorizontalLayout",
"(",
")",
";",
"res",
".",
"setWidth",
"(",
"\"100%\"",
")",
";",
"res",
".",
... | Get horizontal layout with key, value from additional info.<p>
@param key key
@param value value
@param editable boolean
@return HorizontalLayout | [
"Get",
"horizontal",
"layout",
"with",
"key",
"value",
"from",
"additional",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsAdditionalInfosDialog.java#L219-L242 |
janus-project/guava.janusproject.io | guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/FluentIterable.java | FluentIterable.limit | @CheckReturnValue
public final FluentIterable<E> limit(int size) {
"""
Creates a fluent iterable with the first {@code size} elements of this
fluent iterable. If this fluent iterable does not contain that many elements,
the returned fluent iterable will have the same behavior as this fluent iterable.
The retu... | java | @CheckReturnValue
public final FluentIterable<E> limit(int size) {
return from(Iterables.limit(iterable, size));
} | [
"@",
"CheckReturnValue",
"public",
"final",
"FluentIterable",
"<",
"E",
">",
"limit",
"(",
"int",
"size",
")",
"{",
"return",
"from",
"(",
"Iterables",
".",
"limit",
"(",
"iterable",
",",
"size",
")",
")",
";",
"}"
] | Creates a fluent iterable with the first {@code size} elements of this
fluent iterable. If this fluent iterable does not contain that many elements,
the returned fluent iterable will have the same behavior as this fluent iterable.
The returned fluent iterable's iterator supports {@code remove()} if this
fluent iterable... | [
"Creates",
"a",
"fluent",
"iterable",
"with",
"the",
"first",
"{",
"@code",
"size",
"}",
"elements",
"of",
"this",
"fluent",
"iterable",
".",
"If",
"this",
"fluent",
"iterable",
"does",
"not",
"contain",
"that",
"many",
"elements",
"the",
"returned",
"fluent... | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/FluentIterable.java#L342-L345 |
banq/jdonframework | src/main/java/com/jdon/container/pico/JdonPicoContainer.java | JdonPicoContainer.registerComponentImplementation | public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation, List parameters)
throws PicoRegistrationException {
"""
Same as
{@link #registerComponentImplementation(java.lang.Object, java.lang.Class, org.picocontainer.Parameter[])}
but with parameters as a {@lin... | java | public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation, List parameters)
throws PicoRegistrationException {
Parameter[] parametersAsArray = (Parameter[]) parameters.toArray(new Parameter[parameters.size()]);
return registerComponentImplementation(componentKe... | [
"public",
"ComponentAdapter",
"registerComponentImplementation",
"(",
"Object",
"componentKey",
",",
"Class",
"componentImplementation",
",",
"List",
"parameters",
")",
"throws",
"PicoRegistrationException",
"{",
"Parameter",
"[",
"]",
"parametersAsArray",
"=",
"(",
"Para... | Same as
{@link #registerComponentImplementation(java.lang.Object, java.lang.Class, org.picocontainer.Parameter[])}
but with parameters as a {@link List}. Makes it possible to use with
Groovy arrays (which are actually Lists). | [
"Same",
"as",
"{"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/container/pico/JdonPicoContainer.java#L279-L283 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/BizwifiAPI.java | BizwifiAPI.shopClean | public static BaseResult shopClean(String accessToken, ShopInfo shopInfo) {
"""
Wi-Fi门店管理-清空门店网络及设备
@param accessToken accessToken
@param shopInfo shopInfo
@return BaseResult
"""
return shopClean(accessToken, JsonUtil.toJSONString(shopInfo));
} | java | public static BaseResult shopClean(String accessToken, ShopInfo shopInfo) {
return shopClean(accessToken, JsonUtil.toJSONString(shopInfo));
} | [
"public",
"static",
"BaseResult",
"shopClean",
"(",
"String",
"accessToken",
",",
"ShopInfo",
"shopInfo",
")",
"{",
"return",
"shopClean",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"shopInfo",
")",
")",
";",
"}"
] | Wi-Fi门店管理-清空门店网络及设备
@param accessToken accessToken
@param shopInfo shopInfo
@return BaseResult | [
"Wi",
"-",
"Fi门店管理",
"-",
"清空门店网络及设备"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/BizwifiAPI.java#L285-L287 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/utils/FileUtils.java | FileUtils.closeDirectByteBuffer | public static boolean closeDirectByteBuffer(final ByteBuffer byteBuffer, final LogNode log) {
"""
Close a {@code DirectByteBuffer} -- in particular, will unmap a {@link MappedByteBuffer}.
@param byteBuffer
The {@link ByteBuffer} to close/unmap.
@param log
The log.
@return True if the byteBuffer was closed/u... | java | public static boolean closeDirectByteBuffer(final ByteBuffer byteBuffer, final LogNode log) {
if (byteBuffer != null && byteBuffer.isDirect()) {
return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
@Override
public Boolean run() {
... | [
"public",
"static",
"boolean",
"closeDirectByteBuffer",
"(",
"final",
"ByteBuffer",
"byteBuffer",
",",
"final",
"LogNode",
"log",
")",
"{",
"if",
"(",
"byteBuffer",
"!=",
"null",
"&&",
"byteBuffer",
".",
"isDirect",
"(",
")",
")",
"{",
"return",
"AccessControl... | Close a {@code DirectByteBuffer} -- in particular, will unmap a {@link MappedByteBuffer}.
@param byteBuffer
The {@link ByteBuffer} to close/unmap.
@param log
The log.
@return True if the byteBuffer was closed/unmapped. | [
"Close",
"a",
"{",
"@code",
"DirectByteBuffer",
"}",
"--",
"in",
"particular",
"will",
"unmap",
"a",
"{",
"@link",
"MappedByteBuffer",
"}",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/FileUtils.java#L606-L618 |
knowm/XChart | xchart/src/main/java/org/knowm/xchart/OHLCChart.java | OHLCChart.addSeries | public OHLCSeries addSeries(
String seriesName,
List<? extends Number> openData,
List<? extends Number> highData,
List<? extends Number> lowData,
List<? extends Number> closeData) {
"""
Add a series for a OHLC type chart using Lists
@param seriesName
@param openData the open data
... | java | public OHLCSeries addSeries(
String seriesName,
List<? extends Number> openData,
List<? extends Number> highData,
List<? extends Number> lowData,
List<? extends Number> closeData) {
return addSeries(seriesName, null, openData, highData, lowData, closeData);
} | [
"public",
"OHLCSeries",
"addSeries",
"(",
"String",
"seriesName",
",",
"List",
"<",
"?",
"extends",
"Number",
">",
"openData",
",",
"List",
"<",
"?",
"extends",
"Number",
">",
"highData",
",",
"List",
"<",
"?",
"extends",
"Number",
">",
"lowData",
",",
"... | Add a series for a OHLC type chart using Lists
@param seriesName
@param openData the open data
@param highData the high data
@param lowData the low data
@param closeData the close data
@return A Series object that you can set properties on | [
"Add",
"a",
"series",
"for",
"a",
"OHLC",
"type",
"chart",
"using",
"Lists"
] | train | https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/OHLCChart.java#L219-L227 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.biPredicate | public static <T, U> BiPredicate<T, U> biPredicate(CheckedBiPredicate<T, U> predicate, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedBiPredicate} in a {@link BiPredicate} with a custom handler for checked exceptions.
"""
return (t, u) -> {
try {
return predicate.te... | java | public static <T, U> BiPredicate<T, U> biPredicate(CheckedBiPredicate<T, U> predicate, Consumer<Throwable> handler) {
return (t, u) -> {
try {
return predicate.test(t, u);
}
catch (Throwable e) {
handler.accept(e);
throw new Il... | [
"public",
"static",
"<",
"T",
",",
"U",
">",
"BiPredicate",
"<",
"T",
",",
"U",
">",
"biPredicate",
"(",
"CheckedBiPredicate",
"<",
"T",
",",
"U",
">",
"predicate",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"(",
"t",
",",... | Wrap a {@link CheckedBiPredicate} in a {@link BiPredicate} with a custom handler for checked exceptions. | [
"Wrap",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L447-L458 |
apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/crypto/EncryptionConfigParser.java | EncryptionConfigParser.getCipher | public static String getCipher(Map<String, Object> parameters) {
"""
Get the underlying cipher name
@param parameters parameters map
@return the cipher name
"""
return (String)parameters.get(ENCRYPTION_CIPHER_KEY);
} | java | public static String getCipher(Map<String, Object> parameters) {
return (String)parameters.get(ENCRYPTION_CIPHER_KEY);
} | [
"public",
"static",
"String",
"getCipher",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"return",
"(",
"String",
")",
"parameters",
".",
"get",
"(",
"ENCRYPTION_CIPHER_KEY",
")",
";",
"}"
] | Get the underlying cipher name
@param parameters parameters map
@return the cipher name | [
"Get",
"the",
"underlying",
"cipher",
"name"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/crypto/EncryptionConfigParser.java#L211-L213 |
querydsl/querydsl | querydsl-spatial/src/main/java/com/querydsl/spatial/GeometryExpressions.java | GeometryExpressions.fromText | public static GeometryExpression<?> fromText(String text) {
"""
Return a specified ST_Geometry value from Well-Known Text representation (WKT).
@param text WKT form
@return geometry
"""
return geometryOperation(SpatialOps.GEOM_FROM_TEXT, ConstantImpl.create(text));
} | java | public static GeometryExpression<?> fromText(String text) {
return geometryOperation(SpatialOps.GEOM_FROM_TEXT, ConstantImpl.create(text));
} | [
"public",
"static",
"GeometryExpression",
"<",
"?",
">",
"fromText",
"(",
"String",
"text",
")",
"{",
"return",
"geometryOperation",
"(",
"SpatialOps",
".",
"GEOM_FROM_TEXT",
",",
"ConstantImpl",
".",
"create",
"(",
"text",
")",
")",
";",
"}"
] | Return a specified ST_Geometry value from Well-Known Text representation (WKT).
@param text WKT form
@return geometry | [
"Return",
"a",
"specified",
"ST_Geometry",
"value",
"from",
"Well",
"-",
"Known",
"Text",
"representation",
"(",
"WKT",
")",
"."
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-spatial/src/main/java/com/querydsl/spatial/GeometryExpressions.java#L44-L46 |
geomajas/geomajas-project-client-gwt2 | common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/impl/DomImpl.java | DomImpl.createElementNS | public Element createElementNS(String ns, String tag) {
"""
<p>
Creates a new DOM element in the given name-space. If the name-space is HTML, a normal element will be created.
</p>
<p>
There is an exception when using Internet Explorer! For Internet Explorer a new element will be created of type
"namespace:ta... | java | public Element createElementNS(String ns, String tag) {
return createElementNS(ns, tag, null);
} | [
"public",
"Element",
"createElementNS",
"(",
"String",
"ns",
",",
"String",
"tag",
")",
"{",
"return",
"createElementNS",
"(",
"ns",
",",
"tag",
",",
"null",
")",
";",
"}"
] | <p>
Creates a new DOM element in the given name-space. If the name-space is HTML, a normal element will be created.
</p>
<p>
There is an exception when using Internet Explorer! For Internet Explorer a new element will be created of type
"namespace:tag".
</p>
@param ns
The name-space to be used in the element creation.... | [
"<p",
">",
"Creates",
"a",
"new",
"DOM",
"element",
"in",
"the",
"given",
"name",
"-",
"space",
".",
"If",
"the",
"name",
"-",
"space",
"is",
"HTML",
"a",
"normal",
"element",
"will",
"be",
"created",
".",
"<",
"/",
"p",
">",
"<p",
">",
"There",
... | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/impl/DomImpl.java#L121-L123 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPath.java | QPath.makeChildPath | public static QPath makeChildPath(final QPath parent, final QPathEntry[] relEntries) {
"""
Make child path using array of QPath entries (relative path). <br>
@param parent
- parent QPath
@param relEntries
- QPathEntry array
@return new QPath
"""
final QPathEntry[] parentEntries = parent.getEntrie... | java | public static QPath makeChildPath(final QPath parent, final QPathEntry[] relEntries)
{
final QPathEntry[] parentEntries = parent.getEntries();
final QPathEntry[] names = new QPathEntry[parentEntries.length + relEntries.length];
int index = 0;
for (QPathEntry name : parentEntries)
na... | [
"public",
"static",
"QPath",
"makeChildPath",
"(",
"final",
"QPath",
"parent",
",",
"final",
"QPathEntry",
"[",
"]",
"relEntries",
")",
"{",
"final",
"QPathEntry",
"[",
"]",
"parentEntries",
"=",
"parent",
".",
"getEntries",
"(",
")",
";",
"final",
"QPathEnt... | Make child path using array of QPath entries (relative path). <br>
@param parent
- parent QPath
@param relEntries
- QPathEntry array
@return new QPath | [
"Make",
"child",
"path",
"using",
"array",
"of",
"QPath",
"entries",
"(",
"relative",
"path",
")",
".",
"<br",
">"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPath.java#L478-L492 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.removeLongLivedPageFlow | public static void removeLongLivedPageFlow( String modulePath, HttpServletRequest request,
ServletContext servletContext ) {
"""
Remove a "long-lived" page flow from the session. Once it is created, a long-lived page flow
is never removed from the session unless thi... | java | public static void removeLongLivedPageFlow( String modulePath, HttpServletRequest request,
ServletContext servletContext )
{
StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
HttpServletRequest unwrappedRequest = unwrapMultipart( ... | [
"public",
"static",
"void",
"removeLongLivedPageFlow",
"(",
"String",
"modulePath",
",",
"HttpServletRequest",
"request",
",",
"ServletContext",
"servletContext",
")",
"{",
"StorageHandler",
"sh",
"=",
"Handlers",
".",
"get",
"(",
"servletContext",
")",
".",
"getSto... | Remove a "long-lived" page flow from the session. Once it is created, a long-lived page flow
is never removed from the session unless this method or {@link PageFlowController#remove} is
called. Navigating to another page flow hides the current long-lived controller, but does not
remove it. | [
"Remove",
"a",
"long",
"-",
"lived",
"page",
"flow",
"from",
"the",
"session",
".",
"Once",
"it",
"is",
"created",
"a",
"long",
"-",
"lived",
"page",
"flow",
"is",
"never",
"removed",
"from",
"the",
"session",
"unless",
"this",
"method",
"or",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L436-L459 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.out2field | public void out2field(Object from, String from_out, Object o) {
"""
Maps a component Out field to an object's field. Both field have the
same name.
@param from the component
@param from_out the component's Out field.
@param o the object
"""
out2field(from, from_out, o, from_out);
} | java | public void out2field(Object from, String from_out, Object o) {
out2field(from, from_out, o, from_out);
} | [
"public",
"void",
"out2field",
"(",
"Object",
"from",
",",
"String",
"from_out",
",",
"Object",
"o",
")",
"{",
"out2field",
"(",
"from",
",",
"from_out",
",",
"o",
",",
"from_out",
")",
";",
"}"
] | Maps a component Out field to an object's field. Both field have the
same name.
@param from the component
@param from_out the component's Out field.
@param o the object | [
"Maps",
"a",
"component",
"Out",
"field",
"to",
"an",
"object",
"s",
"field",
".",
"Both",
"field",
"have",
"the",
"same",
"name",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L230-L232 |
vkostyukov/la4j | src/main/java/org/la4j/Vectors.java | Vectors.mkMinAccumulator | public static VectorAccumulator mkMinAccumulator() {
"""
Makes a minimum vector accumulator that accumulates the minimum across vector elements.
@return a minimum vector accumulator
"""
return new VectorAccumulator() {
private double result = Double.POSITIVE_INFINITY;
@Overr... | java | public static VectorAccumulator mkMinAccumulator() {
return new VectorAccumulator() {
private double result = Double.POSITIVE_INFINITY;
@Override
public void update(int i, double value) {
result = Math.min(result, value);
}
@Override
... | [
"public",
"static",
"VectorAccumulator",
"mkMinAccumulator",
"(",
")",
"{",
"return",
"new",
"VectorAccumulator",
"(",
")",
"{",
"private",
"double",
"result",
"=",
"Double",
".",
"POSITIVE_INFINITY",
";",
"@",
"Override",
"public",
"void",
"update",
"(",
"int",... | Makes a minimum vector accumulator that accumulates the minimum across vector elements.
@return a minimum vector accumulator | [
"Makes",
"a",
"minimum",
"vector",
"accumulator",
"that",
"accumulates",
"the",
"minimum",
"across",
"vector",
"elements",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Vectors.java#L282-L298 |
grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.getArtefact | public GrailsClass getArtefact(String artefactType, String name) {
"""
Retrieves an artefact for the given type and name.
@param artefactType The artefact type as defined by a registered ArtefactHandler
@param name The name of the class
@return A GrailsClass instance or null if none could be found for... | java | public GrailsClass getArtefact(String artefactType, String name) {
ArtefactInfo info = getArtefactInfo(artefactType);
return info == null ? null : info.getGrailsClass(name);
} | [
"public",
"GrailsClass",
"getArtefact",
"(",
"String",
"artefactType",
",",
"String",
"name",
")",
"{",
"ArtefactInfo",
"info",
"=",
"getArtefactInfo",
"(",
"artefactType",
")",
";",
"return",
"info",
"==",
"null",
"?",
"null",
":",
"info",
".",
"getGrailsClas... | Retrieves an artefact for the given type and name.
@param artefactType The artefact type as defined by a registered ArtefactHandler
@param name The name of the class
@return A GrailsClass instance or null if none could be found for the given artefactType and name | [
"Retrieves",
"an",
"artefact",
"for",
"the",
"given",
"type",
"and",
"name",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L464-L467 |
ansell/restlet-utils | src/main/java/com/github/ansell/restletutils/RestletUtilSesameRealm.java | RestletUtilSesameRealm.buildRestletUserFromSparqlResult | protected RestletUtilUser buildRestletUserFromSparqlResult(final String userIdentifier, final BindingSet bindingSet) {
"""
Builds a RestletUtilUser from the data retrieved in a SPARQL result.
@param userIdentifier
The unique identifier of the User.
@param bindingSet
Results of a single user from SPARQL.
@re... | java | protected RestletUtilUser buildRestletUserFromSparqlResult(final String userIdentifier, final BindingSet bindingSet)
{
// log.info("result={}", bindingSet);
String userEmail = bindingSet.getValue("userEmail").stringValue();
// TODO: When hashed, need to unhash here
char[] us... | [
"protected",
"RestletUtilUser",
"buildRestletUserFromSparqlResult",
"(",
"final",
"String",
"userIdentifier",
",",
"final",
"BindingSet",
"bindingSet",
")",
"{",
"// log.info(\"result={}\", bindingSet);",
"String",
"userEmail",
"=",
"bindingSet",
".",
"getValue",
"(",
"\"us... | Builds a RestletUtilUser from the data retrieved in a SPARQL result.
@param userIdentifier
The unique identifier of the User.
@param bindingSet
Results of a single user from SPARQL.
@return A RestletUtilUser account. | [
"Builds",
"a",
"RestletUtilUser",
"from",
"the",
"data",
"retrieved",
"in",
"a",
"SPARQL",
"result",
"."
] | train | https://github.com/ansell/restlet-utils/blob/6c39a3e91aa8295936af1dbfccd6ba27230c40a9/src/main/java/com/github/ansell/restletutils/RestletUtilSesameRealm.java#L596-L619 |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/aaf/hl/Question.java | Question.deriveNs | public Result<NsDAO.Data> deriveNs(AuthzTrans trans, String child) {
"""
Derive NS
Given a Child Namespace, figure out what the best Namespace parent is.
For instance, if in the NS table, the parent "com.att" exists, but not
"com.att.child" or "com.att.a.b.c", then passing in either
"com.att.child" or "com... | java | public Result<NsDAO.Data> deriveNs(AuthzTrans trans, String child) {
Result<List<NsDAO.Data>> r = nsDAO.read(trans, child);
if (r.isOKhasData()) {
return Result.ok(r.value.get(0));
} else {
int dot = child == null ? -1 : child.lastIndexOf('.');
if (dot < 0) {
return Result.err(Status.ERR_NsNotFoun... | [
"public",
"Result",
"<",
"NsDAO",
".",
"Data",
">",
"deriveNs",
"(",
"AuthzTrans",
"trans",
",",
"String",
"child",
")",
"{",
"Result",
"<",
"List",
"<",
"NsDAO",
".",
"Data",
">>",
"r",
"=",
"nsDAO",
".",
"read",
"(",
"trans",
",",
"child",
")",
"... | Derive NS
Given a Child Namespace, figure out what the best Namespace parent is.
For instance, if in the NS table, the parent "com.att" exists, but not
"com.att.child" or "com.att.a.b.c", then passing in either
"com.att.child" or "com.att.a.b.c" will return "com.att"
Uses recursive search on Cached DAO data
@param ... | [
"Derive",
"NS"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/aaf/hl/Question.java#L341-L355 |
podio/podio-java | src/main/java/com/podio/stream/StreamAPI.java | StreamAPI.getGlobalStreamV2 | public List<StreamObjectV2> getGlobalStreamV2(Integer limit,
Integer offset, DateTime dateFrom, DateTime dateTo) {
"""
Returns the global stream. The types of objects in the stream can be
either "item", "status" or "task".
@param limit
How many objects should be returned, defaults to 10
@param offset
How... | java | public List<StreamObjectV2> getGlobalStreamV2(Integer limit,
Integer offset, DateTime dateFrom, DateTime dateTo) {
return getStreamV2("/stream/v2/", limit, offset, dateFrom, dateTo);
} | [
"public",
"List",
"<",
"StreamObjectV2",
">",
"getGlobalStreamV2",
"(",
"Integer",
"limit",
",",
"Integer",
"offset",
",",
"DateTime",
"dateFrom",
",",
"DateTime",
"dateTo",
")",
"{",
"return",
"getStreamV2",
"(",
"\"/stream/v2/\"",
",",
"limit",
",",
"offset",
... | Returns the global stream. The types of objects in the stream can be
either "item", "status" or "task".
@param limit
How many objects should be returned, defaults to 10
@param offset
How far should the objects be offset, defaults to 0
@param dateFrom
The date and time that all events should be after, defaults to
no li... | [
"Returns",
"the",
"global",
"stream",
".",
"The",
"types",
"of",
"objects",
"in",
"the",
"stream",
"can",
"be",
"either",
"item",
"status",
"or",
"task",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/stream/StreamAPI.java#L91-L94 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/SliderThumbPainter.java | SliderThumbPainter.paintContinuous | private void paintContinuous(Graphics2D g, JComponent c, int width, int height) {
"""
DOCUMENT ME!
@param g DOCUMENT ME!
@param c DOCUMENT ME!
@param width DOCUMENT ME!
@param height DOCUMENT ME!
"""
boolean useToolBarColors = isInToolBar(c);
Shape s;
if (isFocused) ... | java | private void paintContinuous(Graphics2D g, JComponent c, int width, int height) {
boolean useToolBarColors = isInToolBar(c);
Shape s;
if (isFocused) {
s = shapeGenerator.createSliderThumbContinuous(0, 1, width);
g.setPaint(getFocusPaint(s, FocusType.OUTER_FOCUS, useToo... | [
"private",
"void",
"paintContinuous",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"boolean",
"useToolBarColors",
"=",
"isInToolBar",
"(",
"c",
")",
";",
"Shape",
"s",
";",
"if",
"(",
"isFocused",
"... | DOCUMENT ME!
@param g DOCUMENT ME!
@param c DOCUMENT ME!
@param width DOCUMENT ME!
@param height DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/SliderThumbPainter.java#L199-L224 |
wildfly/wildfly-build-tools | provisioning/src/main/java/org/wildfly/build/provisioning/model/ServerProvisioningDescriptionModelParser12.java | ServerProvisioningDescriptionModelParser12.readElement | @Override
public void readElement(final XMLExtendedStreamReader reader, final ServerProvisioningDescription result) throws XMLStreamException {
"""
/*
we only override this method, for now only change new EXTRACT_SCHEMAS_GROUPS attribute
"""
for (int i = 0; i < reader.getAttributeCount(); i++) {
... | java | @Override
public void readElement(final XMLExtendedStreamReader reader, final ServerProvisioningDescription result) throws XMLStreamException {
for (int i = 0; i < reader.getAttributeCount(); i++) {
final Attribute attribute = Attribute.of(reader.getAttributeName(i));
switch (attribu... | [
"@",
"Override",
"public",
"void",
"readElement",
"(",
"final",
"XMLExtendedStreamReader",
"reader",
",",
"final",
"ServerProvisioningDescription",
"result",
")",
"throws",
"XMLStreamException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"reader",
"."... | /*
we only override this method, for now only change new EXTRACT_SCHEMAS_GROUPS attribute | [
"/",
"*",
"we",
"only",
"override",
"this",
"method",
"for",
"now",
"only",
"change",
"new",
"EXTRACT_SCHEMAS_GROUPS",
"attribute"
] | train | https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/provisioning/model/ServerProvisioningDescriptionModelParser12.java#L43-L95 |
trello/RxLifecycle | rxlifecycle-android/src/main/java/com/trello/rxlifecycle3/android/RxLifecycleAndroid.java | RxLifecycleAndroid.bindActivity | @NonNull
@CheckResult
public static <T> LifecycleTransformer<T> bindActivity(@NonNull final Observable<ActivityEvent> lifecycle) {
"""
Binds the given source to an Activity lifecycle.
<p>
This helper automatically determines (based on the lifecycle sequence itself) when the source
should stop emitting i... | java | @NonNull
@CheckResult
public static <T> LifecycleTransformer<T> bindActivity(@NonNull final Observable<ActivityEvent> lifecycle) {
return bind(lifecycle, ACTIVITY_LIFECYCLE);
} | [
"@",
"NonNull",
"@",
"CheckResult",
"public",
"static",
"<",
"T",
">",
"LifecycleTransformer",
"<",
"T",
">",
"bindActivity",
"(",
"@",
"NonNull",
"final",
"Observable",
"<",
"ActivityEvent",
">",
"lifecycle",
")",
"{",
"return",
"bind",
"(",
"lifecycle",
",... | Binds the given source to an Activity lifecycle.
<p>
This helper automatically determines (based on the lifecycle sequence itself) when the source
should stop emitting items. In the case that the lifecycle sequence is in the
creation phase (CREATE, START, etc) it will choose the equivalent destructive phase (DESTROY,
S... | [
"Binds",
"the",
"given",
"source",
"to",
"an",
"Activity",
"lifecycle",
".",
"<p",
">",
"This",
"helper",
"automatically",
"determines",
"(",
"based",
"on",
"the",
"lifecycle",
"sequence",
"itself",
")",
"when",
"the",
"source",
"should",
"stop",
"emitting",
... | train | https://github.com/trello/RxLifecycle/blob/b0a9eb54867f0d72b9614d24091c59dfd4b2d5c1/rxlifecycle-android/src/main/java/com/trello/rxlifecycle3/android/RxLifecycleAndroid.java#L51-L55 |
snowtide/lucene-pdf | src/java/com/snowtide/pdf/lucene/LucenePDFDocumentFactory.java | LucenePDFDocumentFactory.buildPDFDocument | public static Document buildPDFDocument (com.snowtide.pdf.Document pdf) throws IOException {
"""
Creates a new Lucene Document instance using the PDF text and metadata provided by the PDFxStream
Document using a default {@link LucenePDFConfiguration#LucenePDFConfiguration()} to control Lucene field names,
etc.
... | java | public static Document buildPDFDocument (com.snowtide.pdf.Document pdf) throws IOException {
return buildPDFDocument(pdf, DEFAULT_CONFIG);
} | [
"public",
"static",
"Document",
"buildPDFDocument",
"(",
"com",
".",
"snowtide",
".",
"pdf",
".",
"Document",
"pdf",
")",
"throws",
"IOException",
"{",
"return",
"buildPDFDocument",
"(",
"pdf",
",",
"DEFAULT_CONFIG",
")",
";",
"}"
] | Creates a new Lucene Document instance using the PDF text and metadata provided by the PDFxStream
Document using a default {@link LucenePDFConfiguration#LucenePDFConfiguration()} to control Lucene field names,
etc. | [
"Creates",
"a",
"new",
"Lucene",
"Document",
"instance",
"using",
"the",
"PDF",
"text",
"and",
"metadata",
"provided",
"by",
"the",
"PDFxStream",
"Document",
"using",
"a",
"default",
"{"
] | train | https://github.com/snowtide/lucene-pdf/blob/1d97a877912bcfb354d3e8bff8275c92397db133/src/java/com/snowtide/pdf/lucene/LucenePDFDocumentFactory.java#L87-L89 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.iamin | public SDVariable iamin(String name, SDVariable in, int... dimensions) {
"""
Index of the min absolute value: argmin(abs(in))
@see SameDiff#argmin(String, SDVariable, boolean, int...)
"""
return iamin(name, in, false, dimensions);
} | java | public SDVariable iamin(String name, SDVariable in, int... dimensions) {
return iamin(name, in, false, dimensions);
} | [
"public",
"SDVariable",
"iamin",
"(",
"String",
"name",
",",
"SDVariable",
"in",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"iamin",
"(",
"name",
",",
"in",
",",
"false",
",",
"dimensions",
")",
";",
"}"
] | Index of the min absolute value: argmin(abs(in))
@see SameDiff#argmin(String, SDVariable, boolean, int...) | [
"Index",
"of",
"the",
"min",
"absolute",
"value",
":",
"argmin",
"(",
"abs",
"(",
"in",
"))"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L1250-L1252 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/UnImplNode.java | UnImplNode.getAttributeNS | public String getAttributeNS(String namespaceURI, String localName) {
"""
Unimplemented. See org.w3c.dom.Element
@param namespaceURI Namespace URI of attribute node to get
@param localName Local part of qualified name of attribute node to get
@return null
"""
error(XMLErrorResources.ER_FUNCTION_NOT... | java | public String getAttributeNS(String namespaceURI, String localName)
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNS not supported!");
return null;
} | [
"public",
"String",
"getAttributeNS",
"(",
"String",
"namespaceURI",
",",
"String",
"localName",
")",
"{",
"error",
"(",
"XMLErrorResources",
".",
"ER_FUNCTION_NOT_SUPPORTED",
")",
";",
"//\"getAttributeNS not supported!\");",
"return",
"null",
";",
"}"
] | Unimplemented. See org.w3c.dom.Element
@param namespaceURI Namespace URI of attribute node to get
@param localName Local part of qualified name of attribute node to get
@return null | [
"Unimplemented",
".",
"See",
"org",
".",
"w3c",
".",
"dom",
".",
"Element"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/UnImplNode.java#L505-L511 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createNiceMock | public static synchronized <T> T createNiceMock(Class<T> type) {
"""
Creates a nice mock object that supports mocking of final and native
methods.
@param <T> the type of the mock object
@param type the type of the mock object
@return the mock object.
"""
return doMock(type, false, new NiceMockSt... | java | public static synchronized <T> T createNiceMock(Class<T> type) {
return doMock(type, false, new NiceMockStrategy(), null, (Method[]) null);
} | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"createNiceMock",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"doMock",
"(",
"type",
",",
"false",
",",
"new",
"NiceMockStrategy",
"(",
")",
",",
"null",
",",
"(",
"Method",
"[",
"]... | Creates a nice mock object that supports mocking of final and native
methods.
@param <T> the type of the mock object
@param type the type of the mock object
@return the mock object. | [
"Creates",
"a",
"nice",
"mock",
"object",
"that",
"supports",
"mocking",
"of",
"final",
"and",
"native",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L175-L177 |
tango-controls/JTango | server/src/main/java/org/tango/server/servant/CommandGetter.java | CommandGetter.getCommand | public static CommandImpl getCommand(final String name, final List<CommandImpl> commandList) throws DevFailed {
"""
Get a command
@param name
@return The command
@throws DevFailed
"""
CommandImpl result = null;
for (final CommandImpl command : commandList) {
if (command.getN... | java | public static CommandImpl getCommand(final String name, final List<CommandImpl> commandList) throws DevFailed {
CommandImpl result = null;
for (final CommandImpl command : commandList) {
if (command.getName().equalsIgnoreCase(name)) {
result = command;
br... | [
"public",
"static",
"CommandImpl",
"getCommand",
"(",
"final",
"String",
"name",
",",
"final",
"List",
"<",
"CommandImpl",
">",
"commandList",
")",
"throws",
"DevFailed",
"{",
"CommandImpl",
"result",
"=",
"null",
";",
"for",
"(",
"final",
"CommandImpl",
"comm... | Get a command
@param name
@return The command
@throws DevFailed | [
"Get",
"a",
"command"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/CommandGetter.java#L44-L56 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerRpcClient.java | CircuitBreakerRpcClient.newDecorator | public static Function<Client<RpcRequest, RpcResponse>, CircuitBreakerRpcClient>
newDecorator(CircuitBreakerMapping mapping, CircuitBreakerStrategyWithContent<RpcResponse> strategy) {
"""
Creates a new decorator with the specified {@link CircuitBreakerMapping} and
{@link CircuitBreakerStrategy}.
<p>Since {... | java | public static Function<Client<RpcRequest, RpcResponse>, CircuitBreakerRpcClient>
newDecorator(CircuitBreakerMapping mapping, CircuitBreakerStrategyWithContent<RpcResponse> strategy) {
return delegate -> new CircuitBreakerRpcClient(delegate, mapping, strategy);
} | [
"public",
"static",
"Function",
"<",
"Client",
"<",
"RpcRequest",
",",
"RpcResponse",
">",
",",
"CircuitBreakerRpcClient",
">",
"newDecorator",
"(",
"CircuitBreakerMapping",
"mapping",
",",
"CircuitBreakerStrategyWithContent",
"<",
"RpcResponse",
">",
"strategy",
")",
... | Creates a new decorator with the specified {@link CircuitBreakerMapping} and
{@link CircuitBreakerStrategy}.
<p>Since {@link CircuitBreaker} is a unit of failure detection, don't reuse the same instance for
unrelated services. | [
"Creates",
"a",
"new",
"decorator",
"with",
"the",
"specified",
"{",
"@link",
"CircuitBreakerMapping",
"}",
"and",
"{",
"@link",
"CircuitBreakerStrategy",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerRpcClient.java#L54-L57 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java | Util.getZxidFromName | public static long getZxidFromName(String name, String prefix) {
"""
Extracts zxid from the file name. The file name should have been created
using one of the {@link makeLogName} or {@link makeSnapshotName}.
@param name the file name to parse
@param prefix the file name prefix (snapshot or log)
@return zxid
... | java | public static long getZxidFromName(String name, String prefix) {
long zxid = -1;
String nameParts[] = name.split("\\.");
if (nameParts.length == 2 && nameParts[0].equals(prefix)) {
try {
zxid = Long.parseLong(nameParts[1], 16);
} catch (NumberFormatExcepti... | [
"public",
"static",
"long",
"getZxidFromName",
"(",
"String",
"name",
",",
"String",
"prefix",
")",
"{",
"long",
"zxid",
"=",
"-",
"1",
";",
"String",
"nameParts",
"[",
"]",
"=",
"name",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"if",
"(",
"nameParts",... | Extracts zxid from the file name. The file name should have been created
using one of the {@link makeLogName} or {@link makeSnapshotName}.
@param name the file name to parse
@param prefix the file name prefix (snapshot or log)
@return zxid | [
"Extracts",
"zxid",
"from",
"the",
"file",
"name",
".",
"The",
"file",
"name",
"should",
"have",
"been",
"created",
"using",
"one",
"of",
"the",
"{",
"@link",
"makeLogName",
"}",
"or",
"{",
"@link",
"makeSnapshotName",
"}",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java#L139-L149 |
knowm/Sundial | src/main/java/org/knowm/sundial/SundialJobScheduler.java | SundialJobScheduler.addJob | public static void addJob(
String jobName, String jobClassName, Map<String, Object> params, boolean isConcurrencyAllowed)
throws SundialSchedulerException {
"""
Adds a Job to the scheduler. Replaces a matching existing Job.
@param jobName
@param jobClassName
@param params Set this null if there ... | java | public static void addJob(
String jobName, String jobClassName, Map<String, Object> params, boolean isConcurrencyAllowed)
throws SundialSchedulerException {
try {
addJob(
jobName,
getScheduler().getCascadingClassLoadHelper().loadClass(jobClassName),
params,
... | [
"public",
"static",
"void",
"addJob",
"(",
"String",
"jobName",
",",
"String",
"jobClassName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"boolean",
"isConcurrencyAllowed",
")",
"throws",
"SundialSchedulerException",
"{",
"try",
"{",
"addJob",... | Adds a Job to the scheduler. Replaces a matching existing Job.
@param jobName
@param jobClassName
@param params Set this null if there are no params
@param isConcurrencyAllowed | [
"Adds",
"a",
"Job",
"to",
"the",
"scheduler",
".",
"Replaces",
"a",
"matching",
"existing",
"Job",
"."
] | train | https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L251-L264 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java | CommerceNotificationQueueEntryPersistenceImpl.findBySent | @Override
public List<CommerceNotificationQueueEntry> findBySent(boolean sent) {
"""
Returns all the commerce notification queue entries where sent = ?.
@param sent the sent
@return the matching commerce notification queue entries
"""
return findBySent(sent, QueryUtil.ALL_POS, QueryUtil.ALL_POS, nul... | java | @Override
public List<CommerceNotificationQueueEntry> findBySent(boolean sent) {
return findBySent(sent, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationQueueEntry",
">",
"findBySent",
"(",
"boolean",
"sent",
")",
"{",
"return",
"findBySent",
"(",
"sent",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"... | Returns all the commerce notification queue entries where sent = ?.
@param sent the sent
@return the matching commerce notification queue entries | [
"Returns",
"all",
"the",
"commerce",
"notification",
"queue",
"entries",
"where",
"sent",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java#L1179-L1182 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/ant/DdlUtilsDataHandling.java | DdlUtilsDataHandling.getInsertDataSql | public void getInsertDataSql(Reader input, Writer output) throws DataTaskException {
"""
Returns the sql necessary to add the data XML contained in the given input stream.
Note that the data is expected to match the repository metadata (not the table schema).
Also note that you should not use the reader after pa... | java | public void getInsertDataSql(Reader input, Writer output) throws DataTaskException
{
try
{
DataSet set = (DataSet)_digester.parse(input);
set.createInsertionSql(_dbModel, _platform, output);
}
catch (Exception ex)
{
if (ex instan... | [
"public",
"void",
"getInsertDataSql",
"(",
"Reader",
"input",
",",
"Writer",
"output",
")",
"throws",
"DataTaskException",
"{",
"try",
"{",
"DataSet",
"set",
"=",
"(",
"DataSet",
")",
"_digester",
".",
"parse",
"(",
"input",
")",
";",
"set",
".",
"createIn... | Returns the sql necessary to add the data XML contained in the given input stream.
Note that the data is expected to match the repository metadata (not the table schema).
Also note that you should not use the reader after passing it to this method except closing
it (which is not done automatically).
@param input A re... | [
"Returns",
"the",
"sql",
"necessary",
"to",
"add",
"the",
"data",
"XML",
"contained",
"in",
"the",
"given",
"input",
"stream",
".",
"Note",
"that",
"the",
"data",
"is",
"expected",
"to",
"match",
"the",
"repository",
"metadata",
"(",
"not",
"the",
"table",... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/ant/DdlUtilsDataHandling.java#L227-L247 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.