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 |
|---|---|---|---|---|---|---|---|---|---|---|
berkesa/datatree | src/main/java/io/datatree/Tree.java | Tree.putMap | public Tree putMap(String path) {
"""
Associates the specified Map (~= JSON object) container with the
specified path. If the structure previously contained a mapping for the
path, the old value is replaced. Sample code:<br>
<br>
Tree node = new Tree();<br>
Tree map = node.putMap("a.b.c");<br>
map.put("d.e.f... | java | public Tree putMap(String path) {
return putObjectInternal(path, new LinkedHashMap<String, Object>(), false);
} | [
"public",
"Tree",
"putMap",
"(",
"String",
"path",
")",
"{",
"return",
"putObjectInternal",
"(",
"path",
",",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
",",
"false",
")",
";",
"}"
] | Associates the specified Map (~= JSON object) container with the
specified path. If the structure previously contained a mapping for the
path, the old value is replaced. Sample code:<br>
<br>
Tree node = new Tree();<br>
Tree map = node.putMap("a.b.c");<br>
map.put("d.e.f", 123);
@param path
path with which the specifi... | [
"Associates",
"the",
"specified",
"Map",
"(",
"~",
"=",
"JSON",
"object",
")",
"container",
"with",
"the",
"specified",
"path",
".",
"If",
"the",
"structure",
"previously",
"contained",
"a",
"mapping",
"for",
"the",
"path",
"the",
"old",
"value",
"is",
"re... | train | https://github.com/berkesa/datatree/blob/79aea9b45c7b46ab28af0a09310bc01c421c6b3a/src/main/java/io/datatree/Tree.java#L2010-L2012 |
j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java | OpenHelperManager.getHelper | @Deprecated
public static synchronized OrmLiteSqliteOpenHelper getHelper(Context context) {
"""
<p>
Similar to {@link #getHelper(Context, Class)} (which is recommended) except we have to find the helper class
through other means. This method requires that the Context be a class that extends one of ORMLite's And... | java | @Deprecated
public static synchronized OrmLiteSqliteOpenHelper getHelper(Context context) {
if (helperClass == null) {
if (context == null) {
throw new IllegalArgumentException("context argument is null");
}
Context appContext = context.getApplicationContext();
innerSetHelperClass(lookupHelperClass(a... | [
"@",
"Deprecated",
"public",
"static",
"synchronized",
"OrmLiteSqliteOpenHelper",
"getHelper",
"(",
"Context",
"context",
")",
"{",
"if",
"(",
"helperClass",
"==",
"null",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgument... | <p>
Similar to {@link #getHelper(Context, Class)} (which is recommended) except we have to find the helper class
through other means. This method requires that the Context be a class that extends one of ORMLite's Android base
classes such as {@link OrmLiteBaseActivity}. Either that or the helper class needs to be set i... | [
"<p",
">",
"Similar",
"to",
"{",
"@link",
"#getHelper",
"(",
"Context",
"Class",
")",
"}",
"(",
"which",
"is",
"recommended",
")",
"except",
"we",
"have",
"to",
"find",
"the",
"helper",
"class",
"through",
"other",
"means",
".",
"This",
"method",
"requir... | train | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java#L103-L113 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/support/ClassTypeInformation.java | ClassTypeInformation.getTypeVariableMap | private static Map<TypeVariable<?>, Type> getTypeVariableMap(Class<?> type) {
"""
Little helper to allow us to create a generified map, actually just to satisfy the compiler.
@param type must not be {@literal null}.
@return
"""
return getTypeVariableMap(type, new HashSet<Type>());
} | java | private static Map<TypeVariable<?>, Type> getTypeVariableMap(Class<?> type) {
return getTypeVariableMap(type, new HashSet<Type>());
} | [
"private",
"static",
"Map",
"<",
"TypeVariable",
"<",
"?",
">",
",",
"Type",
">",
"getTypeVariableMap",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"getTypeVariableMap",
"(",
"type",
",",
"new",
"HashSet",
"<",
"Type",
">",
"(",
")",
")",
... | Little helper to allow us to create a generified map, actually just to satisfy the compiler.
@param type must not be {@literal null}.
@return | [
"Little",
"helper",
"to",
"allow",
"us",
"to",
"create",
"a",
"generified",
"map",
"actually",
"just",
"to",
"satisfy",
"the",
"compiler",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/support/ClassTypeInformation.java#L132-L134 |
maxirosson/jdroid-android | jdroid-android-google-maps/src/main/java/com/jdroid/android/google/maps/GoogleRouteParser.java | GoogleRouteParser.decodePolyLine | private List<GeoLocation> decodePolyLine(String poly) {
"""
Decode a polyline string into a list of GeoLocations. From
https://developers.google.com/maps/documentation/directions/?hl=es#Limits
@param poly polyline encoded string to decode.
@return the list of GeoLocations represented by this polystring.
"... | java | private List<GeoLocation> decodePolyLine(String poly) {
int len = poly.length();
int index = 0;
List<GeoLocation> decoded = new ArrayList<>();
int lat = 0;
int lng = 0;
while (index < len) {
int b;
int shift = 0;
int result = 0;
do {
b = poly.charAt(index++) - 63;
result |= (b & 0x1f) <... | [
"private",
"List",
"<",
"GeoLocation",
">",
"decodePolyLine",
"(",
"String",
"poly",
")",
"{",
"int",
"len",
"=",
"poly",
".",
"length",
"(",
")",
";",
"int",
"index",
"=",
"0",
";",
"List",
"<",
"GeoLocation",
">",
"decoded",
"=",
"new",
"ArrayList",
... | Decode a polyline string into a list of GeoLocations. From
https://developers.google.com/maps/documentation/directions/?hl=es#Limits
@param poly polyline encoded string to decode.
@return the list of GeoLocations represented by this polystring. | [
"Decode",
"a",
"polyline",
"string",
"into",
"a",
"list",
"of",
"GeoLocations",
".",
"From",
"https",
":",
"//",
"developers",
".",
"google",
".",
"com",
"/",
"maps",
"/",
"documentation",
"/",
"directions",
"/",
"?hl",
"=",
"es#Limits"
] | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-google-maps/src/main/java/com/jdroid/android/google/maps/GoogleRouteParser.java#L55-L88 |
rzwitserloot/lombok | src/core/lombok/eclipse/handlers/HandleGetter.java | HandleGetter.generateGetterForField | public void generateGetterForField(EclipseNode fieldNode, ASTNode pos, AccessLevel level, boolean lazy, List<Annotation> onMethod) {
"""
Generates a getter on the stated field.
Used by {@link HandleData}.
The difference between this call and the handle method is as follows:
If there is a {@code lombok.Get... | java | public void generateGetterForField(EclipseNode fieldNode, ASTNode pos, AccessLevel level, boolean lazy, List<Annotation> onMethod) {
if (hasAnnotation(Getter.class, fieldNode)) {
//The annotation will make it happen, so we can skip it.
return;
}
createGetterForField(level, fieldNode, fieldNode, pos, fals... | [
"public",
"void",
"generateGetterForField",
"(",
"EclipseNode",
"fieldNode",
",",
"ASTNode",
"pos",
",",
"AccessLevel",
"level",
",",
"boolean",
"lazy",
",",
"List",
"<",
"Annotation",
">",
"onMethod",
")",
"{",
"if",
"(",
"hasAnnotation",
"(",
"Getter",
".",
... | Generates a getter on the stated field.
Used by {@link HandleData}.
The difference between this call and the handle method is as follows:
If there is a {@code lombok.Getter} annotation on the field, it is used and the
same rules apply (e.g. warning if the method already exists, stated access level applies).
If not, ... | [
"Generates",
"a",
"getter",
"on",
"the",
"stated",
"field",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/eclipse/handlers/HandleGetter.java#L125-L132 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadManager.java | HttpFileUploadManager.requestSlot | public Slot requestSlot(String filename, long fileSize, String contentType, DomainBareJid uploadServiceAddress)
throws SmackException, InterruptedException, XMPPException.XMPPErrorException {
"""
Request a new upload slot with optional content type from custom upload service.
When you get slot you s... | java | public Slot requestSlot(String filename, long fileSize, String contentType, DomainBareJid uploadServiceAddress)
throws SmackException, InterruptedException, XMPPException.XMPPErrorException {
final XMPPConnection connection = connection();
final UploadService defaultUploadService = this.defa... | [
"public",
"Slot",
"requestSlot",
"(",
"String",
"filename",
",",
"long",
"fileSize",
",",
"String",
"contentType",
",",
"DomainBareJid",
"uploadServiceAddress",
")",
"throws",
"SmackException",
",",
"InterruptedException",
",",
"XMPPException",
".",
"XMPPErrorException"... | Request a new upload slot with optional content type from custom upload service.
When you get slot you should upload file to PUT URL and share GET URL.
Note that this is a synchronous call -- Smack must wait for the server response.
@param filename name of file to be uploaded
@param fileSize file size in bytes.
@para... | [
"Request",
"a",
"new",
"upload",
"slot",
"with",
"optional",
"content",
"type",
"from",
"custom",
"upload",
"service",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadManager.java#L328-L374 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/replicator/PusherInternal.java | PusherInternal.findCommonAncestor | private static int findCommonAncestor(RevisionInternal rev, List<String> possibleRevIDs) {
"""
Given a revision and an array of revIDs, finds the latest common ancestor revID
and returns its generation #. If there is none, returns 0.
<p/>
int CBLFindCommonAncestor(CBL_Revision* rev, NSArray* possibleRevIDs) in ... | java | private static int findCommonAncestor(RevisionInternal rev, List<String> possibleRevIDs) {
if (possibleRevIDs == null || possibleRevIDs.size() == 0) {
return 0;
}
List<String> history = Database.parseCouchDBRevisionHistory(rev.getProperties());
//rev is missing _revisions pr... | [
"private",
"static",
"int",
"findCommonAncestor",
"(",
"RevisionInternal",
"rev",
",",
"List",
"<",
"String",
">",
"possibleRevIDs",
")",
"{",
"if",
"(",
"possibleRevIDs",
"==",
"null",
"||",
"possibleRevIDs",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"r... | Given a revision and an array of revIDs, finds the latest common ancestor revID
and returns its generation #. If there is none, returns 0.
<p/>
int CBLFindCommonAncestor(CBL_Revision* rev, NSArray* possibleRevIDs) in CBLRestPusher.m | [
"Given",
"a",
"revision",
"and",
"an",
"array",
"of",
"revIDs",
"finds",
"the",
"latest",
"common",
"ancestor",
"revID",
"and",
"returns",
"its",
"generation",
"#",
".",
"If",
"there",
"is",
"none",
"returns",
"0",
".",
"<p",
"/",
">",
"int",
"CBLFindCom... | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/replicator/PusherInternal.java#L670-L689 |
nicoulaj/checksum-maven-plugin | src/main/java/net/nicoulaj/maven/plugins/checksum/mojo/ArtifactsMojo.java | ArtifactsMojo.getFilesToProcess | @Override
protected List<ChecksumFile> getFilesToProcess() {
"""
Build the list of files from which digests should be generated.
<p>The list is composed of the project main and attached artifacts.</p>
@return the list of files that should be processed.
@see #hasValidFile(org.apache.maven.artifact.Artifa... | java | @Override
protected List<ChecksumFile> getFilesToProcess()
{
List<ChecksumFile> files = new LinkedList<ChecksumFile>();
// Add project main artifact.
if ( hasValidFile( project.getArtifact() ) )
{
files.add( new ChecksumFile( "", project.getArtifact().getFile(), proj... | [
"@",
"Override",
"protected",
"List",
"<",
"ChecksumFile",
">",
"getFilesToProcess",
"(",
")",
"{",
"List",
"<",
"ChecksumFile",
">",
"files",
"=",
"new",
"LinkedList",
"<",
"ChecksumFile",
">",
"(",
")",
";",
"// Add project main artifact.",
"if",
"(",
"hasVa... | Build the list of files from which digests should be generated.
<p>The list is composed of the project main and attached artifacts.</p>
@return the list of files that should be processed.
@see #hasValidFile(org.apache.maven.artifact.Artifact) | [
"Build",
"the",
"list",
"of",
"files",
"from",
"which",
"digests",
"should",
"be",
"generated",
"."
] | train | https://github.com/nicoulaj/checksum-maven-plugin/blob/8d8feab8a0a34e24ae41621e7372be6387e1fe55/src/main/java/net/nicoulaj/maven/plugins/checksum/mojo/ArtifactsMojo.java#L140-L163 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ExtUtils.java | ExtUtils.findResultConverter | public static Annotation findResultConverter(final Method method, final Class<?> root) {
"""
Searches for result converter annotations (annotations annotated with
{@link ru.vyarus.guice.persist.orient.repository.core.spi.result.ResultConverter}).
<p>
Annotation may be defined on method, type and probably global... | java | public static Annotation findResultConverter(final Method method, final Class<?> root) {
Annotation res = findSingleExtAnnotation(method, ResultConverter.class);
if (res == null) {
final List<Annotation> annotations = filterAnnotations(ResultConverter.class, root.getAnnotations());
... | [
"public",
"static",
"Annotation",
"findResultConverter",
"(",
"final",
"Method",
"method",
",",
"final",
"Class",
"<",
"?",
">",
"root",
")",
"{",
"Annotation",
"res",
"=",
"findSingleExtAnnotation",
"(",
"method",
",",
"ResultConverter",
".",
"class",
")",
";... | Searches for result converter annotations (annotations annotated with
{@link ru.vyarus.guice.persist.orient.repository.core.spi.result.ResultConverter}).
<p>
Annotation may be defined on method, type and probably globally on root repository type.
If annotation is defined in two places then only more prioritized will be... | [
"Searches",
"for",
"result",
"converter",
"annotations",
"(",
"annotations",
"annotated",
"with",
"{",
"@link",
"ru",
".",
"vyarus",
".",
"guice",
".",
"persist",
".",
"orient",
".",
"repository",
".",
"core",
".",
"spi",
".",
"result",
".",
"ResultConverter... | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ExtUtils.java#L126-L137 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/AvailabilityFactory.java | AvailabilityFactory.process | public void process(AvailabilityTable table, byte[] data) {
"""
Populates a resource availability table.
@param table resource availability table
@param data file data
"""
if (data != null)
{
Calendar cal = DateHelper.popCalendar();
int items = MPPUtility.getShort(data, 0);
... | java | public void process(AvailabilityTable table, byte[] data)
{
if (data != null)
{
Calendar cal = DateHelper.popCalendar();
int items = MPPUtility.getShort(data, 0);
int offset = 12;
for (int loop = 0; loop < items; loop++)
{
double unitsValue = MPPU... | [
"public",
"void",
"process",
"(",
"AvailabilityTable",
"table",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"if",
"(",
"data",
"!=",
"null",
")",
"{",
"Calendar",
"cal",
"=",
"DateHelper",
".",
"popCalendar",
"(",
")",
";",
"int",
"items",
"=",
"MPPUtilit... | Populates a resource availability table.
@param table resource availability table
@param data file data | [
"Populates",
"a",
"resource",
"availability",
"table",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/AvailabilityFactory.java#L46-L73 |
denisneuling/apitrary.jar | apitrary-api-client/src/main/java/com/apitrary/api/transport/ApiClientTransportFactory.java | ApiClientTransportFactory.newTransport | public Transport newTransport(ApitraryApi apitraryApi, Class<Transport> transportClazz) {
"""
<p>newTransport.</p>
@param apitraryApi a {@link com.apitrary.api.ApitraryApi} object.
@param transportClazz a {@link java.lang.Class} object.
@return a {@link com.apitrary.api.transport.Transport} object.
"""
... | java | public Transport newTransport(ApitraryApi apitraryApi, Class<Transport> transportClazz) {
try {
Transport transport = transportClazz.newInstance();
transport.setApitraryApi(apitraryApi);
return transport;
} catch (IllegalAccessException e) {
throw new ApiTransportException(e);
} catch (InstantiationEx... | [
"public",
"Transport",
"newTransport",
"(",
"ApitraryApi",
"apitraryApi",
",",
"Class",
"<",
"Transport",
">",
"transportClazz",
")",
"{",
"try",
"{",
"Transport",
"transport",
"=",
"transportClazz",
".",
"newInstance",
"(",
")",
";",
"transport",
".",
"setApitr... | <p>newTransport.</p>
@param apitraryApi a {@link com.apitrary.api.ApitraryApi} object.
@param transportClazz a {@link java.lang.Class} object.
@return a {@link com.apitrary.api.transport.Transport} object. | [
"<p",
">",
"newTransport",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-api-client/src/main/java/com/apitrary/api/transport/ApiClientTransportFactory.java#L75-L85 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withString | public Postcard withString(@Nullable String key, @Nullable String value) {
"""
Inserts a String value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a String, or null
@return current
"""
... | java | public Postcard withString(@Nullable String key, @Nullable String value) {
mBundle.putString(key, value);
return this;
} | [
"public",
"Postcard",
"withString",
"(",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"String",
"value",
")",
"{",
"mBundle",
".",
"putString",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a String value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a String, or null
@return current | [
"Inserts",
"a",
"String",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L244-L247 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.query | public static <T> T query(Connection conn, String sql, RsHandler<T> rsh, Object... params) throws SQLException {
"""
执行查询语句<br>
此方法不会关闭Connection
@param <T> 处理结果类型
@param conn 数据库连接对象
@param sql 查询语句
@param rsh 结果集处理对象
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常
"""
PreparedStatement... | java | public static <T> T query(Connection conn, String sql, RsHandler<T> rsh, Object... params) throws SQLException {
PreparedStatement ps = null;
try {
ps = StatementUtil.prepareStatement(conn, sql, params);
return executeQuery(ps, rsh);
} finally {
DbUtil.close(ps);
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"query",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"RsHandler",
"<",
"T",
">",
"rsh",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"ps",
"=",
"null",
";",
"... | 执行查询语句<br>
此方法不会关闭Connection
@param <T> 处理结果类型
@param conn 数据库连接对象
@param sql 查询语句
@param rsh 结果集处理对象
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常 | [
"执行查询语句<br",
">",
"此方法不会关闭Connection"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L258-L266 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/database/CmsHtmlImportConverter.java | CmsHtmlImportConverter.printDocument | private void printDocument(Node node, Hashtable properties) {
"""
Private method to parse DOM and create user defined output.<p>
@param node Node of DOM from HTML code
@param properties the file properties
"""
// if node is empty do nothing... (Recursion)
if (node == null) {
re... | java | private void printDocument(Node node, Hashtable properties) {
// if node is empty do nothing... (Recursion)
if (node == null) {
return;
}
// initialise local variables
int type = node.getNodeType();
String name = node.getNodeName();
// detect node ty... | [
"private",
"void",
"printDocument",
"(",
"Node",
"node",
",",
"Hashtable",
"properties",
")",
"{",
"// if node is empty do nothing... (Recursion)",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// initialise local variables",
"int",
"type",
"=",
... | Private method to parse DOM and create user defined output.<p>
@param node Node of DOM from HTML code
@param properties the file properties | [
"Private",
"method",
"to",
"parse",
"DOM",
"and",
"create",
"user",
"defined",
"output",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/database/CmsHtmlImportConverter.java#L321-L384 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.argsToMap | public static Map<String, String[]> argsToMap(String[] args) {
"""
Parses command line arguments into a Map. Arguments of the form
<p/>
-flag1 arg1a arg1b ... arg1m -flag2 -flag3 arg3a ... arg3n
<p/>
will be parsed so that the flag is a key in the Map (including
the hyphen) and its value will be a {@link Stri... | java | public static Map<String, String[]> argsToMap(String[] args) {
return argsToMap(args, new HashMap<String, Integer>());
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"argsToMap",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"return",
"argsToMap",
"(",
"args",
",",
"new",
"HashMap",
"<",
"String",
",",
"Integer",
">",
"(",
")",
")",
";",
"}"
] | Parses command line arguments into a Map. Arguments of the form
<p/>
-flag1 arg1a arg1b ... arg1m -flag2 -flag3 arg3a ... arg3n
<p/>
will be parsed so that the flag is a key in the Map (including
the hyphen) and its value will be a {@link String}[] containing
the optional arguments (if present). The non-flag values no... | [
"Parses",
"command",
"line",
"arguments",
"into",
"a",
"Map",
".",
"Arguments",
"of",
"the",
"form",
"<p",
"/",
">",
"-",
"flag1",
"arg1a",
"arg1b",
"...",
"arg1m",
"-",
"flag2",
"-",
"flag3",
"arg3a",
"...",
"arg3n",
"<p",
"/",
">",
"will",
"be",
"p... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L629-L631 |
real-logic/agrona | agrona/src/main/java/org/agrona/PrintBufferUtil.java | PrintBufferUtil.appendPrettyHexDump | public static void appendPrettyHexDump(final StringBuilder dump, final DirectBuffer buffer) {
"""
Appends the prettified multi-line hexadecimal dump of the specified {@link DirectBuffer} to the specified
{@link StringBuilder} that is easy to read by humans.
@param dump where should we append string represent... | java | public static void appendPrettyHexDump(final StringBuilder dump, final DirectBuffer buffer)
{
appendPrettyHexDump(dump, buffer, 0, buffer.capacity());
} | [
"public",
"static",
"void",
"appendPrettyHexDump",
"(",
"final",
"StringBuilder",
"dump",
",",
"final",
"DirectBuffer",
"buffer",
")",
"{",
"appendPrettyHexDump",
"(",
"dump",
",",
"buffer",
",",
"0",
",",
"buffer",
".",
"capacity",
"(",
")",
")",
";",
"}"
] | Appends the prettified multi-line hexadecimal dump of the specified {@link DirectBuffer} to the specified
{@link StringBuilder} that is easy to read by humans.
@param dump where should we append string representation of the buffer
@param buffer dumped buffer | [
"Appends",
"the",
"prettified",
"multi",
"-",
"line",
"hexadecimal",
"dump",
"of",
"the",
"specified",
"{",
"@link",
"DirectBuffer",
"}",
"to",
"the",
"specified",
"{",
"@link",
"StringBuilder",
"}",
"that",
"is",
"easy",
"to",
"read",
"by",
"humans",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/PrintBufferUtil.java#L135-L138 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.getStringsWithSubstring | public HashSet<String> getStringsWithSubstring(String str) {
"""
返回包含字串的key<br>
Retrieves all the Strings in the MDAG that contain a given String.
@param str a String that is contained in all the desired Strings
@return a HashSet containing all the Strings present in the MDAG that begin with {@code prefixStri... | java | public HashSet<String> getStringsWithSubstring(String str)
{
HashSet<String> strHashSet = new HashSet<String>();
if (sourceNode != null) //if the MDAG hasn't been simplified
getStrings(strHashSet, SearchCondition.SUBSTRING_SEARCH_CONDITION, str, "", sourceNode.getOutgoingTransition... | [
"public",
"HashSet",
"<",
"String",
">",
"getStringsWithSubstring",
"(",
"String",
"str",
")",
"{",
"HashSet",
"<",
"String",
">",
"strHashSet",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"sourceNode",
"!=",
"null",
")",
"//if t... | 返回包含字串的key<br>
Retrieves all the Strings in the MDAG that contain a given String.
@param str a String that is contained in all the desired Strings
@return a HashSet containing all the Strings present in the MDAG that begin with {@code prefixString} | [
"返回包含字串的key<br",
">",
"Retrieves",
"all",
"the",
"Strings",
"in",
"the",
"MDAG",
"that",
"contain",
"a",
"given",
"String",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L976-L986 |
amaembo/streamex | src/main/java/one/util/streamex/LongStreamEx.java | LongStreamEx.zip | public static LongStreamEx zip(long[] first, long[] second, LongBinaryOperator mapper) {
"""
Returns a sequential {@code LongStreamEx} containing the results of
applying the given function to the corresponding pairs of values in given
two arrays.
@param first the first array
@param second the second array
@... | java | public static LongStreamEx zip(long[] first, long[] second, LongBinaryOperator mapper) {
return of(new RangeBasedSpliterator.ZipLong(0, checkLength(first.length, second.length), mapper, first,
second));
} | [
"public",
"static",
"LongStreamEx",
"zip",
"(",
"long",
"[",
"]",
"first",
",",
"long",
"[",
"]",
"second",
",",
"LongBinaryOperator",
"mapper",
")",
"{",
"return",
"of",
"(",
"new",
"RangeBasedSpliterator",
".",
"ZipLong",
"(",
"0",
",",
"checkLength",
"(... | Returns a sequential {@code LongStreamEx} containing the results of
applying the given function to the corresponding pairs of values in given
two arrays.
@param first the first array
@param second the second array
@param mapper a non-interfering, stateless function to apply to each pair
of the corresponding array elem... | [
"Returns",
"a",
"sequential",
"{",
"@code",
"LongStreamEx",
"}",
"containing",
"the",
"results",
"of",
"applying",
"the",
"given",
"function",
"to",
"the",
"corresponding",
"pairs",
"of",
"values",
"in",
"given",
"two",
"arrays",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/LongStreamEx.java#L2050-L2053 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomMetadataWriter.java | AtomMetadataWriter.writeFeedLink | void writeFeedLink(Object entity, NavigationProperty property) throws XMLStreamException, ODataEdmException {
"""
Write a feed {@code <link>} element.
@throws XMLStreamException If unable to write to stream
"""
xmlWriter.writeStartElement(ATOM_LINK);
xmlWriter.writeAttribute(REL, SELF);
... | java | void writeFeedLink(Object entity, NavigationProperty property) throws XMLStreamException, ODataEdmException {
xmlWriter.writeStartElement(ATOM_LINK);
xmlWriter.writeAttribute(REL, SELF);
if (entity == null) {
if (ODataUriUtil.isActionCallUri(oDataUri) || ODataUriUtil.isFunctionCall... | [
"void",
"writeFeedLink",
"(",
"Object",
"entity",
",",
"NavigationProperty",
"property",
")",
"throws",
"XMLStreamException",
",",
"ODataEdmException",
"{",
"xmlWriter",
".",
"writeStartElement",
"(",
"ATOM_LINK",
")",
";",
"xmlWriter",
".",
"writeAttribute",
"(",
"... | Write a feed {@code <link>} element.
@throws XMLStreamException If unable to write to stream | [
"Write",
"a",
"feed",
"{",
"@code",
"<link",
">",
"}",
"element",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomMetadataWriter.java#L234-L262 |
konvergeio/cofoja | src/main/java/com/google/java/contract/util/Predicates.java | Predicates.forKeys | public static <K, V> Predicate<Map<K, V>> forKeys(
final Predicate<? super Set<K>> p) {
"""
Returns a predicate that evaluates to {@code true} if the key set
of its argument satisfies {@code p}.
"""
return new Predicate<Map<K, V>>() {
@Override
public boolean apply(Map<K, V> obj) {
... | java | public static <K, V> Predicate<Map<K, V>> forKeys(
final Predicate<? super Set<K>> p) {
return new Predicate<Map<K, V>>() {
@Override
public boolean apply(Map<K, V> obj) {
return p.apply(obj.keySet());
}
};
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Predicate",
"<",
"Map",
"<",
"K",
",",
"V",
">",
">",
"forKeys",
"(",
"final",
"Predicate",
"<",
"?",
"super",
"Set",
"<",
"K",
">",
">",
"p",
")",
"{",
"return",
"new",
"Predicate",
"<",
"Map",
"<"... | Returns a predicate that evaluates to {@code true} if the key set
of its argument satisfies {@code p}. | [
"Returns",
"a",
"predicate",
"that",
"evaluates",
"to",
"{"
] | train | https://github.com/konvergeio/cofoja/blob/6ded58fa05eb5bf85f16353c8dd4c70bee59121a/src/main/java/com/google/java/contract/util/Predicates.java#L254-L262 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hash/MurmurHash3Adaptor.java | MurmurHash3Adaptor.asInt | public static int asInt(final double datum, final int n) {
"""
Returns a deterministic uniform random integer between zero (inclusive) and
n (exclusive) given the input double.
@param datum the given double.
@param n The upper exclusive bound of the integers produced. Must be > 1.
@return deterministic unif... | java | public static int asInt(final double datum, final int n) {
final double d = (datum == 0.0) ? 0.0 : datum; //canonicalize -0.0, 0.0
final long[] data = { Double.doubleToLongBits(d) };//canonicalize all NaN forms
return asInteger(data, n); //data is long[]
} | [
"public",
"static",
"int",
"asInt",
"(",
"final",
"double",
"datum",
",",
"final",
"int",
"n",
")",
"{",
"final",
"double",
"d",
"=",
"(",
"datum",
"==",
"0.0",
")",
"?",
"0.0",
":",
"datum",
";",
"//canonicalize -0.0, 0.0",
"final",
"long",
"[",
"]",
... | Returns a deterministic uniform random integer between zero (inclusive) and
n (exclusive) given the input double.
@param datum the given double.
@param n The upper exclusive bound of the integers produced. Must be > 1.
@return deterministic uniform random integer | [
"Returns",
"a",
"deterministic",
"uniform",
"random",
"integer",
"between",
"zero",
"(",
"inclusive",
")",
"and",
"n",
"(",
"exclusive",
")",
"given",
"the",
"input",
"double",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hash/MurmurHash3Adaptor.java#L292-L296 |
RoaringBitmap/RoaringBitmap | jmh/src/main/java/org/roaringbitmap/bithacking/SelectBenchmark.java | SelectBenchmark.select | public static int select(short w, int j) {
"""
Given a word w, return the position of the jth true bit.
@param w word
@param j index
@return position of jth true bit in w
"""
int sumtotal = 0;
for (int counter = 0; counter < 16; ++counter) {
sumtotal += (w >> counter) & 1;
if (sumtotal... | java | public static int select(short w, int j) {
int sumtotal = 0;
for (int counter = 0; counter < 16; ++counter) {
sumtotal += (w >> counter) & 1;
if (sumtotal > j)
return counter;
}
throw new IllegalArgumentException(
"cannot locate " + j + "th bit in " + w + " weight is " + Inte... | [
"public",
"static",
"int",
"select",
"(",
"short",
"w",
",",
"int",
"j",
")",
"{",
"int",
"sumtotal",
"=",
"0",
";",
"for",
"(",
"int",
"counter",
"=",
"0",
";",
"counter",
"<",
"16",
";",
"++",
"counter",
")",
"{",
"sumtotal",
"+=",
"(",
"w",
... | Given a word w, return the position of the jth true bit.
@param w word
@param j index
@return position of jth true bit in w | [
"Given",
"a",
"word",
"w",
"return",
"the",
"position",
"of",
"the",
"jth",
"true",
"bit",
"."
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/jmh/src/main/java/org/roaringbitmap/bithacking/SelectBenchmark.java#L155-L164 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.rebootWorkerAsync | public Observable<Void> rebootWorkerAsync(String resourceGroupName, String name, String workerName) {
"""
Reboot a worker machine in an App Service plan.
Reboot a worker machine in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the A... | java | public Observable<Void> rebootWorkerAsync(String resourceGroupName, String name, String workerName) {
return rebootWorkerWithServiceResponseAsync(resourceGroupName, name, workerName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response)... | [
"public",
"Observable",
"<",
"Void",
">",
"rebootWorkerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"workerName",
")",
"{",
"return",
"rebootWorkerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"workerName",... | Reboot a worker machine in an App Service plan.
Reboot a worker machine in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param workerName Name of worker machine, which typically starts with RD.
@throws IllegalArgumentE... | [
"Reboot",
"a",
"worker",
"machine",
"in",
"an",
"App",
"Service",
"plan",
".",
"Reboot",
"a",
"worker",
"machine",
"in",
"an",
"App",
"Service",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L3951-L3958 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClient.java | ManagementClient.deleteSubscription | public Void deleteSubscription(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException {
"""
Deletes the subscription described by the topicPath and the subscriptionName.
@param topicPath - The name of the topic.
@param subscriptionName - The name of the subscription.
@throws... | java | public Void deleteSubscription(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException {
return Utils.completeFuture(this.asyncClient.deleteSubscriptionAsync(topicPath, subscriptionName));
} | [
"public",
"Void",
"deleteSubscription",
"(",
"String",
"topicPath",
",",
"String",
"subscriptionName",
")",
"throws",
"ServiceBusException",
",",
"InterruptedException",
"{",
"return",
"Utils",
".",
"completeFuture",
"(",
"this",
".",
"asyncClient",
".",
"deleteSubscr... | Deletes the subscription described by the topicPath and the subscriptionName.
@param topicPath - The name of the topic.
@param subscriptionName - The name of the subscription.
@throws IllegalArgumentException - path is not null / empty / too long / invalid.
@throws TimeoutException - The operation times out. The timeou... | [
"Deletes",
"the",
"subscription",
"described",
"by",
"the",
"topicPath",
"and",
"the",
"subscriptionName",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClient.java#L598-L600 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/impl/ServerEvaluationCallImpl.java | ServerEvaluationCallImpl.addVariableAs | @Override
public ServerEvaluationCall addVariableAs(String name, Object value) {
"""
Like other *As convenience methods throughout the API, the Object value
is managed by the Handle registered for that Class.
"""
if (value == null) return this;
Class<?> as = value.getClass();
AbstractWriteHandl... | java | @Override
public ServerEvaluationCall addVariableAs(String name, Object value) {
if (value == null) return this;
Class<?> as = value.getClass();
AbstractWriteHandle writeHandle = null;
if (AbstractWriteHandle.class.isAssignableFrom(as)) {
writeHandle = (AbstractWriteHandle) value;
} else {
... | [
"@",
"Override",
"public",
"ServerEvaluationCall",
"addVariableAs",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"this",
";",
"Class",
"<",
"?",
">",
"as",
"=",
"value",
".",
"getClass",
"(",
... | Like other *As convenience methods throughout the API, the Object value
is managed by the Handle registered for that Class. | [
"Like",
"other",
"*",
"As",
"convenience",
"methods",
"throughout",
"the",
"API",
"the",
"Object",
"value",
"is",
"managed",
"by",
"the",
"Handle",
"registered",
"for",
"that",
"Class",
"."
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/impl/ServerEvaluationCallImpl.java#L114-L128 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorHsv.java | ColorHsv.rgbToHsv | public static void rgbToHsv( double r , double g , double b , double []hsv ) {
"""
Convert RGB color into HSV color
@param r red
@param g green
@param b blue
@param hsv (Output) HSV value.
"""
// Maximum value
double max = r > g ? ( r > b ? r : b) : ( g > b ? g : b );
// Minimum value
double min ... | java | public static void rgbToHsv( double r , double g , double b , double []hsv ) {
// Maximum value
double max = r > g ? ( r > b ? r : b) : ( g > b ? g : b );
// Minimum value
double min = r < g ? ( r < b ? r : b) : ( g < b ? g : b );
double delta = max - min;
hsv[2] = max;
if( max != 0 )
hsv[1] = delta ... | [
"public",
"static",
"void",
"rgbToHsv",
"(",
"double",
"r",
",",
"double",
"g",
",",
"double",
"b",
",",
"double",
"[",
"]",
"hsv",
")",
"{",
"// Maximum value",
"double",
"max",
"=",
"r",
">",
"g",
"?",
"(",
"r",
">",
"b",
"?",
"r",
":",
"b",
... | Convert RGB color into HSV color
@param r red
@param g green
@param b blue
@param hsv (Output) HSV value. | [
"Convert",
"RGB",
"color",
"into",
"HSV",
"color"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorHsv.java#L207-L237 |
amazon-archives/aws-sdk-java-resources | aws-resources-core/src/main/java/com/amazonaws/resources/internal/ReflectionUtils.java | ReflectionUtils.findAccessor | private static Method findAccessor(Object target, String propertyName) {
"""
Returns the accessor method for the specified member property.
For example, if the member property is "Foo", this method looks
for a "getFoo()" method and an "isFoo()" method.
If no accessor is found, this method throws an IllegalSta... | java | private static Method findAccessor(Object target, String propertyName) {
propertyName = propertyName.substring(0, 1).toUpperCase()
+ propertyName.substring(1);
try {
return target.getClass().getMethod("get" + propertyName);
} catch (NoSuchMethodException nsme) ... | [
"private",
"static",
"Method",
"findAccessor",
"(",
"Object",
"target",
",",
"String",
"propertyName",
")",
"{",
"propertyName",
"=",
"propertyName",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toUpperCase",
"(",
")",
"+",
"propertyName",
".",
"substrin... | Returns the accessor method for the specified member property.
For example, if the member property is "Foo", this method looks
for a "getFoo()" method and an "isFoo()" method.
If no accessor is found, this method throws an IllegalStateException.
@param target the object to reflect on
@param propertyName the name of t... | [
"Returns",
"the",
"accessor",
"method",
"for",
"the",
"specified",
"member",
"property",
".",
"For",
"example",
"if",
"the",
"member",
"property",
"is",
"Foo",
"this",
"method",
"looks",
"for",
"a",
"getFoo",
"()",
"method",
"and",
"an",
"isFoo",
"()",
"me... | train | https://github.com/amazon-archives/aws-sdk-java-resources/blob/0f4fef2615d9687997b70a36eed1d62dd42df035/aws-resources-core/src/main/java/com/amazonaws/resources/internal/ReflectionUtils.java#L464-L485 |
michael-rapp/AndroidBottomSheet | library/src/main/java/de/mrapp/android/bottomsheet/BottomSheet.java | BottomSheet.setDivider | public final void setDivider(final int index, @Nullable final CharSequence title) {
"""
Replaces the item at a specific index with a divider.
@param index
The index of the item, which should be replaced, as an {@link Integer} value
@param title
The title of the divider, which should be added, as an instance ... | java | public final void setDivider(final int index, @Nullable final CharSequence title) {
Divider divider = new Divider();
divider.setTitle(title);
adapter.set(index, divider);
adaptGridViewHeight();
} | [
"public",
"final",
"void",
"setDivider",
"(",
"final",
"int",
"index",
",",
"@",
"Nullable",
"final",
"CharSequence",
"title",
")",
"{",
"Divider",
"divider",
"=",
"new",
"Divider",
"(",
")",
";",
"divider",
".",
"setTitle",
"(",
"title",
")",
";",
"adap... | Replaces the item at a specific index with a divider.
@param index
The index of the item, which should be replaced, as an {@link Integer} value
@param title
The title of the divider, which should be added, as an instance of the type {@link
CharSequence}, or null, if no title should be used | [
"Replaces",
"the",
"item",
"at",
"a",
"specific",
"index",
"with",
"a",
"divider",
"."
] | train | https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/library/src/main/java/de/mrapp/android/bottomsheet/BottomSheet.java#L2185-L2190 |
groupe-sii/ogham | ogham-email-sendgrid/src/main/java/fr/sii/ogham/email/sender/impl/sendgrid/handler/StringContentHandler.java | StringContentHandler.setContent | @Override
public void setContent(final Email email, final Content content) throws ContentHandlerException {
"""
Reads the content and adds it into the email. This method is expected to
update the content of the {@code email} parameter.
While the method signature accepts any {@link Content} instance as
param... | java | @Override
public void setContent(final Email email, final Content content) throws ContentHandlerException {
if (email == null) {
throw new IllegalArgumentException("[email] cannot be null");
}
if (content == null) {
throw new IllegalArgumentException("[content] cannot be null");
}
if (content... | [
"@",
"Override",
"public",
"void",
"setContent",
"(",
"final",
"Email",
"email",
",",
"final",
"Content",
"content",
")",
"throws",
"ContentHandlerException",
"{",
"if",
"(",
"email",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"... | Reads the content and adds it into the email. This method is expected to
update the content of the {@code email} parameter.
While the method signature accepts any {@link Content} instance as
parameter, the method will fail if anything other than a
{@link StringContent} is provided.
@param email
the email to put the c... | [
"Reads",
"the",
"content",
"and",
"adds",
"it",
"into",
"the",
"email",
".",
"This",
"method",
"is",
"expected",
"to",
"update",
"the",
"content",
"of",
"the",
"{",
"@code",
"email",
"}",
"parameter",
"."
] | train | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-sendgrid/src/main/java/fr/sii/ogham/email/sender/impl/sendgrid/handler/StringContentHandler.java#L57-L80 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java | FTPFileSystem.exists | private boolean exists(FTPClient client, Path file) {
"""
Convenience method, so that we don't open a new connection when using this
method from within another method. Otherwise every API invocation incurs
the overhead of opening/closing a TCP connection.
"""
try {
return getFileStatus(client, file... | java | private boolean exists(FTPClient client, Path file) {
try {
return getFileStatus(client, file) != null;
} catch (FileNotFoundException fnfe) {
return false;
} catch (IOException ioe) {
throw new FTPException("Failed to get file status", ioe);
}
} | [
"private",
"boolean",
"exists",
"(",
"FTPClient",
"client",
",",
"Path",
"file",
")",
"{",
"try",
"{",
"return",
"getFileStatus",
"(",
"client",
",",
"file",
")",
"!=",
"null",
";",
"}",
"catch",
"(",
"FileNotFoundException",
"fnfe",
")",
"{",
"return",
... | Convenience method, so that we don't open a new connection when using this
method from within another method. Otherwise every API invocation incurs
the overhead of opening/closing a TCP connection. | [
"Convenience",
"method",
"so",
"that",
"we",
"don",
"t",
"open",
"a",
"new",
"connection",
"when",
"using",
"this",
"method",
"from",
"within",
"another",
"method",
".",
"Otherwise",
"every",
"API",
"invocation",
"incurs",
"the",
"overhead",
"of",
"opening",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java#L258-L266 |
DiUS/pact-jvm | pact-jvm-consumer-java8/src/main/java/io/pactfoundation/consumer/dsl/LambdaDslObject.java | LambdaDslObject.minArrayLike | public LambdaDslObject minArrayLike(String name, Integer size, Consumer<LambdaDslObject> nestedObject) {
"""
Attribute that is an array with a minimum size where each item must match the following example
@param name field name
@param size minimum size of the array
"""
final PactDslJsonBody minArra... | java | public LambdaDslObject minArrayLike(String name, Integer size, Consumer<LambdaDslObject> nestedObject) {
final PactDslJsonBody minArrayLike = object.minArrayLike(name, size);
final LambdaDslObject dslObject = new LambdaDslObject(minArrayLike);
nestedObject.accept(dslObject);
minArrayLike... | [
"public",
"LambdaDslObject",
"minArrayLike",
"(",
"String",
"name",
",",
"Integer",
"size",
",",
"Consumer",
"<",
"LambdaDslObject",
">",
"nestedObject",
")",
"{",
"final",
"PactDslJsonBody",
"minArrayLike",
"=",
"object",
".",
"minArrayLike",
"(",
"name",
",",
... | Attribute that is an array with a minimum size where each item must match the following example
@param name field name
@param size minimum size of the array | [
"Attribute",
"that",
"is",
"an",
"array",
"with",
"a",
"minimum",
"size",
"where",
"each",
"item",
"must",
"match",
"the",
"following",
"example"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer-java8/src/main/java/io/pactfoundation/consumer/dsl/LambdaDslObject.java#L438-L444 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsDynamicFunctionParser.java | CmsDynamicFunctionParser.getLocaleToUse | protected Locale getLocaleToUse(CmsObject cms, CmsXmlContent xmlContent) {
"""
Gets the locale to use for parsing the dynamic function.<p>
@param cms the current CMS context
@param xmlContent the xml content from which the dynamic function should be read
@return the locale from which the dynamic function sh... | java | protected Locale getLocaleToUse(CmsObject cms, CmsXmlContent xmlContent) {
Locale contextLocale = cms.getRequestContext().getLocale();
if (xmlContent.hasLocale(contextLocale)) {
return contextLocale;
}
Locale defaultLocale = CmsLocaleManager.getDefaultLocale();
... | [
"protected",
"Locale",
"getLocaleToUse",
"(",
"CmsObject",
"cms",
",",
"CmsXmlContent",
"xmlContent",
")",
"{",
"Locale",
"contextLocale",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getLocale",
"(",
")",
";",
"if",
"(",
"xmlContent",
".",
"hasLocale... | Gets the locale to use for parsing the dynamic function.<p>
@param cms the current CMS context
@param xmlContent the xml content from which the dynamic function should be read
@return the locale from which the dynamic function should be read | [
"Gets",
"the",
"locale",
"to",
"use",
"for",
"parsing",
"the",
"dynamic",
"function",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsDynamicFunctionParser.java#L158-L173 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/util/UpgradeInputByteBufferUtil.java | UpgradeInputByteBufferUtil.validate | private void validate() throws IOException {
"""
This checks if we have already had an exception thrown. If so it just rethrows that exception
This check is done before any reads are done
@throws IOException
"""
if (null != _error) {
throw _error;
}
if(!_isReadL... | java | private void validate() throws IOException {
if (null != _error) {
throw _error;
}
if(!_isReadLine && !_isReady){
//If there is no data available then isReady will have returned false and this throw an IllegalStateException
if (TraceComponent.isAnyTra... | [
"private",
"void",
"validate",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"null",
"!=",
"_error",
")",
"{",
"throw",
"_error",
";",
"}",
"if",
"(",
"!",
"_isReadLine",
"&&",
"!",
"_isReady",
")",
"{",
"//If there is no data available then isReady will ... | This checks if we have already had an exception thrown. If so it just rethrows that exception
This check is done before any reads are done
@throws IOException | [
"This",
"checks",
"if",
"we",
"have",
"already",
"had",
"an",
"exception",
"thrown",
".",
"If",
"so",
"it",
"just",
"rethrows",
"that",
"exception",
"This",
"check",
"is",
"done",
"before",
"any",
"reads",
"are",
"done"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/util/UpgradeInputByteBufferUtil.java#L309-L320 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java | AlignmentTools.replaceOptAln | public static AFPChain replaceOptAln(AFPChain afpChain, Atom[] ca1, Atom[] ca2,
Map<Integer, Integer> alignment) throws StructureException {
"""
Takes an AFPChain and replaces the optimal alignment based on an alignment map
<p>Parameters are filled with defaults (often null) or sometimes
calculated.... | java | public static AFPChain replaceOptAln(AFPChain afpChain, Atom[] ca1, Atom[] ca2,
Map<Integer, Integer> alignment) throws StructureException {
// Determine block lengths
// Sort ca1 indices, then start a new block whenever ca2 indices aren't
// increasing monotonically.
Integer[] res1 = alignment.keyS... | [
"public",
"static",
"AFPChain",
"replaceOptAln",
"(",
"AFPChain",
"afpChain",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"alignment",
")",
"throws",
"StructureException",
"{",
"// Determine bl... | Takes an AFPChain and replaces the optimal alignment based on an alignment map
<p>Parameters are filled with defaults (often null) or sometimes
calculated.
<p>For a way to create a new AFPChain, see
{@link AlignmentTools#createAFPChain(Atom[], Atom[], ResidueNumber[], ResidueNumber[])}
@param afpChain The alignment ... | [
"Takes",
"an",
"AFPChain",
"and",
"replaces",
"the",
"optimal",
"alignment",
"based",
"on",
"an",
"alignment",
"map"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L753-L807 |
cdk/cdk | descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/ProtonTotalPartialChargeDescriptor.java | ProtonTotalPartialChargeDescriptor.calculate | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer ac) {
"""
The method returns partial charges assigned to an heavy atom and its protons through Gasteiger Marsili
It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools.HydrogenAdder.
@param atom ... | java | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer ac) {
neighboors = ac.getConnectedAtomsList(atom);
IAtomContainer clone;
try {
clone = (IAtomContainer) ac.clone();
} catch (CloneNotSupportedException e) {
return getDummyDescriptorValue(e... | [
"@",
"Override",
"public",
"DescriptorValue",
"calculate",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"ac",
")",
"{",
"neighboors",
"=",
"ac",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
";",
"IAtomContainer",
"clone",
";",
"try",
"{",
"clone",
"=",
"(... | The method returns partial charges assigned to an heavy atom and its protons through Gasteiger Marsili
It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools.HydrogenAdder.
@param atom The IAtom for which the DescriptorValue is requested
@param ac AtomCo... | [
"The",
"method",
"returns",
"partial",
"charges",
"assigned",
"to",
"an",
"heavy",
"atom",
"and",
"its",
"protons",
"through",
"Gasteiger",
"Marsili",
"It",
"is",
"needed",
"to",
"call",
"the",
"addExplicitHydrogensToSatisfyValency",
"method",
"from",
"the",
"clas... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/ProtonTotalPartialChargeDescriptor.java#L116-L159 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/lnkproducer/LinkGenerator.java | LinkGenerator.simpleWriteString | private void simpleWriteString(String outString, OutputStream outStream) throws IOException {
"""
Writes string into stream.
@param outString string
@param outStream stream
@throws IOException {@link IOException}
"""
for (int i = 0; i < outString.length(); i++)
{
int charCode = outStr... | java | private void simpleWriteString(String outString, OutputStream outStream) throws IOException
{
for (int i = 0; i < outString.length(); i++)
{
int charCode = outString.charAt(i);
outStream.write(charCode & 0xFF);
outStream.write((charCode >> 8) & 0xFF);
}
} | [
"private",
"void",
"simpleWriteString",
"(",
"String",
"outString",
",",
"OutputStream",
"outStream",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"outString",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"i... | Writes string into stream.
@param outString string
@param outStream stream
@throws IOException {@link IOException} | [
"Writes",
"string",
"into",
"stream",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/lnkproducer/LinkGenerator.java#L333-L341 |
Talend/tesb-rt-se | sam/sam-agent/src/main/java/org/talend/esb/sam/agent/flowidprocessor/FlowIdProtocolHeaderCodec.java | FlowIdProtocolHeaderCodec.writeFlowId | public static void writeFlowId(Message message, String flowId) {
"""
Write flow id.
@param message the message
@param flowId the flow id
"""
Map<String, List<String>> headers = getOrCreateProtocolHeader(message);
headers.put(FLOWID_HTTP_HEADER_NAME, Collections.singletonList(flowId));
... | java | public static void writeFlowId(Message message, String flowId) {
Map<String, List<String>> headers = getOrCreateProtocolHeader(message);
headers.put(FLOWID_HTTP_HEADER_NAME, Collections.singletonList(flowId));
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("HTTP header '" + FLOWID_HTTP_H... | [
"public",
"static",
"void",
"writeFlowId",
"(",
"Message",
"message",
",",
"String",
"flowId",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
"=",
"getOrCreateProtocolHeader",
"(",
"message",
")",
";",
"headers",
".",
"put... | Write flow id.
@param message the message
@param flowId the flow id | [
"Write",
"flow",
"id",
"."
] | train | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/sam/sam-agent/src/main/java/org/talend/esb/sam/agent/flowidprocessor/FlowIdProtocolHeaderCodec.java#L77-L83 |
mikepenz/Android-Iconics | library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java | IconicsDrawable.backgroundContourColorListRes | @NonNull
public IconicsDrawable backgroundContourColorListRes(@ColorRes int colorResId) {
"""
Set background contour colors from color res.
@return The current IconicsDrawable for chaining.
"""
return backgroundContourColor(ContextCompat.getColorStateList(mContext, colorResId));
} | java | @NonNull
public IconicsDrawable backgroundContourColorListRes(@ColorRes int colorResId) {
return backgroundContourColor(ContextCompat.getColorStateList(mContext, colorResId));
} | [
"@",
"NonNull",
"public",
"IconicsDrawable",
"backgroundContourColorListRes",
"(",
"@",
"ColorRes",
"int",
"colorResId",
")",
"{",
"return",
"backgroundContourColor",
"(",
"ContextCompat",
".",
"getColorStateList",
"(",
"mContext",
",",
"colorResId",
")",
")",
";",
... | Set background contour colors from color res.
@return The current IconicsDrawable for chaining. | [
"Set",
"background",
"contour",
"colors",
"from",
"color",
"res",
"."
] | train | https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L764-L767 |
Wadpam/guja | guja-gae/src/main/java/com/wadpam/guja/servlet/GAEBlobServlet.java | GAEBlobServlet.getUploadUrl | private void getUploadUrl(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
"""
Get an upload URL
@param req
@param resp
@throws ServletException
@throws IOException
"""
LOGGER.debug("Get blobstore upload url");
String callback = req.getParameter(CALLBACK_PAR... | java | private void getUploadUrl(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
LOGGER.debug("Get blobstore upload url");
String callback = req.getParameter(CALLBACK_PARAM);
if (null == callback) {
callback = req.getRequestURI();
}
String keepQueryParam = r... | [
"private",
"void",
"getUploadUrl",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Get blobstore upload url\"",
")",
";",
"String",
"callback",
"=",
"re... | Get an upload URL
@param req
@param resp
@throws ServletException
@throws IOException | [
"Get",
"an",
"upload",
"URL"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-gae/src/main/java/com/wadpam/guja/servlet/GAEBlobServlet.java#L104-L128 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchManager.java | CmsSearchManager.removeSearchFieldMapping | public boolean removeSearchFieldMapping(CmsLuceneField field, CmsSearchFieldMapping mapping)
throws CmsIllegalStateException {
"""
Removes a search field mapping from the given field.<p>
@param field the field
@param mapping mapping to remove from the field
@return true if remove was successful, false i... | java | public boolean removeSearchFieldMapping(CmsLuceneField field, CmsSearchFieldMapping mapping)
throws CmsIllegalStateException {
if (field.getMappings().size() < 2) {
throw new CmsIllegalStateException(
Messages.get().container(
Messages.ERR_FIELD_MAPPING_DELET... | [
"public",
"boolean",
"removeSearchFieldMapping",
"(",
"CmsLuceneField",
"field",
",",
"CmsSearchFieldMapping",
"mapping",
")",
"throws",
"CmsIllegalStateException",
"{",
"if",
"(",
"field",
".",
"getMappings",
"(",
")",
".",
"size",
"(",
")",
"<",
"2",
")",
"{",... | Removes a search field mapping from the given field.<p>
@param field the field
@param mapping mapping to remove from the field
@return true if remove was successful, false if preconditions for removal are ok but the given
mapping was unknown.
@throws CmsIllegalStateException if the given mapping is the last mapping ... | [
"Removes",
"a",
"search",
"field",
"mapping",
"from",
"the",
"given",
"field",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchManager.java#L1931-L1951 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapApi.java | MapApi.getNullableOptional | public static <T> Optional<T> getNullableOptional(final Map map, final Class<T> clazz, final Object... path) {
"""
Get optional value by path.
@param <T> optional value type
@param clazz type of value
@param map subject
@param path nodes to walk in map
@return value
"""
return getNullable(map, Opt... | java | public static <T> Optional<T> getNullableOptional(final Map map, final Class<T> clazz, final Object... path) {
return getNullable(map, Optional.class, path);
} | [
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"getNullableOptional",
"(",
"final",
"Map",
"map",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"...",
"path",
")",
"{",
"return",
"getNullable",
"(",
"map",
",",
... | Get optional value by path.
@param <T> optional value type
@param clazz type of value
@param map subject
@param path nodes to walk in map
@return value | [
"Get",
"optional",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapApi.java#L283-L285 |
apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/dataset/TimeBasedSubDirDatasetsFinder.java | TimeBasedSubDirDatasetsFinder.folderWithinAllowedPeriod | protected boolean folderWithinAllowedPeriod(Path inputFolder, DateTime folderTime) {
"""
Return true iff input folder time is between compaction.timebased.min.time.ago and
compaction.timebased.max.time.ago.
"""
DateTime currentTime = new DateTime(this.timeZone);
PeriodFormatter periodFormatter = getPe... | java | protected boolean folderWithinAllowedPeriod(Path inputFolder, DateTime folderTime) {
DateTime currentTime = new DateTime(this.timeZone);
PeriodFormatter periodFormatter = getPeriodFormatter();
DateTime earliestAllowedFolderTime = getEarliestAllowedFolderTime(currentTime, periodFormatter);
DateTime lates... | [
"protected",
"boolean",
"folderWithinAllowedPeriod",
"(",
"Path",
"inputFolder",
",",
"DateTime",
"folderTime",
")",
"{",
"DateTime",
"currentTime",
"=",
"new",
"DateTime",
"(",
"this",
".",
"timeZone",
")",
";",
"PeriodFormatter",
"periodFormatter",
"=",
"getPeriod... | Return true iff input folder time is between compaction.timebased.min.time.ago and
compaction.timebased.max.time.ago. | [
"Return",
"true",
"iff",
"input",
"folder",
"time",
"is",
"between",
"compaction",
".",
"timebased",
".",
"min",
".",
"time",
".",
"ago",
"and",
"compaction",
".",
"timebased",
".",
"max",
".",
"time",
".",
"ago",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/dataset/TimeBasedSubDirDatasetsFinder.java#L220-L237 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/Stripe.java | Stripe.createAccountTokenSynchronous | @Nullable
public Token createAccountTokenSynchronous(@NonNull final AccountParams accountParams)
throws AuthenticationException,
InvalidRequestException,
APIConnectionException,
APIException {
"""
Blocking method to create a {@link Token} for a Connect Account. D... | java | @Nullable
public Token createAccountTokenSynchronous(@NonNull final AccountParams accountParams)
throws AuthenticationException,
InvalidRequestException,
APIConnectionException,
APIException {
return createAccountTokenSynchronous(accountParams, mDefaultPublish... | [
"@",
"Nullable",
"public",
"Token",
"createAccountTokenSynchronous",
"(",
"@",
"NonNull",
"final",
"AccountParams",
"accountParams",
")",
"throws",
"AuthenticationException",
",",
"InvalidRequestException",
",",
"APIConnectionException",
",",
"APIException",
"{",
"return",
... | Blocking method to create a {@link Token} for a Connect Account. Do not call this on the UI
thread or your app will crash. The method uses the currently set
{@link #mDefaultPublishableKey}.
@param accountParams params to use for this token.
@return a {@link Token} that can be used for this account.
@throws Authentica... | [
"Blocking",
"method",
"to",
"create",
"a",
"{",
"@link",
"Token",
"}",
"for",
"a",
"Connect",
"Account",
".",
"Do",
"not",
"call",
"this",
"on",
"the",
"UI",
"thread",
"or",
"your",
"app",
"will",
"crash",
".",
"The",
"method",
"uses",
"the",
"currentl... | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/Stripe.java#L689-L696 |
gitblit/fathom | fathom-mailer/src/main/java/fathom/mailer/Mailer.java | Mailer.newTextMailRequest | public MailRequest newTextMailRequest(String requestId, String subject, String body) {
"""
Creates a plan text MailRequest with the specified subject and body.
The request id is supplied.
@param requestId
@param subject
@param body
@return a text mail request
"""
return createMailRequest(request... | java | public MailRequest newTextMailRequest(String requestId, String subject, String body) {
return createMailRequest(requestId, false, subject, body);
} | [
"public",
"MailRequest",
"newTextMailRequest",
"(",
"String",
"requestId",
",",
"String",
"subject",
",",
"String",
"body",
")",
"{",
"return",
"createMailRequest",
"(",
"requestId",
",",
"false",
",",
"subject",
",",
"body",
")",
";",
"}"
] | Creates a plan text MailRequest with the specified subject and body.
The request id is supplied.
@param requestId
@param subject
@param body
@return a text mail request | [
"Creates",
"a",
"plan",
"text",
"MailRequest",
"with",
"the",
"specified",
"subject",
"and",
"body",
".",
"The",
"request",
"id",
"is",
"supplied",
"."
] | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-mailer/src/main/java/fathom/mailer/Mailer.java#L110-L112 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.shiftDrawCenter | public void shiftDrawCenter(double shiftX, double shiftY) {
"""
Move the draw center by dx and dy.
@param shiftX the x shift
@param shiftY the y shift
"""
drawCenter.set(drawCenter.x + shiftX, drawCenter.y + shiftY);
setup();
} | java | public void shiftDrawCenter(double shiftX, double shiftY) {
drawCenter.set(drawCenter.x + shiftX, drawCenter.y + shiftY);
setup();
} | [
"public",
"void",
"shiftDrawCenter",
"(",
"double",
"shiftX",
",",
"double",
"shiftY",
")",
"{",
"drawCenter",
".",
"set",
"(",
"drawCenter",
".",
"x",
"+",
"shiftX",
",",
"drawCenter",
".",
"y",
"+",
"shiftY",
")",
";",
"setup",
"(",
")",
";",
"}"
] | Move the draw center by dx and dy.
@param shiftX the x shift
@param shiftY the y shift | [
"Move",
"the",
"draw",
"center",
"by",
"dx",
"and",
"dy",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L260-L263 |
google/closure-templates | java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java | TranslateToPyExprVisitor.genCodeForKeyAccess | private static String genCodeForKeyAccess(
String containerExpr,
PyExpr key,
NotFoundBehavior notFoundBehavior,
CoerceKeyToString coerceKeyToString) {
"""
Generates the code for key access given the name of a variable to be used as a key, e.g. {@code
.get(key)}.
@param key an expression... | java | private static String genCodeForKeyAccess(
String containerExpr,
PyExpr key,
NotFoundBehavior notFoundBehavior,
CoerceKeyToString coerceKeyToString) {
if (coerceKeyToString == CoerceKeyToString.YES) {
key = new PyFunctionExprBuilder("runtime.maybe_coerce_key_to_string").addArg(key).asP... | [
"private",
"static",
"String",
"genCodeForKeyAccess",
"(",
"String",
"containerExpr",
",",
"PyExpr",
"key",
",",
"NotFoundBehavior",
"notFoundBehavior",
",",
"CoerceKeyToString",
"coerceKeyToString",
")",
"{",
"if",
"(",
"coerceKeyToString",
"==",
"CoerceKeyToString",
"... | Generates the code for key access given the name of a variable to be used as a key, e.g. {@code
.get(key)}.
@param key an expression to be used as a key
@param notFoundBehavior What should happen if the key is not in the structure.
@param coerceKeyToString Whether or not the key should be coerced to a string. | [
"Generates",
"the",
"code",
"for",
"key",
"access",
"given",
"the",
"name",
"of",
"a",
"variable",
"to",
"be",
"used",
"as",
"a",
"key",
"e",
".",
"g",
".",
"{",
"@code",
".",
"get",
"(",
"key",
")",
"}",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java#L591-L614 |
haifengl/smile | demo/src/main/java/smile/demo/util/ParameterParser.java | ParameterParser.addParameter | public void addParameter(String name, ParameterType type) {
"""
Add a (optional) parameter.
@param name the name of parameter.
@param type the type of parameter.
"""
parameters.put(name, new Parameter(name, type));
} | java | public void addParameter(String name, ParameterType type) {
parameters.put(name, new Parameter(name, type));
} | [
"public",
"void",
"addParameter",
"(",
"String",
"name",
",",
"ParameterType",
"type",
")",
"{",
"parameters",
".",
"put",
"(",
"name",
",",
"new",
"Parameter",
"(",
"name",
",",
"type",
")",
")",
";",
"}"
] | Add a (optional) parameter.
@param name the name of parameter.
@param type the type of parameter. | [
"Add",
"a",
"(",
"optional",
")",
"parameter",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/demo/src/main/java/smile/demo/util/ParameterParser.java#L93-L95 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java | JDBC4DatabaseMetaData.getTablePrivileges | @Override
public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException {
"""
Retrieves a description of the access rights for each table available in a catalog.
"""
checkClosed();
VoltTable vtable = new VoltTable(
new... | java | @Override
public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException
{
checkClosed();
VoltTable vtable = new VoltTable(
new ColumnInfo("TABLE_CAT", VoltType.STRING),
new ColumnInfo("TABLE_SCHEM", VoltType... | [
"@",
"Override",
"public",
"ResultSet",
"getTablePrivileges",
"(",
"String",
"catalog",
",",
"String",
"schemaPattern",
",",
"String",
"tableNamePattern",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"VoltTable",
"vtable",
"=",
"new",
"VoltTab... | Retrieves a description of the access rights for each table available in a catalog. | [
"Retrieves",
"a",
"description",
"of",
"the",
"access",
"rights",
"for",
"each",
"table",
"available",
"in",
"a",
"catalog",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java#L788-L805 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/throttling/ThrottlingService.java | ThrottlingService.onSuccess | protected O onSuccess(ServiceRequestContext ctx, I req) throws Exception {
"""
Invoked when {@code req} is not throttled. By default, this method delegates the specified {@code req} to
the {@link #delegate()} of this service.
"""
return delegate().serve(ctx, req);
} | java | protected O onSuccess(ServiceRequestContext ctx, I req) throws Exception {
return delegate().serve(ctx, req);
} | [
"protected",
"O",
"onSuccess",
"(",
"ServiceRequestContext",
"ctx",
",",
"I",
"req",
")",
"throws",
"Exception",
"{",
"return",
"delegate",
"(",
")",
".",
"serve",
"(",
"ctx",
",",
"req",
")",
";",
"}"
] | Invoked when {@code req} is not throttled. By default, this method delegates the specified {@code req} to
the {@link #delegate()} of this service. | [
"Invoked",
"when",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/throttling/ThrottlingService.java#L56-L58 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryBaseImpl.java | LogRepositoryBaseImpl.getLogDirectoryName | public String getLogDirectoryName(long timestamp, String pid, String label) {
"""
returns sub-directory name to be used for instances and sub-processes
@param timestamp time of the instance start. It should be negative for sub-processes
@param pid process Id of the instance or sub-process. It cannot be null or... | java | public String getLogDirectoryName(long timestamp, String pid, String label) {
if (pid == null || pid.isEmpty()) {
throw new IllegalArgumentException("pid cannot be empty");
}
StringBuilder sb = new StringBuilder();
if (timestamp > 0) {
sb.append(timestamp).append... | [
"public",
"String",
"getLogDirectoryName",
"(",
"long",
"timestamp",
",",
"String",
"pid",
",",
"String",
"label",
")",
"{",
"if",
"(",
"pid",
"==",
"null",
"||",
"pid",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
... | returns sub-directory name to be used for instances and sub-processes
@param timestamp time of the instance start. It should be negative for sub-processes
@param pid process Id of the instance or sub-process. It cannot be null or empty.
@param label additional identification to use on the sub-directory.
@return string... | [
"returns",
"sub",
"-",
"directory",
"name",
"to",
"be",
"used",
"for",
"instances",
"and",
"sub",
"-",
"processes"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryBaseImpl.java#L317-L334 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/JCROrganizationServiceImpl.java | JCROrganizationServiceImpl.getStorageSession | Session getStorageSession() throws RepositoryException {
"""
Return system Session to org-service storage workspace. For internal use
only.
@return system session
@throws RepositoryException if any Exception is occurred
"""
try
{
ManageableRepository repository = getWorkingRepository(... | java | Session getStorageSession() throws RepositoryException
{
try
{
ManageableRepository repository = getWorkingRepository();
String workspaceName = storageWorkspace;
if (workspaceName == null)
{
workspaceName = repository.getConfiguration().getDefaultWorkspace... | [
"Session",
"getStorageSession",
"(",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"ManageableRepository",
"repository",
"=",
"getWorkingRepository",
"(",
")",
";",
"String",
"workspaceName",
"=",
"storageWorkspace",
";",
"if",
"(",
"workspaceName",
"==",
"... | Return system Session to org-service storage workspace. For internal use
only.
@return system session
@throws RepositoryException if any Exception is occurred | [
"Return",
"system",
"Session",
"to",
"org",
"-",
"service",
"storage",
"workspace",
".",
"For",
"internal",
"use",
"only",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/JCROrganizationServiceImpl.java#L331-L349 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/DockerImage.java | DockerImage.checkAndSetManifestAndImagePathCandidates | private boolean checkAndSetManifestAndImagePathCandidates(String manifestPath, String candidateImagePath, ArtifactoryDependenciesClient dependenciesClient, TaskListener listener) throws IOException {
"""
Check if the provided manifestPath is correct.
Set the manifest and imagePath in case of the correct manifest.... | java | private boolean checkAndSetManifestAndImagePathCandidates(String manifestPath, String candidateImagePath, ArtifactoryDependenciesClient dependenciesClient, TaskListener listener) throws IOException {
String candidateManifest = getManifestFromArtifactory(dependenciesClient, manifestPath);
if (candidateMa... | [
"private",
"boolean",
"checkAndSetManifestAndImagePathCandidates",
"(",
"String",
"manifestPath",
",",
"String",
"candidateImagePath",
",",
"ArtifactoryDependenciesClient",
"dependenciesClient",
",",
"TaskListener",
"listener",
")",
"throws",
"IOException",
"{",
"String",
"ca... | Check if the provided manifestPath is correct.
Set the manifest and imagePath in case of the correct manifest.
@param manifestPath
@param candidateImagePath
@param dependenciesClient
@param listener
@return true if found the correct manifest
@throws IOException | [
"Check",
"if",
"the",
"provided",
"manifestPath",
"is",
"correct",
".",
"Set",
"the",
"manifest",
"and",
"imagePath",
"in",
"case",
"of",
"the",
"correct",
"manifest",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/DockerImage.java#L212-L227 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/Preconditions.java | Preconditions.checkState | public static void checkState(boolean condition,
@Nullable String errorMessageTemplate,
@Nullable Object... errorMessageArgs) {
"""
Checks the given boolean condition, and throws an {@code IllegalStateException} if
the condition is not met (evaluates to {@code false}).
@param condition The condition to c... | java | public static void checkState(boolean condition,
@Nullable String errorMessageTemplate,
@Nullable Object... errorMessageArgs) {
if (!condition) {
throw new IllegalStateException(format(errorMessageTemplate, errorMessageArgs));
}
} | [
"public",
"static",
"void",
"checkState",
"(",
"boolean",
"condition",
",",
"@",
"Nullable",
"String",
"errorMessageTemplate",
",",
"@",
"Nullable",
"Object",
"...",
"errorMessageArgs",
")",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"IllegalS... | Checks the given boolean condition, and throws an {@code IllegalStateException} if
the condition is not met (evaluates to {@code false}).
@param condition The condition to check
@param errorMessageTemplate The message template for the {@code IllegalStateException}
that is thrown if the check fails. The template substi... | [
"Checks",
"the",
"given",
"boolean",
"condition",
"and",
"throws",
"an",
"{",
"@code",
"IllegalStateException",
"}",
"if",
"the",
"condition",
"is",
"not",
"met",
"(",
"evaluates",
"to",
"{",
"@code",
"false",
"}",
")",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/Preconditions.java#L212-L219 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/LookupTableHelper.java | LookupTableHelper.getContext | public static UIContext getContext(final String key, final Request request) {
"""
Retrieves the UIContext for the given data list.
@param key the list key.
@param request the current request being responded to.
@return the UIContext for the given key.
"""
return (UIContext) request.getSessionAttribute... | java | public static UIContext getContext(final String key, final Request request) {
return (UIContext) request.getSessionAttribute(DATA_LIST_UIC_SESSION_KEY);
} | [
"public",
"static",
"UIContext",
"getContext",
"(",
"final",
"String",
"key",
",",
"final",
"Request",
"request",
")",
"{",
"return",
"(",
"UIContext",
")",
"request",
".",
"getSessionAttribute",
"(",
"DATA_LIST_UIC_SESSION_KEY",
")",
";",
"}"
] | Retrieves the UIContext for the given data list.
@param key the list key.
@param request the current request being responded to.
@return the UIContext for the given key. | [
"Retrieves",
"the",
"UIContext",
"for",
"the",
"given",
"data",
"list",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/LookupTableHelper.java#L47-L49 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/StatisticalMoments.java | StatisticalMoments.put | @Override
public void put(double val, double weight) {
"""
Add data with a given weight.
@param val data
@param weight weight
"""
if(weight <= 0) {
return;
}
if(this.n == 0) {
n = weight;
min = max = val;
sum = val * weight;
m2 = m3 = m4 = 0;
return;
}
... | java | @Override
public void put(double val, double weight) {
if(weight <= 0) {
return;
}
if(this.n == 0) {
n = weight;
min = max = val;
sum = val * weight;
m2 = m3 = m4 = 0;
return;
}
final double nn = weight + this.n;
final double deltan = val * this.n - this.sum... | [
"@",
"Override",
"public",
"void",
"put",
"(",
"double",
"val",
",",
"double",
"weight",
")",
"{",
"if",
"(",
"weight",
"<=",
"0",
")",
"{",
"return",
";",
"}",
"if",
"(",
"this",
".",
"n",
"==",
"0",
")",
"{",
"n",
"=",
"weight",
";",
"min",
... | Add data with a given weight.
@param val data
@param weight weight | [
"Add",
"data",
"with",
"a",
"given",
"weight",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/StatisticalMoments.java#L149-L182 |
xwiki/xwiki-rendering | xwiki-rendering-macros/xwiki-rendering-macro-toc/src/main/java/org/xwiki/rendering/internal/macro/toc/TocTreeBuilder.java | TocTreeBuilder.addItemBlock | private Block addItemBlock(Block currentBlock, HeaderBlock headerBlock, String documentReference) {
"""
Add a {@link ListItemBlock} in the current toc tree block and return the new {@link ListItemBlock}.
@param currentBlock the current block in the toc tree.
@param headerBlock the {@link HeaderBlock} to use to... | java | private Block addItemBlock(Block currentBlock, HeaderBlock headerBlock, String documentReference)
{
ListItemBlock itemBlock =
headerBlock == null ? createEmptyTocEntry() : createTocEntry(headerBlock, documentReference);
currentBlock.addChild(itemBlock);
return itemBlock;
} | [
"private",
"Block",
"addItemBlock",
"(",
"Block",
"currentBlock",
",",
"HeaderBlock",
"headerBlock",
",",
"String",
"documentReference",
")",
"{",
"ListItemBlock",
"itemBlock",
"=",
"headerBlock",
"==",
"null",
"?",
"createEmptyTocEntry",
"(",
")",
":",
"createTocEn... | Add a {@link ListItemBlock} in the current toc tree block and return the new {@link ListItemBlock}.
@param currentBlock the current block in the toc tree.
@param headerBlock the {@link HeaderBlock} to use to generate toc anchor label.
@return the new {@link ListItemBlock}. | [
"Add",
"a",
"{",
"@link",
"ListItemBlock",
"}",
"in",
"the",
"current",
"toc",
"tree",
"block",
"and",
"return",
"the",
"new",
"{",
"@link",
"ListItemBlock",
"}",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-macros/xwiki-rendering-macro-toc/src/main/java/org/xwiki/rendering/internal/macro/toc/TocTreeBuilder.java#L163-L171 |
apache/incubator-shardingsphere | sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/connection/XAConnectionFactory.java | XAConnectionFactory.createXAConnection | public static XAConnection createXAConnection(final DatabaseType databaseType, final XADataSource xaDataSource, final Connection connection) {
"""
Create XA connection from normal connection.
@param databaseType database type
@param connection normal connection
@param xaDataSource XA data source
@return XA c... | java | public static XAConnection createXAConnection(final DatabaseType databaseType, final XADataSource xaDataSource, final Connection connection) {
switch (databaseType) {
case MySQL:
return new MySQLXAConnectionWrapper().wrap(xaDataSource, connection);
case PostgreSQL:
... | [
"public",
"static",
"XAConnection",
"createXAConnection",
"(",
"final",
"DatabaseType",
"databaseType",
",",
"final",
"XADataSource",
"xaDataSource",
",",
"final",
"Connection",
"connection",
")",
"{",
"switch",
"(",
"databaseType",
")",
"{",
"case",
"MySQL",
":",
... | Create XA connection from normal connection.
@param databaseType database type
@param connection normal connection
@param xaDataSource XA data source
@return XA connection | [
"Create",
"XA",
"connection",
"from",
"normal",
"connection",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/connection/XAConnectionFactory.java#L47-L58 |
icode/ameba | src/main/java/ameba/core/Requests.java | Requests.readEntity | public static <T> T readEntity(Class<T> rawType, Type type) {
"""
<p>readEntity.</p>
@param rawType a {@link java.lang.Class} object.
@param type a {@link java.lang.reflect.Type} object.
@param <T> a T object.
@return a T object.
"""
return getRequest().readEntity(rawType, type);
} | java | public static <T> T readEntity(Class<T> rawType, Type type) {
return getRequest().readEntity(rawType, type);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"readEntity",
"(",
"Class",
"<",
"T",
">",
"rawType",
",",
"Type",
"type",
")",
"{",
"return",
"getRequest",
"(",
")",
".",
"readEntity",
"(",
"rawType",
",",
"type",
")",
";",
"}"
] | <p>readEntity.</p>
@param rawType a {@link java.lang.Class} object.
@param type a {@link java.lang.reflect.Type} object.
@param <T> a T object.
@return a T object. | [
"<p",
">",
"readEntity",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/core/Requests.java#L239-L241 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDsl.java | MapDsl.with | public static MapOperator with(final Map map, final Class<? extends Map> nodeClass) {
"""
Entry point for mutable map dsl.
@param map subject
@param nodeClass map class
@return operator
"""
return new MapOperator(map, nodeClass);
} | java | public static MapOperator with(final Map map, final Class<? extends Map> nodeClass) {
return new MapOperator(map, nodeClass);
} | [
"public",
"static",
"MapOperator",
"with",
"(",
"final",
"Map",
"map",
",",
"final",
"Class",
"<",
"?",
"extends",
"Map",
">",
"nodeClass",
")",
"{",
"return",
"new",
"MapOperator",
"(",
"map",
",",
"nodeClass",
")",
";",
"}"
] | Entry point for mutable map dsl.
@param map subject
@param nodeClass map class
@return operator | [
"Entry",
"point",
"for",
"mutable",
"map",
"dsl",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDsl.java#L36-L38 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/conformance/TypeConformanceComputer.java | TypeConformanceComputer.getCommonParameterSuperType | @Deprecated
public final LightweightTypeReference getCommonParameterSuperType(List<LightweightTypeReference> types, List<LightweightTypeReference> initiallyRequested, ITypeReferenceOwner owner) {
"""
Logic was moved to inner class CommonSuperTypeFinder in the context of bug 495314.
This method is scheduled for... | java | @Deprecated
public final LightweightTypeReference getCommonParameterSuperType(List<LightweightTypeReference> types, List<LightweightTypeReference> initiallyRequested, ITypeReferenceOwner owner) {
CommonSuperTypeFinder typeFinder = newCommonSuperTypeFinder(owner);
typeFinder.requestsInProgress = Lists.newArrayList(... | [
"@",
"Deprecated",
"public",
"final",
"LightweightTypeReference",
"getCommonParameterSuperType",
"(",
"List",
"<",
"LightweightTypeReference",
">",
"types",
",",
"List",
"<",
"LightweightTypeReference",
">",
"initiallyRequested",
",",
"ITypeReferenceOwner",
"owner",
")",
... | Logic was moved to inner class CommonSuperTypeFinder in the context of bug 495314.
This method is scheduled for deletion in Xtext 2.15
@deprecated see {@link CommonSuperTypeFinder#getCommonParameterSuperType(List)} | [
"Logic",
"was",
"moved",
"to",
"inner",
"class",
"CommonSuperTypeFinder",
"in",
"the",
"context",
"of",
"bug",
"495314",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/conformance/TypeConformanceComputer.java#L814-L820 |
aws/aws-sdk-java | aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/validation/ValidationContext.java | ValidationContext.assertNotEmpty | public void assertNotEmpty(Collection<?> collection, String propertyName) {
"""
Asserts the collection is not null and not empty, reporting to {@link ProblemReporter} with this context if it is.
@param collection Collection to assert on.
@param propertyName Name of property.
"""
if (CollectionUti... | java | public void assertNotEmpty(Collection<?> collection, String propertyName) {
if (CollectionUtils.isNullOrEmpty(collection)) {
problemReporter.report(new Problem(this, String.format("%s requires one or more items", propertyName)));
}
} | [
"public",
"void",
"assertNotEmpty",
"(",
"Collection",
"<",
"?",
">",
"collection",
",",
"String",
"propertyName",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isNullOrEmpty",
"(",
"collection",
")",
")",
"{",
"problemReporter",
".",
"report",
"(",
"new",
"... | Asserts the collection is not null and not empty, reporting to {@link ProblemReporter} with this context if it is.
@param collection Collection to assert on.
@param propertyName Name of property. | [
"Asserts",
"the",
"collection",
"is",
"not",
"null",
"and",
"not",
"empty",
"reporting",
"to",
"{",
"@link",
"ProblemReporter",
"}",
"with",
"this",
"context",
"if",
"it",
"is",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/validation/ValidationContext.java#L90-L94 |
liferay/com-liferay-commerce | commerce-tax-engine-fixed-service/src/main/java/com/liferay/commerce/tax/engine/fixed/service/persistence/impl/CommerceTaxFixedRatePersistenceImpl.java | CommerceTaxFixedRatePersistenceImpl.findAll | @Override
public List<CommerceTaxFixedRate> findAll() {
"""
Returns all the commerce tax fixed rates.
@return the commerce tax fixed rates
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceTaxFixedRate> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceTaxFixedRate",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce tax fixed rates.
@return the commerce tax fixed rates | [
"Returns",
"all",
"the",
"commerce",
"tax",
"fixed",
"rates",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-engine-fixed-service/src/main/java/com/liferay/commerce/tax/engine/fixed/service/persistence/impl/CommerceTaxFixedRatePersistenceImpl.java#L1953-L1956 |
lessthanoptimal/BoofCV | main/boofcv-simulation/src/main/java/boofcv/simulation/SimulatePlanarWorld.java | SimulatePlanarWorld.computePixel | public void computePixel(int which, double x, double y, Point2D_F64 output) {
"""
Project a point which lies on the 2D planar polygon's surface onto the rendered image
"""
SurfaceRect r = scene.get(which);
Point3D_F64 p3 = new Point3D_F64(-x,-y,0);
SePointOps_F64.transform(r.rectToCamera, p3, p3);
//... | java | public void computePixel(int which, double x, double y, Point2D_F64 output) {
SurfaceRect r = scene.get(which);
Point3D_F64 p3 = new Point3D_F64(-x,-y,0);
SePointOps_F64.transform(r.rectToCamera, p3, p3);
// unit sphere
p3.scale(1.0/p3.norm());
sphereToPixel.compute(p3.x,p3.y,p3.z,output);
} | [
"public",
"void",
"computePixel",
"(",
"int",
"which",
",",
"double",
"x",
",",
"double",
"y",
",",
"Point2D_F64",
"output",
")",
"{",
"SurfaceRect",
"r",
"=",
"scene",
".",
"get",
"(",
"which",
")",
";",
"Point3D_F64",
"p3",
"=",
"new",
"Point3D_F64",
... | Project a point which lies on the 2D planar polygon's surface onto the rendered image | [
"Project",
"a",
"point",
"which",
"lies",
"on",
"the",
"2D",
"planar",
"polygon",
"s",
"surface",
"onto",
"the",
"rendered",
"image"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-simulation/src/main/java/boofcv/simulation/SimulatePlanarWorld.java#L307-L317 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.users_getInfo | public T users_getInfo(Collection<Integer> userIds, EnumSet<ProfileField> fields)
throws FacebookException, IOException {
"""
Retrieves the requested info fields for the requested set of users.
@param userIds a collection of user IDs for which to fetch info
@param fields a set of ProfileFields
@return a T c... | java | public T users_getInfo(Collection<Integer> userIds, EnumSet<ProfileField> fields)
throws FacebookException, IOException {
// assertions test for invalid params
assert (userIds != null);
assert (fields != null);
assert (!fields.isEmpty());
return this.callMethod(FacebookMethod.USERS_GET_INFO,
... | [
"public",
"T",
"users_getInfo",
"(",
"Collection",
"<",
"Integer",
">",
"userIds",
",",
"EnumSet",
"<",
"ProfileField",
">",
"fields",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"// assertions test for invalid params",
"assert",
"(",
"userIds",
"!=... | Retrieves the requested info fields for the requested set of users.
@param userIds a collection of user IDs for which to fetch info
@param fields a set of ProfileFields
@return a T consisting of a list of users, with each user element
containing the requested fields. | [
"Retrieves",
"the",
"requested",
"info",
"fields",
"for",
"the",
"requested",
"set",
"of",
"users",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L923-L933 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqltruncate | public static void sqltruncate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
"""
truncate to trunc translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
"""
twoArgumentsFunctionCall(buf, "trunc("... | java | public static void sqltruncate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
twoArgumentsFunctionCall(buf, "trunc(", "truncate", parsedArgs);
} | [
"public",
"static",
"void",
"sqltruncate",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"twoArgumentsFunctionCall",
"(",
"buf",
",",
"\"trunc(\"",
",",
"\"truncate\"",
",",
... | truncate to trunc translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"truncate",
"to",
"trunc",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L131-L133 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.getScaleFactor | public static double getScaleFactor(IAtomContainer container, double bondLength) {
"""
Determines the scale factor for displaying a structure loaded from disk in a frame. An
average of all bond length values is produced and a scale factor is determined which would
scale the given molecule such that its See comme... | java | public static double getScaleFactor(IAtomContainer container, double bondLength) {
double currentAverageBondLength = getBondLengthMedian(container);
if (currentAverageBondLength == 0 || Double.isNaN(currentAverageBondLength)) return 1;
return bondLength / currentAverageBondLength;
} | [
"public",
"static",
"double",
"getScaleFactor",
"(",
"IAtomContainer",
"container",
",",
"double",
"bondLength",
")",
"{",
"double",
"currentAverageBondLength",
"=",
"getBondLengthMedian",
"(",
"container",
")",
";",
"if",
"(",
"currentAverageBondLength",
"==",
"0",
... | Determines the scale factor for displaying a structure loaded from disk in a frame. An
average of all bond length values is produced and a scale factor is determined which would
scale the given molecule such that its See comment for center(IAtomContainer atomCon,
Dimension areaDim, HashMap renderingCoordinates) for det... | [
"Determines",
"the",
"scale",
"factor",
"for",
"displaying",
"a",
"structure",
"loaded",
"from",
"disk",
"in",
"a",
"frame",
".",
"An",
"average",
"of",
"all",
"bond",
"length",
"values",
"is",
"produced",
"and",
"a",
"scale",
"factor",
"is",
"determined",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L898-L902 |
umano/AndroidSlidingUpPanel | library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java | ViewDragHelper.checkTouchSlop | private boolean checkTouchSlop(View child, float dx, float dy) {
"""
Check if we've crossed a reasonable touch slop for the given child view.
If the child cannot be dragged along the horizontal or vertical axis, motion
along that axis will not count toward the slop check.
@param child Child to check
@param d... | java | private boolean checkTouchSlop(View child, float dx, float dy) {
if (child == null) {
return false;
}
final boolean checkHorizontal = mCallback.getViewHorizontalDragRange(child) > 0;
final boolean checkVertical = mCallback.getViewVerticalDragRange(child) > 0;
if (che... | [
"private",
"boolean",
"checkTouchSlop",
"(",
"View",
"child",
",",
"float",
"dx",
",",
"float",
"dy",
")",
"{",
"if",
"(",
"child",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"final",
"boolean",
"checkHorizontal",
"=",
"mCallback",
".",
"getVie... | Check if we've crossed a reasonable touch slop for the given child view.
If the child cannot be dragged along the horizontal or vertical axis, motion
along that axis will not count toward the slop check.
@param child Child to check
@param dx Motion since initial position along X axis
@param dy Motion since initial pos... | [
"Check",
"if",
"we",
"ve",
"crossed",
"a",
"reasonable",
"touch",
"slop",
"for",
"the",
"given",
"child",
"view",
".",
"If",
"the",
"child",
"cannot",
"be",
"dragged",
"along",
"the",
"horizontal",
"or",
"vertical",
"axis",
"motion",
"along",
"that",
"axis... | train | https://github.com/umano/AndroidSlidingUpPanel/blob/45a460435b07e764138a700328836cafc1ed5c42/library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java#L1293-L1308 |
thorntail/thorntail | plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java | GradleDependencyResolutionHelper.asDescriptor | private static DependencyDescriptor asDescriptor(String scope, ResolvedDependency dependency) {
"""
Translate the given {@link ResolvedDependency resolved dependency} in to a {@link DependencyDescriptor} reference.
@param scope the scope to assign to the descriptor.
@param dependency the resolved dependen... | java | private static DependencyDescriptor asDescriptor(String scope, ResolvedDependency dependency) {
Set<ResolvedArtifact> artifacts = dependency.getModuleArtifacts();
// Let us use the first artifact's type for determining the type.
// I am not sure under what circumstances, would we need to check... | [
"private",
"static",
"DependencyDescriptor",
"asDescriptor",
"(",
"String",
"scope",
",",
"ResolvedDependency",
"dependency",
")",
"{",
"Set",
"<",
"ResolvedArtifact",
">",
"artifacts",
"=",
"dependency",
".",
"getModuleArtifacts",
"(",
")",
";",
"// Let us use the fi... | Translate the given {@link ResolvedDependency resolved dependency} in to a {@link DependencyDescriptor} reference.
@param scope the scope to assign to the descriptor.
@param dependency the resolved dependency reference.
@return an instance of {@link DependencyDescriptor}. | [
"Translate",
"the",
"given",
"{",
"@link",
"ResolvedDependency",
"resolved",
"dependency",
"}",
"in",
"to",
"a",
"{",
"@link",
"DependencyDescriptor",
"}",
"reference",
"."
] | train | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java#L264-L282 |
Gagravarr/VorbisJava | core/src/main/java/org/gagravarr/ogg/OggPacketReader.java | OggPacketReader.skipToGranulePosition | public void skipToGranulePosition(int sid, long granulePosition) throws IOException {
"""
Skips forward until the first packet with a Granule Position
of equal or greater than that specified. Call {@link #getNextPacket()}
to retrieve this packet.
This method advances across all streams, but only searches the
s... | java | public void skipToGranulePosition(int sid, long granulePosition) throws IOException {
OggPacket p = null;
while( (p = getNextPacket()) != null ) {
if(p.getSid() == sid && p.getGranulePosition() >= granulePosition) {
nextPacket = p;
break;
}
... | [
"public",
"void",
"skipToGranulePosition",
"(",
"int",
"sid",
",",
"long",
"granulePosition",
")",
"throws",
"IOException",
"{",
"OggPacket",
"p",
"=",
"null",
";",
"while",
"(",
"(",
"p",
"=",
"getNextPacket",
"(",
")",
")",
"!=",
"null",
")",
"{",
"if"... | Skips forward until the first packet with a Granule Position
of equal or greater than that specified. Call {@link #getNextPacket()}
to retrieve this packet.
This method advances across all streams, but only searches the
specified one.
@param sid The ID of the stream who's packets we will search
@param granulePosition T... | [
"Skips",
"forward",
"until",
"the",
"first",
"packet",
"with",
"a",
"Granule",
"Position",
"of",
"equal",
"or",
"greater",
"than",
"that",
"specified",
".",
"Call",
"{"
] | train | https://github.com/Gagravarr/VorbisJava/blob/22b4d645b00386d59d17a336a2bc9d54db08df16/core/src/main/java/org/gagravarr/ogg/OggPacketReader.java#L190-L198 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putCharBigEndian | public final void putCharBigEndian(int index, char value) {
"""
Writes the given character (16 bit, 2 bytes) to the given position in big-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putChar(int, char)}. For most cases (such as
transien... | java | public final void putCharBigEndian(int index, char value) {
if (LITTLE_ENDIAN) {
putChar(index, Character.reverseBytes(value));
} else {
putChar(index, value);
}
} | [
"public",
"final",
"void",
"putCharBigEndian",
"(",
"int",
"index",
",",
"char",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putChar",
"(",
"index",
",",
"Character",
".",
"reverseBytes",
"(",
"value",
")",
")",
";",
"}",
"else",
"{",
"pu... | Writes the given character (16 bit, 2 bytes) to the given position in big-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putChar(int, char)}. For most cases (such as
transient storage in memory or serialization for I/O and network),
it suffices t... | [
"Writes",
"the",
"given",
"character",
"(",
"16",
"bit",
"2",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"big",
"-",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"native",
"byte",
"or... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L536-L542 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/proxy/AbstractProxyFactory.java | AbstractProxyFactory.retrieveCollectionProxyConstructor | private static Constructor retrieveCollectionProxyConstructor(Class proxyClass, Class baseType, String typeDesc) {
"""
Retrieves the constructor that is used by OJB to create instances of the given collection proxy
class.
@param proxyClass The proxy class
@param baseType The required base type of the proxy cl... | java | private static Constructor retrieveCollectionProxyConstructor(Class proxyClass, Class baseType, String typeDesc)
{
if(proxyClass == null)
{
throw new MetadataException("No " + typeDesc + " specified.");
}
if(proxyClass.isInterface() || Modifier.isAbstract(proxyClass... | [
"private",
"static",
"Constructor",
"retrieveCollectionProxyConstructor",
"(",
"Class",
"proxyClass",
",",
"Class",
"baseType",
",",
"String",
"typeDesc",
")",
"{",
"if",
"(",
"proxyClass",
"==",
"null",
")",
"{",
"throw",
"new",
"MetadataException",
"(",
"\"No \"... | Retrieves the constructor that is used by OJB to create instances of the given collection proxy
class.
@param proxyClass The proxy class
@param baseType The required base type of the proxy class
@param typeDesc The type of collection proxy
@return The constructor | [
"Retrieves",
"the",
"constructor",
"that",
"is",
"used",
"by",
"OJB",
"to",
"create",
"instances",
"of",
"the",
"given",
"collection",
"proxy",
"class",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/proxy/AbstractProxyFactory.java#L180-L216 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetResourcesImpl.java | SheetResourcesImpl.importCsv | public Sheet importCsv(String file, String sheetName, Integer headerRowIndex, Integer primaryRowIndex) throws SmartsheetException {
"""
Imports a sheet.
It mirrors to the following Smartsheet REST API method: POST /sheets/import
@param file path to the CSV file
@param sheetName destination sheet name
@para... | java | public Sheet importCsv(String file, String sheetName, Integer headerRowIndex, Integer primaryRowIndex) throws SmartsheetException {
return importFile("sheets/import", file,"text/csv", sheetName, headerRowIndex, primaryRowIndex);
} | [
"public",
"Sheet",
"importCsv",
"(",
"String",
"file",
",",
"String",
"sheetName",
",",
"Integer",
"headerRowIndex",
",",
"Integer",
"primaryRowIndex",
")",
"throws",
"SmartsheetException",
"{",
"return",
"importFile",
"(",
"\"sheets/import\"",
",",
"file",
",",
"... | Imports a sheet.
It mirrors to the following Smartsheet REST API method: POST /sheets/import
@param file path to the CSV file
@param sheetName destination sheet name
@param headerRowIndex index (0 based) of row to be used for column names
@param primaryRowIndex index (0 based) of primary column
@return the created sh... | [
"Imports",
"a",
"sheet",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetResourcesImpl.java#L435-L437 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.rebootInstance | public void rebootInstance(String instanceId, boolean forceStop) {
"""
Rebooting the instance owned by the user.
You can reboot the instance only when the instance is Running,
otherwise,it's will get <code>409</code> errorCode.
This is an asynchronous interface,
you can get the latest status by invoke {@li... | java | public void rebootInstance(String instanceId, boolean forceStop) {
this.rebootInstance(new RebootInstanceRequest().withInstanceId(instanceId).withForceStop(forceStop));
} | [
"public",
"void",
"rebootInstance",
"(",
"String",
"instanceId",
",",
"boolean",
"forceStop",
")",
"{",
"this",
".",
"rebootInstance",
"(",
"new",
"RebootInstanceRequest",
"(",
")",
".",
"withInstanceId",
"(",
"instanceId",
")",
".",
"withForceStop",
"(",
"force... | Rebooting the instance owned by the user.
You can reboot the instance only when the instance is Running,
otherwise,it's will get <code>409</code> errorCode.
This is an asynchronous interface,
you can get the latest status by invoke {@link #getInstance(GetInstanceRequest)}
@param instanceId The id of the instance.
@p... | [
"Rebooting",
"the",
"instance",
"owned",
"by",
"the",
"user",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L480-L482 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.sendAppendRequest | @Then("^I add a new DCOS label with key '(.+?)' and value '(.+?)' to the service '(.+?)'?$")
public void sendAppendRequest(String key, String value, String service) throws Exception {
"""
A PUT request over the body value.
@param key
@param value
@param service
@throws Exception
"""
commonspe... | java | @Then("^I add a new DCOS label with key '(.+?)' and value '(.+?)' to the service '(.+?)'?$")
public void sendAppendRequest(String key, String value, String service) throws Exception {
commonspec.runCommandAndGetResult("touch " + service + ".json && dcos marathon app show " + service + " > /dcos/" + service ... | [
"@",
"Then",
"(",
"\"^I add a new DCOS label with key '(.+?)' and value '(.+?)' to the service '(.+?)'?$\"",
")",
"public",
"void",
"sendAppendRequest",
"(",
"String",
"key",
",",
"String",
"value",
",",
"String",
"service",
")",
"throws",
"Exception",
"{",
"commonspec",
... | A PUT request over the body value.
@param key
@param value
@param service
@throws Exception | [
"A",
"PUT",
"request",
"over",
"the",
"body",
"value",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L405-L426 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java | GlobalUsersInner.beginStartEnvironmentAsync | public Observable<Void> beginStartEnvironmentAsync(String userName, String environmentId) {
"""
Starts an environment by starting all resources inside the environment. This operation can take a while to complete.
@param userName The name of the user.
@param environmentId The resourceId of the environment
@thr... | java | public Observable<Void> beginStartEnvironmentAsync(String userName, String environmentId) {
return beginStartEnvironmentWithServiceResponseAsync(userName, environmentId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
... | [
"public",
"Observable",
"<",
"Void",
">",
"beginStartEnvironmentAsync",
"(",
"String",
"userName",
",",
"String",
"environmentId",
")",
"{",
"return",
"beginStartEnvironmentWithServiceResponseAsync",
"(",
"userName",
",",
"environmentId",
")",
".",
"map",
"(",
"new",
... | Starts an environment by starting all resources inside the environment. This operation can take a while to complete.
@param userName The name of the user.
@param environmentId The resourceId of the environment
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse}... | [
"Starts",
"an",
"environment",
"by",
"starting",
"all",
"resources",
"inside",
"the",
"environment",
".",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L1174-L1181 |
ixa-ehu/ixa-pipe-pos | src/main/java/eus/ixa/ixa/pipe/pos/StatisticalTagger.java | StatisticalTagger.loadModel | private POSModel loadModel(final String lang, final String modelName, final Boolean useModelCache) {
"""
Loads statically the probabilistic model. Every instance of this finder
will share the same model.
@param lang
the language
@param modelName
the model to be loaded
@param useModelCache
whether to cache... | java | private POSModel loadModel(final String lang, final String modelName, final Boolean useModelCache) {
final long lStartTime = new Date().getTime();
POSModel model = null;
try {
if (useModelCache) {
synchronized (posModels) {
if (!posModels.containsKey(lang)) {
model = new ... | [
"private",
"POSModel",
"loadModel",
"(",
"final",
"String",
"lang",
",",
"final",
"String",
"modelName",
",",
"final",
"Boolean",
"useModelCache",
")",
"{",
"final",
"long",
"lStartTime",
"=",
"new",
"Date",
"(",
")",
".",
"getTime",
"(",
")",
";",
"POSMod... | Loads statically the probabilistic model. Every instance of this finder
will share the same model.
@param lang
the language
@param modelName
the model to be loaded
@param useModelCache
whether to cache the model in memory
@return the model as a {@link POSModel} object | [
"Loads",
"statically",
"the",
"probabilistic",
"model",
".",
"Every",
"instance",
"of",
"this",
"finder",
"will",
"share",
"the",
"same",
"model",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/StatisticalTagger.java#L152-L174 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsyncThrowing | public static <T1, T2, T3, R> Func3<T1, T2, T3, Observable<R>> toAsyncThrowing(ThrowingFunc3<? super T1, ? super T2, ? super T3, ? extends R> func) {
"""
Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/R... | java | public static <T1, T2, T3, R> Func3<T1, T2, T3, Observable<R>> toAsyncThrowing(ThrowingFunc3<? super T1, ? super T2, ? super T3, ? extends R> func) {
return toAsyncThrowing(func, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"Func3",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"Observable",
"<",
"R",
">",
">",
"toAsyncThrowing",
"(",
"ThrowingFunc3",
"<",
"?",
"super",
"T1",
",",
"?",
"super",
"T2",
",",
... | Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <T3> the third parameter type
@... | [
"Convert",
"a",
"synchronous",
"function",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L326-L328 |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.setWaterMarks | public void setWaterMarks(String source, long lwmScn, long hwmScn) {
"""
Sets the water marks of a source.
@param source - the source
@param lwmScn - the low water mark SCN
@param hwmScn - the high water mark SCN
"""
WaterMarkEntry e = sourceWaterMarkMap.get(source);
if (e == null) {
... | java | public void setWaterMarks(String source, long lwmScn, long hwmScn) {
WaterMarkEntry e = sourceWaterMarkMap.get(source);
if (e == null) {
e = new WaterMarkEntry(source);
sourceWaterMarkMap.put(source, e);
}
e.setLWMScn(lwmScn);
e.setHWMScn(hwmScn);
} | [
"public",
"void",
"setWaterMarks",
"(",
"String",
"source",
",",
"long",
"lwmScn",
",",
"long",
"hwmScn",
")",
"{",
"WaterMarkEntry",
"e",
"=",
"sourceWaterMarkMap",
".",
"get",
"(",
"source",
")",
";",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"e",
"=",... | Sets the water marks of a source.
@param source - the source
@param lwmScn - the low water mark SCN
@param hwmScn - the high water mark SCN | [
"Sets",
"the",
"water",
"marks",
"of",
"a",
"source",
"."
] | train | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L248-L256 |
pdef/pdef-java | pdef/src/main/java/io/pdef/json/JsonFormat.java | JsonFormat.read | public <T> T read(final InputStream stream, final DataTypeDescriptor<T> descriptor) {
"""
Parses an object from an input stream, does not close the input stream.
"""
try {
return jsonFormat.read(stream, descriptor);
} catch (Exception e) {
throw propagate(e);
}
} | java | public <T> T read(final InputStream stream, final DataTypeDescriptor<T> descriptor) {
try {
return jsonFormat.read(stream, descriptor);
} catch (Exception e) {
throw propagate(e);
}
} | [
"public",
"<",
"T",
">",
"T",
"read",
"(",
"final",
"InputStream",
"stream",
",",
"final",
"DataTypeDescriptor",
"<",
"T",
">",
"descriptor",
")",
"{",
"try",
"{",
"return",
"jsonFormat",
".",
"read",
"(",
"stream",
",",
"descriptor",
")",
";",
"}",
"c... | Parses an object from an input stream, does not close the input stream. | [
"Parses",
"an",
"object",
"from",
"an",
"input",
"stream",
"does",
"not",
"close",
"the",
"input",
"stream",
"."
] | train | https://github.com/pdef/pdef-java/blob/7776c44d1aab0f3dbf7267b0c32b8f9282fe6167/pdef/src/main/java/io/pdef/json/JsonFormat.java#L86-L92 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksInner.java | WorkbooksInner.listByResourceGroup | public List<WorkbookInner> listByResourceGroup(String resourceGroupName, CategoryType category) {
"""
Get all Workbooks defined within a specified resource group and category.
@param resourceGroupName The name of the resource group.
@param category Category of workbook to return. Possible values include: 'work... | java | public List<WorkbookInner> listByResourceGroup(String resourceGroupName, CategoryType category) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName, category).toBlocking().single().body();
} | [
"public",
"List",
"<",
"WorkbookInner",
">",
"listByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"CategoryType",
"category",
")",
"{",
"return",
"listByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"category",
")",
".",
"toBlocking",
... | Get all Workbooks defined within a specified resource group and category.
@param resourceGroupName The name of the resource group.
@param category Category of workbook to return. Possible values include: 'workbook', 'TSG', 'performance', 'retention'
@throws IllegalArgumentException thrown if parameters fail the valida... | [
"Get",
"all",
"Workbooks",
"defined",
"within",
"a",
"specified",
"resource",
"group",
"and",
"category",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksInner.java#L95-L97 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.removeMultiple | @Nonnull
public static String removeMultiple (@Nullable final String sInputString, @Nonnull final char [] aRemoveChars) {
"""
Optimized remove method that removes a set of characters from an input
string!
@param sInputString
The input string.
@param aRemoveChars
The characters to remove. May not be <code>... | java | @Nonnull
public static String removeMultiple (@Nullable final String sInputString, @Nonnull final char [] aRemoveChars)
{
ValueEnforcer.notNull (aRemoveChars, "RemoveChars");
// Any input text?
if (hasNoText (sInputString))
return "";
// Anything to remove?
if (aRemoveChars.length == 0)
... | [
"@",
"Nonnull",
"public",
"static",
"String",
"removeMultiple",
"(",
"@",
"Nullable",
"final",
"String",
"sInputString",
",",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aRemoveChars",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aRemoveChars",
",",
"\"Rem... | Optimized remove method that removes a set of characters from an input
string!
@param sInputString
The input string.
@param aRemoveChars
The characters to remove. May not be <code>null</code>.
@return The version of the string without the passed characters or an empty
String if the input string was <code>null</code>. | [
"Optimized",
"remove",
"method",
"that",
"removes",
"a",
"set",
"of",
"characters",
"from",
"an",
"input",
"string!"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L5196-L5215 |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorModel.java | CmsMessageBundleEditorModel.handleKeyChange | public KeyChangeResult handleKeyChange(EntryChangeEvent event, boolean allLanguages) {
"""
Handles a key change.
@param event the key change event.
@param allLanguages <code>true</code> for changing the key for all languages, <code>false</code> if the key should be changed only for the current language.
@retu... | java | public KeyChangeResult handleKeyChange(EntryChangeEvent event, boolean allLanguages) {
if (m_keyset.getKeySet().contains(event.getNewValue())) {
m_container.getItem(event.getItemId()).getItemProperty(TableProperty.KEY).setValue(event.getOldValue());
return KeyChangeResult.FAILED_DUPLICA... | [
"public",
"KeyChangeResult",
"handleKeyChange",
"(",
"EntryChangeEvent",
"event",
",",
"boolean",
"allLanguages",
")",
"{",
"if",
"(",
"m_keyset",
".",
"getKeySet",
"(",
")",
".",
"contains",
"(",
"event",
".",
"getNewValue",
"(",
")",
")",
")",
"{",
"m_cont... | Handles a key change.
@param event the key change event.
@param allLanguages <code>true</code> for changing the key for all languages, <code>false</code> if the key should be changed only for the current language.
@return result, indicating if the key change was successful. | [
"Handles",
"a",
"key",
"change",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorModel.java#L815-L826 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlContentDefinition.java | CmsXmlContentDefinition.getCachedContentDefinition | private static CmsXmlContentDefinition getCachedContentDefinition(String schemaLocation, EntityResolver resolver) {
"""
Looks up the given XML content definition system id in the internal content definition cache.<p>
@param schemaLocation the system id of the XML content definition to look up
@param resolver t... | java | private static CmsXmlContentDefinition getCachedContentDefinition(String schemaLocation, EntityResolver resolver) {
if (resolver instanceof CmsXmlEntityResolver) {
// check for a cached version of this content definition
CmsXmlEntityResolver cmsResolver = (CmsXmlEntityResolver)resolver;... | [
"private",
"static",
"CmsXmlContentDefinition",
"getCachedContentDefinition",
"(",
"String",
"schemaLocation",
",",
"EntityResolver",
"resolver",
")",
"{",
"if",
"(",
"resolver",
"instanceof",
"CmsXmlEntityResolver",
")",
"{",
"// check for a cached version of this content defi... | Looks up the given XML content definition system id in the internal content definition cache.<p>
@param schemaLocation the system id of the XML content definition to look up
@param resolver the XML entity resolver to use (contains the cache)
@return the XML content definition found, or null if no definition is cached... | [
"Looks",
"up",
"the",
"given",
"XML",
"content",
"definition",
"system",
"id",
"in",
"the",
"internal",
"content",
"definition",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlContentDefinition.java#L861-L869 |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/manager/ServiceManagerAmpWrapper.java | ServiceManagerAmpWrapper.bind | @Override
public ServiceRefAmp bind(ServiceRefAmp service, String address) {
"""
/*
@Override
public <T> T createPinProxy(ServiceRefAmp actorRef,
Class<T> api,
Class<?>... apis)
{
return getDelegate().createPinProxy(actorRef, api, apis);
}
"""
return delegate().bind(service, address);
} | java | @Override
public ServiceRefAmp bind(ServiceRefAmp service, String address)
{
return delegate().bind(service, address);
} | [
"@",
"Override",
"public",
"ServiceRefAmp",
"bind",
"(",
"ServiceRefAmp",
"service",
",",
"String",
"address",
")",
"{",
"return",
"delegate",
"(",
")",
".",
"bind",
"(",
"service",
",",
"address",
")",
";",
"}"
] | /*
@Override
public <T> T createPinProxy(ServiceRefAmp actorRef,
Class<T> api,
Class<?>... apis)
{
return getDelegate().createPinProxy(actorRef, api, apis);
} | [
"/",
"*"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/manager/ServiceManagerAmpWrapper.java#L158-L162 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/actions/ExecutePLSQLAction.java | ExecutePLSQLAction.createStatementsFromScript | private List<String> createStatementsFromScript(TestContext context) {
"""
Create SQL statements from inline script.
@param context the current test context.
@return list of SQL statements.
"""
List<String> stmts = new ArrayList<>();
script = context.replaceDynamicContentInString(scr... | java | private List<String> createStatementsFromScript(TestContext context) {
List<String> stmts = new ArrayList<>();
script = context.replaceDynamicContentInString(script);
if (log.isDebugEnabled()) {
log.debug("Found inline PLSQL script " + script);
}
StringToken... | [
"private",
"List",
"<",
"String",
">",
"createStatementsFromScript",
"(",
"TestContext",
"context",
")",
"{",
"List",
"<",
"String",
">",
"stmts",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"script",
"=",
"context",
".",
"replaceDynamicContentInString",
"("... | Create SQL statements from inline script.
@param context the current test context.
@return list of SQL statements. | [
"Create",
"SQL",
"statements",
"from",
"inline",
"script",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/ExecutePLSQLAction.java#L119-L136 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java | MethodHandle.ofLoaded | public static MethodHandle ofLoaded(Object methodHandle, Object lookup) {
"""
Creates a method handles representation of a loaded method handle which is analyzed using the given lookup context.
A method handle can only be analyzed on virtual machines that support the corresponding API (Java 7+). For virtual machi... | java | public static MethodHandle ofLoaded(Object methodHandle, Object lookup) {
if (!JavaType.METHOD_HANDLE.isInstance(methodHandle)) {
throw new IllegalArgumentException("Expected method handle object: " + methodHandle);
} else if (!JavaType.METHOD_HANDLES_LOOKUP.isInstance(lookup)) {... | [
"public",
"static",
"MethodHandle",
"ofLoaded",
"(",
"Object",
"methodHandle",
",",
"Object",
"lookup",
")",
"{",
"if",
"(",
"!",
"JavaType",
".",
"METHOD_HANDLE",
".",
"isInstance",
"(",
"methodHandle",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",... | Creates a method handles representation of a loaded method handle which is analyzed using the given lookup context.
A method handle can only be analyzed on virtual machines that support the corresponding API (Java 7+). For virtual machines before Java 8+,
a method handle instance can only be analyzed by taking advantag... | [
"Creates",
"a",
"method",
"handles",
"representation",
"of",
"a",
"loaded",
"method",
"handle",
"which",
"is",
"analyzed",
"using",
"the",
"given",
"lookup",
"context",
".",
"A",
"method",
"handle",
"can",
"only",
"be",
"analyzed",
"on",
"virtual",
"machines",... | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java#L503-L517 |
Azure/azure-sdk-for-java | compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/DisksInner.java | DisksInner.createOrUpdate | public DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk) {
"""
Creates or updates a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported... | java | public DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, diskName, disk).toBlocking().last().body();
} | [
"public",
"DiskInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"diskName",
",",
"DiskInner",
"disk",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"diskName",
",",
"disk",
")",
".",
"toBlockin... | Creates or updates a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@param disk D... | [
"Creates",
"or",
"updates",
"a",
"disk",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/DisksInner.java#L144-L146 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.document_id_GET | public OvhDocument document_id_GET(String id) throws IOException {
"""
Get this object properties
REST: GET /me/document/{id}
@param id [required] Document id
"""
String qPath = "/me/document/{id}";
StringBuilder sb = path(qPath, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return co... | java | public OvhDocument document_id_GET(String id) throws IOException {
String qPath = "/me/document/{id}";
StringBuilder sb = path(qPath, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhDocument.class);
} | [
"public",
"OvhDocument",
"document_id_GET",
"(",
"String",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/document/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"id",
")",
";",
"String",
"resp",
"=",
"exec",
"(... | Get this object properties
REST: GET /me/document/{id}
@param id [required] Document id | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2545-L2550 |
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/ManagedInstancesInner.java | ManagedInstancesInner.updateAsync | public Observable<ManagedInstanceInner> updateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters) {
"""
Updates a managed instance.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Mana... | java | public Observable<ManagedInstanceInner> updateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters) {
return updateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).map(new Func1<ServiceResponse<ManagedInstanceInner>, ManagedInstanceInner>() {
... | [
"public",
"Observable",
"<",
"ManagedInstanceInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"ManagedInstanceUpdate",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
","... | Updates a managed instance.
@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 managedInstanceName The name of the managed instance.
@param parameters The requested managed instance resource state.
@thr... | [
"Updates",
"a",
"managed",
"instance",
"."
] | 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/ManagedInstancesInner.java#L789-L796 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java | PgResultSet.getBytes | @Override
public byte[] getBytes(int columnIndex) throws SQLException {
"""
{@inheritDoc}
<p>In normal use, the bytes represent the raw values returned by the backend. However, if the
column is an OID, then it is assumed to refer to a Large Object, and that object is returned as
a byte array.</p>
<p><b>B... | java | @Override
public byte[] getBytes(int columnIndex) throws SQLException {
connection.getLogger().log(Level.FINEST, " getBytes columnIndex: {0}", columnIndex);
checkResultSet(columnIndex);
if (wasNullFlag) {
return null;
}
if (isBinary(columnIndex)) {
// If the data is already binary th... | [
"@",
"Override",
"public",
"byte",
"[",
"]",
"getBytes",
"(",
"int",
"columnIndex",
")",
"throws",
"SQLException",
"{",
"connection",
".",
"getLogger",
"(",
")",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\" getBytes columnIndex: {0}\"",
",",
"columnIndex... | {@inheritDoc}
<p>In normal use, the bytes represent the raw values returned by the backend. However, if the
column is an OID, then it is assumed to refer to a Large Object, and that object is returned as
a byte array.</p>
<p><b>Be warned</b> If the large object is huge, then you may run out of memory.</p> | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java#L2324-L2341 |
phax/ph-web | ph-servlet/src/main/java/com/helger/servlet/cookie/CookieHelper.java | CookieHelper.removeCookie | public static void removeCookie (@Nonnull final HttpServletResponse aHttpResponse, @Nonnull final Cookie aCookie) {
"""
Remove a cookie by setting the max age to 0.
@param aHttpResponse
The HTTP response. May not be <code>null</code>.
@param aCookie
The cookie to be removed. May not be <code>null</code>.
... | java | public static void removeCookie (@Nonnull final HttpServletResponse aHttpResponse, @Nonnull final Cookie aCookie)
{
ValueEnforcer.notNull (aHttpResponse, "HttpResponse");
ValueEnforcer.notNull (aCookie, "aCookie");
// expire the cookie!
aCookie.setMaxAge (0);
aHttpResponse.addCookie (aCookie);
... | [
"public",
"static",
"void",
"removeCookie",
"(",
"@",
"Nonnull",
"final",
"HttpServletResponse",
"aHttpResponse",
",",
"@",
"Nonnull",
"final",
"Cookie",
"aCookie",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aHttpResponse",
",",
"\"HttpResponse\"",
")",
";",... | Remove a cookie by setting the max age to 0.
@param aHttpResponse
The HTTP response. May not be <code>null</code>.
@param aCookie
The cookie to be removed. May not be <code>null</code>. | [
"Remove",
"a",
"cookie",
"by",
"setting",
"the",
"max",
"age",
"to",
"0",
"."
] | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/cookie/CookieHelper.java#L135-L143 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.intdiv | public static Number intdiv(Number left, Number right) {
"""
Integer Divide two Numbers.
@param left a Number
@param right another Number
@return a Number (an Integer) resulting from the integer division operation
@since 1.0
"""
return NumberMath.intdiv(left, right);
} | java | public static Number intdiv(Number left, Number right) {
return NumberMath.intdiv(left, right);
} | [
"public",
"static",
"Number",
"intdiv",
"(",
"Number",
"left",
",",
"Number",
"right",
")",
"{",
"return",
"NumberMath",
".",
"intdiv",
"(",
"left",
",",
"right",
")",
";",
"}"
] | Integer Divide two Numbers.
@param left a Number
@param right another Number
@return a Number (an Integer) resulting from the integer division operation
@since 1.0 | [
"Integer",
"Divide",
"two",
"Numbers",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L15434-L15436 |
keyboardsurfer/Crouton | library/src/main/java/de/keyboardsurfer/android/widget/crouton/Manager.java | Manager.removeCrouton | protected void removeCrouton(Crouton crouton) {
"""
Removes the {@link Crouton}'s view after it's display
durationInMilliseconds.
@param crouton
The {@link Crouton} added to a {@link ViewGroup} and should be
removed.
"""
// If the crouton hasn't been displayed yet a `Crouton.hide()` will fail to hide... | java | protected void removeCrouton(Crouton crouton) {
// If the crouton hasn't been displayed yet a `Crouton.hide()` will fail to hide
// it since the DISPLAY message might still be in the queue. Remove all messages
// for this crouton.
removeAllMessagesForCrouton(crouton);
View croutonView = crouton.get... | [
"protected",
"void",
"removeCrouton",
"(",
"Crouton",
"crouton",
")",
"{",
"// If the crouton hasn't been displayed yet a `Crouton.hide()` will fail to hide",
"// it since the DISPLAY message might still be in the queue. Remove all messages",
"// for this crouton.",
"removeAllMessagesForCrouto... | Removes the {@link Crouton}'s view after it's display
durationInMilliseconds.
@param crouton
The {@link Crouton} added to a {@link ViewGroup} and should be
removed. | [
"Removes",
"the",
"{",
"@link",
"Crouton",
"}",
"s",
"view",
"after",
"it",
"s",
"display",
"durationInMilliseconds",
"."
] | train | https://github.com/keyboardsurfer/Crouton/blob/7806b15e4d52793e1f5aeaa4a55b1e220289e619/library/src/main/java/de/keyboardsurfer/android/widget/crouton/Manager.java#L295-L325 |
actframework/actframework | src/main/java/act/cli/ascii_table/impl/SimpleASCIITableImpl.java | SimpleASCIITableImpl.getRowLineBuf | private String getRowLineBuf(int colCount, List<Integer> colMaxLenList, String[][] data) {
"""
Each string item rendering requires the border and a space on both sides.
12 3 12 3 12 34
+----- +-------- +------+
abc venkat last
@param colCount
@param colMaxLenList
@param data
@re... | java | private String getRowLineBuf(int colCount, List<Integer> colMaxLenList, String[][] data) {
S.Buffer rowBuilder = S.buffer();
int colWidth;
for (int i = 0 ; i < colCount ; i ++) {
colWidth = colMaxLenList.get(i) + 3;
for (int j = 0; j < colWidth ; j ++) {
if (j==0) {
rowBuilder.append(... | [
"private",
"String",
"getRowLineBuf",
"(",
"int",
"colCount",
",",
"List",
"<",
"Integer",
">",
"colMaxLenList",
",",
"String",
"[",
"]",
"[",
"]",
"data",
")",
"{",
"S",
".",
"Buffer",
"rowBuilder",
"=",
"S",
".",
"buffer",
"(",
")",
";",
"int",
"co... | Each string item rendering requires the border and a space on both sides.
12 3 12 3 12 34
+----- +-------- +------+
abc venkat last
@param colCount
@param colMaxLenList
@param data
@return | [
"Each",
"string",
"item",
"rendering",
"requires",
"the",
"border",
"and",
"a",
"space",
"on",
"both",
"sides",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/cli/ascii_table/impl/SimpleASCIITableImpl.java#L338-L359 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/UtilFile.java | UtilFile.isType | public static boolean isType(File file, String extension) {
"""
Check if the following type is the expected type.
@param file The file to check (can be <code>null</code>).
@param extension The expected extension (must not be <code>null</code>).
@return <code>true</code> if correct, <code>false</code> else.
@... | java | public static boolean isType(File file, String extension)
{
Check.notNull(extension);
if (file != null && file.isFile())
{
final String current = getExtension(file);
return current.equals(extension.replace(Constant.DOT, Constant.EMPTY_STRING));
}
retu... | [
"public",
"static",
"boolean",
"isType",
"(",
"File",
"file",
",",
"String",
"extension",
")",
"{",
"Check",
".",
"notNull",
"(",
"extension",
")",
";",
"if",
"(",
"file",
"!=",
"null",
"&&",
"file",
".",
"isFile",
"(",
")",
")",
"{",
"final",
"Strin... | Check if the following type is the expected type.
@param file The file to check (can be <code>null</code>).
@param extension The expected extension (must not be <code>null</code>).
@return <code>true</code> if correct, <code>false</code> else.
@throws LionEngineException If invalid argument. | [
"Check",
"if",
"the",
"following",
"type",
"is",
"the",
"expected",
"type",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/UtilFile.java#L233-L243 |
Alexey1Gavrilov/ExpectIt | expectit-core/src/main/java/net/sf/expectit/ExpectBuilder.java | ExpectBuilder.withTimeout | public final ExpectBuilder withTimeout(long duration, TimeUnit unit) {
"""
Sets the default timeout in the given unit for expect operations. Optional,
the default value is 30 seconds.
@param duration the timeout value
@param unit the time unit
@return this
@throws java.lang.IllegalArgumentException if t... | java | public final ExpectBuilder withTimeout(long duration, TimeUnit unit) {
validateDuration(duration);
this.timeout = unit.toMillis(duration);
return this;
} | [
"public",
"final",
"ExpectBuilder",
"withTimeout",
"(",
"long",
"duration",
",",
"TimeUnit",
"unit",
")",
"{",
"validateDuration",
"(",
"duration",
")",
";",
"this",
".",
"timeout",
"=",
"unit",
".",
"toMillis",
"(",
"duration",
")",
";",
"return",
"this",
... | Sets the default timeout in the given unit for expect operations. Optional,
the default value is 30 seconds.
@param duration the timeout value
@param unit the time unit
@return this
@throws java.lang.IllegalArgumentException if the timeout {@code <= 0} | [
"Sets",
"the",
"default",
"timeout",
"in",
"the",
"given",
"unit",
"for",
"expect",
"operations",
".",
"Optional",
"the",
"default",
"value",
"is",
"30",
"seconds",
"."
] | train | https://github.com/Alexey1Gavrilov/ExpectIt/blob/5acbe1f8f895fe1dbd63e29bf3ab8e5bbf0873c3/expectit-core/src/main/java/net/sf/expectit/ExpectBuilder.java#L104-L108 |
alipay/sofa-hessian | src/main/java/com/caucho/hessian/io/Hessian2Output.java | Hessian2Output.writeListBegin | public boolean writeListBegin(int length, String type)
throws IOException {
"""
Writes the list header to the stream. List writers will call
<code>writeListBegin</code> followed by the list contents and then
call <code>writeListEnd</code>.
<code><pre>
list ::= V type value* Z
::= v type int value*
... | java | public boolean writeListBegin(int length, String type)
throws IOException
{
flushIfFull();
if (length < 0) {
if (type != null) {
_buffer[_offset++] = (byte) BC_LIST_VARIABLE;
writeType(type);
}
else
_buffer[... | [
"public",
"boolean",
"writeListBegin",
"(",
"int",
"length",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"flushIfFull",
"(",
")",
";",
"if",
"(",
"length",
"<",
"0",
")",
"{",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"_buffer",
"[",
"... | Writes the list header to the stream. List writers will call
<code>writeListBegin</code> followed by the list contents and then
call <code>writeListEnd</code>.
<code><pre>
list ::= V type value* Z
::= v type int value*
</pre></code>
@return true for variable lists, false for fixed lists | [
"Writes",
"the",
"list",
"header",
"to",
"the",
"stream",
".",
"List",
"writers",
"will",
"call",
"<code",
">",
"writeListBegin<",
"/",
"code",
">",
"followed",
"by",
"the",
"list",
"contents",
"and",
"then",
"call",
"<code",
">",
"writeListEnd<",
"/",
"co... | train | https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/Hessian2Output.java#L477-L516 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/PropertiesUtil.java | PropertiesUtil.listPropertiesWithPrefix | public static Collection listPropertiesWithPrefix(Properties props, String prefix) {
"""
Returns a Collection of all property values that have keys with a certain prefix.
@param props the Properties to reaqd
@param prefix the prefix
@return Collection of all property values with keys with a certain prefix
"... | java | public static Collection listPropertiesWithPrefix(Properties props, String prefix) {
final HashSet set = new HashSet();
for (Iterator i = props.keySet().iterator(); i.hasNext();) {
String key = (String) i.next();
if (key.startsWith(prefix)) {
set.add(props.getProp... | [
"public",
"static",
"Collection",
"listPropertiesWithPrefix",
"(",
"Properties",
"props",
",",
"String",
"prefix",
")",
"{",
"final",
"HashSet",
"set",
"=",
"new",
"HashSet",
"(",
")",
";",
"for",
"(",
"Iterator",
"i",
"=",
"props",
".",
"keySet",
"(",
")"... | Returns a Collection of all property values that have keys with a certain prefix.
@param props the Properties to reaqd
@param prefix the prefix
@return Collection of all property values with keys with a certain prefix | [
"Returns",
"a",
"Collection",
"of",
"all",
"property",
"values",
"that",
"have",
"keys",
"with",
"a",
"certain",
"prefix",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/PropertiesUtil.java#L125-L134 |
jboss/jboss-jstl-api_spec | src/main/java/org/apache/taglibs/standard/functions/Functions.java | Functions.containsIgnoreCase | public static boolean containsIgnoreCase(String input, String substring) {
"""
Tests if a string contains the specified substring in a case insensitive way.
Equivalent to <code>fn:contains(fn:toUpperCase(string), fn:toUpperCase(substring))</code>.
@param input the input string on which the function is appl... | java | public static boolean containsIgnoreCase(String input, String substring) {
return contains(input.toUpperCase(), substring.toUpperCase());
} | [
"public",
"static",
"boolean",
"containsIgnoreCase",
"(",
"String",
"input",
",",
"String",
"substring",
")",
"{",
"return",
"contains",
"(",
"input",
".",
"toUpperCase",
"(",
")",
",",
"substring",
".",
"toUpperCase",
"(",
")",
")",
";",
"}"
] | Tests if a string contains the specified substring in a case insensitive way.
Equivalent to <code>fn:contains(fn:toUpperCase(string), fn:toUpperCase(substring))</code>.
@param input the input string on which the function is applied
@param substring the substring tested for
@return true if the character sequence re... | [
"Tests",
"if",
"a",
"string",
"contains",
"the",
"specified",
"substring",
"in",
"a",
"case",
"insensitive",
"way",
".",
"Equivalent",
"to",
"<code",
">",
"fn",
":",
"contains",
"(",
"fn",
":",
"toUpperCase",
"(",
"string",
")",
"fn",
":",
"toUpperCase",
... | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/functions/Functions.java#L107-L109 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMesh.java | GVRMesh.createQuad | public static GVRMesh createQuad(GVRContext ctx, String vertexDesc, float width, float height) {
"""
Creates a mesh whose vertices describe a quad consisting of two triangles,
with the specified width and height. If the vertex descriptor allows for
normals and/or texture coordinates, they are added.
@param ct... | java | public static GVRMesh createQuad(GVRContext ctx, String vertexDesc, float width, float height)
{
GVRMesh mesh = new GVRMesh(ctx, vertexDesc);
mesh.createQuad(width, height);
return mesh;
} | [
"public",
"static",
"GVRMesh",
"createQuad",
"(",
"GVRContext",
"ctx",
",",
"String",
"vertexDesc",
",",
"float",
"width",
",",
"float",
"height",
")",
"{",
"GVRMesh",
"mesh",
"=",
"new",
"GVRMesh",
"(",
"ctx",
",",
"vertexDesc",
")",
";",
"mesh",
".",
"... | Creates a mesh whose vertices describe a quad consisting of two triangles,
with the specified width and height. If the vertex descriptor allows for
normals and/or texture coordinates, they are added.
@param ctx GVRContext to use for creating mesh.
@param vertexDesc String describing vertex format of {@link GV... | [
"Creates",
"a",
"mesh",
"whose",
"vertices",
"describe",
"a",
"quad",
"consisting",
"of",
"two",
"triangles",
"with",
"the",
"specified",
"width",
"and",
"height",
".",
"If",
"the",
"vertex",
"descriptor",
"allows",
"for",
"normals",
"and",
"/",
"or",
"textu... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMesh.java#L733-L738 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.