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 |
|---|---|---|---|---|---|---|---|---|---|---|
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/swift/SwiftInputStream.java | SwiftInputStream.closeStream | private void closeStream(String msg, long length) {
"""
close the stream
@param msg close message
@param length length
"""
if (wrappedStream != null) {
long remaining = remainingInCurrentRequest();
boolean shouldAbort = remaining > readahead;
if (!shouldAbort) {
try {
... | java | private void closeStream(String msg, long length) {
if (wrappedStream != null) {
long remaining = remainingInCurrentRequest();
boolean shouldAbort = remaining > readahead;
if (!shouldAbort) {
try {
wrappedStream.close();
} catch (IOException e) {
LOG.debug("When... | [
"private",
"void",
"closeStream",
"(",
"String",
"msg",
",",
"long",
"length",
")",
"{",
"if",
"(",
"wrappedStream",
"!=",
"null",
")",
"{",
"long",
"remaining",
"=",
"remainingInCurrentRequest",
"(",
")",
";",
"boolean",
"shouldAbort",
"=",
"remaining",
">"... | close the stream
@param msg close message
@param length length | [
"close",
"the",
"stream"
] | train | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/swift/SwiftInputStream.java#L332-L352 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/UserService.java | UserService.resetExpiredPassword | public void resetExpiredPassword(ModeledUser user, Credentials credentials)
throws GuacamoleException {
"""
Resets the password of the given user to the new password specified via
the "new-password" and "confirm-new-password" parameters from the
provided credentials. If these parameters are missing o... | java | public void resetExpiredPassword(ModeledUser user, Credentials credentials)
throws GuacamoleException {
UserModel userModel = user.getModel();
// Get username
String username = user.getIdentifier();
// Pull new password from HTTP request
HttpServletRequest request ... | [
"public",
"void",
"resetExpiredPassword",
"(",
"ModeledUser",
"user",
",",
"Credentials",
"credentials",
")",
"throws",
"GuacamoleException",
"{",
"UserModel",
"userModel",
"=",
"user",
".",
"getModel",
"(",
")",
";",
"// Get username",
"String",
"username",
"=",
... | Resets the password of the given user to the new password specified via
the "new-password" and "confirm-new-password" parameters from the
provided credentials. If these parameters are missing or invalid,
additional credentials will be requested.
@param user
The user whose password should be reset.
@param credentials
... | [
"Resets",
"the",
"password",
"of",
"the",
"given",
"user",
"to",
"the",
"new",
"password",
"specified",
"via",
"the",
"new",
"-",
"password",
"and",
"confirm",
"-",
"new",
"-",
"password",
"parameters",
"from",
"the",
"provided",
"credentials",
".",
"If",
... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/UserService.java#L481-L521 |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java | Jsr250Utils.getMethodsWithAnnotation | private static List<Method> getMethodsWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotation, Logger log) {
"""
Locates all methods annotated with a given annotation that are declared directly in the class passed in alphabetical order.
@param clazz
@param annotation
@param log
@return
"""
... | java | private static List<Method> getMethodsWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotation, Logger log) {
List<Method> annotatedMethods = new ArrayList<Method>();
Method classMethods[] = clazz.getDeclaredMethods();
for(Method classMethod : classMethods) {
if(classMethod.isAnnotationPr... | [
"private",
"static",
"List",
"<",
"Method",
">",
"getMethodsWithAnnotation",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
",",
"Logger",
"log",
")",
"{",
"List",
"<",
"Method",
">",
"annotatedMet... | Locates all methods annotated with a given annotation that are declared directly in the class passed in alphabetical order.
@param clazz
@param annotation
@param log
@return | [
"Locates",
"all",
"methods",
"annotated",
"with",
"a",
"given",
"annotation",
"that",
"are",
"declared",
"directly",
"in",
"the",
"class",
"passed",
"in",
"alphabetical",
"order",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java#L209-L227 |
menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java | NettyUtils.writeStrings | public static ChannelBuffer writeStrings(Charset charset, String... msgs) {
"""
Writes multiple strings to a channelBuffer with the length of the string
preceding its content. So if there are two string <code>Hello</code> and
<code>World</code> then the channel buffer returned would contain <Length
of Hello><He... | java | public static ChannelBuffer writeStrings(Charset charset, String... msgs)
{
ChannelBuffer buffer = null;
for (String msg : msgs)
{
if (null == buffer)
{
buffer = writeString(msg, charset);
}
else
{
ChannelBuffer theBuffer = writeString(msg,charset);
if(null != theBuffer)
{
buf... | [
"public",
"static",
"ChannelBuffer",
"writeStrings",
"(",
"Charset",
"charset",
",",
"String",
"...",
"msgs",
")",
"{",
"ChannelBuffer",
"buffer",
"=",
"null",
";",
"for",
"(",
"String",
"msg",
":",
"msgs",
")",
"{",
"if",
"(",
"null",
"==",
"buffer",
")... | Writes multiple strings to a channelBuffer with the length of the string
preceding its content. So if there are two string <code>Hello</code> and
<code>World</code> then the channel buffer returned would contain <Length
of Hello><Hello as appropriate charset binary><Length of world><World as
UTF-8 binary>
@param chars... | [
"Writes",
"multiple",
"strings",
"to",
"a",
"channelBuffer",
"with",
"the",
"length",
"of",
"the",
"string",
"preceding",
"its",
"content",
".",
"So",
"if",
"there",
"are",
"two",
"string",
"<code",
">",
"Hello<",
"/",
"code",
">",
"and",
"<code",
">",
"... | train | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java#L221-L240 |
voldemort/voldemort | src/java/voldemort/utils/PartitionBalanceUtils.java | PartitionBalanceUtils.analyzeInvalidMetadataRate | public static String analyzeInvalidMetadataRate(final Cluster currentCluster,
List<StoreDefinition> currentStoreDefs,
final Cluster finalCluster,
List<StoreDefiniti... | java | public static String analyzeInvalidMetadataRate(final Cluster currentCluster,
List<StoreDefinition> currentStoreDefs,
final Cluster finalCluster,
List<StoreDefiniti... | [
"public",
"static",
"String",
"analyzeInvalidMetadataRate",
"(",
"final",
"Cluster",
"currentCluster",
",",
"List",
"<",
"StoreDefinition",
">",
"currentStoreDefs",
",",
"final",
"Cluster",
"finalCluster",
",",
"List",
"<",
"StoreDefinition",
">",
"finalStoreDefs",
")... | Compares current cluster with final cluster. Uses pertinent store defs
for each cluster to determine if a node that hosts a zone-primary in the
current cluster will no longer host any zone-nary in the final cluster.
This check is the precondition for a server returning an invalid metadata
exception to a client on a nor... | [
"Compares",
"current",
"cluster",
"with",
"final",
"cluster",
".",
"Uses",
"pertinent",
"store",
"defs",
"for",
"each",
"cluster",
"to",
"determine",
"if",
"a",
"node",
"that",
"hosts",
"a",
"zone",
"-",
"primary",
"in",
"the",
"current",
"cluster",
"will",
... | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L320-L369 |
casmi/casmi | src/main/java/casmi/graphics/element/Element.java | Element.setPosition | public void setPosition(double x, double y, double z) {
"""
Sets the position of the Element in 3D.
@param x
x-coordinate
@param y
y-coordinate
@param z
z-coordinate
"""
this.x = x;
this.y = y;
this.z = z;
} | java | public void setPosition(double x, double y, double z) {
this.x = x;
this.y = y;
this.z = z;
} | [
"public",
"void",
"setPosition",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"this",
".",
"x",
"=",
"x",
";",
"this",
".",
"y",
"=",
"y",
";",
"this",
".",
"z",
"=",
"z",
";",
"}"
] | Sets the position of the Element in 3D.
@param x
x-coordinate
@param y
y-coordinate
@param z
z-coordinate | [
"Sets",
"the",
"position",
"of",
"the",
"Element",
"in",
"3D",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Element.java#L436-L440 |
apache/incubator-heron | storm-compatibility/src/java/org/apache/storm/utils/ConfigUtils.java | ConfigUtils.translateComponentConfig | @SuppressWarnings( {
"""
Translate storm config to heron config for components
@param stormConfig the storm config
@return a heron config
""""rawtypes", "unchecked"})
public static Config translateComponentConfig(Map stormConfig) {
Config heronConfig;
if (stormConfig != null) {
heronConfig = ... | java | @SuppressWarnings({"rawtypes", "unchecked"})
public static Config translateComponentConfig(Map stormConfig) {
Config heronConfig;
if (stormConfig != null) {
heronConfig = new Config((Map<String, Object>) stormConfig);
} else {
heronConfig = new Config();
}
doStormTranslation(heronConf... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"Config",
"translateComponentConfig",
"(",
"Map",
"stormConfig",
")",
"{",
"Config",
"heronConfig",
";",
"if",
"(",
"stormConfig",
"!=",
"null",
")",
"{",
"h... | Translate storm config to heron config for components
@param stormConfig the storm config
@return a heron config | [
"Translate",
"storm",
"config",
"to",
"heron",
"config",
"for",
"components"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/storm-compatibility/src/java/org/apache/storm/utils/ConfigUtils.java#L65-L77 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/HibernateSession.java | HibernateSession.deleteAll | public long deleteAll(final QueryableCriteria criteria) {
"""
Deletes all objects matching the given criteria.
@param criteria The criteria
@return The total number of records deleted
"""
return getHibernateTemplate().execute((GrailsHibernateTemplate.HibernateCallback<Integer>) session -> {
... | java | public long deleteAll(final QueryableCriteria criteria) {
return getHibernateTemplate().execute((GrailsHibernateTemplate.HibernateCallback<Integer>) session -> {
JpaQueryBuilder builder = new JpaQueryBuilder(criteria);
builder.setConversionService(getMappingContext().getConversionService... | [
"public",
"long",
"deleteAll",
"(",
"final",
"QueryableCriteria",
"criteria",
")",
"{",
"return",
"getHibernateTemplate",
"(",
")",
".",
"execute",
"(",
"(",
"GrailsHibernateTemplate",
".",
"HibernateCallback",
"<",
"Integer",
">",
")",
"session",
"->",
"{",
"Jp... | Deletes all objects matching the given criteria.
@param criteria The criteria
@return The total number of records deleted | [
"Deletes",
"all",
"objects",
"matching",
"the",
"given",
"criteria",
"."
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/HibernateSession.java#L91-L115 |
aragozin/jvm-tools | hprof-heap/src/main/java/org/netbeans/lib/profiler/heap/HeapFactory.java | HeapFactory.createHeap | public static Heap createHeap(File heapDump, int segment)
throws FileNotFoundException, IOException {
"""
this factory method creates {@link Heap} from a memory dump file in Hprof format.
If the memory dump file contains more than one dump, parameter segment is used to
select particula... | java | public static Heap createHeap(File heapDump, int segment)
throws FileNotFoundException, IOException {
return new HprofHeap(createBuffer(heapDump, DEFAULT_BUFFER), segment);
} | [
"public",
"static",
"Heap",
"createHeap",
"(",
"File",
"heapDump",
",",
"int",
"segment",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"new",
"HprofHeap",
"(",
"createBuffer",
"(",
"heapDump",
",",
"DEFAULT_BUFFER",
")",
",",
"segme... | this factory method creates {@link Heap} from a memory dump file in Hprof format.
If the memory dump file contains more than one dump, parameter segment is used to
select particular dump.
<br>
<b>This implementation is using temporary disk files for building auxiliary indexes</b>
<br>
Speed: slow
@return implementation... | [
"this",
"factory",
"method",
"creates",
"{"
] | train | https://github.com/aragozin/jvm-tools/blob/d3a4d0c6a47fb9317f274988569655f30dcd2f76/hprof-heap/src/main/java/org/netbeans/lib/profiler/heap/HeapFactory.java#L121-L124 |
derari/cthul | xml/src/main/java/org/cthul/resolve/ResolvingException.java | ResolvingException.throwIf | public <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable>
RuntimeException throwIf(Class<T1> t1, Class<T2> t2, Class<T3> t3, Class<T4> t4)
throws T1, T2, T3, T4 {
"""
Throws the {@linkplain #getResolvingCause() cause} if it is one of the
sp... | java | public <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable>
RuntimeException throwIf(Class<T1> t1, Class<T2> t2, Class<T3> t3, Class<T4> t4)
throws T1, T2, T3, T4 {
Throwable c = getResolvingCause();
if (t1 != null && t1.isInstanc... | [
"public",
"<",
"T1",
"extends",
"Throwable",
",",
"T2",
"extends",
"Throwable",
",",
"T3",
"extends",
"Throwable",
",",
"T4",
"extends",
"Throwable",
">",
"RuntimeException",
"throwIf",
"(",
"Class",
"<",
"T1",
">",
"t1",
",",
"Class",
"<",
"T2",
">",
"t... | Throws the {@linkplain #getResolvingCause() cause} if it is one of the
specified types, otherwise returns a
{@linkplain #asRuntimeException() runtime exception}.
@param <T1>
@param <T2>
@param <T3>
@param <T4>
@param t1
@param t2
@param t3
@param t4
@return runtime exception
@throws T1
@throws T2
@throws T3
@throws T4 | [
"Throws",
"the",
"{"
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/xml/src/main/java/org/cthul/resolve/ResolvingException.java#L290-L310 |
ReactiveX/RxApacheHttp | src/main/java/rx/apache/http/ObservableHttp.java | ObservableHttp.createRequest | public static ObservableHttp<ObservableHttpResponse> createRequest(final HttpAsyncRequestProducer requestProducer, final HttpAsyncClient client) {
"""
Execute request using {@link HttpAsyncRequestProducer} to define HTTP Method, URI and payload (if applicable).
<p>
If the response is chunked (or flushed progress... | java | public static ObservableHttp<ObservableHttpResponse> createRequest(final HttpAsyncRequestProducer requestProducer, final HttpAsyncClient client) {
return createRequest(requestProducer, client, new BasicHttpContext());
} | [
"public",
"static",
"ObservableHttp",
"<",
"ObservableHttpResponse",
">",
"createRequest",
"(",
"final",
"HttpAsyncRequestProducer",
"requestProducer",
",",
"final",
"HttpAsyncClient",
"client",
")",
"{",
"return",
"createRequest",
"(",
"requestProducer",
",",
"client",
... | Execute request using {@link HttpAsyncRequestProducer} to define HTTP Method, URI and payload (if applicable).
<p>
If the response is chunked (or flushed progressively such as with <i>text/event-stream</i> <a href="http://www.w3.org/TR/2009/WD-eventsource-20091029/">Server-Sent Events</a>) this will call
{@link Observe... | [
"Execute",
"request",
"using",
"{",
"@link",
"HttpAsyncRequestProducer",
"}",
"to",
"define",
"HTTP",
"Method",
"URI",
"and",
"payload",
"(",
"if",
"applicable",
")",
".",
"<p",
">",
"If",
"the",
"response",
"is",
"chunked",
"(",
"or",
"flushed",
"progressiv... | train | https://github.com/ReactiveX/RxApacheHttp/blob/7494169cdc1199f11ca9744f18c28e6fcb694a6e/src/main/java/rx/apache/http/ObservableHttp.java#L138-L140 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfLayer.java | PdfLayer.setPrint | public void setPrint(String subtype, boolean printstate) {
"""
Specifies that the content in this group is intended for
use in printing
@param subtype a name specifying the kind of content controlled by the group;
for example, <B>Trapping</B>, <B>PrintersMarks</B> and <B>Watermark</B>
@param printstate indicat... | java | public void setPrint(String subtype, boolean printstate) {
PdfDictionary usage = getUsage();
PdfDictionary dic = new PdfDictionary();
dic.put(PdfName.SUBTYPE, new PdfName(subtype));
dic.put(PdfName.PRINTSTATE, printstate ? PdfName.ON : PdfName.OFF);
usage.put(PdfName.PRINT, dic);... | [
"public",
"void",
"setPrint",
"(",
"String",
"subtype",
",",
"boolean",
"printstate",
")",
"{",
"PdfDictionary",
"usage",
"=",
"getUsage",
"(",
")",
";",
"PdfDictionary",
"dic",
"=",
"new",
"PdfDictionary",
"(",
")",
";",
"dic",
".",
"put",
"(",
"PdfName",... | Specifies that the content in this group is intended for
use in printing
@param subtype a name specifying the kind of content controlled by the group;
for example, <B>Trapping</B>, <B>PrintersMarks</B> and <B>Watermark</B>
@param printstate indicates that the group should be
set to that state when the document is print... | [
"Specifies",
"that",
"the",
"content",
"in",
"this",
"group",
"is",
"intended",
"for",
"use",
"in",
"printing"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfLayer.java#L274-L280 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/ServerPrepareStatementCache.java | ServerPrepareStatementCache.put | public synchronized ServerPrepareResult put(String key, ServerPrepareResult result) {
"""
Associates the specified value with the specified key in this map. If the map previously
contained a mapping for the key, the existing cached prepared result shared counter will be
incremented.
@param key key
@param ... | java | public synchronized ServerPrepareResult put(String key, ServerPrepareResult result) {
ServerPrepareResult cachedServerPrepareResult = super.get(key);
//if there is already some cached data (and not been deallocate), return existing cached data
if (cachedServerPrepareResult != null && cachedServerPrepareResu... | [
"public",
"synchronized",
"ServerPrepareResult",
"put",
"(",
"String",
"key",
",",
"ServerPrepareResult",
"result",
")",
"{",
"ServerPrepareResult",
"cachedServerPrepareResult",
"=",
"super",
".",
"get",
"(",
"key",
")",
";",
"//if there is already some cached data (and n... | Associates the specified value with the specified key in this map. If the map previously
contained a mapping for the key, the existing cached prepared result shared counter will be
incremented.
@param key key
@param result new prepare result.
@return the previous value associated with key if not been deallocate, or... | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
".",
"If",
"the",
"map",
"previously",
"contained",
"a",
"mapping",
"for",
"the",
"key",
"the",
"existing",
"cached",
"prepared",
"result",
"shared",
"counter",
... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/ServerPrepareStatementCache.java#L111-L121 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java | AbstractIndexWriter.addDescription | protected void addDescription(MemberDoc member, Content dlTree) {
"""
Add description for Class, Field, Method or Constructor.
@param member MemberDoc for the member of the Class Kind
@param dlTree the content tree to which the description will be added
"""
String name = (member instanceof Executab... | java | protected void addDescription(MemberDoc member, Content dlTree) {
String name = (member instanceof ExecutableMemberDoc)?
member.name() + ((ExecutableMemberDoc)member).flatSignature() :
member.name();
Content span = HtmlTree.SPAN(HtmlStyle.memberNameLink,
getDocLin... | [
"protected",
"void",
"addDescription",
"(",
"MemberDoc",
"member",
",",
"Content",
"dlTree",
")",
"{",
"String",
"name",
"=",
"(",
"member",
"instanceof",
"ExecutableMemberDoc",
")",
"?",
"member",
".",
"name",
"(",
")",
"+",
"(",
"(",
"ExecutableMemberDoc",
... | Add description for Class, Field, Method or Constructor.
@param member MemberDoc for the member of the Class Kind
@param dlTree the content tree to which the description will be added | [
"Add",
"description",
"for",
"Class",
"Field",
"Method",
"or",
"Constructor",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java#L175-L188 |
OpenLiberty/open-liberty | dev/com.ibm.ws.wsoc/src/com/ibm/ws/wsoc/AnnotatedEndpoint.java | AnnotatedEndpoint.setMaxMessageSize | private void setMaxMessageSize(Method method, EndpointMethodHelper endpointMethodHelper) {
"""
/*
maxMessageSize attribute in @OnMessage: Specifies the maximum size of message in bytes that the method this annotates will be able to process, or -1 to indicate that there
is no maximum defined, and therefore it is ... | java | private void setMaxMessageSize(Method method, EndpointMethodHelper endpointMethodHelper) {
OnMessage onMsgAnnotation = method.getAnnotation(OnMessage.class);
Long maxMessageSize = onMsgAnnotation.maxMessageSize();
// maxMessageSize is -1 if it is not defined.
if (maxMessageSize < -1) {
... | [
"private",
"void",
"setMaxMessageSize",
"(",
"Method",
"method",
",",
"EndpointMethodHelper",
"endpointMethodHelper",
")",
"{",
"OnMessage",
"onMsgAnnotation",
"=",
"method",
".",
"getAnnotation",
"(",
"OnMessage",
".",
"class",
")",
";",
"Long",
"maxMessageSize",
"... | /*
maxMessageSize attribute in @OnMessage: Specifies the maximum size of message in bytes that the method this annotates will be able to process, or -1 to indicate that there
is no maximum defined, and therefore it is undefined which means unlimited. | [
"/",
"*",
"maxMessageSize",
"attribute",
"in"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.wsoc/src/com/ibm/ws/wsoc/AnnotatedEndpoint.java#L1170-L1183 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpRequestUtils.java | HttpRequestUtils.getService | public static WebApplicationService getService(final List<ArgumentExtractor> argumentExtractors, final HttpServletRequest request) {
"""
Gets the service from the request based on given extractors.
@param argumentExtractors the argument extractors
@param request the request
@return the service, or ... | java | public static WebApplicationService getService(final List<ArgumentExtractor> argumentExtractors, final HttpServletRequest request) {
return argumentExtractors
.stream()
.map(argumentExtractor -> argumentExtractor.extractService(request))
.filter(Objects::nonNull)
... | [
"public",
"static",
"WebApplicationService",
"getService",
"(",
"final",
"List",
"<",
"ArgumentExtractor",
">",
"argumentExtractors",
",",
"final",
"HttpServletRequest",
"request",
")",
"{",
"return",
"argumentExtractors",
".",
"stream",
"(",
")",
".",
"map",
"(",
... | Gets the service from the request based on given extractors.
@param argumentExtractors the argument extractors
@param request the request
@return the service, or null. | [
"Gets",
"the",
"service",
"from",
"the",
"request",
"based",
"on",
"given",
"extractors",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpRequestUtils.java#L129-L136 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/strings/offsets/OffsetGroup.java | OffsetGroup.from | public static OffsetGroup from(final CharOffset charOffset, final EDTOffset edtOffset) {
"""
Creates a {@code OffsetGroup} with the specified character and EDT offsets and no specified
byte or ASR offsets.
"""
return new Builder().charOffset(charOffset).edtOffset(edtOffset).build();
} | java | public static OffsetGroup from(final CharOffset charOffset, final EDTOffset edtOffset) {
return new Builder().charOffset(charOffset).edtOffset(edtOffset).build();
} | [
"public",
"static",
"OffsetGroup",
"from",
"(",
"final",
"CharOffset",
"charOffset",
",",
"final",
"EDTOffset",
"edtOffset",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"charOffset",
"(",
"charOffset",
")",
".",
"edtOffset",
"(",
"edtOffset",
")",
"... | Creates a {@code OffsetGroup} with the specified character and EDT offsets and no specified
byte or ASR offsets. | [
"Creates",
"a",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/strings/offsets/OffsetGroup.java#L40-L42 |
structurizr/java | structurizr-analysis/src/com/structurizr/analysis/TypeUtils.java | TypeUtils.findFirstImplementationOfInterface | public static Class findFirstImplementationOfInterface(Class interfaceType, Set<Class<?>> types) {
"""
Finds the first implementation of the given interface.
@param interfaceType a Class object representing the interface type
@param types the set of Class objects to search through
@return the... | java | public static Class findFirstImplementationOfInterface(Class interfaceType, Set<Class<?>> types) {
if (interfaceType == null) {
throw new IllegalArgumentException("An interface type must be provided.");
} else if (!interfaceType.isInterface()) {
throw new IllegalArgumentException... | [
"public",
"static",
"Class",
"findFirstImplementationOfInterface",
"(",
"Class",
"interfaceType",
",",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"types",
")",
"{",
"if",
"(",
"interfaceType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"... | Finds the first implementation of the given interface.
@param interfaceType a Class object representing the interface type
@param types the set of Class objects to search through
@return the first concrete implementation class of the given interface,
or null if one can't be found | [
"Finds",
"the",
"first",
"implementation",
"of",
"the",
"given",
"interface",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-analysis/src/com/structurizr/analysis/TypeUtils.java#L94-L115 |
Netflix/zuul | zuul-core/src/main/java/com/netflix/zuul/context/SessionContext.java | SessionContext.getBoolean | public boolean getBoolean(String key, boolean defaultResponse) {
"""
Convenience method to return a boolean value for a given key
@param key
@param defaultResponse
@return true or false depending what was set. default defaultResponse
"""
Boolean b = (Boolean) get(key);
if (b != null) {
... | java | public boolean getBoolean(String key, boolean defaultResponse) {
Boolean b = (Boolean) get(key);
if (b != null) {
return b.booleanValue();
}
return defaultResponse;
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultResponse",
")",
"{",
"Boolean",
"b",
"=",
"(",
"Boolean",
")",
"get",
"(",
"key",
")",
";",
"if",
"(",
"b",
"!=",
"null",
")",
"{",
"return",
"b",
".",
"booleanValue",
"... | Convenience method to return a boolean value for a given key
@param key
@param defaultResponse
@return true or false depending what was set. default defaultResponse | [
"Convenience",
"method",
"to",
"return",
"a",
"boolean",
"value",
"for",
"a",
"given",
"key"
] | train | https://github.com/Netflix/zuul/blob/01bc777cf05e3522d37c9ed902ae13eb38a19692/zuul-core/src/main/java/com/netflix/zuul/context/SessionContext.java#L115-L121 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/UIForm.java | UIForm.createUniqueId | public String createUniqueId(FacesContext context, String seed) {
"""
<p class="changed_modified_2_2">Generate an identifier for a component. The identifier
will be prefixed with UNIQUE_ID_PREFIX, and will be unique
within this component-container. Optionally, a unique seed value can
be supplied by component cr... | java | public String createUniqueId(FacesContext context, String seed) {
if (isPrependId()) {
Integer i = (Integer) getStateHelper().get(PropertyKeys.lastId);
int lastId = ((i != null) ? i : 0);
getStateHelper().put(PropertyKeys.lastId, ++lastId);
return UIViewRoot.UNIQ... | [
"public",
"String",
"createUniqueId",
"(",
"FacesContext",
"context",
",",
"String",
"seed",
")",
"{",
"if",
"(",
"isPrependId",
"(",
")",
")",
"{",
"Integer",
"i",
"=",
"(",
"Integer",
")",
"getStateHelper",
"(",
")",
".",
"get",
"(",
"PropertyKeys",
".... | <p class="changed_modified_2_2">Generate an identifier for a component. The identifier
will be prefixed with UNIQUE_ID_PREFIX, and will be unique
within this component-container. Optionally, a unique seed value can
be supplied by component creators which should be
included in the generated unique id.</p>
<p class="chan... | [
"<p",
"class",
"=",
"changed_modified_2_2",
">",
"Generate",
"an",
"identifier",
"for",
"a",
"component",
".",
"The",
"identifier",
"will",
"be",
"prefixed",
"with",
"UNIQUE_ID_PREFIX",
"and",
"will",
"be",
"unique",
"within",
"this",
"component",
"-",
"containe... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UIForm.java#L301-L318 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java | ActionUtil.createAction | public static IAction createAction(String label, String script) {
"""
Creates an action object from fields.
@param label Action's label name. May be a label reference (prefixed with an '@' character)
or the label itself.
@param script Action's script.
@return An action object.
"""
return new Acti... | java | public static IAction createAction(String label, String script) {
return new Action(script, label, script);
} | [
"public",
"static",
"IAction",
"createAction",
"(",
"String",
"label",
",",
"String",
"script",
")",
"{",
"return",
"new",
"Action",
"(",
"script",
",",
"label",
",",
"script",
")",
";",
"}"
] | Creates an action object from fields.
@param label Action's label name. May be a label reference (prefixed with an '@' character)
or the label itself.
@param script Action's script.
@return An action object. | [
"Creates",
"an",
"action",
"object",
"from",
"fields",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java#L59-L61 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java | TrainsImpl.trainVersion | public EnqueueTrainingResponse trainVersion(UUID appId, String versionId) {
"""
Sends a training request for a version of a specified LUIS app. This POST request initiates a request asynchronously. To determine whether the training request is successful, submit a GET request to get training status. Note: The appli... | java | public EnqueueTrainingResponse trainVersion(UUID appId, String versionId) {
return trainVersionWithServiceResponseAsync(appId, versionId).toBlocking().single().body();
} | [
"public",
"EnqueueTrainingResponse",
"trainVersion",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
")",
"{",
"return",
"trainVersionWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"bo... | Sends a training request for a version of a specified LUIS app. This POST request initiates a request asynchronously. To determine whether the training request is successful, submit a GET request to get training status. Note: The application version is not fully trained unless all the models (intents and entities) are ... | [
"Sends",
"a",
"training",
"request",
"for",
"a",
"version",
"of",
"a",
"specified",
"LUIS",
"app",
".",
"This",
"POST",
"request",
"initiates",
"a",
"request",
"asynchronously",
".",
"To",
"determine",
"whether",
"the",
"training",
"request",
"is",
"successful... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java#L80-L82 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.xdsl_options_line_lineAction_GET | public OvhPrice xdsl_options_line_lineAction_GET(net.minidev.ovh.api.price.xdsl.options.OvhLineEnum lineAction) throws IOException {
"""
Get the price of line action
REST: GET /price/xdsl/options/line/{lineAction}
@param lineAction [required] The type of line action
"""
String qPath = "/price/xdsl/option... | java | public OvhPrice xdsl_options_line_lineAction_GET(net.minidev.ovh.api.price.xdsl.options.OvhLineEnum lineAction) throws IOException {
String qPath = "/price/xdsl/options/line/{lineAction}";
StringBuilder sb = path(qPath, lineAction);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, O... | [
"public",
"OvhPrice",
"xdsl_options_line_lineAction_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"xdsl",
".",
"options",
".",
"OvhLineEnum",
"lineAction",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/price/xdsl/o... | Get the price of line action
REST: GET /price/xdsl/options/line/{lineAction}
@param lineAction [required] The type of line action | [
"Get",
"the",
"price",
"of",
"line",
"action"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L63-L68 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/StatementManager.java | StatementManager.bindStatement | private int bindStatement(PreparedStatement stmt, int index, BetweenCriteria crit, ClassDescriptor cld) throws SQLException {
"""
bind BetweenCriteria
@param stmt the PreparedStatement
@param index the position of the parameter to bind
@param crit the Criteria containing the parameter
@param cld the ClassDescr... | java | private int bindStatement(PreparedStatement stmt, int index, BetweenCriteria crit, ClassDescriptor cld) throws SQLException
{
index = bindStatementValue(stmt, index, crit.getAttribute(), crit.getValue(), cld);
return bindStatementValue(stmt, index, crit.getAttribute(), crit.getValue2(), cld);
... | [
"private",
"int",
"bindStatement",
"(",
"PreparedStatement",
"stmt",
",",
"int",
"index",
",",
"BetweenCriteria",
"crit",
",",
"ClassDescriptor",
"cld",
")",
"throws",
"SQLException",
"{",
"index",
"=",
"bindStatementValue",
"(",
"stmt",
",",
"index",
",",
"crit... | bind BetweenCriteria
@param stmt the PreparedStatement
@param index the position of the parameter to bind
@param crit the Criteria containing the parameter
@param cld the ClassDescriptor
@return next index for PreparedStatement | [
"bind",
"BetweenCriteria"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java#L295-L300 |
Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/endpoint/EndpointUtils.java | EndpointUtils.getZoneBasedDiscoveryUrlsFromRegion | public static Map<String, List<String>> getZoneBasedDiscoveryUrlsFromRegion(EurekaClientConfig clientConfig, String region) {
"""
Get the zone based CNAMES that are bound to a region.
@param region
- The region for which the zone names need to be retrieved
@return - The list of CNAMES from which the zone-rela... | java | public static Map<String, List<String>> getZoneBasedDiscoveryUrlsFromRegion(EurekaClientConfig clientConfig, String region) {
String discoveryDnsName = null;
try {
discoveryDnsName = "txt." + region + "." + clientConfig.getEurekaServerDNSName();
logger.debug("The region url to b... | [
"public",
"static",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"getZoneBasedDiscoveryUrlsFromRegion",
"(",
"EurekaClientConfig",
"clientConfig",
",",
"String",
"region",
")",
"{",
"String",
"discoveryDnsName",
"=",
"null",
";",
"try",
"{",
"disc... | Get the zone based CNAMES that are bound to a region.
@param region
- The region for which the zone names need to be retrieved
@return - The list of CNAMES from which the zone-related information can
be retrieved | [
"Get",
"the",
"zone",
"based",
"CNAMES",
"that",
"are",
"bound",
"to",
"a",
"region",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/endpoint/EndpointUtils.java#L317-L349 |
knowm/XChart | xchart/src/main/java/org/knowm/xchart/internal/chartpart/ToolTips.java | ToolTips.addData | public void addData(double xOffset, double yOffset, String label) {
"""
Adds a data with label with coordinates (xOffset, yOffset). This point will be highlighted with
a circle centering (xOffset, yOffset)
"""
DataPoint dp = new DataPoint(xOffset, yOffset, label);
dataPointList.add(dp);
} | java | public void addData(double xOffset, double yOffset, String label) {
DataPoint dp = new DataPoint(xOffset, yOffset, label);
dataPointList.add(dp);
} | [
"public",
"void",
"addData",
"(",
"double",
"xOffset",
",",
"double",
"yOffset",
",",
"String",
"label",
")",
"{",
"DataPoint",
"dp",
"=",
"new",
"DataPoint",
"(",
"xOffset",
",",
"yOffset",
",",
"label",
")",
";",
"dataPointList",
".",
"add",
"(",
"dp",... | Adds a data with label with coordinates (xOffset, yOffset). This point will be highlighted with
a circle centering (xOffset, yOffset) | [
"Adds",
"a",
"data",
"with",
"label",
"with",
"coordinates",
"(",
"xOffset",
"yOffset",
")",
".",
"This",
"point",
"will",
"be",
"highlighted",
"with",
"a",
"circle",
"centering",
"(",
"xOffset",
"yOffset",
")"
] | train | https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/ToolTips.java#L132-L136 |
sebastiangraf/perfidix | src/main/java/org/perfidix/socketadapter/SocketViewProgressUpdater.java | SocketViewProgressUpdater.initProgressView | public boolean initProgressView(final Map<BenchmarkMethod, Integer> mapping)
throws SocketViewException {
"""
This method initializes the values of the eclipse view and resets the
progress bar.
@param mapping
a mapping with all methods to benchmark and the related runs
@throws SocketViewException
if init... | java | public boolean initProgressView(final Map<BenchmarkMethod, Integer> mapping)
throws SocketViewException {
if (mapping != null) {
final Set<BenchmarkMethod> methodSet = mapping.keySet();
final Map<String, Integer> finalMap = new HashMap<String, Integer>();
for (BenchmarkMethod benchmarkMethod : methodSet)... | [
"public",
"boolean",
"initProgressView",
"(",
"final",
"Map",
"<",
"BenchmarkMethod",
",",
"Integer",
">",
"mapping",
")",
"throws",
"SocketViewException",
"{",
"if",
"(",
"mapping",
"!=",
"null",
")",
"{",
"final",
"Set",
"<",
"BenchmarkMethod",
">",
"methodS... | This method initializes the values of the eclipse view and resets the
progress bar.
@param mapping
a mapping with all methods to benchmark and the related runs
@throws SocketViewException
if init fails | [
"This",
"method",
"initializes",
"the",
"values",
"of",
"the",
"eclipse",
"view",
"and",
"resets",
"the",
"progress",
"bar",
"."
] | train | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/socketadapter/SocketViewProgressUpdater.java#L73-L88 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.setReadonlyValue | public static <T> void setReadonlyValue(AbstractField<T> field, T value) {
"""
Sets the value of a text field which may be set to read-only mode.<p>
When setting a Vaadin field to read-only, you also can't set its value programmatically anymore.
So we need to temporarily disable read-only mode, set the value, ... | java | public static <T> void setReadonlyValue(AbstractField<T> field, T value) {
boolean readonly = field.isReadOnly();
try {
field.setReadOnly(false);
field.setValue(value);
} finally {
field.setReadOnly(readonly);
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"setReadonlyValue",
"(",
"AbstractField",
"<",
"T",
">",
"field",
",",
"T",
"value",
")",
"{",
"boolean",
"readonly",
"=",
"field",
".",
"isReadOnly",
"(",
")",
";",
"try",
"{",
"field",
".",
"setReadOnly",
"(... | Sets the value of a text field which may be set to read-only mode.<p>
When setting a Vaadin field to read-only, you also can't set its value programmatically anymore.
So we need to temporarily disable read-only mode, set the value, and then switch back to read-only mode.
@param field the field
@param value the value ... | [
"Sets",
"the",
"value",
"of",
"a",
"text",
"field",
"which",
"may",
"be",
"set",
"to",
"read",
"-",
"only",
"mode",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L1144-L1153 |
aws/aws-sdk-java | aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java | StepFunctionBuilder.gte | public static NumericGreaterThanOrEqualCondition.Builder gte(String variable, long expectedValue) {
"""
Binary condition for Numeric greater than comparison. Supports both integral and floating point numeric types.
@param variable The JSONPath expression that determines which piece of the input document is... | java | public static NumericGreaterThanOrEqualCondition.Builder gte(String variable, long expectedValue) {
return NumericGreaterThanOrEqualCondition.builder().variable(variable).expectedValue(expectedValue);
} | [
"public",
"static",
"NumericGreaterThanOrEqualCondition",
".",
"Builder",
"gte",
"(",
"String",
"variable",
",",
"long",
"expectedValue",
")",
"{",
"return",
"NumericGreaterThanOrEqualCondition",
".",
"builder",
"(",
")",
".",
"variable",
"(",
"variable",
")",
".",
... | Binary condition for Numeric greater than comparison. Supports both integral and floating point numeric types.
@param variable The JSONPath expression that determines which piece of the input document is used for the comparison.
@param expectedValue The expected value for this condition.
@see <a href="https://sta... | [
"Binary",
"condition",
"for",
"Numeric",
"greater",
"than",
"comparison",
".",
"Supports",
"both",
"integral",
"and",
"floating",
"point",
"numeric",
"types",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java#L332-L334 |
JodaOrg/joda-time-jsptags | src/main/java/org/joda/time/contrib/jsptag/Util.java | Util.findMatch | private static LocalizationContext findMatch(PageContext pageContext,
String basename) {
"""
Determines the client's preferred locales from the request, and compares
each of the locales (in order of preference) against the available
locales in order to determine the best matching locale.
@param pa... | java | private static LocalizationContext findMatch(PageContext pageContext,
String basename) {
LocalizationContext locCtxt = null;
// Determine locale from client's browser settings.
for (Enumeration enum_ = Util
.getRequestLocales((HttpServletRequest) pageContext
... | [
"private",
"static",
"LocalizationContext",
"findMatch",
"(",
"PageContext",
"pageContext",
",",
"String",
"basename",
")",
"{",
"LocalizationContext",
"locCtxt",
"=",
"null",
";",
"// Determine locale from client's browser settings.",
"for",
"(",
"Enumeration",
"enum_",
... | Determines the client's preferred locales from the request, and compares
each of the locales (in order of preference) against the available
locales in order to determine the best matching locale.
@param pageContext the page in which the resource bundle with the given
base name is requested @param basename the resource... | [
"Determines",
"the",
"client",
"s",
"preferred",
"locales",
"from",
"the",
"request",
"and",
"compares",
"each",
"of",
"the",
"locales",
"(",
"in",
"order",
"of",
"preference",
")",
"against",
"the",
"available",
"locales",
"in",
"order",
"to",
"determine",
... | train | https://github.com/JodaOrg/joda-time-jsptags/blob/69008a813568cb6f3e37ea7a80f8b1f2070edf14/src/main/java/org/joda/time/contrib/jsptag/Util.java#L552-L569 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java | CommerceDiscountUsageEntryPersistenceImpl.findAll | @Override
public List<CommerceDiscountUsageEntry> findAll(int start, int end) {
"""
Returns a range of all the commerce discount usage entries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are in... | java | @Override
public List<CommerceDiscountUsageEntry> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscountUsageEntry",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce discount usage entries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"discount",
"usage",
"entries",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java#L1133-L1136 |
gliga/ekstazi | org.ekstazi.core/src/main/java/org/ekstazi/agent/AgentLoader.java | AgentLoader.attachAgent | private static void attachAgent(Class<?> vmClass, URL agentJarURL) throws Exception {
"""
Attaches jar where this class belongs to the current VirtualMachine as an
agent.
@param vmClass
VirtualMachine
@throws Exception
If unexpected behavior
"""
String pid = getPID();
String agentAbsolut... | java | private static void attachAgent(Class<?> vmClass, URL agentJarURL) throws Exception {
String pid = getPID();
String agentAbsolutePath = new File(agentJarURL.toURI().getSchemeSpecificPart()).getAbsolutePath();
Object vm = getAttachMethod(vmClass).invoke(null, new Object[] { pid });
getLo... | [
"private",
"static",
"void",
"attachAgent",
"(",
"Class",
"<",
"?",
">",
"vmClass",
",",
"URL",
"agentJarURL",
")",
"throws",
"Exception",
"{",
"String",
"pid",
"=",
"getPID",
"(",
")",
";",
"String",
"agentAbsolutePath",
"=",
"new",
"File",
"(",
"agentJar... | Attaches jar where this class belongs to the current VirtualMachine as an
agent.
@param vmClass
VirtualMachine
@throws Exception
If unexpected behavior | [
"Attaches",
"jar",
"where",
"this",
"class",
"belongs",
"to",
"the",
"current",
"VirtualMachine",
"as",
"an",
"agent",
"."
] | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/agent/AgentLoader.java#L116-L123 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/FrameworkUtil.java | FrameworkUtil.setAttribute | public static void setAttribute(String key, Object value) {
"""
Stores an arbitrary named attribute in the attribute cache.
@param key Attribute name.
@param value Attribute value. If null, value is removed from cache.
@throws IllegalStateException if AppFramework is not initialized
"""
assertInit... | java | public static void setAttribute(String key, Object value) {
assertInitialized();
getAppFramework().setAttribute(key, value);
} | [
"public",
"static",
"void",
"setAttribute",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"assertInitialized",
"(",
")",
";",
"getAppFramework",
"(",
")",
".",
"setAttribute",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Stores an arbitrary named attribute in the attribute cache.
@param key Attribute name.
@param value Attribute value. If null, value is removed from cache.
@throws IllegalStateException if AppFramework is not initialized | [
"Stores",
"an",
"arbitrary",
"named",
"attribute",
"in",
"the",
"attribute",
"cache",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/FrameworkUtil.java#L74-L77 |
apache/incubator-shardingsphere | sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/ShardingExecuteEngine.java | ShardingExecuteEngine.groupExecute | public <I, O> List<O> groupExecute(final Collection<ShardingExecuteGroup<I>> inputGroups, final ShardingGroupExecuteCallback<I, O> callback) throws SQLException {
"""
Execute for group.
@param inputGroups input groups
@param callback sharding execute callback
@param <I> type of input value
@param <O> type of... | java | public <I, O> List<O> groupExecute(final Collection<ShardingExecuteGroup<I>> inputGroups, final ShardingGroupExecuteCallback<I, O> callback) throws SQLException {
return groupExecute(inputGroups, null, callback, false);
} | [
"public",
"<",
"I",
",",
"O",
">",
"List",
"<",
"O",
">",
"groupExecute",
"(",
"final",
"Collection",
"<",
"ShardingExecuteGroup",
"<",
"I",
">",
">",
"inputGroups",
",",
"final",
"ShardingGroupExecuteCallback",
"<",
"I",
",",
"O",
">",
"callback",
")",
... | Execute for group.
@param inputGroups input groups
@param callback sharding execute callback
@param <I> type of input value
@param <O> type of return value
@return execute result
@throws SQLException throw if execute failure | [
"Execute",
"for",
"group",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/ShardingExecuteEngine.java#L61-L63 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.toLineString | public LineString toLineString(Polyline polyline, boolean hasZ, boolean hasM) {
"""
Convert a {@link Polyline} to a {@link LineString}
@param polyline polyline
@param hasZ has z flag
@param hasM has m flag
@return line string
"""
return toLineString(polyline.getPoints(), hasZ, hasM);
... | java | public LineString toLineString(Polyline polyline, boolean hasZ, boolean hasM) {
return toLineString(polyline.getPoints(), hasZ, hasM);
} | [
"public",
"LineString",
"toLineString",
"(",
"Polyline",
"polyline",
",",
"boolean",
"hasZ",
",",
"boolean",
"hasM",
")",
"{",
"return",
"toLineString",
"(",
"polyline",
".",
"getPoints",
"(",
")",
",",
"hasZ",
",",
"hasM",
")",
";",
"}"
] | Convert a {@link Polyline} to a {@link LineString}
@param polyline polyline
@param hasZ has z flag
@param hasM has m flag
@return line string | [
"Convert",
"a",
"{",
"@link",
"Polyline",
"}",
"to",
"a",
"{",
"@link",
"LineString",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L302-L304 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | FieldUtils.writeDeclaredField | public static void writeDeclaredField(final Object target, final String fieldName, final Object value) throws IllegalAccessException {
"""
Writes a {@code public} {@link Field}. Only the specified class will be considered.
@param target
the object to reflect, must not be {@code null}
@param fieldName
the fie... | java | public static void writeDeclaredField(final Object target, final String fieldName, final Object value) throws IllegalAccessException {
writeDeclaredField(target, fieldName, value, false);
} | [
"public",
"static",
"void",
"writeDeclaredField",
"(",
"final",
"Object",
"target",
",",
"final",
"String",
"fieldName",
",",
"final",
"Object",
"value",
")",
"throws",
"IllegalAccessException",
"{",
"writeDeclaredField",
"(",
"target",
",",
"fieldName",
",",
"val... | Writes a {@code public} {@link Field}. Only the specified class will be considered.
@param target
the object to reflect, must not be {@code null}
@param fieldName
the field name to obtain
@param value
to set
@throws IllegalArgumentException
if {@code target} is {@code null}, {@code fieldName} is blank or empty or coul... | [
"Writes",
"a",
"{",
"@code",
"public",
"}",
"{",
"@link",
"Field",
"}",
".",
"Only",
"the",
"specified",
"class",
"will",
"be",
"considered",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L809-L811 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java | FailoverGroupsInner.beginCreateOrUpdate | public FailoverGroupInner beginCreateOrUpdate(String resourceGroupName, String serverName, String failoverGroupName, FailoverGroupInner parameters) {
"""
Creates or updates a failover group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Az... | java | public FailoverGroupInner beginCreateOrUpdate(String resourceGroupName, String serverName, String failoverGroupName, FailoverGroupInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName, parameters).toBlocking().single().body();
} | [
"public",
"FailoverGroupInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"failoverGroupName",
",",
"FailoverGroupInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resour... | Creates or updates a failover group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server containing the failover group.
@param failoverGroupName The name of the failover... | [
"Creates",
"or",
"updates",
"a",
"failover",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java#L310-L312 |
twitter/hraven | hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java | AppSummaryService.getNewAppKeyFromResult | private AppKey getNewAppKeyFromResult(Result result, long startTime,
long endTime) throws IOException {
"""
constructs App key from the result set based on cluster, user, appId picks
those results that satisfy the time range criteria
@param result
@param startTime
@param endTime
@return flow key
@throw... | java | private AppKey getNewAppKeyFromResult(Result result, long startTime,
long endTime) throws IOException {
byte[] rowKey = result.getRow();
byte[][] keyComponents = ByteUtil.split(rowKey, Constants.SEP_BYTES);
String cluster = Bytes.toString(keyComponents[0]);
String user = Bytes.toString(keyCompone... | [
"private",
"AppKey",
"getNewAppKeyFromResult",
"(",
"Result",
"result",
",",
"long",
"startTime",
",",
"long",
"endTime",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"rowKey",
"=",
"result",
".",
"getRow",
"(",
")",
";",
"byte",
"[",
"]",
"[",
"... | constructs App key from the result set based on cluster, user, appId picks
those results that satisfy the time range criteria
@param result
@param startTime
@param endTime
@return flow key
@throws IOException | [
"constructs",
"App",
"key",
"from",
"the",
"result",
"set",
"based",
"on",
"cluster",
"user",
"appId",
"picks",
"those",
"results",
"that",
"satisfy",
"the",
"time",
"range",
"criteria"
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java#L202-L226 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optBinder | @Nullable
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public static IBinder optBinder(@Nullable Bundle bundle, @Nullable String key, @Nullable IBinder fallback) {
"""
Returns a optional {@link android.os.IBinder} value. In other words, returns the value mapped by key if it exists and is a {@link android... | java | @Nullable
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public static IBinder optBinder(@Nullable Bundle bundle, @Nullable String key, @Nullable IBinder fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getBinder(key);
} | [
"@",
"Nullable",
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"JELLY_BEAN_MR2",
")",
"public",
"static",
"IBinder",
"optBinder",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"IBinder",
"... | Returns a optional {@link android.os.IBinder} value. In other words, returns the value mapped by key if it exists and is a {@link android.os.IBinder}.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will retur... | [
"Returns",
"a",
"optional",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L108-L115 |
janus-project/guava.janusproject.io | guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/Sets.java | Sets.symmetricDifference | public static <E> SetView<E> symmetricDifference(
Set<? extends E> set1, Set<? extends E> set2) {
"""
Returns an unmodifiable <b>view</b> of the symmetric difference of two
sets. The returned set contains all elements that are contained in either
{@code set1} or {@code set2} but not in both. The iteration ... | java | public static <E> SetView<E> symmetricDifference(
Set<? extends E> set1, Set<? extends E> set2) {
checkNotNull(set1, "set1");
checkNotNull(set2, "set2");
// TODO(kevinb): Replace this with a more efficient implementation
return difference(union(set1, set2), intersection(set1, set2));
} | [
"public",
"static",
"<",
"E",
">",
"SetView",
"<",
"E",
">",
"symmetricDifference",
"(",
"Set",
"<",
"?",
"extends",
"E",
">",
"set1",
",",
"Set",
"<",
"?",
"extends",
"E",
">",
"set2",
")",
"{",
"checkNotNull",
"(",
"set1",
",",
"\"set1\"",
")",
"... | Returns an unmodifiable <b>view</b> of the symmetric difference of two
sets. The returned set contains all elements that are contained in either
{@code set1} or {@code set2} but not in both. The iteration order of the
returned set is undefined.
<p>Results are undefined if {@code set1} and {@code set2} are sets based
o... | [
"Returns",
"an",
"unmodifiable",
"<b",
">",
"view<",
"/",
"b",
">",
"of",
"the",
"symmetric",
"difference",
"of",
"two",
"sets",
".",
"The",
"returned",
"set",
"contains",
"all",
"elements",
"that",
"are",
"contained",
"in",
"either",
"{",
"@code",
"set1",... | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/Sets.java#L673-L680 |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageManager.java | ImageManager.getMirage | public Mirage getMirage (ImageKey key, Colorization[] zations) {
"""
Like {@link #getMirage(ImageKey)} but the supplied colorizations are applied to the source
image before creating the mirage.
"""
return getMirage(key, null, zations);
} | java | public Mirage getMirage (ImageKey key, Colorization[] zations)
{
return getMirage(key, null, zations);
} | [
"public",
"Mirage",
"getMirage",
"(",
"ImageKey",
"key",
",",
"Colorization",
"[",
"]",
"zations",
")",
"{",
"return",
"getMirage",
"(",
"key",
",",
"null",
",",
"zations",
")",
";",
"}"
] | Like {@link #getMirage(ImageKey)} but the supplied colorizations are applied to the source
image before creating the mirage. | [
"Like",
"{"
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageManager.java#L347-L350 |
rapidpro/expressions | java/src/main/java/io/rapidpro/expressions/functions/ExcelFunctions.java | ExcelFunctions.fixed | public static String fixed(EvaluationContext ctx, Object number, @IntegerDefault(2) Object decimals, @BooleanDefault(false) Object noCommas) {
"""
Formats the given number in decimal format using a period and commas
"""
BigDecimal _number = Conversions.toDecimal(number, ctx);
_number = _number.... | java | public static String fixed(EvaluationContext ctx, Object number, @IntegerDefault(2) Object decimals, @BooleanDefault(false) Object noCommas) {
BigDecimal _number = Conversions.toDecimal(number, ctx);
_number = _number.setScale(Conversions.toInteger(decimals, ctx), RoundingMode.HALF_UP);
Decimal... | [
"public",
"static",
"String",
"fixed",
"(",
"EvaluationContext",
"ctx",
",",
"Object",
"number",
",",
"@",
"IntegerDefault",
"(",
"2",
")",
"Object",
"decimals",
",",
"@",
"BooleanDefault",
"(",
"false",
")",
"Object",
"noCommas",
")",
"{",
"BigDecimal",
"_n... | Formats the given number in decimal format using a period and commas | [
"Formats",
"the",
"given",
"number",
"in",
"decimal",
"format",
"using",
"a",
"period",
"and",
"commas"
] | train | https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/functions/ExcelFunctions.java#L66-L74 |
upwork/java-upwork | src/com/Upwork/api/Routers/Messages.java | Messages.updateRoomSettings | public JSONObject updateRoomSettings(String company, String roomId, String username, HashMap<String, String> params) throws JSONException {
"""
Update a room settings
@param company Company ID
@param roomId Room ID
@param username User ID
@param params Parameters
@throws JSONException If error occur... | java | public JSONObject updateRoomSettings(String company, String roomId, String username, HashMap<String, String> params) throws JSONException {
return oClient.put("/messages/v3/" + company + "/rooms/" + roomId + "/users/" + username, params);
} | [
"public",
"JSONObject",
"updateRoomSettings",
"(",
"String",
"company",
",",
"String",
"roomId",
",",
"String",
"username",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"put",
"(",
... | Update a room settings
@param company Company ID
@param roomId Room ID
@param username User ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Update",
"a",
"room",
"settings"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Messages.java#L140-L142 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/sdxtools_image.java | sdxtools_image.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>
"""
sdxtools_image_responses result = (sdxtools_image_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
sdxtools_image_responses result = (sdxtools_image_responses) service.get_payload_formatter().string_to_resource(sdxtools_image_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"sdxtools_image_responses",
"result",
"=",
"(",
"sdxtools_image_responses",
")",
"service",
".",
"get_payload_... | <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/mps/sdxtools_image.java#L265-L282 |
qspin/qtaste | kernel/src/main/java/com/qspin/qtaste/toolbox/simulators/SimulatorImpl.java | SimulatorImpl.logAndThrowException | private static void logAndThrowException(String message, PyException e) throws Exception {
"""
Logs message and exception and throws Exception.
@param message message
@param e PyException
@throws java.lang.Exception Exception built with 'message + ":\n" + message_of_e'
"""
LOGGER.error(message, e)... | java | private static void logAndThrowException(String message, PyException e) throws Exception {
LOGGER.error(message, e);
throw new Exception(message + ":\n" + PythonHelper.getMessage(e));
} | [
"private",
"static",
"void",
"logAndThrowException",
"(",
"String",
"message",
",",
"PyException",
"e",
")",
"throws",
"Exception",
"{",
"LOGGER",
".",
"error",
"(",
"message",
",",
"e",
")",
";",
"throw",
"new",
"Exception",
"(",
"message",
"+",
"\":\\n\"",... | Logs message and exception and throws Exception.
@param message message
@param e PyException
@throws java.lang.Exception Exception built with 'message + ":\n" + message_of_e' | [
"Logs",
"message",
"and",
"exception",
"and",
"throws",
"Exception",
"."
] | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/kernel/src/main/java/com/qspin/qtaste/toolbox/simulators/SimulatorImpl.java#L281-L284 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.invokeAnnotTypeOnObjectAndHierarchy | public Throwable invokeAnnotTypeOnObjectAndHierarchy(Object obj, ANNOT_TYPE type) {
"""
<p>Invoke post-construct and pre-destroy methods on the target object.</p>
<p>Method are selected on the super class chain of the target object, including
the class of the target object. Invocations are performed starting ... | java | public Throwable invokeAnnotTypeOnObjectAndHierarchy(Object obj, ANNOT_TYPE type) {
String methodName = "invokeAnnotTypeOnObjectAndHierarchy";
if (obj == null) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
logger.logp(Level.FI... | [
"public",
"Throwable",
"invokeAnnotTypeOnObjectAndHierarchy",
"(",
"Object",
"obj",
",",
"ANNOT_TYPE",
"type",
")",
"{",
"String",
"methodName",
"=",
"\"invokeAnnotTypeOnObjectAndHierarchy\"",
";",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"if",
"(",
"com",
".",
... | <p>Invoke post-construct and pre-destroy methods on the target object.</p>
<p>Method are selected on the super class chain of the target object, including
the class of the target object. Invocations are performed starting with the
method from the top-most class. All invocations are performed on the target
object.</p... | [
"<p",
">",
"Invoke",
"post",
"-",
"construct",
"and",
"pre",
"-",
"destroy",
"methods",
"on",
"the",
"target",
"object",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L812-L832 |
pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/ZkOrderedStore.java | ZkOrderedStore.getEntitiesWithPosition | CompletableFuture<Map<Long, String>> getEntitiesWithPosition(String scope, String stream) {
"""
Returns a map of position to entity that was added to the set.
Note: Entities are ordered by position in the set but the map responded from this api is not ordered by default.
Users can filter and order elements based... | java | CompletableFuture<Map<Long, String>> getEntitiesWithPosition(String scope, String stream) {
Map<Long, String> result = new ConcurrentHashMap<>();
return Futures.exceptionallyExpecting(storeHelper.getChildren(getCollectionsPath(scope, stream)), DATA_NOT_FOUND_PREDICATE, Collections.emptyList())
... | [
"CompletableFuture",
"<",
"Map",
"<",
"Long",
",",
"String",
">",
">",
"getEntitiesWithPosition",
"(",
"String",
"scope",
",",
"String",
"stream",
")",
"{",
"Map",
"<",
"Long",
",",
"String",
">",
"result",
"=",
"new",
"ConcurrentHashMap",
"<>",
"(",
")",
... | Returns a map of position to entity that was added to the set.
Note: Entities are ordered by position in the set but the map responded from this api is not ordered by default.
Users can filter and order elements based on the position and entity id.
@param scope scope scope
@param stream stream stream
@return Completabl... | [
"Returns",
"a",
"map",
"of",
"position",
"to",
"entity",
"that",
"was",
"added",
"to",
"the",
"set",
".",
"Note",
":",
"Entities",
"are",
"ordered",
"by",
"position",
"in",
"the",
"set",
"but",
"the",
"map",
"responded",
"from",
"this",
"api",
"is",
"n... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/ZkOrderedStore.java#L168-L199 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysInner.java | VpnGatewaysInner.updateTagsAsync | public Observable<VpnGatewayInner> updateTagsAsync(String resourceGroupName, String gatewayName) {
"""
Updates virtual wan vpn gateway tags.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if parameters fai... | java | public Observable<VpnGatewayInner> updateTagsAsync(String resourceGroupName, String gatewayName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1<ServiceResponse<VpnGatewayInner>, VpnGatewayInner>() {
@Override
public VpnGatewayInner call(ServiceR... | [
"public",
"Observable",
"<",
"VpnGatewayInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"gatewayName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"gatewayName",
")",
".",
"map",
"(",
"new... | Updates virtual wan vpn gateway tags.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"virtual",
"wan",
"vpn",
"gateway",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysInner.java#L403-L410 |
atteo/classindex | classindex/src/main/java/org/atteo/classindex/ClassIndex.java | ClassIndex.getPackageClasses | public static Iterable<Class<?>> getPackageClasses(String packageName, ClassLoader classLoader) {
"""
Retrieves a list of classes from given package.
<p/>
<p>
The package must be annotated with {@link IndexSubclasses} for the classes inside
to be indexed at compile-time by {@link org.atteo.classindex.processor... | java | public static Iterable<Class<?>> getPackageClasses(String packageName, ClassLoader classLoader) {
Iterable<String> entries = readIndexFile(classLoader, packageName.replace(".", "/") + "/" + PACKAGE_INDEX_NAME);
Set<Class<?>> classes = new HashSet<>();
findClassesInPackage(classLoader, packageName, classes, entri... | [
"public",
"static",
"Iterable",
"<",
"Class",
"<",
"?",
">",
">",
"getPackageClasses",
"(",
"String",
"packageName",
",",
"ClassLoader",
"classLoader",
")",
"{",
"Iterable",
"<",
"String",
">",
"entries",
"=",
"readIndexFile",
"(",
"classLoader",
",",
"package... | Retrieves a list of classes from given package.
<p/>
<p>
The package must be annotated with {@link IndexSubclasses} for the classes inside
to be indexed at compile-time by {@link org.atteo.classindex.processor.ClassIndexProcessor}.
</p>
@param packageName name of the package to search classes for
@param classLoader cl... | [
"Retrieves",
"a",
"list",
"of",
"classes",
"from",
"given",
"package",
".",
"<p",
"/",
">",
"<p",
">",
"The",
"package",
"must",
"be",
"annotated",
"with",
"{",
"@link",
"IndexSubclasses",
"}",
"for",
"the",
"classes",
"inside",
"to",
"be",
"indexed",
"a... | train | https://github.com/atteo/classindex/blob/ad76c6bd8b4e84c594d94e48f466a095ffe2306a/classindex/src/main/java/org/atteo/classindex/ClassIndex.java#L189-L199 |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java | Pipe.getHeight2I | private double getHeight2I( double slope, double g, double maxd, double c ) {
"""
Dimensiona il tubo adottando una pendenza pari a quella del terreno
<p>
Sostanzialmente uguale alla get_height_2. L'unica differenza e che
dimensiona iltubo adottando una pendenza pari a quella del terreno.
</p>
@param slope
... | java | private double getHeight2I( double slope, double g, double maxd, double c ) {
/* B Pari a A * ( Rh^ 1/6 ). */
double B;
/*
* oldD [cm] Altezza della sezione trapezoidale calcolato imponendo una
* pendenza pari a quella del terreno.
*/
double oldD;
/* D ... | [
"private",
"double",
"getHeight2I",
"(",
"double",
"slope",
",",
"double",
"g",
",",
"double",
"maxd",
",",
"double",
"c",
")",
"{",
"/* B Pari a A * ( Rh^ 1/6 ). */",
"double",
"B",
";",
"/*\n * oldD [cm] Altezza della sezione trapezoidale calcolato imponendo una\n... | Dimensiona il tubo adottando una pendenza pari a quella del terreno
<p>
Sostanzialmente uguale alla get_height_2. L'unica differenza e che
dimensiona iltubo adottando una pendenza pari a quella del terreno.
</p>
@param slope
[%] Pendenza del tratto da dimensionare, che e' pari a quella
del terreno
@param g
Grado di ri... | [
"Dimensiona",
"il",
"tubo",
"adottando",
"una",
"pendenza",
"pari",
"a",
"quella",
"del",
"terreno",
"<p",
">",
"Sostanzialmente",
"uguale",
"alla",
"get_height_2",
".",
"L",
"unica",
"differenza",
"e",
"che",
"dimensiona",
"iltubo",
"adottando",
"una",
"pendenz... | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java#L1402-L1438 |
joniles/mpxj | src/main/java/net/sf/mpxj/ResourceAssignment.java | ResourceAssignment.getTimephasedOvertimeWork | public List<TimephasedWork> getTimephasedOvertimeWork() {
"""
Retrieves the timephased breakdown of the planned overtime work for this
resource assignment.
@return timephased planned work
"""
if (m_timephasedOvertimeWork == null && m_timephasedWork != null && getOvertimeWork() != null)
{
... | java | public List<TimephasedWork> getTimephasedOvertimeWork()
{
if (m_timephasedOvertimeWork == null && m_timephasedWork != null && getOvertimeWork() != null)
{
double perDayFactor = getRemainingOvertimeWork().getDuration() / (getRemainingWork().getDuration() - getRemainingOvertimeWork().getDuration()... | [
"public",
"List",
"<",
"TimephasedWork",
">",
"getTimephasedOvertimeWork",
"(",
")",
"{",
"if",
"(",
"m_timephasedOvertimeWork",
"==",
"null",
"&&",
"m_timephasedWork",
"!=",
"null",
"&&",
"getOvertimeWork",
"(",
")",
"!=",
"null",
")",
"{",
"double",
"perDayFac... | Retrieves the timephased breakdown of the planned overtime work for this
resource assignment.
@return timephased planned work | [
"Retrieves",
"the",
"timephased",
"breakdown",
"of",
"the",
"planned",
"overtime",
"work",
"for",
"this",
"resource",
"assignment",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L587-L600 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/models/CDownloadRequest.java | CDownloadRequest.getByteSink | public ByteSink getByteSink() {
"""
If no progress listener has been set, return the byte sink defined in constructor, otherwise decorate it.
@return the byte sink to be used for download operations.
"""
ByteSink bs = byteSink;
if ( progressListener != null ) {
bs = new ProgressB... | java | public ByteSink getByteSink()
{
ByteSink bs = byteSink;
if ( progressListener != null ) {
bs = new ProgressByteSink( bs, progressListener );
}
return bs;
} | [
"public",
"ByteSink",
"getByteSink",
"(",
")",
"{",
"ByteSink",
"bs",
"=",
"byteSink",
";",
"if",
"(",
"progressListener",
"!=",
"null",
")",
"{",
"bs",
"=",
"new",
"ProgressByteSink",
"(",
"bs",
",",
"progressListener",
")",
";",
"}",
"return",
"bs",
";... | If no progress listener has been set, return the byte sink defined in constructor, otherwise decorate it.
@return the byte sink to be used for download operations. | [
"If",
"no",
"progress",
"listener",
"has",
"been",
"set",
"return",
"the",
"byte",
"sink",
"defined",
"in",
"constructor",
"otherwise",
"decorate",
"it",
"."
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/models/CDownloadRequest.java#L132-L139 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.ortho2D | public Matrix4f ortho2D(float left, float right, float bottom, float top) {
"""
Apply an orthographic projection transformation for a right-handed coordinate system to this matrix.
<p>
This method is equivalent to calling {@link #ortho(float, float, float, float, float, float) ortho()} with
<code>zNear=-1</code... | java | public Matrix4f ortho2D(float left, float right, float bottom, float top) {
return ortho2D(left, right, bottom, top, thisOrNew());
} | [
"public",
"Matrix4f",
"ortho2D",
"(",
"float",
"left",
",",
"float",
"right",
",",
"float",
"bottom",
",",
"float",
"top",
")",
"{",
"return",
"ortho2D",
"(",
"left",
",",
"right",
",",
"bottom",
",",
"top",
",",
"thisOrNew",
"(",
")",
")",
";",
"}"
... | Apply an orthographic projection transformation for a right-handed coordinate system to this matrix.
<p>
This method is equivalent to calling {@link #ortho(float, float, float, float, float, float) ortho()} with
<code>zNear=-1</code> and <code>zFar=+1</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>... | [
"Apply",
"an",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"to",
"this",
"matrix",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#ortho",
"(",
"float",
"f... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L7866-L7868 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/ToolScreen.java | ToolScreen.printData | public boolean printData(PrintWriter out, int iPrintOptions) {
"""
Display this control's data in print (view) format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
"""
boolean bControls = super.printData(out, iPrin... | java | public boolean printData(PrintWriter out, int iPrintOptions)
{
boolean bControls = super.printData(out, iPrintOptions);
bControls = this.getScreenFieldView().printToolbarData(bControls, out, iPrintOptions);
return bControls;
} | [
"public",
"boolean",
"printData",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"boolean",
"bControls",
"=",
"super",
".",
"printData",
"(",
"out",
",",
"iPrintOptions",
")",
";",
"bControls",
"=",
"this",
".",
"getScreenFieldView",
"(",
... | Display this control's data in print (view) format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception. | [
"Display",
"this",
"control",
"s",
"data",
"in",
"print",
"(",
"view",
")",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/ToolScreen.java#L201-L206 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/table/RtfBorderGroup.java | RtfBorderGroup.setBorder | private void setBorder(int borderPosition, int borderStyle, float borderWidth, Color borderColor) {
"""
Sets a border in the Hashtable of borders
@param borderPosition The position of this RtfBorder
@param borderStyle The type of borders this RtfBorderGroup contains
@param borderWidth The border width to use
... | java | private void setBorder(int borderPosition, int borderStyle, float borderWidth, Color borderColor) {
RtfBorder border = new RtfBorder(this.document, this.borderType, borderPosition, borderStyle, borderWidth, borderColor);
this.borders.put(Integer.valueOf(borderPosition), border);
} | [
"private",
"void",
"setBorder",
"(",
"int",
"borderPosition",
",",
"int",
"borderStyle",
",",
"float",
"borderWidth",
",",
"Color",
"borderColor",
")",
"{",
"RtfBorder",
"border",
"=",
"new",
"RtfBorder",
"(",
"this",
".",
"document",
",",
"this",
".",
"bord... | Sets a border in the Hashtable of borders
@param borderPosition The position of this RtfBorder
@param borderStyle The type of borders this RtfBorderGroup contains
@param borderWidth The border width to use
@param borderColor The border color to use | [
"Sets",
"a",
"border",
"in",
"the",
"Hashtable",
"of",
"borders"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/table/RtfBorderGroup.java#L149-L152 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.readUtf8Lines | public static <T extends Collection<String>> T readUtf8Lines(File file, T collection) throws IORuntimeException {
"""
从文件中读取每一行数据,数据编码为UTF-8
@param <T> 集合类型
@param file 文件路径
@param collection 集合
@return 文件中的每行内容的集合
@throws IORuntimeException IO异常
@since 3.1.1
"""
return readLines(file, CharsetUtil.C... | java | public static <T extends Collection<String>> T readUtf8Lines(File file, T collection) throws IORuntimeException {
return readLines(file, CharsetUtil.CHARSET_UTF_8, collection);
} | [
"public",
"static",
"<",
"T",
"extends",
"Collection",
"<",
"String",
">",
">",
"T",
"readUtf8Lines",
"(",
"File",
"file",
",",
"T",
"collection",
")",
"throws",
"IORuntimeException",
"{",
"return",
"readLines",
"(",
"file",
",",
"CharsetUtil",
".",
"CHARSET... | 从文件中读取每一行数据,数据编码为UTF-8
@param <T> 集合类型
@param file 文件路径
@param collection 集合
@return 文件中的每行内容的集合
@throws IORuntimeException IO异常
@since 3.1.1 | [
"从文件中读取每一行数据,数据编码为UTF",
"-",
"8"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2206-L2208 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java | FeatureIO.writeText | public static void writeText(String featuresFileName, double[][] features) throws Exception {
"""
Takes a two-dimensional double array with features and writes them in a comma separated text file.
@param featuresFileName
The text file's name.
@param features
The features.
@throws Exception
"""
Buffer... | java | public static void writeText(String featuresFileName, double[][] features) throws Exception {
BufferedWriter out = new BufferedWriter(new FileWriter(featuresFileName));
for (double[] feature : features) {
for (int j = 0; j < feature.length - 1; j++) {
out.write(feature[j] + ",");
}
out.write(feat... | [
"public",
"static",
"void",
"writeText",
"(",
"String",
"featuresFileName",
",",
"double",
"[",
"]",
"[",
"]",
"features",
")",
"throws",
"Exception",
"{",
"BufferedWriter",
"out",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWriter",
"(",
"featuresFileName",
... | Takes a two-dimensional double array with features and writes them in a comma separated text file.
@param featuresFileName
The text file's name.
@param features
The features.
@throws Exception | [
"Takes",
"a",
"two",
"-",
"dimensional",
"double",
"array",
"with",
"features",
"and",
"writes",
"them",
"in",
"a",
"comma",
"separated",
"text",
"file",
"."
] | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java#L121-L130 |
fflewddur/hola | src/main/java/net/straylightlabs/hola/sd/Query.java | Query.createWithTimeout | @SuppressWarnings("unused")
public static Query createWithTimeout(Service service, Domain domain, int timeout) {
"""
Create a Query for the given Service and Domain.
@param service service to search for
@param domain domain to search on
@param timeout time in MS to wait for a response
@return a new Quer... | java | @SuppressWarnings("unused")
public static Query createWithTimeout(Service service, Domain domain, int timeout) {
return new Query(service, domain, timeout);
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"static",
"Query",
"createWithTimeout",
"(",
"Service",
"service",
",",
"Domain",
"domain",
",",
"int",
"timeout",
")",
"{",
"return",
"new",
"Query",
"(",
"service",
",",
"domain",
",",
"timeout",
"... | Create a Query for the given Service and Domain.
@param service service to search for
@param domain domain to search on
@param timeout time in MS to wait for a response
@return a new Query object | [
"Create",
"a",
"Query",
"for",
"the",
"given",
"Service",
"and",
"Domain",
"."
] | train | https://github.com/fflewddur/hola/blob/08d9b9f3b807fd447181a5c1122f117a950db848/src/main/java/net/straylightlabs/hola/sd/Query.java#L95-L98 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDFactoryDaoImpl.java | GeneratedDFactoryDaoImpl.queryByClientSecret | public Iterable<DFactory> queryByClientSecret(java.lang.String clientSecret) {
"""
query-by method for field clientSecret
@param clientSecret the specified attribute
@return an Iterable of DFactorys for the specified clientSecret
"""
return queryByField(null, DFactoryMapper.Field.CLIENTSECRET.getFieldNam... | java | public Iterable<DFactory> queryByClientSecret(java.lang.String clientSecret) {
return queryByField(null, DFactoryMapper.Field.CLIENTSECRET.getFieldName(), clientSecret);
} | [
"public",
"Iterable",
"<",
"DFactory",
">",
"queryByClientSecret",
"(",
"java",
".",
"lang",
".",
"String",
"clientSecret",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DFactoryMapper",
".",
"Field",
".",
"CLIENTSECRET",
".",
"getFieldName",
"(",
")"... | query-by method for field clientSecret
@param clientSecret the specified attribute
@return an Iterable of DFactorys for the specified clientSecret | [
"query",
"-",
"by",
"method",
"for",
"field",
"clientSecret"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDFactoryDaoImpl.java#L88-L90 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.getFromTaskAsync | public Observable<InputStream> getFromTaskAsync(String jobId, String taskId, String filePath, FileGetFromTaskOptions fileGetFromTaskOptions) {
"""
Returns the content of the specified task file.
@param jobId The ID of the job that contains the task.
@param taskId The ID of the task whose file you want to retri... | java | public Observable<InputStream> getFromTaskAsync(String jobId, String taskId, String filePath, FileGetFromTaskOptions fileGetFromTaskOptions) {
return getFromTaskWithServiceResponseAsync(jobId, taskId, filePath, fileGetFromTaskOptions).map(new Func1<ServiceResponseWithHeaders<InputStream, FileGetFromTaskHeaders>... | [
"public",
"Observable",
"<",
"InputStream",
">",
"getFromTaskAsync",
"(",
"String",
"jobId",
",",
"String",
"taskId",
",",
"String",
"filePath",
",",
"FileGetFromTaskOptions",
"fileGetFromTaskOptions",
")",
"{",
"return",
"getFromTaskWithServiceResponseAsync",
"(",
"job... | Returns the content of the specified task file.
@param jobId The ID of the job that contains the task.
@param taskId The ID of the task whose file you want to retrieve.
@param filePath The path to the task file that you want to get the content of.
@param fileGetFromTaskOptions Additional parameters for the operation
@... | [
"Returns",
"the",
"content",
"of",
"the",
"specified",
"task",
"file",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L528-L535 |
badamowicz/sonar-hla | sonar-hla/src/main/java/com/github/badamowicz/sonar/hla/impl/DefaultSonarConverter.java | DefaultSonarConverter.surroundFields | private String surroundFields(String csvData) {
"""
Surround the given CSV data with quotations for every field.
@param csvData The original data without quotations.
@return A new string object with all fields being quoted.
"""
StringBuilder surroundedCSV = null;
StringTokenizer currTokeni... | java | private String surroundFields(String csvData) {
StringBuilder surroundedCSV = null;
StringTokenizer currTokenizer = null;
surroundedCSV = new StringBuilder();
for (String currLine : csvData.split(BREAK)) {
currTokenizer = new StringTokenizer(currLine, SEP);
w... | [
"private",
"String",
"surroundFields",
"(",
"String",
"csvData",
")",
"{",
"StringBuilder",
"surroundedCSV",
"=",
"null",
";",
"StringTokenizer",
"currTokenizer",
"=",
"null",
";",
"surroundedCSV",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"String"... | Surround the given CSV data with quotations for every field.
@param csvData The original data without quotations.
@return A new string object with all fields being quoted. | [
"Surround",
"the",
"given",
"CSV",
"data",
"with",
"quotations",
"for",
"every",
"field",
"."
] | train | https://github.com/badamowicz/sonar-hla/blob/21bd8a853d81966b47e96b518430abbc07ccd5f3/sonar-hla/src/main/java/com/github/badamowicz/sonar/hla/impl/DefaultSonarConverter.java#L192-L215 |
cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/Mappings.java | Mappings.toSubstructures | public Iterable<IAtomContainer> toSubstructures() {
"""
Obtain the mapped substructures (atoms/bonds) of the target compound. The atoms
and bonds are the same as in the target molecule but there may be less of them.
<blockquote><pre>
IAtomContainer query, target
Mappings mappings = ...;
for (IAtomContainer ... | java | public Iterable<IAtomContainer> toSubstructures() {
return FluentIterable.from(map(new ToAtomBondMap(query, target)))
.transform(new Function<Map<IChemObject, IChemObject>, IAtomContainer>() {
@Override
public IAtomCo... | [
"public",
"Iterable",
"<",
"IAtomContainer",
">",
"toSubstructures",
"(",
")",
"{",
"return",
"FluentIterable",
".",
"from",
"(",
"map",
"(",
"new",
"ToAtomBondMap",
"(",
"query",
",",
"target",
")",
")",
")",
".",
"transform",
"(",
"new",
"Function",
"<",... | Obtain the mapped substructures (atoms/bonds) of the target compound. The atoms
and bonds are the same as in the target molecule but there may be less of them.
<blockquote><pre>
IAtomContainer query, target
Mappings mappings = ...;
for (IAtomContainer mol : mol.toSubstructures()) {
for (IAtom atom : mol.atoms())
targe... | [
"Obtain",
"the",
"mapped",
"substructures",
"(",
"atoms",
"/",
"bonds",
")",
"of",
"the",
"target",
"compound",
".",
"The",
"atoms",
"and",
"bonds",
"are",
"the",
"same",
"as",
"in",
"the",
"target",
"molecule",
"but",
"there",
"may",
"be",
"less",
"of",... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/Mappings.java#L463-L478 |
marklogic/marklogic-contentpump | mapreduce/src/main/java/com/marklogic/mapreduce/utilities/InternalUtilities.java | InternalUtilities.getUriWithOutputDir | public static String getUriWithOutputDir(DocumentURI key, String outputDir) {
"""
If outputDir is available and valid, modify DocumentURI, and return uri
in string
@param key
@param outputDir
@return URI
"""
String uri = key.getUri();
if (outputDir != null && !outputDir.isEmpty()) {
... | java | public static String getUriWithOutputDir(DocumentURI key, String outputDir){
String uri = key.getUri();
if (outputDir != null && !outputDir.isEmpty()) {
uri = outputDir.endsWith("/") || uri.startsWith("/") ?
outputDir + uri : outputDir + '/' + uri;
key.setUri(u... | [
"public",
"static",
"String",
"getUriWithOutputDir",
"(",
"DocumentURI",
"key",
",",
"String",
"outputDir",
")",
"{",
"String",
"uri",
"=",
"key",
".",
"getUri",
"(",
")",
";",
"if",
"(",
"outputDir",
"!=",
"null",
"&&",
"!",
"outputDir",
".",
"isEmpty",
... | If outputDir is available and valid, modify DocumentURI, and return uri
in string
@param key
@param outputDir
@return URI | [
"If",
"outputDir",
"is",
"available",
"and",
"valid",
"modify",
"DocumentURI",
"and",
"return",
"uri",
"in",
"string"
] | train | https://github.com/marklogic/marklogic-contentpump/blob/4c41e4a953301f81a4c655efb2a847603dee8afc/mapreduce/src/main/java/com/marklogic/mapreduce/utilities/InternalUtilities.java#L424-L433 |
knightliao/apollo | src/main/java/com/github/knightliao/apollo/redis/RedisClient.java | RedisClient.getSet | public Object getSet(String key, Object value, Integer expiration) throws Exception {
"""
get old value and set new value
@param key
@param value
@param expiration
@return false if redis did not execute the option
@throws Exception
@author wangchongjie
"""
Jedis jedis = null;
try {... | java | public Object getSet(String key, Object value, Integer expiration) throws Exception {
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
long begin = System.currentTimeMillis();
// 操作expire成功返回1,失败返回0,仅当均返回1时,实际操作成功
byte[] val = jedis.getSet... | [
"public",
"Object",
"getSet",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"Integer",
"expiration",
")",
"throws",
"Exception",
"{",
"Jedis",
"jedis",
"=",
"null",
";",
"try",
"{",
"jedis",
"=",
"this",
".",
"jedisPool",
".",
"getResource",
"(",
")... | get old value and set new value
@param key
@param value
@param expiration
@return false if redis did not execute the option
@throws Exception
@author wangchongjie | [
"get",
"old",
"value",
"and",
"set",
"new",
"value"
] | train | https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L162-L197 |
h2oai/h2o-3 | h2o-algos/src/main/java/hex/deeplearning/DeepLearningTask.java | DeepLearningTask.bpropMiniBatch | static public void bpropMiniBatch(Neurons[] neurons, int n) {
"""
Helper to apply back-propagation without clearing out the gradients afterwards
Used for gradient checking
@param neurons
@param n number of trained examples in this last mini batch (usually == mini_batch_size, but can be less)
"""
neurons... | java | static public void bpropMiniBatch(Neurons[] neurons, int n) {
neurons[neurons.length - 1].bpropOutputLayer(n);
for (int i = neurons.length - 2; i > 0; --i)
neurons[i].bprop(n);
for (int mb=0;mb<n;++mb) {
// all errors are reset to 0
for (int i = 0; i<neurons.length ;++i) {
Storage... | [
"static",
"public",
"void",
"bpropMiniBatch",
"(",
"Neurons",
"[",
"]",
"neurons",
",",
"int",
"n",
")",
"{",
"neurons",
"[",
"neurons",
".",
"length",
"-",
"1",
"]",
".",
"bpropOutputLayer",
"(",
"n",
")",
";",
"for",
"(",
"int",
"i",
"=",
"neurons"... | Helper to apply back-propagation without clearing out the gradients afterwards
Used for gradient checking
@param neurons
@param n number of trained examples in this last mini batch (usually == mini_batch_size, but can be less) | [
"Helper",
"to",
"apply",
"back",
"-",
"propagation",
"without",
"clearing",
"out",
"the",
"gradients",
"afterwards",
"Used",
"for",
"gradient",
"checking"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/deeplearning/DeepLearningTask.java#L135-L148 |
BioPAX/Paxtools | sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java | L3ToSBGNPDConverter.getGlyphToLink | private Glyph getGlyphToLink(Entity e, String linkID) {
"""
/*
Gets the representing glyph of the PhysicalEntity or Gene.
@param e PhysicalEntity or Gene to get its glyph
@param linkID Edge id, used if the Entity is ubique
@return Representing glyph
"""
if (ubiqueDet == null || !ubiqueDet.isUbique(e))
... | java | private Glyph getGlyphToLink(Entity e, String linkID)
{
if (ubiqueDet == null || !ubiqueDet.isUbique(e))
{
return glyphMap.get(convertID(e.getUri()));
}
else {
// Create a new glyph for each use of ubique
Glyph g = createGlyphBasics(e, false);
g.setId(convertID(e.getUri()) + "_" + ModelUtils.md5hex... | [
"private",
"Glyph",
"getGlyphToLink",
"(",
"Entity",
"e",
",",
"String",
"linkID",
")",
"{",
"if",
"(",
"ubiqueDet",
"==",
"null",
"||",
"!",
"ubiqueDet",
".",
"isUbique",
"(",
"e",
")",
")",
"{",
"return",
"glyphMap",
".",
"get",
"(",
"convertID",
"("... | /*
Gets the representing glyph of the PhysicalEntity or Gene.
@param e PhysicalEntity or Gene to get its glyph
@param linkID Edge id, used if the Entity is ubique
@return Representing glyph | [
"/",
"*",
"Gets",
"the",
"representing",
"glyph",
"of",
"the",
"PhysicalEntity",
"or",
"Gene",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java#L510-L529 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.trClassHtmlContent | public static String trClassHtmlContent(String clazz, String... content) {
"""
Build a HTML TableRow with given CSS class for a string.
Use this method if given content contains HTML snippets, prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param clazz class for tr element
@param content content string... | java | public static String trClassHtmlContent(String clazz, String... content) {
return tagClassHtmlContent(Html.Tag.TR, clazz, content);
} | [
"public",
"static",
"String",
"trClassHtmlContent",
"(",
"String",
"clazz",
",",
"String",
"...",
"content",
")",
"{",
"return",
"tagClassHtmlContent",
"(",
"Html",
".",
"Tag",
".",
"TR",
",",
"clazz",
",",
"content",
")",
";",
"}"
] | Build a HTML TableRow with given CSS class for a string.
Use this method if given content contains HTML snippets, prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param clazz class for tr element
@param content content string
@return HTML tr element as string | [
"Build",
"a",
"HTML",
"TableRow",
"with",
"given",
"CSS",
"class",
"for",
"a",
"string",
".",
"Use",
"this",
"method",
"if",
"given",
"content",
"contains",
"HTML",
"snippets",
"prepared",
"with",
"{",
"@link",
"HtmlBuilder#htmlEncode",
"(",
"String",
")",
"... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L115-L117 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java | SQLiteDatabaseSchema.findColumnNameByPropertyName | public String findColumnNameByPropertyName(SQLiteModelMethod method, String propertyName) {
"""
get a.
@param method
the method
@param propertyName
the property name
@return the string
"""
Set<SQLProperty> propertiesSet = getPropertyBySimpleName(propertyName);
Set<String> set = new HashSet<String>()... | java | public String findColumnNameByPropertyName(SQLiteModelMethod method, String propertyName) {
Set<SQLProperty> propertiesSet = getPropertyBySimpleName(propertyName);
Set<String> set = new HashSet<String>();
String result = null;
for (SQLProperty item : propertiesSet) {
result = item.columnName;
set.add(ite... | [
"public",
"String",
"findColumnNameByPropertyName",
"(",
"SQLiteModelMethod",
"method",
",",
"String",
"propertyName",
")",
"{",
"Set",
"<",
"SQLProperty",
">",
"propertiesSet",
"=",
"getPropertyBySimpleName",
"(",
"propertyName",
")",
";",
"Set",
"<",
"String",
">"... | get a.
@param method
the method
@param propertyName
the property name
@return the string | [
"get",
"a",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java#L467-L481 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationChecker.java | ServerConfigurationChecker.regenerateReport | public synchronized void regenerateReport() {
"""
Checks the server-side configurations and records the check results.
"""
// Generate the configuration map from master and worker configuration records
Map<PropertyKey, Map<Optional<String>, List<String>>> confMap = generateConfMap();
// Update the... | java | public synchronized void regenerateReport() {
// Generate the configuration map from master and worker configuration records
Map<PropertyKey, Map<Optional<String>, List<String>>> confMap = generateConfMap();
// Update the errors and warnings configuration
Map<Scope, List<InconsistentProperty>> confErro... | [
"public",
"synchronized",
"void",
"regenerateReport",
"(",
")",
"{",
"// Generate the configuration map from master and worker configuration records",
"Map",
"<",
"PropertyKey",
",",
"Map",
"<",
"Optional",
"<",
"String",
">",
",",
"List",
"<",
"String",
">",
">",
">"... | Checks the server-side configurations and records the check results. | [
"Checks",
"the",
"server",
"-",
"side",
"configurations",
"and",
"records",
"the",
"check",
"results",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationChecker.java#L72-L106 |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/datamodel/DataModelFactory.java | DataModelFactory.createDependency | public static Dependency createDependency(final Artifact artifact, final Scope scope) {
"""
Generates a dependency regarding the parameters.
@param artifact Artifact
@param scope Scope
@return Dependency
"""
final Dependency dependency = new Dependency();
dependency.setTarget(artifact);
dependency.s... | java | public static Dependency createDependency(final Artifact artifact, final Scope scope){
final Dependency dependency = new Dependency();
dependency.setTarget(artifact);
dependency.setScope(scope);
return dependency;
} | [
"public",
"static",
"Dependency",
"createDependency",
"(",
"final",
"Artifact",
"artifact",
",",
"final",
"Scope",
"scope",
")",
"{",
"final",
"Dependency",
"dependency",
"=",
"new",
"Dependency",
"(",
")",
";",
"dependency",
".",
"setTarget",
"(",
"artifact",
... | Generates a dependency regarding the parameters.
@param artifact Artifact
@param scope Scope
@return Dependency | [
"Generates",
"a",
"dependency",
"regarding",
"the",
"parameters",
"."
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/datamodel/DataModelFactory.java#L143-L149 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getLong | public long getLong(String key, long defaultValue) {
"""
Returns the value associated with the given key as a long.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value ... | java | public long getLong(String key, long defaultValue) {
Object o = getRawValue(key);
if (o == null) {
return defaultValue;
}
return convertToLong(o, defaultValue);
} | [
"public",
"long",
"getLong",
"(",
"String",
"key",
",",
"long",
"defaultValue",
")",
"{",
"Object",
"o",
"=",
"getRawValue",
"(",
"key",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",
"convertToLong",
"(... | Returns the value associated with the given key as a long.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value associated with the given key | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"as",
"a",
"long",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L278-L285 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_billingAccountSite_POST | public void billingAccount_billingAccountSite_POST(String billingAccount, String billingAccountSite) throws IOException {
"""
Used to overwrite current billing account feature by the billing account site
REST: POST /telephony/{billingAccount}/billingAccountSite
@param billingAccountSite [required] Billing acco... | java | public void billingAccount_billingAccountSite_POST(String billingAccount, String billingAccountSite) throws IOException {
String qPath = "/telephony/{billingAccount}/billingAccountSite";
StringBuilder sb = path(qPath, billingAccount);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "billing... | [
"public",
"void",
"billingAccount_billingAccountSite_POST",
"(",
"String",
"billingAccount",
",",
"String",
"billingAccountSite",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/billingAccountSite\"",
";",
"StringBuilder",
"sb",
"=",
... | Used to overwrite current billing account feature by the billing account site
REST: POST /telephony/{billingAccount}/billingAccountSite
@param billingAccountSite [required] Billing account site (master billing account)
@param billingAccount [required] The name of your billingAccount | [
"Used",
"to",
"overwrite",
"current",
"billing",
"account",
"feature",
"by",
"the",
"billing",
"account",
"site"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5048-L5054 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/AbstractSailthruClient.java | AbstractSailthruClient.httpRequest | protected Object httpRequest(ApiAction action, HttpRequestMethod method, Map<String, Object> data) throws IOException {
"""
Make Http request to Sailthru API for given resource with given method and data
@param action
@param method
@param data parameter data
@return Object
@throws IOException
"""
... | java | protected Object httpRequest(ApiAction action, HttpRequestMethod method, Map<String, Object> data) throws IOException {
String url = this.apiUrl + "/" + action.toString().toLowerCase();
Type type = new TypeToken<Map<String, Object>>() {}.getType();
String json = GSON.toJson(data, type);
... | [
"protected",
"Object",
"httpRequest",
"(",
"ApiAction",
"action",
",",
"HttpRequestMethod",
"method",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"throws",
"IOException",
"{",
"String",
"url",
"=",
"this",
".",
"apiUrl",
"+",
"\"/\"",
"+",
... | Make Http request to Sailthru API for given resource with given method and data
@param action
@param method
@param data parameter data
@return Object
@throws IOException | [
"Make",
"Http",
"request",
"to",
"Sailthru",
"API",
"for",
"given",
"resource",
"with",
"given",
"method",
"and",
"data"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/AbstractSailthruClient.java#L153-L161 |
nguillaumin/slick2d-maven | slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/GradientEditor.java | GradientEditor.movePoint | private void movePoint(int mx, int my) {
"""
Move the current point to the specified mouse location
@param mx The x coordinate of the mouse
@param my The y coordinate of teh mouse
"""
if (!isEnabled()) {
return;
}
if (selected == null) {
return;
}
if (list.indexOf(selected) == 0)... | java | private void movePoint(int mx, int my) {
if (!isEnabled()) {
return;
}
if (selected == null) {
return;
}
if (list.indexOf(selected) == 0) {
return;
}
if (list.indexOf(selected) == list.size()-1) {
return;
}
float newPos = (mx - 10) / (float) width;
newPos = Math.min... | [
"private",
"void",
"movePoint",
"(",
"int",
"mx",
",",
"int",
"my",
")",
"{",
"if",
"(",
"!",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"selected",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"list",
".",
"index... | Move the current point to the specified mouse location
@param mx The x coordinate of the mouse
@param my The y coordinate of teh mouse | [
"Move",
"the",
"current",
"point",
"to",
"the",
"specified",
"mouse",
"location"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/GradientEditor.java#L294-L316 |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassInfo.java | ClassInfo.addSuperclass | void addSuperclass(final String superclassName, final Map<String, ClassInfo> classNameToClassInfo) {
"""
Add a superclass to this class.
@param superclassName
the superclass name
@param classNameToClassInfo
the map from class name to class info
"""
if (superclassName != null && !superclassName.eq... | java | void addSuperclass(final String superclassName, final Map<String, ClassInfo> classNameToClassInfo) {
if (superclassName != null && !superclassName.equals("java.lang.Object")) {
final ClassInfo superclassClassInfo = getOrCreateClassInfo(superclassName, /* classModifiers = */ 0,
cl... | [
"void",
"addSuperclass",
"(",
"final",
"String",
"superclassName",
",",
"final",
"Map",
"<",
"String",
",",
"ClassInfo",
">",
"classNameToClassInfo",
")",
"{",
"if",
"(",
"superclassName",
"!=",
"null",
"&&",
"!",
"superclassName",
".",
"equals",
"(",
"\"java.... | Add a superclass to this class.
@param superclassName
the superclass name
@param classNameToClassInfo
the map from class name to class info | [
"Add",
"a",
"superclass",
"to",
"this",
"class",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassInfo.java#L366-L373 |
ykrasik/jaci | jaci-utils/src/main/java/com/github/ykrasik/jaci/util/string/StringUtils.java | StringUtils.join | public static <T> String join(List<T> list, String delimiter) {
"""
Create a string out of the list's elements using the given delimiter.
@param list List to create a string from.
@param delimiter Delimiter to use between elements.
@param <T> Type of elements in the list.
@return A string created from the gi... | java | public static <T> String join(List<T> list, String delimiter) {
if (list.isEmpty()) {
return "";
}
final StringBuilder sb = new StringBuilder();
for (T element : list) {
sb.append(element);
sb.append(delimiter);
}
sb.delete(sb.length()... | [
"public",
"static",
"<",
"T",
">",
"String",
"join",
"(",
"List",
"<",
"T",
">",
"list",
",",
"String",
"delimiter",
")",
"{",
"if",
"(",
"list",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"final",
"StringBuilder",
"sb",
"=",
... | Create a string out of the list's elements using the given delimiter.
@param list List to create a string from.
@param delimiter Delimiter to use between elements.
@param <T> Type of elements in the list.
@return A string created from the given list's elements, delimited by the given delimiter. | [
"Create",
"a",
"string",
"out",
"of",
"the",
"list",
"s",
"elements",
"using",
"the",
"given",
"delimiter",
"."
] | train | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-utils/src/main/java/com/github/ykrasik/jaci/util/string/StringUtils.java#L112-L124 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newWasEndedBy | public WasEndedBy newWasEndedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger) {
"""
A factory method to create an instance of an end {@link WasEndedBy}
@param id
@param activity an identifier for the ended <a href="http://www.w3.org/TR/prov-dm/#end.activity">activity</a>
@param trigger an opt... | java | public WasEndedBy newWasEndedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger) {
WasEndedBy res = of.createWasEndedBy();
res.setId(id);
res.setActivity(activity);
res.setTrigger(trigger);
return res;
} | [
"public",
"WasEndedBy",
"newWasEndedBy",
"(",
"QualifiedName",
"id",
",",
"QualifiedName",
"activity",
",",
"QualifiedName",
"trigger",
")",
"{",
"WasEndedBy",
"res",
"=",
"of",
".",
"createWasEndedBy",
"(",
")",
";",
"res",
".",
"setId",
"(",
"id",
")",
";"... | A factory method to create an instance of an end {@link WasEndedBy}
@param id
@param activity an identifier for the ended <a href="http://www.w3.org/TR/prov-dm/#end.activity">activity</a>
@param trigger an optional identifier for the <a href="http://www.w3.org/TR/prov-dm/#end.trigger">entity triggering</a> the activity... | [
"A",
"factory",
"method",
"to",
"create",
"an",
"instance",
"of",
"an",
"end",
"{"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L1245-L1251 |
EdwardRaff/JSAT | JSAT/src/jsat/io/CSV.java | CSV.readR | public static RegressionDataSet readR(int numeric_target_column, Path path, int lines_to_skip, Set<Integer> cat_cols) throws IOException {
"""
Reads in a CSV dataset as a regression dataset.
@param numeric_target_column the column index (starting from zero) of the
feature that will be the target regression val... | java | public static RegressionDataSet readR(int numeric_target_column, Path path, int lines_to_skip, Set<Integer> cat_cols) throws IOException
{
return readR(numeric_target_column, path, DEFAULT_DELIMITER, lines_to_skip, DEFAULT_COMMENT, cat_cols);
} | [
"public",
"static",
"RegressionDataSet",
"readR",
"(",
"int",
"numeric_target_column",
",",
"Path",
"path",
",",
"int",
"lines_to_skip",
",",
"Set",
"<",
"Integer",
">",
"cat_cols",
")",
"throws",
"IOException",
"{",
"return",
"readR",
"(",
"numeric_target_column"... | Reads in a CSV dataset as a regression dataset.
@param numeric_target_column the column index (starting from zero) of the
feature that will be the target regression value
@param path the reader for the CSV content
@param lines_to_skip the number of lines to skip when reading in the CSV
(used to skip header information... | [
"Reads",
"in",
"a",
"CSV",
"dataset",
"as",
"a",
"regression",
"dataset",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/CSV.java#L74-L77 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.addMethod | @Nonnull
public BugInstance addMethod(MethodGen methodGen, String sourceFile) {
"""
Add a method annotation. If this is the first method annotation added, it
becomes the primary method annotation. If the method has source line
information, then a SourceLineAnnotation is added to the method.
@param methodG... | java | @Nonnull
public BugInstance addMethod(MethodGen methodGen, String sourceFile) {
String className = methodGen.getClassName();
MethodAnnotation methodAnnotation = new MethodAnnotation(className, methodGen.getName(), methodGen.getSignature(),
methodGen.isStatic());
addMethod(met... | [
"@",
"Nonnull",
"public",
"BugInstance",
"addMethod",
"(",
"MethodGen",
"methodGen",
",",
"String",
"sourceFile",
")",
"{",
"String",
"className",
"=",
"methodGen",
".",
"getClassName",
"(",
")",
";",
"MethodAnnotation",
"methodAnnotation",
"=",
"new",
"MethodAnno... | Add a method annotation. If this is the first method annotation added, it
becomes the primary method annotation. If the method has source line
information, then a SourceLineAnnotation is added to the method.
@param methodGen
the MethodGen object for the method
@param sourceFile
source file method is defined in
@return... | [
"Add",
"a",
"method",
"annotation",
".",
"If",
"this",
"is",
"the",
"first",
"method",
"annotation",
"added",
"it",
"becomes",
"the",
"primary",
"method",
"annotation",
".",
"If",
"the",
"method",
"has",
"source",
"line",
"information",
"then",
"a",
"SourceL... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1342-L1350 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java | WebhooksInner.getCallbackConfig | public CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName) {
"""
Gets the configuration of service URI and custom headers for the webhook.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName Th... | java | public CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName) {
return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body();
} | [
"public",
"CallbackConfigInner",
"getCallbackConfig",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"webhookName",
")",
"{",
"return",
"getCallbackConfigWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"webho... | Gets the configuration of service URI and custom headers for the webhook.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param webhookName The name of the webhook.
@throws IllegalArgumentException thrown if param... | [
"Gets",
"the",
"configuration",
"of",
"service",
"URI",
"and",
"custom",
"headers",
"for",
"the",
"webhook",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java#L965-L967 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java | CDKMCS.buildRGraph | public static CDKRGraph buildRGraph(IAtomContainer sourceGraph, IAtomContainer targetGraph, boolean shouldMatchBonds)
throws CDKException {
"""
Builds the CDKRGraph ( resolution graph ), from two atomContainer
(description of the two molecules to compare)
This is the interface point between the CDK m... | java | public static CDKRGraph buildRGraph(IAtomContainer sourceGraph, IAtomContainer targetGraph, boolean shouldMatchBonds)
throws CDKException {
CDKRGraph rGraph = new CDKRGraph();
nodeConstructor(rGraph, sourceGraph, targetGraph, shouldMatchBonds);
arcConstructor(rGraph, sourceGraph, tar... | [
"public",
"static",
"CDKRGraph",
"buildRGraph",
"(",
"IAtomContainer",
"sourceGraph",
",",
"IAtomContainer",
"targetGraph",
",",
"boolean",
"shouldMatchBonds",
")",
"throws",
"CDKException",
"{",
"CDKRGraph",
"rGraph",
"=",
"new",
"CDKRGraph",
"(",
")",
";",
"nodeCo... | Builds the CDKRGraph ( resolution graph ), from two atomContainer
(description of the two molecules to compare)
This is the interface point between the CDK model and
the generic MCSS algorithm based on the RGRaph.
@param sourceGraph Description of the first molecule
@param targetGraph Description of the second mol... | [
"Builds",
"the",
"CDKRGraph",
"(",
"resolution",
"graph",
")",
"from",
"two",
"atomContainer",
"(",
"description",
"of",
"the",
"two",
"molecules",
"to",
"compare",
")",
"This",
"is",
"the",
"interface",
"point",
"between",
"the",
"CDK",
"model",
"and",
"the... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java#L449-L455 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/util/MathUtils.java | MathUtils.ssError | public static double ssError(double[] predictedValues, double[] targetAttribute) {
"""
How much of the variance is NOT explained by the regression
@param predictedValues predicted values
@param targetAttribute data for target attribute
@return the sum squares of regression
"""
double ret = 0;
... | java | public static double ssError(double[] predictedValues, double[] targetAttribute) {
double ret = 0;
for (int i = 0; i < predictedValues.length; i++) {
ret += Math.pow(targetAttribute[i] - predictedValues[i], 2);
}
return ret;
} | [
"public",
"static",
"double",
"ssError",
"(",
"double",
"[",
"]",
"predictedValues",
",",
"double",
"[",
"]",
"targetAttribute",
")",
"{",
"double",
"ret",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"predictedValues",
".",
"length"... | How much of the variance is NOT explained by the regression
@param predictedValues predicted values
@param targetAttribute data for target attribute
@return the sum squares of regression | [
"How",
"much",
"of",
"the",
"variance",
"is",
"NOT",
"explained",
"by",
"the",
"regression"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/util/MathUtils.java#L188-L195 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java | StructureTools.addGroupsToStructure | public static void addGroupsToStructure(Structure s, Collection<Group> groups, int model, boolean clone) {
"""
Add a list of groups to a new structure. Chains will be automatically
created in the new structure as needed.
@param s structure to receive the group
@param g group to add
@param clone Indicates wheth... | java | public static void addGroupsToStructure(Structure s, Collection<Group> groups, int model, boolean clone) {
Chain chainGuess = null;
for(Group g : groups) {
chainGuess = addGroupToStructure(s, g, model, chainGuess, clone);
}
} | [
"public",
"static",
"void",
"addGroupsToStructure",
"(",
"Structure",
"s",
",",
"Collection",
"<",
"Group",
">",
"groups",
",",
"int",
"model",
",",
"boolean",
"clone",
")",
"{",
"Chain",
"chainGuess",
"=",
"null",
";",
"for",
"(",
"Group",
"g",
":",
"gr... | Add a list of groups to a new structure. Chains will be automatically
created in the new structure as needed.
@param s structure to receive the group
@param g group to add
@param clone Indicates whether the input groups should be cloned before
being added to the new chain | [
"Add",
"a",
"list",
"of",
"groups",
"to",
"a",
"new",
"structure",
".",
"Chains",
"will",
"be",
"automatically",
"created",
"in",
"the",
"new",
"structure",
"as",
"needed",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L587-L592 |
LevelFourAB/commons | commons-types/src/main/java/se/l4/commons/types/Types.java | Types.resolveSubtype | @NonNull
public static ResolvedType resolveSubtype(@NonNull ResolvedType superType, @NonNull Class<?> subType) {
"""
Resolve a sub type of the given super type.
@param superType
the super type
@param subType
the sub type to resolve
@return
resolved type
@see TypeResolver#resolveSubtype(ResolvedType, Clas... | java | @NonNull
public static ResolvedType resolveSubtype(@NonNull ResolvedType superType, @NonNull Class<?> subType)
{
return typeResolver.resolveSubtype(superType, subType);
} | [
"@",
"NonNull",
"public",
"static",
"ResolvedType",
"resolveSubtype",
"(",
"@",
"NonNull",
"ResolvedType",
"superType",
",",
"@",
"NonNull",
"Class",
"<",
"?",
">",
"subType",
")",
"{",
"return",
"typeResolver",
".",
"resolveSubtype",
"(",
"superType",
",",
"s... | Resolve a sub type of the given super type.
@param superType
the super type
@param subType
the sub type to resolve
@return
resolved type
@see TypeResolver#resolveSubtype(ResolvedType, Class) | [
"Resolve",
"a",
"sub",
"type",
"of",
"the",
"given",
"super",
"type",
"."
] | train | https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-types/src/main/java/se/l4/commons/types/Types.java#L72-L76 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.getMediaSourceDownload | public GetMediaSourceDownloadResponse getMediaSourceDownload(String mediaId, long expiredInSeconds) {
"""
get media source download url.
@param mediaId The unique ID for each media resource
@param expiredInSeconds The expire time
@return
"""
GetMediaSourceDownloadRequest request = new GetMediaSour... | java | public GetMediaSourceDownloadResponse getMediaSourceDownload(String mediaId, long expiredInSeconds) {
GetMediaSourceDownloadRequest request = new GetMediaSourceDownloadRequest()
.withMediaId(mediaId)
.withExpiredInSeconds(expiredInSeconds);
return getMediaSourceDownload(r... | [
"public",
"GetMediaSourceDownloadResponse",
"getMediaSourceDownload",
"(",
"String",
"mediaId",
",",
"long",
"expiredInSeconds",
")",
"{",
"GetMediaSourceDownloadRequest",
"request",
"=",
"new",
"GetMediaSourceDownloadRequest",
"(",
")",
".",
"withMediaId",
"(",
"mediaId",
... | get media source download url.
@param mediaId The unique ID for each media resource
@param expiredInSeconds The expire time
@return | [
"get",
"media",
"source",
"download",
"url",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L905-L910 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsContainerpageService.java | CmsContainerpageService.isEditingModelGroups | public static boolean isEditingModelGroups(CmsObject cms, CmsResource containerPage) {
"""
Checks whether the current page is a model group page.<p>
@param cms the CMS context
@param containerPage the current page
@return <code>true</code> if the current page is a model group page
"""
return (O... | java | public static boolean isEditingModelGroups(CmsObject cms, CmsResource containerPage) {
return (OpenCms.getResourceManager().getResourceType(containerPage).getTypeName().equals(
CmsResourceTypeXmlContainerPage.MODEL_GROUP_TYPE_NAME)
&& OpenCms.getRoleManager().hasRole(cms, CmsRole.DEVELO... | [
"public",
"static",
"boolean",
"isEditingModelGroups",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"containerPage",
")",
"{",
"return",
"(",
"OpenCms",
".",
"getResourceManager",
"(",
")",
".",
"getResourceType",
"(",
"containerPage",
")",
".",
"getTypeName",
"("... | Checks whether the current page is a model group page.<p>
@param cms the CMS context
@param containerPage the current page
@return <code>true</code> if the current page is a model group page | [
"Checks",
"whether",
"the",
"current",
"page",
"is",
"a",
"model",
"group",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsContainerpageService.java#L410-L415 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/redis/Cache.java | Cache.expireAt | public Long expireAt(Object key, long unixTime) {
"""
EXPIREAT 的作用和 EXPIRE 类似,都用于为 key 设置生存时间。不同在于 EXPIREAT 命令接受的时间参数是 UNIX 时间戳(unix timestamp)。
"""
Jedis jedis = getJedis();
try {
return jedis.expireAt(keyToBytes(key), unixTime);
}
finally {close(jedis);}
} | java | public Long expireAt(Object key, long unixTime) {
Jedis jedis = getJedis();
try {
return jedis.expireAt(keyToBytes(key), unixTime);
}
finally {close(jedis);}
} | [
"public",
"Long",
"expireAt",
"(",
"Object",
"key",
",",
"long",
"unixTime",
")",
"{",
"Jedis",
"jedis",
"=",
"getJedis",
"(",
")",
";",
"try",
"{",
"return",
"jedis",
".",
"expireAt",
"(",
"keyToBytes",
"(",
"key",
")",
",",
"unixTime",
")",
";",
"}... | EXPIREAT 的作用和 EXPIRE 类似,都用于为 key 设置生存时间。不同在于 EXPIREAT 命令接受的时间参数是 UNIX 时间戳(unix timestamp)。 | [
"EXPIREAT",
"的作用和",
"EXPIRE",
"类似,都用于为",
"key",
"设置生存时间。不同在于",
"EXPIREAT",
"命令接受的时间参数是",
"UNIX",
"时间戳",
"(",
"unix",
"timestamp",
")",
"。"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L329-L335 |
chocoteam/choco-graph | src/main/java/org/chocosolver/graphsolver/variables/GraphVar.java | GraphVar.enforceNode | public boolean enforceNode(int x, ICause cause) throws ContradictionException {
"""
Enforce the node x to belong to any solution
Adds x to the lower bound graph
@param x node's index
@param cause algorithm which is related to the modification
@return true iff the enforcing has an effect
"""
assert ... | java | public boolean enforceNode(int x, ICause cause) throws ContradictionException {
assert cause != null;
assert (x >= 0 && x < n);
if (UB.getNodes().contains(x)) {
if (LB.addNode(x)) {
if (reactOnModification) {
delta.add(x, GraphDelta.NE, cause);
}
GraphEventType e = GraphEventType.ADD_NODE;
... | [
"public",
"boolean",
"enforceNode",
"(",
"int",
"x",
",",
"ICause",
"cause",
")",
"throws",
"ContradictionException",
"{",
"assert",
"cause",
"!=",
"null",
";",
"assert",
"(",
"x",
">=",
"0",
"&&",
"x",
"<",
"n",
")",
";",
"if",
"(",
"UB",
".",
"getN... | Enforce the node x to belong to any solution
Adds x to the lower bound graph
@param x node's index
@param cause algorithm which is related to the modification
@return true iff the enforcing has an effect | [
"Enforce",
"the",
"node",
"x",
"to",
"belong",
"to",
"any",
"solution",
"Adds",
"x",
"to",
"the",
"lower",
"bound",
"graph"
] | train | https://github.com/chocoteam/choco-graph/blob/0a03b0aafc86601977728c7e3fcb5ed376f1fae9/src/main/java/org/chocosolver/graphsolver/variables/GraphVar.java#L147-L163 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/range/LocalTimeRangeRandomizer.java | LocalTimeRangeRandomizer.aNewLocalTimeRangeRandomizer | public static LocalTimeRangeRandomizer aNewLocalTimeRangeRandomizer(final LocalTime min, final LocalTime max, final long seed) {
"""
Create a new {@link LocalTimeRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link LocalTimeRangeRandomizer}.
"""
... | java | public static LocalTimeRangeRandomizer aNewLocalTimeRangeRandomizer(final LocalTime min, final LocalTime max, final long seed) {
return new LocalTimeRangeRandomizer(min, max, seed);
} | [
"public",
"static",
"LocalTimeRangeRandomizer",
"aNewLocalTimeRangeRandomizer",
"(",
"final",
"LocalTime",
"min",
",",
"final",
"LocalTime",
"max",
",",
"final",
"long",
"seed",
")",
"{",
"return",
"new",
"LocalTimeRangeRandomizer",
"(",
"min",
",",
"max",
",",
"s... | Create a new {@link LocalTimeRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link LocalTimeRangeRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"LocalTimeRangeRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/LocalTimeRangeRandomizer.java#L76-L78 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/script/ScriptfileUtils.java | ScriptfileUtils.writeScriptTempfile | public static File writeScriptTempfile(
final Framework framework,
final Reader source,
final LineEndingStyle style
)
throws IOException {
"""
Copy reader content to a tempfile for script execution
@param framework framework
@param source string content
@... | java | public static File writeScriptTempfile(
final Framework framework,
final Reader source,
final LineEndingStyle style
)
throws IOException
{
return writeScriptTempfile(framework, null, null, source, style);
} | [
"public",
"static",
"File",
"writeScriptTempfile",
"(",
"final",
"Framework",
"framework",
",",
"final",
"Reader",
"source",
",",
"final",
"LineEndingStyle",
"style",
")",
"throws",
"IOException",
"{",
"return",
"writeScriptTempfile",
"(",
"framework",
",",
"null",
... | Copy reader content to a tempfile for script execution
@param framework framework
@param source string content
@param style style
@return tempfile
@throws IOException if an error occurs | [
"Copy",
"reader",
"content",
"to",
"a",
"tempfile",
"for",
"script",
"execution"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/script/ScriptfileUtils.java#L170-L178 |
aws/aws-sdk-java | aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/TaskDefinition.java | TaskDefinition.getCompatibilities | public java.util.List<String> getCompatibilities() {
"""
<p>
The launch type to use with your task. For more information, see <a
href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html">Amazon ECS Launch Types</a>
in the <i>Amazon Elastic Container Service Developer Guide</i>.
</p>
... | java | public java.util.List<String> getCompatibilities() {
if (compatibilities == null) {
compatibilities = new com.amazonaws.internal.SdkInternalList<String>();
}
return compatibilities;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"getCompatibilities",
"(",
")",
"{",
"if",
"(",
"compatibilities",
"==",
"null",
")",
"{",
"compatibilities",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalList",
"<",... | <p>
The launch type to use with your task. For more information, see <a
href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html">Amazon ECS Launch Types</a>
in the <i>Amazon Elastic Container Service Developer Guide</i>.
</p>
@return The launch type to use with your task. For more informati... | [
"<p",
">",
"The",
"launch",
"type",
"to",
"use",
"with",
"your",
"task",
".",
"For",
"more",
"information",
"see",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
".",
"com",
"/",
"AmazonECS",
"/",
"latest",
"/",
"developerg... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/TaskDefinition.java#L1543-L1548 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsAfterPublishStaticExportHandler.java | CmsAfterPublishStaticExportHandler.exportAfterPublish | protected void exportAfterPublish(CmsUUID publishHistoryId, I_CmsReport report)
throws CmsException, IOException, ServletException {
"""
Starts the static export on publish.<p>
Exports all modified resources after a publish process into the real FS.<p>
@param publishHistoryId the publichHistoryId of the ... | java | protected void exportAfterPublish(CmsUUID publishHistoryId, I_CmsReport report)
throws CmsException, IOException, ServletException {
// first check if the test resource was published already
// if not, we must do a complete export of all static resources
String rfsName = CmsFileUtil.normali... | [
"protected",
"void",
"exportAfterPublish",
"(",
"CmsUUID",
"publishHistoryId",
",",
"I_CmsReport",
"report",
")",
"throws",
"CmsException",
",",
"IOException",
",",
"ServletException",
"{",
"// first check if the test resource was published already",
"// if not, we must do a comp... | Starts the static export on publish.<p>
Exports all modified resources after a publish process into the real FS.<p>
@param publishHistoryId the publichHistoryId of the published project
@param report an <code>{@link I_CmsReport}</code> instance to print output message, or <code>null</code> to write messages to the lo... | [
"Starts",
"the",
"static",
"export",
"on",
"publish",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsAfterPublishStaticExportHandler.java#L247-L278 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/optimization/AbstractStochasticCachingDiffFunction.java | AbstractStochasticCachingDiffFunction.getHdotVFiniteDifference | private void getHdotVFiniteDifference(double[] x, double[] v, double[] curDerivative) {
"""
Calculate the Hessian vector product with a vector v of the current function based on a finite difference approximation.
This is done using the approximation:
H.v ~ ( Grad( x + h * v ) - Grad( x ) ) / h
Note that thi... | java | private void getHdotVFiniteDifference(double[] x, double[] v, double[] curDerivative){
double h = finiteDifferenceStepSize;
double hInv = 1/h; // this avoids dividing too much since it's a bit more expensive than multiplying
if (gradPerturbed == null) {
gradPerturbed = new double[x.length... | [
"private",
"void",
"getHdotVFiniteDifference",
"(",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"v",
",",
"double",
"[",
"]",
"curDerivative",
")",
"{",
"double",
"h",
"=",
"finiteDifferenceStepSize",
";",
"double",
"hInv",
"=",
"1",
"/",
"h",
";",... | Calculate the Hessian vector product with a vector v of the current function based on a finite difference approximation.
This is done using the approximation:
H.v ~ ( Grad( x + h * v ) - Grad( x ) ) / h
Note that this method will not be exact, and the value of h should be choosen to be small enough to avoid truncatio... | [
"Calculate",
"the",
"Hessian",
"vector",
"product",
"with",
"a",
"vector",
"v",
"of",
"the",
"current",
"function",
"based",
"on",
"a",
"finite",
"difference",
"approximation",
".",
"This",
"is",
"done",
"using",
"the",
"approximation",
":"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/optimization/AbstractStochasticCachingDiffFunction.java#L422-L470 |
wcm-io/wcm-io-tooling | commons/content-package-builder/src/main/java/io/wcm/tooling/commons/contentpackagebuilder/XmlContentBuilder.java | XmlContentBuilder.buildNtFile | public Document buildNtFile(String mimeType, String encoding) {
"""
Build XML for nt:file
@param mimeType Mime type
@param encoding Encoding
@return nt:file XML
"""
Document doc = documentBuilder.newDocument();
Element jcrRoot = createJcrRoot(doc, NT_FILE);
Element jcrContent = createJcrContent(... | java | public Document buildNtFile(String mimeType, String encoding) {
Document doc = documentBuilder.newDocument();
Element jcrRoot = createJcrRoot(doc, NT_FILE);
Element jcrContent = createJcrContent(doc, jcrRoot, NT_RESOURCE);
if (StringUtils.isNotEmpty(mimeType)) {
setAttributeNamespaceAware(jcrCont... | [
"public",
"Document",
"buildNtFile",
"(",
"String",
"mimeType",
",",
"String",
"encoding",
")",
"{",
"Document",
"doc",
"=",
"documentBuilder",
".",
"newDocument",
"(",
")",
";",
"Element",
"jcrRoot",
"=",
"createJcrRoot",
"(",
"doc",
",",
"NT_FILE",
")",
";... | Build XML for nt:file
@param mimeType Mime type
@param encoding Encoding
@return nt:file XML | [
"Build",
"XML",
"for",
"nt",
":",
"file"
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/commons/content-package-builder/src/main/java/io/wcm/tooling/commons/contentpackagebuilder/XmlContentBuilder.java#L136-L149 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbCompanies.java | TmdbCompanies.getCompanyMovies | public ResultList<MovieBasic> getCompanyMovies(int companyId, String language, Integer page) throws MovieDbException {
"""
This method is used to retrieve the movies associated with a company.
These movies are returned in order of most recently released to oldest. The default response will return 20 movies per ... | java | public ResultList<MovieBasic> getCompanyMovies(int companyId, String language, Integer page) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, companyId);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.PAGE, page);
... | [
"public",
"ResultList",
"<",
"MovieBasic",
">",
"getCompanyMovies",
"(",
"int",
"companyId",
",",
"String",
"language",
",",
"Integer",
"page",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"... | This method is used to retrieve the movies associated with a company.
These movies are returned in order of most recently released to oldest. The default response will return 20 movies per page.
@param companyId
@param language
@param page
@return
@throws MovieDbException | [
"This",
"method",
"is",
"used",
"to",
"retrieve",
"the",
"movies",
"associated",
"with",
"a",
"company",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbCompanies.java#L86-L96 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendPong | public static <T> void sendPong(final ByteBuffer[] data, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context) {
"""
Sends a complete pong message, invoking the callback when complete
@param data The data to send
@param wsChannel The web socket channel
@param callback The callback ... | java | public static <T> void sendPong(final ByteBuffer[] data, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context) {
sendInternal(mergeBuffers(data), WebSocketFrameType.PONG, wsChannel, callback, context, -1);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"sendPong",
"(",
"final",
"ByteBuffer",
"[",
"]",
"data",
",",
"final",
"WebSocketChannel",
"wsChannel",
",",
"final",
"WebSocketCallback",
"<",
"T",
">",
"callback",
",",
"T",
"context",
")",
"{",
"sendInternal",
... | Sends a complete pong message, invoking the callback when complete
@param data The data to send
@param wsChannel The web socket channel
@param callback The callback to invoke on completion
@param context The context object that will be passed to the callback on completion | [
"Sends",
"a",
"complete",
"pong",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L470-L472 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DisasterRecoveryConfigurationsInner.java | DisasterRecoveryConfigurationsInner.beginFailoverAsync | public Observable<Void> beginFailoverAsync(String resourceGroupName, String serverName, String disasterRecoveryConfigurationName) {
"""
Fails over from the current primary server to this server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from th... | java | public Observable<Void> beginFailoverAsync(String resourceGroupName, String serverName, String disasterRecoveryConfigurationName) {
return beginFailoverWithServiceResponseAsync(resourceGroupName, serverName, disasterRecoveryConfigurationName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
... | [
"public",
"Observable",
"<",
"Void",
">",
"beginFailoverAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"disasterRecoveryConfigurationName",
")",
"{",
"return",
"beginFailoverWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Fails over from the current primary server to this server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param disasterRecoveryConfigurationName The name of the ... | [
"Fails",
"over",
"from",
"the",
"current",
"primary",
"server",
"to",
"this",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DisasterRecoveryConfigurationsInner.java#L736-L743 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java | ValueEnforcer.notEmpty | public static <T extends CharSequence> T notEmpty (final T aValue, @Nonnull final Supplier <? extends String> aName) {
"""
Check that the passed String is neither <code>null</code> nor empty.
@param <T>
Type to be checked and returned
@param aValue
The String to check.
@param aName
The name of the value (e... | java | public static <T extends CharSequence> T notEmpty (final T aValue, @Nonnull final Supplier <? extends String> aName)
{
notNull (aValue, aName);
if (isEnabled ())
if (aValue.length () == 0)
throw new IllegalArgumentException ("The value of the string '" + aName.get () + "' may not be empty!");
... | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"notEmpty",
"(",
"final",
"T",
"aValue",
",",
"@",
"Nonnull",
"final",
"Supplier",
"<",
"?",
"extends",
"String",
">",
"aName",
")",
"{",
"notNull",
"(",
"aValue",
",",
"aName",
")",
";... | Check that the passed String is neither <code>null</code> nor empty.
@param <T>
Type to be checked and returned
@param aValue
The String to check.
@param aName
The name of the value (e.g. the parameter name)
@return The passed value.
@throws IllegalArgumentException
if the passed value is empty | [
"Check",
"that",
"the",
"passed",
"String",
"is",
"neither",
"<code",
">",
"null<",
"/",
"code",
">",
"nor",
"empty",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L368-L375 |
geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.setCurrentValue | public void setCurrentValue(double curValue, boolean fireEvent) {
"""
Set the current value and optionally fire the onValueChange event.
@param curValue
the current value
@param fireEvent
fire the onValue change event if true
"""
// Confine the value to the range
this.curValue = Math.max(minValue, ... | java | public void setCurrentValue(double curValue, boolean fireEvent) {
// Confine the value to the range
this.curValue = Math.max(minValue, Math.min(maxValue, curValue));
double remainder = (this.curValue - minValue) % stepSize;
this.curValue -= remainder;
// Go to next step if more than halfway there
if... | [
"public",
"void",
"setCurrentValue",
"(",
"double",
"curValue",
",",
"boolean",
"fireEvent",
")",
"{",
"// Confine the value to the range\r",
"this",
".",
"curValue",
"=",
"Math",
".",
"max",
"(",
"minValue",
",",
"Math",
".",
"min",
"(",
"maxValue",
",",
"cur... | Set the current value and optionally fire the onValueChange event.
@param curValue
the current value
@param fireEvent
fire the onValue change event if true | [
"Set",
"the",
"current",
"value",
"and",
"optionally",
"fire",
"the",
"onValueChange",
"event",
"."
] | train | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L561-L579 |
Azure/azure-sdk-for-java | policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java | PolicyDefinitionsInner.getAtManagementGroup | public PolicyDefinitionInner getAtManagementGroup(String policyDefinitionName, String managementGroupId) {
"""
Gets the policy definition at management group level.
@param policyDefinitionName The name of the policy definition to get.
@param managementGroupId The ID of the management group.
@throws IllegalArg... | java | public PolicyDefinitionInner getAtManagementGroup(String policyDefinitionName, String managementGroupId) {
return getAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).toBlocking().single().body();
} | [
"public",
"PolicyDefinitionInner",
"getAtManagementGroup",
"(",
"String",
"policyDefinitionName",
",",
"String",
"managementGroupId",
")",
"{",
"return",
"getAtManagementGroupWithServiceResponseAsync",
"(",
"policyDefinitionName",
",",
"managementGroupId",
")",
".",
"toBlocking... | Gets the policy definition at management group level.
@param policyDefinitionName The name of the policy definition to get.
@param managementGroupId The ID of the management group.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by serv... | [
"Gets",
"the",
"policy",
"definition",
"at",
"management",
"group",
"level",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java#L623-L625 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.