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 |
|---|---|---|---|---|---|---|---|---|---|---|
liyiorg/weixin-popular | src/main/java/weixin/popular/api/MaterialAPI.java | MaterialAPI.update_news | public static BaseResult update_news(String access_token,String media_id,int index,List<Article> articles) {
"""
修改永久图文素材
@param access_token access_token
@param media_id 要修改的图文消息的id
@param index 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为0
@param articles articles
@return BaseResult
"""
return update_news(... | java | public static BaseResult update_news(String access_token,String media_id,int index,List<Article> articles){
return update_news(access_token, media_id, index, JsonUtil.toJSONString(articles));
} | [
"public",
"static",
"BaseResult",
"update_news",
"(",
"String",
"access_token",
",",
"String",
"media_id",
",",
"int",
"index",
",",
"List",
"<",
"Article",
">",
"articles",
")",
"{",
"return",
"update_news",
"(",
"access_token",
",",
"media_id",
",",
"index",... | 修改永久图文素材
@param access_token access_token
@param media_id 要修改的图文消息的id
@param index 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为0
@param articles articles
@return BaseResult | [
"修改永久图文素材"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MaterialAPI.java#L214-L216 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java | Option.hasMoreFlags | private static boolean hasMoreFlags(String[] args, int start, Option[] templates) {
"""
Determines if a String array representation of option names contains an option whose name matches a FLAG_TYPE option in the supplied array of
Option templates. The search starts from the supplied starting index and ends with t... | java | private static boolean hasMoreFlags(String[] args, int start, Option[] templates) {
for (int i = start; i < args.length; i++) {
Option template = findTemplate(args[i], templates);
if (((template == null) || (!Type.LIST.equals(template.getType())))) {
return true;
... | [
"private",
"static",
"boolean",
"hasMoreFlags",
"(",
"String",
"[",
"]",
"args",
",",
"int",
"start",
",",
"Option",
"[",
"]",
"templates",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"args",
".",
"length",
";",
"i",
"++",
")",
... | Determines if a String array representation of option names contains an option whose name matches a FLAG_TYPE option in the supplied array of
Option templates. The search starts from the supplied starting index and ends with the last element in <code>args[]</code>
@param args A String array containing option n... | [
"Determines",
"if",
"a",
"String",
"array",
"representation",
"of",
"option",
"names",
"contains",
"an",
"option",
"whose",
"name",
"matches",
"a",
"FLAG_TYPE",
"option",
"in",
"the",
"supplied",
"array",
"of",
"Option",
"templates",
".",
"The",
"search",
"sta... | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java#L263-L276 |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/FileSystemContext.java | FileSystemContext.moveFile | public boolean moveFile(String srcPath, String dstPath)
throws IOException {
"""
Move the file referenced by the srcPath to the dstPath. This will cause
the dstPath file to be overwritten if it already exists. If the srcPath
does not exist, or the dstPath cannot be written to, or an error occurs
during... | java | public boolean moveFile(String srcPath, String dstPath)
throws IOException {
return moveFile(srcPath, dstPath, true);
} | [
"public",
"boolean",
"moveFile",
"(",
"String",
"srcPath",
",",
"String",
"dstPath",
")",
"throws",
"IOException",
"{",
"return",
"moveFile",
"(",
"srcPath",
",",
"dstPath",
",",
"true",
")",
";",
"}"
] | Move the file referenced by the srcPath to the dstPath. This will cause
the dstPath file to be overwritten if it already exists. If the srcPath
does not exist, or the dstPath cannot be written to, or an error occurs
during moving, then an {@link IOException} is thrown.
@param srcPath The path of the file to move
@para... | [
"Move",
"the",
"file",
"referenced",
"by",
"the",
"srcPath",
"to",
"the",
"dstPath",
".",
"This",
"will",
"cause",
"the",
"dstPath",
"file",
"to",
"be",
"overwritten",
"if",
"it",
"already",
"exists",
".",
"If",
"the",
"srcPath",
"does",
"not",
"exist",
... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/FileSystemContext.java#L113-L117 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/GLRenderWrapper.java | GLRenderWrapper.savePixels | private Bitmap savePixels(int x, int y, int w, int h) {
"""
Extract the bitmap from OpenGL
@param x the start column
@param y the start line
@param w the width of the bitmap
@param h the height of the bitmap
"""
int b[] = new int[w * (y + h)];
int bt[] = new int[w * h];
IntBuffer ib = IntBuffer.wra... | java | private Bitmap savePixels(int x, int y, int w, int h) {
int b[] = new int[w * (y + h)];
int bt[] = new int[w * h];
IntBuffer ib = IntBuffer.wrap(b);
ib.position(0);
GLES20.glReadPixels(x, 0, w, y + h, GLES20.GL_RGBA,
GLES20.GL_UNSIGNED_BYTE, ib);
for (int i = 0, k = 0; i < h; i++, k++) {
// remember... | [
"private",
"Bitmap",
"savePixels",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
")",
"{",
"int",
"b",
"[",
"]",
"=",
"new",
"int",
"[",
"w",
"*",
"(",
"y",
"+",
"h",
")",
"]",
";",
"int",
"bt",
"[",
"]",
"=",
"new",... | Extract the bitmap from OpenGL
@param x the start column
@param y the start line
@param w the width of the bitmap
@param h the height of the bitmap | [
"Extract",
"the",
"bitmap",
"from",
"OpenGL"
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/GLRenderWrapper.java#L128-L150 |
phax/ph-commons | ph-charset/src/main/java/com/helger/charset/utf7/UTF7StyleCharsetEncoder.java | UTF7StyleCharsetEncoder.encodeLoop | @Override
protected CoderResult encodeLoop (final CharBuffer in, final ByteBuffer out) {
"""
{@inheritDoc}
<p>
Note that this method might return <code>CoderResult.OVERFLOW</code>, even
though there is sufficient space available in the output buffer. This is
done to force the broken implementation of
{@link... | java | @Override
protected CoderResult encodeLoop (final CharBuffer in, final ByteBuffer out)
{
while (in.hasRemaining ())
{
if (out.remaining () < 4)
return CoderResult.OVERFLOW;
final char ch = in.get ();
if (m_aCharset.canEncodeDirectly (ch))
{
_unshift (out, ch);
... | [
"@",
"Override",
"protected",
"CoderResult",
"encodeLoop",
"(",
"final",
"CharBuffer",
"in",
",",
"final",
"ByteBuffer",
"out",
")",
"{",
"while",
"(",
"in",
".",
"hasRemaining",
"(",
")",
")",
"{",
"if",
"(",
"out",
".",
"remaining",
"(",
")",
"<",
"4... | {@inheritDoc}
<p>
Note that this method might return <code>CoderResult.OVERFLOW</code>, even
though there is sufficient space available in the output buffer. This is
done to force the broken implementation of
{@link java.nio.charset.CharsetEncoder#encode(CharBuffer)} to call flush
(the buggy method is <code>final</code... | [
"{",
"@inheritDoc",
"}",
"<p",
">",
"Note",
"that",
"this",
"method",
"might",
"return",
"<code",
">",
"CoderResult",
".",
"OVERFLOW<",
"/",
"code",
">",
"even",
"though",
"there",
"is",
"sufficient",
"space",
"available",
"in",
"the",
"output",
"buffer",
... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-charset/src/main/java/com/helger/charset/utf7/UTF7StyleCharsetEncoder.java#L137-L161 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/core/GenericCollectionTypeResolver.java | GenericCollectionTypeResolver.getCollectionFieldType | public static Class<?> getCollectionFieldType(Field collectionField, int nestingLevel) {
"""
Determine the generic element type of the given Collection field.
@param collectionField the collection field to introspect
@param nestingLevel the nesting level of the target type
(typically 1; e.g. in case of a List o... | java | public static Class<?> getCollectionFieldType(Field collectionField, int nestingLevel) {
return getGenericFieldType(collectionField, Collection.class, 0, null, nestingLevel);
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"getCollectionFieldType",
"(",
"Field",
"collectionField",
",",
"int",
"nestingLevel",
")",
"{",
"return",
"getGenericFieldType",
"(",
"collectionField",
",",
"Collection",
".",
"class",
",",
"0",
",",
"null",
",",
"... | Determine the generic element type of the given Collection field.
@param collectionField the collection field to introspect
@param nestingLevel the nesting level of the target type
(typically 1; e.g. in case of a List of Lists, 1 would indicate the
nested List, whereas 2 would indicate the element of the nested List)
@... | [
"Determine",
"the",
"generic",
"element",
"type",
"of",
"the",
"given",
"Collection",
"field",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/GenericCollectionTypeResolver.java#L90-L92 |
joachimvda/jtransfo | core/src/main/java/org/jtransfo/internal/ReflectionHelper.java | ReflectionHelper.getMethod | Method getMethod(Class<?> type, Class<?> returnType, String name, Class<?>... parameters) {
"""
Get method with given name and parameters and given return type.
@param type class on which method should be found
@param returnType required return type (or null for void or no check)
@param name method name
@par... | java | Method getMethod(Class<?> type, Class<?> returnType, String name, Class<?>... parameters) {
Method method = null;
try {
// first try for public methods
method = type.getMethod(name, parameters);
if (null != returnType && !returnType.isAssignableFrom(method.getReturnTy... | [
"Method",
"getMethod",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"?",
">",
"returnType",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"...",
"parameters",
")",
"{",
"Method",
"method",
"=",
"null",
";",
"try",
"{",
"// first try ... | Get method with given name and parameters and given return type.
@param type class on which method should be found
@param returnType required return type (or null for void or no check)
@param name method name
@param parameters method parameter types
@return method or null when method not found | [
"Get",
"method",
"with",
"given",
"name",
"and",
"parameters",
"and",
"given",
"return",
"type",
"."
] | train | https://github.com/joachimvda/jtransfo/blob/eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8/core/src/main/java/org/jtransfo/internal/ReflectionHelper.java#L178-L194 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/LocalDateRange.java | LocalDateRange.ofClosed | public static LocalDateRange ofClosed(LocalDate startInclusive, LocalDate endInclusive) {
"""
Obtains a closed range of dates, including the start and end.
<p>
The range includes the start date and the end date.
The end date must be equal to or after the start date.
<p>
The constants {@code LocalDate.MIN} and... | java | public static LocalDateRange ofClosed(LocalDate startInclusive, LocalDate endInclusive) {
Objects.requireNonNull(startInclusive, "startInclusive");
Objects.requireNonNull(endInclusive, "endInclusive");
if (endInclusive.isBefore(startInclusive)) {
throw new DateTimeException("Start da... | [
"public",
"static",
"LocalDateRange",
"ofClosed",
"(",
"LocalDate",
"startInclusive",
",",
"LocalDate",
"endInclusive",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"startInclusive",
",",
"\"startInclusive\"",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"en... | Obtains a closed range of dates, including the start and end.
<p>
The range includes the start date and the end date.
The end date must be equal to or after the start date.
<p>
The constants {@code LocalDate.MIN} and {@code LocalDate.MAX} can be used
to indicate an unbounded far-past or far-future. In addition, an end ... | [
"Obtains",
"a",
"closed",
"range",
"of",
"dates",
"including",
"the",
"start",
"and",
"end",
".",
"<p",
">",
"The",
"range",
"includes",
"the",
"start",
"date",
"and",
"the",
"end",
"date",
".",
"The",
"end",
"date",
"must",
"be",
"equal",
"to",
"or",
... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/LocalDateRange.java#L155-L163 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.fireEvent | private void fireEvent(boolean resized, ZoomOption option) {
"""
Fire an event.
@param resized resized or not
@param option zoom option
"""
if (width > 0) {
// keep old semantics of sameScaleLevel for api compatibility !
boolean sameScale = lastViewState != null && viewState.isPannableFrom(lastView... | java | private void fireEvent(boolean resized, ZoomOption option) {
if (width > 0) {
// keep old semantics of sameScaleLevel for api compatibility !
boolean sameScale = lastViewState != null && viewState.isPannableFrom(lastViewState);
handlerManager.fireEvent(new MapViewChangedEvent(getBounds(), getCurrentScale(), ... | [
"private",
"void",
"fireEvent",
"(",
"boolean",
"resized",
",",
"ZoomOption",
"option",
")",
"{",
"if",
"(",
"width",
">",
"0",
")",
"{",
"// keep old semantics of sameScaleLevel for api compatibility !",
"boolean",
"sameScale",
"=",
"lastViewState",
"!=",
"null",
"... | Fire an event.
@param resized resized or not
@param option zoom option | [
"Fire",
"an",
"event",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L630-L637 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TimerService.java | TimerService.registerTimeout | public void registerTimeout(final K key, final long delay, final TimeUnit unit) {
"""
Register a timeout for the given key which shall occur in the given delay.
@param key for which to register the timeout
@param delay until the timeout
@param unit of the timeout delay
"""
Preconditions.checkState(timeo... | java | public void registerTimeout(final K key, final long delay, final TimeUnit unit) {
Preconditions.checkState(timeoutListener != null, "The " + getClass().getSimpleName() +
" has not been started.");
if (timeouts.containsKey(key)) {
unregisterTimeout(key);
}
timeouts.put(key, new Timeout<>(timeoutListener,... | [
"public",
"void",
"registerTimeout",
"(",
"final",
"K",
"key",
",",
"final",
"long",
"delay",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"timeoutListener",
"!=",
"null",
",",
"\"The \"",
"+",
"getClass",
"(",
")",
... | Register a timeout for the given key which shall occur in the given delay.
@param key for which to register the timeout
@param delay until the timeout
@param unit of the timeout delay | [
"Register",
"a",
"timeout",
"for",
"the",
"given",
"key",
"which",
"shall",
"occur",
"in",
"the",
"given",
"delay",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TimerService.java#L101-L110 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/PortletPreferencesJsonDaoImpl.java | PortletPreferencesJsonDaoImpl.getJsonNode | @Override
public JsonNode getJsonNode(PortletPreferences prefs, String key) throws IOException {
"""
Read the specified portlet preference and parse it as a JSON string into a {@link JsonNode}
If the preference is null returns a {@link JSONObject}.
@param prefs Preferences to read from
@param key Preferen... | java | @Override
public JsonNode getJsonNode(PortletPreferences prefs, String key) throws IOException {
final String prefValue = StringUtils.trimToNull(prefs.getValue(key, null));
if (prefValue == null) {
// Default to an empty object
return mapper.createObjectNode();
}
... | [
"@",
"Override",
"public",
"JsonNode",
"getJsonNode",
"(",
"PortletPreferences",
"prefs",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"final",
"String",
"prefValue",
"=",
"StringUtils",
".",
"trimToNull",
"(",
"prefs",
".",
"getValue",
"(",
"key",
... | Read the specified portlet preference and parse it as a JSON string into a {@link JsonNode}
If the preference is null returns a {@link JSONObject}.
@param prefs Preferences to read from
@param key Preference key to read from | [
"Read",
"the",
"specified",
"portlet",
"preference",
"and",
"parse",
"it",
"as",
"a",
"JSON",
"string",
"into",
"a",
"{",
"@link",
"JsonNode",
"}",
"If",
"the",
"preference",
"is",
"null",
"returns",
"a",
"{",
"@link",
"JSONObject",
"}",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/PortletPreferencesJsonDaoImpl.java#L80-L88 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/ResourceUtils.java | ResourceUtils.findInstanceResourcesDirectory | public static File findInstanceResourcesDirectory( File applicationFilesDirectory, Instance instance ) {
"""
Finds the resource directory for an instance.
@param applicationFilesDirectory the application's directory
@param instance an instance
@return a non-null file (that may not exist)
"""
return findIn... | java | public static File findInstanceResourcesDirectory( File applicationFilesDirectory, Instance instance ) {
return findInstanceResourcesDirectory( applicationFilesDirectory, instance.getComponent());
} | [
"public",
"static",
"File",
"findInstanceResourcesDirectory",
"(",
"File",
"applicationFilesDirectory",
",",
"Instance",
"instance",
")",
"{",
"return",
"findInstanceResourcesDirectory",
"(",
"applicationFilesDirectory",
",",
"instance",
".",
"getComponent",
"(",
")",
")"... | Finds the resource directory for an instance.
@param applicationFilesDirectory the application's directory
@param instance an instance
@return a non-null file (that may not exist) | [
"Finds",
"the",
"resource",
"directory",
"for",
"an",
"instance",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/ResourceUtils.java#L116-L118 |
lemire/JavaFastPFOR | src/main/java/me/lemire/integercompression/differential/Delta.java | Delta.delta | public static int delta(int[] data, int start, int length, int init) {
"""
Apply differential coding (in-place) given an initial value.
@param data
data to be modified
@param start
starting index
@param length
number of integers to process
@param init
initial value
@return next initial vale
"""
... | java | public static int delta(int[] data, int start, int length, int init) {
final int nextinit = data[start + length - 1];
for (int i = length - 1; i > 0; --i) {
data[start + i] -= data[start + i - 1];
}
data[start] -= init;
... | [
"public",
"static",
"int",
"delta",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"start",
",",
"int",
"length",
",",
"int",
"init",
")",
"{",
"final",
"int",
"nextinit",
"=",
"data",
"[",
"start",
"+",
"length",
"-",
"1",
"]",
";",
"for",
"(",
"int"... | Apply differential coding (in-place) given an initial value.
@param data
data to be modified
@param start
starting index
@param length
number of integers to process
@param init
initial value
@return next initial vale | [
"Apply",
"differential",
"coding",
"(",
"in",
"-",
"place",
")",
"given",
"an",
"initial",
"value",
"."
] | train | https://github.com/lemire/JavaFastPFOR/blob/ffeea61ab2fdb3854da7b0a557f8d22d674477f4/src/main/java/me/lemire/integercompression/differential/Delta.java#L43-L50 |
samskivert/samskivert | src/main/java/com/samskivert/util/ProcessLogger.java | ProcessLogger.copyOutput | public static void copyOutput (Logger target, String name, Process process) {
"""
Starts threads that copy the output of the supplied process's stdout and stderr streams to
the supplied target logger. When the streams reach EOF, the threads will exit. The threads
will be set to daemon so that they do not prevent... | java | public static void copyOutput (Logger target, String name, Process process)
{
new StreamReader(target, name + " stdout", process.getInputStream()).start();
new StreamReader(target, name + " stderr", process.getErrorStream()).start();
} | [
"public",
"static",
"void",
"copyOutput",
"(",
"Logger",
"target",
",",
"String",
"name",
",",
"Process",
"process",
")",
"{",
"new",
"StreamReader",
"(",
"target",
",",
"name",
"+",
"\" stdout\"",
",",
"process",
".",
"getInputStream",
"(",
")",
")",
".",... | Starts threads that copy the output of the supplied process's stdout and stderr streams to
the supplied target logger. When the streams reach EOF, the threads will exit. The threads
will be set to daemon so that they do not prevent the VM from exiting.
@param target the logger to which to copy the output.
@param name ... | [
"Starts",
"threads",
"that",
"copy",
"the",
"output",
"of",
"the",
"supplied",
"process",
"s",
"stdout",
"and",
"stderr",
"streams",
"to",
"the",
"supplied",
"target",
"logger",
".",
"When",
"the",
"streams",
"reach",
"EOF",
"the",
"threads",
"will",
"exit",... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ProcessLogger.java#L29-L33 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/TileGroupsConfig.java | TileGroupsConfig.exportGroup | private static void exportGroup(Xml nodeGroups, TileGroup group) {
"""
Export the group data as a node.
@param nodeGroups The root node (must not be <code>null</code>).
@param group The group to export (must not be <code>null</code>).
"""
final Xml nodeGroup = nodeGroups.createChild(NODE_GROUP);
... | java | private static void exportGroup(Xml nodeGroups, TileGroup group)
{
final Xml nodeGroup = nodeGroups.createChild(NODE_GROUP);
nodeGroup.writeString(ATT_GROUP_NAME, group.getName());
nodeGroup.writeString(ATT_GROUP_TYPE, group.getType().name());
for (final TileRef tileRef : grou... | [
"private",
"static",
"void",
"exportGroup",
"(",
"Xml",
"nodeGroups",
",",
"TileGroup",
"group",
")",
"{",
"final",
"Xml",
"nodeGroup",
"=",
"nodeGroups",
".",
"createChild",
"(",
"NODE_GROUP",
")",
";",
"nodeGroup",
".",
"writeString",
"(",
"ATT_GROUP_NAME",
... | Export the group data as a node.
@param nodeGroups The root node (must not be <code>null</code>).
@param group The group to export (must not be <code>null</code>). | [
"Export",
"the",
"group",
"data",
"as",
"a",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/TileGroupsConfig.java#L129-L140 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookFragment.java | FacebookFragment.onActivityResult | @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
"""
Called when the activity that was launched exits. This method manages session
information when a session is opened. If this method is overridden in subclasses,
be sure to call {@code super.onActivityResult(...)} first.... | java | @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
sessionTracker.getSession().onActivityResult(this.getActivity(), requestCode, resultCode, data);
} | [
"@",
"Override",
"public",
"void",
"onActivityResult",
"(",
"int",
"requestCode",
",",
"int",
"resultCode",
",",
"Intent",
"data",
")",
"{",
"super",
".",
"onActivityResult",
"(",
"requestCode",
",",
"resultCode",
",",
"data",
")",
";",
"sessionTracker",
".",
... | Called when the activity that was launched exits. This method manages session
information when a session is opened. If this method is overridden in subclasses,
be sure to call {@code super.onActivityResult(...)} first. | [
"Called",
"when",
"the",
"activity",
"that",
"was",
"launched",
"exits",
".",
"This",
"method",
"manages",
"session",
"information",
"when",
"a",
"session",
"is",
"opened",
".",
"If",
"this",
"method",
"is",
"overridden",
"in",
"subclasses",
"be",
"sure",
"t... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookFragment.java#L57-L61 |
Netflix/spectator | spectator-ext-sandbox/src/main/java/com/netflix/spectator/sandbox/HttpLogEntry.java | HttpLogEntry.logClientRequest | @Deprecated
public static void logClientRequest(Logger logger, HttpLogEntry entry) {
"""
Log a client request.
@deprecated Use {@link #logClientRequest(HttpLogEntry)} instead.
"""
log(logger, CLIENT, entry);
} | java | @Deprecated
public static void logClientRequest(Logger logger, HttpLogEntry entry) {
log(logger, CLIENT, entry);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"logClientRequest",
"(",
"Logger",
"logger",
",",
"HttpLogEntry",
"entry",
")",
"{",
"log",
"(",
"logger",
",",
"CLIENT",
",",
"entry",
")",
";",
"}"
] | Log a client request.
@deprecated Use {@link #logClientRequest(HttpLogEntry)} instead. | [
"Log",
"a",
"client",
"request",
"."
] | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-ext-sandbox/src/main/java/com/netflix/spectator/sandbox/HttpLogEntry.java#L111-L114 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java | ExpressRoutePortsInner.beginUpdateTags | public ExpressRoutePortInner beginUpdateTags(String resourceGroupName, String expressRoutePortName) {
"""
Update ExpressRoutePort tags.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@throws IllegalArgumentException thrown if par... | java | public ExpressRoutePortInner beginUpdateTags(String resourceGroupName, String expressRoutePortName) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().single().body();
} | [
"public",
"ExpressRoutePortInner",
"beginUpdateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRoutePortName",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"expressRoutePortName",
")",
".",
"toBlocking",
"(",
... | Update ExpressRoutePort tags.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeExcep... | [
"Update",
"ExpressRoutePort",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java#L672-L674 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/impl/ImplConvertNV21.java | ImplConvertNV21.nv21ToGray | public static void nv21ToGray(byte[] dataNV, GrayF32 output) {
"""
First block contains gray-scale information and UV data can be ignored.
"""
//CONCURRENT_BELOW BoofConcurrency.loopFor(0, output.height, y -> {
for( int y = 0; y < output.height; y++ ) {
int indexIn = y*output.width;
int indexOut = o... | java | public static void nv21ToGray(byte[] dataNV, GrayF32 output) {
//CONCURRENT_BELOW BoofConcurrency.loopFor(0, output.height, y -> {
for( int y = 0; y < output.height; y++ ) {
int indexIn = y*output.width;
int indexOut = output.startIndex + y*output.stride;
for( int x = 0; x < output.width; x++ ) {
out... | [
"public",
"static",
"void",
"nv21ToGray",
"(",
"byte",
"[",
"]",
"dataNV",
",",
"GrayF32",
"output",
")",
"{",
"//CONCURRENT_BELOW BoofConcurrency.loopFor(0, output.height, y -> {",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"output",
".",
"height",
";",
... | First block contains gray-scale information and UV data can be ignored. | [
"First",
"block",
"contains",
"gray",
"-",
"scale",
"information",
"and",
"UV",
"data",
"can",
"be",
"ignored",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/impl/ImplConvertNV21.java#L57-L69 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.ofPairs | public static <U, T> StreamEx<T> ofPairs(List<U> list, BiFunction<? super U, ? super U, ? extends T> mapper) {
"""
Returns a sequential ordered {@code StreamEx} containing the results of
applying the given mapper function to the all possible pairs of elements
taken from the provided list.
<p>
The indices of ... | java | public static <U, T> StreamEx<T> ofPairs(List<U> list, BiFunction<? super U, ? super U, ? extends T> mapper) {
return of(new PairPermutationSpliterator<>(list, mapper));
} | [
"public",
"static",
"<",
"U",
",",
"T",
">",
"StreamEx",
"<",
"T",
">",
"ofPairs",
"(",
"List",
"<",
"U",
">",
"list",
",",
"BiFunction",
"<",
"?",
"super",
"U",
",",
"?",
"super",
"U",
",",
"?",
"extends",
"T",
">",
"mapper",
")",
"{",
"return... | Returns a sequential ordered {@code StreamEx} containing the results of
applying the given mapper function to the all possible pairs of elements
taken from the provided list.
<p>
The indices of two elements supplied to the mapper function are always
ordered: first element index is strictly less than the second element... | [
"Returns",
"a",
"sequential",
"ordered",
"{",
"@code",
"StreamEx",
"}",
"containing",
"the",
"results",
"of",
"applying",
"the",
"given",
"mapper",
"function",
"to",
"the",
"all",
"possible",
"pairs",
"of",
"elements",
"taken",
"from",
"the",
"provided",
"list... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L2862-L2864 |
shrinkwrap/descriptors | api-base/src/main/java/org/jboss/shrinkwrap/descriptor/api/Descriptors.java | Descriptors.importAs | public static <T extends Descriptor> DescriptorImporter<T> importAs(final Class<T> type)
throws IllegalArgumentException {
"""
Returns a new {@link DescriptorImporter} instance, ready to import as a new {@link Descriptor} instance of the
given type
@param type
@return
@throws IllegalArgumentException... | java | public static <T extends Descriptor> DescriptorImporter<T> importAs(final Class<T> type)
throws IllegalArgumentException {
return importAs(type, null);
} | [
"public",
"static",
"<",
"T",
"extends",
"Descriptor",
">",
"DescriptorImporter",
"<",
"T",
">",
"importAs",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"importAs",
"(",
"type",
",",
"null",
")",
... | Returns a new {@link DescriptorImporter} instance, ready to import as a new {@link Descriptor} instance of the
given type
@param type
@return
@throws IllegalArgumentException
If the type is not specified | [
"Returns",
"a",
"new",
"{",
"@link",
"DescriptorImporter",
"}",
"instance",
"ready",
"to",
"import",
"as",
"a",
"new",
"{",
"@link",
"Descriptor",
"}",
"instance",
"of",
"the",
"given",
"type"
] | train | https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/api-base/src/main/java/org/jboss/shrinkwrap/descriptor/api/Descriptors.java#L81-L84 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/ServiceDirectory.java | ServiceDirectory.setUser | public static void setUser(String userName, String password) {
"""
Set the Directory User.
@param userName
the user name.
@param password
the password of the user.
@throws ServiceException
"""
getImpl().getDirectoryServiceClient().setUser(userName, password);
} | java | public static void setUser(String userName, String password){
getImpl().getDirectoryServiceClient().setUser(userName, password);
} | [
"public",
"static",
"void",
"setUser",
"(",
"String",
"userName",
",",
"String",
"password",
")",
"{",
"getImpl",
"(",
")",
".",
"getDirectoryServiceClient",
"(",
")",
".",
"setUser",
"(",
"userName",
",",
"password",
")",
";",
"}"
] | Set the Directory User.
@param userName
the user name.
@param password
the password of the user.
@throws ServiceException | [
"Set",
"the",
"Directory",
"User",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/ServiceDirectory.java#L124-L126 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java | FTPFileSystem.rename | private boolean rename(FTPClient client, Path src, Path dst)
throws IOException {
"""
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.
@param client
@para... | java | private boolean rename(FTPClient client, Path src, Path dst)
throws IOException {
Path workDir = new Path(client.printWorkingDirectory());
Path absoluteSrc = makeAbsolute(workDir, src);
Path absoluteDst = makeAbsolute(workDir, dst);
if (!exists(client, absoluteSrc)) {
throw new IOException("... | [
"private",
"boolean",
"rename",
"(",
"FTPClient",
"client",
",",
"Path",
"src",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"Path",
"workDir",
"=",
"new",
"Path",
"(",
"client",
".",
"printWorkingDirectory",
"(",
")",
")",
";",
"Path",
"absolute... | 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.
@param client
@param src
@param dst
@return
@throws IOException | [
"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#L530-L553 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/IfmapJHelper.java | IfmapJHelper.getTrustManagers | public static TrustManager[] getTrustManagers() throws InitializationException {
"""
Creates {@link TrustManager} instances based on the javax.net.ssl.trustStore
and javax.net.ssl.trustStorePassword environment variables.
@return an array of {@link TrustManager} instances
@throws InitializationException
"... | java | public static TrustManager[] getTrustManagers() throws InitializationException {
String file = System.getProperty("javax.net.ssl.trustStore");
String pass = System.getProperty("javax.net.ssl.trustStorePassword");
if (file == null || pass == null) {
throw new InitializationException("javax.net.ssl.trustStore /... | [
"public",
"static",
"TrustManager",
"[",
"]",
"getTrustManagers",
"(",
")",
"throws",
"InitializationException",
"{",
"String",
"file",
"=",
"System",
".",
"getProperty",
"(",
"\"javax.net.ssl.trustStore\"",
")",
";",
"String",
"pass",
"=",
"System",
".",
"getProp... | Creates {@link TrustManager} instances based on the javax.net.ssl.trustStore
and javax.net.ssl.trustStorePassword environment variables.
@return an array of {@link TrustManager} instances
@throws InitializationException | [
"Creates",
"{",
"@link",
"TrustManager",
"}",
"instances",
"based",
"on",
"the",
"javax",
".",
"net",
".",
"ssl",
".",
"trustStore",
"and",
"javax",
".",
"net",
".",
"ssl",
".",
"trustStorePassword",
"environment",
"variables",
"."
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/IfmapJHelper.java#L136-L146 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.deleteAsync | public CompletableFuture<Object> deleteAsync(@DelegatesTo(HttpConfig.class) final Closure closure) {
"""
Executes an asynchronous DELETE request on the configured URI (an asynchronous alias to the `delete(Closure)` method), with additional configuration
provided by the configuration closure.
[source,groovy]
-... | java | public CompletableFuture<Object> deleteAsync(@DelegatesTo(HttpConfig.class) final Closure closure) {
return CompletableFuture.supplyAsync(() -> delete(closure), getExecutor());
} | [
"public",
"CompletableFuture",
"<",
"Object",
">",
"deleteAsync",
"(",
"@",
"DelegatesTo",
"(",
"HttpConfig",
".",
"class",
")",
"final",
"Closure",
"closure",
")",
"{",
"return",
"CompletableFuture",
".",
"supplyAsync",
"(",
"(",
")",
"->",
"delete",
"(",
"... | Executes an asynchronous DELETE request on the configured URI (an asynchronous alias to the `delete(Closure)` method), with additional configuration
provided by the configuration closure.
[source,groovy]
----
def http = HttpBuilder.configure {
request.uri = 'http://localhost:10101'
}
def result = http.deleteAsync(){
r... | [
"Executes",
"an",
"asynchronous",
"DELETE",
"request",
"on",
"the",
"configured",
"URI",
"(",
"an",
"asynchronous",
"alias",
"to",
"the",
"delete",
"(",
"Closure",
")",
"method",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuration... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1193-L1195 |
calimero-project/calimero-core | src/tuwien/auto/calimero/serial/usb/UsbConnection.java | UsbConnection.fireFrameReceived | private void fireFrameReceived(final KnxTunnelEmi emiType, final byte[] frame) throws KNXFormatException {
"""
Fires a frame received event ({@link KNXListener#frameReceived(FrameEvent)}) for the supplied EMI
<code>frame</code>.
@param frame the EMI1/EMI2/cEMI L-data frame to generate the event for
@throws KN... | java | private void fireFrameReceived(final KnxTunnelEmi emiType, final byte[] frame) throws KNXFormatException
{
logger.debug("received {} frame {}", emiType, DataUnitBuilder.toHex(frame, ""));
final FrameEvent fe = emiType == KnxTunnelEmi.CEmi
? new FrameEvent(this, CEMIFactory.create(frame, 0, frame.length)) : new... | [
"private",
"void",
"fireFrameReceived",
"(",
"final",
"KnxTunnelEmi",
"emiType",
",",
"final",
"byte",
"[",
"]",
"frame",
")",
"throws",
"KNXFormatException",
"{",
"logger",
".",
"debug",
"(",
"\"received {} frame {}\"",
",",
"emiType",
",",
"DataUnitBuilder",
"."... | Fires a frame received event ({@link KNXListener#frameReceived(FrameEvent)}) for the supplied EMI
<code>frame</code>.
@param frame the EMI1/EMI2/cEMI L-data frame to generate the event for
@throws KNXFormatException on error creating cEMI message | [
"Fires",
"a",
"frame",
"received",
"event",
"(",
"{",
"@link",
"KNXListener#frameReceived",
"(",
"FrameEvent",
")",
"}",
")",
"for",
"the",
"supplied",
"EMI",
"<code",
">",
"frame<",
"/",
"code",
">",
"."
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/serial/usb/UsbConnection.java#L804-L810 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/sjavac/BuildState.java | BuildState.flattenArtifacts | public void flattenArtifacts(Map<String,Module> m) {
"""
Store references to all artifacts found in the module tree into the maps
stored in the build state.
@param m The set of modules.
"""
modules = m;
// Extract all the found packages.
for (Module i : modules.values()) {
... | java | public void flattenArtifacts(Map<String,Module> m) {
modules = m;
// Extract all the found packages.
for (Module i : modules.values()) {
for (Map.Entry<String,Package> j : i.packages().entrySet()) {
Package p = packages.get(j.getKey());
// Check that n... | [
"public",
"void",
"flattenArtifacts",
"(",
"Map",
"<",
"String",
",",
"Module",
">",
"m",
")",
"{",
"modules",
"=",
"m",
";",
"// Extract all the found packages.",
"for",
"(",
"Module",
"i",
":",
"modules",
".",
"values",
"(",
")",
")",
"{",
"for",
"(",
... | Store references to all artifacts found in the module tree into the maps
stored in the build state.
@param m The set of modules. | [
"Store",
"references",
"to",
"all",
"artifacts",
"found",
"in",
"the",
"module",
"tree",
"into",
"the",
"maps",
"stored",
"in",
"the",
"build",
"state",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/sjavac/BuildState.java#L133-L151 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.listAvailableProvidersAsync | public Observable<AvailableProvidersListInner> listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) {
"""
Lists all available internet service providers for a specified Azure region.
@param resourceGroupName The name of the network watcher... | java | public Observable<AvailableProvidersListInner> listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) {
return listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1<ServiceResponse<Av... | [
"public",
"Observable",
"<",
"AvailableProvidersListInner",
">",
"listAvailableProvidersAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"AvailableProvidersListParameters",
"parameters",
")",
"{",
"return",
"listAvailableProvidersWithServiceRe... | Lists all available internet service providers for a specified Azure region.
@param resourceGroupName The name of the network watcher resource group.
@param networkWatcherName The name of the network watcher resource.
@param parameters Parameters that scope the list of available providers.
@throws IllegalArgumentExcep... | [
"Lists",
"all",
"available",
"internet",
"service",
"providers",
"for",
"a",
"specified",
"Azure",
"region",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L2503-L2510 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java | CommerceShippingMethodPersistenceImpl.removeByG_A | @Override
public void removeByG_A(long groupId, boolean active) {
"""
Removes all the commerce shipping methods where groupId = ? and active = ? from the database.
@param groupId the group ID
@param active the active
"""
for (CommerceShippingMethod commerceShippingMethod : findByG_A(
groupId... | java | @Override
public void removeByG_A(long groupId, boolean active) {
for (CommerceShippingMethod commerceShippingMethod : findByG_A(
groupId, active, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceShippingMethod);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_A",
"(",
"long",
"groupId",
",",
"boolean",
"active",
")",
"{",
"for",
"(",
"CommerceShippingMethod",
"commerceShippingMethod",
":",
"findByG_A",
"(",
"groupId",
",",
"active",
",",
"QueryUtil",
".",
"ALL_POS",
",",
... | Removes all the commerce shipping methods where groupId = ? and active = ? from the database.
@param groupId the group ID
@param active the active | [
"Removes",
"all",
"the",
"commerce",
"shipping",
"methods",
"where",
"groupId",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java#L1339-L1345 |
seedstack/business | migrate/src/main/java/org/seedstack/business/view/VirtualList.java | VirtualList.subList | List<T> subList(long from, long to) {
"""
Returns a portion of this list between the specified from, inclusive, and to, exclusive.
@param from low endpoint (inclusive) of the subList
@param to high endpoint (exclusive) of the subList
@return the sub list of item
"""
if (fullListSize > 0 && to - ... | java | List<T> subList(long from, long to) {
if (fullListSize > 0 && to - from > 0) {
checkRange(from);
// subList takes a [from;to[ range
checkRange(to - 1);
// check if the data of the required sub list are available
assertSubRange(from, to - 1);
... | [
"List",
"<",
"T",
">",
"subList",
"(",
"long",
"from",
",",
"long",
"to",
")",
"{",
"if",
"(",
"fullListSize",
">",
"0",
"&&",
"to",
"-",
"from",
">",
"0",
")",
"{",
"checkRange",
"(",
"from",
")",
";",
"// subList takes a [from;to[ range",
"checkRange... | Returns a portion of this list between the specified from, inclusive, and to, exclusive.
@param from low endpoint (inclusive) of the subList
@param to high endpoint (exclusive) of the subList
@return the sub list of item | [
"Returns",
"a",
"portion",
"of",
"this",
"list",
"between",
"the",
"specified",
"from",
"inclusive",
"and",
"to",
"exclusive",
"."
] | train | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/migrate/src/main/java/org/seedstack/business/view/VirtualList.java#L61-L75 |
bmwcarit/joynr | java/messaging/messaging-common/src/main/java/io/joynr/messaging/util/Utilities.java | Utilities.getUrlWithoutSessionId | public static String getUrlWithoutSessionId(String url, String sessionIdName) {
"""
Returns the URL without the session encoded into the URL.
@param url
the url to de-code
@param sessionIdName
the name of the session ID, e.g. jsessionid
@return url without session id information or url, if no session was
e... | java | public static String getUrlWithoutSessionId(String url, String sessionIdName) {
if (isSessionEncodedInUrl(url, sessionIdName)) {
return url.substring(0, url.indexOf(getSessionIdSubstring(sessionIdName)));
}
return url;
} | [
"public",
"static",
"String",
"getUrlWithoutSessionId",
"(",
"String",
"url",
",",
"String",
"sessionIdName",
")",
"{",
"if",
"(",
"isSessionEncodedInUrl",
"(",
"url",
",",
"sessionIdName",
")",
")",
"{",
"return",
"url",
".",
"substring",
"(",
"0",
",",
"ur... | Returns the URL without the session encoded into the URL.
@param url
the url to de-code
@param sessionIdName
the name of the session ID, e.g. jsessionid
@return url without session id information or url, if no session was
encoded into the URL | [
"Returns",
"the",
"URL",
"without",
"the",
"session",
"encoded",
"into",
"the",
"URL",
"."
] | train | https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/messaging/messaging-common/src/main/java/io/joynr/messaging/util/Utilities.java#L138-L144 |
Azure/azure-sdk-for-java | dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/RecordSetsInner.java | RecordSetsInner.listByDnsZoneAsync | public Observable<Page<RecordSetInner>> listByDnsZoneAsync(final String resourceGroupName, final String zoneName, final Integer top, final String recordsetnamesuffix) {
"""
Lists all record sets in a DNS zone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS zone (wi... | java | public Observable<Page<RecordSetInner>> listByDnsZoneAsync(final String resourceGroupName, final String zoneName, final Integer top, final String recordsetnamesuffix) {
return listByDnsZoneWithServiceResponseAsync(resourceGroupName, zoneName, top, recordsetnamesuffix)
.map(new Func1<ServiceResponse<... | [
"public",
"Observable",
"<",
"Page",
"<",
"RecordSetInner",
">",
">",
"listByDnsZoneAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"zoneName",
",",
"final",
"Integer",
"top",
",",
"final",
"String",
"recordsetnamesuffix",
")",
"{",
... | Lists all record sets in a DNS zone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS zone (without a terminating dot).
@param top The maximum number of record sets to return. If not specified, returns up to 100 record sets.
@param recordsetnamesuffix The suffix label of the... | [
"Lists",
"all",
"record",
"sets",
"in",
"a",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/RecordSetsInner.java#L1271-L1279 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/task_command_log.java | task_command_log.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
task_command_log_responses result = (task_command_log_responses) servic... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
task_command_log_responses result = (task_command_log_responses) service.get_payload_formatter().string_to_resource(task_command_log_responses.class, response);
if(result.errorcode != 0)
{
if (res... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"task_command_log_responses",
"result",
"=",
"(",
"task_command_log_responses",
")",
"service",
".",
"get_payl... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/task_command_log.java#L293-L310 |
mangstadt/biweekly | src/main/java/biweekly/io/scribe/property/RecurrencePropertyScribe.java | RecurrencePropertyScribe.handleVersion1Multivalued | private void handleVersion1Multivalued(String value, ICalDataType dataType, ICalParameters parameters, ParseContext context) {
"""
Version 1.0 allows multiple RRULE values to be defined inside of the same
property. This method checks for this and, if multiple values are found,
parses them and throws a {@link Dat... | java | private void handleVersion1Multivalued(String value, ICalDataType dataType, ICalParameters parameters, ParseContext context) {
List<String> rrules = splitRRULEValues(value);
if (rrules.size() == 1) {
return;
}
DataModelConversionException conversionException = new DataModelConversionException(null);
for (... | [
"private",
"void",
"handleVersion1Multivalued",
"(",
"String",
"value",
",",
"ICalDataType",
"dataType",
",",
"ICalParameters",
"parameters",
",",
"ParseContext",
"context",
")",
"{",
"List",
"<",
"String",
">",
"rrules",
"=",
"splitRRULEValues",
"(",
"value",
")"... | Version 1.0 allows multiple RRULE values to be defined inside of the same
property. This method checks for this and, if multiple values are found,
parses them and throws a {@link DataModelConversionException}.
@param value the property value
@param dataType the property data type
@param parameters the property paramete... | [
"Version",
"1",
".",
"0",
"allows",
"multiple",
"RRULE",
"values",
"to",
"be",
"defined",
"inside",
"of",
"the",
"same",
"property",
".",
"This",
"method",
"checks",
"for",
"this",
"and",
"if",
"multiple",
"values",
"are",
"found",
"parses",
"them",
"and",... | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/property/RecurrencePropertyScribe.java#L229-L256 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java | QrCodeUtil.generate | public static BufferedImage generate(String content, QrConfig config) {
"""
生成二维码图片
@param content 文本内容
@param config 二维码配置,包括长、宽、边距、颜色等
@return 二维码图片(黑白)
@since 4.1.2
"""
return generate(content, BarcodeFormat.QR_CODE, config);
} | java | public static BufferedImage generate(String content, QrConfig config) {
return generate(content, BarcodeFormat.QR_CODE, config);
} | [
"public",
"static",
"BufferedImage",
"generate",
"(",
"String",
"content",
",",
"QrConfig",
"config",
")",
"{",
"return",
"generate",
"(",
"content",
",",
"BarcodeFormat",
".",
"QR_CODE",
",",
"config",
")",
";",
"}"
] | 生成二维码图片
@param content 文本内容
@param config 二维码配置,包括长、宽、边距、颜色等
@return 二维码图片(黑白)
@since 4.1.2 | [
"生成二维码图片"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L158-L160 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/trustmanager/X509ProxyCertPathValidator.java | X509ProxyCertPathValidator.engineValidate | @SuppressWarnings("unchecked")
public CertPathValidatorResult engineValidate(CertPath certPath, CertPathParameters params)
throws CertPathValidatorException, InvalidAlgorithmParameterException {
"""
Validates the specified certification path using the specified algorithm parameter set.
<p>
Th... | java | @SuppressWarnings("unchecked")
public CertPathValidatorResult engineValidate(CertPath certPath, CertPathParameters params)
throws CertPathValidatorException, InvalidAlgorithmParameterException {
if (certPath == null) {
throw new IllegalArgumentException(
"Cer... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"CertPathValidatorResult",
"engineValidate",
"(",
"CertPath",
"certPath",
",",
"CertPathParameters",
"params",
")",
"throws",
"CertPathValidatorException",
",",
"InvalidAlgorithmParameterException",
"{",
"if",
"(... | Validates the specified certification path using the specified algorithm parameter set.
<p>
The <code>CertPath</code> specified must be of a type that is supported by the validation algorithm, otherwise
an <code>InvalidAlgorithmParameterException</code> will be thrown. For example, a <code>CertPathValidator</code>
that... | [
"Validates",
"the",
"specified",
"certification",
"path",
"using",
"the",
"specified",
"algorithm",
"parameter",
"set",
".",
"<p",
">",
"The",
"<code",
">",
"CertPath<",
"/",
"code",
">",
"specified",
"must",
"be",
"of",
"a",
"type",
"that",
"is",
"supported... | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/X509ProxyCertPathValidator.java#L89-L112 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassUtils.java | ClassUtils.getClass | @GwtIncompatible("incompatible method")
public static Class<?> getClass(final ClassLoader classLoader, final String className) throws ClassNotFoundException {
"""
Returns the (initialized) class represented by {@code className}
using the {@code classLoader}. This implementation supports
the syntaxes "{@code... | java | @GwtIncompatible("incompatible method")
public static Class<?> getClass(final ClassLoader classLoader, final String className) throws ClassNotFoundException {
return getClass(classLoader, className, true);
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"Class",
"<",
"?",
">",
"getClass",
"(",
"final",
"ClassLoader",
"classLoader",
",",
"final",
"String",
"className",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"getClass",
... | Returns the (initialized) class represented by {@code className}
using the {@code classLoader}. This implementation supports
the syntaxes "{@code java.util.Map.Entry[]}",
"{@code java.util.Map$Entry[]}", "{@code [Ljava.util.Map.Entry;}",
and "{@code [Ljava.util.Map$Entry;}".
@param classLoader the class loader to us... | [
"Returns",
"the",
"(",
"initialized",
")",
"class",
"represented",
"by",
"{",
"@code",
"className",
"}",
"using",
"the",
"{",
"@code",
"classLoader",
"}",
".",
"This",
"implementation",
"supports",
"the",
"syntaxes",
"{",
"@code",
"java",
".",
"util",
".",
... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L1037-L1040 |
chr78rm/tracelogger | src/main/java/de/christofreichardt/diagnosis/NullTracer.java | NullTracer.logException | @Override
public void logException(LogLevel logLevel, Throwable throwable, Class clazz, String methodName) {
"""
Pseudo logException()-method. Derived classes should provide code which connects to an alternative logging system.
@param logLevel (ignored)
@param throwable (ignored)
@param clazz (ignored)
"... | java | @Override
public void logException(LogLevel logLevel, Throwable throwable, Class clazz, String methodName) {
} | [
"@",
"Override",
"public",
"void",
"logException",
"(",
"LogLevel",
"logLevel",
",",
"Throwable",
"throwable",
",",
"Class",
"clazz",
",",
"String",
"methodName",
")",
"{",
"}"
] | Pseudo logException()-method. Derived classes should provide code which connects to an alternative logging system.
@param logLevel (ignored)
@param throwable (ignored)
@param clazz (ignored) | [
"Pseudo",
"logException",
"()",
"-",
"method",
".",
"Derived",
"classes",
"should",
"provide",
"code",
"which",
"connects",
"to",
"an",
"alternative",
"logging",
"system",
"."
] | train | https://github.com/chr78rm/tracelogger/blob/ad22452b20f8111ad4d367302c2b26a100a20200/src/main/java/de/christofreichardt/diagnosis/NullTracer.java#L163-L165 |
shinesolutions/swagger-aem | java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/SlingApi.java | SlingApi.postAuthorizablesAsync | public com.squareup.okhttp.Call postAuthorizablesAsync(String authorizableId, String intermediatePath, String createUser, String createGroup, String reppassword, String profilegivenName, final ApiCallback<String> callback) throws ApiException {
"""
(asynchronously)
@param authorizableId (required)
@param inte... | java | public com.squareup.okhttp.Call postAuthorizablesAsync(String authorizableId, String intermediatePath, String createUser, String createGroup, String reppassword, String profilegivenName, final ApiCallback<String> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"postAuthorizablesAsync",
"(",
"String",
"authorizableId",
",",
"String",
"intermediatePath",
",",
"String",
"createUser",
",",
"String",
"createGroup",
",",
"String",
"reppassword",
",",
"String",
"pro... | (asynchronously)
@param authorizableId (required)
@param intermediatePath (required)
@param createUser (optional)
@param createGroup (optional)
@param reppassword (optional)
@param profilegivenName (optional)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ... | [
"(",
"asynchronously",
")"
] | train | https://github.com/shinesolutions/swagger-aem/blob/ae7da4df93e817dc2bad843779b2069d9c4e7c6b/java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/SlingApi.java#L2467-L2492 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getGeometryType | public static int getGeometryType(Connection connection,TableLocation location, String fieldName)
throws SQLException {
"""
Return the sfs geometry type identifier of the provided field of the provided table.
@param connection Active connection
@param location Catalog, schema and table name
@param... | java | public static int getGeometryType(Connection connection,TableLocation location, String fieldName)
throws SQLException {
if(fieldName==null || fieldName.isEmpty()) {
List<String> geometryFields = getGeometryFields(connection, location);
if(geometryFields.isEmpty()) {
... | [
"public",
"static",
"int",
"getGeometryType",
"(",
"Connection",
"connection",
",",
"TableLocation",
"location",
",",
"String",
"fieldName",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"fieldName",
"==",
"null",
"||",
"fieldName",
".",
"isEmpty",
"(",
")",
... | Return the sfs geometry type identifier of the provided field of the provided table.
@param connection Active connection
@param location Catalog, schema and table name
@param fieldName Geometry field name or empty (take the first one)
@return The sfs geometry type identifier
@see GeometryTypeCodes
@throws SQLExcept... | [
"Return",
"the",
"sfs",
"geometry",
"type",
"identifier",
"of",
"the",
"provided",
"field",
"of",
"the",
"provided",
"table",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L101-L124 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.decodeBytesToChars | @Nonnull
public static char [] decodeBytesToChars (@Nonnull final byte [] aByteArray, @Nonnull final Charset aCharset) {
"""
Decode a byte array to a char array using the provided charset. This does the
same as <code>new String (aByteArray, aCharset)</code> just without the
intermediate objects.
@param aByt... | java | @Nonnull
public static char [] decodeBytesToChars (@Nonnull final byte [] aByteArray, @Nonnull final Charset aCharset)
{
return decodeBytesToChars (aByteArray, 0, aByteArray.length, aCharset);
} | [
"@",
"Nonnull",
"public",
"static",
"char",
"[",
"]",
"decodeBytesToChars",
"(",
"@",
"Nonnull",
"final",
"byte",
"[",
"]",
"aByteArray",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"return",
"decodeBytesToChars",
"(",
"aByteArray",
",",
"... | Decode a byte array to a char array using the provided charset. This does the
same as <code>new String (aByteArray, aCharset)</code> just without the
intermediate objects.
@param aByteArray
The byte array to be decoded. May not be <code>null</code>.
@param aCharset
Charset to be used. May not be <code>null</code>.
@re... | [
"Decode",
"a",
"byte",
"array",
"to",
"a",
"char",
"array",
"using",
"the",
"provided",
"charset",
".",
"This",
"does",
"the",
"same",
"as",
"<code",
">",
"new",
"String",
"(",
"aByteArray",
"aCharset",
")",
"<",
"/",
"code",
">",
"just",
"without",
"t... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L5352-L5356 |
h2oai/h2o-3 | h2o-algos/src/main/java/hex/tree/gbm/GBMModel.java | GBMModel.score0 | @Override protected double[] score0(double data[/*ncols*/], double preds[/*nclasses+1*/], double offset, int ntrees) {
"""
Bulk scoring API for one row. Chunks are all compatible with the model,
and expect the last Chunks are for the final distribution and prediction.
Default method is to just load the data int... | java | @Override protected double[] score0(double data[/*ncols*/], double preds[/*nclasses+1*/], double offset, int ntrees) {
super.score0(data, preds, offset, ntrees); // These are f_k(x) in Algorithm 10.4
return score0Probabilities(preds, offset);
} | [
"@",
"Override",
"protected",
"double",
"[",
"]",
"score0",
"(",
"double",
"data",
"[",
"/*ncols*/",
"]",
",",
"double",
"preds",
"[",
"/*nclasses+1*/",
"]",
",",
"double",
"offset",
",",
"int",
"ntrees",
")",
"{",
"super",
".",
"score0",
"(",
"data",
... | Bulk scoring API for one row. Chunks are all compatible with the model,
and expect the last Chunks are for the final distribution and prediction.
Default method is to just load the data into the tmp array, then call
subclass scoring logic. | [
"Bulk",
"scoring",
"API",
"for",
"one",
"row",
".",
"Chunks",
"are",
"all",
"compatible",
"with",
"the",
"model",
"and",
"expect",
"the",
"last",
"Chunks",
"are",
"for",
"the",
"final",
"distribution",
"and",
"prediction",
".",
"Default",
"method",
"is",
"... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/tree/gbm/GBMModel.java#L264-L267 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/util/buff/ByteBuffer.java | ByteBuffer.getNextField | public int getNextField(FieldInfo field, boolean bDisplayOption, int iMoveMode) // Must be to call right Get calls {
"""
Get the next field and fill it with data from this buffer.
You must override this method.
@param field The field to set.
@param bDisplayOption The display option for setting the field.
@pa... | java | public int getNextField(FieldInfo field, boolean bDisplayOption, int iMoveMode) // Must be to call right Get calls
{
boolean bDone = ((BaseField)field).read(m_daIn, m_bFixedLength);
if (!bDone)
return Constants.NORMAL_RETURN;
else
return Constants.ERROR_RETURN;
... | [
"public",
"int",
"getNextField",
"(",
"FieldInfo",
"field",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"// Must be to call right Get calls",
"{",
"boolean",
"bDone",
"=",
"(",
"(",
"BaseField",
")",
"field",
")",
".",
"read",
"(",
"m_daIn",
... | Get the next field and fill it with data from this buffer.
You must override this method.
@param field The field to set.
@param bDisplayOption The display option for setting the field.
@param iMoveMove The move mode for setting the field.
@return The error code. | [
"Get",
"the",
"next",
"field",
"and",
"fill",
"it",
"with",
"data",
"from",
"this",
"buffer",
".",
"You",
"must",
"override",
"this",
"method",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/util/buff/ByteBuffer.java#L176-L183 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/domassign/Repeater.java | Repeater.repeatOverFourTermDeclaration | public boolean repeatOverFourTermDeclaration(Declaration d,
Map<String, CSSProperty> properties, Map<String, Term<?>> values)
throws IllegalArgumentException {
"""
Construct terms array to be used by repeated object from available terms
(in size 1 to 4) according to CSS rules.
Example:
<p>
<code>margin... | java | public boolean repeatOverFourTermDeclaration(Declaration d,
Map<String, CSSProperty> properties, Map<String, Term<?>> values)
throws IllegalArgumentException {
switch (d.size()) {
case 1:
// one term for all value
Term<?> term = d.get(0);
// check inherit
if(term instanceof TermIdent && CSSPr... | [
"public",
"boolean",
"repeatOverFourTermDeclaration",
"(",
"Declaration",
"d",
",",
"Map",
"<",
"String",
",",
"CSSProperty",
">",
"properties",
",",
"Map",
"<",
"String",
",",
"Term",
"<",
"?",
">",
">",
"values",
")",
"throws",
"IllegalArgumentException",
"{... | Construct terms array to be used by repeated object from available terms
(in size 1 to 4) according to CSS rules.
Example:
<p>
<code>margin: 2px 5px;</code> creates virtual terms array with terms
<code>2px 5px 2px 5px</code> so top and bottom; left and right contains
the same margin
</p>
@param d
Declaration with ter... | [
"Construct",
"terms",
"array",
"to",
"be",
"used",
"by",
"repeated",
"object",
"from",
"available",
"terms",
"(",
"in",
"size",
"1",
"to",
"4",
")",
"according",
"to",
"CSS",
"rules",
"."
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/domassign/Repeater.java#L113-L160 |
Netflix/suro | suro-core/src/main/java/com/netflix/suro/SuroPlugin.java | SuroPlugin.addSinkType | public <T extends Sink> void addSinkType(String typeName, Class<T> sinkClass) {
"""
Add a sink implementation to Suro. typeName is the expected value of the
'type' field of a JSON configuration.
@param typeName
@param sinkClass
"""
LOG.info("Adding sinkType: " + typeName + " -> " + sinkClass.getC... | java | public <T extends Sink> void addSinkType(String typeName, Class<T> sinkClass) {
LOG.info("Adding sinkType: " + typeName + " -> " + sinkClass.getCanonicalName());
Multibinder<TypeHolder> bindings
= Multibinder.newSetBinder(binder(), TypeHolder.class);
bindings.addBinding().to... | [
"public",
"<",
"T",
"extends",
"Sink",
">",
"void",
"addSinkType",
"(",
"String",
"typeName",
",",
"Class",
"<",
"T",
">",
"sinkClass",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Adding sinkType: \"",
"+",
"typeName",
"+",
"\" -> \"",
"+",
"sinkClass",
".",
"... | Add a sink implementation to Suro. typeName is the expected value of the
'type' field of a JSON configuration.
@param typeName
@param sinkClass | [
"Add",
"a",
"sink",
"implementation",
"to",
"Suro",
".",
"typeName",
"is",
"the",
"expected",
"value",
"of",
"the",
"type",
"field",
"of",
"a",
"JSON",
"configuration",
"."
] | train | https://github.com/Netflix/suro/blob/e73d1a2e5b0492e41feb5a57d9e2a2e741a38453/suro-core/src/main/java/com/netflix/suro/SuroPlugin.java#L31-L37 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/ListIterate.java | ListIterate.reverseForEachWithIndex | public static <T> void reverseForEachWithIndex(List<T> list, ObjectIntProcedure<? super T> objectIntProcedure) {
"""
Iterates over the List in reverse order executing the Procedure for each element. The index passed into the ObjectIntProcedure is the actual index of the
range.
"""
if (!list.isEmpty())... | java | public static <T> void reverseForEachWithIndex(List<T> list, ObjectIntProcedure<? super T> objectIntProcedure)
{
if (!list.isEmpty())
{
ListIterate.forEachWithIndex(list, list.size() - 1, 0, objectIntProcedure);
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"reverseForEachWithIndex",
"(",
"List",
"<",
"T",
">",
"list",
",",
"ObjectIntProcedure",
"<",
"?",
"super",
"T",
">",
"objectIntProcedure",
")",
"{",
"if",
"(",
"!",
"list",
".",
"isEmpty",
"(",
")",
")",
"{"... | Iterates over the List in reverse order executing the Procedure for each element. The index passed into the ObjectIntProcedure is the actual index of the
range. | [
"Iterates",
"over",
"the",
"List",
"in",
"reverse",
"order",
"executing",
"the",
"Procedure",
"for",
"each",
"element",
".",
"The",
"index",
"passed",
"into",
"the",
"ObjectIntProcedure",
"is",
"the",
"actual",
"index",
"of",
"the",
"range",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/ListIterate.java#L680-L686 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java | CategoryGraph.serializeMap | private void serializeMap(Map<?,?> map, File file) {
"""
Serialize a Map.
@param map The map to serialize.
@param file The file for saving the map.
"""
try(ObjectOutputStream os = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)))){
os.writeObject(map);
... | java | private void serializeMap(Map<?,?> map, File file) {
try(ObjectOutputStream os = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)))){
os.writeObject(map);
} catch (Exception e) {
logger.error(e.getLocalizedMessage(), e);
}
} | [
"private",
"void",
"serializeMap",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"File",
"file",
")",
"{",
"try",
"(",
"ObjectOutputStream",
"os",
"=",
"new",
"ObjectOutputStream",
"(",
"new",
"BufferedOutputStream",
"(",
"new",
"FileOutputStream",
"(",
... | Serialize a Map.
@param map The map to serialize.
@param file The file for saving the map. | [
"Serialize",
"a",
"Map",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L1644-L1650 |
evernote/android-state | library/src/main/java/com/evernote/android/state/StateSaverImpl.java | StateSaverImpl.restoreInstanceState | @Nullable
/*package*/ <T extends View> Parcelable restoreInstanceState(@NonNull T target, @Nullable Parcelable state) {
"""
Restore the sate of the given view and return the super state of the parent class.
@param target The view containing fields annotated with {@link State}.
@param state The parcelable ... | java | @Nullable
/*package*/ <T extends View> Parcelable restoreInstanceState(@NonNull T target, @Nullable Parcelable state) {
if (state != null) {
Injector.View<T> injector = safeGet(target, Injector.View.DEFAULT);
return injector.restore(target, state);
} else {
return... | [
"@",
"Nullable",
"/*package*/",
"<",
"T",
"extends",
"View",
">",
"Parcelable",
"restoreInstanceState",
"(",
"@",
"NonNull",
"T",
"target",
",",
"@",
"Nullable",
"Parcelable",
"state",
")",
"{",
"if",
"(",
"state",
"!=",
"null",
")",
"{",
"Injector",
".",
... | Restore the sate of the given view and return the super state of the parent class.
@param target The view containing fields annotated with {@link State}.
@param state The parcelable containing the view's state and its super sate.
@return The super state of teh parent class of the view. Usually it isn't {@code null}. | [
"Restore",
"the",
"sate",
"of",
"the",
"given",
"view",
"and",
"return",
"the",
"super",
"state",
"of",
"the",
"parent",
"class",
"."
] | train | https://github.com/evernote/android-state/blob/6d56c0c5709f330324ec23d39c3f70c9d59bf6d3/library/src/main/java/com/evernote/android/state/StateSaverImpl.java#L109-L117 |
phax/ph-web | ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponse.java | UnifiedResponse.setXFrameOptions | @Nonnull
public final UnifiedResponse setXFrameOptions (@Nonnull final EXFrameOptionType eType,
@Nullable final ISimpleURL aDomain) {
"""
The X-Frame-Options HTTP response header can be used to indicate whether or
not a browser should be allowed to render a page ... | java | @Nonnull
public final UnifiedResponse setXFrameOptions (@Nonnull final EXFrameOptionType eType,
@Nullable final ISimpleURL aDomain)
{
ValueEnforcer.notNull (eType, "Type");
if (eType.isURLRequired ())
ValueEnforcer.notNull (aDomain, "Domain");
if (... | [
"@",
"Nonnull",
"public",
"final",
"UnifiedResponse",
"setXFrameOptions",
"(",
"@",
"Nonnull",
"final",
"EXFrameOptionType",
"eType",
",",
"@",
"Nullable",
"final",
"ISimpleURL",
"aDomain",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"eType",
",",
"\"Type\"",
... | The X-Frame-Options HTTP response header can be used to indicate whether or
not a browser should be allowed to render a page in a <frame>,
<iframe> or <object> . Sites can use this to avoid clickjacking
attacks, by ensuring that their content is not embedded into other sites.
Example:
<pre>
X-Frame-O... | [
"The",
"X",
"-",
"Frame",
"-",
"Options",
"HTTP",
"response",
"header",
"can",
"be",
"used",
"to",
"indicate",
"whether",
"or",
"not",
"a",
"browser",
"should",
"be",
"allowed",
"to",
"render",
"a",
"page",
"in",
"a",
"<",
";",
"frame>",
";",
"<"... | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponse.java#L1130-L1144 |
FXMisc/WellBehavedFX | src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java | InputMapTemplate.ifProcessed | public InputMapTemplate<S, E> ifProcessed(BiConsumer<? super S, ? super E> postProceed) {
"""
Executes some additional handler if the event was consumed (e.g. {@link InputHandler#process(Event)} returns
{@link Result#CONSUME}).
"""
return postResult(Result.PROCEED, postProceed);
} | java | public InputMapTemplate<S, E> ifProcessed(BiConsumer<? super S, ? super E> postProceed) {
return postResult(Result.PROCEED, postProceed);
} | [
"public",
"InputMapTemplate",
"<",
"S",
",",
"E",
">",
"ifProcessed",
"(",
"BiConsumer",
"<",
"?",
"super",
"S",
",",
"?",
"super",
"E",
">",
"postProceed",
")",
"{",
"return",
"postResult",
"(",
"Result",
".",
"PROCEED",
",",
"postProceed",
")",
";",
... | Executes some additional handler if the event was consumed (e.g. {@link InputHandler#process(Event)} returns
{@link Result#CONSUME}). | [
"Executes",
"some",
"additional",
"handler",
"if",
"the",
"event",
"was",
"consumed",
"(",
"e",
".",
"g",
".",
"{"
] | train | https://github.com/FXMisc/WellBehavedFX/blob/ca889734481f5439655ca8deb6f742964b5654b0/src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java#L192-L194 |
lastaflute/lasta-di | src/main/java/org/lastaflute/di/util/LdiSrl.java | LdiSrl.substringLastFront | public static String substringLastFront(String str, String... delimiters) {
"""
Extract front sub-string from last-found delimiter.
<pre>
substringLastFront("foo.bar/baz.qux", ".", "/")
returns "foo.bar/baz"
</pre>
@param str The target string. (NotNull)
@param delimiters The array of delimiters. (NotNull)
... | java | public static String substringLastFront(String str, String... delimiters) {
assertStringNotNull(str);
return doSubstringFirstRear(true, false, false, str, delimiters);
} | [
"public",
"static",
"String",
"substringLastFront",
"(",
"String",
"str",
",",
"String",
"...",
"delimiters",
")",
"{",
"assertStringNotNull",
"(",
"str",
")",
";",
"return",
"doSubstringFirstRear",
"(",
"true",
",",
"false",
",",
"false",
",",
"str",
",",
"... | Extract front sub-string from last-found delimiter.
<pre>
substringLastFront("foo.bar/baz.qux", ".", "/")
returns "foo.bar/baz"
</pre>
@param str The target string. (NotNull)
@param delimiters The array of delimiters. (NotNull)
@return The part of string. (NotNull: if delimiter not found, returns argument-plain string) | [
"Extract",
"front",
"sub",
"-",
"string",
"from",
"last",
"-",
"found",
"delimiter",
".",
"<pre",
">",
"substringLastFront",
"(",
"foo",
".",
"bar",
"/",
"baz",
".",
"qux",
".",
"/",
")",
"returns",
"foo",
".",
"bar",
"/",
"baz",
"<",
"/",
"pre",
"... | train | https://github.com/lastaflute/lasta-di/blob/c4e123610c53a04cc836c5e456660e32d613447b/src/main/java/org/lastaflute/di/util/LdiSrl.java#L687-L690 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/permission/SharedObjectPermissionSet.java | SharedObjectPermissionSet.getPermissions | private static Set<ObjectPermission> getPermissions(Collection<String> identifiers) {
"""
Returns a new Set of ObjectPermissions defining READ access for each of
the given identifiers.
@param identifiers
The identifiers of the objects for which READ permission should be
granted.
@return
A new Set of Obje... | java | private static Set<ObjectPermission> getPermissions(Collection<String> identifiers) {
// Include one READ permission for each of the given identifiers
Set<ObjectPermission> permissions = new HashSet<ObjectPermission>();
for (String identifier : identifiers)
permissions.add(new Objec... | [
"private",
"static",
"Set",
"<",
"ObjectPermission",
">",
"getPermissions",
"(",
"Collection",
"<",
"String",
">",
"identifiers",
")",
"{",
"// Include one READ permission for each of the given identifiers",
"Set",
"<",
"ObjectPermission",
">",
"permissions",
"=",
"new",
... | Returns a new Set of ObjectPermissions defining READ access for each of
the given identifiers.
@param identifiers
The identifiers of the objects for which READ permission should be
granted.
@return
A new Set of ObjectPermissions granting READ access for each of the
given identifiers. | [
"Returns",
"a",
"new",
"Set",
"of",
"ObjectPermissions",
"defining",
"READ",
"access",
"for",
"each",
"of",
"the",
"given",
"identifiers",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/permission/SharedObjectPermissionSet.java#L46-L70 |
podio/podio-java | src/main/java/com/podio/tag/TagAPI.java | TagAPI.createTags | public void createTags(Reference reference, String... tags) {
"""
Add a new set of tags to the object. If a tag with the same text is
already present, the tag will be ignored.
@param reference
The object the tags should be added to
@param tags
The tags that should be added
"""
createTags(reference, Ar... | java | public void createTags(Reference reference, String... tags) {
createTags(reference, Arrays.asList(tags));
} | [
"public",
"void",
"createTags",
"(",
"Reference",
"reference",
",",
"String",
"...",
"tags",
")",
"{",
"createTags",
"(",
"reference",
",",
"Arrays",
".",
"asList",
"(",
"tags",
")",
")",
";",
"}"
] | Add a new set of tags to the object. If a tag with the same text is
already present, the tag will be ignored.
@param reference
The object the tags should be added to
@param tags
The tags that should be added | [
"Add",
"a",
"new",
"set",
"of",
"tags",
"to",
"the",
"object",
".",
"If",
"a",
"tag",
"with",
"the",
"same",
"text",
"is",
"already",
"present",
"the",
"tag",
"will",
"be",
"ignored",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/tag/TagAPI.java#L53-L55 |
hap-java/HAP-Java | src/main/java/io/github/hapjava/impl/pairing/HomekitSRP6ServerSession.java | HomekitSRP6ServerSession.step1 | public BigInteger step1(final String userID, final BigInteger s, final BigInteger v) {
"""
Increments this SRP-6a authentication session to {@link State#STEP_1}.
<p>Argument origin:
<ul>
<li>From client: user identity 'I'.
<li>From server database: matching salt 's' and password verifier 'v' values.
</ul>... | java | public BigInteger step1(final String userID, final BigInteger s, final BigInteger v) {
// Check arguments
if (userID == null || userID.trim().isEmpty())
throw new IllegalArgumentException("The user identity 'I' must not be null or empty");
this.userID = userID;
if (s == null) throw new Illegal... | [
"public",
"BigInteger",
"step1",
"(",
"final",
"String",
"userID",
",",
"final",
"BigInteger",
"s",
",",
"final",
"BigInteger",
"v",
")",
"{",
"// Check arguments",
"if",
"(",
"userID",
"==",
"null",
"||",
"userID",
".",
"trim",
"(",
")",
".",
"isEmpty",
... | Increments this SRP-6a authentication session to {@link State#STEP_1}.
<p>Argument origin:
<ul>
<li>From client: user identity 'I'.
<li>From server database: matching salt 's' and password verifier 'v' values.
</ul>
@param userID The identity 'I' of the authenticating user. Must not be {@code null} or empty.
@param ... | [
"Increments",
"this",
"SRP",
"-",
"6a",
"authentication",
"session",
"to",
"{",
"@link",
"State#STEP_1",
"}",
"."
] | train | https://github.com/hap-java/HAP-Java/blob/d2b2f4f1579580a2b5958af3a192128345843db9/src/main/java/io/github/hapjava/impl/pairing/HomekitSRP6ServerSession.java#L132-L167 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateUtilities.java | DateUtilities.setCalendarData | public static void setCalendarData(Calendar calendar, Locale locale) {
"""
Set the attributes of the given calendar from the given locale.
@param calendar The calendar to set the date settings on
@param locale The locale to use for the date settings
"""
int[] array = (int[])localeData.get(locale);
... | java | public static void setCalendarData(Calendar calendar, Locale locale)
{
int[] array = (int[])localeData.get(locale);
if(array == null)
{
Calendar c = Calendar.getInstance(locale);
array = new int[2];
array[0] = c.getFirstDayOfWeek();
array[1] = ... | [
"public",
"static",
"void",
"setCalendarData",
"(",
"Calendar",
"calendar",
",",
"Locale",
"locale",
")",
"{",
"int",
"[",
"]",
"array",
"=",
"(",
"int",
"[",
"]",
")",
"localeData",
".",
"get",
"(",
"locale",
")",
";",
"if",
"(",
"array",
"==",
"nul... | Set the attributes of the given calendar from the given locale.
@param calendar The calendar to set the date settings on
@param locale The locale to use for the date settings | [
"Set",
"the",
"attributes",
"of",
"the",
"given",
"calendar",
"from",
"the",
"given",
"locale",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L333-L346 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.setBytes | public static void setBytes(Path self, byte[] bytes) throws IOException {
"""
Write the bytes from the byte array to the Path.
@param self the file to write to
@param bytes the byte[] to write to the file
@throws java.io.IOException if an IOException occurs.
@since 2.3.0
"""
IOGroovyMethods.setB... | java | public static void setBytes(Path self, byte[] bytes) throws IOException {
IOGroovyMethods.setBytes(Files.newOutputStream(self), bytes);
} | [
"public",
"static",
"void",
"setBytes",
"(",
"Path",
"self",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"IOGroovyMethods",
".",
"setBytes",
"(",
"Files",
".",
"newOutputStream",
"(",
"self",
")",
",",
"bytes",
")",
";",
"}"
] | Write the bytes from the byte array to the Path.
@param self the file to write to
@param bytes the byte[] to write to the file
@throws java.io.IOException if an IOException occurs.
@since 2.3.0 | [
"Write",
"the",
"bytes",
"from",
"the",
"byte",
"array",
"to",
"the",
"Path",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L416-L418 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java | JQLBuilder.checkFieldsDefinitions | private static void checkFieldsDefinitions(SQLiteModelMethod method, Class<? extends Annotation> annotation) {
"""
Check fields definitions.
@param method
the method
@param annotation
the annotation
"""
List<String> includedFields = AnnotationUtility.extractAsStringArray(method.getElement(), annotation... | java | private static void checkFieldsDefinitions(SQLiteModelMethod method, Class<? extends Annotation> annotation) {
List<String> includedFields = AnnotationUtility.extractAsStringArray(method.getElement(), annotation, AnnotationAttributeType.FIELDS);
List<String> excludedFields = AnnotationUtility.extractAsStringArray(m... | [
"private",
"static",
"void",
"checkFieldsDefinitions",
"(",
"SQLiteModelMethod",
"method",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"List",
"<",
"String",
">",
"includedFields",
"=",
"AnnotationUtility",
".",
"extractAsStringArra... | Check fields definitions.
@param method
the method
@param annotation
the annotation | [
"Check",
"fields",
"definitions",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java#L196-L205 |
jblas-project/jblas | src/main/java/org/jblas/Solve.java | Solve.pinv | public static FloatMatrix pinv(FloatMatrix A) {
"""
Computes the pseudo-inverse.
Note, this function uses the solveLeastSquares and might produce different numerical
solutions for the underdetermined case than matlab.
@param A rectangular matrix
@return matrix P such that A*P*A = A and P*A*P = P.
"""
... | java | public static FloatMatrix pinv(FloatMatrix A) {
return solveLeastSquares(A, FloatMatrix.eye(A.rows));
} | [
"public",
"static",
"FloatMatrix",
"pinv",
"(",
"FloatMatrix",
"A",
")",
"{",
"return",
"solveLeastSquares",
"(",
"A",
",",
"FloatMatrix",
".",
"eye",
"(",
"A",
".",
"rows",
")",
")",
";",
"}"
] | Computes the pseudo-inverse.
Note, this function uses the solveLeastSquares and might produce different numerical
solutions for the underdetermined case than matlab.
@param A rectangular matrix
@return matrix P such that A*P*A = A and P*A*P = P. | [
"Computes",
"the",
"pseudo",
"-",
"inverse",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Solve.java#L172-L174 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java | MultiLineString.fromLineString | public static MultiLineString fromLineString(@NonNull LineString lineString,
@Nullable BoundingBox bbox) {
"""
Create a new instance of this class by passing in a single {@link LineString} object. The
LineStrings should comply with the GeoJson specifications describe... | java | public static MultiLineString fromLineString(@NonNull LineString lineString,
@Nullable BoundingBox bbox) {
List<List<Point>> coordinates = Arrays.asList(lineString.coordinates());
return new MultiLineString(TYPE, bbox, coordinates);
} | [
"public",
"static",
"MultiLineString",
"fromLineString",
"(",
"@",
"NonNull",
"LineString",
"lineString",
",",
"@",
"Nullable",
"BoundingBox",
"bbox",
")",
"{",
"List",
"<",
"List",
"<",
"Point",
">>",
"coordinates",
"=",
"Arrays",
".",
"asList",
"(",
"lineStr... | Create a new instance of this class by passing in a single {@link LineString} object. The
LineStrings should comply with the GeoJson specifications described in the documentation.
@param lineString a single LineString which make up this MultiLineString
@param bbox optionally include a bbox definition
@return a n... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"passing",
"in",
"a",
"single",
"{",
"@link",
"LineString",
"}",
"object",
".",
"The",
"LineStrings",
"should",
"comply",
"with",
"the",
"GeoJson",
"specifications",
"described",
"in",
"the",
"do... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java#L144-L148 |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teatools/TeaToolsUtils.java | TeaToolsUtils.createContextClass | public Class<?> createContextClass(ClassLoader loader,
Class<?>[] classes,
String[] prefixNames)
throws Exception {
"""
Merges several classes together, producing a new class that has all
of the methods of the combined classes. Al... | java | public Class<?> createContextClass(ClassLoader loader,
Class<?>[] classes,
String[] prefixNames)
throws Exception {
ClassInjector classInjector =
new ClassInjector(loader, (java.io.File) ... | [
"public",
"Class",
"<",
"?",
">",
"createContextClass",
"(",
"ClassLoader",
"loader",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"classes",
",",
"String",
"[",
"]",
"prefixNames",
")",
"throws",
"Exception",
"{",
"ClassInjector",
"classInjector",
"=",
"new",
"... | Merges several classes together, producing a new class that has all
of the methods of the combined classes. All methods in the combined
class delegate to instances of the source classes. If multiple classes
implement the same method, the first one provided is used.
The merged class implements all of the interfaces pro... | [
"Merges",
"several",
"classes",
"together",
"producing",
"a",
"new",
"class",
"that",
"has",
"all",
"of",
"the",
"methods",
"of",
"the",
"combined",
"classes",
".",
"All",
"methods",
"in",
"the",
"combined",
"class",
"delegate",
"to",
"instances",
"of",
"the... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teatools/TeaToolsUtils.java#L807-L825 |
dmurph/jgoogleanalyticstracker | src/main/java/com/dmurph/tracking/JGoogleAnalyticsTracker.java | JGoogleAnalyticsTracker.trackEvent | public void trackEvent(String argCategory, String argAction, String argLabel) {
"""
Tracks an event. To provide more info about the page, use
{@link #makeCustomRequest(AnalyticsRequestData)}.
@param argCategory
@param argAction
@param argLabel
"""
trackEvent(argCategory, argAction, argLabel, null... | java | public void trackEvent(String argCategory, String argAction, String argLabel) {
trackEvent(argCategory, argAction, argLabel, null);
} | [
"public",
"void",
"trackEvent",
"(",
"String",
"argCategory",
",",
"String",
"argAction",
",",
"String",
"argLabel",
")",
"{",
"trackEvent",
"(",
"argCategory",
",",
"argAction",
",",
"argLabel",
",",
"null",
")",
";",
"}"
] | Tracks an event. To provide more info about the page, use
{@link #makeCustomRequest(AnalyticsRequestData)}.
@param argCategory
@param argAction
@param argLabel | [
"Tracks",
"an",
"event",
".",
"To",
"provide",
"more",
"info",
"about",
"the",
"page",
"use",
"{",
"@link",
"#makeCustomRequest",
"(",
"AnalyticsRequestData",
")",
"}",
"."
] | train | https://github.com/dmurph/jgoogleanalyticstracker/blob/69f68caf8e09a53e6f6076477bf05b84bc80e386/src/main/java/com/dmurph/tracking/JGoogleAnalyticsTracker.java#L376-L378 |
alipay/sofa-rpc | core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AbstractCluster.java | AbstractCluster.resolveTimeout | private int resolveTimeout(SofaRequest request, ConsumerConfig consumerConfig, ProviderInfo providerInfo) {
"""
决定超时时间
@param request 请求
@param consumerConfig 客户端配置
@param providerInfo 服务提供者信息
@return 调用超时
"""
// 先去调用级别配置
Integer timeout = request.getTimeout();
if (timeou... | java | private int resolveTimeout(SofaRequest request, ConsumerConfig consumerConfig, ProviderInfo providerInfo) {
// 先去调用级别配置
Integer timeout = request.getTimeout();
if (timeout == null) {
// 取客户端配置(先方法级别再接口级别)
timeout = consumerConfig.getMethodTimeout(request.getMethodName());... | [
"private",
"int",
"resolveTimeout",
"(",
"SofaRequest",
"request",
",",
"ConsumerConfig",
"consumerConfig",
",",
"ProviderInfo",
"providerInfo",
")",
"{",
"// 先去调用级别配置",
"Integer",
"timeout",
"=",
"request",
".",
"getTimeout",
"(",
")",
";",
"if",
"(",
"timeout",
... | 决定超时时间
@param request 请求
@param consumerConfig 客户端配置
@param providerInfo 服务提供者信息
@return 调用超时 | [
"决定超时时间"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AbstractCluster.java#L589-L605 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.takeWhile | public static <T> T[] takeWhile(T[] self, @ClosureParams(FirstParam.Component.class) Closure condition) {
"""
Returns the longest prefix of this array where each element
passed to the given closure evaluates to true.
<pre class="groovyTestCase">
def nums = [ 1, 3, 2 ] as Integer[]
assert nums.takeWhile{ it {@c... | java | public static <T> T[] takeWhile(T[] self, @ClosureParams(FirstParam.Component.class) Closure condition) {
int num = 0;
BooleanClosureWrapper bcw = new BooleanClosureWrapper(condition);
while (num < self.length) {
T value = self[num];
if (bcw.call(value)) {
... | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"takeWhile",
"(",
"T",
"[",
"]",
"self",
",",
"@",
"ClosureParams",
"(",
"FirstParam",
".",
"Component",
".",
"class",
")",
"Closure",
"condition",
")",
"{",
"int",
"num",
"=",
"0",
";",
"BooleanClosu... | Returns the longest prefix of this array where each element
passed to the given closure evaluates to true.
<pre class="groovyTestCase">
def nums = [ 1, 3, 2 ] as Integer[]
assert nums.takeWhile{ it {@code <} 1 } == [] as Integer[]
assert nums.takeWhile{ it {@code <} 3 } == [ 1 ] as Integer[]
assert nums.takeWhile{ it {... | [
"Returns",
"the",
"longest",
"prefix",
"of",
"this",
"array",
"where",
"each",
"element",
"passed",
"to",
"the",
"given",
"closure",
"evaluates",
"to",
"true",
".",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"def",
"nums",
"=",
"[",
"1",
"3",
"2",
"]",... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L10995-L11007 |
zxing/zxing | core/src/main/java/com/google/zxing/BinaryBitmap.java | BinaryBitmap.getBlackRow | public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {
"""
Converts one row of luminance data to 1 bit data. May actually do the conversion, or return
cached data. Callers should assume this method is expensive and call it as seldom as possible.
This method is intended for decoding 1D barcod... | java | public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {
return binarizer.getBlackRow(y, row);
} | [
"public",
"BitArray",
"getBlackRow",
"(",
"int",
"y",
",",
"BitArray",
"row",
")",
"throws",
"NotFoundException",
"{",
"return",
"binarizer",
".",
"getBlackRow",
"(",
"y",
",",
"row",
")",
";",
"}"
] | Converts one row of luminance data to 1 bit data. May actually do the conversion, or return
cached data. Callers should assume this method is expensive and call it as seldom as possible.
This method is intended for decoding 1D barcodes and may choose to apply sharpening.
@param y The row to fetch, which must be in [0,... | [
"Converts",
"one",
"row",
"of",
"luminance",
"data",
"to",
"1",
"bit",
"data",
".",
"May",
"actually",
"do",
"the",
"conversion",
"or",
"return",
"cached",
"data",
".",
"Callers",
"should",
"assume",
"this",
"method",
"is",
"expensive",
"and",
"call",
"it"... | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/BinaryBitmap.java#L65-L67 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java | AlternativeAlignment.apairs_from_seed | public void apairs_from_seed(int l,int i, int j) {
"""
Set apairs according to a seed position.
@param l
@param i
@param j
"""
aligpath = new IndexPair[l];
idx1 = new int[l];
idx2 = new int[l];
for (int x = 0 ; x < l ; x++) {
idx1[x]=i+x;
idx2[x]=j+x;
aligpath[x] = new IndexPair((short)(... | java | public void apairs_from_seed(int l,int i, int j){
aligpath = new IndexPair[l];
idx1 = new int[l];
idx2 = new int[l];
for (int x = 0 ; x < l ; x++) {
idx1[x]=i+x;
idx2[x]=j+x;
aligpath[x] = new IndexPair((short)(i+x),(short)(j+x));
}
} | [
"public",
"void",
"apairs_from_seed",
"(",
"int",
"l",
",",
"int",
"i",
",",
"int",
"j",
")",
"{",
"aligpath",
"=",
"new",
"IndexPair",
"[",
"l",
"]",
";",
"idx1",
"=",
"new",
"int",
"[",
"l",
"]",
";",
"idx2",
"=",
"new",
"int",
"[",
"l",
"]",... | Set apairs according to a seed position.
@param l
@param i
@param j | [
"Set",
"apairs",
"according",
"to",
"a",
"seed",
"position",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java#L242-L251 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newInitializationException | public static InitializationException newInitializationException(String message, Object... args) {
"""
Constructs and initializes a new {@link InitializationException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link ... | java | public static InitializationException newInitializationException(String message, Object... args) {
return newInitializationException(null, message, args);
} | [
"public",
"static",
"InitializationException",
"newInitializationException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newInitializationException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link InitializationException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link InitializationException exception}.
@param args {@link Object[] arguments} used to replace format placeholders ... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"InitializationException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L439-L441 |
openbase/jul | communication/controller/src/main/java/org/openbase/jul/communication/controller/RPCHelper.java | RPCHelper.registerInterface | public static <I, T extends I> void registerInterface(final Class<I> interfaceClass, final T instance, final RSBLocalServer server) throws CouldNotPerformException {
"""
public static SyncObject syncObject = new SyncObject("MapSync");
"""
for (final Method method : interfaceClass.getMethods()) {
... | java | public static <I, T extends I> void registerInterface(final Class<I> interfaceClass, final T instance, final RSBLocalServer server) throws CouldNotPerformException {
for (final Method method : interfaceClass.getMethods()) {
if (method.getAnnotation(RPCMethod.class) != null) {
boolean... | [
"public",
"static",
"<",
"I",
",",
"T",
"extends",
"I",
">",
"void",
"registerInterface",
"(",
"final",
"Class",
"<",
"I",
">",
"interfaceClass",
",",
"final",
"T",
"instance",
",",
"final",
"RSBLocalServer",
"server",
")",
"throws",
"CouldNotPerformException"... | public static SyncObject syncObject = new SyncObject("MapSync"); | [
"public",
"static",
"SyncObject",
"syncObject",
"=",
"new",
"SyncObject",
"(",
"MapSync",
")",
";"
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/communication/controller/src/main/java/org/openbase/jul/communication/controller/RPCHelper.java#L65-L80 |
influxdata/influxdb-java | src/main/java/org/influxdb/impl/Preconditions.java | Preconditions.checkNonEmptyString | public static String checkNonEmptyString(final String string, final String name) throws IllegalArgumentException {
"""
Enforces that the string is {@linkplain String#isEmpty() not empty}.
@param string the string to test
@param name variable name for reporting
@return {@code string}
@throws IllegalArgumentExce... | java | public static String checkNonEmptyString(final String string, final String name) throws IllegalArgumentException {
if (string == null || string.isEmpty()) {
throw new IllegalArgumentException("Expecting a non-empty string for " + name);
}
return string;
} | [
"public",
"static",
"String",
"checkNonEmptyString",
"(",
"final",
"String",
"string",
",",
"final",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"string",
".",
"isEmpty",
"(",
")",
")",
"{",
"thr... | Enforces that the string is {@linkplain String#isEmpty() not empty}.
@param string the string to test
@param name variable name for reporting
@return {@code string}
@throws IllegalArgumentException if the string is empty | [
"Enforces",
"that",
"the",
"string",
"is",
"{"
] | train | https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/impl/Preconditions.java#L20-L25 |
thorntail/wildfly-config-api | generator/src/main/java/org/wildfly/swarm/config/generator/generator/ResourceFactory.java | ResourceFactory.create | public JavaClassSource create(ClassIndex index, ClassPlan plan) {
"""
Base template for a resource representation.
Covers the resource attributes
@param index
@param plan
@return
"""
this.names.clear();
// base class
JavaClassSource type = Roaster.parse(
JavaClass... | java | public JavaClassSource create(ClassIndex index, ClassPlan plan) {
this.names.clear();
// base class
JavaClassSource type = Roaster.parse(
JavaClassSource.class,
"public class " + plan.getClassName() + "<T extends " + plan.getClassName() + "<T>> implements " + Key... | [
"public",
"JavaClassSource",
"create",
"(",
"ClassIndex",
"index",
",",
"ClassPlan",
"plan",
")",
"{",
"this",
".",
"names",
".",
"clear",
"(",
")",
";",
"// base class",
"JavaClassSource",
"type",
"=",
"Roaster",
".",
"parse",
"(",
"JavaClassSource",
".",
"... | Base template for a resource representation.
Covers the resource attributes
@param index
@param plan
@return | [
"Base",
"template",
"for",
"a",
"resource",
"representation",
".",
"Covers",
"the",
"resource",
"attributes"
] | train | https://github.com/thorntail/wildfly-config-api/blob/ddb3f3bcb7b85b22c6371415546f567bc44493db/generator/src/main/java/org/wildfly/swarm/config/generator/generator/ResourceFactory.java#L63-L105 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/MultiColumnText.java | MultiColumnText.addRegularColumns | public void addRegularColumns(float left, float right, float gutterWidth, int numColumns) {
"""
Add the specified number of evenly spaced rectangular columns.
Columns will be separated by the specified gutterWidth.
@param left left boundary of first column
@param right right boundary of last colu... | java | public void addRegularColumns(float left, float right, float gutterWidth, int numColumns) {
float currX = left;
float width = right - left;
float colWidth = (width - (gutterWidth * (numColumns - 1))) / numColumns;
for (int i = 0; i < numColumns; i++) {
addSimpleColumn(currX, ... | [
"public",
"void",
"addRegularColumns",
"(",
"float",
"left",
",",
"float",
"right",
",",
"float",
"gutterWidth",
",",
"int",
"numColumns",
")",
"{",
"float",
"currX",
"=",
"left",
";",
"float",
"width",
"=",
"right",
"-",
"left",
";",
"float",
"colWidth",
... | Add the specified number of evenly spaced rectangular columns.
Columns will be separated by the specified gutterWidth.
@param left left boundary of first column
@param right right boundary of last column
@param gutterWidth width of gutter spacing between columns
@param numColumns number of columns to add | [
"Add",
"the",
"specified",
"number",
"of",
"evenly",
"spaced",
"rectangular",
"columns",
".",
"Columns",
"will",
"be",
"separated",
"by",
"the",
"specified",
"gutterWidth",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/MultiColumnText.java#L218-L226 |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/cluster/impl/ClusterLocator.java | ClusterLocator.locateCluster | public void locateCluster(String cluster, Handler<AsyncResult<String>> doneHandler) {
"""
Locates the local address of the nearest node if one exists.
@param cluster The cluster in which to search for the node.
@param doneHandler A handler to be called once the address has been located.
"""
Set<String>... | java | public void locateCluster(String cluster, Handler<AsyncResult<String>> doneHandler) {
Set<String> registry = vertx.sharedData().getSet(cluster);
synchronized (registry) {
if (!registry.isEmpty()) {
locateNode(cluster, new HashSet<>(registry), doneHandler);
}
}
} | [
"public",
"void",
"locateCluster",
"(",
"String",
"cluster",
",",
"Handler",
"<",
"AsyncResult",
"<",
"String",
">",
">",
"doneHandler",
")",
"{",
"Set",
"<",
"String",
">",
"registry",
"=",
"vertx",
".",
"sharedData",
"(",
")",
".",
"getSet",
"(",
"clus... | Locates the local address of the nearest node if one exists.
@param cluster The cluster in which to search for the node.
@param doneHandler A handler to be called once the address has been located. | [
"Locates",
"the",
"local",
"address",
"of",
"the",
"nearest",
"node",
"if",
"one",
"exists",
"."
] | train | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/cluster/impl/ClusterLocator.java#L47-L54 |
actorapp/actor-platform | actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java | MarkdownParser.handleRawText | private void handleRawText(TextCursor cursor, int limit, ArrayList<MDText> elements) {
"""
Handling raw text block
@param cursor text cursor
@param limit text end
@param elements current elements
"""
while (true) {
BasicUrl url = findUrl(cursor, limit);
if (url != null... | java | private void handleRawText(TextCursor cursor, int limit, ArrayList<MDText> elements) {
while (true) {
BasicUrl url = findUrl(cursor, limit);
if (url != null) {
String link = cursor.text.substring(url.getStart(), url.getEnd());
// Handling text before url ... | [
"private",
"void",
"handleRawText",
"(",
"TextCursor",
"cursor",
",",
"int",
"limit",
",",
"ArrayList",
"<",
"MDText",
">",
"elements",
")",
"{",
"while",
"(",
"true",
")",
"{",
"BasicUrl",
"url",
"=",
"findUrl",
"(",
"cursor",
",",
"limit",
")",
";",
... | Handling raw text block
@param cursor text cursor
@param limit text end
@param elements current elements | [
"Handling",
"raw",
"text",
"block"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java#L189-L211 |
aws/aws-sdk-java | aws-java-sdk-fms/src/main/java/com/amazonaws/services/fms/model/PolicyComplianceDetail.java | PolicyComplianceDetail.withIssueInfoMap | public PolicyComplianceDetail withIssueInfoMap(java.util.Map<String, String> issueInfoMap) {
"""
<p>
Details about problems with dependent services, such as AWS WAF or AWS Config, that are causing a resource to be
non-compliant. The details include the name of the dependent service and the error message received... | java | public PolicyComplianceDetail withIssueInfoMap(java.util.Map<String, String> issueInfoMap) {
setIssueInfoMap(issueInfoMap);
return this;
} | [
"public",
"PolicyComplianceDetail",
"withIssueInfoMap",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"issueInfoMap",
")",
"{",
"setIssueInfoMap",
"(",
"issueInfoMap",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Details about problems with dependent services, such as AWS WAF or AWS Config, that are causing a resource to be
non-compliant. The details include the name of the dependent service and the error message received that
indicates the problem with the service.
</p>
@param issueInfoMap
Details about problems with depe... | [
"<p",
">",
"Details",
"about",
"problems",
"with",
"dependent",
"services",
"such",
"as",
"AWS",
"WAF",
"or",
"AWS",
"Config",
"that",
"are",
"causing",
"a",
"resource",
"to",
"be",
"non",
"-",
"compliant",
".",
"The",
"details",
"include",
"the",
"name",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-fms/src/main/java/com/amazonaws/services/fms/model/PolicyComplianceDetail.java#L407-L410 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/tree/GISTreeSetUtil.java | GISTreeSetUtil.getNodeBuildingBounds | @Pure
public static Rectangle2d getNodeBuildingBounds(AbstractGISTreeSetNode<?, ?> node) {
"""
Replies the bounds of the area covered by the node.
The replied rectangle is not normalized.
@param node is the node for which the bounds must be extracted and reploed.
@return the not-normalized rectangle.
"""... | java | @Pure
public static Rectangle2d getNodeBuildingBounds(AbstractGISTreeSetNode<?, ?> node) {
assert node != null;
final double w = node.nodeWidth / 2.;
final double h = node.nodeHeight / 2.;
final IcosepQuadTreeZone zone = node.getZone();
final double lx;
final double ly;
if (zone == null) {
// Is root ... | [
"@",
"Pure",
"public",
"static",
"Rectangle2d",
"getNodeBuildingBounds",
"(",
"AbstractGISTreeSetNode",
"<",
"?",
",",
"?",
">",
"node",
")",
"{",
"assert",
"node",
"!=",
"null",
";",
"final",
"double",
"w",
"=",
"node",
".",
"nodeWidth",
"/",
"2.",
";",
... | Replies the bounds of the area covered by the node.
The replied rectangle is not normalized.
@param node is the node for which the bounds must be extracted and reploed.
@return the not-normalized rectangle. | [
"Replies",
"the",
"bounds",
"of",
"the",
"area",
"covered",
"by",
"the",
"node",
".",
"The",
"replied",
"rectangle",
"is",
"not",
"normalized",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/tree/GISTreeSetUtil.java#L387-L424 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java | XMLCharHelper.isInvalidXMLAttributeValueChar | public static boolean isInvalidXMLAttributeValueChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c) {
"""
Check if the passed character is invalid for a attribute value node.
@param eXMLVersion
XML version to be used. May not be <code>null</code>.
@param c
char to check
@return <code>true</c... | java | public static boolean isInvalidXMLAttributeValueChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c)
{
switch (eXMLVersion)
{
case XML_10:
return INVALID_VALUE_CHAR_XML10.get (c);
case XML_11:
return INVALID_ATTR_VALUE_CHAR_XML11.get (c);
case HTML:
ret... | [
"public",
"static",
"boolean",
"isInvalidXMLAttributeValueChar",
"(",
"@",
"Nonnull",
"final",
"EXMLSerializeVersion",
"eXMLVersion",
",",
"final",
"int",
"c",
")",
"{",
"switch",
"(",
"eXMLVersion",
")",
"{",
"case",
"XML_10",
":",
"return",
"INVALID_VALUE_CHAR_XML... | Check if the passed character is invalid for a attribute value node.
@param eXMLVersion
XML version to be used. May not be <code>null</code>.
@param c
char to check
@return <code>true</code> if the char is invalid | [
"Check",
"if",
"the",
"passed",
"character",
"is",
"invalid",
"for",
"a",
"attribute",
"value",
"node",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java#L956-L969 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunction.java | DifferentialFunction.rarg | public SDVariable rarg() {
"""
The right argument for this function.
Note that this assumes that there are 2 args for this
function, if 2 are not set, it throws an
{@link ND4JIllegalStateException}
@return
"""
val args = args();
if(args == null || args.length != 2)
throw new ND4... | java | public SDVariable rarg() {
val args = args();
if(args == null || args.length != 2)
throw new ND4JIllegalStateException("In order to use this function, the number of arguments for this function must be 2.");
return args[1];
} | [
"public",
"SDVariable",
"rarg",
"(",
")",
"{",
"val",
"args",
"=",
"args",
"(",
")",
";",
"if",
"(",
"args",
"==",
"null",
"||",
"args",
".",
"length",
"!=",
"2",
")",
"throw",
"new",
"ND4JIllegalStateException",
"(",
"\"In order to use this function, the nu... | The right argument for this function.
Note that this assumes that there are 2 args for this
function, if 2 are not set, it throws an
{@link ND4JIllegalStateException}
@return | [
"The",
"right",
"argument",
"for",
"this",
"function",
".",
"Note",
"that",
"this",
"assumes",
"that",
"there",
"are",
"2",
"args",
"for",
"this",
"function",
"if",
"2",
"are",
"not",
"set",
"it",
"throws",
"an",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunction.java#L756-L761 |
sarl/sarl | main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/scoping/extensions/numbers/comparison/ShortComparisonExtensions.java | ShortComparisonExtensions.operator_spaceship | @Pure
@Inline(value = "$3.compare($1.shortValue(), $2)", constantExpression = true, imported = Short.class)
public static int operator_spaceship(Short left, byte right) {
"""
The number comparison operator. This is equivalent to the Java
{@code compareTo} function on numbers. This function is null-safe.
@par... | java | @Pure
@Inline(value = "$3.compare($1.shortValue(), $2)", constantExpression = true, imported = Short.class)
public static int operator_spaceship(Short left, byte right) {
return Short.compare(left.shortValue(), right);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"$3.compare($1.shortValue(), $2)\"",
",",
"constantExpression",
"=",
"true",
",",
"imported",
"=",
"Short",
".",
"class",
")",
"public",
"static",
"int",
"operator_spaceship",
"(",
"Short",
"left",
",",
"byte",
... | The number comparison operator. This is equivalent to the Java
{@code compareTo} function on numbers. This function is null-safe.
@param left a number
@param right a number.
@return the value {@code 0} if {@code left == right};
a value less than {@code 0} if {@code left < right}; and
a value greater than {@code 0} if ... | [
"The",
"number",
"comparison",
"operator",
".",
"This",
"is",
"equivalent",
"to",
"the",
"Java",
"{",
"@code",
"compareTo",
"}",
"function",
"on",
"numbers",
".",
"This",
"function",
"is",
"null",
"-",
"safe",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/scoping/extensions/numbers/comparison/ShortComparisonExtensions.java#L615-L619 |
overturetool/overture | core/ast/src/main/java/org/overture/ast/preview/GraphViz.java | GraphViz.writeGraphToFile | public int writeGraphToFile(byte[] img, File to) {
"""
Writes the graph's image in a file.
@param img
A byte array containing the image of the graph.
@param to
A File object to where we want to write.
@return Success: 1, Failure: -1
"""
try
{
FileOutputStream fos = new FileOutputStream(to);
fo... | java | public int writeGraphToFile(byte[] img, File to)
{
try
{
FileOutputStream fos = new FileOutputStream(to);
fos.write(img);
fos.close();
} catch (IOException ioe)
{
return -1;
}
return 1;
} | [
"public",
"int",
"writeGraphToFile",
"(",
"byte",
"[",
"]",
"img",
",",
"File",
"to",
")",
"{",
"try",
"{",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"to",
")",
";",
"fos",
".",
"write",
"(",
"img",
")",
";",
"fos",
".",
"close"... | Writes the graph's image in a file.
@param img
A byte array containing the image of the graph.
@param to
A File object to where we want to write.
@return Success: 1, Failure: -1 | [
"Writes",
"the",
"graph",
"s",
"image",
"in",
"a",
"file",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/ast/src/main/java/org/overture/ast/preview/GraphViz.java#L186-L200 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Audit.java | Audit.findByEntity | public static List<Audit> findByEntity(EntityManager em, JPAEntity entity) {
"""
Finds all alerts for the given entity.
@param em Entity manager. Cannot be null.
@param entity The entity for which all audits will be returned. Cannot be null.
@return All alerts belongs to given entity.
"""
... | java | public static List<Audit> findByEntity(EntityManager em, JPAEntity entity) {
return findByEntity(em, entity, null);
} | [
"public",
"static",
"List",
"<",
"Audit",
">",
"findByEntity",
"(",
"EntityManager",
"em",
",",
"JPAEntity",
"entity",
")",
"{",
"return",
"findByEntity",
"(",
"em",
",",
"entity",
",",
"null",
")",
";",
"}"
] | Finds all alerts for the given entity.
@param em Entity manager. Cannot be null.
@param entity The entity for which all audits will be returned. Cannot be null.
@return All alerts belongs to given entity. | [
"Finds",
"all",
"alerts",
"for",
"the",
"given",
"entity",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Audit.java#L131-L133 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/transform/transformpolicylabel_stats.java | transformpolicylabel_stats.get | public static transformpolicylabel_stats get(nitro_service service, String labelname) throws Exception {
"""
Use this API to fetch statistics of transformpolicylabel_stats resource of given name .
"""
transformpolicylabel_stats obj = new transformpolicylabel_stats();
obj.set_labelname(labelname);
transfo... | java | public static transformpolicylabel_stats get(nitro_service service, String labelname) throws Exception{
transformpolicylabel_stats obj = new transformpolicylabel_stats();
obj.set_labelname(labelname);
transformpolicylabel_stats response = (transformpolicylabel_stats) obj.stat_resource(service);
return response;... | [
"public",
"static",
"transformpolicylabel_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"labelname",
")",
"throws",
"Exception",
"{",
"transformpolicylabel_stats",
"obj",
"=",
"new",
"transformpolicylabel_stats",
"(",
")",
";",
"obj",
".",
"set_labeln... | Use this API to fetch statistics of transformpolicylabel_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"transformpolicylabel_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/transform/transformpolicylabel_stats.java#L149-L154 |
derari/cthul | objects/src/main/java/org/cthul/objects/reflection/Signatures.java | Signatures.candidateMethods | public static Method[] candidateMethods(Class<?> clazz, String name, Class<?>[] argTypes) {
"""
Finds the best equally-matching methods for the given argument types.
@param clazz
@param name
@param argTypes
@return methods
"""
return candidateMethods(collectMethods(clazz, name), argTypes);
} | java | public static Method[] candidateMethods(Class<?> clazz, String name, Class<?>[] argTypes) {
return candidateMethods(collectMethods(clazz, name), argTypes);
} | [
"public",
"static",
"Method",
"[",
"]",
"candidateMethods",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
")",
"{",
"return",
"candidateMethods",
"(",
"collectMethods",
"(",
"clazz",
",",
... | Finds the best equally-matching methods for the given argument types.
@param clazz
@param name
@param argTypes
@return methods | [
"Finds",
"the",
"best",
"equally",
"-",
"matching",
"methods",
"for",
"the",
"given",
"argument",
"types",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L187-L189 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/Validate.java | Validate.notNaN | public static void notNaN(final double value, final String message, final Object... values) {
"""
<p>Validates that the specified argument is not {@code NaN}; otherwise
throwing an exception with the specified message.</p>
<pre>Validate.notNaN(myDouble, "The value must be a number");</pre>
@param value the... | java | public static void notNaN(final double value, final String message, final Object... values) {
if (Double.isNaN(value)) {
throw new IllegalArgumentException(StringUtils.simpleFormat(message, values));
}
} | [
"public",
"static",
"void",
"notNaN",
"(",
"final",
"double",
"value",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentE... | <p>Validates that the specified argument is not {@code NaN}; otherwise
throwing an exception with the specified message.</p>
<pre>Validate.notNaN(myDouble, "The value must be a number");</pre>
@param value the value to validate
@param message the {@link String#format(String, Object...)} exception message if invalid... | [
"<p",
">",
"Validates",
"that",
"the",
"specified",
"argument",
"is",
"not",
"{",
"@code",
"NaN",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L924-L928 |
RestComm/media-core | control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/command/CreateConnectionCommand.java | CreateConnectionCommand.createLocalConnection | private MgcpConnection createLocalConnection(int callId, MgcpEndpoint endpoint) throws MgcpConnectionException {
"""
Creates a new Local Connection.
<p>
The connection will be fully open and connected to a secondary endpoint.<br>
</p>
@param callId The the call identifies which indicates to which session t... | java | private MgcpConnection createLocalConnection(int callId, MgcpEndpoint endpoint) throws MgcpConnectionException {
MgcpConnection connection = endpoint.createConnection(callId, true);
connection.open(null);
return connection;
} | [
"private",
"MgcpConnection",
"createLocalConnection",
"(",
"int",
"callId",
",",
"MgcpEndpoint",
"endpoint",
")",
"throws",
"MgcpConnectionException",
"{",
"MgcpConnection",
"connection",
"=",
"endpoint",
".",
"createConnection",
"(",
"callId",
",",
"true",
")",
";",
... | Creates a new Local Connection.
<p>
The connection will be fully open and connected to a secondary endpoint.<br>
</p>
@param callId The the call identifies which indicates to which session the connection belongs to.
@param secondEndpoint The endpoint where the connection will be registered to.
@return The new connec... | [
"Creates",
"a",
"new",
"Local",
"Connection",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/command/CreateConnectionCommand.java#L216-L220 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLAnnotationUtil.java | SARLAnnotationUtil.findStringValue | public String findStringValue(JvmAnnotationTarget op, Class<? extends Annotation> annotationType) {
"""
Extract the string value of the given annotation, if it exists.
@param op the annotated element.
@param annotationType the type of the annotation to consider
@return the value of the annotation, or {@code n... | java | public String findStringValue(JvmAnnotationTarget op, Class<? extends Annotation> annotationType) {
final JvmAnnotationReference reference = this.lookup.findAnnotation(op, annotationType);
if (reference != null) {
return findStringValue(reference);
}
return null;
} | [
"public",
"String",
"findStringValue",
"(",
"JvmAnnotationTarget",
"op",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
")",
"{",
"final",
"JvmAnnotationReference",
"reference",
"=",
"this",
".",
"lookup",
".",
"findAnnotation",
"(",
"op",... | Extract the string value of the given annotation, if it exists.
@param op the annotated element.
@param annotationType the type of the annotation to consider
@return the value of the annotation, or {@code null} if no annotation or no
value. | [
"Extract",
"the",
"string",
"value",
"of",
"the",
"given",
"annotation",
"if",
"it",
"exists",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLAnnotationUtil.java#L70-L76 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/NNChain.java | NNChain.findUnlinked | public static int findUnlinked(int pos, int end, DBIDArrayIter ix, PointerHierarchyRepresentationBuilder builder) {
"""
Find an unlinked object.
@param pos Starting position
@param end End position
@param ix Iterator to translate into DBIDs
@param builder Linkage information
@return Position
"""
whi... | java | public static int findUnlinked(int pos, int end, DBIDArrayIter ix, PointerHierarchyRepresentationBuilder builder) {
while(pos < end) {
if(!builder.isLinked(ix.seek(pos))) {
return pos;
}
++pos;
}
return -1;
} | [
"public",
"static",
"int",
"findUnlinked",
"(",
"int",
"pos",
",",
"int",
"end",
",",
"DBIDArrayIter",
"ix",
",",
"PointerHierarchyRepresentationBuilder",
"builder",
")",
"{",
"while",
"(",
"pos",
"<",
"end",
")",
"{",
"if",
"(",
"!",
"builder",
".",
"isLi... | Find an unlinked object.
@param pos Starting position
@param end End position
@param ix Iterator to translate into DBIDs
@param builder Linkage information
@return Position | [
"Find",
"an",
"unlinked",
"object",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/NNChain.java#L199-L207 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java | VisOdomMonoPlaneInfinity.isRotationFromAxisY | protected boolean isRotationFromAxisY(PointTrack t, Vector3D_F64 pointing) {
"""
Checks for motion which can't be caused by rotations along the y-axis alone. This is done by adjusting the
pointing vector in the plane reference frame such that it has the same y component as when the track was spawned
and that th... | java | protected boolean isRotationFromAxisY(PointTrack t, Vector3D_F64 pointing) {
VoTrack p = t.getCookie();
// remove rotations not along x-z plane
double normXZ = Math.sqrt(pointing.x * pointing.x + pointing.z * pointing.z);
pointingAdj.set(pointing.x / normXZ, p.pointingY, pointing.z / normXZ);
// Put pointin... | [
"protected",
"boolean",
"isRotationFromAxisY",
"(",
"PointTrack",
"t",
",",
"Vector3D_F64",
"pointing",
")",
"{",
"VoTrack",
"p",
"=",
"t",
".",
"getCookie",
"(",
")",
";",
"// remove rotations not along x-z plane",
"double",
"normXZ",
"=",
"Math",
".",
"sqrt",
... | Checks for motion which can't be caused by rotations along the y-axis alone. This is done by adjusting the
pointing vector in the plane reference frame such that it has the same y component as when the track was spawned
and that the x-z components are normalized to one, to ensure consistent units. That pointing vecto... | [
"Checks",
"for",
"motion",
"which",
"can",
"t",
"be",
"caused",
"by",
"rotations",
"along",
"the",
"y",
"-",
"axis",
"alone",
".",
"This",
"is",
"done",
"by",
"adjusting",
"the",
"pointing",
"vector",
"in",
"the",
"plane",
"reference",
"frame",
"such",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L390-L411 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/DiscreteFourierTransformOps.java | DiscreteFourierTransformOps.checkImageArguments | public static void checkImageArguments( ImageBase image , ImageInterleaved transform ) {
"""
Checks to see if the image and its transform are appropriate sizes . The transform should have
twice the width and twice the height as the image.
@param image Storage for an image
@param transform Storage for a Fouri... | java | public static void checkImageArguments( ImageBase image , ImageInterleaved transform ) {
InputSanityCheck.checkSameShape(image,transform);
if( 2 != transform.getNumBands() )
throw new IllegalArgumentException("The transform must have two bands");
} | [
"public",
"static",
"void",
"checkImageArguments",
"(",
"ImageBase",
"image",
",",
"ImageInterleaved",
"transform",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"image",
",",
"transform",
")",
";",
"if",
"(",
"2",
"!=",
"transform",
".",
"getNumBand... | Checks to see if the image and its transform are appropriate sizes . The transform should have
twice the width and twice the height as the image.
@param image Storage for an image
@param transform Storage for a Fourier Transform | [
"Checks",
"to",
"see",
"if",
"the",
"image",
"and",
"its",
"transform",
"are",
"appropriate",
"sizes",
".",
"The",
"transform",
"should",
"have",
"twice",
"the",
"width",
"and",
"twice",
"the",
"height",
"as",
"the",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/DiscreteFourierTransformOps.java#L98-L102 |
op4j/op4j | src/main/java/org/op4j/functions/FnNumber.java | FnNumber.toDouble | public static final Function<Number,Double> toDouble(final int scale, final RoundingMode roundingMode) {
"""
<p>
It converts the input into a {@link Double} using the given scale and {@link RoundingMode}
</p>
@param scale the scale to be used
@param roundingMode the {@link RoundingMode} to round the input wi... | java | public static final Function<Number,Double> toDouble(final int scale, final RoundingMode roundingMode) {
return new ToDouble(scale, roundingMode);
} | [
"public",
"static",
"final",
"Function",
"<",
"Number",
",",
"Double",
">",
"toDouble",
"(",
"final",
"int",
"scale",
",",
"final",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"new",
"ToDouble",
"(",
"scale",
",",
"roundingMode",
")",
";",
"}"
] | <p>
It converts the input into a {@link Double} using the given scale and {@link RoundingMode}
</p>
@param scale the scale to be used
@param roundingMode the {@link RoundingMode} to round the input with
@return the {@link Double} | [
"<p",
">",
"It",
"converts",
"the",
"input",
"into",
"a",
"{",
"@link",
"Double",
"}",
"using",
"the",
"given",
"scale",
"and",
"{",
"@link",
"RoundingMode",
"}",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnNumber.java#L133-L135 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/util/StringHelper.java | StringHelper.makeFormattedString | public static String makeFormattedString(
String aAttrName,
Object aObj,
boolean aPrependSeparator) {
"""
Utility method that gets formatted string representing the <code>Object</code>.
<p>
For String object it returns <code>"string_value"</code>.
For other objects it returns <code>[obj.... | java | public static String makeFormattedString(
String aAttrName,
Object aObj,
boolean aPrependSeparator) {
StringBuffer mStrBuff = new StringBuffer(PreFormatString(aAttrName, aPrependSeparator));
if (aObj == null)
mStrBuff.append("null");
else if (aObj instanceof S... | [
"public",
"static",
"String",
"makeFormattedString",
"(",
"String",
"aAttrName",
",",
"Object",
"aObj",
",",
"boolean",
"aPrependSeparator",
")",
"{",
"StringBuffer",
"mStrBuff",
"=",
"new",
"StringBuffer",
"(",
"PreFormatString",
"(",
"aAttrName",
",",
"aPrependSep... | Utility method that gets formatted string representing the <code>Object</code>.
<p>
For String object it returns <code>"string_value"</code>.
For other objects it returns <code>[obj.toString()]</code>.
If the object is null then it returns <code>null</code>.
<p>
Example: aAttrName="aObj",aAttrName="aObj", etc, where th... | [
"Utility",
"method",
"that",
"gets",
"formatted",
"string",
"representing",
"the",
"<code",
">",
"Object<",
"/",
"code",
">",
".",
"<p",
">",
"For",
"String",
"object",
"it",
"returns",
"<code",
">",
"string_value",
"<",
"/",
"code",
">",
".",
"For",
"ot... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/util/StringHelper.java#L74-L91 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaProfilerInitialize | public static int cudaProfilerInitialize(String configFile, String outputFile, int outputMode) {
"""
Initialize the CUDA profiler.
<pre>
cudaError_t cudaProfilerInitialize (
const char* configFile,
const char* outputFile,
cudaOutputMode_t outputMode )
</pre>
<div>
<p>Initialize the CUDA profiler. Using ... | java | public static int cudaProfilerInitialize(String configFile, String outputFile, int outputMode)
{
return checkResult(cudaProfilerInitializeNative(configFile, outputFile, outputMode));
} | [
"public",
"static",
"int",
"cudaProfilerInitialize",
"(",
"String",
"configFile",
",",
"String",
"outputFile",
",",
"int",
"outputMode",
")",
"{",
"return",
"checkResult",
"(",
"cudaProfilerInitializeNative",
"(",
"configFile",
",",
"outputFile",
",",
"outputMode",
... | Initialize the CUDA profiler.
<pre>
cudaError_t cudaProfilerInitialize (
const char* configFile,
const char* outputFile,
cudaOutputMode_t outputMode )
</pre>
<div>
<p>Initialize the CUDA profiler. Using this
API user can initialize the CUDA profiler by specifying the configuration
file,
output file and output file fo... | [
"Initialize",
"the",
"CUDA",
"profiler",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L11776-L11779 |
spring-projects/spring-mobile | spring-mobile-autoconfigure/src/main/java/org/springframework/mobile/autoconfigure/DeviceDelegatingViewResolverFactory.java | DeviceDelegatingViewResolverFactory.createViewResolver | public LiteDeviceDelegatingViewResolver createViewResolver(ViewResolver delegate) {
"""
Create a {@link LiteDeviceDelegatingViewResolver} delegating to the specified
{@link ViewResolver} and computing a sensible order for it. The specified
{@link ViewResolver} should implement {@link Ordered}, consider using
{@... | java | public LiteDeviceDelegatingViewResolver createViewResolver(ViewResolver delegate) {
if (!(delegate instanceof Ordered)) {
throw new IllegalStateException("ViewResolver " + delegate
+ " should implement " + Ordered.class.getName());
}
int delegateOrder = ((Ordered) delegate).getOrder();
return createView... | [
"public",
"LiteDeviceDelegatingViewResolver",
"createViewResolver",
"(",
"ViewResolver",
"delegate",
")",
"{",
"if",
"(",
"!",
"(",
"delegate",
"instanceof",
"Ordered",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"ViewResolver \"",
"+",
"delegate",
... | Create a {@link LiteDeviceDelegatingViewResolver} delegating to the specified
{@link ViewResolver} and computing a sensible order for it. The specified
{@link ViewResolver} should implement {@link Ordered}, consider using
{@link #createViewResolver(ViewResolver, int)} if that's not the case.
@param delegate the view re... | [
"Create",
"a",
"{"
] | train | https://github.com/spring-projects/spring-mobile/blob/a402cbcaf208e24288b957f44c9984bd6e8bf064/spring-mobile-autoconfigure/src/main/java/org/springframework/mobile/autoconfigure/DeviceDelegatingViewResolverFactory.java#L69-L76 |
plume-lib/options | src/main/java/org/plumelib/options/OptionsDoclet.java | OptionsDoclet.optionsToJavadoc | public String optionsToJavadoc(int padding, int refillWidth) {
"""
Get the HTML documentation for the underlying Options instance, formatted as a Javadoc comment.
@param padding the number of leading spaces to add in the Javadoc output, before "* "
@param refillWidth the number of columns to fit the text into,... | java | public String optionsToJavadoc(int padding, int refillWidth) {
StringJoiner b = new StringJoiner(lineSep);
Scanner s = new Scanner(optionsToHtml(refillWidth - padding - 2));
while (s.hasNextLine()) {
String line = s.nextLine();
StringBuilder bb = new StringBuilder();
bb.append(StringUtils... | [
"public",
"String",
"optionsToJavadoc",
"(",
"int",
"padding",
",",
"int",
"refillWidth",
")",
"{",
"StringJoiner",
"b",
"=",
"new",
"StringJoiner",
"(",
"lineSep",
")",
";",
"Scanner",
"s",
"=",
"new",
"Scanner",
"(",
"optionsToHtml",
"(",
"refillWidth",
"-... | Get the HTML documentation for the underlying Options instance, formatted as a Javadoc comment.
@param padding the number of leading spaces to add in the Javadoc output, before "* "
@param refillWidth the number of columns to fit the text into, by breaking lines
@return the HTML documentation for the underlying Option... | [
"Get",
"the",
"HTML",
"documentation",
"for",
"the",
"underlying",
"Options",
"instance",
"formatted",
"as",
"a",
"Javadoc",
"comment",
"."
] | train | https://github.com/plume-lib/options/blob/1bdd0ac7a1794bdf9dd373e279f69d43395154f0/src/main/java/org/plumelib/options/OptionsDoclet.java#L677-L694 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportVersion2.java | CmsImportVersion2.removeFolders | private void removeFolders() throws CmsImportExportException {
"""
Deletes the folder structure which has been creating while importing the body files..<p>
@throws CmsImportExportException if something goes wrong
"""
try {
int size = m_folderStorage.size();
m_report.printl... | java | private void removeFolders() throws CmsImportExportException {
try {
int size = m_folderStorage.size();
m_report.println(Messages.get().container(Messages.RPT_DELFOLDER_START_0), I_CmsReport.FORMAT_HEADLINE);
// iterate though all collected folders. Iteration must start at... | [
"private",
"void",
"removeFolders",
"(",
")",
"throws",
"CmsImportExportException",
"{",
"try",
"{",
"int",
"size",
"=",
"m_folderStorage",
".",
"size",
"(",
")",
";",
"m_report",
".",
"println",
"(",
"Messages",
".",
"get",
"(",
")",
".",
"container",
"("... | Deletes the folder structure which has been creating while importing the body files..<p>
@throws CmsImportExportException if something goes wrong | [
"Deletes",
"the",
"folder",
"structure",
"which",
"has",
"been",
"creating",
"while",
"importing",
"the",
"body",
"files",
"..",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportVersion2.java#L1122-L1172 |
alkacon/opencms-core | src/org/opencms/ade/configuration/formatters/CmsFormatterBeanParser.java | CmsFormatterBeanParser.getString | private String getString(I_CmsXmlContentLocation val, String path, String defaultValue) {
"""
Gets an XML string value.<p>
@param val the location of the parent value
@param path the path of the sub-value
@param defaultValue the default value to use if no value was found
@return the found value
"""
... | java | private String getString(I_CmsXmlContentLocation val, String path, String defaultValue) {
if ((val != null)) {
I_CmsXmlContentValueLocation subVal = val.getSubValue(path);
if ((subVal != null) && (subVal.getValue() != null)) {
return subVal.getValue().getStringValue(m_cm... | [
"private",
"String",
"getString",
"(",
"I_CmsXmlContentLocation",
"val",
",",
"String",
"path",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"(",
"val",
"!=",
"null",
")",
")",
"{",
"I_CmsXmlContentValueLocation",
"subVal",
"=",
"val",
".",
"getSubValue... | Gets an XML string value.<p>
@param val the location of the parent value
@param path the path of the sub-value
@param defaultValue the default value to use if no value was found
@return the found value | [
"Gets",
"an",
"XML",
"string",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/formatters/CmsFormatterBeanParser.java#L648-L657 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/util/PatchedNettySnappyDecoder.java | PatchedNettySnappyDecoder.decodeLiteral | static int decodeLiteral(byte tag, ByteBuf in, ByteBuf out) {
"""
Reads a literal from the input buffer directly to the output buffer.
A "literal" is an uncompressed segment of data stored directly in the
byte stream.
@param tag The tag that identified this segment as a literal is also
used to encode part of... | java | static int decodeLiteral(byte tag, ByteBuf in, ByteBuf out) {
in.markReaderIndex();
int length;
switch (tag >> 2 & 0x3F) {
case 60:
if (!in.isReadable()) {
return NOT_ENOUGH_INPUT;
}
length = in.readUnsignedByte();
... | [
"static",
"int",
"decodeLiteral",
"(",
"byte",
"tag",
",",
"ByteBuf",
"in",
",",
"ByteBuf",
"out",
")",
"{",
"in",
".",
"markReaderIndex",
"(",
")",
";",
"int",
"length",
";",
"switch",
"(",
"tag",
">>",
"2",
"&",
"0x3F",
")",
"{",
"case",
"60",
":... | Reads a literal from the input buffer directly to the output buffer.
A "literal" is an uncompressed segment of data stored directly in the
byte stream.
@param tag The tag that identified this segment as a literal is also
used to encode part of the length of the data
@param in The input buffer to read the literal from
... | [
"Reads",
"a",
"literal",
"from",
"the",
"input",
"buffer",
"directly",
"to",
"the",
"output",
"buffer",
".",
"A",
"literal",
"is",
"an",
"uncompressed",
"segment",
"of",
"data",
"stored",
"directly",
"in",
"the",
"byte",
"stream",
"."
] | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/util/PatchedNettySnappyDecoder.java#L195-L237 |
aws/aws-sdk-java | aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/GetOpenIdTokenForDeveloperIdentityRequest.java | GetOpenIdTokenForDeveloperIdentityRequest.withLogins | public GetOpenIdTokenForDeveloperIdentityRequest withLogins(java.util.Map<String, String> logins) {
"""
<p>
A set of optional name-value pairs that map provider names to provider tokens. Each name-value pair represents a
user from a public provider or developer provider. If the user is from a developer provider,... | java | public GetOpenIdTokenForDeveloperIdentityRequest withLogins(java.util.Map<String, String> logins) {
setLogins(logins);
return this;
} | [
"public",
"GetOpenIdTokenForDeveloperIdentityRequest",
"withLogins",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"logins",
")",
"{",
"setLogins",
"(",
"logins",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A set of optional name-value pairs that map provider names to provider tokens. Each name-value pair represents a
user from a public provider or developer provider. If the user is from a developer provider, the name-value pair
will follow the syntax <code>"developer_provider_name": "developer_user_identifier"</code>... | [
"<p",
">",
"A",
"set",
"of",
"optional",
"name",
"-",
"value",
"pairs",
"that",
"map",
"provider",
"names",
"to",
"provider",
"tokens",
".",
"Each",
"name",
"-",
"value",
"pair",
"represents",
"a",
"user",
"from",
"a",
"public",
"provider",
"or",
"develo... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/GetOpenIdTokenForDeveloperIdentityRequest.java#L214-L217 |
bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/EmoFileSystem.java | EmoFileSystem.create | @Override
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress)
throws IOException {
"""
All remaining FileSystem operations are not supported and will throw exceptions.
"""
throw ne... | java | @Override
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress)
throws IOException {
throw new IOException("Create not supported for EmoFileSystem: " + f);
} | [
"@",
"Override",
"public",
"FSDataOutputStream",
"create",
"(",
"Path",
"f",
",",
"FsPermission",
"permission",
",",
"boolean",
"overwrite",
",",
"int",
"bufferSize",
",",
"short",
"replication",
",",
"long",
"blockSize",
",",
"Progressable",
"progress",
")",
"t... | All remaining FileSystem operations are not supported and will throw exceptions. | [
"All",
"remaining",
"FileSystem",
"operations",
"are",
"not",
"supported",
"and",
"will",
"throw",
"exceptions",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/EmoFileSystem.java#L483-L487 |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/MultiScopeRecoveryLog.java | MultiScopeRecoveryLog.addRecoverableUnit | protected void addRecoverableUnit(RecoverableUnit recoverableUnit, boolean recovered) {
"""
Adds a new RecoverableUnitImpl object, keyed from its identity to this
classes collection of such objects.
@param recoverableUnit The RecoverableUnit to be added
@param recovered Flag to indicate if this instances have... | java | protected void addRecoverableUnit(RecoverableUnit recoverableUnit, boolean recovered)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "addRecoverableUnit", new Object[] { recoverableUnit, recovered, this });
final long identity = recoverableUnit.identity();
_recoverableUnits.put(identi... | [
"protected",
"void",
"addRecoverableUnit",
"(",
"RecoverableUnit",
"recoverableUnit",
",",
"boolean",
"recovered",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"addRecoverableUnit\"",
",",
"new",
"Objec... | Adds a new RecoverableUnitImpl object, keyed from its identity to this
classes collection of such objects.
@param recoverableUnit The RecoverableUnit to be added
@param recovered Flag to indicate if this instances have been created during
recovery (true) or normal running (false). If its been created
during recovery w... | [
"Adds",
"a",
"new",
"RecoverableUnitImpl",
"object",
"keyed",
"from",
"its",
"identity",
"to",
"this",
"classes",
"collection",
"of",
"such",
"objects",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/MultiScopeRecoveryLog.java#L2378-L2394 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionPoliciesInner.java | BackupLongTermRetentionPoliciesInner.createOrUpdateAsync | public Observable<BackupLongTermRetentionPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, BackupLongTermRetentionPolicyInner parameters) {
"""
Creates or updates a database backup long term retention policy.
@param resourceGroupName The name of the resource grou... | java | public Observable<BackupLongTermRetentionPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, BackupLongTermRetentionPolicyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<Servic... | [
"public",
"Observable",
"<",
"BackupLongTermRetentionPolicyInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"BackupLongTermRetentionPolicyInner",
"parameters",
")",
"{",
"return",
"creat... | Creates or updates a database backup long term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database
@param... | [
"Creates",
"or",
"updates",
"a",
"database",
"backup",
"long",
"term",
"retention",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionPoliciesInner.java#L211-L218 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java | RedisStorage.unsetTriggerState | @Override
public boolean unsetTriggerState(final String triggerHashKey, Jedis jedis) throws JobPersistenceException {
"""
Unsets the state of the given trigger key by removing the trigger from all trigger state sets.
@param triggerHashKey the redis key of the desired trigger hash
@param jedis a thread-safe R... | java | @Override
public boolean unsetTriggerState(final String triggerHashKey, Jedis jedis) throws JobPersistenceException {
boolean removed = false;
Pipeline pipe = jedis.pipelined();
List<Response<Long>> responses = new ArrayList<>(RedisTriggerState.values().length);
for (RedisTriggerStat... | [
"@",
"Override",
"public",
"boolean",
"unsetTriggerState",
"(",
"final",
"String",
"triggerHashKey",
",",
"Jedis",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"boolean",
"removed",
"=",
"false",
";",
"Pipeline",
"pipe",
"=",
"jedis",
".",
"pipelined",
... | Unsets the state of the given trigger key by removing the trigger from all trigger state sets.
@param triggerHashKey the redis key of the desired trigger hash
@param jedis a thread-safe Redis connection
@return true if the trigger was removed, false if the trigger was stateless
@throws org.quartz.JobPersistenceExceptio... | [
"Unsets",
"the",
"state",
"of",
"the",
"given",
"trigger",
"key",
"by",
"removing",
"the",
"trigger",
"from",
"all",
"trigger",
"state",
"sets",
"."
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java#L256-L273 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.