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 |
|---|---|---|---|---|---|---|---|---|---|---|
sebastiangraf/perfidix | src/main/java/org/perfidix/element/AbstractMethodArrangement.java | AbstractMethodArrangement.getMethodArrangement | public static AbstractMethodArrangement getMethodArrangement(final List<BenchmarkElement> elements, final KindOfArrangement kind) {
"""
Factory method to get the method arrangement for a given set of classes. The kind of arrangement is set by an
instance of the enum {@link KindOfArrangement}.
@param elements t... | java | public static AbstractMethodArrangement getMethodArrangement(final List<BenchmarkElement> elements, final KindOfArrangement kind) {
AbstractMethodArrangement arrang = null;
switch (kind) {
case NoArrangement:
arrang = new NoMethodArrangement(elements);
break;
... | [
"public",
"static",
"AbstractMethodArrangement",
"getMethodArrangement",
"(",
"final",
"List",
"<",
"BenchmarkElement",
">",
"elements",
",",
"final",
"KindOfArrangement",
"kind",
")",
"{",
"AbstractMethodArrangement",
"arrang",
"=",
"null",
";",
"switch",
"(",
"kind"... | Factory method to get the method arrangement for a given set of classes. The kind of arrangement is set by an
instance of the enum {@link KindOfArrangement}.
@param elements to be benched
@param kind for the method arrangement
@return the arrangement, mainly an iterator | [
"Factory",
"method",
"to",
"get",
"the",
"method",
"arrangement",
"for",
"a",
"given",
"set",
"of",
"classes",
".",
"The",
"kind",
"of",
"arrangement",
"is",
"set",
"by",
"an",
"instance",
"of",
"the",
"enum",
"{",
"@link",
"KindOfArrangement",
"}",
"."
] | train | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/element/AbstractMethodArrangement.java#L60-L77 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java | ExecutionGraph.tryRestartOrFail | private boolean tryRestartOrFail(long globalModVersionForRestart) {
"""
Try to restart the job. If we cannot restart the job (e.g. no more restarts allowed), then
try to fail the job. This operation is only permitted if the current state is FAILING or
RESTARTING.
@return true if the operation could be execute... | java | private boolean tryRestartOrFail(long globalModVersionForRestart) {
JobStatus currentState = state;
if (currentState == JobStatus.FAILING || currentState == JobStatus.RESTARTING) {
final Throwable failureCause = this.failureCause;
synchronized (progressLock) {
if (LOG.isDebugEnabled()) {
LOG.debug(... | [
"private",
"boolean",
"tryRestartOrFail",
"(",
"long",
"globalModVersionForRestart",
")",
"{",
"JobStatus",
"currentState",
"=",
"state",
";",
"if",
"(",
"currentState",
"==",
"JobStatus",
".",
"FAILING",
"||",
"currentState",
"==",
"JobStatus",
".",
"RESTARTING",
... | Try to restart the job. If we cannot restart the job (e.g. no more restarts allowed), then
try to fail the job. This operation is only permitted if the current state is FAILING or
RESTARTING.
@return true if the operation could be executed; false if a concurrent job status change occurred | [
"Try",
"to",
"restart",
"the",
"job",
".",
"If",
"we",
"cannot",
"restart",
"the",
"job",
"(",
"e",
".",
"g",
".",
"no",
"more",
"restarts",
"allowed",
")",
"then",
"try",
"to",
"fail",
"the",
"job",
".",
"This",
"operation",
"is",
"only",
"permitted... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1468-L1513 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/button/SegmentedButtonPainter.java | SegmentedButtonPainter.createOuterFocus | protected Shape createOuterFocus(final SegmentType segmentType, final int x, final int y, final int w, final int h) {
"""
Create the shape for the outer focus ring. Designed to be drawn rather
than filled.
@param segmentType the segment type.
@param x the x offset.
@param y the y offse... | java | protected Shape createOuterFocus(final SegmentType segmentType, final int x, final int y, final int w, final int h) {
switch (segmentType) {
case FIRST:
return shapeGenerator.createRoundRectangle(x - 2, y - 2, w + 3, h + 3, CornerSize.OUTER_FOCUS, CornerStyle.ROUNDED,
... | [
"protected",
"Shape",
"createOuterFocus",
"(",
"final",
"SegmentType",
"segmentType",
",",
"final",
"int",
"x",
",",
"final",
"int",
"y",
",",
"final",
"int",
"w",
",",
"final",
"int",
"h",
")",
"{",
"switch",
"(",
"segmentType",
")",
"{",
"case",
"FIRST... | Create the shape for the outer focus ring. Designed to be drawn rather
than filled.
@param segmentType the segment type.
@param x the x offset.
@param y the y offset.
@param w the width.
@param h the height.
@return the shape of the outer focus ring. Designed to be drawn r... | [
"Create",
"the",
"shape",
"for",
"the",
"outer",
"focus",
"ring",
".",
"Designed",
"to",
"be",
"drawn",
"rather",
"than",
"filled",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/button/SegmentedButtonPainter.java#L227-L244 |
osglworks/java-tool | src/main/java/org/osgl/util/IO.java | IO.registerInputStreamHandler | public static void registerInputStreamHandler(MimeType type, InputStreamHandler handler) {
"""
Associate an {@link InputStreamHandler} with a specific {@link MimeType}
@param type
The mimetype the handler listen to
@param handler
the handler
"""
$.requireNotNull(handler);
InputStreamHandler... | java | public static void registerInputStreamHandler(MimeType type, InputStreamHandler handler) {
$.requireNotNull(handler);
InputStreamHandlerDispatcher dispatcher = inputStreamHandlerLookup.get(type);
if (null == dispatcher) {
dispatcher = new InputStreamHandlerDispatcher(handler);
... | [
"public",
"static",
"void",
"registerInputStreamHandler",
"(",
"MimeType",
"type",
",",
"InputStreamHandler",
"handler",
")",
"{",
"$",
".",
"requireNotNull",
"(",
"handler",
")",
";",
"InputStreamHandlerDispatcher",
"dispatcher",
"=",
"inputStreamHandlerLookup",
".",
... | Associate an {@link InputStreamHandler} with a specific {@link MimeType}
@param type
The mimetype the handler listen to
@param handler
the handler | [
"Associate",
"an",
"{"
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/IO.java#L160-L169 |
sdl/Testy | src/main/java/com/sdl/selenium/bootstrap/button/UploadFile.java | UploadFile.newUpload | public boolean newUpload(String filePath) {
"""
Upload file with AutoIT.
Use only this: button.newUpload("C:\\text.txt");
@param filePath "C:\\text.txt"
@return true | false
"""
WebLocator uploadButton = new WebLocator(this).setTag("span").setClasses("fileupload-new").setElPathSuffix("icon-folder... | java | public boolean newUpload(String filePath) {
WebLocator uploadButton = new WebLocator(this).setTag("span").setClasses("fileupload-new").setElPathSuffix("icon-folder-open", "count(.//i[@class='icon-folder-open']) > 0");
return upload(uploadButton, filePath);
} | [
"public",
"boolean",
"newUpload",
"(",
"String",
"filePath",
")",
"{",
"WebLocator",
"uploadButton",
"=",
"new",
"WebLocator",
"(",
"this",
")",
".",
"setTag",
"(",
"\"span\"",
")",
".",
"setClasses",
"(",
"\"fileupload-new\"",
")",
".",
"setElPathSuffix",
"("... | Upload file with AutoIT.
Use only this: button.newUpload("C:\\text.txt");
@param filePath "C:\\text.txt"
@return true | false | [
"Upload",
"file",
"with",
"AutoIT",
".",
"Use",
"only",
"this",
":",
"button",
".",
"newUpload",
"(",
"C",
":",
"\\\\",
"text",
".",
"txt",
")",
";"
] | train | https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/bootstrap/button/UploadFile.java#L94-L97 |
isisaddons-legacy/isis-module-security | dom/src/main/java/org/isisaddons/module/security/shiro/AuthenticationStrategyForIsisModuleSecurityRealm.java | AuthenticationStrategyForIsisModuleSecurityRealm.beforeAllAttempts | @Override
public AuthenticationInfo beforeAllAttempts(Collection<? extends Realm> realms, AuthenticationToken token) throws AuthenticationException {
"""
Reconfigures the SimpleAuthenticationInfo to use a implementation for storing its PrincipalCollections.
<p>
The default implementation uses a {@link org.... | java | @Override
public AuthenticationInfo beforeAllAttempts(Collection<? extends Realm> realms, AuthenticationToken token) throws AuthenticationException {
final SimpleAuthenticationInfo authenticationInfo = (SimpleAuthenticationInfo) super.beforeAllAttempts(realms, token);
authenticationInfo.setPrincipa... | [
"@",
"Override",
"public",
"AuthenticationInfo",
"beforeAllAttempts",
"(",
"Collection",
"<",
"?",
"extends",
"Realm",
">",
"realms",
",",
"AuthenticationToken",
"token",
")",
"throws",
"AuthenticationException",
"{",
"final",
"SimpleAuthenticationInfo",
"authenticationIn... | Reconfigures the SimpleAuthenticationInfo to use a implementation for storing its PrincipalCollections.
<p>
The default implementation uses a {@link org.apache.shiro.subject.SimplePrincipalCollection}, however this
doesn't play well with the Isis Addons' security module which ends up chaining together multiple instanc... | [
"Reconfigures",
"the",
"SimpleAuthenticationInfo",
"to",
"use",
"a",
"implementation",
"for",
"storing",
"its",
"PrincipalCollections",
"."
] | train | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/dom/src/main/java/org/isisaddons/module/security/shiro/AuthenticationStrategyForIsisModuleSecurityRealm.java#L26-L32 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java | EscapedFunctions.sqllocate | public static String sqllocate(List<?> parsedArgs) throws SQLException {
"""
locate translation.
@param parsedArgs arguments
@return sql call
@throws SQLException if something wrong happens
"""
if (parsedArgs.size() == 2) {
return "position(" + parsedArgs.get(0) + " in " + parsedArgs.get(1) + ")... | java | public static String sqllocate(List<?> parsedArgs) throws SQLException {
if (parsedArgs.size() == 2) {
return "position(" + parsedArgs.get(0) + " in " + parsedArgs.get(1) + ")";
} else if (parsedArgs.size() == 3) {
String tmp = "position(" + parsedArgs.get(0) + " in substring(" + parsedArgs.get(1) +... | [
"public",
"static",
"String",
"sqllocate",
"(",
"List",
"<",
"?",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"parsedArgs",
".",
"size",
"(",
")",
"==",
"2",
")",
"{",
"return",
"\"position(\"",
"+",
"parsedArgs",
".",
"get",
"(",
... | locate translation.
@param parsedArgs arguments
@return sql call
@throws SQLException if something wrong happens | [
"locate",
"translation",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L302-L313 |
frostwire/frostwire-jlibtorrent | src/main/java/com/frostwire/jlibtorrent/TorrentHandle.java | TorrentHandle.setPieceDeadline | public void setPieceDeadline(int index, int deadline, deadline_flags_t flags) {
"""
This function sets or resets the deadline associated with a specific
piece index (``index``). libtorrent will attempt to download this
entire piece before the deadline expires. This is not necessarily
possible, but pieces with a... | java | public void setPieceDeadline(int index, int deadline, deadline_flags_t flags) {
th.set_piece_deadline(index, deadline, flags);
} | [
"public",
"void",
"setPieceDeadline",
"(",
"int",
"index",
",",
"int",
"deadline",
",",
"deadline_flags_t",
"flags",
")",
"{",
"th",
".",
"set_piece_deadline",
"(",
"index",
",",
"deadline",
",",
"flags",
")",
";",
"}"
] | This function sets or resets the deadline associated with a specific
piece index (``index``). libtorrent will attempt to download this
entire piece before the deadline expires. This is not necessarily
possible, but pieces with a more recent deadline will always be
prioritized over pieces with a deadline further ahead i... | [
"This",
"function",
"sets",
"or",
"resets",
"the",
"deadline",
"associated",
"with",
"a",
"specific",
"piece",
"index",
"(",
"index",
")",
".",
"libtorrent",
"will",
"attempt",
"to",
"download",
"this",
"entire",
"piece",
"before",
"the",
"deadline",
"expires"... | train | https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/TorrentHandle.java#L1206-L1208 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nslimitidentifier_binding.java | nslimitidentifier_binding.get | public static nslimitidentifier_binding get(nitro_service service, String limitidentifier) throws Exception {
"""
Use this API to fetch nslimitidentifier_binding resource of given name .
"""
nslimitidentifier_binding obj = new nslimitidentifier_binding();
obj.set_limitidentifier(limitidentifier);
nslimit... | java | public static nslimitidentifier_binding get(nitro_service service, String limitidentifier) throws Exception{
nslimitidentifier_binding obj = new nslimitidentifier_binding();
obj.set_limitidentifier(limitidentifier);
nslimitidentifier_binding response = (nslimitidentifier_binding) obj.get_resource(service);
retu... | [
"public",
"static",
"nslimitidentifier_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"limitidentifier",
")",
"throws",
"Exception",
"{",
"nslimitidentifier_binding",
"obj",
"=",
"new",
"nslimitidentifier_binding",
"(",
")",
";",
"obj",
".",
"set_lim... | Use this API to fetch nslimitidentifier_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"nslimitidentifier_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nslimitidentifier_binding.java#L103-L108 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3d.java | AlignedBox3d.setFromCorners | @Override
public void setFromCorners(double x1, double y1, double z1, double x2, double y2, double z2) {
"""
Change the frame of the box.
@param x1 is the coordinate of the first corner.
@param y1 is the coordinate of the first corner.
@param z1 is the coordinate of the first corner.
@param x2 is the coordi... | java | @Override
public void setFromCorners(double x1, double y1, double z1, double x2, double y2, double z2) {
if (x1<x2) {
this.minxProperty.set(x1);
this.maxxProperty.set(x2);
}
else {
this.minxProperty.set(x2);
this.maxxProperty.set(x1);
}
if (y1<y2) {
this.minyProperty.set(y1);
this.maxyPrope... | [
"@",
"Override",
"public",
"void",
"setFromCorners",
"(",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"z1",
",",
"double",
"x2",
",",
"double",
"y2",
",",
"double",
"z2",
")",
"{",
"if",
"(",
"x1",
"<",
"x2",
")",
"{",
"this",
".",
"minxPro... | Change the frame of the box.
@param x1 is the coordinate of the first corner.
@param y1 is the coordinate of the first corner.
@param z1 is the coordinate of the first corner.
@param x2 is the coordinate of the second corner.
@param y2 is the coordinate of the second corner.
@param z2 is the coordinate of the second c... | [
"Change",
"the",
"frame",
"of",
"the",
"box",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3d.java#L368-L394 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAvailabilityEstimatePersistenceImpl.java | CommerceAvailabilityEstimatePersistenceImpl.findByGroupId | @Override
public List<CommerceAvailabilityEstimate> findByGroupId(long groupId,
int start, int end) {
"""
Returns a range of all the commerce availability estimates where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <cod... | java | @Override
public List<CommerceAvailabilityEstimate> findByGroupId(long groupId,
int start, int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceAvailabilityEstimate",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
"... | Returns a range of all the commerce availability estimates 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 resul... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"availability",
"estimates",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAvailabilityEstimatePersistenceImpl.java#L1556-L1560 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java | DevicesInner.scanForUpdates | public void scanForUpdates(String deviceName, String resourceGroupName) {
"""
Scans for updates on a data box edge/gateway device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExcept... | java | public void scanForUpdates(String deviceName, String resourceGroupName) {
scanForUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().last().body();
} | [
"public",
"void",
"scanForUpdates",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
")",
"{",
"scanForUpdatesWithServiceResponseAsync",
"(",
"deviceName",
",",
"resourceGroupName",
")",
".",
"toBlocking",
"(",
")",
".",
"last",
"(",
")",
".",
"bod... | Scans for updates on a data box edge/gateway device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapp... | [
"Scans",
"for",
"updates",
"on",
"a",
"data",
"box",
"edge",
"/",
"gateway",
"device",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L1682-L1684 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java | TableInfo.newBuilder | public static Builder newBuilder(TableId tableId, TableDefinition definition) {
"""
Returns a builder for a {@code TableInfo} object given table identity and definition. Use
{@link StandardTableDefinition} to create simple BigQuery table. Use {@link ViewDefinition} to
create a BigQuery view. Use {@link ExternalT... | java | public static Builder newBuilder(TableId tableId, TableDefinition definition) {
return new BuilderImpl().setTableId(tableId).setDefinition(definition);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableId",
"tableId",
",",
"TableDefinition",
"definition",
")",
"{",
"return",
"new",
"BuilderImpl",
"(",
")",
".",
"setTableId",
"(",
"tableId",
")",
".",
"setDefinition",
"(",
"definition",
")",
";",
"}"
] | Returns a builder for a {@code TableInfo} object given table identity and definition. Use
{@link StandardTableDefinition} to create simple BigQuery table. Use {@link ViewDefinition} to
create a BigQuery view. Use {@link ExternalTableDefinition} to create a BigQuery a table backed
by external data. | [
"Returns",
"a",
"builder",
"for",
"a",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java#L447-L449 |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/TreeTimer.java | TreeTimer.leftpad | @Nonnull
private static String leftpad(@Nonnull String s, int n, char padChar) {
"""
Left-pads a String with the specific padChar so it is length <code>n</code>. If the String
is already at least length n, no padding is done.
"""
int diff = n - s.length();
if (diff <= 0) {
ret... | java | @Nonnull
private static String leftpad(@Nonnull String s, int n, char padChar) {
int diff = n - s.length();
if (diff <= 0) {
return s;
}
StringBuilder buf = new StringBuilder(n);
for (int i = 0; i < diff; ++i) {
buf.append(padChar);
}
... | [
"@",
"Nonnull",
"private",
"static",
"String",
"leftpad",
"(",
"@",
"Nonnull",
"String",
"s",
",",
"int",
"n",
",",
"char",
"padChar",
")",
"{",
"int",
"diff",
"=",
"n",
"-",
"s",
".",
"length",
"(",
")",
";",
"if",
"(",
"diff",
"<=",
"0",
")",
... | Left-pads a String with the specific padChar so it is length <code>n</code>. If the String
is already at least length n, no padding is done. | [
"Left",
"-",
"pads",
"a",
"String",
"with",
"the",
"specific",
"padChar",
"so",
"it",
"is",
"length",
"<code",
">",
"n<",
"/",
"code",
">",
".",
"If",
"the",
"String",
"is",
"already",
"at",
"least",
"length",
"n",
"no",
"padding",
"is",
"done",
"."
... | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/TreeTimer.java#L90-L103 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobStreamsInner.java | JobStreamsInner.listByJobAsync | public Observable<Page<JobStreamInner>> listByJobAsync(final String resourceGroupName, final String automationAccountName, final String jobId, final String filter) {
"""
Retrieve a list of jobs streams identified by job id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName ... | java | public Observable<Page<JobStreamInner>> listByJobAsync(final String resourceGroupName, final String automationAccountName, final String jobId, final String filter) {
return listByJobWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId, filter)
.map(new Func1<ServiceResponse<Page<... | [
"public",
"Observable",
"<",
"Page",
"<",
"JobStreamInner",
">",
">",
"listByJobAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"automationAccountName",
",",
"final",
"String",
"jobId",
",",
"final",
"String",
"filter",
")",
"{",
"re... | Retrieve a list of jobs streams identified by job id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobId The job Id.
@param filter The filter to apply on the operation.
@throws IllegalArgumentException thrown if parameters fail the va... | [
"Retrieve",
"a",
"list",
"of",
"jobs",
"streams",
"identified",
"by",
"job",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobStreamsInner.java#L350-L358 |
crnk-project/crnk-framework | crnk-core/src/main/java/io/crnk/core/engine/internal/utils/PreconditionUtil.java | PreconditionUtil.assertFalse | public static void assertFalse(boolean condition, String message, Object... args) {
"""
Asserts that a condition is true. If it isn't it throws an
{@link AssertionError} with the given message.
@param message the identifying message for the {@link AssertionError} (
<code>null</code> okay)
@param condition ... | java | public static void assertFalse(boolean condition, String message, Object... args) {
verify(!condition, message, args);
} | [
"public",
"static",
"void",
"assertFalse",
"(",
"boolean",
"condition",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"verify",
"(",
"!",
"condition",
",",
"message",
",",
"args",
")",
";",
"}"
] | Asserts that a condition is true. If it isn't it throws an
{@link AssertionError} with the given message.
@param message the identifying message for the {@link AssertionError} (
<code>null</code> okay)
@param condition condition to be checked | [
"Asserts",
"that",
"a",
"condition",
"is",
"true",
".",
"If",
"it",
"isn",
"t",
"it",
"throws",
"an",
"{",
"@link",
"AssertionError",
"}",
"with",
"the",
"given",
"message",
"."
] | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/utils/PreconditionUtil.java#L99-L101 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/TransformationsInner.java | TransformationsInner.getAsync | public Observable<TransformationInner> getAsync(String resourceGroupName, String jobName, String transformationName) {
"""
Gets details about the specified transformation.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manage... | java | public Observable<TransformationInner> getAsync(String resourceGroupName, String jobName, String transformationName) {
return getWithServiceResponseAsync(resourceGroupName, jobName, transformationName).map(new Func1<ServiceResponseWithHeaders<TransformationInner, TransformationsGetHeaders>, TransformationInner>... | [
"public",
"Observable",
"<",
"TransformationInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"transformationName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"jobName",
",",
"t... | Gets details about the specified transformation.
@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 jobName The name of the streaming job.
@param transformationName The name of the transformation.
@thro... | [
"Gets",
"details",
"about",
"the",
"specified",
"transformation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/TransformationsInner.java#L519-L526 |
scribejava/scribejava | scribejava-core/src/main/java/com/github/scribejava/core/utils/StreamUtils.java | StreamUtils.getStreamContents | public static String getStreamContents(InputStream is) throws IOException {
"""
Returns the stream contents as an UTF-8 encoded string
@param is input stream
@return string contents
@throws java.io.IOException in any. SocketTimeout in example
"""
Preconditions.checkNotNull(is, "Cannot get String f... | java | public static String getStreamContents(InputStream is) throws IOException {
Preconditions.checkNotNull(is, "Cannot get String from a null object");
final char[] buffer = new char[0x10000];
final StringBuilder out = new StringBuilder();
try (Reader in = new InputStreamReader(is, "UTF-8"))... | [
"public",
"static",
"String",
"getStreamContents",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"is",
",",
"\"Cannot get String from a null object\"",
")",
";",
"final",
"char",
"[",
"]",
"buffer",
"=",
"n... | Returns the stream contents as an UTF-8 encoded string
@param is input stream
@return string contents
@throws java.io.IOException in any. SocketTimeout in example | [
"Returns",
"the",
"stream",
"contents",
"as",
"an",
"UTF",
"-",
"8",
"encoded",
"string"
] | train | https://github.com/scribejava/scribejava/blob/030d76872fe371a84b5d05c6c3c33c34e8f611f1/scribejava-core/src/main/java/com/github/scribejava/core/utils/StreamUtils.java#L21-L35 |
CloudSlang/cs-actions | cs-vmware/src/main/java/io/cloudslang/content/vmware/services/VmService.java | VmService.getOsDescriptors | public Map<String, String> getOsDescriptors(HttpInputs httpInputs, VmInputs vmInputs, String delimiter) throws Exception {
"""
Method used to connect to data center to retrieve a list with all the guest operating system descriptors
supported by the host system.
@param httpInputs Object that has all the inputs ... | java | public Map<String, String> getOsDescriptors(HttpInputs httpInputs, VmInputs vmInputs, String delimiter) throws Exception {
ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
try {
ManagedObjectReference environmentBrowserMor = new MorObjectHandler()
... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getOsDescriptors",
"(",
"HttpInputs",
"httpInputs",
",",
"VmInputs",
"vmInputs",
",",
"String",
"delimiter",
")",
"throws",
"Exception",
"{",
"ConnectionResources",
"connectionResources",
"=",
"new",
"ConnectionRe... | Method used to connect to data center to retrieve a list with all the guest operating system descriptors
supported by the host system.
@param httpInputs Object that has all the inputs necessary to made a connection to data center
@param vmInputs Object that has all the specific inputs necessary to identify the targe... | [
"Method",
"used",
"to",
"connect",
"to",
"data",
"center",
"to",
"retrieve",
"a",
"list",
"with",
"all",
"the",
"guest",
"operating",
"system",
"descriptors",
"supported",
"by",
"the",
"host",
"system",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-vmware/src/main/java/io/cloudslang/content/vmware/services/VmService.java#L52-L72 |
japgolly/svg-android | src/main/java/com/larvalabs/svgandroid/SVGBuilder.java | SVGBuilder.readFromAsset | public SVGBuilder readFromAsset(AssetManager assetMngr, String svgPath) throws IOException {
"""
Parse SVG data from an Android application asset.
@param assetMngr the Android asset manager.
@param svgPath the path to the SVG file in the application's assets.
@throws IOException if there was a problem reading... | java | public SVGBuilder readFromAsset(AssetManager assetMngr, String svgPath) throws IOException {
this.data = assetMngr.open(svgPath);
return this;
} | [
"public",
"SVGBuilder",
"readFromAsset",
"(",
"AssetManager",
"assetMngr",
",",
"String",
"svgPath",
")",
"throws",
"IOException",
"{",
"this",
".",
"data",
"=",
"assetMngr",
".",
"open",
"(",
"svgPath",
")",
";",
"return",
"this",
";",
"}"
] | Parse SVG data from an Android application asset.
@param assetMngr the Android asset manager.
@param svgPath the path to the SVG file in the application's assets.
@throws IOException if there was a problem reading the file. | [
"Parse",
"SVG",
"data",
"from",
"an",
"Android",
"application",
"asset",
"."
] | train | https://github.com/japgolly/svg-android/blob/823affb6110292abcb8c5f783f86217643307f27/src/main/java/com/larvalabs/svgandroid/SVGBuilder.java#L72-L75 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.getSubQuerySQL | private String getSubQuerySQL(Query subQuery) {
"""
Convert subQuery to SQL
@param subQuery the subQuery value of SelectionCriteria
"""
ClassDescriptor cld = getRoot().cld.getRepository().getDescriptorFor(subQuery.getSearchClass());
String sql;
if (subQuery instanceof QueryBySQL)
... | java | private String getSubQuerySQL(Query subQuery)
{
ClassDescriptor cld = getRoot().cld.getRepository().getDescriptorFor(subQuery.getSearchClass());
String sql;
if (subQuery instanceof QueryBySQL)
{
sql = ((QueryBySQL) subQuery).getSql();
}
else
... | [
"private",
"String",
"getSubQuerySQL",
"(",
"Query",
"subQuery",
")",
"{",
"ClassDescriptor",
"cld",
"=",
"getRoot",
"(",
")",
".",
"cld",
".",
"getRepository",
"(",
")",
".",
"getDescriptorFor",
"(",
"subQuery",
".",
"getSearchClass",
"(",
")",
")",
";",
... | Convert subQuery to SQL
@param subQuery the subQuery value of SelectionCriteria | [
"Convert",
"subQuery",
"to",
"SQL"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L982-L997 |
atomix/atomix | agent/src/main/java/io/atomix/agent/AtomixAgent.java | AtomixAgent.parseArgs | static Namespace parseArgs(String[] args, List<String> unknown) {
"""
Parses the command line arguments, returning an argparse4j namespace.
@param args the arguments to parse
@return the namespace
"""
ArgumentParser parser = createParser();
Namespace namespace = null;
try {
namespace = pa... | java | static Namespace parseArgs(String[] args, List<String> unknown) {
ArgumentParser parser = createParser();
Namespace namespace = null;
try {
namespace = parser.parseKnownArgs(args, unknown);
} catch (ArgumentParserException e) {
parser.handleError(e);
System.exit(1);
}
return na... | [
"static",
"Namespace",
"parseArgs",
"(",
"String",
"[",
"]",
"args",
",",
"List",
"<",
"String",
">",
"unknown",
")",
"{",
"ArgumentParser",
"parser",
"=",
"createParser",
"(",
")",
";",
"Namespace",
"namespace",
"=",
"null",
";",
"try",
"{",
"namespace",
... | Parses the command line arguments, returning an argparse4j namespace.
@param args the arguments to parse
@return the namespace | [
"Parses",
"the",
"command",
"line",
"arguments",
"returning",
"an",
"argparse4j",
"namespace",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/agent/src/main/java/io/atomix/agent/AtomixAgent.java#L89-L99 |
tango-controls/JTango | server/src/main/java/org/tango/server/export/TangoExporter.java | TangoExporter.exportAll | @Override
public void exportAll() throws DevFailed {
"""
Build all devices of all classes that are is this executable
@throws DevFailed
"""
// load tango db cache
DatabaseFactory.getDatabase().loadCache(serverName, hostName);
// special case for admin device
final DeviceC... | java | @Override
public void exportAll() throws DevFailed {
// load tango db cache
DatabaseFactory.getDatabase().loadCache(serverName, hostName);
// special case for admin device
final DeviceClassBuilder clazz = new DeviceClassBuilder(AdminDevice.class, Constants.ADMIN_SERVER_CLASS_NAME);
... | [
"@",
"Override",
"public",
"void",
"exportAll",
"(",
")",
"throws",
"DevFailed",
"{",
"// load tango db cache",
"DatabaseFactory",
".",
"getDatabase",
"(",
")",
".",
"loadCache",
"(",
"serverName",
",",
"hostName",
")",
";",
"// special case for admin device",
"fina... | Build all devices of all classes that are is this executable
@throws DevFailed | [
"Build",
"all",
"devices",
"of",
"all",
"classes",
"that",
"are",
"is",
"this",
"executable"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/export/TangoExporter.java#L75-L94 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/Zealot.java | Zealot.getSqlInfoSimply | public static SqlInfo getSqlInfoSimply(String nsAtZealotId, Object paramObj) {
"""
通过传入zealot xml文件对应的命名空间、zealot节点的ID以及参数对象(一般是JavaBean或者Map)的结合体,来简单快速的生成和获取sqlInfo信息(有参的SQL).
@param nsAtZealotId xml命名空间nameSpace+@@+zealotId的值.如:"student@@queryStudentById"
@param paramObj 参数对象(一般是JavaBean对象或者Map)
@return 返回S... | java | public static SqlInfo getSqlInfoSimply(String nsAtZealotId, Object paramObj) {
String[] arr = nsAtZealotId.split(ZealotConst.SP_AT);
if (arr.length != LEN) {
throw new ValidFailException("nsAtZealotId参数的值必须是xml文件中的 nameSpace + '@@' + zealotId 节点的值,"
+ "如:'student@@queryS... | [
"public",
"static",
"SqlInfo",
"getSqlInfoSimply",
"(",
"String",
"nsAtZealotId",
",",
"Object",
"paramObj",
")",
"{",
"String",
"[",
"]",
"arr",
"=",
"nsAtZealotId",
".",
"split",
"(",
"ZealotConst",
".",
"SP_AT",
")",
";",
"if",
"(",
"arr",
".",
"length"... | 通过传入zealot xml文件对应的命名空间、zealot节点的ID以及参数对象(一般是JavaBean或者Map)的结合体,来简单快速的生成和获取sqlInfo信息(有参的SQL).
@param nsAtZealotId xml命名空间nameSpace+@@+zealotId的值.如:"student@@queryStudentById"
@param paramObj 参数对象(一般是JavaBean对象或者Map)
@return 返回SqlInfo对象 | [
"通过传入zealot",
"xml文件对应的命名空间、zealot节点的ID以及参数对象",
"(",
"一般是JavaBean或者Map",
")",
"的结合体,来简单快速的生成和获取sqlInfo信息",
"(",
"有参的SQL",
")",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/Zealot.java#L52-L59 |
atomix/catalyst | common/src/main/java/io/atomix/catalyst/util/PropertiesReader.java | PropertiesReader.getProperty | private <T> T getProperty(String property, Function<String, T> transformer) {
"""
Reads an arbitrary property.
@param property The property name.
@param transformer A transformer function with which to transform the property value to its appropriate type.
@param <T> The property type.
@return The property va... | java | private <T> T getProperty(String property, Function<String, T> transformer) {
Assert.notNull(property, "property");
String value = properties.getProperty(property);
if (value == null)
throw new ConfigurationException("missing property: " + property);
return transformer.apply(value);
} | [
"private",
"<",
"T",
">",
"T",
"getProperty",
"(",
"String",
"property",
",",
"Function",
"<",
"String",
",",
"T",
">",
"transformer",
")",
"{",
"Assert",
".",
"notNull",
"(",
"property",
",",
"\"property\"",
")",
";",
"String",
"value",
"=",
"properties... | Reads an arbitrary property.
@param property The property name.
@param transformer A transformer function with which to transform the property value to its appropriate type.
@param <T> The property type.
@return The property value.
@throws ConfigurationException if the property is not present | [
"Reads",
"an",
"arbitrary",
"property",
"."
] | train | https://github.com/atomix/catalyst/blob/140e762cb975cd8ee1fd85119043c5b8bf917c5c/common/src/main/java/io/atomix/catalyst/util/PropertiesReader.java#L498-L504 |
interedition/collatex | collatex-core/src/main/java/eu/interedition/collatex/suffixtree/ActivePoint.java | ActivePoint.setPosition | void setPosition(Node<T, S> node, Edge<T, S> edge, int length) {
"""
Sets the active point to a new node, edge, length tripple.
@param node
@param edge
@param length
"""
activeNode = node;
activeEdge = edge;
activeLength = length;
} | java | void setPosition(Node<T, S> node, Edge<T, S> edge, int length) {
activeNode = node;
activeEdge = edge;
activeLength = length;
} | [
"void",
"setPosition",
"(",
"Node",
"<",
"T",
",",
"S",
">",
"node",
",",
"Edge",
"<",
"T",
",",
"S",
">",
"edge",
",",
"int",
"length",
")",
"{",
"activeNode",
"=",
"node",
";",
"activeEdge",
"=",
"edge",
";",
"activeLength",
"=",
"length",
";",
... | Sets the active point to a new node, edge, length tripple.
@param node
@param edge
@param length | [
"Sets",
"the",
"active",
"point",
"to",
"a",
"new",
"node",
"edge",
"length",
"tripple",
"."
] | train | https://github.com/interedition/collatex/blob/76dd1fcc36047bc66a87d31142e72e98b5347821/collatex-core/src/main/java/eu/interedition/collatex/suffixtree/ActivePoint.java#L38-L42 |
infinispan/infinispan | core/src/main/java/org/infinispan/statetransfer/StateTransferInterceptor.java | StateTransferInterceptor.handleNonTxWriteCommand | private Object handleNonTxWriteCommand(InvocationContext ctx, WriteCommand command) {
"""
For non-tx write commands, we retry the command locally if the topology changed.
But we only retry on the originator, and only if the command doesn't have
the {@code CACHE_MODE_LOCAL} flag.
"""
if (trace) log.trac... | java | private Object handleNonTxWriteCommand(InvocationContext ctx, WriteCommand command) {
if (trace) log.tracef("handleNonTxWriteCommand for command %s, topology id %d", command, command.getTopologyId());
updateTopologyId(command);
// Only catch OutdatedTopologyExceptions on the originator
if (!ct... | [
"private",
"Object",
"handleNonTxWriteCommand",
"(",
"InvocationContext",
"ctx",
",",
"WriteCommand",
"command",
")",
"{",
"if",
"(",
"trace",
")",
"log",
".",
"tracef",
"(",
"\"handleNonTxWriteCommand for command %s, topology id %d\"",
",",
"command",
",",
"command",
... | For non-tx write commands, we retry the command locally if the topology changed.
But we only retry on the originator, and only if the command doesn't have
the {@code CACHE_MODE_LOCAL} flag. | [
"For",
"non",
"-",
"tx",
"write",
"commands",
"we",
"retry",
"the",
"command",
"locally",
"if",
"the",
"topology",
"changed",
".",
"But",
"we",
"only",
"retry",
"on",
"the",
"originator",
"and",
"only",
"if",
"the",
"command",
"doesn",
"t",
"have",
"the"... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/statetransfer/StateTransferInterceptor.java#L299-L310 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/CacheIndexBasedFilter.java | CacheIndexBasedFilter.timestampToAsofAttributeRelationiship | private static boolean timestampToAsofAttributeRelationiship(Map.Entry<Attribute, Attribute> each) {
"""
unsupported combination of businessDate timestamp -> businessDate asOf mapping. requires custom index
"""
return (each.getValue() != null && each.getValue().isAsOfAttribute()) && !each.getKey().isA... | java | private static boolean timestampToAsofAttributeRelationiship(Map.Entry<Attribute, Attribute> each)
{
return (each.getValue() != null && each.getValue().isAsOfAttribute()) && !each.getKey().isAsOfAttribute();
} | [
"private",
"static",
"boolean",
"timestampToAsofAttributeRelationiship",
"(",
"Map",
".",
"Entry",
"<",
"Attribute",
",",
"Attribute",
">",
"each",
")",
"{",
"return",
"(",
"each",
".",
"getValue",
"(",
")",
"!=",
"null",
"&&",
"each",
".",
"getValue",
"(",
... | unsupported combination of businessDate timestamp -> businessDate asOf mapping. requires custom index | [
"unsupported",
"combination",
"of",
"businessDate",
"timestamp",
"-",
">",
"businessDate",
"asOf",
"mapping",
".",
"requires",
"custom",
"index"
] | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/CacheIndexBasedFilter.java#L84-L87 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentPersistenceImpl.java | CommerceShipmentPersistenceImpl.findByGroupId | @Override
public List<CommerceShipment> findByGroupId(long groupId) {
"""
Returns all the commerce shipments where groupId = ?.
@param groupId the group ID
@return the matching commerce shipments
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceShipment> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceShipment",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce shipments where groupId = ?.
@param groupId the group ID
@return the matching commerce shipments | [
"Returns",
"all",
"the",
"commerce",
"shipments",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentPersistenceImpl.java#L122-L125 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java | PtoPOutputHandler.createControlNotFlushed | private ControlNotFlushed createControlNotFlushed(SIBUuid12 stream, long reqID)
throws SIResourceException {
"""
Creates a NOTFLUSHED message for sending
@param stream The UUID of the stream the message should be sent on.
@param reqID The request ID that the message answers.
@return the new NOTFLUSHED mes... | java | private ControlNotFlushed createControlNotFlushed(SIBUuid12 stream, long reqID)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createControlNotFlushed", new Object[] {stream, new Long(reqID)});
ControlNotFlushed notFlushedMsg;
// ... | [
"private",
"ControlNotFlushed",
"createControlNotFlushed",
"(",
"SIBUuid12",
"stream",
",",
"long",
"reqID",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
... | Creates a NOTFLUSHED message for sending
@param stream The UUID of the stream the message should be sent on.
@param reqID The request ID that the message answers.
@return the new NOTFLUSHED message.
@throws SIResourceException if the message can't be created. | [
"Creates",
"a",
"NOTFLUSHED",
"message",
"for",
"sending"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java#L1700-L1765 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/StackTraceHelper.java | StackTraceHelper.getStackAsString | @Nonnull
public static String getStackAsString (@Nullable final Throwable t, final boolean bOmitCommonStackTraceElements) {
"""
Get the stack trace of a throwable as string.
@param t
The throwable to be converted. May be <code>null</code>.
@param bOmitCommonStackTraceElements
If <code>true</code> the stack... | java | @Nonnull
public static String getStackAsString (@Nullable final Throwable t, final boolean bOmitCommonStackTraceElements)
{
if (t == null)
return "";
// convert call stack to string
final StringBuilder aCallStack = _getRecursiveStackAsStringBuilder (t,
... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getStackAsString",
"(",
"@",
"Nullable",
"final",
"Throwable",
"t",
",",
"final",
"boolean",
"bOmitCommonStackTraceElements",
")",
"{",
"if",
"(",
"t",
"==",
"null",
")",
"return",
"\"\"",
";",
"// convert call stac... | Get the stack trace of a throwable as string.
@param t
The throwable to be converted. May be <code>null</code>.
@param bOmitCommonStackTraceElements
If <code>true</code> the stack trace is cut after certain class
names occurring. If <code>false</code> the complete stack trace is
returned.
@return the stack trace as ne... | [
"Get",
"the",
"stack",
"trace",
"of",
"a",
"throwable",
"as",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/StackTraceHelper.java#L207-L226 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/index/service/RowService.java | RowService.build | public static RowService build(ColumnFamilyStore baseCfs, ColumnDefinition columnDefinition) {
"""
Returns a new {@link RowService} for the specified {@link ColumnFamilyStore} and {@link ColumnDefinition}.
@param baseCfs The {@link ColumnFamilyStore} associated to the managed index.
@param columnDefin... | java | public static RowService build(ColumnFamilyStore baseCfs, ColumnDefinition columnDefinition) {
int clusteringPosition = baseCfs.metadata.clusteringColumns().size();
if (clusteringPosition > 0) {
return new RowServiceWide(baseCfs, columnDefinition);
} else {
return new Row... | [
"public",
"static",
"RowService",
"build",
"(",
"ColumnFamilyStore",
"baseCfs",
",",
"ColumnDefinition",
"columnDefinition",
")",
"{",
"int",
"clusteringPosition",
"=",
"baseCfs",
".",
"metadata",
".",
"clusteringColumns",
"(",
")",
".",
"size",
"(",
")",
";",
"... | Returns a new {@link RowService} for the specified {@link ColumnFamilyStore} and {@link ColumnDefinition}.
@param baseCfs The {@link ColumnFamilyStore} associated to the managed index.
@param columnDefinition The {@link ColumnDefinition} of the indexed column.
@return A new {@link RowService} for the specifie... | [
"Returns",
"a",
"new",
"{",
"@link",
"RowService",
"}",
"for",
"the",
"specified",
"{",
"@link",
"ColumnFamilyStore",
"}",
"and",
"{",
"@link",
"ColumnDefinition",
"}",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/RowService.java#L102-L109 |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/Shutterbug.java | Shutterbug.shootPage | public static PageSnapshot shootPage(WebDriver driver, ScrollStrategy scroll, int scrollTimeout, boolean useDevicePixelRatio) {
"""
To be used when screen shooting the page
and need to scroll while making screen shots, either vertically or
horizontally or both directions (Chrome).
@param driver WebDriver inst... | java | public static PageSnapshot shootPage(WebDriver driver, ScrollStrategy scroll, int scrollTimeout, boolean useDevicePixelRatio) {
Browser browser = new Browser(driver, useDevicePixelRatio);
browser.setScrollTimeout(scrollTimeout);
PageSnapshot pageScreenshot = new PageSnapshot(driver, browser.get... | [
"public",
"static",
"PageSnapshot",
"shootPage",
"(",
"WebDriver",
"driver",
",",
"ScrollStrategy",
"scroll",
",",
"int",
"scrollTimeout",
",",
"boolean",
"useDevicePixelRatio",
")",
"{",
"Browser",
"browser",
"=",
"new",
"Browser",
"(",
"driver",
",",
"useDeviceP... | To be used when screen shooting the page
and need to scroll while making screen shots, either vertically or
horizontally or both directions (Chrome).
@param driver WebDriver instance
@param scroll ScrollStrategy How you need to scroll
@param scrollTimeout Timeout to wait after scrolling and before taking screen shot
... | [
"To",
"be",
"used",
"when",
"screen",
"shooting",
"the",
"page",
"and",
"need",
"to",
"scroll",
"while",
"making",
"screen",
"shots",
"either",
"vertically",
"or",
"horizontally",
"or",
"both",
"directions",
"(",
"Chrome",
")",
"."
] | train | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/Shutterbug.java#L100-L114 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java | StructureTools.addGroupToStructure | public static Chain addGroupToStructure(Structure s, Group g, int model, Chain chainGuess, boolean clone ) {
"""
Adds a particular group to a structure. A new chain will be created if necessary.
<p>When adding multiple groups, pass the return value of one call as the
chainGuess parameter of the next call for e... | java | public static Chain addGroupToStructure(Structure s, Group g, int model, Chain chainGuess, boolean clone ) {
synchronized(s) {
// Find or create the chain
String chainId = g.getChainId();
assert !chainId.isEmpty();
Chain chain;
if(chainGuess != null && chainGuess.getId() == chainId) {
// previously... | [
"public",
"static",
"Chain",
"addGroupToStructure",
"(",
"Structure",
"s",
",",
"Group",
"g",
",",
"int",
"model",
",",
"Chain",
"chainGuess",
",",
"boolean",
"clone",
")",
"{",
"synchronized",
"(",
"s",
")",
"{",
"// Find or create the chain",
"String",
"chai... | Adds a particular group to a structure. A new chain will be created if necessary.
<p>When adding multiple groups, pass the return value of one call as the
chainGuess parameter of the next call for efficiency.
<pre>
Chain guess = null;
for(Group g : groups) {
guess = addGroupToStructure(s, g, guess );
}
</pre>
@param s... | [
"Adds",
"a",
"particular",
"group",
"to",
"a",
"structure",
".",
"A",
"new",
"chain",
"will",
"be",
"created",
"if",
"necessary",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L525-L577 |
soi-toolkit/soi-toolkit-mule | commons/components/commons-xml/src/main/java/org/soitoolkit/commons/xml/XPathUtil.java | XPathUtil.getXml | public static String getXml(Node node, boolean indentXml, int indentSize) {
"""
Creates a string representation of the dom node.
NOTE: The string can be formatted and indented with a specified indent size, but be aware that this is depending on a Xalan implementation of the XSLT library.
@param node
@param in... | java | public static String getXml(Node node, boolean indentXml, int indentSize) {
try {
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer;
if (indentXml) {
transformer = tf.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setO... | [
"public",
"static",
"String",
"getXml",
"(",
"Node",
"node",
",",
"boolean",
"indentXml",
",",
"int",
"indentSize",
")",
"{",
"try",
"{",
"TransformerFactory",
"tf",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
";",
"Transformer",
"transformer",
";... | Creates a string representation of the dom node.
NOTE: The string can be formatted and indented with a specified indent size, but be aware that this is depending on a Xalan implementation of the XSLT library.
@param node
@param indentXml
@param indentSize
@return | [
"Creates",
"a",
"string",
"representation",
"of",
"the",
"dom",
"node",
".",
"NOTE",
":",
"The",
"string",
"can",
"be",
"formatted",
"and",
"indented",
"with",
"a",
"specified",
"indent",
"size",
"but",
"be",
"aware",
"that",
"this",
"is",
"depending",
"on... | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-xml/src/main/java/org/soitoolkit/commons/xml/XPathUtil.java#L212-L235 |
nutzam/nutzboot | nutzboot-demo/nutzboot-demo-simple/nutzboot-demo-simple-elasticsearch/src/main/java/io/nutz/demo/simple/utils/ElasticsearchUtil.java | ElasticsearchUtil.createOrUpdateData | public void createOrUpdateData(String indexName, String type, List<NutMap> list) {
"""
批量创建或更新文档
@param indexName 索引名
@param type 数据类型(表名)
@param list 包含id和obj的NutMap集合对象
"""
BulkRequestBuilder bulkRequest = getClient().prepareBulk();
if (list.size() > 0) {
for (NutMa... | java | public void createOrUpdateData(String indexName, String type, List<NutMap> list) {
BulkRequestBuilder bulkRequest = getClient().prepareBulk();
if (list.size() > 0) {
for (NutMap nutMap : list) {
bulkRequest.add(getClient().prepareIndex(indexName, type).setId(nutMap.getString(... | [
"public",
"void",
"createOrUpdateData",
"(",
"String",
"indexName",
",",
"String",
"type",
",",
"List",
"<",
"NutMap",
">",
"list",
")",
"{",
"BulkRequestBuilder",
"bulkRequest",
"=",
"getClient",
"(",
")",
".",
"prepareBulk",
"(",
")",
";",
"if",
"(",
"li... | 批量创建或更新文档
@param indexName 索引名
@param type 数据类型(表名)
@param list 包含id和obj的NutMap集合对象 | [
"批量创建或更新文档"
] | train | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-demo/nutzboot-demo-simple/nutzboot-demo-simple-elasticsearch/src/main/java/io/nutz/demo/simple/utils/ElasticsearchUtil.java#L134-L142 |
jbundle/jbundle | app/program/screen/src/main/java/org/jbundle/app/program/screen/JavaButton.java | JavaButton.controlToField | public int controlToField() {
"""
Move the control's value to the field.
@return An error value.
"""
int iErrorCode = super.controlToField();
if (m_classInfo != null)
{
TaskScheduler js = BaseApplet.getSharedInstance().getApplication().getTaskScheduler();
String... | java | public int controlToField()
{
int iErrorCode = super.controlToField();
if (m_classInfo != null)
{
TaskScheduler js = BaseApplet.getSharedInstance().getApplication().getTaskScheduler();
String strJob = Utility.addURLParam(null, DBParams.SCREEN, ".app.program.manual.uti... | [
"public",
"int",
"controlToField",
"(",
")",
"{",
"int",
"iErrorCode",
"=",
"super",
".",
"controlToField",
"(",
")",
";",
"if",
"(",
"m_classInfo",
"!=",
"null",
")",
"{",
"TaskScheduler",
"js",
"=",
"BaseApplet",
".",
"getSharedInstance",
"(",
")",
".",
... | Move the control's value to the field.
@return An error value. | [
"Move",
"the",
"control",
"s",
"value",
"to",
"the",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/screen/src/main/java/org/jbundle/app/program/screen/JavaButton.java#L66-L85 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/DataFileCache.java | DataFileCache.deleteOrResetFreePos | static void deleteOrResetFreePos(Database database, String filename) {
"""
This method deletes a data file or resets its free position.
this is used only for nio files - not OOo files
"""
ScaledRAFile raFile = null;
database.getFileAccess().removeElement(filename);
// OOo related co... | java | static void deleteOrResetFreePos(Database database, String filename) {
ScaledRAFile raFile = null;
database.getFileAccess().removeElement(filename);
// OOo related code
if (database.isStoredFileAccess()) {
return;
}
// OOo end
if (!database.getFile... | [
"static",
"void",
"deleteOrResetFreePos",
"(",
"Database",
"database",
",",
"String",
"filename",
")",
"{",
"ScaledRAFile",
"raFile",
"=",
"null",
";",
"database",
".",
"getFileAccess",
"(",
")",
".",
"removeElement",
"(",
"filename",
")",
";",
"// OOo related c... | This method deletes a data file or resets its free position.
this is used only for nio files - not OOo files | [
"This",
"method",
"deletes",
"a",
"data",
"file",
"or",
"resets",
"its",
"free",
"position",
".",
"this",
"is",
"used",
"only",
"for",
"nio",
"files",
"-",
"not",
"OOo",
"files"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/DataFileCache.java#L949-L981 |
UrielCh/ovh-java-sdk | ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java | ApiOvhRouter.serviceName_network_ipNet_GET | public OvhNetwork serviceName_network_ipNet_GET(String serviceName, String ipNet) throws IOException {
"""
Get this object properties
REST: GET /router/{serviceName}/network/{ipNet}
@param serviceName [required] The internal name of your Router offer
@param ipNet [required] Gateway IP / CIDR Netmask
"""
... | java | public OvhNetwork serviceName_network_ipNet_GET(String serviceName, String ipNet) throws IOException {
String qPath = "/router/{serviceName}/network/{ipNet}";
StringBuilder sb = path(qPath, serviceName, ipNet);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhNetwork.class);
} | [
"public",
"OvhNetwork",
"serviceName_network_ipNet_GET",
"(",
"String",
"serviceName",
",",
"String",
"ipNet",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/router/{serviceName}/network/{ipNet}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Get this object properties
REST: GET /router/{serviceName}/network/{ipNet}
@param serviceName [required] The internal name of your Router offer
@param ipNet [required] Gateway IP / CIDR Netmask | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java#L274-L279 |
mailin-api/sendinblue-java-mvn | src/main/java/com/sendinblue/Sendinblue.java | Sendinblue.get_campaign_v2 | public String get_campaign_v2(Map<String, Object> data) {
"""
/*
Get a particular campaign detail.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {Integer} id: Unique Id of the campaign [Mandatory]
"""
String id = data.get("id").toString();
return ... | java | public String get_campaign_v2(Map<String, Object> data) {
String id = data.get("id").toString();
return get("campaign/" + id + "/detailsv2/", EMPTY_STRING);
} | [
"public",
"String",
"get_campaign_v2",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"{",
"String",
"id",
"=",
"data",
".",
"get",
"(",
"\"id\"",
")",
".",
"toString",
"(",
")",
";",
"return",
"get",
"(",
"\"campaign/\"",
"+",
"id",
"+"... | /*
Get a particular campaign detail.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {Integer} id: Unique Id of the campaign [Mandatory] | [
"/",
"*",
"Get",
"a",
"particular",
"campaign",
"detail",
"."
] | train | https://github.com/mailin-api/sendinblue-java-mvn/blob/3a186b004003450f18d619aa084adc8d75086183/src/main/java/com/sendinblue/Sendinblue.java#L353-L356 |
joniles/mpxj | src/main/java/net/sf/mpxj/RecurringData.java | RecurringData.getYearlyRelativeDates | private void getYearlyRelativeDates(Calendar calendar, List<Date> dates) {
"""
Calculate start dates for a yearly relative recurrence.
@param calendar current date
@param dates array of start dates
"""
long startDate = calendar.getTimeInMillis();
calendar.set(Calendar.DAY_OF_MONTH, 1);
ca... | java | private void getYearlyRelativeDates(Calendar calendar, List<Date> dates)
{
long startDate = calendar.getTimeInMillis();
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.set(Calendar.MONTH, NumberHelper.getInt(m_monthNumber) - 1);
int dayNumber = NumberHelper.getInt(m_dayNumber);
while ... | [
"private",
"void",
"getYearlyRelativeDates",
"(",
"Calendar",
"calendar",
",",
"List",
"<",
"Date",
">",
"dates",
")",
"{",
"long",
"startDate",
"=",
"calendar",
".",
"getTimeInMillis",
"(",
")",
";",
"calendar",
".",
"set",
"(",
"Calendar",
".",
"DAY_OF_MON... | Calculate start dates for a yearly relative recurrence.
@param calendar current date
@param dates array of start dates | [
"Calculate",
"start",
"dates",
"for",
"a",
"yearly",
"relative",
"recurrence",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/RecurringData.java#L569-L598 |
VoltDB/voltdb | src/frontend/org/voltdb/InvocationDispatcher.java | InvocationDispatcher.sendSentinel | public final void sendSentinel(long txnId, int partitionId) {
"""
Send a command log replay sentinel to the given partition.
@param txnId
@param partitionId
"""
final long initiatorHSId = m_cartographer.getHSIdForSinglePartitionMaster(partitionId);
sendSentinel(txnId, initiatorHSId, -1, -1, t... | java | public final void sendSentinel(long txnId, int partitionId) {
final long initiatorHSId = m_cartographer.getHSIdForSinglePartitionMaster(partitionId);
sendSentinel(txnId, initiatorHSId, -1, -1, true);
} | [
"public",
"final",
"void",
"sendSentinel",
"(",
"long",
"txnId",
",",
"int",
"partitionId",
")",
"{",
"final",
"long",
"initiatorHSId",
"=",
"m_cartographer",
".",
"getHSIdForSinglePartitionMaster",
"(",
"partitionId",
")",
";",
"sendSentinel",
"(",
"txnId",
",",
... | Send a command log replay sentinel to the given partition.
@param txnId
@param partitionId | [
"Send",
"a",
"command",
"log",
"replay",
"sentinel",
"to",
"the",
"given",
"partition",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/InvocationDispatcher.java#L898-L901 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.displayConcernedElementsAtTheBeginningOfMethod | protected void displayConcernedElementsAtTheBeginningOfMethod(String methodName, List<String> concernedElements) {
"""
Display message (list of elements) at the beginning of method in logs.
@param methodName
is name of java method
@param concernedElements
is a list of concerned elements (example: authorized ... | java | protected void displayConcernedElementsAtTheBeginningOfMethod(String methodName, List<String> concernedElements) {
logger.debug("{}: with {} concernedElements", methodName, concernedElements.size());
int i = 0;
for (final String element : concernedElements) {
i++;
lo... | [
"protected",
"void",
"displayConcernedElementsAtTheBeginningOfMethod",
"(",
"String",
"methodName",
",",
"List",
"<",
"String",
">",
"concernedElements",
")",
"{",
"logger",
".",
"debug",
"(",
"\"{}: with {} concernedElements\"",
",",
"methodName",
",",
"concernedElements... | Display message (list of elements) at the beginning of method in logs.
@param methodName
is name of java method
@param concernedElements
is a list of concerned elements (example: authorized activities) | [
"Display",
"message",
"(",
"list",
"of",
"elements",
")",
"at",
"the",
"beginning",
"of",
"method",
"in",
"logs",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L861-L868 |
Terracotta-OSS/statistics | src/main/java/org/terracotta/statistics/derived/latency/DefaultLatencyHistogramStatistic.java | DefaultLatencyHistogramStatistic.tryExpire | private void tryExpire(boolean force, LongSupplier time) {
"""
Expire the histogram if it is time to expire it, or if force is true AND it is dirty
"""
long now = time.getAsLong();
if (force || now >= nextPruning) {
nextPruning = now + pruningDelay;
histogram.expire(now);
}
} | java | private void tryExpire(boolean force, LongSupplier time) {
long now = time.getAsLong();
if (force || now >= nextPruning) {
nextPruning = now + pruningDelay;
histogram.expire(now);
}
} | [
"private",
"void",
"tryExpire",
"(",
"boolean",
"force",
",",
"LongSupplier",
"time",
")",
"{",
"long",
"now",
"=",
"time",
".",
"getAsLong",
"(",
")",
";",
"if",
"(",
"force",
"||",
"now",
">=",
"nextPruning",
")",
"{",
"nextPruning",
"=",
"now",
"+",... | Expire the histogram if it is time to expire it, or if force is true AND it is dirty | [
"Expire",
"the",
"histogram",
"if",
"it",
"is",
"time",
"to",
"expire",
"it",
"or",
"if",
"force",
"is",
"true",
"AND",
"it",
"is",
"dirty"
] | train | https://github.com/Terracotta-OSS/statistics/blob/d24e4989b8c8dbe4f5210e49c7945d51b6585881/src/main/java/org/terracotta/statistics/derived/latency/DefaultLatencyHistogramStatistic.java#L169-L175 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/support/ParseTreeUtils.java | ParseTreeUtils.printNodeTree | public static <V> String printNodeTree(ParsingResult<V> parsingResult) {
"""
Creates a readable string represenation of the parse tree in the given {@link ParsingResult} object.
@param parsingResult the parsing result containing the parse tree
@return a new String
"""
checkArgNotNull(parsingResult,... | java | public static <V> String printNodeTree(ParsingResult<V> parsingResult) {
checkArgNotNull(parsingResult, "parsingResult");
return printNodeTree(parsingResult, Predicates.<Node<V>>alwaysTrue(), Predicates.<Node<V>>alwaysTrue());
} | [
"public",
"static",
"<",
"V",
">",
"String",
"printNodeTree",
"(",
"ParsingResult",
"<",
"V",
">",
"parsingResult",
")",
"{",
"checkArgNotNull",
"(",
"parsingResult",
",",
"\"parsingResult\"",
")",
";",
"return",
"printNodeTree",
"(",
"parsingResult",
",",
"Pred... | Creates a readable string represenation of the parse tree in the given {@link ParsingResult} object.
@param parsingResult the parsing result containing the parse tree
@return a new String | [
"Creates",
"a",
"readable",
"string",
"represenation",
"of",
"the",
"parse",
"tree",
"in",
"the",
"given",
"{",
"@link",
"ParsingResult",
"}",
"object",
"."
] | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/support/ParseTreeUtils.java#L326-L329 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/TransportContext.java | TransportContext.initializePipeline | public TransportChannelHandler initializePipeline(
SocketChannel channel,
RpcHandler channelRpcHandler) {
"""
Initializes a client or server Netty Channel Pipeline which encodes/decodes messages and
has a {@link org.apache.spark.network.server.TransportChannelHandler} to handle request or
response me... | java | public TransportChannelHandler initializePipeline(
SocketChannel channel,
RpcHandler channelRpcHandler) {
try {
TransportChannelHandler channelHandler = createChannelHandler(channel, channelRpcHandler);
ChunkFetchRequestHandler chunkFetchHandler =
createChunkFetchHandler(channelHandl... | [
"public",
"TransportChannelHandler",
"initializePipeline",
"(",
"SocketChannel",
"channel",
",",
"RpcHandler",
"channelRpcHandler",
")",
"{",
"try",
"{",
"TransportChannelHandler",
"channelHandler",
"=",
"createChannelHandler",
"(",
"channel",
",",
"channelRpcHandler",
")",... | Initializes a client or server Netty Channel Pipeline which encodes/decodes messages and
has a {@link org.apache.spark.network.server.TransportChannelHandler} to handle request or
response messages.
@param channel The channel to initialize.
@param channelRpcHandler The RPC handler to use for the channel.
@return Retu... | [
"Initializes",
"a",
"client",
"or",
"server",
"Netty",
"Channel",
"Pipeline",
"which",
"encodes",
"/",
"decodes",
"messages",
"and",
"has",
"a",
"{",
"@link",
"org",
".",
"apache",
".",
"spark",
".",
"network",
".",
"server",
".",
"TransportChannelHandler",
... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/TransportContext.java#L185-L210 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ValidationUtils.java | ValidationUtils.validate3NonNegative | public static int[] validate3NonNegative(int[] data, String paramName) {
"""
Reformats the input array to a length 3 array and checks that all values >= 0.
If the array is length 1, returns [a, a, a]
If the array is length 3, returns the array.
@param data An array
@param paramName The param name, for erro... | java | public static int[] validate3NonNegative(int[] data, String paramName){
validateNonNegative(data, paramName);
return validate3(data, paramName);
} | [
"public",
"static",
"int",
"[",
"]",
"validate3NonNegative",
"(",
"int",
"[",
"]",
"data",
",",
"String",
"paramName",
")",
"{",
"validateNonNegative",
"(",
"data",
",",
"paramName",
")",
";",
"return",
"validate3",
"(",
"data",
",",
"paramName",
")",
";",... | Reformats the input array to a length 3 array and checks that all values >= 0.
If the array is length 1, returns [a, a, a]
If the array is length 3, returns the array.
@param data An array
@param paramName The param name, for error reporting
@return An int array of length 3 that represents the input | [
"Reformats",
"the",
"input",
"array",
"to",
"a",
"length",
"3",
"array",
"and",
"checks",
"that",
"all",
"values",
">",
"=",
"0",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ValidationUtils.java#L230-L233 |
alibaba/otter | node/etl/src/main/java/com/alibaba/otter/node/etl/select/selector/MessageParser.java | MessageParser.copyEventColumn | private EventColumn copyEventColumn(Column column, boolean isUpdate, TableInfoHolder tableHolder) {
"""
把 erosa-protocol's Column 转化成 otter's model EventColumn.
@param column
@return
"""
EventColumn eventColumn = new EventColumn();
eventColumn.setIndex(column.getIndex());
eventColum... | java | private EventColumn copyEventColumn(Column column, boolean isUpdate, TableInfoHolder tableHolder) {
EventColumn eventColumn = new EventColumn();
eventColumn.setIndex(column.getIndex());
eventColumn.setKey(column.getIsKey());
eventColumn.setNull(column.getIsNull());
eventColumn.se... | [
"private",
"EventColumn",
"copyEventColumn",
"(",
"Column",
"column",
",",
"boolean",
"isUpdate",
",",
"TableInfoHolder",
"tableHolder",
")",
"{",
"EventColumn",
"eventColumn",
"=",
"new",
"EventColumn",
"(",
")",
";",
"eventColumn",
".",
"setIndex",
"(",
"column"... | 把 erosa-protocol's Column 转化成 otter's model EventColumn.
@param column
@return | [
"把",
"erosa",
"-",
"protocol",
"s",
"Column",
"转化成",
"otter",
"s",
"model",
"EventColumn",
"."
] | train | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/node/etl/src/main/java/com/alibaba/otter/node/etl/select/selector/MessageParser.java#L656-L687 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/GeoPackageCache.java | GeoPackageCache.getOrNoCacheOpen | public GeoPackage getOrNoCacheOpen(String name, File file) {
"""
Get the cached GeoPackage or open the GeoPackage file without caching it
@param name
GeoPackage name
@param file
GeoPackage file
@return GeoPackage
@since 3.1.0
"""
return getOrOpen(name, file, false);
} | java | public GeoPackage getOrNoCacheOpen(String name, File file) {
return getOrOpen(name, file, false);
} | [
"public",
"GeoPackage",
"getOrNoCacheOpen",
"(",
"String",
"name",
",",
"File",
"file",
")",
"{",
"return",
"getOrOpen",
"(",
"name",
",",
"file",
",",
"false",
")",
";",
"}"
] | Get the cached GeoPackage or open the GeoPackage file without caching it
@param name
GeoPackage name
@param file
GeoPackage file
@return GeoPackage
@since 3.1.0 | [
"Get",
"the",
"cached",
"GeoPackage",
"or",
"open",
"the",
"GeoPackage",
"file",
"without",
"caching",
"it"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/GeoPackageCache.java#L68-L70 |
alkacon/opencms-core | src/org/opencms/ugc/CmsUgcSession.java | CmsUgcSession.deleteContentValue | protected void deleteContentValue(CmsXmlContent content, Locale locale, String path) {
"""
Deletes the given value path from the content document.<p>
@param content the content document
@param locale the content locale
@param path the value XPath
"""
boolean hasValue = content.hasValue(path, loca... | java | protected void deleteContentValue(CmsXmlContent content, Locale locale, String path) {
boolean hasValue = content.hasValue(path, locale);
if (hasValue) {
int index = CmsXmlUtils.getXpathIndexInt(path) - 1;
I_CmsXmlContentValue val = content.getValue(path, locale);
if... | [
"protected",
"void",
"deleteContentValue",
"(",
"CmsXmlContent",
"content",
",",
"Locale",
"locale",
",",
"String",
"path",
")",
"{",
"boolean",
"hasValue",
"=",
"content",
".",
"hasValue",
"(",
"path",
",",
"locale",
")",
";",
"if",
"(",
"hasValue",
")",
... | Deletes the given value path from the content document.<p>
@param content the content document
@param locale the content locale
@param path the value XPath | [
"Deletes",
"the",
"given",
"value",
"path",
"from",
"the",
"content",
"document",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcSession.java#L634-L646 |
lessthanoptimal/ddogleg | src/org/ddogleg/solver/PolynomialSolver.java | PolynomialSolver.polynomialRootsEVD | @SuppressWarnings("ToArrayCallWithZeroLengthArrayArgument")
public static Complex_F64[] polynomialRootsEVD(double... coefficients) {
"""
Finds real and imaginary roots in a polynomial using the companion matrix and
Eigenvalue decomposition. The coefficients order is specified from smallest to largest.
Example,... | java | @SuppressWarnings("ToArrayCallWithZeroLengthArrayArgument")
public static Complex_F64[] polynomialRootsEVD(double... coefficients) {
PolynomialRoots alg = new RootFinderCompanion();
if( !alg.process( Polynomial.wrap(coefficients)) )
throw new IllegalArgumentException("Algorithm failed, was the input bad?");
... | [
"@",
"SuppressWarnings",
"(",
"\"ToArrayCallWithZeroLengthArrayArgument\"",
")",
"public",
"static",
"Complex_F64",
"[",
"]",
"polynomialRootsEVD",
"(",
"double",
"...",
"coefficients",
")",
"{",
"PolynomialRoots",
"alg",
"=",
"new",
"RootFinderCompanion",
"(",
")",
"... | Finds real and imaginary roots in a polynomial using the companion matrix and
Eigenvalue decomposition. The coefficients order is specified from smallest to largest.
Example, 5 + 6*x + 7*x^2 + 8*x^3 = [5,6,7,8]
@param coefficients Polynomial coefficients from smallest to largest.
@return The found roots. | [
"Finds",
"real",
"and",
"imaginary",
"roots",
"in",
"a",
"polynomial",
"using",
"the",
"companion",
"matrix",
"and",
"Eigenvalue",
"decomposition",
".",
"The",
"coefficients",
"order",
"is",
"specified",
"from",
"smallest",
"to",
"largest",
".",
"Example",
"5",
... | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/solver/PolynomialSolver.java#L66-L77 |
brettwooldridge/HikariCP | src/main/java/com/zaxxer/hikari/util/UtilityElf.java | UtilityElf.safeIsAssignableFrom | public static boolean safeIsAssignableFrom(Object obj, String className) {
"""
Checks whether an object is an instance of given type without throwing exception when the class is not loaded.
@param obj the object to check
@param className String class
@return true if object is assignable from the type, false oth... | java | public static boolean safeIsAssignableFrom(Object obj, String className) {
try {
Class<?> clazz = Class.forName(className);
return clazz.isAssignableFrom(obj.getClass());
} catch (ClassNotFoundException ignored) {
return false;
}
} | [
"public",
"static",
"boolean",
"safeIsAssignableFrom",
"(",
"Object",
"obj",
",",
"String",
"className",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"className",
")",
";",
"return",
"clazz",
".",
"isAssignableF... | Checks whether an object is an instance of given type without throwing exception when the class is not loaded.
@param obj the object to check
@param className String class
@return true if object is assignable from the type, false otherwise or when the class cannot be loaded | [
"Checks",
"whether",
"an",
"object",
"is",
"an",
"instance",
"of",
"given",
"type",
"without",
"throwing",
"exception",
"when",
"the",
"class",
"is",
"not",
"loaded",
"."
] | train | https://github.com/brettwooldridge/HikariCP/blob/c509ec1a3f1e19769ee69323972f339cf098ff4b/src/main/java/com/zaxxer/hikari/util/UtilityElf.java#L73-L80 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.searchGuildID | public void searchGuildID(String name, Callback<List<String>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on guild Search API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/search">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@... | java | public void searchGuildID(String name, Callback<List<String>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.GUILD, name));
gw2API.searchGuildID(name).enqueue(callback);
} | [
"public",
"void",
"searchGuildID",
"(",
"String",
"name",
",",
"Callback",
"<",
"List",
"<",
"String",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ParamType",
"."... | For more info on guild Search API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/search">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param name guild name
@param callback callback that i... | [
"For",
"more",
"info",
"on",
"guild",
"Search",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"guild",
"/",
"search",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1631-L1634 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ReportUtil.java | ReportUtil.foundFunctionInGroupHeader | public static boolean foundFunctionInGroupHeader(ReportLayout layout, String groupName) {
"""
Test to see if a function is found in group header band
@param layout report layout
@param groupName group name
@return true if a function is found in group header band, false otherwise
"""
List<Band> groupHead... | java | public static boolean foundFunctionInGroupHeader(ReportLayout layout, String groupName) {
List<Band> groupHeaderBands = layout.getGroupHeaderBands();
for (Band band : groupHeaderBands) {
if (band.getName().equals(ReportLayout.GROUP_HEADER_BAND_NAME_PREFIX + groupName)) {
return foundFunctionInBand(band);... | [
"public",
"static",
"boolean",
"foundFunctionInGroupHeader",
"(",
"ReportLayout",
"layout",
",",
"String",
"groupName",
")",
"{",
"List",
"<",
"Band",
">",
"groupHeaderBands",
"=",
"layout",
".",
"getGroupHeaderBands",
"(",
")",
";",
"for",
"(",
"Band",
"band",
... | Test to see if a function is found in group header band
@param layout report layout
@param groupName group name
@return true if a function is found in group header band, false otherwise | [
"Test",
"to",
"see",
"if",
"a",
"function",
"is",
"found",
"in",
"group",
"header",
"band"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ReportUtil.java#L1006-L1014 |
cdapio/tigon | tigon-flow/src/main/java/co/cask/tigon/internal/app/runtime/distributed/AbstractDistributedProgramRunner.java | AbstractDistributedProgramRunner.addCleanupListener | private TwillController addCleanupListener(TwillController controller, final File hConfFile,
final File cConfFile, final Program program, final File programDir) {
"""
Adds a listener to the given TwillController to delete local temp files when the program has started/te... | java | private TwillController addCleanupListener(TwillController controller, final File hConfFile,
final File cConfFile, final Program program, final File programDir) {
final AtomicBoolean deleted = new AtomicBoolean(false);
controller.addListener(new ServiceListenerAdapt... | [
"private",
"TwillController",
"addCleanupListener",
"(",
"TwillController",
"controller",
",",
"final",
"File",
"hConfFile",
",",
"final",
"File",
"cConfFile",
",",
"final",
"Program",
"program",
",",
"final",
"File",
"programDir",
")",
"{",
"final",
"AtomicBoolean"... | Adds a listener to the given TwillController to delete local temp files when the program has started/terminated.
The local temp files could be removed once the program is started, since Twill would keep the files in
HDFS and no long needs the local temp files once program is started.
@return The same TwillController i... | [
"Adds",
"a",
"listener",
"to",
"the",
"given",
"TwillController",
"to",
"delete",
"local",
"temp",
"files",
"when",
"the",
"program",
"has",
"started",
"/",
"terminated",
".",
"The",
"local",
"temp",
"files",
"could",
"be",
"removed",
"once",
"the",
"program... | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-flow/src/main/java/co/cask/tigon/internal/app/runtime/distributed/AbstractDistributedProgramRunner.java#L184-L224 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.calcEntropy | private double calcEntropy(final List<Match> matches, final boolean include_brute_force) {
"""
Helper method to calculate entropy from a list of matches.
@param matches the list of matches
@return the sum of the entropy in the list passed in
"""
double entropy = 0;
for (Match match : matche... | java | private double calcEntropy(final List<Match> matches, final boolean include_brute_force)
{
double entropy = 0;
for (Match match : matches)
{
if (include_brute_force || !(match instanceof BruteForceMatch))
{
entropy += match.calculateEntropy();
... | [
"private",
"double",
"calcEntropy",
"(",
"final",
"List",
"<",
"Match",
">",
"matches",
",",
"final",
"boolean",
"include_brute_force",
")",
"{",
"double",
"entropy",
"=",
"0",
";",
"for",
"(",
"Match",
"match",
":",
"matches",
")",
"{",
"if",
"(",
"incl... | Helper method to calculate entropy from a list of matches.
@param matches the list of matches
@return the sum of the entropy in the list passed in | [
"Helper",
"method",
"to",
"calculate",
"entropy",
"from",
"a",
"list",
"of",
"matches",
"."
] | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L531-L542 |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java | PDPageContentStreamExt.newLineAtOffset | public void newLineAtOffset (final float tx, final float ty) throws IOException {
"""
The Td operator. Move to the start of the next line, offset from the start
of the current line by (tx, ty).
@param tx
The x translation.
@param ty
The y translation.
@throws IOException
If there is an error writing to th... | java | public void newLineAtOffset (final float tx, final float ty) throws IOException
{
if (!inTextMode)
{
throw new IllegalStateException ("Error: must call beginText() before newLineAtOffset()");
}
writeOperand (tx);
writeOperand (ty);
writeOperator ((byte) 'T', (byte) 'd');
} | [
"public",
"void",
"newLineAtOffset",
"(",
"final",
"float",
"tx",
",",
"final",
"float",
"ty",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"inTextMode",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Error: must call beginText() before newLineAtOf... | The Td operator. Move to the start of the next line, offset from the start
of the current line by (tx, ty).
@param tx
The x translation.
@param ty
The y translation.
@throws IOException
If there is an error writing to the stream.
@throws IllegalStateException
If the method was not allowed to be called at this time. | [
"The",
"Td",
"operator",
".",
"Move",
"to",
"the",
"start",
"of",
"the",
"next",
"line",
"offset",
"from",
"the",
"start",
"of",
"the",
"current",
"line",
"by",
"(",
"tx",
"ty",
")",
"."
] | train | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java#L443-L452 |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/BlockReconstructor.java | BlockReconstructor.computeMetadata | DataInputStream computeMetadata(Configuration conf, InputStream dataStream)
throws IOException {
"""
Reads data from the data stream provided and computes metadata.
"""
ByteArrayOutputStream mdOutBase = new ByteArrayOutputStream(1024*1024);
DataOutputStream mdOut = new DataOutputStream(mdOutBase);
... | java | DataInputStream computeMetadata(Configuration conf, InputStream dataStream)
throws IOException {
ByteArrayOutputStream mdOutBase = new ByteArrayOutputStream(1024*1024);
DataOutputStream mdOut = new DataOutputStream(mdOutBase);
// First, write out the version.
mdOut.writeShort(FSDataset.FORMAT_VERSION... | [
"DataInputStream",
"computeMetadata",
"(",
"Configuration",
"conf",
",",
"InputStream",
"dataStream",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"mdOutBase",
"=",
"new",
"ByteArrayOutputStream",
"(",
"1024",
"*",
"1024",
")",
";",
"DataOutputStream",
... | Reads data from the data stream provided and computes metadata. | [
"Reads",
"data",
"from",
"the",
"data",
"stream",
"provided",
"and",
"computes",
"metadata",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/BlockReconstructor.java#L649-L701 |
VoltDB/voltdb | src/frontend/org/voltdb/LoadedProcedureSet.java | LoadedProcedureSet.getNibbleDeleteProc | public ProcedureRunner getNibbleDeleteProc(String procName,
Table catTable,
Column column,
ComparisonOperation op) {
"""
(TableName).nibbleDelete is cached in default procedu... | java | public ProcedureRunner getNibbleDeleteProc(String procName,
Table catTable,
Column column,
ComparisonOperation op)
{
ProcedureRunner pr = m_defaultProcCache.get(procNa... | [
"public",
"ProcedureRunner",
"getNibbleDeleteProc",
"(",
"String",
"procName",
",",
"Table",
"catTable",
",",
"Column",
"column",
",",
"ComparisonOperation",
"op",
")",
"{",
"ProcedureRunner",
"pr",
"=",
"m_defaultProcCache",
".",
"get",
"(",
"procName",
")",
";",... | (TableName).nibbleDelete is cached in default procedure cache.
@param tableName
@return | [
"(",
"TableName",
")",
".",
"nibbleDelete",
"is",
"cached",
"in",
"default",
"procedure",
"cache",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/LoadedProcedureSet.java#L285-L305 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JBasePanel.java | JBasePanel.addToolbar | public JPanel addToolbar(JComponent screen, JComponent toolbar) {
"""
Add this toolbar to this panel and return the new main panel.
@param screen The screen to add a toolbar to.
@param toolbar The toolbar to add.
@return The new panel with these two components in them.
"""
JPanel panelMain = new JPa... | java | public JPanel addToolbar(JComponent screen, JComponent toolbar)
{
JPanel panelMain = new JPanel();
panelMain.setOpaque(false);
panelMain.setLayout(new BoxLayout(panelMain, BoxLayout.Y_AXIS));
panelMain.add(toolbar);
toolbar.setAlignmentX(0);
panelMain.add(screen);
... | [
"public",
"JPanel",
"addToolbar",
"(",
"JComponent",
"screen",
",",
"JComponent",
"toolbar",
")",
"{",
"JPanel",
"panelMain",
"=",
"new",
"JPanel",
"(",
")",
";",
"panelMain",
".",
"setOpaque",
"(",
"false",
")",
";",
"panelMain",
".",
"setLayout",
"(",
"n... | Add this toolbar to this panel and return the new main panel.
@param screen The screen to add a toolbar to.
@param toolbar The toolbar to add.
@return The new panel with these two components in them. | [
"Add",
"this",
"toolbar",
"to",
"this",
"panel",
"and",
"return",
"the",
"new",
"main",
"panel",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JBasePanel.java#L571-L581 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF5.java | CommonOps_DDF5.extractRow | public static DMatrix5 extractRow( DMatrix5x5 a , int row , DMatrix5 out ) {
"""
Extracts the row from the matrix a.
@param a Input matrix
@param row Which row is to be extracted
@param out output. Storage for the extracted row. If null then a new vector will be returned.
@return The extracted row.
"""
... | java | public static DMatrix5 extractRow( DMatrix5x5 a , int row , DMatrix5 out ) {
if( out == null) out = new DMatrix5();
switch( row ) {
case 0:
out.a1 = a.a11;
out.a2 = a.a12;
out.a3 = a.a13;
out.a4 = a.a14;
out.a5 =... | [
"public",
"static",
"DMatrix5",
"extractRow",
"(",
"DMatrix5x5",
"a",
",",
"int",
"row",
",",
"DMatrix5",
"out",
")",
"{",
"if",
"(",
"out",
"==",
"null",
")",
"out",
"=",
"new",
"DMatrix5",
"(",
")",
";",
"switch",
"(",
"row",
")",
"{",
"case",
"0... | Extracts the row from the matrix a.
@param a Input matrix
@param row Which row is to be extracted
@param out output. Storage for the extracted row. If null then a new vector will be returned.
@return The extracted row. | [
"Extracts",
"the",
"row",
"from",
"the",
"matrix",
"a",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF5.java#L1953-L1995 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/udpchannel/internal/BufferDump.java | BufferDump.formatLineId | static private StringBuilder formatLineId(StringBuilder buffer, int value) {
"""
Format the input value as a four digit hex number, padding with zeros.
@param buffer
@param value
@return StringBuilder
"""
char[] chars = new char[4];
for (int i = 3; i >= 0; i--) {
chars[i] = (ch... | java | static private StringBuilder formatLineId(StringBuilder buffer, int value) {
char[] chars = new char[4];
for (int i = 3; i >= 0; i--) {
chars[i] = (char) HEX_BYTES[(value % 16) & 0xF];
value >>= 4;
}
return buffer.append(chars);
} | [
"static",
"private",
"StringBuilder",
"formatLineId",
"(",
"StringBuilder",
"buffer",
",",
"int",
"value",
")",
"{",
"char",
"[",
"]",
"chars",
"=",
"new",
"char",
"[",
"4",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"3",
";",
"i",
">=",
"0",
";",
"i",... | Format the input value as a four digit hex number, padding with zeros.
@param buffer
@param value
@return StringBuilder | [
"Format",
"the",
"input",
"value",
"as",
"a",
"four",
"digit",
"hex",
"number",
"padding",
"with",
"zeros",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/udpchannel/internal/BufferDump.java#L94-L101 |
m-m-m/util | gwt/src/main/java/net/sf/mmm/util/gwt/base/rebind/AbstractIncrementalGenerator.java | AbstractIncrementalGenerator.isCachedResultObsolete | protected boolean isCachedResultObsolete(CachedGeneratorResult cachedGeneratorResult, String typeName) {
"""
This method determines whether a {@link CachedGeneratorResult} is obsolete or can be reused.
@param cachedGeneratorResult is the {@link CachedGeneratorResult}.
@param typeName is the full-qualified name... | java | protected boolean isCachedResultObsolete(CachedGeneratorResult cachedGeneratorResult, String typeName) {
try {
URL javaFileUrl = Thread.currentThread().getContextClassLoader()
.getResource(typeName.replace('.', '/') + ".java");
String protocol = javaFileUrl.getProtocol().toLowerCase();
... | [
"protected",
"boolean",
"isCachedResultObsolete",
"(",
"CachedGeneratorResult",
"cachedGeneratorResult",
",",
"String",
"typeName",
")",
"{",
"try",
"{",
"URL",
"javaFileUrl",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
"."... | This method determines whether a {@link CachedGeneratorResult} is obsolete or can be reused.
@param cachedGeneratorResult is the {@link CachedGeneratorResult}.
@param typeName is the full-qualified name of the {@link Class} to generate.
@return {@code true} if the {@link CachedGeneratorResult} is obsolete and has to b... | [
"This",
"method",
"determines",
"whether",
"a",
"{",
"@link",
"CachedGeneratorResult",
"}",
"is",
"obsolete",
"or",
"can",
"be",
"reused",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/gwt/src/main/java/net/sf/mmm/util/gwt/base/rebind/AbstractIncrementalGenerator.java#L257-L275 |
joniles/mpxj | src/main/java/net/sf/mpxj/sample/PrimaveraConvert.java | PrimaveraConvert.processProject | private void processProject(PrimaveraDatabaseReader reader, int projectID, String outputFile) throws Exception {
"""
Process a single project.
@param reader Primavera reader
@param projectID required project ID
@param outputFile output file name
"""
long start = System.currentTimeMillis();
rea... | java | private void processProject(PrimaveraDatabaseReader reader, int projectID, String outputFile) throws Exception
{
long start = System.currentTimeMillis();
reader.setProjectID(projectID);
ProjectFile projectFile = reader.read();
long elapsed = System.currentTimeMillis() - start;
System.ou... | [
"private",
"void",
"processProject",
"(",
"PrimaveraDatabaseReader",
"reader",
",",
"int",
"projectID",
",",
"String",
"outputFile",
")",
"throws",
"Exception",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"reader",
".",
"setProj... | Process a single project.
@param reader Primavera reader
@param projectID required project ID
@param outputFile output file name | [
"Process",
"a",
"single",
"project",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/sample/PrimaveraConvert.java#L114-L128 |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/command/option/HelpFormatter.java | HelpFormatter.appendOption | private void appendOption(StringBuilder sb, Option option, boolean required) {
"""
Appends the usage clause for an Option to a StringBuilder.
@param sb the StringBuilder to append to
@param option the Option to append
@param required whether the Option is required or not
"""
if (!required) {
... | java | private void appendOption(StringBuilder sb, Option option, boolean required) {
if (!required) {
sb.append(OPTIONAL_BRACKET_OPEN);
}
if (option.getName() != null) {
sb.append(OPTION_PREFIX).append(option.getName());
} else {
sb.append(LONG_OPTION_PREFIX... | [
"private",
"void",
"appendOption",
"(",
"StringBuilder",
"sb",
",",
"Option",
"option",
",",
"boolean",
"required",
")",
"{",
"if",
"(",
"!",
"required",
")",
"{",
"sb",
".",
"append",
"(",
"OPTIONAL_BRACKET_OPEN",
")",
";",
"}",
"if",
"(",
"option",
"."... | Appends the usage clause for an Option to a StringBuilder.
@param sb the StringBuilder to append to
@param option the Option to append
@param required whether the Option is required or not | [
"Appends",
"the",
"usage",
"clause",
"for",
"an",
"Option",
"to",
"a",
"StringBuilder",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/option/HelpFormatter.java#L289-L306 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/extra/scannotation/ClasspathUrlFinder.java | ClasspathUrlFinder.findResourceBase | public static URL findResourceBase(String baseResource, ClassLoader loader) {
"""
Find the classpath URL for a specific classpath resource. The classpath URL is extracted
from loader.getResource() using the baseResource.
@param baseResource
@param loader
@return
"""
URL url = loader.getResource(ba... | java | public static URL findResourceBase(String baseResource, ClassLoader loader)
{
URL url = loader.getResource(baseResource);
return findResourceBase(url, baseResource);
} | [
"public",
"static",
"URL",
"findResourceBase",
"(",
"String",
"baseResource",
",",
"ClassLoader",
"loader",
")",
"{",
"URL",
"url",
"=",
"loader",
".",
"getResource",
"(",
"baseResource",
")",
";",
"return",
"findResourceBase",
"(",
"url",
",",
"baseResource",
... | Find the classpath URL for a specific classpath resource. The classpath URL is extracted
from loader.getResource() using the baseResource.
@param baseResource
@param loader
@return | [
"Find",
"the",
"classpath",
"URL",
"for",
"a",
"specific",
"classpath",
"resource",
".",
"The",
"classpath",
"URL",
"is",
"extracted",
"from",
"loader",
".",
"getResource",
"()",
"using",
"the",
"baseResource",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/extra/scannotation/ClasspathUrlFinder.java#L103-L107 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosCommentsApi.java | PhotosCommentsApi.getList | public Comments getList(String photoId, String minCommentDate, String maxCommentDate, boolean sign) throws JinxException {
"""
Returns the comments for a photo
<br>
This method does not require authentication. You can choose to sign the call by passing true or false
as the value of the sign parameter.
<br>
... | java | public Comments getList(String photoId, String minCommentDate, String maxCommentDate, boolean sign) throws JinxException {
JinxUtils.validateParams(photoId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photos.comments.getList");
params.put("photo_id", photoId);
if (!Ji... | [
"public",
"Comments",
"getList",
"(",
"String",
"photoId",
",",
"String",
"minCommentDate",
",",
"String",
"maxCommentDate",
",",
"boolean",
"sign",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photoId",
")",
";",
"Map",
"<",
... | Returns the comments for a photo
<br>
This method does not require authentication. You can choose to sign the call by passing true or false
as the value of the sign parameter.
<br>
@param photoId (Required) The id of the photo to fetch comments for.
@param minCommentDate (Optional) Minimum date that a a comment... | [
"Returns",
"the",
"comments",
"for",
"a",
"photo",
"<br",
">",
"This",
"method",
"does",
"not",
"require",
"authentication",
".",
"You",
"can",
"choose",
"to",
"sign",
"the",
"call",
"by",
"passing",
"true",
"or",
"false",
"as",
"the",
"value",
"of",
"th... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosCommentsApi.java#L121-L133 |
mapbox/mapbox-events-android | liblocation/src/main/java/com/mapbox/android/core/location/LocationEngineProvider.java | LocationEngineProvider.getBestLocationEngine | @NonNull
@Deprecated
public static LocationEngine getBestLocationEngine(@NonNull Context context, boolean background) {
"""
Returns instance to the best location engine, given the included libraries.
@param context {@link Context}.
@param background true if background optimized engine is desired (note: ... | java | @NonNull
@Deprecated
public static LocationEngine getBestLocationEngine(@NonNull Context context, boolean background) {
return getBestLocationEngine(context);
} | [
"@",
"NonNull",
"@",
"Deprecated",
"public",
"static",
"LocationEngine",
"getBestLocationEngine",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"boolean",
"background",
")",
"{",
"return",
"getBestLocationEngine",
"(",
"context",
")",
";",
"}"
] | Returns instance to the best location engine, given the included libraries.
@param context {@link Context}.
@param background true if background optimized engine is desired (note: parameter deprecated)
@return a unique instance of {@link LocationEngine} every time method is called.
@since 1.0.0 | [
"Returns",
"instance",
"to",
"the",
"best",
"location",
"engine",
"given",
"the",
"included",
"libraries",
"."
] | train | https://github.com/mapbox/mapbox-events-android/blob/5b5ca7e04cb8fab31a8dc040b6e7521f930a58a4/liblocation/src/main/java/com/mapbox/android/core/location/LocationEngineProvider.java#L30-L34 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/XmlStringBuilder.java | XmlStringBuilder.appendAttribute | public void appendAttribute(final String name, final Object value) {
"""
<p>
Adds an xml attribute name+value pair to the end of this XmlStringBuilder. All attribute values are escaped to
prevent malformed XML and XSS attacks.
</p>
<p>
If the value is null an empty string "" is output.
</p>
<p>
Eg. name="v... | java | public void appendAttribute(final String name, final Object value) {
write(' ');
write(name);
write("=\"");
if (value instanceof Message) {
appendEscaped(translate(value));
} else if (value != null) {
appendEscaped(value.toString());
}
write('"');
} | [
"public",
"void",
"appendAttribute",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"value",
")",
"{",
"write",
"(",
"'",
"'",
")",
";",
"write",
"(",
"name",
")",
";",
"write",
"(",
"\"=\\\"\"",
")",
";",
"if",
"(",
"value",
"instanceof",
"... | <p>
Adds an xml attribute name+value pair to the end of this XmlStringBuilder. All attribute values are escaped to
prevent malformed XML and XSS attacks.
</p>
<p>
If the value is null an empty string "" is output.
</p>
<p>
Eg. name="value"
</p>
@param name the name of the attribute to be added.
@param value the value ... | [
"<p",
">",
"Adds",
"an",
"xml",
"attribute",
"name",
"+",
"value",
"pair",
"to",
"the",
"end",
"of",
"this",
"XmlStringBuilder",
".",
"All",
"attribute",
"values",
"are",
"escaped",
"to",
"prevent",
"malformed",
"XML",
"and",
"XSS",
"attacks",
".",
"<",
... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/XmlStringBuilder.java#L190-L202 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.router_new_duration_POST | public OvhOrder router_new_duration_POST(String duration, String vrack) throws IOException {
"""
Create order
REST: POST /order/router/new/{duration}
@param vrack [required] The name of your vrack
@param duration [required] Duration
"""
String qPath = "/order/router/new/{duration}";
StringBuilder sb =... | java | public OvhOrder router_new_duration_POST(String duration, String vrack) throws IOException {
String qPath = "/order/router/new/{duration}";
StringBuilder sb = path(qPath, duration);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "vrack", vrack);
String resp = exec(qPath, "POST", sb.toStr... | [
"public",
"OvhOrder",
"router_new_duration_POST",
"(",
"String",
"duration",
",",
"String",
"vrack",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/router/new/{duration}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"duration"... | Create order
REST: POST /order/router/new/{duration}
@param vrack [required] The name of your vrack
@param duration [required] Duration | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L940-L947 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsCategoriesTab.java | CmsCategoriesTab.addChildren | private void addChildren(CmsTreeItem parent, List<CmsCategoryTreeEntry> children, List<String> selectedCategories) {
"""
Adds children item to the category tree and select the categories.<p>
@param parent the parent item
@param children the list of children
@param selectedCategories the list of categories to ... | java | private void addChildren(CmsTreeItem parent, List<CmsCategoryTreeEntry> children, List<String> selectedCategories) {
if (children != null) {
for (CmsCategoryTreeEntry child : children) {
// set the category tree item and add to parent tree item
CmsTreeItem treeItem =... | [
"private",
"void",
"addChildren",
"(",
"CmsTreeItem",
"parent",
",",
"List",
"<",
"CmsCategoryTreeEntry",
">",
"children",
",",
"List",
"<",
"String",
">",
"selectedCategories",
")",
"{",
"if",
"(",
"children",
"!=",
"null",
")",
"{",
"for",
"(",
"CmsCategor... | Adds children item to the category tree and select the categories.<p>
@param parent the parent item
@param children the list of children
@param selectedCategories the list of categories to select | [
"Adds",
"children",
"item",
"to",
"the",
"category",
"tree",
"and",
"select",
"the",
"categories",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsCategoriesTab.java#L334-L348 |
languagetool-org/languagetool | languagetool-server/src/main/java/org/languagetool/server/UserLimits.java | UserLimits.getLimitsFromToken | static UserLimits getLimitsFromToken(HTTPServerConfig config, String jwtToken) {
"""
Get limits from the JWT key itself, no database access needed.
"""
Objects.requireNonNull(jwtToken);
try {
String secretKey = config.getSecretTokenKey();
if (secretKey == null) {
throw new RuntimeEx... | java | static UserLimits getLimitsFromToken(HTTPServerConfig config, String jwtToken) {
Objects.requireNonNull(jwtToken);
try {
String secretKey = config.getSecretTokenKey();
if (secretKey == null) {
throw new RuntimeException("You specified a 'token' parameter but this server doesn't accept tokens... | [
"static",
"UserLimits",
"getLimitsFromToken",
"(",
"HTTPServerConfig",
"config",
",",
"String",
"jwtToken",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"jwtToken",
")",
";",
"try",
"{",
"String",
"secretKey",
"=",
"config",
".",
"getSecretTokenKey",
"(",
")... | Get limits from the JWT key itself, no database access needed. | [
"Get",
"limits",
"from",
"the",
"JWT",
"key",
"itself",
"no",
"database",
"access",
"needed",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-server/src/main/java/org/languagetool/server/UserLimits.java#L65-L92 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/registry/Registries.java | Registries.processPostSetBlock | public static void processPostSetBlock(Chunk chunk, BlockPos pos, IBlockState oldState, IBlockState newState) {
"""
Processes {@link ISetBlockCallback ISetBlockCallbacks}.<br>
Called by ASM from {@link Chunk#setBlockState(BlockPos, IBlockState)}.
@param chunk the chunk
@param pos the pos
@param oldState the ... | java | public static void processPostSetBlock(Chunk chunk, BlockPos pos, IBlockState oldState, IBlockState newState)
{
postSetBlockRegistry.processCallbacks(chunk, pos, oldState, newState);
} | [
"public",
"static",
"void",
"processPostSetBlock",
"(",
"Chunk",
"chunk",
",",
"BlockPos",
"pos",
",",
"IBlockState",
"oldState",
",",
"IBlockState",
"newState",
")",
"{",
"postSetBlockRegistry",
".",
"processCallbacks",
"(",
"chunk",
",",
"pos",
",",
"oldState",
... | Processes {@link ISetBlockCallback ISetBlockCallbacks}.<br>
Called by ASM from {@link Chunk#setBlockState(BlockPos, IBlockState)}.
@param chunk the chunk
@param pos the pos
@param oldState the old state
@param newState the new state | [
"Processes",
"{",
"@link",
"ISetBlockCallback",
"ISetBlockCallbacks",
"}",
".",
"<br",
">",
"Called",
"by",
"ASM",
"from",
"{",
"@link",
"Chunk#setBlockState",
"(",
"BlockPos",
"IBlockState",
")",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/registry/Registries.java#L151-L154 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/durableexecutor/impl/TaskRingBuffer.java | TaskRingBuffer.putBackup | void putBackup(int sequence, Callable task) {
"""
Puts the task for the given sequence
@param sequence The sequence
@param task The task
"""
head = Math.max(head, sequence);
callableCounter++;
int index = toIndex(sequence);
ringItems[index] = task;
isTask[index] ... | java | void putBackup(int sequence, Callable task) {
head = Math.max(head, sequence);
callableCounter++;
int index = toIndex(sequence);
ringItems[index] = task;
isTask[index] = true;
sequences[index] = sequence;
} | [
"void",
"putBackup",
"(",
"int",
"sequence",
",",
"Callable",
"task",
")",
"{",
"head",
"=",
"Math",
".",
"max",
"(",
"head",
",",
"sequence",
")",
";",
"callableCounter",
"++",
";",
"int",
"index",
"=",
"toIndex",
"(",
"sequence",
")",
";",
"ringItems... | Puts the task for the given sequence
@param sequence The sequence
@param task The task | [
"Puts",
"the",
"task",
"for",
"the",
"given",
"sequence"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/durableexecutor/impl/TaskRingBuffer.java#L101-L108 |
h2oai/h2o-2 | src/main/java/water/fvec/Chunk.java | Chunk.set0 | public final float set0(int idx, float f) {
"""
Set a floating element in a chunk given a 0-based chunk local index.
"""
setWrite();
if( _chk2.set_impl(idx,f) ) return f;
(_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,f);
return f;
} | java | public final float set0(int idx, float f) {
setWrite();
if( _chk2.set_impl(idx,f) ) return f;
(_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,f);
return f;
} | [
"public",
"final",
"float",
"set0",
"(",
"int",
"idx",
",",
"float",
"f",
")",
"{",
"setWrite",
"(",
")",
";",
"if",
"(",
"_chk2",
".",
"set_impl",
"(",
"idx",
",",
"f",
")",
")",
"return",
"f",
";",
"(",
"_chk2",
"=",
"inflate_impl",
"(",
"new",... | Set a floating element in a chunk given a 0-based chunk local index. | [
"Set",
"a",
"floating",
"element",
"in",
"a",
"chunk",
"given",
"a",
"0",
"-",
"based",
"chunk",
"local",
"index",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/Chunk.java#L145-L150 |
jingwei/krati | krati-main/src/main/java/krati/core/StoreConfig.java | StoreConfig.getDouble | public double getDouble(String pName, double defaultValue) {
"""
Gets a double property via a string property name.
@param pName - the property name
@param defaultValue - the default property value
@return a double property
"""
String pValue = _properties.getProperty(pName);
return ... | java | public double getDouble(String pName, double defaultValue) {
String pValue = _properties.getProperty(pName);
return parseDouble(pName, pValue, defaultValue);
} | [
"public",
"double",
"getDouble",
"(",
"String",
"pName",
",",
"double",
"defaultValue",
")",
"{",
"String",
"pValue",
"=",
"_properties",
".",
"getProperty",
"(",
"pName",
")",
";",
"return",
"parseDouble",
"(",
"pName",
",",
"pValue",
",",
"defaultValue",
"... | Gets a double property via a string property name.
@param pName - the property name
@param defaultValue - the default property value
@return a double property | [
"Gets",
"a",
"double",
"property",
"via",
"a",
"string",
"property",
"name",
"."
] | train | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/StoreConfig.java#L447-L450 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configurealert.java | br_configurealert.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
br_configurealert_responses result = (br_configurealert_responses) serv... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
br_configurealert_responses result = (br_configurealert_responses) service.get_payload_formatter().string_to_resource(br_configurealert_responses.class, response);
if(result.errorcode != 0)
{
if (... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"br_configurealert_responses",
"result",
"=",
"(",
"br_configurealert_responses",
")",
"service",
".",
"get_pa... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configurealert.java#L178-L195 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/CauchyDistribution.java | CauchyDistribution.logpdf | public static double logpdf(double x, double location, double shape) {
"""
PDF function, static version.
@param x Value
@param location Location (x0)
@param shape Shape (gamma)
@return PDF value
"""
final double v = (x - location) / shape;
return -FastMath.log(Math.PI * shape * (1 + v * v));
} | java | public static double logpdf(double x, double location, double shape) {
final double v = (x - location) / shape;
return -FastMath.log(Math.PI * shape * (1 + v * v));
} | [
"public",
"static",
"double",
"logpdf",
"(",
"double",
"x",
",",
"double",
"location",
",",
"double",
"shape",
")",
"{",
"final",
"double",
"v",
"=",
"(",
"x",
"-",
"location",
")",
"/",
"shape",
";",
"return",
"-",
"FastMath",
".",
"log",
"(",
"Math... | PDF function, static version.
@param x Value
@param location Location (x0)
@param shape Shape (gamma)
@return PDF value | [
"PDF",
"function",
"static",
"version",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/CauchyDistribution.java#L149-L152 |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientMockBuilder.java | HttpClientMockBuilder.doReturnJSON | public HttpClientResponseBuilder doReturnJSON(String response, Charset charset) {
"""
Adds action which returns provided JSON in provided encoding and status 200. Additionally it sets "Content-type" header to "application/json".
@param response JSON to return
@return response builder
"""
return res... | java | public HttpClientResponseBuilder doReturnJSON(String response, Charset charset) {
return responseBuilder.doReturnJSON(response, charset);
} | [
"public",
"HttpClientResponseBuilder",
"doReturnJSON",
"(",
"String",
"response",
",",
"Charset",
"charset",
")",
"{",
"return",
"responseBuilder",
".",
"doReturnJSON",
"(",
"response",
",",
"charset",
")",
";",
"}"
] | Adds action which returns provided JSON in provided encoding and status 200. Additionally it sets "Content-type" header to "application/json".
@param response JSON to return
@return response builder | [
"Adds",
"action",
"which",
"returns",
"provided",
"JSON",
"in",
"provided",
"encoding",
"and",
"status",
"200",
".",
"Additionally",
"it",
"sets",
"Content",
"-",
"type",
"header",
"to",
"application",
"/",
"json",
"."
] | train | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientMockBuilder.java#L235-L237 |
hector-client/hector | core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java | HFactory.getOrCreateCluster | public static Cluster getOrCreateCluster(String clusterName,
CassandraHostConfigurator cassandraHostConfigurator, Map<String, String> credentials) {
"""
Method tries to create a Cluster instance for an existing Cassandra
cluster. If another class already called getOrCreateCluster, the factory
returns the c... | java | public static Cluster getOrCreateCluster(String clusterName,
CassandraHostConfigurator cassandraHostConfigurator, Map<String, String> credentials) {
return createCluster(clusterName, cassandraHostConfigurator, credentials);
} | [
"public",
"static",
"Cluster",
"getOrCreateCluster",
"(",
"String",
"clusterName",
",",
"CassandraHostConfigurator",
"cassandraHostConfigurator",
",",
"Map",
"<",
"String",
",",
"String",
">",
"credentials",
")",
"{",
"return",
"createCluster",
"(",
"clusterName",
","... | Method tries to create a Cluster instance for an existing Cassandra
cluster. If another class already called getOrCreateCluster, the factory
returns the cached instance. If the instance doesn't exist in memory, a new
ThriftCluster is created and cached.
Example usage for a default installation of Cassandra.
String cl... | [
"Method",
"tries",
"to",
"create",
"a",
"Cluster",
"instance",
"for",
"an",
"existing",
"Cassandra",
"cluster",
".",
"If",
"another",
"class",
"already",
"called",
"getOrCreateCluster",
"the",
"factory",
"returns",
"the",
"cached",
"instance",
".",
"If",
"the",
... | train | https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java#L166-L169 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.translationRotateScaleMul | public Matrix4x3f translationRotateScaleMul(Vector3fc translation, Quaternionfc quat, Vector3fc scale, Matrix4x3f m) {
"""
Set <code>this</code> matrix to <code>T * R * S * M</code>, where <code>T</code> is the given <code>translation</code>,
<code>R</code> is a rotation transformation specified by the given quat... | java | public Matrix4x3f translationRotateScaleMul(Vector3fc translation, Quaternionfc quat, Vector3fc scale, Matrix4x3f m) {
return translationRotateScaleMul(translation.x(), translation.y(), translation.z(), quat.x(), quat.y(), quat.z(), quat.w(), scale.x(), scale.y(), scale.z(), m);
} | [
"public",
"Matrix4x3f",
"translationRotateScaleMul",
"(",
"Vector3fc",
"translation",
",",
"Quaternionfc",
"quat",
",",
"Vector3fc",
"scale",
",",
"Matrix4x3f",
"m",
")",
"{",
"return",
"translationRotateScaleMul",
"(",
"translation",
".",
"x",
"(",
")",
",",
"tra... | Set <code>this</code> matrix to <code>T * R * S * M</code>, where <code>T</code> is the given <code>translation</code>,
<code>R</code> is a rotation transformation specified by the given quaternion, <code>S</code> is a scaling transformation
which scales the axes by <code>scale</code>.
<p>
When transforming a vector by... | [
"Set",
"<code",
">",
"this<",
"/",
"code",
">",
"matrix",
"to",
"<code",
">",
"T",
"*",
"R",
"*",
"S",
"*",
"M<",
"/",
"code",
">",
"where",
"<code",
">",
"T<",
"/",
"code",
">",
"is",
"the",
"given",
"<code",
">",
"translation<",
"/",
"code",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L2871-L2873 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagBundle.java | CmsJspTagBundle.getLocale | static Locale getLocale(PageContext pageContext, String name) {
"""
Returns the locale specified by the named scoped attribute or context
configuration parameter.
<p> The named scoped attribute is searched in the page, request,
session (if valid), and application scope(s) (in this order). If no such
attribut... | java | static Locale getLocale(PageContext pageContext, String name) {
Locale loc = null;
Object obj = javax.servlet.jsp.jstl.core.Config.find(pageContext, name);
if (obj != null) {
if (obj instanceof Locale) {
loc = (Locale)obj;
} else {
... | [
"static",
"Locale",
"getLocale",
"(",
"PageContext",
"pageContext",
",",
"String",
"name",
")",
"{",
"Locale",
"loc",
"=",
"null",
";",
"Object",
"obj",
"=",
"javax",
".",
"servlet",
".",
"jsp",
".",
"jstl",
".",
"core",
".",
"Config",
".",
"find",
"("... | Returns the locale specified by the named scoped attribute or context
configuration parameter.
<p> The named scoped attribute is searched in the page, request,
session (if valid), and application scope(s) (in this order). If no such
attribute exists in any of the scopes, the locale is taken from the
named context conf... | [
"Returns",
"the",
"locale",
"specified",
"by",
"the",
"named",
"scoped",
"attribute",
"or",
"context",
"configuration",
"parameter",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagBundle.java#L135-L149 |
aws/aws-sdk-java | aws-java-sdk-logs/src/main/java/com/amazonaws/services/logs/model/ListTagsLogGroupResult.java | ListTagsLogGroupResult.withTags | public ListTagsLogGroupResult withTags(java.util.Map<String, String> tags) {
"""
<p>
The tags for the log group.
</p>
@param tags
The tags for the log group.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public ListTagsLogGroupResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"ListTagsLogGroupResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags for the log group.
</p>
@param tags
The tags for the log group.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"tags",
"for",
"the",
"log",
"group",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-logs/src/main/java/com/amazonaws/services/logs/model/ListTagsLogGroupResult.java#L71-L74 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java | SARLJvmModelInferrer.appendEventGuardEvaluators | protected void appendEventGuardEvaluators(JvmGenericType container) {
"""
Append the guard evaluators.
@param container the container type.
"""
final GenerationContext context = getContext(container);
if (context != null) {
final Collection<Pair<SarlBehaviorUnit, Collection<Procedure1<? super ITreeAp... | java | protected void appendEventGuardEvaluators(JvmGenericType container) {
final GenerationContext context = getContext(container);
if (context != null) {
final Collection<Pair<SarlBehaviorUnit, Collection<Procedure1<? super ITreeAppendable>>>> allEvaluators
= context.getGuardEvaluationCodes();
if (allEvaluat... | [
"protected",
"void",
"appendEventGuardEvaluators",
"(",
"JvmGenericType",
"container",
")",
"{",
"final",
"GenerationContext",
"context",
"=",
"getContext",
"(",
"container",
")",
";",
"if",
"(",
"context",
"!=",
"null",
")",
"{",
"final",
"Collection",
"<",
"Pa... | Append the guard evaluators.
@param container the container type. | [
"Append",
"the",
"guard",
"evaluators",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java#L2505-L2572 |
sagiegurari/fax4j | src/main/java/org/fax4j/bridge/FaxBridgeImpl.java | FaxBridgeImpl.updateFaxJobWithFileInfo | @Override
protected void updateFaxJobWithFileInfo(FaxJob faxJob,FileInfo fileInfo) {
"""
This function stores the file in the local machine and updates
the fax job with the new file data.
@param faxJob
The fax job object to be updated
@param fileInfo
The file information of the requested fax
"""... | java | @Override
protected void updateFaxJobWithFileInfo(FaxJob faxJob,FileInfo fileInfo)
{
//get file
File file=fileInfo.getFile();
if(file==null)
{
//get file name
String fileName=fileInfo.getName();
//get file content
byte... | [
"@",
"Override",
"protected",
"void",
"updateFaxJobWithFileInfo",
"(",
"FaxJob",
"faxJob",
",",
"FileInfo",
"fileInfo",
")",
"{",
"//get file",
"File",
"file",
"=",
"fileInfo",
".",
"getFile",
"(",
")",
";",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"//ge... | This function stores the file in the local machine and updates
the fax job with the new file data.
@param faxJob
The fax job object to be updated
@param fileInfo
The file information of the requested fax | [
"This",
"function",
"stores",
"the",
"file",
"in",
"the",
"local",
"machine",
"and",
"updates",
"the",
"fax",
"job",
"with",
"the",
"new",
"file",
"data",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/bridge/FaxBridgeImpl.java#L85-L115 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java | IterUtil.toMap | public static <K, V> Map<K, V> toMap(Iterator<K> keys, Iterator<V> values) {
"""
将键列表和值列表转换为Map<br>
以键为准,值与键位置需对应。如果键元素数多于值元素,多余部分值用null代替。<br>
如果值多于键,忽略多余的值。
@param <K> 键类型
@param <V> 值类型
@param keys 键列表
@param values 值列表
@return 标题内容Map
@since 3.1.0
"""
return toMap(keys, values, false);
} | java | public static <K, V> Map<K, V> toMap(Iterator<K> keys, Iterator<V> values) {
return toMap(keys, values, false);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"toMap",
"(",
"Iterator",
"<",
"K",
">",
"keys",
",",
"Iterator",
"<",
"V",
">",
"values",
")",
"{",
"return",
"toMap",
"(",
"keys",
",",
"values",
",",
"false",
")",
... | 将键列表和值列表转换为Map<br>
以键为准,值与键位置需对应。如果键元素数多于值元素,多余部分值用null代替。<br>
如果值多于键,忽略多余的值。
@param <K> 键类型
@param <V> 值类型
@param keys 键列表
@param values 值列表
@return 标题内容Map
@since 3.1.0 | [
"将键列表和值列表转换为Map<br",
">",
"以键为准,值与键位置需对应。如果键元素数多于值元素,多余部分值用null代替。<br",
">",
"如果值多于键,忽略多余的值。"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java#L404-L406 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/text/TokenStream.java | TokenStream.consumeLong | public long consumeLong() throws ParsingException, IllegalStateException {
"""
Convert the value of this token to a long, return it, and move to the next token.
@return the current token's value, converted to an integer
@throws ParsingException if there is no such token to consume, or if the token cannot be co... | java | public long consumeLong() throws ParsingException, IllegalStateException {
if (completed) throwNoMoreContent();
// Get the value from the current token ...
String value = currentToken().value();
try {
long result = Long.parseLong(value);
moveToNextToken();
... | [
"public",
"long",
"consumeLong",
"(",
")",
"throws",
"ParsingException",
",",
"IllegalStateException",
"{",
"if",
"(",
"completed",
")",
"throwNoMoreContent",
"(",
")",
";",
"// Get the value from the current token ...",
"String",
"value",
"=",
"currentToken",
"(",
")... | Convert the value of this token to a long, return it, and move to the next token.
@return the current token's value, converted to an integer
@throws ParsingException if there is no such token to consume, or if the token cannot be converted to a long
@throws IllegalStateException if this method was called before the st... | [
"Convert",
"the",
"value",
"of",
"this",
"token",
"to",
"a",
"long",
"return",
"it",
"and",
"move",
"to",
"the",
"next",
"token",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/text/TokenStream.java#L502-L515 |
streamsets/datacollector-api | src/main/java/com/streamsets/pipeline/api/Field.java | Field.createListMap | public static Field createListMap(LinkedHashMap<String, Field> v) {
"""
Creates a <code>LIST_MAP</code> field. The keys of the ordered Map must be of <code>String</code> type and the
values must be of <code>Field</code> type, <code>NULL</code> values are not allowed as key or values.
<p/>
This method performs a... | java | public static Field createListMap(LinkedHashMap<String, Field> v) {
return new Field(Type.LIST_MAP, v);
} | [
"public",
"static",
"Field",
"createListMap",
"(",
"LinkedHashMap",
"<",
"String",
",",
"Field",
">",
"v",
")",
"{",
"return",
"new",
"Field",
"(",
"Type",
".",
"LIST_MAP",
",",
"v",
")",
";",
"}"
] | Creates a <code>LIST_MAP</code> field. The keys of the ordered Map must be of <code>String</code> type and the
values must be of <code>Field</code> type, <code>NULL</code> values are not allowed as key or values.
<p/>
This method performs a deep copy of the ordered Map.
@param v value.
@return a <code>List-Map Field<... | [
"Creates",
"a",
"<code",
">",
"LIST_MAP<",
"/",
"code",
">",
"field",
".",
"The",
"keys",
"of",
"the",
"ordered",
"Map",
"must",
"be",
"of",
"<code",
">",
"String<",
"/",
"code",
">",
"type",
"and",
"the",
"values",
"must",
"be",
"of",
"<code",
">",
... | train | https://github.com/streamsets/datacollector-api/blob/ac832a97bea2fcef11f50fac6746e85019adad58/src/main/java/com/streamsets/pipeline/api/Field.java#L391-L393 |
attribyte/wpdb | src/main/java/org/attribyte/wp/model/ShortcodeParser.java | ShortcodeParser.scanForName | private static String scanForName(int pos, final char[] chars) {
"""
Scans for a valid shortcode name.
@param pos The starting position.
@param chars The character array to scan.
@return The shortcode name or an empty string if none found or invalid character is encountered.
"""
StringBuilder buf = ne... | java | private static String scanForName(int pos, final char[] chars) {
StringBuilder buf = new StringBuilder();
while(pos < chars.length) {
char ch = chars[pos++];
switch(ch) {
case ' ':
case ']':
return buf.toString();
case '[':
cas... | [
"private",
"static",
"String",
"scanForName",
"(",
"int",
"pos",
",",
"final",
"char",
"[",
"]",
"chars",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"while",
"(",
"pos",
"<",
"chars",
".",
"length",
")",
"{",
"char",
... | Scans for a valid shortcode name.
@param pos The starting position.
@param chars The character array to scan.
@return The shortcode name or an empty string if none found or invalid character is encountered. | [
"Scans",
"for",
"a",
"valid",
"shortcode",
"name",
"."
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/model/ShortcodeParser.java#L318-L341 |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/time/runtime/RuntimeClock.java | RuntimeClock.subscribe | @SuppressWarnings("checkstyle:hiddenfield")
private <T extends Time> void subscribe(final Class<T> eventClass, final Set<EventHandler<T>> handlers) {
"""
Register event handlers for the given event class.
@param eventClass Event type to handle. Must be derived from Time.
@param handlers One or many event handl... | java | @SuppressWarnings("checkstyle:hiddenfield")
private <T extends Time> void subscribe(final Class<T> eventClass, final Set<EventHandler<T>> handlers) {
for (final EventHandler<T> handler : handlers) {
LOG.log(Level.FINEST, "Subscribe: event {0} handler {1}", new Object[] {eventClass.getName(), handler});
... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:hiddenfield\"",
")",
"private",
"<",
"T",
"extends",
"Time",
">",
"void",
"subscribe",
"(",
"final",
"Class",
"<",
"T",
">",
"eventClass",
",",
"final",
"Set",
"<",
"EventHandler",
"<",
"T",
">",
">",
"handlers",
... | Register event handlers for the given event class.
@param eventClass Event type to handle. Must be derived from Time.
@param handlers One or many event handlers that can process given event type.
@param <T> Event type - must be derived from class Time. (i.e. contain a timestamp). | [
"Register",
"event",
"handlers",
"for",
"the",
"given",
"event",
"class",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/time/runtime/RuntimeClock.java#L264-L270 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.asDirectoryURI | public URI asDirectoryURI() throws URISyntaxException {
"""
Get file's URI as a directory. There will always be a trailing {@code "/"} character.
@return the uri
@throws URISyntaxException if the URI is somehow malformed
"""
final String pathName = getPathName(false);
return new URI(VFSUti... | java | public URI asDirectoryURI() throws URISyntaxException {
final String pathName = getPathName(false);
return new URI(VFSUtils.VFS_PROTOCOL, "", parent == null ? pathName : pathName + "/", null);
} | [
"public",
"URI",
"asDirectoryURI",
"(",
")",
"throws",
"URISyntaxException",
"{",
"final",
"String",
"pathName",
"=",
"getPathName",
"(",
"false",
")",
";",
"return",
"new",
"URI",
"(",
"VFSUtils",
".",
"VFS_PROTOCOL",
",",
"\"\"",
",",
"parent",
"==",
"null... | Get file's URI as a directory. There will always be a trailing {@code "/"} character.
@return the uri
@throws URISyntaxException if the URI is somehow malformed | [
"Get",
"file",
"s",
"URI",
"as",
"a",
"directory",
".",
"There",
"will",
"always",
"be",
"a",
"trailing",
"{",
"@code",
"/",
"}",
"character",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L558-L561 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ExecutePLSQLBuilder.java | ExecutePLSQLBuilder.sqlResource | public ExecutePLSQLBuilder sqlResource(Resource sqlResource, Charset charset) {
"""
Setter for external file resource containing the SQL statements to execute.
@param sqlResource
@param charset
"""
try {
action.setScript(FileUtils.readToString(sqlResource, charset));
} catch (IOEx... | java | public ExecutePLSQLBuilder sqlResource(Resource sqlResource, Charset charset) {
try {
action.setScript(FileUtils.readToString(sqlResource, charset));
} catch (IOException e) {
throw new CitrusRuntimeException("Failed to read sql resource", e);
}
return this;
} | [
"public",
"ExecutePLSQLBuilder",
"sqlResource",
"(",
"Resource",
"sqlResource",
",",
"Charset",
"charset",
")",
"{",
"try",
"{",
"action",
".",
"setScript",
"(",
"FileUtils",
".",
"readToString",
"(",
"sqlResource",
",",
"charset",
")",
")",
";",
"}",
"catch",... | Setter for external file resource containing the SQL statements to execute.
@param sqlResource
@param charset | [
"Setter",
"for",
"external",
"file",
"resource",
"containing",
"the",
"SQL",
"statements",
"to",
"execute",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ExecutePLSQLBuilder.java#L156-L163 |
OpenTSDB/opentsdb | src/tsd/HttpQuery.java | HttpQuery.escapeJson | static void escapeJson(final String s, final StringBuilder buf) {
"""
Escapes a string appropriately to be a valid in JSON.
Valid JSON strings are defined in RFC 4627, Section 2.5.
@param s The string to escape, which is assumed to be in .
@param buf The buffer into which to write the escaped string.
"""
... | java | static void escapeJson(final String s, final StringBuilder buf) {
final int length = s.length();
int extra = 0;
// First count how many extra chars we'll need, if any.
for (int i = 0; i < length; i++) {
final char c = s.charAt(i);
switch (c) {
case '"':
case '\\':
cas... | [
"static",
"void",
"escapeJson",
"(",
"final",
"String",
"s",
",",
"final",
"StringBuilder",
"buf",
")",
"{",
"final",
"int",
"length",
"=",
"s",
".",
"length",
"(",
")",
";",
"int",
"extra",
"=",
"0",
";",
"// First count how many extra chars we'll need, if an... | Escapes a string appropriately to be a valid in JSON.
Valid JSON strings are defined in RFC 4627, Section 2.5.
@param s The string to escape, which is assumed to be in .
@param buf The buffer into which to write the escaped string. | [
"Escapes",
"a",
"string",
"appropriately",
"to",
"be",
"a",
"valid",
"in",
"JSON",
".",
"Valid",
"JSON",
"strings",
"are",
"defined",
"in",
"RFC",
"4627",
"Section",
"2",
".",
"5",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpQuery.java#L478-L523 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Streams.java | Streams.optionalToStream | public final static <T> Stream<T> optionalToStream(final Optional<T> optional) {
"""
Convert an Optional to a Stream
<pre>
{@code
Stream<Integer> stream = Streams.optionalToStream(Optional.of(1));
//Stream[1]
Stream<Integer> zero = Streams.optionalToStream(Optional.zero());
//Stream[]
}
</pre>
@para... | java | public final static <T> Stream<T> optionalToStream(final Optional<T> optional) {
if (optional.isPresent())
return Stream.of(optional.get());
return Stream.of();
} | [
"public",
"final",
"static",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"optionalToStream",
"(",
"final",
"Optional",
"<",
"T",
">",
"optional",
")",
"{",
"if",
"(",
"optional",
".",
"isPresent",
"(",
")",
")",
"return",
"Stream",
".",
"of",
"(",
"optio... | Convert an Optional to a Stream
<pre>
{@code
Stream<Integer> stream = Streams.optionalToStream(Optional.of(1));
//Stream[1]
Stream<Integer> zero = Streams.optionalToStream(Optional.zero());
//Stream[]
}
</pre>
@param optional Optional to convert to a Stream
@return Stream with a single value (if present) created fro... | [
"Convert",
"an",
"Optional",
"to",
"a",
"Stream"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Streams.java#L497-L501 |
jenkinsci/jenkins | core/src/main/java/hudson/util/NoClientBindSSLProtocolSocketFactory.java | NoClientBindSSLProtocolSocketFactory.createSocket | public Socket createSocket(
final String host,
final int port,
final InetAddress localAddress,
final int localPort,
final HttpConnectionParams params
) throws IOException, UnknownHostException, ConnectTimeoutException {
"""
Attempts to get a new socket connection to the ... | java | public Socket createSocket(
final String host,
final int port,
final InetAddress localAddress,
final int localPort,
final HttpConnectionParams params
) throws IOException, UnknownHostException, ConnectTimeoutException {
if (params == null) {
throw new Ille... | [
"public",
"Socket",
"createSocket",
"(",
"final",
"String",
"host",
",",
"final",
"int",
"port",
",",
"final",
"InetAddress",
"localAddress",
",",
"final",
"int",
"localPort",
",",
"final",
"HttpConnectionParams",
"params",
")",
"throws",
"IOException",
",",
"Un... | Attempts to get a new socket connection to the given host within the given time limit.
<p>
This method employs several techniques to circumvent the limitations of older JREs that
do not support connect timeout. When running in JRE 1.4 or above reflection is used to
call Socket#connect(SocketAddress endpoint, int timeou... | [
"Attempts",
"to",
"get",
"a",
"new",
"socket",
"connection",
"to",
"the",
"given",
"host",
"within",
"the",
"given",
"time",
"limit",
".",
"<p",
">",
"This",
"method",
"employs",
"several",
"techniques",
"to",
"circumvent",
"the",
"limitations",
"of",
"older... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/NoClientBindSSLProtocolSocketFactory.java#L105-L128 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Domain.java | Domain.update | public static Domain update(final String id) throws AppPlatformException, ParseException, IOException, Exception {
"""
Convenience method to get information about a specific Domain.
@param id the domain id.
@return information about a specific Domain.
@throws AppPlatformException API Exception
@throws ParseExc... | java | public static Domain update(final String id) throws AppPlatformException, ParseException, IOException, Exception {
return update(id, null);
} | [
"public",
"static",
"Domain",
"update",
"(",
"final",
"String",
"id",
")",
"throws",
"AppPlatformException",
",",
"ParseException",
",",
"IOException",
",",
"Exception",
"{",
"return",
"update",
"(",
"id",
",",
"null",
")",
";",
"}"
] | Convenience method to get information about a specific Domain.
@param id the domain id.
@return information about a specific Domain.
@throws AppPlatformException API Exception
@throws ParseException Error parsing data
@throws IOException unexpected error
@throws Exception error | [
"Convenience",
"method",
"to",
"get",
"information",
"about",
"a",
"specific",
"Domain",
"."
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Domain.java#L167-L169 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/RowColumnOps.java | RowColumnOps.addMultCol | public static void addMultCol(Matrix A, int j, int start, int to, double t, double[] c) {
"""
Updates the values of column <tt>j</tt> in the given matrix to be A[:,j] = A[:,j]+c[:]*<tt>t</tt>.<br>
The Matrix <tt>A</tt> and array <tt>c</tt> do not need to have the same dimensions, so long as they both have indices... | java | public static void addMultCol(Matrix A, int j, int start, int to, double t, double[] c)
{
for(int i = start; i < to; i++)
A.increment(i, j, c[i]*t);
} | [
"public",
"static",
"void",
"addMultCol",
"(",
"Matrix",
"A",
",",
"int",
"j",
",",
"int",
"start",
",",
"int",
"to",
",",
"double",
"t",
",",
"double",
"[",
"]",
"c",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"to",
";",
... | Updates the values of column <tt>j</tt> in the given matrix to be A[:,j] = A[:,j]+c[:]*<tt>t</tt>.<br>
The Matrix <tt>A</tt> and array <tt>c</tt> do not need to have the same dimensions, so long as they both have indices in the given range.
@param A the matrix to perform he update on
@param j the row to update
@param ... | [
"Updates",
"the",
"values",
"of",
"column",
"<tt",
">",
"j<",
"/",
"tt",
">",
"in",
"the",
"given",
"matrix",
"to",
"be",
"A",
"[",
":",
"j",
"]",
"=",
"A",
"[",
":",
"j",
"]",
"+",
"c",
"[",
":",
"]",
"*",
"<tt",
">",
"t<",
"/",
"tt",
">... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/RowColumnOps.java#L327-L331 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDAttribute.java | DTDAttribute.validate | public String validate(DTDValidatorBase v, String value, boolean normalize)
throws XMLStreamException {
"""
<p>
Note: the default implementation is not optimized, as it does
a potentially unnecessary copy of the contents. It is expected that
this method is seldom called (Woodstox never directly calls it... | java | public String validate(DTDValidatorBase v, String value, boolean normalize)
throws XMLStreamException
{
int len = value.length();
/* Temporary buffer has to come from the validator itself, since
* attribute objects are stateless and shared...
*/
char[] cbuf = v.getT... | [
"public",
"String",
"validate",
"(",
"DTDValidatorBase",
"v",
",",
"String",
"value",
",",
"boolean",
"normalize",
")",
"throws",
"XMLStreamException",
"{",
"int",
"len",
"=",
"value",
".",
"length",
"(",
")",
";",
"/* Temporary buffer has to come from the validator... | <p>
Note: the default implementation is not optimized, as it does
a potentially unnecessary copy of the contents. It is expected that
this method is seldom called (Woodstox never directly calls it; it
only gets called for chained validators when one validator normalizes
the value, and then following validators are pass... | [
"<p",
">",
"Note",
":",
"the",
"default",
"implementation",
"is",
"not",
"optimized",
"as",
"it",
"does",
"a",
"potentially",
"unnecessary",
"copy",
"of",
"the",
"contents",
".",
"It",
"is",
"expected",
"that",
"this",
"method",
"is",
"seldom",
"called",
"... | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDAttribute.java#L226-L238 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/UsersInner.java | UsersInner.listByDataBoxEdgeDeviceAsync | public Observable<Page<UserInner>> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) {
"""
Gets all the users registered on a data box edge/gateway device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException ... | java | public Observable<Page<UserInner>> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) {
return listByDataBoxEdgeDeviceWithServiceResponseAsync(deviceName, resourceGroupName)
.map(new Func1<ServiceResponse<Page<UserInner>>, Page<UserInner>>() {
@Over... | [
"public",
"Observable",
"<",
"Page",
"<",
"UserInner",
">",
">",
"listByDataBoxEdgeDeviceAsync",
"(",
"final",
"String",
"deviceName",
",",
"final",
"String",
"resourceGroupName",
")",
"{",
"return",
"listByDataBoxEdgeDeviceWithServiceResponseAsync",
"(",
"deviceName",
... | Gets all the users registered on a data box edge/gateway device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<UserInner> object | [
"Gets",
"all",
"the",
"users",
"registered",
"on",
"a",
"data",
"box",
"edge",
"/",
"gateway",
"device",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/UsersInner.java#L143-L151 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java | MapMessage.asString | public String asString(final String format) {
"""
Formats the Structured data as described in <a href="https://tools.ietf.org/html/rfc5424">RFC 5424</a>.
@param format The format identifier.
@return The formatted String.
"""
try {
return format(EnglishEnums.valueOf(MapFormat.class, form... | java | public String asString(final String format) {
try {
return format(EnglishEnums.valueOf(MapFormat.class, format), new StringBuilder()).toString();
} catch (final IllegalArgumentException ex) {
return asString();
}
} | [
"public",
"String",
"asString",
"(",
"final",
"String",
"format",
")",
"{",
"try",
"{",
"return",
"format",
"(",
"EnglishEnums",
".",
"valueOf",
"(",
"MapFormat",
".",
"class",
",",
"format",
")",
",",
"new",
"StringBuilder",
"(",
")",
")",
".",
"toStrin... | Formats the Structured data as described in <a href="https://tools.ietf.org/html/rfc5424">RFC 5424</a>.
@param format The format identifier.
@return The formatted String. | [
"Formats",
"the",
"Structured",
"data",
"as",
"described",
"in",
"<a",
"href",
"=",
"https",
":",
"//",
"tools",
".",
"ietf",
".",
"org",
"/",
"html",
"/",
"rfc5424",
">",
"RFC",
"5424<",
"/",
"a",
">",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L243-L249 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.