repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
201
func_name
stringlengths
4
126
whole_func_string
stringlengths
75
3.57k
language
stringclasses
1 value
func_code_string
stringlengths
75
3.57k
func_code_tokens
listlengths
21
599
func_documentation_string
stringlengths
61
1.95k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
111
308
jmchilton/galaxy-bootstrap
src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java
DownloadProperties.wgetGithub
public static DownloadProperties wgetGithub(final String branch, final File destination) { return new DownloadProperties(new WgetGithubDownloader(branch), destination); }
java
public static DownloadProperties wgetGithub(final String branch, final File destination) { return new DownloadProperties(new WgetGithubDownloader(branch), destination); }
[ "public", "static", "DownloadProperties", "wgetGithub", "(", "final", "String", "branch", ",", "final", "File", "destination", ")", "{", "return", "new", "DownloadProperties", "(", "new", "WgetGithubDownloader", "(", "branch", ")", ",", "destination", ")", ";", ...
Builds a new DownloadProperties for downloading Galaxy from github using wget. @param branch The branch to download (e.g. master, dev, release_15.03). @param destination The destination directory to store Galaxy, null if a directory should be chosen by default. @return A DownloadProperties for downloading Galaxy from github using wget.
[ "Builds", "a", "new", "DownloadProperties", "for", "downloading", "Galaxy", "from", "github", "using", "wget", "." ]
train
https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java#L293-L295
jeremylong/DependencyCheck
utils/src/main/java/org/owasp/dependencycheck/utils/Checksum.java
Checksum.getSHA1Checksum
public static String getSHA1Checksum(String text) { final byte[] data = stringToBytes(text); return getChecksum(SHA1, data); }
java
public static String getSHA1Checksum(String text) { final byte[] data = stringToBytes(text); return getChecksum(SHA1, data); }
[ "public", "static", "String", "getSHA1Checksum", "(", "String", "text", ")", "{", "final", "byte", "[", "]", "data", "=", "stringToBytes", "(", "text", ")", ";", "return", "getChecksum", "(", "SHA1", ",", "data", ")", ";", "}" ]
Calculates the SHA1 checksum of the specified text. @param text the text to generate the SHA1 checksum @return the hex representation of the SHA1
[ "Calculates", "the", "SHA1", "checksum", "of", "the", "specified", "text", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Checksum.java#L169-L172
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java
PublicIPPrefixesInner.beginDelete
public void beginDelete(String resourceGroupName, String publicIpPrefixName) { beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); }
java
public void beginDelete(String resourceGroupName, String publicIpPrefixName) { beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); }
[ "public", "void", "beginDelete", "(", "String", "resourceGroupName", ",", "String", "publicIpPrefixName", ")", "{", "beginDeleteWithServiceResponseAsync", "(", "resourceGroupName", ",", "publicIpPrefixName", ")", ".", "toBlocking", "(", ")", ".", "single", "(", ")", ...
Deletes the specified public IP prefix. @param resourceGroupName The name of the resource group. @param publicIpPrefixName The name of the PublicIpPrefix. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
[ "Deletes", "the", "specified", "public", "IP", "prefix", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java#L191-L193
OpenLiberty/open-liberty
dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java
IFixCompareCommandTask.isIFixApplicable
private boolean isIFixApplicable(Version productVersion, IFixInfo iFixInfo) throws VersionParsingException { // If we don't know the product version just return true if (productVersion == null) { return true; } // Get the applicability for the iFix Applicability applicability = iFixInfo.getApplicability(); if (applicability == null) { throw new VersionParsingException(getMessage("compare.unable.to.find.offering", iFixInfo.getId())); } List<Offering> offerings = applicability.getOfferings(); if (offerings == null || offerings.isEmpty()) { throw new VersionParsingException(getMessage("compare.unable.to.find.offering", iFixInfo.getId())); } // All offerings do not have the same version range so we need to iterate to see if we match // an of the applicable ranges boolean matches = false; for (Offering offering : offerings) { String tolerance = offering.getTolerance(); VersionRange toleranceRange = VersionRange.parseVersionRange(tolerance); // Make sure the product version is in the range of the tolerance if (toleranceRange.matches(productVersion)) { matches = true; break; } } return matches; }
java
private boolean isIFixApplicable(Version productVersion, IFixInfo iFixInfo) throws VersionParsingException { // If we don't know the product version just return true if (productVersion == null) { return true; } // Get the applicability for the iFix Applicability applicability = iFixInfo.getApplicability(); if (applicability == null) { throw new VersionParsingException(getMessage("compare.unable.to.find.offering", iFixInfo.getId())); } List<Offering> offerings = applicability.getOfferings(); if (offerings == null || offerings.isEmpty()) { throw new VersionParsingException(getMessage("compare.unable.to.find.offering", iFixInfo.getId())); } // All offerings do not have the same version range so we need to iterate to see if we match // an of the applicable ranges boolean matches = false; for (Offering offering : offerings) { String tolerance = offering.getTolerance(); VersionRange toleranceRange = VersionRange.parseVersionRange(tolerance); // Make sure the product version is in the range of the tolerance if (toleranceRange.matches(productVersion)) { matches = true; break; } } return matches; }
[ "private", "boolean", "isIFixApplicable", "(", "Version", "productVersion", ",", "IFixInfo", "iFixInfo", ")", "throws", "VersionParsingException", "{", "// If we don't know the product version just return true", "if", "(", "productVersion", "==", "null", ")", "{", "return",...
Returns <code>true</code> if the IFixInfo applies the current installation version. @param productVersion @param iFixInfo @return
[ "Returns", "<code", ">", "true<", "/", "code", ">", "if", "the", "IFixInfo", "applies", "the", "current", "installation", "version", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java#L474-L504
osglworks/java-mvc
src/main/java/org/osgl/mvc/result/Gone.java
Gone.of
public static Gone of(Throwable cause) { if (_localizedErrorMsg()) { return of(cause, defaultMessage(GONE)); } else { touchPayload().cause(cause); return _INSTANCE; } }
java
public static Gone of(Throwable cause) { if (_localizedErrorMsg()) { return of(cause, defaultMessage(GONE)); } else { touchPayload().cause(cause); return _INSTANCE; } }
[ "public", "static", "Gone", "of", "(", "Throwable", "cause", ")", "{", "if", "(", "_localizedErrorMsg", "(", ")", ")", "{", "return", "of", "(", "cause", ",", "defaultMessage", "(", "GONE", ")", ")", ";", "}", "else", "{", "touchPayload", "(", ")", "...
Returns a static Gone instance and set the {@link #payload} thread local with cause specified. When calling the instance on {@link #getMessage()} method, it will return whatever stored in the {@link #payload} thread local @param cause the cause @return a static Gone instance as described above
[ "Returns", "a", "static", "Gone", "instance", "and", "set", "the", "{", "@link", "#payload", "}", "thread", "local", "with", "cause", "specified", "." ]
train
https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/Gone.java#L130-L137
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java
ComputerVisionImpl.analyzeImageByDomainInStream
public DomainModelResults analyzeImageByDomainInStream(String model, byte[] image, AnalyzeImageByDomainInStreamOptionalParameter analyzeImageByDomainInStreamOptionalParameter) { return analyzeImageByDomainInStreamWithServiceResponseAsync(model, image, analyzeImageByDomainInStreamOptionalParameter).toBlocking().single().body(); }
java
public DomainModelResults analyzeImageByDomainInStream(String model, byte[] image, AnalyzeImageByDomainInStreamOptionalParameter analyzeImageByDomainInStreamOptionalParameter) { return analyzeImageByDomainInStreamWithServiceResponseAsync(model, image, analyzeImageByDomainInStreamOptionalParameter).toBlocking().single().body(); }
[ "public", "DomainModelResults", "analyzeImageByDomainInStream", "(", "String", "model", ",", "byte", "[", "]", "image", ",", "AnalyzeImageByDomainInStreamOptionalParameter", "analyzeImageByDomainInStreamOptionalParameter", ")", "{", "return", "analyzeImageByDomainInStreamWithServic...
This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET request. Currently, the API only provides a single domain-specific model: celebrities. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong. @param model The domain-specific content to recognize. @param image An image stream. @param analyzeImageByDomainInStreamOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @throws ComputerVisionErrorException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the DomainModelResults object if successful.
[ "This", "operation", "recognizes", "content", "within", "an", "image", "by", "applying", "a", "domain", "-", "specific", "model", ".", "The", "list", "of", "domain", "-", "specific", "models", "that", "are", "supported", "by", "the", "Computer", "Vision", "A...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L257-L259
nulab/backlog4j
src/main/java/com/nulabinc/backlog4j/internal/http/MimeHelper.java
MimeHelper.decodeContentDisposition
public static String decodeContentDisposition(String value, Map<String, String> params) { try { HeaderTokenizer tokenizer = new HeaderTokenizer(value); // get the first token, which must be an ATOM Token token = tokenizer.next(); if (token.getType() != Token.ATOM) { return null; } String disposition = token.getValue(); // value ignored in this method // the remainder is the parameters String remainder = tokenizer.getRemainder(); if (remainder != null) { getParameters(remainder, params); } return disposition; } catch (ParseException e) { return null; } }
java
public static String decodeContentDisposition(String value, Map<String, String> params) { try { HeaderTokenizer tokenizer = new HeaderTokenizer(value); // get the first token, which must be an ATOM Token token = tokenizer.next(); if (token.getType() != Token.ATOM) { return null; } String disposition = token.getValue(); // value ignored in this method // the remainder is the parameters String remainder = tokenizer.getRemainder(); if (remainder != null) { getParameters(remainder, params); } return disposition; } catch (ParseException e) { return null; } }
[ "public", "static", "String", "decodeContentDisposition", "(", "String", "value", ",", "Map", "<", "String", ",", "String", ">", "params", ")", "{", "try", "{", "HeaderTokenizer", "tokenizer", "=", "new", "HeaderTokenizer", "(", "value", ")", ";", "// get the ...
Decodes the Content-Disposition header value according to RFC 2183 and RFC 2231. <p/> Does not deal with continuation lines. <p/> See <a href="http://tools.ietf.org/html/rfc2231">RFC 2231</a> for details. @param value the header value to decode @param params the map of parameters to fill @return the disposition
[ "Decodes", "the", "Content", "-", "Disposition", "header", "value", "according", "to", "RFC", "2183", "and", "RFC", "2231", ".", "<p", "/", ">", "Does", "not", "deal", "with", "continuation", "lines", ".", "<p", "/", ">", "See", "<a", "href", "=", "htt...
train
https://github.com/nulab/backlog4j/blob/862ae0586ad808b2ec413f665b8dfc0c9a107b4e/src/main/java/com/nulabinc/backlog4j/internal/http/MimeHelper.java#L61-L81