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 |
|---|---|---|---|---|---|---|---|---|---|---|
mattprecious/telescope | telescope/src/main/java/com/mattprecious/telescope/TelescopeFileProvider.java | TelescopeFileProvider.getUriForFile | public static Uri getUriForFile(Context context, File file) {
"""
Calls {@link #getUriForFile(Context, String, File)} using the correct authority for Telescope
screenshots.
"""
return getUriForFile(context, context.getPackageName() + ".telescope.fileprovider", file);
} | java | public static Uri getUriForFile(Context context, File file) {
return getUriForFile(context, context.getPackageName() + ".telescope.fileprovider", file);
} | [
"public",
"static",
"Uri",
"getUriForFile",
"(",
"Context",
"context",
",",
"File",
"file",
")",
"{",
"return",
"getUriForFile",
"(",
"context",
",",
"context",
".",
"getPackageName",
"(",
")",
"+",
"\".telescope.fileprovider\"",
",",
"file",
")",
";",
"}"
] | Calls {@link #getUriForFile(Context, String, File)} using the correct authority for Telescope
screenshots. | [
"Calls",
"{"
] | train | https://github.com/mattprecious/telescope/blob/ce5e2710fb16ee214026fc25b091eb946fdbbb3c/telescope/src/main/java/com/mattprecious/telescope/TelescopeFileProvider.java#L12-L14 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/BitmapUtil.java | BitmapUtil.clipSquare | public static Bitmap clipSquare(@NonNull final Bitmap bitmap, final int size,
final int borderWidth, @ColorInt final int borderColor) {
"""
Clips the long edge of a bitmap, if its width and height are not equal, in order to transform
it into a square. Additionally, the bitmap i... | java | public static Bitmap clipSquare(@NonNull final Bitmap bitmap, final int size,
final int borderWidth, @ColorInt final int borderColor) {
Condition.INSTANCE.ensureAtLeast(borderWidth, 0, "The border width must be at least 0");
Bitmap clippedBitmap = clipSquare(bitmap, s... | [
"public",
"static",
"Bitmap",
"clipSquare",
"(",
"@",
"NonNull",
"final",
"Bitmap",
"bitmap",
",",
"final",
"int",
"size",
",",
"final",
"int",
"borderWidth",
",",
"@",
"ColorInt",
"final",
"int",
"borderColor",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
... | Clips the long edge of a bitmap, if its width and height are not equal, in order to transform
it into a square. Additionally, the bitmap is resized to a specific size and a border will be
added.
@param bitmap
The bitmap, which should be clipped, as an instance of the class {@link Bitmap}. The
bitmap may not be null
@p... | [
"Clips",
"the",
"long",
"edge",
"of",
"a",
"bitmap",
"if",
"its",
"width",
"and",
"height",
"are",
"not",
"equal",
"in",
"order",
"to",
"transform",
"it",
"into",
"a",
"square",
".",
"Additionally",
"the",
"bitmap",
"is",
"resized",
"to",
"a",
"specific"... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/BitmapUtil.java#L311-L337 |
lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLib.java | TagLib.setELClass | protected void setELClass(String eLClass, Identification id, Attributes attributes) {
"""
Fuegt der TagLib die Evaluator Klassendefinition als Zeichenkette hinzu. Diese Methode wird durch
die Klasse TagLibFactory verwendet.
@param eLClass Zeichenkette der Evaluator Klassendefinition.
"""
this.ELClass = Cl... | java | protected void setELClass(String eLClass, Identification id, Attributes attributes) {
this.ELClass = ClassDefinitionImpl.toClassDefinition(eLClass, id, attributes);
} | [
"protected",
"void",
"setELClass",
"(",
"String",
"eLClass",
",",
"Identification",
"id",
",",
"Attributes",
"attributes",
")",
"{",
"this",
".",
"ELClass",
"=",
"ClassDefinitionImpl",
".",
"toClassDefinition",
"(",
"eLClass",
",",
"id",
",",
"attributes",
")",
... | Fuegt der TagLib die Evaluator Klassendefinition als Zeichenkette hinzu. Diese Methode wird durch
die Klasse TagLibFactory verwendet.
@param eLClass Zeichenkette der Evaluator Klassendefinition. | [
"Fuegt",
"der",
"TagLib",
"die",
"Evaluator",
"Klassendefinition",
"als",
"Zeichenkette",
"hinzu",
".",
"Diese",
"Methode",
"wird",
"durch",
"die",
"Klasse",
"TagLibFactory",
"verwendet",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLib.java#L244-L246 |
apereo/cas | support/cas-server-support-throttle-core/src/main/java/org/apereo/cas/web/support/AbstractThrottledSubmissionHandlerInterceptorAdapter.java | AbstractThrottledSubmissionHandlerInterceptorAdapter.throttleRequest | protected boolean throttleRequest(final HttpServletRequest request, final HttpServletResponse response) {
"""
Is request throttled.
@param request the request
@param response the response
@return true if the request is throttled. False otherwise, letting it proceed.
"""
return configurationContex... | java | protected boolean throttleRequest(final HttpServletRequest request, final HttpServletResponse response) {
return configurationContext.getThrottledRequestExecutor() != null
&& configurationContext.getThrottledRequestExecutor().throttle(request, response);
} | [
"protected",
"boolean",
"throttleRequest",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"{",
"return",
"configurationContext",
".",
"getThrottledRequestExecutor",
"(",
")",
"!=",
"null",
"&&",
"configurationContext",... | Is request throttled.
@param request the request
@param response the response
@return true if the request is throttled. False otherwise, letting it proceed. | [
"Is",
"request",
"throttled",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-throttle-core/src/main/java/org/apereo/cas/web/support/AbstractThrottledSubmissionHandlerInterceptorAdapter.java#L86-L89 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParameters.java | RequiredParameters.applyTo | public ParameterTool applyTo(ParameterTool parameterTool) throws RequiredParametersException {
"""
Check for all required parameters defined:
- has a value been passed
- if not, does the parameter have an associated default value
- does the type of the parameter match the one defined in RequiredParameters
- do... | java | public ParameterTool applyTo(ParameterTool parameterTool) throws RequiredParametersException {
List<String> missingArguments = new LinkedList<>();
HashMap<String, String> newParameters = new HashMap<>(parameterTool.toMap());
for (Option o : data.values()) {
if (newParameters.containsKey(o.getName())) {
i... | [
"public",
"ParameterTool",
"applyTo",
"(",
"ParameterTool",
"parameterTool",
")",
"throws",
"RequiredParametersException",
"{",
"List",
"<",
"String",
">",
"missingArguments",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"HashMap",
"<",
"String",
",",
"String",
... | Check for all required parameters defined:
- has a value been passed
- if not, does the parameter have an associated default value
- does the type of the parameter match the one defined in RequiredParameters
- does the value provided in the parameterTool adhere to the choices defined in the option.
<p>If any check fai... | [
"Check",
"for",
"all",
"required",
"parameters",
"defined",
":",
"-",
"has",
"a",
"value",
"been",
"passed",
"-",
"if",
"not",
"does",
"the",
"parameter",
"have",
"an",
"associated",
"default",
"value",
"-",
"does",
"the",
"type",
"of",
"the",
"parameter",... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParameters.java#L89-L117 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/models/ProjectFilter.java | ProjectFilter.getQueryParams | public GitLabApiForm getQueryParams(int page, int perPage) {
"""
Get the query params specified by this filter.
@param page specifies the page number
@param perPage specifies the number of items per page
@return a GitLabApiForm instance holding the query parameters for this ProjectFilter instance
"""
... | java | public GitLabApiForm getQueryParams(int page, int perPage) {
return (getQueryParams()
.withParam(Constants.PAGE_PARAM, page)
.withParam(Constants.PER_PAGE_PARAM, perPage));
} | [
"public",
"GitLabApiForm",
"getQueryParams",
"(",
"int",
"page",
",",
"int",
"perPage",
")",
"{",
"return",
"(",
"getQueryParams",
"(",
")",
".",
"withParam",
"(",
"Constants",
".",
"PAGE_PARAM",
",",
"page",
")",
".",
"withParam",
"(",
"Constants",
".",
"... | Get the query params specified by this filter.
@param page specifies the page number
@param perPage specifies the number of items per page
@return a GitLabApiForm instance holding the query parameters for this ProjectFilter instance | [
"Get",
"the",
"query",
"params",
"specified",
"by",
"this",
"filter",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/models/ProjectFilter.java#L190-L194 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/Sort.java | Sort.insertionSort | public static <T extends Comparable<? super T>>
void insertionSort( T[] arr, int start, int end ) {
"""
method to sort an subarray from start to end with insertion sort algorithm
@param arr an array of Comparable items
@param start the begining position
@param end the end position
"""
int i;
... | java | public static <T extends Comparable<? super T>>
void insertionSort( T[] arr, int start, int end )
{
int i;
for ( int j = start + 1; j <= end; j++ ) {
T tmp = arr[j];
for ( i = j; i > start && tmp.compareTo( arr[i - 1] ) < 0; i-- ) {
arr[ i ] = arr[ i - 1 ... | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
"super",
"T",
">",
">",
"void",
"insertionSort",
"(",
"T",
"[",
"]",
"arr",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"i",
";",
"for",
"(",
"int",
"j",
"=",
"start",
... | method to sort an subarray from start to end with insertion sort algorithm
@param arr an array of Comparable items
@param start the begining position
@param end the end position | [
"method",
"to",
"sort",
"an",
"subarray",
"from",
"start",
"to",
"end",
"with",
"insertion",
"sort",
"algorithm"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/Sort.java#L246-L257 |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/d3/DisparityToColorPointCloud.java | DisparityToColorPointCloud.process | public void process(ImageGray disparity , BufferedImage color ) {
"""
Given the disparity image compute the 3D location of valid points and save pixel colors
at that point
@param disparity Disparity image
@param color Color image of left camera
"""
cloudRgb.setMaxSize(disparity.width*disparity.height);
... | java | public void process(ImageGray disparity , BufferedImage color ) {
cloudRgb.setMaxSize(disparity.width*disparity.height);
cloudXyz.setMaxSize(disparity.width*disparity.height*3);
cloudRgb.reset();
cloudXyz.reset();
if( disparity instanceof GrayU8)
process((GrayU8)disparity,color);
else
process((GrayF3... | [
"public",
"void",
"process",
"(",
"ImageGray",
"disparity",
",",
"BufferedImage",
"color",
")",
"{",
"cloudRgb",
".",
"setMaxSize",
"(",
"disparity",
".",
"width",
"*",
"disparity",
".",
"height",
")",
";",
"cloudXyz",
".",
"setMaxSize",
"(",
"disparity",
".... | Given the disparity image compute the 3D location of valid points and save pixel colors
at that point
@param disparity Disparity image
@param color Color image of left camera | [
"Given",
"the",
"disparity",
"image",
"compute",
"the",
"3D",
"location",
"of",
"valid",
"points",
"and",
"save",
"pixel",
"colors",
"at",
"that",
"point"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/DisparityToColorPointCloud.java#L117-L127 |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSExpression.java | CSSExpression.addNumber | @Nonnull
public CSSExpression addNumber (@Nonnegative final int nIndex, final float fValue) {
"""
Shortcut method to add a numeric value
@param nIndex
The index where the member should be added. Must be ≥ 0.
@param fValue
The value to be added.
@return this
"""
return addMember (nIndex, new CSS... | java | @Nonnull
public CSSExpression addNumber (@Nonnegative final int nIndex, final float fValue)
{
return addMember (nIndex, new CSSExpressionMemberTermSimple (fValue));
} | [
"@",
"Nonnull",
"public",
"CSSExpression",
"addNumber",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
",",
"final",
"float",
"fValue",
")",
"{",
"return",
"addMember",
"(",
"nIndex",
",",
"new",
"CSSExpressionMemberTermSimple",
"(",
"fValue",
")",
")",
";... | Shortcut method to add a numeric value
@param nIndex
The index where the member should be added. Must be ≥ 0.
@param fValue
The value to be added.
@return this | [
"Shortcut",
"method",
"to",
"add",
"a",
"numeric",
"value"
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSExpression.java#L196-L200 |
apache/incubator-druid | indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/LogUtils.java | LogUtils.streamFile | public static InputStream streamFile(final File file, final long offset) throws IOException {
"""
Open a stream to a file.
@param offset If zero, stream the entire log. If positive, read from this byte position onwards. If negative,
read this many bytes from the end of the file.
@return input supplier for t... | java | public static InputStream streamFile(final File file, final long offset) throws IOException
{
final RandomAccessFile raf = new RandomAccessFile(file, "r");
final long rafLength = raf.length();
if (offset > 0) {
raf.seek(offset);
} else if (offset < 0 && offset < rafLength) {
raf.seek(Math.... | [
"public",
"static",
"InputStream",
"streamFile",
"(",
"final",
"File",
"file",
",",
"final",
"long",
"offset",
")",
"throws",
"IOException",
"{",
"final",
"RandomAccessFile",
"raf",
"=",
"new",
"RandomAccessFile",
"(",
"file",
",",
"\"r\"",
")",
";",
"final",
... | Open a stream to a file.
@param offset If zero, stream the entire log. If positive, read from this byte position onwards. If negative,
read this many bytes from the end of the file.
@return input supplier for this log, if available from this provider | [
"Open",
"a",
"stream",
"to",
"a",
"file",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/LogUtils.java#L38-L48 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.calculateLineIndentationLevel | protected int calculateLineIndentationLevel(final ParserData parserData, final String line,
int lineNumber) throws IndentationException {
"""
Calculates the indentation level of a line using the amount of whitespace and the parsers indentation size setting.
@param parserData
@param line The l... | java | protected int calculateLineIndentationLevel(final ParserData parserData, final String line,
int lineNumber) throws IndentationException {
char[] lineCharArray = line.toCharArray();
int indentationCount = 0;
// Count the amount of whitespace characters before any text to determine the... | [
"protected",
"int",
"calculateLineIndentationLevel",
"(",
"final",
"ParserData",
"parserData",
",",
"final",
"String",
"line",
",",
"int",
"lineNumber",
")",
"throws",
"IndentationException",
"{",
"char",
"[",
"]",
"lineCharArray",
"=",
"line",
".",
"toCharArray",
... | Calculates the indentation level of a line using the amount of whitespace and the parsers indentation size setting.
@param parserData
@param line The line to calculate the indentation for.
@return The lines indentation level.
@throws IndentationException Thrown if the indentation for the line isn't valid. | [
"Calculates",
"the",
"indentation",
"level",
"of",
"a",
"line",
"using",
"the",
"amount",
"of",
"whitespace",
"and",
"the",
"parsers",
"indentation",
"size",
"setting",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L490-L509 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/JarURLConnection.java | JarURLConnection.parseSpecs | private void parseSpecs(URL url) throws MalformedURLException {
"""
/* get the specs for a given url out of the cache, and compute and
cache them if they're not there.
"""
String spec = url.getFile();
int separator = spec.indexOf("!/");
/*
* REMIND: we don't handle nested JAR... | java | private void parseSpecs(URL url) throws MalformedURLException {
String spec = url.getFile();
int separator = spec.indexOf("!/");
/*
* REMIND: we don't handle nested JAR URLs
*/
if (separator == -1) {
throw new MalformedURLException("no !/ found in url spec:... | [
"private",
"void",
"parseSpecs",
"(",
"URL",
"url",
")",
"throws",
"MalformedURLException",
"{",
"String",
"spec",
"=",
"url",
".",
"getFile",
"(",
")",
";",
"int",
"separator",
"=",
"spec",
".",
"indexOf",
"(",
"\"!/\"",
")",
";",
"/*\n * REMIND: we... | /* get the specs for a given url out of the cache, and compute and
cache them if they're not there. | [
"/",
"*",
"get",
"the",
"specs",
"for",
"a",
"given",
"url",
"out",
"of",
"the",
"cache",
"and",
"compute",
"and",
"cache",
"them",
"if",
"they",
"re",
"not",
"there",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/JarURLConnection.java#L164-L183 |
Javen205/IJPay | src/main/java/com/jpay/ext/kit/PaymentKit.java | PaymentKit.buildShortUrlParasMap | public static Map<String, String> buildShortUrlParasMap(String appid, String sub_appid, String mch_id,
String sub_mch_id, String long_url, String paternerKey) {
"""
构建短链接参数
@param appid
@param sub_appid
@param mch_id
@param sub_mch_id
@param long_url
@param paternerKey
@return <Map<String, String>>
... | java | public static Map<String, String> buildShortUrlParasMap(String appid, String sub_appid, String mch_id,
String sub_mch_id, String long_url, String paternerKey) {
Map<String, String> params = new HashMap<String, String>();
params.put("appid", appid);
params.put("sub_appid", sub_appid);
params.put("mch_id", mch... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"buildShortUrlParasMap",
"(",
"String",
"appid",
",",
"String",
"sub_appid",
",",
"String",
"mch_id",
",",
"String",
"sub_mch_id",
",",
"String",
"long_url",
",",
"String",
"paternerKey",
")",
"{",
... | 构建短链接参数
@param appid
@param sub_appid
@param mch_id
@param sub_mch_id
@param long_url
@param paternerKey
@return <Map<String, String>> | [
"构建短链接参数"
] | train | https://github.com/Javen205/IJPay/blob/78da6be4b70675abc6a41df74817532fa257ef29/src/main/java/com/jpay/ext/kit/PaymentKit.java#L37-L48 |
dlew/joda-time-android | library/src/main/java/net/danlew/android/joda/DateUtils.java | DateUtils.getRelativeTimeSpanString | public static CharSequence getRelativeTimeSpanString(Context ctx, ReadablePartial time, boolean withPreposition) {
"""
Returns a relative time string to display the time expressed by millis.
Missing fields from 'time' are filled in with values from the current time.
See {@link android.text.format.DateUtils#g... | java | public static CharSequence getRelativeTimeSpanString(Context ctx, ReadablePartial time, boolean withPreposition) {
return getRelativeTimeSpanString(ctx, time.toDateTime(DateTime.now()), withPreposition);
} | [
"public",
"static",
"CharSequence",
"getRelativeTimeSpanString",
"(",
"Context",
"ctx",
",",
"ReadablePartial",
"time",
",",
"boolean",
"withPreposition",
")",
"{",
"return",
"getRelativeTimeSpanString",
"(",
"ctx",
",",
"time",
".",
"toDateTime",
"(",
"DateTime",
"... | Returns a relative time string to display the time expressed by millis.
Missing fields from 'time' are filled in with values from the current time.
See {@link android.text.format.DateUtils#getRelativeTimeSpanString} for full docs.
@param withPreposition If true, the string returned will include the correct
prepositi... | [
"Returns",
"a",
"relative",
"time",
"string",
"to",
"display",
"the",
"time",
"expressed",
"by",
"millis",
"."
] | train | https://github.com/dlew/joda-time-android/blob/5bf96f6ef4ea63ee91e73e1e528896fa00108dec/library/src/main/java/net/danlew/android/joda/DateUtils.java#L351-L353 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/plugins/PluginRepository.java | PluginRepository.getPlugin | public final IPluginInterface getPlugin(final String name) throws UnknownPluginException {
"""
Returns the implementation of the plugin identified by the given name.
@param name
The plugin name
@return the plugin identified by the given name * @throws UnknownPluginException
if no plugin with the given na... | java | public final IPluginInterface getPlugin(final String name) throws UnknownPluginException {
PluginDefinition pluginDef = pluginsDefinitionsMap.get(name);
if (pluginDef == null) {
throw new UnknownPluginException(name);
}
try {
IPluginInterface pluginInterface = pl... | [
"public",
"final",
"IPluginInterface",
"getPlugin",
"(",
"final",
"String",
"name",
")",
"throws",
"UnknownPluginException",
"{",
"PluginDefinition",
"pluginDef",
"=",
"pluginsDefinitionsMap",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"pluginDef",
"==",
"null"... | Returns the implementation of the plugin identified by the given name.
@param name
The plugin name
@return the plugin identified by the given name * @throws UnknownPluginException
if no plugin with the given name exists. * @see it.jnrpe.plugins.IPluginRepository#getPlugin(String) | [
"Returns",
"the",
"implementation",
"of",
"the",
"plugin",
"identified",
"by",
"the",
"given",
"name",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/plugins/PluginRepository.java#L70-L89 |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java | VisualizeBinaryData.renderLabeled | public static BufferedImage renderLabeled(GrayS32 labelImage, int numRegions, BufferedImage out) {
"""
Renders a labeled where each region is assigned a random color.
@param labelImage Labeled image with labels from 0 to numRegions-1
@param numRegions Number of labeled in the image
@param out Output image. I... | java | public static BufferedImage renderLabeled(GrayS32 labelImage, int numRegions, BufferedImage out) {
int colors[] = new int[numRegions];
Random rand = new Random(123);
for( int i = 0; i < colors.length; i++ ) {
colors[i] = rand.nextInt();
}
return renderLabeled(labelImage, colors, out);
} | [
"public",
"static",
"BufferedImage",
"renderLabeled",
"(",
"GrayS32",
"labelImage",
",",
"int",
"numRegions",
",",
"BufferedImage",
"out",
")",
"{",
"int",
"colors",
"[",
"]",
"=",
"new",
"int",
"[",
"numRegions",
"]",
";",
"Random",
"rand",
"=",
"new",
"R... | Renders a labeled where each region is assigned a random color.
@param labelImage Labeled image with labels from 0 to numRegions-1
@param numRegions Number of labeled in the image
@param out Output image. If null a new image is declared
@return Colorized labeled image | [
"Renders",
"a",
"labeled",
"where",
"each",
"region",
"is",
"assigned",
"a",
"random",
"color",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java#L332-L342 |
libgdx/box2dlights | src/box2dLight/RayHandler.java | RayHandler.pointAtLight | public boolean pointAtLight(float x, float y) {
"""
Checks whether the given point is inside of any light volume
@return true if point is inside of any light volume
"""
for (Light light : lightList) {
if (light.contains(x, y)) return true;
}
return false;
} | java | public boolean pointAtLight(float x, float y) {
for (Light light : lightList) {
if (light.contains(x, y)) return true;
}
return false;
} | [
"public",
"boolean",
"pointAtLight",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"for",
"(",
"Light",
"light",
":",
"lightList",
")",
"{",
"if",
"(",
"light",
".",
"contains",
"(",
"x",
",",
"y",
")",
")",
"return",
"true",
";",
"}",
"return",
... | Checks whether the given point is inside of any light volume
@return true if point is inside of any light volume | [
"Checks",
"whether",
"the",
"given",
"point",
"is",
"inside",
"of",
"any",
"light",
"volume"
] | train | https://github.com/libgdx/box2dlights/blob/08cf93a41464f71d32475aaa2fe280dc6af78ff3/src/box2dLight/RayHandler.java#L400-L405 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/Utils/MapFileHelper.java | MapFileHelper.createAndLaunchWorld | public static boolean createAndLaunchWorld(WorldSettings worldsettings, boolean isTemporary) {
"""
Creates and launches a unique world according to the settings.
@param worldsettings the world's settings
@param isTemporary if true, the world will be deleted whenever newer worlds are created
@return
"""
... | java | public static boolean createAndLaunchWorld(WorldSettings worldsettings, boolean isTemporary)
{
String s = getNewSaveFileLocation(isTemporary);
Minecraft.getMinecraft().launchIntegratedServer(s, s, worldsettings);
cleanupTemporaryWorlds(s);
return true;
} | [
"public",
"static",
"boolean",
"createAndLaunchWorld",
"(",
"WorldSettings",
"worldsettings",
",",
"boolean",
"isTemporary",
")",
"{",
"String",
"s",
"=",
"getNewSaveFileLocation",
"(",
"isTemporary",
")",
";",
"Minecraft",
".",
"getMinecraft",
"(",
")",
".",
"lau... | Creates and launches a unique world according to the settings.
@param worldsettings the world's settings
@param isTemporary if true, the world will be deleted whenever newer worlds are created
@return | [
"Creates",
"and",
"launches",
"a",
"unique",
"world",
"according",
"to",
"the",
"settings",
"."
] | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/MapFileHelper.java#L106-L112 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/resources/FileResourceModelSource.java | FileResourceModelSource.parseFile | public static INodeSet parseFile(final File file, final Framework framework, final String project) throws
ResourceModelSourceException,
ConfigurationException {
"""
Utility method to directly parse the nodes from a file
@param file file
@param framework fwk
@param project projec... | java | public static INodeSet parseFile(final File file, final Framework framework, final String project) throws
ResourceModelSourceException,
ConfigurationException
{
final FileResourceModelSource prov = new FileResourceModelSource(framework);
prov.configure(
Config... | [
"public",
"static",
"INodeSet",
"parseFile",
"(",
"final",
"File",
"file",
",",
"final",
"Framework",
"framework",
",",
"final",
"String",
"project",
")",
"throws",
"ResourceModelSourceException",
",",
"ConfigurationException",
"{",
"final",
"FileResourceModelSource",
... | Utility method to directly parse the nodes from a file
@param file file
@param framework fwk
@param project project name
@return nodes
@throws ResourceModelSourceException if an error occurs
@throws ConfigurationException if a configuration error occurs | [
"Utility",
"method",
"to",
"directly",
"parse",
"the",
"nodes",
"from",
"a",
"file"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/resources/FileResourceModelSource.java#L203-L217 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberFormat.java | NumberFormat.getPattern | protected static String getPattern(ULocale forLocale, int choice) {
"""
Returns the pattern for the provided locale and choice.
@param forLocale the locale of the data.
@param choice the pattern format.
@return the pattern
"""
/* for ISOCURRENCYSTYLE and PLURALCURRENCYSTYLE,
* the pattern i... | java | protected static String getPattern(ULocale forLocale, int choice) {
/* for ISOCURRENCYSTYLE and PLURALCURRENCYSTYLE,
* the pattern is the same as the pattern of CURRENCYSTYLE
* but by replacing the single currency sign with
* double currency sign or triple currency sign.
*/
... | [
"protected",
"static",
"String",
"getPattern",
"(",
"ULocale",
"forLocale",
",",
"int",
"choice",
")",
"{",
"/* for ISOCURRENCYSTYLE and PLURALCURRENCYSTYLE,\n * the pattern is the same as the pattern of CURRENCYSTYLE\n * but by replacing the single currency sign with\n ... | Returns the pattern for the provided locale and choice.
@param forLocale the locale of the data.
@param choice the pattern format.
@return the pattern | [
"Returns",
"the",
"pattern",
"for",
"the",
"provided",
"locale",
"and",
"choice",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberFormat.java#L1366-L1415 |
pressgang-ccms/PressGangCCMSQuery | src/main/java/org/jboss/pressgang/ccms/filter/utils/JPAUtils.java | JPAUtils.copyJoins | public static void copyJoins(From<?, ?> from, From<?, ?> to) {
"""
Copy Joins
@param from source Join
@param to destination Join
"""
for (Join<?, ?> j : from.getJoins()) {
Join<?, ?> toJoin = to.join(j.getAttribute().getName(), j.getJoinType());
toJoin.alias(getOrCreateAli... | java | public static void copyJoins(From<?, ?> from, From<?, ?> to) {
for (Join<?, ?> j : from.getJoins()) {
Join<?, ?> toJoin = to.join(j.getAttribute().getName(), j.getJoinType());
toJoin.alias(getOrCreateAlias(j));
copyJoins(j, toJoin);
}
for (Fetch<?, ?> f : fr... | [
"public",
"static",
"void",
"copyJoins",
"(",
"From",
"<",
"?",
",",
"?",
">",
"from",
",",
"From",
"<",
"?",
",",
"?",
">",
"to",
")",
"{",
"for",
"(",
"Join",
"<",
"?",
",",
"?",
">",
"j",
":",
"from",
".",
"getJoins",
"(",
")",
")",
"{",... | Copy Joins
@param from source Join
@param to destination Join | [
"Copy",
"Joins"
] | train | https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/utils/JPAUtils.java#L281-L294 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataSomeValuesFromImpl_CustomFieldSerializer.java | OWLDataSomeValuesFromImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataSomeValuesFromImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.goog... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataSomeValuesFromImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataSomeValuesFromImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataSomeValuesFromImpl_CustomFieldSerializer.java#L93-L96 |
tango-controls/JTango | server/src/main/java/org/tango/server/events/EventUtilities.java | EventUtilities.sendToSocket | static void sendToSocket(final ZMQ.Socket eventSocket, final String fullName, int counter, boolean isException, byte[] data) throws DevFailed {
"""
Send data so ZMQ Socket. <br>
Warning. See http://zeromq.org/area:faq. "ZeroMQ sockets are not thread-safe.<br>
The short version is that sockets should not be share... | java | static void sendToSocket(final ZMQ.Socket eventSocket, final String fullName, int counter, boolean isException, byte[] data) throws DevFailed {
XLOGGER.entry();
sendContextData(eventSocket, fullName, counter, isException);
eventSocket.send(data);
LOGGER.debug("event {} sent", fullName);
... | [
"static",
"void",
"sendToSocket",
"(",
"final",
"ZMQ",
".",
"Socket",
"eventSocket",
",",
"final",
"String",
"fullName",
",",
"int",
"counter",
",",
"boolean",
"isException",
",",
"byte",
"[",
"]",
"data",
")",
"throws",
"DevFailed",
"{",
"XLOGGER",
".",
"... | Send data so ZMQ Socket. <br>
Warning. See http://zeromq.org/area:faq. "ZeroMQ sockets are not thread-safe.<br>
The short version is that sockets should not be shared between threads. We recommend creating a dedicated socket for each thread. <br>
For those situations where a dedicated socket per thread is infeasible, a... | [
"Send",
"data",
"so",
"ZMQ",
"Socket",
".",
"<br",
">",
"Warning",
".",
"See",
"http",
":",
"//",
"zeromq",
".",
"org",
"/",
"area",
":",
"faq",
".",
"ZeroMQ",
"sockets",
"are",
"not",
"thread",
"-",
"safe",
".",
"<br",
">",
"The",
"short",
"versio... | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventUtilities.java#L438-L444 |
rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__render | protected RawData __render(String template, Object... args) {
"""
Render another template from this template. Could be used in template authoring.
For example:
<p/>
<pre><code>
{@literal @}args String customTemplate, Map<String, Object> customParams
{@literal @}{ Object renderResult = render(customTemplate, c... | java | protected RawData __render(String template, Object... args) {
if (null == template) return new RawData("");
return S.raw(__engine.sandbox().render(template, args));
} | [
"protected",
"RawData",
"__render",
"(",
"String",
"template",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"null",
"==",
"template",
")",
"return",
"new",
"RawData",
"(",
"\"\"",
")",
";",
"return",
"S",
".",
"raw",
"(",
"__engine",
".",
"sandbo... | Render another template from this template. Could be used in template authoring.
For example:
<p/>
<pre><code>
{@literal @}args String customTemplate, Map<String, Object> customParams
{@literal @}{ Object renderResult = render(customTemplate, customParams);
}
<p class="customer_content">@renderResult</p>
</code></pre>
... | [
"Render",
"another",
"template",
"from",
"this",
"template",
".",
"Could",
"be",
"used",
"in",
"template",
"authoring",
".",
"For",
"example",
":",
"<p",
"/",
">",
"<pre",
">",
"<code",
">",
"{",
"@literal",
"@",
"}",
"args",
"String",
"customTemplate",
... | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L280-L283 |
SonarOpenCommunity/sonar-cxx | cxx-sensors/src/main/java/org/sonar/cxx/sensors/compiler/CxxCompilerSensor.java | CxxCompilerSensor.isInputValid | protected boolean isInputValid(String filename, String line, String id, String msg) {
"""
Derived classes can overload this method
@param filename
@param line
@param id
@param msg
@return true, if valid
"""
return !filename.isEmpty() || !line.isEmpty() || !id.isEmpty() || !msg.isEmpty();
} | java | protected boolean isInputValid(String filename, String line, String id, String msg) {
return !filename.isEmpty() || !line.isEmpty() || !id.isEmpty() || !msg.isEmpty();
} | [
"protected",
"boolean",
"isInputValid",
"(",
"String",
"filename",
",",
"String",
"line",
",",
"String",
"id",
",",
"String",
"msg",
")",
"{",
"return",
"!",
"filename",
".",
"isEmpty",
"(",
")",
"||",
"!",
"line",
".",
"isEmpty",
"(",
")",
"||",
"!",
... | Derived classes can overload this method
@param filename
@param line
@param id
@param msg
@return true, if valid | [
"Derived",
"classes",
"can",
"overload",
"this",
"method"
] | train | https://github.com/SonarOpenCommunity/sonar-cxx/blob/7e7a3a44d6d86382a0434652a798f8235503c9b8/cxx-sensors/src/main/java/org/sonar/cxx/sensors/compiler/CxxCompilerSensor.java#L116-L118 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlGraphicsContext.java | VmlGraphicsContext.drawCircle | public void drawCircle(Object parent, String name, Coordinate position, double radius, ShapeStyle style) {
"""
Draw a circle on the <code>GraphicsContext</code>.
@param parent
parent group object
@param name
The circle's name.
@param position
The center position as a coordinate.
@param radius
The circle'... | java | public void drawCircle(Object parent, String name, Coordinate position, double radius, ShapeStyle style) {
if (isAttached()) {
Element circle = helper.createOrUpdateElement(parent, name, "oval", style);
// Real position is the upper left corner of the circle:
applyAbsolutePosition(circle, new Coordinate(pos... | [
"public",
"void",
"drawCircle",
"(",
"Object",
"parent",
",",
"String",
"name",
",",
"Coordinate",
"position",
",",
"double",
"radius",
",",
"ShapeStyle",
"style",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"Element",
"circle",
"=",
"helper",
... | Draw a circle on the <code>GraphicsContext</code>.
@param parent
parent group object
@param name
The circle's name.
@param position
The center position as a coordinate.
@param radius
The circle's radius.
@param style
The styling object by which the circle should be drawn. | [
"Draw",
"a",
"circle",
"on",
"the",
"<code",
">",
"GraphicsContext<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlGraphicsContext.java#L127-L138 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/FileWatcher.java | FileWatcher.addWatcher | @Deprecated
public void addWatcher(File file, Watcher watcher) {
"""
Start watching file path and notify watcher for updates on that file.
@param file The file path to watch.
@param watcher The watcher to be notified.
@deprecated Use {@link #addWatcher(Path, Listener)}
"""
addWatcher(file.toPa... | java | @Deprecated
public void addWatcher(File file, Watcher watcher) {
addWatcher(file.toPath(), watcher);
} | [
"@",
"Deprecated",
"public",
"void",
"addWatcher",
"(",
"File",
"file",
",",
"Watcher",
"watcher",
")",
"{",
"addWatcher",
"(",
"file",
".",
"toPath",
"(",
")",
",",
"watcher",
")",
";",
"}"
] | Start watching file path and notify watcher for updates on that file.
@param file The file path to watch.
@param watcher The watcher to be notified.
@deprecated Use {@link #addWatcher(Path, Listener)} | [
"Start",
"watching",
"file",
"path",
"and",
"notify",
"watcher",
"for",
"updates",
"on",
"that",
"file",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/FileWatcher.java#L164-L167 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_features_backupFTP_access_POST | public OvhTask serviceName_features_backupFTP_access_POST(String serviceName, Boolean cifs, Boolean ftp, String ipBlock, Boolean nfs) throws IOException {
"""
Create a new Backup FTP ACL
REST: POST /dedicated/server/{serviceName}/features/backupFTP/access
@param nfs [required] Wether to allow the NFS protocol ... | java | public OvhTask serviceName_features_backupFTP_access_POST(String serviceName, Boolean cifs, Boolean ftp, String ipBlock, Boolean nfs) throws IOException {
String qPath = "/dedicated/server/{serviceName}/features/backupFTP/access";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap... | [
"public",
"OvhTask",
"serviceName_features_backupFTP_access_POST",
"(",
"String",
"serviceName",
",",
"Boolean",
"cifs",
",",
"Boolean",
"ftp",
",",
"String",
"ipBlock",
",",
"Boolean",
"nfs",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/... | Create a new Backup FTP ACL
REST: POST /dedicated/server/{serviceName}/features/backupFTP/access
@param nfs [required] Wether to allow the NFS protocol for this ACL
@param ipBlock [required] The IP Block specific to this ACL. It musts belong to your server.
@param cifs [required] Wether to allow the CIFS (SMB) protoco... | [
"Create",
"a",
"new",
"Backup",
"FTP",
"ACL"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L853-L863 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/ArgUtils.java | ArgUtils.instanceOf | public static void instanceOf(final Object arg, final Class<?> clazz, final String name) {
"""
検証対象の値が、指定したクラスを継承しているかどうか検証する。
@since 2.0
@param arg 検証対象の値
@param clazz 親クラス
@param name 検証対象の引数の名前
"""
if(arg == null) {
throw new IllegalArgumentException(String.format("%s s... | java | public static void instanceOf(final Object arg, final Class<?> clazz, final String name) {
if(arg == null) {
throw new IllegalArgumentException(String.format("%s should not be null.", name));
}
if(!clazz.isAssignableFrom(arg.getClass())) {
throw n... | [
"public",
"static",
"void",
"instanceOf",
"(",
"final",
"Object",
"arg",
",",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"arg",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
... | 検証対象の値が、指定したクラスを継承しているかどうか検証する。
@since 2.0
@param arg 検証対象の値
@param clazz 親クラス
@param name 検証対象の引数の名前 | [
"検証対象の値が、指定したクラスを継承しているかどうか検証する。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/ArgUtils.java#L136-L146 |
BioPAX/Paxtools | sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java | L3ToSBGNPDConverter.createGlyph | private Glyph createGlyph(Entity e) {
"""
/*
Creates a glyph representing the given PhysicalEntity.
@param e PhysicalEntity or Gene to represent
@return the created glyph
"""
String id = convertID(e.getUri());
if (glyphMap.containsKey(id))
return glyphMap.get(id);
// Create its glyph and registe... | java | private Glyph createGlyph(Entity e)
{
String id = convertID(e.getUri());
if (glyphMap.containsKey(id))
return glyphMap.get(id);
// Create its glyph and register
Glyph g = createGlyphBasics(e, true);
glyphMap.put(g.getId(), g);
//TODO: export metadata (e.g., from bpe.getAnnotations() map) using the SBG... | [
"private",
"Glyph",
"createGlyph",
"(",
"Entity",
"e",
")",
"{",
"String",
"id",
"=",
"convertID",
"(",
"e",
".",
"getUri",
"(",
")",
")",
";",
"if",
"(",
"glyphMap",
".",
"containsKey",
"(",
"id",
")",
")",
"return",
"glyphMap",
".",
"get",
"(",
"... | /*
Creates a glyph representing the given PhysicalEntity.
@param e PhysicalEntity or Gene to represent
@return the created glyph | [
"/",
"*",
"Creates",
"a",
"glyph",
"representing",
"the",
"given",
"PhysicalEntity",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java#L407-L438 |
nguyenq/tess4j | src/main/java/com/recognition/software/jdeskew/ImageUtil.java | ImageUtil.isBlack | public static boolean isBlack(BufferedImage image, int x, int y) {
"""
Whether the pixel is black.
@param image source image
@param x
@param y
@return
"""
if (image.getType() == BufferedImage.TYPE_BYTE_BINARY) {
WritableRaster raster = image.getRaster();
int pixelRGBVal... | java | public static boolean isBlack(BufferedImage image, int x, int y) {
if (image.getType() == BufferedImage.TYPE_BYTE_BINARY) {
WritableRaster raster = image.getRaster();
int pixelRGBValue = raster.getSample(x, y, 0);
return pixelRGBValue == 0;
}
int lumin... | [
"public",
"static",
"boolean",
"isBlack",
"(",
"BufferedImage",
"image",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"image",
".",
"getType",
"(",
")",
"==",
"BufferedImage",
".",
"TYPE_BYTE_BINARY",
")",
"{",
"WritableRaster",
"raster",
"=",
... | Whether the pixel is black.
@param image source image
@param x
@param y
@return | [
"Whether",
"the",
"pixel",
"is",
"black",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/com/recognition/software/jdeskew/ImageUtil.java#L29-L38 |
alkacon/opencms-core | src-modules/org/opencms/workplace/explorer/CmsExplorer.java | CmsExplorer.getWorkplaceExplorerLink | public static String getWorkplaceExplorerLink(final CmsObject cms, final String explorerRootPath) {
"""
Creates a link for the OpenCms workplace that will reload the whole workplace, switch to the explorer view, the
site of the given explorerRootPath and show the folder given in the explorerRootPath.
<p>
@par... | java | public static String getWorkplaceExplorerLink(final CmsObject cms, final String explorerRootPath) {
// split the root site:
StringBuffer siteRoot = new StringBuffer();
StringBuffer path = new StringBuffer('/');
Scanner scanner = new Scanner(explorerRootPath);
scanner.useDelimite... | [
"public",
"static",
"String",
"getWorkplaceExplorerLink",
"(",
"final",
"CmsObject",
"cms",
",",
"final",
"String",
"explorerRootPath",
")",
"{",
"// split the root site:",
"StringBuffer",
"siteRoot",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"StringBuffer",
"path",
... | Creates a link for the OpenCms workplace that will reload the whole workplace, switch to the explorer view, the
site of the given explorerRootPath and show the folder given in the explorerRootPath.
<p>
@param cms
the cms object
@param explorerRootPath
a root relative folder link (has to end with '/').
@return a link... | [
"Creates",
"a",
"link",
"for",
"the",
"OpenCms",
"workplace",
"that",
"will",
"reload",
"the",
"whole",
"workplace",
"switch",
"to",
"the",
"explorer",
"view",
"the",
"site",
"of",
"the",
"given",
"explorerRootPath",
"and",
"show",
"the",
"folder",
"given",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/explorer/CmsExplorer.java#L154-L197 |
igniterealtime/REST-API-Client | src/main/java/org/igniterealtime/restclient/RestApiClient.java | RestApiClient.addUserToGroups | public Response addUserToGroups(String username, UserGroupsEntity userGroupsEntity) {
"""
Adds the user to groups.
@param username
the username
@param userGroupsEntity
the user groups entity
@return the response
"""
return restClient.post("users/" + username + "/groups/", userGroupsEntity,
new Has... | java | public Response addUserToGroups(String username, UserGroupsEntity userGroupsEntity) {
return restClient.post("users/" + username + "/groups/", userGroupsEntity,
new HashMap<String, String>());
} | [
"public",
"Response",
"addUserToGroups",
"(",
"String",
"username",
",",
"UserGroupsEntity",
"userGroupsEntity",
")",
"{",
"return",
"restClient",
".",
"post",
"(",
"\"users/\"",
"+",
"username",
"+",
"\"/groups/\"",
",",
"userGroupsEntity",
",",
"new",
"HashMap",
... | Adds the user to groups.
@param username
the username
@param userGroupsEntity
the user groups entity
@return the response | [
"Adds",
"the",
"user",
"to",
"groups",
"."
] | train | https://github.com/igniterealtime/REST-API-Client/blob/fd544dd770ec2ababa47fef51579522ddce09f05/src/main/java/org/igniterealtime/restclient/RestApiClient.java#L511-L514 |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/BboxService.java | BboxService.getCenterPoint | public static Coordinate getCenterPoint(Bbox bbox) {
"""
Get the center of the bounding box as a Coordinate.
@param bbox
The bounding box to get the center point for.
@return The center of the given bounding box as a new coordinate.
"""
double centerX = (bbox.getWidth() == 0 ? bbox.getX() : bbox.getX() ... | java | public static Coordinate getCenterPoint(Bbox bbox) {
double centerX = (bbox.getWidth() == 0 ? bbox.getX() : bbox.getX() + bbox.getWidth() / 2);
double centerY = (bbox.getHeight() == 0 ? bbox.getY() : bbox.getY() + bbox.getHeight() / 2);
return new Coordinate(centerX, centerY);
} | [
"public",
"static",
"Coordinate",
"getCenterPoint",
"(",
"Bbox",
"bbox",
")",
"{",
"double",
"centerX",
"=",
"(",
"bbox",
".",
"getWidth",
"(",
")",
"==",
"0",
"?",
"bbox",
".",
"getX",
"(",
")",
":",
"bbox",
".",
"getX",
"(",
")",
"+",
"bbox",
"."... | Get the center of the bounding box as a Coordinate.
@param bbox
The bounding box to get the center point for.
@return The center of the given bounding box as a new coordinate. | [
"Get",
"the",
"center",
"of",
"the",
"bounding",
"box",
"as",
"a",
"Coordinate",
"."
] | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/BboxService.java#L65-L69 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.detectEnd | public static Point detectEnd(List<Location> subLocations, boolean isCircular) {
"""
This will attempt to find what the last point is and returns that
position. If the location is circular this will return the total length
of the location and does not mean the maximum point on the Sequence
we may find the locat... | java | public static Point detectEnd(List<Location> subLocations, boolean isCircular) {
int end = 0;
Point lastPoint = null;
if(isCircular) {
for (Location sub : subLocations) {
lastPoint = sub.getEnd();
end += lastPoint.getPosition();
}
}
else {
lastPoint = subLocations.get(subLocations.size()-1).g... | [
"public",
"static",
"Point",
"detectEnd",
"(",
"List",
"<",
"Location",
">",
"subLocations",
",",
"boolean",
"isCircular",
")",
"{",
"int",
"end",
"=",
"0",
";",
"Point",
"lastPoint",
"=",
"null",
";",
"if",
"(",
"isCircular",
")",
"{",
"for",
"(",
"Lo... | This will attempt to find what the last point is and returns that
position. If the location is circular this will return the total length
of the location and does not mean the maximum point on the Sequence
we may find the locations on | [
"This",
"will",
"attempt",
"to",
"find",
"what",
"the",
"last",
"point",
"is",
"and",
"returns",
"that",
"position",
".",
"If",
"the",
"location",
"is",
"circular",
"this",
"will",
"return",
"the",
"total",
"length",
"of",
"the",
"location",
"and",
"does",... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L322-L336 |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/serializer/FlatteningDeserializer.java | FlatteningDeserializer.handleFlatteningForField | @SuppressWarnings("unchecked")
private static void handleFlatteningForField(Field classField, JsonNode jsonNode) {
"""
Given a field of a POJO class and JsonNode corresponds to the same POJO class,
check field's {@link JsonProperty} has flattening dots in it if so
flatten the nested child JsonNode correspond... | java | @SuppressWarnings("unchecked")
private static void handleFlatteningForField(Field classField, JsonNode jsonNode) {
final JsonProperty jsonProperty = classField.getAnnotation(JsonProperty.class);
if (jsonProperty != null) {
final String jsonPropValue = jsonProperty.value();
if... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"void",
"handleFlatteningForField",
"(",
"Field",
"classField",
",",
"JsonNode",
"jsonNode",
")",
"{",
"final",
"JsonProperty",
"jsonProperty",
"=",
"classField",
".",
"getAnnotation",
"(",
"Js... | Given a field of a POJO class and JsonNode corresponds to the same POJO class,
check field's {@link JsonProperty} has flattening dots in it if so
flatten the nested child JsonNode corresponds to the field in the given JsonNode.
@param classField the field in a POJO class
@param jsonNode the json node corresponds to PO... | [
"Given",
"a",
"field",
"of",
"a",
"POJO",
"class",
"and",
"JsonNode",
"corresponds",
"to",
"the",
"same",
"POJO",
"class",
"check",
"field",
"s",
"{",
"@link",
"JsonProperty",
"}",
"has",
"flattening",
"dots",
"in",
"it",
"if",
"so",
"flatten",
"the",
"n... | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/serializer/FlatteningDeserializer.java#L147-L157 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_role_roleId_member_POST | public OvhOperation serviceName_role_roleId_member_POST(String serviceName, String roleId, String note, String username) throws IOException {
"""
Append user into the member list of specified role
REST: POST /dbaas/logs/{serviceName}/role/{roleId}/member
@param serviceName [required] Service name
@param roleI... | java | public OvhOperation serviceName_role_roleId_member_POST(String serviceName, String roleId, String note, String username) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/role/{roleId}/member";
StringBuilder sb = path(qPath, serviceName, roleId);
HashMap<String, Object>o = new HashMap<String, Object>... | [
"public",
"OvhOperation",
"serviceName_role_roleId_member_POST",
"(",
"String",
"serviceName",
",",
"String",
"roleId",
",",
"String",
"note",
",",
"String",
"username",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/logs/{serviceName}/role/{roleId}/... | Append user into the member list of specified role
REST: POST /dbaas/logs/{serviceName}/role/{roleId}/member
@param serviceName [required] Service name
@param roleId [required] Role ID
@param username [required] Username
@param note [required] Custom note | [
"Append",
"user",
"into",
"the",
"member",
"list",
"of",
"specified",
"role"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L897-L905 |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java | CSSColorHelper.getHSLColorValue | @Nonnull
@Nonempty
public static String getHSLColorValue (final float fHue, final float fSaturation, final float fLightness) {
"""
Get the passed values as CSS HSL color value
@param fHue
Hue - is scaled to 0-359
@param fSaturation
Saturation - is scaled to 0-100
@param fLightness
Lightness - is scaled... | java | @Nonnull
@Nonempty
public static String getHSLColorValue (final float fHue, final float fSaturation, final float fLightness)
{
return new StringBuilder (18).append (CCSSValue.PREFIX_HSL_OPEN)
.append (getHSLHueValue (fHue))
.append (',')
... | [
"@",
"Nonnull",
"@",
"Nonempty",
"public",
"static",
"String",
"getHSLColorValue",
"(",
"final",
"float",
"fHue",
",",
"final",
"float",
"fSaturation",
",",
"final",
"float",
"fLightness",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
"18",
")",
".",
"app... | Get the passed values as CSS HSL color value
@param fHue
Hue - is scaled to 0-359
@param fSaturation
Saturation - is scaled to 0-100
@param fLightness
Lightness - is scaled to 0-100
@return The CSS string to use | [
"Get",
"the",
"passed",
"values",
"as",
"CSS",
"HSL",
"color",
"value"
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java#L503-L516 |
JOML-CI/JOML | src/org/joml/Matrix3d.java | Matrix3d.rotationTowards | public Matrix3d rotationTowards(Vector3dc dir, Vector3dc up) {
"""
Set this matrix to a model transformation for a right-handed coordinate system,
that aligns the local <code>-z</code> axis with <code>center - eye</code>.
<p>
In order to apply the rotation transformation to a previous existing transformation,
... | java | public Matrix3d rotationTowards(Vector3dc dir, Vector3dc up) {
return rotationTowards(dir.x(), dir.y(), dir.z(), up.x(), up.y(), up.z());
} | [
"public",
"Matrix3d",
"rotationTowards",
"(",
"Vector3dc",
"dir",
",",
"Vector3dc",
"up",
")",
"{",
"return",
"rotationTowards",
"(",
"dir",
".",
"x",
"(",
")",
",",
"dir",
".",
"y",
"(",
")",
",",
"dir",
".",
"z",
"(",
")",
",",
"up",
".",
"x",
... | Set this matrix to a model transformation for a right-handed coordinate system,
that aligns the local <code>-z</code> axis with <code>center - eye</code>.
<p>
In order to apply the rotation transformation to a previous existing transformation,
use {@link #rotateTowards(double, double, double, double, double, double) ro... | [
"Set",
"this",
"matrix",
"to",
"a",
"model",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"aligns",
"the",
"local",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"axis",
"with",
"<code",
">",
"center",
"-",
"eye<",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3d.java#L4555-L4557 |
structr/structr | structr-core/src/main/java/org/structr/common/ValidationHelper.java | ValidationHelper.isValidStringMatchingRegex | public static boolean isValidStringMatchingRegex(final GraphObject node, final PropertyKey<String> key, final String expression, final ErrorBuffer errorBuffer) {
"""
Checks whether the value of the given property key of the given node
if not null and matches the given regular expression.
@param node
@param ke... | java | public static boolean isValidStringMatchingRegex(final GraphObject node, final PropertyKey<String> key, final String expression, final ErrorBuffer errorBuffer) {
final String value = node.getProperty(key);
if (isValidStringMatchingRegex(value, expression)) {
return true;
}
// no match
errorBuffer.add(ne... | [
"public",
"static",
"boolean",
"isValidStringMatchingRegex",
"(",
"final",
"GraphObject",
"node",
",",
"final",
"PropertyKey",
"<",
"String",
">",
"key",
",",
"final",
"String",
"expression",
",",
"final",
"ErrorBuffer",
"errorBuffer",
")",
"{",
"final",
"String",... | Checks whether the value of the given property key of the given node
if not null and matches the given regular expression.
@param node
@param key
@param expression
@param errorBuffer
@return true if string matches expression | [
"Checks",
"whether",
"the",
"value",
"of",
"the",
"given",
"property",
"key",
"of",
"the",
"given",
"node",
"if",
"not",
"null",
"and",
"matches",
"the",
"given",
"regular",
"expression",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/common/ValidationHelper.java#L165-L176 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/Zips.java | Zips.isEntryInDir | private boolean isEntryInDir(Set<String> dirNames, String entryName) {
"""
Checks if entry given by name resides inside of one of the dirs.
@param dirNames dirs
@param entryName entryPath
"""
// this should be done with a trie, put dirNames in a trie and check if entryName leads to
// some node or ... | java | private boolean isEntryInDir(Set<String> dirNames, String entryName) {
// this should be done with a trie, put dirNames in a trie and check if entryName leads to
// some node or not.
for(String dirName : dirNames) {
if (entryName.startsWith(dirName)) {
return true;
}
}
return fal... | [
"private",
"boolean",
"isEntryInDir",
"(",
"Set",
"<",
"String",
">",
"dirNames",
",",
"String",
"entryName",
")",
"{",
"// this should be done with a trie, put dirNames in a trie and check if entryName leads to",
"// some node or not.",
"for",
"(",
"String",
"dirName",
":",
... | Checks if entry given by name resides inside of one of the dirs.
@param dirNames dirs
@param entryName entryPath | [
"Checks",
"if",
"entry",
"given",
"by",
"name",
"resides",
"inside",
"of",
"one",
"of",
"the",
"dirs",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/Zips.java#L607-L616 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDate.java | LocalDate.plusYears | public LocalDate plusYears(long yearsToAdd) {
"""
Returns a copy of this {@code LocalDate} with the specified number of years added.
<p>
This method adds the specified amount to the years field in three steps:
<ol>
<li>Add the input years to the year field</li>
<li>Check if the resulting date would be invalid... | java | public LocalDate plusYears(long yearsToAdd) {
if (yearsToAdd == 0) {
return this;
}
int newYear = YEAR.checkValidIntValue(year + yearsToAdd); // safe overflow
return resolvePreviousValid(newYear, month, day);
} | [
"public",
"LocalDate",
"plusYears",
"(",
"long",
"yearsToAdd",
")",
"{",
"if",
"(",
"yearsToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"newYear",
"=",
"YEAR",
".",
"checkValidIntValue",
"(",
"year",
"+",
"yearsToAdd",
")",
";",
"// saf... | Returns a copy of this {@code LocalDate} with the specified number of years added.
<p>
This method adds the specified amount to the years field in three steps:
<ol>
<li>Add the input years to the year field</li>
<li>Check if the resulting date would be invalid</li>
<li>Adjust the day-of-month to the last valid day if n... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalDate",
"}",
"with",
"the",
"specified",
"number",
"of",
"years",
"added",
".",
"<p",
">",
"This",
"method",
"adds",
"the",
"specified",
"amount",
"to",
"the",
"years",
"field",
"in",
"three",
"ste... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDate.java#L1267-L1273 |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java | OtpErlangList.stringValue | public String stringValue() throws OtpErlangException {
"""
Convert a list of integers into a Unicode string, interpreting each
integer as a Unicode code point value.
@return A java.lang.String object created through its constructor
String(int[], int, int).
@exception OtpErlangException
for non-proper and... | java | public String stringValue() throws OtpErlangException {
if (!isProper()) {
throw new OtpErlangException("Non-proper list: " + this);
}
final int[] values = new int[arity()];
for (int i = 0; i < values.length; ++i) {
final OtpErlangObject o = elementAt(i);
... | [
"public",
"String",
"stringValue",
"(",
")",
"throws",
"OtpErlangException",
"{",
"if",
"(",
"!",
"isProper",
"(",
")",
")",
"{",
"throw",
"new",
"OtpErlangException",
"(",
"\"Non-proper list: \"",
"+",
"this",
")",
";",
"}",
"final",
"int",
"[",
"]",
"val... | Convert a list of integers into a Unicode string, interpreting each
integer as a Unicode code point value.
@return A java.lang.String object created through its constructor
String(int[], int, int).
@exception OtpErlangException
for non-proper and non-integer lists.
@exception OtpErlangRangeException
if any integer d... | [
"Convert",
"a",
"list",
"of",
"integers",
"into",
"a",
"Unicode",
"string",
"interpreting",
"each",
"integer",
"as",
"a",
"Unicode",
"code",
"point",
"value",
"."
] | train | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java#L437-L451 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/redis/Cache.java | Cache.lindex | @SuppressWarnings("unchecked")
/**
* 返回列表 key 中,下标为 index 的元素。
* 下标(index)参数 start 和 stop 都以 0 为底,也就是说,以 0 表示列表的第一个元素,
* 以 1 表示列表的第二个元素,以此类推。
* 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。
* 如果 key 不是列表类型,返回一个错误。
*/
public <T> T lindex(Object key, long index) {
"""
返回列表 key 中,下标为 ind... | java | @SuppressWarnings("unchecked")
/**
* 返回列表 key 中,下标为 index 的元素。
* 下标(index)参数 start 和 stop 都以 0 为底,也就是说,以 0 表示列表的第一个元素,
* 以 1 表示列表的第二个元素,以此类推。
* 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。
* 如果 key 不是列表类型,返回一个错误。
*/
public <T> T lindex(Object key, long index) {
Jedis jedis = getJedis()... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"/**\r\n\t * 返回列表 key 中,下标为 index 的元素。\r\n\t * 下标(index)参数 start 和 stop 都以 0 为底,也就是说,以 0 表示列表的第一个元素,\r\n\t * 以 1 表示列表的第二个元素,以此类推。\r\n\t * 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。\r\n\t * 如果 key 不是列表类型,返回一个错误。\r\n\t */",
"public",
"<",
"T"... | 返回列表 key 中,下标为 index 的元素。
下标(index)参数 start 和 stop 都以 0 为底,也就是说,以 0 表示列表的第一个元素,以 1 表示列表的第二个元素,以此类推。
你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。
如果 key 不是列表类型,返回一个错误。 | [
"返回列表",
"key",
"中,下标为",
"index",
"的元素。",
"下标",
"(",
"index",
")",
"参数",
"start",
"和",
"stop",
"都以",
"0",
"为底,也就是说,以",
"0",
"表示列表的第一个元素,以",
"1",
"表示列表的第二个元素,以此类推。",
"你也可以使用负数下标,以",
"-",
"1",
"表示列表的最后一个元素,",
"-",
"2",
"表示列表的倒数第二个元素,以此类推。",
"如果",
"key",
"不是列表类型... | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L611-L626 |
Azure/azure-sdk-for-java | devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllersInner.java | ControllersInner.createAsync | public Observable<ControllerInner> createAsync(String resourceGroupName, String name, ControllerInner controller) {
"""
Creates an Azure Dev Spaces Controller.
Creates an Azure Dev Spaces Controller with the specified create parameters.
@param resourceGroupName Resource group to which the resource belongs.
@p... | java | public Observable<ControllerInner> createAsync(String resourceGroupName, String name, ControllerInner controller) {
return createWithServiceResponseAsync(resourceGroupName, name, controller).map(new Func1<ServiceResponse<ControllerInner>, ControllerInner>() {
@Override
public ControllerI... | [
"public",
"Observable",
"<",
"ControllerInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"ControllerInner",
"controller",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"cont... | Creates an Azure Dev Spaces Controller.
Creates an Azure Dev Spaces Controller with the specified create parameters.
@param resourceGroupName Resource group to which the resource belongs.
@param name Name of the resource.
@param controller Controller create parameters.
@throws IllegalArgumentException thrown if parame... | [
"Creates",
"an",
"Azure",
"Dev",
"Spaces",
"Controller",
".",
"Creates",
"an",
"Azure",
"Dev",
"Spaces",
"Controller",
"with",
"the",
"specified",
"create",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllersInner.java#L248-L255 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/StringEscaper.java | StringEscaper.formatHex | @Pure
public static String formatHex(int amount, int digits) {
"""
Format the given int value to hexadecimal.
@param amount the value to convert.
@param digits the minimal number of digits.
@return a string representation of the given value.
"""
final StringBuffer hex = new StringBuffer(Integer.toHexSt... | java | @Pure
public static String formatHex(int amount, int digits) {
final StringBuffer hex = new StringBuffer(Integer.toHexString(amount));
while (hex.length() < digits) {
hex.insert(0, "0"); //$NON-NLS-1$
}
return hex.toString();
} | [
"@",
"Pure",
"public",
"static",
"String",
"formatHex",
"(",
"int",
"amount",
",",
"int",
"digits",
")",
"{",
"final",
"StringBuffer",
"hex",
"=",
"new",
"StringBuffer",
"(",
"Integer",
".",
"toHexString",
"(",
"amount",
")",
")",
";",
"while",
"(",
"hex... | Format the given int value to hexadecimal.
@param amount the value to convert.
@param digits the minimal number of digits.
@return a string representation of the given value. | [
"Format",
"the",
"given",
"int",
"value",
"to",
"hexadecimal",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/StringEscaper.java#L186-L193 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DataMaskingPoliciesInner.java | DataMaskingPoliciesInner.createOrUpdateAsync | public Observable<DataMaskingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DataMaskingPolicyInner parameters) {
"""
Creates or updates a database data masking policy.
@param resourceGroupName The name of the resource group that contains the resource. You can ... | java | public Observable<DataMaskingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DataMaskingPolicyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceResponse<DataMaskingPol... | [
"public",
"Observable",
"<",
"DataMaskingPolicyInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"DataMaskingPolicyInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResp... | Creates or updates a database data masking 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 parameters P... | [
"Creates",
"or",
"updates",
"a",
"database",
"data",
"masking",
"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/DataMaskingPoliciesInner.java#L108-L115 |
HeidelTime/heideltime | src/jvnsensegmenter/JVnSenSegmenter.java | JVnSenSegmenter.senSegmentFile | private static void senSegmentFile(String infile, String outfile, JVnSenSegmenter senSegmenter ) {
"""
Segment sentences.
@param infile the infile
@param outfile the outfile
@param senSegmenter the sen segmenter
"""
try{
BufferedReader in = new BufferedReader(new InputStreamReader(
... | java | private static void senSegmentFile(String infile, String outfile, JVnSenSegmenter senSegmenter ){
try{
BufferedReader in = new BufferedReader(new InputStreamReader(
new FileInputStream(infile), "UTF-8"));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
... | [
"private",
"static",
"void",
"senSegmentFile",
"(",
"String",
"infile",
",",
"String",
"outfile",
",",
"JVnSenSegmenter",
"senSegmenter",
")",
"{",
"try",
"{",
"BufferedReader",
"in",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"new",
"Fi... | Segment sentences.
@param infile the infile
@param outfile the outfile
@param senSegmenter the sen segmenter | [
"Segment",
"sentences",
"."
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvnsensegmenter/JVnSenSegmenter.java#L187-L222 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.padOrTrim | public static String padOrTrim(String str, int num) {
"""
Pad or trim so as to produce a string of exactly a certain length.
@param str The String to be padded or truncated
@param num The desired length
"""
if (str == null) {
str = "null";
}
int leng = str.length();
if (leng < nu... | java | public static String padOrTrim(String str, int num) {
if (str == null) {
str = "null";
}
int leng = str.length();
if (leng < num) {
StringBuilder sb = new StringBuilder(str);
for (int i = 0; i < num - leng; i++) {
sb.append(' ');
}
return sb.toString();
... | [
"public",
"static",
"String",
"padOrTrim",
"(",
"String",
"str",
",",
"int",
"num",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"str",
"=",
"\"null\"",
";",
"}",
"int",
"leng",
"=",
"str",
".",
"length",
"(",
")",
";",
"if",
"(",
"leng",
... | Pad or trim so as to produce a string of exactly a certain length.
@param str The String to be padded or truncated
@param num The desired length | [
"Pad",
"or",
"trim",
"so",
"as",
"to",
"produce",
"a",
"string",
"of",
"exactly",
"a",
"certain",
"length",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L426-L442 |
ModeShape/modeshape | modeshape-schematic/src/main/java/org/modeshape/schematic/Base64.java | Base64.encodeBytes | public static String encodeBytes( byte[] source,
int off,
int len,
int options ) throws IOException {
"""
Encodes a byte array into Base64 notation.
<p>
Example options:
<pre>
GZIP: gzip-compress... | java | public static String encodeBytes( byte[] source,
int off,
int len,
int options ) throws IOException {
byte[] encoded = encodeBytesToBytes(source, off, len, options);
// Return value accordi... | [
"public",
"static",
"String",
"encodeBytes",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"off",
",",
"int",
"len",
",",
"int",
"options",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"encoded",
"=",
"encodeBytesToBytes",
"(",
"source",
",",
"off... | Encodes a byte array into Base64 notation.
<p>
Example options:
<pre>
GZIP: gzip-compresses object before encoding it.
DO_BREAK_LINES: break lines at 76 characters
<i>Note: Technically, this makes your encoding non-compliant.</i>
</pre>
<p>
Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
<p>
Ex... | [
"Encodes",
"a",
"byte",
"array",
"into",
"Base64",
"notation",
".",
"<p",
">",
"Example",
"options",
":"
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-schematic/src/main/java/org/modeshape/schematic/Base64.java#L825-L839 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.copyDirectory | public static void copyDirectory( File source, File target ) throws IOException {
"""
Copies a directory.
<p>
This method copies the content of the source directory
into the a target directory. This latter is created if necessary.
</p>
@param source the directory to copy
@param target the target directory
... | java | public static void copyDirectory( File source, File target ) throws IOException {
Utils.createDirectory( target );
for( File sourceFile : listAllFiles( source, false )) {
String path = computeFileRelativeLocation( source, sourceFile );
File targetFile = new File( target, path );
Utils.createDirectory( ta... | [
"public",
"static",
"void",
"copyDirectory",
"(",
"File",
"source",
",",
"File",
"target",
")",
"throws",
"IOException",
"{",
"Utils",
".",
"createDirectory",
"(",
"target",
")",
";",
"for",
"(",
"File",
"sourceFile",
":",
"listAllFiles",
"(",
"source",
",",... | Copies a directory.
<p>
This method copies the content of the source directory
into the a target directory. This latter is created if necessary.
</p>
@param source the directory to copy
@param target the target directory
@throws IOException if a problem occurred during the copy | [
"Copies",
"a",
"directory",
".",
"<p",
">",
"This",
"method",
"copies",
"the",
"content",
"of",
"the",
"source",
"directory",
"into",
"the",
"a",
"target",
"directory",
".",
"This",
"latter",
"is",
"created",
"if",
"necessary",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L1250-L1260 |
beanshell/beanshell | src/main/java/bsh/engine/BshScriptEngine.java | BshScriptEngine.invokeFunction | @Override
public Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException {
"""
Same as invoke(Object, String, Object...) with {@code null} as the
first argument. Used to call top-level procedures defined in scripts.
@param args Arguments to pass to the procedure
@... | java | @Override
public Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException {
return invokeMethod(getGlobal(), name, args);
} | [
"@",
"Override",
"public",
"Object",
"invokeFunction",
"(",
"String",
"name",
",",
"Object",
"...",
"args",
")",
"throws",
"ScriptException",
",",
"NoSuchMethodException",
"{",
"return",
"invokeMethod",
"(",
"getGlobal",
"(",
")",
",",
"name",
",",
"args",
")"... | Same as invoke(Object, String, Object...) with {@code null} as the
first argument. Used to call top-level procedures defined in scripts.
@param args Arguments to pass to the procedure
@return The value returned by the procedure
@throws javax.script.ScriptException if an error occurrs during invocation
of the method.
... | [
"Same",
"as",
"invoke",
"(",
"Object",
"String",
"Object",
"...",
")",
"with",
"{",
"@code",
"null",
"}",
"as",
"the",
"first",
"argument",
".",
"Used",
"to",
"call",
"top",
"-",
"level",
"procedures",
"defined",
"in",
"scripts",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/engine/BshScriptEngine.java#L302-L305 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java | Path2dfx.isCurvedProperty | public BooleanProperty isCurvedProperty() {
"""
Replies the isCurved property.
@return the isCurved property.
"""
if (this.isCurved == null) {
this.isCurved = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_CURVED, false);
this.isCurved.bind(Bindings.createBooleanBinding(() -> {
for (f... | java | public BooleanProperty isCurvedProperty() {
if (this.isCurved == null) {
this.isCurved = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_CURVED, false);
this.isCurved.bind(Bindings.createBooleanBinding(() -> {
for (final PathElementType type : innerTypesProperty()) {
if (type == PathElementTy... | [
"public",
"BooleanProperty",
"isCurvedProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isCurved",
"==",
"null",
")",
"{",
"this",
".",
"isCurved",
"=",
"new",
"ReadOnlyBooleanWrapper",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"IS_CURVED",
",",
"false",... | Replies the isCurved property.
@return the isCurved property. | [
"Replies",
"the",
"isCurved",
"property",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java#L333-L347 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java | AmazonDynamoDBClient.setEndpoint | public void setEndpoint(String endpoint, String serviceName, String regionId) throws IllegalArgumentException {
"""
Overrides the default endpoint for this client ("http://dynamodb.us-east-1.amazonaws.com/") and explicitly provides
an AWS region ID and AWS service name to use when the client calculates a signatur... | java | public void setEndpoint(String endpoint, String serviceName, String regionId) throws IllegalArgumentException {
setEndpoint(endpoint);
signer.setServiceName(serviceName);
signer.setRegionName(regionId);
} | [
"public",
"void",
"setEndpoint",
"(",
"String",
"endpoint",
",",
"String",
"serviceName",
",",
"String",
"regionId",
")",
"throws",
"IllegalArgumentException",
"{",
"setEndpoint",
"(",
"endpoint",
")",
";",
"signer",
".",
"setServiceName",
"(",
"serviceName",
")",... | Overrides the default endpoint for this client ("http://dynamodb.us-east-1.amazonaws.com/") and explicitly provides
an AWS region ID and AWS service name to use when the client calculates a signature
for requests. In almost all cases, this region ID and service name
are automatically determined from the endpoint, and ... | [
"Overrides",
"the",
"default",
"endpoint",
"for",
"this",
"client",
"(",
"http",
":",
"//",
"dynamodb",
".",
"us",
"-",
"east",
"-",
"1",
".",
"amazonaws",
".",
"com",
"/",
")",
"and",
"explicitly",
"provides",
"an",
"AWS",
"region",
"ID",
"and",
"AWS"... | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java#L981-L985 |
pravega/pravega | controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java | StreamMetrics.reportSegmentSplitsAndMerges | public static void reportSegmentSplitsAndMerges(String scope, String streamName, long splits, long merges) {
"""
Reports the number of segment splits and merges related to a particular scale operation on a Stream. Both global
and Stream-specific counters are updated.
@param scope Scope.
@param streamN... | java | public static void reportSegmentSplitsAndMerges(String scope, String streamName, long splits, long merges) {
DYNAMIC_LOGGER.updateCounterValue(globalMetricName(SEGMENTS_SPLITS), splits);
DYNAMIC_LOGGER.updateCounterValue(SEGMENTS_SPLITS, splits, streamTags(scope, streamName));
DYNAMIC_LOGGER.upd... | [
"public",
"static",
"void",
"reportSegmentSplitsAndMerges",
"(",
"String",
"scope",
",",
"String",
"streamName",
",",
"long",
"splits",
",",
"long",
"merges",
")",
"{",
"DYNAMIC_LOGGER",
".",
"updateCounterValue",
"(",
"globalMetricName",
"(",
"SEGMENTS_SPLITS",
")"... | Reports the number of segment splits and merges related to a particular scale operation on a Stream. Both global
and Stream-specific counters are updated.
@param scope Scope.
@param streamName Name of the Stream.
@param splits Number of segment splits in the scale operation.
@param merges Numb... | [
"Reports",
"the",
"number",
"of",
"segment",
"splits",
"and",
"merges",
"related",
"to",
"a",
"particular",
"scale",
"operation",
"on",
"a",
"Stream",
".",
"Both",
"global",
"and",
"Stream",
"-",
"specific",
"counters",
"are",
"updated",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L213-L218 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/storage/ApptentiveDatabaseHelper.java | ApptentiveDatabaseHelper.onUpgrade | @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
"""
This method is called when an app is upgraded. Add alter table statements here for each version in a non-breaking
switch, so that all the necessary upgrades occur for each older version.
"""
ApptentiveLog.d(DATABASE, "... | java | @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
ApptentiveLog.d(DATABASE, "Upgrade database from %d to %d", oldVersion, newVersion);
try {
DatabaseMigrator migrator = createDatabaseMigrator(oldVersion, newVersion);
if (migrator != null) {
migrator.onUpgrade(db, oldVer... | [
"@",
"Override",
"public",
"void",
"onUpgrade",
"(",
"SQLiteDatabase",
"db",
",",
"int",
"oldVersion",
",",
"int",
"newVersion",
")",
"{",
"ApptentiveLog",
".",
"d",
"(",
"DATABASE",
",",
"\"Upgrade database from %d to %d\"",
",",
"oldVersion",
",",
"newVersion",
... | This method is called when an app is upgraded. Add alter table statements here for each version in a non-breaking
switch, so that all the necessary upgrades occur for each older version. | [
"This",
"method",
"is",
"called",
"when",
"an",
"app",
"is",
"upgraded",
".",
"Add",
"alter",
"table",
"statements",
"here",
"for",
"each",
"version",
"in",
"a",
"non",
"-",
"breaking",
"switch",
"so",
"that",
"all",
"the",
"necessary",
"upgrades",
"occur"... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/ApptentiveDatabaseHelper.java#L240-L256 |
alkacon/opencms-core | src/org/opencms/gwt/CmsCoreService.java | CmsCoreService.internalGetLinkForReturnCode | public static CmsReturnLinkInfo internalGetLinkForReturnCode(CmsObject cms, String returnCode) throws CmsException {
"""
Implementation method for getting the link for a given return code.<p>
@param cms the CMS context
@param returnCode the return code
@return the link for the return code
@throws CmsExcept... | java | public static CmsReturnLinkInfo internalGetLinkForReturnCode(CmsObject cms, String returnCode) throws CmsException {
if (CmsUUID.isValidUUID(returnCode)) {
try {
CmsResource pageRes = cms.readResource(new CmsUUID(returnCode), CmsResourceFilter.IGNORE_EXPIRATION);
ret... | [
"public",
"static",
"CmsReturnLinkInfo",
"internalGetLinkForReturnCode",
"(",
"CmsObject",
"cms",
",",
"String",
"returnCode",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"CmsUUID",
".",
"isValidUUID",
"(",
"returnCode",
")",
")",
"{",
"try",
"{",
"CmsResource"... | Implementation method for getting the link for a given return code.<p>
@param cms the CMS context
@param returnCode the return code
@return the link for the return code
@throws CmsException if something goes wrong | [
"Implementation",
"method",
"for",
"getting",
"the",
"link",
"for",
"a",
"given",
"return",
"code",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsCoreService.java#L568-L611 |
apache/incubator-heron | heron/statefulstorages/src/java/org/apache/heron/statefulstorage/hdfs/HDFSStorage.java | HDFSStorage.createDir | protected void createDir(String dir) throws StatefulStorageException {
"""
Creates the directory if it does not exist.
@param dir The path of dir to ensure existence
"""
Path path = new Path(dir);
try {
fileSystem.mkdirs(path);
if (!fileSystem.exists(path)) {
throw new StatefulS... | java | protected void createDir(String dir) throws StatefulStorageException {
Path path = new Path(dir);
try {
fileSystem.mkdirs(path);
if (!fileSystem.exists(path)) {
throw new StatefulStorageException("Failed to create dir: " + dir);
}
} catch (IOException e) {
throw new Stateful... | [
"protected",
"void",
"createDir",
"(",
"String",
"dir",
")",
"throws",
"StatefulStorageException",
"{",
"Path",
"path",
"=",
"new",
"Path",
"(",
"dir",
")",
";",
"try",
"{",
"fileSystem",
".",
"mkdirs",
"(",
"path",
")",
";",
"if",
"(",
"!",
"fileSystem"... | Creates the directory if it does not exist.
@param dir The path of dir to ensure existence | [
"Creates",
"the",
"directory",
"if",
"it",
"does",
"not",
"exist",
"."
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/statefulstorages/src/java/org/apache/heron/statefulstorage/hdfs/HDFSStorage.java#L183-L194 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDatatypeDefinitionAxiomImpl_CustomFieldSerializer.java | OWLDatatypeDefinitionAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDatatypeDefinitionAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.goo... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDatatypeDefinitionAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLDatatypeDefinitionAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDatatypeDefinitionAxiomImpl_CustomFieldSerializer.java#L76-L79 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.prependIfMissing | public static String prependIfMissing(final String str, final CharSequence prefix, final CharSequence... prefixes) {
"""
Prepends the prefix to the start of the string if the string does not
already start with any of the prefixes.
<pre>
StringUtils.prependIfMissing(null, null) = null
StringUtils.prependIfMis... | java | public static String prependIfMissing(final String str, final CharSequence prefix, final CharSequence... prefixes) {
return prependIfMissing(str, prefix, false, prefixes);
} | [
"public",
"static",
"String",
"prependIfMissing",
"(",
"final",
"String",
"str",
",",
"final",
"CharSequence",
"prefix",
",",
"final",
"CharSequence",
"...",
"prefixes",
")",
"{",
"return",
"prependIfMissing",
"(",
"str",
",",
"prefix",
",",
"false",
",",
"pre... | Prepends the prefix to the start of the string if the string does not
already start with any of the prefixes.
<pre>
StringUtils.prependIfMissing(null, null) = null
StringUtils.prependIfMissing("abc", null) = "abc"
StringUtils.prependIfMissing("", "xyz") = "xyz"
StringUtils.prependIfMissing("abc", "xyz") = "xyzabc"
Str... | [
"Prepends",
"the",
"prefix",
"to",
"the",
"start",
"of",
"the",
"string",
"if",
"the",
"string",
"does",
"not",
"already",
"start",
"with",
"any",
"of",
"the",
"prefixes",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L8915-L8917 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java | ConditionalFunctions.ifNaN | public static Expression ifNaN(Expression expression1, Expression expression2, Expression... others) {
"""
Returned expression results in first non-MISSING, non-NaN number.
Returns MISSING or NULL if a non-number input is encountered first
"""
return build("IFNAN", expression1, expression2, others);
... | java | public static Expression ifNaN(Expression expression1, Expression expression2, Expression... others) {
return build("IFNAN", expression1, expression2, others);
} | [
"public",
"static",
"Expression",
"ifNaN",
"(",
"Expression",
"expression1",
",",
"Expression",
"expression2",
",",
"Expression",
"...",
"others",
")",
"{",
"return",
"build",
"(",
"\"IFNAN\"",
",",
"expression1",
",",
"expression2",
",",
"others",
")",
";",
"... | Returned expression results in first non-MISSING, non-NaN number.
Returns MISSING or NULL if a non-number input is encountered first | [
"Returned",
"expression",
"results",
"in",
"first",
"non",
"-",
"MISSING",
"non",
"-",
"NaN",
"number",
".",
"Returns",
"MISSING",
"or",
"NULL",
"if",
"a",
"non",
"-",
"number",
"input",
"is",
"encountered",
"first"
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java#L108-L110 |
j256/ormlite-core | src/main/java/com/j256/ormlite/table/TableUtils.java | TableUtils.clearTable | public static <T> int clearTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig)
throws SQLException {
"""
Clear all data out of the table. For certain database types and with large sized tables, which may take a long
time. In some configurations, it may be faster to drop and re-create t... | java | public static <T> int clearTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig)
throws SQLException {
return clearTable(connectionSource, tableConfig.getTableName());
} | [
"public",
"static",
"<",
"T",
">",
"int",
"clearTable",
"(",
"ConnectionSource",
"connectionSource",
",",
"DatabaseTableConfig",
"<",
"T",
">",
"tableConfig",
")",
"throws",
"SQLException",
"{",
"return",
"clearTable",
"(",
"connectionSource",
",",
"tableConfig",
... | Clear all data out of the table. For certain database types and with large sized tables, which may take a long
time. In some configurations, it may be faster to drop and re-create the table.
<p>
<b>WARNING:</b> This is [obviously] very destructive and is unrecoverable.
</p> | [
"Clear",
"all",
"data",
"out",
"of",
"the",
"table",
".",
"For",
"certain",
"database",
"types",
"and",
"with",
"large",
"sized",
"tables",
"which",
"may",
"take",
"a",
"long",
"time",
".",
"In",
"some",
"configurations",
"it",
"may",
"be",
"faster",
"to... | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L249-L252 |
paypal/SeLion | dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/DataProviderHelper.java | DataProviderHelper.parseIndexString | public static int[] parseIndexString(String value) {
"""
This function will parse the index string into separated individual indexes as needed. Calling the method with a
string containing "1, 3, 5-7, 11, 12-14, 8" would return an list of integers {1, 3, 5, 6, 7, 11, 12, 13, 14, 8}.
Use ',' to separate values, an... | java | public static int[] parseIndexString(String value) {
logger.entering(value);
List<Integer> indexes = new ArrayList<>();
int begin;
int end;
String[] parsed;
String[] parsedIndex = value.split(",");
for (String index : parsedIndex) {
if (index.contains... | [
"public",
"static",
"int",
"[",
"]",
"parseIndexString",
"(",
"String",
"value",
")",
"{",
"logger",
".",
"entering",
"(",
"value",
")",
";",
"List",
"<",
"Integer",
">",
"indexes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"begin",
";",
"... | This function will parse the index string into separated individual indexes as needed. Calling the method with a
string containing "1, 3, 5-7, 11, 12-14, 8" would return an list of integers {1, 3, 5, 6, 7, 11, 12, 13, 14, 8}.
Use ',' to separate values, and use '-' to specify a continuous range. Presence of an invalid ... | [
"This",
"function",
"will",
"parse",
"the",
"index",
"string",
"into",
"separated",
"individual",
"indexes",
"as",
"needed",
".",
"Calling",
"the",
"method",
"with",
"a",
"string",
"containing",
"1",
"3",
"5",
"-",
"7",
"11",
"12",
"-",
"14",
"8",
"would... | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/DataProviderHelper.java#L70-L101 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Color.java | Color.addToCopy | public Color addToCopy(Color c) {
"""
Add another colour to this one
@param c The colour to add
@return The copy which has had the color added to it
"""
Color copy = new Color(r,g,b,a);
copy.r += c.r;
copy.g += c.g;
copy.b += c.b;
copy.a += c.a;
return copy;
} | java | public Color addToCopy(Color c) {
Color copy = new Color(r,g,b,a);
copy.r += c.r;
copy.g += c.g;
copy.b += c.b;
copy.a += c.a;
return copy;
} | [
"public",
"Color",
"addToCopy",
"(",
"Color",
"c",
")",
"{",
"Color",
"copy",
"=",
"new",
"Color",
"(",
"r",
",",
"g",
",",
"b",
",",
"a",
")",
";",
"copy",
".",
"r",
"+=",
"c",
".",
"r",
";",
"copy",
".",
"g",
"+=",
"c",
".",
"g",
";",
"... | Add another colour to this one
@param c The colour to add
@return The copy which has had the color added to it | [
"Add",
"another",
"colour",
"to",
"this",
"one"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Color.java#L367-L375 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java | MappingUtils.invokeConnectionSetter | public static void invokeConnectionSetter(Connection conn, String functionName, Object value) throws MjdbcException {
"""
Invocation of {@link java.sql.Connection} setter functions
This function provides flexibility which required to use {@link java.sql.Connection}
with different Java versions: 5/6 etc.
@para... | java | public static void invokeConnectionSetter(Connection conn, String functionName, Object value) throws MjdbcException {
if (MjdbcConstants.connectionBeanDescription.containsKey(functionName) == true) {
MappingUtils.callSetter(conn, MjdbcConstants.connectionBeanDescription.get(functionName), value);
... | [
"public",
"static",
"void",
"invokeConnectionSetter",
"(",
"Connection",
"conn",
",",
"String",
"functionName",
",",
"Object",
"value",
")",
"throws",
"MjdbcException",
"{",
"if",
"(",
"MjdbcConstants",
".",
"connectionBeanDescription",
".",
"containsKey",
"(",
"fun... | Invocation of {@link java.sql.Connection} setter functions
This function provides flexibility which required to use {@link java.sql.Connection}
with different Java versions: 5/6 etc.
@param conn SQL Connection
@param functionName SQL Connection parameter name
@param value value which would be set
@throw... | [
"Invocation",
"of",
"{",
"@link",
"java",
".",
"sql",
".",
"Connection",
"}",
"setter",
"functions",
"This",
"function",
"provides",
"flexibility",
"which",
"required",
"to",
"use",
"{",
"@link",
"java",
".",
"sql",
".",
"Connection",
"}",
"with",
"different... | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java#L243-L249 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.findUniqueBoolean | public boolean findUniqueBoolean(@NotNull @SQL String sql, Object... args) {
"""
A convenience method for retrieving a single non-null boolean.
@throws NonUniqueResultException if there is more then one row
@throws EmptyResultException if there are no rows
"""
return findUniqueBoolean(SqlQuery.quer... | java | public boolean findUniqueBoolean(@NotNull @SQL String sql, Object... args) {
return findUniqueBoolean(SqlQuery.query(sql, args));
} | [
"public",
"boolean",
"findUniqueBoolean",
"(",
"@",
"NotNull",
"@",
"SQL",
"String",
"sql",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"findUniqueBoolean",
"(",
"SqlQuery",
".",
"query",
"(",
"sql",
",",
"args",
")",
")",
";",
"}"
] | A convenience method for retrieving a single non-null boolean.
@throws NonUniqueResultException if there is more then one row
@throws EmptyResultException if there are no rows | [
"A",
"convenience",
"method",
"for",
"retrieving",
"a",
"single",
"non",
"-",
"null",
"boolean",
"."
] | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L513-L515 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLChannelProvider.java | SSLChannelProvider.updatedSslSupport | protected void updatedSslSupport(SSLSupport service, Map<String, Object> props) {
"""
This is called if the service is updated.
@param ref reference to the service
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "updatedSslSupport", props);
}
... | java | protected void updatedSslSupport(SSLSupport service, Map<String, Object> props) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "updatedSslSupport", props);
}
sslSupport = service;
// If the default pid has changed.. we need to go hunting f... | [
"protected",
"void",
"updatedSslSupport",
"(",
"SSLSupport",
"service",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"... | This is called if the service is updated.
@param ref reference to the service | [
"This",
"is",
"called",
"if",
"the",
"service",
"is",
"updated",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLChannelProvider.java#L216-L235 |
carewebframework/carewebframework-vista | org.carewebframework.vista.api-parent/org.carewebframework.vista.api.core/src/main/java/org/carewebframework/vista/api/property/PropertyService.java | PropertyService.newProperty | private Property newProperty(String propertyName, String instanceName, String entity) {
"""
Returns an instance of the specified property, observing property aliases.
@param propertyName Property name
@param instanceName Instance name
@param entity Entity list
@return Newly created property.
"""
... | java | private Property newProperty(String propertyName, String instanceName, String entity) {
return new Property(toAlias(propertyName), instanceName, entity);
} | [
"private",
"Property",
"newProperty",
"(",
"String",
"propertyName",
",",
"String",
"instanceName",
",",
"String",
"entity",
")",
"{",
"return",
"new",
"Property",
"(",
"toAlias",
"(",
"propertyName",
")",
",",
"instanceName",
",",
"entity",
")",
";",
"}"
] | Returns an instance of the specified property, observing property aliases.
@param propertyName Property name
@param instanceName Instance name
@param entity Entity list
@return Newly created property. | [
"Returns",
"an",
"instance",
"of",
"the",
"specified",
"property",
"observing",
"property",
"aliases",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.api-parent/org.carewebframework.vista.api.core/src/main/java/org/carewebframework/vista/api/property/PropertyService.java#L75-L77 |
sundrio/sundrio | annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java | ToPojo.readObjectProperty | private static String readObjectProperty(String ref, TypeDef source, Property property) {
"""
Returns the string representation of the code that reads an object property from a reference using a getter.
@param ref The reference.
@param source The type of the reference.
@param property The ... | java | private static String readObjectProperty(String ref, TypeDef source, Property property) {
return ref + "." + getterOf(source, property).getName() + "()";
} | [
"private",
"static",
"String",
"readObjectProperty",
"(",
"String",
"ref",
",",
"TypeDef",
"source",
",",
"Property",
"property",
")",
"{",
"return",
"ref",
"+",
"\".\"",
"+",
"getterOf",
"(",
"source",
",",
"property",
")",
".",
"getName",
"(",
")",
"+",
... | Returns the string representation of the code that reads an object property from a reference using a getter.
@param ref The reference.
@param source The type of the reference.
@param property The property to read.
@return The code. | [
"Returns",
"the",
"string",
"representation",
"of",
"the",
"code",
"that",
"reads",
"an",
"object",
"property",
"from",
"a",
"reference",
"using",
"a",
"getter",
"."
] | train | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java#L599-L601 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.isInstanceOf | public <T> T isInstanceOf(final Class<?> type, final T obj, final String message, final Object... values) {
"""
<p>Validate that the argument is an instance of the specified class; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary
class</p>... | java | public <T> T isInstanceOf(final Class<?> type, final T obj, final String message, final Object... values) {
if (!type.isInstance(obj)) {
fail(String.format(message, values));
}
return obj;
} | [
"public",
"<",
"T",
">",
"T",
"isInstanceOf",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"T",
"obj",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"!",
"type",
".",
"isInstance",
"... | <p>Validate that the argument is an instance of the specified class; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary
class</p>
<pre>Validate.isInstanceOf(OkClass.classs, object, "Wrong class, object is of class %s",
object.getClass().getName())... | [
"<p",
">",
"Validate",
"that",
"the",
"argument",
"is",
"an",
"instance",
"of",
"the",
"specified",
"class",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"This",
"method",
"is",
"useful",
"when",
"validating",
... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L1574-L1579 |
shinesolutions/swagger-aem | java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/CrxApi.java | CrxApi.postPackageUpdateAsync | public com.squareup.okhttp.Call postPackageUpdateAsync(String groupName, String packageName, String version, String path, String filter, String charset_, final ApiCallback<String> callback) throws ApiException {
"""
(asynchronously)
@param groupName (required)
@param packageName (required)
@param version (... | java | public com.squareup.okhttp.Call postPackageUpdateAsync(String groupName, String packageName, String version, String path, String filter, String charset_, final ApiCallback<String> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.Progress... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"postPackageUpdateAsync",
"(",
"String",
"groupName",
",",
"String",
"packageName",
",",
"String",
"version",
",",
"String",
"path",
",",
"String",
"filter",
",",
"String",
"charset_",
",",
"final",... | (asynchronously)
@param groupName (required)
@param packageName (required)
@param version (required)
@param path (required)
@param filter (optional)
@param charset_ (optional)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ApiException If fail to process t... | [
"(",
"asynchronously",
")"
] | train | https://github.com/shinesolutions/swagger-aem/blob/ae7da4df93e817dc2bad843779b2069d9c4e7c6b/java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/CrxApi.java#L747-L772 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/CentralAnalyzer.java | CentralAnalyzer.prepareFileTypeAnalyzer | @Override
public void prepareFileTypeAnalyzer(Engine engine) throws InitializationException {
"""
Initializes the analyzer once before any analysis is performed.
@param engine a reference to the dependency-check engine
@throws InitializationException if there's an error during initialization
"""
... | java | @Override
public void prepareFileTypeAnalyzer(Engine engine) throws InitializationException {
LOGGER.debug("Initializing Central analyzer");
LOGGER.debug("Central analyzer enabled: {}", isEnabled());
if (isEnabled()) {
try {
searcher = new CentralSearch(getSetting... | [
"@",
"Override",
"public",
"void",
"prepareFileTypeAnalyzer",
"(",
"Engine",
"engine",
")",
"throws",
"InitializationException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Initializing Central analyzer\"",
")",
";",
"LOGGER",
".",
"debug",
"(",
"\"Central analyzer enabled: {}... | Initializes the analyzer once before any analysis is performed.
@param engine a reference to the dependency-check engine
@throws InitializationException if there's an error during initialization | [
"Initializes",
"the",
"analyzer",
"once",
"before",
"any",
"analysis",
"is",
"performed",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/CentralAnalyzer.java#L161-L173 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.parsers/src/com/ibm/ws/repository/parsers/ParserBase.java | ParserBase.explodeArtifact | public ArtifactMetadata explodeArtifact(File archiveFile, File metadataFile) throws RepositoryArchiveException {
"""
This signature of explodeArtifact is called directly if the archive file
and the metadata file may not be co-located e.g. when pulling them out
of different parts of the build.
@param archiveFi... | java | public ArtifactMetadata explodeArtifact(File archiveFile, File metadataFile) throws RepositoryArchiveException {
String path;
try {
path = archiveFile.getCanonicalPath();
} catch (IOException e) {
throw new RepositoryArchiveException("Failed to get the path for the archi... | [
"public",
"ArtifactMetadata",
"explodeArtifact",
"(",
"File",
"archiveFile",
",",
"File",
"metadataFile",
")",
"throws",
"RepositoryArchiveException",
"{",
"String",
"path",
";",
"try",
"{",
"path",
"=",
"archiveFile",
".",
"getCanonicalPath",
"(",
")",
";",
"}",
... | This signature of explodeArtifact is called directly if the archive file
and the metadata file may not be co-located e.g. when pulling them out
of different parts of the build.
@param archiveFile - the .jar or .esa file to look for a sibling zip for
@param metadataFile - the *.metadata.zip file or null to use one
co-l... | [
"This",
"signature",
"of",
"explodeArtifact",
"is",
"called",
"directly",
"if",
"the",
"archive",
"file",
"and",
"the",
"metadata",
"file",
"may",
"not",
"be",
"co",
"-",
"located",
"e",
".",
"g",
".",
"when",
"pulling",
"them",
"out",
"of",
"different",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.parsers/src/com/ibm/ws/repository/parsers/ParserBase.java#L434-L459 |
apereo/cas | support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java | AbstractServiceValidateController.validateServiceTicket | protected Assertion validateServiceTicket(final WebApplicationService service, final String serviceTicketId) {
"""
Validate service ticket assertion.
@param service the service
@param serviceTicketId the service ticket id
@return the assertion
"""
return serviceValidateConfigurationContext... | java | protected Assertion validateServiceTicket(final WebApplicationService service, final String serviceTicketId) {
return serviceValidateConfigurationContext.getCentralAuthenticationService().validateServiceTicket(serviceTicketId, service);
} | [
"protected",
"Assertion",
"validateServiceTicket",
"(",
"final",
"WebApplicationService",
"service",
",",
"final",
"String",
"serviceTicketId",
")",
"{",
"return",
"serviceValidateConfigurationContext",
".",
"getCentralAuthenticationService",
"(",
")",
".",
"validateServiceTi... | Validate service ticket assertion.
@param service the service
@param serviceTicketId the service ticket id
@return the assertion | [
"Validate",
"service",
"ticket",
"assertion",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java#L225-L227 |
unbescape/unbescape | src/main/java/org/unbescape/properties/PropertiesEscape.java | PropertiesEscape.escapePropertiesKey | public static void escapePropertiesKey(final Reader reader, final Writer writer, final PropertiesKeyEscapeLevel level)
throws IOException {
"""
<p>
Perform a (configurable) Java Properties Key <strong>escape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<... | java | public static void escapePropertiesKey(final Reader reader, final Writer writer, final PropertiesKeyEscapeLevel level)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (level == null) {
t... | [
"public",
"static",
"void",
"escapePropertiesKey",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
",",
"final",
"PropertiesKeyEscapeLevel",
"level",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"... | <p>
Perform a (configurable) Java Properties Key <strong>escape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
This method will perform an escape operation according to the specified
{@link org.unbescape.properties.PropertiesKeyEscapeLevel} argument value.
</p>
<p>
All oth... | [
"<p",
">",
"Perform",
"a",
"(",
"configurable",
")",
"Java",
"Properties",
"Key",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Write... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L1169-L1181 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/cluster/PendingRequestsMap.java | PendingRequestsMap.addRequest | void addRequest(final InstanceType instanceType, final int numberOfInstances) {
"""
Adds the a pending request for the given number of instances of the given type to this map.
@param instanceType
the requested instance type
@param numberOfInstances
the requested number of instances of this type
"""
In... | java | void addRequest(final InstanceType instanceType, final int numberOfInstances) {
Integer numberOfRemainingInstances = this.pendingRequests.get(instanceType);
if (numberOfRemainingInstances == null) {
numberOfRemainingInstances = Integer.valueOf(numberOfInstances);
} else {
numberOfRemainingInstances = Integ... | [
"void",
"addRequest",
"(",
"final",
"InstanceType",
"instanceType",
",",
"final",
"int",
"numberOfInstances",
")",
"{",
"Integer",
"numberOfRemainingInstances",
"=",
"this",
".",
"pendingRequests",
".",
"get",
"(",
"instanceType",
")",
";",
"if",
"(",
"numberOfRem... | Adds the a pending request for the given number of instances of the given type to this map.
@param instanceType
the requested instance type
@param numberOfInstances
the requested number of instances of this type | [
"Adds",
"the",
"a",
"pending",
"request",
"for",
"the",
"given",
"number",
"of",
"instances",
"of",
"the",
"given",
"type",
"to",
"this",
"map",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/cluster/PendingRequestsMap.java#L55-L65 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/Signature.java | Signature.getInstance | public static Signature getInstance(String algorithm)
throws NoSuchAlgorithmException {
"""
Returns a Signature object that implements the specified signature
algorithm.
<p> This method traverses the list of registered security Providers,
starting with the most preferred Provider.
A new Signature... | java | public static Signature getInstance(String algorithm)
throws NoSuchAlgorithmException {
List<Service> list;
if (algorithm.equalsIgnoreCase(RSA_SIGNATURE)) {
list = GetInstance.getServices(rsaIds);
} else {
list = GetInstance.getServices("Signature", algorithm)... | [
"public",
"static",
"Signature",
"getInstance",
"(",
"String",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"List",
"<",
"Service",
">",
"list",
";",
"if",
"(",
"algorithm",
".",
"equalsIgnoreCase",
"(",
"RSA_SIGNATURE",
")",
")",
"{",
"list",
... | Returns a Signature object that implements the specified signature
algorithm.
<p> This method traverses the list of registered security Providers,
starting with the most preferred Provider.
A new Signature object encapsulating the
SignatureSpi implementation from the first
Provider that supports the specified algorith... | [
"Returns",
"a",
"Signature",
"object",
"that",
"implements",
"the",
"specified",
"signature",
"algorithm",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/Signature.java#L353-L384 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseShortObj | @Nullable
public static Short parseShortObj (@Nullable final Object aObject) {
"""
Parse the given {@link Object} as {@link Short} with radix
{@value #DEFAULT_RADIX}.
@param aObject
The object to parse. May be <code>null</code>.
@return <code>null</code> if the object does not represent a valid value.
... | java | @Nullable
public static Short parseShortObj (@Nullable final Object aObject)
{
return parseShortObj (aObject, DEFAULT_RADIX, null);
} | [
"@",
"Nullable",
"public",
"static",
"Short",
"parseShortObj",
"(",
"@",
"Nullable",
"final",
"Object",
"aObject",
")",
"{",
"return",
"parseShortObj",
"(",
"aObject",
",",
"DEFAULT_RADIX",
",",
"null",
")",
";",
"}"
] | Parse the given {@link Object} as {@link Short} with radix
{@value #DEFAULT_RADIX}.
@param aObject
The object to parse. May be <code>null</code>.
@return <code>null</code> if the object does not represent a valid value. | [
"Parse",
"the",
"given",
"{",
"@link",
"Object",
"}",
"as",
"{",
"@link",
"Short",
"}",
"with",
"radix",
"{",
"@value",
"#DEFAULT_RADIX",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L1259-L1263 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/ChaincodeCollectionConfiguration.java | ChaincodeCollectionConfiguration.fromJsonFile | public static ChaincodeCollectionConfiguration fromJsonFile(File configFile) throws InvalidArgumentException, IOException, ChaincodeCollectionConfigurationException {
"""
Creates a new ChaincodeCollectionConfiguration instance configured with details supplied in a JSON file.
@param configFile The file containin... | java | public static ChaincodeCollectionConfiguration fromJsonFile(File configFile) throws InvalidArgumentException, IOException, ChaincodeCollectionConfigurationException {
return fromFile(configFile, true);
} | [
"public",
"static",
"ChaincodeCollectionConfiguration",
"fromJsonFile",
"(",
"File",
"configFile",
")",
"throws",
"InvalidArgumentException",
",",
"IOException",
",",
"ChaincodeCollectionConfigurationException",
"{",
"return",
"fromFile",
"(",
"configFile",
",",
"true",
")"... | Creates a new ChaincodeCollectionConfiguration instance configured with details supplied in a JSON file.
@param configFile The file containing the network configuration
@return A new ChaincodeCollectionConfiguration instance
@throws InvalidArgumentException
@throws IOException | [
"Creates",
"a",
"new",
"ChaincodeCollectionConfiguration",
"instance",
"configured",
"with",
"details",
"supplied",
"in",
"a",
"JSON",
"file",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/ChaincodeCollectionConfiguration.java#L100-L102 |
plaid/plaid-java | src/main/java/com/plaid/client/internal/gson/Optional.java | Optional.of | public static <T, S extends T> Optional<T> of(S value) {
"""
Create a new Optional containing value.
@param value The value contained.
@return The value wrapped in an Optional.
"""
if (value == null) {
throw new IllegalArgumentException("Optional does not support NULL, use Optional.empty() instea... | java | public static <T, S extends T> Optional<T> of(S value) {
if (value == null) {
throw new IllegalArgumentException("Optional does not support NULL, use Optional.empty() instead.");
}
return new Optional<T>(value);
} | [
"public",
"static",
"<",
"T",
",",
"S",
"extends",
"T",
">",
"Optional",
"<",
"T",
">",
"of",
"(",
"S",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Optional does not support NULL, use O... | Create a new Optional containing value.
@param value The value contained.
@return The value wrapped in an Optional. | [
"Create",
"a",
"new",
"Optional",
"containing",
"value",
"."
] | train | https://github.com/plaid/plaid-java/blob/360f1f8a5178fa0c3c2c2e07a58f8ccec5f33117/src/main/java/com/plaid/client/internal/gson/Optional.java#L26-L32 |
btaz/data-util | src/main/java/com/btaz/util/tf/Template.java | Template.readResource | public static String readResource(String path) {
"""
This method looks for a file on the provided path and returns it as a string
@param path path
@return {@code String} text
"""
try {
File file = ResourceUtil.getResourceFile(path);
return ResourceUtil.readFromFileIntoString(f... | java | public static String readResource(String path) {
try {
File file = ResourceUtil.getResourceFile(path);
return ResourceUtil.readFromFileIntoString(file);
} catch (Exception e) {
throw new DataUtilException("Failed to load resource", e);
}
} | [
"public",
"static",
"String",
"readResource",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"File",
"file",
"=",
"ResourceUtil",
".",
"getResourceFile",
"(",
"path",
")",
";",
"return",
"ResourceUtil",
".",
"readFromFileIntoString",
"(",
"file",
")",
";",
"}"... | This method looks for a file on the provided path and returns it as a string
@param path path
@return {@code String} text | [
"This",
"method",
"looks",
"for",
"a",
"file",
"on",
"the",
"provided",
"path",
"and",
"returns",
"it",
"as",
"a",
"string"
] | train | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/tf/Template.java#L61-L68 |
querydsl/querydsl | querydsl-collections/src/main/java/com/querydsl/collections/AbstractCollQuery.java | AbstractCollQuery.from | public <A> Q from(Path<A> entity, Iterable<? extends A> col) {
"""
Add a query source
@param <A> type of expression
@param entity Path for the source
@param col content of the source
@return current object
"""
iterables.put(entity, col);
getMetadata().addJoin(JoinType.DEFAULT, entity);
... | java | public <A> Q from(Path<A> entity, Iterable<? extends A> col) {
iterables.put(entity, col);
getMetadata().addJoin(JoinType.DEFAULT, entity);
return queryMixin.getSelf();
} | [
"public",
"<",
"A",
">",
"Q",
"from",
"(",
"Path",
"<",
"A",
">",
"entity",
",",
"Iterable",
"<",
"?",
"extends",
"A",
">",
"col",
")",
"{",
"iterables",
".",
"put",
"(",
"entity",
",",
"col",
")",
";",
"getMetadata",
"(",
")",
".",
"addJoin",
... | Add a query source
@param <A> type of expression
@param entity Path for the source
@param col content of the source
@return current object | [
"Add",
"a",
"query",
"source"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-collections/src/main/java/com/querydsl/collections/AbstractCollQuery.java#L76-L80 |
maguro/aunit | junit/src/main/java/com/toolazydogs/aunit/Assert.java | Assert.assertToken | public static void assertToken(int expectedType, String expectedText, LexerResults lexerResults) {
"""
Asserts the token produced by an ANTLR tester.
@param expectedType the expected type of the token.
@param expectedText the expected text of the token.
@param lexerResults the result of {@link Work#scan(Strin... | java | public static void assertToken(int expectedType, String expectedText, LexerResults lexerResults)
{
assertToken(expectedType, expectedText, lexerResults.getToken());
} | [
"public",
"static",
"void",
"assertToken",
"(",
"int",
"expectedType",
",",
"String",
"expectedText",
",",
"LexerResults",
"lexerResults",
")",
"{",
"assertToken",
"(",
"expectedType",
",",
"expectedText",
",",
"lexerResults",
".",
"getToken",
"(",
")",
")",
";"... | Asserts the token produced by an ANTLR tester.
@param expectedType the expected type of the token.
@param expectedText the expected text of the token.
@param lexerResults the result of {@link Work#scan(String)} which will
produce the token to assert. | [
"Asserts",
"the",
"token",
"produced",
"by",
"an",
"ANTLR",
"tester",
"."
] | train | https://github.com/maguro/aunit/blob/1f972e35b28327e5e2e7881befc928df0546d74c/junit/src/main/java/com/toolazydogs/aunit/Assert.java#L74-L77 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.notEmpty | public static void notEmpty(Map<?, ?> map, String message, Object... arguments) {
"""
Asserts that the {@link Map} is not empty.
The assertion holds if and only if the {@link Map} is not {@literal null}
and contains at least 1 key/value mapping.
@param map {@link Map} to evaluate.
@param message {@link Str... | java | public static void notEmpty(Map<?, ?> map, String message, Object... arguments) {
notEmpty(map, new IllegalArgumentException(format(message, arguments)));
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"String",
"message",
",",
"Object",
"...",
"arguments",
")",
"{",
"notEmpty",
"(",
"map",
",",
"new",
"IllegalArgumentException",
"(",
"format",
"(",
"message",
",",... | Asserts that the {@link Map} is not empty.
The assertion holds if and only if the {@link Map} is not {@literal null}
and contains at least 1 key/value mapping.
@param map {@link Map} to evaluate.
@param message {@link String} containing the message using in the {@link IllegalArgumentException} thrown
if the assertion... | [
"Asserts",
"that",
"the",
"{",
"@link",
"Map",
"}",
"is",
"not",
"empty",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L1113-L1115 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/TimeZoneGenericNames.java | TimeZoneGenericNames.getDisplayName | public String getDisplayName(TimeZone tz, GenericNameType type, long date) {
"""
Returns the display name of the time zone for the given name type
at the given date, or null if the display name is not available.
@param tz the time zone
@param type the generic name type - see {@link GenericNameType}
@param da... | java | public String getDisplayName(TimeZone tz, GenericNameType type, long date) {
String name = null;
String tzCanonicalID = null;
switch (type) {
case LOCATION:
tzCanonicalID = ZoneMeta.getCanonicalCLDRID(tz);
if (tzCanonicalID != null) {
name = getGen... | [
"public",
"String",
"getDisplayName",
"(",
"TimeZone",
"tz",
",",
"GenericNameType",
"type",
",",
"long",
"date",
")",
"{",
"String",
"name",
"=",
"null",
";",
"String",
"tzCanonicalID",
"=",
"null",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"LOCATION"... | Returns the display name of the time zone for the given name type
at the given date, or null if the display name is not available.
@param tz the time zone
@param type the generic name type - see {@link GenericNameType}
@param date the date
@return the display name of the time zone for the given name type
at the given ... | [
"Returns",
"the",
"display",
"name",
"of",
"the",
"time",
"zone",
"for",
"the",
"given",
"name",
"type",
"at",
"the",
"given",
"date",
"or",
"null",
"if",
"the",
"display",
"name",
"is",
"not",
"available",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/TimeZoneGenericNames.java#L197-L219 |
hawkular/hawkular-alerts | engine/src/main/java/org/hawkular/alerts/engine/impl/PartitionManagerImpl.java | PartitionManagerImpl.add | private void add(Map<String, List<String>> partition, PartitionEntry entry) {
"""
/*
Auxiliary function to transform a PartitionEntry object into a plain map representation.
"""
String tenantId = entry.getTenantId();
String triggerId = entry.getTriggerId();
if (partition.get(tenantId) ... | java | private void add(Map<String, List<String>> partition, PartitionEntry entry) {
String tenantId = entry.getTenantId();
String triggerId = entry.getTriggerId();
if (partition.get(tenantId) == null) {
partition.put(tenantId, new ArrayList<>());
}
partition.get(tenantId).a... | [
"private",
"void",
"add",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"partition",
",",
"PartitionEntry",
"entry",
")",
"{",
"String",
"tenantId",
"=",
"entry",
".",
"getTenantId",
"(",
")",
";",
"String",
"triggerId",
"=",
"entry",
... | /*
Auxiliary function to transform a PartitionEntry object into a plain map representation. | [
"/",
"*",
"Auxiliary",
"function",
"to",
"transform",
"a",
"PartitionEntry",
"object",
"into",
"a",
"plain",
"map",
"representation",
"."
] | train | https://github.com/hawkular/hawkular-alerts/blob/b4a0c2909b38e03e72cc1828219562ee8fcbf426/engine/src/main/java/org/hawkular/alerts/engine/impl/PartitionManagerImpl.java#L469-L476 |
att/AAF | cadi/core/src/main/java/com/att/cadi/Symm.java | Symm.depass | public long depass(final String password, final OutputStream os) throws IOException {
"""
Decrypt a password
Skip Symm.ENC
@param password
@param os
@return
@throws IOException
"""
int offset = password.startsWith(ENC)?4:0;
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final... | java | public long depass(final String password, final OutputStream os) throws IOException {
int offset = password.startsWith(ENC)?4:0;
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final ByteArrayInputStream bais = new ByteArrayInputStream(password.getBytes(),offset,password.length()-offset);
e... | [
"public",
"long",
"depass",
"(",
"final",
"String",
"password",
",",
"final",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"int",
"offset",
"=",
"password",
".",
"startsWith",
"(",
"ENC",
")",
"?",
"4",
":",
"0",
";",
"final",
"ByteArrayOutputS... | Decrypt a password
Skip Symm.ENC
@param password
@param os
@return
@throws IOException | [
"Decrypt",
"a",
"password"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/Symm.java#L682-L723 |
zeromq/jeromq | src/main/java/org/zeromq/proto/ZPicture.java | ZPicture.recvPicture | @Draft
public Object[] recvPicture(Socket socket, String picture) {
"""
Receive a 'picture' message to the socket (or actor).
@param picture The picture is a string that defines the type of each frame.
This makes it easy to recv a complex multiframe message in
one call. The picture can contain any of th... | java | @Draft
public Object[] recvPicture(Socket socket, String picture)
{
if (!FORMAT.matcher(picture).matches()) {
throw new ZMQException(picture + " is not in expected format " + FORMAT.pattern(), ZError.EPROTO);
}
Object[] elements = new Object[picture.length()];
for (in... | [
"@",
"Draft",
"public",
"Object",
"[",
"]",
"recvPicture",
"(",
"Socket",
"socket",
",",
"String",
"picture",
")",
"{",
"if",
"(",
"!",
"FORMAT",
".",
"matcher",
"(",
"picture",
")",
".",
"matches",
"(",
")",
")",
"{",
"throw",
"new",
"ZMQException",
... | Receive a 'picture' message to the socket (or actor).
@param picture The picture is a string that defines the type of each frame.
This makes it easy to recv a complex multiframe message in
one call. The picture can contain any of these characters,
each corresponding to zero or one elements in the result:
<table>
<ca... | [
"Receive",
"a",
"picture",
"message",
"to",
"the",
"socket",
"(",
"or",
"actor",
")",
"."
] | train | https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/proto/ZPicture.java#L369-L430 |
opentelecoms-org/zrtp-java | src/zorg/platform/j2se/DiffieHellmanSuiteImpl.java | DiffieHellmanSuiteImpl.setAlgorithm | public void setAlgorithm(KeyAgreementType dh) {
"""
DH3K RIM implementation is currently buggy and DOES NOT WORK!!!
"""
log("DH algorithm set: " + getDHName(dhMode) + " -> " + getDHName(dh));
try {
if(dhMode != null && dh.keyType == dhMode.keyType) return;
dhMode = dh;
switch (dhMode.keyType) {
... | java | public void setAlgorithm(KeyAgreementType dh)
{
log("DH algorithm set: " + getDHName(dhMode) + " -> " + getDHName(dh));
try {
if(dhMode != null && dh.keyType == dhMode.keyType) return;
dhMode = dh;
switch (dhMode.keyType) {
case KeyAgreementType.DH_MODE_DH3K:
DHParameterSpec paramSpec =... | [
"public",
"void",
"setAlgorithm",
"(",
"KeyAgreementType",
"dh",
")",
"{",
"log",
"(",
"\"DH algorithm set: \"",
"+",
"getDHName",
"(",
"dhMode",
")",
"+",
"\" -> \"",
"+",
"getDHName",
"(",
"dh",
")",
")",
";",
"try",
"{",
"if",
"(",
"dhMode",
"!=",
"nu... | DH3K RIM implementation is currently buggy and DOES NOT WORK!!! | [
"DH3K",
"RIM",
"implementation",
"is",
"currently",
"buggy",
"and",
"DOES",
"NOT",
"WORK!!!"
] | train | https://github.com/opentelecoms-org/zrtp-java/blob/10a0c77866c5d1b1504df161db9a447f5069ed54/src/zorg/platform/j2se/DiffieHellmanSuiteImpl.java#L176-L203 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DevicesManagementApi.java | DevicesManagementApi.updateDeviceTypesInfo | public DeviceTypesInfoEnvelope updateDeviceTypesInfo(String dtid, DeviceTypesInfo deviceTypeInfo) throws ApiException {
"""
Updates a device type information
Updates a device type information
@param dtid Device type ID. (required)
@param deviceTypeInfo Device type info object to be set (required)
@return Devic... | java | public DeviceTypesInfoEnvelope updateDeviceTypesInfo(String dtid, DeviceTypesInfo deviceTypeInfo) throws ApiException {
ApiResponse<DeviceTypesInfoEnvelope> resp = updateDeviceTypesInfoWithHttpInfo(dtid, deviceTypeInfo);
return resp.getData();
} | [
"public",
"DeviceTypesInfoEnvelope",
"updateDeviceTypesInfo",
"(",
"String",
"dtid",
",",
"DeviceTypesInfo",
"deviceTypeInfo",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"DeviceTypesInfoEnvelope",
">",
"resp",
"=",
"updateDeviceTypesInfoWithHttpInfo",
"(",
"dti... | Updates a device type information
Updates a device type information
@param dtid Device type ID. (required)
@param deviceTypeInfo Device type info object to be set (required)
@return DeviceTypesInfoEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Updates",
"a",
"device",
"type",
"information",
"Updates",
"a",
"device",
"type",
"information"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DevicesManagementApi.java#L1554-L1557 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/array/AWUtil.java | AWUtil.safeWrite | public static <T, U extends T> int safeWrite(ArrayWritable<U> aw, T[] array) {
"""
Writes the complete container data to an array. This method ensures that the array's capacity is not exceeded.
@param aw
the container.
@param array
the array
@return the number of elements copied
"""
int num = ... | java | public static <T, U extends T> int safeWrite(ArrayWritable<U> aw, T[] array) {
int num = aw.size();
if (num <= 0) {
return 0;
}
if (num > array.length) {
num = array.length;
}
aw.writeToArray(0, array, 0, num);
return num;
} | [
"public",
"static",
"<",
"T",
",",
"U",
"extends",
"T",
">",
"int",
"safeWrite",
"(",
"ArrayWritable",
"<",
"U",
">",
"aw",
",",
"T",
"[",
"]",
"array",
")",
"{",
"int",
"num",
"=",
"aw",
".",
"size",
"(",
")",
";",
"if",
"(",
"num",
"<=",
"0... | Writes the complete container data to an array. This method ensures that the array's capacity is not exceeded.
@param aw
the container.
@param array
the array
@return the number of elements copied | [
"Writes",
"the",
"complete",
"container",
"data",
"to",
"an",
"array",
".",
"This",
"method",
"ensures",
"that",
"the",
"array",
"s",
"capacity",
"is",
"not",
"exceeded",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/array/AWUtil.java#L46-L56 |
netty/netty | common/src/main/java/io/netty/util/internal/ThreadLocalRandom.java | ThreadLocalRandom.nextInt | public int nextInt(int least, int bound) {
"""
Returns a pseudorandom, uniformly distributed value between the
given least value (inclusive) and bound (exclusive).
@param least the least value returned
@param bound the upper bound (exclusive)
@throws IllegalArgumentException if least greater than or equal
t... | java | public int nextInt(int least, int bound) {
if (least >= bound) {
throw new IllegalArgumentException();
}
return nextInt(bound - least) + least;
} | [
"public",
"int",
"nextInt",
"(",
"int",
"least",
",",
"int",
"bound",
")",
"{",
"if",
"(",
"least",
">=",
"bound",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"return",
"nextInt",
"(",
"bound",
"-",
"least",
")",
"+",
"l... | Returns a pseudorandom, uniformly distributed value between the
given least value (inclusive) and bound (exclusive).
@param least the least value returned
@param bound the upper bound (exclusive)
@throws IllegalArgumentException if least greater than or equal
to bound
@return the next value | [
"Returns",
"a",
"pseudorandom",
"uniformly",
"distributed",
"value",
"between",
"the",
"given",
"least",
"value",
"(",
"inclusive",
")",
"and",
"bound",
"(",
"exclusive",
")",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/ThreadLocalRandom.java#L296-L301 |
nats-io/java-nats | src/main/java/io/nats/client/NKey.java | NKey.getPublicKey | public char[] getPublicKey() throws GeneralSecurityException, IOException {
"""
@return the encoded public key for this NKey
@throws GeneralSecurityException if there is an encryption problem
@throws IOException if there is a problem encoding the public
key
"""
if (publicKey != null) ... | java | public char[] getPublicKey() throws GeneralSecurityException, IOException {
if (publicKey != null) {
return publicKey;
}
KeyPair keys = getKeyPair();
EdDSAPublicKey pubKey = (EdDSAPublicKey) keys.getPublic();
byte[] pubBytes = pubKey.getAbyte();
return encod... | [
"public",
"char",
"[",
"]",
"getPublicKey",
"(",
")",
"throws",
"GeneralSecurityException",
",",
"IOException",
"{",
"if",
"(",
"publicKey",
"!=",
"null",
")",
"{",
"return",
"publicKey",
";",
"}",
"KeyPair",
"keys",
"=",
"getKeyPair",
"(",
")",
";",
"EdDS... | @return the encoded public key for this NKey
@throws GeneralSecurityException if there is an encryption problem
@throws IOException if there is a problem encoding the public
key | [
"@return",
"the",
"encoded",
"public",
"key",
"for",
"this",
"NKey"
] | train | https://github.com/nats-io/java-nats/blob/5f291048fd30192ba39b3fe2925ecd60aaad6b48/src/main/java/io/nats/client/NKey.java#L698-L708 |
EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/TiffITProfile.java | TiffITProfile.validateIfdSD | private void validateIfdSD(IFD ifd, int p) {
"""
Validate Screened Data image.
@param ifd the ifd
@param p the profile (default = 0, P2 = 2)
"""
IfdTags metadata = ifd.getMetadata();
if (p == 2) {
checkRequiredTag(metadata, "NewSubfileType", 1, new long[]{0});
}
checkRequiredTag(meta... | java | private void validateIfdSD(IFD ifd, int p) {
IfdTags metadata = ifd.getMetadata();
if (p == 2) {
checkRequiredTag(metadata, "NewSubfileType", 1, new long[]{0});
}
checkRequiredTag(metadata, "ImageLength", 1);
checkRequiredTag(metadata, "ImageWidth", 1);
checkRequiredTag(metadata, "BitsPer... | [
"private",
"void",
"validateIfdSD",
"(",
"IFD",
"ifd",
",",
"int",
"p",
")",
"{",
"IfdTags",
"metadata",
"=",
"ifd",
".",
"getMetadata",
"(",
")",
";",
"if",
"(",
"p",
"==",
"2",
")",
"{",
"checkRequiredTag",
"(",
"metadata",
",",
"\"NewSubfileType\"",
... | Validate Screened Data image.
@param ifd the ifd
@param p the profile (default = 0, P2 = 2) | [
"Validate",
"Screened",
"Data",
"image",
"."
] | train | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/TiffITProfile.java#L551-L581 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/crdt/ReplicatedVectorClocks.java | ReplicatedVectorClocks.setReplicatedVectorClocks | public void setReplicatedVectorClocks(String serviceName, String memberUUID, Map<String, VectorClock> vectorClocks) {
"""
Sets the vector clock map for the given {@code serviceName} and
{@code memberUUID}.
The vector clock map contains mappings from CRDT name to the last
successfully replicated CRDT state versi... | java | public void setReplicatedVectorClocks(String serviceName, String memberUUID, Map<String, VectorClock> vectorClocks) {
replicatedVectorClocks.put(new ReplicatedVectorClockId(serviceName, memberUUID),
Collections.unmodifiableMap(vectorClocks));
} | [
"public",
"void",
"setReplicatedVectorClocks",
"(",
"String",
"serviceName",
",",
"String",
"memberUUID",
",",
"Map",
"<",
"String",
",",
"VectorClock",
">",
"vectorClocks",
")",
"{",
"replicatedVectorClocks",
".",
"put",
"(",
"new",
"ReplicatedVectorClockId",
"(",
... | Sets the vector clock map for the given {@code serviceName} and
{@code memberUUID}.
The vector clock map contains mappings from CRDT name to the last
successfully replicated CRDT state version. All CRDTs in this map should
be of the same type.
@param serviceName the service name
@param memberUUID the target member ... | [
"Sets",
"the",
"vector",
"clock",
"map",
"for",
"the",
"given",
"{",
"@code",
"serviceName",
"}",
"and",
"{",
"@code",
"memberUUID",
"}",
".",
"The",
"vector",
"clock",
"map",
"contains",
"mappings",
"from",
"CRDT",
"name",
"to",
"the",
"last",
"successful... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/crdt/ReplicatedVectorClocks.java#L81-L84 |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/ManagementChannelReceiver.java | ManagementChannelReceiver.handlePing | private static void handlePing(final Channel channel, final ManagementProtocolHeader header) throws IOException {
"""
Handle a simple ping request.
@param channel the channel
@param header the protocol header
@throws IOException for any error
"""
final ManagementProtocolHeader response = new Manag... | java | private static void handlePing(final Channel channel, final ManagementProtocolHeader header) throws IOException {
final ManagementProtocolHeader response = new ManagementPongHeader(header.getVersion());
final MessageOutputStream output = channel.writeMessage();
try {
writeHeader(resp... | [
"private",
"static",
"void",
"handlePing",
"(",
"final",
"Channel",
"channel",
",",
"final",
"ManagementProtocolHeader",
"header",
")",
"throws",
"IOException",
"{",
"final",
"ManagementProtocolHeader",
"response",
"=",
"new",
"ManagementPongHeader",
"(",
"header",
".... | Handle a simple ping request.
@param channel the channel
@param header the protocol header
@throws IOException for any error | [
"Handle",
"a",
"simple",
"ping",
"request",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/ManagementChannelReceiver.java#L142-L151 |
opengeospatial/teamengine | teamengine-core/src/main/java/com/occamlab/te/Engine.java | Engine.preload | public void preload(Index index, String sourcesName) throws Exception {
"""
Loads all of the XSL executables. This is a time consuming operation.
@param index
@param sourcesName
A stylesheet reference.
@throws Exception
If the stylesheet fail to compile.
"""
for (String key : index.getTestKeys(... | java | public void preload(Index index, String sourcesName) throws Exception {
for (String key : index.getTestKeys()) {
TestEntry te = index.getTest(key);
loadExecutable(te, sourcesName);
}
for (String key : index.getFunctionKeys()) {
List<FunctionEntry> functi... | [
"public",
"void",
"preload",
"(",
"Index",
"index",
",",
"String",
"sourcesName",
")",
"throws",
"Exception",
"{",
"for",
"(",
"String",
"key",
":",
"index",
".",
"getTestKeys",
"(",
")",
")",
"{",
"TestEntry",
"te",
"=",
"index",
".",
"getTest",
"(",
... | Loads all of the XSL executables. This is a time consuming operation.
@param index
@param sourcesName
A stylesheet reference.
@throws Exception
If the stylesheet fail to compile. | [
"Loads",
"all",
"of",
"the",
"XSL",
"executables",
".",
"This",
"is",
"a",
"time",
"consuming",
"operation",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/Engine.java#L136-L149 |
fernandospr/javapns-jdk16 | src/main/java/javapns/communication/ProxyManager.java | ProxyManager.setJVMProxy | public static void setJVMProxy(String host, String port) {
"""
Configure a proxy to use for HTTPS connections created anywhere in the JVM (not recommended).
@param host the proxyHost
@param port the proxyPort
"""
System.setProperty(JVM_PROXY_HOST_PROPERTY, host);
System.setProperty(JVM_PROXY_PORT_PROPE... | java | public static void setJVMProxy(String host, String port) {
System.setProperty(JVM_PROXY_HOST_PROPERTY, host);
System.setProperty(JVM_PROXY_PORT_PROPERTY, port);
} | [
"public",
"static",
"void",
"setJVMProxy",
"(",
"String",
"host",
",",
"String",
"port",
")",
"{",
"System",
".",
"setProperty",
"(",
"JVM_PROXY_HOST_PROPERTY",
",",
"host",
")",
";",
"System",
".",
"setProperty",
"(",
"JVM_PROXY_PORT_PROPERTY",
",",
"port",
"... | Configure a proxy to use for HTTPS connections created anywhere in the JVM (not recommended).
@param host the proxyHost
@param port the proxyPort | [
"Configure",
"a",
"proxy",
"to",
"use",
"for",
"HTTPS",
"connections",
"created",
"anywhere",
"in",
"the",
"JVM",
"(",
"not",
"recommended",
")",
"."
] | train | https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/communication/ProxyManager.java#L39-L42 |
kazocsaba/matrix | src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java | ImmutableMatrixFactory.createVector | public static ImmutableVector2 createVector(final double x, final double y) {
"""
Creates a new immutable 2D column vector.
@param x the x coordinate of the new vector
@param y the y coordinate of the new vector
@return the new vector
"""
return new ImmutableVector2(new ImmutableData(2, 1) {
@Overrid... | java | public static ImmutableVector2 createVector(final double x, final double y) {
return new ImmutableVector2(new ImmutableData(2, 1) {
@Override
public double getQuick(int row, int col) {
if (row == 0)
return x;
else
return y;
}
});
} | [
"public",
"static",
"ImmutableVector2",
"createVector",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"y",
")",
"{",
"return",
"new",
"ImmutableVector2",
"(",
"new",
"ImmutableData",
"(",
"2",
",",
"1",
")",
"{",
"@",
"Override",
"public",
"double",
... | Creates a new immutable 2D column vector.
@param x the x coordinate of the new vector
@param y the y coordinate of the new vector
@return the new vector | [
"Creates",
"a",
"new",
"immutable",
"2D",
"column",
"vector",
"."
] | train | https://github.com/kazocsaba/matrix/blob/018570db945fe616b25606fe605fa6e0c180ab5b/src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java#L24-L34 |
akarnokd/akarnokd-xml | src/main/java/hu/akarnokd/xml/XNElement.java | XNElement.get | public String get(String attributeName) {
"""
Retrieve the first attribute which has the given local attribute name.
@param attributeName the attribute name
@return the attribute value or null if no such attribute
"""
// check first for a namespace-less attribute
String attr = attributes.get(... | java | public String get(String attributeName) {
// check first for a namespace-less attribute
String attr = attributes.get(new XAttributeName(attributeName, null, null));
if (attr == null) {
// find any attribute ignoring namespace
for (XAttributeName n : attributes.keySet()) {... | [
"public",
"String",
"get",
"(",
"String",
"attributeName",
")",
"{",
"// check first for a namespace-less attribute",
"String",
"attr",
"=",
"attributes",
".",
"get",
"(",
"new",
"XAttributeName",
"(",
"attributeName",
",",
"null",
",",
"null",
")",
")",
";",
"i... | Retrieve the first attribute which has the given local attribute name.
@param attributeName the attribute name
@return the attribute value or null if no such attribute | [
"Retrieve",
"the",
"first",
"attribute",
"which",
"has",
"the",
"given",
"local",
"attribute",
"name",
"."
] | train | https://github.com/akarnokd/akarnokd-xml/blob/57466a5a9cb455a13d7121557c165287b31ee870/src/main/java/hu/akarnokd/xml/XNElement.java#L667-L679 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.