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
apiman/apiman
manager/api/core/src/main/java/io/apiman/manager/api/core/plugin/AbstractPluginRegistry.java
AbstractPluginRegistry.downloadFromMavenRepo
protected boolean downloadFromMavenRepo(File pluginFile, PluginCoordinates coordinates, URI mavenRepoUrl) { """ Tries to download the plugin from the given remote maven repository. """ String artifactSubPath = PluginUtils.getMavenPath(coordinates); InputStream istream = null; OutputStre...
java
protected boolean downloadFromMavenRepo(File pluginFile, PluginCoordinates coordinates, URI mavenRepoUrl) { String artifactSubPath = PluginUtils.getMavenPath(coordinates); InputStream istream = null; OutputStream ostream = null; try { URL artifactUrl = new URL(mavenRepoUrl.to...
[ "protected", "boolean", "downloadFromMavenRepo", "(", "File", "pluginFile", ",", "PluginCoordinates", "coordinates", ",", "URI", "mavenRepoUrl", ")", "{", "String", "artifactSubPath", "=", "PluginUtils", ".", "getMavenPath", "(", "coordinates", ")", ";", "InputStream"...
Tries to download the plugin from the given remote maven repository.
[ "Tries", "to", "download", "the", "plugin", "from", "the", "given", "remote", "maven", "repository", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/core/src/main/java/io/apiman/manager/api/core/plugin/AbstractPluginRegistry.java#L177-L203
atomix/copycat
server/src/main/java/io/atomix/copycat/server/storage/compaction/MajorCompactionTask.java
MajorCompactionTask.mergeReleased
private void mergeReleased(List<Segment> segments, List<OffsetPredicate> predicates, Segment compactSegment) { """ Updates the new compact segment with entries that were released during compaction. """ for (int i = 0; i < segments.size(); i++) { mergeReleasedEntries(segments.get(i), predicates.get(i)...
java
private void mergeReleased(List<Segment> segments, List<OffsetPredicate> predicates, Segment compactSegment) { for (int i = 0; i < segments.size(); i++) { mergeReleasedEntries(segments.get(i), predicates.get(i), compactSegment); } }
[ "private", "void", "mergeReleased", "(", "List", "<", "Segment", ">", "segments", ",", "List", "<", "OffsetPredicate", ">", "predicates", ",", "Segment", "compactSegment", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "segments", ".", "size"...
Updates the new compact segment with entries that were released during compaction.
[ "Updates", "the", "new", "compact", "segment", "with", "entries", "that", "were", "released", "during", "compaction", "." ]
train
https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/storage/compaction/MajorCompactionTask.java#L297-L301
pac4j/pac4j
pac4j-config/src/main/java/org/pac4j/config/ldaptive/LdaptiveAuthenticatorBuilder.java
LdaptiveAuthenticatorBuilder.newSearchExecutor
public static SearchExecutor newSearchExecutor(final String baseDn, final String filterQuery, final String... params) { """ New search executor search executor. @param baseDn the base dn @param filterQuery the filter query @param params the params @return the search executor """ final S...
java
public static SearchExecutor newSearchExecutor(final String baseDn, final String filterQuery, final String... params) { final SearchExecutor executor = new SearchExecutor(); executor.setBaseDn(baseDn); executor.setSearchFilter(newSearchFilter(filterQuery, params)); executor.setReturnAttr...
[ "public", "static", "SearchExecutor", "newSearchExecutor", "(", "final", "String", "baseDn", ",", "final", "String", "filterQuery", ",", "final", "String", "...", "params", ")", "{", "final", "SearchExecutor", "executor", "=", "new", "SearchExecutor", "(", ")", ...
New search executor search executor. @param baseDn the base dn @param filterQuery the filter query @param params the params @return the search executor
[ "New", "search", "executor", "search", "executor", "." ]
train
https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-config/src/main/java/org/pac4j/config/ldaptive/LdaptiveAuthenticatorBuilder.java#L389-L396
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslAttributes.java
RslAttributes.setMulti
public void setMulti(String attribute, String [] values) { """ Sets the attribute value to the given list of values. The list of values is added as a single value. @param attribute the attribute to set the value of. @param values the list of values to add. """ NameOpValue nv = getRelation(attribute); nv...
java
public void setMulti(String attribute, String [] values) { NameOpValue nv = getRelation(attribute); nv.clear(); List list = new LinkedList(); for (int i=0;i<values.length;i++) { list.add(new Value(values[i])); } nv.add(list); }
[ "public", "void", "setMulti", "(", "String", "attribute", ",", "String", "[", "]", "values", ")", "{", "NameOpValue", "nv", "=", "getRelation", "(", "attribute", ")", ";", "nv", ".", "clear", "(", ")", ";", "List", "list", "=", "new", "LinkedList", "("...
Sets the attribute value to the given list of values. The list of values is added as a single value. @param attribute the attribute to set the value of. @param values the list of values to add.
[ "Sets", "the", "attribute", "value", "to", "the", "given", "list", "of", "values", ".", "The", "list", "of", "values", "is", "added", "as", "a", "single", "value", "." ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L318-L326
jmeter-maven-plugin/jmeter-maven-plugin
src/main/java/com/lazerycode/jmeter/properties/PropertiesFile.java
PropertiesFile.loadProvidedPropertiesIfAvailable
public void loadProvidedPropertiesIfAvailable(File providedPropertiesFile, boolean replaceAllProperties) throws MojoExecutionException { """ Check if a file exists. If it does calculate if we need to merge it with existing properties, or replace all existing properties. @param providedPropertiesFile A properti...
java
public void loadProvidedPropertiesIfAvailable(File providedPropertiesFile, boolean replaceAllProperties) throws MojoExecutionException { if (providedPropertiesFile.exists()) { Properties providedPropertySet = loadPropertiesFile(providedPropertiesFile); if (replaceAllProperties) { ...
[ "public", "void", "loadProvidedPropertiesIfAvailable", "(", "File", "providedPropertiesFile", ",", "boolean", "replaceAllProperties", ")", "throws", "MojoExecutionException", "{", "if", "(", "providedPropertiesFile", ".", "exists", "(", ")", ")", "{", "Properties", "pro...
Check if a file exists. If it does calculate if we need to merge it with existing properties, or replace all existing properties. @param providedPropertiesFile A properties file that will be check to see if it exists @param replaceAllProperties If we should replace all properties, or just merge them @throws MojoExe...
[ "Check", "if", "a", "file", "exists", ".", "If", "it", "does", "calculate", "if", "we", "need", "to", "merge", "it", "with", "existing", "properties", "or", "replace", "all", "existing", "properties", "." ]
train
https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/blob/63dc8b49cc6b9542deb681e25a2ada6025ddbf6b/src/main/java/com/lazerycode/jmeter/properties/PropertiesFile.java#L82-L91
seancfoley/IPAddress
IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java
HostName.asInetSocketAddress
public InetSocketAddress asInetSocketAddress(Function<String, Integer> serviceMapper) { """ Returns the InetSocketAddress for this host. A host must have an associated port, or a service name string that is mapped to a port using the provided service mapper, to have a corresponding InetSocketAddress. <p> If t...
java
public InetSocketAddress asInetSocketAddress(Function<String, Integer> serviceMapper) { if(isValid()) { Integer port = getPort(); if(port == null && serviceMapper != null) { String service = getService(); if(service != null) { port = serviceMapper.apply(service); } } if(port != null) { ...
[ "public", "InetSocketAddress", "asInetSocketAddress", "(", "Function", "<", "String", ",", "Integer", ">", "serviceMapper", ")", "{", "if", "(", "isValid", "(", ")", ")", "{", "Integer", "port", "=", "getPort", "(", ")", ";", "if", "(", "port", "==", "nu...
Returns the InetSocketAddress for this host. A host must have an associated port, or a service name string that is mapped to a port using the provided service mapper, to have a corresponding InetSocketAddress. <p> If there is on associated port, then this returns null. <p> Note that host name strings are not resolved ...
[ "Returns", "the", "InetSocketAddress", "for", "this", "host", ".", "A", "host", "must", "have", "an", "associated", "port", "or", "a", "service", "name", "string", "that", "is", "mapped", "to", "a", "port", "using", "the", "provided", "service", "mapper", ...
train
https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java#L822-L841
iobeam/iobeam-client-java
src/main/java/com/iobeam/api/client/Iobeam.java
Iobeam.registerDeviceAsync
public void registerDeviceAsync(Device device, RegisterCallback callback) { """ Registers a device asynchronously with parameters of the provided {@link Device}. This will not block the calling thread. If successful, the device ID of this client will be set (either to the id provided, or if not provided, a rando...
java
public void registerDeviceAsync(Device device, RegisterCallback callback) { RestCallback<Device> cb; if (callback == null) { cb = RegisterCallback.getEmptyCallback().getInnerCallback(this); } else { cb = callback.getInnerCallback(this); } // If device ID ...
[ "public", "void", "registerDeviceAsync", "(", "Device", "device", ",", "RegisterCallback", "callback", ")", "{", "RestCallback", "<", "Device", ">", "cb", ";", "if", "(", "callback", "==", "null", ")", "{", "cb", "=", "RegisterCallback", ".", "getEmptyCallback...
Registers a device asynchronously with parameters of the provided {@link Device}. This will not block the calling thread. If successful, the device ID of this client will be set (either to the id provided, or if not provided, a randomly generated one). Any provided callback will be run on a background thread. If the cl...
[ "Registers", "a", "device", "asynchronously", "with", "parameters", "of", "the", "provided", "{", "@link", "Device", "}", ".", "This", "will", "not", "block", "the", "calling", "thread", ".", "If", "successful", "the", "device", "ID", "of", "this", "client",...
train
https://github.com/iobeam/iobeam-client-java/blob/06e7aeb2a313503392358a3671de7d28628d0e33/src/main/java/com/iobeam/api/client/Iobeam.java#L636-L667
Azure/azure-sdk-for-java
appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java
AppServicePlansInner.listMetricDefintionsAsync
public Observable<Page<ResourceMetricDefinitionInner>> listMetricDefintionsAsync(final String resourceGroupName, final String name) { """ Get metrics that can be queried for an App Service plan, and their definitions. Get metrics that can be queried for an App Service plan, and their definitions. @param resour...
java
public Observable<Page<ResourceMetricDefinitionInner>> listMetricDefintionsAsync(final String resourceGroupName, final String name) { return listMetricDefintionsWithServiceResponseAsync(resourceGroupName, name) .map(new Func1<ServiceResponse<Page<ResourceMetricDefinitionInner>>, Page<ResourceMetricD...
[ "public", "Observable", "<", "Page", "<", "ResourceMetricDefinitionInner", ">", ">", "listMetricDefintionsAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "name", ")", "{", "return", "listMetricDefintionsWithServiceResponseAsync", "(", "resourc...
Get metrics that can be queried for an App Service plan, and their definitions. Get metrics that can be queried for an App Service plan, and their definitions. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service plan. @throws IllegalArgumentException t...
[ "Get", "metrics", "that", "can", "be", "queried", "for", "an", "App", "Service", "plan", "and", "their", "definitions", ".", "Get", "metrics", "that", "can", "be", "queried", "for", "an", "App", "Service", "plan", "and", "their", "definitions", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L1848-L1856
3redronin/mu-server
src/main/java/io/muserver/rest/SafeHtml.java
SafeHtml.htmlEscape
public static String htmlEscape(String str, boolean avoidDoubleEscape) { """ Escapes a string for use in an HTML entity or HTML attribute. <p> The returned value is always suitable for an HTML <i>entity</i> but only suitable for an HTML <i>attribute</i> if the attribute value is inside double quotes. So for ...
java
public static String htmlEscape(String str, boolean avoidDoubleEscape) { if (str == null || str.length() == 0) { return str; } // Implementation: Most likely this can be further optimized // by finding a way to lazily instantiate the StringBuilder, because // m...
[ "public", "static", "String", "htmlEscape", "(", "String", "str", ",", "boolean", "avoidDoubleEscape", ")", "{", "if", "(", "str", "==", "null", "||", "str", ".", "length", "(", ")", "==", "0", ")", "{", "return", "str", ";", "}", "// Implementation: Mo...
Escapes a string for use in an HTML entity or HTML attribute. <p> The returned value is always suitable for an HTML <i>entity</i> but only suitable for an HTML <i>attribute</i> if the attribute value is inside double quotes. So for attribute values be sure to do like this: <pre> &lt;div title="value-from-this-method" ...
[ "Escapes", "a", "string", "for", "use", "in", "an", "HTML", "entity", "or", "HTML", "attribute", "." ]
train
https://github.com/3redronin/mu-server/blob/51598606a3082a121fbd785348ee9770b40308e6/src/main/java/io/muserver/rest/SafeHtml.java#L56-L97
greenmail-mail-test/greenmail
greenmail-core/src/main/java/com/icegreen/greenmail/server/AbstractServer.java
AbstractServer.createSession
public Session createSession(Properties properties, boolean debug) { """ Creates a session configured for given server (IMAP, SMTP, ...). @param properties optional session properties, can be null. @param debug if true enables JavaMail debug settings @return the session. """ Properties props ...
java
public Session createSession(Properties properties, boolean debug) { Properties props = setup.configureJavaMailSessionProperties(properties, debug); if (log.isDebugEnabled()) { StringBuilder buf = new StringBuilder("Server Mail session properties are :"); for (Map.Entry<Object, ...
[ "public", "Session", "createSession", "(", "Properties", "properties", ",", "boolean", "debug", ")", "{", "Properties", "props", "=", "setup", ".", "configureJavaMailSessionProperties", "(", "properties", ",", "debug", ")", ";", "if", "(", "log", ".", "isDebugEn...
Creates a session configured for given server (IMAP, SMTP, ...). @param properties optional session properties, can be null. @param debug if true enables JavaMail debug settings @return the session.
[ "Creates", "a", "session", "configured", "for", "given", "server", "(", "IMAP", "SMTP", "...", ")", "." ]
train
https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/server/AbstractServer.java#L302-L316
VoltDB/voltdb
third_party/java/src/com/google_voltpatches/common/collect/Iterables.java
Iterables.removeFirstMatching
@Nullable static <T> T removeFirstMatching(Iterable<T> removeFrom, Predicate<? super T> predicate) { """ Removes and returns the first matching element, or returns {@code null} if there is none. """ checkNotNull(predicate); Iterator<T> iterator = removeFrom.iterator(); while (iterator.hasNext()) ...
java
@Nullable static <T> T removeFirstMatching(Iterable<T> removeFrom, Predicate<? super T> predicate) { checkNotNull(predicate); Iterator<T> iterator = removeFrom.iterator(); while (iterator.hasNext()) { T next = iterator.next(); if (predicate.apply(next)) { iterator.remove(); ret...
[ "@", "Nullable", "static", "<", "T", ">", "T", "removeFirstMatching", "(", "Iterable", "<", "T", ">", "removeFrom", ",", "Predicate", "<", "?", "super", "T", ">", "predicate", ")", "{", "checkNotNull", "(", "predicate", ")", ";", "Iterator", "<", "T", ...
Removes and returns the first matching element, or returns {@code null} if there is none.
[ "Removes", "and", "returns", "the", "first", "matching", "element", "or", "returns", "{" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/Iterables.java#L242-L254
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/pipes/Submitter.java
Submitter.setIfUnset
private static void setIfUnset(JobConf conf, String key, String value) { """ Set the configuration, if it doesn't already have a value for the given key. @param conf the configuration to modify @param key the key to set @param value the new "default" value to set """ if (conf.get(key) == null) { ...
java
private static void setIfUnset(JobConf conf, String key, String value) { if (conf.get(key) == null) { conf.set(key, value); } }
[ "private", "static", "void", "setIfUnset", "(", "JobConf", "conf", ",", "String", "key", ",", "String", "value", ")", "{", "if", "(", "conf", ".", "get", "(", "key", ")", "==", "null", ")", "{", "conf", ".", "set", "(", "key", ",", "value", ")", ...
Set the configuration, if it doesn't already have a value for the given key. @param conf the configuration to modify @param key the key to set @param value the new "default" value to set
[ "Set", "the", "configuration", "if", "it", "doesn", "t", "already", "have", "a", "value", "for", "the", "given", "key", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/pipes/Submitter.java#L177-L181
indeedeng/util
io/src/main/java/com/indeed/util/io/Files.java
Files.writeObjectToFile
@Deprecated public static boolean writeObjectToFile(Object obj, String file) { """ Writes an object to a file. @return true if the file was successfully written, false otherwise @deprecated use {@link #writeObjectToFileOrDie(Object, String, org.apache.log4j.Logger)} instead """ try { ...
java
@Deprecated public static boolean writeObjectToFile(Object obj, String file) { try { writeObjectToFileOrDie(obj, file, LOGGER); return true; } catch (Exception e) { LOGGER.error(e.getClass() + ": writeObjectToFile(" + file + ") encountered exception: " + e.g...
[ "@", "Deprecated", "public", "static", "boolean", "writeObjectToFile", "(", "Object", "obj", ",", "String", "file", ")", "{", "try", "{", "writeObjectToFileOrDie", "(", "obj", ",", "file", ",", "LOGGER", ")", ";", "return", "true", ";", "}", "catch", "(", ...
Writes an object to a file. @return true if the file was successfully written, false otherwise @deprecated use {@link #writeObjectToFileOrDie(Object, String, org.apache.log4j.Logger)} instead
[ "Writes", "an", "object", "to", "a", "file", "." ]
train
https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/io/src/main/java/com/indeed/util/io/Files.java#L335-L344
Wootric/WootricSDK-Android
androidsdk/src/main/java/com/wootric/androidsdk/Wootric.java
Wootric.init
@Deprecated public static Wootric init(FragmentActivity fragmentActivity, String clientId, String clientSecret, String accountToken) { """ It configures the SDK with required parameters. @param fragmentActivity FragmentActivity where the survey will be presented. @param clientId Found in API section of the...
java
@Deprecated public static Wootric init(FragmentActivity fragmentActivity, String clientId, String clientSecret, String accountToken) { Wootric local = singleton; if(local == null) { synchronized (Wootric.class) { local = singleton; if(local == null) { ...
[ "@", "Deprecated", "public", "static", "Wootric", "init", "(", "FragmentActivity", "fragmentActivity", ",", "String", "clientId", ",", "String", "clientSecret", ",", "String", "accountToken", ")", "{", "Wootric", "local", "=", "singleton", ";", "if", "(", "local...
It configures the SDK with required parameters. @param fragmentActivity FragmentActivity where the survey will be presented. @param clientId Found in API section of the Wootric's admin panel. @param clientSecret Found in API section of the Wootric's admin panel. @param accountToken Found in Install section of the Woot...
[ "It", "configures", "the", "SDK", "with", "required", "parameters", "." ]
train
https://github.com/Wootric/WootricSDK-Android/blob/ba584f2317ce99452424b9a78d024e361ad6fec4/androidsdk/src/main/java/com/wootric/androidsdk/Wootric.java#L71-L88
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WPanelRenderer.java
WPanelRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { """ Paints the given container. @param component the container to paint. @param renderContext the RenderContext to paint to. """ WPanel panel = (WPanel) component; XmlStringBuilder xml = renderContext...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WPanel panel = (WPanel) component; XmlStringBuilder xml = renderContext.getWriter(); WButton submitButton = panel.getDefaultSubmitButton(); String submitId = submitButton == null ? null : submitButton.getId();...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WPanel", "panel", "=", "(", "WPanel", ")", "component", ";", "XmlStringBuilder", "xml", "=", "renderContext", ...
Paints the given container. @param component the container to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "container", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WPanelRenderer.java#L28-L66
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/CalibrationFiducialDetector.java
CalibrationFiducialDetector.getCenter
@Override public void getCenter(int which, Point2D_F64 location) { """ Returns the detection point average location. This will NOT be the same as the geometric center. @param which Fiducial's index @param location (output) Storage for the transform. modified. """ CalibrationObservation view = detector....
java
@Override public void getCenter(int which, Point2D_F64 location) { CalibrationObservation view = detector.getDetectedPoints(); location.set(0,0); for (int i = 0; i < view.size(); i++) { PointIndex2D_F64 p = view.get(i); location.x += p.x; location.y += p.y; } location.x /= view.size(); location....
[ "@", "Override", "public", "void", "getCenter", "(", "int", "which", ",", "Point2D_F64", "location", ")", "{", "CalibrationObservation", "view", "=", "detector", ".", "getDetectedPoints", "(", ")", ";", "location", ".", "set", "(", "0", ",", "0", ")", ";",...
Returns the detection point average location. This will NOT be the same as the geometric center. @param which Fiducial's index @param location (output) Storage for the transform. modified.
[ "Returns", "the", "detection", "point", "average", "location", ".", "This", "will", "NOT", "be", "the", "same", "as", "the", "geometric", "center", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/CalibrationFiducialDetector.java#L280-L293
haifengl/smile
plot/src/main/java/smile/swing/table/MultiColumnSortTableHeaderCellRenderer.java
MultiColumnSortTableHeaderCellRenderer.getIcon
@Override public Icon getIcon(JTable table, int column) { """ Overridden to return an icon suitable to a sorted column, or null if the column is unsorted. The icon for the primary sorted column is fully opaque, and the opacity is reduced by a factor of <code>alpha</code> for each subsequent sort index. @...
java
@Override public Icon getIcon(JTable table, int column) { float computedAlpha = 1.0F; for (RowSorter.SortKey sortKey : table.getRowSorter().getSortKeys()) { if (table.convertColumnIndexToView(sortKey.getColumn()) == column) { switch (sortKey.getSortOrder()) { ...
[ "@", "Override", "public", "Icon", "getIcon", "(", "JTable", "table", ",", "int", "column", ")", "{", "float", "computedAlpha", "=", "1.0F", ";", "for", "(", "RowSorter", ".", "SortKey", "sortKey", ":", "table", ".", "getRowSorter", "(", ")", ".", "getSo...
Overridden to return an icon suitable to a sorted column, or null if the column is unsorted. The icon for the primary sorted column is fully opaque, and the opacity is reduced by a factor of <code>alpha</code> for each subsequent sort index. @param table the <code>JTable</code>. @param column the column index. @return...
[ "Overridden", "to", "return", "an", "icon", "suitable", "to", "a", "sorted", "column", "or", "null", "if", "the", "column", "is", "unsorted", ".", "The", "icon", "for", "the", "primary", "sorted", "column", "is", "fully", "opaque", "and", "the", "opacity",...
train
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/swing/table/MultiColumnSortTableHeaderCellRenderer.java#L71-L89
code4everything/util
src/main/java/com/zhazhapan/util/DateUtils.java
DateUtils.addHour
public static Date addHour(String date, int amount) throws ParseException { """ 添加小时 @param date 日期 @param amount 数量 @return 添加后的日期 @throws ParseException 异常 """ return add(date, Calendar.HOUR, amount); }
java
public static Date addHour(String date, int amount) throws ParseException { return add(date, Calendar.HOUR, amount); }
[ "public", "static", "Date", "addHour", "(", "String", "date", ",", "int", "amount", ")", "throws", "ParseException", "{", "return", "add", "(", "date", ",", "Calendar", ".", "HOUR", ",", "amount", ")", ";", "}" ]
添加小时 @param date 日期 @param amount 数量 @return 添加后的日期 @throws ParseException 异常
[ "添加小时" ]
train
https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/DateUtils.java#L355-L357
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/ClassUtil.java
ClassUtil.applyMethod
public static Object applyMethod(Object pObject, String pMethod, Object ... pArgs) { """ Apply a method to a given object with optional arguments. The method is looked up the whole class hierarchy. @param pObject object on which to apply the method @param pMethod the method name @param pArgs optional argumen...
java
public static Object applyMethod(Object pObject, String pMethod, Object ... pArgs) { Class<?> clazz = pObject.getClass(); try { Method method = extractMethod(pMethod, clazz, pArgs); return method.invoke(pObject,pArgs); } catch (NoSuchMethodException e) { throw...
[ "public", "static", "Object", "applyMethod", "(", "Object", "pObject", ",", "String", "pMethod", ",", "Object", "...", "pArgs", ")", "{", "Class", "<", "?", ">", "clazz", "=", "pObject", ".", "getClass", "(", ")", ";", "try", "{", "Method", "method", "...
Apply a method to a given object with optional arguments. The method is looked up the whole class hierarchy. @param pObject object on which to apply the method @param pMethod the method name @param pArgs optional arguments @return return value (if any)
[ "Apply", "a", "method", "to", "a", "given", "object", "with", "optional", "arguments", ".", "The", "method", "is", "looked", "up", "the", "whole", "class", "hierarchy", "." ]
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/ClassUtil.java#L181-L193
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Asserter.java
Asserter.assertCurrentActivity
public void assertCurrentActivity(String message, Class<? extends Activity> expectedClass) { """ Asserts that an expected {@link Activity} is currently active one. @param message the message that should be displayed if the assert fails @param expectedClass the {@code Class} object that is expected to be active...
java
public void assertCurrentActivity(String message, Class<? extends Activity> expectedClass) { if(expectedClass == null){ Assert.fail("The specified Activity is null!"); } boolean foundActivity = waiter.waitForActivity(expectedClass); if(!foundActivity) { Activity activity = activityUtils.getCurrentActi...
[ "public", "void", "assertCurrentActivity", "(", "String", "message", ",", "Class", "<", "?", "extends", "Activity", ">", "expectedClass", ")", "{", "if", "(", "expectedClass", "==", "null", ")", "{", "Assert", ".", "fail", "(", "\"The specified Activity is null!...
Asserts that an expected {@link Activity} is currently active one. @param message the message that should be displayed if the assert fails @param expectedClass the {@code Class} object that is expected to be active e.g. {@code MyActivity.class}
[ "Asserts", "that", "an", "expected", "{", "@link", "Activity", "}", "is", "currently", "active", "one", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Asserter.java#L58-L74
xetorthio/jedis
src/main/java/redis/clients/jedis/BinaryJedis.java
BinaryJedis.hdel
@Override public Long hdel(final byte[] key, final byte[]... fields) { """ Remove the specified field from an hash stored at key. <p> <b>Time complexity:</b> O(1) @param key @param fields @return If the field was present in the hash it is deleted and 1 is returned, otherwise 0 is returned and no operation ...
java
@Override public Long hdel(final byte[] key, final byte[]... fields) { checkIsInMultiOrPipeline(); client.hdel(key, fields); return client.getIntegerReply(); }
[ "@", "Override", "public", "Long", "hdel", "(", "final", "byte", "[", "]", "key", ",", "final", "byte", "[", "]", "...", "fields", ")", "{", "checkIsInMultiOrPipeline", "(", ")", ";", "client", ".", "hdel", "(", "key", ",", "fields", ")", ";", "retur...
Remove the specified field from an hash stored at key. <p> <b>Time complexity:</b> O(1) @param key @param fields @return If the field was present in the hash it is deleted and 1 is returned, otherwise 0 is returned and no operation is performed.
[ "Remove", "the", "specified", "field", "from", "an", "hash", "stored", "at", "key", ".", "<p", ">", "<b", ">", "Time", "complexity", ":", "<", "/", "b", ">", "O", "(", "1", ")" ]
train
https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L1044-L1049
GCRC/nunaliit
nunaliit2-couch-utils/src/main/java/ca/carleton/gcrc/couch/utils/SubmissionUtils.java
SubmissionUtils.getApprovedDocumentFromSubmission
static public JSONObject getApprovedDocumentFromSubmission(JSONObject submissionDoc) throws Exception { """ Re-creates the approved document submitted by the client from the submission document. @param submissionDoc Submission document from the submission database @return Document submitted by user for update ...
java
static public JSONObject getApprovedDocumentFromSubmission(JSONObject submissionDoc) throws Exception { JSONObject submissionInfo = submissionDoc.getJSONObject("nunaliit_submission"); // Check if an approved version of the document is available JSONObject doc = submissionInfo.optJSONObject("approved_doc"); if(...
[ "static", "public", "JSONObject", "getApprovedDocumentFromSubmission", "(", "JSONObject", "submissionDoc", ")", "throws", "Exception", "{", "JSONObject", "submissionInfo", "=", "submissionDoc", ".", "getJSONObject", "(", "\"nunaliit_submission\"", ")", ";", "// Check if an ...
Re-creates the approved document submitted by the client from the submission document. @param submissionDoc Submission document from the submission database @return Document submitted by user for update
[ "Re", "-", "creates", "the", "approved", "document", "submitted", "by", "the", "client", "from", "the", "submission", "document", "." ]
train
https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-couch-utils/src/main/java/ca/carleton/gcrc/couch/utils/SubmissionUtils.java#L75-L89
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
HtmlDocletWriter.addInlineDeprecatedComment
public void addInlineDeprecatedComment(Doc doc, Tag tag, Content htmltree) { """ Add the inline deprecated comment. @param doc the doc for which the inline deprecated comment will be added @param tag the inline tag to be added @param htmltree the content tree to which the comment will be added """ ...
java
public void addInlineDeprecatedComment(Doc doc, Tag tag, Content htmltree) { addCommentTags(doc, tag.inlineTags(), true, false, htmltree); }
[ "public", "void", "addInlineDeprecatedComment", "(", "Doc", "doc", ",", "Tag", "tag", ",", "Content", "htmltree", ")", "{", "addCommentTags", "(", "doc", ",", "tag", ".", "inlineTags", "(", ")", ",", "true", ",", "false", ",", "htmltree", ")", ";", "}" ]
Add the inline deprecated comment. @param doc the doc for which the inline deprecated comment will be added @param tag the inline tag to be added @param htmltree the content tree to which the comment will be added
[ "Add", "the", "inline", "deprecated", "comment", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L1430-L1432
JodaOrg/joda-time
src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java
DateTimeFormatterBuilder.appendTimeZoneShortName
public DateTimeFormatterBuilder appendTimeZoneShortName(Map<String, DateTimeZone> parseLookup) { """ Instructs the printer to emit a short locale-specific time zone name, providing a lookup for parsing. Time zone names are not unique, thus the API forces you to supply the lookup. The names are searched in the o...
java
public DateTimeFormatterBuilder appendTimeZoneShortName(Map<String, DateTimeZone> parseLookup) { TimeZoneName pp = new TimeZoneName(TimeZoneName.SHORT_NAME, parseLookup); return append0(pp, pp); }
[ "public", "DateTimeFormatterBuilder", "appendTimeZoneShortName", "(", "Map", "<", "String", ",", "DateTimeZone", ">", "parseLookup", ")", "{", "TimeZoneName", "pp", "=", "new", "TimeZoneName", "(", "TimeZoneName", ".", "SHORT_NAME", ",", "parseLookup", ")", ";", "...
Instructs the printer to emit a short locale-specific time zone name, providing a lookup for parsing. Time zone names are not unique, thus the API forces you to supply the lookup. The names are searched in the order of the map, thus it is strongly recommended to use a {@code LinkedHashMap} or similar. @param parseLook...
[ "Instructs", "the", "printer", "to", "emit", "a", "short", "locale", "-", "specific", "time", "zone", "name", "providing", "a", "lookup", "for", "parsing", ".", "Time", "zone", "names", "are", "not", "unique", "thus", "the", "API", "forces", "you", "to", ...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L1057-L1060
ops4j/org.ops4j.base
ops4j-base-lang/src/main/java/org/ops4j/lang/PostConditionException.java
PostConditionException.validateLesserThan
public static void validateLesserThan( long value, long limit, String identifier ) throws PostConditionException { """ Validates that the value is lesser than a limit. This method ensures that <code>value < limit</code>. @param identifier The name of the object. @param limit The limit that the ...
java
public static void validateLesserThan( long value, long limit, String identifier ) throws PostConditionException { if( value < limit ) { return; } throw new PostConditionException( identifier + " was not lesser than " + limit + ". Was: " + value ); }
[ "public", "static", "void", "validateLesserThan", "(", "long", "value", ",", "long", "limit", ",", "String", "identifier", ")", "throws", "PostConditionException", "{", "if", "(", "value", "<", "limit", ")", "{", "return", ";", "}", "throw", "new", "PostCond...
Validates that the value is lesser than a limit. This method ensures that <code>value < limit</code>. @param identifier The name of the object. @param limit The limit that the value must be smaller than. @param value The value to be tested. @throws PostConditionException if the condition is not met.
[ "Validates", "that", "the", "value", "is", "lesser", "than", "a", "limit", "." ]
train
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/PostConditionException.java#L149-L157
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.deposit_depositId_GET
public OvhDeposit deposit_depositId_GET(String depositId) throws IOException { """ Get this object properties REST: GET /me/deposit/{depositId} @param depositId [required] """ String qPath = "/me/deposit/{depositId}"; StringBuilder sb = path(qPath, depositId); String resp = exec(qPath, "GET", sb.toSt...
java
public OvhDeposit deposit_depositId_GET(String depositId) throws IOException { String qPath = "/me/deposit/{depositId}"; StringBuilder sb = path(qPath, depositId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhDeposit.class); }
[ "public", "OvhDeposit", "deposit_depositId_GET", "(", "String", "depositId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/me/deposit/{depositId}\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",", "depositId", ")", ";", "String", "res...
Get this object properties REST: GET /me/deposit/{depositId} @param depositId [required]
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3291-L3296
googleapis/google-cloud-java
google-cloud-clients/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/IntentsClient.java
IntentsClient.updateIntent
public final Intent updateIntent(Intent intent, String languageCode, FieldMask updateMask) { """ Updates the specified intent. <p>Sample code: <pre><code> try (IntentsClient intentsClient = IntentsClient.create()) { Intent intent = Intent.newBuilder().build(); String languageCode = ""; FieldMask updateMa...
java
public final Intent updateIntent(Intent intent, String languageCode, FieldMask updateMask) { UpdateIntentRequest request = UpdateIntentRequest.newBuilder() .setIntent(intent) .setLanguageCode(languageCode) .setUpdateMask(updateMask) .build(); return updat...
[ "public", "final", "Intent", "updateIntent", "(", "Intent", "intent", ",", "String", "languageCode", ",", "FieldMask", "updateMask", ")", "{", "UpdateIntentRequest", "request", "=", "UpdateIntentRequest", ".", "newBuilder", "(", ")", ".", "setIntent", "(", "intent...
Updates the specified intent. <p>Sample code: <pre><code> try (IntentsClient intentsClient = IntentsClient.create()) { Intent intent = Intent.newBuilder().build(); String languageCode = ""; FieldMask updateMask = FieldMask.newBuilder().build(); Intent response = intentsClient.updateIntent(intent, languageCode, update...
[ "Updates", "the", "specified", "intent", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/IntentsClient.java#L773-L782
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/DrizzleDataSource.java
DrizzleDataSource.getConnection
public Connection getConnection(final String username, final String password) throws SQLException { """ <p>Attempts to establish a connection with the data source that this <code>DataSource</code> object represents. @param username the database user on whose behalf the connection is being made @param password ...
java
public Connection getConnection(final String username, final String password) throws SQLException { try { return new DrizzleConnection(new MySQLProtocol(hostname, port, database, username, password, new Properties()), new DrizzleQueryFactory()); } catch (QueryException e)...
[ "public", "Connection", "getConnection", "(", "final", "String", "username", ",", "final", "String", "password", ")", "throws", "SQLException", "{", "try", "{", "return", "new", "DrizzleConnection", "(", "new", "MySQLProtocol", "(", "hostname", ",", "port", ",",...
<p>Attempts to establish a connection with the data source that this <code>DataSource</code> object represents. @param username the database user on whose behalf the connection is being made @param password the user's password @return a connection to the data source @throws java.sql.SQLException if a database access e...
[ "<p", ">", "Attempts", "to", "establish", "a", "connection", "with", "the", "data", "source", "that", "this", "<code", ">", "DataSource<", "/", "code", ">", "object", "represents", "." ]
train
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleDataSource.java#L78-L85
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java
CommonOps_DDRM.multInner
public static void multInner(DMatrix1Row a , DMatrix1Row c ) { """ <p>Computes the matrix multiplication inner product:<br> <br> c = a<sup>T</sup> * a <br> <br> c<sub>ij</sub> = &sum;<sub>k=1:n</sub> { a<sub>ki</sub> * a<sub>kj</sub>} </p> <p> Is faster than using a generic matrix multiplication by taking...
java
public static void multInner(DMatrix1Row a , DMatrix1Row c ) { c.reshape(a.numCols,a.numCols); if( a.numCols >= EjmlParameters.MULT_INNER_SWITCH ) { MatrixMultProduct_DDRM.inner_small(a, c); } else { MatrixMultProduct_DDRM.inner_reorder(a, c); } }
[ "public", "static", "void", "multInner", "(", "DMatrix1Row", "a", ",", "DMatrix1Row", "c", ")", "{", "c", ".", "reshape", "(", "a", ".", "numCols", ",", "a", ".", "numCols", ")", ";", "if", "(", "a", ".", "numCols", ">=", "EjmlParameters", ".", "MULT...
<p>Computes the matrix multiplication inner product:<br> <br> c = a<sup>T</sup> * a <br> <br> c<sub>ij</sub> = &sum;<sub>k=1:n</sub> { a<sub>ki</sub> * a<sub>kj</sub>} </p> <p> Is faster than using a generic matrix multiplication by taking advantage of symmetry. For vectors there is an even faster option, see {@link ...
[ "<p", ">", "Computes", "the", "matrix", "multiplication", "inner", "product", ":", "<br", ">", "<br", ">", "c", "=", "a<sup", ">", "T<", "/", "sup", ">", "*", "a", "<br", ">", "<br", ">", "c<sub", ">", "ij<", "/", "sub", ">", "=", "&sum", ";", ...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L288-L297
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.addEntityWithServiceResponseAsync
public Observable<ServiceResponse<UUID>> addEntityWithServiceResponseAsync(UUID appId, String versionId, AddEntityOptionalParameter addEntityOptionalParameter) { """ Adds an entity extractor to the application. @param appId The application ID. @param versionId The version ID. @param addEntityOptionalParameter...
java
public Observable<ServiceResponse<UUID>> addEntityWithServiceResponseAsync(UUID appId, String versionId, AddEntityOptionalParameter addEntityOptionalParameter) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null....
[ "public", "Observable", "<", "ServiceResponse", "<", "UUID", ">", ">", "addEntityWithServiceResponseAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "AddEntityOptionalParameter", "addEntityOptionalParameter", ")", "{", "if", "(", "this", ".", "client", ...
Adds an entity extractor to the application. @param appId The application ID. @param versionId The version ID. @param addEntityOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observ...
[ "Adds", "an", "entity", "extractor", "to", "the", "application", "." ]
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#L977-L990
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/cdn/CdnClient.java
CdnClient.createDomain
public CreateDomainResponse createDomain(CreateDomainRequest request) { """ Create a new domain acceleration. @param request The request containing user-defined domain information. @return Result of the createDomain operation returned by the service. """ checkNotNull(request, "The parameter request...
java
public CreateDomainResponse createDomain(CreateDomainRequest request) { checkNotNull(request, "The parameter request should NOT be null."); InternalRequest internalRequest = createRequest(request, HttpMethodName.PUT, DOMAIN, request.getDomain()); this.attachRequestToBody(request, internalRequest...
[ "public", "CreateDomainResponse", "createDomain", "(", "CreateDomainRequest", "request", ")", "{", "checkNotNull", "(", "request", ",", "\"The parameter request should NOT be null.\"", ")", ";", "InternalRequest", "internalRequest", "=", "createRequest", "(", "request", ","...
Create a new domain acceleration. @param request The request containing user-defined domain information. @return Result of the createDomain operation returned by the service.
[ "Create", "a", "new", "domain", "acceleration", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cdn/CdnClient.java#L182-L187
igniterealtime/Smack
smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java
OmemoMessageBuilder.addRecipient
public void addRecipient(OmemoDevice contactsDevice) throws NoIdentityKeyException, CorruptedOmemoKeyException, UndecidedOmemoIdentityException, UntrustedOmemoIdentityException { """ Add a new recipient device to the message. @param contactsDevice device of the recipient @throws NoIdent...
java
public void addRecipient(OmemoDevice contactsDevice) throws NoIdentityKeyException, CorruptedOmemoKeyException, UndecidedOmemoIdentityException, UntrustedOmemoIdentityException { OmemoFingerprint fingerprint; fingerprint = OmemoService.getInstance().getOmemoStoreBackend().getFin...
[ "public", "void", "addRecipient", "(", "OmemoDevice", "contactsDevice", ")", "throws", "NoIdentityKeyException", ",", "CorruptedOmemoKeyException", ",", "UndecidedOmemoIdentityException", ",", "UntrustedOmemoIdentityException", "{", "OmemoFingerprint", "fingerprint", ";", "fing...
Add a new recipient device to the message. @param contactsDevice device of the recipient @throws NoIdentityKeyException if we have no identityKey of that device. Can be fixed by fetching and processing the devices bundle. @throws CorruptedOmemoKeyException if the identityKey of that device is corrupted. @throws Undeci...
[ "Add", "a", "new", "recipient", "device", "to", "the", "message", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java#L222-L243
assertthat/selenium-shutterbug
src/main/java/com/assertthat/selenium_shutterbug/core/Snapshot.java
Snapshot.withCroppedThumbnail
public T withCroppedThumbnail(double scale, int maxWidth, int maxHeight) { """ Generate cropped thumbnail of the original screenshot. Will save different thumbnails depends on when it was called in the chain. @param scale to apply @param maxWidth max width in pixels. If set to -1 the actual image width is use...
java
public T withCroppedThumbnail(double scale, int maxWidth, int maxHeight) { return withCroppedThumbnail(Paths.get(location.toString(), "./thumbnails").toString(), "thumb_" + fileName, scale, maxWidth,maxHeight); }
[ "public", "T", "withCroppedThumbnail", "(", "double", "scale", ",", "int", "maxWidth", ",", "int", "maxHeight", ")", "{", "return", "withCroppedThumbnail", "(", "Paths", ".", "get", "(", "location", ".", "toString", "(", ")", ",", "\"./thumbnails\"", ")", "....
Generate cropped thumbnail of the original screenshot. Will save different thumbnails depends on when it was called in the chain. @param scale to apply @param maxWidth max width in pixels. If set to -1 the actual image width is used @param maxHeight max height in pixels. If set to -1 the actual image height is used @r...
[ "Generate", "cropped", "thumbnail", "of", "the", "original", "screenshot", ".", "Will", "save", "different", "thumbnails", "depends", "on", "when", "it", "was", "called", "in", "the", "chain", "." ]
train
https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/Snapshot.java#L145-L147
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java
Validator.validateNotNull
public void validateNotNull(Object object, String name, String message) { """ Validates a given object to be not null @param object The object to check @param name The name of the field to display the error message @param message A custom error message instead of the default one """ if (object == ...
java
public void validateNotNull(Object object, String name, String message) { if (object == null) { addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.NOTNULL_KEY.name(), name))); } }
[ "public", "void", "validateNotNull", "(", "Object", "object", ",", "String", "name", ",", "String", "message", ")", "{", "if", "(", "object", "==", "null", ")", "{", "addError", "(", "name", ",", "Optional", ".", "ofNullable", "(", "message", ")", ".", ...
Validates a given object to be not null @param object The object to check @param name The name of the field to display the error message @param message A custom error message instead of the default one
[ "Validates", "a", "given", "object", "to", "be", "not", "null" ]
train
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L476-L480
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/mps/mps_doc_image.java
mps_doc_image.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ mps_doc_image_responses result = (mps_doc_image_responses) service.get_...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { mps_doc_image_responses result = (mps_doc_image_responses) service.get_payload_formatter().string_to_resource(mps_doc_image_responses.class, response); if(result.errorcode != 0) { if (result.error...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "mps_doc_image_responses", "result", "=", "(", "mps_doc_image_responses", ")", "service", ".", "get_payload_fo...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/mps_doc_image.java#L265-L282
google/flogger
api/src/main/java/com/google/common/flogger/parser/MessageBuilder.java
MessageBuilder.addParameter
public final void addParameter(int termStart, int termEnd, Parameter param) { """ Called by parser implementations to signify that the parsing of the next parameter is complete. This method will call {@link #addParameterImpl(int, int, Parameter)} with exactly the same arguments, but may also do additional work b...
java
public final void addParameter(int termStart, int termEnd, Parameter param) { // Set a bit in the parameter mask according to which parameter was referenced. // Shifting wraps, so we must do a check here. if (param.getIndex() < 32) { pmask |= (1 << param.getIndex()); } maxIndex = Math.max(maxI...
[ "public", "final", "void", "addParameter", "(", "int", "termStart", ",", "int", "termEnd", ",", "Parameter", "param", ")", "{", "// Set a bit in the parameter mask according to which parameter was referenced.", "// Shifting wraps, so we must do a check here.", "if", "(", "param...
Called by parser implementations to signify that the parsing of the next parameter is complete. This method will call {@link #addParameterImpl(int, int, Parameter)} with exactly the same arguments, but may also do additional work before or after that call. @param termStart the index of the first character in the log m...
[ "Called", "by", "parser", "implementations", "to", "signify", "that", "the", "parsing", "of", "the", "next", "parameter", "is", "complete", ".", "This", "method", "will", "call", "{", "@link", "#addParameterImpl", "(", "int", "int", "Parameter", ")", "}", "w...
train
https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/MessageBuilder.java#L75-L83
kiegroup/drools
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/util/EvalHelper.java
EvalHelper.getValue
public static Object getValue(final Object current, final String property) { """ {@link #getDefinedValue(Object, String)} method instead. @deprecated this method cannot distinguish null because: 1. property undefined for current, 2. an error, 3. a properly defined property value valorized to null. """ ...
java
public static Object getValue(final Object current, final String property) { return getDefinedValue(current, property).getValueResult().getOrElse(null); }
[ "public", "static", "Object", "getValue", "(", "final", "Object", "current", ",", "final", "String", "property", ")", "{", "return", "getDefinedValue", "(", "current", ",", "property", ")", ".", "getValueResult", "(", ")", ".", "getOrElse", "(", "null", ")",...
{@link #getDefinedValue(Object, String)} method instead. @deprecated this method cannot distinguish null because: 1. property undefined for current, 2. an error, 3. a properly defined property value valorized to null.
[ "{", "@link", "#getDefinedValue", "(", "Object", "String", ")", "}", "method", "instead", ".", "@deprecated", "this", "method", "cannot", "distinguish", "null", "because", ":", "1", ".", "property", "undefined", "for", "current", "2", ".", "an", "error", "3"...
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/util/EvalHelper.java#L398-L400
drinkjava2/jDialects
core/src/main/java/com/github/drinkjava2/jdialects/springsrc/utils/ClassUtils.java
ClassUtils.getMostSpecificMethod
public static Method getMostSpecificMethod(Method method, Class<?> targetClass) { """ Given a method, which may come from an interface, and a target class used in the current reflective invocation, find the corresponding target method if there is one. E.g. the method may be {@code IFoo.bar()} and the target cla...
java
public static Method getMostSpecificMethod(Method method, Class<?> targetClass) { if (method != null && isOverridable(method, targetClass) && targetClass != null && targetClass != method.getDeclaringClass()) { try { if (Modifier.isPublic(method.getModifiers())) { try { return targetClass.getMeth...
[ "public", "static", "Method", "getMostSpecificMethod", "(", "Method", "method", ",", "Class", "<", "?", ">", "targetClass", ")", "{", "if", "(", "method", "!=", "null", "&&", "isOverridable", "(", "method", ",", "targetClass", ")", "&&", "targetClass", "!=",...
Given a method, which may come from an interface, and a target class used in the current reflective invocation, find the corresponding target method if there is one. E.g. the method may be {@code IFoo.bar()} and the target class may be {@code DefaultFoo}. In this case, the method may be {@code DefaultFoo.bar()}. This e...
[ "Given", "a", "method", "which", "may", "come", "from", "an", "interface", "and", "a", "target", "class", "used", "in", "the", "current", "reflective", "invocation", "find", "the", "corresponding", "target", "method", "if", "there", "is", "one", ".", "E", ...
train
https://github.com/drinkjava2/jDialects/blob/1c165f09c6042a599b681c279024abcc1b848b88/core/src/main/java/com/github/drinkjava2/jdialects/springsrc/utils/ClassUtils.java#L778-L801
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.extractColumns
public static CSTable extractColumns(CSTable table, String... colNames) { """ Extract the columns and create another table. @param table the table @param colName the names of the columns to extract. @return A new Table with the Columns. """ int[] idx = {}; for (String name : colNames) { ...
java
public static CSTable extractColumns(CSTable table, String... colNames) { int[] idx = {}; for (String name : colNames) { idx = add(idx, columnIndexes(table, name)); } if (idx.length == 0) { throw new IllegalArgumentException("No such column names: " + Arrays.toS...
[ "public", "static", "CSTable", "extractColumns", "(", "CSTable", "table", ",", "String", "...", "colNames", ")", "{", "int", "[", "]", "idx", "=", "{", "}", ";", "for", "(", "String", "name", ":", "colNames", ")", "{", "idx", "=", "add", "(", "idx", ...
Extract the columns and create another table. @param table the table @param colName the names of the columns to extract. @return A new Table with the Columns.
[ "Extract", "the", "columns", "and", "create", "another", "table", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1323-L1356
SonarSource/sonarqube
server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleQueryFactory.java
RuleQueryFactory.createRuleQuery
public RuleQuery createRuleQuery(DbSession dbSession, Request request) { """ Create a {@link RuleQuery} from a {@link Request}. When a profile key is set, the language of the profile is automatically set in the query """ RuleQuery query = new RuleQuery(); query.setQueryText(request.param(WebService.Pa...
java
public RuleQuery createRuleQuery(DbSession dbSession, Request request) { RuleQuery query = new RuleQuery(); query.setQueryText(request.param(WebService.Param.TEXT_QUERY)); query.setSeverities(request.paramAsStrings(PARAM_SEVERITIES)); query.setRepositories(request.paramAsStrings(PARAM_REPOSITORIES)); ...
[ "public", "RuleQuery", "createRuleQuery", "(", "DbSession", "dbSession", ",", "Request", "request", ")", "{", "RuleQuery", "query", "=", "new", "RuleQuery", "(", ")", ";", "query", ".", "setQueryText", "(", "request", ".", "param", "(", "WebService", ".", "P...
Create a {@link RuleQuery} from a {@link Request}. When a profile key is set, the language of the profile is automatically set in the query
[ "Create", "a", "{" ]
train
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleQueryFactory.java#L83-L115
UrielCh/ovh-java-sdk
ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java
ApiOvhEmailexchange.organizationName_service_exchangeService_sharedAccount_POST
public OvhTask organizationName_service_exchangeService_sharedAccount_POST(String organizationName, String exchangeService, String displayName, String firstName, Boolean hiddenFromGAL, String initials, String lastName, OvhMailingFilterEnum[] mailingFilter, Long quota, String sharedEmailAddress) throws IOException { ...
java
public OvhTask organizationName_service_exchangeService_sharedAccount_POST(String organizationName, String exchangeService, String displayName, String firstName, Boolean hiddenFromGAL, String initials, String lastName, OvhMailingFilterEnum[] mailingFilter, Long quota, String sharedEmailAddress) throws IOException { S...
[ "public", "OvhTask", "organizationName_service_exchangeService_sharedAccount_POST", "(", "String", "organizationName", ",", "String", "exchangeService", ",", "String", "displayName", ",", "String", "firstName", ",", "Boolean", "hiddenFromGAL", ",", "String", "initials", ","...
Create new shared mailbox in exchange server REST: POST /email/exchange/{organizationName}/service/{exchangeService}/sharedAccount @param mailingFilter [required] Enable mailing filtrering @param lastName [required] Shared account last name @param hiddenFromGAL [required] Hide the shared account in Global Address List...
[ "Create", "new", "shared", "mailbox", "in", "exchange", "server" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L617-L631
Wikidata/Wikidata-Toolkit
wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/values/TimeValueConverter.java
TimeValueConverter.getTimeLiteral
private static Literal getTimeLiteral(TimeValue value, RdfWriter rdfWriter) { """ Returns the RDF literal to encode the time component of a given time value. <p> Times with limited precision are encoded using limited-precision XML Schema datatypes, such as gYear, if available. Wikidata encodes the year 1BCE a...
java
private static Literal getTimeLiteral(TimeValue value, RdfWriter rdfWriter) { long year = value.getYear(); //Year normalization if (year == 0 || (year < 0 && value.getPrecision() >= TimeValue.PREC_YEAR)) { year--; } String timestamp = String.format("%04d-%02d-%02dT%02d:%02d:%02dZ", year, value.getMon...
[ "private", "static", "Literal", "getTimeLiteral", "(", "TimeValue", "value", ",", "RdfWriter", "rdfWriter", ")", "{", "long", "year", "=", "value", ".", "getYear", "(", ")", ";", "//Year normalization", "if", "(", "year", "==", "0", "||", "(", "year", "<",...
Returns the RDF literal to encode the time component of a given time value. <p> Times with limited precision are encoded using limited-precision XML Schema datatypes, such as gYear, if available. Wikidata encodes the year 1BCE as 0000, while XML Schema, even in version 2, does not allow 0000 and interprets -0001 as 1BC...
[ "Returns", "the", "RDF", "literal", "to", "encode", "the", "time", "component", "of", "a", "given", "time", "value", ".", "<p", ">", "Times", "with", "limited", "precision", "are", "encoded", "using", "limited", "-", "precision", "XML", "Schema", "datatypes"...
train
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/values/TimeValueConverter.java#L113-L125
cpollet/jixture
core/src/main/java/net/cpollet/jixture/fixtures/generator/fixture/TemplateGenerator.java
TemplateGenerator.addFieldGenerator
public TemplateGenerator addFieldGenerator(String fieldName, FieldGenerator fieldGenerator) { """ Adds a {@link net.cpollet.jixture.fixtures.generator.field.FieldGenerator}. @param fieldName the field's name whom value is to be overridden. @param fieldGenerator the field generator to add @return the current i...
java
public TemplateGenerator addFieldGenerator(String fieldName, FieldGenerator fieldGenerator) { multiFieldGenerator.addFieldGenerator(fieldName, fieldGenerator); return this; }
[ "public", "TemplateGenerator", "addFieldGenerator", "(", "String", "fieldName", ",", "FieldGenerator", "fieldGenerator", ")", "{", "multiFieldGenerator", ".", "addFieldGenerator", "(", "fieldName", ",", "fieldGenerator", ")", ";", "return", "this", ";", "}" ]
Adds a {@link net.cpollet.jixture.fixtures.generator.field.FieldGenerator}. @param fieldName the field's name whom value is to be overridden. @param fieldGenerator the field generator to add @return the current instance.
[ "Adds", "a", "{", "@link", "net", ".", "cpollet", ".", "jixture", ".", "fixtures", ".", "generator", ".", "field", ".", "FieldGenerator", "}", "." ]
train
https://github.com/cpollet/jixture/blob/faef0d4991f81c2cdb5be3ba24176636ef0cc433/core/src/main/java/net/cpollet/jixture/fixtures/generator/fixture/TemplateGenerator.java#L69-L72
liyiorg/weixin-popular
src/main/java/weixin/popular/api/PayMchAPI.java
PayMchAPI.secapiPayProfitsharing
public static SecapiPayProfitsharingResult secapiPayProfitsharing(SecapiPayProfitsharing secapiPayProfitsharing,String key) { """ 分账-请求单次分账 @since 2.8.25 @param secapiPayProfitsharing secapiPayProfitsharing @param key key @return SecapiPayProfitsharingResult """ Map<String,String> map = MapUtil.objectToM...
java
public static SecapiPayProfitsharingResult secapiPayProfitsharing(SecapiPayProfitsharing secapiPayProfitsharing,String key){ Map<String,String> map = MapUtil.objectToMap(secapiPayProfitsharing, "receivers"); if(secapiPayProfitsharing.getReceivers() != null){ map.put("receivers", JsonUtil.toJSONString(secapiPayPr...
[ "public", "static", "SecapiPayProfitsharingResult", "secapiPayProfitsharing", "(", "SecapiPayProfitsharing", "secapiPayProfitsharing", ",", "String", "key", ")", "{", "Map", "<", "String", ",", "String", ">", "map", "=", "MapUtil", ".", "objectToMap", "(", "secapiPayP...
分账-请求单次分账 @since 2.8.25 @param secapiPayProfitsharing secapiPayProfitsharing @param key key @return SecapiPayProfitsharingResult
[ "分账", "-", "请求单次分账" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/PayMchAPI.java#L733-L747
jOOQ/jOOL
jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java
Unchecked.biFunction
public static <T, U, R> BiFunction<T, U, R> biFunction(CheckedBiFunction<T, U, R> function, Consumer<Throwable> handler) { """ Wrap a {@link CheckedBiFunction} in a {@link BiFunction} with a custom handler for checked exceptions. <p> Example: <code><pre> map.computeIfPresent("key", Unchecked.biFunction( (k, v...
java
public static <T, U, R> BiFunction<T, U, R> biFunction(CheckedBiFunction<T, U, R> function, Consumer<Throwable> handler) { return (t, u) -> { try { return function.apply(t, u); } catch (Throwable e) { handler.accept(e); throw n...
[ "public", "static", "<", "T", ",", "U", ",", "R", ">", "BiFunction", "<", "T", ",", "U", ",", "R", ">", "biFunction", "(", "CheckedBiFunction", "<", "T", ",", "U", ",", "R", ">", "function", ",", "Consumer", "<", "Throwable", ">", "handler", ")", ...
Wrap a {@link CheckedBiFunction} in a {@link BiFunction} with a custom handler for checked exceptions. <p> Example: <code><pre> map.computeIfPresent("key", Unchecked.biFunction( (k, v) -> { if (k == null || v == null) throw new Exception("No nulls allowed in map"); return 42; }, e -> { throw new IllegalStateException(...
[ "Wrap", "a", "{", "@link", "CheckedBiFunction", "}", "in", "a", "{", "@link", "BiFunction", "}", "with", "a", "custom", "handler", "for", "checked", "exceptions", ".", "<p", ">", "Example", ":", "<code", ">", "<pre", ">", "map", ".", "computeIfPresent", ...
train
https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L351-L362
raydac/java-binary-block-parser
jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/JBBPCompiler.java
JBBPCompiler.assertName
private static void assertName(final String name, final JBBPToken token) { """ The Method check that a field name supports business rules. @param name the name to be checked @param token the token contains the name @throws JBBPCompilationException if the name doesn't support business rules """ if (na...
java
private static void assertName(final String name, final JBBPToken token) { if (name.indexOf('.') >= 0) { throw new JBBPCompilationException("Detected disallowed char '.' in name [" + name + ']', token); } }
[ "private", "static", "void", "assertName", "(", "final", "String", "name", ",", "final", "JBBPToken", "token", ")", "{", "if", "(", "name", ".", "indexOf", "(", "'", "'", ")", ">=", "0", ")", "{", "throw", "new", "JBBPCompilationException", "(", "\"Detec...
The Method check that a field name supports business rules. @param name the name to be checked @param token the token contains the name @throws JBBPCompilationException if the name doesn't support business rules
[ "The", "Method", "check", "that", "a", "field", "name", "supports", "business", "rules", "." ]
train
https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/JBBPCompiler.java#L495-L499
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/util/PropertiesUtils.java
PropertiesUtils.filterProperties
public static Map<String, String> filterProperties(Properties props, String prefix, boolean removePrefix) { """ Filters the properties file using the prefix given in parameter. @param props the properties @param prefix the prefix of the property to retrieve @param removePrefix the flag indicating if the pr...
java
public static Map<String, String> filterProperties(Properties props, String prefix, boolean removePrefix) { List<String> excludedProperties = Collections.emptyList(); return filterProperties(props, prefix, removePrefix, excludedProperties); }
[ "public", "static", "Map", "<", "String", ",", "String", ">", "filterProperties", "(", "Properties", "props", ",", "String", "prefix", ",", "boolean", "removePrefix", ")", "{", "List", "<", "String", ">", "excludedProperties", "=", "Collections", ".", "emptyLi...
Filters the properties file using the prefix given in parameter. @param props the properties @param prefix the prefix of the property to retrieve @param removePrefix the flag indicating if the prefix should be removed from the property key. @return the filtered properties
[ "Filters", "the", "properties", "file", "using", "the", "prefix", "given", "in", "parameter", "." ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/util/PropertiesUtils.java#L56-L60
jenkinsci/jenkins
core/src/main/java/hudson/model/AbstractItem.java
AbstractItem.updateByXml
public void updateByXml(Source source) throws IOException { """ Updates an Item by its XML definition. @param source source of the Item's new definition. The source should be either a <code>StreamSource</code> or a <code>SAXSource</code>, other sources may not be handled. @since 1.473 """ checkPerm...
java
public void updateByXml(Source source) throws IOException { checkPermission(CONFIGURE); XmlFile configXmlFile = getConfigFile(); final AtomicFileWriter out = new AtomicFileWriter(configXmlFile.getFile()); try { try { XMLUtils.safeTransform(source, new StreamRe...
[ "public", "void", "updateByXml", "(", "Source", "source", ")", "throws", "IOException", "{", "checkPermission", "(", "CONFIGURE", ")", ";", "XmlFile", "configXmlFile", "=", "getConfigFile", "(", ")", ";", "final", "AtomicFileWriter", "out", "=", "new", "AtomicFi...
Updates an Item by its XML definition. @param source source of the Item's new definition. The source should be either a <code>StreamSource</code> or a <code>SAXSource</code>, other sources may not be handled. @since 1.473
[ "Updates", "an", "Item", "by", "its", "XML", "definition", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractItem.java#L859-L894
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.getCustomPrebuiltEntityRoles
public List<EntityRole> getCustomPrebuiltEntityRoles(UUID appId, String versionId, UUID entityId) { """ Get All Entity Roles for a given entity. @param appId The application ID. @param versionId The version ID. @param entityId entity Id @throws IllegalArgumentException thrown if parameters fail the validatio...
java
public List<EntityRole> getCustomPrebuiltEntityRoles(UUID appId, String versionId, UUID entityId) { return getCustomPrebuiltEntityRolesWithServiceResponseAsync(appId, versionId, entityId).toBlocking().single().body(); }
[ "public", "List", "<", "EntityRole", ">", "getCustomPrebuiltEntityRoles", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "entityId", ")", "{", "return", "getCustomPrebuiltEntityRolesWithServiceResponseAsync", "(", "appId", ",", "versionId", ",", "entit...
Get All Entity Roles for a given entity. @param appId The application ID. @param versionId The version ID. @param entityId entity Id @throws IllegalArgumentException thrown if parameters fail the validation @throws ErrorResponseException thrown if the request is rejected by server @throws RuntimeException all other wr...
[ "Get", "All", "Entity", "Roles", "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#L9619-L9621
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/BufferUtils.java
BufferUtils.sliceByteBuffer
public static ByteBuffer sliceByteBuffer(ByteBuffer buffer, int position) { """ Convenience method for {@link #sliceByteBuffer(ByteBuffer, int, int)} where the last parameter is the number of remaining bytes in the new buffer. @param buffer source {@link ByteBuffer} to slice @param position position in the so...
java
public static ByteBuffer sliceByteBuffer(ByteBuffer buffer, int position) { // The following is an optimization comparing to directly calling // sliceByteBuffer(ByteBuffer, int, int) needs to compute the length of the sliced buffer and // set the limit, but those operations should have been taken care of by...
[ "public", "static", "ByteBuffer", "sliceByteBuffer", "(", "ByteBuffer", "buffer", ",", "int", "position", ")", "{", "// The following is an optimization comparing to directly calling", "// sliceByteBuffer(ByteBuffer, int, int) needs to compute the length of the sliced buffer and", "// se...
Convenience method for {@link #sliceByteBuffer(ByteBuffer, int, int)} where the last parameter is the number of remaining bytes in the new buffer. @param buffer source {@link ByteBuffer} to slice @param position position in the source {@link ByteBuffer} to slice @return the sliced {@link ByteBuffer}
[ "Convenience", "method", "for", "{", "@link", "#sliceByteBuffer", "(", "ByteBuffer", "int", "int", ")", "}", "where", "the", "last", "parameter", "is", "the", "number", "of", "remaining", "bytes", "in", "the", "new", "buffer", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/BufferUtils.java#L352-L357
kaazing/java.client
ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java
WrappedByteBuffer.fillWith
public WrappedByteBuffer fillWith(byte b, int size) { """ Fills the buffer with a specific number of repeated bytes. @param b the byte to repeat @param size the number of times to repeat @return the buffer """ _autoExpand(size); while (size-- > 0) { _buf.put(b); } ...
java
public WrappedByteBuffer fillWith(byte b, int size) { _autoExpand(size); while (size-- > 0) { _buf.put(b); } return this; }
[ "public", "WrappedByteBuffer", "fillWith", "(", "byte", "b", ",", "int", "size", ")", "{", "_autoExpand", "(", "size", ")", ";", "while", "(", "size", "--", ">", "0", ")", "{", "_buf", ".", "put", "(", "b", ")", ";", "}", "return", "this", ";", "...
Fills the buffer with a specific number of repeated bytes. @param b the byte to repeat @param size the number of times to repeat @return the buffer
[ "Fills", "the", "buffer", "with", "a", "specific", "number", "of", "repeated", "bytes", "." ]
train
https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java#L305-L311
landawn/AbacusUtil
src/com/landawn/abacus/util/DateUtil.java
DateUtil.setDays
public static <T extends java.util.Date> T setDays(final T date, final int amount) { """ Copied from Apache Commons Lang under Apache License v2. <br /> Sets the day of month field to a date returning a new object. The original {@code Date} is unchanged. @param date the date, not null @param amount the a...
java
public static <T extends java.util.Date> T setDays(final T date, final int amount) { return set(date, Calendar.DAY_OF_MONTH, amount); }
[ "public", "static", "<", "T", "extends", "java", ".", "util", ".", "Date", ">", "T", "setDays", "(", "final", "T", "date", ",", "final", "int", "amount", ")", "{", "return", "set", "(", "date", ",", "Calendar", ".", "DAY_OF_MONTH", ",", "amount", ")"...
Copied from Apache Commons Lang under Apache License v2. <br /> Sets the day of month field to a date returning a new object. The original {@code Date} is unchanged. @param date the date, not null @param amount the amount to set @return a new {@code Date} set with the specified value @throws IllegalArgumentException...
[ "Copied", "from", "Apache", "Commons", "Lang", "under", "Apache", "License", "v2", ".", "<br", "/", ">" ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DateUtil.java#L732-L734
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionFactory.java
ExtensionFactory.getExtensionDependency
public ExtensionDependency getExtensionDependency(String id, VersionConstraint versionConstraint, boolean optional, Map<String, Object> properties) { """ Store and return a weak reference equals to the passed {@link ExtensionDependency}. @param id the id of the extension dependency @param versionConstr...
java
public ExtensionDependency getExtensionDependency(String id, VersionConstraint versionConstraint, boolean optional, Map<String, Object> properties) { return getExtensionDependency(new DefaultExtensionDependency(id, versionConstraint, optional, properties)); }
[ "public", "ExtensionDependency", "getExtensionDependency", "(", "String", "id", ",", "VersionConstraint", "versionConstraint", ",", "boolean", "optional", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "return", "getExtensionDependency", "(", ...
Store and return a weak reference equals to the passed {@link ExtensionDependency}. @param id the id of the extension dependency @param versionConstraint the version constraint of the extension dependency @param optional true if the dependency is optional @param properties the custom properties of the extension depend...
[ "Store", "and", "return", "a", "weak", "reference", "equals", "to", "the", "passed", "{", "@link", "ExtensionDependency", "}", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionFactory.java#L86-L90
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java
CPDefinitionOptionRelPersistenceImpl.findByGroupId
@Override public List<CPDefinitionOptionRel> findByGroupId(long groupId) { """ Returns all the cp definition option rels where groupId = &#63;. @param groupId the group ID @return the matching cp definition option rels """ return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
java
@Override public List<CPDefinitionOptionRel> findByGroupId(long groupId) { return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
[ "@", "Override", "public", "List", "<", "CPDefinitionOptionRel", ">", "findByGroupId", "(", "long", "groupId", ")", "{", "return", "findByGroupId", "(", "groupId", ",", "QueryUtil", ".", "ALL_POS", ",", "QueryUtil", ".", "ALL_POS", ",", "null", ")", ";", "}"...
Returns all the cp definition option rels where groupId = &#63;. @param groupId the group ID @return the matching cp definition option rels
[ "Returns", "all", "the", "cp", "definition", "option", "rels", "where", "groupId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L1524-L1527
belaban/JGroups
src/org/jgroups/blocks/ReplicatedHashMap.java
ReplicatedHashMap.put
public V put(K key, V value) { """ Maps the specified key to the specified value in this table. Neither the key nor the value can be null. <p/> <p> The value can be retrieved by calling the <tt>get</tt> method with a key that is equal to the original key. @param key key with which the specified value is to b...
java
public V put(K key, V value) { V prev_val=get(key); try { MethodCall call=new MethodCall(PUT, key, value); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("put(" + key + ", " + value + ") failed", e);...
[ "public", "V", "put", "(", "K", "key", ",", "V", "value", ")", "{", "V", "prev_val", "=", "get", "(", "key", ")", ";", "try", "{", "MethodCall", "call", "=", "new", "MethodCall", "(", "PUT", ",", "key", ",", "value", ")", ";", "disp", ".", "cal...
Maps the specified key to the specified value in this table. Neither the key nor the value can be null. <p/> <p> The value can be retrieved by calling the <tt>get</tt> method with a key that is equal to the original key. @param key key with which the specified value is to be associated @param value value to be associa...
[ "Maps", "the", "specified", "key", "to", "the", "specified", "value", "in", "this", "table", ".", "Neither", "the", "key", "nor", "the", "value", "can", "be", "null", ".", "<p", "/", ">", "<p", ">", "The", "value", "can", "be", "retrieved", "by", "ca...
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/blocks/ReplicatedHashMap.java#L218-L228
carewebframework/carewebframework-core
org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/ConfigTemplate.java
ConfigTemplate.addEntry
public void addEntry(String placeholder, String... params) { """ Adds an entry to the config file. @param placeholder Placeholder identifying insertion point for entry. @param params Parameters to be applied to the template. """ ConfigEntry entry = entries.get(placeholder); String line = en...
java
public void addEntry(String placeholder, String... params) { ConfigEntry entry = entries.get(placeholder); String line = entry.template; for (int i = 0; i < params.length; i++) { line = line.replace("{" + i + "}", StringUtils.defaultString(params[i])); } entry.buffe...
[ "public", "void", "addEntry", "(", "String", "placeholder", ",", "String", "...", "params", ")", "{", "ConfigEntry", "entry", "=", "entries", ".", "get", "(", "placeholder", ")", ";", "String", "line", "=", "entry", ".", "template", ";", "for", "(", "int...
Adds an entry to the config file. @param placeholder Placeholder identifying insertion point for entry. @param params Parameters to be applied to the template.
[ "Adds", "an", "entry", "to", "the", "config", "file", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/ConfigTemplate.java#L110-L119
OpenTSDB/opentsdb
src/utils/JSON.java
JSON.serializeToJSONPString
public static final String serializeToJSONPString(final String callback, final Object object) { """ Serializes the given object and wraps it in a callback function i.e. &lt;callback&gt;(&lt;json&gt;) Note: This will not append a trailing semicolon @param callback The name of the Javascript callback to pre...
java
public static final String serializeToJSONPString(final String callback, final Object object) { if (callback == null || callback.isEmpty()) throw new IllegalArgumentException("Missing callback name"); if (object == null) throw new IllegalArgumentException("Object was null"); try { re...
[ "public", "static", "final", "String", "serializeToJSONPString", "(", "final", "String", "callback", ",", "final", "Object", "object", ")", "{", "if", "(", "callback", "==", "null", "||", "callback", ".", "isEmpty", "(", ")", ")", "throw", "new", "IllegalArg...
Serializes the given object and wraps it in a callback function i.e. &lt;callback&gt;(&lt;json&gt;) Note: This will not append a trailing semicolon @param callback The name of the Javascript callback to prepend @param object The object to serialize @return A JSONP formatted string @throws IllegalArgumentException if th...
[ "Serializes", "the", "given", "object", "and", "wraps", "it", "in", "a", "callback", "function", "i", ".", "e", ".", "&lt", ";", "callback&gt", ";", "(", "&lt", ";", "json&gt", ";", ")", "Note", ":", "This", "will", "not", "append", "a", "trailing", ...
train
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/JSON.java#L311-L322
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/util/RuntimeHttpUtils.java
RuntimeHttpUtils.toUri
public static URI toUri(String endpoint, ClientConfiguration config) { """ Returns an URI for the given endpoint. Prefixes the protocol if the endpoint given does not have it. @throws IllegalArgumentException if the inputs are null. """ if (config == null) { throw new IllegalArgumentEx...
java
public static URI toUri(String endpoint, ClientConfiguration config) { if (config == null) { throw new IllegalArgumentException("ClientConfiguration cannot be null"); } return toUri(endpoint, config.getProtocol()); }
[ "public", "static", "URI", "toUri", "(", "String", "endpoint", ",", "ClientConfiguration", "config", ")", "{", "if", "(", "config", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"ClientConfiguration cannot be null\"", ")", ";", "}", ...
Returns an URI for the given endpoint. Prefixes the protocol if the endpoint given does not have it. @throws IllegalArgumentException if the inputs are null.
[ "Returns", "an", "URI", "for", "the", "given", "endpoint", ".", "Prefixes", "the", "protocol", "if", "the", "endpoint", "given", "does", "not", "have", "it", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/RuntimeHttpUtils.java#L166-L172
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java
CommonOps_DDF3.elementMult
public static void elementMult( DMatrix3 a , DMatrix3 b) { """ <p>Performs an element by element multiplication operation:<br> <br> a<sub>i</sub> = a<sub>i</sub> * b<sub>i</sub> <br> </p> @param a The left vector in the multiplication operation. Modified. @param b The right vector in the multiplication operat...
java
public static void elementMult( DMatrix3 a , DMatrix3 b) { a.a1 *= b.a1; a.a2 *= b.a2; a.a3 *= b.a3; }
[ "public", "static", "void", "elementMult", "(", "DMatrix3", "a", ",", "DMatrix3", "b", ")", "{", "a", ".", "a1", "*=", "b", ".", "a1", ";", "a", ".", "a2", "*=", "b", ".", "a2", ";", "a", ".", "a3", "*=", "b", ".", "a3", ";", "}" ]
<p>Performs an element by element multiplication operation:<br> <br> a<sub>i</sub> = a<sub>i</sub> * b<sub>i</sub> <br> </p> @param a The left vector in the multiplication operation. Modified. @param b The right vector in the multiplication operation. Not modified.
[ "<p", ">", "Performs", "an", "element", "by", "element", "multiplication", "operation", ":", "<br", ">", "<br", ">", "a<sub", ">", "i<", "/", "sub", ">", "=", "a<sub", ">", "i<", "/", "sub", ">", "*", "b<sub", ">", "i<", "/", "sub", ">", "<br", "...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java#L1053-L1057
lotaris/rox-client-java
rox-client-java/src/main/java/com/lotaris/rox/common/config/Configuration.java
Configuration.uidAlreadyUsed
private boolean uidAlreadyUsed(String category, String projectName, String uid) { """ Check if a UID was already used in any context @param category The category to check @param projectName The project name to check @param uid The UID to validate @return True if the UID is present for at least one version of...
java
private boolean uidAlreadyUsed(String category, String projectName, String uid) { if (uid == null) { return false; } else { for (File versionDirectory : getUidFilesForProject(category, projectName)) { String uidRead = readUid(new File(versionDirectory, "latest")); if (uidRead != null && !uid...
[ "private", "boolean", "uidAlreadyUsed", "(", "String", "category", ",", "String", "projectName", ",", "String", "uid", ")", "{", "if", "(", "uid", "==", "null", ")", "{", "return", "false", ";", "}", "else", "{", "for", "(", "File", "versionDirectory", "...
Check if a UID was already used in any context @param category The category to check @param projectName The project name to check @param uid The UID to validate @return True if the UID is present for at least one version of a project in a category, false otherwise
[ "Check", "if", "a", "UID", "was", "already", "used", "in", "any", "context" ]
train
https://github.com/lotaris/rox-client-java/blob/1b33f7560347c382c59a40c4037d175ab8127fde/rox-client-java/src/main/java/com/lotaris/rox/common/config/Configuration.java#L507-L525
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleUtil.java
BouncyCastleUtil.getIdentity
public static String getIdentity(X509Certificate cert) { """ Returns the subject DN of the given certificate in the Globus format. @param cert the certificate to get the subject of. The certificate must be of <code>X509CertificateObject</code> type. @return the subject DN of the certificate in the Globus form...
java
public static String getIdentity(X509Certificate cert) { if (cert == null) { return null; } String subjectDN = cert.getSubjectX500Principal().getName(X500Principal.RFC2253); X509Name name = new X509Name(true, subjectDN); return X509NameHelper.toString(name); }
[ "public", "static", "String", "getIdentity", "(", "X509Certificate", "cert", ")", "{", "if", "(", "cert", "==", "null", ")", "{", "return", "null", ";", "}", "String", "subjectDN", "=", "cert", ".", "getSubjectX500Principal", "(", ")", ".", "getName", "(",...
Returns the subject DN of the given certificate in the Globus format. @param cert the certificate to get the subject of. The certificate must be of <code>X509CertificateObject</code> type. @return the subject DN of the certificate in the Globus format.
[ "Returns", "the", "subject", "DN", "of", "the", "given", "certificate", "in", "the", "Globus", "format", "." ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleUtil.java#L425-L433
jpaoletti/java-presentation-manager
modules/jpm-core/src/main/java/jpaoletti/jpm/validator/ValidatorSupport.java
ValidatorSupport.get
public String get (String name, String def) { """ Helper for a property @param name Property name @param def Default value @return Property value """ if (properties != null) { Object obj = properties.get (name); if (obj instanceof String) return obj.toString()...
java
public String get (String name, String def) { if (properties != null) { Object obj = properties.get (name); if (obj instanceof String) return obj.toString(); } return def; }
[ "public", "String", "get", "(", "String", "name", ",", "String", "def", ")", "{", "if", "(", "properties", "!=", "null", ")", "{", "Object", "obj", "=", "properties", ".", "get", "(", "name", ")", ";", "if", "(", "obj", "instanceof", "String", ")", ...
Helper for a property @param name Property name @param def Default value @return Property value
[ "Helper", "for", "a", "property" ]
train
https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/validator/ValidatorSupport.java#L30-L37
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/event/CheckRangeHandler.java
CheckRangeHandler.syncClonedListener
public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) { """ Set this cloned listener to the same state at this listener. @param field The field this new listener will be added to. @param The new listener to sync to this. @param Has the init method been called? @return ...
java
public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) { if (!bInitCalled) ((CheckRangeHandler)listener).init(null, m_dStartRange, m_dEndRange); return super.syncClonedListener(field, listener, true); }
[ "public", "boolean", "syncClonedListener", "(", "BaseField", "field", ",", "FieldListener", "listener", ",", "boolean", "bInitCalled", ")", "{", "if", "(", "!", "bInitCalled", ")", "(", "(", "CheckRangeHandler", ")", "listener", ")", ".", "init", "(", "null", ...
Set this cloned listener to the same state at this listener. @param field The field this new listener will be added to. @param The new listener to sync to this. @param Has the init method been called? @return True if I called init.
[ "Set", "this", "cloned", "listener", "to", "the", "same", "state", "at", "this", "listener", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/CheckRangeHandler.java#L99-L104
vkostyukov/la4j
src/main/java/org/la4j/Vectors.java
Vectors.asModFunction
public static VectorFunction asModFunction(final double arg) { """ Creates a mod function that calculates the modulus of it's argument and given {@code value}. @param arg a divisor value @return a closure that does {@code _ % _} """ return new VectorFunction() { @Override ...
java
public static VectorFunction asModFunction(final double arg) { return new VectorFunction() { @Override public double evaluate(int i, double value) { return value % arg; } }; }
[ "public", "static", "VectorFunction", "asModFunction", "(", "final", "double", "arg", ")", "{", "return", "new", "VectorFunction", "(", ")", "{", "@", "Override", "public", "double", "evaluate", "(", "int", "i", ",", "double", "value", ")", "{", "return", ...
Creates a mod function that calculates the modulus of it's argument and given {@code value}. @param arg a divisor value @return a closure that does {@code _ % _}
[ "Creates", "a", "mod", "function", "that", "calculates", "the", "modulus", "of", "it", "s", "argument", "and", "given", "{", "@code", "value", "}", "." ]
train
https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Vectors.java#L218-L225
di2e/Argo
PluginFramework/src/main/java/ws/argo/probe/Probe.java
Probe.frameProbeFrom
public static Probe frameProbeFrom(Probe p) throws ProbeSenderException { """ Create a new probe from the argument that includes all the frame stuff (payload type, respondTo addr, etc) but don't include any of the contract or service ids. This method is a helper method for splitting over sized probes into small...
java
public static Probe frameProbeFrom(Probe p) throws ProbeSenderException { Probe fp = null; try { fp = new Probe(p.getProbeWrapper().getRespondToPayloadType()); } catch (UnsupportedPayloadType e1) { throw new ProbeSenderException("Error in creating frame probe.", e1); } fp.setHopLimit(p....
[ "public", "static", "Probe", "frameProbeFrom", "(", "Probe", "p", ")", "throws", "ProbeSenderException", "{", "Probe", "fp", "=", "null", ";", "try", "{", "fp", "=", "new", "Probe", "(", "p", ".", "getProbeWrapper", "(", ")", ".", "getRespondToPayloadType", ...
Create a new probe from the argument that includes all the frame stuff (payload type, respondTo addr, etc) but don't include any of the contract or service ids. This method is a helper method for splitting over sized probes into smaller probes so that the packets are not too big for the network. @param p the source pr...
[ "Create", "a", "new", "probe", "from", "the", "argument", "that", "includes", "all", "the", "frame", "stuff", "(", "payload", "type", "respondTo", "addr", "etc", ")", "but", "don", "t", "include", "any", "of", "the", "contract", "or", "service", "ids", "...
train
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/PluginFramework/src/main/java/ws/argo/probe/Probe.java#L60-L79
jwtk/jjwt
api/src/main/java/io/jsonwebtoken/lang/Collections.java
Collections.containsAny
public static boolean containsAny(Collection source, Collection candidates) { """ Return <code>true</code> if any element in '<code>candidates</code>' is contained in '<code>source</code>'; otherwise returns <code>false</code>. @param source the source Collection @param candidates the candidates to search for ...
java
public static boolean containsAny(Collection source, Collection candidates) { if (isEmpty(source) || isEmpty(candidates)) { return false; } for (Object candidate : candidates) { if (source.contains(candidate)) { return true; } } ...
[ "public", "static", "boolean", "containsAny", "(", "Collection", "source", ",", "Collection", "candidates", ")", "{", "if", "(", "isEmpty", "(", "source", ")", "||", "isEmpty", "(", "candidates", ")", ")", "{", "return", "false", ";", "}", "for", "(", "O...
Return <code>true</code> if any element in '<code>candidates</code>' is contained in '<code>source</code>'; otherwise returns <code>false</code>. @param source the source Collection @param candidates the candidates to search for @return whether any of the candidates has been found
[ "Return", "<code", ">", "true<", "/", "code", ">", "if", "any", "element", "in", "<code", ">", "candidates<", "/", "code", ">", "is", "contained", "in", "<code", ">", "source<", "/", "code", ">", ";", "otherwise", "returns", "<code", ">", "false<", "/"...
train
https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Collections.java#L191-L201
amzn/ion-java
src/com/amazon/ion/impl/IonBinary.java
IonBinary.readAll
public static void readAll(InputStream in, byte[] buf, int offset, int len) throws IOException { """ Uses {@link InputStream#read(byte[], int, int)} until the entire length is read. This method will block until the request is satisfied. @param in The stream to read from. @param buf The buffer to ...
java
public static void readAll(InputStream in, byte[] buf, int offset, int len) throws IOException { int rem = len; while (rem > 0) { int amount = in.read(buf, offset, rem); if (amount <= 0) { // try to throw a useful exception ...
[ "public", "static", "void", "readAll", "(", "InputStream", "in", ",", "byte", "[", "]", "buf", ",", "int", "offset", ",", "int", "len", ")", "throws", "IOException", "{", "int", "rem", "=", "len", ";", "while", "(", "rem", ">", "0", ")", "{", "int"...
Uses {@link InputStream#read(byte[], int, int)} until the entire length is read. This method will block until the request is satisfied. @param in The stream to read from. @param buf The buffer to read to. @param offset The offset of the buffer to read from. @param len The length of the data to re...
[ "Uses", "{", "@link", "InputStream#read", "(", "byte", "[]", "int", "int", ")", "}", "until", "the", "entire", "length", "is", "read", ".", "This", "method", "will", "block", "until", "the", "request", "is", "satisfied", "." ]
train
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonBinary.java#L921-L940
Azure/azure-sdk-for-java
streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/FunctionsInner.java
FunctionsInner.createOrReplaceAsync
public Observable<FunctionInner> createOrReplaceAsync(String resourceGroupName, String jobName, String functionName, FunctionInner function, String ifMatch, String ifNoneMatch) { """ Creates a function or replaces an already existing function under an existing streaming job. @param resourceGroupName The name of...
java
public Observable<FunctionInner> createOrReplaceAsync(String resourceGroupName, String jobName, String functionName, FunctionInner function, String ifMatch, String ifNoneMatch) { return createOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, functionName, function, ifMatch, ifNoneMatch).map(new Func...
[ "public", "Observable", "<", "FunctionInner", ">", "createOrReplaceAsync", "(", "String", "resourceGroupName", ",", "String", "jobName", ",", "String", "functionName", ",", "FunctionInner", "function", ",", "String", "ifMatch", ",", "String", "ifNoneMatch", ")", "{"...
Creates a function or replaces an already existing function under an existing streaming job. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param jobName The name of the streaming job. @param functionName...
[ "Creates", "a", "function", "or", "replaces", "an", "already", "existing", "function", "under", "an", "existing", "streaming", "job", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/FunctionsInner.java#L252-L259
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanDocBookBuilder.java
PublicanDocBookBuilder.processConditions
@Override protected void processConditions(final BuildData buildData, final SpecTopic specTopic, final Document doc) { """ Checks if the conditional pass should be done by checking to see if the publican.cfg has it's own condition set. If none are set then the conditions are processed. @param buildData Inf...
java
@Override protected void processConditions(final BuildData buildData, final SpecTopic specTopic, final Document doc) { if (buildData.getContentSpec().getPublicanCfg() == null || !buildData.getContentSpec().getPublicanCfg().contains("condition:")) { super.processConditions(buildData, specTopic, d...
[ "@", "Override", "protected", "void", "processConditions", "(", "final", "BuildData", "buildData", ",", "final", "SpecTopic", "specTopic", ",", "final", "Document", "doc", ")", "{", "if", "(", "buildData", ".", "getContentSpec", "(", ")", ".", "getPublicanCfg", ...
Checks if the conditional pass should be done by checking to see if the publican.cfg has it's own condition set. If none are set then the conditions are processed. @param buildData Information and data structures for the build. @param specTopic The spec topic the conditions should be processed for, @param doc Th...
[ "Checks", "if", "the", "conditional", "pass", "should", "be", "done", "by", "checking", "to", "see", "if", "the", "publican", ".", "cfg", "has", "it", "s", "own", "condition", "set", ".", "If", "none", "are", "set", "then", "the", "conditions", "are", ...
train
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanDocBookBuilder.java#L59-L64
Alluxio/alluxio
core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java
AbstractFileSystem.setPermission
@Override public void setPermission(Path path, FsPermission permission) throws IOException { """ Changes permission of a path. @param path path to set permission @param permission permission set to path """ LOG.debug("setMode({},{})", path, permission.toString()); AlluxioURI uri = new AlluxioURI(...
java
@Override public void setPermission(Path path, FsPermission permission) throws IOException { LOG.debug("setMode({},{})", path, permission.toString()); AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); SetAttributePOptions options = SetAttributePOptions.newBuilder() .setMode(...
[ "@", "Override", "public", "void", "setPermission", "(", "Path", "path", ",", "FsPermission", "permission", ")", "throws", "IOException", "{", "LOG", ".", "debug", "(", "\"setMode({},{})\"", ",", "path", ",", "permission", ".", "toString", "(", ")", ")", ";"...
Changes permission of a path. @param path path to set permission @param permission permission set to path
[ "Changes", "permission", "of", "a", "path", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java#L404-L415
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java
ComponentCollision.removePoints
private void removePoints(double x, double y, Collidable collidable) { """ Remove point and adjacent points depending of the collidable max collision size. @param x The horizontal location. @param y The vertical location. @param collidable The collidable reference. """ final int minX = (int) Math....
java
private void removePoints(double x, double y, Collidable collidable) { final int minX = (int) Math.floor(x / REDUCE_FACTOR); final int minY = (int) Math.floor(y / REDUCE_FACTOR); final int maxX = (int) Math.floor((x + collidable.getMaxWidth()) / REDUCE_FACTOR); final int maxY = (int)...
[ "private", "void", "removePoints", "(", "double", "x", ",", "double", "y", ",", "Collidable", "collidable", ")", "{", "final", "int", "minX", "=", "(", "int", ")", "Math", ".", "floor", "(", "x", "/", "REDUCE_FACTOR", ")", ";", "final", "int", "minY", ...
Remove point and adjacent points depending of the collidable max collision size. @param x The horizontal location. @param y The vertical location. @param collidable The collidable reference.
[ "Remove", "point", "and", "adjacent", "points", "depending", "of", "the", "collidable", "max", "collision", "size", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java#L284-L292
intendia-oss/rxjava-gwt
src/main/modified/io/reactivex/super/io/reactivex/Single.java
Single.fromObservable
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Single<T> fromObservable(ObservableSource<? extends T> observableSource) { """ Wraps a specific ObservableSource into a Single and signals its single element or error. <p>If the ObservableSource is empty, a NoSuchElementException...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Single<T> fromObservable(ObservableSource<? extends T> observableSource) { ObjectHelper.requireNonNull(observableSource, "observableSource is null"); return RxJavaPlugins.onAssembly(new ObservableSingleSingle<T>(observa...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "static", "<", "T", ">", "Single", "<", "T", ">", "fromObservable", "(", "ObservableSource", "<", "?", "extends", "T", ">", "observableSource", ")", "{", "...
Wraps a specific ObservableSource into a Single and signals its single element or error. <p>If the ObservableSource is empty, a NoSuchElementException is signalled. If the source has more than one element, an IndexOutOfBoundsException is signalled. <p> <img width="640" height="343" src="https://raw.github.com/wiki/Reac...
[ "Wraps", "a", "specific", "ObservableSource", "into", "a", "Single", "and", "signals", "its", "single", "element", "or", "error", ".", "<p", ">", "If", "the", "ObservableSource", "is", "empty", "a", "NoSuchElementException", "is", "signalled", ".", "If", "the"...
train
https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Single.java#L788-L793
killbill/killbill
catalog/src/main/java/org/killbill/billing/catalog/DefaultVersionedCatalog.java
DefaultVersionedCatalog.getStaticCatalog
private StaticCatalog getStaticCatalog(final PlanSpecifier spec, final DateTime requestedDate, final DateTime subscriptionChangePlanDate) throws CatalogApiException { """ Note that the PlanSpecifier billing period must refer here to the recurring phase one when a plan name isn't specified """ final Cat...
java
private StaticCatalog getStaticCatalog(final PlanSpecifier spec, final DateTime requestedDate, final DateTime subscriptionChangePlanDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(spec), requestedDate, subscriptionChangePlanDate); return entr...
[ "private", "StaticCatalog", "getStaticCatalog", "(", "final", "PlanSpecifier", "spec", ",", "final", "DateTime", "requestedDate", ",", "final", "DateTime", "subscriptionChangePlanDate", ")", "throws", "CatalogApiException", "{", "final", "CatalogPlanEntry", "entry", "=", ...
Note that the PlanSpecifier billing period must refer here to the recurring phase one when a plan name isn't specified
[ "Note", "that", "the", "PlanSpecifier", "billing", "period", "must", "refer", "here", "to", "the", "recurring", "phase", "one", "when", "a", "plan", "name", "isn", "t", "specified" ]
train
https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/catalog/src/main/java/org/killbill/billing/catalog/DefaultVersionedCatalog.java#L327-L330
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java
RunbookDraftsInner.beginReplaceContent
public String beginReplaceContent(String resourceGroupName, String automationAccountName, String runbookName, String runbookContent) { """ Replaces the runbook draft content. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param runbo...
java
public String beginReplaceContent(String resourceGroupName, String automationAccountName, String runbookName, String runbookContent) { return beginReplaceContentWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName, runbookContent).toBlocking().single().body(); }
[ "public", "String", "beginReplaceContent", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "String", "runbookName", ",", "String", "runbookContent", ")", "{", "return", "beginReplaceContentWithServiceResponseAsync", "(", "resourceGroupName", ...
Replaces the runbook draft content. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param runbookName The runbook name. @param runbookContent The runbook draft content. @throws IllegalArgumentException thrown if parameters fail the validation ...
[ "Replaces", "the", "runbook", "draft", "content", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java#L275-L277
elki-project/elki
elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/deliclu/DeLiCluNode.java
DeLiCluNode.integrityCheckParameters
@Override protected void integrityCheckParameters(DeLiCluNode parent, int index) { """ Tests, if the parameters of the entry representing this node, are correctly set. Subclasses may need to overwrite this method. @param parent the parent holding the entry representing this node @param index the index of th...
java
@Override protected void integrityCheckParameters(DeLiCluNode parent, int index) { super.integrityCheckParameters(parent, index); // test if hasHandled and hasUnhandled flag are correctly set DeLiCluEntry entry = parent.getEntry(index); boolean hasHandled = hasHandled(); boolean hasUnhandled = has...
[ "@", "Override", "protected", "void", "integrityCheckParameters", "(", "DeLiCluNode", "parent", ",", "int", "index", ")", "{", "super", ".", "integrityCheckParameters", "(", "parent", ",", "index", ")", ";", "// test if hasHandled and hasUnhandled flag are correctly set",...
Tests, if the parameters of the entry representing this node, are correctly set. Subclasses may need to overwrite this method. @param parent the parent holding the entry representing this node @param index the index of the entry in the parents child array
[ "Tests", "if", "the", "parameters", "of", "the", "entry", "representing", "this", "node", "are", "correctly", "set", ".", "Subclasses", "may", "need", "to", "overwrite", "this", "method", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/deliclu/DeLiCluNode.java#L106-L123
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java
CPDefinitionLinkPersistenceImpl.findByUUID_G
@Override public CPDefinitionLink findByUUID_G(String uuid, long groupId) throws NoSuchCPDefinitionLinkException { """ Returns the cp definition link where uuid = &#63; and groupId = &#63; or throws a {@link NoSuchCPDefinitionLinkException} if it could not be found. @param uuid the uuid @param groupId the g...
java
@Override public CPDefinitionLink findByUUID_G(String uuid, long groupId) throws NoSuchCPDefinitionLinkException { CPDefinitionLink cpDefinitionLink = fetchByUUID_G(uuid, groupId); if (cpDefinitionLink == null) { StringBundler msg = new StringBundler(6); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.appe...
[ "@", "Override", "public", "CPDefinitionLink", "findByUUID_G", "(", "String", "uuid", ",", "long", "groupId", ")", "throws", "NoSuchCPDefinitionLinkException", "{", "CPDefinitionLink", "cpDefinitionLink", "=", "fetchByUUID_G", "(", "uuid", ",", "groupId", ")", ";", ...
Returns the cp definition link where uuid = &#63; and groupId = &#63; or throws a {@link NoSuchCPDefinitionLinkException} if it could not be found. @param uuid the uuid @param groupId the group ID @return the matching cp definition link @throws NoSuchCPDefinitionLinkException if a matching cp definition link could not...
[ "Returns", "the", "cp", "definition", "link", "where", "uuid", "=", "&#63", ";", "and", "groupId", "=", "&#63", ";", "or", "throws", "a", "{", "@link", "NoSuchCPDefinitionLinkException", "}", "if", "it", "could", "not", "be", "found", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L666-L692
prestodb/presto
presto-raptor/src/main/java/com/facebook/presto/raptor/util/DatabaseUtil.java
DatabaseUtil.mySqlErrorCodeMatches
private static boolean mySqlErrorCodeMatches(Exception e, int errorCode) { """ Check if an exception is caused by a MySQL exception of certain error code """ return Throwables.getCausalChain(e).stream() .filter(SQLException.class::isInstance) .map(SQLException.class::cas...
java
private static boolean mySqlErrorCodeMatches(Exception e, int errorCode) { return Throwables.getCausalChain(e).stream() .filter(SQLException.class::isInstance) .map(SQLException.class::cast) .filter(t -> t.getErrorCode() == errorCode) .map(Thro...
[ "private", "static", "boolean", "mySqlErrorCodeMatches", "(", "Exception", "e", ",", "int", "errorCode", ")", "{", "return", "Throwables", ".", "getCausalChain", "(", "e", ")", ".", "stream", "(", ")", ".", "filter", "(", "SQLException", ".", "class", "::", ...
Check if an exception is caused by a MySQL exception of certain error code
[ "Check", "if", "an", "exception", "is", "caused", "by", "a", "MySQL", "exception", "of", "certain", "error", "code" ]
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-raptor/src/main/java/com/facebook/presto/raptor/util/DatabaseUtil.java#L155-L163
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java
PageFlowUtils.getModulePath
public static String getModulePath( HttpServletRequest request, String requestURI ) { """ Get the Struts module path for a URI. This is the parent directory, relative to the web application root, of the file referenced by the URI. @param request the current HttpServletRequest. @param requestURI the URI for w...
java
public static String getModulePath( HttpServletRequest request, String requestURI ) { return getModulePathForRelativeURI( getRelativeURI( request, requestURI, null ) ); }
[ "public", "static", "String", "getModulePath", "(", "HttpServletRequest", "request", ",", "String", "requestURI", ")", "{", "return", "getModulePathForRelativeURI", "(", "getRelativeURI", "(", "request", ",", "requestURI", ",", "null", ")", ")", ";", "}" ]
Get the Struts module path for a URI. This is the parent directory, relative to the web application root, of the file referenced by the URI. @param request the current HttpServletRequest. @param requestURI the URI for which to get the Struts module path.
[ "Get", "the", "Struts", "module", "path", "for", "a", "URI", ".", "This", "is", "the", "parent", "directory", "relative", "to", "the", "web", "application", "root", "of", "the", "file", "referenced", "by", "the", "URI", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L95-L98
Jasig/uPortal
uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/cache/TagTrackingCacheEventListener.java
TagTrackingCacheEventListener.removeElement
protected void removeElement(Ehcache cache, Element element) { """ If the element has a TaggedCacheKey remove the tag associations """ final Set<CacheEntryTag> tags = this.getTags(element); // Check if the key is tagged if (tags != null && !tags.isEmpty()) { final String ca...
java
protected void removeElement(Ehcache cache, Element element) { final Set<CacheEntryTag> tags = this.getTags(element); // Check if the key is tagged if (tags != null && !tags.isEmpty()) { final String cacheName = cache.getName(); final LoadingCache<CacheEntryTag, Set<Obje...
[ "protected", "void", "removeElement", "(", "Ehcache", "cache", ",", "Element", "element", ")", "{", "final", "Set", "<", "CacheEntryTag", ">", "tags", "=", "this", ".", "getTags", "(", "element", ")", ";", "// Check if the key is tagged", "if", "(", "tags", ...
If the element has a TaggedCacheKey remove the tag associations
[ "If", "the", "element", "has", "a", "TaggedCacheKey", "remove", "the", "tag", "associations" ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/cache/TagTrackingCacheEventListener.java#L161-L187
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRContext.java
GVRContext.showToast
public void showToast(final String message, float duration) { """ Show a toast-like message for the specified duration @param message @param duration in seconds """ final float quadWidth = 1.2f; final GVRTextViewSceneObject toastSceneObject = new GVRTextViewSceneObject(this, quadWidth, quad...
java
public void showToast(final String message, float duration) { final float quadWidth = 1.2f; final GVRTextViewSceneObject toastSceneObject = new GVRTextViewSceneObject(this, quadWidth, quadWidth / 5, message); toastSceneObject.setTextSize(6); toastSceneObject.setTextColor...
[ "public", "void", "showToast", "(", "final", "String", "message", ",", "float", "duration", ")", "{", "final", "float", "quadWidth", "=", "1.2f", ";", "final", "GVRTextViewSceneObject", "toastSceneObject", "=", "new", "GVRTextViewSceneObject", "(", "this", ",", ...
Show a toast-like message for the specified duration @param message @param duration in seconds
[ "Show", "a", "toast", "-", "like", "message", "for", "the", "specified", "duration" ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRContext.java#L702-L754
zaproxy/zaproxy
src/org/zaproxy/zap/extension/help/ZapTocView.java
ZapTocView.getDataAsTree
@Override public DefaultMutableTreeNode getDataAsTree() { """ Note: The implementation has been copied (verbatim) from the base method except for the use of a custom TreeItemFactory. """ HelpSet hs = getHelpSet(); Hashtable<?, ?> params = getParameters(); URL url; if (param...
java
@Override public DefaultMutableTreeNode getDataAsTree() { HelpSet hs = getHelpSet(); Hashtable<?, ?> params = getParameters(); URL url; if (params == null || !params.containsKey("data")) { return new DefaultMutableTreeNode(); } try { url = ne...
[ "@", "Override", "public", "DefaultMutableTreeNode", "getDataAsTree", "(", ")", "{", "HelpSet", "hs", "=", "getHelpSet", "(", ")", ";", "Hashtable", "<", "?", ",", "?", ">", "params", "=", "getParameters", "(", ")", ";", "URL", "url", ";", "if", "(", "...
Note: The implementation has been copied (verbatim) from the base method except for the use of a custom TreeItemFactory.
[ "Note", ":", "The", "implementation", "has", "been", "copied", "(", "verbatim", ")", "from", "the", "base", "method", "except", "for", "the", "use", "of", "a", "custom", "TreeItemFactory", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/help/ZapTocView.java#L58-L75
prestodb/presto
presto-spi/src/main/java/com/facebook/presto/spi/block/BlockUtil.java
BlockUtil.compactSlice
static Slice compactSlice(Slice slice, int index, int length) { """ Returns a slice containing values in the specified range of the specified slice. If the range matches the entire slice, the input slice will be returned. Otherwise, a copy will be returned. """ if (slice.isCompact() && index == 0 && ...
java
static Slice compactSlice(Slice slice, int index, int length) { if (slice.isCompact() && index == 0 && length == slice.length()) { return slice; } return Slices.copyOf(slice, index, length); }
[ "static", "Slice", "compactSlice", "(", "Slice", "slice", ",", "int", "index", ",", "int", "length", ")", "{", "if", "(", "slice", ".", "isCompact", "(", ")", "&&", "index", "==", "0", "&&", "length", "==", "slice", ".", "length", "(", ")", ")", "{...
Returns a slice containing values in the specified range of the specified slice. If the range matches the entire slice, the input slice will be returned. Otherwise, a copy will be returned.
[ "Returns", "a", "slice", "containing", "values", "in", "the", "specified", "range", "of", "the", "specified", "slice", ".", "If", "the", "range", "matches", "the", "entire", "slice", "the", "input", "slice", "will", "be", "returned", ".", "Otherwise", "a", ...
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/block/BlockUtil.java#L131-L137
VoltDB/voltdb
src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java
JDBC4DatabaseMetaData.supportsResultSetConcurrency
@Override public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException { """ Retrieves whether this database supports the given concurrency type in combination with the given result set type. """ checkClosed(); if (type == ResultSet.TYPE_SCROLL_INSENSITIVE && c...
java
@Override public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException { checkClosed(); if (type == ResultSet.TYPE_SCROLL_INSENSITIVE && concurrency == ResultSet.CONCUR_READ_ONLY) return true; return false; }
[ "@", "Override", "public", "boolean", "supportsResultSetConcurrency", "(", "int", "type", ",", "int", "concurrency", ")", "throws", "SQLException", "{", "checkClosed", "(", ")", ";", "if", "(", "type", "==", "ResultSet", ".", "TYPE_SCROLL_INSENSITIVE", "&&", "co...
Retrieves whether this database supports the given concurrency type in combination with the given result set type.
[ "Retrieves", "whether", "this", "database", "supports", "the", "given", "concurrency", "type", "in", "combination", "with", "the", "given", "result", "set", "type", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java#L1497-L1504
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/RoaringArray.java
RoaringArray.appendCopiesAfter
protected void appendCopiesAfter(RoaringArray sa, short beforeStart) { """ Append copies of the values AFTER a specified key (may or may not be present) to end. @param sa other array @param beforeStart given key is the largest key that we won't copy """ int startLocation = sa.getIndex(beforeStart); ...
java
protected void appendCopiesAfter(RoaringArray sa, short beforeStart) { int startLocation = sa.getIndex(beforeStart); if (startLocation >= 0) { startLocation++; } else { startLocation = -startLocation - 1; } extendArray(sa.size - startLocation); for (int i = startLocation; i < sa.siz...
[ "protected", "void", "appendCopiesAfter", "(", "RoaringArray", "sa", ",", "short", "beforeStart", ")", "{", "int", "startLocation", "=", "sa", ".", "getIndex", "(", "beforeStart", ")", ";", "if", "(", "startLocation", ">=", "0", ")", "{", "startLocation", "+...
Append copies of the values AFTER a specified key (may or may not be present) to end. @param sa other array @param beforeStart given key is the largest key that we won't copy
[ "Append", "copies", "of", "the", "values", "AFTER", "a", "specified", "key", "(", "may", "or", "may", "not", "be", "present", ")", "to", "end", "." ]
train
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringArray.java#L153-L167
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
Section508Compliance.processFaultyGuiStrings
private void processFaultyGuiStrings() { """ looks for calls to set a readable string that is generated from a static constant, as these strings are not translatable. also looks for setting readable strings that are appended together. This is likely not to be internationalizable. """ FQMethod methodIn...
java
private void processFaultyGuiStrings() { FQMethod methodInfo = new FQMethod(getClassConstantOperand(), getNameConstantOperand(), getSigConstantOperand()); Integer parmIndex = displayTextMethods.get(methodInfo); if ((parmIndex != null) && (stack.getStackDepth() > parmIndex.intValue())) { ...
[ "private", "void", "processFaultyGuiStrings", "(", ")", "{", "FQMethod", "methodInfo", "=", "new", "FQMethod", "(", "getClassConstantOperand", "(", ")", ",", "getNameConstantOperand", "(", ")", ",", "getSigConstantOperand", "(", ")", ")", ";", "Integer", "parmInde...
looks for calls to set a readable string that is generated from a static constant, as these strings are not translatable. also looks for setting readable strings that are appended together. This is likely not to be internationalizable.
[ "looks", "for", "calls", "to", "set", "a", "readable", "string", "that", "is", "generated", "from", "a", "static", "constant", "as", "these", "strings", "are", "not", "translatable", ".", "also", "looks", "for", "setting", "readable", "strings", "that", "are...
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java#L343-L357
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java
RobotiumUtils.filterViewsByText
public static <T extends TextView> List<T> filterViewsByText(Iterable<T> views, String regex) { """ Filters a collection of Views and returns a list that contains only Views with text that matches a specified regular expression. @param views The collection of views to scan @param regex The text pattern to sea...
java
public static <T extends TextView> List<T> filterViewsByText(Iterable<T> views, String regex) { return filterViewsByText(views, Pattern.compile(regex)); }
[ "public", "static", "<", "T", "extends", "TextView", ">", "List", "<", "T", ">", "filterViewsByText", "(", "Iterable", "<", "T", ">", "views", ",", "String", "regex", ")", "{", "return", "filterViewsByText", "(", "views", ",", "Pattern", ".", "compile", ...
Filters a collection of Views and returns a list that contains only Views with text that matches a specified regular expression. @param views The collection of views to scan @param regex The text pattern to search for @return A list of views whose text matches the given regex
[ "Filters", "a", "collection", "of", "Views", "and", "returns", "a", "list", "that", "contains", "only", "Views", "with", "text", "that", "matches", "a", "specified", "regular", "expression", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java#L158-L160
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.accessRestriction_u2f_id_enable_POST
public void accessRestriction_u2f_id_enable_POST(Long id, String clientData, String signatureData) throws IOException { """ Enable this U2F account REST: POST /me/accessRestriction/u2f/{id}/enable @param signatureData [required] @param clientData [required] @param id [required] The Id of the restriction ...
java
public void accessRestriction_u2f_id_enable_POST(Long id, String clientData, String signatureData) throws IOException { String qPath = "/me/accessRestriction/u2f/{id}/enable"; StringBuilder sb = path(qPath, id); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "clientData", clientData); ad...
[ "public", "void", "accessRestriction_u2f_id_enable_POST", "(", "Long", "id", ",", "String", "clientData", ",", "String", "signatureData", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/me/accessRestriction/u2f/{id}/enable\"", ";", "StringBuilder", "sb", ...
Enable this U2F account REST: POST /me/accessRestriction/u2f/{id}/enable @param signatureData [required] @param clientData [required] @param id [required] The Id of the restriction
[ "Enable", "this", "U2F", "account" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L4181-L4188
zeroturnaround/zt-zip
src/main/java/org/zeroturnaround/zip/ZipEntryUtil.java
ZipEntryUtil.copyEntry
static void copyEntry(ZipEntry zipEntry, InputStream in, ZipOutputStream out) throws IOException { """ Copies a given ZIP entry to a ZIP file. @param zipEntry a ZIP entry from existing ZIP file. @param in contents of the ZIP entry. @param out target ZIP stream. """ copyEntry(zipEntry, in, out, true...
java
static void copyEntry(ZipEntry zipEntry, InputStream in, ZipOutputStream out) throws IOException { copyEntry(zipEntry, in, out, true); }
[ "static", "void", "copyEntry", "(", "ZipEntry", "zipEntry", ",", "InputStream", "in", ",", "ZipOutputStream", "out", ")", "throws", "IOException", "{", "copyEntry", "(", "zipEntry", ",", "in", ",", "out", ",", "true", ")", ";", "}" ]
Copies a given ZIP entry to a ZIP file. @param zipEntry a ZIP entry from existing ZIP file. @param in contents of the ZIP entry. @param out target ZIP stream.
[ "Copies", "a", "given", "ZIP", "entry", "to", "a", "ZIP", "file", "." ]
train
https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipEntryUtil.java#L90-L92
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java
Log.printErrLine
private void printErrLine(int pos, PrintWriter writer) { """ Print the faulty source code line and point to the error. @param pos Buffer index of the error position, must be on current line """ String line = (source == null ? null : source.getLine(pos)); if (line == null) return;...
java
private void printErrLine(int pos, PrintWriter writer) { String line = (source == null ? null : source.getLine(pos)); if (line == null) return; int col = source.getColumnNumber(pos, false); printRawLines(writer, line); for (int i = 0; i < col - 1; i++) { ...
[ "private", "void", "printErrLine", "(", "int", "pos", ",", "PrintWriter", "writer", ")", "{", "String", "line", "=", "(", "source", "==", "null", "?", "null", ":", "source", ".", "getLine", "(", "pos", ")", ")", ";", "if", "(", "line", "==", "null", ...
Print the faulty source code line and point to the error. @param pos Buffer index of the error position, must be on current line
[ "Print", "the", "faulty", "source", "code", "line", "and", "point", "to", "the", "error", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java#L556-L568
line/armeria
zipkin/src/main/java/com/linecorp/armeria/internal/tracing/SpanTags.java
SpanTags.addTags
public static void addTags(Span span, RequestLog log) { """ Adds information about the raw HTTP request, RPC request, and endpoint to the span. """ final String host = log.requestHeaders().authority(); assert host != null; span.tag("http.host", host); final StringBuilder uriBuil...
java
public static void addTags(Span span, RequestLog log) { final String host = log.requestHeaders().authority(); assert host != null; span.tag("http.host", host); final StringBuilder uriBuilder = new StringBuilder() .append(log.scheme().uriText()) .append(":/...
[ "public", "static", "void", "addTags", "(", "Span", "span", ",", "RequestLog", "log", ")", "{", "final", "String", "host", "=", "log", ".", "requestHeaders", "(", ")", ".", "authority", "(", ")", ";", "assert", "host", "!=", "null", ";", "span", ".", ...
Adds information about the raw HTTP request, RPC request, and endpoint to the span.
[ "Adds", "information", "about", "the", "raw", "HTTP", "request", "RPC", "request", "and", "endpoint", "to", "the", "span", "." ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/zipkin/src/main/java/com/linecorp/armeria/internal/tracing/SpanTags.java#L40-L74
jhunters/jprotobuf
src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java
MiniTemplatorParser.excludeTemplateRange
private void excludeTemplateRange(int tPosBegin, int tPosEnd) { """ Registers a dummy block to exclude a range within the template text. """ if (blockTabCnt > 0) { // Check whether we can extend the previous block. BlockTabRec btr = blockTab[blockTabCnt - 1]; if ...
java
private void excludeTemplateRange(int tPosBegin, int tPosEnd) { if (blockTabCnt > 0) { // Check whether we can extend the previous block. BlockTabRec btr = blockTab[blockTabCnt - 1]; if (btr.dummy && btr.tPosEnd == tPosBegin) { btr.tPosContentsEnd = tPosE...
[ "private", "void", "excludeTemplateRange", "(", "int", "tPosBegin", ",", "int", "tPosEnd", ")", "{", "if", "(", "blockTabCnt", ">", "0", ")", "{", "// Check whether we can extend the previous block.\r", "BlockTabRec", "btr", "=", "blockTab", "[", "blockTabCnt", "-",...
Registers a dummy block to exclude a range within the template text.
[ "Registers", "a", "dummy", "block", "to", "exclude", "a", "range", "within", "the", "template", "text", "." ]
train
https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1234-L1252
alkacon/opencms-core
src/org/opencms/ui/apps/dbmanager/CmsResourceTypeStatResultList.java
CmsResourceTypeStatResultList.setVerticalLayout
public void setVerticalLayout(VerticalLayout layout, boolean addAll) { """ Sets the layout.<p> @param layout to display the result in @param addAll indicates if the whole list should be added or just the last item """ if (m_results.size() > 0) { if (addAll) { for (CmsRe...
java
public void setVerticalLayout(VerticalLayout layout, boolean addAll) { if (m_results.size() > 0) { if (addAll) { for (CmsResourceTypeStatResult result : m_results) { layout.addComponent(getLayoutFromResult(result), 0); } } else { ...
[ "public", "void", "setVerticalLayout", "(", "VerticalLayout", "layout", ",", "boolean", "addAll", ")", "{", "if", "(", "m_results", ".", "size", "(", ")", ">", "0", ")", "{", "if", "(", "addAll", ")", "{", "for", "(", "CmsResourceTypeStatResult", "result",...
Sets the layout.<p> @param layout to display the result in @param addAll indicates if the whole list should be added or just the last item
[ "Sets", "the", "layout", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/dbmanager/CmsResourceTypeStatResultList.java#L132-L148
meertensinstituut/mtas
src/main/java/mtas/solr/handler/component/util/MtasSolrCollectionResult.java
MtasSolrCollectionResult.setCheck
public void setCheck(long now, SimpleOrderedMap<Object> status) throws IOException { """ Sets the check. @param now the now @param status the status @throws IOException Signals that an I/O exception has occurred. """ if (action.equals(ComponentCollection.ACTION_CHECK)) { this.now = now; ...
java
public void setCheck(long now, SimpleOrderedMap<Object> status) throws IOException { if (action.equals(ComponentCollection.ACTION_CHECK)) { this.now = now; this.status = status; } else { throw new IOException("not allowed with action '" + action + "'"); } }
[ "public", "void", "setCheck", "(", "long", "now", ",", "SimpleOrderedMap", "<", "Object", ">", "status", ")", "throws", "IOException", "{", "if", "(", "action", ".", "equals", "(", "ComponentCollection", ".", "ACTION_CHECK", ")", ")", "{", "this", ".", "no...
Sets the check. @param now the now @param status the status @throws IOException Signals that an I/O exception has occurred.
[ "Sets", "the", "check", "." ]
train
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrCollectionResult.java#L111-L119
eFaps/eFaps-Kernel
src/main/java/org/efaps/db/transaction/ConnectionResource.java
ConnectionResource.freeResource
@Override protected void freeResource() throws EFapsException { """ Frees the resource and gives this connection resource back to the context object. @throws EFapsException on error """ try { if (!getConnection().isClosed()) { getConnection().close(); ...
java
@Override protected void freeResource() throws EFapsException { try { if (!getConnection().isClosed()) { getConnection().close(); } } catch (final SQLException e) { throw new EFapsException("Could not close", e); } }
[ "@", "Override", "protected", "void", "freeResource", "(", ")", "throws", "EFapsException", "{", "try", "{", "if", "(", "!", "getConnection", "(", ")", ".", "isClosed", "(", ")", ")", "{", "getConnection", "(", ")", ".", "close", "(", ")", ";", "}", ...
Frees the resource and gives this connection resource back to the context object. @throws EFapsException on error
[ "Frees", "the", "resource", "and", "gives", "this", "connection", "resource", "back", "to", "the", "context", "object", "." ]
train
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/transaction/ConnectionResource.java#L83-L94
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/TransitionsConfig.java
TransitionsConfig.exportTiles
private static void exportTiles(Xml nodeTransition, Collection<TileRef> tilesRef) { """ Export all tiles for the transition. @param nodeTransition The transition node (must not be <code>null</code>). @param tilesRef The transition tiles ref (must not be <code>null</code>). """ for (final TileRef t...
java
private static void exportTiles(Xml nodeTransition, Collection<TileRef> tilesRef) { for (final TileRef tileRef : tilesRef) { final Xml nodeTileRef = TileConfig.exports(tileRef); nodeTransition.add(nodeTileRef); } }
[ "private", "static", "void", "exportTiles", "(", "Xml", "nodeTransition", ",", "Collection", "<", "TileRef", ">", "tilesRef", ")", "{", "for", "(", "final", "TileRef", "tileRef", ":", "tilesRef", ")", "{", "final", "Xml", "nodeTileRef", "=", "TileConfig", "....
Export all tiles for the transition. @param nodeTransition The transition node (must not be <code>null</code>). @param tilesRef The transition tiles ref (must not be <code>null</code>).
[ "Export", "all", "tiles", "for", "the", "transition", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/TransitionsConfig.java#L164-L171
michael-rapp/AndroidBottomSheet
library/src/main/java/de/mrapp/android/bottomsheet/BottomSheet.java
BottomSheet.addItem
public final void addItem(final int id, @NonNull final CharSequence title) { """ Adds a new item to the bottom sheet. @param id The id of the item, which should be added, as an {@link Integer} value. The id must be at least 0 @param title The title of the item, which should be added, as an instance of the t...
java
public final void addItem(final int id, @NonNull final CharSequence title) { Item item = new Item(id, title); adapter.add(item); adaptGridViewHeight(); }
[ "public", "final", "void", "addItem", "(", "final", "int", "id", ",", "@", "NonNull", "final", "CharSequence", "title", ")", "{", "Item", "item", "=", "new", "Item", "(", "id", ",", "title", ")", ";", "adapter", ".", "add", "(", "item", ")", ";", "...
Adds a new item to the bottom sheet. @param id The id of the item, which should be added, as an {@link Integer} value. The id must be at least 0 @param title The title of the item, which should be added, as an instance of the type {@link CharSequence}. The title may neither be null, nor empty
[ "Adds", "a", "new", "item", "to", "the", "bottom", "sheet", "." ]
train
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/library/src/main/java/de/mrapp/android/bottomsheet/BottomSheet.java#L1982-L1986
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/time/DateUtils.java
DateUtils.setHours
public static Date setHours(final Date date, final int amount) { """ Sets the hours field to a date returning a new object. Hours range from 0-23. The original {@code Date} is unchanged. @param date the date, not null @param amount the amount to set @return a new {@code Date} set with the specified value...
java
public static Date setHours(final Date date, final int amount) { return set(date, Calendar.HOUR_OF_DAY, amount); }
[ "public", "static", "Date", "setHours", "(", "final", "Date", "date", ",", "final", "int", "amount", ")", "{", "return", "set", "(", "date", ",", "Calendar", ".", "HOUR_OF_DAY", ",", "amount", ")", ";", "}" ]
Sets the hours field to a date returning a new object. Hours range from 0-23. The original {@code Date} is unchanged. @param date the date, not null @param amount the amount to set @return a new {@code Date} set with the specified value @throws IllegalArgumentException if the date is null @since 2.4
[ "Sets", "the", "hours", "field", "to", "a", "date", "returning", "a", "new", "object", ".", "Hours", "range", "from", "0", "-", "23", ".", "The", "original", "{", "@code", "Date", "}", "is", "unchanged", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L586-L588
fabric8io/docker-maven-plugin
src/main/java/io/fabric8/maven/docker/util/VolumeBindingUtil.java
VolumeBindingUtil.resolveRelativeVolumeBindings
public static void resolveRelativeVolumeBindings(File baseDir, RunVolumeConfiguration volumeConfiguration) { """ Iterates over each {@link RunVolumeConfiguration#getBind() binding} in the {@code volumeConfiguration}, and resolves any relative paths in the binding strings using {@link #resolveRelativeVolumeBinding...
java
public static void resolveRelativeVolumeBindings(File baseDir, RunVolumeConfiguration volumeConfiguration) { List<String> bindings = volumeConfiguration.getBind(); if (bindings == null || bindings.isEmpty()) { return; } for (int i = 0; i < bindings.size(); i++) { ...
[ "public", "static", "void", "resolveRelativeVolumeBindings", "(", "File", "baseDir", ",", "RunVolumeConfiguration", "volumeConfiguration", ")", "{", "List", "<", "String", ">", "bindings", "=", "volumeConfiguration", ".", "getBind", "(", ")", ";", "if", "(", "bind...
Iterates over each {@link RunVolumeConfiguration#getBind() binding} in the {@code volumeConfiguration}, and resolves any relative paths in the binding strings using {@link #resolveRelativeVolumeBinding(File, String)}. The {@code volumeConfiguration} is modified in place, with any relative paths replaced with absolute p...
[ "Iterates", "over", "each", "{", "@link", "RunVolumeConfiguration#getBind", "()", "binding", "}", "in", "the", "{", "@code", "volumeConfiguration", "}", "and", "resolves", "any", "relative", "paths", "in", "the", "binding", "strings", "using", "{", "@link", "#re...
train
https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/VolumeBindingUtil.java#L207-L217
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/randomprojection/RPUtils.java
RPUtils.computeDistance
public static double computeDistance(String function,INDArray x,INDArray y) { """ Compute the distance between 2 vectors given a function name. Valid function names: euclidean: euclidean distance cosinedistance: cosine distance cosine similarity: cosine similarity manhattan: manhattan distance jaccard: jacca...
java
public static double computeDistance(String function,INDArray x,INDArray y) { return computeDistance(function,x,y,Nd4j.scalar(0.0)); }
[ "public", "static", "double", "computeDistance", "(", "String", "function", ",", "INDArray", "x", ",", "INDArray", "y", ")", "{", "return", "computeDistance", "(", "function", ",", "x", ",", "y", ",", "Nd4j", ".", "scalar", "(", "0.0", ")", ")", ";", "...
Compute the distance between 2 vectors given a function name. Valid function names: euclidean: euclidean distance cosinedistance: cosine distance cosine similarity: cosine similarity manhattan: manhattan distance jaccard: jaccard distance hamming: hamming distance @param function the function to use (default euclidean ...
[ "Compute", "the", "distance", "between", "2", "vectors", "given", "a", "function", "name", ".", "Valid", "function", "names", ":", "euclidean", ":", "euclidean", "distance", "cosinedistance", ":", "cosine", "distance", "cosine", "similarity", ":", "cosine", "sim...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/randomprojection/RPUtils.java#L367-L369
Azure/azure-sdk-for-java
notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java
NotificationHubsInner.listKeys
public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { """ Gets the Primary and Secondary ConnectionStrings to the NotificationHub. @param resourceGroupName The name of the resource group. @param namespaceName The namesp...
java
public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); }
[ "public", "ResourceListKeysInner", "listKeys", "(", "String", "resourceGroupName", ",", "String", "namespaceName", ",", "String", "notificationHubName", ",", "String", "authorizationRuleName", ")", "{", "return", "listKeysWithServiceResponseAsync", "(", "resourceGroupName", ...
Gets the Primary and Secondary ConnectionStrings to the NotificationHub. @param resourceGroupName The name of the resource group. @param namespaceName The namespace name. @param notificationHubName The notification hub name. @param authorizationRuleName The connection string of the NotificationHub for the specified au...
[ "Gets", "the", "Primary", "and", "Secondary", "ConnectionStrings", "to", "the", "NotificationHub", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L1464-L1466