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 |
|---|---|---|---|---|---|---|---|---|---|---|
ktoso/janbanery | janbanery-core/src/main/java/pl/project13/janbanery/core/rest/AsyncHttpClientRestClient.java | AsyncHttpClientRestClient.doGet | @Override
@SuppressWarnings("unchecked")
public <T> T doGet(String url, Type returnType) throws ServerCommunicationException {
"""
Delegate to {@link AsyncHttpClientRestClient#doGet(String)} and also use {@link Gson} to parse the returned json
into the requested object
@param url url to call
@param... | java | @Override
@SuppressWarnings("unchecked")
public <T> T doGet(String url, Type returnType) throws ServerCommunicationException {
RestClientResponse response = doGet(url);
String responseBody = response.getResponseBody();
return (T) gson.fromJson(responseBody, returnType);
} | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"doGet",
"(",
"String",
"url",
",",
"Type",
"returnType",
")",
"throws",
"ServerCommunicationException",
"{",
"RestClientResponse",
"response",
"=",
"doGet",
"(",
... | Delegate to {@link AsyncHttpClientRestClient#doGet(String)} and also use {@link Gson} to parse the returned json
into the requested object
@param url url to call
@param returnType taskType to parse the returned json into
@param <T> the return taskType, should match returnType
@return the KanbaneryResourc... | [
"Delegate",
"to",
"{",
"@link",
"AsyncHttpClientRestClient#doGet",
"(",
"String",
")",
"}",
"and",
"also",
"use",
"{",
"@link",
"Gson",
"}",
"to",
"parse",
"the",
"returned",
"json",
"into",
"the",
"requested",
"object"
] | train | https://github.com/ktoso/janbanery/blob/cd77b774814c7fbb2a0c9c55d4c3f7e76affa636/janbanery-core/src/main/java/pl/project13/janbanery/core/rest/AsyncHttpClientRestClient.java#L134-L141 |
jglobus/JGlobus | axis/src/main/java/org/globus/axis/transport/HTTPUtils.java | HTTPUtils.setCloseConnection | public static void setCloseConnection(Stub stub, boolean close) {
"""
Sets on option on the stub to close the connection
after receiving the reply (connection will not
be reused).
@param stub The stub to set the property on
@param close If true, connection close will be requested. Otherwise
connection close... | java | public static void setCloseConnection(Stub stub, boolean close) {
Hashtable headers = getRequestHeaders(stub);
if (close) {
headers.put(HTTPConstants.HEADER_CONNECTION,
HTTPConstants.HEADER_CONNECTION_CLOSE);
} else {
headers.remove(HTTPConstants.H... | [
"public",
"static",
"void",
"setCloseConnection",
"(",
"Stub",
"stub",
",",
"boolean",
"close",
")",
"{",
"Hashtable",
"headers",
"=",
"getRequestHeaders",
"(",
"stub",
")",
";",
"if",
"(",
"close",
")",
"{",
"headers",
".",
"put",
"(",
"HTTPConstants",
".... | Sets on option on the stub to close the connection
after receiving the reply (connection will not
be reused).
@param stub The stub to set the property on
@param close If true, connection close will be requested. Otherwise
connection close will not be requested. | [
"Sets",
"on",
"option",
"on",
"the",
"stub",
"to",
"close",
"the",
"connection",
"after",
"receiving",
"the",
"reply",
"(",
"connection",
"will",
"not",
"be",
"reused",
")",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/axis/src/main/java/org/globus/axis/transport/HTTPUtils.java#L51-L59 |
lecho/hellocharts-android | hellocharts-library/src/lecho/lib/hellocharts/renderer/BubbleChartRenderer.java | BubbleChartRenderer.processBubble | private float processBubble(BubbleValue bubbleValue, PointF point) {
"""
Calculate bubble radius and center x and y coordinates. Center x and x will be stored in point parameter, radius
will be returned as float value.
"""
final float rawX = computator.computeRawX(bubbleValue.getX());
final fl... | java | private float processBubble(BubbleValue bubbleValue, PointF point) {
final float rawX = computator.computeRawX(bubbleValue.getX());
final float rawY = computator.computeRawY(bubbleValue.getY());
float radius = (float) Math.sqrt(Math.abs(bubbleValue.getZ()) / Math.PI);
float rawRadius;
... | [
"private",
"float",
"processBubble",
"(",
"BubbleValue",
"bubbleValue",
",",
"PointF",
"point",
")",
"{",
"final",
"float",
"rawX",
"=",
"computator",
".",
"computeRawX",
"(",
"bubbleValue",
".",
"getX",
"(",
")",
")",
";",
"final",
"float",
"rawY",
"=",
"... | Calculate bubble radius and center x and y coordinates. Center x and x will be stored in point parameter, radius
will be returned as float value. | [
"Calculate",
"bubble",
"radius",
"and",
"center",
"x",
"and",
"y",
"coordinates",
".",
"Center",
"x",
"and",
"x",
"will",
"be",
"stored",
"in",
"point",
"parameter",
"radius",
"will",
"be",
"returned",
"as",
"float",
"value",
"."
] | train | https://github.com/lecho/hellocharts-android/blob/c41419c9afa097452dee823c7eba0e5136aa96bd/hellocharts-library/src/lecho/lib/hellocharts/renderer/BubbleChartRenderer.java#L240-L262 |
ops4j/org.ops4j.pax.swissbox | pax-swissbox-bnd/src/main/java/org/ops4j/pax/swissbox/bnd/BndUtils.java | BndUtils.parseInstructions | public static Properties parseInstructions( final String query )
throws MalformedURLException {
"""
Parses bnd instructions out of an url query string.
@param query query part of an url.
@return parsed instructions as properties
@throws java.net.MalformedURLException if provided path does not comp... | java | public static Properties parseInstructions( final String query )
throws MalformedURLException
{
final Properties instructions = new Properties();
if( query != null )
{
try
{
// just ignore for the moment and try out if we have valid properties ... | [
"public",
"static",
"Properties",
"parseInstructions",
"(",
"final",
"String",
"query",
")",
"throws",
"MalformedURLException",
"{",
"final",
"Properties",
"instructions",
"=",
"new",
"Properties",
"(",
")",
";",
"if",
"(",
"query",
"!=",
"null",
")",
"{",
"tr... | Parses bnd instructions out of an url query string.
@param query query part of an url.
@return parsed instructions as properties
@throws java.net.MalformedURLException if provided path does not comply to syntax. | [
"Parses",
"bnd",
"instructions",
"out",
"of",
"an",
"url",
"query",
"string",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-bnd/src/main/java/org/ops4j/pax/swissbox/bnd/BndUtils.java#L275-L316 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.setCMYKColorFill | public void setCMYKColorFill(int cyan, int magenta, int yellow, int black) {
"""
Changes the current color for filling paths (device dependent colors!).
<P>
Sets the color space to <B>DeviceCMYK</B> (or the <B>DefaultCMYK</B> color space),
and sets the color to use for filling paths.</P>
<P>
This method is de... | java | public void setCMYKColorFill(int cyan, int magenta, int yellow, int black) {
content.append((float)(cyan & 0xFF) / 0xFF);
content.append(' ');
content.append((float)(magenta & 0xFF) / 0xFF);
content.append(' ');
content.append((float)(yellow & 0xFF) / 0xFF);
content.appen... | [
"public",
"void",
"setCMYKColorFill",
"(",
"int",
"cyan",
",",
"int",
"magenta",
",",
"int",
"yellow",
",",
"int",
"black",
")",
"{",
"content",
".",
"append",
"(",
"(",
"float",
")",
"(",
"cyan",
"&",
"0xFF",
")",
"/",
"0xFF",
")",
";",
"content",
... | Changes the current color for filling paths (device dependent colors!).
<P>
Sets the color space to <B>DeviceCMYK</B> (or the <B>DefaultCMYK</B> color space),
and sets the color to use for filling paths.</P>
<P>
This method is described in the 'Portable Document Format Reference Manual version 1.3'
section 8.5.2.1 (pag... | [
"Changes",
"the",
"current",
"color",
"for",
"filling",
"paths",
"(",
"device",
"dependent",
"colors!",
")",
".",
"<P",
">",
"Sets",
"the",
"color",
"space",
"to",
"<B",
">",
"DeviceCMYK<",
"/",
"B",
">",
"(",
"or",
"the",
"<B",
">",
"DefaultCMYK<",
"/... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L2108-L2117 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createStrictMock | public static <T> T createStrictMock(Class<T> type, ConstructorArgs constructorArgs, Method... methods) {
"""
Creates a strict mock object that supports mocking of final and native
methods and invokes a specific constructor.
@param <T> the type of the mock object
@param type the type of... | java | public static <T> T createStrictMock(Class<T> type, ConstructorArgs constructorArgs, Method... methods) {
return doMock(type, false, new StrictMockStrategy(), constructorArgs, methods);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"createStrictMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"ConstructorArgs",
"constructorArgs",
",",
"Method",
"...",
"methods",
")",
"{",
"return",
"doMock",
"(",
"type",
",",
"false",
",",
"new",
"StrictMockStr... | Creates a strict mock object that supports mocking of final and native
methods and invokes a specific constructor.
@param <T> the type of the mock object
@param type the type of the mock object
@param constructorArgs The constructor arguments that will be used to invoke a
special constructor.
@p... | [
"Creates",
"a",
"strict",
"mock",
"object",
"that",
"supports",
"mocking",
"of",
"final",
"and",
"native",
"methods",
"and",
"invokes",
"a",
"specific",
"constructor",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L190-L192 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java | PageInBrowserStats.getAverageDOMLoadTime | public double getAverageDOMLoadTime(final String intervalName, final TimeUnit unit) {
"""
Returns the average DOM load time for given interval and {@link TimeUnit}.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return average DOM load time
"""
return unit.transformMillis... | java | public double getAverageDOMLoadTime(final String intervalName, final TimeUnit unit) {
return unit.transformMillis(totalDomLoadTime.getValueAsLong(intervalName)) / numberOfLoads.getValueAsDouble(intervalName);
} | [
"public",
"double",
"getAverageDOMLoadTime",
"(",
"final",
"String",
"intervalName",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"return",
"unit",
".",
"transformMillis",
"(",
"totalDomLoadTime",
".",
"getValueAsLong",
"(",
"intervalName",
")",
")",
"/",
"numberOf... | Returns the average DOM load time for given interval and {@link TimeUnit}.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return average DOM load time | [
"Returns",
"the",
"average",
"DOM",
"load",
"time",
"for",
"given",
"interval",
"and",
"{",
"@link",
"TimeUnit",
"}",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java#L210-L212 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java | BasicAtomGenerator.invisibleCarbon | protected boolean invisibleCarbon(IAtom atom, IAtomContainer atomContainer, RendererModel model) {
"""
Checks an atom to see if it is an 'invisible carbon' - that is, it is:
a) a carbon atom and b) this carbon should not be shown.
@param atom the atom to check
@param atomContainer the atom container the atom ... | java | protected boolean invisibleCarbon(IAtom atom, IAtomContainer atomContainer, RendererModel model) {
return isCarbon(atom) && !showCarbon(atom, atomContainer, model);
} | [
"protected",
"boolean",
"invisibleCarbon",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"atomContainer",
",",
"RendererModel",
"model",
")",
"{",
"return",
"isCarbon",
"(",
"atom",
")",
"&&",
"!",
"showCarbon",
"(",
"atom",
",",
"atomContainer",
",",
"model",
... | Checks an atom to see if it is an 'invisible carbon' - that is, it is:
a) a carbon atom and b) this carbon should not be shown.
@param atom the atom to check
@param atomContainer the atom container the atom is part of
@param model the renderer model
@return true if this atom should not be shown | [
"Checks",
"an",
"atom",
"to",
"see",
"if",
"it",
"is",
"an",
"invisible",
"carbon",
"-",
"that",
"is",
"it",
"is",
":",
"a",
")",
"a",
"carbon",
"atom",
"and",
"b",
")",
"this",
"carbon",
"should",
"not",
"be",
"shown",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java#L275-L277 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_statistics_raid_unit_GET | public OvhRtmRaid serviceName_statistics_raid_unit_GET(String serviceName, String unit) throws IOException {
"""
Get this object properties
REST: GET /dedicated/server/{serviceName}/statistics/raid/{unit}
@param serviceName [required] The internal name of your dedicated server
@param unit [required] Raid unit... | java | public OvhRtmRaid serviceName_statistics_raid_unit_GET(String serviceName, String unit) throws IOException {
String qPath = "/dedicated/server/{serviceName}/statistics/raid/{unit}";
StringBuilder sb = path(qPath, serviceName, unit);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, O... | [
"public",
"OvhRtmRaid",
"serviceName_statistics_raid_unit_GET",
"(",
"String",
"serviceName",
",",
"String",
"unit",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/statistics/raid/{unit}\"",
";",
"StringBuilder",
"sb",
"=",
"pa... | Get this object properties
REST: GET /dedicated/server/{serviceName}/statistics/raid/{unit}
@param serviceName [required] The internal name of your dedicated server
@param unit [required] Raid unit | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1460-L1465 |
mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java | LBFGS_port.QUARD_MINIMIZER | private static double QUARD_MINIMIZER(double qm, double u, double fu, double du, double v, double fv) {
"""
Find a minimizer of an interpolated quadratic function.
@param qm The minimizer of the interpolated quadratic.
@param u The value of one point, u.
@param fu The value of f(u).
@param ... | java | private static double QUARD_MINIMIZER(double qm, double u, double fu, double du, double v, double fv) {
double a, d, gamma, theta, p, q, r, s;
a = (v) - (u);
(qm) = (u) + (du) / (((fu) - (fv)) / a + (du)) / 2 * a;
return qm;
} | [
"private",
"static",
"double",
"QUARD_MINIMIZER",
"(",
"double",
"qm",
",",
"double",
"u",
",",
"double",
"fu",
",",
"double",
"du",
",",
"double",
"v",
",",
"double",
"fv",
")",
"{",
"double",
"a",
",",
"d",
",",
"gamma",
",",
"theta",
",",
"p",
"... | Find a minimizer of an interpolated quadratic function.
@param qm The minimizer of the interpolated quadratic.
@param u The value of one point, u.
@param fu The value of f(u).
@param du The value of f'(u).
@param v The value of another point, v.
@param fv The value of f(v). | [
"Find",
"a",
"minimizer",
"of",
"an",
"interpolated",
"quadratic",
"function",
"."
] | train | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java#L1851-L1856 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.createIntrinsic | public static CameraPinholeBrown createIntrinsic(int width, int height, double hfov) {
"""
Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics.
The focal length is assumed to be the same for x and y.
@param width Image width
@param height Image height
@p... | java | public static CameraPinholeBrown createIntrinsic(int width, int height, double hfov) {
CameraPinholeBrown intrinsic = new CameraPinholeBrown();
intrinsic.width = width;
intrinsic.height = height;
intrinsic.cx = width / 2;
intrinsic.cy = height / 2;
intrinsic.fx = intrinsic.cx / Math.tan(UtilAngle.degreeToRa... | [
"public",
"static",
"CameraPinholeBrown",
"createIntrinsic",
"(",
"int",
"width",
",",
"int",
"height",
",",
"double",
"hfov",
")",
"{",
"CameraPinholeBrown",
"intrinsic",
"=",
"new",
"CameraPinholeBrown",
"(",
")",
";",
"intrinsic",
".",
"width",
"=",
"width",
... | Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics.
The focal length is assumed to be the same for x and y.
@param width Image width
@param height Image height
@param hfov Horizontal FOV in degrees
@return guess camera parameters | [
"Creates",
"a",
"set",
"of",
"intrinsic",
"parameters",
"without",
"distortion",
"for",
"a",
"camera",
"with",
"the",
"specified",
"characteristics",
".",
"The",
"focal",
"length",
"is",
"assumed",
"to",
"be",
"the",
"same",
"for",
"x",
"and",
"y",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L118-L128 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.fundamentalToEssential | public static DMatrixRMaj fundamentalToEssential( DMatrixRMaj F , DMatrixRMaj K , @Nullable DMatrixRMaj outputE ) {
"""
Given the calibration matrix, convert the fundamental matrix into an essential matrix. E = K'*F*k. The
singular values of the resulting E matrix are forced to be [1,1,0]
@param F (Input) Fund... | java | public static DMatrixRMaj fundamentalToEssential( DMatrixRMaj F , DMatrixRMaj K , @Nullable DMatrixRMaj outputE ) {
if( outputE == null )
outputE = new DMatrixRMaj(3,3);
PerspectiveOps.multTranA(K,F,K,outputE);
// this is unlikely to be a perfect essential matrix. reduce the error by enforcing essential cons... | [
"public",
"static",
"DMatrixRMaj",
"fundamentalToEssential",
"(",
"DMatrixRMaj",
"F",
",",
"DMatrixRMaj",
"K",
",",
"@",
"Nullable",
"DMatrixRMaj",
"outputE",
")",
"{",
"if",
"(",
"outputE",
"==",
"null",
")",
"outputE",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
... | Given the calibration matrix, convert the fundamental matrix into an essential matrix. E = K'*F*k. The
singular values of the resulting E matrix are forced to be [1,1,0]
@param F (Input) Fundamental matrix. 3x3
@param K (Input) Calibration matrix (3x3)
@param outputE (Output) Found essential matrix
@return Essential m... | [
"Given",
"the",
"calibration",
"matrix",
"convert",
"the",
"fundamental",
"matrix",
"into",
"an",
"essential",
"matrix",
".",
"E",
"=",
"K",
"*",
"F",
"*",
"k",
".",
"The",
"singular",
"values",
"of",
"the",
"resulting",
"E",
"matrix",
"are",
"forced",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L946-L970 |
tango-controls/JTango | server/src/main/java/org/tango/logging/LoggingManager.java | LoggingManager.addFileAppender | public void addFileAppender(final String fileName, final String deviceName) throws DevFailed {
"""
Add an file appender for a device
@param fileName
@param deviceName
@throws DevFailed
"""
if (rootLoggerBack != null) {
logger.debug("add file appender of {} in {}", deviceName, fileName)... | java | public void addFileAppender(final String fileName, final String deviceName) throws DevFailed {
if (rootLoggerBack != null) {
logger.debug("add file appender of {} in {}", deviceName, fileName);
final String deviceNameLower = deviceName.toLowerCase(Locale.ENGLISH);
final File ... | [
"public",
"void",
"addFileAppender",
"(",
"final",
"String",
"fileName",
",",
"final",
"String",
"deviceName",
")",
"throws",
"DevFailed",
"{",
"if",
"(",
"rootLoggerBack",
"!=",
"null",
")",
"{",
"logger",
".",
"debug",
"(",
"\"add file appender of {} in {}\"",
... | Add an file appender for a device
@param fileName
@param deviceName
@throws DevFailed | [
"Add",
"an",
"file",
"appender",
"for",
"a",
"device"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/logging/LoggingManager.java#L197-L257 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java | CloudStorageFileSystemProvider.newFileChannel | @Override
public FileChannel newFileChannel(
Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException {
"""
Open a file for reading OR writing. The {@link FileChannel} that is returned will only allow
reads or writes depending on the {@link OpenOption}s that are specifie... | java | @Override
public FileChannel newFileChannel(
Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException {
checkNotNull(path);
initStorage();
CloudStorageUtil.checkNotNullArray(attrs);
if (options.contains(StandardOpenOption.CREATE_NEW)) {
Files.createFile(p... | [
"@",
"Override",
"public",
"FileChannel",
"newFileChannel",
"(",
"Path",
"path",
",",
"Set",
"<",
"?",
"extends",
"OpenOption",
">",
"options",
",",
"FileAttribute",
"<",
"?",
">",
"...",
"attrs",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"path... | Open a file for reading OR writing. The {@link FileChannel} that is returned will only allow
reads or writes depending on the {@link OpenOption}s that are specified. If any of the
following have been specified, the {@link FileChannel} will be write-only: {@link
StandardOpenOption#CREATE}
<ul>
<li>{@link StandardOpenOp... | [
"Open",
"a",
"file",
"for",
"reading",
"OR",
"writing",
".",
"The",
"{",
"@link",
"FileChannel",
"}",
"that",
"is",
"returned",
"will",
"only",
"allow",
"reads",
"or",
"writes",
"depending",
"on",
"the",
"{",
"@link",
"OpenOption",
"}",
"s",
"that",
"are... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java#L330-L349 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java | FileUtils.loadStringToFileListMultimap | public static ImmutableListMultimap<String, File> loadStringToFileListMultimap(
final CharSource source) throws IOException {
"""
Reads an {@link ImmutableListMultimap} from a {@link CharSource}, where each line is a
key, a tab character ("\t"), and a value. Blank lines and lines beginning with "#" are igno... | java | public static ImmutableListMultimap<String, File> loadStringToFileListMultimap(
final CharSource source) throws IOException {
return loadMultimap(source, Functions.<String>identity(), FileFunction.INSTANCE,
IsCommentLine.INSTANCE);
} | [
"public",
"static",
"ImmutableListMultimap",
"<",
"String",
",",
"File",
">",
"loadStringToFileListMultimap",
"(",
"final",
"CharSource",
"source",
")",
"throws",
"IOException",
"{",
"return",
"loadMultimap",
"(",
"source",
",",
"Functions",
".",
"<",
"String",
">... | Reads an {@link ImmutableListMultimap} from a {@link CharSource}, where each line is a
key, a tab character ("\t"), and a value. Blank lines and lines beginning with "#" are ignored. | [
"Reads",
"an",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java#L292-L296 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsRenderer.java | CmsRenderer.renderDescription | private void renderDescription(CmsTabInfo tabInfo, Panel descriptionParent) {
"""
Renders the tab description in a given panel.<p>
@param tabInfo the tab info object
@param descriptionParent the panel in which to render the tab description
"""
if (tabInfo.getDescription() != null) {
... | java | private void renderDescription(CmsTabInfo tabInfo, Panel descriptionParent) {
if (tabInfo.getDescription() != null) {
HTML descriptionLabel = new HTML();
descriptionLabel.addStyleName(I_CmsLayoutBundle.INSTANCE.form().tabDescription());
if (!tabInfo.getDescription().sta... | [
"private",
"void",
"renderDescription",
"(",
"CmsTabInfo",
"tabInfo",
",",
"Panel",
"descriptionParent",
")",
"{",
"if",
"(",
"tabInfo",
".",
"getDescription",
"(",
")",
"!=",
"null",
")",
"{",
"HTML",
"descriptionLabel",
"=",
"new",
"HTML",
"(",
")",
";",
... | Renders the tab description in a given panel.<p>
@param tabInfo the tab info object
@param descriptionParent the panel in which to render the tab description | [
"Renders",
"the",
"tab",
"description",
"in",
"a",
"given",
"panel",
".",
"<p",
">",
"@param",
"tabInfo",
"the",
"tab",
"info",
"object"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsRenderer.java#L899-L911 |
validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.pushCharArray | private void pushCharArray(String ename, char[] ch, int start, int length)
throws SAXException {
"""
Push a new internal input source.
<p>
This method is useful for expanding an internal entity, or for unreading
a string of characters. It creates a new readBuffer containing the
characters in the ar... | java | private void pushCharArray(String ename, char[] ch, int start, int length)
throws SAXException {
// Push the existing status
pushInput(ename);
if ((ename != null) && doReport) {
dataBufferFlush();
handler.startInternalEntity(ename);
}
sourceTyp... | [
"private",
"void",
"pushCharArray",
"(",
"String",
"ename",
",",
"char",
"[",
"]",
"ch",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"SAXException",
"{",
"// Push the existing status",
"pushInput",
"(",
"ename",
")",
";",
"if",
"(",
"(",
"ena... | Push a new internal input source.
<p>
This method is useful for expanding an internal entity, or for unreading
a string of characters. It creates a new readBuffer containing the
characters in the array, instead of characters converted from an input
byte stream.
@param ch
The char array to push.
@see #pushString
@see #... | [
"Push",
"a",
"new",
"internal",
"input",
"source",
".",
"<p",
">",
"This",
"method",
"is",
"useful",
"for",
"expanding",
"an",
"internal",
"entity",
"or",
"for",
"unreading",
"a",
"string",
"of",
"characters",
".",
"It",
"creates",
"a",
"new",
"readBuffer"... | train | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L4152-L4165 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java | ScriptRequestState.getTagIdMapping | private void getTagIdMapping(String tagId, String value, AbstractRenderAppender results) {
"""
This method will write out a tagId map entry for when there
isn't a ScriptContainer defined.
@param tagId the tagId value
@param value the "real" value of the written out
@param results the JavaScript that will b... | java | private void getTagIdMapping(String tagId, String value, AbstractRenderAppender results)
{
if ((_javaScriptFeatures & CoreScriptFeature.ALLOCATE_LEGACY.value) == 0) {
_javaScriptFeatures |= CoreScriptFeature.ALLOCATE_LEGACY.value;
String s = getString("singleIdMappingTable", new Obje... | [
"private",
"void",
"getTagIdMapping",
"(",
"String",
"tagId",
",",
"String",
"value",
",",
"AbstractRenderAppender",
"results",
")",
"{",
"if",
"(",
"(",
"_javaScriptFeatures",
"&",
"CoreScriptFeature",
".",
"ALLOCATE_LEGACY",
".",
"value",
")",
"==",
"0",
")",
... | This method will write out a tagId map entry for when there
isn't a ScriptContainer defined.
@param tagId the tagId value
@param value the "real" value of the written out
@param results the JavaScript that will be output | [
"This",
"method",
"will",
"write",
"out",
"a",
"tagId",
"map",
"entry",
"for",
"when",
"there",
"isn",
"t",
"a",
"ScriptContainer",
"defined",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java#L333-L347 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/AttributeConstraintRule.java | AttributeConstraintRule.validatePattern | private boolean validatePattern(Object validationObject, Annotation annotate) {
"""
Checks whether the given string is a valid pattern or not
@param validationObject
@param annotate
@return
"""
if (checkNullObject(validationObject))
{
return true;
}
java.util.r... | java | private boolean validatePattern(Object validationObject, Annotation annotate)
{
if (checkNullObject(validationObject))
{
return true;
}
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile(((Pattern) annotate).regexp(),
((Pattern) annotate).f... | [
"private",
"boolean",
"validatePattern",
"(",
"Object",
"validationObject",
",",
"Annotation",
"annotate",
")",
"{",
"if",
"(",
"checkNullObject",
"(",
"validationObject",
")",
")",
"{",
"return",
"true",
";",
"}",
"java",
".",
"util",
".",
"regex",
".",
"Pa... | Checks whether the given string is a valid pattern or not
@param validationObject
@param annotate
@return | [
"Checks",
"whether",
"the",
"given",
"string",
"is",
"a",
"valid",
"pattern",
"or",
"not"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/AttributeConstraintRule.java#L247-L264 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModulePreviewApiKeys.java | ModulePreviewApiKeys.fetchOne | public CMAPreviewApiKey fetchOne(String spaceId, String keyId) {
"""
Fetch only one preview api key.
<p>
This method will override the configuration specified through
{@link CMAClient.Builder#setSpaceId(String)} and will ignore
{@link CMAClient.Builder#setEnvironmentId(String)}.
@param spaceId the id of the... | java | public CMAPreviewApiKey fetchOne(String spaceId, String keyId) {
assertNotNull(spaceId, "entry");
assertNotNull(keyId, "keyId");
return service.fetchOne(spaceId, keyId).blockingFirst();
} | [
"public",
"CMAPreviewApiKey",
"fetchOne",
"(",
"String",
"spaceId",
",",
"String",
"keyId",
")",
"{",
"assertNotNull",
"(",
"spaceId",
",",
"\"entry\"",
")",
";",
"assertNotNull",
"(",
"keyId",
",",
"\"keyId\"",
")",
";",
"return",
"service",
".",
"fetchOne",
... | Fetch only one preview api key.
<p>
This method will override the configuration specified through
{@link CMAClient.Builder#setSpaceId(String)} and will ignore
{@link CMAClient.Builder#setEnvironmentId(String)}.
@param spaceId the id of the space this is valid on.
@param keyId the id of the key itself.
@return one pr... | [
"Fetch",
"only",
"one",
"preview",
"api",
"key",
".",
"<p",
">",
"This",
"method",
"will",
"override",
"the",
"configuration",
"specified",
"through",
"{",
"@link",
"CMAClient",
".",
"Builder#setSpaceId",
"(",
"String",
")",
"}",
"and",
"will",
"ignore",
"{"... | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModulePreviewApiKeys.java#L119-L124 |
roboconf/roboconf-platform | core/roboconf-dm-rest-services/src/main/java/net/roboconf/dm/rest/services/internal/resources/impl/DebugResource.java | DebugResource.createDiagnostic | Diagnostic createDiagnostic( Instance instance ) {
"""
Creates a diagnostic for an instance.
@param instance a non-null instance
@return a non-null diagnostic
"""
Diagnostic result = new Diagnostic( InstanceHelpers.computeInstancePath( instance ));
for( Map.Entry<String,Boolean> entry : ComponentHelpers... | java | Diagnostic createDiagnostic( Instance instance ) {
Diagnostic result = new Diagnostic( InstanceHelpers.computeInstancePath( instance ));
for( Map.Entry<String,Boolean> entry : ComponentHelpers.findComponentDependenciesFor( instance.getComponent()).entrySet()) {
String facetOrComponentName = entry.getKey();
... | [
"Diagnostic",
"createDiagnostic",
"(",
"Instance",
"instance",
")",
"{",
"Diagnostic",
"result",
"=",
"new",
"Diagnostic",
"(",
"InstanceHelpers",
".",
"computeInstancePath",
"(",
"instance",
")",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
... | Creates a diagnostic for an instance.
@param instance a non-null instance
@return a non-null diagnostic | [
"Creates",
"a",
"diagnostic",
"for",
"an",
"instance",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-rest-services/src/main/java/net/roboconf/dm/rest/services/internal/resources/impl/DebugResource.java#L184-L198 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/ConnectionManagerFactory.java | ConnectionManagerFactory.createConnectionManager | public static ConnectionManager createConnectionManager(TransactionSupportEnum tse,
ManagedConnectionFactory mcf,
CachedConnectionManager ccm,
... | java | public static ConnectionManager createConnectionManager(TransactionSupportEnum tse,
ManagedConnectionFactory mcf,
CachedConnectionManager ccm,
... | [
"public",
"static",
"ConnectionManager",
"createConnectionManager",
"(",
"TransactionSupportEnum",
"tse",
",",
"ManagedConnectionFactory",
"mcf",
",",
"CachedConnectionManager",
"ccm",
",",
"ConnectionManagerConfiguration",
"cmc",
",",
"TransactionIntegration",
"ti",
")",
"{"... | Create a connection manager
@param tse The transaction support level
@param mcf The managed connection factory
@param ccm The cached connection manager
@param cmc The connection manager configuration
@param ti The transaction integration
@return The connection manager | [
"Create",
"a",
"connection",
"manager"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/ConnectionManagerFactory.java#L53-L71 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hllmap/CouponTraverseMap.java | CouponTraverseMap.findKey | @Override
int findKey(final byte[] key) {
"""
Returns entryIndex if the given key is found. If not found, returns one's complement entryIndex
of an empty slot for insertion, which may be over a deleted key.
@param key the given key
@return the entryIndex
"""
final long[] hash = MurmurHash3.hash(key, S... | java | @Override
int findKey(final byte[] key) {
final long[] hash = MurmurHash3.hash(key, SEED);
int entryIndex = getIndex(hash[0], tableEntries_);
int firstDeletedIndex = -1;
final int loopIndex = entryIndex;
do {
if (isBitClear(stateArr_, entryIndex)) {
return firstDeletedIndex == -1 ? ~... | [
"@",
"Override",
"int",
"findKey",
"(",
"final",
"byte",
"[",
"]",
"key",
")",
"{",
"final",
"long",
"[",
"]",
"hash",
"=",
"MurmurHash3",
".",
"hash",
"(",
"key",
",",
"SEED",
")",
";",
"int",
"entryIndex",
"=",
"getIndex",
"(",
"hash",
"[",
"0",
... | Returns entryIndex if the given key is found. If not found, returns one's complement entryIndex
of an empty slot for insertion, which may be over a deleted key.
@param key the given key
@return the entryIndex | [
"Returns",
"entryIndex",
"if",
"the",
"given",
"key",
"is",
"found",
".",
"If",
"not",
"found",
"returns",
"one",
"s",
"complement",
"entryIndex",
"of",
"an",
"empty",
"slot",
"for",
"insertion",
"which",
"may",
"be",
"over",
"a",
"deleted",
"key",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hllmap/CouponTraverseMap.java#L113-L131 |
dropwizard/dropwizard | dropwizard-jersey/src/main/java/io/dropwizard/jersey/filter/RequestIdFilter.java | RequestIdFilter.generateRandomUuid | private static UUID generateRandomUuid() {
"""
Generate a random UUID v4 that will perform reasonably when used by
multiple threads under load.
@see <a href="https://github.com/Netflix/netflix-commons/blob/v0.3.0/netflix-commons-util/src/main/java/com/netflix/util/concurrent/ConcurrentUUIDFactory.java">Concurr... | java | private static UUID generateRandomUuid() {
final Random rnd = ThreadLocalRandom.current();
long mostSig = rnd.nextLong();
long leastSig = rnd.nextLong();
// Identify this as a version 4 UUID, that is one based on a random value.
mostSig &= 0xffffffffffff0fffL;
mostSig |... | [
"private",
"static",
"UUID",
"generateRandomUuid",
"(",
")",
"{",
"final",
"Random",
"rnd",
"=",
"ThreadLocalRandom",
".",
"current",
"(",
")",
";",
"long",
"mostSig",
"=",
"rnd",
".",
"nextLong",
"(",
")",
";",
"long",
"leastSig",
"=",
"rnd",
".",
"next... | Generate a random UUID v4 that will perform reasonably when used by
multiple threads under load.
@see <a href="https://github.com/Netflix/netflix-commons/blob/v0.3.0/netflix-commons-util/src/main/java/com/netflix/util/concurrent/ConcurrentUUIDFactory.java">ConcurrentUUIDFactory</a>
@return random UUID | [
"Generate",
"a",
"random",
"UUID",
"v4",
"that",
"will",
"perform",
"reasonably",
"when",
"used",
"by",
"multiple",
"threads",
"under",
"load",
"."
] | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-jersey/src/main/java/io/dropwizard/jersey/filter/RequestIdFilter.java#L59-L74 |
keenlabs/KeenClient-Java | core/src/main/java/io/keen/client/java/KeenClient.java | KeenClient.addEventAsync | public void addEventAsync(String eventCollection, Map<String, Object> event) {
"""
Adds an event to the default project with default Keen properties and no callbacks.
@see #addEvent(KeenProject, String, java.util.Map, java.util.Map, KeenCallback)
@param eventCollection The name of the collection in which to pu... | java | public void addEventAsync(String eventCollection, Map<String, Object> event) {
addEventAsync(eventCollection, event, null);
} | [
"public",
"void",
"addEventAsync",
"(",
"String",
"eventCollection",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"event",
")",
"{",
"addEventAsync",
"(",
"eventCollection",
",",
"event",
",",
"null",
")",
";",
"}"
] | Adds an event to the default project with default Keen properties and no callbacks.
@see #addEvent(KeenProject, String, java.util.Map, java.util.Map, KeenCallback)
@param eventCollection The name of the collection in which to publish the event.
@param event A Map that consists of key/value pairs. Keen naming... | [
"Adds",
"an",
"event",
"to",
"the",
"default",
"project",
"with",
"default",
"Keen",
"properties",
"and",
"no",
"callbacks",
"."
] | train | https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/core/src/main/java/io/keen/client/java/KeenClient.java#L186-L188 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java | LineSegment.pointAlongLineSegment | public Point pointAlongLineSegment(double distance) {
"""
Computes a Point along the line segment with a given distance to the start Point.
@param distance distance from start point
@return point at given distance from start point
"""
if (start.x == end.x) {
// we have a vertical line
... | java | public Point pointAlongLineSegment(double distance) {
if (start.x == end.x) {
// we have a vertical line
if (start.y > end.y) {
return new Point(end.x, end.y + distance);
} else {
return new Point(start.x, start.y + distance);
}
... | [
"public",
"Point",
"pointAlongLineSegment",
"(",
"double",
"distance",
")",
"{",
"if",
"(",
"start",
".",
"x",
"==",
"end",
".",
"x",
")",
"{",
"// we have a vertical line",
"if",
"(",
"start",
".",
"y",
">",
"end",
".",
"y",
")",
"{",
"return",
"new",... | Computes a Point along the line segment with a given distance to the start Point.
@param distance distance from start point
@return point at given distance from start point | [
"Computes",
"a",
"Point",
"along",
"the",
"line",
"segment",
"with",
"a",
"given",
"distance",
"to",
"the",
"start",
"Point",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java#L197-L213 |
aws/aws-sdk-java | aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/EntityFilter.java | EntityFilter.setTags | public void setTags(java.util.Collection<java.util.Map<String, String>> tags) {
"""
<p>
A map of entity tags attached to the affected entity.
</p>
@param tags
A map of entity tags attached to the affected entity.
"""
if (tags == null) {
this.tags = null;
return;
}
... | java | public void setTags(java.util.Collection<java.util.Map<String, String>> tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList<java.util.Map<String, String>>(tags);
} | [
"public",
"void",
"setTags",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
">",
"tags",
")",
"{",
"if",
"(",
"tags",
"==",
"null",
")",
"{",
"this",
".",
"tags",
"=",
"null",... | <p>
A map of entity tags attached to the affected entity.
</p>
@param tags
A map of entity tags attached to the affected entity. | [
"<p",
">",
"A",
"map",
"of",
"entity",
"tags",
"attached",
"to",
"the",
"affected",
"entity",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/EntityFilter.java#L378-L385 |
twilio/twilio-java | src/main/java/com/twilio/rest/messaging/v1/service/ShortCodeReader.java | ShortCodeReader.previousPage | @Override
public Page<ShortCode> previousPage(final Page<ShortCode> page,
final TwilioRestClient client) {
"""
Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Pa... | java | @Override
public Page<ShortCode> previousPage(final Page<ShortCode> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.MESSAGING.toString(),
cl... | [
"@",
"Override",
"public",
"Page",
"<",
"ShortCode",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"ShortCode",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
... | Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"Retrieve",
"the",
"previous",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/messaging/v1/service/ShortCodeReader.java#L114-L125 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/LoadBalancerNetworkInterfacesInner.java | LoadBalancerNetworkInterfacesInner.listAsync | public Observable<Page<NetworkInterfaceInner>> listAsync(final String resourceGroupName, final String loadBalancerName) {
"""
Gets associated load balancer network interfaces.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@throws IllegalArgumen... | java | public Observable<Page<NetworkInterfaceInner>> listAsync(final String resourceGroupName, final String loadBalancerName) {
return listWithServiceResponseAsync(resourceGroupName, loadBalancerName)
.map(new Func1<ServiceResponse<Page<NetworkInterfaceInner>>, Page<NetworkInterfaceInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"NetworkInterfaceInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"loadBalancerName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"loadB... | Gets associated load balancer network interfaces.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<NetworkInterfaceInner> object | [
"Gets",
"associated",
"load",
"balancer",
"network",
"interfaces",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/LoadBalancerNetworkInterfacesInner.java#L118-L126 |
mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DataSynchronizer.java | DataSynchronizer.desyncDocumentsFromRemote | @CheckReturnValue
LocalSyncWriteModelContainer desyncDocumentsFromRemote(
final NamespaceSynchronizationConfig nsConfig,
final BsonValue... documentIds) {
"""
Requests that a document be no longer be synchronized by the given _id. Any uncommitted writes
will be lost.
@param nsConfig the namesp... | java | @CheckReturnValue
LocalSyncWriteModelContainer desyncDocumentsFromRemote(
final NamespaceSynchronizationConfig nsConfig,
final BsonValue... documentIds) {
this.waitUntilInitialized();
final MongoNamespace namespace = nsConfig.getNamespace();
final Lock lock = this.syncConfig.getNamespaceConfig... | [
"@",
"CheckReturnValue",
"LocalSyncWriteModelContainer",
"desyncDocumentsFromRemote",
"(",
"final",
"NamespaceSynchronizationConfig",
"nsConfig",
",",
"final",
"BsonValue",
"...",
"documentIds",
")",
"{",
"this",
".",
"waitUntilInitialized",
"(",
")",
";",
"final",
"Mongo... | Requests that a document be no longer be synchronized by the given _id. Any uncommitted writes
will be lost.
@param nsConfig the namespace synchronization config of the namespace where the document
lives.
@param documentIds the _ids of the documents. | [
"Requests",
"that",
"a",
"document",
"be",
"no",
"longer",
"be",
"synchronized",
"by",
"the",
"given",
"_id",
".",
"Any",
"uncommitted",
"writes",
"will",
"be",
"lost",
"."
] | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DataSynchronizer.java#L2040-L2069 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataDecoder.java | DataDecoder.decodeSingleNullable | public static byte[] decodeSingleNullable(byte[] src, int prefixPadding, int suffixPadding)
throws CorruptEncodingException {
"""
Decodes the given byte array which was encoded by {@link
DataEncoder#encodeSingleNullable}. Always returns a new byte array
instance.
@param prefixPadding amount of extra ... | java | public static byte[] decodeSingleNullable(byte[] src, int prefixPadding, int suffixPadding)
throws CorruptEncodingException
{
try {
byte b = src[prefixPadding];
if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
return null;
}
int... | [
"public",
"static",
"byte",
"[",
"]",
"decodeSingleNullable",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"prefixPadding",
",",
"int",
"suffixPadding",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"byte",
"b",
"=",
"src",
"[",
"prefixPadding",
"... | Decodes the given byte array which was encoded by {@link
DataEncoder#encodeSingleNullable}. Always returns a new byte array
instance.
@param prefixPadding amount of extra bytes to skip from start of encoded byte array
@param suffixPadding amount of extra bytes to skip at end of encoded byte array | [
"Decodes",
"the",
"given",
"byte",
"array",
"which",
"was",
"encoded",
"by",
"{",
"@link",
"DataEncoder#encodeSingleNullable",
"}",
".",
"Always",
"returns",
"a",
"new",
"byte",
"array",
"instance",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L703-L721 |
jblas-project/jblas | src/main/java/org/jblas/util/SanityChecks.java | SanityChecks.checkEigenvalues | public static void checkEigenvalues() {
"""
Compute eigenvalues. This is a routine not in ATLAS, but in the original
LAPACK.
"""
DoubleMatrix A = new DoubleMatrix(new double[][]{
{3.0, 2.0, 0.0},
{2.0, 3.0, 2.0},
{0.0, 2.0, 3.0}
... | java | public static void checkEigenvalues() {
DoubleMatrix A = new DoubleMatrix(new double[][]{
{3.0, 2.0, 0.0},
{2.0, 3.0, 2.0},
{0.0, 2.0, 3.0}
});
DoubleMatrix E = new DoubleMatrix(3, 1);
NativeBlas.dsyev('N', 'U', 3, A.d... | [
"public",
"static",
"void",
"checkEigenvalues",
"(",
")",
"{",
"DoubleMatrix",
"A",
"=",
"new",
"DoubleMatrix",
"(",
"new",
"double",
"[",
"]",
"[",
"]",
"{",
"{",
"3.0",
",",
"2.0",
",",
"0.0",
"}",
",",
"{",
"2.0",
",",
"3.0",
",",
"2.0",
"}",
... | Compute eigenvalues. This is a routine not in ATLAS, but in the original
LAPACK. | [
"Compute",
"eigenvalues",
".",
"This",
"is",
"a",
"routine",
"not",
"in",
"ATLAS",
"but",
"in",
"the",
"original",
"LAPACK",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/SanityChecks.java#L115-L126 |
VoltDB/voltdb | src/frontend/org/voltcore/agreement/AgreementSeeker.java | AgreementSeeker.amongDeadHsids | public static Predicate<Map.Entry<Long, Boolean>> amongDeadHsids(final Set<Long> hsids) {
"""
returns a map entry predicate that tests whether or not the given
map entry describes a dead site
@param hsids pre-failure mesh hsids
@return
"""
return new Predicate<Map.Entry<Long,Boolean>>() {
... | java | public static Predicate<Map.Entry<Long, Boolean>> amongDeadHsids(final Set<Long> hsids) {
return new Predicate<Map.Entry<Long,Boolean>>() {
@Override
public boolean apply(Entry<Long, Boolean> e) {
return hsids.contains(e.getKey()) && e.getValue();
}
};... | [
"public",
"static",
"Predicate",
"<",
"Map",
".",
"Entry",
"<",
"Long",
",",
"Boolean",
">",
">",
"amongDeadHsids",
"(",
"final",
"Set",
"<",
"Long",
">",
"hsids",
")",
"{",
"return",
"new",
"Predicate",
"<",
"Map",
".",
"Entry",
"<",
"Long",
",",
"B... | returns a map entry predicate that tests whether or not the given
map entry describes a dead site
@param hsids pre-failure mesh hsids
@return | [
"returns",
"a",
"map",
"entry",
"predicate",
"that",
"tests",
"whether",
"or",
"not",
"the",
"given",
"map",
"entry",
"describes",
"a",
"dead",
"site"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/agreement/AgreementSeeker.java#L153-L160 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusNetwork.java | BusNetwork.getBusHub | @Pure
public BusHub getBusHub(String name, Comparator<String> nameComparator) {
"""
Replies the bus hub with the specified name.
@param name is the desired name
@param nameComparator is used to compare the names.
@return a bus hub or <code>null</code>
"""
if (name == null) {
return null;
}
final... | java | @Pure
public BusHub getBusHub(String name, Comparator<String> nameComparator) {
if (name == null) {
return null;
}
final Comparator<String> cmp = nameComparator == null ? BusNetworkUtilities.NAME_COMPARATOR : nameComparator;
for (final BusHub busHub : this.validBusHubs) {
if (cmp.compare(name, busHub.get... | [
"@",
"Pure",
"public",
"BusHub",
"getBusHub",
"(",
"String",
"name",
",",
"Comparator",
"<",
"String",
">",
"nameComparator",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"Comparator",
"<",
"String",
">",
"c... | Replies the bus hub with the specified name.
@param name is the desired name
@param nameComparator is used to compare the names.
@return a bus hub or <code>null</code> | [
"Replies",
"the",
"bus",
"hub",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusNetwork.java#L1288-L1305 |
lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java | AbstractVersionEnforcer.enforceVersion | public void enforceVersion( Log log, String variableName, String requiredVersionRange, ArtifactVersion actualVersion )
throws EnforcerRuleException {
"""
Compares the specified version to see if it is allowed by the defined version range.
@param log the log
@param variableName name of variable to use i... | java | public void enforceVersion( Log log, String variableName, String requiredVersionRange, ArtifactVersion actualVersion )
throws EnforcerRuleException
{
if ( StringUtils.isEmpty( requiredVersionRange ) )
{
throw new EnforcerRuleException( variableName + " version can't be empty." );... | [
"public",
"void",
"enforceVersion",
"(",
"Log",
"log",
",",
"String",
"variableName",
",",
"String",
"requiredVersionRange",
",",
"ArtifactVersion",
"actualVersion",
")",
"throws",
"EnforcerRuleException",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"require... | Compares the specified version to see if it is allowed by the defined version range.
@param log the log
@param variableName name of variable to use in messages (Example: "Maven" or "Java" etc).
@param requiredVersionRange range of allowed versions.
@param actualVersion the version to be checked.
@throws EnforcerRuleEx... | [
"Compares",
"the",
"specified",
"version",
"to",
"see",
"if",
"it",
"is",
"allowed",
"by",
"the",
"defined",
"version",
"range",
"."
] | train | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java#L69-L116 |
bazaarvoice/ostrich | core/src/main/java/com/bazaarvoice/ostrich/discovery/ConfiguredFixedHostDiscoverySource.java | ConfiguredFixedHostDiscoverySource.serialize | @SuppressWarnings("UnusedParameters")
protected String serialize(String serviceName, String id, Payload payload) {
"""
Subclasses may override this to customize the persistent format of the payload.
"""
return String.valueOf(payload);
} | java | @SuppressWarnings("UnusedParameters")
protected String serialize(String serviceName, String id, Payload payload) {
return String.valueOf(payload);
} | [
"@",
"SuppressWarnings",
"(",
"\"UnusedParameters\"",
")",
"protected",
"String",
"serialize",
"(",
"String",
"serviceName",
",",
"String",
"id",
",",
"Payload",
"payload",
")",
"{",
"return",
"String",
".",
"valueOf",
"(",
"payload",
")",
";",
"}"
] | Subclasses may override this to customize the persistent format of the payload. | [
"Subclasses",
"may",
"override",
"this",
"to",
"customize",
"the",
"persistent",
"format",
"of",
"the",
"payload",
"."
] | train | https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/discovery/ConfiguredFixedHostDiscoverySource.java#L64-L67 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java | ClassBuilder.buildMemberSummary | public void buildMemberSummary(XMLNode node, Content classContentTree) throws Exception {
"""
Build the member summary contents of the page.
@param node the XML element that specifies which components to document
@param classContentTree the content tree to which the documentation will be added
"""
... | java | public void buildMemberSummary(XMLNode node, Content classContentTree) throws Exception {
Content memberSummaryTree = writer.getMemberTreeHeader();
configuration.getBuilderFactory().
getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree);
classContentTree.addConte... | [
"public",
"void",
"buildMemberSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"classContentTree",
")",
"throws",
"Exception",
"{",
"Content",
"memberSummaryTree",
"=",
"writer",
".",
"getMemberTreeHeader",
"(",
")",
";",
"configuration",
".",
"getBuilderFactory",
... | Build the member summary contents of the page.
@param node the XML element that specifies which components to document
@param classContentTree the content tree to which the documentation will be added | [
"Build",
"the",
"member",
"summary",
"contents",
"of",
"the",
"page",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java#L339-L344 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/StorableGenerator.java | StorableGenerator.requirePkInitialized | private void requirePkInitialized(CodeBuilder b, String methodName) {
"""
Generates code that verifies that all primary keys are initialized.
@param b builder that will invoke generated method
@param methodName name to give to generated method
"""
// Add code to call method which we are about to d... | java | private void requirePkInitialized(CodeBuilder b, String methodName) {
// Add code to call method which we are about to define.
b.loadThis();
b.invokeVirtual(methodName, null, null);
// Now define new method, discarding original builder object.
b = new CodeBuilder(mClassFil... | [
"private",
"void",
"requirePkInitialized",
"(",
"CodeBuilder",
"b",
",",
"String",
"methodName",
")",
"{",
"// Add code to call method which we are about to define.\r",
"b",
".",
"loadThis",
"(",
")",
";",
"b",
".",
"invokeVirtual",
"(",
"methodName",
",",
"null",
"... | Generates code that verifies that all primary keys are initialized.
@param b builder that will invoke generated method
@param methodName name to give to generated method | [
"Generates",
"code",
"that",
"verifies",
"that",
"all",
"primary",
"keys",
"are",
"initialized",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java#L2577-L2592 |
stevespringett/CPE-Parser | src/main/java/us/springett/parsers/cpe/Cpe.java | Cpe.compareAttributes | protected static boolean compareAttributes(Part left, Part right) {
"""
This does not follow the spec precisely because ANY compared to NA is
classified as undefined by the spec; however, in this implementation ANY
will match NA and return true.
This will compare the left value to the right value and return t... | java | protected static boolean compareAttributes(Part left, Part right) {
if (left == right) {
return true;
} else if (left == Part.ANY) {
return true;
}
return false;
} | [
"protected",
"static",
"boolean",
"compareAttributes",
"(",
"Part",
"left",
",",
"Part",
"right",
")",
"{",
"if",
"(",
"left",
"==",
"right",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"left",
"==",
"Part",
".",
"ANY",
")",
"{",
"return... | This does not follow the spec precisely because ANY compared to NA is
classified as undefined by the spec; however, in this implementation ANY
will match NA and return true.
This will compare the left value to the right value and return true if
the left matches the right. Note that it is possible that the right would
... | [
"This",
"does",
"not",
"follow",
"the",
"spec",
"precisely",
"because",
"ANY",
"compared",
"to",
"NA",
"is",
"classified",
"as",
"undefined",
"by",
"the",
"spec",
";",
"however",
"in",
"this",
"implementation",
"ANY",
"will",
"match",
"NA",
"and",
"return",
... | train | https://github.com/stevespringett/CPE-Parser/blob/e6324ca020dc0790097d3d62bb98aabf60e56843/src/main/java/us/springett/parsers/cpe/Cpe.java#L584-L591 |
KyoriPowered/text | api/src/main/java/net/kyori/text/event/ClickEvent.java | ClickEvent.runCommand | public static @NonNull ClickEvent runCommand(final @NonNull String command) {
"""
Creates a click event that runs a command.
@param command the command to run
@return a click event
"""
return new ClickEvent(Action.RUN_COMMAND, command);
} | java | public static @NonNull ClickEvent runCommand(final @NonNull String command) {
return new ClickEvent(Action.RUN_COMMAND, command);
} | [
"public",
"static",
"@",
"NonNull",
"ClickEvent",
"runCommand",
"(",
"final",
"@",
"NonNull",
"String",
"command",
")",
"{",
"return",
"new",
"ClickEvent",
"(",
"Action",
".",
"RUN_COMMAND",
",",
"command",
")",
";",
"}"
] | Creates a click event that runs a command.
@param command the command to run
@return a click event | [
"Creates",
"a",
"click",
"event",
"that",
"runs",
"a",
"command",
"."
] | train | https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/event/ClickEvent.java#L76-L78 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkWhile | private Environment checkWhile(Stmt.While stmt, Environment environment, EnclosingScope scope) {
"""
Type check a <code>whiley</code> statement.
@param stmt
Statement to type check
@param environment
Determines the type of all variables immediately going into this
block
@return
@throws ResolveError
If a ... | java | private Environment checkWhile(Stmt.While stmt, Environment environment, EnclosingScope scope) {
// Type loop invariant(s).
checkConditions(stmt.getInvariant(), true, environment);
// Type condition assuming its true to represent inside a loop
// iteration.
// Important if condition contains a type test, as w... | [
"private",
"Environment",
"checkWhile",
"(",
"Stmt",
".",
"While",
"stmt",
",",
"Environment",
"environment",
",",
"EnclosingScope",
"scope",
")",
"{",
"// Type loop invariant(s).",
"checkConditions",
"(",
"stmt",
".",
"getInvariant",
"(",
")",
",",
"true",
",",
... | Type check a <code>whiley</code> statement.
@param stmt
Statement to type check
@param environment
Determines the type of all variables immediately going into this
block
@return
@throws ResolveError
If a named type within this statement cannot be resolved within
the enclosing project. | [
"Type",
"check",
"a",
"<code",
">",
"whiley<",
"/",
"code",
">",
"statement",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L757-L775 |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/url/PortalUrlProviderImpl.java | PortalUrlProviderImpl.verifyPortletWindowId | protected String verifyPortletWindowId(
HttpServletRequest request, IPortletWindowId portletWindowId) {
"""
Verify the requested portlet window corresponds to a node in the user's layout and return the
corresponding layout node id
"""
final IUserInstance userInstance = this.userInstanceMan... | java | protected String verifyPortletWindowId(
HttpServletRequest request, IPortletWindowId portletWindowId) {
final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
final... | [
"protected",
"String",
"verifyPortletWindowId",
"(",
"HttpServletRequest",
"request",
",",
"IPortletWindowId",
"portletWindowId",
")",
"{",
"final",
"IUserInstance",
"userInstance",
"=",
"this",
".",
"userInstanceManager",
".",
"getUserInstance",
"(",
"request",
")",
";... | Verify the requested portlet window corresponds to a node in the user's layout and return the
corresponding layout node id | [
"Verify",
"the",
"requested",
"portlet",
"window",
"corresponds",
"to",
"a",
"node",
"in",
"the",
"user",
"s",
"layout",
"and",
"return",
"the",
"corresponding",
"layout",
"node",
"id"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/url/PortalUrlProviderImpl.java#L216-L241 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyRawHelper.java | ModifyRawHelper.extractWhereConditions | static String extractWhereConditions(boolean updateMode, SQLiteModelMethod method) {
"""
Extract where conditions.
@param updateMode
the update mode
@param method
the method
@return the string
"""
final One<String> whereCondition = new One<String>("");
final One<Boolean> found = new One<Boolean>(nul... | java | static String extractWhereConditions(boolean updateMode, SQLiteModelMethod method) {
final One<String> whereCondition = new One<String>("");
final One<Boolean> found = new One<Boolean>(null);
JQLChecker.getInstance().replaceVariableStatements(method, method.jql.value, new JQLReplaceVariableStatementListenerImpl()... | [
"static",
"String",
"extractWhereConditions",
"(",
"boolean",
"updateMode",
",",
"SQLiteModelMethod",
"method",
")",
"{",
"final",
"One",
"<",
"String",
">",
"whereCondition",
"=",
"new",
"One",
"<",
"String",
">",
"(",
"\"\"",
")",
";",
"final",
"One",
"<",... | Extract where conditions.
@param updateMode
the update mode
@param method
the method
@return the string | [
"Extract",
"where",
"conditions",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyRawHelper.java#L388-L405 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/BizwifiAPI.java | BizwifiAPI.deviceList | public static DeviceListResult deviceList(String accessToken, DeviceList deviceList) {
"""
Wi-Fi设备管理-查询设备
可通过指定分页或具体门店ID的方式,查询当前MP账号下指定门店连网成功的设备信息。一次最多能查询20个门店的设备信息。
@param accessToken accessToken
@param deviceList deviceList
@return DeviceListResult
"""
return deviceList(accessToken, JsonUtil.... | java | public static DeviceListResult deviceList(String accessToken, DeviceList deviceList) {
return deviceList(accessToken, JsonUtil.toJSONString(deviceList));
} | [
"public",
"static",
"DeviceListResult",
"deviceList",
"(",
"String",
"accessToken",
",",
"DeviceList",
"deviceList",
")",
"{",
"return",
"deviceList",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"deviceList",
")",
")",
";",
"}"
] | Wi-Fi设备管理-查询设备
可通过指定分页或具体门店ID的方式,查询当前MP账号下指定门店连网成功的设备信息。一次最多能查询20个门店的设备信息。
@param accessToken accessToken
@param deviceList deviceList
@return DeviceListResult | [
"Wi",
"-",
"Fi设备管理",
"-",
"查询设备",
"可通过指定分页或具体门店ID的方式,查询当前MP账号下指定门店连网成功的设备信息。一次最多能查询20个门店的设备信息。"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/BizwifiAPI.java#L379-L381 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java | ASegment.getNextMatch | protected IWord[] getNextMatch(char[] chars, int index) {
"""
match the next CJK word in the dictionary
@param chars
@param index
@return IWord[]
"""
ArrayList<IWord> mList = new ArrayList<IWord>(8);
//StringBuilder isb = new StringBuilder();
isb.clear();
char c = char... | java | protected IWord[] getNextMatch(char[] chars, int index)
{
ArrayList<IWord> mList = new ArrayList<IWord>(8);
//StringBuilder isb = new StringBuilder();
isb.clear();
char c = chars[index];
isb.append(c);
String temp = isb.toString();
if ( dic.match(ILexico... | [
"protected",
"IWord",
"[",
"]",
"getNextMatch",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"index",
")",
"{",
"ArrayList",
"<",
"IWord",
">",
"mList",
"=",
"new",
"ArrayList",
"<",
"IWord",
">",
"(",
"8",
")",
";",
"//StringBuilder isb = new StringBuilder... | match the next CJK word in the dictionary
@param chars
@param index
@return IWord[] | [
"match",
"the",
"next",
"CJK",
"word",
"in",
"the",
"dictionary"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L882-L923 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.setWriterDirOctalPermissions | public static void setWriterDirOctalPermissions(State state, int numBranches, int branchId, String octalPermissions) {
"""
Given a {@link String} in octal notation, set a key, value pair in the given {@link State} for the writer to
use when creating directories. This method should be used in conjunction with {@li... | java | public static void setWriterDirOctalPermissions(State state, int numBranches, int branchId, String octalPermissions) {
state.setProp(
ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_DIR_PERMISSIONS, numBranches, branchId),
octalPermissions);
} | [
"public",
"static",
"void",
"setWriterDirOctalPermissions",
"(",
"State",
"state",
",",
"int",
"numBranches",
",",
"int",
"branchId",
",",
"String",
"octalPermissions",
")",
"{",
"state",
".",
"setProp",
"(",
"ForkOperatorUtils",
".",
"getPropertyNameForBranch",
"("... | Given a {@link String} in octal notation, set a key, value pair in the given {@link State} for the writer to
use when creating directories. This method should be used in conjunction with {@link #deserializeWriterDirPermissions(State, int, int)}. | [
"Given",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L876-L880 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/util/TextFormatter.java | TextFormatter.appendSize | public static void appendSize(StringBuilder buf, long size) {
"""
Appends the human-readable representation of the specified byte-unit {@code size} to the specified
{@link StringBuffer}.
"""
if (size >= 104857600) { // >= 100 MiB
buf.append(size / 1048576).append("MiB(").append(size).appen... | java | public static void appendSize(StringBuilder buf, long size) {
if (size >= 104857600) { // >= 100 MiB
buf.append(size / 1048576).append("MiB(").append(size).append("B)");
} else if (size >= 102400) { // >= 100 KiB
buf.append(size / 1024).append("KiB(").append(size).append("B)");
... | [
"public",
"static",
"void",
"appendSize",
"(",
"StringBuilder",
"buf",
",",
"long",
"size",
")",
"{",
"if",
"(",
"size",
">=",
"104857600",
")",
"{",
"// >= 100 MiB",
"buf",
".",
"append",
"(",
"size",
"/",
"1048576",
")",
".",
"append",
"(",
"\"MiB(\"",... | Appends the human-readable representation of the specified byte-unit {@code size} to the specified
{@link StringBuffer}. | [
"Appends",
"the",
"human",
"-",
"readable",
"representation",
"of",
"the",
"specified",
"byte",
"-",
"unit",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/util/TextFormatter.java#L36-L44 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java | ExceptionUtils.printRootCauseStackTrace | @GwtIncompatible("incompatible method")
public static void printRootCauseStackTrace(final Throwable throwable, final PrintStream stream) {
"""
<p>Prints a compact stack trace for the root cause of a throwable.</p>
<p>The compact stack trace starts with the root cause and prints
stack frames up to the place... | java | @GwtIncompatible("incompatible method")
public static void printRootCauseStackTrace(final Throwable throwable, final PrintStream stream) {
if (throwable == null) {
return;
}
Validate.isTrue(stream != null, "The PrintStream must not be null");
final String trace[] = getRoo... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"void",
"printRootCauseStackTrace",
"(",
"final",
"Throwable",
"throwable",
",",
"final",
"PrintStream",
"stream",
")",
"{",
"if",
"(",
"throwable",
"==",
"null",
")",
"{",
"return",
... | <p>Prints a compact stack trace for the root cause of a throwable.</p>
<p>The compact stack trace starts with the root cause and prints
stack frames up to the place where it was caught and wrapped.
Then it prints the wrapped exception and continues with stack frames
until the wrapper exception is caught and wrapped ag... | [
"<p",
">",
"Prints",
"a",
"compact",
"stack",
"trace",
"for",
"the",
"root",
"cause",
"of",
"a",
"throwable",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java#L471-L482 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_zone_name_terminate_POST | public void serviceName_zone_name_terminate_POST(String serviceName, String name) throws IOException {
"""
Terminate your service zone option
REST: POST /ipLoadbalancing/{serviceName}/zone/{name}/terminate
@param serviceName [required] The internal name of your IP load balancing
@param name [required] Name of... | java | public void serviceName_zone_name_terminate_POST(String serviceName, String name) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/zone/{name}/terminate";
StringBuilder sb = path(qPath, serviceName, name);
exec(qPath, "POST", sb.toString(), null);
} | [
"public",
"void",
"serviceName_zone_name_terminate_POST",
"(",
"String",
"serviceName",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/zone/{name}/terminate\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"... | Terminate your service zone option
REST: POST /ipLoadbalancing/{serviceName}/zone/{name}/terminate
@param serviceName [required] The internal name of your IP load balancing
@param name [required] Name of your zone | [
"Terminate",
"your",
"service",
"zone",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1790-L1794 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.beanMap | public static Collection beanMap(final String property, Iterator i, boolean includeNull) {
"""
Map dynamically using a bean property name.
@param property the name of a bean property
@param i an iterator of objects
@param includeNull true to include null results in the response
@return collect... | java | public static Collection beanMap(final String property, Iterator i, boolean includeNull) {
return map(beanMapper(property), i, includeNull);
} | [
"public",
"static",
"Collection",
"beanMap",
"(",
"final",
"String",
"property",
",",
"Iterator",
"i",
",",
"boolean",
"includeNull",
")",
"{",
"return",
"map",
"(",
"beanMapper",
"(",
"property",
")",
",",
"i",
",",
"includeNull",
")",
";",
"}"
] | Map dynamically using a bean property name.
@param property the name of a bean property
@param i an iterator of objects
@param includeNull true to include null results in the response
@return collection
@throws ClassCastException if there is an error invoking the method on any object. | [
"Map",
"dynamically",
"using",
"a",
"bean",
"property",
"name",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L732-L734 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/WorkspacesApi.java | WorkspacesApi.listWorkspaceFilePages | public PageImages listWorkspaceFilePages(String accountId, String workspaceId, String folderId, String fileId, WorkspacesApi.ListWorkspaceFilePagesOptions options) throws ApiException {
"""
List File Pages
Retrieves a workspace file as rasterized pages.
@param accountId The external account number (int) or accou... | java | public PageImages listWorkspaceFilePages(String accountId, String workspaceId, String folderId, String fileId, WorkspacesApi.ListWorkspaceFilePagesOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
... | [
"public",
"PageImages",
"listWorkspaceFilePages",
"(",
"String",
"accountId",
",",
"String",
"workspaceId",
",",
"String",
"folderId",
",",
"String",
"fileId",
",",
"WorkspacesApi",
".",
"ListWorkspaceFilePagesOptions",
"options",
")",
"throws",
"ApiException",
"{",
"... | List File Pages
Retrieves a workspace file as rasterized pages.
@param accountId The external account number (int) or account ID Guid. (required)
@param workspaceId Specifies the workspace ID GUID. (required)
@param folderId The ID of the folder being accessed. (required)
@param fileId Specifies the room file ID GUID. ... | [
"List",
"File",
"Pages",
"Retrieves",
"a",
"workspace",
"file",
"as",
"rasterized",
"pages",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/WorkspacesApi.java#L492-L550 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java | SlotManager.removeSlotRequestFromSlot | private void removeSlotRequestFromSlot(SlotID slotId, AllocationID allocationId) {
"""
Removes a pending slot request identified by the given allocation id from a slot identified
by the given slot id.
@param slotId identifying the slot
@param allocationId identifying the presumable assigned pending slot reque... | java | private void removeSlotRequestFromSlot(SlotID slotId, AllocationID allocationId) {
TaskManagerSlot taskManagerSlot = slots.get(slotId);
if (null != taskManagerSlot) {
if (taskManagerSlot.getState() == TaskManagerSlot.State.PENDING && Objects.equals(allocationId, taskManagerSlot.getAssignedSlotRequest().getAlloc... | [
"private",
"void",
"removeSlotRequestFromSlot",
"(",
"SlotID",
"slotId",
",",
"AllocationID",
"allocationId",
")",
"{",
"TaskManagerSlot",
"taskManagerSlot",
"=",
"slots",
".",
"get",
"(",
"slotId",
")",
";",
"if",
"(",
"null",
"!=",
"taskManagerSlot",
")",
"{",... | Removes a pending slot request identified by the given allocation id from a slot identified
by the given slot id.
@param slotId identifying the slot
@param allocationId identifying the presumable assigned pending slot request | [
"Removes",
"a",
"pending",
"slot",
"request",
"identified",
"by",
"the",
"given",
"allocation",
"id",
"from",
"a",
"slot",
"identified",
"by",
"the",
"given",
"slot",
"id",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java#L917-L939 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_output_graylog_stream_streamId_rule_POST | public OvhOperation serviceName_output_graylog_stream_streamId_rule_POST(String serviceName, String streamId, String field, Boolean isInverted, OvhStreamRuleOperatorEnum operator, String value) throws IOException {
"""
Register a new rule on specified graylog stream
REST: POST /dbaas/logs/{serviceName}/output/g... | java | public OvhOperation serviceName_output_graylog_stream_streamId_rule_POST(String serviceName, String streamId, String field, Boolean isInverted, OvhStreamRuleOperatorEnum operator, String value) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/rule";
StringBuilder sb = ... | [
"public",
"OvhOperation",
"serviceName_output_graylog_stream_streamId_rule_POST",
"(",
"String",
"serviceName",
",",
"String",
"streamId",
",",
"String",
"field",
",",
"Boolean",
"isInverted",
",",
"OvhStreamRuleOperatorEnum",
"operator",
",",
"String",
"value",
")",
"thr... | Register a new rule on specified graylog stream
REST: POST /dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/rule
@param serviceName [required] Service name
@param streamId [required] Stream ID
@param value [required] Field value
@param field [required] Field name
@param operator [required] Field operator
@pa... | [
"Register",
"a",
"new",
"rule",
"on",
"specified",
"graylog",
"stream"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L1563-L1573 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java | PactDslJsonArray.arrayMinMaxLike | public static PactDslJsonArray arrayMinMaxLike(int minSize, int maxSize, PactDslJsonRootValue value) {
"""
Root level array with minimum and maximum size where each item must match the provided matcher
@param minSize minimum size
@param maxSize maximum size
"""
return arrayMinMaxLike(minSize, maxSize, mi... | java | public static PactDslJsonArray arrayMinMaxLike(int minSize, int maxSize, PactDslJsonRootValue value) {
return arrayMinMaxLike(minSize, maxSize, minSize, value);
} | [
"public",
"static",
"PactDslJsonArray",
"arrayMinMaxLike",
"(",
"int",
"minSize",
",",
"int",
"maxSize",
",",
"PactDslJsonRootValue",
"value",
")",
"{",
"return",
"arrayMinMaxLike",
"(",
"minSize",
",",
"maxSize",
",",
"minSize",
",",
"value",
")",
";",
"}"
] | Root level array with minimum and maximum size where each item must match the provided matcher
@param minSize minimum size
@param maxSize maximum size | [
"Root",
"level",
"array",
"with",
"minimum",
"and",
"maximum",
"size",
"where",
"each",
"item",
"must",
"match",
"the",
"provided",
"matcher"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java#L897-L899 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FirewallRulesInner.java | FirewallRulesInner.listByServerAsync | public Observable<Page<FirewallRuleInner>> listByServerAsync(final String resourceGroupName, final String serverName) {
"""
Gets a list of firewall rules.
@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 port... | java | public Observable<Page<FirewallRuleInner>> listByServerAsync(final String resourceGroupName, final String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName)
.map(new Func1<ServiceResponse<Page<FirewallRuleInner>>, Page<FirewallRuleInner>>() {
@Ov... | [
"public",
"Observable",
"<",
"Page",
"<",
"FirewallRuleInner",
">",
">",
"listByServerAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Gets a list of firewall rules.
@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.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the... | [
"Gets",
"a",
"list",
"of",
"firewall",
"rules",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FirewallRulesInner.java#L428-L436 |
apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v5/PluginDefaultGroovyMethods.java | PluginDefaultGroovyMethods.putAt | public static void putAt(StringBuilder self, IntRange range, Object value) {
"""
Support the range subscript operator for StringBuilder.
Index values are treated as characters within the builder.
@param self a StringBuilder
@param range a Range
@param value the object that's toString() will be inserted
... | java | public static void putAt(StringBuilder self, IntRange range, Object value) {
RangeInfo info = subListBorders(self.length(), range);
self.replace(info.from, info.to, value.toString());
} | [
"public",
"static",
"void",
"putAt",
"(",
"StringBuilder",
"self",
",",
"IntRange",
"range",
",",
"Object",
"value",
")",
"{",
"RangeInfo",
"info",
"=",
"subListBorders",
"(",
"self",
".",
"length",
"(",
")",
",",
"range",
")",
";",
"self",
".",
"replace... | Support the range subscript operator for StringBuilder.
Index values are treated as characters within the builder.
@param self a StringBuilder
@param range a Range
@param value the object that's toString() will be inserted | [
"Support",
"the",
"range",
"subscript",
"operator",
"for",
"StringBuilder",
".",
"Index",
"values",
"are",
"treated",
"as",
"characters",
"within",
"the",
"builder",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v5/PluginDefaultGroovyMethods.java#L118-L121 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineMediaSource.java | InlineMediaSource.getInlineAsset | private Asset getInlineAsset(Resource ntResourceResource, Media media, String fileName) {
"""
Get implementation of inline media item
@param ntResourceResource nt:resource node
@param media Media metadata
@param fileName File name
@return Inline media item instance
"""
return new InlineAsset(ntResource... | java | private Asset getInlineAsset(Resource ntResourceResource, Media media, String fileName) {
return new InlineAsset(ntResourceResource, media, fileName, adaptable);
} | [
"private",
"Asset",
"getInlineAsset",
"(",
"Resource",
"ntResourceResource",
",",
"Media",
"media",
",",
"String",
"fileName",
")",
"{",
"return",
"new",
"InlineAsset",
"(",
"ntResourceResource",
",",
"media",
",",
"fileName",
",",
"adaptable",
")",
";",
"}"
] | Get implementation of inline media item
@param ntResourceResource nt:resource node
@param media Media metadata
@param fileName File name
@return Inline media item instance | [
"Get",
"implementation",
"of",
"inline",
"media",
"item"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineMediaSource.java#L170-L172 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java | HttpResponse.withHeader | public HttpResponse withHeader(String name, String... values) {
"""
Add a header to return as a Header object, if a header with
the same name already exists this will NOT be modified but
two headers will exist
@param name the header name
@param values the header values
"""
this.headers.withEntr... | java | public HttpResponse withHeader(String name, String... values) {
this.headers.withEntry(name, values);
return this;
} | [
"public",
"HttpResponse",
"withHeader",
"(",
"String",
"name",
",",
"String",
"...",
"values",
")",
"{",
"this",
".",
"headers",
".",
"withEntry",
"(",
"name",
",",
"values",
")",
";",
"return",
"this",
";",
"}"
] | Add a header to return as a Header object, if a header with
the same name already exists this will NOT be modified but
two headers will exist
@param name the header name
@param values the header values | [
"Add",
"a",
"header",
"to",
"return",
"as",
"a",
"Header",
"object",
"if",
"a",
"header",
"with",
"the",
"same",
"name",
"already",
"exists",
"this",
"will",
"NOT",
"be",
"modified",
"but",
"two",
"headers",
"will",
"exist"
] | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java#L222-L225 |
WhereIsMyTransport/TransportApiSdk.Java | transportapisdk/src/main/java/transportapisdk/TransportApiClient.java | TransportApiClient.getAgenciesNearby | public TransportApiResult<List<Agency>> getAgenciesNearby(AgencyQueryOptions options, double latitude, double longitude, int radiusInMeters) {
"""
Gets a list of agencies nearby ordered by distance from the point specified.
@param options Options to limit the results by. Default: AgencyQueryOptions.defaultQ... | java | public TransportApiResult<List<Agency>> getAgenciesNearby(AgencyQueryOptions options, double latitude, double longitude, int radiusInMeters)
{
if (options == null)
{
options = AgencyQueryOptions.defaultQueryOptions();
}
if (radiusInMeters < 0)
{
throw new IllegalA... | [
"public",
"TransportApiResult",
"<",
"List",
"<",
"Agency",
">",
">",
"getAgenciesNearby",
"(",
"AgencyQueryOptions",
"options",
",",
"double",
"latitude",
",",
"double",
"longitude",
",",
"int",
"radiusInMeters",
")",
"{",
"if",
"(",
"options",
"==",
"null",
... | Gets a list of agencies nearby ordered by distance from the point specified.
@param options Options to limit the results by. Default: AgencyQueryOptions.defaultQueryOptions()
@param latitude Latitude in decimal degrees.
@param longitude Longitude in decimal degrees.
@param radiusInMeters Radius in meters to ... | [
"Gets",
"a",
"list",
"of",
"agencies",
"nearby",
"ordered",
"by",
"distance",
"from",
"the",
"point",
"specified",
"."
] | train | https://github.com/WhereIsMyTransport/TransportApiSdk.Java/blob/f4ade7046c8dadfcb2976ee354f85f67a6e930a2/transportapisdk/src/main/java/transportapisdk/TransportApiClient.java#L109-L122 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ParameterMapper.java | ParameterMapper.requestParamaterToObject | public static <T> T requestParamaterToObject(NativeWebRequest req, Class<T> c) {
"""
Request paramater to object t.
@param <T> the type parameter
@param req the req
@param c the c
@return the t
"""
return requestParamaterToObject((HttpServletRequest) req.getNativeRequest(), c, "UTF-8");
} | java | public static <T> T requestParamaterToObject(NativeWebRequest req, Class<T> c) {
return requestParamaterToObject((HttpServletRequest) req.getNativeRequest(), c, "UTF-8");
} | [
"public",
"static",
"<",
"T",
">",
"T",
"requestParamaterToObject",
"(",
"NativeWebRequest",
"req",
",",
"Class",
"<",
"T",
">",
"c",
")",
"{",
"return",
"requestParamaterToObject",
"(",
"(",
"HttpServletRequest",
")",
"req",
".",
"getNativeRequest",
"(",
")",... | Request paramater to object t.
@param <T> the type parameter
@param req the req
@param c the c
@return the t | [
"Request",
"paramater",
"to",
"object",
"t",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ParameterMapper.java#L37-L39 |
medallia/Word2VecJava | src/main/java/com/medallia/word2vec/util/IO.java | IO.copyAndCloseBoth | public static int copyAndCloseBoth(Reader input, Writer output) throws IOException {
"""
Copy input to output and close both the input and output streams before returning
"""
try {
return copyAndCloseOutput(input, output);
} finally {
input.close();
}
} | java | public static int copyAndCloseBoth(Reader input, Writer output) throws IOException {
try {
return copyAndCloseOutput(input, output);
} finally {
input.close();
}
} | [
"public",
"static",
"int",
"copyAndCloseBoth",
"(",
"Reader",
"input",
",",
"Writer",
"output",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"copyAndCloseOutput",
"(",
"input",
",",
"output",
")",
";",
"}",
"finally",
"{",
"input",
".",
"close",
... | Copy input to output and close both the input and output streams before returning | [
"Copy",
"input",
"to",
"output",
"and",
"close",
"both",
"the",
"input",
"and",
"output",
"streams",
"before",
"returning"
] | train | https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/util/IO.java#L105-L111 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/storage/StorageFacade.java | StorageFacade.registerProvider | public static void registerProvider( String providerName, Class<? extends StorageProvider> providerClass ) {
"""
Register a new {@link StorageProvider}
@param providerName The name to use with the provider
@param providerClass The provider class
"""
if ( PROVIDERS.containsKey( providerName ) ) {
... | java | public static void registerProvider( String providerName, Class<? extends StorageProvider> providerClass )
{
if ( PROVIDERS.containsKey( providerName ) ) {
throw new IllegalArgumentException( "A provider already exists with the name " + providerName );
}
PROVIDERS.put( providerNa... | [
"public",
"static",
"void",
"registerProvider",
"(",
"String",
"providerName",
",",
"Class",
"<",
"?",
"extends",
"StorageProvider",
">",
"providerClass",
")",
"{",
"if",
"(",
"PROVIDERS",
".",
"containsKey",
"(",
"providerName",
")",
")",
"{",
"throw",
"new",... | Register a new {@link StorageProvider}
@param providerName The name to use with the provider
@param providerClass The provider class | [
"Register",
"a",
"new",
"{",
"@link",
"StorageProvider",
"}"
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/storage/StorageFacade.java#L63-L70 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/Matrix.java | Matrix.increment | public void increment(int i, int j, double value) {
"""
Alters the current matrix at index <i>(i,j)</i> to be equal to
<i>A<sub>i,j</sub> = A<sub>i,j</sub> + value</i>
@param i the row, starting from 0
@param j the column, starting from 0
@param value the value to add to the matrix coordinate
"""
i... | java | public void increment(int i, int j, double value)
{
if(Double.isNaN(value) || Double.isInfinite(value))
throw new ArithmeticException("Can not add a value " + value);
set(i, j, get(i, j)+value);
} | [
"public",
"void",
"increment",
"(",
"int",
"i",
",",
"int",
"j",
",",
"double",
"value",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"value",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"value",
")",
")",
"throw",
"new",
"ArithmeticException",
... | Alters the current matrix at index <i>(i,j)</i> to be equal to
<i>A<sub>i,j</sub> = A<sub>i,j</sub> + value</i>
@param i the row, starting from 0
@param j the column, starting from 0
@param value the value to add to the matrix coordinate | [
"Alters",
"the",
"current",
"matrix",
"at",
"index",
"<i",
">",
"(",
"i",
"j",
")",
"<",
"/",
"i",
">",
"to",
"be",
"equal",
"to",
"<i",
">",
"A<sub",
">",
"i",
"j<",
"/",
"sub",
">",
"=",
"A<sub",
">",
"i",
"j<",
"/",
"sub",
">",
"+",
"val... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L549-L554 |
apache/incubator-druid | server/src/main/java/org/apache/druid/initialization/Initialization.java | Initialization.getExtensionFilesToLoad | public static File[] getExtensionFilesToLoad(ExtensionsConfig config) {
"""
Find all the extension files that should be loaded by druid.
<p/>
If user explicitly specifies druid.extensions.loadList, then it will look for those extensions under root
extensions directory. If one of them is not found, druid will fa... | java | public static File[] getExtensionFilesToLoad(ExtensionsConfig config)
{
final File rootExtensionsDir = new File(config.getDirectory());
if (rootExtensionsDir.exists() && !rootExtensionsDir.isDirectory()) {
throw new ISE("Root extensions directory [%s] is not a directory!?", rootExtensionsDir);
}
... | [
"public",
"static",
"File",
"[",
"]",
"getExtensionFilesToLoad",
"(",
"ExtensionsConfig",
"config",
")",
"{",
"final",
"File",
"rootExtensionsDir",
"=",
"new",
"File",
"(",
"config",
".",
"getDirectory",
"(",
")",
")",
";",
"if",
"(",
"rootExtensionsDir",
".",... | Find all the extension files that should be loaded by druid.
<p/>
If user explicitly specifies druid.extensions.loadList, then it will look for those extensions under root
extensions directory. If one of them is not found, druid will fail loudly.
<p/>
If user doesn't specify druid.extension.toLoad (or its value is empt... | [
"Find",
"all",
"the",
"extension",
"files",
"that",
"should",
"be",
"loaded",
"by",
"druid",
".",
"<p",
"/",
">",
"If",
"user",
"explicitly",
"specifies",
"druid",
".",
"extensions",
".",
"loadList",
"then",
"it",
"will",
"look",
"for",
"those",
"extension... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/initialization/Initialization.java#L225-L254 |
samskivert/pythagoras | src/main/java/pythagoras/d/Frustum.java | Frustum.setToFrustum | public Frustum setToFrustum (
double left, double right, double bottom, double top, double near, double far) {
"""
Sets this frustum to one pointing in the Z- direction with the specified parameters
determining its size and shape (see the OpenGL documentation for <code>glFrustum</code>).
@return a refe... | java | public Frustum setToFrustum (
double left, double right, double bottom, double top, double near, double far) {
return setToProjection(left, right, bottom, top, near, far, Vector3.UNIT_Z, false, false);
} | [
"public",
"Frustum",
"setToFrustum",
"(",
"double",
"left",
",",
"double",
"right",
",",
"double",
"bottom",
",",
"double",
"top",
",",
"double",
"near",
",",
"double",
"far",
")",
"{",
"return",
"setToProjection",
"(",
"left",
",",
"right",
",",
"bottom",... | Sets this frustum to one pointing in the Z- direction with the specified parameters
determining its size and shape (see the OpenGL documentation for <code>glFrustum</code>).
@return a reference to this frustum, for chaining. | [
"Sets",
"this",
"frustum",
"to",
"one",
"pointing",
"in",
"the",
"Z",
"-",
"direction",
"with",
"the",
"specified",
"parameters",
"determining",
"its",
"size",
"and",
"shape",
"(",
"see",
"the",
"OpenGL",
"documentation",
"for",
"<code",
">",
"glFrustum<",
"... | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Frustum.java#L66-L69 |
looly/hutool | hutool-log/src/main/java/cn/hutool/log/dialect/jdk/JdkLog.java | JdkLog.logIfEnabled | private void logIfEnabled(Level level, Throwable throwable, String format, Object[] arguments) {
"""
打印对应等级的日志
@param level 等级
@param throwable 异常对象
@param format 消息模板
@param arguments 参数
"""
this.logIfEnabled(FQCN_SELF, level, throwable, format, arguments);
} | java | private void logIfEnabled(Level level, Throwable throwable, String format, Object[] arguments){
this.logIfEnabled(FQCN_SELF, level, throwable, format, arguments);
} | [
"private",
"void",
"logIfEnabled",
"(",
"Level",
"level",
",",
"Throwable",
"throwable",
",",
"String",
"format",
",",
"Object",
"[",
"]",
"arguments",
")",
"{",
"this",
".",
"logIfEnabled",
"(",
"FQCN_SELF",
",",
"level",
",",
"throwable",
",",
"format",
... | 打印对应等级的日志
@param level 等级
@param throwable 异常对象
@param format 消息模板
@param arguments 参数 | [
"打印对应等级的日志"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-log/src/main/java/cn/hutool/log/dialect/jdk/JdkLog.java#L167-L169 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/cdn/CdnClient.java | CdnClient.setRequestAuth | public SetRequestAuthResponse setRequestAuth(SetRequestAuthRequest request) {
"""
Set the request authentication.
@param request The request containing all of the options related to the update request.
@return Result of the setHTTPSAcceleration operation returned by the service.
"""
checkNotNull(re... | java | public SetRequestAuthResponse setRequestAuth(SetRequestAuthRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
InternalRequest internalRequest =
createRequest(request, HttpMethodName.PUT, DOMAIN, request.getDomain(), "config");
internalRequest.... | [
"public",
"SetRequestAuthResponse",
"setRequestAuth",
"(",
"SetRequestAuthRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"createRequest",
"(",
"request",... | Set the request authentication.
@param request The request containing all of the options related to the update request.
@return Result of the setHTTPSAcceleration operation returned by the service. | [
"Set",
"the",
"request",
"authentication",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cdn/CdnClient.java#L494-L501 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.readX509Certificate | public static Certificate readX509Certificate(InputStream in, char[] password, String alias) {
"""
读取X.509 Certification文件<br>
Certification为证书文件<br>
see: http://snowolf.iteye.com/blog/391931
@param in {@link InputStream} 如果想从文件读取.cer文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@param password 密码
... | java | public static Certificate readX509Certificate(InputStream in, char[] password, String alias) {
return readCertificate(X509, in, password, alias);
} | [
"public",
"static",
"Certificate",
"readX509Certificate",
"(",
"InputStream",
"in",
",",
"char",
"[",
"]",
"password",
",",
"String",
"alias",
")",
"{",
"return",
"readCertificate",
"(",
"X509",
",",
"in",
",",
"password",
",",
"alias",
")",
";",
"}"
] | 读取X.509 Certification文件<br>
Certification为证书文件<br>
see: http://snowolf.iteye.com/blog/391931
@param in {@link InputStream} 如果想从文件读取.cer文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@param password 密码
@param alias 别名
@return {@link KeyStore}
@since 4.4.1 | [
"读取X",
".",
"509",
"Certification文件<br",
">",
"Certification为证书文件<br",
">",
"see",
":",
"http",
":",
"//",
"snowolf",
".",
"iteye",
".",
"com",
"/",
"blog",
"/",
"391931"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L629-L631 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java | HttpRequest.handleRedirect | public boolean handleRedirect(int statusCode, HttpHeaders responseHeaders) {
"""
Sets up this request object to handle the necessary redirect if redirects are turned on, it is
a redirect status code and the header has a location.
<p>When the status code is {@code 303} the method on the request is changed to a ... | java | public boolean handleRedirect(int statusCode, HttpHeaders responseHeaders) {
String redirectLocation = responseHeaders.getLocation();
if (getFollowRedirects()
&& HttpStatusCodes.isRedirect(statusCode)
&& redirectLocation != null) {
// resolve the redirect location relative to the current l... | [
"public",
"boolean",
"handleRedirect",
"(",
"int",
"statusCode",
",",
"HttpHeaders",
"responseHeaders",
")",
"{",
"String",
"redirectLocation",
"=",
"responseHeaders",
".",
"getLocation",
"(",
")",
";",
"if",
"(",
"getFollowRedirects",
"(",
")",
"&&",
"HttpStatusC... | Sets up this request object to handle the necessary redirect if redirects are turned on, it is
a redirect status code and the header has a location.
<p>When the status code is {@code 303} the method on the request is changed to a GET as per the
RFC2616 specification. On a redirect, it also removes the {@code "Authoriz... | [
"Sets",
"up",
"this",
"request",
"object",
"to",
"handle",
"the",
"necessary",
"redirect",
"if",
"redirects",
"are",
"turned",
"on",
"it",
"is",
"a",
"redirect",
"status",
"code",
"and",
"the",
"header",
"has",
"a",
"location",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java#L1153-L1176 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.findBinding | public <S, T> Binding<S, T> findBinding(Class<S> source, Class<T> target) {
"""
Resolve a Binding with the given source and target class.
A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
The source class is considered the owning class of the binding. The sourc... | java | public <S, T> Binding<S, T> findBinding(Class<S> source, Class<T> target) {
return findBinding(new ConverterKey<S,T>(source, target, DefaultBinding.class));
} | [
"public",
"<",
"S",
",",
"T",
">",
"Binding",
"<",
"S",
",",
"T",
">",
"findBinding",
"(",
"Class",
"<",
"S",
">",
"source",
",",
"Class",
"<",
"T",
">",
"target",
")",
"{",
"return",
"findBinding",
"(",
"new",
"ConverterKey",
"<",
"S",
",",
"T",... | Resolve a Binding with the given source and target class.
A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
The source class is considered the owning class of the binding. The source can be marshalled
into the target class. Similarly, the target can be unmarshalled to ... | [
"Resolve",
"a",
"Binding",
"with",
"the",
"given",
"source",
"and",
"target",
"class",
".",
"A",
"binding",
"unifies",
"a",
"marshaller",
"and",
"an",
"unmarshaller",
"and",
"both",
"must",
"be",
"available",
"to",
"resolve",
"a",
"binding",
"."
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L847-L849 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/products/CMSOption.java | CMSOption.getValue | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value c... | java | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
/*
* Calculate value of the swap at exercise date on each path (beware of perfect forsight - all rates are simulationTime=exerciseDate)
*/
RandomVariable valueFixLeg = new... | [
"@",
"Override",
"public",
"RandomVariable",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationModel",
"model",
")",
"throws",
"CalculationException",
"{",
"/*\n\t\t * Calculate value of the swap at exercise date on each path (beware of perfect forsight -... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/CMSOption.java#L65-L122 |
google/closure-templates | java/src/com/google/template/soy/pysrc/restricted/PyExprUtils.java | PyExprUtils.convertMapToOrderedDict | public static PyExpr convertMapToOrderedDict(Map<PyExpr, PyExpr> dict) {
"""
Convert a java Map to valid PyExpr as dict.
@param dict A Map to be converted to PyExpr as a dictionary, both key and value should be
PyExpr.
"""
List<String> values = new ArrayList<>();
for (Map.Entry<PyExpr, PyExpr> ent... | java | public static PyExpr convertMapToOrderedDict(Map<PyExpr, PyExpr> dict) {
List<String> values = new ArrayList<>();
for (Map.Entry<PyExpr, PyExpr> entry : dict.entrySet()) {
values.add("(" + entry.getKey().getText() + ", " + entry.getValue().getText() + ")");
}
Joiner joiner = Joiner.on(", ");
... | [
"public",
"static",
"PyExpr",
"convertMapToOrderedDict",
"(",
"Map",
"<",
"PyExpr",
",",
"PyExpr",
">",
"dict",
")",
"{",
"List",
"<",
"String",
">",
"values",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"PyExpr"... | Convert a java Map to valid PyExpr as dict.
@param dict A Map to be converted to PyExpr as a dictionary, both key and value should be
PyExpr. | [
"Convert",
"a",
"java",
"Map",
"to",
"valid",
"PyExpr",
"as",
"dict",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/restricted/PyExprUtils.java#L222-L231 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Image.java | Image.scalePercent | public void scalePercent(float percentX, float percentY) {
"""
Scale the width and height of an image to a certain percentage.
@param percentX
the scaling percentage of the width
@param percentY
the scaling percentage of the height
"""
plainWidth = (getWidth() * percentX) / 100f;
plainHeight = (getHe... | java | public void scalePercent(float percentX, float percentY) {
plainWidth = (getWidth() * percentX) / 100f;
plainHeight = (getHeight() * percentY) / 100f;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
} | [
"public",
"void",
"scalePercent",
"(",
"float",
"percentX",
",",
"float",
"percentY",
")",
"{",
"plainWidth",
"=",
"(",
"getWidth",
"(",
")",
"*",
"percentX",
")",
"/",
"100f",
";",
"plainHeight",
"=",
"(",
"getHeight",
"(",
")",
"*",
"percentY",
")",
... | Scale the width and height of an image to a certain percentage.
@param percentX
the scaling percentage of the width
@param percentY
the scaling percentage of the height | [
"Scale",
"the",
"width",
"and",
"height",
"of",
"an",
"image",
"to",
"a",
"certain",
"percentage",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Image.java#L1296-L1303 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryRunner.java | QueryRunner.runPartitionScanQueryOnPartitionChunk | public ResultSegment runPartitionScanQueryOnPartitionChunk(Query query, int partitionId, int tableIndex, int fetchSize) {
"""
Runs a query on a chunk of a single partition. The chunk is defined by the offset {@code tableIndex}
and the soft limit {@code fetchSize}.
@param query the query
@param partition... | java | public ResultSegment runPartitionScanQueryOnPartitionChunk(Query query, int partitionId, int tableIndex, int fetchSize) {
MapContainer mapContainer = mapServiceContext.getMapContainer(query.getMapName());
Predicate predicate = queryOptimizer.optimize(query.getPredicate(), mapContainer.getIndexes(partiti... | [
"public",
"ResultSegment",
"runPartitionScanQueryOnPartitionChunk",
"(",
"Query",
"query",
",",
"int",
"partitionId",
",",
"int",
"tableIndex",
",",
"int",
"fetchSize",
")",
"{",
"MapContainer",
"mapContainer",
"=",
"mapServiceContext",
".",
"getMapContainer",
"(",
"q... | Runs a query on a chunk of a single partition. The chunk is defined by the offset {@code tableIndex}
and the soft limit {@code fetchSize}.
@param query the query
@param partitionId the partition which is queried
@param tableIndex the index at which to start querying
@param fetchSize the soft limit for the num... | [
"Runs",
"a",
"query",
"on",
"a",
"chunk",
"of",
"a",
"single",
"partition",
".",
"The",
"chunk",
"is",
"defined",
"by",
"the",
"offset",
"{",
"@code",
"tableIndex",
"}",
"and",
"the",
"soft",
"limit",
"{",
"@code",
"fetchSize",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryRunner.java#L88-L99 |
threerings/nenya | core/src/main/java/com/threerings/media/tile/Tile.java | Tile.paint | public void paint (Graphics2D gfx, int x, int y) {
"""
Render the tile image at the specified position in the given
graphics context.
"""
_mirage.paint(gfx, x, y);
} | java | public void paint (Graphics2D gfx, int x, int y)
{
_mirage.paint(gfx, x, y);
} | [
"public",
"void",
"paint",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"_mirage",
".",
"paint",
"(",
"gfx",
",",
"x",
",",
"y",
")",
";",
"}"
] | Render the tile image at the specified position in the given
graphics context. | [
"Render",
"the",
"tile",
"image",
"at",
"the",
"specified",
"position",
"in",
"the",
"given",
"graphics",
"context",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/Tile.java#L119-L122 |
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsInner.java | CollectionPartitionsInner.listMetricsAsync | public Observable<List<PartitionMetricInner>> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) {
"""
Retrieves the metrics determined by the given filter for the given collection, split by partition.
@param resourceGroupName Name of an Azure... | java | public Observable<List<PartitionMetricInner>> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) {
return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).map(new Func1<ServiceResponse<Lis... | [
"public",
"Observable",
"<",
"List",
"<",
"PartitionMetricInner",
">",
">",
"listMetricsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"databaseRid",
",",
"String",
"collectionRid",
",",
"String",
"filter",
")",
"{",
"retu... | Retrieves the metrics determined by the given filter for the given collection, split by partition.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param databaseRid Cosmos DB database rid.
@param collectionRid Cosmos DB collection rid.
@param filter An ODa... | [
"Retrieves",
"the",
"metrics",
"determined",
"by",
"the",
"given",
"filter",
"for",
"the",
"given",
"collection",
"split",
"by",
"partition",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsInner.java#L109-L116 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java | GVRPose.getLocalRotation | public void getLocalRotation(int boneindex, Quaternionf q) {
"""
Gets the local rotation for a bone given its index.
@param boneindex zero based index of bone whose rotation is wanted.
@return local rotation for the designated bone as a quaternion.
@see #setLocalRotation
@see #setWorldRotations
@see #setWor... | java | public void getLocalRotation(int boneindex, Quaternionf q)
{
Bone bone = mBones[boneindex];
if ((bone.Changed & (WORLD_POS | WORLD_ROT)) != 0)
{
calcLocal(bone, mSkeleton.getParentBoneIndex(boneindex));
}
bone.LocalMatrix.getUnnormalizedRotation(q);
q.nor... | [
"public",
"void",
"getLocalRotation",
"(",
"int",
"boneindex",
",",
"Quaternionf",
"q",
")",
"{",
"Bone",
"bone",
"=",
"mBones",
"[",
"boneindex",
"]",
";",
"if",
"(",
"(",
"bone",
".",
"Changed",
"&",
"(",
"WORLD_POS",
"|",
"WORLD_ROT",
")",
")",
"!="... | Gets the local rotation for a bone given its index.
@param boneindex zero based index of bone whose rotation is wanted.
@return local rotation for the designated bone as a quaternion.
@see #setLocalRotation
@see #setWorldRotations
@see #setWorldMatrix
@see GVRSkeleton#setBoneAxis | [
"Gets",
"the",
"local",
"rotation",
"for",
"a",
"bone",
"given",
"its",
"index",
".",
"@param",
"boneindex",
"zero",
"based",
"index",
"of",
"bone",
"whose",
"rotation",
"is",
"wanted",
".",
"@return",
"local",
"rotation",
"for",
"the",
"designated",
"bone",... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java#L588-L598 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/process/Morphology.java | Morphology.stemStatic | public static WordTag stemStatic(String word, String tag) {
"""
Return a new WordTag which has the lemma as the value of word().
The default is to lowercase non-proper-nouns, unless options have
been set.
"""
initStaticLexer();
return new WordTag(lemmatize(word, tag, staticLexer, staticLexer.option... | java | public static WordTag stemStatic(String word, String tag) {
initStaticLexer();
return new WordTag(lemmatize(word, tag, staticLexer, staticLexer.option(1)), tag);
} | [
"public",
"static",
"WordTag",
"stemStatic",
"(",
"String",
"word",
",",
"String",
"tag",
")",
"{",
"initStaticLexer",
"(",
")",
";",
"return",
"new",
"WordTag",
"(",
"lemmatize",
"(",
"word",
",",
"tag",
",",
"staticLexer",
",",
"staticLexer",
".",
"optio... | Return a new WordTag which has the lemma as the value of word().
The default is to lowercase non-proper-nouns, unless options have
been set. | [
"Return",
"a",
"new",
"WordTag",
"which",
"has",
"the",
"lemma",
"as",
"the",
"value",
"of",
"word",
"()",
".",
"The",
"default",
"is",
"to",
"lowercase",
"non",
"-",
"proper",
"-",
"nouns",
"unless",
"options",
"have",
"been",
"set",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/process/Morphology.java#L178-L181 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.stripAndTrim | public String stripAndTrim(String str) {
"""
Strips all symbols, punctuation, whitespace and control chars from a string.
@param str a dirty string
@return a clean string
"""
MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
params.putSingle("string", str);
return getEntity(invokeGet(... | java | public String stripAndTrim(String str) {
MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
params.putSingle("string", str);
return getEntity(invokeGet("utils/nosymbols", params), String.class);
} | [
"public",
"String",
"stripAndTrim",
"(",
"String",
"str",
")",
"{",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"MultivaluedHashMap",
"<>",
"(",
")",
";",
"params",
".",
"putSingle",
"(",
"\"string\"",
",",
"str",
")",
";",
... | Strips all symbols, punctuation, whitespace and control chars from a string.
@param str a dirty string
@return a clean string | [
"Strips",
"all",
"symbols",
"punctuation",
"whitespace",
"and",
"control",
"chars",
"from",
"a",
"string",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L1221-L1225 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/javax/xml/validation/SchemaFactory.java | SchemaFactory.setFeature | public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
"""
Set the value of a feature flag.
<p>
Feature can be used to control the way a {@link SchemaFactory}
parses schemas, although {@link SchemaFactory}s are not required
to recognize any specific fe... | java | public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException("name == null");
}
throw new SAXNotRecognizedException(name);
} | [
"public",
"void",
"setFeature",
"(",
"String",
"name",
",",
"boolean",
"value",
")",
"throws",
"SAXNotRecognizedException",
",",
"SAXNotSupportedException",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"name == nul... | Set the value of a feature flag.
<p>
Feature can be used to control the way a {@link SchemaFactory}
parses schemas, although {@link SchemaFactory}s are not required
to recognize any specific feature names.</p>
<p>The feature name is any fully-qualified URI. It is
possible for a {@link SchemaFactory} to expose a feat... | [
"Set",
"the",
"value",
"of",
"a",
"feature",
"flag",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/javax/xml/validation/SchemaFactory.java#L316-L321 |
MTDdk/jawn | jawn-server/src/main/java/net/javapla/jawn/server/CookieHelper.java | CookieHelper.setHttpOnlyReflect | static void setHttpOnlyReflect(net.javapla.jawn.core.http.Cookie awCookie, javax.servlet.http.Cookie servletCookie) {
"""
Need to call this by reflection for backwards compatibility with Servlet 2.5
"""
try {
servletCookie.getClass().getMethod("setHttpOnly", boolean.class).invoke(servletCoo... | java | static void setHttpOnlyReflect(net.javapla.jawn.core.http.Cookie awCookie, javax.servlet.http.Cookie servletCookie){
try {
servletCookie.getClass().getMethod("setHttpOnly", boolean.class).invoke(servletCookie, awCookie.isHttpOnly());
} catch (Exception e) {
// Cookie.logger.warn("... | [
"static",
"void",
"setHttpOnlyReflect",
"(",
"net",
".",
"javapla",
".",
"jawn",
".",
"core",
".",
"http",
".",
"Cookie",
"awCookie",
",",
"javax",
".",
"servlet",
".",
"http",
".",
"Cookie",
"servletCookie",
")",
"{",
"try",
"{",
"servletCookie",
".",
"... | Need to call this by reflection for backwards compatibility with Servlet 2.5 | [
"Need",
"to",
"call",
"this",
"by",
"reflection",
"for",
"backwards",
"compatibility",
"with",
"Servlet",
"2",
".",
"5"
] | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-server/src/main/java/net/javapla/jawn/server/CookieHelper.java#L44-L50 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/AABBUtils.java | AABBUtils.getCollisionBoundingBoxes | public static AxisAlignedBB[] getCollisionBoundingBoxes(World world, Block block, BlockPos pos) {
"""
Gets the collision {@link AxisAlignedBB} for the {@link Block} as the {@link BlockPos} coordinates.
@param world the world
@param block the block
@param pos the pos
@return the collision bounding boxes
"... | java | public static AxisAlignedBB[] getCollisionBoundingBoxes(World world, Block block, BlockPos pos)
{
return getCollisionBoundingBoxes(world, new MBlockState(pos, block), false);
} | [
"public",
"static",
"AxisAlignedBB",
"[",
"]",
"getCollisionBoundingBoxes",
"(",
"World",
"world",
",",
"Block",
"block",
",",
"BlockPos",
"pos",
")",
"{",
"return",
"getCollisionBoundingBoxes",
"(",
"world",
",",
"new",
"MBlockState",
"(",
"pos",
",",
"block",
... | Gets the collision {@link AxisAlignedBB} for the {@link Block} as the {@link BlockPos} coordinates.
@param world the world
@param block the block
@param pos the pos
@return the collision bounding boxes | [
"Gets",
"the",
"collision",
"{",
"@link",
"AxisAlignedBB",
"}",
"for",
"the",
"{",
"@link",
"Block",
"}",
"as",
"the",
"{",
"@link",
"BlockPos",
"}",
"coordinates",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/AABBUtils.java#L405-L408 |
javagl/Common | src/main/java/de/javagl/common/beans/PropertyChangeListeners.java | PropertyChangeListeners.addDeepLogger | public static void addDeepLogger(Object object, Level level) {
"""
Attaches a deep property change listener to the given object, that
generates logging information about the property change events,
and prints them as log messages.
@param object The object
@param level The log level
"""
addDeepLo... | java | public static void addDeepLogger(Object object, Level level)
{
addDeepLogger(object, m -> logger.log(level, m));
} | [
"public",
"static",
"void",
"addDeepLogger",
"(",
"Object",
"object",
",",
"Level",
"level",
")",
"{",
"addDeepLogger",
"(",
"object",
",",
"m",
"->",
"logger",
".",
"log",
"(",
"level",
",",
"m",
")",
")",
";",
"}"
] | Attaches a deep property change listener to the given object, that
generates logging information about the property change events,
and prints them as log messages.
@param object The object
@param level The log level | [
"Attaches",
"a",
"deep",
"property",
"change",
"listener",
"to",
"the",
"given",
"object",
"that",
"generates",
"logging",
"information",
"about",
"the",
"property",
"change",
"events",
"and",
"prints",
"them",
"as",
"log",
"messages",
"."
] | train | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/beans/PropertyChangeListeners.java#L71-L74 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java | RegistriesInner.scheduleRunAsync | public Observable<RunInner> scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) {
"""
Schedules a new run based on the request parameters and add it to the run queue.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param regis... | java | public Observable<RunInner> scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) {
return scheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).map(new Func1<ServiceResponse<RunInner>, RunInner>() {
@Override
public RunInner ca... | [
"public",
"Observable",
"<",
"RunInner",
">",
"scheduleRunAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"RunRequest",
"runRequest",
")",
"{",
"return",
"scheduleRunWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
... | Schedules a new run based on the request parameters and add it to the run queue.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param runRequest The parameters of a run that needs to scheduled.
@throws IllegalArg... | [
"Schedules",
"a",
"new",
"run",
"based",
"on",
"the",
"request",
"parameters",
"and",
"add",
"it",
"to",
"the",
"run",
"queue",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java#L1754-L1761 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java | LiveEventsInner.createAsync | public Observable<LiveEventInner> createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) {
"""
Create Live Event.
Creates a Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountNa... | java | public Observable<LiveEventInner> createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) {
return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).map(new Func1<ServiceResponse<LiveEventInn... | [
"public",
"Observable",
"<",
"LiveEventInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"liveEventName",
",",
"LiveEventInner",
"parameters",
",",
"Boolean",
"autoStart",
")",
"{",
"return",
"createWithServic... | Create Live Event.
Creates a Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@param parameters Live Event properties needed for creation.
@param autoStart The flag ind... | [
"Create",
"Live",
"Event",
".",
"Creates",
"a",
"Live",
"Event",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java#L490-L497 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactory.java | DetectorFactory.getReportedBugPatterns | public Set<BugPattern> getReportedBugPatterns() {
"""
Get set of all BugPatterns this detector reports. An empty set means that
we don't know what kind of bug patterns might be reported.
"""
Set<BugPattern> result = new TreeSet<>();
StringTokenizer tok = new StringTokenizer(reports, ",");
... | java | public Set<BugPattern> getReportedBugPatterns() {
Set<BugPattern> result = new TreeSet<>();
StringTokenizer tok = new StringTokenizer(reports, ",");
while (tok.hasMoreTokens()) {
String type = tok.nextToken();
BugPattern bugPattern = DetectorFactoryCollection.instance().l... | [
"public",
"Set",
"<",
"BugPattern",
">",
"getReportedBugPatterns",
"(",
")",
"{",
"Set",
"<",
"BugPattern",
">",
"result",
"=",
"new",
"TreeSet",
"<>",
"(",
")",
";",
"StringTokenizer",
"tok",
"=",
"new",
"StringTokenizer",
"(",
"reports",
",",
"\",\"",
")... | Get set of all BugPatterns this detector reports. An empty set means that
we don't know what kind of bug patterns might be reported. | [
"Get",
"set",
"of",
"all",
"BugPatterns",
"this",
"detector",
"reports",
".",
"An",
"empty",
"set",
"means",
"that",
"we",
"don",
"t",
"know",
"what",
"kind",
"of",
"bug",
"patterns",
"might",
"be",
"reported",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactory.java#L345-L356 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.reportSyntaxError | private void reportSyntaxError(JCDiagnostic.DiagnosticPosition diagPos, String key, Object... args) {
"""
Report a syntax error using the given DiagnosticPosition object and
arguments, unless one was already reported at the same position.
"""
int pos = diagPos.getPreferredPosition();
if (pos >... | java | private void reportSyntaxError(JCDiagnostic.DiagnosticPosition diagPos, String key, Object... args) {
int pos = diagPos.getPreferredPosition();
if (pos > S.errPos() || pos == Position.NOPOS) {
if (token.kind == EOF) {
error(diagPos, "premature.eof");
} else {
... | [
"private",
"void",
"reportSyntaxError",
"(",
"JCDiagnostic",
".",
"DiagnosticPosition",
"diagPos",
",",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"int",
"pos",
"=",
"diagPos",
".",
"getPreferredPosition",
"(",
")",
";",
"if",
"(",
"pos",
">",
... | Report a syntax error using the given DiagnosticPosition object and
arguments, unless one was already reported at the same position. | [
"Report",
"a",
"syntax",
"error",
"using",
"the",
"given",
"DiagnosticPosition",
"object",
"and",
"arguments",
"unless",
"one",
"was",
"already",
"reported",
"at",
"the",
"same",
"position",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavacParser.java#L469-L482 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java | TotalOrderPartitioner.buildTrie | private TrieNode buildTrie(BinaryComparable[] splits, int lower,
int upper, byte[] prefix, int maxDepth) {
"""
Given a sorted set of cut points, build a trie that will find the correct
partition quickly.
@param splits the list of cut points
@param lower the lower bound of partitions 0..numPartitions-1
@p... | java | private TrieNode buildTrie(BinaryComparable[] splits, int lower,
int upper, byte[] prefix, int maxDepth) {
final int depth = prefix.length;
if (depth >= maxDepth || lower == upper) {
return new LeafTrieNode(depth, splits, lower, upper);
}
InnerTrieNode result = new InnerTrieNode(depth);
... | [
"private",
"TrieNode",
"buildTrie",
"(",
"BinaryComparable",
"[",
"]",
"splits",
",",
"int",
"lower",
",",
"int",
"upper",
",",
"byte",
"[",
"]",
"prefix",
",",
"int",
"maxDepth",
")",
"{",
"final",
"int",
"depth",
"=",
"prefix",
".",
"length",
";",
"i... | Given a sorted set of cut points, build a trie that will find the correct
partition quickly.
@param splits the list of cut points
@param lower the lower bound of partitions 0..numPartitions-1
@param upper the upper bound of partitions 0..numPartitions-1
@param prefix the prefix that we have already checked against
@par... | [
"Given",
"a",
"sorted",
"set",
"of",
"cut",
"points",
"build",
"a",
"trie",
"that",
"will",
"find",
"the",
"correct",
"partition",
"quickly",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java#L235-L263 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java | CommerceNotificationAttachmentPersistenceImpl.findAll | @Override
public List<CommerceNotificationAttachment> findAll(int start, int end) {
"""
Returns a range of all the commerce notification attachments.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they ... | java | @Override
public List<CommerceNotificationAttachment> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationAttachment",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce notification attachments.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Settin... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"notification",
"attachments",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java#L2729-L2732 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java | CPDefinitionPersistenceImpl.findByGroupId | @Override
public List<CPDefinition> findByGroupId(long groupId, int start, int end) {
"""
Returns a range of all the cp definitions where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, ... | java | @Override
public List<CPDefinition> findByGroupId(long groupId, int start, int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinition",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp definitions where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Set... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definitions",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java#L1524-L1527 |
wcm-io/wcm-io-wcm | commons/src/main/java/io/wcm/wcm/commons/util/Template.java | Template.forPage | public static TemplatePathInfo forPage(@NotNull Page page, @NotNull TemplatePathInfo @NotNull... templates) {
"""
Lookup template for given page.
@param page Page
@param templates Templates
@return The {@link TemplatePathInfo} instance or null for unknown template paths
"""
if (page == null || templates... | java | public static TemplatePathInfo forPage(@NotNull Page page, @NotNull TemplatePathInfo @NotNull... templates) {
if (page == null || templates == null) {
return null;
}
String templatePath = page.getProperties().get(NameConstants.PN_TEMPLATE, String.class);
return forTemplatePath(templatePath, templa... | [
"public",
"static",
"TemplatePathInfo",
"forPage",
"(",
"@",
"NotNull",
"Page",
"page",
",",
"@",
"NotNull",
"TemplatePathInfo",
"@",
"NotNull",
".",
".",
".",
"templates",
")",
"{",
"if",
"(",
"page",
"==",
"null",
"||",
"templates",
"==",
"null",
")",
... | Lookup template for given page.
@param page Page
@param templates Templates
@return The {@link TemplatePathInfo} instance or null for unknown template paths | [
"Lookup",
"template",
"for",
"given",
"page",
"."
] | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/commons/src/main/java/io/wcm/wcm/commons/util/Template.java#L158-L164 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java | JBBPOut.Short | public JBBPOut Short(final String str, final JBBPBitOrder bitOrder) throws IOException {
"""
Write codes of chars as 16 bit values into the stream.
@param str the string which chars will be written, must not be null
@param bitOrder the bit outOrder
@return the DSL session
@throws IOException it will be ... | java | public JBBPOut Short(final String str, final JBBPBitOrder bitOrder) throws IOException {
assertNotEnded();
if (this.processCommands) {
final boolean msb0 = bitOrder == JBBPBitOrder.MSB0;
for (int i = 0; i < str.length(); i++) {
short value = (short) str.charAt(i);
if (msb0) {
... | [
"public",
"JBBPOut",
"Short",
"(",
"final",
"String",
"str",
",",
"final",
"JBBPBitOrder",
"bitOrder",
")",
"throws",
"IOException",
"{",
"assertNotEnded",
"(",
")",
";",
"if",
"(",
"this",
".",
"processCommands",
")",
"{",
"final",
"boolean",
"msb0",
"=",
... | Write codes of chars as 16 bit values into the stream.
@param str the string which chars will be written, must not be null
@param bitOrder the bit outOrder
@return the DSL session
@throws IOException it will be thrown for transport errors
@since 1.1 | [
"Write",
"codes",
"of",
"chars",
"as",
"16",
"bit",
"values",
"into",
"the",
"stream",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java#L686-L699 |
ltearno/hexa.tools | hexa.persistence/src/main/java/fr/lteconsulting/hexa/persistence/client/hqlParser.java | hqlParser.inList | public final hqlParser.inList_return inList() throws RecognitionException {
"""
hql.g:486:1: inList : compoundExpr -> ^( IN_LIST[\"inList\"] compoundExpr ) ;
"""
hqlParser.inList_return retval = new hqlParser.inList_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope... | java | public final hqlParser.inList_return inList() throws RecognitionException {
hqlParser.inList_return retval = new hqlParser.inList_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope compoundExpr180 =null;
RewriteRuleSubtreeStream stream_compoundExpr=new RewriteRuleSubtreeS... | [
"public",
"final",
"hqlParser",
".",
"inList_return",
"inList",
"(",
")",
"throws",
"RecognitionException",
"{",
"hqlParser",
".",
"inList_return",
"retval",
"=",
"new",
"hqlParser",
".",
"inList_return",
"(",
")",
";",
"retval",
".",
"start",
"=",
"input",
".... | hql.g:486:1: inList : compoundExpr -> ^( IN_LIST[\"inList\"] compoundExpr ) ; | [
"hql",
".",
"g",
":",
"486",
":",
"1",
":",
"inList",
":",
"compoundExpr",
"-",
">",
"^",
"(",
"IN_LIST",
"[",
"\\",
"inList",
"\\",
"]",
"compoundExpr",
")",
";"
] | train | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.persistence/src/main/java/fr/lteconsulting/hexa/persistence/client/hqlParser.java#L5941-L6003 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.ensureRight | public static String ensureRight(final String value, final String suffix, boolean caseSensitive) {
"""
Ensures that the value ends with suffix. If it doesn't, it's appended.
@param value The input String
@param suffix The substr to be ensured to be right
@param caseSensitive Use case (in-)sensi... | java | public static String ensureRight(final String value, final String suffix, boolean caseSensitive) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
return endsWith(value, suffix, caseSensitive) ? value : append(value, suffix);
} | [
"public",
"static",
"String",
"ensureRight",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"suffix",
",",
"boolean",
"caseSensitive",
")",
"{",
"validate",
"(",
"value",
",",
"NULL_STRING_PREDICATE",
",",
"NULL_STRING_MSG_SUPPLIER",
")",
";",
"return",
... | Ensures that the value ends with suffix. If it doesn't, it's appended.
@param value The input String
@param suffix The substr to be ensured to be right
@param caseSensitive Use case (in-)sensitive matching for determining if value already ends with suffix
@return The string which is guarenteed to start ... | [
"Ensures",
"that",
"the",
"value",
"ends",
"with",
"suffix",
".",
"If",
"it",
"doesn",
"t",
"it",
"s",
"appended",
"."
] | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L403-L406 |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java | AbstractProperty.encodeFromRaw | public VALUETO encodeFromRaw(Object o, Optional<CassandraOptions> cassandraOptions) {
"""
Encode given java raw object to CQL-compatible value using Achilles codec system and a CassandraOptions
containing a runtime SchemaNameProvider. Use the
<br/>
<br/>
<pre class="code"><code class="java">
CassandraOptions.... | java | public VALUETO encodeFromRaw(Object o, Optional<CassandraOptions> cassandraOptions) {
if (o == null) return null;
return encodeFromRawInternal(o, cassandraOptions);
} | [
"public",
"VALUETO",
"encodeFromRaw",
"(",
"Object",
"o",
",",
"Optional",
"<",
"CassandraOptions",
">",
"cassandraOptions",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"return",
"null",
";",
"return",
"encodeFromRawInternal",
"(",
"o",
",",
"cassandraOptions... | Encode given java raw object to CQL-compatible value using Achilles codec system and a CassandraOptions
containing a runtime SchemaNameProvider. Use the
<br/>
<br/>
<pre class="code"><code class="java">
CassandraOptions.withSchemaNameProvider(SchemaNameProvider provider)
</code></pre>
<br/>
static method to build such ... | [
"Encode",
"given",
"java",
"raw",
"object",
"to",
"CQL",
"-",
"compatible",
"value",
"using",
"Achilles",
"codec",
"system",
"and",
"a",
"CassandraOptions",
"containing",
"a",
"runtime",
"SchemaNameProvider",
".",
"Use",
"the",
"<br",
"/",
">",
"<br",
"/",
"... | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java#L118-L121 |
zaproxy/zaproxy | src/org/parosproxy/paros/core/scanner/AbstractPlugin.java | AbstractPlugin.matchBodyPattern | protected boolean matchBodyPattern(HttpMessage msg, Pattern pattern, StringBuilder sb) {
"""
Check if the given pattern can be found in the msg body. If the supplied
StringBuilder is not null, append the result to the StringBuilder.
@param msg the message that will be checked
@param pattern the pattern that w... | java | protected boolean matchBodyPattern(HttpMessage msg, Pattern pattern, StringBuilder sb) { // ZAP: Changed the type of the parameter "sb" to StringBuilder.
Matcher matcher = pattern.matcher(msg.getResponseBody().toString());
boolean result = matcher.find();
if (result) {
if (sb != ... | [
"protected",
"boolean",
"matchBodyPattern",
"(",
"HttpMessage",
"msg",
",",
"Pattern",
"pattern",
",",
"StringBuilder",
"sb",
")",
"{",
"// ZAP: Changed the type of the parameter \"sb\" to StringBuilder.\r",
"Matcher",
"matcher",
"=",
"pattern",
".",
"matcher",
"(",
"msg"... | Check if the given pattern can be found in the msg body. If the supplied
StringBuilder is not null, append the result to the StringBuilder.
@param msg the message that will be checked
@param pattern the pattern that will be used
@param sb where the regex match should be appended
@return true if the pattern can be foun... | [
"Check",
"if",
"the",
"given",
"pattern",
"can",
"be",
"found",
"in",
"the",
"msg",
"body",
".",
"If",
"the",
"supplied",
"StringBuilder",
"is",
"not",
"null",
"append",
"the",
"result",
"to",
"the",
"StringBuilder",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/AbstractPlugin.java#L730-L739 |
mnlipp/jgrapes | org.jgrapes.http/src/org/jgrapes/http/ResponseCreationSupport.java | ResponseCreationSupport.uriFromPath | public static URI uriFromPath(String path) throws IllegalArgumentException {
"""
Create a {@link URI} from a path. This is similar to calling
`new URI(null, null, path, null)` with the {@link URISyntaxException}
converted to a {@link IllegalArgumentException}.
@param path the path
@return the uri
@throws Il... | java | public static URI uriFromPath(String path) throws IllegalArgumentException {
try {
return new URI(null, null, path, null);
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}
} | [
"public",
"static",
"URI",
"uriFromPath",
"(",
"String",
"path",
")",
"throws",
"IllegalArgumentException",
"{",
"try",
"{",
"return",
"new",
"URI",
"(",
"null",
",",
"null",
",",
"path",
",",
"null",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",... | Create a {@link URI} from a path. This is similar to calling
`new URI(null, null, path, null)` with the {@link URISyntaxException}
converted to a {@link IllegalArgumentException}.
@param path the path
@return the uri
@throws IllegalArgumentException if the string violates
RFC 2396 | [
"Create",
"a",
"{",
"@link",
"URI",
"}",
"from",
"a",
"path",
".",
"This",
"is",
"similar",
"to",
"calling",
"new",
"URI",
"(",
"null",
"null",
"path",
"null",
")",
"with",
"the",
"{",
"@link",
"URISyntaxException",
"}",
"converted",
"to",
"a",
"{",
... | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.http/src/org/jgrapes/http/ResponseCreationSupport.java#L311-L317 |
motown-io/motown | operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/ChargingStationEventListener.java | ChargingStationEventListener.updateAuthorizationList | private void updateAuthorizationList(final ChargingStation chargingStation, final Set<LocalAuthorization> updatedLocalAuthorizations) {
"""
Updates the local representation of the charging station authorization list.
Tokens in the updatedIdentificationTokens will be removed from the local operator api list.
@p... | java | private void updateAuthorizationList(final ChargingStation chargingStation, final Set<LocalAuthorization> updatedLocalAuthorizations) {
Set<LocalAuthorization> authorizationList = chargingStation.getLocalAuths();
Iterables.removeIf(authorizationList, new Predicate<LocalAuthorization>() {
@O... | [
"private",
"void",
"updateAuthorizationList",
"(",
"final",
"ChargingStation",
"chargingStation",
",",
"final",
"Set",
"<",
"LocalAuthorization",
">",
"updatedLocalAuthorizations",
")",
"{",
"Set",
"<",
"LocalAuthorization",
">",
"authorizationList",
"=",
"chargingStation... | Updates the local representation of the charging station authorization list.
Tokens in the updatedIdentificationTokens will be removed from the local operator api list.
@param chargingStation the chargingstation.
@param updatedLocalAuthorizations the updated tokens. | [
"Updates",
"the",
"local",
"representation",
"of",
"the",
"charging",
"station",
"authorization",
"list",
".",
"Tokens",
"in",
"the",
"updatedIdentificationTokens",
"will",
"be",
"removed",
"from",
"the",
"local",
"operator",
"api",
"list",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/ChargingStationEventListener.java#L285-L295 |
kiuwan/java-api-client | src/main/java/com/kiuwan/client/KiuwanRestApiClient.java | KiuwanRestApiClient.initializeConnection | private void initializeConnection(String user, String password, String restApiBaseUrl, String proxyHost, Integer proxyPort, Proxy.Type proxyType, String proxyUser, String proxyPassword) {
"""
Initializes the connection.
@param user The user name in Kiuwan.
@param password The password in Kiuwan.
@param restApiB... | java | private void initializeConnection(String user, String password, String restApiBaseUrl, String proxyHost, Integer proxyPort, Proxy.Type proxyType, String proxyUser, String proxyPassword) {
connection = ClientHelper.createClient(proxyHost, proxyPort, proxyType, proxyUser, proxyPassword).register(HttpAuthenticationFeatu... | [
"private",
"void",
"initializeConnection",
"(",
"String",
"user",
",",
"String",
"password",
",",
"String",
"restApiBaseUrl",
",",
"String",
"proxyHost",
",",
"Integer",
"proxyPort",
",",
"Proxy",
".",
"Type",
"proxyType",
",",
"String",
"proxyUser",
",",
"Strin... | Initializes the connection.
@param user The user name in Kiuwan.
@param password The password in Kiuwan.
@param restApiBaseUrl Base URL for REST-API.
@param proxyHost Proxy hostname or address.
@param proxyPort Port of the proxy.
@param proxyType Type of the proxy: HTTP/SOCKS/DIRECT.
@param proxyUser User name to authe... | [
"Initializes",
"the",
"connection",
"."
] | train | https://github.com/kiuwan/java-api-client/blob/5cda6a6ed9f37a03f9418a1846d349f6d59e14f7/src/main/java/com/kiuwan/client/KiuwanRestApiClient.java#L1103-L1105 |
betfair/cougar | cougar-codegen-plugin/src/main/java/com/betfair/cougar/codegen/IdlToDSMojo.java | IdlToDSMojo.readNamespaceAttr | private String readNamespaceAttr(Document doc) {
"""
Retrieve 'namespace' attr of interface definition or null if not found
"""
// lazy loading is mostly pointless but it keeps things together
if (namespaceExpr == null) {
namespaceExpr = initNamespaceAttrExpression();
}
String s;
try... | java | private String readNamespaceAttr(Document doc) {
// lazy loading is mostly pointless but it keeps things together
if (namespaceExpr == null) {
namespaceExpr = initNamespaceAttrExpression();
}
String s;
try {
s = namespaceExpr.evaluate(doc);
} catch (XPathExpressionException e) {
throw... | [
"private",
"String",
"readNamespaceAttr",
"(",
"Document",
"doc",
")",
"{",
"// lazy loading is mostly pointless but it keeps things together",
"if",
"(",
"namespaceExpr",
"==",
"null",
")",
"{",
"namespaceExpr",
"=",
"initNamespaceAttrExpression",
"(",
")",
";",
"}",
"... | Retrieve 'namespace' attr of interface definition or null if not found | [
"Retrieve",
"namespace",
"attr",
"of",
"interface",
"definition",
"or",
"null",
"if",
"not",
"found"
] | train | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-codegen-plugin/src/main/java/com/betfair/cougar/codegen/IdlToDSMojo.java#L653-L668 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.