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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/URI.java | URI.setScheme | public void setScheme(String p_scheme) throws MalformedURIException {
"""
Set the scheme for this URI. The scheme is converted to lowercase
before it is set.
@param p_scheme the scheme for this URI (cannot be null)
@throws MalformedURIException if p_scheme is not a conformant
scheme name
"""
if (p... | java | public void setScheme(String p_scheme) throws MalformedURIException
{
if (p_scheme == null)
{
throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!");
}
if (!isConformantSchemeName(p_scheme))
{
t... | [
"public",
"void",
"setScheme",
"(",
"String",
"p_scheme",
")",
"throws",
"MalformedURIException",
"{",
"if",
"(",
"p_scheme",
"==",
"null",
")",
"{",
"throw",
"new",
"MalformedURIException",
"(",
"Utils",
".",
"messages",
".",
"createMessage",
"(",
"MsgKey",
"... | Set the scheme for this URI. The scheme is converted to lowercase
before it is set.
@param p_scheme the scheme for this URI (cannot be null)
@throws MalformedURIException if p_scheme is not a conformant
scheme name | [
"Set",
"the",
"scheme",
"for",
"this",
"URI",
".",
"The",
"scheme",
"is",
"converted",
"to",
"lowercase",
"before",
"it",
"is",
"set",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/URI.java#L1016-L1030 |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsReport.java | CmsReport.pageHtml | public String pageHtml(int segment, boolean loadStyles) {
"""
Builds the start html of the page, including setting of DOCTYPE and
inserting a header with the content-type.<p>
This overloads the default method of the parent class.<p>
@param segment the HTML segment (START / END)
@param loadStyles if true, t... | java | public String pageHtml(int segment, boolean loadStyles) {
if (useNewStyle()) {
return super.pageHtml(segment, null, getParamTitle());
}
if (segment == HTML_START) {
StringBuffer result = new StringBuffer(512);
result.append("<!DOCTYPE html>\n");
r... | [
"public",
"String",
"pageHtml",
"(",
"int",
"segment",
",",
"boolean",
"loadStyles",
")",
"{",
"if",
"(",
"useNewStyle",
"(",
")",
")",
"{",
"return",
"super",
".",
"pageHtml",
"(",
"segment",
",",
"null",
",",
"getParamTitle",
"(",
")",
")",
";",
"}",... | Builds the start html of the page, including setting of DOCTYPE and
inserting a header with the content-type.<p>
This overloads the default method of the parent class.<p>
@param segment the HTML segment (START / END)
@param loadStyles if true, the defaul style sheet will be loaded
@return the start html of the page | [
"Builds",
"the",
"start",
"html",
"of",
"the",
"page",
"including",
"setting",
"of",
"DOCTYPE",
"and",
"inserting",
"a",
"header",
"with",
"the",
"content",
"-",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsReport.java#L461-L486 |
encoway/edu | edu/src/main/java/com/encoway/edu/Components.java | Components.getFullyQualifiedComponentId | static String getFullyQualifiedComponentId(FacesContext context, UIComponent component, boolean absolute) {
"""
Returns the fully qualified (absolute) ID of {@code component}.
@param context a {@link FacesContext}
@param component {@link UIComponent} to return the ID for
@param absolute if {@code true} {@link... | java | static String getFullyQualifiedComponentId(FacesContext context, UIComponent component, boolean absolute) {
if (component == null) {
return null;
}
char separatorChar = getSeparatorChar(context);
String fqid = component.getId();
while (component.getParent() != null)... | [
"static",
"String",
"getFullyQualifiedComponentId",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
",",
"boolean",
"absolute",
")",
"{",
"if",
"(",
"component",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"char",
"separatorChar",
"=",
... | Returns the fully qualified (absolute) ID of {@code component}.
@param context a {@link FacesContext}
@param component {@link UIComponent} to return the ID for
@param absolute if {@code true} {@link UINamingContainer#getSeparatorChar(FacesContext)} is prepended (to indicate an absolute path)
@return a fully qualified ... | [
"Returns",
"the",
"fully",
"qualified",
"(",
"absolute",
")",
"ID",
"of",
"{",
"@code",
"component",
"}",
"."
] | train | https://github.com/encoway/edu/blob/52ae92b2207f7d5668e212904359fbeb360f3f05/edu/src/main/java/com/encoway/edu/Components.java#L50-L67 |
google/gson | extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java | RuntimeTypeAdapterFactory.registerSubtype | public RuntimeTypeAdapterFactory<T> registerSubtype(Class<? extends T> type) {
"""
Registers {@code type} identified by its {@link Class#getSimpleName simple
name}. Labels are case sensitive.
@throws IllegalArgumentException if either {@code type} or its simple name
have already been registered on this type a... | java | public RuntimeTypeAdapterFactory<T> registerSubtype(Class<? extends T> type) {
return registerSubtype(type, type.getSimpleName());
} | [
"public",
"RuntimeTypeAdapterFactory",
"<",
"T",
">",
"registerSubtype",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"type",
")",
"{",
"return",
"registerSubtype",
"(",
"type",
",",
"type",
".",
"getSimpleName",
"(",
")",
")",
";",
"}"
] | Registers {@code type} identified by its {@link Class#getSimpleName simple
name}. Labels are case sensitive.
@throws IllegalArgumentException if either {@code type} or its simple name
have already been registered on this type adapter. | [
"Registers",
"{",
"@code",
"type",
"}",
"identified",
"by",
"its",
"{",
"@link",
"Class#getSimpleName",
"simple",
"name",
"}",
".",
"Labels",
"are",
"case",
"sensitive",
"."
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java#L191-L193 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java | ReferenceCountedOpenSslContext.toBIO | static long toBIO(ByteBufAllocator allocator, X509Certificate... certChain) throws Exception {
"""
Return the pointer to a <a href="https://www.openssl.org/docs/crypto/BIO_get_mem_ptr.html">in-memory BIO</a>
or {@code 0} if the {@code certChain} is {@code null}. The BIO contains the content of the {@code certChai... | java | static long toBIO(ByteBufAllocator allocator, X509Certificate... certChain) throws Exception {
if (certChain == null) {
return 0;
}
if (certChain.length == 0) {
throw new IllegalArgumentException("certChain can't be empty");
}
PemEncoded pem = PemX509Cer... | [
"static",
"long",
"toBIO",
"(",
"ByteBufAllocator",
"allocator",
",",
"X509Certificate",
"...",
"certChain",
")",
"throws",
"Exception",
"{",
"if",
"(",
"certChain",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"certChain",
".",
"length",
"=... | Return the pointer to a <a href="https://www.openssl.org/docs/crypto/BIO_get_mem_ptr.html">in-memory BIO</a>
or {@code 0} if the {@code certChain} is {@code null}. The BIO contains the content of the {@code certChain}. | [
"Return",
"the",
"pointer",
"to",
"a",
"<a",
"href",
"=",
"https",
":",
"//",
"www",
".",
"openssl",
".",
"org",
"/",
"docs",
"/",
"crypto",
"/",
"BIO_get_mem_ptr",
".",
"html",
">",
"in",
"-",
"memory",
"BIO<",
"/",
"a",
">",
"or",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java#L833-L848 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/template/TemplateMatching.java | TemplateMatching.setTemplate | public void setTemplate(T template, T mask , int maxMatches) {
"""
Specifies the template to search for and the maximum number of matches to return.
@param template Template being searched for
@param mask Optional mask. Same size as template. 0 = pixel is transparent, values larger than zero
determi... | java | public void setTemplate(T template, T mask , int maxMatches) {
this.template = template;
this.mask = mask;
this.maxMatches = maxMatches;
} | [
"public",
"void",
"setTemplate",
"(",
"T",
"template",
",",
"T",
"mask",
",",
"int",
"maxMatches",
")",
"{",
"this",
".",
"template",
"=",
"template",
";",
"this",
".",
"mask",
"=",
"mask",
";",
"this",
".",
"maxMatches",
"=",
"maxMatches",
";",
"}"
] | Specifies the template to search for and the maximum number of matches to return.
@param template Template being searched for
@param mask Optional mask. Same size as template. 0 = pixel is transparent, values larger than zero
determine how influential the pixel is. Can be null.
@param maxMatches The maximum... | [
"Specifies",
"the",
"template",
"to",
"search",
"for",
"and",
"the",
"maximum",
"number",
"of",
"matches",
"to",
"return",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/template/TemplateMatching.java#L92-L96 |
selenide/selenide | src/main/java/com/codeborne/selenide/SelenideTargetLocator.java | SelenideTargetLocator.windowByTitle | protected static WebDriver windowByTitle(WebDriver driver, String title) {
"""
Switch to window/tab by name/handle/title except some windows handles
@param title title of window/tab
"""
Set<String> windowHandles = driver.getWindowHandles();
for (String windowHandle : windowHandles) {
driver.swi... | java | protected static WebDriver windowByTitle(WebDriver driver, String title) {
Set<String> windowHandles = driver.getWindowHandles();
for (String windowHandle : windowHandles) {
driver.switchTo().window(windowHandle);
if (title.equals(driver.getTitle())) {
return driver;
}
}
throw... | [
"protected",
"static",
"WebDriver",
"windowByTitle",
"(",
"WebDriver",
"driver",
",",
"String",
"title",
")",
"{",
"Set",
"<",
"String",
">",
"windowHandles",
"=",
"driver",
".",
"getWindowHandles",
"(",
")",
";",
"for",
"(",
"String",
"windowHandle",
":",
"... | Switch to window/tab by name/handle/title except some windows handles
@param title title of window/tab | [
"Switch",
"to",
"window",
"/",
"tab",
"by",
"name",
"/",
"handle",
"/",
"title",
"except",
"some",
"windows",
"handles"
] | train | https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/SelenideTargetLocator.java#L207-L217 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.listPipelines | public ListPipelinesResponse listPipelines(ListPipelinesRequest request) {
"""
List all your pipelines.
@param request The request object containing all options for listing all pipelines.
@return The list of all your pipelines
"""
checkNotNull(request, "The parameter request should NOT be null.")... | java | public ListPipelinesResponse listPipelines(ListPipelinesRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, PIPELINE);
return invokeHttpClient(internalRequest, ListPipelinesResponse.cl... | [
"public",
"ListPipelinesResponse",
"listPipelines",
"(",
"ListPipelinesRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"createRequest",
"(",
"HttpMethodNa... | List all your pipelines.
@param request The request object containing all options for listing all pipelines.
@return The list of all your pipelines | [
"List",
"all",
"your",
"pipelines",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L606-L610 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/report/AnalysisScreen.java | AnalysisScreen.getBasisField | public BaseField getBasisField(BaseField fldSummary, Record recBasis, int iSummarySeq) {
"""
Get the matching basis field given the summary field.
Override this if you don't want the defaults.
@param fldSummary The summary field to match.
@param recBasic The basis record.
@param iSummarySeq The position in the... | java | public BaseField getBasisField(BaseField fldSummary, Record recBasis, int iSummarySeq)
{
BaseField fldBasis = null;
String strFieldName = fldSummary.getFieldName();
if ((strFieldName != null) && (strFieldName.indexOf('.') != -1))
{
Record record = this.getRecord(strFieldN... | [
"public",
"BaseField",
"getBasisField",
"(",
"BaseField",
"fldSummary",
",",
"Record",
"recBasis",
",",
"int",
"iSummarySeq",
")",
"{",
"BaseField",
"fldBasis",
"=",
"null",
";",
"String",
"strFieldName",
"=",
"fldSummary",
".",
"getFieldName",
"(",
")",
";",
... | Get the matching basis field given the summary field.
Override this if you don't want the defaults.
@param fldSummary The summary field to match.
@param recBasic The basis record.
@param iSummarySeq The position in the summary record.
@return The basis field. | [
"Get",
"the",
"matching",
"basis",
"field",
"given",
"the",
"summary",
"field",
".",
"Override",
"this",
"if",
"you",
"don",
"t",
"want",
"the",
"defaults",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/report/AnalysisScreen.java#L297-L311 |
alexvasilkov/AndroidCommons | library/src/main/java/com/alexvasilkov/android/commons/converters/ConvertUtils.java | ConvertUtils.convert | public static <T extends Enum<T>> T convert(Class<T> type, String name, T defaultValue) {
"""
Searches for enum of given class with given name (case insensitive).
@param type Enum class
@param name Enum constant name
@param defaultValue Default value if no enum constant with given name is found
"""
... | java | public static <T extends Enum<T>> T convert(Class<T> type, String name, T defaultValue) {
if (name == null) {
return defaultValue;
}
for (T e : type.getEnumConstants()) {
if (e.name().equalsIgnoreCase(name)) {
return e;
}
}
re... | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"convert",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"name",
",",
"T",
"defaultValue",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"defaultValue"... | Searches for enum of given class with given name (case insensitive).
@param type Enum class
@param name Enum constant name
@param defaultValue Default value if no enum constant with given name is found | [
"Searches",
"for",
"enum",
"of",
"given",
"class",
"with",
"given",
"name",
"(",
"case",
"insensitive",
")",
"."
] | train | https://github.com/alexvasilkov/AndroidCommons/blob/aca9f6d5acfc6bd3694984b7f89956e1a0146ddb/library/src/main/java/com/alexvasilkov/android/commons/converters/ConvertUtils.java#L107-L119 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java | ResourceBundlesHandlerImpl.storeBundle | private void storeBundle(String bundleId, JoinableResourceBundleContent store) {
"""
Store the bundle
@param bundleId
the bundle Id to store
@param store
the bundle
"""
stopProcessIfNeeded();
if (bundleMustBeProcessedInLive(store.getContent().toString())) {
liveProcessBundles.add(bundleId);
}
... | java | private void storeBundle(String bundleId, JoinableResourceBundleContent store) {
stopProcessIfNeeded();
if (bundleMustBeProcessedInLive(store.getContent().toString())) {
liveProcessBundles.add(bundleId);
}
resourceBundleHandler.storeBundle(bundleId, store);
} | [
"private",
"void",
"storeBundle",
"(",
"String",
"bundleId",
",",
"JoinableResourceBundleContent",
"store",
")",
"{",
"stopProcessIfNeeded",
"(",
")",
";",
"if",
"(",
"bundleMustBeProcessedInLive",
"(",
"store",
".",
"getContent",
"(",
")",
".",
"toString",
"(",
... | Store the bundle
@param bundleId
the bundle Id to store
@param store
the bundle | [
"Store",
"the",
"bundle"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java#L1263-L1271 |
micronaut-projects/micronaut-core | views/src/main/java/io/micronaut/views/ViewUtils.java | ViewUtils.normalizeFile | @Nonnull
public static String normalizeFile(@Nonnull String path, String extension) {
"""
Returns a path that is converted to unix style file separators
and never starts with a "/". If an extension is provided and the
path ends with the extension, the extension will be stripped.
The extension parameter supp... | java | @Nonnull
public static String normalizeFile(@Nonnull String path, String extension) {
path = path.replace("\\", "/");
if (path.startsWith("/")) {
path = path.substring(1);
}
if (extension != null && !extension.startsWith(".")) {
extension = "." + extension;
... | [
"@",
"Nonnull",
"public",
"static",
"String",
"normalizeFile",
"(",
"@",
"Nonnull",
"String",
"path",
",",
"String",
"extension",
")",
"{",
"path",
"=",
"path",
".",
"replace",
"(",
"\"\\\\\"",
",",
"\"/\"",
")",
";",
"if",
"(",
"path",
".",
"startsWith"... | Returns a path that is converted to unix style file separators
and never starts with a "/". If an extension is provided and the
path ends with the extension, the extension will be stripped.
The extension parameter supports extensions that do and do not
begin with a ".".
@param path The path to normalizeFile
@param ext... | [
"Returns",
"a",
"path",
"that",
"is",
"converted",
"to",
"unix",
"style",
"file",
"separators",
"and",
"never",
"starts",
"with",
"a",
"/",
".",
"If",
"an",
"extension",
"is",
"provided",
"and",
"the",
"path",
"ends",
"with",
"the",
"extension",
"the",
"... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/views/src/main/java/io/micronaut/views/ViewUtils.java#L61-L75 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/returns/PackageUrl.java | PackageUrl.getPackageLabelUrl | public static MozuUrl getPackageLabelUrl(String packageId, Boolean returnAsBase64Png, String returnId) {
"""
Get Resource Url for GetPackageLabel
@param packageId Unique identifier of the package for which to retrieve the label.
@param returnAsBase64Png Specifies whether to return the RMA label image as Base64-e... | java | public static MozuUrl getPackageLabelUrl(String packageId, Boolean returnAsBase64Png, String returnId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/returns/{returnId}/packages/{packageId}/label?returnAsBase64Png={returnAsBase64Png}");
formatter.formatUrl("packageId", packageId);
formatter.forma... | [
"public",
"static",
"MozuUrl",
"getPackageLabelUrl",
"(",
"String",
"packageId",
",",
"Boolean",
"returnAsBase64Png",
",",
"String",
"returnId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/returns/{returnId}/packages/{packageId}/... | Get Resource Url for GetPackageLabel
@param packageId Unique identifier of the package for which to retrieve the label.
@param returnAsBase64Png Specifies whether to return the RMA label image as Base64-encoded PNG image instead of as a byte array encoded in the original image format. The default is .
@param returnId U... | [
"Get",
"Resource",
"Url",
"for",
"GetPackageLabel"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/returns/PackageUrl.java#L23-L30 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4ClientConnection.java | JDBC4ClientConnection.executeAsync | public boolean executeAsync(ProcedureCallback callback, String procedure, Object... parameters)
throws NoConnectionsException, IOException {
"""
Executes a procedure asynchronously, then calls the provided user callback with the server
response upon completion.
@param callback
the user-specified c... | java | public boolean executeAsync(ProcedureCallback callback, String procedure, Object... parameters)
throws NoConnectionsException, IOException
{
ClientImpl currentClient = this.getClient();
try {
return currentClient.callProcedure(new TrackingCallback(this, procedure, callback),
... | [
"public",
"boolean",
"executeAsync",
"(",
"ProcedureCallback",
"callback",
",",
"String",
"procedure",
",",
"Object",
"...",
"parameters",
")",
"throws",
"NoConnectionsException",
",",
"IOException",
"{",
"ClientImpl",
"currentClient",
"=",
"this",
".",
"getClient",
... | Executes a procedure asynchronously, then calls the provided user callback with the server
response upon completion.
@param callback
the user-specified callback to call with the server response upon execution
completion.
@param procedure
the name of the procedure to call.
@param parameters
the list of parameters to pa... | [
"Executes",
"a",
"procedure",
"asynchronously",
"then",
"calls",
"the",
"provided",
"user",
"callback",
"with",
"the",
"server",
"response",
"upon",
"completion",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4ClientConnection.java#L415-L427 |
codelibs/jcifs | src/main/java/jcifs/smb1/Config.java | Config.getInetAddressArray | public static InetAddress[] getInetAddressArray( String key, String delim, InetAddress[] def ) {
"""
Retrieve an array of <tt>InetAddress</tt> created from a property
value containting a <tt>delim</tt> separated list of hostnames and/or
ipaddresses.
"""
String p = getProperty( key );
if( p !=... | java | public static InetAddress[] getInetAddressArray( String key, String delim, InetAddress[] def ) {
String p = getProperty( key );
if( p != null ) {
StringTokenizer tok = new StringTokenizer( p, delim );
int len = tok.countTokens();
InetAddress[] arr = new InetAddress[le... | [
"public",
"static",
"InetAddress",
"[",
"]",
"getInetAddressArray",
"(",
"String",
"key",
",",
"String",
"delim",
",",
"InetAddress",
"[",
"]",
"def",
")",
"{",
"String",
"p",
"=",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"p",
"!=",
"null",
")",... | Retrieve an array of <tt>InetAddress</tt> created from a property
value containting a <tt>delim</tt> separated list of hostnames and/or
ipaddresses. | [
"Retrieve",
"an",
"array",
"of",
"<tt",
">",
"InetAddress<",
"/",
"tt",
">",
"created",
"from",
"a",
"property",
"value",
"containting",
"a",
"<tt",
">",
"delim<",
"/",
"tt",
">",
"separated",
"list",
"of",
"hostnames",
"and",
"/",
"or",
"ipaddresses",
"... | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/Config.java#L327-L348 |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/cli/util/OptionSet.java | OptionSet.addOption | public OptionSet addOption(String key, Options.Separator separator, Options.Multiplicity multiplicity) {
"""
Add a value option with the given key, separator, and multiplicity, no details, and the default prefix
<p>
@param key The key for the option
@param separator The separator for the option
@pa... | java | public OptionSet addOption(String key, Options.Separator separator, Options.Multiplicity multiplicity) {
return addOption(key, false, separator, true, multiplicity);
} | [
"public",
"OptionSet",
"addOption",
"(",
"String",
"key",
",",
"Options",
".",
"Separator",
"separator",
",",
"Options",
".",
"Multiplicity",
"multiplicity",
")",
"{",
"return",
"addOption",
"(",
"key",
",",
"false",
",",
"separator",
",",
"true",
",",
"mult... | Add a value option with the given key, separator, and multiplicity, no details, and the default prefix
<p>
@param key The key for the option
@param separator The separator for the option
@param multiplicity The multiplicity for the option
<p>
@return The set instance itself (to support invocation chaining f... | [
"Add",
"a",
"value",
"option",
"with",
"the",
"given",
"key",
"separator",
"and",
"multiplicity",
"no",
"details",
"and",
"the",
"default",
"prefix",
"<p",
">"
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/cli/util/OptionSet.java#L225-L227 |
box/box-java-sdk | src/main/java/com/box/sdk/EventLog.java | EventLog.getEnterpriseEvents | public static EventLog getEnterpriseEvents(BoxAPIConnection api, Date after, Date before, BoxEvent.Type... types) {
"""
Gets all the enterprise events that occurred within a specified date range.
@param api the API connection to use.
@param after the lower bound on the timestamp of the events returned.
@p... | java | public static EventLog getEnterpriseEvents(BoxAPIConnection api, Date after, Date before, BoxEvent.Type... types) {
return getEnterpriseEvents(api, null, after, before, ENTERPRISE_LIMIT, types);
} | [
"public",
"static",
"EventLog",
"getEnterpriseEvents",
"(",
"BoxAPIConnection",
"api",
",",
"Date",
"after",
",",
"Date",
"before",
",",
"BoxEvent",
".",
"Type",
"...",
"types",
")",
"{",
"return",
"getEnterpriseEvents",
"(",
"api",
",",
"null",
",",
"after",
... | Gets all the enterprise events that occurred within a specified date range.
@param api the API connection to use.
@param after the lower bound on the timestamp of the events returned.
@param before the upper bound on the timestamp of the events returned.
@param types an optional list of event types to filter b... | [
"Gets",
"all",
"the",
"enterprise",
"events",
"that",
"occurred",
"within",
"a",
"specified",
"date",
"range",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/EventLog.java#L74-L76 |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/LicenseUtility.java | LicenseUtility.displayLicenseFile | public Object displayLicenseFile(InputStream licenseFile, CommandConsole commandConsole) {
"""
Display the license file. If an error occurs reading or writing the
license file, exit with a message
@param licenseFile
The license file to display
"""
Object e = LicenseUtility.class;
if (licen... | java | public Object displayLicenseFile(InputStream licenseFile, CommandConsole commandConsole) {
Object e = LicenseUtility.class;
if (licenseFile != null) {
e = showLicenseFile(licenseFile, commandConsole);
}
if (e != null) {
commandConsole.printErrorMessage(CommandUtil... | [
"public",
"Object",
"displayLicenseFile",
"(",
"InputStream",
"licenseFile",
",",
"CommandConsole",
"commandConsole",
")",
"{",
"Object",
"e",
"=",
"LicenseUtility",
".",
"class",
";",
"if",
"(",
"licenseFile",
"!=",
"null",
")",
"{",
"e",
"=",
"showLicenseFile"... | Display the license file. If an error occurs reading or writing the
license file, exit with a message
@param licenseFile
The license file to display | [
"Display",
"the",
"license",
"file",
".",
"If",
"an",
"error",
"occurs",
"reading",
"or",
"writing",
"the",
"license",
"file",
"exit",
"with",
"a",
"message"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/LicenseUtility.java#L38-L47 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPMeasurementUnitPersistenceImpl.java | CPMeasurementUnitPersistenceImpl.removeByUUID_G | @Override
public CPMeasurementUnit removeByUUID_G(String uuid, long groupId)
throws NoSuchCPMeasurementUnitException {
"""
Removes the cp measurement unit where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp measurement unit that was remo... | java | @Override
public CPMeasurementUnit removeByUUID_G(String uuid, long groupId)
throws NoSuchCPMeasurementUnitException {
CPMeasurementUnit cpMeasurementUnit = findByUUID_G(uuid, groupId);
return remove(cpMeasurementUnit);
} | [
"@",
"Override",
"public",
"CPMeasurementUnit",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPMeasurementUnitException",
"{",
"CPMeasurementUnit",
"cpMeasurementUnit",
"=",
"findByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";... | Removes the cp measurement unit where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp measurement unit that was removed | [
"Removes",
"the",
"cp",
"measurement",
"unit",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPMeasurementUnitPersistenceImpl.java#L814-L820 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.getPackageLink | public Content getPackageLink(PackageDoc pkg, Content label) {
"""
Return the link to the given package.
@param pkg the package to link to.
@param label the label for the link.
@return a content tree for the package link.
"""
boolean included = pkg != null && pkg.isIncluded();
if (! includ... | java | public Content getPackageLink(PackageDoc pkg, Content label) {
boolean included = pkg != null && pkg.isIncluded();
if (! included) {
for (PackageDoc p : configuration.packages) {
if (p.equals(pkg)) {
included = true;
break;
... | [
"public",
"Content",
"getPackageLink",
"(",
"PackageDoc",
"pkg",
",",
"Content",
"label",
")",
"{",
"boolean",
"included",
"=",
"pkg",
"!=",
"null",
"&&",
"pkg",
".",
"isIncluded",
"(",
")",
";",
"if",
"(",
"!",
"included",
")",
"{",
"for",
"(",
"Packa... | Return the link to the given package.
@param pkg the package to link to.
@param label the label for the link.
@return a content tree for the package link. | [
"Return",
"the",
"link",
"to",
"the",
"given",
"package",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L959-L980 |
telly/MrVector | library/src/main/java/com/telly/mrvector/Utils.java | Utils.parseTintMode | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
static Mode parseTintMode(int value, Mode defaultMode) {
"""
Parses a {@link Mode} from a tintMode
attribute's enum value.
@hide
"""
switch (value) {
case 3: return Mode.SRC_OVER;
case 5: return Mode.SRC_IN;
case 9: return Mode.SRC_ATOP;
... | java | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
static Mode parseTintMode(int value, Mode defaultMode) {
switch (value) {
case 3: return Mode.SRC_OVER;
case 5: return Mode.SRC_IN;
case 9: return Mode.SRC_ATOP;
case 14: return Mode.MULTIPLY;
case 15: return Mode.SCREEN;
case 16:
... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"static",
"Mode",
"parseTintMode",
"(",
"int",
"value",
",",
"Mode",
"defaultMode",
")",
"{",
"switch",
"(",
"value",
")",
"{",
"case",
"3",
":",
"return",
"Mode",
".",
"SRC_OVE... | Parses a {@link Mode} from a tintMode
attribute's enum value.
@hide | [
"Parses",
"a",
"{",
"@link",
"Mode",
"}",
"from",
"a",
"tintMode",
"attribute",
"s",
"enum",
"value",
"."
] | train | https://github.com/telly/MrVector/blob/846cd05ab6e57dcdc1cae28e796ac84b1d6365d5/library/src/main/java/com/telly/mrvector/Utils.java#L88-L105 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java | EnumConstantBuilder.buildEnumConstantComments | public void buildEnumConstantComments(XMLNode node, Content enumConstantsTree) {
"""
Build the comments for the enum constant. Do nothing if
{@link Configuration#nocomment} is set to true.
@param node the XML element that specifies which components to document
@param enumConstantsTree the content tree to whi... | java | public void buildEnumConstantComments(XMLNode node, Content enumConstantsTree) {
if (!configuration.nocomment) {
writer.addComments(currentElement, enumConstantsTree);
}
} | [
"public",
"void",
"buildEnumConstantComments",
"(",
"XMLNode",
"node",
",",
"Content",
"enumConstantsTree",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"nocomment",
")",
"{",
"writer",
".",
"addComments",
"(",
"currentElement",
",",
"enumConstantsTree",
")",
... | Build the comments for the enum constant. Do nothing if
{@link Configuration#nocomment} is set to true.
@param node the XML element that specifies which components to document
@param enumConstantsTree the content tree to which the documentation will be added | [
"Build",
"the",
"comments",
"for",
"the",
"enum",
"constant",
".",
"Do",
"nothing",
"if",
"{",
"@link",
"Configuration#nocomment",
"}",
"is",
"set",
"to",
"true",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java#L183-L187 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/ParsedSelectStmt.java | ParsedSelectStmt.parseTableSchemaFromXML | private void parseTableSchemaFromXML(String tableName,
StmtCommonTableScanShared tableScan,
VoltXMLElement voltXMLElement) {
"""
/*
Read the schema from the XML. Add the parsed columns to the
list of columns. One might think this... | java | private void parseTableSchemaFromXML(String tableName,
StmtCommonTableScanShared tableScan,
VoltXMLElement voltXMLElement) {
assert("table".equals(voltXMLElement.name));
List<VoltXMLElement> columnSet = voltXMLElement.find... | [
"private",
"void",
"parseTableSchemaFromXML",
"(",
"String",
"tableName",
",",
"StmtCommonTableScanShared",
"tableScan",
",",
"VoltXMLElement",
"voltXMLElement",
")",
"{",
"assert",
"(",
"\"table\"",
".",
"equals",
"(",
"voltXMLElement",
".",
"name",
")",
")",
";",
... | /*
Read the schema from the XML. Add the parsed columns to the
list of columns. One might think this is the same as
AbstractParsedStmt.parseTable, but it is not. That function
parses a statement scan from a join expression, not a
table schema. | [
"/",
"*",
"Read",
"the",
"schema",
"from",
"the",
"XML",
".",
"Add",
"the",
"parsed",
"columns",
"to",
"the",
"list",
"of",
"columns",
".",
"One",
"might",
"think",
"this",
"is",
"the",
"same",
"as",
"AbstractParsedStmt",
".",
"parseTable",
"but",
"it",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/ParsedSelectStmt.java#L2678-L2726 |
googleads/googleads-java-lib | examples/adwords_axis/src/main/java/adwords/axis/v201809/advancedoperations/UsePortfolioBiddingStrategy.java | UsePortfolioBiddingStrategy.createBiddingStrategy | private static SharedBiddingStrategy createBiddingStrategy(
AdWordsServicesInterface adWordsServices, AdWordsSession session) throws RemoteException {
"""
Creates the bidding strategy object.
@param adWordsServices the user to run the example with
@param session the AdWordsSession
@throws ApiException i... | java | private static SharedBiddingStrategy createBiddingStrategy(
AdWordsServicesInterface adWordsServices, AdWordsSession session) throws RemoteException {
// Get the BiddingStrategyService, which loads the required classes.
BiddingStrategyServiceInterface biddingStrategyService =
adWordsServices.get(s... | [
"private",
"static",
"SharedBiddingStrategy",
"createBiddingStrategy",
"(",
"AdWordsServicesInterface",
"adWordsServices",
",",
"AdWordsSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the BiddingStrategyService, which loads the required classes.",
"BiddingStrategySe... | Creates the bidding strategy object.
@param adWordsServices the user to run the example with
@param session the AdWordsSession
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Creates",
"the",
"bidding",
"strategy",
"object",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/adwords_axis/src/main/java/adwords/axis/v201809/advancedoperations/UsePortfolioBiddingStrategy.java#L152-L185 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/Base64.java | Base64.decode4to3 | private static int decode4to3( byte[] source, int srcOffset, byte[] destination, int destOffset ) {
"""
Decodes four bytes from array <var>source</var>
and writes the resulting bytes (up to three of them)
to <var>destination</var>.
The source and destination arrays can be manipulated
anywhere along their lengt... | java | private static int decode4to3( byte[] source, int srcOffset, byte[] destination, int destOffset )
{
// Example: Dk==
if( source[ srcOffset + 2] == EQUALS_SIGN )
{
// Two ways to do the same thing. Don't know which way I like best.
//int outBuff = ( ( DECODABET... | [
"private",
"static",
"int",
"decode4to3",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"srcOffset",
",",
"byte",
"[",
"]",
"destination",
",",
"int",
"destOffset",
")",
"{",
"// Example: Dk==\r",
"if",
"(",
"source",
"[",
"srcOffset",
"+",
"2",
"]",
"=="... | Decodes four bytes from array <var>source</var>
and writes the resulting bytes (up to three of them)
to <var>destination</var>.
The source and destination arrays can be manipulated
anywhere along their length by specifying
<var>srcOffset</var> and <var>destOffset</var>.
This method does not check to make sure your arra... | [
"Decodes",
"four",
"bytes",
"from",
"array",
"<var",
">",
"source<",
"/",
"var",
">",
"and",
"writes",
"the",
"resulting",
"bytes",
"(",
"up",
"to",
"three",
"of",
"them",
")",
"to",
"<var",
">",
"destination<",
"/",
"var",
">",
".",
"The",
"source",
... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/Base64.java#L623-L682 |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/util/ExpandableStringEnum.java | ExpandableStringEnum.fromString | @SuppressWarnings("unchecked")
protected static <T extends ExpandableStringEnum<T>> T fromString(String name, Class<T> clazz) {
"""
Creates an instance of the specific expandable string enum from a String.
@param name the value to create the instance from
@param clazz the class of the expandable string enum
... | java | @SuppressWarnings("unchecked")
protected static <T extends ExpandableStringEnum<T>> T fromString(String name, Class<T> clazz) {
if (name == null) {
return null;
} else if (valuesByName != null) {
T value = (T) valuesByName.get(uniqueKey(clazz, name));
if (value !=... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"static",
"<",
"T",
"extends",
"ExpandableStringEnum",
"<",
"T",
">",
">",
"T",
"fromString",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"name",
"==",... | Creates an instance of the specific expandable string enum from a String.
@param name the value to create the instance from
@param clazz the class of the expandable string enum
@param <T> the class of the expandable string enum
@return the expandable string enum instance | [
"Creates",
"an",
"instance",
"of",
"the",
"specific",
"expandable",
"string",
"enum",
"from",
"a",
"String",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/util/ExpandableStringEnum.java#L48-L65 |
jblas-project/jblas | src/main/java/org/jblas/ComplexDouble.java | ComplexDouble.muli | public ComplexDouble muli(ComplexDouble c, ComplexDouble result) {
"""
Multiply two complex numbers, in-place
@param c other complex number
@param result complex number where product is stored
@return same as result
"""
double newR = r * c.r - i * c.i;
double newI = r * c.i + i * c.r;
res... | java | public ComplexDouble muli(ComplexDouble c, ComplexDouble result) {
double newR = r * c.r - i * c.i;
double newI = r * c.i + i * c.r;
result.r = newR;
result.i = newI;
return result;
} | [
"public",
"ComplexDouble",
"muli",
"(",
"ComplexDouble",
"c",
",",
"ComplexDouble",
"result",
")",
"{",
"double",
"newR",
"=",
"r",
"*",
"c",
".",
"r",
"-",
"i",
"*",
"c",
".",
"i",
";",
"double",
"newI",
"=",
"r",
"*",
"c",
".",
"i",
"+",
"i",
... | Multiply two complex numbers, in-place
@param c other complex number
@param result complex number where product is stored
@return same as result | [
"Multiply",
"two",
"complex",
"numbers",
"in",
"-",
"place"
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/ComplexDouble.java#L226-L232 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreen.java | JScreen.addScreenButtons | public void addScreenButtons(Container parent) {
"""
Add a submit and reset buttons to the bottom of the grid.
@param gridbag The screen layout.
@param c The constraint to use.
"""
GridBagLayout gridbag = (GridBagLayout)this.getScreenLayout();
GridBagConstraints c = this.getGBConstraints();
... | java | public void addScreenButtons(Container parent)
{
GridBagLayout gridbag = (GridBagLayout)this.getScreenLayout();
GridBagConstraints c = this.getGBConstraints();
c.gridheight = GridBagConstraints.REMAINDER; // end row
c.anchor = GridBagConstraints.NORTH;
c.gridwidth = 1; // end... | [
"public",
"void",
"addScreenButtons",
"(",
"Container",
"parent",
")",
"{",
"GridBagLayout",
"gridbag",
"=",
"(",
"GridBagLayout",
")",
"this",
".",
"getScreenLayout",
"(",
")",
";",
"GridBagConstraints",
"c",
"=",
"this",
".",
"getGBConstraints",
"(",
")",
";... | Add a submit and reset buttons to the bottom of the grid.
@param gridbag The screen layout.
@param c The constraint to use. | [
"Add",
"a",
"submit",
"and",
"reset",
"buttons",
"to",
"the",
"bottom",
"of",
"the",
"grid",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreen.java#L350-L375 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java | JobSchedulesImpl.terminateAsync | public Observable<Void> terminateAsync(String jobScheduleId) {
"""
Terminates a job schedule.
@param jobScheduleId The ID of the job schedule to terminates.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponseWithHeaders} object if successful.
"""
... | java | public Observable<Void> terminateAsync(String jobScheduleId) {
return terminateWithServiceResponseAsync(jobScheduleId).map(new Func1<ServiceResponseWithHeaders<Void, JobScheduleTerminateHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHeaders<Void, JobScheduleTerminateHe... | [
"public",
"Observable",
"<",
"Void",
">",
"terminateAsync",
"(",
"String",
"jobScheduleId",
")",
"{",
"return",
"terminateWithServiceResponseAsync",
"(",
"jobScheduleId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponseWithHeaders",
"<",
"Void",
",",
"J... | Terminates a job schedule.
@param jobScheduleId The ID of the job schedule to terminates.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponseWithHeaders} object if successful. | [
"Terminates",
"a",
"job",
"schedule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java#L1797-L1804 |
rholder/guava-retrying | src/main/java/com/github/rholder/retry/StopStrategies.java | StopStrategies.stopAfterDelay | public static StopStrategy stopAfterDelay(long duration, @Nonnull TimeUnit timeUnit) {
"""
Returns a stop strategy which stops after a given delay. If an
unsuccessful attempt is made, this {@link StopStrategy} will check if the
amount of time that's passed from the first attempt has exceeded the
given delay amo... | java | public static StopStrategy stopAfterDelay(long duration, @Nonnull TimeUnit timeUnit) {
Preconditions.checkNotNull(timeUnit, "The time unit may not be null");
return new StopAfterDelayStrategy(timeUnit.toMillis(duration));
} | [
"public",
"static",
"StopStrategy",
"stopAfterDelay",
"(",
"long",
"duration",
",",
"@",
"Nonnull",
"TimeUnit",
"timeUnit",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"timeUnit",
",",
"\"The time unit may not be null\"",
")",
";",
"return",
"new",
"StopAft... | Returns a stop strategy which stops after a given delay. If an
unsuccessful attempt is made, this {@link StopStrategy} will check if the
amount of time that's passed from the first attempt has exceeded the
given delay amount. If it has exceeded this delay, then using this
strategy causes the retrying to stop.
@param d... | [
"Returns",
"a",
"stop",
"strategy",
"which",
"stops",
"after",
"a",
"given",
"delay",
".",
"If",
"an",
"unsuccessful",
"attempt",
"is",
"made",
"this",
"{",
"@link",
"StopStrategy",
"}",
"will",
"check",
"if",
"the",
"amount",
"of",
"time",
"that",
"s",
... | train | https://github.com/rholder/guava-retrying/blob/177b6c9b9f3e7957f404f0bdb8e23374cb1de43f/src/main/java/com/github/rholder/retry/StopStrategies.java#L85-L88 |
infinispan/infinispan | client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/ByteBufUtil.java | ByteBufUtil.writeXid | public static void writeXid(ByteBuf buf, Xid xid) {
"""
Writes the {@link Xid} to the {@link ByteBuf}.
@param buf the buffer to write to.
@param xid the {@link Xid} to encode
"""
if (xid instanceof RemoteXid) {
((RemoteXid) xid).writeTo(buf);
} else {
ByteBufUtil.writeSignedVI... | java | public static void writeXid(ByteBuf buf, Xid xid) {
if (xid instanceof RemoteXid) {
((RemoteXid) xid).writeTo(buf);
} else {
ByteBufUtil.writeSignedVInt(buf, xid.getFormatId());
writeArray(buf, xid.getGlobalTransactionId());
writeArray(buf, xid.getBranchQualifier());
... | [
"public",
"static",
"void",
"writeXid",
"(",
"ByteBuf",
"buf",
",",
"Xid",
"xid",
")",
"{",
"if",
"(",
"xid",
"instanceof",
"RemoteXid",
")",
"{",
"(",
"(",
"RemoteXid",
")",
"xid",
")",
".",
"writeTo",
"(",
"buf",
")",
";",
"}",
"else",
"{",
"Byte... | Writes the {@link Xid} to the {@link ByteBuf}.
@param buf the buffer to write to.
@param xid the {@link Xid} to encode | [
"Writes",
"the",
"{",
"@link",
"Xid",
"}",
"to",
"the",
"{",
"@link",
"ByteBuf",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/ByteBufUtil.java#L162-L170 |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java | Transform1D.setTranslation | public void setTranslation(List<? extends S> path, Direction1D direction, Tuple2D<?> position) {
"""
Set the position.
@param path the path to follow.
@param direction is the direction to follow on the path if the path contains only one segment.
@param position where <code>x</code> is the curviline coordinate... | java | public void setTranslation(List<? extends S> path, Direction1D direction, Tuple2D<?> position) {
assert position != null : AssertMessages.notNullParameter(3);
this.path = path == null || path.isEmpty() ? null : new ArrayList<>(path);
this.firstSegmentDirection = detectFirstSegmentDirection(direction);
this.curv... | [
"public",
"void",
"setTranslation",
"(",
"List",
"<",
"?",
"extends",
"S",
">",
"path",
",",
"Direction1D",
"direction",
",",
"Tuple2D",
"<",
"?",
">",
"position",
")",
"{",
"assert",
"position",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
... | Set the position.
@param path the path to follow.
@param direction is the direction to follow on the path if the path contains only one segment.
@param position where <code>x</code> is the curviline coordinate and <code>y</code> is the shift coordinate. | [
"Set",
"the",
"position",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java#L352-L359 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/math.java | math.getRandomNumber | public static int getRandomNumber(int min, int max) {
"""
Returns a random number between MIN inclusive and MAX exclusive.
@param min
value inclusive
@param max
value exclusive
@return an int between MIN inclusive and MAX exclusive.
"""
Random r = new Random();
return r.nextInt(max - min + 1) + mi... | java | public static int getRandomNumber(int min, int max) {
Random r = new Random();
return r.nextInt(max - min + 1) + min;
} | [
"public",
"static",
"int",
"getRandomNumber",
"(",
"int",
"min",
",",
"int",
"max",
")",
"{",
"Random",
"r",
"=",
"new",
"Random",
"(",
")",
";",
"return",
"r",
".",
"nextInt",
"(",
"max",
"-",
"min",
"+",
"1",
")",
"+",
"min",
";",
"}"
] | Returns a random number between MIN inclusive and MAX exclusive.
@param min
value inclusive
@param max
value exclusive
@return an int between MIN inclusive and MAX exclusive. | [
"Returns",
"a",
"random",
"number",
"between",
"MIN",
"inclusive",
"and",
"MAX",
"exclusive",
"."
] | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/math.java#L386-L389 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.drawRadioField | public void drawRadioField(float llx, float lly, float urx, float ury, boolean on) {
"""
Draws a TextField.
@param llx
@param lly
@param urx
@param ury
@param on
"""
if (llx > urx) { float x = llx; llx = urx; urx = x; }
if (lly > ury) { float y = lly; lly = ury; ury = y; }
// silve... | java | public void drawRadioField(float llx, float lly, float urx, float ury, boolean on) {
if (llx > urx) { float x = llx; llx = urx; urx = x; }
if (lly > ury) { float y = lly; lly = ury; ury = y; }
// silver circle
setLineWidth(1);
setLineCap(1);
setColorStroke(new Color(0xC0,... | [
"public",
"void",
"drawRadioField",
"(",
"float",
"llx",
",",
"float",
"lly",
",",
"float",
"urx",
",",
"float",
"ury",
",",
"boolean",
"on",
")",
"{",
"if",
"(",
"llx",
">",
"urx",
")",
"{",
"float",
"x",
"=",
"llx",
";",
"llx",
"=",
"urx",
";",... | Draws a TextField.
@param llx
@param lly
@param urx
@param ury
@param on | [
"Draws",
"a",
"TextField",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L2657-L2686 |
keenlabs/KeenClient-Java | core/src/main/java/io/keen/client/java/KeenClient.java | KeenClient.addEvent | public void addEvent(KeenProject project, String eventCollection, Map<String, Object> event,
Map<String, Object> keenProperties, KeenCallback callback) {
"""
Synchronously adds an event to the specified collection. This method will immediately
publish the event to the Keen server in the c... | java | public void addEvent(KeenProject project, String eventCollection, Map<String, Object> event,
Map<String, Object> keenProperties, KeenCallback callback) {
if (!isActive) {
handleLibraryInactive(callback);
return;
}
if (project == null && defaultP... | [
"public",
"void",
"addEvent",
"(",
"KeenProject",
"project",
",",
"String",
"eventCollection",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"event",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"keenProperties",
",",
"KeenCallback",
"callback",
")",
"{",... | Synchronously adds an event to the specified collection. This method will immediately
publish the event to the Keen server in the current thread.
@param project The project in which to publish the event. If a default project has been set
on the client, this parameter may be null, in which case the default proj... | [
"Synchronously",
"adds",
"an",
"event",
"to",
"the",
"specified",
"collection",
".",
"This",
"method",
"will",
"immediately",
"publish",
"the",
"event",
"to",
"the",
"Keen",
"server",
"in",
"the",
"current",
"thread",
"."
] | train | https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/core/src/main/java/io/keen/client/java/KeenClient.java#L146-L176 |
JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.registerMethodConstructor | public <T> void registerMethodConstructor(final Class<T> cls, String toStringMethodName) {
"""
Registers a converter for a specific type by method and constructor.
<p>
This method allows the converter to be used when the target class cannot have annotations added.
The two method name and constructor must obey t... | java | public <T> void registerMethodConstructor(final Class<T> cls, String toStringMethodName) {
if (cls == null) {
throw new IllegalArgumentException("Class must not be null");
}
if (toStringMethodName == null) {
throw new IllegalArgumentException("Method name must not be... | [
"public",
"<",
"T",
">",
"void",
"registerMethodConstructor",
"(",
"final",
"Class",
"<",
"T",
">",
"cls",
",",
"String",
"toStringMethodName",
")",
"{",
"if",
"(",
"cls",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Class must... | Registers a converter for a specific type by method and constructor.
<p>
This method allows the converter to be used when the target class cannot have annotations added.
The two method name and constructor must obey the same rules as defined by the annotations
{@link ToString} and {@link FromString}.
The converter will... | [
"Registers",
"a",
"converter",
"for",
"a",
"specific",
"type",
"by",
"method",
"and",
"constructor",
".",
"<p",
">",
"This",
"method",
"allows",
"the",
"converter",
"to",
"be",
"used",
"when",
"the",
"target",
"class",
"cannot",
"have",
"annotations",
"added... | train | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L773-L787 |
bmelnychuk/AndroidTreeView | library/src/main/java/com/unnamed/b/atv/view/TwoDScrollView.java | TwoDScrollView.scrollAndFocus | private boolean scrollAndFocus(int directionY, int top, int bottom, int directionX, int left, int right) {
"""
<p>Scrolls the view to make the area defined by <code>top</code> and
<code>bottom</code> visible. This method attempts to give the focus
to a component visible in this area. If no component can be focus... | java | private boolean scrollAndFocus(int directionY, int top, int bottom, int directionX, int left, int right) {
boolean handled = true;
int height = getHeight();
int containerTop = getScrollY();
int containerBottom = containerTop + height;
boolean up = directionY == View.FOCUS_UP;
... | [
"private",
"boolean",
"scrollAndFocus",
"(",
"int",
"directionY",
",",
"int",
"top",
",",
"int",
"bottom",
",",
"int",
"directionX",
",",
"int",
"left",
",",
"int",
"right",
")",
"{",
"boolean",
"handled",
"=",
"true",
";",
"int",
"height",
"=",
"getHeig... | <p>Scrolls the view to make the area defined by <code>top</code> and
<code>bottom</code> visible. This method attempts to give the focus
to a component visible in this area. If no component can be focused in
the new visible area, the focus is reclaimed by this scrollview.</p>
@param direction the scroll direction: {@l... | [
"<p",
">",
"Scrolls",
"the",
"view",
"to",
"make",
"the",
"area",
"defined",
"by",
"<code",
">",
"top<",
"/",
"code",
">",
"and",
"<code",
">",
"bottom<",
"/",
"code",
">",
"visible",
".",
"This",
"method",
"attempts",
"to",
"give",
"the",
"focus",
"... | train | https://github.com/bmelnychuk/AndroidTreeView/blob/d051ce75f5c9bd5206481808f6133b51f581c8f1/library/src/main/java/com/unnamed/b/atv/view/TwoDScrollView.java#L620-L646 |
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.queryByLatitude | public Iterable<DContact> queryByLatitude(Object parent, java.lang.Float latitude) {
"""
query-by method for field latitude
@param latitude the specified attribute
@return an Iterable of DContacts for the specified latitude
"""
return queryByField(parent, DContactMapper.Field.LATITUDE.getFieldName(), lat... | java | public Iterable<DContact> queryByLatitude(Object parent, java.lang.Float latitude) {
return queryByField(parent, DContactMapper.Field.LATITUDE.getFieldName(), latitude);
} | [
"public",
"Iterable",
"<",
"DContact",
">",
"queryByLatitude",
"(",
"Object",
"parent",
",",
"java",
".",
"lang",
".",
"Float",
"latitude",
")",
"{",
"return",
"queryByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"LATITUDE",
".",
"getFiel... | query-by method for field latitude
@param latitude the specified attribute
@return an Iterable of DContacts for the specified latitude | [
"query",
"-",
"by",
"method",
"for",
"field",
"latitude"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L196-L198 |
HaraldWalker/user-agent-utils | src/main/java/eu/bitwalker/useragentutils/UserAgent.java | UserAgent.valueOf | public static UserAgent valueOf(String name) {
"""
Returns UserAgent based on combined string representation
@param name Name of the user agent.
@return UserAgent
"""
if (name == null)
throw new NullPointerException("Name is null");
String[] elements = name.split("-");
if (elements.le... | java | public static UserAgent valueOf(String name)
{
if (name == null)
throw new NullPointerException("Name is null");
String[] elements = name.split("-");
if (elements.length == 2)
{
OperatingSystem operatingSystem = OperatingSystem.valueOf(elements[0]);
Browser browser = Browser.valueOf(ele... | [
"public",
"static",
"UserAgent",
"valueOf",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"Name is null\"",
")",
";",
"String",
"[",
"]",
"elements",
"=",
"name",
".",
"split",
"(",
... | Returns UserAgent based on combined string representation
@param name Name of the user agent.
@return UserAgent | [
"Returns",
"UserAgent",
"based",
"on",
"combined",
"string",
"representation"
] | train | https://github.com/HaraldWalker/user-agent-utils/blob/7f954514298f76afff8a75723bc25205bfe30d1b/src/main/java/eu/bitwalker/useragentutils/UserAgent.java#L179-L195 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/MapIterate.java | MapIterate.toListOfPairs | public static <K, V> MutableList<Pair<K, V>> toListOfPairs(Map<K, V> map) {
"""
Iterate over the specified map applying the specified Function to each value
and return the results as a List.
"""
final MutableList<Pair<K, V>> pairs = FastList.newList(map.size());
MapIterate.forEachKeyValue(map,... | java | public static <K, V> MutableList<Pair<K, V>> toListOfPairs(Map<K, V> map)
{
final MutableList<Pair<K, V>> pairs = FastList.newList(map.size());
MapIterate.forEachKeyValue(map, new Procedure2<K, V>()
{
public void value(K key, V value)
{
pairs.add(Tuple... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"MutableList",
"<",
"Pair",
"<",
"K",
",",
"V",
">",
">",
"toListOfPairs",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
")",
"{",
"final",
"MutableList",
"<",
"Pair",
"<",
"K",
",",
"V",
">",
">",
"... | Iterate over the specified map applying the specified Function to each value
and return the results as a List. | [
"Iterate",
"over",
"the",
"specified",
"map",
"applying",
"the",
"specified",
"Function",
"to",
"each",
"value",
"and",
"return",
"the",
"results",
"as",
"a",
"List",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/MapIterate.java#L977-L988 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.insertBand | public static void insertBand( GrayF64 input, int band , InterleavedF64 output) {
"""
Inserts a single band into a multi-band image overwriting the original band
@param input Single band image
@param band Which band the image is to be inserted into
@param output The multi-band image which the input image is t... | java | public static void insertBand( GrayF64 input, int band , InterleavedF64 output) {
final int numBands = output.numBands;
for (int y = 0; y < input.height; y++) {
int indexIn = input.getStartIndex() + y * input.getStride();
int indexOut = output.getStartIndex() + y * output.getStride() + band;
int end = ind... | [
"public",
"static",
"void",
"insertBand",
"(",
"GrayF64",
"input",
",",
"int",
"band",
",",
"InterleavedF64",
"output",
")",
"{",
"final",
"int",
"numBands",
"=",
"output",
".",
"numBands",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"input",... | Inserts a single band into a multi-band image overwriting the original band
@param input Single band image
@param band Which band the image is to be inserted into
@param output The multi-band image which the input image is to be inserted into | [
"Inserts",
"a",
"single",
"band",
"into",
"a",
"multi",
"-",
"band",
"image",
"overwriting",
"the",
"original",
"band"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L2866-L2877 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Image.java | Image.setImageColor | public void setImageColor(float r, float g, float b) {
"""
Set the filter to apply when drawing this image
@param r The red component of the filter colour
@param g The green component of the filter colour
@param b The blue component of the filter colour
"""
setColor(TOP_LEFT, r, g, b);
setColor(TOP_... | java | public void setImageColor(float r, float g, float b) {
setColor(TOP_LEFT, r, g, b);
setColor(TOP_RIGHT, r, g, b);
setColor(BOTTOM_LEFT, r, g, b);
setColor(BOTTOM_RIGHT, r, g, b);
} | [
"public",
"void",
"setImageColor",
"(",
"float",
"r",
",",
"float",
"g",
",",
"float",
"b",
")",
"{",
"setColor",
"(",
"TOP_LEFT",
",",
"r",
",",
"g",
",",
"b",
")",
";",
"setColor",
"(",
"TOP_RIGHT",
",",
"r",
",",
"g",
",",
"b",
")",
";",
"se... | Set the filter to apply when drawing this image
@param r The red component of the filter colour
@param g The green component of the filter colour
@param b The blue component of the filter colour | [
"Set",
"the",
"filter",
"to",
"apply",
"when",
"drawing",
"this",
"image"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Image.java#L358-L363 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlEntityResolver.java | CmsXmlEntityResolver.cacheContentDefinition | public void cacheContentDefinition(String systemId, CmsXmlContentDefinition contentDefinition) {
"""
Caches an XML content definition based on the given system id and the online / offline status
of this entity resolver instance.<p>
@param systemId the system id to use as cache key
@param contentDefinition the... | java | public void cacheContentDefinition(String systemId, CmsXmlContentDefinition contentDefinition) {
String cacheKey = getCacheKeyForCurrentProject(systemId);
m_cacheContentDefinitions.put(cacheKey, contentDefinition);
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.get().getBundle().key... | [
"public",
"void",
"cacheContentDefinition",
"(",
"String",
"systemId",
",",
"CmsXmlContentDefinition",
"contentDefinition",
")",
"{",
"String",
"cacheKey",
"=",
"getCacheKeyForCurrentProject",
"(",
"systemId",
")",
";",
"m_cacheContentDefinitions",
".",
"put",
"(",
"cac... | Caches an XML content definition based on the given system id and the online / offline status
of this entity resolver instance.<p>
@param systemId the system id to use as cache key
@param contentDefinition the content definition to cache | [
"Caches",
"an",
"XML",
"content",
"definition",
"based",
"on",
"the",
"given",
"system",
"id",
"and",
"the",
"online",
"/",
"offline",
"status",
"of",
"this",
"entity",
"resolver",
"instance",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlEntityResolver.java#L278-L285 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/table/RtfRow.java | RtfRow.importRow | private void importRow(PdfPRow row) {
"""
Imports a PdfPRow and copies all settings
@param row The PdfPRow to import
@since 2.1.3
"""
this.cells = new ArrayList();
this.width = this.document.getDocumentHeader().getPageSetting().getPageWidth() - this.document.getDocumentHeader().getPageSetti... | java | private void importRow(PdfPRow row) {
this.cells = new ArrayList();
this.width = this.document.getDocumentHeader().getPageSetting().getPageWidth() - this.document.getDocumentHeader().getPageSetting().getMarginLeft() - this.document.getDocumentHeader().getPageSetting().getMarginRight();
this.widt... | [
"private",
"void",
"importRow",
"(",
"PdfPRow",
"row",
")",
"{",
"this",
".",
"cells",
"=",
"new",
"ArrayList",
"(",
")",
";",
"this",
".",
"width",
"=",
"this",
".",
"document",
".",
"getDocumentHeader",
"(",
")",
".",
"getPageSetting",
"(",
")",
".",... | Imports a PdfPRow and copies all settings
@param row The PdfPRow to import
@since 2.1.3 | [
"Imports",
"a",
"PdfPRow",
"and",
"copies",
"all",
"settings"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/table/RtfRow.java#L249-L267 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/GeomFactory3ifx.java | GeomFactory3ifx.newPoint | @SuppressWarnings("static-method")
public Point3ifx newPoint(IntegerProperty x, IntegerProperty y, IntegerProperty z) {
"""
Create a point with properties.
@param x the x property.
@param y the y property.
@param z the z property.
@return the vector.
"""
return new Point3ifx(x, y, z);
} | java | @SuppressWarnings("static-method")
public Point3ifx newPoint(IntegerProperty x, IntegerProperty y, IntegerProperty z) {
return new Point3ifx(x, y, z);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"public",
"Point3ifx",
"newPoint",
"(",
"IntegerProperty",
"x",
",",
"IntegerProperty",
"y",
",",
"IntegerProperty",
"z",
")",
"{",
"return",
"new",
"Point3ifx",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
... | Create a point with properties.
@param x the x property.
@param y the y property.
@param z the z property.
@return the vector. | [
"Create",
"a",
"point",
"with",
"properties",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/GeomFactory3ifx.java#L106-L109 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java | JobsInner.listOutputFilesWithServiceResponseAsync | public Observable<ServiceResponse<Page<FileInner>>> listOutputFilesWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final String experimentName, final String jobName, final JobsListOutputFilesOptions jobsListOutputFilesOptions) {
"""
List all directories and files inside the giv... | java | public Observable<ServiceResponse<Page<FileInner>>> listOutputFilesWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final String experimentName, final String jobName, final JobsListOutputFilesOptions jobsListOutputFilesOptions) {
return listOutputFilesSinglePageAsync(resource... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"FileInner",
">",
">",
">",
"listOutputFilesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"workspaceName",
",",
"final",
"String",
"experimentName",
","... | List all directories and files inside the given directory of the Job's output directory (if the output directory is on Azure File Share or Azure Storage Container).
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can onl... | [
"List",
"all",
"directories",
"and",
"files",
"inside",
"the",
"given",
"directory",
"of",
"the",
"Job",
"s",
"output",
"directory",
"(",
"if",
"the",
"output",
"directory",
"is",
"on",
"Azure",
"File",
"Share",
"or",
"Azure",
"Storage",
"Container",
")",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java#L951-L963 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/filecache/DistributedCache.java | DistributedCache.getTimestamp | public static long getTimestamp(Configuration conf, URI cache)
throws IOException {
"""
Returns mtime of a given cache file on hdfs.
@param conf configuration
@param cache cache file
@return mtime of a given cache file on hdfs
@throws IOException
"""
FileSystem fileSystem = FileSystem.get(cache, co... | java | public static long getTimestamp(Configuration conf, URI cache)
throws IOException {
FileSystem fileSystem = FileSystem.get(cache, conf);
Path filePath = new Path(cache.getPath());
return fileSystem.getFileStatus(filePath).getModificationTime();
} | [
"public",
"static",
"long",
"getTimestamp",
"(",
"Configuration",
"conf",
",",
"URI",
"cache",
")",
"throws",
"IOException",
"{",
"FileSystem",
"fileSystem",
"=",
"FileSystem",
".",
"get",
"(",
"cache",
",",
"conf",
")",
";",
"Path",
"filePath",
"=",
"new",
... | Returns mtime of a given cache file on hdfs.
@param conf configuration
@param cache cache file
@return mtime of a given cache file on hdfs
@throws IOException | [
"Returns",
"mtime",
"of",
"a",
"given",
"cache",
"file",
"on",
"hdfs",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/filecache/DistributedCache.java#L643-L649 |
jimmoores/quandl4j | core/src/main/java/com/jimmoores/quandl/MetaDataResult.java | MetaDataResult.getHeaderDefinition | public HeaderDefinition getHeaderDefinition() {
"""
Extract a HeaderDefinition from the meta data. Throws a QuandlRuntimeException if it cannot construct a valid HeaderDefinition
@return the header definition, not null
"""
JSONArray jsonArray = null;
try {
jsonArray = _jsonObject.getJSONArray(... | java | public HeaderDefinition getHeaderDefinition() {
JSONArray jsonArray = null;
try {
jsonArray = _jsonObject.getJSONArray(COLUMN_NAMES_FIELD);
List<String> columnNames = new ArrayList<String>(jsonArray.length());
for (int i = 0; i < jsonArray.length(); i++) {
columnNames.add(jsonArray.get... | [
"public",
"HeaderDefinition",
"getHeaderDefinition",
"(",
")",
"{",
"JSONArray",
"jsonArray",
"=",
"null",
";",
"try",
"{",
"jsonArray",
"=",
"_jsonObject",
".",
"getJSONArray",
"(",
"COLUMN_NAMES_FIELD",
")",
";",
"List",
"<",
"String",
">",
"columnNames",
"=",... | Extract a HeaderDefinition from the meta data. Throws a QuandlRuntimeException if it cannot construct a valid HeaderDefinition
@return the header definition, not null | [
"Extract",
"a",
"HeaderDefinition",
"from",
"the",
"meta",
"data",
".",
"Throws",
"a",
"QuandlRuntimeException",
"if",
"it",
"cannot",
"construct",
"a",
"valid",
"HeaderDefinition"
] | train | https://github.com/jimmoores/quandl4j/blob/5d67ae60279d889da93ae7aa3bf6b7d536f88822/core/src/main/java/com/jimmoores/quandl/MetaDataResult.java#L52-L65 |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/EhCache2Metrics.java | EhCache2Metrics.monitor | public static Ehcache monitor(MeterRegistry registry, Ehcache cache, Iterable<Tag> tags) {
"""
Record metrics on an EhCache cache.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param tags Tags to apply to all recorded metrics.
@return The instrumented cache, u... | java | public static Ehcache monitor(MeterRegistry registry, Ehcache cache, Iterable<Tag> tags) {
new EhCache2Metrics(cache, tags).bindTo(registry);
return cache;
} | [
"public",
"static",
"Ehcache",
"monitor",
"(",
"MeterRegistry",
"registry",
",",
"Ehcache",
"cache",
",",
"Iterable",
"<",
"Tag",
">",
"tags",
")",
"{",
"new",
"EhCache2Metrics",
"(",
"cache",
",",
"tags",
")",
".",
"bindTo",
"(",
"registry",
")",
";",
"... | Record metrics on an EhCache cache.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param tags Tags to apply to all recorded metrics.
@return The instrumented cache, unchanged. The original cache is not wrapped or proxied in any way. | [
"Record",
"metrics",
"on",
"an",
"EhCache",
"cache",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/EhCache2Metrics.java#L59-L62 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java | DomHelper.drawGroup | public void drawGroup(Object parent, Object object, Matrix transformation, Style style) {
"""
Creates a group element in the technology (SVG/VML/...) of this context. A group is meant to group other elements
together, possibly applying a transformation upon them.
@param parent
parent group object
@param obje... | java | public void drawGroup(Object parent, Object object, Matrix transformation, Style style) {
createOrUpdateGroup(parent, object, transformation, style);
} | [
"public",
"void",
"drawGroup",
"(",
"Object",
"parent",
",",
"Object",
"object",
",",
"Matrix",
"transformation",
",",
"Style",
"style",
")",
"{",
"createOrUpdateGroup",
"(",
"parent",
",",
"object",
",",
"transformation",
",",
"style",
")",
";",
"}"
] | Creates a group element in the technology (SVG/VML/...) of this context. A group is meant to group other elements
together, possibly applying a transformation upon them.
@param parent
parent group object
@param object
group object
@param transformation
On each group, it is possible to apply a matrix transformation (cu... | [
"Creates",
"a",
"group",
"element",
"in",
"the",
"technology",
"(",
"SVG",
"/",
"VML",
"/",
"...",
")",
"of",
"this",
"context",
".",
"A",
"group",
"is",
"meant",
"to",
"group",
"other",
"elements",
"together",
"possibly",
"applying",
"a",
"transformation"... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L269-L271 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java | RestClientUtil.addMapDocument | public String addMapDocument(String indexName, Map bean, ClientOptions clientOptions) throws ElasticSearchException {
"""
创建或者更新索引文档
For Elasticsearch 7 and 7+
@param indexName
@param bean
@return
@throws ElasticSearchException
"""
return addDateMapDocument( indexName, _doc, bean,clientOptions);
} | java | public String addMapDocument(String indexName, Map bean, ClientOptions clientOptions) throws ElasticSearchException{
return addDateMapDocument( indexName, _doc, bean,clientOptions);
} | [
"public",
"String",
"addMapDocument",
"(",
"String",
"indexName",
",",
"Map",
"bean",
",",
"ClientOptions",
"clientOptions",
")",
"throws",
"ElasticSearchException",
"{",
"return",
"addDateMapDocument",
"(",
"indexName",
",",
"_doc",
",",
"bean",
",",
"clientOptions... | 创建或者更新索引文档
For Elasticsearch 7 and 7+
@param indexName
@param bean
@return
@throws ElasticSearchException | [
"创建或者更新索引文档",
"For",
"Elasticsearch",
"7",
"and",
"7",
"+"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L4415-L4417 |
anotheria/configureme | src/main/java/org/configureme/sources/ConfigurationSourceKey.java | ConfigurationSourceKey.propertyFile | public static final ConfigurationSourceKey propertyFile(final String name) {
"""
Creates a new configuration source key for property files.
@param name name of the property file.
@return a new configuration source key instance for property files
"""
return new ConfigurationSourceKey(Type.FILE, Format.PRO... | java | public static final ConfigurationSourceKey propertyFile(final String name){
return new ConfigurationSourceKey(Type.FILE, Format.PROPERTIES, name);
} | [
"public",
"static",
"final",
"ConfigurationSourceKey",
"propertyFile",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"ConfigurationSourceKey",
"(",
"Type",
".",
"FILE",
",",
"Format",
".",
"PROPERTIES",
",",
"name",
")",
";",
"}"
] | Creates a new configuration source key for property files.
@param name name of the property file.
@return a new configuration source key instance for property files | [
"Creates",
"a",
"new",
"configuration",
"source",
"key",
"for",
"property",
"files",
"."
] | train | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/sources/ConfigurationSourceKey.java#L201-L203 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.createMessageReceiverFromEntityPathAsync | public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings) {
"""
Asynchronously creates a message receiver to the entity using the client settings in PeekLock mode
@param namespaceEndpointURI endpoint uri o... | java | public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings) {
return createMessageReceiverFromEntityPathAsync(namespaceEndpointURI, entityPath, clientSettings, DEFAULTRECEIVEMODE);
} | [
"public",
"static",
"CompletableFuture",
"<",
"IMessageReceiver",
">",
"createMessageReceiverFromEntityPathAsync",
"(",
"URI",
"namespaceEndpointURI",
",",
"String",
"entityPath",
",",
"ClientSettings",
"clientSettings",
")",
"{",
"return",
"createMessageReceiverFromEntityPathA... | Asynchronously creates a message receiver to the entity using the client settings in PeekLock mode
@param namespaceEndpointURI endpoint uri of entity namespace
@param entityPath path of entity
@param clientSettings client settings
@return a CompletableFuture representing the pending creation of message receiver | [
"Asynchronously",
"creates",
"a",
"message",
"receiver",
"to",
"the",
"entity",
"using",
"the",
"client",
"settings",
"in",
"PeekLock",
"mode"
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L430-L432 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withByte | public Postcard withByte(@Nullable String key, byte value) {
"""
Inserts a byte value into the mapping of this Bundle, replacing
any existing value for the given key.
@param key a String, or null
@param value a byte
@return current
"""
mBundle.putByte(key, value);
return this;
} | java | public Postcard withByte(@Nullable String key, byte value) {
mBundle.putByte(key, value);
return this;
} | [
"public",
"Postcard",
"withByte",
"(",
"@",
"Nullable",
"String",
"key",
",",
"byte",
"value",
")",
"{",
"mBundle",
".",
"putByte",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a byte value into the mapping of this Bundle, replacing
any existing value for the given key.
@param key a String, or null
@param value a byte
@return current | [
"Inserts",
"a",
"byte",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L322-L325 |
jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/MessageReceiverFilterList.java | MessageReceiverFilterList.removeMessageFilter | public boolean removeMessageFilter(Integer intFilterID, boolean bFreeFilter) {
"""
Remove this message filter from this queue.
Note: This will remove a filter that equals this filter, accounting for a copy
passed from a remote client.
@param messageFilter The message filter to remove.
@param bFreeFilter If tru... | java | public boolean removeMessageFilter(Integer intFilterID, boolean bFreeFilter)
{
BaseMessageFilter filter = (BaseMessageFilter)m_mapFilters.remove(intFilterID);
if (filter == null)
{
System.out.println("Error: BaseMessageReceiver.removeMessageFilter");
return false;
... | [
"public",
"boolean",
"removeMessageFilter",
"(",
"Integer",
"intFilterID",
",",
"boolean",
"bFreeFilter",
")",
"{",
"BaseMessageFilter",
"filter",
"=",
"(",
"BaseMessageFilter",
")",
"m_mapFilters",
".",
"remove",
"(",
"intFilterID",
")",
";",
"if",
"(",
"filter",... | Remove this message filter from this queue.
Note: This will remove a filter that equals this filter, accounting for a copy
passed from a remote client.
@param messageFilter The message filter to remove.
@param bFreeFilter If true, free this filter.
@return True if successful. | [
"Remove",
"this",
"message",
"filter",
"from",
"this",
"queue",
".",
"Note",
":",
"This",
"will",
"remove",
"a",
"filter",
"that",
"equals",
"this",
"filter",
"accounting",
"for",
"a",
"copy",
"passed",
"from",
"a",
"remote",
"client",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/MessageReceiverFilterList.java#L158-L170 |
katharsis-project/katharsis-framework | katharsis-core/src/main/java/io/katharsis/core/internal/registry/ResourceRegistryImpl.java | ResourceRegistryImpl.addEntry | public RegistryEntry addEntry(Class<?> resource, RegistryEntry registryEntry) {
"""
Adds a new resource definition to a registry.
@param resource
class of a resource
@param registryEntry
resource information
@param <T>
type of a resource
"""
resources.put(resource, registryEntry);
registryEntry.ini... | java | public RegistryEntry addEntry(Class<?> resource, RegistryEntry registryEntry) {
resources.put(resource, registryEntry);
registryEntry.initialize(moduleRegistry);
logger.debug("Added resource {} to ResourceRegistry", resource.getName());
return registryEntry;
} | [
"public",
"RegistryEntry",
"addEntry",
"(",
"Class",
"<",
"?",
">",
"resource",
",",
"RegistryEntry",
"registryEntry",
")",
"{",
"resources",
".",
"put",
"(",
"resource",
",",
"registryEntry",
")",
";",
"registryEntry",
".",
"initialize",
"(",
"moduleRegistry",
... | Adds a new resource definition to a registry.
@param resource
class of a resource
@param registryEntry
resource information
@param <T>
type of a resource | [
"Adds",
"a",
"new",
"resource",
"definition",
"to",
"a",
"registry",
"."
] | train | https://github.com/katharsis-project/katharsis-framework/blob/73d1a8763c49c5cf4643d43e2dbfedb647630c46/katharsis-core/src/main/java/io/katharsis/core/internal/registry/ResourceRegistryImpl.java#L45-L50 |
alkacon/opencms-core | src/org/opencms/main/CmsSessionManager.java | CmsSessionManager.sendBroadcast | public void sendBroadcast(CmsObject cms, String message, boolean repeat) {
"""
Sends a broadcast to all sessions of all currently authenticated users.<p>
@param cms the OpenCms user context of the user sending the broadcast
@param message the message to broadcast
@param repeat repeat this message
"""
... | java | public void sendBroadcast(CmsObject cms, String message, boolean repeat) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(message)) {
// don't broadcast empty messages
return;
}
// create the broadcast
CmsBroadcast broadcast = new CmsBroadcast(cms.getRequestContext().... | [
"public",
"void",
"sendBroadcast",
"(",
"CmsObject",
"cms",
",",
"String",
"message",
",",
"boolean",
"repeat",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"message",
")",
")",
"{",
"// don't broadcast empty messages",
"return",
";",... | Sends a broadcast to all sessions of all currently authenticated users.<p>
@param cms the OpenCms user context of the user sending the broadcast
@param message the message to broadcast
@param repeat repeat this message | [
"Sends",
"a",
"broadcast",
"to",
"all",
"sessions",
"of",
"all",
"currently",
"authenticated",
"users",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsSessionManager.java#L349-L367 |
samskivert/samskivert | src/main/java/com/samskivert/net/PathUtil.java | PathUtil.appendPath | public static String appendPath (String source, String affix) {
"""
Appends the supplied affix to the specified source path, ensuring
that exactly one path separator (<code>/</code> as we are dealing
with URLs here not platform specific file-system paths) is used
between the two. <em>Note:</em> this means that ... | java | public static String appendPath (String source, String affix)
{
if (source.endsWith("/")) {
if (affix.startsWith("/")) {
return source + affix.substring(1);
} else {
return source + affix;
}
} else if (affix.startsWith("/")) {
... | [
"public",
"static",
"String",
"appendPath",
"(",
"String",
"source",
",",
"String",
"affix",
")",
"{",
"if",
"(",
"source",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"if",
"(",
"affix",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"return",
"s... | Appends the supplied affix to the specified source path, ensuring
that exactly one path separator (<code>/</code> as we are dealing
with URLs here not platform specific file-system paths) is used
between the two. <em>Note:</em> this means that the affix will be
made into a relative path regardless of whether or not it ... | [
"Appends",
"the",
"supplied",
"affix",
"to",
"the",
"specified",
"source",
"path",
"ensuring",
"that",
"exactly",
"one",
"path",
"separator",
"(",
"<code",
">",
"/",
"<",
"/",
"code",
">",
"as",
"we",
"are",
"dealing",
"with",
"URLs",
"here",
"not",
"pla... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/net/PathUtil.java#L45-L58 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplNoCompression_CustomFieldSerializer.java | OWLLiteralImplNoCompression_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLLiteralImplNoCompression instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.goog... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLLiteralImplNoCompression instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLLiteralImplNoCompression",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user.clie... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplNoCompression_CustomFieldSerializer.java#L90-L93 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/ValidateDigitHandler.java | ValidateDigitHandler.fieldChanged | public int fieldChanged(boolean bDisplayOption, int iMoveMode) {
"""
The Field has Changed.
Make sure this is a valid modulus-7 number, if not, return an error.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_... | java | public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{ // Read a valid record
int value = (int)((NumberField)this.getOwner()).getValue();
if ((value / 10) % 7 != value - (value / 10 * 10))
{
Task task = null;
if (this.getOwner() != null)
if (... | [
"public",
"int",
"fieldChanged",
"(",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"// Read a valid record",
"int",
"value",
"=",
"(",
"int",
")",
"(",
"(",
"NumberField",
")",
"this",
".",
"getOwner",
"(",
")",
")",
".",
"getValue",
"("... | The Field has Changed.
Make sure this is a valid modulus-7 number, if not, return an error.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay). | [
"The",
"Field",
"has",
"Changed",
".",
"Make",
"sure",
"this",
"is",
"a",
"valid",
"modulus",
"-",
"7",
"number",
"if",
"not",
"return",
"an",
"error",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/ValidateDigitHandler.java#L60-L78 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriPathSegment | public static void unescapeUriPathSegment(final Reader reader, final Writer writer, final String encoding)
throws IOException {
"""
<p>
Perform am URI path segment <strong>unescape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unesca... | java | public static void unescapeUriPathSegment(final Reader reader, final Writer writer, final String encoding)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (encoding == null) {
throw new ... | [
"public",
"static",
"void",
"unescapeUriPathSegment",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"Ill... | <p>
Perform am URI path segment <strong>unescape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to be percent-encoded in this context (unre... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"segment",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">",
"."... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L2219-L2232 |
infinispan/infinispan | core/src/main/java/org/infinispan/util/concurrent/CompletableFutures.java | CompletableFutures.await | public static boolean await(CompletableFuture<?> future, long time, TimeUnit unit) throws InterruptedException {
"""
It waits until the {@link CompletableFuture} is completed.
<p>
It ignore if the {@link CompletableFuture} is completed normally or exceptionally.
@param future the {@link CompletableFuture} to ... | java | public static boolean await(CompletableFuture<?> future, long time, TimeUnit unit) throws InterruptedException {
try {
requireNonNull(future, "Completable Future must be non-null.").get(time, requireNonNull(unit, "Time Unit must be non-null"));
return true;
} catch (ExecutionException e) {... | [
"public",
"static",
"boolean",
"await",
"(",
"CompletableFuture",
"<",
"?",
">",
"future",
",",
"long",
"time",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"try",
"{",
"requireNonNull",
"(",
"future",
",",
"\"Completable Future must be non... | It waits until the {@link CompletableFuture} is completed.
<p>
It ignore if the {@link CompletableFuture} is completed normally or exceptionally.
@param future the {@link CompletableFuture} to test.
@param time the timeout.
@param unit the timeout unit.
@return {@code true} if completed, {@code false} if timed out... | [
"It",
"waits",
"until",
"the",
"{",
"@link",
"CompletableFuture",
"}",
"is",
"completed",
".",
"<p",
">",
"It",
"ignore",
"if",
"the",
"{",
"@link",
"CompletableFuture",
"}",
"is",
"completed",
"normally",
"or",
"exceptionally",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/util/concurrent/CompletableFutures.java#L88-L97 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.updateAsync | public Observable<AppServicePlanInner> updateAsync(String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan) {
"""
Creates or updates an App Service Plan.
Creates or updates an App Service Plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param ... | java | public Observable<AppServicePlanInner> updateAsync(String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan) {
return updateWithServiceResponseAsync(resourceGroupName, name, appServicePlan).map(new Func1<ServiceResponse<AppServicePlanInner>, AppServicePlanInner>() {
@Overrid... | [
"public",
"Observable",
"<",
"AppServicePlanInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"AppServicePlanPatchResource",
"appServicePlan",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"n... | Creates or updates an App Service Plan.
Creates or updates an App Service Plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param appServicePlan Details of the App Service plan.
@throws IllegalArgumentException thrown if parameters fail ... | [
"Creates",
"or",
"updates",
"an",
"App",
"Service",
"Plan",
".",
"Creates",
"or",
"updates",
"an",
"App",
"Service",
"Plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L974-L981 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readEndTag | private void readEndTag() throws IOException, KriptonRuntimeException {
"""
Read end tag.
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception
"""
read('<');
read('/');
name = readName(); // TODO: pass the expected name in as a ... | java | private void readEndTag() throws IOException, KriptonRuntimeException {
read('<');
read('/');
name = readName(); // TODO: pass the expected name in as a hint?
skip();
read('>');
int sp = (depth - 1) * 4;
if (depth == 0) {
checkRelaxed("read end tag " + name + " with no tags open");
type = COMMENT;... | [
"private",
"void",
"readEndTag",
"(",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"read",
"(",
"'",
"'",
")",
";",
"read",
"(",
"'",
"'",
")",
";",
"name",
"=",
"readName",
"(",
")",
";",
"// TODO: pass the expected name in as a hint?",
... | Read end tag.
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception | [
"Read",
"end",
"tag",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L1155-L1177 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/clhm/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.tryToRetire | boolean tryToRetire(Node<K, V> node, WeightedValue<V> expect) {
"""
Attempts to transition the node from the <tt>alive</tt> state to the
<tt>retired</tt> state.
@param node the entry in the page replacement policy
@param expect the expected weighted value
@return if successful
"""
if (expect.isAl... | java | boolean tryToRetire(Node<K, V> node, WeightedValue<V> expect) {
if (expect.isAlive()) {
final WeightedValue<V> retired = new WeightedValue<V>(expect.value, -expect.weight);
return node.compareAndSet(expect, retired);
}
return false;
} | [
"boolean",
"tryToRetire",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"node",
",",
"WeightedValue",
"<",
"V",
">",
"expect",
")",
"{",
"if",
"(",
"expect",
".",
"isAlive",
"(",
")",
")",
"{",
"final",
"WeightedValue",
"<",
"V",
">",
"retired",
"=",
"new"... | Attempts to transition the node from the <tt>alive</tt> state to the
<tt>retired</tt> state.
@param node the entry in the page replacement policy
@param expect the expected weighted value
@return if successful | [
"Attempts",
"to",
"transition",
"the",
"node",
"from",
"the",
"<tt",
">",
"alive<",
"/",
"tt",
">",
"state",
"to",
"the",
"<tt",
">",
"retired<",
"/",
"tt",
">",
"state",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/clhm/ConcurrentLinkedHashMap.java#L484-L490 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/TenantDataUrl.java | TenantDataUrl.getDBValueUrl | public static MozuUrl getDBValueUrl(String dbEntryQuery, String responseFields) {
"""
Get Resource Url for GetDBValue
@param dbEntryQuery The database entry string to create.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. T... | java | public static MozuUrl getDBValueUrl(String dbEntryQuery, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/tenantdata/{dbEntryQuery}?responseFields={responseFields}");
formatter.formatUrl("dbEntryQuery", dbEntryQuery);
formatter.formatUrl("responseFields", responseFields);
... | [
"public",
"static",
"MozuUrl",
"getDBValueUrl",
"(",
"String",
"dbEntryQuery",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/tenantdata/{dbEntryQuery}?responseFields={responseFields}\"",
")",
";",
"... | Get Resource Url for GetDBValue
@param dbEntryQuery The database entry string to create.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this para... | [
"Get",
"Resource",
"Url",
"for",
"GetDBValue"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/TenantDataUrl.java#L22-L28 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ExpGammaDistribution.java | ExpGammaDistribution.quantile | public static double quantile(double p, double k, double theta, double shift) {
"""
Compute probit (inverse cdf) for ExpGamma distributions.
@param p Probability
@param k k, alpha aka. "shape" parameter
@param theta Theta = 1.0/Beta aka. "scaling" parameter
@param shift Shift parameter
@return Probit for Ex... | java | public static double quantile(double p, double k, double theta, double shift) {
return FastMath.log(GammaDistribution.quantile(p, k, 1)) / theta + shift;
} | [
"public",
"static",
"double",
"quantile",
"(",
"double",
"p",
",",
"double",
"k",
",",
"double",
"theta",
",",
"double",
"shift",
")",
"{",
"return",
"FastMath",
".",
"log",
"(",
"GammaDistribution",
".",
"quantile",
"(",
"p",
",",
"k",
",",
"1",
")",
... | Compute probit (inverse cdf) for ExpGamma distributions.
@param p Probability
@param k k, alpha aka. "shape" parameter
@param theta Theta = 1.0/Beta aka. "scaling" parameter
@param shift Shift parameter
@return Probit for ExpGamma distribution | [
"Compute",
"probit",
"(",
"inverse",
"cdf",
")",
"for",
"ExpGamma",
"distributions",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ExpGammaDistribution.java#L244-L246 |
motown-io/motown | vas/view-model/src/main/java/io/motown/vas/viewmodel/VasSubscriberService.java | VasSubscriberService.updateSubscribers | public void updateSubscribers(ChargingStation chargingStation, Date timestampStatusChange) {
"""
Updates all known subscribers (from the repository) about the new state the charging station is in. Uses the executor
service to execute updaters. Any exceptions thrown by an updater (e.g. client not reachable) will n... | java | public void updateSubscribers(ChargingStation chargingStation, Date timestampStatusChange) {
StatusChange change = new StatusChange(chargingStation.getId(), timestampStatusChange, chargingStation.getState(), chargingStation.getNumberOfFreeEvses());
List<Subscription> subscriptions = subscriptionReposit... | [
"public",
"void",
"updateSubscribers",
"(",
"ChargingStation",
"chargingStation",
",",
"Date",
"timestampStatusChange",
")",
"{",
"StatusChange",
"change",
"=",
"new",
"StatusChange",
"(",
"chargingStation",
".",
"getId",
"(",
")",
",",
"timestampStatusChange",
",",
... | Updates all known subscribers (from the repository) about the new state the charging station is in. Uses the executor
service to execute updaters. Any exceptions thrown by an updater (e.g. client not reachable) will not influence
other updaters.
@param chargingStation charging station that had it's state changed.
@par... | [
"Updates",
"all",
"known",
"subscribers",
"(",
"from",
"the",
"repository",
")",
"about",
"the",
"new",
"state",
"the",
"charging",
"station",
"is",
"in",
".",
"Uses",
"the",
"executor",
"service",
"to",
"execute",
"updaters",
".",
"Any",
"exceptions",
"thro... | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/vas/view-model/src/main/java/io/motown/vas/viewmodel/VasSubscriberService.java#L44-L51 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java | AtlasGraphUtilsV1.addProperty | public static AtlasVertex addProperty(AtlasVertex vertex, String propertyName, Object value) {
"""
Adds an additional value to a multi-property.
@param propertyName
@param value
"""
if (LOG.isDebugEnabled()) {
LOG.debug("==> addProperty({}, {}, {})", toString(vertex), propertyName, valu... | java | public static AtlasVertex addProperty(AtlasVertex vertex, String propertyName, Object value) {
if (LOG.isDebugEnabled()) {
LOG.debug("==> addProperty({}, {}, {})", toString(vertex), propertyName, value);
}
propertyName = encodePropertyKey(propertyName);
vertex.addProperty(pro... | [
"public",
"static",
"AtlasVertex",
"addProperty",
"(",
"AtlasVertex",
"vertex",
",",
"String",
"propertyName",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"==> addProperty({}, {}, {... | Adds an additional value to a multi-property.
@param propertyName
@param value | [
"Adds",
"an",
"additional",
"value",
"to",
"a",
"multi",
"-",
"property",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java#L139-L146 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/StringToOpenTypeConverter.java | StringToOpenTypeConverter.convertToObject | @SuppressWarnings("unchecked")
@Override
public Object convertToObject(OpenType openType, Object pValue) {
"""
Handle conversion for OpenTypes. The value is expected to be in JSON (either
an {@link org.json.simple.JSONAware} object or its string representation.
@param openType target type
@param pValue v... | java | @SuppressWarnings("unchecked")
@Override
public Object convertToObject(OpenType openType, Object pValue) {
if (pValue == null) {
return null;
} else {
for (OpenTypeConverter converter : converters) {
if (converter.canConvert(openType)) {
r... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"Object",
"convertToObject",
"(",
"OpenType",
"openType",
",",
"Object",
"pValue",
")",
"{",
"if",
"(",
"pValue",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{"... | Handle conversion for OpenTypes. The value is expected to be in JSON (either
an {@link org.json.simple.JSONAware} object or its string representation.
@param openType target type
@param pValue value to convert from
@return the converted value | [
"Handle",
"conversion",
"for",
"OpenTypes",
".",
"The",
"value",
"is",
"expected",
"to",
"be",
"in",
"JSON",
"(",
"either",
"an",
"{",
"@link",
"org",
".",
"json",
".",
"simple",
".",
"JSONAware",
"}",
"object",
"or",
"its",
"string",
"representation",
"... | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/StringToOpenTypeConverter.java#L60-L74 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DifferenceEvaluators.java | DifferenceEvaluators.ignorePrologDifferencesExceptDoctype | public static DifferenceEvaluator ignorePrologDifferencesExceptDoctype() {
"""
Ignore any differences except differences inside the doctype
declaration that are part of the <a
href="https://www.w3.org/TR/2008/REC-xml-20081126/#sec-prolog-dtd">XML
prolog</a>.
<p>Here "ignore" means return {@code ComparisonRes... | java | public static DifferenceEvaluator ignorePrologDifferencesExceptDoctype() {
return new DifferenceEvaluator() {
@Override
public ComparisonResult evaluate(Comparison comparison, ComparisonResult orig) {
return belongsToProlog(comparison, false)
|| isSequ... | [
"public",
"static",
"DifferenceEvaluator",
"ignorePrologDifferencesExceptDoctype",
"(",
")",
"{",
"return",
"new",
"DifferenceEvaluator",
"(",
")",
"{",
"@",
"Override",
"public",
"ComparisonResult",
"evaluate",
"(",
"Comparison",
"comparison",
",",
"ComparisonResult",
... | Ignore any differences except differences inside the doctype
declaration that are part of the <a
href="https://www.w3.org/TR/2008/REC-xml-20081126/#sec-prolog-dtd">XML
prolog</a>.
<p>Here "ignore" means return {@code ComparisonResult.EQUAL}.</p>
<p>This is one of the building blocks for mimicing the behavior
of XMLUn... | [
"Ignore",
"any",
"differences",
"except",
"differences",
"inside",
"the",
"doctype",
"declaration",
"that",
"are",
"part",
"of",
"the",
"<a",
"href",
"=",
"https",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/",
"2008",
"/",
"REC",
"-",
"xml",... | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DifferenceEvaluators.java#L203-L212 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/transform/OpPredicate.java | OpPredicate.nameEquals | public static OpPredicate nameEquals(final String name) {
"""
Return true if the operation own (user specified) name equals the specified name
"""
return new OpPredicate() {
@Override
public boolean matches(SameDiff sameDiff, DifferentialFunction function) {
retu... | java | public static OpPredicate nameEquals(final String name){
return new OpPredicate() {
@Override
public boolean matches(SameDiff sameDiff, DifferentialFunction function) {
return function.getOwnName().equals(name);
}
};
} | [
"public",
"static",
"OpPredicate",
"nameEquals",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"OpPredicate",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"SameDiff",
"sameDiff",
",",
"DifferentialFunction",
"function",
")",
... | Return true if the operation own (user specified) name equals the specified name | [
"Return",
"true",
"if",
"the",
"operation",
"own",
"(",
"user",
"specified",
")",
"name",
"equals",
"the",
"specified",
"name"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/transform/OpPredicate.java#L42-L49 |
micronaut-projects/micronaut-core | http-server-netty/src/main/java/io/micronaut/http/server/netty/SmartHttpContentCompressor.java | SmartHttpContentCompressor.shouldSkip | public boolean shouldSkip(@Nullable String contentType, @Nullable Integer contentLength) {
"""
Determines if encoding should occur based on the content type and length.
@param contentType The content type
@param contentLength The content length
@return True if the content is compressible and larger than 1KB... | java | public boolean shouldSkip(@Nullable String contentType, @Nullable Integer contentLength) {
if (contentType == null) {
return true;
}
return !MediaType.isTextBased(contentType) || (contentLength != null && contentLength >= 0 && contentLength < compressionThreshold);
} | [
"public",
"boolean",
"shouldSkip",
"(",
"@",
"Nullable",
"String",
"contentType",
",",
"@",
"Nullable",
"Integer",
"contentLength",
")",
"{",
"if",
"(",
"contentType",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"return",
"!",
"MediaType",
".",
"is... | Determines if encoding should occur based on the content type and length.
@param contentType The content type
@param contentLength The content length
@return True if the content is compressible and larger than 1KB | [
"Determines",
"if",
"encoding",
"should",
"occur",
"based",
"on",
"the",
"content",
"type",
"and",
"length",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/SmartHttpContentCompressor.java#L70-L75 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/ZoneRulesBuilder.java | ZoneRulesBuilder.addWindow | public ZoneRulesBuilder addWindow(
ZoneOffset standardOffset,
LocalDateTime until,
TimeDefinition untilDefinition) {
"""
Adds a window to the builder that can be used to filter a set of rules.
<p>
This method defines and adds a window to the zone where the standard offset is s... | java | public ZoneRulesBuilder addWindow(
ZoneOffset standardOffset,
LocalDateTime until,
TimeDefinition untilDefinition) {
Jdk8Methods.requireNonNull(standardOffset, "standardOffset");
Jdk8Methods.requireNonNull(until, "until");
Jdk8Methods.requireNonNull(untilDefin... | [
"public",
"ZoneRulesBuilder",
"addWindow",
"(",
"ZoneOffset",
"standardOffset",
",",
"LocalDateTime",
"until",
",",
"TimeDefinition",
"untilDefinition",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"standardOffset",
",",
"\"standardOffset\"",
")",
";",
"Jdk8Meth... | Adds a window to the builder that can be used to filter a set of rules.
<p>
This method defines and adds a window to the zone where the standard offset is specified.
The window limits the effect of subsequent additions of transition rules
or fixed savings. If neither rules or fixed savings are added to the window
then ... | [
"Adds",
"a",
"window",
"to",
"the",
"builder",
"that",
"can",
"be",
"used",
"to",
"filter",
"a",
"set",
"of",
"rules",
".",
"<p",
">",
"This",
"method",
"defines",
"and",
"adds",
"a",
"window",
"to",
"the",
"zone",
"where",
"the",
"standard",
"offset",... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/ZoneRulesBuilder.java#L116-L130 |
morfologik/morfologik-stemming | morfologik-fsa-builders/src/main/java/morfologik/fsa/builders/FSAUtils.java | FSAUtils.toDot | public static void toDot(Writer w, FSA fsa, int node) throws IOException {
"""
Saves the right-language reachable from a given FSA node, formatted as an
input for the graphviz package (expressed in the <code>dot</code>
language), to the given writer.
@param w The writer to write dot language description of th... | java | public static void toDot(Writer w, FSA fsa, int node) throws IOException {
w.write("digraph Automaton {\n");
w.write(" rankdir = LR;\n");
final BitSet visited = new BitSet();
w.write(" stop [shape=doublecircle,label=\"\"];\n");
w.write(" initial [shape=plaintext,label=\"\"];\n");
w.... | [
"public",
"static",
"void",
"toDot",
"(",
"Writer",
"w",
",",
"FSA",
"fsa",
",",
"int",
"node",
")",
"throws",
"IOException",
"{",
"w",
".",
"write",
"(",
"\"digraph Automaton {\\n\"",
")",
";",
"w",
".",
"write",
"(",
"\" rankdir = LR;\\n\"",
")",
";",
... | Saves the right-language reachable from a given FSA node, formatted as an
input for the graphviz package (expressed in the <code>dot</code>
language), to the given writer.
@param w The writer to write dot language description of the automaton.
@param fsa The automaton to visualize.
@param node Starting node (subgraph ... | [
"Saves",
"the",
"right",
"-",
"language",
"reachable",
"from",
"a",
"given",
"FSA",
"node",
"formatted",
"as",
"an",
"input",
"for",
"the",
"graphviz",
"package",
"(",
"expressed",
"in",
"the",
"<code",
">",
"dot<",
"/",
"code",
">",
"language",
")",
"to... | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-fsa-builders/src/main/java/morfologik/fsa/builders/FSAUtils.java#L62-L74 |
j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/util/ReflectionUtils.java | ReflectionUtils.methodBelongsTo | public static boolean methodBelongsTo(Method m, Method[] methods) {
"""
Returns true if the method is in the method array.
@param m the method
@param methods the method array
@return true if the method is in the method array.
"""
boolean result = false;
for (int i = 0; i < methods.length && !result;... | java | public static boolean methodBelongsTo(Method m, Method[] methods){
boolean result = false;
for (int i = 0; i < methods.length && !result; i++) {
if(methodEquals (methods [i], m)){
result = true;
}
}
return result;
} | [
"public",
"static",
"boolean",
"methodBelongsTo",
"(",
"Method",
"m",
",",
"Method",
"[",
"]",
"methods",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"methods",
".",
"length",
"&&",
"!",
"result"... | Returns true if the method is in the method array.
@param m the method
@param methods the method array
@return true if the method is in the method array. | [
"Returns",
"true",
"if",
"the",
"method",
"is",
"in",
"the",
"method",
"array",
"."
] | train | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/util/ReflectionUtils.java#L31-L41 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java | SequenceMixin.sequenceEqualityIgnoreCase | public static <C extends Compound> boolean sequenceEqualityIgnoreCase(Sequence<C> source, Sequence<C> target) {
"""
A case-insensitive manner of comparing two sequence objects together.
We will throw out any compounds which fail to match on their sequence
length & compound sets used. The code will also bail out ... | java | public static <C extends Compound> boolean sequenceEqualityIgnoreCase(Sequence<C> source, Sequence<C> target) {
return baseSequenceEquality(source, target, true);
} | [
"public",
"static",
"<",
"C",
"extends",
"Compound",
">",
"boolean",
"sequenceEqualityIgnoreCase",
"(",
"Sequence",
"<",
"C",
">",
"source",
",",
"Sequence",
"<",
"C",
">",
"target",
")",
"{",
"return",
"baseSequenceEquality",
"(",
"source",
",",
"target",
"... | A case-insensitive manner of comparing two sequence objects together.
We will throw out any compounds which fail to match on their sequence
length & compound sets used. The code will also bail out the moment
we find something is wrong with a Sequence. Cost to run is linear to
the length of the Sequence.
@param <C> The... | [
"A",
"case",
"-",
"insensitive",
"manner",
"of",
"comparing",
"two",
"sequence",
"objects",
"together",
".",
"We",
"will",
"throw",
"out",
"any",
"compounds",
"which",
"fail",
"to",
"match",
"on",
"their",
"sequence",
"length",
"&",
"compound",
"sets",
"used... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L355-L357 |
99soft/rocoto | src/main/java/org/nnsoft/guice/rocoto/variables/AbstractAppender.java | AbstractAppender.resolve | public String resolve( Map<String, String> configuration ) {
"""
Begin resolving process with this appender against the provided configuration.
"""
StringBuilder buffer = new StringBuilder();
append( buffer, configuration, null );
return buffer.toString();
} | java | public String resolve( Map<String, String> configuration )
{
StringBuilder buffer = new StringBuilder();
append( buffer, configuration, null );
return buffer.toString();
} | [
"public",
"String",
"resolve",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"configuration",
")",
"{",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"append",
"(",
"buffer",
",",
"configuration",
",",
"null",
")",
";",
"return",
... | Begin resolving process with this appender against the provided configuration. | [
"Begin",
"resolving",
"process",
"with",
"this",
"appender",
"against",
"the",
"provided",
"configuration",
"."
] | train | https://github.com/99soft/rocoto/blob/9f54ed913cae54d613b3bc7a352f579d0c6b816f/src/main/java/org/nnsoft/guice/rocoto/variables/AbstractAppender.java#L86-L91 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/watchdir/WatchDir.java | WatchDir._registerDirRecursive | private void _registerDirRecursive (@Nonnull final Path aStartDir) throws IOException {
"""
Register the given directory, and all its sub-directories, with the
WatchService.
@param aStartDir
The start directory to be iterated. May not be <code>null</code>.
"""
// register directory and sub-directories... | java | private void _registerDirRecursive (@Nonnull final Path aStartDir) throws IOException
{
// register directory and sub-directories
Files.walkFileTree (aStartDir, new SimpleFileVisitor <Path> ()
{
@Override
public FileVisitResult preVisitDirectory (final Path dir, final BasicFileAttributes attrs... | [
"private",
"void",
"_registerDirRecursive",
"(",
"@",
"Nonnull",
"final",
"Path",
"aStartDir",
")",
"throws",
"IOException",
"{",
"// register directory and sub-directories",
"Files",
".",
"walkFileTree",
"(",
"aStartDir",
",",
"new",
"SimpleFileVisitor",
"<",
"Path",
... | Register the given directory, and all its sub-directories, with the
WatchService.
@param aStartDir
The start directory to be iterated. May not be <code>null</code>. | [
"Register",
"the",
"given",
"directory",
"and",
"all",
"its",
"sub",
"-",
"directories",
"with",
"the",
"WatchService",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/watchdir/WatchDir.java#L101-L113 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/ByteUtil.java | ByteUtil.decodeBcd | public static String decodeBcd(byte[] data, int offset, int len) {
"""
BCD decodes a byte array into a String. For example, addresses inside
PDUs for SMS are usually BCD encoded. An address of "13134434272" will
actually look like this inside the byte[] "31314443722F"
len is the number of bytes
to read.
... | java | public static String decodeBcd(byte[] data, int offset, int len) {
StringBuilder result = new StringBuilder();
// loop through byte array until we get to the end or an F
for (int i = offset; i < (offset + len); i++) {
// get buffer
StringBuilder x = new StringBuilder(enc... | [
"public",
"static",
"String",
"decodeBcd",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// loop through byte array until we get to the end or an F",
"for",... | BCD decodes a byte array into a String. For example, addresses inside
PDUs for SMS are usually BCD encoded. An address of "13134434272" will
actually look like this inside the byte[] "31314443722F"
len is the number of bytes
to read. | [
"BCD",
"decodes",
"a",
"byte",
"array",
"into",
"a",
"String",
".",
"For",
"example",
"addresses",
"inside",
"PDUs",
"for",
"SMS",
"are",
"usually",
"BCD",
"encoded",
".",
"An",
"address",
"of",
"13134434272",
"will",
"actually",
"look",
"like",
"this",
"i... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/ByteUtil.java#L61-L78 |
libgdx/gdx-ai | gdx-ai/src/com/badlogic/gdx/ai/utils/ArithmeticUtils.java | ArithmeticUtils.lcmPositive | public static int lcmPositive (int a, int b) throws ArithmeticException {
"""
Returns the least common multiple of the absolute value of two numbers, using the formula
{@code lcm(a, b) = (a / gcd(a, b)) * b}.
<p>
Special cases:
<ul>
<li>The invocations {@code lcm(Integer.MIN_VALUE, n)} and {@code lcm(n, Integ... | java | public static int lcmPositive (int a, int b) throws ArithmeticException {
if (a == 0 || b == 0) return 0;
int lcm = Math.abs(mulAndCheck(a / gcdPositive(a, b), b));
if (lcm == Integer.MIN_VALUE) {
throw new ArithmeticException("overflow: lcm(" + a + ", " + b + ") > 2^31");
}
return lcm;
} | [
"public",
"static",
"int",
"lcmPositive",
"(",
"int",
"a",
",",
"int",
"b",
")",
"throws",
"ArithmeticException",
"{",
"if",
"(",
"a",
"==",
"0",
"||",
"b",
"==",
"0",
")",
"return",
"0",
";",
"int",
"lcm",
"=",
"Math",
".",
"abs",
"(",
"mulAndChec... | Returns the least common multiple of the absolute value of two numbers, using the formula
{@code lcm(a, b) = (a / gcd(a, b)) * b}.
<p>
Special cases:
<ul>
<li>The invocations {@code lcm(Integer.MIN_VALUE, n)} and {@code lcm(n, Integer.MIN_VALUE)}, where {@code abs(n)} is a power
of 2, throw an {@code ArithmeticExceptio... | [
"Returns",
"the",
"least",
"common",
"multiple",
"of",
"the",
"absolute",
"value",
"of",
"two",
"numbers",
"using",
"the",
"formula",
"{",
"@code",
"lcm",
"(",
"a",
"b",
")",
"=",
"(",
"a",
"/",
"gcd",
"(",
"a",
"b",
"))",
"*",
"b",
"}",
".",
"<p... | train | https://github.com/libgdx/gdx-ai/blob/2d1523a97193a45e18e11a4837c6800d08f177c5/gdx-ai/src/com/badlogic/gdx/ai/utils/ArithmeticUtils.java#L102-L110 |
alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.minBy | public Stream minBy(String inputFieldName) {
"""
This aggregator operation computes the minimum of tuples by the given {@code inputFieldName} and it is
assumed that its value is an instance of {@code Comparable}. If the value of tuple with field {@code inputFieldName} is not an
instance of {@code Comparable} the... | java | public Stream minBy(String inputFieldName) {
Aggregator<ComparisonAggregator.State> min = new Min(inputFieldName);
return comparableAggregateStream(inputFieldName, min);
} | [
"public",
"Stream",
"minBy",
"(",
"String",
"inputFieldName",
")",
"{",
"Aggregator",
"<",
"ComparisonAggregator",
".",
"State",
">",
"min",
"=",
"new",
"Min",
"(",
"inputFieldName",
")",
";",
"return",
"comparableAggregateStream",
"(",
"inputFieldName",
",",
"m... | This aggregator operation computes the minimum of tuples by the given {@code inputFieldName} and it is
assumed that its value is an instance of {@code Comparable}. If the value of tuple with field {@code inputFieldName} is not an
instance of {@code Comparable} then it throws {@code ClassCastException}
@param inputFiel... | [
"This",
"aggregator",
"operation",
"computes",
"the",
"minimum",
"of",
"tuples",
"by",
"the",
"given",
"{",
"@code",
"inputFieldName",
"}",
"and",
"it",
"is",
"assumed",
"that",
"its",
"value",
"is",
"an",
"instance",
"of",
"{",
"@code",
"Comparable",
"}",
... | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L482-L485 |
azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java | HadoopJobUtils.killJobOnCluster | public static void killJobOnCluster(String applicationId, Logger log) throws YarnException,
IOException {
"""
<pre>
Uses YarnClient to kill the job on HDFS.
Using JobClient only works partially:
If yarn container has started but spark job haven't, it will kill
If spark job has started, the cancel will ha... | java | public static void killJobOnCluster(String applicationId, Logger log) throws YarnException,
IOException {
YarnConfiguration yarnConf = new YarnConfiguration();
YarnClient yarnClient = YarnClient.createYarnClient();
yarnClient.init(yarnConf);
yarnClient.start();
String[] split = applicationId... | [
"public",
"static",
"void",
"killJobOnCluster",
"(",
"String",
"applicationId",
",",
"Logger",
"log",
")",
"throws",
"YarnException",
",",
"IOException",
"{",
"YarnConfiguration",
"yarnConf",
"=",
"new",
"YarnConfiguration",
"(",
")",
";",
"YarnClient",
"yarnClient"... | <pre>
Uses YarnClient to kill the job on HDFS.
Using JobClient only works partially:
If yarn container has started but spark job haven't, it will kill
If spark job has started, the cancel will hang until the spark job is complete
If the spark job is complete, it will return immediately, with a job not found on job trac... | [
"<pre",
">",
"Uses",
"YarnClient",
"to",
"kill",
"the",
"job",
"on",
"HDFS",
".",
"Using",
"JobClient",
"only",
"works",
"partially",
":",
"If",
"yarn",
"container",
"has",
"started",
"but",
"spark",
"job",
"haven",
"t",
"it",
"will",
"kill",
"If",
"spar... | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java#L494-L509 |
pressgang-ccms/PressGangCCMSQuery | src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java | BaseFilterQueryBuilder.addIdInArrayCondition | protected void addIdInArrayCondition(final String propertyName, final String[] values) throws NumberFormatException {
"""
Add a Field Search Condition that will check if the id field exists in an array of id values that are represented as a
String. eg. {@code field IN (values)}
@param propertyName The name of ... | java | protected void addIdInArrayCondition(final String propertyName, final String[] values) throws NumberFormatException {
addIdInArrayCondition(getRootPath().get(propertyName).as(Integer.class), values);
} | [
"protected",
"void",
"addIdInArrayCondition",
"(",
"final",
"String",
"propertyName",
",",
"final",
"String",
"[",
"]",
"values",
")",
"throws",
"NumberFormatException",
"{",
"addIdInArrayCondition",
"(",
"getRootPath",
"(",
")",
".",
"get",
"(",
"propertyName",
"... | Add a Field Search Condition that will check if the id field exists in an array of id values that are represented as a
String. eg. {@code field IN (values)}
@param propertyName The name of the field id as defined in the Entity mapping class.
@param values The array of Ids to be compared to.
@throws NumberFormatE... | [
"Add",
"a",
"Field",
"Search",
"Condition",
"that",
"will",
"check",
"if",
"the",
"id",
"field",
"exists",
"in",
"an",
"array",
"of",
"id",
"values",
"that",
"are",
"represented",
"as",
"a",
"String",
".",
"eg",
".",
"{",
"@code",
"field",
"IN",
"(",
... | train | https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java#L319-L321 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpResponse.java | HttpResponse.writeBody | public long writeBody(OutputStream out, boolean isCloseOut, StreamProgress streamProgress) {
"""
将响应内容写出到{@link OutputStream}<br>
异步模式下直接读取Http流写出,同步模式下将存储在内存中的响应内容写出<br>
写出后会关闭Http流(异步模式)
@param out 写出的流
@param isCloseOut 是否关闭输出流
@param streamProgress 进度显示接口,通过实现此接口显示下载进度
@return 写出bytes数
@since 3.3.2
... | java | public long writeBody(OutputStream out, boolean isCloseOut, StreamProgress streamProgress) {
if (null == out) {
throw new NullPointerException("[out] is null!");
}
try {
return IoUtil.copyByNIO(bodyStream(), out, IoUtil.DEFAULT_BUFFER_SIZE, streamProgress);
} finally {
IoUtil.close(this);
if... | [
"public",
"long",
"writeBody",
"(",
"OutputStream",
"out",
",",
"boolean",
"isCloseOut",
",",
"StreamProgress",
"streamProgress",
")",
"{",
"if",
"(",
"null",
"==",
"out",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"[out] is null!\"",
")",
";",
"... | 将响应内容写出到{@link OutputStream}<br>
异步模式下直接读取Http流写出,同步模式下将存储在内存中的响应内容写出<br>
写出后会关闭Http流(异步模式)
@param out 写出的流
@param isCloseOut 是否关闭输出流
@param streamProgress 进度显示接口,通过实现此接口显示下载进度
@return 写出bytes数
@since 3.3.2 | [
"将响应内容写出到",
"{",
"@link",
"OutputStream",
"}",
"<br",
">",
"异步模式下直接读取Http流写出,同步模式下将存储在内存中的响应内容写出<br",
">",
"写出后会关闭Http流(异步模式)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpResponse.java#L235-L247 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/AppUtil.java | AppUtil.startWebBrowser | public static void startWebBrowser(@NonNull final Context context, @NonNull final String uri) {
"""
Starts the web browser in order to show a specific URI. If an error occurs while starting the
web browser an {@link ActivityNotFoundException} will be thrown.
@param context
The context, the web browser should ... | java | public static void startWebBrowser(@NonNull final Context context, @NonNull final String uri) {
Condition.INSTANCE.ensureNotNull(uri, "The URI may not be null");
Condition.INSTANCE.ensureNotEmpty(uri, "The URI may not be empty");
startWebBrowser(context, Uri.parse(
(uri.startsWit... | [
"public",
"static",
"void",
"startWebBrowser",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"NonNull",
"final",
"String",
"uri",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"uri",
",",
"\"The URI may not be null\"",
")",
... | Starts the web browser in order to show a specific URI. If an error occurs while starting the
web browser an {@link ActivityNotFoundException} will be thrown.
@param context
The context, the web browser should be started from, as an instance of the class
{@link Context}. The context may not be null
@param uri
The URI,... | [
"Starts",
"the",
"web",
"browser",
"in",
"order",
"to",
"show",
"a",
"specific",
"URI",
".",
"If",
"an",
"error",
"occurs",
"while",
"starting",
"the",
"web",
"browser",
"an",
"{",
"@link",
"ActivityNotFoundException",
"}",
"will",
"be",
"thrown",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/AppUtil.java#L178-L184 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/DefaultValueFunction.java | DefaultValueFunction.defaultValue | public static DefaultValueFunction defaultValue(Field field, Object defaultValue) {
"""
Creates new {@link DefaultValueFunction} representing {@code def(field.getName(), defaultValue))}
@param field must not be null
@param defaultValue must not be null
@return
"""
Assert.notNull(field, "Field must not ... | java | public static DefaultValueFunction defaultValue(Field field, Object defaultValue) {
Assert.notNull(field, "Field must not be 'null' for default value operation.");
return new DefaultValueFunction(field, defaultValue);
} | [
"public",
"static",
"DefaultValueFunction",
"defaultValue",
"(",
"Field",
"field",
",",
"Object",
"defaultValue",
")",
"{",
"Assert",
".",
"notNull",
"(",
"field",
",",
"\"Field must not be 'null' for default value operation.\"",
")",
";",
"return",
"new",
"DefaultValue... | Creates new {@link DefaultValueFunction} representing {@code def(field.getName(), defaultValue))}
@param field must not be null
@param defaultValue must not be null
@return | [
"Creates",
"new",
"{",
"@link",
"DefaultValueFunction",
"}",
"representing",
"{",
"@code",
"def",
"(",
"field",
".",
"getName",
"()",
"defaultValue",
"))",
"}"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/DefaultValueFunction.java#L58-L63 |
outbrain/ob1k | ob1k-core/src/main/java/com/outbrain/ob1k/server/netty/HttpStaticFileServerHandler.java | HttpStaticFileServerHandler.setDateAndCacheHeaders | private void setDateAndCacheHeaders(final HttpResponse response) {
"""
Sets the Date and Cache headers for the HTTP Response
@param response HTTP response
"""
final SimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);
dateFormatter.setTimeZone(TimeZone.getTimeZone(HTTP... | java | private void setDateAndCacheHeaders(final HttpResponse response) {
final SimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);
dateFormatter.setTimeZone(TimeZone.getTimeZone(HTTP_DATE_GMT_TIMEZONE));
// Date header
final Calendar time = new GregorianCalendar();
respons... | [
"private",
"void",
"setDateAndCacheHeaders",
"(",
"final",
"HttpResponse",
"response",
")",
"{",
"final",
"SimpleDateFormat",
"dateFormatter",
"=",
"new",
"SimpleDateFormat",
"(",
"HTTP_DATE_FORMAT",
",",
"Locale",
".",
"US",
")",
";",
"dateFormatter",
".",
"setTime... | Sets the Date and Cache headers for the HTTP Response
@param response HTTP response | [
"Sets",
"the",
"Date",
"and",
"Cache",
"headers",
"for",
"the",
"HTTP",
"Response"
] | train | https://github.com/outbrain/ob1k/blob/9e43ab39230c5787065053da0f766d822d0fe4e7/ob1k-core/src/main/java/com/outbrain/ob1k/server/netty/HttpStaticFileServerHandler.java#L226-L239 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.escapeUriQueryParam | public static void escapeUriQueryParam(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform am URI query parameter (name or value) <strong>escape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding,
writing results to a <tt>Writer</tt>.
</p>
<p>
... | java | public static void escapeUriQueryParam(final String text, final Writer writer)
throws IOException {
escapeUriQueryParam(text, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"escapeUriQueryParam",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeUriQueryParam",
"(",
"text",
",",
"writer",
",",
"DEFAULT_ENCODING",
")",
";",
"}"
] | <p>
Perform am URI query parameter (name or value) <strong>escape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding,
writing results to a <tt>Writer</tt>.
</p>
<p>
The following are the only allowed chars in an URI query parameter (will not be escaped):
</p>
<ul>
<li><tt>A-Z a-z 0-9</tt></l... | [
"<p",
">",
"Perform",
"am",
"URI",
"query",
"parameter",
"(",
"name",
"or",
"value",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L619-L622 |
appium/java-client | src/main/java/io/appium/java_client/imagecomparison/ComparisonResult.java | ComparisonResult.mapToPoint | public static Point mapToPoint(Map<String, Object> map) {
"""
Transforms a map into {@link Point} object.
@param map the source map.
@return {@link Point} object
"""
return new Point(toSeleniumCoordinate(map.get("x")), toSeleniumCoordinate(map.get("y")));
} | java | public static Point mapToPoint(Map<String, Object> map) {
return new Point(toSeleniumCoordinate(map.get("x")), toSeleniumCoordinate(map.get("y")));
} | [
"public",
"static",
"Point",
"mapToPoint",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"return",
"new",
"Point",
"(",
"toSeleniumCoordinate",
"(",
"map",
".",
"get",
"(",
"\"x\"",
")",
")",
",",
"toSeleniumCoordinate",
"(",
"map",
"."... | Transforms a map into {@link Point} object.
@param map the source map.
@return {@link Point} object | [
"Transforms",
"a",
"map",
"into",
"{",
"@link",
"Point",
"}",
"object",
"."
] | train | https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/ComparisonResult.java#L115-L117 |
landawn/AbacusUtil | src/com/landawn/abacus/dataSource/PoolableConnection.java | PoolableConnection.setClientInfo | @Override
public void setClientInfo(String name, String value) throws SQLClientInfoException {
"""
Method setClientInfo.
@param name
@param value
@throws SQLClientInfoException
@see java.sql.Connection#setClientInfo(String, String)
"""
internalConn.setClientInfo(name, value);
} | java | @Override
public void setClientInfo(String name, String value) throws SQLClientInfoException {
internalConn.setClientInfo(name, value);
} | [
"@",
"Override",
"public",
"void",
"setClientInfo",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"SQLClientInfoException",
"{",
"internalConn",
".",
"setClientInfo",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Method setClientInfo.
@param name
@param value
@throws SQLClientInfoException
@see java.sql.Connection#setClientInfo(String, String) | [
"Method",
"setClientInfo",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolableConnection.java#L857-L860 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/node/locate/KeyValueLocator.java | KeyValueLocator.partitionForKey | private static int partitionForKey(byte[] key, int numPartitions) {
"""
Calculate the vbucket for the given key.
@param key the key to calculate from.
@param numPartitions the number of partitions in the bucket.
@return the calculated partition.
"""
CRC32 crc32 = new CRC32();
crc32.update(... | java | private static int partitionForKey(byte[] key, int numPartitions) {
CRC32 crc32 = new CRC32();
crc32.update(key);
long rv = (crc32.getValue() >> 16) & 0x7fff;
return (int) rv &numPartitions - 1;
} | [
"private",
"static",
"int",
"partitionForKey",
"(",
"byte",
"[",
"]",
"key",
",",
"int",
"numPartitions",
")",
"{",
"CRC32",
"crc32",
"=",
"new",
"CRC32",
"(",
")",
";",
"crc32",
".",
"update",
"(",
"key",
")",
";",
"long",
"rv",
"=",
"(",
"crc32",
... | Calculate the vbucket for the given key.
@param key the key to calculate from.
@param numPartitions the number of partitions in the bucket.
@return the calculated partition. | [
"Calculate",
"the",
"vbucket",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/node/locate/KeyValueLocator.java#L239-L244 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java | VirtualNetworksInner.updateTags | public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName) {
"""
Updates a virtual network tags.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@throws IllegalArgumentException thrown if parameters fail the va... | java | public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().last().body();
} | [
"public",
"VirtualNetworkInner",
"updateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkName",
")",
".",
"toBlocking",
"(",
")",
".",
... | Updates a virtual network tags.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all o... | [
"Updates",
"a",
"virtual",
"network",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java#L623-L625 |
lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibTag.java | TagLibTag.setTTTClassDefinition | public void setTTTClassDefinition(String tttClass, Identification id, Attributes attr) {
"""
Setzt die implementierende Klassendefinition des Evaluator. Diese Methode wird durch die Klasse
TagLibFactory verwendet.
@param tteClass Klassendefinition der Evaluator-Implementation.
"""
this.tttCD = ClassDefini... | java | public void setTTTClassDefinition(String tttClass, Identification id, Attributes attr) {
this.tttCD = ClassDefinitionImpl.toClassDefinition(tttClass, id, attr);
this.tttConstructor = null;
} | [
"public",
"void",
"setTTTClassDefinition",
"(",
"String",
"tttClass",
",",
"Identification",
"id",
",",
"Attributes",
"attr",
")",
"{",
"this",
".",
"tttCD",
"=",
"ClassDefinitionImpl",
".",
"toClassDefinition",
"(",
"tttClass",
",",
"id",
",",
"attr",
")",
";... | Setzt die implementierende Klassendefinition des Evaluator. Diese Methode wird durch die Klasse
TagLibFactory verwendet.
@param tteClass Klassendefinition der Evaluator-Implementation. | [
"Setzt",
"die",
"implementierende",
"Klassendefinition",
"des",
"Evaluator",
".",
"Diese",
"Methode",
"wird",
"durch",
"die",
"Klasse",
"TagLibFactory",
"verwendet",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibTag.java#L598-L601 |
playn/playn | html/src/playn/html/HtmlInput.java | HtmlInput.getRelativeX | static float getRelativeX (NativeEvent e, Element target) {
"""
Gets the event's x-position relative to a given element.
@param e native event
@param target the element whose coordinate system is to be used
@return the relative x-position
"""
return (e.getClientX() - target.getAbsoluteLeft() + target.... | java | static float getRelativeX (NativeEvent e, Element target) {
return (e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() +
target.getOwnerDocument().getScrollLeft()) / HtmlGraphics.experimentalScale;
} | [
"static",
"float",
"getRelativeX",
"(",
"NativeEvent",
"e",
",",
"Element",
"target",
")",
"{",
"return",
"(",
"e",
".",
"getClientX",
"(",
")",
"-",
"target",
".",
"getAbsoluteLeft",
"(",
")",
"+",
"target",
".",
"getScrollLeft",
"(",
")",
"+",
"target"... | Gets the event's x-position relative to a given element.
@param e native event
@param target the element whose coordinate system is to be used
@return the relative x-position | [
"Gets",
"the",
"event",
"s",
"x",
"-",
"position",
"relative",
"to",
"a",
"given",
"element",
"."
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/html/src/playn/html/HtmlInput.java#L311-L314 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/EventHelper.java | EventHelper.addDelayedStyler | public void addDelayedStyler(String tag, Collection<Advanced> advanced, Chunk chunk) {
"""
add a styler that will do its styling in {@link #onGenericTag(com.itextpdf.text.pdf.PdfWriter, com.itextpdf.text.Document, com.itextpdf.text.Rectangle, java.lang.String)
}.
@param tag
@param advanced
@param chunk used ... | java | public void addDelayedStyler(String tag, Collection<Advanced> advanced, Chunk chunk) {
addDelayedStyler(tag, advanced, chunk, null);
} | [
"public",
"void",
"addDelayedStyler",
"(",
"String",
"tag",
",",
"Collection",
"<",
"Advanced",
">",
"advanced",
",",
"Chunk",
"chunk",
")",
"{",
"addDelayedStyler",
"(",
"tag",
",",
"advanced",
",",
"chunk",
",",
"null",
")",
";",
"}"
] | add a styler that will do its styling in {@link #onGenericTag(com.itextpdf.text.pdf.PdfWriter, com.itextpdf.text.Document, com.itextpdf.text.Rectangle, java.lang.String)
}.
@param tag
@param advanced
@param chunk used when debugging, for placing debug info at the right position in the pdf
@see Chunk#Chunk(com.itextpdf... | [
"add",
"a",
"styler",
"that",
"will",
"do",
"its",
"styling",
"in",
"{",
"@link",
"#onGenericTag",
"(",
"com",
".",
"itextpdf",
".",
"text",
".",
"pdf",
".",
"PdfWriter",
"com",
".",
"itextpdf",
".",
"text",
".",
"Document",
"com",
".",
"itextpdf",
"."... | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/EventHelper.java#L572-L574 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/types/TimecodeRange.java | TimecodeRange.add | public TimecodeRange add(SampleCount samples) {
"""
Move the range right by the specified number of samples
@param samples
@return
"""
final Timecode newStart = start.add(samples);
final Timecode newEnd = end.add(samples);
return new TimecodeRange(newStart, newEnd);
} | java | public TimecodeRange add(SampleCount samples)
{
final Timecode newStart = start.add(samples);
final Timecode newEnd = end.add(samples);
return new TimecodeRange(newStart, newEnd);
} | [
"public",
"TimecodeRange",
"add",
"(",
"SampleCount",
"samples",
")",
"{",
"final",
"Timecode",
"newStart",
"=",
"start",
".",
"add",
"(",
"samples",
")",
";",
"final",
"Timecode",
"newEnd",
"=",
"end",
".",
"add",
"(",
"samples",
")",
";",
"return",
"ne... | Move the range right by the specified number of samples
@param samples
@return | [
"Move",
"the",
"range",
"right",
"by",
"the",
"specified",
"number",
"of",
"samples"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/TimecodeRange.java#L100-L106 |
motown-io/motown | chargingstation-configuration/view-model/src/main/java/io/motown/chargingstationconfiguration/viewmodel/domain/DomainService.java | DomainService.getConnectorById | private Connector getConnectorById(Evse evse, Long id) {
"""
Gets a Connector by id.
@param evse evse which should contain the connector.
@param id connector id.
@return connector.
@throws EntityNotFoundException if the Connector cannot be found.
"""
return get... | java | private Connector getConnectorById(Evse evse, Long id) {
return getConnectorById(evse, id, true);
} | [
"private",
"Connector",
"getConnectorById",
"(",
"Evse",
"evse",
",",
"Long",
"id",
")",
"{",
"return",
"getConnectorById",
"(",
"evse",
",",
"id",
",",
"true",
")",
";",
"}"
] | Gets a Connector by id.
@param evse evse which should contain the connector.
@param id connector id.
@return connector.
@throws EntityNotFoundException if the Connector cannot be found. | [
"Gets",
"a",
"Connector",
"by",
"id",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/chargingstation-configuration/view-model/src/main/java/io/motown/chargingstationconfiguration/viewmodel/domain/DomainService.java#L412-L414 |
riversun/bigdoc | src/main/java/org/riversun/bigdoc/bin/BigFileSearcher.java | BigFileSearcher.searchBigFileRealtime | public List<Long> searchBigFileRealtime(File f, byte[] searchBytes, OnRealtimeResultListener listener) {
"""
Search bytes from big file faster with realtime result callback<br>
<br>
This callbacks the result in real time, but since the concurrency is
inferior to #searchBigFile,so the execution speed is slower t... | java | public List<Long> searchBigFileRealtime(File f, byte[] searchBytes, OnRealtimeResultListener listener) {
return searchBigFileRealtime(f, searchBytes, 0, listener);
} | [
"public",
"List",
"<",
"Long",
">",
"searchBigFileRealtime",
"(",
"File",
"f",
",",
"byte",
"[",
"]",
"searchBytes",
",",
"OnRealtimeResultListener",
"listener",
")",
"{",
"return",
"searchBigFileRealtime",
"(",
"f",
",",
"searchBytes",
",",
"0",
",",
"listene... | Search bytes from big file faster with realtime result callback<br>
<br>
This callbacks the result in real time, but since the concurrency is
inferior to #searchBigFile,so the execution speed is slower than
#searchBigFile
@param f
targetFile
@param searchBytes
sequence of bytes you want to search
@param listener
callb... | [
"Search",
"bytes",
"from",
"big",
"file",
"faster",
"with",
"realtime",
"result",
"callback<br",
">",
"<br",
">",
"This",
"callbacks",
"the",
"result",
"in",
"real",
"time",
"but",
"since",
"the",
"concurrency",
"is",
"inferior",
"to",
"#searchBigFile",
"so",
... | train | https://github.com/riversun/bigdoc/blob/46bd7c9a8667be23acdb1ad8286027e4b08cff3a/src/main/java/org/riversun/bigdoc/bin/BigFileSearcher.java#L218-L220 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/EntrySerializer.java | EntrySerializer.serializeRemoval | private int serializeRemoval(@NonNull TableKey tableKey, byte[] target, int targetOffset) {
"""
Serializes the given {@link TableKey} for removal into the given array.
@param tableKey The {@link TableKey} to serialize.
@param target The byte array to serialize to.
@param targetOffset The first offse... | java | private int serializeRemoval(@NonNull TableKey tableKey, byte[] target, int targetOffset) {
val key = tableKey.getKey();
Preconditions.checkArgument(key.getLength() <= MAX_KEY_LENGTH, "Key too large.");
int serializationLength = getRemovalLength(tableKey);
Preconditions.checkElementIndex... | [
"private",
"int",
"serializeRemoval",
"(",
"@",
"NonNull",
"TableKey",
"tableKey",
",",
"byte",
"[",
"]",
"target",
",",
"int",
"targetOffset",
")",
"{",
"val",
"key",
"=",
"tableKey",
".",
"getKey",
"(",
")",
";",
"Preconditions",
".",
"checkArgument",
"(... | Serializes the given {@link TableKey} for removal into the given array.
@param tableKey The {@link TableKey} to serialize.
@param target The byte array to serialize to.
@param targetOffset The first offset within the byte array to serialize at.
@return The first offset in the given byte array after the seria... | [
"Serializes",
"the",
"given",
"{",
"@link",
"TableKey",
"}",
"for",
"removal",
"into",
"the",
"given",
"array",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/EntrySerializer.java#L156-L168 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.