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 |
|---|---|---|---|---|---|---|---|---|---|---|
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBaseGridScreen.java | XBaseGridScreen.printControlEndForm | public void printControlEndForm(PrintWriter out, int iPrintOptions) {
"""
Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes.
"""
BasePanel scrDetail = ((BaseGridScreen)this.getScreenField()).getReportDetail();
this.printHeadi... | java | public void printControlEndForm(PrintWriter out, int iPrintOptions)
{
BasePanel scrDetail = ((BaseGridScreen)this.getScreenField()).getReportDetail();
this.printHeadingFootingControls(out, iPrintOptions | HtmlConstants.FOOTING_SCREEN);
if (scrDetail != null)
{
scrDetail.... | [
"public",
"void",
"printControlEndForm",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"BasePanel",
"scrDetail",
"=",
"(",
"(",
"BaseGridScreen",
")",
"this",
".",
"getScreenField",
"(",
")",
")",
".",
"getReportDetail",
"(",
")",
";",
"t... | Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes. | [
"Display",
"the",
"start",
"form",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBaseGridScreen.java#L117-L139 |
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeClient.java | RespokeClient.getConnection | public RespokeConnection getConnection(String connectionID, String endpointID, boolean skipCreate) {
"""
Find a Connection by id and return it. In most cases, if we don't find it we will create it. This is useful
in the case of dynamic endpoints where groups are not in use. Set skipCreate=true to return null
if ... | java | public RespokeConnection getConnection(String connectionID, String endpointID, boolean skipCreate) {
RespokeConnection connection = null;
if (null != connectionID) {
RespokeEndpoint endpoint = getEndpoint(endpointID, skipCreate);
if (null != endpoint) {
for (Res... | [
"public",
"RespokeConnection",
"getConnection",
"(",
"String",
"connectionID",
",",
"String",
"endpointID",
",",
"boolean",
"skipCreate",
")",
"{",
"RespokeConnection",
"connection",
"=",
"null",
";",
"if",
"(",
"null",
"!=",
"connectionID",
")",
"{",
"RespokeEndp... | Find a Connection by id and return it. In most cases, if we don't find it we will create it. This is useful
in the case of dynamic endpoints where groups are not in use. Set skipCreate=true to return null
if the Connection is not already known.
@param connectionID The ID of the connection to return
@param endpointID ... | [
"Find",
"a",
"Connection",
"by",
"id",
"and",
"return",
"it",
".",
"In",
"most",
"cases",
"if",
"we",
"don",
"t",
"find",
"it",
"we",
"will",
"create",
"it",
".",
"This",
"is",
"useful",
"in",
"the",
"case",
"of",
"dynamic",
"endpoints",
"where",
"gr... | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeClient.java#L456-L478 |
Quickhull3d/quickhull3d | src/main/java/com/github/quickhull3d/VertexList.java | VertexList.insertBefore | public void insertBefore(Vertex vtx, Vertex next) {
"""
Inserts a vertex into this list before another specificed vertex.
"""
vtx.prev = next.prev;
if (next.prev == null) {
head = vtx;
} else {
next.prev.next = vtx;
}
vtx.next = next;
next... | java | public void insertBefore(Vertex vtx, Vertex next) {
vtx.prev = next.prev;
if (next.prev == null) {
head = vtx;
} else {
next.prev.next = vtx;
}
vtx.next = next;
next.prev = vtx;
} | [
"public",
"void",
"insertBefore",
"(",
"Vertex",
"vtx",
",",
"Vertex",
"next",
")",
"{",
"vtx",
".",
"prev",
"=",
"next",
".",
"prev",
";",
"if",
"(",
"next",
".",
"prev",
"==",
"null",
")",
"{",
"head",
"=",
"vtx",
";",
"}",
"else",
"{",
"next",... | Inserts a vertex into this list before another specificed vertex. | [
"Inserts",
"a",
"vertex",
"into",
"this",
"list",
"before",
"another",
"specificed",
"vertex",
"."
] | train | https://github.com/Quickhull3d/quickhull3d/blob/3f80953b86c46385e84730e5d2a1745cbfa12703/src/main/java/com/github/quickhull3d/VertexList.java#L113-L122 |
podio/podio-java | src/main/java/com/podio/org/OrgAPI.java | OrgAPI.getMemberByMail | public OrganizationMember getMemberByMail(int orgId, String mail) {
"""
Returns the member data for the given user in the given organization.
@param orgId
The id of the organization
@param mail
The mail of the users account
@return The details of the users membership of the organization
"""
return ge... | java | public OrganizationMember getMemberByMail(int orgId, String mail) {
return getResourceFactory().getApiResource(
"/org/" + orgId + "/member/mail/" + mail).get(
OrganizationMember.class);
} | [
"public",
"OrganizationMember",
"getMemberByMail",
"(",
"int",
"orgId",
",",
"String",
"mail",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/org/\"",
"+",
"orgId",
"+",
"\"/member/mail/\"",
"+",
"mail",
")",
".",
"get",
"(... | Returns the member data for the given user in the given organization.
@param orgId
The id of the organization
@param mail
The mail of the users account
@return The details of the users membership of the organization | [
"Returns",
"the",
"member",
"data",
"for",
"the",
"given",
"user",
"in",
"the",
"given",
"organization",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/org/OrgAPI.java#L209-L213 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoScheme.java | ContentCryptoScheme.newCipherLite | protected CipherLite newCipherLite(Cipher cipher, SecretKey cek, int cipherMode) {
"""
This is a factory method intended to be overridden by sublcasses to
return the appropriate instance of cipher lite.
"""
return new CipherLite(cipher, this, cek, cipherMode);
} | java | protected CipherLite newCipherLite(Cipher cipher, SecretKey cek, int cipherMode) {
return new CipherLite(cipher, this, cek, cipherMode);
} | [
"protected",
"CipherLite",
"newCipherLite",
"(",
"Cipher",
"cipher",
",",
"SecretKey",
"cek",
",",
"int",
"cipherMode",
")",
"{",
"return",
"new",
"CipherLite",
"(",
"cipher",
",",
"this",
",",
"cek",
",",
"cipherMode",
")",
";",
"}"
] | This is a factory method intended to be overridden by sublcasses to
return the appropriate instance of cipher lite. | [
"This",
"is",
"a",
"factory",
"method",
"intended",
"to",
"be",
"overridden",
"by",
"sublcasses",
"to",
"return",
"the",
"appropriate",
"instance",
"of",
"cipher",
"lite",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoScheme.java#L233-L235 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java | ExcelUtil.readBySax | public static void readBySax(String path, int sheetIndex, RowHandler rowHandler) {
"""
通过Sax方式读取Excel,同时支持03和07格式
@param path Excel文件路径
@param sheetIndex sheet序号
@param rowHandler 行处理器
@since 3.2.0
"""
BufferedInputStream in = null;
try {
in = FileUtil.getInputStream(path);
readBySax(in, sh... | java | public static void readBySax(String path, int sheetIndex, RowHandler rowHandler) {
BufferedInputStream in = null;
try {
in = FileUtil.getInputStream(path);
readBySax(in, sheetIndex, rowHandler);
} finally {
IoUtil.close(in);
}
} | [
"public",
"static",
"void",
"readBySax",
"(",
"String",
"path",
",",
"int",
"sheetIndex",
",",
"RowHandler",
"rowHandler",
")",
"{",
"BufferedInputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"FileUtil",
".",
"getInputStream",
"(",
"path",
")",
... | 通过Sax方式读取Excel,同时支持03和07格式
@param path Excel文件路径
@param sheetIndex sheet序号
@param rowHandler 行处理器
@since 3.2.0 | [
"通过Sax方式读取Excel,同时支持03和07格式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L35-L43 |
KyoriPowered/lunar | src/main/java/net/kyori/lunar/EvenMoreObjects.java | EvenMoreObjects.make | public static <B, C> @NonNull C make(final @NonNull B builder, final @NonNull Consumer<B> consumer, final @NonNull Function<B, C> creator) {
"""
Configures {@code builder} using {@code consumer} and then builds it using {@code creator}.
@param builder the builder
@param consumer the consumer
@param creator th... | java | public static <B, C> @NonNull C make(final @NonNull B builder, final @NonNull Consumer<B> consumer, final @NonNull Function<B, C> creator) {
return creator.apply(make(builder, consumer));
} | [
"public",
"static",
"<",
"B",
",",
"C",
">",
"@",
"NonNull",
"C",
"make",
"(",
"final",
"@",
"NonNull",
"B",
"builder",
",",
"final",
"@",
"NonNull",
"Consumer",
"<",
"B",
">",
"consumer",
",",
"final",
"@",
"NonNull",
"Function",
"<",
"B",
",",
"C... | Configures {@code builder} using {@code consumer} and then builds it using {@code creator}.
@param builder the builder
@param consumer the consumer
@param creator the creator
@param <B> the builder type
@param <C> the creator type
@return the value | [
"Configures",
"{",
"@code",
"builder",
"}",
"using",
"{",
"@code",
"consumer",
"}",
"and",
"then",
"builds",
"it",
"using",
"{",
"@code",
"creator",
"}",
"."
] | train | https://github.com/KyoriPowered/lunar/blob/6856747d9034a2fe0c8d0a8a0150986797732b5c/src/main/java/net/kyori/lunar/EvenMoreObjects.java#L75-L77 |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java | CSSColorHelper.getParsedRGBColorValue | @Nullable
public static CSSRGB getParsedRGBColorValue (@Nullable final String sValue) {
"""
Extract the CSS RGB color value from the passed String. Example value:
<code>rgb(255,0,0)</code>
@param sValue
The value to extract the value from. May be <code>null</code>.
@return <code>null</code> if the passed v... | java | @Nullable
public static CSSRGB getParsedRGBColorValue (@Nullable final String sValue)
{
final String sRealValue = StringHelper.trim (sValue);
if (StringHelper.hasText (sRealValue) && sRealValue.startsWith (CCSSValue.PREFIX_RGB))
{
final String [] aValues = RegExHelper.getAllMatchingGroupValues (PA... | [
"@",
"Nullable",
"public",
"static",
"CSSRGB",
"getParsedRGBColorValue",
"(",
"@",
"Nullable",
"final",
"String",
"sValue",
")",
"{",
"final",
"String",
"sRealValue",
"=",
"StringHelper",
".",
"trim",
"(",
"sValue",
")",
";",
"if",
"(",
"StringHelper",
".",
... | Extract the CSS RGB color value from the passed String. Example value:
<code>rgb(255,0,0)</code>
@param sValue
The value to extract the value from. May be <code>null</code>.
@return <code>null</code> if the passed value is not a valid CSS RGB color
value. | [
"Extract",
"the",
"CSS",
"RGB",
"color",
"value",
"from",
"the",
"passed",
"String",
".",
"Example",
"value",
":",
"<code",
">",
"rgb",
"(",
"255",
"0",
"0",
")",
"<",
"/",
"code",
">"
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java#L185-L196 |
buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/XOManagerImpl.java | XOManagerImpl.createByExample | private CompositeObject createByExample(Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> exampleEntity, Class<?> type, Class<?>... types) {
"""
Create a new {@link CompositeObject} instance using an example.
@param exampleEntity
The example instance.
@param type
The interface the property type ... | java | private CompositeObject createByExample(Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> exampleEntity, Class<?> type, Class<?>... types) {
DynamicType<EntityTypeMetadata<EntityMetadata>> effectiveTypes = sessionContext.getMetadataProvider().getEffectiveTypes(type, types);
Set<EntityDiscri... | [
"private",
"CompositeObject",
"createByExample",
"(",
"Map",
"<",
"PrimitivePropertyMethodMetadata",
"<",
"PropertyMetadata",
">",
",",
"Object",
">",
"exampleEntity",
",",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"?",
">",
"...",
"types",
")",
"{",
... | Create a new {@link CompositeObject} instance using an example.
@param exampleEntity
The example instance.
@param type
The interface the property type shall implement.
@param types
Additional interfaces the entity type shall implement.
@return The {@link CompositeObject} instance. | [
"Create",
"a",
"new",
"{",
"@link",
"CompositeObject",
"}",
"instance",
"using",
"an",
"example",
"."
] | train | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/XOManagerImpl.java#L247-L257 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java | SARLFormatter._format | protected void _format(SarlBehavior behavior, IFormattableDocument document) {
"""
Format the given SARL behavior.
@param behavior the SARL component.
@param document the document.
"""
formatAnnotations(behavior, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations);
formatModifiers(beha... | java | protected void _format(SarlBehavior behavior, IFormattableDocument document) {
formatAnnotations(behavior, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations);
formatModifiers(behavior, document);
final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(behavior);
document.... | [
"protected",
"void",
"_format",
"(",
"SarlBehavior",
"behavior",
",",
"IFormattableDocument",
"document",
")",
"{",
"formatAnnotations",
"(",
"behavior",
",",
"document",
",",
"XbaseFormatterPreferenceKeys",
".",
"newLineAfterClassAnnotations",
")",
";",
"formatModifiers"... | Format the given SARL behavior.
@param behavior the SARL component.
@param document the document. | [
"Format",
"the",
"given",
"SARL",
"behavior",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L250-L261 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/types/DatastreamReferencedContent.java | DatastreamReferencedContent.getContentStream | @Override
public InputStream getContentStream(Context context) throws StreamIOException {
"""
Gets an InputStream to the content of this externally-referenced
datastream.
<p>The DSLocation of this datastream must be non-null before invoking
this method.
<p>If successful, the DSMIME type is automaticall... | java | @Override
public InputStream getContentStream(Context context) throws StreamIOException {
try {
ContentManagerParams params = new ContentManagerParams(DSLocation);
if (context != null ) {
params.setContext(context);
}
MIMETypedStream stream = g... | [
"@",
"Override",
"public",
"InputStream",
"getContentStream",
"(",
"Context",
"context",
")",
"throws",
"StreamIOException",
"{",
"try",
"{",
"ContentManagerParams",
"params",
"=",
"new",
"ContentManagerParams",
"(",
"DSLocation",
")",
";",
"if",
"(",
"context",
"... | Gets an InputStream to the content of this externally-referenced
datastream.
<p>The DSLocation of this datastream must be non-null before invoking
this method.
<p>If successful, the DSMIME type is automatically set based on the web
server's response header. If the web server doesn't send a valid
Content-type: header,... | [
"Gets",
"an",
"InputStream",
"to",
"the",
"content",
"of",
"this",
"externally",
"-",
"referenced",
"datastream",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/types/DatastreamReferencedContent.java#L84-L98 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/aspera/transfer/AsperaTransferManager.java | AsperaTransferManager.uploadDirectory | public Future<AsperaTransaction> uploadDirectory(String bucketName, String virtualDirectoryKeyPrefix, File directory,
boolean includeSubdirectories) {
"""
Subdirectories are included in the upload by default, to exclude ensure you pass through 'false' for
includeSubdirectories param
@param bucketName
@para... | java | public Future<AsperaTransaction> uploadDirectory(String bucketName, String virtualDirectoryKeyPrefix, File directory,
boolean includeSubdirectories) {
return uploadDirectory(bucketName, virtualDirectoryKeyPrefix, directory, includeSubdirectories, asperaConfig, null);
} | [
"public",
"Future",
"<",
"AsperaTransaction",
">",
"uploadDirectory",
"(",
"String",
"bucketName",
",",
"String",
"virtualDirectoryKeyPrefix",
",",
"File",
"directory",
",",
"boolean",
"includeSubdirectories",
")",
"{",
"return",
"uploadDirectory",
"(",
"bucketName",
... | Subdirectories are included in the upload by default, to exclude ensure you pass through 'false' for
includeSubdirectories param
@param bucketName
@param virtualDirectoryKeyPrefix
@param directory
@param includeSubdirectories
@return | [
"Subdirectories",
"are",
"included",
"in",
"the",
"upload",
"by",
"default",
"to",
"exclude",
"ensure",
"you",
"pass",
"through",
"false",
"for",
"includeSubdirectories",
"param"
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/aspera/transfer/AsperaTransferManager.java#L237-L240 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ComparableExtensions.java | ComparableExtensions.operator_greaterThan | @Pure /* not guaranteed, since compareTo() is invoked */
@Inline("($1.compareTo($2) > 0)")
public static <C> boolean operator_greaterThan(Comparable<? super C> left, C right) {
"""
The comparison operator <code>greater than</code>.
@param left
a comparable
@param right
the value to compare with
@return <c... | java | @Pure /* not guaranteed, since compareTo() is invoked */
@Inline("($1.compareTo($2) > 0)")
public static <C> boolean operator_greaterThan(Comparable<? super C> left, C right) {
return left.compareTo(right) > 0;
} | [
"@",
"Pure",
"/* not guaranteed, since compareTo() is invoked */",
"@",
"Inline",
"(",
"\"($1.compareTo($2) > 0)\"",
")",
"public",
"static",
"<",
"C",
">",
"boolean",
"operator_greaterThan",
"(",
"Comparable",
"<",
"?",
"super",
"C",
">",
"left",
",",
"C",
"right",... | The comparison operator <code>greater than</code>.
@param left
a comparable
@param right
the value to compare with
@return <code>left.compareTo(right) > 0</code> | [
"The",
"comparison",
"operator",
"<code",
">",
"greater",
"than<",
"/",
"code",
">",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ComparableExtensions.java#L44-L48 |
karczews/RxBroadcastReceiver | library/src/main/java/com/github/karczews/rxbroadcastreceiver/RxBroadcastReceivers.java | RxBroadcastReceivers.fromIntentFilter | @NonNull
@CheckResult
public static Observable<Intent> fromIntentFilter(@NonNull final Context context,
@NonNull final IntentFilter filter) {
"""
Creates Observable that will register {@link android.content.BroadcastReceiver} for provided
{@link Intent... | java | @NonNull
@CheckResult
public static Observable<Intent> fromIntentFilter(@NonNull final Context context,
@NonNull final IntentFilter filter) {
return new RxBroadcastReceiver(context, filter);
} | [
"@",
"NonNull",
"@",
"CheckResult",
"public",
"static",
"Observable",
"<",
"Intent",
">",
"fromIntentFilter",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"NonNull",
"final",
"IntentFilter",
"filter",
")",
"{",
"return",
"new",
"RxBroadcastRecei... | Creates Observable that will register {@link android.content.BroadcastReceiver} for provided
{@link IntentFilter} when subscribed to. Observable will emit received broadcast as data {@link Intent}
@param context used to register broadcast receiver to.
@param filter {@link IntentFilter} used to select Intent broadcast... | [
"Creates",
"Observable",
"that",
"will",
"register",
"{",
"@link",
"android",
".",
"content",
".",
"BroadcastReceiver",
"}",
"for",
"provided",
"{",
"@link",
"IntentFilter",
"}",
"when",
"subscribed",
"to",
".",
"Observable",
"will",
"emit",
"received",
"broadca... | train | https://github.com/karczews/RxBroadcastReceiver/blob/08dfc33fca4e8772b25ae98a859c2cff69b4a203/library/src/main/java/com/github/karczews/rxbroadcastreceiver/RxBroadcastReceivers.java#L40-L45 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/titlepaneforegound/TitlePaneButtonForegroundPainter.java | TitlePaneButtonForegroundPainter.paintPressed | public void paintPressed(Graphics2D g, JComponent c, int width, int height) {
"""
Paint the pressed state of the button foreground.
@param g the Graphics2D context to paint with.
@param c the button to paint.
@param width the width to paint.
@param height the height to paint.
"""
paint... | java | public void paintPressed(Graphics2D g, JComponent c, int width, int height) {
paint(g, c, width, height, pressedBorder, pressedCorner, pressedInterior);
} | [
"public",
"void",
"paintPressed",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"paint",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
",",
"pressedBorder",
",",
"pressedCorner",
",",
"pressedInte... | Paint the pressed state of the button foreground.
@param g the Graphics2D context to paint with.
@param c the button to paint.
@param width the width to paint.
@param height the height to paint. | [
"Paint",
"the",
"pressed",
"state",
"of",
"the",
"button",
"foreground",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/titlepaneforegound/TitlePaneButtonForegroundPainter.java#L58-L60 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageLoaderCurrent.java | ImageLoaderCurrent.processINodesUC | private void processINodesUC(DataInputStream in, ImageVisitor v,
boolean skipBlocks) throws IOException {
"""
Process the INodes under construction section of the fsimage.
@param in DataInputStream to process
@param v Visitor to walk over inodes
@param skipBlocks Walk over each block?
"""
int nu... | java | private void processINodesUC(DataInputStream in, ImageVisitor v,
boolean skipBlocks) throws IOException {
int numINUC = in.readInt();
v.visitEnclosingElement(ImageElement.INODES_UNDER_CONSTRUCTION,
ImageElement.NUM_INODES_UNDER_CONSTRUCTION, numINUC);
for(int i = 0; i < nu... | [
"private",
"void",
"processINodesUC",
"(",
"DataInputStream",
"in",
",",
"ImageVisitor",
"v",
",",
"boolean",
"skipBlocks",
")",
"throws",
"IOException",
"{",
"int",
"numINUC",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"v",
".",
"visitEnclosingElement",
"(",
... | Process the INodes under construction section of the fsimage.
@param in DataInputStream to process
@param v Visitor to walk over inodes
@param skipBlocks Walk over each block? | [
"Process",
"the",
"INodes",
"under",
"construction",
"section",
"of",
"the",
"fsimage",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageLoaderCurrent.java#L202-L250 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.waitForProcessOutput | public static void waitForProcessOutput(Process self, Appendable output, Appendable error) {
"""
Gets the output and error streams from a process and reads them
to keep the process from blocking due to a full output buffer.
The processed stream data is appended to the supplied Appendable.
For this, two Threads ... | java | public static void waitForProcessOutput(Process self, Appendable output, Appendable error) {
Thread tout = consumeProcessOutputStream(self, output);
Thread terr = consumeProcessErrorStream(self, error);
try { tout.join(); } catch (InterruptedException ignore) {}
try { terr.join(); } catc... | [
"public",
"static",
"void",
"waitForProcessOutput",
"(",
"Process",
"self",
",",
"Appendable",
"output",
",",
"Appendable",
"error",
")",
"{",
"Thread",
"tout",
"=",
"consumeProcessOutputStream",
"(",
"self",
",",
"output",
")",
";",
"Thread",
"terr",
"=",
"co... | Gets the output and error streams from a process and reads them
to keep the process from blocking due to a full output buffer.
The processed stream data is appended to the supplied Appendable.
For this, two Threads are started, but join()ed, so we wait.
As implied by the waitFor... name, we also wait until we finish
as... | [
"Gets",
"the",
"output",
"and",
"error",
"streams",
"from",
"a",
"process",
"and",
"reads",
"them",
"to",
"keep",
"the",
"process",
"from",
"blocking",
"due",
"to",
"a",
"full",
"output",
"buffer",
".",
"The",
"processed",
"stream",
"data",
"is",
"appended... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L241-L248 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java | FeaturesImpl.addPhraseList | public int addPhraseList(UUID appId, String versionId, PhraselistCreateObject phraselistCreateObject) {
"""
Creates a new phraselist feature.
@param appId The application ID.
@param versionId The version ID.
@param phraselistCreateObject A Phraselist object containing Name, comma-separated Phrases and the isE... | java | public int addPhraseList(UUID appId, String versionId, PhraselistCreateObject phraselistCreateObject) {
return addPhraseListWithServiceResponseAsync(appId, versionId, phraselistCreateObject).toBlocking().single().body();
} | [
"public",
"int",
"addPhraseList",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"PhraselistCreateObject",
"phraselistCreateObject",
")",
"{",
"return",
"addPhraseListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"phraselistCreateObject",
")",
... | Creates a new phraselist feature.
@param appId The application ID.
@param versionId The version ID.
@param phraselistCreateObject A Phraselist object containing Name, comma-separated Phrases and the isExchangeable boolean. Default value for isExchangeable is true.
@throws IllegalArgumentException thrown if parameters ... | [
"Creates",
"a",
"new",
"phraselist",
"feature",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java#L108-L110 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/reflect/TypeReflector.java | TypeReflector.createInstanceByDescriptor | public static Object createInstanceByDescriptor(TypeDescriptor type, Object... args) throws Exception {
"""
Creates an instance of an object type specified by type descriptor.
@param type a type descriptor that points to an object type
@param args arguments for the object constructor.
@return the create... | java | public static Object createInstanceByDescriptor(TypeDescriptor type, Object... args) throws Exception {
if (type == null)
throw new NullPointerException("Type descriptor cannot be null");
return createInstance(type.getName(), type.getLibrary(), args);
} | [
"public",
"static",
"Object",
"createInstanceByDescriptor",
"(",
"TypeDescriptor",
"type",
",",
"Object",
"...",
"args",
")",
"throws",
"Exception",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"Type descriptor cannot be ... | Creates an instance of an object type specified by type descriptor.
@param type a type descriptor that points to an object type
@param args arguments for the object constructor.
@return the created object instance.
@throws Exception when type of instance not found
@see #createInstance(String, String, Object...)... | [
"Creates",
"an",
"instance",
"of",
"an",
"object",
"type",
"specified",
"by",
"type",
"descriptor",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/reflect/TypeReflector.java#L148-L153 |
Talend/tesb-rt-se | locator-service/locator-rest-service/src/main/java/org/talend/esb/locator/service/rest/LocatorRestServiceImpl.java | LocatorRestServiceImpl.unregisterEndpoint | public void unregisterEndpoint(String arg0, String arg1) {
"""
Unregister the endpoint for given service.
@param input
String encoded name of service
@param input
String encoded name of endpoint
"""
String endpointURL = null;
QName serviceName = null;
try {
serviceName... | java | public void unregisterEndpoint(String arg0, String arg1) {
String endpointURL = null;
QName serviceName = null;
try {
serviceName = QName.valueOf(URLDecoder.decode(arg0, "UTF-8"));
endpointURL = URLDecoder.decode(arg1, "UTF-8");
} catch (UnsupportedEncodingExcepti... | [
"public",
"void",
"unregisterEndpoint",
"(",
"String",
"arg0",
",",
"String",
"arg1",
")",
"{",
"String",
"endpointURL",
"=",
"null",
";",
"QName",
"serviceName",
"=",
"null",
";",
"try",
"{",
"serviceName",
"=",
"QName",
".",
"valueOf",
"(",
"URLDecoder",
... | Unregister the endpoint for given service.
@param input
String encoded name of service
@param input
String encoded name of endpoint | [
"Unregister",
"the",
"endpoint",
"for",
"given",
"service",
"."
] | train | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator-service/locator-rest-service/src/main/java/org/talend/esb/locator/service/rest/LocatorRestServiceImpl.java#L229-L256 |
eyp/serfj | src/main/java/net/sf/serfj/RestServlet.java | RestServlet.service | @Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
"""
Parses the request to get information about what controller is trying to call, then
invoke the action from that controller (if any), and finally gives an answer.<br>
<br>
Basica... | java | @Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Eliminamos de la URI el contexto
String url = request.getRequestURI().substring(request.getContextPath().length());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("url => {}", url)... | [
"@",
"Override",
"protected",
"void",
"service",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"// Eliminamos de la URI el contexto",
"String",
"url",
"=",
"request",
".",
"getRe... | Parses the request to get information about what controller is trying to call, then
invoke the action from that controller (if any), and finally gives an answer.<br>
<br>
Basically it only dispatchs the request to a controller. | [
"Parses",
"the",
"request",
"to",
"get",
"information",
"about",
"what",
"controller",
"is",
"trying",
"to",
"call",
"then",
"invoke",
"the",
"action",
"from",
"that",
"controller",
"(",
"if",
"any",
")",
"and",
"finally",
"gives",
"an",
"answer",
".",
"<b... | train | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/RestServlet.java#L88-L116 |
wildfly/wildfly-core | process-controller/src/main/java/org/jboss/as/process/ProcessUtils.java | ProcessUtils.resolveProcessId | private int resolveProcessId(final String processName, int id) throws IOException {
"""
Iterate through all java processes and try to find the one matching to the given process id.
This will return the resolved process-id or {@code -1} if not resolvable.
@param processName the process name
@param id the proce... | java | private int resolveProcessId(final String processName, int id) throws IOException {
final String jpsCommand = getJpsCommand();
if(jpsCommand == null) {
ProcessLogger.ROOT_LOGGER.jpsCommandNotFound(processName);
return -1;
}
final Process p = Runtime.getRuntime().e... | [
"private",
"int",
"resolveProcessId",
"(",
"final",
"String",
"processName",
",",
"int",
"id",
")",
"throws",
"IOException",
"{",
"final",
"String",
"jpsCommand",
"=",
"getJpsCommand",
"(",
")",
";",
"if",
"(",
"jpsCommand",
"==",
"null",
")",
"{",
"ProcessL... | Iterate through all java processes and try to find the one matching to the given process id.
This will return the resolved process-id or {@code -1} if not resolvable.
@param processName the process name
@param id the process integer id, or {@code -1} if this is not relevant
@return the process id
@throws IOException | [
"Iterate",
"through",
"all",
"java",
"processes",
"and",
"try",
"to",
"find",
"the",
"one",
"matching",
"to",
"the",
"given",
"process",
"id",
".",
"This",
"will",
"return",
"the",
"resolved",
"process",
"-",
"id",
"or",
"{",
"@code",
"-",
"1",
"}",
"i... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/process-controller/src/main/java/org/jboss/as/process/ProcessUtils.java#L89-L123 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/webapp/resources/OrganizationResource.java | OrganizationResource.getCorporateGroupIdPrefix | @GET
@Produces( {
"""
Return the list of corporate GroupId prefix configured for an organization.
@param organizationId String Organization name
@return Response A list of corporate groupId prefix in HTML or JSON
"""MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
@Path("/{name}" + ServerAPI.GET_C... | java | @GET
@Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
@Path("/{name}" + ServerAPI.GET_CORPORATE_GROUPIDS)
public Response getCorporateGroupIdPrefix(@PathParam("name") final String organizationId){
LOG.info("Got a get corporate groupId prefix request for organization " + organizationId +"... | [
"@",
"GET",
"@",
"Produces",
"(",
"{",
"MediaType",
".",
"TEXT_HTML",
",",
"MediaType",
".",
"APPLICATION_JSON",
"}",
")",
"@",
"Path",
"(",
"\"/{name}\"",
"+",
"ServerAPI",
".",
"GET_CORPORATE_GROUPIDS",
")",
"public",
"Response",
"getCorporateGroupIdPrefix",
"... | Return the list of corporate GroupId prefix configured for an organization.
@param organizationId String Organization name
@return Response A list of corporate groupId prefix in HTML or JSON | [
"Return",
"the",
"list",
"of",
"corporate",
"GroupId",
"prefix",
"configured",
"for",
"an",
"organization",
"."
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/resources/OrganizationResource.java#L128-L139 |
revapi/revapi | revapi/src/main/java/org/revapi/AnalysisContext.java | AnalysisContext.copyWithConfiguration | public AnalysisContext copyWithConfiguration(ModelNode configuration) {
"""
This is generally only useful for extensions that delegate some of their functionality to other "internal"
extensions of their own that they need to configure.
@param configuration the configuration to be supplied with the returned ana... | java | public AnalysisContext copyWithConfiguration(ModelNode configuration) {
return new AnalysisContext(this.locale, configuration, this.oldApi, this.newApi, this.data);
} | [
"public",
"AnalysisContext",
"copyWithConfiguration",
"(",
"ModelNode",
"configuration",
")",
"{",
"return",
"new",
"AnalysisContext",
"(",
"this",
".",
"locale",
",",
"configuration",
",",
"this",
".",
"oldApi",
",",
"this",
".",
"newApi",
",",
"this",
".",
"... | This is generally only useful for extensions that delegate some of their functionality to other "internal"
extensions of their own that they need to configure.
@param configuration the configuration to be supplied with the returned analysis context.
@return an analysis context that is a clone of this instance but its ... | [
"This",
"is",
"generally",
"only",
"useful",
"for",
"extensions",
"that",
"delegate",
"some",
"of",
"their",
"functionality",
"to",
"other",
"internal",
"extensions",
"of",
"their",
"own",
"that",
"they",
"need",
"to",
"configure",
"."
] | train | https://github.com/revapi/revapi/blob/e070b136d977441ab96fdce067a13e7e0423295b/revapi/src/main/java/org/revapi/AnalysisContext.java#L195-L197 |
gallandarakhneorg/afc | core/util/src/main/java/org/arakhne/afc/util/IntegerList.java | IntegerList.get | protected boolean get(int offset, int[] tofill) {
"""
Replies the segment index for the specified value.
<p>The given array must be pre-allocated with at least 2 cells.
The first cell will the the index of the segment. The
second cell will be the first integer value.
@param offset is the number of integer ... | java | protected boolean get(int offset, int[] tofill) {
if (this.values != null) {
int idxTab = 0;
for (int idxStart = 0; idxStart < this.values.length - 1; idxStart += 2) {
for (int n = this.values[idxStart]; n <= this.values[idxStart + 1]; ++n) {
if (offset == idxTab) {
tofill[0] = idxStart;
to... | [
"protected",
"boolean",
"get",
"(",
"int",
"offset",
",",
"int",
"[",
"]",
"tofill",
")",
"{",
"if",
"(",
"this",
".",
"values",
"!=",
"null",
")",
"{",
"int",
"idxTab",
"=",
"0",
";",
"for",
"(",
"int",
"idxStart",
"=",
"0",
";",
"idxStart",
"<"... | Replies the segment index for the specified value.
<p>The given array must be pre-allocated with at least 2 cells.
The first cell will the the index of the segment. The
second cell will be the first integer value.
@param offset is the number of integer values to skip from the
begining of the value set.
@param tofill ... | [
"Replies",
"the",
"segment",
"index",
"for",
"the",
"specified",
"value",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/util/src/main/java/org/arakhne/afc/util/IntegerList.java#L687-L704 |
zaproxy/zaproxy | src/org/parosproxy/paros/view/WorkbenchPanel.java | WorkbenchPanel.removePanels | private static void removePanels(TabbedPanel2 tabbedPanel, List<AbstractPanel> panels) {
"""
Removes the given {@code panels} from the given {@code tabbedPanel}.
<p>
After removing all the panels the tabbed panel is revalidated.
@param tabbedPanel the tabbed panel to remove the panels
@param panels the panel... | java | private static void removePanels(TabbedPanel2 tabbedPanel, List<AbstractPanel> panels) {
for (AbstractPanel panel : panels) {
removeTabPanel(tabbedPanel, panel);
}
tabbedPanel.revalidate();
} | [
"private",
"static",
"void",
"removePanels",
"(",
"TabbedPanel2",
"tabbedPanel",
",",
"List",
"<",
"AbstractPanel",
">",
"panels",
")",
"{",
"for",
"(",
"AbstractPanel",
"panel",
":",
"panels",
")",
"{",
"removeTabPanel",
"(",
"tabbedPanel",
",",
"panel",
")",... | Removes the given {@code panels} from the given {@code tabbedPanel}.
<p>
After removing all the panels the tabbed panel is revalidated.
@param tabbedPanel the tabbed panel to remove the panels
@param panels the panels to remove
@see #addPanel(TabbedPanel2, AbstractPanel, boolean)
@see javax.swing.JComponent#revalidate... | [
"Removes",
"the",
"given",
"{",
"@code",
"panels",
"}",
"from",
"the",
"given",
"{",
"@code",
"tabbedPanel",
"}",
".",
"<p",
">",
"After",
"removing",
"all",
"the",
"panels",
"the",
"tabbed",
"panel",
"is",
"revalidated",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L978-L983 |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | MapCore/src/main/java/org/wwarn/mapcore/client/components/customwidgets/facet/FacetBuilder.java | FacetBuilder.setItemsList | public FacetBuilder setItemsList(Map<String, String> items) {
"""
Takes a map of value to labels and the unique name of the list
@param items map of value to labels
@return a Builder instance to allow chaining
"""
ArrayList<FacetWidgetItem> facetWidgetItems = new ArrayList<FacetWidgetItem>();
... | java | public FacetBuilder setItemsList(Map<String, String> items) {
ArrayList<FacetWidgetItem> facetWidgetItems = new ArrayList<FacetWidgetItem>();
for (String key : items.keySet()){
String label = items.get(key);
FacetWidgetItem facetWidgetItem = new FacetWidgetItem(key, label);
... | [
"public",
"FacetBuilder",
"setItemsList",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"items",
")",
"{",
"ArrayList",
"<",
"FacetWidgetItem",
">",
"facetWidgetItems",
"=",
"new",
"ArrayList",
"<",
"FacetWidgetItem",
">",
"(",
")",
";",
"for",
"(",
"String... | Takes a map of value to labels and the unique name of the list
@param items map of value to labels
@return a Builder instance to allow chaining | [
"Takes",
"a",
"map",
"of",
"value",
"to",
"labels",
"and",
"the",
"unique",
"name",
"of",
"the",
"list"
] | train | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/MapCore/src/main/java/org/wwarn/mapcore/client/components/customwidgets/facet/FacetBuilder.java#L113-L123 |
alkacon/opencms-core | src/org/opencms/xml/page/CmsXmlPageFactory.java | CmsXmlPageFactory.createDocument | public static String createDocument(Locale locale, String encoding) {
"""
Creates a valid XML page String representation,
containing one empty element in the given locale.<p>
@param locale the locale to create the XML page for
@param encoding the encoding to use when creating the String from the XML
@retur... | java | public static String createDocument(Locale locale, String encoding) {
try {
return CmsXmlUtils.marshal(createDocument(locale), encoding);
} catch (CmsXmlException e) {
// this should never happen
LOG.error(Messages.get().getBundle().key(Messages.ERR_XML_PAGE_FACT_CRE... | [
"public",
"static",
"String",
"createDocument",
"(",
"Locale",
"locale",
",",
"String",
"encoding",
")",
"{",
"try",
"{",
"return",
"CmsXmlUtils",
".",
"marshal",
"(",
"createDocument",
"(",
"locale",
")",
",",
"encoding",
")",
";",
"}",
"catch",
"(",
"Cms... | Creates a valid XML page String representation,
containing one empty element in the given locale.<p>
@param locale the locale to create the XML page for
@param encoding the encoding to use when creating the String from the XML
@return a valid XML page document as a String | [
"Creates",
"a",
"valid",
"XML",
"page",
"String",
"representation",
"containing",
"one",
"empty",
"element",
"in",
"the",
"given",
"locale",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/page/CmsXmlPageFactory.java#L110-L119 |
opsgenie/opsgenieclient | sdk-swagger/src/main/java/com/ifountain/opsgenie/client/swagger/api/AlertApi.java | AlertApi.listNotes | public ListAlertNotesResponse listNotes(ListAlertNotesRequest params) throws ApiException {
"""
List Alert Notes
List alert notes for the given alert identifier
@param params.identifier Identifier of alert which could be alert id, tiny id or alert alias (required)
@param params.identifierType Type of the iden... | java | public ListAlertNotesResponse listNotes(ListAlertNotesRequest params) throws ApiException {
String identifier = params.getIdentifier();
String identifierType = params.getIdentifierType().getValue();
String offset = params.getOffset();
String direction = params.getDirection().getValue();
Integer limi... | [
"public",
"ListAlertNotesResponse",
"listNotes",
"(",
"ListAlertNotesRequest",
"params",
")",
"throws",
"ApiException",
"{",
"String",
"identifier",
"=",
"params",
".",
"getIdentifier",
"(",
")",
";",
"String",
"identifierType",
"=",
"params",
".",
"getIdentifierType"... | List Alert Notes
List alert notes for the given alert identifier
@param params.identifier Identifier of alert which could be alert id, tiny id or alert alias (required)
@param params.identifierType Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or ... | [
"List",
"Alert",
"Notes",
"List",
"alert",
"notes",
"for",
"the",
"given",
"alert",
"identifier"
] | train | https://github.com/opsgenie/opsgenieclient/blob/6d94efb16bbc74be189c86e9329af510ac8a048c/sdk-swagger/src/main/java/com/ifountain/opsgenie/client/swagger/api/AlertApi.java#L1291-L1338 |
nulab/backlog4j | src/main/java/com/nulabinc/backlog4j/BacklogEndPointSupport.java | BacklogEndPointSupport.getIssueAttachmentEndpoint | public String getIssueAttachmentEndpoint(Object issueIdOrKey, Object attachmentId) throws BacklogException {
"""
Returns the endpoint of attachment file.
@param issueIdOrKey the issue identifier
@param attachmentId the attachment identifierr
@return the endpoint
@throws BacklogException
"""
r... | java | public String getIssueAttachmentEndpoint(Object issueIdOrKey, Object attachmentId) throws BacklogException {
return buildEndpoint("issues/" + issueIdOrKey + "/attachments/" + attachmentId);
} | [
"public",
"String",
"getIssueAttachmentEndpoint",
"(",
"Object",
"issueIdOrKey",
",",
"Object",
"attachmentId",
")",
"throws",
"BacklogException",
"{",
"return",
"buildEndpoint",
"(",
"\"issues/\"",
"+",
"issueIdOrKey",
"+",
"\"/attachments/\"",
"+",
"attachmentId",
")"... | Returns the endpoint of attachment file.
@param issueIdOrKey the issue identifier
@param attachmentId the attachment identifierr
@return the endpoint
@throws BacklogException | [
"Returns",
"the",
"endpoint",
"of",
"attachment",
"file",
"."
] | train | https://github.com/nulab/backlog4j/blob/862ae0586ad808b2ec413f665b8dfc0c9a107b4e/src/main/java/com/nulabinc/backlog4j/BacklogEndPointSupport.java#L70-L72 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitAttribute | @Override
public R visitAttribute(AttributeTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitAttribute(AttributeTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitAttribute",
"(",
"AttributeTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L105-L108 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/loader/PersistenceXMLLoader.java | PersistenceXMLLoader.getElementContent | private static String getElementContent(Element element, String defaultStr) {
"""
Get the content of the given element.
@param element
The element to get the content for.
@param defaultStr
The default to return when there is no content.
@return The content of the element or the default.
@throws Exception
... | java | private static String getElementContent(Element element, String defaultStr)
{
if (element == null)
{
return defaultStr;
}
NodeList children = element.getChildNodes();
StringBuilder result = new StringBuilder("");
for (int i = 0; i < children.getL... | [
"private",
"static",
"String",
"getElementContent",
"(",
"Element",
"element",
",",
"String",
"defaultStr",
")",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"return",
"defaultStr",
";",
"}",
"NodeList",
"children",
"=",
"element",
".",
"getChildNodes",
... | Get the content of the given element.
@param element
The element to get the content for.
@param defaultStr
The default to return when there is no content.
@return The content of the element or the default.
@throws Exception
the exception | [
"Get",
"the",
"content",
"of",
"the",
"given",
"element",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/loader/PersistenceXMLLoader.java#L535-L553 |
VoltDB/voltdb | examples/geospatial/client/geospatial/AdBrokerBenchmark.java | AdBrokerBenchmark.connectToOneServerWithRetry | static void connectToOneServerWithRetry(Client client, String server) {
"""
Connect to a single server with retry. Limited exponential backoff.
No timeout. This will run until the process is killed if it's not
able to connect.
@param server hostname:port or just hostname (hostname can be ip).
"""
... | java | static void connectToOneServerWithRetry(Client client, String server) {
int sleep = 1000;
while (true) {
try {
client.createConnection(server);
break;
}
catch (Exception e) {
System.err.printf("Connection failed - retryi... | [
"static",
"void",
"connectToOneServerWithRetry",
"(",
"Client",
"client",
",",
"String",
"server",
")",
"{",
"int",
"sleep",
"=",
"1000",
";",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"client",
".",
"createConnection",
"(",
"server",
")",
";",
"break",
... | Connect to a single server with retry. Limited exponential backoff.
No timeout. This will run until the process is killed if it's not
able to connect.
@param server hostname:port or just hostname (hostname can be ip). | [
"Connect",
"to",
"a",
"single",
"server",
"with",
"retry",
".",
"Limited",
"exponential",
"backoff",
".",
"No",
"timeout",
".",
"This",
"will",
"run",
"until",
"the",
"process",
"is",
"killed",
"if",
"it",
"s",
"not",
"able",
"to",
"connect",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/geospatial/client/geospatial/AdBrokerBenchmark.java#L200-L214 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/splitassigner/InputSplitManager.java | InputSplitManager.getNextInputSplit | public InputSplit getNextInputSplit(final ExecutionVertex vertex, final int sequenceNumber) {
"""
Returns the next input split the input split manager (or the responsible {@link InputSplitAssigner} to be more
precise) has chosen for the given vertex to consume.
@param vertex
the vertex for which the next inpu... | java | public InputSplit getNextInputSplit(final ExecutionVertex vertex, final int sequenceNumber) {
InputSplit nextInputSplit = this.inputSplitTracker.getInputSplitFromLog(vertex, sequenceNumber);
if (nextInputSplit != null) {
LOG.info("Input split " + nextInputSplit.getSplitNumber() + " for vertex " + vertex + " rep... | [
"public",
"InputSplit",
"getNextInputSplit",
"(",
"final",
"ExecutionVertex",
"vertex",
",",
"final",
"int",
"sequenceNumber",
")",
"{",
"InputSplit",
"nextInputSplit",
"=",
"this",
".",
"inputSplitTracker",
".",
"getInputSplitFromLog",
"(",
"vertex",
",",
"sequenceNu... | Returns the next input split the input split manager (or the responsible {@link InputSplitAssigner} to be more
precise) has chosen for the given vertex to consume.
@param vertex
the vertex for which the next input split is to be determined
@param sequenceNumber
the sequence number of the vertex's request
@return the n... | [
"Returns",
"the",
"next",
"input",
"split",
"the",
"input",
"split",
"manager",
"(",
"or",
"the",
"responsible",
"{",
"@link",
"InputSplitAssigner",
"}",
"to",
"be",
"more",
"precise",
")",
"has",
"chosen",
"for",
"the",
"given",
"vertex",
"to",
"consume",
... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/splitassigner/InputSplitManager.java#L173-L196 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/NativeAppCallAttachmentStore.java | NativeAppCallAttachmentStore.addAttachmentsForCall | public void addAttachmentsForCall(Context context, UUID callId, Map<String, Bitmap> imageAttachments) {
"""
Adds a number of bitmap attachments associated with a native app call. The attachments will be
served via {@link NativeAppCallContentProvider#openFile(android.net.Uri, String) openFile}.
@param context t... | java | public void addAttachmentsForCall(Context context, UUID callId, Map<String, Bitmap> imageAttachments) {
Validate.notNull(context, "context");
Validate.notNull(callId, "callId");
Validate.containsNoNulls(imageAttachments.values(), "imageAttachments");
Validate.containsNoNullOrEmpty(imageA... | [
"public",
"void",
"addAttachmentsForCall",
"(",
"Context",
"context",
",",
"UUID",
"callId",
",",
"Map",
"<",
"String",
",",
"Bitmap",
">",
"imageAttachments",
")",
"{",
"Validate",
".",
"notNull",
"(",
"context",
",",
"\"context\"",
")",
";",
"Validate",
".... | Adds a number of bitmap attachments associated with a native app call. The attachments will be
served via {@link NativeAppCallContentProvider#openFile(android.net.Uri, String) openFile}.
@param context the Context the call is being made from
@param callId the unique ID of the call
@param imageAttachments a Map of atta... | [
"Adds",
"a",
"number",
"of",
"bitmap",
"attachments",
"associated",
"with",
"a",
"native",
"app",
"call",
".",
"The",
"attachments",
"will",
"be",
"served",
"via",
"{",
"@link",
"NativeAppCallContentProvider#openFile",
"(",
"android",
".",
"net",
".",
"Uri",
"... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/NativeAppCallAttachmentStore.java#L59-L76 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_role_roleId_member_username_GET | public OvhMember serviceName_role_roleId_member_username_GET(String serviceName, String roleId, String username) throws IOException {
"""
Returns the member metadata
REST: GET /dbaas/logs/{serviceName}/role/{roleId}/member/{username}
@param serviceName [required] Service name
@param roleId [required] Role ID
... | java | public OvhMember serviceName_role_roleId_member_username_GET(String serviceName, String roleId, String username) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/role/{roleId}/member/{username}";
StringBuilder sb = path(qPath, serviceName, roleId, username);
String resp = exec(qPath, "GET", sb.toStr... | [
"public",
"OvhMember",
"serviceName_role_roleId_member_username_GET",
"(",
"String",
"serviceName",
",",
"String",
"roleId",
",",
"String",
"username",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/logs/{serviceName}/role/{roleId}/member/{username}\"",
... | Returns the member metadata
REST: GET /dbaas/logs/{serviceName}/role/{roleId}/member/{username}
@param serviceName [required] Service name
@param roleId [required] Role ID
@param username [required] Username | [
"Returns",
"the",
"member",
"metadata"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L930-L935 |
WolfgangFahl/Mediawiki-Japi | src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java | Mediawiki.getResponse | public ClientResponse getResponse(String url, Method method)
throws Exception {
"""
get a response for the given url and method
@param url
@param method
@return
@throws Exception
"""
Builder resource = getResource(url);
ClientResponse response = null;
switch (method) {
case Get:
... | java | public ClientResponse getResponse(String url, Method method)
throws Exception {
Builder resource = getResource(url);
ClientResponse response = null;
switch (method) {
case Get:
response = resource.get(ClientResponse.class);
break;
case Post:
response = resource.post(ClientRes... | [
"public",
"ClientResponse",
"getResponse",
"(",
"String",
"url",
",",
"Method",
"method",
")",
"throws",
"Exception",
"{",
"Builder",
"resource",
"=",
"getResource",
"(",
"url",
")",
";",
"ClientResponse",
"response",
"=",
"null",
";",
"switch",
"(",
"method",... | get a response for the given url and method
@param url
@param method
@return
@throws Exception | [
"get",
"a",
"response",
"for",
"the",
"given",
"url",
"and",
"method"
] | train | https://github.com/WolfgangFahl/Mediawiki-Japi/blob/78d0177ebfe02eb05da5550839727861f1e888a5/src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java#L333-L352 |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherConfiguration.java | ScatterGatherConfiguration.addBroadcastSetForScatterFunction | public void addBroadcastSetForScatterFunction(String name, DataSet<?> data) {
"""
Adds a data set as a broadcast set to the scatter function.
@param name The name under which the broadcast data is available in the scatter function.
@param data The data set to be broadcast.
"""
this.bcVarsScatter.add(new ... | java | public void addBroadcastSetForScatterFunction(String name, DataSet<?> data) {
this.bcVarsScatter.add(new Tuple2<>(name, data));
} | [
"public",
"void",
"addBroadcastSetForScatterFunction",
"(",
"String",
"name",
",",
"DataSet",
"<",
"?",
">",
"data",
")",
"{",
"this",
".",
"bcVarsScatter",
".",
"add",
"(",
"new",
"Tuple2",
"<>",
"(",
"name",
",",
"data",
")",
")",
";",
"}"
] | Adds a data set as a broadcast set to the scatter function.
@param name The name under which the broadcast data is available in the scatter function.
@param data The data set to be broadcast. | [
"Adds",
"a",
"data",
"set",
"as",
"a",
"broadcast",
"set",
"to",
"the",
"scatter",
"function",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherConfiguration.java#L61-L63 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/ServerSICoreConnectionListener.java | ServerSICoreConnectionListener.addSICoreConnection | public void addSICoreConnection(SICoreConnection conn, Conversation conversation) {
"""
Creates a new SICoreConnection that this listener is listening
for events from.
@param conn The SICoreConnection.
@param conversation The associated conversation.
"""
if (TraceComponent.isAnyTracingEnabled() &&... | java | public void addSICoreConnection(SICoreConnection conn, Conversation conversation) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addSICoreConnection");
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
SibTr.debug(tc, "Params... | [
"public",
"void",
"addSICoreConnection",
"(",
"SICoreConnection",
"conn",
",",
"Conversation",
"conversation",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
... | Creates a new SICoreConnection that this listener is listening
for events from.
@param conn The SICoreConnection.
@param conversation The associated conversation. | [
"Creates",
"a",
"new",
"SICoreConnection",
"that",
"this",
"listener",
"is",
"listening",
"for",
"events",
"from",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/ServerSICoreConnectionListener.java#L92-L111 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.withDefault | public static <T> ListWithDefault<T> withDefault(List<T> self, @ClosureParams(value=SimpleType.class, options = "int") Closure<T> init) {
"""
An alias for <code>withLazyDefault</code> which decorates a list allowing
it to grow when called with index values outside the normal list bounds.
@param self a List
@p... | java | public static <T> ListWithDefault<T> withDefault(List<T> self, @ClosureParams(value=SimpleType.class, options = "int") Closure<T> init) {
return withLazyDefault(self, init);
} | [
"public",
"static",
"<",
"T",
">",
"ListWithDefault",
"<",
"T",
">",
"withDefault",
"(",
"List",
"<",
"T",
">",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"int\"",
")",
"Closure",
"<",
"T",
... | An alias for <code>withLazyDefault</code> which decorates a list allowing
it to grow when called with index values outside the normal list bounds.
@param self a List
@param init a Closure with the target index as parameter which generates the default value
@return the decorated List
@see #withLazyDefault(java.util.Lis... | [
"An",
"alias",
"for",
"<code",
">",
"withLazyDefault<",
"/",
"code",
">",
"which",
"decorates",
"a",
"list",
"allowing",
"it",
"to",
"grow",
"when",
"called",
"with",
"index",
"values",
"outside",
"the",
"normal",
"list",
"bounds",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8620-L8622 |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/network/Network.java | Network.generateDot | public void generateDot(Model mo, String out, boolean fromLeftToRight) throws IOException {
"""
Generate a dot file (diagram) of the current network infrastructure, included all connected elements and links.
@param mo the model to use, it may contains naming services for switches or nodes that wi... | java | public void generateDot(Model mo, String out, boolean fromLeftToRight) throws IOException {
try (BufferedWriter dot = new BufferedWriter(new FileWriter(out))) {
dot.append("digraph G {\n");
if (fromLeftToRight) {
dot.append("rankdir=LR;\n");
}
dra... | [
"public",
"void",
"generateDot",
"(",
"Model",
"mo",
",",
"String",
"out",
",",
"boolean",
"fromLeftToRight",
")",
"throws",
"IOException",
"{",
"try",
"(",
"BufferedWriter",
"dot",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWriter",
"(",
"out",
")",
")"... | Generate a dot file (diagram) of the current network infrastructure, included all connected elements and links.
@param mo the model to use, it may contains naming services for switches or nodes that will
replace the generic names mainly based on the id number.
@param out the output dot fil... | [
"Generate",
"a",
"dot",
"file",
"(",
"diagram",
")",
"of",
"the",
"current",
"network",
"infrastructure",
"included",
"all",
"connected",
"elements",
"and",
"links",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/Network.java#L313-L325 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.createSingle | public static IDLProxyObject createSingle(InputStream is, boolean debug, File path) throws IOException {
"""
Creates the single.
@param is the is
@param debug the debug
@param path the path
@return the IDL proxy object
@throws IOException Signals that an I/O exception has occurred.
"""
return cr... | java | public static IDLProxyObject createSingle(InputStream is, boolean debug, File path) throws IOException {
return createSingle(is, debug, path, true);
} | [
"public",
"static",
"IDLProxyObject",
"createSingle",
"(",
"InputStream",
"is",
",",
"boolean",
"debug",
",",
"File",
"path",
")",
"throws",
"IOException",
"{",
"return",
"createSingle",
"(",
"is",
",",
"debug",
",",
"path",
",",
"true",
")",
";",
"}"
] | Creates the single.
@param is the is
@param debug the debug
@param path the path
@return the IDL proxy object
@throws IOException Signals that an I/O exception has occurred. | [
"Creates",
"the",
"single",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L1002-L1004 |
lukas-krecan/JsonUnit | json-unit-spring/src/main/java/net/javacrumbs/jsonunit/spring/JsonUnitResultMatchers.java | JsonUnitResultMatchers.isEqualTo | public ResultMatcher isEqualTo(final Object expected) {
"""
Compares JSON for equality. The expected object is converted to JSON
before comparison. Ignores order of sibling nodes and whitespaces.
<p/>
Please note that if you pass a String, it's parsed as JSON which can lead to an
unexpected behavior. If you pa... | java | public ResultMatcher isEqualTo(final Object expected) {
return new AbstractResultMatcher(path, configuration) {
public void doMatch(Object actual) {
Diff diff = createDiff(expected, actual);
diff.failIfDifferent();
}
};
} | [
"public",
"ResultMatcher",
"isEqualTo",
"(",
"final",
"Object",
"expected",
")",
"{",
"return",
"new",
"AbstractResultMatcher",
"(",
"path",
",",
"configuration",
")",
"{",
"public",
"void",
"doMatch",
"(",
"Object",
"actual",
")",
"{",
"Diff",
"diff",
"=",
... | Compares JSON for equality. The expected object is converted to JSON
before comparison. Ignores order of sibling nodes and whitespaces.
<p/>
Please note that if you pass a String, it's parsed as JSON which can lead to an
unexpected behavior. If you pass in "1" it is parsed as a JSON containing
integer 1. If you compare... | [
"Compares",
"JSON",
"for",
"equality",
".",
"The",
"expected",
"object",
"is",
"converted",
"to",
"JSON",
"before",
"comparison",
".",
"Ignores",
"order",
"of",
"sibling",
"nodes",
"and",
"whitespaces",
".",
"<p",
"/",
">",
"Please",
"note",
"that",
"if",
... | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit-spring/src/main/java/net/javacrumbs/jsonunit/spring/JsonUnitResultMatchers.java#L96-L103 |
michael-rapp/AndroidPreferenceActivity | example/src/main/java/de/mrapp/android/preference/activity/example/fragment/AppearancePreferenceFragment.java | AppearancePreferenceFragment.createToolbarElevationChangeListener | private OnPreferenceChangeListener createToolbarElevationChangeListener() {
"""
Creates and returns a listener, which allows to adapt the elevation of the toolbar, when the
value of the corresponding preference has been changed.
@return The listener, which has been created, as an instance of the type {@link
O... | java | private OnPreferenceChangeListener createToolbarElevationChangeListener() {
return new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
int elevation = Integer.valueOf((String) newValue);
... | [
"private",
"OnPreferenceChangeListener",
"createToolbarElevationChangeListener",
"(",
")",
"{",
"return",
"new",
"OnPreferenceChangeListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onPreferenceChange",
"(",
"Preference",
"preference",
",",
"Object",
"newVa... | Creates and returns a listener, which allows to adapt the elevation of the toolbar, when the
value of the corresponding preference has been changed.
@return The listener, which has been created, as an instance of the type {@link
OnPreferenceChangeListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"adapt",
"the",
"elevation",
"of",
"the",
"toolbar",
"when",
"the",
"value",
"of",
"the",
"corresponding",
"preference",
"has",
"been",
"changed",
"."
] | train | https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/fragment/AppearancePreferenceFragment.java#L67-L78 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractSphere3F.java | AbstractSphere3F.containsSphereAlignedBox | @Pure
public static boolean containsSphereAlignedBox(
double cx, double cy, double cz, double radius,
double bx, double by, double bz, double bsx, double bsy, double bsz) {
"""
Replies if an aligned box is inside in the sphere.
@param cx is the center of the sphere.
@param cy is the center of the sphere... | java | @Pure
public static boolean containsSphereAlignedBox(
double cx, double cy, double cz, double radius,
double bx, double by, double bz, double bsx, double bsy, double bsz) {
double rcx = (bx + bsx/2f);
double rcy = (by + bsy/2f);
double rcz = (bz + bsz/2f);
double farX;
if (cx<=rcx) farX = bx + bsx;
e... | [
"@",
"Pure",
"public",
"static",
"boolean",
"containsSphereAlignedBox",
"(",
"double",
"cx",
",",
"double",
"cy",
",",
"double",
"cz",
",",
"double",
"radius",
",",
"double",
"bx",
",",
"double",
"by",
",",
"double",
"bz",
",",
"double",
"bsx",
",",
"dou... | Replies if an aligned box is inside in the sphere.
@param cx is the center of the sphere.
@param cy is the center of the sphere.
@param cz is the center of the sphere.
@param radius is the radius of the sphere.
@param bx is the lowest corner of the box.
@param by is the lowest corner of the box.
@param bz is the lowes... | [
"Replies",
"if",
"an",
"aligned",
"box",
"is",
"inside",
"in",
"the",
"sphere",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractSphere3F.java#L414-L431 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Image.java | Image.drawSheared | public void drawSheared(float x,float y, float hshear, float vshear, Color filter) {
"""
Draw this image at a specified location and size
@param x The x location to draw the image at
@param y The y location to draw the image at
@param hshear The amount to shear the bottom points by horizontally
@param vshear... | java | public void drawSheared(float x,float y, float hshear, float vshear, Color filter) {
if (alpha != 1) {
if (filter == null) {
filter = Color.white;
}
filter = new Color(filter);
filter.a *= alpha;
}
if (filter != null) {
filter.bind();
... | [
"public",
"void",
"drawSheared",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"hshear",
",",
"float",
"vshear",
",",
"Color",
"filter",
")",
"{",
"if",
"(",
"alpha",
"!=",
"1",
")",
"{",
"if",
"(",
"filter",
"==",
"null",
")",
"{",
"filter",... | Draw this image at a specified location and size
@param x The x location to draw the image at
@param y The y location to draw the image at
@param hshear The amount to shear the bottom points by horizontally
@param vshear The amount to shear the right points by vertically
@param filter The colour filter to apply | [
"Draw",
"this",
"image",
"at",
"a",
"specified",
"location",
"and",
"size"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Image.java#L709-L751 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/RandomMatrices_ZDRM.java | RandomMatrices_ZDRM.hermitianPosDef | public static ZMatrixRMaj hermitianPosDef(int width, Random rand) {
"""
Creates a random symmetric positive definite matrix.
@param width The width of the square matrix it returns.
@param rand Random number generator used to make the matrix.
@return The random symmetric positive definite matrix.
"""
... | java | public static ZMatrixRMaj hermitianPosDef(int width, Random rand) {
// This is not formally proven to work. It just seems to work.
ZMatrixRMaj a = RandomMatrices_ZDRM.rectangle(width,1,rand);
ZMatrixRMaj b = new ZMatrixRMaj(1,width);
ZMatrixRMaj c = new ZMatrixRMaj(width,width);
... | [
"public",
"static",
"ZMatrixRMaj",
"hermitianPosDef",
"(",
"int",
"width",
",",
"Random",
"rand",
")",
"{",
"// This is not formally proven to work. It just seems to work.",
"ZMatrixRMaj",
"a",
"=",
"RandomMatrices_ZDRM",
".",
"rectangle",
"(",
"width",
",",
"1",
",",
... | Creates a random symmetric positive definite matrix.
@param width The width of the square matrix it returns.
@param rand Random number generator used to make the matrix.
@return The random symmetric positive definite matrix. | [
"Creates",
"a",
"random",
"symmetric",
"positive",
"definite",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/RandomMatrices_ZDRM.java#L110-L124 |
Alluxio/alluxio | core/server/common/src/main/java/alluxio/RestUtils.java | RestUtils.createErrorResponse | private static Response createErrorResponse(Exception e, AlluxioConfiguration alluxioConf) {
"""
Creates an error response using the given exception.
@param e the exception to be converted into {@link ErrorResponse} and encoded into json
@return the response
"""
AlluxioStatusException se = AlluxioStatu... | java | private static Response createErrorResponse(Exception e, AlluxioConfiguration alluxioConf) {
AlluxioStatusException se = AlluxioStatusException.fromThrowable(e);
ErrorResponse response = new ErrorResponse(se.getStatus().getCode(), se.getMessage());
Response.ResponseBuilder rb = Response.serverError().entit... | [
"private",
"static",
"Response",
"createErrorResponse",
"(",
"Exception",
"e",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"{",
"AlluxioStatusException",
"se",
"=",
"AlluxioStatusException",
".",
"fromThrowable",
"(",
"e",
")",
";",
"ErrorResponse",
"response",
"... | Creates an error response using the given exception.
@param e the exception to be converted into {@link ErrorResponse} and encoded into json
@return the response | [
"Creates",
"an",
"error",
"response",
"using",
"the",
"given",
"exception",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/RestUtils.java#L174-L184 |
jbehave/jbehave-core | jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java | StoryFinder.findPaths | public List<String> findPaths(String searchIn, List<String> includes, List<String> excludes) {
"""
Finds paths from a source path, allowing for include/exclude patterns.
Paths found are normalised by {@link StoryFinder#normalise(List<String>)}
.
@param searchIn the source path to search in
@param includes th... | java | public List<String> findPaths(String searchIn, List<String> includes, List<String> excludes) {
return normalise(sort(scan(searchIn, includes, excludes)));
} | [
"public",
"List",
"<",
"String",
">",
"findPaths",
"(",
"String",
"searchIn",
",",
"List",
"<",
"String",
">",
"includes",
",",
"List",
"<",
"String",
">",
"excludes",
")",
"{",
"return",
"normalise",
"(",
"sort",
"(",
"scan",
"(",
"searchIn",
",",
"in... | Finds paths from a source path, allowing for include/exclude patterns.
Paths found are normalised by {@link StoryFinder#normalise(List<String>)}
.
@param searchIn the source path to search in
@param includes the List of include patterns, or <code>null</code> if
none
@param excludes the List of exclude patterns, or <co... | [
"Finds",
"paths",
"from",
"a",
"source",
"path",
"allowing",
"for",
"include",
"/",
"exclude",
"patterns",
".",
"Paths",
"found",
"are",
"normalised",
"by",
"{",
"@link",
"StoryFinder#normalise",
"(",
"List<String",
">",
")",
"}",
"."
] | train | https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java#L150-L152 |
Whiley/WhileyCompiler | src/main/java/wyil/interpreter/Interpreter.java | Interpreter.executeSwitch | private Status executeSwitch(Stmt.Switch stmt, CallStack frame, EnclosingScope scope) {
"""
Execute a Switch statement at a given point in the function or method
body
@param stmt
--- The swithc statement to execute
@param frame
--- The current stack frame
@return
"""
Tuple<Stmt.Case> cases = stmt.get... | java | private Status executeSwitch(Stmt.Switch stmt, CallStack frame, EnclosingScope scope) {
Tuple<Stmt.Case> cases = stmt.getCases();
//
Object value = executeExpression(ANY_T, stmt.getCondition(), frame);
for (int i = 0; i != cases.size(); ++i) {
Stmt.Case c = cases.get(i);
Stmt.Block body = c.getBlock();
... | [
"private",
"Status",
"executeSwitch",
"(",
"Stmt",
".",
"Switch",
"stmt",
",",
"CallStack",
"frame",
",",
"EnclosingScope",
"scope",
")",
"{",
"Tuple",
"<",
"Stmt",
".",
"Case",
">",
"cases",
"=",
"stmt",
".",
"getCases",
"(",
")",
";",
"//",
"Object",
... | Execute a Switch statement at a given point in the function or method
body
@param stmt
--- The swithc statement to execute
@param frame
--- The current stack frame
@return | [
"Execute",
"a",
"Switch",
"statement",
"at",
"a",
"given",
"point",
"in",
"the",
"function",
"or",
"method",
"body"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L484-L505 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/miner/DirectedRelationMiner.java | DirectedRelationMiner.writeResult | @Override
public void writeResult(Map<BioPAXElement, List<Match>> matches, OutputStream out)
throws IOException {
"""
Writes the result as "A B", where A and B are gene symbols, and whitespace is tab.
@param matches pattern search result
@param out output stream
"""
writeResultAsSIF(matches, out, true, ... | java | @Override
public void writeResult(Map<BioPAXElement, List<Match>> matches, OutputStream out)
throws IOException
{
writeResultAsSIF(matches, out, true, getSourceLabel(), getTargetLabel());
} | [
"@",
"Override",
"public",
"void",
"writeResult",
"(",
"Map",
"<",
"BioPAXElement",
",",
"List",
"<",
"Match",
">",
">",
"matches",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"writeResultAsSIF",
"(",
"matches",
",",
"out",
",",
"true",
... | Writes the result as "A B", where A and B are gene symbols, and whitespace is tab.
@param matches pattern search result
@param out output stream | [
"Writes",
"the",
"result",
"as",
"A",
"B",
"where",
"A",
"and",
"B",
"are",
"gene",
"symbols",
"and",
"whitespace",
"is",
"tab",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/miner/DirectedRelationMiner.java#L63-L68 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/Deployment.java | Deployment.of | public static Deployment of(final Path content) {
"""
Creates a new deployment for the path. If the path is a directory the content will be deployed exploded using
the file system location.
@param content the path containing the content
@return the deployment
"""
final DeploymentContent deployme... | java | public static Deployment of(final Path content) {
final DeploymentContent deploymentContent = DeploymentContent.of(Assert.checkNotNullParam("content", content));
return new Deployment(deploymentContent, null);
} | [
"public",
"static",
"Deployment",
"of",
"(",
"final",
"Path",
"content",
")",
"{",
"final",
"DeploymentContent",
"deploymentContent",
"=",
"DeploymentContent",
".",
"of",
"(",
"Assert",
".",
"checkNotNullParam",
"(",
"\"content\"",
",",
"content",
")",
")",
";",... | Creates a new deployment for the path. If the path is a directory the content will be deployed exploded using
the file system location.
@param content the path containing the content
@return the deployment | [
"Creates",
"a",
"new",
"deployment",
"for",
"the",
"path",
".",
"If",
"the",
"path",
"is",
"a",
"directory",
"the",
"content",
"will",
"be",
"deployed",
"exploded",
"using",
"the",
"file",
"system",
"location",
"."
] | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/Deployment.java#L79-L82 |
apache/reef | lang/java/reef-examples/src/main/java/org/apache/reef/examples/hellohttp/HelloREEFHttp.java | HelloREEFHttp.runHelloReef | public static LauncherStatus runHelloReef(final Configuration runtimeConf, final int timeOut)
throws BindException, InjectionException {
"""
Run Hello Reef with merged configuration.
@param runtimeConf
@param timeOut
@return
@throws BindException
@throws InjectionException
"""
final Configurat... | java | public static LauncherStatus runHelloReef(final Configuration runtimeConf, final int timeOut)
throws BindException, InjectionException {
final Configuration driverConf =
Configurations.merge(HelloREEFHttp.getDriverConfiguration(), getHTTPConfiguration());
return DriverLauncher.getLauncher(runtimeC... | [
"public",
"static",
"LauncherStatus",
"runHelloReef",
"(",
"final",
"Configuration",
"runtimeConf",
",",
"final",
"int",
"timeOut",
")",
"throws",
"BindException",
",",
"InjectionException",
"{",
"final",
"Configuration",
"driverConf",
"=",
"Configurations",
".",
"mer... | Run Hello Reef with merged configuration.
@param runtimeConf
@param timeOut
@return
@throws BindException
@throws InjectionException | [
"Run",
"Hello",
"Reef",
"with",
"merged",
"configuration",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples/src/main/java/org/apache/reef/examples/hellohttp/HelloREEFHttp.java#L97-L102 |
apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.createHttpClient | private CloseableHttpClient createHttpClient() throws AzkabanClientException {
"""
Create a {@link CloseableHttpClient} used to communicate with Azkaban server.
Derived class can configure different http client by overriding this method.
@return A closeable http client.
"""
try {
// SSLSocketFactor... | java | private CloseableHttpClient createHttpClient() throws AzkabanClientException {
try {
// SSLSocketFactory using custom TrustStrategy that ignores warnings about untrusted certificates
// Self sign SSL
SSLContextBuilder sslcb = new SSLContextBuilder();
sslcb.loadTrustMaterial(null, (TrustStrategy) new... | [
"private",
"CloseableHttpClient",
"createHttpClient",
"(",
")",
"throws",
"AzkabanClientException",
"{",
"try",
"{",
"// SSLSocketFactory using custom TrustStrategy that ignores warnings about untrusted certificates",
"// Self sign SSL",
"SSLContextBuilder",
"sslcb",
"=",
"new",
"SSL... | Create a {@link CloseableHttpClient} used to communicate with Azkaban server.
Derived class can configure different http client by overriding this method.
@return A closeable http client. | [
"Create",
"a",
"{",
"@link",
"CloseableHttpClient",
"}",
"used",
"to",
"communicate",
"with",
"Azkaban",
"server",
".",
"Derived",
"class",
"can",
"configure",
"different",
"http",
"client",
"by",
"overriding",
"this",
"method",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L150-L175 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/util/pathfinding/AStarPathFinder.java | AStarPathFinder.isValidLocation | protected boolean isValidLocation(Mover mover, int sx, int sy, int x, int y) {
"""
Check if a given location is valid for the supplied mover
@param mover The mover that would hold a given location
@param sx The starting x coordinate
@param sy The starting y coordinate
@param x The x coordinate of the locatio... | java | protected boolean isValidLocation(Mover mover, int sx, int sy, int x, int y) {
boolean invalid = (x < 0) || (y < 0) || (x >= map.getWidthInTiles()) || (y >= map.getHeightInTiles());
if ((!invalid) && ((sx != x) || (sy != y))) {
this.mover = mover;
this.sourceX = sx;
this.sourceY = sy;
invalid ... | [
"protected",
"boolean",
"isValidLocation",
"(",
"Mover",
"mover",
",",
"int",
"sx",
",",
"int",
"sy",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"boolean",
"invalid",
"=",
"(",
"x",
"<",
"0",
")",
"||",
"(",
"y",
"<",
"0",
")",
"||",
"(",
"x",... | Check if a given location is valid for the supplied mover
@param mover The mover that would hold a given location
@param sx The starting x coordinate
@param sy The starting y coordinate
@param x The x coordinate of the location to check
@param y The y coordinate of the location to check
@return True if the location is... | [
"Check",
"if",
"a",
"given",
"location",
"is",
"valid",
"for",
"the",
"supplied",
"mover"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/util/pathfinding/AStarPathFinder.java#L317-L328 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/ArrayUtil.java | ArrayUtil.startsWith | public static boolean startsWith(Object array1[], Object array2[]) {
"""
Returns true if <code>array1</code> starts with <code>array2</code>
"""
return equals(array1, 0, array2, 0, array2.length);
} | java | public static boolean startsWith(Object array1[], Object array2[]){
return equals(array1, 0, array2, 0, array2.length);
} | [
"public",
"static",
"boolean",
"startsWith",
"(",
"Object",
"array1",
"[",
"]",
",",
"Object",
"array2",
"[",
"]",
")",
"{",
"return",
"equals",
"(",
"array1",
",",
"0",
",",
"array2",
",",
"0",
",",
"array2",
".",
"length",
")",
";",
"}"
] | Returns true if <code>array1</code> starts with <code>array2</code> | [
"Returns",
"true",
"if",
"<code",
">",
"array1<",
"/",
"code",
">",
"starts",
"with",
"<code",
">",
"array2<",
"/",
"code",
">"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ArrayUtil.java#L119-L121 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photos/PhotoUtils.java | PhotoUtils.getAttribute | private static String getAttribute(String name, Element firstElement, Element secondElement) {
"""
Try to get an attribute value from two elements.
@param firstElement
@param secondElement
@return attribute value
"""
String val = firstElement.getAttribute(name);
if (val.length() == 0 && ... | java | private static String getAttribute(String name, Element firstElement, Element secondElement) {
String val = firstElement.getAttribute(name);
if (val.length() == 0 && secondElement != null) {
val = secondElement.getAttribute(name);
}
return val;
} | [
"private",
"static",
"String",
"getAttribute",
"(",
"String",
"name",
",",
"Element",
"firstElement",
",",
"Element",
"secondElement",
")",
"{",
"String",
"val",
"=",
"firstElement",
".",
"getAttribute",
"(",
"name",
")",
";",
"if",
"(",
"val",
".",
"length"... | Try to get an attribute value from two elements.
@param firstElement
@param secondElement
@return attribute value | [
"Try",
"to",
"get",
"an",
"attribute",
"value",
"from",
"two",
"elements",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/PhotoUtils.java#L33-L39 |
google/closure-compiler | src/com/google/javascript/jscomp/AbstractCommandLineRunner.java | AbstractCommandLineRunner.createInputs | @GwtIncompatible("Unnecessary")
private List<SourceFile> createInputs(
List<FlagEntry<JsSourceType>> files, boolean allowStdIn, List<JsModuleSpec> jsModuleSpecs)
throws IOException {
"""
Creates inputs from a list of files.
@param files A list of flag entries indicates js and zip file names.
@par... | java | @GwtIncompatible("Unnecessary")
private List<SourceFile> createInputs(
List<FlagEntry<JsSourceType>> files, boolean allowStdIn, List<JsModuleSpec> jsModuleSpecs)
throws IOException {
return createInputs(files, /* jsonFiles= */ null, allowStdIn, jsModuleSpecs);
} | [
"@",
"GwtIncompatible",
"(",
"\"Unnecessary\"",
")",
"private",
"List",
"<",
"SourceFile",
">",
"createInputs",
"(",
"List",
"<",
"FlagEntry",
"<",
"JsSourceType",
">",
">",
"files",
",",
"boolean",
"allowStdIn",
",",
"List",
"<",
"JsModuleSpec",
">",
"jsModul... | Creates inputs from a list of files.
@param files A list of flag entries indicates js and zip file names.
@param allowStdIn Whether '-' is allowed appear as a filename to represent stdin. If true, '-'
is only allowed to appear once.
@param jsModuleSpecs A list js module specs.
@return An array of inputs | [
"Creates",
"inputs",
"from",
"a",
"list",
"of",
"files",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L559-L564 |
plaid/plaid-java | src/main/java/com/plaid/client/internal/Util.java | Util.notEmpty | public static void notEmpty(Object[] arr, String name) {
"""
Checks that a given array is not null and not empty.
@param arr The array to check
@param name The name of the array to use when raising an error.
@throws IllegalArgumentException If the collection was null or empty.
"""
notNull(arr, name... | java | public static void notEmpty(Object[] arr, String name) {
notNull(arr, name);
if (arr.length == 0) {
throw new IllegalArgumentException(name + "must not be empty");
}
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"Object",
"[",
"]",
"arr",
",",
"String",
"name",
")",
"{",
"notNull",
"(",
"arr",
",",
"name",
")",
";",
"if",
"(",
"arr",
".",
"length",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"... | Checks that a given array is not null and not empty.
@param arr The array to check
@param name The name of the array to use when raising an error.
@throws IllegalArgumentException If the collection was null or empty. | [
"Checks",
"that",
"a",
"given",
"array",
"is",
"not",
"null",
"and",
"not",
"empty",
"."
] | train | https://github.com/plaid/plaid-java/blob/360f1f8a5178fa0c3c2c2e07a58f8ccec5f33117/src/main/java/com/plaid/client/internal/Util.java#L45-L51 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/classify/Dataset.java | Dataset.readSVMLightFormat | public static Dataset<String, String> readSVMLightFormat(String filename, Index<String> featureIndex, Index<String> labelIndex) {
"""
Constructs a Dataset by reading in a file in SVM light format.
the created dataset has the same feature and label index as given
"""
return readSVMLightFormat(filename, fe... | java | public static Dataset<String, String> readSVMLightFormat(String filename, Index<String> featureIndex, Index<String> labelIndex) {
return readSVMLightFormat(filename, featureIndex, labelIndex, null);
} | [
"public",
"static",
"Dataset",
"<",
"String",
",",
"String",
">",
"readSVMLightFormat",
"(",
"String",
"filename",
",",
"Index",
"<",
"String",
">",
"featureIndex",
",",
"Index",
"<",
"String",
">",
"labelIndex",
")",
"{",
"return",
"readSVMLightFormat",
"(",
... | Constructs a Dataset by reading in a file in SVM light format.
the created dataset has the same feature and label index as given | [
"Constructs",
"a",
"Dataset",
"by",
"reading",
"in",
"a",
"file",
"in",
"SVM",
"light",
"format",
".",
"the",
"created",
"dataset",
"has",
"the",
"same",
"feature",
"and",
"label",
"index",
"as",
"given"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/Dataset.java#L214-L216 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/PathUtils.java | PathUtils.contains | @Trivial
private static boolean contains(String[] fileList, String fileName) {
"""
Tell if a file name is present in an array of file names. Test
file names using case sensitive {@link String#equals(Object)}.
The parameter file names collection is expected to be obtained from
a call to {@link File#list()}... | java | @Trivial
private static boolean contains(String[] fileList, String fileName) {
if (fileList != null) {
for (String name : fileList) {
if (name.equals(fileName)) {
return true;
}
}
}
return false;
} | [
"@",
"Trivial",
"private",
"static",
"boolean",
"contains",
"(",
"String",
"[",
"]",
"fileList",
",",
"String",
"fileName",
")",
"{",
"if",
"(",
"fileList",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"name",
":",
"fileList",
")",
"{",
"if",
"(",
"... | Tell if a file name is present in an array of file names. Test
file names using case sensitive {@link String#equals(Object)}.
The parameter file names collection is expected to be obtained from
a call to {@link File#list()}, which can return null.
@param fileNames The file names to test against. The array may
be null... | [
"Tell",
"if",
"a",
"file",
"name",
"is",
"present",
"in",
"an",
"array",
"of",
"file",
"names",
".",
"Test",
"file",
"names",
"using",
"case",
"sensitive",
"{",
"@link",
"String#equals",
"(",
"Object",
")",
"}",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/PathUtils.java#L1442-L1453 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/LayoutManager.java | LayoutManager.show | public static void show(boolean manage, String deflt, IEventListener closeListener) {
"""
Invokes the layout manager dialog.
@param manage If true, open in management mode; otherwise, in selection mode.
@param deflt Default layout name.
@param closeListener Close event listener.
"""
Map<String, Ob... | java | public static void show(boolean manage, String deflt, IEventListener closeListener) {
Map<String, Object> args = new HashMap<>();
args.put("manage", manage);
args.put("deflt", deflt);
PopupDialog.show(RESOURCE_PREFIX + "layoutManager.fsp", args, true, true, true, closeListener);
} | [
"public",
"static",
"void",
"show",
"(",
"boolean",
"manage",
",",
"String",
"deflt",
",",
"IEventListener",
"closeListener",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"args",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"args",
".",
"put",
"(... | Invokes the layout manager dialog.
@param manage If true, open in management mode; otherwise, in selection mode.
@param deflt Default layout name.
@param closeListener Close event listener. | [
"Invokes",
"the",
"layout",
"manager",
"dialog",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/LayoutManager.java#L171-L176 |
nominanuda/zen-project | zen-rhino/src/main/java/org/mozilla/javascript/HtmlUnitRegExpProxy.java | HtmlUnitRegExpProxy.action | @Override
public Object action(final Context cx, final Scriptable scope,
final Scriptable thisObj, final Object[] args, final int actionType) {
"""
Use the wrapped proxy except for replacement with string arg where it
uses Java regular expression. {@inheritDoc}
"""
try {
return doAction(cx, scope, th... | java | @Override
public Object action(final Context cx, final Scriptable scope,
final Scriptable thisObj, final Object[] args, final int actionType) {
try {
return doAction(cx, scope, thisObj, args, actionType);
} catch (final StackOverflowError e) {
// TODO: We shouldn't have to catch this exception and fall ba... | [
"@",
"Override",
"public",
"Object",
"action",
"(",
"final",
"Context",
"cx",
",",
"final",
"Scriptable",
"scope",
",",
"final",
"Scriptable",
"thisObj",
",",
"final",
"Object",
"[",
"]",
"args",
",",
"final",
"int",
"actionType",
")",
"{",
"try",
"{",
"... | Use the wrapped proxy except for replacement with string arg where it
uses Java regular expression. {@inheritDoc} | [
"Use",
"the",
"wrapped",
"proxy",
"except",
"for",
"replacement",
"with",
"string",
"arg",
"where",
"it",
"uses",
"Java",
"regular",
"expression",
".",
"{"
] | train | https://github.com/nominanuda/zen-project/blob/fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d/zen-rhino/src/main/java/org/mozilla/javascript/HtmlUnitRegExpProxy.java#L52-L63 |
wildfly/wildfly-core | remoting/subsystem/src/main/java/org/jboss/as/remoting/management/ManagementRemotingServices.java | ManagementRemotingServices.installManagementChannelOpenListenerService | public static void installManagementChannelOpenListenerService(
final ServiceTarget serviceTarget,
final ServiceName endpointName,
final String channelName,
final ServiceName operationHandlerName,
final OptionMap options,
final boolean onDemand) {
... | java | public static void installManagementChannelOpenListenerService(
final ServiceTarget serviceTarget,
final ServiceName endpointName,
final String channelName,
final ServiceName operationHandlerName,
final OptionMap options,
final boolean onDemand) {
... | [
"public",
"static",
"void",
"installManagementChannelOpenListenerService",
"(",
"final",
"ServiceTarget",
"serviceTarget",
",",
"final",
"ServiceName",
"endpointName",
",",
"final",
"String",
"channelName",
",",
"final",
"ServiceName",
"operationHandlerName",
",",
"final",
... | Set up the services to create a channel listener. This assumes that an endpoint service called {@code endpointName} exists.
@param serviceTarget the service target to install the services into
@param endpointName the name of the endpoint to install a channel listener into
@param channelName the name of the channel
@par... | [
"Set",
"up",
"the",
"services",
"to",
"create",
"a",
"channel",
"listener",
".",
"This",
"assumes",
"that",
"an",
"endpoint",
"service",
"called",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/remoting/subsystem/src/main/java/org/jboss/as/remoting/management/ManagementRemotingServices.java#L114-L131 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/DynamicFactory.java | DynamicFactory.ofClass | public <T extends ICDKObject> T ofClass(Class<T> intf) {
"""
Construct an implementation using the default constructor. This provides
some speed boost over invoking {@link #ofClass(Class, Object...)}.
@param intf the interface to construct an instance of
@param <T> the type of the class
@return an implement... | java | public <T extends ICDKObject> T ofClass(Class<T> intf) {
try {
if (!intf.isInterface()) throw new IllegalArgumentException("expected interface, got " + intf.getClass());
Creator<T> creator = get(new ClassBasedKey(intf, EMPTY_CLASS_ARRAY));
return creator.create(null); // t... | [
"public",
"<",
"T",
"extends",
"ICDKObject",
">",
"T",
"ofClass",
"(",
"Class",
"<",
"T",
">",
"intf",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"intf",
".",
"isInterface",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"expected interface... | Construct an implementation using the default constructor. This provides
some speed boost over invoking {@link #ofClass(Class, Object...)}.
@param intf the interface to construct an instance of
@param <T> the type of the class
@return an implementation of provided interface constructed using the
default constructor.
... | [
"Construct",
"an",
"implementation",
"using",
"the",
"default",
"constructor",
".",
"This",
"provides",
"some",
"speed",
"boost",
"over",
"invoking",
"{",
"@link",
"#ofClass",
"(",
"Class",
"Object",
"...",
")",
"}",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/DynamicFactory.java#L544-L561 |
pavlospt/RxFile | rxfile/src/main/java/com/pavlospt/rxfile/RxFile.java | RxFile.createFilesFromClipData | public static Observable<List<File>> createFilesFromClipData(final Context context,
final ClipData clipData) {
"""
/*
Create a copy of the files found under the ClipData item passed from MultiSelection, in the Library's cache folder.
The mime type of the resource will be determined by URLConnection.guess... | java | public static Observable<List<File>> createFilesFromClipData(final Context context,
final ClipData clipData) {
return createFilesFromClipData(context, clipData, MimeMap.UrlConnection);
} | [
"public",
"static",
"Observable",
"<",
"List",
"<",
"File",
">",
">",
"createFilesFromClipData",
"(",
"final",
"Context",
"context",
",",
"final",
"ClipData",
"clipData",
")",
"{",
"return",
"createFilesFromClipData",
"(",
"context",
",",
"clipData",
",",
"MimeM... | /*
Create a copy of the files found under the ClipData item passed from MultiSelection, in the Library's cache folder.
The mime type of the resource will be determined by URLConnection.guessContentTypeFromName() method. | [
"/",
"*",
"Create",
"a",
"copy",
"of",
"the",
"files",
"found",
"under",
"the",
"ClipData",
"item",
"passed",
"from",
"MultiSelection",
"in",
"the",
"Library",
"s",
"cache",
"folder",
"."
] | train | https://github.com/pavlospt/RxFile/blob/54210b02631f4b27d31bea040eca86183136cf46/rxfile/src/main/java/com/pavlospt/rxfile/RxFile.java#L136-L140 |
square/tape | tape/src/main/java/com/squareup/tape2/QueueFile.java | QueueFile.writeInt | private static void writeInt(byte[] buffer, int offset, int value) {
"""
Stores an {@code int} in the {@code byte[]}. The behavior is equivalent to calling
{@link RandomAccessFile#writeInt}.
"""
buffer[offset ] = (byte) (value >> 24);
buffer[offset + 1] = (byte) (value >> 16);
buffer[offset + 2... | java | private static void writeInt(byte[] buffer, int offset, int value) {
buffer[offset ] = (byte) (value >> 24);
buffer[offset + 1] = (byte) (value >> 16);
buffer[offset + 2] = (byte) (value >> 8);
buffer[offset + 3] = (byte) value;
} | [
"private",
"static",
"void",
"writeInt",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"value",
")",
"{",
"buffer",
"[",
"offset",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
">>",
"24",
")",
";",
"buffer",
"[",
"offset",
"+",
... | Stores an {@code int} in the {@code byte[]}. The behavior is equivalent to calling
{@link RandomAccessFile#writeInt}. | [
"Stores",
"an",
"{"
] | train | https://github.com/square/tape/blob/445cd3fd0a7b3ec48c9ea3e0e86663fe6d3735d8/tape/src/main/java/com/squareup/tape2/QueueFile.java#L217-L222 |
cwilper/ttff | src/main/java/com/github/cwilper/ttff/Sources.java | Sources.drain | public static <T> long drain(Source<T> source) throws IOException {
"""
Exhausts the given source.
<p>
The source will be automatically closed regardless of success.
@param source the source to exhaust.
@param <T> the type.
@return the number of items encountered.
@throws IOException if an I/O problem occu... | java | public static <T> long drain(Source<T> source) throws IOException {
return drain(source, new AbstractSink<T>() {
@Override
public void put(T item) { }
});
} | [
"public",
"static",
"<",
"T",
">",
"long",
"drain",
"(",
"Source",
"<",
"T",
">",
"source",
")",
"throws",
"IOException",
"{",
"return",
"drain",
"(",
"source",
",",
"new",
"AbstractSink",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"voi... | Exhausts the given source.
<p>
The source will be automatically closed regardless of success.
@param source the source to exhaust.
@param <T> the type.
@return the number of items encountered.
@throws IOException if an I/O problem occurs. | [
"Exhausts",
"the",
"given",
"source",
".",
"<p",
">",
"The",
"source",
"will",
"be",
"automatically",
"closed",
"regardless",
"of",
"success",
"."
] | train | https://github.com/cwilper/ttff/blob/b351883764546078128d69c2ff0a8431dd45796b/src/main/java/com/github/cwilper/ttff/Sources.java#L226-L231 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ElevationUtil.java | ElevationUtil.getHorizontalShadowWidth | private static float getHorizontalShadowWidth(@NonNull final Context context,
final int elevation,
@NonNull final Orientation orientation,
final boolean parallelLight) {
... | java | private static float getHorizontalShadowWidth(@NonNull final Context context,
final int elevation,
@NonNull final Orientation orientation,
final boolean parallelLight) {
... | [
"private",
"static",
"float",
"getHorizontalShadowWidth",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"final",
"int",
"elevation",
",",
"@",
"NonNull",
"final",
"Orientation",
"orientation",
",",
"final",
"boolean",
"parallelLight",
")",
"{",
"switch"... | Returns the width of a shadow, which is located next to a corner of an elevated view in
horizontal direction.
@param context
The context, which should be used, as an instance of the class {@link Context}. The
context may not be null
@param elevation
The elevation, which should be emulated, in dp as an {@link Integer} ... | [
"Returns",
"the",
"width",
"of",
"a",
"shadow",
"which",
"is",
"located",
"next",
"to",
"a",
"corner",
"of",
"an",
"elevated",
"view",
"in",
"horizontal",
"direction",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L421-L435 |
arquillian/arquillian-recorder | arquillian-recorder-reporter/arquillian-recorder-reporter-impl/src/main/java/org/arquillian/recorder/reporter/exporter/impl/AsciiDocExporter.java | AsciiDocExporter.writeContainerProperties | protected void writeContainerProperties(Map<String, String> properties) throws IOException {
"""
Method that is called to write container properties to AsciiDoc document.
@param properties container properties as a map
"""
if (properties.size() > 0) {
writer.append("[cols=\"2*\", optio... | java | protected void writeContainerProperties(Map<String, String> properties) throws IOException {
if (properties.size() > 0) {
writer.append("[cols=\"2*\", options=\"header\"]").append(NEW_LINE);
writer.append(".").append(this.resourceBundle.getString("asciidoc.reporter.properties")).append... | [
"protected",
"void",
"writeContainerProperties",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"throws",
"IOException",
"{",
"if",
"(",
"properties",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"writer",
".",
"append",
"(",
"\"[cols=\\\"... | Method that is called to write container properties to AsciiDoc document.
@param properties container properties as a map | [
"Method",
"that",
"is",
"called",
"to",
"write",
"container",
"properties",
"to",
"AsciiDoc",
"document",
"."
] | train | https://github.com/arquillian/arquillian-recorder/blob/e3417111deb03a2e2d9b96d38b986db17e2c1d19/arquillian-recorder-reporter/arquillian-recorder-reporter-impl/src/main/java/org/arquillian/recorder/reporter/exporter/impl/AsciiDocExporter.java#L225-L245 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java | JDBC4CallableStatement.setBigDecimal | @Override
public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
"""
Sets the designated parameter to the given java.math.BigDecimal value.
"""
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setBigDecimal",
"(",
"String",
"parameterName",
",",
"BigDecimal",
"x",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Sets the designated parameter to the given java.math.BigDecimal value. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"math",
".",
"BigDecimal",
"value",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java#L591-L596 |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphPath.java | GraphPath.removeBefore | @Override
public boolean removeBefore(ST obj, PT pt) {
"""
Remove the path's elements before the
specified one which is starting
at the specified point. The specified element will
not be removed.
<p>This function removes until the <i>first occurence</i>
of the given object.
@param obj is the segment to ... | java | @Override
public boolean removeBefore(ST obj, PT pt) {
return removeUntil(indexOf(obj, pt), false);
} | [
"@",
"Override",
"public",
"boolean",
"removeBefore",
"(",
"ST",
"obj",
",",
"PT",
"pt",
")",
"{",
"return",
"removeUntil",
"(",
"indexOf",
"(",
"obj",
",",
"pt",
")",
",",
"false",
")",
";",
"}"
] | Remove the path's elements before the
specified one which is starting
at the specified point. The specified element will
not be removed.
<p>This function removes until the <i>first occurence</i>
of the given object.
@param obj is the segment to remove
@param pt is the point on which the segment was connected
as its f... | [
"Remove",
"the",
"path",
"s",
"elements",
"before",
"the",
"specified",
"one",
"which",
"is",
"starting",
"at",
"the",
"specified",
"point",
".",
"The",
"specified",
"element",
"will",
"not",
"be",
"removed",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphPath.java#L658-L661 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuStringUtil.java | GosuStringUtil.containsOnly | public static boolean containsOnly(String str, String validChars) {
"""
<p>Checks if the String contains only certain characters.</p>
<p>A <code>null</code> String will return <code>false</code>.
A <code>null</code> valid character String will return <code>false</code>.
An empty String ("") always returns <co... | java | public static boolean containsOnly(String str, String validChars) {
if (str == null || validChars == null) {
return false;
}
return containsOnly(str, validChars.toCharArray());
} | [
"public",
"static",
"boolean",
"containsOnly",
"(",
"String",
"str",
",",
"String",
"validChars",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"validChars",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"containsOnly",
"(",
"str",
","... | <p>Checks if the String contains only certain characters.</p>
<p>A <code>null</code> String will return <code>false</code>.
A <code>null</code> valid character String will return <code>false</code>.
An empty String ("") always returns <code>true</code>.</p>
<pre>
GosuStringUtil.containsOnly(null, *) = false
Gos... | [
"<p",
">",
"Checks",
"if",
"the",
"String",
"contains",
"only",
"certain",
"characters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L1318-L1323 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setEnterpriseCost | public void setEnterpriseCost(int index, Number value) {
"""
Set an enterprise field value.
@param index field index
@param value field value
"""
set(selectField(ResourceFieldLists.ENTERPRISE_COST, index), value);
} | java | public void setEnterpriseCost(int index, Number value)
{
set(selectField(ResourceFieldLists.ENTERPRISE_COST, index), value);
} | [
"public",
"void",
"setEnterpriseCost",
"(",
"int",
"index",
",",
"Number",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"ENTERPRISE_COST",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set an enterprise field value.
@param index field index
@param value field value | [
"Set",
"an",
"enterprise",
"field",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L2051-L2054 |
loldevs/riotapi | rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/PlayerStatsService.java | PlayerStatsService.retrievePlayerStatsByAccountId | public PlayerLifetimeStats retrievePlayerStatsByAccountId(long accountId, Season season) {
"""
Retrieve player stats
@param accountId The player's id
@param season The target season
@return Player stats
"""
return client.sendRpcAndWait(SERVICE, "retrievePlayerStatsByAccountId", accountId, season);
... | java | public PlayerLifetimeStats retrievePlayerStatsByAccountId(long accountId, Season season) {
return client.sendRpcAndWait(SERVICE, "retrievePlayerStatsByAccountId", accountId, season);
} | [
"public",
"PlayerLifetimeStats",
"retrievePlayerStatsByAccountId",
"(",
"long",
"accountId",
",",
"Season",
"season",
")",
"{",
"return",
"client",
".",
"sendRpcAndWait",
"(",
"SERVICE",
",",
"\"retrievePlayerStatsByAccountId\"",
",",
"accountId",
",",
"season",
")",
... | Retrieve player stats
@param accountId The player's id
@param season The target season
@return Player stats | [
"Retrieve",
"player",
"stats"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/PlayerStatsService.java#L53-L55 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java | RingBuffer.tryPublishEvents | public boolean tryPublishEvents(EventTranslatorVararg<E> translator, Object[]... args) {
"""
Allows a variable number of user supplied arguments per event.
@param translator The user specified translation for the event
@param args User supplied arguments, one Object[] per event.
@return true if the value was ... | java | public boolean tryPublishEvents(EventTranslatorVararg<E> translator, Object[]... args) {
return tryPublishEvents(translator, 0, args.length, args);
} | [
"public",
"boolean",
"tryPublishEvents",
"(",
"EventTranslatorVararg",
"<",
"E",
">",
"translator",
",",
"Object",
"[",
"]",
"...",
"args",
")",
"{",
"return",
"tryPublishEvents",
"(",
"translator",
",",
"0",
",",
"args",
".",
"length",
",",
"args",
")",
"... | Allows a variable number of user supplied arguments per event.
@param translator The user specified translation for the event
@param args User supplied arguments, one Object[] per event.
@return true if the value was published, false if there was insufficient capacity.
@see #publishEvents(com.lmax.disruptor.EventTrans... | [
"Allows",
"a",
"variable",
"number",
"of",
"user",
"supplied",
"arguments",
"per",
"event",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java#L787-L789 |
jamesagnew/hapi-fhir | restful-server-example/src/main/java/ca/uhn/example/provider/PatientResourceProvider.java | PatientResourceProvider.updatePatient | @Update()
public MethodOutcome updatePatient(@IdParam IdDt theId, @ResourceParam Patient thePatient) {
"""
The "@Update" annotation indicates that this method supports replacing an existing
resource (by ID) with a new instance of that resource.
@param theId
This is the ID of the patient to update
@param the... | java | @Update()
public MethodOutcome updatePatient(@IdParam IdDt theId, @ResourceParam Patient thePatient) {
validateResource(thePatient);
Long id;
try {
id = theId.getIdPartAsLong();
} catch (DataFormatException e) {
throw new InvalidRequestException("Invalid ID " + theId.getValue() + " - Must be numeric");
... | [
"@",
"Update",
"(",
")",
"public",
"MethodOutcome",
"updatePatient",
"(",
"@",
"IdParam",
"IdDt",
"theId",
",",
"@",
"ResourceParam",
"Patient",
"thePatient",
")",
"{",
"validateResource",
"(",
"thePatient",
")",
";",
"Long",
"id",
";",
"try",
"{",
"id",
"... | The "@Update" annotation indicates that this method supports replacing an existing
resource (by ID) with a new instance of that resource.
@param theId
This is the ID of the patient to update
@param thePatient
This is the actual resource to save
@return This method returns a "MethodOutcome" | [
"The",
"@Update",
"annotation",
"indicates",
"that",
"this",
"method",
"supports",
"replacing",
"an",
"existing",
"resource",
"(",
"by",
"ID",
")",
"with",
"a",
"new",
"instance",
"of",
"that",
"resource",
"."
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/restful-server-example/src/main/java/ca/uhn/example/provider/PatientResourceProvider.java#L225-L246 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/ExportApi.java | ExportApi.exportRequestAsync | public com.squareup.okhttp.Call exportRequestAsync(ExportRequestInfo exportRequestInfo, final ApiCallback<ExportRequestResponse> callback) throws ApiException {
"""
Create Export Request (asynchronously)
Export normalized messages. The following input combinations are supported:<br/><table><tr>&... | java | public com.squareup.okhttp.Call exportRequestAsync(ExportRequestInfo exportRequestInfo, final ApiCallback<ExportRequestResponse> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"exportRequestAsync",
"(",
"ExportRequestInfo",
"exportRequestInfo",
",",
"final",
"ApiCallback",
"<",
"ExportRequestResponse",
">",
"callback",
")",
"throws",
"ApiException",
"{",
"ProgressResponseBody",
"... | Create Export Request (asynchronously)
Export normalized messages. The following input combinations are supported:<br/><table><tr><th>Combination</th><th>Parameters</th><th>Description</th></tr><tr><td>Get by users</td><td>uids</td&g... | [
"Create",
"Export",
"Request",
"(",
"asynchronously",
")",
"Export",
"normalized",
"messages",
".",
"The",
"following",
"input",
"combinations",
"are",
"supported",
":",
"<",
";",
"br",
"/",
">",
";",
"<",
";",
"table>",
";",
"<",
";",
"tr>",
"... | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/ExportApi.java#L152-L177 |
cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java | XLogPDescriptor.getPresenceOfSulfat | private boolean getPresenceOfSulfat(IAtomContainer ac, IAtom atom) {
"""
Gets the presenceOfSulfat A-S(O2)-A attribute of the XLogPDescriptor object.
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The presenceOfSulfat [boolean]
"""
List<IAtom> n... | java | private boolean getPresenceOfSulfat(IAtomContainer ac, IAtom atom) {
List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
//org.openscience.cdk.interfaces.IAtom[] second = null;
//IBond bond = null;
//int counter = 0;
for (IAtom neighbour : neighbours) {
if (neigh... | [
"private",
"boolean",
"getPresenceOfSulfat",
"(",
"IAtomContainer",
"ac",
",",
"IAtom",
"atom",
")",
"{",
"List",
"<",
"IAtom",
">",
"neighbours",
"=",
"ac",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
";",
"//org.openscience.cdk.interfaces.IAtom[] second = null;"... | Gets the presenceOfSulfat A-S(O2)-A attribute of the XLogPDescriptor object.
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The presenceOfSulfat [boolean] | [
"Gets",
"the",
"presenceOfSulfat",
"A",
"-",
"S",
"(",
"O2",
")",
"-",
"A",
"attribute",
"of",
"the",
"XLogPDescriptor",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java#L1345-L1357 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/ResourceBundleMessagesGenerator.java | ResourceBundleMessagesGenerator.getFileMappings | protected List<FilePathMapping> getFileMappings(String path, GeneratorContext context, List<Locale> locales) {
"""
Returns the list of file path mapping associate to the resource bundles
locales
@param path
the resource path
@param context
the generator context
@param locales
the list of locales
@return ... | java | protected List<FilePathMapping> getFileMappings(String path, GeneratorContext context, List<Locale> locales) {
List<FilePathMapping> fMappings = new ArrayList<>();
String fileSuffix = PROPERTIES_FILE_SUFFIX;
String[] names = path.split(RESOURCE_BUNDLE_SEPARATOR);
for (String resourcePath : names) {
resou... | [
"protected",
"List",
"<",
"FilePathMapping",
">",
"getFileMappings",
"(",
"String",
"path",
",",
"GeneratorContext",
"context",
",",
"List",
"<",
"Locale",
">",
"locales",
")",
"{",
"List",
"<",
"FilePathMapping",
">",
"fMappings",
"=",
"new",
"ArrayList",
"<>... | Returns the list of file path mapping associate to the resource bundles
locales
@param path
the resource path
@param context
the generator context
@param locales
the list of locales
@return the list of file path mapping associate to the resource bundles
locales | [
"Returns",
"the",
"list",
"of",
"file",
"path",
"mapping",
"associate",
"to",
"the",
"resource",
"bundles",
"locales"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/ResourceBundleMessagesGenerator.java#L210-L237 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java | DatatypeConverter.printDurationTimeUnits | public static final BigInteger printDurationTimeUnits(Duration duration, boolean estimated) {
"""
Print duration time units.
@param duration Duration value
@param estimated is this an estimated duration
@return time units value
"""
// SF-329: null default required to keep Powerproject happy when imp... | java | public static final BigInteger printDurationTimeUnits(Duration duration, boolean estimated)
{
// SF-329: null default required to keep Powerproject happy when importing MSPDI files
TimeUnit units = duration == null ? PARENT_FILE.get().getProjectProperties().getDefaultDurationUnits() : duration.getUnits()... | [
"public",
"static",
"final",
"BigInteger",
"printDurationTimeUnits",
"(",
"Duration",
"duration",
",",
"boolean",
"estimated",
")",
"{",
"// SF-329: null default required to keep Powerproject happy when importing MSPDI files",
"TimeUnit",
"units",
"=",
"duration",
"==",
"null",... | Print duration time units.
@param duration Duration value
@param estimated is this an estimated duration
@return time units value | [
"Print",
"duration",
"time",
"units",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L994-L999 |
lessthanoptimal/ddogleg | src/org/ddogleg/nn/FactoryNearestNeighbor.java | FactoryNearestNeighbor.kdRandomForest | public static <P> NearestNeighbor<P> kdRandomForest( KdTreeDistance<P> distance ,
int maxNodesSearched , int numTrees , int numConsiderSplit ,
long randomSeed ) {
"""
Approximate {@link NearestNeighbor} search which uses a set of randomly generated K-D trees and a Best-Bin-First
s... | java | public static <P> NearestNeighbor<P> kdRandomForest( KdTreeDistance<P> distance ,
int maxNodesSearched , int numTrees , int numConsiderSplit ,
long randomSeed ) {
Random rand = new Random(randomSeed);
return new KdForestBbfSearch<>(numTrees,maxNodesSearched,distance,
new AxisS... | [
"public",
"static",
"<",
"P",
">",
"NearestNeighbor",
"<",
"P",
">",
"kdRandomForest",
"(",
"KdTreeDistance",
"<",
"P",
">",
"distance",
",",
"int",
"maxNodesSearched",
",",
"int",
"numTrees",
",",
"int",
"numConsiderSplit",
",",
"long",
"randomSeed",
")",
"... | Approximate {@link NearestNeighbor} search which uses a set of randomly generated K-D trees and a Best-Bin-First
search. Designed to work in high dimensional space. Distance measure is Euclidean squared.
@see KdForestBbfSearch
@see AxisSplitterMedian
@param distance Specifies how distance is computed between two poi... | [
"Approximate",
"{",
"@link",
"NearestNeighbor",
"}",
"search",
"which",
"uses",
"a",
"set",
"of",
"randomly",
"generated",
"K",
"-",
"D",
"trees",
"and",
"a",
"Best",
"-",
"Bin",
"-",
"First",
"search",
".",
"Designed",
"to",
"work",
"in",
"high",
"dimen... | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/nn/FactoryNearestNeighbor.java#L88-L96 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_summary_GET | public OvhDomainSummary domain_summary_GET(String domain) throws IOException {
"""
Summary for this domain
REST: GET /email/domain/{domain}/summary
@param domain [required] Name of your domain name
"""
String qPath = "/email/domain/{domain}/summary";
StringBuilder sb = path(qPath, domain);
String res... | java | public OvhDomainSummary domain_summary_GET(String domain) throws IOException {
String qPath = "/email/domain/{domain}/summary";
StringBuilder sb = path(qPath, domain);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhDomainSummary.class);
} | [
"public",
"OvhDomainSummary",
"domain_summary_GET",
"(",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/summary\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"domain",
")",
";",
"String",
... | Summary for this domain
REST: GET /email/domain/{domain}/summary
@param domain [required] Name of your domain name | [
"Summary",
"for",
"this",
"domain"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L1088-L1093 |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/MathService.java | MathService.intersectsLineSegment | public static boolean intersectsLineSegment(Coordinate a, Coordinate b, Coordinate c, Coordinate d) {
"""
Calculates whether or not 2 line-segments intersect. The definition we use is that line segments intersect if
they either cross or overlap. If they touch in 1 end point, they do not intersect. This definition... | java | public static boolean intersectsLineSegment(Coordinate a, Coordinate b, Coordinate c, Coordinate d) {
// check single-point segment: these never intersect
if ((a.getX() == b.getX() && a.getY() == b.getY()) || (c.getX() == d.getX() && c.getY() == d.getY())) {
return false;
}
double c1 = cross(a, c, a, b);
d... | [
"public",
"static",
"boolean",
"intersectsLineSegment",
"(",
"Coordinate",
"a",
",",
"Coordinate",
"b",
",",
"Coordinate",
"c",
",",
"Coordinate",
"d",
")",
"{",
"// check single-point segment: these never intersect",
"if",
"(",
"(",
"a",
".",
"getX",
"(",
")",
... | Calculates whether or not 2 line-segments intersect. The definition we use is that line segments intersect if
they either cross or overlap. If they touch in 1 end point, they do not intersect. This definition is most useful
for checking polygon validity, as touching rings in 1 point are allowed, but crossing or overlap... | [
"Calculates",
"whether",
"or",
"not",
"2",
"line",
"-",
"segments",
"intersect",
".",
"The",
"definition",
"we",
"use",
"is",
"that",
"line",
"segments",
"intersect",
"if",
"they",
"either",
"cross",
"or",
"overlap",
".",
"If",
"they",
"touch",
"in",
"1",
... | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/MathService.java#L41-L74 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/impl/StorageWriter.java | StorageWriter.checkFreeDiskSpace | private void checkFreeDiskSpace(List<File> inputFiles) {
"""
Fail if the size of the expected store file exceed 2/3rd of the free disk space
"""
//Check for free space
long usableSpace = 0;
long totalSize = 0;
for (File f : inputFiles) {
if (f.exists()) {
totalSize += f.length();
... | java | private void checkFreeDiskSpace(List<File> inputFiles) {
//Check for free space
long usableSpace = 0;
long totalSize = 0;
for (File f : inputFiles) {
if (f.exists()) {
totalSize += f.length();
usableSpace = f.getUsableSpace();
}
}
LOGGER.log(Level.INFO, "Total expecte... | [
"private",
"void",
"checkFreeDiskSpace",
"(",
"List",
"<",
"File",
">",
"inputFiles",
")",
"{",
"//Check for free space",
"long",
"usableSpace",
"=",
"0",
";",
"long",
"totalSize",
"=",
"0",
";",
"for",
"(",
"File",
"f",
":",
"inputFiles",
")",
"{",
"if",
... | Fail if the size of the expected store file exceed 2/3rd of the free disk space | [
"Fail",
"if",
"the",
"size",
"of",
"the",
"expected",
"store",
"file",
"exceed",
"2",
"/",
"3rd",
"of",
"the",
"free",
"disk",
"space"
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/impl/StorageWriter.java#L365-L382 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.zipFile | private static void zipFile(final File srcFile, final String destPath, final ZipOutputStream out) throws IOException {
"""
Adds a file to a ZIP output stream.
@param srcFile
File to add - Cannot be <code>null</code>.
@param destPath
Path to use for the file - May be <code>null</code> or empty.
@param out
D... | java | private static void zipFile(final File srcFile, final String destPath, final ZipOutputStream out) throws IOException {
final byte[] buf = new byte[1024];
try (final InputStream in = new BufferedInputStream(new FileInputStream(srcFile))) {
final ZipEntry zipEntry = new ZipEntry(concatPat... | [
"private",
"static",
"void",
"zipFile",
"(",
"final",
"File",
"srcFile",
",",
"final",
"String",
"destPath",
",",
"final",
"ZipOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"1024",
"]",
... | Adds a file to a ZIP output stream.
@param srcFile
File to add - Cannot be <code>null</code>.
@param destPath
Path to use for the file - May be <code>null</code> or empty.
@param out
Destination stream - Cannot be <code>null</code>.
@throws IOException
Error writing to the output stream. | [
"Adds",
"a",
"file",
"to",
"a",
"ZIP",
"output",
"stream",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1297-L1310 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.endFinalizerGaps | void endFinalizerGaps(Env<GenContext> from, Env<GenContext> to) {
"""
Mark end of all gaps in catch-all ranges for finalizers of environments
lying between, and including to two environments.
@param from the most deeply nested environment to mark
@param to the least deeply nested environment to mark
... | java | void endFinalizerGaps(Env<GenContext> from, Env<GenContext> to) {
Env<GenContext> last = null;
while (last != to) {
endFinalizerGap(from);
last = from;
from = from.next;
}
} | [
"void",
"endFinalizerGaps",
"(",
"Env",
"<",
"GenContext",
">",
"from",
",",
"Env",
"<",
"GenContext",
">",
"to",
")",
"{",
"Env",
"<",
"GenContext",
">",
"last",
"=",
"null",
";",
"while",
"(",
"last",
"!=",
"to",
")",
"{",
"endFinalizerGap",
"(",
"... | Mark end of all gaps in catch-all ranges for finalizers of environments
lying between, and including to two environments.
@param from the most deeply nested environment to mark
@param to the least deeply nested environment to mark | [
"Mark",
"end",
"of",
"all",
"gaps",
"in",
"catch",
"-",
"all",
"ranges",
"for",
"finalizers",
"of",
"environments",
"lying",
"between",
"and",
"including",
"to",
"two",
"environments",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java#L372-L379 |
eyp/serfj | src/main/java/net/sf/serfj/ServletHelper.java | ServletHelper.methodExists | private Method methodExists(Class<?> clazz, String method, Class<?>[] params) {
"""
Checks if a class method exists.
@param clazz
Class.
@param method
Method.
@param params
Method's params.
@return the method, or null if it doesn't exist.
"""
try {
return clazz.getMethod(method, params);
} catc... | java | private Method methodExists(Class<?> clazz, String method, Class<?>[] params) {
try {
return clazz.getMethod(method, params);
} catch (NoSuchMethodException e) {
return null;
}
} | [
"private",
"Method",
"methodExists",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"method",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"params",
")",
"{",
"try",
"{",
"return",
"clazz",
".",
"getMethod",
"(",
"method",
",",
"params",
")",
";",
... | Checks if a class method exists.
@param clazz
Class.
@param method
Method.
@param params
Method's params.
@return the method, or null if it doesn't exist. | [
"Checks",
"if",
"a",
"class",
"method",
"exists",
"."
] | train | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/ServletHelper.java#L116-L122 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/TypeDescriptor.java | TypeDescriptor.getByDescriptor | public MethodMember getByDescriptor(String name, String descriptor) {
"""
Check if this descriptor defines a method with the specified name and descriptor. Return the method if it is
found. Modifiers, generic signature and exceptions are ignored in this search.
@param name the member name
@param descriptor th... | java | public MethodMember getByDescriptor(String name, String descriptor) {
for (MethodMember existingMethod : methods) {
if (existingMethod.getName().equals(name) && existingMethod.getDescriptor().equals(descriptor)) {
return existingMethod;
}
}
return null;
} | [
"public",
"MethodMember",
"getByDescriptor",
"(",
"String",
"name",
",",
"String",
"descriptor",
")",
"{",
"for",
"(",
"MethodMember",
"existingMethod",
":",
"methods",
")",
"{",
"if",
"(",
"existingMethod",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"nam... | Check if this descriptor defines a method with the specified name and descriptor. Return the method if it is
found. Modifiers, generic signature and exceptions are ignored in this search.
@param name the member name
@param descriptor the member descriptor (e.g. (Ljava/lang/String;)I)
@return the MethodMember if there ... | [
"Check",
"if",
"this",
"descriptor",
"defines",
"a",
"method",
"with",
"the",
"specified",
"name",
"and",
"descriptor",
".",
"Return",
"the",
"method",
"if",
"it",
"is",
"found",
".",
"Modifiers",
"generic",
"signature",
"and",
"exceptions",
"are",
"ignored",
... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/TypeDescriptor.java#L182-L189 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfLayer.java | PdfLayer.setLanguage | public void setLanguage(String lang, boolean preferred) {
"""
Specifies the language of the content controlled by this
optional content group
@param lang a language string which specifies a language and possibly a locale
(for example, <B>es-MX</B> represents Mexican Spanish)
@param preferred used by viewer app... | java | public void setLanguage(String lang, boolean preferred) {
PdfDictionary usage = getUsage();
PdfDictionary dic = new PdfDictionary();
dic.put(PdfName.LANG, new PdfString(lang, PdfObject.TEXT_UNICODE));
if (preferred)
dic.put(PdfName.PREFERRED, PdfName.ON);
usage.put(Pd... | [
"public",
"void",
"setLanguage",
"(",
"String",
"lang",
",",
"boolean",
"preferred",
")",
"{",
"PdfDictionary",
"usage",
"=",
"getUsage",
"(",
")",
";",
"PdfDictionary",
"dic",
"=",
"new",
"PdfDictionary",
"(",
")",
";",
"dic",
".",
"put",
"(",
"PdfName",
... | Specifies the language of the content controlled by this
optional content group
@param lang a language string which specifies a language and possibly a locale
(for example, <B>es-MX</B> represents Mexican Spanish)
@param preferred used by viewer applications when there is a partial match but no exact
match between the ... | [
"Specifies",
"the",
"language",
"of",
"the",
"content",
"controlled",
"by",
"this",
"optional",
"content",
"group"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfLayer.java#L222-L229 |
apache/incubator-gobblin | gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java | KafkaUtils.containsPartitionAvgRecordMillis | public static boolean containsPartitionAvgRecordMillis(State state, KafkaPartition partition) {
"""
Determines whether the given {@link State} contains "[topicname].[partitionid].avg.record.millis".
"""
return state.contains(
getPartitionPropName(partition.getTopicName(), partition.getId()) + "." +... | java | public static boolean containsPartitionAvgRecordMillis(State state, KafkaPartition partition) {
return state.contains(
getPartitionPropName(partition.getTopicName(), partition.getId()) + "." + KafkaSource.AVG_RECORD_MILLIS);
} | [
"public",
"static",
"boolean",
"containsPartitionAvgRecordMillis",
"(",
"State",
"state",
",",
"KafkaPartition",
"partition",
")",
"{",
"return",
"state",
".",
"contains",
"(",
"getPartitionPropName",
"(",
"partition",
".",
"getTopicName",
"(",
")",
",",
"partition"... | Determines whether the given {@link State} contains "[topicname].[partitionid].avg.record.millis". | [
"Determines",
"whether",
"the",
"given",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java#L137-L140 |
code4everything/util | src/main/java/com/zhazhapan/util/RandomUtils.java | RandomUtils.getRandomIntegerIgnoreRange | public static int getRandomIntegerIgnoreRange(int floor, int ceil, int[]... ranges) {
"""
获取忽略多个区间段的随机整数
@param floor 下限
@param ceil 上限
@param ranges 忽略区间(包含下限和上限长度为2的一维数组),可以有多个忽略区间
@return {@link Integer}
"""
int result = getRandomInteger(floor, ceil);
for (int[] range : ranges) {
... | java | public static int getRandomIntegerIgnoreRange(int floor, int ceil, int[]... ranges) {
int result = getRandomInteger(floor, ceil);
for (int[] range : ranges) {
if (range[0] <= result && result <= range[1]) {
if (range[0] > floor) {
result = getRandomInteger... | [
"public",
"static",
"int",
"getRandomIntegerIgnoreRange",
"(",
"int",
"floor",
",",
"int",
"ceil",
",",
"int",
"[",
"]",
"...",
"ranges",
")",
"{",
"int",
"result",
"=",
"getRandomInteger",
"(",
"floor",
",",
"ceil",
")",
";",
"for",
"(",
"int",
"[",
"... | 获取忽略多个区间段的随机整数
@param floor 下限
@param ceil 上限
@param ranges 忽略区间(包含下限和上限长度为2的一维数组),可以有多个忽略区间
@return {@link Integer} | [
"获取忽略多个区间段的随机整数"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/RandomUtils.java#L194-L208 |
JosePaumard/streams-utils | src/main/java/org/paumard/streams/StreamsUtils.java | StreamsUtils.filteringMaxValues | public static <E extends Comparable<? super E>> Stream<E> filteringMaxValues(Stream<E> stream, int numberOfMaxes) {
"""
<p>Generates a stream composed of the N greatest values of the provided stream, compared using the
natural order. This method calls the <code>filteringMaxValues()</code> with the natural order c... | java | public static <E extends Comparable<? super E>> Stream<E> filteringMaxValues(Stream<E> stream, int numberOfMaxes) {
return filteringMaxValues(stream, numberOfMaxes, Comparator.naturalOrder());
} | [
"public",
"static",
"<",
"E",
"extends",
"Comparable",
"<",
"?",
"super",
"E",
">",
">",
"Stream",
"<",
"E",
">",
"filteringMaxValues",
"(",
"Stream",
"<",
"E",
">",
"stream",
",",
"int",
"numberOfMaxes",
")",
"{",
"return",
"filteringMaxValues",
"(",
"s... | <p>Generates a stream composed of the N greatest values of the provided stream, compared using the
natural order. This method calls the <code>filteringMaxValues()</code> with the natural order comparator,
please refer to this javadoc for details. . </p>
<p>A <code>NullPointerException</code> will be thrown if the provi... | [
"<p",
">",
"Generates",
"a",
"stream",
"composed",
"of",
"the",
"N",
"greatest",
"values",
"of",
"the",
"provided",
"stream",
"compared",
"using",
"the",
"natural",
"order",
".",
"This",
"method",
"calls",
"the",
"<code",
">",
"filteringMaxValues",
"()",
"<"... | train | https://github.com/JosePaumard/streams-utils/blob/56152574af0aca44c5f679761202a8f90984ab73/src/main/java/org/paumard/streams/StreamsUtils.java#L1007-L1010 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.recoverDeletedStorageAccount | public StorageBundle recoverDeletedStorageAccount(String vaultBaseUrl, String storageAccountName) {
"""
Recovers the deleted storage account.
Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recove... | java | public StorageBundle recoverDeletedStorageAccount(String vaultBaseUrl, String storageAccountName) {
return recoverDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body();
} | [
"public",
"StorageBundle",
"recoverDeletedStorageAccount",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
")",
"{",
"return",
"recoverDeletedStorageAccountWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"storageAccountName",
")",
".",
"toBlocking",
"... | Recovers the deleted storage account.
Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storage... | [
"Recovers",
"the",
"deleted",
"storage",
"account",
".",
"Recovers",
"the",
"deleted",
"storage",
"account",
"in",
"the",
"specified",
"vault",
".",
"This",
"operation",
"can",
"only",
"be",
"performed",
"on",
"a",
"soft",
"-",
"delete",
"enabled",
"vault",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L9432-L9434 |
javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MCsvWriter.java | MCsvWriter.formatCsv | protected String formatCsv(final String text, final char csvSeparator) {
"""
Encode un texte pour l'export au format csv ou csv local.
@return String
@param text
String
@param csvSeparator
char
"""
String result = text;
if (result.indexOf('\n') != -1) {
// le retour chariot fonctionne dans les... | java | protected String formatCsv(final String text, final char csvSeparator) {
String result = text;
if (result.indexOf('\n') != -1) {
// le retour chariot fonctionne dans les dernières versions d'excel entre des doubles quotes
// mais il ne fonctionne pas dans OpenOffice 1.1.2
result = result.replace('\n',... | [
"protected",
"String",
"formatCsv",
"(",
"final",
"String",
"text",
",",
"final",
"char",
"csvSeparator",
")",
"{",
"String",
"result",
"=",
"text",
";",
"if",
"(",
"result",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"{",
"// le retour c... | Encode un texte pour l'export au format csv ou csv local.
@return String
@param text
String
@param csvSeparator
char | [
"Encode",
"un",
"texte",
"pour",
"l",
"export",
"au",
"format",
"csv",
"ou",
"csv",
"local",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MCsvWriter.java#L84-L102 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.beginPowerOffAsync | public Observable<OperationStatusResponseInner> beginPowerOffAsync(String resourceGroupName, String vmScaleSetName) {
"""
Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resourc... | java | public Observable<OperationStatusResponseInner> beginPowerOffAsync(String resourceGroupName, String vmScaleSetName) {
return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Overri... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"beginPowerOffAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"beginPowerOffWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
".... | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale ... | [
"Power",
"off",
"(",
"stop",
")",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
".",
"Note",
"that",
"resources",
"are",
"still",
"attached",
"and",
"you",
"are",
"getting",
"charged",
"for",
"the",
"resources",
".",
"Inste... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1901-L1908 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/AbstractLongIntMap.java | AbstractLongIntMap.pairsMatching | public void pairsMatching(final LongIntProcedure condition, final LongArrayList keyList, final IntArrayList valueList) {
"""
Fills all pairs satisfying a given condition into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists both have a new size, the numb... | java | public void pairsMatching(final LongIntProcedure condition, final LongArrayList keyList, final IntArrayList valueList) {
keyList.clear();
valueList.clear();
forEachPair(
new LongIntProcedure() {
public boolean apply(long key, int value) {
if (condition.apply(key,value)) {
keyList.add(key);
... | [
"public",
"void",
"pairsMatching",
"(",
"final",
"LongIntProcedure",
"condition",
",",
"final",
"LongArrayList",
"keyList",
",",
"final",
"IntArrayList",
"valueList",
")",
"{",
"keyList",
".",
"clear",
"(",
")",
";",
"valueList",
".",
"clear",
"(",
")",
";",
... | Fills all pairs satisfying a given condition into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists both have a new size, the number of pairs satisfying the condition.
Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link #forEa... | [
"Fills",
"all",
"pairs",
"satisfying",
"a",
"given",
"condition",
"into",
"the",
"specified",
"lists",
".",
"Fills",
"into",
"the",
"lists",
"starting",
"at",
"index",
"0",
".",
"After",
"this",
"call",
"returns",
"the",
"specified",
"lists",
"both",
"have",... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractLongIntMap.java#L254-L269 |
jamesagnew/hapi-fhir | hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerManager.java | FhirServerManager.unregisterFhirProviders | public void unregisterFhirProviders (FhirProviderBundle bundle, Map<String,Object> props) throws FhirConfigurationException {
"""
This method will be called when a FHIR Provider OSGi service
is being removed from the container. This normally will only
occur when its bundle is stopped because it is being removed
... | java | public void unregisterFhirProviders (FhirProviderBundle bundle, Map<String,Object> props) throws FhirConfigurationException {
if (bundle != null) {
Collection<Object> providers = bundle.getProviders();
if (providers != null && !providers.isEmpty()) {
try {
registeredProviders.remove(providers);
St... | [
"public",
"void",
"unregisterFhirProviders",
"(",
"FhirProviderBundle",
"bundle",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"throws",
"FhirConfigurationException",
"{",
"if",
"(",
"bundle",
"!=",
"null",
")",
"{",
"Collection",
"<",
"Object",
... | This method will be called when a FHIR Provider OSGi service
is being removed from the container. This normally will only
occur when its bundle is stopped because it is being removed
or updated.
@param server OSGi service implementing one of the provider
interfaces
@param props the <service-properties> for that servic... | [
"This",
"method",
"will",
"be",
"called",
"when",
"a",
"FHIR",
"Provider",
"OSGi",
"service",
"is",
"being",
"removed",
"from",
"the",
"container",
".",
"This",
"normally",
"will",
"only",
"occur",
"when",
"its",
"bundle",
"is",
"stopped",
"because",
"it",
... | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerManager.java#L248-L271 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/WWindowInterceptor.java | WWindowInterceptor.serviceRequest | @Override
public void serviceRequest(final Request request) {
"""
Temporarily replaces the environment while the request is being handled.
@param request the request being responded to.
"""
// Get window id off the request
windowId = request.getParameter(WWindow.WWINDOW_REQUEST_PARAM_KEY);
if (windo... | java | @Override
public void serviceRequest(final Request request) {
// Get window id off the request
windowId = request.getParameter(WWindow.WWINDOW_REQUEST_PARAM_KEY);
if (windowId == null) {
super.serviceRequest(request);
} else {
// Get the window component
ComponentWithContext target = WebUtilities.get... | [
"@",
"Override",
"public",
"void",
"serviceRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"// Get window id off the request",
"windowId",
"=",
"request",
".",
"getParameter",
"(",
"WWindow",
".",
"WWINDOW_REQUEST_PARAM_KEY",
")",
";",
"if",
"(",
"windowId",... | Temporarily replaces the environment while the request is being handled.
@param request the request being responded to. | [
"Temporarily",
"replaces",
"the",
"environment",
"while",
"the",
"request",
"is",
"being",
"handled",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/WWindowInterceptor.java#L53-L83 |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.jasper.el/src/org/apache/el/lang/ELSupport.java | ELSupport.coerceToString | public static final String coerceToString(final ELContext ctx, final Object obj) {
"""
Coerce an object to a string.
@param ctx the context in which this conversion is taking place
@param obj the object to convert
@return the String value of the object
"""
if (ctx != null) {
boolean origina... | java | public static final String coerceToString(final ELContext ctx, final Object obj) {
if (ctx != null) {
boolean originalIsPropertyResolved = ctx.isPropertyResolved();
try {
Object result = ctx.getELResolver().convertToType(ctx, obj, String.class);
if (ctx.isPropertyResolved()... | [
"public",
"static",
"final",
"String",
"coerceToString",
"(",
"final",
"ELContext",
"ctx",
",",
"final",
"Object",
"obj",
")",
"{",
"if",
"(",
"ctx",
"!=",
"null",
")",
"{",
"boolean",
"originalIsPropertyResolved",
"=",
"ctx",
".",
"isPropertyResolved",
"(",
... | Coerce an object to a string.
@param ctx the context in which this conversion is taking place
@param obj the object to convert
@return the String value of the object | [
"Coerce",
"an",
"object",
"to",
"a",
"string",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.jasper.el/src/org/apache/el/lang/ELSupport.java#L577-L599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.