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 |
|---|---|---|---|---|---|---|---|---|---|---|
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.buildCoverage | public static GridCoverage2D buildCoverage( String name, double[][] dataMatrix, HashMap<String, Double> envelopeParams,
CoordinateReferenceSystem crs, boolean matrixIsRowCol ) {
"""
Creates a {@link GridCoverage2D coverage} from a double[][] matrix and the necessary geographic Information.
@param na... | java | public static GridCoverage2D buildCoverage( String name, double[][] dataMatrix, HashMap<String, Double> envelopeParams,
CoordinateReferenceSystem crs, boolean matrixIsRowCol ) {
WritableRaster writableRaster = createWritableRasterFromMatrix(dataMatrix, matrixIsRowCol);
return buildCoverage(n... | [
"public",
"static",
"GridCoverage2D",
"buildCoverage",
"(",
"String",
"name",
",",
"double",
"[",
"]",
"[",
"]",
"dataMatrix",
",",
"HashMap",
"<",
"String",
",",
"Double",
">",
"envelopeParams",
",",
"CoordinateReferenceSystem",
"crs",
",",
"boolean",
"matrixIs... | Creates a {@link GridCoverage2D coverage} from a double[][] matrix and the necessary geographic Information.
@param name the name of the coverage.
@param dataMatrix the matrix containing the data.
@param envelopeParams the map of boundary parameters.
@param crs the {@link CoordinateReferenceSystem}.
@param matrixIsRow... | [
"Creates",
"a",
"{",
"@link",
"GridCoverage2D",
"coverage",
"}",
"from",
"a",
"double",
"[]",
"[]",
"matrix",
"and",
"the",
"necessary",
"geographic",
"Information",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L825-L829 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchURIHelper.java | CouchURIHelper.changesUri | public URI changesUri(Map<String, Object> query) {
"""
Returns URI for {@code _changes} endpoint using passed
{@code query}.
"""
String base_uri = String.format(
"%s/%s",
this.rootUriString,
"_changes"
);
//lets find the since parameter
... | java | public URI changesUri(Map<String, Object> query) {
String base_uri = String.format(
"%s/%s",
this.rootUriString,
"_changes"
);
//lets find the since parameter
if(query.containsKey("since")){
Object since = query.get("since");
... | [
"public",
"URI",
"changesUri",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"query",
")",
"{",
"String",
"base_uri",
"=",
"String",
".",
"format",
"(",
"\"%s/%s\"",
",",
"this",
".",
"rootUriString",
",",
"\"_changes\"",
")",
";",
"//lets find the since pa... | Returns URI for {@code _changes} endpoint using passed
{@code query}. | [
"Returns",
"URI",
"for",
"{"
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchURIHelper.java#L60-L78 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.findBeanForField | @SuppressWarnings("WeakerAccess")
@Internal
protected final Optional findBeanForField(BeanResolutionContext resolutionContext, BeanContext context, FieldInjectionPoint injectionPoint) {
"""
Obtains a an optional for the field at the given index and the argument at the given index
<p>
Warning: this method... | java | @SuppressWarnings("WeakerAccess")
@Internal
protected final Optional findBeanForField(BeanResolutionContext resolutionContext, BeanContext context, FieldInjectionPoint injectionPoint) {
return resolveBeanWithGenericsForField(resolutionContext, injectionPoint, (beanType, qualifier) ->
((D... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"@",
"Internal",
"protected",
"final",
"Optional",
"findBeanForField",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"FieldInjectionPoint",
"injectionPoint",
")",
"{",
"return"... | Obtains a an optional for the field at the given index and the argument at the given index
<p>
Warning: this method is used by internal generated code and should not be called by user code.
@param resolutionContext The resolution context
@param context The context
@param injectionPoint The field injection... | [
"Obtains",
"a",
"an",
"optional",
"for",
"the",
"field",
"at",
"the",
"given",
"index",
"and",
"the",
"argument",
"at",
"the",
"given",
"index",
"<p",
">",
"Warning",
":",
"this",
"method",
"is",
"used",
"by",
"internal",
"generated",
"code",
"and",
"sho... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L1387-L1393 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java | Configuration.checkOutputFileEncoding | private boolean checkOutputFileEncoding(String docencoding,
DocErrorReporter reporter) {
"""
Check the validity of the given Source or Output File encoding on this
platform.
@param docencoding output file encoding.
@param reporter used to report errors.
"""
OutputStream ost= new Byt... | java | private boolean checkOutputFileEncoding(String docencoding,
DocErrorReporter reporter) {
OutputStream ost= new ByteArrayOutputStream();
OutputStreamWriter osw = null;
try {
osw = new OutputStreamWriter(ost, docencoding);
} catch (UnsupportedEncodingException exc) ... | [
"private",
"boolean",
"checkOutputFileEncoding",
"(",
"String",
"docencoding",
",",
"DocErrorReporter",
"reporter",
")",
"{",
"OutputStream",
"ost",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"OutputStreamWriter",
"osw",
"=",
"null",
";",
"try",
"{",
"osw... | Check the validity of the given Source or Output File encoding on this
platform.
@param docencoding output file encoding.
@param reporter used to report errors. | [
"Check",
"the",
"validity",
"of",
"the",
"given",
"Source",
"or",
"Output",
"File",
"encoding",
"on",
"this",
"platform",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java#L649-L668 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java | ReviewsImpl.addVideoTranscriptAsync | public Observable<Void> addVideoTranscriptAsync(String teamName, String reviewId, byte[] vTTfile) {
"""
This API adds a transcript file (text version of all the words spoken in a video) to a video review. The file should be a valid WebVTT format.
@param teamName Your team name.
@param reviewId Id of the review... | java | public Observable<Void> addVideoTranscriptAsync(String teamName, String reviewId, byte[] vTTfile) {
return addVideoTranscriptWithServiceResponseAsync(teamName, reviewId, vTTfile).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
... | [
"public",
"Observable",
"<",
"Void",
">",
"addVideoTranscriptAsync",
"(",
"String",
"teamName",
",",
"String",
"reviewId",
",",
"byte",
"[",
"]",
"vTTfile",
")",
"{",
"return",
"addVideoTranscriptWithServiceResponseAsync",
"(",
"teamName",
",",
"reviewId",
",",
"v... | This API adds a transcript file (text version of all the words spoken in a video) to a video review. The file should be a valid WebVTT format.
@param teamName Your team name.
@param reviewId Id of the review.
@param vTTfile Transcript file of the video.
@throws IllegalArgumentException thrown if parameters fail the va... | [
"This",
"API",
"adds",
"a",
"transcript",
"file",
"(",
"text",
"version",
"of",
"all",
"the",
"words",
"spoken",
"in",
"a",
"video",
")",
"to",
"a",
"video",
"review",
".",
"The",
"file",
"should",
"be",
"a",
"valid",
"WebVTT",
"format",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L1819-L1826 |
jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java | JmxTransformer.getProcessConfigFiles | @VisibleForTesting
List<File> getProcessConfigFiles() {
"""
If getJsonFile() is a file, then that is all we load. Otherwise, look in
the jsonDir for files.
<p/>
Files must end with .json as the suffix.
"""
// TODO : should use a FileVisitor (Once we update to Java 7)
File[] files;
File configurationD... | java | @VisibleForTesting
List<File> getProcessConfigFiles() {
// TODO : should use a FileVisitor (Once we update to Java 7)
File[] files;
File configurationDirOrFile = configuration.getProcessConfigDirOrFile();
if (configurationDirOrFile == null) {
throw new IllegalStateException("Configuration should specify con... | [
"@",
"VisibleForTesting",
"List",
"<",
"File",
">",
"getProcessConfigFiles",
"(",
")",
"{",
"// TODO : should use a FileVisitor (Once we update to Java 7)",
"File",
"[",
"]",
"files",
";",
"File",
"configurationDirOrFile",
"=",
"configuration",
".",
"getProcessConfigDirOrFi... | If getJsonFile() is a file, then that is all we load. Otherwise, look in
the jsonDir for files.
<p/>
Files must end with .json as the suffix. | [
"If",
"getJsonFile",
"()",
"is",
"a",
"file",
"then",
"that",
"is",
"all",
"we",
"load",
".",
"Otherwise",
"look",
"in",
"the",
"jsonDir",
"for",
"files",
".",
"<p",
"/",
">",
"Files",
"must",
"end",
"with",
".",
"json",
"as",
"the",
"suffix",
"."
] | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java#L433-L455 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java | SoapCallMapColumnFixture.callServiceImpl | protected Response callServiceImpl(String urlSymbolKey, String soapAction) {
"""
Creates response, calls service using configured template and current row's values and calls SOAP service.
@param urlSymbolKey key of symbol containing service's URL.
@param soapAction SOAPAction header value (null if no header is r... | java | protected Response callServiceImpl(String urlSymbolKey, String soapAction) {
String url = getSymbol(urlSymbolKey).toString();
Response response = getEnvironment().createInstance(getResponseClass());
callSoapService(url, getTemplateName(), soapAction, response);
return response;
} | [
"protected",
"Response",
"callServiceImpl",
"(",
"String",
"urlSymbolKey",
",",
"String",
"soapAction",
")",
"{",
"String",
"url",
"=",
"getSymbol",
"(",
"urlSymbolKey",
")",
".",
"toString",
"(",
")",
";",
"Response",
"response",
"=",
"getEnvironment",
"(",
"... | Creates response, calls service using configured template and current row's values and calls SOAP service.
@param urlSymbolKey key of symbol containing service's URL.
@param soapAction SOAPAction header value (null if no header is required).
@return filled response | [
"Creates",
"response",
"calls",
"service",
"using",
"configured",
"template",
"and",
"current",
"row",
"s",
"values",
"and",
"calls",
"SOAP",
"service",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java#L56-L61 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java | ParamTaglet.getTagletOutput | public Content getTagletOutput(Doc holder, TagletWriter writer) {
"""
Given an array of <code>ParamTag</code>s,return its string representation.
@param holder the member that holds the param tags.
@param writer the TagletWriter that will write this tag.
@return the TagletOutput representation of these <code>Par... | java | public Content getTagletOutput(Doc holder, TagletWriter writer) {
if (holder instanceof ExecutableMemberDoc) {
ExecutableMemberDoc member = (ExecutableMemberDoc) holder;
Content output = getTagletOutput(false, member, writer,
member.typeParameters(), member.typeParamTags(... | [
"public",
"Content",
"getTagletOutput",
"(",
"Doc",
"holder",
",",
"TagletWriter",
"writer",
")",
"{",
"if",
"(",
"holder",
"instanceof",
"ExecutableMemberDoc",
")",
"{",
"ExecutableMemberDoc",
"member",
"=",
"(",
"ExecutableMemberDoc",
")",
"holder",
";",
"Conten... | Given an array of <code>ParamTag</code>s,return its string representation.
@param holder the member that holds the param tags.
@param writer the TagletWriter that will write this tag.
@return the TagletOutput representation of these <code>ParamTag</code>s. | [
"Given",
"an",
"array",
"of",
"<code",
">",
"ParamTag<",
"/",
"code",
">",
"s",
"return",
"its",
"string",
"representation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java#L170-L183 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.similarUpdateUrl | public JSONObject similarUpdateUrl(String url, HashMap<String, String> options) {
"""
相似图检索—更新接口
**更新图库中图片的摘要和分类信息(具体变量为brief、tags)**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - op... | java | public JSONObject similarUpdateUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(ImageSearchC... | [
"public",
"JSONObject",
"similarUpdateUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
... | 相似图检索—更新接口
**更新图库中图片的摘要和分类信息(具体变量为brief、tags)**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
brief 更新的摘要信息,最长256B。样例:{"name":"周杰伦", "id":"666"}
tags 1 - 65535范围内的整数,tag间以逗号分隔,最多2个t... | [
"相似图检索—更新接口",
"**",
"更新图库中图片的摘要和分类信息(具体变量为brief、tags)",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L561-L572 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateMac | public static <T extends CharSequence> T validateMac(T value, String errorMsg) throws ValidateException {
"""
验证是否为MAC地址
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
@since 4.1.3
"""
if (false == isMac(value)) {
throw new ValidateException(... | java | public static <T extends CharSequence> T validateMac(T value, String errorMsg) throws ValidateException {
if (false == isMac(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateMac",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isMac",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Vali... | 验证是否为MAC地址
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
@since 4.1.3 | [
"验证是否为MAC地址"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L863-L868 |
lightblueseas/net-extensions | src/main/java/de/alpharogroup/net/socket/SocketExtensions.java | SocketExtensions.readObject | public static Object readObject(final String serverName, final int port)
throws IOException, ClassNotFoundException {
"""
Reads an object from the given socket InetAddress.
@param serverName
The Name from the address to read.
@param port
The port to read.
@return the object
@throws IOException
Signals ... | java | public static Object readObject(final String serverName, final int port)
throws IOException, ClassNotFoundException
{
final InetAddress inetAddress = InetAddress.getByName(serverName);
return readObject(new Socket(inetAddress, port));
} | [
"public",
"static",
"Object",
"readObject",
"(",
"final",
"String",
"serverName",
",",
"final",
"int",
"port",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"final",
"InetAddress",
"inetAddress",
"=",
"InetAddress",
".",
"getByName",
"(",
"serv... | Reads an object from the given socket InetAddress.
@param serverName
The Name from the address to read.
@param port
The port to read.
@return the object
@throws IOException
Signals that an I/O exception has occurred.
@throws ClassNotFoundException
the class not found exception | [
"Reads",
"an",
"object",
"from",
"the",
"given",
"socket",
"InetAddress",
"."
] | train | https://github.com/lightblueseas/net-extensions/blob/771757a93fa9ad13ce0fe061c158e5cba43344cb/src/main/java/de/alpharogroup/net/socket/SocketExtensions.java#L332-L337 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DOMHelper.java | DOMHelper.getParentOfNode | public static Node getParentOfNode(Node node) throws RuntimeException {
"""
Obtain the XPath-model parent of a DOM node -- ownerElement for Attrs,
parent for other nodes.
<p>
Background: The DOM believes that you must be your Parent's
Child, and thus Attrs don't have parents. XPath said that Attrs
do have the... | java | public static Node getParentOfNode(Node node) throws RuntimeException
{
Node parent;
short nodeType = node.getNodeType();
if (Node.ATTRIBUTE_NODE == nodeType)
{
Document doc = node.getOwnerDocument();
/*
TBD:
if(null == doc)
{
throw new RuntimeException(XSLMe... | [
"public",
"static",
"Node",
"getParentOfNode",
"(",
"Node",
"node",
")",
"throws",
"RuntimeException",
"{",
"Node",
"parent",
";",
"short",
"nodeType",
"=",
"node",
".",
"getNodeType",
"(",
")",
";",
"if",
"(",
"Node",
".",
"ATTRIBUTE_NODE",
"==",
"nodeType"... | Obtain the XPath-model parent of a DOM node -- ownerElement for Attrs,
parent for other nodes.
<p>
Background: The DOM believes that you must be your Parent's
Child, and thus Attrs don't have parents. XPath said that Attrs
do have their owning Element as their parent. This function
bridges the difference, either by usi... | [
"Obtain",
"the",
"XPath",
"-",
"model",
"parent",
"of",
"a",
"DOM",
"node",
"--",
"ownerElement",
"for",
"Attrs",
"parent",
"for",
"other",
"nodes",
".",
"<p",
">",
"Background",
":",
"The",
"DOM",
"believes",
"that",
"you",
"must",
"be",
"your",
"Parent... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DOMHelper.java#L1010-L1068 |
ironjacamar/ironjacamar | rarinfo/src/main/java/org/ironjacamar/rarinfo/Main.java | Main.hasMcfTransactionSupport | private static void hasMcfTransactionSupport(PrintStream out, PrintStream error, String classname, URLClassLoader cl) {
"""
hasMcfTransactionSupport
@param out output stream
@param error output stream
@param classname classname
@param cl classloader
"""
try
{
out.print(" Transaction... | java | private static void hasMcfTransactionSupport(PrintStream out, PrintStream error, String classname, URLClassLoader cl)
{
try
{
out.print(" TransactionSupport: ");
Class<?> mcfClz = Class.forName(classname, true, cl);
ManagedConnectionFactory mcf = (ManagedConnectionFa... | [
"private",
"static",
"void",
"hasMcfTransactionSupport",
"(",
"PrintStream",
"out",
",",
"PrintStream",
"error",
",",
"String",
"classname",
",",
"URLClassLoader",
"cl",
")",
"{",
"try",
"{",
"out",
".",
"print",
"(",
"\" TransactionSupport: \"",
")",
";",
"Cla... | hasMcfTransactionSupport
@param out output stream
@param error output stream
@param classname classname
@param cl classloader | [
"hasMcfTransactionSupport"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/rarinfo/src/main/java/org/ironjacamar/rarinfo/Main.java#L949-L973 |
SonarSource/sonarqube | server/sonar-process/src/main/java/org/sonar/process/logging/LogbackHelper.java | LogbackHelper.configureForSubprocessGobbler | public void configureForSubprocessGobbler(Props props, String logPattern) {
"""
Make the logback configuration for a sub process to correctly push all its logs to be read by a stream gobbler
on the sub process's System.out.
@see #buildLogPattern(RootLoggerConfig)
"""
if (isAllLogsToConsoleEnabled(props... | java | public void configureForSubprocessGobbler(Props props, String logPattern) {
if (isAllLogsToConsoleEnabled(props)) {
LoggerContext ctx = getRootContext();
ctx.getLogger(ROOT_LOGGER_NAME).addAppender(newConsoleAppender(ctx, "root_console", logPattern));
}
} | [
"public",
"void",
"configureForSubprocessGobbler",
"(",
"Props",
"props",
",",
"String",
"logPattern",
")",
"{",
"if",
"(",
"isAllLogsToConsoleEnabled",
"(",
"props",
")",
")",
"{",
"LoggerContext",
"ctx",
"=",
"getRootContext",
"(",
")",
";",
"ctx",
".",
"get... | Make the logback configuration for a sub process to correctly push all its logs to be read by a stream gobbler
on the sub process's System.out.
@see #buildLogPattern(RootLoggerConfig) | [
"Make",
"the",
"logback",
"configuration",
"for",
"a",
"sub",
"process",
"to",
"correctly",
"push",
"all",
"its",
"logs",
"to",
"be",
"read",
"by",
"a",
"stream",
"gobbler",
"on",
"the",
"sub",
"process",
"s",
"System",
".",
"out",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-process/src/main/java/org/sonar/process/logging/LogbackHelper.java#L211-L216 |
aol/cyclops | cyclops/src/main/java/com/oath/cyclops/util/box/MutableByte.java | MutableByte.fromExternal | public static MutableByte fromExternal(final Supplier<Byte> s, final Consumer<Byte> c) {
"""
Construct a MutableByte that gets and sets an external value using the provided Supplier and Consumer
e.g.
<pre>
{@code
MutableByte mutable = MutableByte.fromExternal(()->!this.value,val->!this.value);
}
</pre>
... | java | public static MutableByte fromExternal(final Supplier<Byte> s, final Consumer<Byte> c) {
return new MutableByte() {
@Override
public byte getAsByte() {
return s.get();
}
@Override
public Byte get() {
return getAsByte();... | [
"public",
"static",
"MutableByte",
"fromExternal",
"(",
"final",
"Supplier",
"<",
"Byte",
">",
"s",
",",
"final",
"Consumer",
"<",
"Byte",
">",
"c",
")",
"{",
"return",
"new",
"MutableByte",
"(",
")",
"{",
"@",
"Override",
"public",
"byte",
"getAsByte",
... | Construct a MutableByte that gets and sets an external value using the provided Supplier and Consumer
e.g.
<pre>
{@code
MutableByte mutable = MutableByte.fromExternal(()->!this.value,val->!this.value);
}
</pre>
@param s Supplier of an external value
@param c Consumer that sets an external value
@return MutableByte t... | [
"Construct",
"a",
"MutableByte",
"that",
"gets",
"and",
"sets",
"an",
"external",
"value",
"using",
"the",
"provided",
"Supplier",
"and",
"Consumer"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/com/oath/cyclops/util/box/MutableByte.java#L81-L99 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByDisplayName | public Iterable<DUser> queryByDisplayName(java.lang.String displayName) {
"""
query-by method for field displayName
@param displayName the specified attribute
@return an Iterable of DUsers for the specified displayName
"""
return queryByField(null, DUserMapper.Field.DISPLAYNAME.getFieldName(), displayNam... | java | public Iterable<DUser> queryByDisplayName(java.lang.String displayName) {
return queryByField(null, DUserMapper.Field.DISPLAYNAME.getFieldName(), displayName);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByDisplayName",
"(",
"java",
".",
"lang",
".",
"String",
"displayName",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"DISPLAYNAME",
".",
"getFieldName",
"(",
")",
",",
... | query-by method for field displayName
@param displayName the specified attribute
@return an Iterable of DUsers for the specified displayName | [
"query",
"-",
"by",
"method",
"for",
"field",
"displayName"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L133-L135 |
pietermartin/sqlg | sqlg-postgres-parent/sqlg-postgres-dialect/src/main/java/org/umlg/sqlg/sql/dialect/PostgresDialect.java | PostgresDialect.sqlTypeToPropertyType | @Override
public PropertyType sqlTypeToPropertyType(SqlgGraph sqlgGraph, String schema, String table, String column, int sqlType, String typeName, ListIterator<Triple<String, Integer, String>> metaDataIter) {
"""
This is only used for upgrading from pre sqlg_schema sqlg to a sqlg_schema
"""
switch ... | java | @Override
public PropertyType sqlTypeToPropertyType(SqlgGraph sqlgGraph, String schema, String table, String column, int sqlType, String typeName, ListIterator<Triple<String, Integer, String>> metaDataIter) {
switch (sqlType) {
case Types.BIT:
return PropertyType.BOOLEAN;
... | [
"@",
"Override",
"public",
"PropertyType",
"sqlTypeToPropertyType",
"(",
"SqlgGraph",
"sqlgGraph",
",",
"String",
"schema",
",",
"String",
"table",
",",
"String",
"column",
",",
"int",
"sqlType",
",",
"String",
"typeName",
",",
"ListIterator",
"<",
"Triple",
"<"... | This is only used for upgrading from pre sqlg_schema sqlg to a sqlg_schema | [
"This",
"is",
"only",
"used",
"for",
"upgrading",
"from",
"pre",
"sqlg_schema",
"sqlg",
"to",
"a",
"sqlg_schema"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-postgres-parent/sqlg-postgres-dialect/src/main/java/org/umlg/sqlg/sql/dialect/PostgresDialect.java#L2108-L2152 |
apereo/cas | support/cas-server-support-couchdb-core/src/main/java/org/apereo/cas/couchdb/core/ProfileCouchDbRepository.java | ProfileCouchDbRepository.findByLinkedid | @View(name = "by_linkedid", map = "function(doc) {
"""
Find profile by linkedid.
@param linkedid to be searched for
@return profile found
""" if(doc.linkedid){ emit(doc.linkedid, doc) } }")
public CouchDbProfileDocument findByLinkedid(final String linkedid) {
return queryView("by_linkedid", linke... | java | @View(name = "by_linkedid", map = "function(doc) { if(doc.linkedid){ emit(doc.linkedid, doc) } }")
public CouchDbProfileDocument findByLinkedid(final String linkedid) {
return queryView("by_linkedid", linkedid).stream().findFirst().orElse(null);
} | [
"@",
"View",
"(",
"name",
"=",
"\"by_linkedid\"",
",",
"map",
"=",
"\"function(doc) { if(doc.linkedid){ emit(doc.linkedid, doc) } }\"",
")",
"public",
"CouchDbProfileDocument",
"findByLinkedid",
"(",
"final",
"String",
"linkedid",
")",
"{",
"return",
"queryView",
"(",
"... | Find profile by linkedid.
@param linkedid to be searched for
@return profile found | [
"Find",
"profile",
"by",
"linkedid",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-couchdb-core/src/main/java/org/apereo/cas/couchdb/core/ProfileCouchDbRepository.java#L33-L36 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/model/BoundingBox.java | BoundingBox.getPositionRelativeToTile | public Rectangle getPositionRelativeToTile(Tile tile) {
"""
Computes the coordinates of this bounding box relative to a tile.
@param tile the tile to compute the relative position for.
@return rectangle giving the relative position.
"""
Point upperLeft = MercatorProjection.getPixelRelativeToTile(ne... | java | public Rectangle getPositionRelativeToTile(Tile tile) {
Point upperLeft = MercatorProjection.getPixelRelativeToTile(new LatLong(this.maxLatitude, minLongitude), tile);
Point lowerRight = MercatorProjection.getPixelRelativeToTile(new LatLong(this.minLatitude, maxLongitude), tile);
return new Rect... | [
"public",
"Rectangle",
"getPositionRelativeToTile",
"(",
"Tile",
"tile",
")",
"{",
"Point",
"upperLeft",
"=",
"MercatorProjection",
".",
"getPixelRelativeToTile",
"(",
"new",
"LatLong",
"(",
"this",
".",
"maxLatitude",
",",
"minLongitude",
")",
",",
"tile",
")",
... | Computes the coordinates of this bounding box relative to a tile.
@param tile the tile to compute the relative position for.
@return rectangle giving the relative position. | [
"Computes",
"the",
"coordinates",
"of",
"this",
"bounding",
"box",
"relative",
"to",
"a",
"tile",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/BoundingBox.java#L291-L295 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.generateRequest | @Deprecated
public Future<Response> generateRequest(String requestType, boolean secure, String user, String password, String endPoint, String data, String type, String codeBase64) throws Exception {
"""
Generates the request based on the type of request, the end point, the data and type passed
@param reques... | java | @Deprecated
public Future<Response> generateRequest(String requestType, boolean secure, String user, String password, String endPoint, String data, String type, String codeBase64) throws Exception {
return generateRequest(requestType, secure, user, password, endPoint, data, type);
} | [
"@",
"Deprecated",
"public",
"Future",
"<",
"Response",
">",
"generateRequest",
"(",
"String",
"requestType",
",",
"boolean",
"secure",
",",
"String",
"user",
",",
"String",
"password",
",",
"String",
"endPoint",
",",
"String",
"data",
",",
"String",
"type",
... | Generates the request based on the type of request, the end point, the data and type passed
@param requestType type of request to be sent
@param secure type of protocol
@param user user to be used in request
@param password password to be used in request
@param endPoint end point to sent the request ... | [
"Generates",
"the",
"request",
"based",
"on",
"the",
"type",
"of",
"request",
"the",
"end",
"point",
"the",
"data",
"and",
"type",
"passed"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1086-L1089 |
ologolo/streamline-engine | src/org/daisy/streamline/engine/TaskRunner.java | TaskRunner.runTasks | public RunnerResults runTasks(FileSet input, BaseFolder output, String manifestFileName, List<InternalTask> tasks) throws IOException, TaskSystemException {
"""
Runs a list of tasks starting from the input file as input to the first task, the following tasks use the preceding result
as input. The final result is ... | java | public RunnerResults runTasks(FileSet input, BaseFolder output, String manifestFileName, List<InternalTask> tasks) throws IOException, TaskSystemException {
Progress progress = new Progress();
logger.info(name + " started on " + progress.getStart());
int i = 0;
NumberFormat nf = NumberFormat.getPercentInstance(... | [
"public",
"RunnerResults",
"runTasks",
"(",
"FileSet",
"input",
",",
"BaseFolder",
"output",
",",
"String",
"manifestFileName",
",",
"List",
"<",
"InternalTask",
">",
"tasks",
")",
"throws",
"IOException",
",",
"TaskSystemException",
"{",
"Progress",
"progress",
"... | Runs a list of tasks starting from the input file as input to the first task, the following tasks use the preceding result
as input. The final result is written to the output.
@param input the input file
@param output the output file
@param manifestFileName the file name of the manifest file
@param tasks the list of ta... | [
"Runs",
"a",
"list",
"of",
"tasks",
"starting",
"from",
"the",
"input",
"file",
"as",
"input",
"to",
"the",
"first",
"task",
"the",
"following",
"tasks",
"use",
"the",
"preceding",
"result",
"as",
"input",
".",
"The",
"final",
"result",
"is",
"written",
... | train | https://github.com/ologolo/streamline-engine/blob/04b7adc85d84d91dc5f0eaaa401d2738f9401b17/src/org/daisy/streamline/engine/TaskRunner.java#L204-L243 |
verhas/License3j | src/main/java/javax0/license3j/RevocableLicense.java | RevocableLicense.getRevocationURL | public URL getRevocationURL() throws MalformedURLException {
"""
Get the revocation URL of the license. This feature is stored in the
license under the name {@code revocationUrl}. This URL may contain the
string <code>${licenseId}</code> which is replaced by the actual license
ID. Thus there is no need to wire ... | java | public URL getRevocationURL() throws MalformedURLException {
final var revocationURLTemplate = license.get(REVOCATION_URL) == null ? null : license.get(REVOCATION_URL).getString();
final String revocationURL;
if (revocationURLTemplate != null) {
final var id = Optional.ofNullable(lic... | [
"public",
"URL",
"getRevocationURL",
"(",
")",
"throws",
"MalformedURLException",
"{",
"final",
"var",
"revocationURLTemplate",
"=",
"license",
".",
"get",
"(",
"REVOCATION_URL",
")",
"==",
"null",
"?",
"null",
":",
"license",
".",
"get",
"(",
"REVOCATION_URL",
... | Get the revocation URL of the license. This feature is stored in the
license under the name {@code revocationUrl}. This URL may contain the
string <code>${licenseId}</code> which is replaced by the actual license
ID. Thus there is no need to wire into the revocation URL the license ID.
<p>
If there is no license id def... | [
"Get",
"the",
"revocation",
"URL",
"of",
"the",
"license",
".",
"This",
"feature",
"is",
"stored",
"in",
"the",
"license",
"under",
"the",
"name",
"{",
"@code",
"revocationUrl",
"}",
".",
"This",
"URL",
"may",
"contain",
"the",
"string",
"<code",
">",
"$... | train | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/RevocableLicense.java#L38-L51 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java | InvokerHelper.setPropertySafe2 | public static void setPropertySafe2(Object newValue, Object object, String property) {
"""
This is so we don't have to reorder the stack when we call this method.
At some point a better name might be in order.
"""
if (object != null) {
setProperty2(newValue, object, property);
}
... | java | public static void setPropertySafe2(Object newValue, Object object, String property) {
if (object != null) {
setProperty2(newValue, object, property);
}
} | [
"public",
"static",
"void",
"setPropertySafe2",
"(",
"Object",
"newValue",
",",
"Object",
"object",
",",
"String",
"property",
")",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
"{",
"setProperty2",
"(",
"newValue",
",",
"object",
",",
"property",
")",
";",... | This is so we don't have to reorder the stack when we call this method.
At some point a better name might be in order. | [
"This",
"is",
"so",
"we",
"don",
"t",
"have",
"to",
"reorder",
"the",
"stack",
"when",
"we",
"call",
"this",
"method",
".",
"At",
"some",
"point",
"a",
"better",
"name",
"might",
"be",
"in",
"order",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java#L249-L253 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/partition/Partitioner.java | Partitioner.getHighWatermark | @VisibleForTesting
protected long getHighWatermark(ExtractType extractType, WatermarkType watermarkType) {
"""
Get high water mark
@param extractType Extract type
@param watermarkType Watermark type
@return high water mark in {@link Partitioner#WATERMARKTIMEFORMAT}
"""
LOG.debug("Getting high waterm... | java | @VisibleForTesting
protected long getHighWatermark(ExtractType extractType, WatermarkType watermarkType) {
LOG.debug("Getting high watermark");
String timeZone = this.state.getProp(ConfigurationKeys.SOURCE_TIMEZONE);
long highWatermark = ConfigurationKeys.DEFAULT_WATERMARK_VALUE;
if (this.isWatermarkO... | [
"@",
"VisibleForTesting",
"protected",
"long",
"getHighWatermark",
"(",
"ExtractType",
"extractType",
",",
"WatermarkType",
"watermarkType",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Getting high watermark\"",
")",
";",
"String",
"timeZone",
"=",
"this",
".",
"state",
... | Get high water mark
@param extractType Extract type
@param watermarkType Watermark type
@return high water mark in {@link Partitioner#WATERMARKTIMEFORMAT} | [
"Get",
"high",
"water",
"mark"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/partition/Partitioner.java#L422-L444 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipSessionKey.java | SipSessionKey.setToTag | public void setToTag(String toTag, boolean recomputeSessionId) {
"""
Sets the to tag on the key when we receive a response.
We recompute the session id only for derived session otherwise the id will change
when the a request is received or sent and the response is sent back or received which should not happen
S... | java | public void setToTag(String toTag, boolean recomputeSessionId) {
this.toTag = toTag;
if(toTag != null && recomputeSessionId) {
// Issue 2365 : to tag needed for getApplicationSession().getSipSession(<sessionId>) to return forked session and not the parent one
computeToString();
}
} | [
"public",
"void",
"setToTag",
"(",
"String",
"toTag",
",",
"boolean",
"recomputeSessionId",
")",
"{",
"this",
".",
"toTag",
"=",
"toTag",
";",
"if",
"(",
"toTag",
"!=",
"null",
"&&",
"recomputeSessionId",
")",
"{",
"// Issue 2365 : to tag needed for getApplication... | Sets the to tag on the key when we receive a response.
We recompute the session id only for derived session otherwise the id will change
when the a request is received or sent and the response is sent back or received which should not happen
See TCK test SipSessionListenerTest.testSessionDestroyed001
@param toTag the ... | [
"Sets",
"the",
"to",
"tag",
"on",
"the",
"key",
"when",
"we",
"receive",
"a",
"response",
".",
"We",
"recompute",
"the",
"session",
"id",
"only",
"for",
"derived",
"session",
"otherwise",
"the",
"id",
"will",
"change",
"when",
"the",
"a",
"request",
"is"... | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipSessionKey.java#L163-L169 |
groupby/api-java | src/main/java/com/groupbyinc/api/Query.java | Query.addValueRefinement | public Query addValueRefinement(String navigationName, String value, boolean exclude) {
"""
<code>
Add a value refinement. Takes a refinement name, a value, and whether or not to exclude this refinement.
</code>
@param navigationName
The name of the navigation
@param value
The refinement value
@param exc... | java | public Query addValueRefinement(String navigationName, String value, boolean exclude) {
return addRefinement(navigationName, new RefinementValue().setValue(value).setExclude(exclude));
} | [
"public",
"Query",
"addValueRefinement",
"(",
"String",
"navigationName",
",",
"String",
"value",
",",
"boolean",
"exclude",
")",
"{",
"return",
"addRefinement",
"(",
"navigationName",
",",
"new",
"RefinementValue",
"(",
")",
".",
"setValue",
"(",
"value",
")",
... | <code>
Add a value refinement. Takes a refinement name, a value, and whether or not to exclude this refinement.
</code>
@param navigationName
The name of the navigation
@param value
The refinement value
@param exclude
True if the results should exclude this value refinement, false otherwise | [
"<code",
">",
"Add",
"a",
"value",
"refinement",
".",
"Takes",
"a",
"refinement",
"name",
"a",
"value",
"and",
"whether",
"or",
"not",
"to",
"exclude",
"this",
"refinement",
".",
"<",
"/",
"code",
">"
] | train | https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/api/Query.java#L787-L789 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/util/InvocationUtil.java | InvocationUtil.executeLocallyWithRetry | public static LocalRetryableExecution executeLocallyWithRetry(NodeEngine nodeEngine, Operation operation) {
"""
Constructs a local execution with retry logic. The operation must not
have an {@link OperationResponseHandler}, it must return a response
and it must not validate the target.
@return the local execu... | java | public static LocalRetryableExecution executeLocallyWithRetry(NodeEngine nodeEngine, Operation operation) {
if (operation.getOperationResponseHandler() != null) {
throw new IllegalArgumentException("Operation must not have a response handler set");
}
if (!operation.returnsResponse())... | [
"public",
"static",
"LocalRetryableExecution",
"executeLocallyWithRetry",
"(",
"NodeEngine",
"nodeEngine",
",",
"Operation",
"operation",
")",
"{",
"if",
"(",
"operation",
".",
"getOperationResponseHandler",
"(",
")",
"!=",
"null",
")",
"{",
"throw",
"new",
"Illegal... | Constructs a local execution with retry logic. The operation must not
have an {@link OperationResponseHandler}, it must return a response
and it must not validate the target.
@return the local execution
@throws IllegalArgumentException if the operation has a response handler
set, if it does not return a response
or if... | [
"Constructs",
"a",
"local",
"execution",
"with",
"retry",
"logic",
".",
"The",
"operation",
"must",
"not",
"have",
"an",
"{",
"@link",
"OperationResponseHandler",
"}",
"it",
"must",
"return",
"a",
"response",
"and",
"it",
"must",
"not",
"validate",
"the",
"t... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/util/InvocationUtil.java#L102-L115 |
b3log/latke | latke-core/src/main/java/org/json/JSONObject.java | JSONObject.optInt | public int optInt(String key, int defaultValue) {
"""
Get an optional int value associated with a key, or the default if there
is no such key or if the value is not a number. If the value is a string,
an attempt will be made to evaluate it as a number.
@param key
A key string.
@param defaultValue
The defau... | java | public int optInt(String key, int defaultValue) {
final Number val = this.optNumber(key, null);
if (val == null) {
return defaultValue;
}
return val.intValue();
} | [
"public",
"int",
"optInt",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"final",
"Number",
"val",
"=",
"this",
".",
"optNumber",
"(",
"key",
",",
"null",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";"... | Get an optional int value associated with a key, or the default if there
is no such key or if the value is not a number. If the value is a string,
an attempt will be made to evaluate it as a number.
@param key
A key string.
@param defaultValue
The default.
@return An object which is the value. | [
"Get",
"an",
"optional",
"int",
"value",
"associated",
"with",
"a",
"key",
"or",
"the",
"default",
"if",
"there",
"is",
"no",
"such",
"key",
"or",
"if",
"the",
"value",
"is",
"not",
"a",
"number",
".",
"If",
"the",
"value",
"is",
"a",
"string",
"an",... | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONObject.java#L1305-L1311 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.getBgpPeerStatusAsync | public Observable<BgpPeerStatusListResultInner> getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) {
"""
The GetBgpPeerStatus operation retrieves the status of all BGP peers.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName Th... | java | public Observable<BgpPeerStatusListResultInner> getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) {
return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1<ServiceResponse<BgpPeerStatusListResultInner>, BgpPee... | [
"public",
"Observable",
"<",
"BgpPeerStatusListResultInner",
">",
"getBgpPeerStatusAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"String",
"peer",
")",
"{",
"return",
"getBgpPeerStatusWithServiceResponseAsync",
"(",
"resourceGrou... | The GetBgpPeerStatus operation retrieves the status of all BGP peers.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param peer The IP address of the peer to retrieve the status of.
@throws IllegalArgumentException thrown if parameter... | [
"The",
"GetBgpPeerStatus",
"operation",
"retrieves",
"the",
"status",
"of",
"all",
"BGP",
"peers",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L2046-L2053 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.fromPair | public static Word2Vec fromPair(Pair<InMemoryLookupTable, VocabCache> pair) {
"""
Load word vectors from the given pair
@param pair the given pair
@return a read only word vectors impl based on the given lookup table and vocab
"""
Word2Vec vectors = new Word2Vec();
vectors.setLookupTable(pa... | java | public static Word2Vec fromPair(Pair<InMemoryLookupTable, VocabCache> pair) {
Word2Vec vectors = new Word2Vec();
vectors.setLookupTable(pair.getFirst());
vectors.setVocab(pair.getSecond());
vectors.setModelUtils(new BasicModelUtils());
return vectors;
} | [
"public",
"static",
"Word2Vec",
"fromPair",
"(",
"Pair",
"<",
"InMemoryLookupTable",
",",
"VocabCache",
">",
"pair",
")",
"{",
"Word2Vec",
"vectors",
"=",
"new",
"Word2Vec",
"(",
")",
";",
"vectors",
".",
"setLookupTable",
"(",
"pair",
".",
"getFirst",
"(",
... | Load word vectors from the given pair
@param pair the given pair
@return a read only word vectors impl based on the given lookup table and vocab | [
"Load",
"word",
"vectors",
"from",
"the",
"given",
"pair"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L1582-L1588 |
craterdog/java-security-framework | java-certificate-management-api/src/main/java/craterdog/security/CertificateManager.java | CertificateManager.saveKeyStore | public final void saveKeyStore(OutputStream output, KeyStore keyStore, char[] password) throws IOException {
"""
This method saves a PKCS12 format key store out to an output stream.
@param output The output stream to be written to.
@param keyStore The PKCS12 format key store.
@param password The password that... | java | public final void saveKeyStore(OutputStream output, KeyStore keyStore, char[] password) throws IOException {
logger.entry();
try {
keyStore.store(output, password);
} catch (KeyStoreException | NoSuchAlgorithmException | CertificateException e) {
RuntimeException exc... | [
"public",
"final",
"void",
"saveKeyStore",
"(",
"OutputStream",
"output",
",",
"KeyStore",
"keyStore",
",",
"char",
"[",
"]",
"password",
")",
"throws",
"IOException",
"{",
"logger",
".",
"entry",
"(",
")",
";",
"try",
"{",
"keyStore",
".",
"store",
"(",
... | This method saves a PKCS12 format key store out to an output stream.
@param output The output stream to be written to.
@param keyStore The PKCS12 format key store.
@param password The password that should be used to encrypt the file.
@throws java.io.IOException Unable to save the key store to the specified output stre... | [
"This",
"method",
"saves",
"a",
"PKCS12",
"format",
"key",
"store",
"out",
"to",
"an",
"output",
"stream",
"."
] | train | https://github.com/craterdog/java-security-framework/blob/a5634c19812d473b608bc11060f5cbb4b4b0b5da/java-certificate-management-api/src/main/java/craterdog/security/CertificateManager.java#L44-L54 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/TypePoolGroupNameMap.java | TypePoolGroupNameMap.containsKey | public boolean containsKey(ResourceType type, String poolGroupName) {
"""
Is the value set with the appropriate keys?
@param type Resource type
@param poolGroup Name of pool group
@return True if this map contains a mapping for the specified key, false
otherwise
"""
Map<String, V> poolGroupNameMap = ... | java | public boolean containsKey(ResourceType type, String poolGroupName) {
Map<String, V> poolGroupNameMap = typePoolGroupNameMap.get(type);
if (poolGroupNameMap == null) {
return false;
}
return poolGroupNameMap.containsKey(poolGroupName);
} | [
"public",
"boolean",
"containsKey",
"(",
"ResourceType",
"type",
",",
"String",
"poolGroupName",
")",
"{",
"Map",
"<",
"String",
",",
"V",
">",
"poolGroupNameMap",
"=",
"typePoolGroupNameMap",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"poolGroupNameMap",
... | Is the value set with the appropriate keys?
@param type Resource type
@param poolGroup Name of pool group
@return True if this map contains a mapping for the specified key, false
otherwise | [
"Is",
"the",
"value",
"set",
"with",
"the",
"appropriate",
"keys?"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/TypePoolGroupNameMap.java#L77-L83 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Stream.java | Stream.takeWhileIndexed | @NotNull
public Stream<T> takeWhileIndexed(@NotNull IndexedPredicate<? super T> predicate) {
"""
Takes elements while the {@code IndexedPredicate} returns {@code true}.
<p>This is an intermediate operation.
<p>Example:
<pre>
predicate: (index, value) -> (index + value) < 5
stream: [1, 2, 3, 4, ... | java | @NotNull
public Stream<T> takeWhileIndexed(@NotNull IndexedPredicate<? super T> predicate) {
return takeWhileIndexed(0, 1, predicate);
} | [
"@",
"NotNull",
"public",
"Stream",
"<",
"T",
">",
"takeWhileIndexed",
"(",
"@",
"NotNull",
"IndexedPredicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"return",
"takeWhileIndexed",
"(",
"0",
",",
"1",
",",
"predicate",
")",
";",
"}"
] | Takes elements while the {@code IndexedPredicate} returns {@code true}.
<p>This is an intermediate operation.
<p>Example:
<pre>
predicate: (index, value) -> (index + value) < 5
stream: [1, 2, 3, 4, -5, -6, -7]
index: [0, 1, 2, 3, 4, 5, 6]
sum: [1, 3, 5, 7, -1, -1, -1]
result: [1, 2]
</pre>
@param pre... | [
"Takes",
"elements",
"while",
"the",
"{",
"@code",
"IndexedPredicate",
"}",
"returns",
"{",
"@code",
"true",
"}",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L1323-L1326 |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Assembly.java | Assembly.addFile | public void addFile(InputStream inputStream, String name) {
"""
Adds a file to your assembly. If the field name specified already exists, it will override the content of the
existing name.
@param inputStream {@link InputStream} the file to be uploaded.
@param name {@link String} the field name of the file whe... | java | public void addFile(InputStream inputStream, String name) {
fileStreams.put(name, inputStream);
// remove duplicate key
if (files.containsKey(name)) {
files.remove(name);
}
} | [
"public",
"void",
"addFile",
"(",
"InputStream",
"inputStream",
",",
"String",
"name",
")",
"{",
"fileStreams",
".",
"put",
"(",
"name",
",",
"inputStream",
")",
";",
"// remove duplicate key",
"if",
"(",
"files",
".",
"containsKey",
"(",
"name",
")",
")",
... | Adds a file to your assembly. If the field name specified already exists, it will override the content of the
existing name.
@param inputStream {@link InputStream} the file to be uploaded.
@param name {@link String} the field name of the file when submitted Transloadit. | [
"Adds",
"a",
"file",
"to",
"your",
"assembly",
".",
"If",
"the",
"field",
"name",
"specified",
"already",
"exists",
"it",
"will",
"override",
"the",
"content",
"of",
"the",
"existing",
"name",
"."
] | train | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Assembly.java#L83-L90 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java | DownloadChemCompProvider.writeID | private void writeID(String contents, String currentID) throws IOException {
"""
Output chemical contents to a file
@param contents File contents
@param currentID Chemical ID, used to determine the filename
@throws IOException
"""
String localName = getLocalFileName(currentID);
try ( PrintWriter pw = ... | java | private void writeID(String contents, String currentID) throws IOException{
String localName = getLocalFileName(currentID);
try ( PrintWriter pw = new PrintWriter(new GZIPOutputStream(new FileOutputStream(localName))) ) {
pw.print(contents);
pw.flush();
}
} | [
"private",
"void",
"writeID",
"(",
"String",
"contents",
",",
"String",
"currentID",
")",
"throws",
"IOException",
"{",
"String",
"localName",
"=",
"getLocalFileName",
"(",
"currentID",
")",
";",
"try",
"(",
"PrintWriter",
"pw",
"=",
"new",
"PrintWriter",
"(",... | Output chemical contents to a file
@param contents File contents
@param currentID Chemical ID, used to determine the filename
@throws IOException | [
"Output",
"chemical",
"contents",
"to",
"a",
"file"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java#L227-L236 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/PayMchAPI.java | PayMchAPI.payitilReport | public static MchBaseResult payitilReport(Report report,String key) {
"""
交易保障 <br>
测速上报
@param report report
@param key key
@return MchBaseResult
"""
Map<String,String> map = MapUtil.objectToMap(report);
String sign = SignatureUtil.generateSign(map,report.getSign_type(),key);
report.setSign(sign);
... | java | public static MchBaseResult payitilReport(Report report,String key){
Map<String,String> map = MapUtil.objectToMap(report);
String sign = SignatureUtil.generateSign(map,report.getSign_type(),key);
report.setSign(sign);
String shorturlXML = XMLConverUtil.convertToXML(report);
HttpUriRequest httpUriRequest = Req... | [
"public",
"static",
"MchBaseResult",
"payitilReport",
"(",
"Report",
"report",
",",
"String",
"key",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"MapUtil",
".",
"objectToMap",
"(",
"report",
")",
";",
"String",
"sign",
"=",
"SignatureUt... | 交易保障 <br>
测速上报
@param report report
@param key key
@return MchBaseResult | [
"交易保障",
"<br",
">",
"测速上报"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/PayMchAPI.java#L413-L424 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java | Scheduler.addSession | public void addSession(String id, Session session) {
"""
Add a session for scheduling.
@param id Identifies the session
@param session Actual session to be scheduled
"""
for (SchedulerForType scheduleThread : schedulersForTypes.values()) {
scheduleThread.addSession(id, session);
}
} | java | public void addSession(String id, Session session) {
for (SchedulerForType scheduleThread : schedulersForTypes.values()) {
scheduleThread.addSession(id, session);
}
} | [
"public",
"void",
"addSession",
"(",
"String",
"id",
",",
"Session",
"session",
")",
"{",
"for",
"(",
"SchedulerForType",
"scheduleThread",
":",
"schedulersForTypes",
".",
"values",
"(",
")",
")",
"{",
"scheduleThread",
".",
"addSession",
"(",
"id",
",",
"se... | Add a session for scheduling.
@param id Identifies the session
@param session Actual session to be scheduled | [
"Add",
"a",
"session",
"for",
"scheduling",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java#L124-L128 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java | SoapClient.setParam | public SoapClient setParam(String name, Object value, boolean useMethodPrefix) {
"""
设置方法参数
@param name 参数名
@param value 参数值,可以是字符串或Map或{@link SOAPElement}
@param useMethodPrefix 是否使用方法的命名空间前缀
@return this
"""
setParam(this.methodEle, name, value, useMethodPrefix ? this.methodEle.getPrefix() : null);
... | java | public SoapClient setParam(String name, Object value, boolean useMethodPrefix) {
setParam(this.methodEle, name, value, useMethodPrefix ? this.methodEle.getPrefix() : null);
return this;
} | [
"public",
"SoapClient",
"setParam",
"(",
"String",
"name",
",",
"Object",
"value",
",",
"boolean",
"useMethodPrefix",
")",
"{",
"setParam",
"(",
"this",
".",
"methodEle",
",",
"name",
",",
"value",
",",
"useMethodPrefix",
"?",
"this",
".",
"methodEle",
".",
... | 设置方法参数
@param name 参数名
@param value 参数值,可以是字符串或Map或{@link SOAPElement}
@param useMethodPrefix 是否使用方法的命名空间前缀
@return this | [
"设置方法参数"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java#L314-L317 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/Equals.java | Equals.classEqual | public static boolean classEqual(Object one, Object two) {
"""
This method should be called before beginning any equals methods. In order
to return true the method:
<ol>
<li>The two given objects are the same instance using ==. This also means
if both Objects are null then this method will return true (well
... | java | public static boolean classEqual(Object one, Object two) {
return one == two || !(one == null || two == null) && one.getClass() == two.getClass();
} | [
"public",
"static",
"boolean",
"classEqual",
"(",
"Object",
"one",
",",
"Object",
"two",
")",
"{",
"return",
"one",
"==",
"two",
"||",
"!",
"(",
"one",
"==",
"null",
"||",
"two",
"==",
"null",
")",
"&&",
"one",
".",
"getClass",
"(",
")",
"==",
"two... | This method should be called before beginning any equals methods. In order
to return true the method:
<ol>
<li>The two given objects are the same instance using ==. This also means
if both Objects are null then this method will return true (well
technically they are equal)</li>
<li>Tests that neither object is null</l... | [
"This",
"method",
"should",
"be",
"called",
"before",
"beginning",
"any",
"equals",
"methods",
".",
"In",
"order",
"to",
"return",
"true",
"the",
"method",
":"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/Equals.java#L84-L86 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ClustersInner.java | ClustersInner.listByWorkspaceAsync | public Observable<Page<ClusterInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ClustersListByWorkspaceOptions clustersListByWorkspaceOptions) {
"""
Gets information about Clusters associated with the given Workspace.
@param resourceGroupName Name of the resource gro... | java | public Observable<Page<ClusterInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ClustersListByWorkspaceOptions clustersListByWorkspaceOptions) {
return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName, clustersListByWorkspaceOptions)
... | [
"public",
"Observable",
"<",
"Page",
"<",
"ClusterInner",
">",
">",
"listByWorkspaceAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"workspaceName",
",",
"final",
"ClustersListByWorkspaceOptions",
"clustersListByWorkspaceOptions",
")",
"{",
... | Gets information about Clusters associated with the given Workspace.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The n... | [
"Gets",
"information",
"about",
"Clusters",
"associated",
"with",
"the",
"given",
"Workspace",
"."
] | 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/ClustersInner.java#L1434-L1442 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PropPatchCommand.java | PropPatchCommand.propPatch | public Response propPatch(Session session, String path, HierarchicalProperty body, List<String> tokens,
String baseURI) {
"""
Webdav Proppatch method method implementation.
@param session current session
@param path resource path
@param body request body
@param tokens tokens
@param baseURI base uri
... | java | public Response propPatch(Session session, String path, HierarchicalProperty body, List<String> tokens,
String baseURI)
{
try
{
lockHolder.checkLock(session, path, tokens);
Node node = (Node)session.getItem(path);
WebDavNamespaceContext nsContext = new WebDav... | [
"public",
"Response",
"propPatch",
"(",
"Session",
"session",
",",
"String",
"path",
",",
"HierarchicalProperty",
"body",
",",
"List",
"<",
"String",
">",
"tokens",
",",
"String",
"baseURI",
")",
"{",
"try",
"{",
"lockHolder",
".",
"checkLock",
"(",
"session... | Webdav Proppatch method method implementation.
@param session current session
@param path resource path
@param body request body
@param tokens tokens
@param baseURI base uri
@return the instance of javax.ws.rs.core.Response | [
"Webdav",
"Proppatch",
"method",
"method",
"implementation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PropPatchCommand.java#L82-L126 |
rosette-api/java | api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java | HttpRosetteAPI.sendGetRequest | private <T extends Response> T sendGetRequest(String urlStr, Class<T> clazz) throws HttpRosetteAPIException {
"""
Sends a GET request to Rosette API.
<p>
Returns a Response.
@param urlStr Rosette API end point.
@param clazz Response class
@return Response
@throws HttpRosetteAPIException
"""
Ht... | java | private <T extends Response> T sendGetRequest(String urlStr, Class<T> clazz) throws HttpRosetteAPIException {
HttpGet get = new HttpGet(urlStr);
for (Header header : additionalHeaders) {
get.addHeader(header);
}
try (CloseableHttpResponse httpResponse = httpClient.execute(ge... | [
"private",
"<",
"T",
"extends",
"Response",
">",
"T",
"sendGetRequest",
"(",
"String",
"urlStr",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"HttpRosetteAPIException",
"{",
"HttpGet",
"get",
"=",
"new",
"HttpGet",
"(",
"urlStr",
")",
";",
"for",
... | Sends a GET request to Rosette API.
<p>
Returns a Response.
@param urlStr Rosette API end point.
@param clazz Response class
@return Response
@throws HttpRosetteAPIException | [
"Sends",
"a",
"GET",
"request",
"to",
"Rosette",
"API",
".",
"<p",
">",
"Returns",
"a",
"Response",
"."
] | train | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java#L326-L339 |
yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/comparator/CompoundComparator.java | CompoundComparator.setComparator | public void setComparator(int index, Comparator<T> comparator, boolean ascending) {
"""
Replace the Comparator at the given index using the given sort order.
@param index the index of the Comparator to replace
@param comparator the Comparator to place at the given index
@param ascending the sort order: ascend... | java | public void setComparator(int index, Comparator<T> comparator, boolean ascending) {
this.comparators.set(index, new InvertibleComparator<>(comparator, ascending));
} | [
"public",
"void",
"setComparator",
"(",
"int",
"index",
",",
"Comparator",
"<",
"T",
">",
"comparator",
",",
"boolean",
"ascending",
")",
"{",
"this",
".",
"comparators",
".",
"set",
"(",
"index",
",",
"new",
"InvertibleComparator",
"<>",
"(",
"comparator",
... | Replace the Comparator at the given index using the given sort order.
@param index the index of the Comparator to replace
@param comparator the Comparator to place at the given index
@param ascending the sort order: ascending (true) or descending (false) | [
"Replace",
"the",
"Comparator",
"at",
"the",
"given",
"index",
"using",
"the",
"given",
"sort",
"order",
"."
] | train | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/comparator/CompoundComparator.java#L112-L114 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelPlainFormatter.java | HpelPlainFormatter.createEventTimeStamp | protected void createEventTimeStamp(RepositoryLogRecord record, StringBuilder buffer) {
"""
Generates the time stamp for the RepositoryLogRecord event. The resulting time stamp is formatted
based on the formatter's locale and time zone.
@param record of the event.
@param buffer output buffer where converted t... | java | protected void createEventTimeStamp(RepositoryLogRecord record, StringBuilder buffer) {
if (null == record) {
throw new IllegalArgumentException("Record cannot be null");
}
if (null == buffer) {
throw new IllegalArgumentException("Buffer cannot be null");
}
// Create the time stamp
buffer.append('[');... | [
"protected",
"void",
"createEventTimeStamp",
"(",
"RepositoryLogRecord",
"record",
",",
"StringBuilder",
"buffer",
")",
"{",
"if",
"(",
"null",
"==",
"record",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Record cannot be null\"",
")",
";",
"}",
"... | Generates the time stamp for the RepositoryLogRecord event. The resulting time stamp is formatted
based on the formatter's locale and time zone.
@param record of the event.
@param buffer output buffer where converted timestamp is appended to. | [
"Generates",
"the",
"time",
"stamp",
"for",
"the",
"RepositoryLogRecord",
"event",
".",
"The",
"resulting",
"time",
"stamp",
"is",
"formatted",
"based",
"on",
"the",
"formatter",
"s",
"locale",
"and",
"time",
"zone",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelPlainFormatter.java#L56-L73 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/input/EscapeSequenceCharacterPattern.java | EscapeSequenceCharacterPattern.getKeyStroke | protected KeyStroke getKeyStroke(KeyType key, int mods) {
"""
combines a KeyType and modifiers into a KeyStroke.
Subclasses can override this for customization purposes.
@param key the KeyType as determined by parsing the sequence.
It will be null, if the pattern looked like a key sequence but wasn't
identif... | java | protected KeyStroke getKeyStroke(KeyType key, int mods) {
boolean bShift = false, bCtrl = false, bAlt = false;
if (key == null) { return null; } // alternative: key = KeyType.Unknown;
if (mods >= 0) { // only use when non-negative!
bShift = (mods & SHIFT) != 0;
bAlt = (... | [
"protected",
"KeyStroke",
"getKeyStroke",
"(",
"KeyType",
"key",
",",
"int",
"mods",
")",
"{",
"boolean",
"bShift",
"=",
"false",
",",
"bCtrl",
"=",
"false",
",",
"bAlt",
"=",
"false",
";",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
"null",
... | combines a KeyType and modifiers into a KeyStroke.
Subclasses can override this for customization purposes.
@param key the KeyType as determined by parsing the sequence.
It will be null, if the pattern looked like a key sequence but wasn't
identified.
@param mods the bitmask of the modifer keys pressed along with the ... | [
"combines",
"a",
"KeyType",
"and",
"modifiers",
"into",
"a",
"KeyStroke",
".",
"Subclasses",
"can",
"override",
"this",
"for",
"customization",
"purposes",
"."
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/input/EscapeSequenceCharacterPattern.java#L140-L149 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java | DecimalFormat.skipPatternWhiteSpace | private static int skipPatternWhiteSpace(String text, int pos) {
"""
Skips over a run of zero or more Pattern_White_Space characters at pos in text.
"""
while (pos < text.length()) {
int c = UTF16.charAt(text, pos);
if (!PatternProps.isWhiteSpace(c)) {
break;
... | java | private static int skipPatternWhiteSpace(String text, int pos) {
while (pos < text.length()) {
int c = UTF16.charAt(text, pos);
if (!PatternProps.isWhiteSpace(c)) {
break;
}
pos += UTF16.getCharCount(c);
}
return pos;
} | [
"private",
"static",
"int",
"skipPatternWhiteSpace",
"(",
"String",
"text",
",",
"int",
"pos",
")",
"{",
"while",
"(",
"pos",
"<",
"text",
".",
"length",
"(",
")",
")",
"{",
"int",
"c",
"=",
"UTF16",
".",
"charAt",
"(",
"text",
",",
"pos",
")",
";"... | Skips over a run of zero or more Pattern_White_Space characters at pos in text. | [
"Skips",
"over",
"a",
"run",
"of",
"zero",
"or",
"more",
"Pattern_White_Space",
"characters",
"at",
"pos",
"in",
"text",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java#L3011-L3020 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.createPlanAddOn | public AddOn createPlanAddOn(final String planCode, final AddOn addOn) {
"""
Create an AddOn to a Plan
<p>
@param planCode The planCode of the {@link Plan } to create within recurly
@param addOn The {@link AddOn} to create within recurly
@return the {@link AddOn} object as identified by the passed in obje... | java | public AddOn createPlanAddOn(final String planCode, final AddOn addOn) {
return doPOST(Plan.PLANS_RESOURCE +
"/" +
planCode +
AddOn.ADDONS_RESOURCE,
addOn, AddOn.class);
} | [
"public",
"AddOn",
"createPlanAddOn",
"(",
"final",
"String",
"planCode",
",",
"final",
"AddOn",
"addOn",
")",
"{",
"return",
"doPOST",
"(",
"Plan",
".",
"PLANS_RESOURCE",
"+",
"\"/\"",
"+",
"planCode",
"+",
"AddOn",
".",
"ADDONS_RESOURCE",
",",
"addOn",
","... | Create an AddOn to a Plan
<p>
@param planCode The planCode of the {@link Plan } to create within recurly
@param addOn The {@link AddOn} to create within recurly
@return the {@link AddOn} object as identified by the passed in object | [
"Create",
"an",
"AddOn",
"to",
"a",
"Plan",
"<p",
">"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1438-L1444 |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/Vertigo.java | Vertigo.deployCluster | public Vertigo deployCluster(String cluster, int nodes) {
"""
Deploys multiple nodes within a cluster at the given address.
@param cluster The cluster event bus address.
@param nodes The number of nodes to deploy.
@return The Vertigo instance.
"""
return deployCluster(cluster, null, nodes, null);
} | java | public Vertigo deployCluster(String cluster, int nodes) {
return deployCluster(cluster, null, nodes, null);
} | [
"public",
"Vertigo",
"deployCluster",
"(",
"String",
"cluster",
",",
"int",
"nodes",
")",
"{",
"return",
"deployCluster",
"(",
"cluster",
",",
"null",
",",
"nodes",
",",
"null",
")",
";",
"}"
] | Deploys multiple nodes within a cluster at the given address.
@param cluster The cluster event bus address.
@param nodes The number of nodes to deploy.
@return The Vertigo instance. | [
"Deploys",
"multiple",
"nodes",
"within",
"a",
"cluster",
"at",
"the",
"given",
"address",
"."
] | train | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/Vertigo.java#L234-L236 |
alipay/sofa-rpc | extension-impl/extension-common/src/main/java/com/alipay/sofa/rpc/common/SofaConfigs.java | SofaConfigs.getIntegerValue | public static int getIntegerValue(String appName, String key, int defaultValue) {
"""
解析数字型配置
@param appName 应用名
@param key 配置项
@param defaultValue 默认值
@return 配置
"""
String ret = getStringValue0(appName, key);
return StringUtils.isEmpty(ret) ? defaultValue : CommonUtils.par... | java | public static int getIntegerValue(String appName, String key, int defaultValue) {
String ret = getStringValue0(appName, key);
return StringUtils.isEmpty(ret) ? defaultValue : CommonUtils.parseInt(ret, defaultValue);
} | [
"public",
"static",
"int",
"getIntegerValue",
"(",
"String",
"appName",
",",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"String",
"ret",
"=",
"getStringValue0",
"(",
"appName",
",",
"key",
")",
";",
"return",
"StringUtils",
".",
"isEmpty",
"(",
... | 解析数字型配置
@param appName 应用名
@param key 配置项
@param defaultValue 默认值
@return 配置 | [
"解析数字型配置"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/extension-common/src/main/java/com/alipay/sofa/rpc/common/SofaConfigs.java#L120-L123 |
joinfaces/joinfaces | joinfaces-autoconfigure/src/main/java/org/joinfaces/autoconfigure/adminfaces/AdminfacesAutoConfiguration.java | AdminfacesAutoConfiguration.adminfacesWebServerFactoryCustomizer | @Bean
public WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> adminfacesWebServerFactoryCustomizer() {
"""
This {@link WebServerFactoryCustomizer} adds a {@link ServletContextInitializer} to the embedded servlet-container
which is equivalent to adminfaces's own {@code META-INF/web-fragment.xml}.
... | java | @Bean
public WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> adminfacesWebServerFactoryCustomizer() {
return factory -> {
factory.addErrorPages(new ErrorPage(HttpStatus.FORBIDDEN, "/403.jsf"),
new ErrorPage(AccessDeniedException.class, "/403.jsf"),
new ErrorPage(AccessLocalException.clas... | [
"@",
"Bean",
"public",
"WebServerFactoryCustomizer",
"<",
"ConfigurableServletWebServerFactory",
">",
"adminfacesWebServerFactoryCustomizer",
"(",
")",
"{",
"return",
"factory",
"->",
"{",
"factory",
".",
"addErrorPages",
"(",
"new",
"ErrorPage",
"(",
"HttpStatus",
".",... | This {@link WebServerFactoryCustomizer} adds a {@link ServletContextInitializer} to the embedded servlet-container
which is equivalent to adminfaces's own {@code META-INF/web-fragment.xml}.
@return adminfaces web server factory customizer | [
"This",
"{"
] | train | https://github.com/joinfaces/joinfaces/blob/c9fc811a9eaf695820951f2c04715297dd1e6d66/joinfaces-autoconfigure/src/main/java/org/joinfaces/autoconfigure/adminfaces/AdminfacesAutoConfiguration.java#L93-L109 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java | WButtonExample.addDefaultSubmitButtonExample | private void addDefaultSubmitButtonExample() {
"""
Examples showing how to set a WButton as the default submit button for an input control.
"""
add(new WHeading(HeadingLevel.H3, "Default submit button"));
add(new ExplanatoryText(
"This example shows how to use an image as the only content of a WButton... | java | private void addDefaultSubmitButtonExample() {
add(new WHeading(HeadingLevel.H3, "Default submit button"));
add(new ExplanatoryText(
"This example shows how to use an image as the only content of a WButton. "
+ "In addition this text field submits the entire screen using the image button to the right of th... | [
"private",
"void",
"addDefaultSubmitButtonExample",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H3",
",",
"\"Default submit button\"",
")",
")",
";",
"add",
"(",
"new",
"ExplanatoryText",
"(",
"\"This example shows how to use an image as t... | Examples showing how to set a WButton as the default submit button for an input control. | [
"Examples",
"showing",
"how",
"to",
"set",
"a",
"WButton",
"as",
"the",
"default",
"submit",
"button",
"for",
"an",
"input",
"control",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java#L280-L311 |
OpenTSDB/opentsdb | src/tools/ConfigArgP.java | ConfigArgP.loadConfig | protected static Properties loadConfig(URL url) {
"""
Loads properties from the passed URL
@param url The url to load from
@return the loaded properties
"""
InputStream is = null;
try {
URLConnection connection = url.openConnection();
if(connection instanceof HttpURLConnection) {
... | java | protected static Properties loadConfig(URL url) {
InputStream is = null;
try {
URLConnection connection = url.openConnection();
if(connection instanceof HttpURLConnection) {
HttpURLConnection conn = (HttpURLConnection)connection;
conn.setConnectTimeout(5000);
conn.setReadTime... | [
"protected",
"static",
"Properties",
"loadConfig",
"(",
"URL",
"url",
")",
"{",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
"URLConnection",
"connection",
"=",
"url",
".",
"openConnection",
"(",
")",
";",
"if",
"(",
"connection",
"instanceof",
"HttpUR... | Loads properties from the passed URL
@param url The url to load from
@return the loaded properties | [
"Loads",
"properties",
"from",
"the",
"passed",
"URL"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/ConfigArgP.java#L279-L296 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java | AnderbergHierarchicalClustering.updateCache | private void updateCache(int size, double[] scratch, double[] bestd, int[] besti, int x, int y, int j, double d) {
"""
Update the cache.
@param size Working set size
@param scratch Scratch matrix
@param bestd Best distance
@param besti Best index
@param x First cluster
@param y Second cluster, {@code y < x... | java | private void updateCache(int size, double[] scratch, double[] bestd, int[] besti, int x, int y, int j, double d) {
// New best
if(d <= bestd[j]) {
bestd[j] = d;
besti[j] = y;
return;
}
// Needs slow update.
if(besti[j] == x || besti[j] == y) {
findBest(size, scratch, bestd, b... | [
"private",
"void",
"updateCache",
"(",
"int",
"size",
",",
"double",
"[",
"]",
"scratch",
",",
"double",
"[",
"]",
"bestd",
",",
"int",
"[",
"]",
"besti",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"j",
",",
"double",
"d",
")",
"{",
"// New be... | Update the cache.
@param size Working set size
@param scratch Scratch matrix
@param bestd Best distance
@param besti Best index
@param x First cluster
@param y Second cluster, {@code y < x}
@param j Updated value d(y, j)
@param d New distance | [
"Update",
"the",
"cache",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java#L312-L323 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.postSave | private void postSave(Group group, boolean isNew) throws Exception {
"""
Notifying listeners after group creation.
@param group
the group which is used in create operation
@param isNew
true, if we have a deal with new group, otherwise it is false
which mean update operation is in progress
@throws Exception... | java | private void postSave(Group group, boolean isNew) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.postSave(group, isNew);
}
} | [
"private",
"void",
"postSave",
"(",
"Group",
"group",
",",
"boolean",
"isNew",
")",
"throws",
"Exception",
"{",
"for",
"(",
"GroupEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"postSave",
"(",
"group",
",",
"isNew",
")",
";",
"}"... | Notifying listeners after group creation.
@param group
the group which is used in create operation
@param isNew
true, if we have a deal with new group, otherwise it is false
which mean update operation is in progress
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"after",
"group",
"creation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L572-L578 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java | PtoPInputHandler.checkTargetAbleToAcceptOrExceptionMessage | private int checkTargetAbleToAcceptOrExceptionMessage(JsDestinationAddress targetDestinationAddr)
throws SITemporaryDestinationNotFoundException, SIResourceException, SINotPossibleInCurrentConfigurationException {
"""
See if a target destination or, if necessary, its exception destination, can
... | java | private int checkTargetAbleToAcceptOrExceptionMessage(JsDestinationAddress targetDestinationAddr)
throws SITemporaryDestinationNotFoundException, SIResourceException, SINotPossibleInCurrentConfigurationException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
... | [
"private",
"int",
"checkTargetAbleToAcceptOrExceptionMessage",
"(",
"JsDestinationAddress",
"targetDestinationAddr",
")",
"throws",
"SITemporaryDestinationNotFoundException",
",",
"SIResourceException",
",",
"SINotPossibleInCurrentConfigurationException",
"{",
"if",
"(",
"TraceCompon... | See if a target destination or, if necessary, its exception destination, can
handle any more messages.
@return reason code signifying whether the destination can accept messages or the reason for
not being able to do so.
@throws SINotPossibleInCurrentConfigurationException
@throws SIResourceException
@throws SITempora... | [
"See",
"if",
"a",
"target",
"destination",
"or",
"if",
"necessary",
"its",
"exception",
"destination",
"can",
"handle",
"any",
"more",
"messages",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java#L3324-L3360 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java | WCheckBoxSelectExample.addExampleUsingArrayList | private void addExampleUsingArrayList() {
"""
This example creates the WCheckBoxSelect from a List of CarOptions.
"""
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect created using an array list of options"));
List<CarOption> options = new ArrayList<>();
options.add(new CarOption("1", "Ferrari", "F-360... | java | private void addExampleUsingArrayList() {
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect created using an array list of options"));
List<CarOption> options = new ArrayList<>();
options.add(new CarOption("1", "Ferrari", "F-360"));
options.add(new CarOption("2", "Mercedez Benz", "amg"));
options.add(new Car... | [
"private",
"void",
"addExampleUsingArrayList",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H3",
",",
"\"WCheckBoxSelect created using an array list of options\"",
")",
")",
";",
"List",
"<",
"CarOption",
">",
"options",
"=",
"new",
"Ar... | This example creates the WCheckBoxSelect from a List of CarOptions. | [
"This",
"example",
"creates",
"the",
"WCheckBoxSelect",
"from",
"a",
"List",
"of",
"CarOptions",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java#L142-L171 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java | StringUtil.isDigit | public static boolean isDigit(String str, int beginIndex, int endIndex) {
"""
check the specified char is a digit or not
true will return if it is or return false this method can recognize full-with char
@param str
@param beginIndex
@param endIndex
@return boolean
"""
char c;
for ... | java | public static boolean isDigit(String str, int beginIndex, int endIndex)
{
char c;
for ( int j = beginIndex; j < endIndex; j++ ) {
c = str.charAt(j);
//make full-width char half-width
if ( c > 65280 ) c -= 65248;
if ( c < 48 || c > 57 ) {
... | [
"public",
"static",
"boolean",
"isDigit",
"(",
"String",
"str",
",",
"int",
"beginIndex",
",",
"int",
"endIndex",
")",
"{",
"char",
"c",
";",
"for",
"(",
"int",
"j",
"=",
"beginIndex",
";",
"j",
"<",
"endIndex",
";",
"j",
"++",
")",
"{",
"c",
"=",
... | check the specified char is a digit or not
true will return if it is or return false this method can recognize full-with char
@param str
@param beginIndex
@param endIndex
@return boolean | [
"check",
"the",
"specified",
"char",
"is",
"a",
"digit",
"or",
"not",
"true",
"will",
"return",
"if",
"it",
"is",
"or",
"return",
"false",
"this",
"method",
"can",
"recognize",
"full",
"-",
"with",
"char"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java#L272-L285 |
mmazi/rescu | src/main/java/si/mazi/rescu/HttpTemplate.java | HttpTemplate.readInputStreamAsEncodedString | String readInputStreamAsEncodedString(InputStream inputStream, HttpURLConnection connection) throws IOException {
"""
<p>
Reads an InputStream as a String allowing for different encoding types. This closes the stream at the end.
</p>
@param inputStream The input stream
@param connection The HTTP con... | java | String readInputStreamAsEncodedString(InputStream inputStream, HttpURLConnection connection) throws IOException {
if (inputStream == null) {
return null;
}
BufferedReader reader = null;
try {
String responseEncoding = getResponseEncoding(connection);
... | [
"String",
"readInputStreamAsEncodedString",
"(",
"InputStream",
"inputStream",
",",
"HttpURLConnection",
"connection",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inputStream",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"BufferedReader",
"reader",
"=",
... | <p>
Reads an InputStream as a String allowing for different encoding types. This closes the stream at the end.
</p>
@param inputStream The input stream
@param connection The HTTP connection object
@return A String representation of the input stream
@throws IOException If something goes wrong | [
"<p",
">",
"Reads",
"an",
"InputStream",
"as",
"a",
"String",
"allowing",
"for",
"different",
"encoding",
"types",
".",
"This",
"closes",
"the",
"stream",
"at",
"the",
"end",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/mmazi/rescu/blob/8a4f9367994da0a2617bd37acf0320c942e62de3/src/main/java/si/mazi/rescu/HttpTemplate.java#L216-L241 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Collectors.java | Collectors.summingInt | @NotNull
public static <T> Collector<T, ?, Integer> summingInt(@NotNull final ToIntFunction<? super T> mapper) {
"""
Returns a {@code Collector} that summing integer-valued input elements.
@param <T> the type of the input elements
@param mapper the mapping function which extracts value from element to cal... | java | @NotNull
public static <T> Collector<T, ?, Integer> summingInt(@NotNull final ToIntFunction<? super T> mapper) {
return new CollectorsImpl<T, int[], Integer>(
new Supplier<int[]>() {
@NotNull
@Override
public int[] get() {
... | [
"@",
"NotNull",
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Integer",
">",
"summingInt",
"(",
"@",
"NotNull",
"final",
"ToIntFunction",
"<",
"?",
"super",
"T",
">",
"mapper",
")",
"{",
"return",
"new",
"CollectorsImpl",
"<... | Returns a {@code Collector} that summing integer-valued input elements.
@param <T> the type of the input elements
@param mapper the mapping function which extracts value from element to calculate result
@return a {@code Collector}
@since 1.1.3 | [
"Returns",
"a",
"{",
"@code",
"Collector",
"}",
"that",
"summing",
"integer",
"-",
"valued",
"input",
"elements",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Collectors.java#L577-L603 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.translateSingleAssignment | private Context translateSingleAssignment(WyilFile.LVal lval, Expr rval, Context context) {
"""
Translate an individual assignment from one rval to exactly one lval.
@param lval
A single location representing the left-hand side
@param rval
A single expression representing the right-hand side
@param context
... | java | private Context translateSingleAssignment(WyilFile.LVal lval, Expr rval, Context context) {
// FIXME: this method is a bit of a kludge. It would be nicer,
// eventually, to have all right-hand side expression represented in
// WyTP directly. This could potentially be done by including an update
// operation in... | [
"private",
"Context",
"translateSingleAssignment",
"(",
"WyilFile",
".",
"LVal",
"lval",
",",
"Expr",
"rval",
",",
"Context",
"context",
")",
"{",
"// FIXME: this method is a bit of a kludge. It would be nicer,",
"// eventually, to have all right-hand side expression represented in... | Translate an individual assignment from one rval to exactly one lval.
@param lval
A single location representing the left-hand side
@param rval
A single expression representing the right-hand side
@param context
@return | [
"Translate",
"an",
"individual",
"assignment",
"from",
"one",
"rval",
"to",
"exactly",
"one",
"lval",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L585-L608 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ras/FormattedWriter.java | FormattedWriter.taggedValue | public final void taggedValue(String tag, long value) throws IOException {
"""
Write out a one-line XML tag with a long datatype, for instance <tag>123456</tag>
@param tag The name of the tag to be written
@param value The data value to be written
@throws IOException If an I/O error occurs while a... | java | public final void taggedValue(String tag, long value) throws IOException {
startTag(tag);
write(Long.toString(value));
endTag(tag);
} | [
"public",
"final",
"void",
"taggedValue",
"(",
"String",
"tag",
",",
"long",
"value",
")",
"throws",
"IOException",
"{",
"startTag",
"(",
"tag",
")",
";",
"write",
"(",
"Long",
".",
"toString",
"(",
"value",
")",
")",
";",
"endTag",
"(",
"tag",
")",
... | Write out a one-line XML tag with a long datatype, for instance <tag>123456</tag>
@param tag The name of the tag to be written
@param value The data value to be written
@throws IOException If an I/O error occurs while attempting to write the characters | [
"Write",
"out",
"a",
"one",
"-",
"line",
"XML",
"tag",
"with",
"a",
"long",
"datatype",
"for",
"instance",
"<tag>123456<",
"/",
"tag>"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ras/FormattedWriter.java#L212-L216 |
hal/core | gui/src/main/java/org/jboss/as/console/server/proxy/HttpClient.java | HttpClient.doPost | public InputStream doPost(byte[] postData, String contentType) {
"""
posts data to the inputstream and returns the InputStream.
@param postData data to be posted. must be url-encoded already.
@param contentType allows you to set the contentType of the request.
@return InputStream input stream from URLConnecti... | java | public InputStream doPost(byte[] postData, String contentType) {
this.urlConnection.setDoOutput(true);
if (contentType != null) this.urlConnection.setRequestProperty( "Content-type", contentType );
OutputStream out = null;
try {
out = this.getOutputStream();
if(o... | [
"public",
"InputStream",
"doPost",
"(",
"byte",
"[",
"]",
"postData",
",",
"String",
"contentType",
")",
"{",
"this",
".",
"urlConnection",
".",
"setDoOutput",
"(",
"true",
")",
";",
"if",
"(",
"contentType",
"!=",
"null",
")",
"this",
".",
"urlConnection"... | posts data to the inputstream and returns the InputStream.
@param postData data to be posted. must be url-encoded already.
@param contentType allows you to set the contentType of the request.
@return InputStream input stream from URLConnection | [
"posts",
"data",
"to",
"the",
"inputstream",
"and",
"returns",
"the",
"InputStream",
"."
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/server/proxy/HttpClient.java#L315-L340 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/Convert.java | Convert.hexStrToStr | @Deprecated
public static String hexStrToStr(String hexStr, Charset charset) {
"""
十六进制转换字符串
@param hexStr Byte字符串(Byte之间无分隔符 如:[616C6B])
@param charset 编码 {@link Charset}
@return 对应的字符串
@see HexUtil#decodeHexStr(String, Charset)
@deprecated 请使用 {@link #hexToStr(String, Charset)}
"""
return hexToSt... | java | @Deprecated
public static String hexStrToStr(String hexStr, Charset charset) {
return hexToStr(hexStr, charset);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"hexStrToStr",
"(",
"String",
"hexStr",
",",
"Charset",
"charset",
")",
"{",
"return",
"hexToStr",
"(",
"hexStr",
",",
"charset",
")",
";",
"}"
] | 十六进制转换字符串
@param hexStr Byte字符串(Byte之间无分隔符 如:[616C6B])
@param charset 编码 {@link Charset}
@return 对应的字符串
@see HexUtil#decodeHexStr(String, Charset)
@deprecated 请使用 {@link #hexToStr(String, Charset)} | [
"十六进制转换字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L730-L733 |
square/burst | burst/src/main/java/com/squareup/burst/BurstableConstructor.java | BurstableConstructor.findAll | private static TestConstructor[] findAll(Class<?> cls) {
"""
Finds all constructors of {@code cls} that are burstable.
A burstable constructor is public, and may or may not be the default constructor.
@throws IllegalStateException if cls has public fields and a non-default constructor
"""
final Constru... | java | private static TestConstructor[] findAll(Class<?> cls) {
final Constructor<?>[] constructors = cls.getConstructors();
final Field[] fields = getBurstableFields(cls);
final List<TestConstructor> filteredConstructors = new ArrayList<>();
for (Constructor<?> constructor : constructors) {
if (constru... | [
"private",
"static",
"TestConstructor",
"[",
"]",
"findAll",
"(",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"final",
"Constructor",
"<",
"?",
">",
"[",
"]",
"constructors",
"=",
"cls",
".",
"getConstructors",
"(",
")",
";",
"final",
"Field",
"[",
"]",
... | Finds all constructors of {@code cls} that are burstable.
A burstable constructor is public, and may or may not be the default constructor.
@throws IllegalStateException if cls has public fields and a non-default constructor | [
"Finds",
"all",
"constructors",
"of",
"{",
"@code",
"cls",
"}",
"that",
"are",
"burstable",
".",
"A",
"burstable",
"constructor",
"is",
"public",
"and",
"may",
"or",
"may",
"not",
"be",
"the",
"default",
"constructor",
"."
] | train | https://github.com/square/burst/blob/20cdb4473896143402f92e11cf03d236fcbe3f12/burst/src/main/java/com/squareup/burst/BurstableConstructor.java#L41-L58 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updatePatternAnyEntityRole | public OperationStatus updatePatternAnyEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePatternAnyEntityRoleOptionalParameter updatePatternAnyEntityRoleOptionalParameter) {
"""
Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
... | java | public OperationStatus updatePatternAnyEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePatternAnyEntityRoleOptionalParameter updatePatternAnyEntityRoleOptionalParameter) {
return updatePatternAnyEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId, updatePatternAnyEnt... | [
"public",
"OperationStatus",
"updatePatternAnyEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
",",
"UpdatePatternAnyEntityRoleOptionalParameter",
"updatePatternAnyEntityRoleOptionalParameter",
")",
"{",
"return",
... | Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role ID.
@param updatePatternAnyEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws Illeg... | [
"Update",
"an",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L12857-L12859 |
cdapio/netty-http | src/main/java/io/cdap/http/internal/HttpResourceHandler.java | HttpResourceHandler.getWeightedMatchScore | private long getWeightedMatchScore(Iterable<String> requestUriParts, Iterable<String> destUriParts) {
"""
Generate a weighted score based on position for matches of URI parts.
The matches are weighted in descending order from left to right.
Exact match is weighted higher than group match, and group match is weig... | java | private long getWeightedMatchScore(Iterable<String> requestUriParts, Iterable<String> destUriParts) {
// The score calculated below is a base 5 number
// The score will have one digit for one part of the URI
// This will allow for 27 parts in the path since log (Long.MAX_VALUE) to base 5 = 27.13
// We l... | [
"private",
"long",
"getWeightedMatchScore",
"(",
"Iterable",
"<",
"String",
">",
"requestUriParts",
",",
"Iterable",
"<",
"String",
">",
"destUriParts",
")",
"{",
"// The score calculated below is a base 5 number",
"// The score will have one digit for one part of the URI",
"//... | Generate a weighted score based on position for matches of URI parts.
The matches are weighted in descending order from left to right.
Exact match is weighted higher than group match, and group match is weighted higher than wildcard match.
@param requestUriParts the parts of request URI
@param destUriParts the parts o... | [
"Generate",
"a",
"weighted",
"score",
"based",
"on",
"position",
"for",
"matches",
"of",
"URI",
"parts",
".",
"The",
"matches",
"are",
"weighted",
"in",
"descending",
"order",
"from",
"left",
"to",
"right",
".",
"Exact",
"match",
"is",
"weighted",
"higher",
... | train | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/HttpResourceHandler.java#L352-L372 |
xerial/snappy-java | src/main/java/org/xerial/snappy/Snappy.java | Snappy.rawUncompress | public static long rawUncompress(long inputAddr, long inputSize, long destAddr)
throws IOException {
"""
Zero-copy decompress using memory addresses.
@param inputAddr input memory address
@param inputSize input byte size
@param destAddr destination address of the uncompressed data
@return the unc... | java | public static long rawUncompress(long inputAddr, long inputSize, long destAddr)
throws IOException
{
return impl.rawUncompress(inputAddr, inputSize, destAddr);
} | [
"public",
"static",
"long",
"rawUncompress",
"(",
"long",
"inputAddr",
",",
"long",
"inputSize",
",",
"long",
"destAddr",
")",
"throws",
"IOException",
"{",
"return",
"impl",
".",
"rawUncompress",
"(",
"inputAddr",
",",
"inputSize",
",",
"destAddr",
")",
";",
... | Zero-copy decompress using memory addresses.
@param inputAddr input memory address
@param inputSize input byte size
@param destAddr destination address of the uncompressed data
@return the uncompressed data size
@throws IOException | [
"Zero",
"-",
"copy",
"decompress",
"using",
"memory",
"addresses",
"."
] | train | https://github.com/xerial/snappy-java/blob/9df6ed7bbce88186c82f2e7cdcb7b974421b3340/src/main/java/org/xerial/snappy/Snappy.java#L403-L407 |
apache/groovy | subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java | DateTimeExtensions.leftShift | public static OffsetDateTime leftShift(final OffsetTime self, LocalDate date) {
"""
Returns an {@link java.time.OffsetDateTime} of this time and the provided {@link java.time.LocalDate}.
@param self an OffsetTime
@param date a LocalDate
@return an OffsetDateTime
@since 2.5.0
"""
return OffsetDate... | java | public static OffsetDateTime leftShift(final OffsetTime self, LocalDate date) {
return OffsetDateTime.of(date, self.toLocalTime(), self.getOffset());
} | [
"public",
"static",
"OffsetDateTime",
"leftShift",
"(",
"final",
"OffsetTime",
"self",
",",
"LocalDate",
"date",
")",
"{",
"return",
"OffsetDateTime",
".",
"of",
"(",
"date",
",",
"self",
".",
"toLocalTime",
"(",
")",
",",
"self",
".",
"getOffset",
"(",
")... | Returns an {@link java.time.OffsetDateTime} of this time and the provided {@link java.time.LocalDate}.
@param self an OffsetTime
@param date a LocalDate
@return an OffsetDateTime
@since 2.5.0 | [
"Returns",
"an",
"{",
"@link",
"java",
".",
"time",
".",
"OffsetDateTime",
"}",
"of",
"this",
"time",
"and",
"the",
"provided",
"{",
"@link",
"java",
".",
"time",
".",
"LocalDate",
"}",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java#L1262-L1264 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/service/RaftServiceContext.java | RaftServiceContext.keepAliveSessions | public void keepAliveSessions(long index, long timestamp) {
"""
Keeps all sessions alive using the given timestamp.
@param index the index of the timestamp
@param timestamp the timestamp with which to reset session timeouts
"""
log.debug("Resetting session timeouts");
this.currentIndex = index... | java | public void keepAliveSessions(long index, long timestamp) {
log.debug("Resetting session timeouts");
this.currentIndex = index;
this.currentTimestamp = Math.max(currentTimestamp, timestamp);
for (RaftSession session : sessions.getSessions(primitiveId)) {
session.setLastUpdated(timestamp);
}
... | [
"public",
"void",
"keepAliveSessions",
"(",
"long",
"index",
",",
"long",
"timestamp",
")",
"{",
"log",
".",
"debug",
"(",
"\"Resetting session timeouts\"",
")",
";",
"this",
".",
"currentIndex",
"=",
"index",
";",
"this",
".",
"currentTimestamp",
"=",
"Math",... | Keeps all sessions alive using the given timestamp.
@param index the index of the timestamp
@param timestamp the timestamp with which to reset session timeouts | [
"Keeps",
"all",
"sessions",
"alive",
"using",
"the",
"given",
"timestamp",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/service/RaftServiceContext.java#L423-L432 |
eldur/jwbf | src/main/java/net/sourceforge/jwbf/mediawiki/actions/queries/OldreviewedPagesTitles.java | OldreviewedPagesTitles.generateRequest | private HttpAction generateRequest(int[] namespace, String orstart, String orend) {
"""
generates the next MediaWiki-request (GetMethod) and adds it to msgs.
@param namespace the namespace(s) that will be searched for links, as a string of numbers
separated by '|'; if null, this parameter is omitted
@param or... | java | private HttpAction generateRequest(int[] namespace, String orstart, String orend) {
RequestBuilder requestBuilder =
new ApiRequestBuilder() //
.action("query") //
.formatXml() //
.param("list", "oldreviewedpages") //
.param("orlimit", LIMIT) //
;
... | [
"private",
"HttpAction",
"generateRequest",
"(",
"int",
"[",
"]",
"namespace",
",",
"String",
"orstart",
",",
"String",
"orend",
")",
"{",
"RequestBuilder",
"requestBuilder",
"=",
"new",
"ApiRequestBuilder",
"(",
")",
"//",
".",
"action",
"(",
"\"query\"",
")"... | generates the next MediaWiki-request (GetMethod) and adds it to msgs.
@param namespace the namespace(s) that will be searched for links, as a string of numbers
separated by '|'; if null, this parameter is omitted
@param orstart Start listing at this timestamp
@param orend Stop listing at this timestamp | [
"generates",
"the",
"next",
"MediaWiki",
"-",
"request",
"(",
"GetMethod",
")",
"and",
"adds",
"it",
"to",
"msgs",
"."
] | train | https://github.com/eldur/jwbf/blob/ee17ea2fa5a26f17c8332a094b2db86dd596d1ff/src/main/java/net/sourceforge/jwbf/mediawiki/actions/queries/OldreviewedPagesTitles.java#L59-L80 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataExactCardinalityImpl_CustomFieldSerializer.java | OWLDataExactCardinalityImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataExactCardinalityImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataExactCardinalityImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLDataExactCardinalityImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataExactCardinalityImpl_CustomFieldSerializer.java#L73-L76 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.writeStream | @Nonnull
public static ESuccess writeStream (@WillClose @Nonnull final OutputStream aOS,
@Nonnull final String sContent,
@Nonnull final Charset aCharset) {
"""
Write bytes to an {@link OutputStream}.
@param aOS
The output stream to w... | java | @Nonnull
public static ESuccess writeStream (@WillClose @Nonnull final OutputStream aOS,
@Nonnull final String sContent,
@Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sContent, "Content");
ValueEnforcer.notNull (aCharset... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"writeStream",
"(",
"@",
"WillClose",
"@",
"Nonnull",
"final",
"OutputStream",
"aOS",
",",
"@",
"Nonnull",
"final",
"String",
"sContent",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"ValueEnfor... | Write bytes to an {@link OutputStream}.
@param aOS
The output stream to write to. May not be <code>null</code>. Is closed
independent of error or success.
@param sContent
The string to be written. May not be <code>null</code>.
@param aCharset
The charset to be used, to convert the String to a byte array.
@return {@lin... | [
"Write",
"bytes",
"to",
"an",
"{",
"@link",
"OutputStream",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L1321-L1330 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java | FileWriter.writeLines | public <T> File writeLines(Collection<T> list) throws IORuntimeException {
"""
将列表写入文件,覆盖模式
@param <T> 集合元素类型
@param list 列表
@return 目标文件
@throws IORuntimeException IO异常
"""
return writeLines(list, false);
} | java | public <T> File writeLines(Collection<T> list) throws IORuntimeException {
return writeLines(list, false);
} | [
"public",
"<",
"T",
">",
"File",
"writeLines",
"(",
"Collection",
"<",
"T",
">",
"list",
")",
"throws",
"IORuntimeException",
"{",
"return",
"writeLines",
"(",
"list",
",",
"false",
")",
";",
"}"
] | 将列表写入文件,覆盖模式
@param <T> 集合元素类型
@param list 列表
@return 目标文件
@throws IORuntimeException IO异常 | [
"将列表写入文件,覆盖模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java#L157-L159 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java | KeyMap.putOrAggregate | public final V putOrAggregate(K key, V value, ReduceFunction<V> aggregator) throws Exception {
"""
Inserts or aggregates a value into the hash map. If the hash map does not yet contain the key,
this method inserts the value. If the table already contains the key (and a value) this
method will use the given Reduc... | java | public final V putOrAggregate(K key, V value, ReduceFunction<V> aggregator) throws Exception {
final int hash = hash(key);
final int slot = indexOf(hash);
// search the chain from the slot
for (Entry<K, V> entry = table[slot]; entry != null; entry = entry.next) {
if (entry.hashCode == hash && entry.key.equa... | [
"public",
"final",
"V",
"putOrAggregate",
"(",
"K",
"key",
",",
"V",
"value",
",",
"ReduceFunction",
"<",
"V",
">",
"aggregator",
")",
"throws",
"Exception",
"{",
"final",
"int",
"hash",
"=",
"hash",
"(",
"key",
")",
";",
"final",
"int",
"slot",
"=",
... | Inserts or aggregates a value into the hash map. If the hash map does not yet contain the key,
this method inserts the value. If the table already contains the key (and a value) this
method will use the given ReduceFunction function to combine the existing value and the
given value to a new value, and store that value ... | [
"Inserts",
"or",
"aggregates",
"a",
"value",
"into",
"the",
"hash",
"map",
".",
"If",
"the",
"hash",
"map",
"does",
"not",
"yet",
"contain",
"the",
"key",
"this",
"method",
"inserts",
"the",
"value",
".",
"If",
"the",
"table",
"already",
"contains",
"the... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L192-L209 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/network/BranchRemoteInterface.java | BranchRemoteInterface.make_restful_post | public final ServerResponse make_restful_post(JSONObject body, String url, String tag, String branchKey) {
"""
Method for handling the RESTful POST operations to Branch Servers. Internally calls abstract method {@link #doRestfulPost(String, JSONObject)}
@param url The url end point
@param body {@lin... | java | public final ServerResponse make_restful_post(JSONObject body, String url, String tag, String branchKey) {
long reqStartTime = System.currentTimeMillis();
body = body != null ? body : new JSONObject();
if (!addCommonParams(body, branchKey)) {
return new ServerResponse(tag, BranchErr... | [
"public",
"final",
"ServerResponse",
"make_restful_post",
"(",
"JSONObject",
"body",
",",
"String",
"url",
",",
"String",
"tag",
",",
"String",
"branchKey",
")",
"{",
"long",
"reqStartTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"body",
"=",
... | Method for handling the RESTful POST operations to Branch Servers. Internally calls abstract method {@link #doRestfulPost(String, JSONObject)}
@param url The url end point
@param body {@link JSONObject with parameters to the POST call}
@param tag {@link String} Tag for identifying the request for anal... | [
"Method",
"for",
"handling",
"the",
"RESTful",
"POST",
"operations",
"to",
"Branch",
"Servers",
".",
"Internally",
"calls",
"abstract",
"method",
"{",
"@link",
"#doRestfulPost",
"(",
"String",
"JSONObject",
")",
"}"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/network/BranchRemoteInterface.java#L125-L150 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.orLikePattern | public ZealotKhala orLikePattern(String field, String pattern) {
"""
根据指定的模式字符串生成带" OR "前缀的like模糊查询的SQL片段.
<p>示例:传入 {"b.title", "Java%"} 两个参数,生成的SQL片段为:" OR b.title LIKE 'Java%' "</p>
@param field 数据库字段
@param pattern 模式字符串
@return ZealotKhala实例
"""
return this.doLikePattern(ZealotConst.OR_PREFIX... | java | public ZealotKhala orLikePattern(String field, String pattern) {
return this.doLikePattern(ZealotConst.OR_PREFIX, field, pattern, true, true);
} | [
"public",
"ZealotKhala",
"orLikePattern",
"(",
"String",
"field",
",",
"String",
"pattern",
")",
"{",
"return",
"this",
".",
"doLikePattern",
"(",
"ZealotConst",
".",
"OR_PREFIX",
",",
"field",
",",
"pattern",
",",
"true",
",",
"true",
")",
";",
"}"
] | 根据指定的模式字符串生成带" OR "前缀的like模糊查询的SQL片段.
<p>示例:传入 {"b.title", "Java%"} 两个参数,生成的SQL片段为:" OR b.title LIKE 'Java%' "</p>
@param field 数据库字段
@param pattern 模式字符串
@return ZealotKhala实例 | [
"根据指定的模式字符串生成带",
"OR",
"前缀的like模糊查询的SQL片段",
".",
"<p",
">",
"示例:传入",
"{",
"b",
".",
"title",
"Java%",
"}",
"两个参数,生成的SQL片段为:",
"OR",
"b",
".",
"title",
"LIKE",
"Java%",
"<",
"/",
"p",
">"
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L1092-L1094 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.xdsl_setting_GET | public OvhSetting xdsl_setting_GET() throws IOException {
"""
Get xdsl settings linked to the nichandle
REST: GET /me/xdsl/setting
"""
String qPath = "/me/xdsl/setting";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhSetting.class);
... | java | public OvhSetting xdsl_setting_GET() throws IOException {
String qPath = "/me/xdsl/setting";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhSetting.class);
} | [
"public",
"OvhSetting",
"xdsl_setting_GET",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/xdsl/setting\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"String",
"resp",
"=",
"exec",
"(",
"qPath",
",",
"\"GET\"",
... | Get xdsl settings linked to the nichandle
REST: GET /me/xdsl/setting | [
"Get",
"xdsl",
"settings",
"linked",
"to",
"the",
"nichandle"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2167-L2172 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/Function2Args.java | Function2Args.fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize) {
"""
This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corre... | java | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
super.fixupVariables(vars, globalsSize);
if(null != m_arg1)
m_arg1.fixupVariables(vars, globalsSize);
} | [
"public",
"void",
"fixupVariables",
"(",
"java",
".",
"util",
".",
"Vector",
"vars",
",",
"int",
"globalsSize",
")",
"{",
"super",
".",
"fixupVariables",
"(",
"vars",
",",
"globalsSize",
")",
";",
"if",
"(",
"null",
"!=",
"m_arg1",
")",
"m_arg1",
".",
... | This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector f... | [
"This",
"function",
"is",
"used",
"to",
"fixup",
"variables",
"from",
"QNames",
"to",
"stack",
"frame",
"indexes",
"at",
"stylesheet",
"build",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/Function2Args.java#L61-L66 |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java | RegistryService.checkGroup | private void checkGroup(final SessionProvider sessionProvider, final String groupPath) throws RepositoryException {
"""
check if group exists and creates one if necessary
@param sessionProvider
@param groupPath
@throws RepositoryException
"""
String[] groupNames = groupPath.split("/");
String ... | java | private void checkGroup(final SessionProvider sessionProvider, final String groupPath) throws RepositoryException
{
String[] groupNames = groupPath.split("/");
String prefix = "/" + EXO_REGISTRY;
Session session = session(sessionProvider, repositoryService.getCurrentRepository());
for (String... | [
"private",
"void",
"checkGroup",
"(",
"final",
"SessionProvider",
"sessionProvider",
",",
"final",
"String",
"groupPath",
")",
"throws",
"RepositoryException",
"{",
"String",
"[",
"]",
"groupNames",
"=",
"groupPath",
".",
"split",
"(",
"\"/\"",
")",
";",
"String... | check if group exists and creates one if necessary
@param sessionProvider
@param groupPath
@throws RepositoryException | [
"check",
"if",
"group",
"exists",
"and",
"creates",
"one",
"if",
"necessary"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java#L647-L669 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServersInner.java | ServersInner.createOrUpdateAsync | public Observable<ServerInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerInner parameters) {
"""
Creates or updates a new server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the ... | java | public Observable<ServerInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerInner>, ServerInner>() {
@Override
public... | [
"public",
"Observable",
"<",
"ServerInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverN... | Creates or updates a new server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param parameters The required parameters for creating or updating a server.
@throw... | [
"Creates",
"or",
"updates",
"a",
"new",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServersInner.java#L298-L305 |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/io/Serializables.java | Serializables.deserialize | public static <T extends Serializable> T deserialize(byte[] bytes) throws IOException, ClassNotFoundException {
"""
Utility for returning a Serializable object from a byte array.
"""
return deserialize(bytes, false);
} | java | public static <T extends Serializable> T deserialize(byte[] bytes) throws IOException, ClassNotFoundException {
return deserialize(bytes, false);
} | [
"public",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"T",
"deserialize",
"(",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"deserialize",
"(",
"bytes",
",",
"false",
")",
";",
"}"
] | Utility for returning a Serializable object from a byte array. | [
"Utility",
"for",
"returning",
"a",
"Serializable",
"object",
"from",
"a",
"byte",
"array",
"."
] | train | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/io/Serializables.java#L58-L60 |
leancloud/java-sdk-all | realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java | AVIMConversation.queryMessagesByType | public void queryMessagesByType(int msgType, final String msgId, final long timestamp, final int limit,
final AVIMMessagesQueryCallback callback) {
"""
获取特定类型的历史消息。
注意:这个操作总是会从云端获取记录。
另,如果不指定 msgId 和 timestamp,则该函数效果等同于 queryMessageByType(type, limit, callback)
@param msgType... | java | public void queryMessagesByType(int msgType, final String msgId, final long timestamp, final int limit,
final AVIMMessagesQueryCallback callback) {
if (null == callback) {
return;
}
Map<String, Object> params = new HashMap<String, Object>();
params.put(Conversatio... | [
"public",
"void",
"queryMessagesByType",
"(",
"int",
"msgType",
",",
"final",
"String",
"msgId",
",",
"final",
"long",
"timestamp",
",",
"final",
"int",
"limit",
",",
"final",
"AVIMMessagesQueryCallback",
"callback",
")",
"{",
"if",
"(",
"null",
"==",
"callbac... | 获取特定类型的历史消息。
注意:这个操作总是会从云端获取记录。
另,如果不指定 msgId 和 timestamp,则该函数效果等同于 queryMessageByType(type, limit, callback)
@param msgType 消息类型,可以参看 `AVIMMessageType` 里的定义。
@param msgId 消息id,从特定消息 id 开始向前查询(结果不会包含该记录)
@param timestamp 查询起始的时间戳,返回小于这个时间的记录,必须配合 msgId 一起使用。
要从最新消息开始获取时,请用 0 代替客户端的本地当前时间(System.currentTim... | [
"获取特定类型的历史消息。",
"注意:这个操作总是会从云端获取记录。",
"另,如果不指定",
"msgId",
"和",
"timestamp,则该函数效果等同于",
"queryMessageByType",
"(",
"type",
"limit",
"callback",
")"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java#L803-L824 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/config/PaxPropertySetter.java | PaxPropertySetter.setProperty | public
void setProperty(String name, String value) {
"""
Set a property on this PaxPropertySetter's Object. If successful, this
method will invoke a setter method on the underlying Object. The
setter is the one for the specified property name and the value is
determined partly from the setter argument type an... | java | public
void setProperty(String name, String value) {
if (value == null) return;
name = Introspector.decapitalize(name);
PropertyDescriptor prop = getPropertyDescriptor(name);
//LogLog.debug("---------Key: "+name+", type="+prop.getPropertyType());
if (prop == null) {
LogLog.warn("No such p... | [
"public",
"void",
"setProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
";",
"name",
"=",
"Introspector",
".",
"decapitalize",
"(",
"name",
")",
";",
"PropertyDescriptor",
"prop",
"=",
"g... | Set a property on this PaxPropertySetter's Object. If successful, this
method will invoke a setter method on the underlying Object. The
setter is the one for the specified property name and the value is
determined partly from the setter argument type and partly from the
value specified in the call to this method.
<p>I... | [
"Set",
"a",
"property",
"on",
"this",
"PaxPropertySetter",
"s",
"Object",
".",
"If",
"successful",
"this",
"method",
"will",
"invoke",
"a",
"setter",
"method",
"on",
"the",
"underlying",
"Object",
".",
"The",
"setter",
"is",
"the",
"one",
"for",
"the",
"sp... | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/config/PaxPropertySetter.java#L255-L275 |
evernote/evernote-sdk-android | library/src/main/java/com/evernote/client/android/EvernoteUtil.java | EvernoteUtil.hash | public static byte[] hash(InputStream in) throws IOException {
"""
Returns an MD5 checksum of the contents of the provided InputStream.
"""
if (HASH_DIGEST == null) {
throw new EvernoteUtilException(EDAM_HASH_ALGORITHM + " not supported", new NoSuchAlgorithmException(EDAM_HASH_ALGORITHM));
... | java | public static byte[] hash(InputStream in) throws IOException {
if (HASH_DIGEST == null) {
throw new EvernoteUtilException(EDAM_HASH_ALGORITHM + " not supported", new NoSuchAlgorithmException(EDAM_HASH_ALGORITHM));
}
byte[] buf = new byte[1024];
int n;
while ((n = in.... | [
"public",
"static",
"byte",
"[",
"]",
"hash",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"if",
"(",
"HASH_DIGEST",
"==",
"null",
")",
"{",
"throw",
"new",
"EvernoteUtilException",
"(",
"EDAM_HASH_ALGORITHM",
"+",
"\" not supported\"",
",",
"n... | Returns an MD5 checksum of the contents of the provided InputStream. | [
"Returns",
"an",
"MD5",
"checksum",
"of",
"the",
"contents",
"of",
"the",
"provided",
"InputStream",
"."
] | train | https://github.com/evernote/evernote-sdk-android/blob/fc59be643e85c4f59d562d1bfe76563997aa73cf/library/src/main/java/com/evernote/client/android/EvernoteUtil.java#L142-L153 |
prometheus/jmx_exporter | jmx_prometheus_javaagent/src/main/java/io/prometheus/jmx/JavaAgent.java | JavaAgent.parseConfig | public static Config parseConfig(String args, String ifc) {
"""
Parse the Java Agent configuration. The arguments are typically specified to the JVM as a javaagent as
{@code -javaagent:/path/to/agent.jar=<CONFIG>}. This method parses the {@code <CONFIG>} portion.
@param args provided agent args
@param ifc defau... | java | public static Config parseConfig(String args, String ifc) {
Pattern pattern = Pattern.compile(
"^(?:((?:[\\w.]+)|(?:\\[.+])):)?" + // host name, or ipv4, or ipv6 address in brackets
"(\\d{1,5}):" + // port
"(.+)"); ... | [
"public",
"static",
"Config",
"parseConfig",
"(",
"String",
"args",
",",
"String",
"ifc",
")",
"{",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"\"^(?:((?:[\\\\w.]+)|(?:\\\\[.+])):)?\"",
"+",
"// host name, or ipv4, or ipv6 address in brackets",
"\"(\\\\d{1... | Parse the Java Agent configuration. The arguments are typically specified to the JVM as a javaagent as
{@code -javaagent:/path/to/agent.jar=<CONFIG>}. This method parses the {@code <CONFIG>} portion.
@param args provided agent args
@param ifc default bind interface
@return configuration to use for our application | [
"Parse",
"the",
"Java",
"Agent",
"configuration",
".",
"The",
"arguments",
"are",
"typically",
"specified",
"to",
"the",
"JVM",
"as",
"a",
"javaagent",
"as",
"{"
] | train | https://github.com/prometheus/jmx_exporter/blob/6a8d92c580b93d62a1a9183cbb7cb1a3b19a8473/jmx_prometheus_javaagent/src/main/java/io/prometheus/jmx/JavaAgent.java#L46-L73 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/PropositionCopier.java | PropositionCopier.visit | @Override
public void visit(AbstractParameter abstractParameter) {
"""
Creates a derived abstract parameter with the id specified in the
constructor and the same characteristics (e.g., data source type,
interval, value, etc.).
@param abstractParameter an {@link AbstractParameter}. Cannot be
<code>null</c... | java | @Override
public void visit(AbstractParameter abstractParameter) {
assert this.kh != null : "kh wasn't set";
AbstractParameter param = new AbstractParameter(propId, this.uniqueIdProvider.getInstance());
param.setSourceSystem(SourceSystem.DERIVED);
param.setInterval(abstractParameter.... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"AbstractParameter",
"abstractParameter",
")",
"{",
"assert",
"this",
".",
"kh",
"!=",
"null",
":",
"\"kh wasn't set\"",
";",
"AbstractParameter",
"param",
"=",
"new",
"AbstractParameter",
"(",
"propId",
",",
"thi... | Creates a derived abstract parameter with the id specified in the
constructor and the same characteristics (e.g., data source type,
interval, value, etc.).
@param abstractParameter an {@link AbstractParameter}. Cannot be
<code>null</code>. | [
"Creates",
"a",
"derived",
"abstract",
"parameter",
"with",
"the",
"id",
"specified",
"in",
"the",
"constructor",
"and",
"the",
"same",
"characteristics",
"(",
"e",
".",
"g",
".",
"data",
"source",
"type",
"interval",
"value",
"etc",
".",
")",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/PropositionCopier.java#L116-L127 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/pool/WrapperInvocationHandler.java | WrapperInvocationHandler.getDatabaseMetaDataSurrogate | protected Object getDatabaseMetaDataSurrogate(final Method method,
final Object[] args) throws Throwable {
"""
Surrogate for any method of the delegate that returns
an instance of <tt>DatabaseMetaData</tt> object. <p>
@param method returning <tt>DatabaseMetaData</tt>
@param args to the method
@th... | java | protected Object getDatabaseMetaDataSurrogate(final Method method,
final Object[] args) throws Throwable {
if (this.dbmdHandler == null) {
Object dbmd = method.invoke(this.delegate, args);
this.dbmdHandler = new WrapperInvocationHandler(dbmd, this);
}
retur... | [
"protected",
"Object",
"getDatabaseMetaDataSurrogate",
"(",
"final",
"Method",
"method",
",",
"final",
"Object",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"this",
".",
"dbmdHandler",
"==",
"null",
")",
"{",
"Object",
"dbmd",
"=",
"method"... | Surrogate for any method of the delegate that returns
an instance of <tt>DatabaseMetaData</tt> object. <p>
@param method returning <tt>DatabaseMetaData</tt>
@param args to the method
@throws java.lang.Throwable the exception, if any, thrown by invoking
the given method with the given arguments upon the delegate
@retur... | [
"Surrogate",
"for",
"any",
"method",
"of",
"the",
"delegate",
"that",
"returns",
"an",
"instance",
"of",
"<tt",
">",
"DatabaseMetaData<",
"/",
"tt",
">",
"object",
".",
"<p",
">"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/pool/WrapperInvocationHandler.java#L874-L884 |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/NetUtils.java | NetUtils.determineHostName | @Nonnull
public static String determineHostName() throws UnknownHostException {
"""
Determine the hostname of the machine that we are on. Do not allow, blank or 0.0.0.0
as valid hostnames. The host name will be save into the OPT_HOSTNAME static variable.
We should not have to worry about threading, because... | java | @Nonnull
public static String determineHostName() throws UnknownHostException {
if (!OPT_HOSTNAME.isPresent()) {
final String hostName = InetAddress.getLocalHost().getHostName();
if (Strings.isNullOrEmpty(hostName)) {
throw new UnknownHostException("Unable to lookup l... | [
"@",
"Nonnull",
"public",
"static",
"String",
"determineHostName",
"(",
")",
"throws",
"UnknownHostException",
"{",
"if",
"(",
"!",
"OPT_HOSTNAME",
".",
"isPresent",
"(",
")",
")",
"{",
"final",
"String",
"hostName",
"=",
"InetAddress",
".",
"getLocalHost",
"(... | Determine the hostname of the machine that we are on. Do not allow, blank or 0.0.0.0
as valid hostnames. The host name will be save into the OPT_HOSTNAME static variable.
We should not have to worry about threading, because the worst that should happen is multiple threads
lookup the hostname at the same time, and its ... | [
"Determine",
"the",
"hostname",
"of",
"the",
"machine",
"that",
"we",
"are",
"on",
".",
"Do",
"not",
"allow",
"blank",
"or",
"0",
".",
"0",
".",
"0",
".",
"0",
"as",
"valid",
"hostnames",
".",
"The",
"host",
"name",
"will",
"be",
"save",
"into",
"t... | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/NetUtils.java#L37-L52 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.JaccardDistance | public static double JaccardDistance(double[] p, double[] q) {
"""
Gets the Jaccard distance between two points.
@param p A point in space.
@param q A point in space.
@return The Jaccard distance between x and y.
"""
double distance = 0;
int intersection = 0, union = 0;
for (int x... | java | public static double JaccardDistance(double[] p, double[] q) {
double distance = 0;
int intersection = 0, union = 0;
for (int x = 0; x < p.length; x++) {
if ((p[x] != 0) || (q[x] != 0)) {
if (p[x] == q[x]) {
intersection++;
}
... | [
"public",
"static",
"double",
"JaccardDistance",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"distance",
"=",
"0",
";",
"int",
"intersection",
"=",
"0",
",",
"union",
"=",
"0",
";",
"for",
"(",
"int",
"x",
"=",
... | Gets the Jaccard distance between two points.
@param p A point in space.
@param q A point in space.
@return The Jaccard distance between x and y. | [
"Gets",
"the",
"Jaccard",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L431-L451 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/tag/BasicTagList.java | BasicTagList.concat | public static BasicTagList concat(TagList t1, TagList t2) {
"""
Returns a tag list containing the union of {@code t1} and {@code t2}.
If there is a conflict with tag keys, the tag from {@code t2} will be
used.
"""
return new BasicTagList(Iterables.concat(t1, t2));
} | java | public static BasicTagList concat(TagList t1, TagList t2) {
return new BasicTagList(Iterables.concat(t1, t2));
} | [
"public",
"static",
"BasicTagList",
"concat",
"(",
"TagList",
"t1",
",",
"TagList",
"t2",
")",
"{",
"return",
"new",
"BasicTagList",
"(",
"Iterables",
".",
"concat",
"(",
"t1",
",",
"t2",
")",
")",
";",
"}"
] | Returns a tag list containing the union of {@code t1} and {@code t2}.
If there is a conflict with tag keys, the tag from {@code t2} will be
used. | [
"Returns",
"a",
"tag",
"list",
"containing",
"the",
"union",
"of",
"{"
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/tag/BasicTagList.java#L166-L168 |
google/closure-compiler | src/com/google/javascript/jscomp/MustBeReachingVariableDef.java | MustBeReachingVariableDef.getDef | Definition getDef(String name, Node useNode) {
"""
Gets the must reaching definition of a given node.
@param name name of the variable. It can only be names of local variable
that are not function parameters, escaped variables or variables
declared in catch.
@param useNode the location of the use where the d... | java | Definition getDef(String name, Node useNode) {
checkArgument(getCfg().hasNode(useNode));
GraphNode<Node, Branch> n = getCfg().getNode(useNode);
FlowState<MustDef> state = n.getAnnotation();
return state.getIn().reachingDef.get(allVarsInFn.get(name));
} | [
"Definition",
"getDef",
"(",
"String",
"name",
",",
"Node",
"useNode",
")",
"{",
"checkArgument",
"(",
"getCfg",
"(",
")",
".",
"hasNode",
"(",
"useNode",
")",
")",
";",
"GraphNode",
"<",
"Node",
",",
"Branch",
">",
"n",
"=",
"getCfg",
"(",
")",
".",... | Gets the must reaching definition of a given node.
@param name name of the variable. It can only be names of local variable
that are not function parameters, escaped variables or variables
declared in catch.
@param useNode the location of the use where the definition reaches. | [
"Gets",
"the",
"must",
"reaching",
"definition",
"of",
"a",
"given",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/MustBeReachingVariableDef.java#L469-L474 |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageManager.java | ImageManager.getPreparedImage | public BufferedImage getPreparedImage (String rset, String path, Colorization[] zations) {
"""
Loads (and caches) the specified image from the resource manager, obtaining the image from
the supplied resource set and applying the using the supplied path to identify the image.
<p> Additionally the image is optim... | java | public BufferedImage getPreparedImage (String rset, String path, Colorization[] zations)
{
BufferedImage image = getImage(rset, path, zations);
BufferedImage prepped = null;
if (image != null) {
prepped = createImage(image.getWidth(), image.getHeight(),
... | [
"public",
"BufferedImage",
"getPreparedImage",
"(",
"String",
"rset",
",",
"String",
"path",
",",
"Colorization",
"[",
"]",
"zations",
")",
"{",
"BufferedImage",
"image",
"=",
"getImage",
"(",
"rset",
",",
"path",
",",
"zations",
")",
";",
"BufferedImage",
"... | Loads (and caches) the specified image from the resource manager, obtaining the image from
the supplied resource set and applying the using the supplied path to identify the image.
<p> Additionally the image is optimized for display in the current graphics
configuration. Consider using {@link #getMirage(ImageKey,Color... | [
"Loads",
"(",
"and",
"caches",
")",
"the",
"specified",
"image",
"from",
"the",
"resource",
"manager",
"obtaining",
"the",
"image",
"from",
"the",
"supplied",
"resource",
"set",
"and",
"applying",
"the",
"using",
"the",
"supplied",
"path",
"to",
"identify",
... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageManager.java#L244-L256 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java | FormLayout.computeGridOrigins | private static int[] computeGridOrigins(Container container,
int totalSize, int offset,
List formSpecs,
List[] componentLists,
int[][] groupIndices,
Measure minMeasure,
Measure prefMeasure) {
"""
Computes and returns the grid's origins.
@pa... | java | private static int[] computeGridOrigins(Container container,
int totalSize, int offset,
List formSpecs,
List[] componentLists,
int[][] groupIndices,
Measure minMeasure,
Measure prefMeasure) {
/* For each spec compute the minimum and preferr... | [
"private",
"static",
"int",
"[",
"]",
"computeGridOrigins",
"(",
"Container",
"container",
",",
"int",
"totalSize",
",",
"int",
"offset",
",",
"List",
"formSpecs",
",",
"List",
"[",
"]",
"componentLists",
",",
"int",
"[",
"]",
"[",
"]",
"groupIndices",
","... | Computes and returns the grid's origins.
@param container the layout container
@param totalSize the total size to assign
@param offset the offset from left or top margin
@param formSpecs the column or row specs, resp.
@param componentLists the components list for each col/row
@param minMeasure the measure used to dete... | [
"Computes",
"and",
"returns",
"the",
"grid",
"s",
"origins",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java#L1325-L1357 |
iron-io/iron_mq_java | src/main/java/io/iron/ironmq/Queue.java | Queue.pushMessages | public Ids pushMessages(String[] msg, long delay) throws IOException {
"""
Pushes a messages onto the queue.
@param msg The array of the messages to push.
@param delay The message's delay in seconds.
@return The IDs of new messages
@throws io.iron.ironmq.HTTPException If the IronMQ service returns a status... | java | public Ids pushMessages(String[] msg, long delay) throws IOException {
ArrayList<Message> messages = new ArrayList<Message>();
for (String messageName: msg){
Message message = new Message();
message.setBody(messageName);
message.setDelay(delay);
messages.a... | [
"public",
"Ids",
"pushMessages",
"(",
"String",
"[",
"]",
"msg",
",",
"long",
"delay",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"Message",
">",
"messages",
"=",
"new",
"ArrayList",
"<",
"Message",
">",
"(",
")",
";",
"for",
"(",
"String",
"... | Pushes a messages onto the queue.
@param msg The array of the messages to push.
@param delay The message's delay in seconds.
@return The IDs of new messages
@throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK.
@throws java.io.IOException If there is an error accessing the Iro... | [
"Pushes",
"a",
"messages",
"onto",
"the",
"queue",
"."
] | train | https://github.com/iron-io/iron_mq_java/blob/62d6a86545ca7ef31b7b4797aae0c5b31394a507/src/main/java/io/iron/ironmq/Queue.java#L412-L427 |
google/closure-compiler | src/com/google/javascript/jscomp/ReplaceMessages.java | ReplaceMessages.getNewValueNode | private Node getNewValueNode(JsMessage message, Node origValueNode)
throws MalformedException {
"""
Constructs a node representing a message's value, or, if possible, just
modifies {@code origValueNode} so that it accurately represents the
message's value.
@param message a message
@param origValueNode... | java | private Node getNewValueNode(JsMessage message, Node origValueNode)
throws MalformedException {
switch (origValueNode.getToken()) {
case FUNCTION:
// The message is a function. Modify the function node.
updateFunctionNode(message, origValueNode);
return origValueNode;
case ... | [
"private",
"Node",
"getNewValueNode",
"(",
"JsMessage",
"message",
",",
"Node",
"origValueNode",
")",
"throws",
"MalformedException",
"{",
"switch",
"(",
"origValueNode",
".",
"getToken",
"(",
")",
")",
"{",
"case",
"FUNCTION",
":",
"// The message is a function. Mo... | Constructs a node representing a message's value, or, if possible, just
modifies {@code origValueNode} so that it accurately represents the
message's value.
@param message a message
@param origValueNode the message's original value node
@return a Node that can replace {@code origValueNode}
@throws MalformedExceptio... | [
"Constructs",
"a",
"node",
"representing",
"a",
"message",
"s",
"value",
"or",
"if",
"possible",
"just",
"modifies",
"{",
"@code",
"origValueNode",
"}",
"so",
"that",
"it",
"accurately",
"represents",
"the",
"message",
"s",
"value",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceMessages.java#L119-L145 |
Impetus/Kundera | src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java | OracleNoSQLClient.readEmbeddable | private void readEmbeddable(Object key, List<String> columnsToSelect, EntityMetadata entityMetadata,
MetamodelImpl metamodel, Table schemaTable, RecordValue value, Attribute attribute) {
"""
Read embeddable.
@param key
the key
@param columnsToSelect
the columns to select
@param entityMetadata
t... | java | private void readEmbeddable(Object key, List<String> columnsToSelect, EntityMetadata entityMetadata,
MetamodelImpl metamodel, Table schemaTable, RecordValue value, Attribute attribute)
{
EmbeddableType embeddableId = metamodel.embeddable(((AbstractAttribute) attribute).getBindableJavaType());
... | [
"private",
"void",
"readEmbeddable",
"(",
"Object",
"key",
",",
"List",
"<",
"String",
">",
"columnsToSelect",
",",
"EntityMetadata",
"entityMetadata",
",",
"MetamodelImpl",
"metamodel",
",",
"Table",
"schemaTable",
",",
"RecordValue",
"value",
",",
"Attribute",
"... | Read embeddable.
@param key
the key
@param columnsToSelect
the columns to select
@param entityMetadata
the entity metadata
@param metamodel
the metamodel
@param schemaTable
the schema table
@param value
the value
@param attribute
the attribute | [
"Read",
"embeddable",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java#L264-L281 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.deleteBranch | public void deleteBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
"""
Delete a single project repository branch.
<pre><code>GitLab Endpoint: DELETE /projects/:id/repository/branches/:branch</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(pat... | java | public void deleteBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects",
getProjectIdOrPath(projectIdOrPath), ... | [
"public",
"void",
"deleteBranch",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"branchName",
")",
"throws",
"GitLabApiException",
"{",
"Response",
".",
"Status",
"expectedStatus",
"=",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
"?",
"Response",
... | Delete a single project repository branch.
<pre><code>GitLab Endpoint: DELETE /projects/:id/repository/branches/:branch</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param branchName the name of the branch to delete
@throws GitLabApiException if any ... | [
"Delete",
"a",
"single",
"project",
"repository",
"branch",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L158-L162 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RelativeDateTimeFormatter.java | RelativeDateTimeFormatter.getInstance | public static RelativeDateTimeFormatter getInstance(ULocale locale, NumberFormat nf) {
"""
Returns a RelativeDateTimeFormatter for a particular locale that uses a particular
NumberFormat object.
@param locale the locale
@param nf the number format object. It is defensively copied to ensure thread-safety
and ... | java | public static RelativeDateTimeFormatter getInstance(ULocale locale, NumberFormat nf) {
return getInstance(locale, nf, Style.LONG, DisplayContext.CAPITALIZATION_NONE);
} | [
"public",
"static",
"RelativeDateTimeFormatter",
"getInstance",
"(",
"ULocale",
"locale",
",",
"NumberFormat",
"nf",
")",
"{",
"return",
"getInstance",
"(",
"locale",
",",
"nf",
",",
"Style",
".",
"LONG",
",",
"DisplayContext",
".",
"CAPITALIZATION_NONE",
")",
"... | Returns a RelativeDateTimeFormatter for a particular locale that uses a particular
NumberFormat object.
@param locale the locale
@param nf the number format object. It is defensively copied to ensure thread-safety
and immutability of this class.
@return An instance of RelativeDateTimeFormatter. | [
"Returns",
"a",
"RelativeDateTimeFormatter",
"for",
"a",
"particular",
"locale",
"that",
"uses",
"a",
"particular",
"NumberFormat",
"object",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RelativeDateTimeFormatter.java#L393-L395 |
samskivert/samskivert | src/main/java/com/samskivert/util/ClassUtil.java | ClassUtil.primitiveIsAssignableFrom | public static boolean primitiveIsAssignableFrom (Class<?> lhs, Class<?> rhs) {
"""
Tells whether an instance of the primitive class represented by 'rhs' can be assigned to an
instance of the primitive class represented by 'lhs'.
@param lhs assignee class.
@param rhs assigned class.
@return true if compatib... | java | public static boolean primitiveIsAssignableFrom (Class<?> lhs, Class<?> rhs)
{
if (lhs == null || rhs == null) {
return false;
}
if (!(lhs.isPrimitive() && rhs.isPrimitive())) {
return false;
}
if (lhs.equals(rhs)) {
return true;
}
... | [
"public",
"static",
"boolean",
"primitiveIsAssignableFrom",
"(",
"Class",
"<",
"?",
">",
"lhs",
",",
"Class",
"<",
"?",
">",
"rhs",
")",
"{",
"if",
"(",
"lhs",
"==",
"null",
"||",
"rhs",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(... | Tells whether an instance of the primitive class represented by 'rhs' can be assigned to an
instance of the primitive class represented by 'lhs'.
@param lhs assignee class.
@param rhs assigned class.
@return true if compatible, false otherwise. If either argument is <code>null</code>, or one
of the parameters does no... | [
"Tells",
"whether",
"an",
"instance",
"of",
"the",
"primitive",
"class",
"represented",
"by",
"rhs",
"can",
"be",
"assigned",
"to",
"an",
"instance",
"of",
"the",
"primitive",
"class",
"represented",
"by",
"lhs",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ClassUtil.java#L236-L252 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsSubscriptionDriver.java | CmsSubscriptionDriver.internalReadVisitEntry | protected CmsVisitEntry internalReadVisitEntry(ResultSet res) throws SQLException {
"""
Creates a new {@link CmsVisitEntry} object from the given result set entry.<p>
@param res the result set
@return the new {@link CmsVisitEntry} object
@throws SQLException if something goes wrong
"""
CmsUUI... | java | protected CmsVisitEntry internalReadVisitEntry(ResultSet res) throws SQLException {
CmsUUID userId = new CmsUUID(res.getString(m_sqlManager.readQuery("C_VISIT_USER_ID")));
long date = res.getLong(m_sqlManager.readQuery("C_VISIT_DATE"));
CmsUUID structureId = new CmsUUID(res.getString(m_sqlManag... | [
"protected",
"CmsVisitEntry",
"internalReadVisitEntry",
"(",
"ResultSet",
"res",
")",
"throws",
"SQLException",
"{",
"CmsUUID",
"userId",
"=",
"new",
"CmsUUID",
"(",
"res",
".",
"getString",
"(",
"m_sqlManager",
".",
"readQuery",
"(",
"\"C_VISIT_USER_ID\"",
")",
"... | Creates a new {@link CmsVisitEntry} object from the given result set entry.<p>
@param res the result set
@return the new {@link CmsVisitEntry} object
@throws SQLException if something goes wrong | [
"Creates",
"a",
"new",
"{",
"@link",
"CmsVisitEntry",
"}",
"object",
"from",
"the",
"given",
"result",
"set",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsSubscriptionDriver.java#L941-L947 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.