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
threerings/nenya
core/src/main/java/com/threerings/miso/client/MisoScenePanel.java
MisoScenePanel.handleObjectPressed
protected void handleObjectPressed (final SceneObject scobj, int mx, int my) { """ Called when the user presses the mouse button over an object. """ String action = scobj.info.action; final ObjectActionHandler handler = ObjectActionHandler.lookup(action); // if there's no handler, just...
java
protected void handleObjectPressed (final SceneObject scobj, int mx, int my) { String action = scobj.info.action; final ObjectActionHandler handler = ObjectActionHandler.lookup(action); // if there's no handler, just fire the action immediately if (handler == null) { fir...
[ "protected", "void", "handleObjectPressed", "(", "final", "SceneObject", "scobj", ",", "int", "mx", ",", "int", "my", ")", "{", "String", "action", "=", "scobj", ".", "info", ".", "action", ";", "final", "ObjectActionHandler", "handler", "=", "ObjectActionHand...
Called when the user presses the mouse button over an object.
[ "Called", "when", "the", "user", "presses", "the", "mouse", "button", "over", "an", "object", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L443-L485
netheosgithub/pcs_api
java/src/main/java/net/netheos/pcsapi/utils/PcsUtils.java
PcsUtils.ensureContentTypeIsJson
public static void ensureContentTypeIsJson( CResponse response, boolean isRetriable ) throws CStorageException { """ Extract content type from response headers, and ensure it is application/json or text/javascript. If no content-type is defined, or content-type is not json, raises a CHttpError. @pa...
java
public static void ensureContentTypeIsJson( CResponse response, boolean isRetriable ) throws CStorageException { String contentType = response.getContentType(); CStorageException ex = null; if ( contentType == null ) { ex = buildCStorageException( response, "Undefine...
[ "public", "static", "void", "ensureContentTypeIsJson", "(", "CResponse", "response", ",", "boolean", "isRetriable", ")", "throws", "CStorageException", "{", "String", "contentType", "=", "response", ".", "getContentType", "(", ")", ";", "CStorageException", "ex", "=...
Extract content type from response headers, and ensure it is application/json or text/javascript. If no content-type is defined, or content-type is not json, raises a CHttpError. @param response the response to check @param isRetriable if True, raised exception is wrapped into a CRetriable
[ "Extract", "content", "type", "from", "response", "headers", "and", "ensure", "it", "is", "application", "/", "json", "or", "text", "/", "javascript", ".", "If", "no", "content", "-", "type", "is", "defined", "or", "content", "-", "type", "is", "not", "j...
train
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/utils/PcsUtils.java#L59-L78
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java
AppsImpl.updatePublishSettingsAsync
public Observable<OperationStatus> updatePublishSettingsAsync(UUID appId, PublishSettingUpdateObject publishSettingUpdateObject) { """ Updates the application publish settings. @param appId The application ID. @param publishSettingUpdateObject An object containing the new publish application settings. @throws...
java
public Observable<OperationStatus> updatePublishSettingsAsync(UUID appId, PublishSettingUpdateObject publishSettingUpdateObject) { return updatePublishSettingsWithServiceResponseAsync(appId, publishSettingUpdateObject).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() { @Override ...
[ "public", "Observable", "<", "OperationStatus", ">", "updatePublishSettingsAsync", "(", "UUID", "appId", ",", "PublishSettingUpdateObject", "publishSettingUpdateObject", ")", "{", "return", "updatePublishSettingsWithServiceResponseAsync", "(", "appId", ",", "publishSettingUpdat...
Updates the application publish settings. @param appId The application ID. @param publishSettingUpdateObject An object containing the new publish application settings. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the OperationStatus object
[ "Updates", "the", "application", "publish", "settings", "." ]
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/AppsImpl.java#L1564-L1571
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/APIClient.java
APIClient.multipleQueries
public JSONObject multipleQueries(List<IndexQuery> queries, RequestOptions requestOptions) throws AlgoliaException { """ This method allows to query multiple indexes with one API call @param requestOptions Options to pass to this request """ return multipleQueries(queries, "none", requestOptions); }
java
public JSONObject multipleQueries(List<IndexQuery> queries, RequestOptions requestOptions) throws AlgoliaException { return multipleQueries(queries, "none", requestOptions); }
[ "public", "JSONObject", "multipleQueries", "(", "List", "<", "IndexQuery", ">", "queries", ",", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "return", "multipleQueries", "(", "queries", ",", "\"none\"", ",", "requestOptions", ")", ";",...
This method allows to query multiple indexes with one API call @param requestOptions Options to pass to this request
[ "This", "method", "allows", "to", "query", "multiple", "indexes", "with", "one", "API", "call" ]
train
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L1264-L1266
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ObjectUtils.java
ObjectUtils.isEqualList
public static <T> Boolean isEqualList(List<T> list1, List<T> list2) { """ Method based on {@link org.apache.commons.collections.ListUtils#isEqualList(java.util.Collection, java.util.Collection)} rewrote for performance reasons. <p> Basically employs {@link ObjectUtils#equals(Object)} instead of {@link #equals(...
java
public static <T> Boolean isEqualList(List<T> list1, List<T> list2) { if (list1 == list2) { return Boolean.TRUE; } else if ((list1 == null) || (list2 == null) || (list1.size() != list2.size())) { return Boolean.FALSE; } final Iterator<T> itr1 = list1.iterator();...
[ "public", "static", "<", "T", ">", "Boolean", "isEqualList", "(", "List", "<", "T", ">", "list1", ",", "List", "<", "T", ">", "list2", ")", "{", "if", "(", "list1", "==", "list2", ")", "{", "return", "Boolean", ".", "TRUE", ";", "}", "else", "if"...
Method based on {@link org.apache.commons.collections.ListUtils#isEqualList(java.util.Collection, java.util.Collection)} rewrote for performance reasons. <p> Basically employs {@link ObjectUtils#equals(Object)} instead of {@link #equals(Object)} since the first one checks identity before calling <code>equals</code>. @...
[ "Method", "based", "on", "{", "@link", "org", ".", "apache", ".", "commons", ".", "collections", ".", "ListUtils#isEqualList", "(", "java", ".", "util", ".", "Collection", "java", ".", "util", ".", "Collection", ")", "}", "rewrote", "for", "performance", "...
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ObjectUtils.java#L185-L208
pip-services3-java/pip-services3-commons-java
src/org/pipservices3/commons/reflect/RecursiveObjectWriter.java
RecursiveObjectWriter.setProperty
public static void setProperty(Object obj, String name, Object value) { """ Recursively sets value of object and its subobjects property specified by its name. The object can be a user defined object, map or array. The property name correspondently must be object property, map key or array index. If the pr...
java
public static void setProperty(Object obj, String name, Object value) { if (obj == null || name == null) return; String[] names = name.split("\\."); if (names == null || names.length == 0) return; performSetProperty(obj, names, 0, value); }
[ "public", "static", "void", "setProperty", "(", "Object", "obj", ",", "String", "name", ",", "Object", "value", ")", "{", "if", "(", "obj", "==", "null", "||", "name", "==", "null", ")", "return", ";", "String", "[", "]", "names", "=", "name", ".", ...
Recursively sets value of object and its subobjects property specified by its name. The object can be a user defined object, map or array. The property name correspondently must be object property, map key or array index. If the property does not exist or introspection fails this method doesn't do anything and doesn'...
[ "Recursively", "sets", "value", "of", "object", "and", "its", "subobjects", "property", "specified", "by", "its", "name", "." ]
train
https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/reflect/RecursiveObjectWriter.java#L52-L61
VoltDB/voltdb
third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java
HelpFormatter.printWrapped
public void printWrapped(PrintWriter pw, int width, String text) { """ Print the specified text to the specified PrintWriter. @param pw The printWriter to write the help to @param width The number of characters to display per line @param text The text to be written to the PrintWriter """ printWrap...
java
public void printWrapped(PrintWriter pw, int width, String text) { printWrapped(pw, width, 0, text); }
[ "public", "void", "printWrapped", "(", "PrintWriter", "pw", ",", "int", "width", ",", "String", "text", ")", "{", "printWrapped", "(", "pw", ",", "width", ",", "0", ",", "text", ")", ";", "}" ]
Print the specified text to the specified PrintWriter. @param pw The printWriter to write the help to @param width The number of characters to display per line @param text The text to be written to the PrintWriter
[ "Print", "the", "specified", "text", "to", "the", "specified", "PrintWriter", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java#L754-L757
dkpro/dkpro-statistics
dkpro-statistics-correlation/src/main/java/org/dkpro/statistics/correlation/PearsonCorrelation.java
PearsonCorrelation.computeCorrelation
public static double computeCorrelation(final double[] list1, final double[] list2) { """ Computes the correlation between two datasets. @param list1 The first dataset as a double array. @param list2 The second dataset as a double array. @return The correlation between the two datasets. """ // R = {...
java
public static double computeCorrelation(final double[] list1, final double[] list2) { // R = { N* (Sum(x*y) - Sum(x)*Sum(y)} / sqrt( { N* Sum( x**2 ) - Sum( x )**2} ) * sqrt ( {N // * Sum( y**2 ) - Sum( y )**2} ) double sumXY = 0; double sumX = 0; double sumY = 0; dou...
[ "public", "static", "double", "computeCorrelation", "(", "final", "double", "[", "]", "list1", ",", "final", "double", "[", "]", "list2", ")", "{", "// R = { N* (Sum(x*y) - Sum(x)*Sum(y)} / sqrt( { N* Sum( x**2 ) - Sum( x )**2} ) * sqrt ( {N", "// * Sum( y**2 ) - Sum( y )**2} )...
Computes the correlation between two datasets. @param list1 The first dataset as a double array. @param list2 The second dataset as a double array. @return The correlation between the two datasets.
[ "Computes", "the", "correlation", "between", "two", "datasets", "." ]
train
https://github.com/dkpro/dkpro-statistics/blob/0b0e93dc49223984964411cbc6df420ba796a8cb/dkpro-statistics-correlation/src/main/java/org/dkpro/statistics/correlation/PearsonCorrelation.java#L69-L104
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Waiter.java
Waiter.waitForText
public <T extends TextView> T waitForText(Class<T> classToFilterBy, String text, int expectedMinimumNumberOfMatches, long timeout, boolean scroll) { """ Waits for a text to be shown. @param classToFilterBy the class to filter by @param text the text that needs to be shown, specified as a regular expression @p...
java
public <T extends TextView> T waitForText(Class<T> classToFilterBy, String text, int expectedMinimumNumberOfMatches, long timeout, boolean scroll) { return waitForText(classToFilterBy, text, expectedMinimumNumberOfMatches, timeout, scroll, false, true); }
[ "public", "<", "T", "extends", "TextView", ">", "T", "waitForText", "(", "Class", "<", "T", ">", "classToFilterBy", ",", "String", "text", ",", "int", "expectedMinimumNumberOfMatches", ",", "long", "timeout", ",", "boolean", "scroll", ")", "{", "return", "wa...
Waits for a text to be shown. @param classToFilterBy the class to filter by @param text the text that needs to be shown, specified as a regular expression @param expectedMinimumNumberOfMatches the minimum number of matches of text that must be shown. {@code 0} means any number of matches @param timeout the amount of t...
[ "Waits", "for", "a", "text", "to", "be", "shown", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L582-L584
allure-framework/allure1
allure-java-aspects/src/main/java/ru/yandex/qatools/allure/aspects/AllureAspectUtils.java
AllureAspectUtils.cutBegin
public static String cutBegin(String data, int maxLength) { """ Cut first (length-maxLength) characters and replace it with "..." """ if (data.length() > maxLength) { return "..." + data.substring(data.length() - maxLength, data.length()); } else { return data; }...
java
public static String cutBegin(String data, int maxLength) { if (data.length() > maxLength) { return "..." + data.substring(data.length() - maxLength, data.length()); } else { return data; } }
[ "public", "static", "String", "cutBegin", "(", "String", "data", ",", "int", "maxLength", ")", "{", "if", "(", "data", ".", "length", "(", ")", ">", "maxLength", ")", "{", "return", "\"...\"", "+", "data", ".", "substring", "(", "data", ".", "length", ...
Cut first (length-maxLength) characters and replace it with "..."
[ "Cut", "first", "(", "length", "-", "maxLength", ")", "characters", "and", "replace", "it", "with", "..." ]
train
https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-aspects/src/main/java/ru/yandex/qatools/allure/aspects/AllureAspectUtils.java#L101-L107
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java
WTable.updateBeanValueForRenderedRows
private void updateBeanValueForRenderedRows() { """ Updates the bean using the table data model's {@link TableModel#setValueAt(Object, List, int)} method. This method only updates the data for the currently set row ids. """ WTableRowRenderer rowRenderer = (WTableRowRenderer) repeater.getRepeatedComponent();...
java
private void updateBeanValueForRenderedRows() { WTableRowRenderer rowRenderer = (WTableRowRenderer) repeater.getRepeatedComponent(); TableModel model = getTableModel(); int index = 0; List<RowIdWrapper> wrappers = repeater.getBeanList(); int columnCount = getColumnCount(); for (RowIdWrapper wrapper : wr...
[ "private", "void", "updateBeanValueForRenderedRows", "(", ")", "{", "WTableRowRenderer", "rowRenderer", "=", "(", "WTableRowRenderer", ")", "repeater", ".", "getRepeatedComponent", "(", ")", ";", "TableModel", "model", "=", "getTableModel", "(", ")", ";", "int", "...
Updates the bean using the table data model's {@link TableModel#setValueAt(Object, List, int)} method. This method only updates the data for the currently set row ids.
[ "Updates", "the", "bean", "using", "the", "table", "data", "model", "s", "{" ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java#L400-L429
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysInner.java
VpnGatewaysInner.beginCreateOrUpdate
public VpnGatewayInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { """ Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. @param resourceGroupName The resource group name of the VpnGateway. @param gatewayName Th...
java
public VpnGatewayInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).toBlocking().single().body(); }
[ "public", "VpnGatewayInner", "beginCreateOrUpdate", "(", "String", "resourceGroupName", ",", "String", "gatewayName", ",", "VpnGatewayInner", "vpnGatewayParameters", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "gatewayName",...
Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. @param resourceGroupName The resource group name of the VpnGateway. @param gatewayName The name of the gateway. @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. @throws IllegalArgument...
[ "Creates", "a", "virtual", "wan", "vpn", "gateway", "if", "it", "doesn", "t", "exist", "else", "updates", "the", "existing", "gateway", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysInner.java#L286-L288
Azure/azure-sdk-for-java
eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java
TopicsInner.beginUpdateAsync
public Observable<TopicInner> beginUpdateAsync(String resourceGroupName, String topicName, Map<String, String> tags) { """ Update a topic. Asynchronously updates a topic with the specified parameters. @param resourceGroupName The name of the resource group within the user's subscription. @param topicName Name...
java
public Observable<TopicInner> beginUpdateAsync(String resourceGroupName, String topicName, Map<String, String> tags) { return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, tags).map(new Func1<ServiceResponse<TopicInner>, TopicInner>() { @Override public TopicInner cal...
[ "public", "Observable", "<", "TopicInner", ">", "beginUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "topicName", ",", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "return", "beginUpdateWithServiceResponseAsync", "(", "resourceGroupN...
Update a topic. Asynchronously updates a topic with the specified parameters. @param resourceGroupName The name of the resource group within the user's subscription. @param topicName Name of the topic @param tags Tags of the resource @throws IllegalArgumentException thrown if parameters fail the validation @return the...
[ "Update", "a", "topic", ".", "Asynchronously", "updates", "a", "topic", "with", "the", "specified", "parameters", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java#L832-L839
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.metaClass
public static MetaClass metaClass (Class self, Closure closure) { """ Sets/updates the metaclass for a given class to a closure. @param self the class whose metaclass we wish to update @param closure the closure representing the new metaclass @return the new metaclass value @throws GroovyRuntimeException if ...
java
public static MetaClass metaClass (Class self, Closure closure){ MetaClassRegistry metaClassRegistry = GroovySystem.getMetaClassRegistry(); MetaClass mc = metaClassRegistry.getMetaClass(self); if (mc instanceof ExpandoMetaClass) { ((ExpandoMetaClass) mc).define(closure); ...
[ "public", "static", "MetaClass", "metaClass", "(", "Class", "self", ",", "Closure", "closure", ")", "{", "MetaClassRegistry", "metaClassRegistry", "=", "GroovySystem", ".", "getMetaClassRegistry", "(", ")", ";", "MetaClass", "mc", "=", "metaClassRegistry", ".", "g...
Sets/updates the metaclass for a given class to a closure. @param self the class whose metaclass we wish to update @param closure the closure representing the new metaclass @return the new metaclass value @throws GroovyRuntimeException if the metaclass can't be set for this class @since 1.6.0
[ "Sets", "/", "updates", "the", "metaclass", "for", "a", "given", "class", "to", "a", "closure", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L17338-L17374
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/repo/jdbc/LoggingDataSource.java
LoggingDataSource.create
public static DataSource create(DataSource ds, Log log) { """ Wraps the given DataSource which logs to the given log. If debug logging is disabled, the original DataSource is returned. """ if (ds == null) { throw new IllegalArgumentException(); } if (log == null) { ...
java
public static DataSource create(DataSource ds, Log log) { if (ds == null) { throw new IllegalArgumentException(); } if (log == null) { log = LogFactory.getLog(LoggingDataSource.class); } if (!log.isDebugEnabled()) { return ds; ...
[ "public", "static", "DataSource", "create", "(", "DataSource", "ds", ",", "Log", "log", ")", "{", "if", "(", "ds", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "if", "(", "log", "==", "null", ")", "{", "log"...
Wraps the given DataSource which logs to the given log. If debug logging is disabled, the original DataSource is returned.
[ "Wraps", "the", "given", "DataSource", "which", "logs", "to", "the", "given", "log", ".", "If", "debug", "logging", "is", "disabled", "the", "original", "DataSource", "is", "returned", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/jdbc/LoggingDataSource.java#L48-L59
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/internal/workspace/api/VoiceApi.java
VoiceApi.initiateTransfer
public ApiSuccessResponse initiateTransfer(String id, InitiateTransferData initiateTransferData) throws ApiException { """ Initiate a transfer Initiate a two-step transfer by placing the first call on hold and dialing the destination number (step 1). After initiating the transfer, you can use [/voice/calls/{id}/c...
java
public ApiSuccessResponse initiateTransfer(String id, InitiateTransferData initiateTransferData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = initiateTransferWithHttpInfo(id, initiateTransferData); return resp.getData(); }
[ "public", "ApiSuccessResponse", "initiateTransfer", "(", "String", "id", ",", "InitiateTransferData", "initiateTransferData", ")", "throws", "ApiException", "{", "ApiResponse", "<", "ApiSuccessResponse", ">", "resp", "=", "initiateTransferWithHttpInfo", "(", "id", ",", ...
Initiate a transfer Initiate a two-step transfer by placing the first call on hold and dialing the destination number (step 1). After initiating the transfer, you can use [/voice/calls/{id}/complete-transfer](/reference/workspace/Voice/index.html#completeTransfer) to complete the transfer (step 2). @param id The connec...
[ "Initiate", "a", "transfer", "Initiate", "a", "two", "-", "step", "transfer", "by", "placing", "the", "first", "call", "on", "hold", "and", "dialing", "the", "destination", "number", "(", "step", "1", ")", ".", "After", "initiating", "the", "transfer", "yo...
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/VoiceApi.java#L1969-L1972
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveDataset.java
HiveDataset.parseLogicalDbAndTable
@VisibleForTesting protected static DbAndTable parseLogicalDbAndTable(String datasetNamePattern, DbAndTable dbAndTable, String logicalDbToken, String logicalTableToken) { """ * Parse logical Database and Table name from a given DbAndTable object. Eg. Dataset Name Pattern : prod_$LOGICAL_DB_lin...
java
@VisibleForTesting protected static DbAndTable parseLogicalDbAndTable(String datasetNamePattern, DbAndTable dbAndTable, String logicalDbToken, String logicalTableToken) { Preconditions.checkArgument(StringUtils.isNotBlank(datasetNamePattern), "Dataset name pattern must not be empty."); List<String> dat...
[ "@", "VisibleForTesting", "protected", "static", "DbAndTable", "parseLogicalDbAndTable", "(", "String", "datasetNamePattern", ",", "DbAndTable", "dbAndTable", ",", "String", "logicalDbToken", ",", "String", "logicalTableToken", ")", "{", "Preconditions", ".", "checkArgume...
* Parse logical Database and Table name from a given DbAndTable object. Eg. Dataset Name Pattern : prod_$LOGICAL_DB_linkedin.prod_$LOGICAL_TABLE_linkedin Source DB and Table : prod_dbName_linkedin.prod_tableName_linkedin Logical DB Token : $LOGICAL_DB Logical Table Token : $LOGICA...
[ "*", "Parse", "logical", "Database", "and", "Table", "name", "from", "a", "given", "DbAndTable", "object", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveDataset.java#L208-L224
reactor/reactor-netty
src/main/java/reactor/netty/http/client/HttpClient.java
HttpClient.followRedirect
public final HttpClient followRedirect(BiPredicate<HttpClientRequest, HttpClientResponse> predicate) { """ Enables auto-redirect support if the passed {@link java.util.function.Predicate} matches. <p> note the passed {@link HttpClientRequest} and {@link HttpClientResponse} should be considered read-only and th...
java
public final HttpClient followRedirect(BiPredicate<HttpClientRequest, HttpClientResponse> predicate) { Objects.requireNonNull(predicate, "predicate"); return tcpConfiguration(tcp -> tcp.bootstrap( b -> HttpClientConfiguration.followRedirectPredicate(b, predicate))); }
[ "public", "final", "HttpClient", "followRedirect", "(", "BiPredicate", "<", "HttpClientRequest", ",", "HttpClientResponse", ">", "predicate", ")", "{", "Objects", ".", "requireNonNull", "(", "predicate", ",", "\"predicate\"", ")", ";", "return", "tcpConfiguration", ...
Enables auto-redirect support if the passed {@link java.util.function.Predicate} matches. <p> note the passed {@link HttpClientRequest} and {@link HttpClientResponse} should be considered read-only and the implement SHOULD NOT consume or write the request/response in this predicate. @param predicate that returns true ...
[ "Enables", "auto", "-", "redirect", "support", "if", "the", "passed", "{", "@link", "java", ".", "util", ".", "function", ".", "Predicate", "}", "matches", ".", "<p", ">", "note", "the", "passed", "{", "@link", "HttpClientRequest", "}", "and", "{", "@lin...
train
https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/client/HttpClient.java#L669-L673
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java
CodecUtils.checkJBCrypt
public static boolean checkJBCrypt(String data, String hash) { """ Checks a given data against a JBCrypted hash @param data The cleartext data @param hash The JBCrypt hashed value @return True if it is a match, false otherwise """ Objects.requireNonNull(data, Required.DATA.toString()); Obj...
java
public static boolean checkJBCrypt(String data, String hash) { Objects.requireNonNull(data, Required.DATA.toString()); Objects.requireNonNull(hash, Required.HASH.toString()); return BCrypt.checkpw(data, hash); }
[ "public", "static", "boolean", "checkJBCrypt", "(", "String", "data", ",", "String", "hash", ")", "{", "Objects", ".", "requireNonNull", "(", "data", ",", "Required", ".", "DATA", ".", "toString", "(", ")", ")", ";", "Objects", ".", "requireNonNull", "(", ...
Checks a given data against a JBCrypted hash @param data The cleartext data @param hash The JBCrypt hashed value @return True if it is a match, false otherwise
[ "Checks", "a", "given", "data", "against", "a", "JBCrypted", "hash" ]
train
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java#L71-L76
Deep-Symmetry/beat-link
src/main/java/org/deepsymmetry/beatlink/Util.java
Util.validateHeader
public static PacketType validateHeader(DatagramPacket packet, int port) { """ Check to see whether a packet starts with the standard header bytes, followed by a known byte identifying it. If so, return the kind of packet that has been recognized. @param packet a packet that has just been received @param port...
java
public static PacketType validateHeader(DatagramPacket packet, int port) { byte[] data = packet.getData(); if (data.length < PACKET_TYPE_OFFSET) { logger.warn("Packet is too short to be a Pro DJ Link packet; must be at least " + PACKET_TYPE_OFFSET + " bytes long, was onl...
[ "public", "static", "PacketType", "validateHeader", "(", "DatagramPacket", "packet", ",", "int", "port", ")", "{", "byte", "[", "]", "data", "=", "packet", ".", "getData", "(", ")", ";", "if", "(", "data", ".", "length", "<", "PACKET_TYPE_OFFSET", ")", "...
Check to see whether a packet starts with the standard header bytes, followed by a known byte identifying it. If so, return the kind of packet that has been recognized. @param packet a packet that has just been received @param port the port on which the packet has been received @return the type of packet that was rec...
[ "Check", "to", "see", "whether", "a", "packet", "starts", "with", "the", "standard", "header", "bytes", "followed", "by", "a", "known", "byte", "identifying", "it", ".", "If", "so", "return", "the", "kind", "of", "packet", "that", "has", "been", "recognize...
train
https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L194-L221
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java
BytecodeUtils.asList
public static Expression asList(Iterable<? extends Expression> items) { """ Returns an expression that returns a new {@link ArrayList} containing all the given items. """ final ImmutableList<Expression> copy = ImmutableList.copyOf(items); if (copy.isEmpty()) { return MethodRef.IMMUTABLE_LIST_OF.g...
java
public static Expression asList(Iterable<? extends Expression> items) { final ImmutableList<Expression> copy = ImmutableList.copyOf(items); if (copy.isEmpty()) { return MethodRef.IMMUTABLE_LIST_OF.get(0).invoke(); } // Note, we cannot necessarily use ImmutableList for anything besides the empty li...
[ "public", "static", "Expression", "asList", "(", "Iterable", "<", "?", "extends", "Expression", ">", "items", ")", "{", "final", "ImmutableList", "<", "Expression", ">", "copy", "=", "ImmutableList", ".", "copyOf", "(", "items", ")", ";", "if", "(", "copy"...
Returns an expression that returns a new {@link ArrayList} containing all the given items.
[ "Returns", "an", "expression", "that", "returns", "a", "new", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L794-L814
alkacon/opencms-core
src/org/opencms/workplace/explorer/CmsExplorerTypeSettings.java
CmsExplorerTypeSettings.isEditable
public boolean isEditable(CmsObject cms, CmsResource resource) { """ Checks if the current user has write permissions on the given resource.<p> @param cms the current cms context @param resource the resource to check @return <code>true</code> if the current user has write permissions on the given resource ...
java
public boolean isEditable(CmsObject cms, CmsResource resource) { if (!cms.getRequestContext().getCurrentProject().isOnlineProject() && OpenCms.getRoleManager().hasRole(cms, CmsRole.ROOT_ADMIN)) { return true; } // determine if this resource type is editable for the curre...
[ "public", "boolean", "isEditable", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ")", "{", "if", "(", "!", "cms", ".", "getRequestContext", "(", ")", ".", "getCurrentProject", "(", ")", ".", "isOnlineProject", "(", ")", "&&", "OpenCms", ".", "ge...
Checks if the current user has write permissions on the given resource.<p> @param cms the current cms context @param resource the resource to check @return <code>true</code> if the current user has write permissions on the given resource
[ "Checks", "if", "the", "current", "user", "has", "write", "permissions", "on", "the", "given", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/explorer/CmsExplorerTypeSettings.java#L579-L588
autermann/yaml
src/main/java/com/github/autermann/yaml/nodes/YamlMappingNode.java
YamlMappingNode.put
public T put(String key, YamlNode value) { """ Adds the specified {@code key}/{@code value} pair to this mapping. @param key the key @param value the value @return {@code this} """ return put(getNodeFactory().textNode(key), value); }
java
public T put(String key, YamlNode value) { return put(getNodeFactory().textNode(key), value); }
[ "public", "T", "put", "(", "String", "key", ",", "YamlNode", "value", ")", "{", "return", "put", "(", "getNodeFactory", "(", ")", ".", "textNode", "(", "key", ")", ",", "value", ")", ";", "}" ]
Adds the specified {@code key}/{@code value} pair to this mapping. @param key the key @param value the value @return {@code this}
[ "Adds", "the", "specified", "{", "@code", "key", "}", "/", "{", "@code", "value", "}", "pair", "to", "this", "mapping", "." ]
train
https://github.com/autermann/yaml/blob/5f8ab03e4fec3a2abe72c03561cdaa3a3936634d/src/main/java/com/github/autermann/yaml/nodes/YamlMappingNode.java#L62-L64
apache/flink
flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java
GlobalConfiguration.loadConfiguration
public static Configuration loadConfiguration(final String configDir, @Nullable final Configuration dynamicProperties) { """ Loads the configuration files from the specified directory. If the dynamic properties configuration is not null, then it is added to the loaded configuration. @param configDir directory ...
java
public static Configuration loadConfiguration(final String configDir, @Nullable final Configuration dynamicProperties) { if (configDir == null) { throw new IllegalArgumentException("Given configuration directory is null, cannot load configuration"); } final File confDirFile = new File(configDir); if (!(con...
[ "public", "static", "Configuration", "loadConfiguration", "(", "final", "String", "configDir", ",", "@", "Nullable", "final", "Configuration", "dynamicProperties", ")", "{", "if", "(", "configDir", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", ...
Loads the configuration files from the specified directory. If the dynamic properties configuration is not null, then it is added to the loaded configuration. @param configDir directory to load the configuration from @param dynamicProperties configuration file containing the dynamic properties. Null if none. @return T...
[ "Loads", "the", "configuration", "files", "from", "the", "specified", "directory", ".", "If", "the", "dynamic", "properties", "configuration", "is", "not", "null", "then", "it", "is", "added", "to", "the", "loaded", "configuration", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java#L93-L122
googleads/googleads-java-lib
examples/admanager_axis/src/main/java/admanager/axis/v201811/ratecardservice/GetRateCardsByStatement.java
GetRateCardsByStatement.runExample
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException { """ Runs the example. @param adManagerServices the services factory. @param session the session. @throws ApiException if the API request failed with one or more service errors. @throws ...
java
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException { // Get the RateCardService. RateCardServiceInterface rateCardService = adManagerServices.get(session, RateCardServiceInterface.class); // Create a statement to get all rate ca...
[ "public", "static", "void", "runExample", "(", "AdManagerServices", "adManagerServices", ",", "AdManagerSession", "session", ")", "throws", "RemoteException", "{", "// Get the RateCardService.", "RateCardServiceInterface", "rateCardService", "=", "adManagerServices", ".", "ge...
Runs the example. @param adManagerServices the services factory. @param session the session. @throws ApiException if the API request failed with one or more service errors. @throws RemoteException if the API request failed due to other errors.
[ "Runs", "the", "example", "." ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201811/ratecardservice/GetRateCardsByStatement.java#L51-L85
amaembo/streamex
src/main/java/one/util/streamex/StreamEx.java
StreamEx.ifEmpty
@SafeVarargs public final StreamEx<T> ifEmpty(T... values) { """ Returns a stream which contents is the same as this stream, except the case when this stream is empty. In this case its contents is replaced with supplied values. <p> This is a <a href="package-summary.html#StreamOps">quasi-intermediate ope...
java
@SafeVarargs public final StreamEx<T> ifEmpty(T... values) { return ifEmpty(null, Spliterators.spliterator(values, Spliterator.ORDERED)); }
[ "@", "SafeVarargs", "public", "final", "StreamEx", "<", "T", ">", "ifEmpty", "(", "T", "...", "values", ")", "{", "return", "ifEmpty", "(", "null", ",", "Spliterators", ".", "spliterator", "(", "values", ",", "Spliterator", ".", "ORDERED", ")", ")", ";",...
Returns a stream which contents is the same as this stream, except the case when this stream is empty. In this case its contents is replaced with supplied values. <p> This is a <a href="package-summary.html#StreamOps">quasi-intermediate operation</a>. @param values values to replace the contents of this stream if thi...
[ "Returns", "a", "stream", "which", "contents", "is", "the", "same", "as", "this", "stream", "except", "the", "case", "when", "this", "stream", "is", "empty", ".", "In", "this", "case", "its", "contents", "is", "replaced", "with", "supplied", "values", "." ...
train
https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L1387-L1390
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/Channel.java
Channel.queryByChaincode
public Collection<ProposalResponse> queryByChaincode(QueryByChaincodeRequest queryByChaincodeRequest, Collection<Peer> peers) throws InvalidArgumentException, ProposalException { """ Send Query proposal @param queryByChaincodeRequest @param peers @return responses from peers. @throws InvalidArgumentException...
java
public Collection<ProposalResponse> queryByChaincode(QueryByChaincodeRequest queryByChaincodeRequest, Collection<Peer> peers) throws InvalidArgumentException, ProposalException { return sendProposal(queryByChaincodeRequest, peers); }
[ "public", "Collection", "<", "ProposalResponse", ">", "queryByChaincode", "(", "QueryByChaincodeRequest", "queryByChaincodeRequest", ",", "Collection", "<", "Peer", ">", "peers", ")", "throws", "InvalidArgumentException", ",", "ProposalException", "{", "return", "sendProp...
Send Query proposal @param queryByChaincodeRequest @param peers @return responses from peers. @throws InvalidArgumentException @throws ProposalException
[ "Send", "Query", "proposal" ]
train
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L4382-L4384
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/X509CRL.java
X509CRL.verify
public void verify(PublicKey key, Provider sigProvider) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, SignatureException { """ Verifies that this CRL was signed using the private key that corresponds to the given public key. This method uses the signature verification engine...
java
public void verify(PublicKey key, Provider sigProvider) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, SignatureException { // BEGIN Android-changed // TODO(user): was X509CRLImpl.verify(this, key, sigProvider); // As the javadoc says, this "default implement...
[ "public", "void", "verify", "(", "PublicKey", "key", ",", "Provider", "sigProvider", ")", "throws", "CRLException", ",", "NoSuchAlgorithmException", ",", "InvalidKeyException", ",", "SignatureException", "{", "// BEGIN Android-changed", "// TODO(user): was X509CRLImpl.verify(...
Verifies that this CRL was signed using the private key that corresponds to the given public key. This method uses the signature verification engine supplied by the given provider. Note that the specified Provider object does not have to be registered in the provider list. This method was added to version 1.8 of the J...
[ "Verifies", "that", "this", "CRL", "was", "signed", "using", "the", "private", "key", "that", "corresponds", "to", "the", "given", "public", "key", ".", "This", "method", "uses", "the", "signature", "verification", "engine", "supplied", "by", "the", "given", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/X509CRL.java#L241-L254
intellimate/Izou
src/main/java/org/intellimate/izou/threadpool/TrackingExecutorService.java
TrackingExecutorService.createTrackingExecutorService
public static TrackingExecutorService createTrackingExecutorService(ExecutorService executorService, Identifiable identifiable) throws IllegalIDException { """ creates a new ExecutorService @param executorService the ExecutorService to use un...
java
public static TrackingExecutorService createTrackingExecutorService(ExecutorService executorService, Identifiable identifiable) throws IllegalIDException { return new TrackingExecutorService(executorService, identifiable); }
[ "public", "static", "TrackingExecutorService", "createTrackingExecutorService", "(", "ExecutorService", "executorService", ",", "Identifiable", "identifiable", ")", "throws", "IllegalIDException", "{", "return", "new", "TrackingExecutorService", "(", "executorService", ",", "...
creates a new ExecutorService @param executorService the ExecutorService to use under the hood @param identifiable the identifiable to associate each submitted thread with @return an instance of TrackingExecutorService @throws IllegalIDException not yet implemented
[ "creates", "a", "new", "ExecutorService" ]
train
https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/threadpool/TrackingExecutorService.java#L40-L43
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/AddTorrentParams.java
AddTorrentParams.dhtNodes
public void dhtNodes(List<Pair<String, Integer>> value) { """ A list of hostname and port pairs, representing DHT nodes to be added to the session (if DHT is enabled). The hostname may be an IP address. @param value the list of DHT nodes """ string_int_pair_vector v = new string_int_pair_vector(); ...
java
public void dhtNodes(List<Pair<String, Integer>> value) { string_int_pair_vector v = new string_int_pair_vector(); for (Pair<String, Integer> p : value) { v.push_back(p.to_string_int_pair()); } p.set_dht_nodes(v); }
[ "public", "void", "dhtNodes", "(", "List", "<", "Pair", "<", "String", ",", "Integer", ">", ">", "value", ")", "{", "string_int_pair_vector", "v", "=", "new", "string_int_pair_vector", "(", ")", ";", "for", "(", "Pair", "<", "String", ",", "Integer", ">"...
A list of hostname and port pairs, representing DHT nodes to be added to the session (if DHT is enabled). The hostname may be an IP address. @param value the list of DHT nodes
[ "A", "list", "of", "hostname", "and", "port", "pairs", "representing", "DHT", "nodes", "to", "be", "added", "to", "the", "session", "(", "if", "DHT", "is", "enabled", ")", ".", "The", "hostname", "may", "be", "an", "IP", "address", "." ]
train
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/AddTorrentParams.java#L185-L193
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java
LdapConnection.searchByOperationalAttribute
public SearchResult searchByOperationalAttribute(String dn, String filter, List<String> inEntityTypes, List<String> propNames, String oprAttribute) throws WIMException { """ Search using operational attribute specified in the parameter. @param dn The DN to search on @param filter The LDAP filter for the search...
java
public SearchResult searchByOperationalAttribute(String dn, String filter, List<String> inEntityTypes, List<String> propNames, String oprAttribute) throws WIMException { String inEntityType = null; List<String> supportedProps = propNames; if (inEntityTypes != null && inEntityTypes.size() > 0) { ...
[ "public", "SearchResult", "searchByOperationalAttribute", "(", "String", "dn", ",", "String", "filter", ",", "List", "<", "String", ">", "inEntityTypes", ",", "List", "<", "String", ">", "propNames", ",", "String", "oprAttribute", ")", "throws", "WIMException", ...
Search using operational attribute specified in the parameter. @param dn The DN to search on @param filter The LDAP filter for the search. @param inEntityTypes The entity types to search for. @param propNames The property names to return. @param oprAttribute The operational attribute. @return The search results or nul...
[ "Search", "using", "operational", "attribute", "specified", "in", "the", "parameter", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java#L2066-L2094
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java
ImageMiscOps.insertBand
public static void insertBand( GrayF32 input, int band , InterleavedF32 output) { """ Inserts a single band into a multi-band image overwriting the original band @param input Single band image @param band Which band the image is to be inserted into @param output The multi-band image which the input image is t...
java
public static void insertBand( GrayF32 input, int band , InterleavedF32 output) { final int numBands = output.numBands; for (int y = 0; y < input.height; y++) { int indexIn = input.getStartIndex() + y * input.getStride(); int indexOut = output.getStartIndex() + y * output.getStride() + band; int end = ind...
[ "public", "static", "void", "insertBand", "(", "GrayF32", "input", ",", "int", "band", ",", "InterleavedF32", "output", ")", "{", "final", "int", "numBands", "=", "output", ".", "numBands", ";", "for", "(", "int", "y", "=", "0", ";", "y", "<", "input",...
Inserts a single band into a multi-band image overwriting the original band @param input Single band image @param band Which band the image is to be inserted into @param output The multi-band image which the input image is to be inserted into
[ "Inserts", "a", "single", "band", "into", "a", "multi", "-", "band", "image", "overwriting", "the", "original", "band" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L2328-L2339
Netflix/Hystrix
hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java
HystrixCommandExecutionHook.onComplete
@Deprecated public <T> T onComplete(HystrixCommand<T> commandInstance, T response) { """ DEPRECATED: Change usages of this to {@link #onEmit} if you want to write a hook that handles each emitted command value or to {@link #onSuccess} if you want to write a hook that handles success of the command Invoked ...
java
@Deprecated public <T> T onComplete(HystrixCommand<T> commandInstance, T response) { // pass-thru by default return response; }
[ "@", "Deprecated", "public", "<", "T", ">", "T", "onComplete", "(", "HystrixCommand", "<", "T", ">", "commandInstance", ",", "T", "response", ")", "{", "// pass-thru by default", "return", "response", ";", "}" ]
DEPRECATED: Change usages of this to {@link #onEmit} if you want to write a hook that handles each emitted command value or to {@link #onSuccess} if you want to write a hook that handles success of the command Invoked after completion of {@link HystrixCommand} execution that results in a response. <p> The response can...
[ "DEPRECATED", ":", "Change", "usages", "of", "this", "to", "{", "@link", "#onEmit", "}", "if", "you", "want", "to", "write", "a", "hook", "that", "handles", "each", "emitted", "command", "value", "or", "to", "{", "@link", "#onSuccess", "}", "if", "you", ...
train
https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java#L447-L451
census-instrumentation/opencensus-java
api/src/main/java/io/opencensus/metrics/export/Metric.java
Metric.createInternal
private static Metric createInternal( MetricDescriptor metricDescriptor, List<TimeSeries> timeSeriesList) { """ Creates a {@link Metric}. @param metricDescriptor the {@link MetricDescriptor}. @param timeSeriesList the {@link TimeSeries} list for this metric. @return a {@code Metric}. @since 0.17 ""...
java
private static Metric createInternal( MetricDescriptor metricDescriptor, List<TimeSeries> timeSeriesList) { Utils.checkNotNull(metricDescriptor, "metricDescriptor"); checkTypeMatch(metricDescriptor.getType(), timeSeriesList); return new AutoValue_Metric(metricDescriptor, timeSeriesList); }
[ "private", "static", "Metric", "createInternal", "(", "MetricDescriptor", "metricDescriptor", ",", "List", "<", "TimeSeries", ">", "timeSeriesList", ")", "{", "Utils", ".", "checkNotNull", "(", "metricDescriptor", ",", "\"metricDescriptor\"", ")", ";", "checkTypeMatch...
Creates a {@link Metric}. @param metricDescriptor the {@link MetricDescriptor}. @param timeSeriesList the {@link TimeSeries} list for this metric. @return a {@code Metric}. @since 0.17
[ "Creates", "a", "{", "@link", "Metric", "}", "." ]
train
https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/metrics/export/Metric.java#L80-L85
virgo47/javasimon
core/src/main/java/org/javasimon/ManagerConfiguration.java
ManagerConfiguration.setProperty
private void setProperty(Callback callback, String property, String value) { """ Sets the callback property. @param callback callback object @param property name of the property @param value value of the property """ try { if (value != null) { SimonBeanUtils.getInstance().setProperty(callback, pr...
java
private void setProperty(Callback callback, String property, String value) { try { if (value != null) { SimonBeanUtils.getInstance().setProperty(callback, property, value); } else { callback.getClass().getMethod(setterName(property)).invoke(callback); } } catch (NoSuchMethodException | InvocationTa...
[ "private", "void", "setProperty", "(", "Callback", "callback", ",", "String", "property", ",", "String", "value", ")", "{", "try", "{", "if", "(", "value", "!=", "null", ")", "{", "SimonBeanUtils", ".", "getInstance", "(", ")", ".", "setProperty", "(", "...
Sets the callback property. @param callback callback object @param property name of the property @param value value of the property
[ "Sets", "the", "callback", "property", "." ]
train
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/ManagerConfiguration.java#L200-L210
Ordinastie/MalisisCore
src/main/java/net/malisis/core/util/EnumFacingUtils.java
EnumFacingUtils.getRealSide
public static EnumFacing getRealSide(IBlockState state, EnumFacing side) { """ Gets the real side of a rotated block. @param state the state @param side the side @return the real side """ if (state == null || side == null) return side; EnumFacing direction = DirectionalComponent.getDirection(state...
java
public static EnumFacing getRealSide(IBlockState state, EnumFacing side) { if (state == null || side == null) return side; EnumFacing direction = DirectionalComponent.getDirection(state); if (direction == EnumFacing.SOUTH) return side; if (direction == EnumFacing.DOWN) return side.rotateAround(Axis....
[ "public", "static", "EnumFacing", "getRealSide", "(", "IBlockState", "state", ",", "EnumFacing", "side", ")", "{", "if", "(", "state", "==", "null", "||", "side", "==", "null", ")", "return", "side", ";", "EnumFacing", "direction", "=", "DirectionalComponent",...
Gets the real side of a rotated block. @param state the state @param side the side @return the real side
[ "Gets", "the", "real", "side", "of", "a", "rotated", "block", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/EnumFacingUtils.java#L99-L129
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.addStickyFooterItemAtPosition
public void addStickyFooterItemAtPosition(@NonNull IDrawerItem drawerItem, int position) { """ Add a footerDrawerItem at a specific position @param drawerItem @param position """ if (mDrawerBuilder.mStickyDrawerItems == null) { mDrawerBuilder.mStickyDrawerItems = new ArrayList<>(); ...
java
public void addStickyFooterItemAtPosition(@NonNull IDrawerItem drawerItem, int position) { if (mDrawerBuilder.mStickyDrawerItems == null) { mDrawerBuilder.mStickyDrawerItems = new ArrayList<>(); } mDrawerBuilder.mStickyDrawerItems.add(position, drawerItem); DrawerUtils.rebui...
[ "public", "void", "addStickyFooterItemAtPosition", "(", "@", "NonNull", "IDrawerItem", "drawerItem", ",", "int", "position", ")", "{", "if", "(", "mDrawerBuilder", ".", "mStickyDrawerItems", "==", "null", ")", "{", "mDrawerBuilder", ".", "mStickyDrawerItems", "=", ...
Add a footerDrawerItem at a specific position @param drawerItem @param position
[ "Add", "a", "footerDrawerItem", "at", "a", "specific", "position" ]
train
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L874-L881
syphr42/prom
src/main/java/org/syphr/prom/PropertiesManager.java
PropertiesManager.saveProperty
public void saveProperty(T property, Object value) throws IOException { """ Save the given property using an object's string representation. See {@link #saveProperty(Object, String)} for additional details. @param property the property whose value is being saved @param value the value to save @throws IOExc...
java
public void saveProperty(T property, Object value) throws IOException { saveProperty(property, value.toString()); }
[ "public", "void", "saveProperty", "(", "T", "property", ",", "Object", "value", ")", "throws", "IOException", "{", "saveProperty", "(", "property", ",", "value", ".", "toString", "(", ")", ")", ";", "}" ]
Save the given property using an object's string representation. See {@link #saveProperty(Object, String)} for additional details. @param property the property whose value is being saved @param value the value to save @throws IOException if there is an error while attempting to write the property to the file
[ "Save", "the", "given", "property", "using", "an", "object", "s", "string", "representation", ".", "See", "{", "@link", "#saveProperty", "(", "Object", "String", ")", "}", "for", "additional", "details", "." ]
train
https://github.com/syphr42/prom/blob/074d67c4ebb3afb0b163fcb0bc4826ee577ac803/src/main/java/org/syphr/prom/PropertiesManager.java#L987-L990
finmath/finmath-lib
src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaption.java
BermudanSwaption.getValue
@Override public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException { """ This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime. Note: For a lattice this is often the value c...
java
@Override public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException { return (RandomVariable) getValues(evaluationTime, model).get("value"); }
[ "@", "Override", "public", "RandomVariable", "getValue", "(", "double", "evaluationTime", ",", "LIBORModelMonteCarloSimulationModel", "model", ")", "throws", "CalculationException", "{", "return", "(", "RandomVariable", ")", "getValues", "(", "evaluationTime", ",", "mod...
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime. Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time. Cashflows prior evaluationTime...
[ "This", "method", "returns", "the", "value", "random", "variable", "of", "the", "product", "within", "the", "specified", "model", "evaluated", "at", "a", "given", "evalutationTime", ".", "Note", ":", "For", "a", "lattice", "this", "is", "often", "the", "valu...
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaption.java#L168-L171
nostra13/Android-Universal-Image-Loader
library/src/main/java/com/nostra13/universalimageloader/core/DefaultConfigurationFactory.java
DefaultConfigurationFactory.createDiskCache
public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator, long diskCacheSize, int diskCacheFileCount) { """ Creates default implementation of {@link DiskCache} depends on incoming parameters """ File reserveCacheDir = createReserveDiskCacheDir(context); if (d...
java
public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator, long diskCacheSize, int diskCacheFileCount) { File reserveCacheDir = createReserveDiskCacheDir(context); if (diskCacheSize > 0 || diskCacheFileCount > 0) { File individualCacheDir = StorageUtils.getIndividua...
[ "public", "static", "DiskCache", "createDiskCache", "(", "Context", "context", ",", "FileNameGenerator", "diskCacheFileNameGenerator", ",", "long", "diskCacheSize", ",", "int", "diskCacheFileCount", ")", "{", "File", "reserveCacheDir", "=", "createReserveDiskCacheDir", "(...
Creates default implementation of {@link DiskCache} depends on incoming parameters
[ "Creates", "default", "implementation", "of", "{" ]
train
https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/DefaultConfigurationFactory.java#L83-L98
jqm4gwt/jqm4gwt
library/src/main/java/com/sksamuel/jqm4gwt/JQMPage.java
JQMPage.prepareTransparentOpened
private static void prepareTransparentOpened(boolean add, String transparentPageId) { """ Needed mostly in case of page container surrounded by external panels, so these panels could be synchronously disabled/enabled when "modal" dialog shown by jqm application. <br> from afterShow till beforeHide. """ ...
java
private static void prepareTransparentOpened(boolean add, String transparentPageId) { Element p = Document.get().getBody(); if (p != null) { String s = JQM4GWT_DLG_TRANSPARENT_OPENED_PREFIX + transparentPageId; if (add) { p.addClassName(JQM4GWT_DLG_TRANSPARENT_OPE...
[ "private", "static", "void", "prepareTransparentOpened", "(", "boolean", "add", ",", "String", "transparentPageId", ")", "{", "Element", "p", "=", "Document", ".", "get", "(", ")", ".", "getBody", "(", ")", ";", "if", "(", "p", "!=", "null", ")", "{", ...
Needed mostly in case of page container surrounded by external panels, so these panels could be synchronously disabled/enabled when "modal" dialog shown by jqm application. <br> from afterShow till beforeHide.
[ "Needed", "mostly", "in", "case", "of", "page", "container", "surrounded", "by", "external", "panels", "so", "these", "panels", "could", "be", "synchronously", "disabled", "/", "enabled", "when", "modal", "dialog", "shown", "by", "jqm", "application", ".", "<b...
train
https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/JQMPage.java#L498-L512
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/subdoc/AsyncLookupInBuilder.java
AsyncLookupInBuilder.existsIn
private Observable<DocumentFragment<Lookup>> existsIn(final String id, final LookupSpec spec, final long timeout, final TimeUnit timeUnit) { """ Helper method to actually perform the subdoc exists operation. """ return Observable.defer(new Func0<Observable<DocumentFragment<Lookup>>>() { ...
java
private Observable<DocumentFragment<Lookup>> existsIn(final String id, final LookupSpec spec, final long timeout, final TimeUnit timeUnit) { return Observable.defer(new Func0<Observable<DocumentFragment<Lookup>>>() { @Override public Observable<DocumentFragment<Lookup>> call() { ...
[ "private", "Observable", "<", "DocumentFragment", "<", "Lookup", ">", ">", "existsIn", "(", "final", "String", "id", ",", "final", "LookupSpec", "spec", ",", "final", "long", "timeout", ",", "final", "TimeUnit", "timeUnit", ")", "{", "return", "Observable", ...
Helper method to actually perform the subdoc exists operation.
[ "Helper", "method", "to", "actually", "perform", "the", "subdoc", "exists", "operation", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/subdoc/AsyncLookupInBuilder.java#L669-L716
TheCoder4eu/BootsFaces-OSP
src/main/java/net/bootsfaces/component/dateTimePicker/DateTimePickerRenderer.java
DateTimePickerRenderer.getValueAsString
public static String getValueAsString(Object value, FacesContext ctx, DateTimePicker dtp) { """ Yields the value which is displayed in the input field of the date picker. @param ctx @param dtp @return """ // Else we use our own converter if(value == null) { return null; } Locale sloc = BsfUtils.s...
java
public static String getValueAsString(Object value, FacesContext ctx, DateTimePicker dtp) { // Else we use our own converter if(value == null) { return null; } Locale sloc = BsfUtils.selectLocale(ctx.getViewRoot().getLocale(), dtp.getLocale(), dtp); String javaFormatString = BsfUtils.selectJavaDateTimeForm...
[ "public", "static", "String", "getValueAsString", "(", "Object", "value", ",", "FacesContext", "ctx", ",", "DateTimePicker", "dtp", ")", "{", "// Else we use our own converter", "if", "(", "value", "==", "null", ")", "{", "return", "null", ";", "}", "Locale", ...
Yields the value which is displayed in the input field of the date picker. @param ctx @param dtp @return
[ "Yields", "the", "value", "which", "is", "displayed", "in", "the", "input", "field", "of", "the", "date", "picker", "." ]
train
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/dateTimePicker/DateTimePickerRenderer.java#L86-L95
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java
TieredBlockStore.checkTempBlockOwnedBySession
private void checkTempBlockOwnedBySession(long sessionId, long blockId) throws BlockDoesNotExistException, BlockAlreadyExistsException, InvalidWorkerStateException { """ Checks if block id is a temporary block and owned by session id. This method must be enclosed by {@link #mMetadataLock}. @param session...
java
private void checkTempBlockOwnedBySession(long sessionId, long blockId) throws BlockDoesNotExistException, BlockAlreadyExistsException, InvalidWorkerStateException { if (mMetaManager.hasBlockMeta(blockId)) { throw new BlockAlreadyExistsException(ExceptionMessage.TEMP_BLOCK_ID_COMMITTED, blockId); } ...
[ "private", "void", "checkTempBlockOwnedBySession", "(", "long", "sessionId", ",", "long", "blockId", ")", "throws", "BlockDoesNotExistException", ",", "BlockAlreadyExistsException", ",", "InvalidWorkerStateException", "{", "if", "(", "mMetaManager", ".", "hasBlockMeta", "...
Checks if block id is a temporary block and owned by session id. This method must be enclosed by {@link #mMetadataLock}. @param sessionId the id of session @param blockId the id of block @throws BlockDoesNotExistException if block id can not be found in temporary blocks @throws BlockAlreadyExistsException if block id ...
[ "Checks", "if", "block", "id", "is", "a", "temporary", "block", "and", "owned", "by", "session", "id", ".", "This", "method", "must", "be", "enclosed", "by", "{", "@link", "#mMetadataLock", "}", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java#L533-L544
liyiorg/weixin-popular
src/main/java/weixin/popular/api/MediaAPI.java
MediaAPI.mediaGetJssdk
public static MediaGetResult mediaGetJssdk(String access_token,String media_id) { """ 高清语音素材获取接口 <br> 公众号可以使用本接口获取从JSSDK的uploadVoice接口上传的临时语音素材,格式为speex,16K采样率。<br> 该音频比上文的临时素材获取接口(格式为amr,8K采样率)更加清晰,适合用作语音识别等对音质要求较高的业务。 @since 2.8.6 @param access_token access_token @param media_id media_id @return MediaGetRe...
java
public static MediaGetResult mediaGetJssdk(String access_token,String media_id){ HttpUriRequest httpUriRequest = RequestBuilder.get() .setUri(BASE_URI + "/cgi-bin/media/get/jssdk") .addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token)) .addParameter("media_id", media_id) .build(); retu...
[ "public", "static", "MediaGetResult", "mediaGetJssdk", "(", "String", "access_token", ",", "String", "media_id", ")", "{", "HttpUriRequest", "httpUriRequest", "=", "RequestBuilder", ".", "get", "(", ")", ".", "setUri", "(", "BASE_URI", "+", "\"/cgi-bin/media/get/jss...
高清语音素材获取接口 <br> 公众号可以使用本接口获取从JSSDK的uploadVoice接口上传的临时语音素材,格式为speex,16K采样率。<br> 该音频比上文的临时素材获取接口(格式为amr,8K采样率)更加清晰,适合用作语音识别等对音质要求较高的业务。 @since 2.8.6 @param access_token access_token @param media_id media_id @return MediaGetResult <br> 如果speex音频格式不符合业务需求,开发者可在获取后,再自行于本地对该语音素材进行转码。<br> 转码请使用speex的官方解码库 http://speex.org/dow...
[ "高清语音素材获取接口", "<br", ">", "公众号可以使用本接口获取从JSSDK的uploadVoice接口上传的临时语音素材,格式为speex,16K采样率。<br", ">", "该音频比上文的临时素材获取接口(格式为amr,8K采样率)更加清晰,适合用作语音识别等对音质要求较高的业务。" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MediaAPI.java#L184-L191
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java
HttpOutboundServiceContextImpl.sendRawRequestBody
@Override public VirtualConnection sendRawRequestBody(WsByteBuffer[] body, InterChannelCallback callback, boolean bForce) throws MessageSentException { """ Send an array of raw body buffers out asynchronously. This method will avoid any body modifications, such as compression or chunked-encoding. <p> This w...
java
@Override public VirtualConnection sendRawRequestBody(WsByteBuffer[] body, InterChannelCallback callback, boolean bForce) throws MessageSentException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "sendRawRequestBody(async)"); } setRawBody(true)...
[ "@", "Override", "public", "VirtualConnection", "sendRawRequestBody", "(", "WsByteBuffer", "[", "]", "body", ",", "InterChannelCallback", "callback", ",", "boolean", "bForce", ")", "throws", "MessageSentException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingE...
Send an array of raw body buffers out asynchronously. This method will avoid any body modifications, such as compression or chunked-encoding. <p> This will return null if the data is being written asynchronously and the provided callback will be used when finished. However, if the write could complete automatically, th...
[ "Send", "an", "array", "of", "raw", "body", "buffers", "out", "asynchronously", ".", "This", "method", "will", "avoid", "any", "body", "modifications", "such", "as", "compression", "or", "chunked", "-", "encoding", ".", "<p", ">", "This", "will", "return", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java#L1091-L1102
rometools/rome
rome-modules/src/main/java/com/rometools/modules/mediarss/io/MediaModuleGenerator.java
MediaModuleGenerator.generateSubTitles
private void generateSubTitles(final Metadata m, final Element e) { """ Generation of subTitle tags. @param m source @param e element to attach new element to """ for (final SubTitle subTitle : m.getSubTitles()) { final Element subTitleElement = new Element("subTitle", NS); ...
java
private void generateSubTitles(final Metadata m, final Element e) { for (final SubTitle subTitle : m.getSubTitles()) { final Element subTitleElement = new Element("subTitle", NS); addNotNullAttribute(subTitleElement, "type", subTitle.getType()); addNotNullAttribute(subTitleEl...
[ "private", "void", "generateSubTitles", "(", "final", "Metadata", "m", ",", "final", "Element", "e", ")", "{", "for", "(", "final", "SubTitle", "subTitle", ":", "m", ".", "getSubTitles", "(", ")", ")", "{", "final", "Element", "subTitleElement", "=", "new"...
Generation of subTitle tags. @param m source @param e element to attach new element to
[ "Generation", "of", "subTitle", "tags", "." ]
train
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/mediarss/io/MediaModuleGenerator.java#L431-L441
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java
SVGPath.ellipticalArc
public SVGPath ellipticalArc(double rx, double ry, double ar, double la, double sp, double x, double y) { """ Elliptical arc curve to the given coordinates. @param rx x radius @param ry y radius @param ar x-axis-rotation @param la large arc flag, if angle &gt;= 180 deg @param sp sweep flag, if arc will be d...
java
public SVGPath ellipticalArc(double rx, double ry, double ar, double la, double sp, double x, double y) { return append(PATH_ARC).append(rx).append(ry).append(ar).append(la).append(sp).append(x).append(y); }
[ "public", "SVGPath", "ellipticalArc", "(", "double", "rx", ",", "double", "ry", ",", "double", "ar", ",", "double", "la", ",", "double", "sp", ",", "double", "x", ",", "double", "y", ")", "{", "return", "append", "(", "PATH_ARC", ")", ".", "append", ...
Elliptical arc curve to the given coordinates. @param rx x radius @param ry y radius @param ar x-axis-rotation @param la large arc flag, if angle &gt;= 180 deg @param sp sweep flag, if arc will be drawn in positive-angle direction @param x new coordinates @param y new coordinates
[ "Elliptical", "arc", "curve", "to", "the", "given", "coordinates", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L549-L551
json-path/JsonPath
json-path/src/main/java/com/jayway/jsonpath/internal/path/CompiledPath.java
CompiledPath.invertScannerFunctionRelationship
private RootPathToken invertScannerFunctionRelationship(final RootPathToken path) { """ In the event the writer of the path referenced a function at the tail end of a scanner, augment the query such that the root node is the function and the parameter to the function is the scanner. This way we maintain relati...
java
private RootPathToken invertScannerFunctionRelationship(final RootPathToken path) { if (path.isFunctionPath() && path.next() instanceof ScanPathToken) { PathToken token = path; PathToken prior = null; while (null != (token = token.next()) && !(token instanceof FunctionPathTok...
[ "private", "RootPathToken", "invertScannerFunctionRelationship", "(", "final", "RootPathToken", "path", ")", "{", "if", "(", "path", ".", "isFunctionPath", "(", ")", "&&", "path", ".", "next", "(", ")", "instanceof", "ScanPathToken", ")", "{", "PathToken", "toke...
In the event the writer of the path referenced a function at the tail end of a scanner, augment the query such that the root node is the function and the parameter to the function is the scanner. This way we maintain relative sanity in the path expression, functions either evaluate scalar values or arrays, they're no...
[ "In", "the", "event", "the", "writer", "of", "the", "path", "referenced", "a", "function", "at", "the", "tail", "end", "of", "a", "scanner", "augment", "the", "query", "such", "that", "the", "root", "node", "is", "the", "function", "and", "the", "paramet...
train
https://github.com/json-path/JsonPath/blob/5a09489c3252b74bbf81992aadb3073be59c04f9/json-path/src/main/java/com/jayway/jsonpath/internal/path/CompiledPath.java#L62-L88
jamesagnew/hapi-fhir
restful-server-example/src/main/java/ca/uhn/example/provider/PatientResourceProvider.java
PatientResourceProvider.addNewVersion
private void addNewVersion(Patient thePatient, Long theId) { """ Stores a new version of the patient in memory so that it can be retrieved later. @param thePatient The patient resource to store @param theId The ID of the patient to retrieve """ InstantDt publishedDate; if (!myIdToPatientVersions.cont...
java
private void addNewVersion(Patient thePatient, Long theId) { InstantDt publishedDate; if (!myIdToPatientVersions.containsKey(theId)) { myIdToPatientVersions.put(theId, new LinkedList<Patient>()); publishedDate = InstantDt.withCurrentTime(); } else { Patient currentPatitne = myIdToPatientVersions.get(theI...
[ "private", "void", "addNewVersion", "(", "Patient", "thePatient", ",", "Long", "theId", ")", "{", "InstantDt", "publishedDate", ";", "if", "(", "!", "myIdToPatientVersions", ".", "containsKey", "(", "theId", ")", ")", "{", "myIdToPatientVersions", ".", "put", ...
Stores a new version of the patient in memory so that it can be retrieved later. @param thePatient The patient resource to store @param theId The ID of the patient to retrieve
[ "Stores", "a", "new", "version", "of", "the", "patient", "in", "memory", "so", "that", "it", "can", "be", "retrieved", "later", "." ]
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/restful-server-example/src/main/java/ca/uhn/example/provider/PatientResourceProvider.java#L80-L107
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java
CacheConfigurationProviderImpl.handleCollection
@SuppressWarnings("unchecked") private boolean handleCollection( final ConfigurationContext ctx, final Class<?> _type, final Object cfg, final ParsedConfiguration _parsedCfg) { """ Get appropriate collection e.g. {@link Cache2kConfiguration#getListeners()} create the bean and add it to the colle...
java
@SuppressWarnings("unchecked") private boolean handleCollection( final ConfigurationContext ctx, final Class<?> _type, final Object cfg, final ParsedConfiguration _parsedCfg) { String _containerName = _parsedCfg.getContainer(); Method m; try { m = cfg.getClass().getMethod(constructGe...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "boolean", "handleCollection", "(", "final", "ConfigurationContext", "ctx", ",", "final", "Class", "<", "?", ">", "_type", ",", "final", "Object", "cfg", ",", "final", "ParsedConfiguration", "_parsedCf...
Get appropriate collection e.g. {@link Cache2kConfiguration#getListeners()} create the bean and add it to the collection. @return True, if applied, false if there is no getter for a collection.
[ "Get", "appropriate", "collection", "e", ".", "g", ".", "{", "@link", "Cache2kConfiguration#getListeners", "()", "}", "create", "the", "bean", "and", "add", "it", "to", "the", "collection", "." ]
train
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java#L343-L372
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/type/TypeUtils.java
TypeUtils.isAssignableFrom
private static boolean isAssignableFrom(Type from, GenericArrayType to) { """ Private helper function that performs some assignability checks for the provided GenericArrayType. """ Type toGenericComponentType = to.getGenericComponentType(); if (toGenericComponentType instanceof ParameterizedType) { Typ...
java
private static boolean isAssignableFrom(Type from, GenericArrayType to) { Type toGenericComponentType = to.getGenericComponentType(); if (toGenericComponentType instanceof ParameterizedType) { Type t = from; if (from instanceof GenericArrayType) { t = ((GenericArrayType) from).getGenericComponentType(); ...
[ "private", "static", "boolean", "isAssignableFrom", "(", "Type", "from", ",", "GenericArrayType", "to", ")", "{", "Type", "toGenericComponentType", "=", "to", ".", "getGenericComponentType", "(", ")", ";", "if", "(", "toGenericComponentType", "instanceof", "Paramete...
Private helper function that performs some assignability checks for the provided GenericArrayType.
[ "Private", "helper", "function", "that", "performs", "some", "assignability", "checks", "for", "the", "provided", "GenericArrayType", "." ]
train
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/type/TypeUtils.java#L185-L205
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java
TrainingsImpl.queryPredictionsAsync
public Observable<PredictionQueryResult> queryPredictionsAsync(UUID projectId, PredictionQueryToken query) { """ Get images that were sent to your prediction endpoint. @param projectId The project id @param query Parameters used to query the predictions. Limited to combining 2 tags @throws IllegalArgumentExce...
java
public Observable<PredictionQueryResult> queryPredictionsAsync(UUID projectId, PredictionQueryToken query) { return queryPredictionsWithServiceResponseAsync(projectId, query).map(new Func1<ServiceResponse<PredictionQueryResult>, PredictionQueryResult>() { @Override public PredictionQuery...
[ "public", "Observable", "<", "PredictionQueryResult", ">", "queryPredictionsAsync", "(", "UUID", "projectId", ",", "PredictionQueryToken", "query", ")", "{", "return", "queryPredictionsWithServiceResponseAsync", "(", "projectId", ",", "query", ")", ".", "map", "(", "n...
Get images that were sent to your prediction endpoint. @param projectId The project id @param query Parameters used to query the predictions. Limited to combining 2 tags @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PredictionQueryResult object
[ "Get", "images", "that", "were", "sent", "to", "your", "prediction", "endpoint", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3028-L3035
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/watch/WatchUtil.java
WatchUtil.createModify
public static WatchMonitor createModify(Path path, int maxDepth, Watcher watcher) { """ 创建并初始化监听,监听修改事件 @param path 路径 @param maxDepth 当监听目录时,监听目录的最大深度,当设置值为1(或小于1)时,表示不递归监听子目录 @param watcher {@link Watcher} @return {@link WatchMonitor} @since 4.5.2 """ final WatchMonitor watchMonitor = create(path, ...
java
public static WatchMonitor createModify(Path path, int maxDepth, Watcher watcher) { final WatchMonitor watchMonitor = create(path, maxDepth, WatchMonitor.ENTRY_MODIFY); watchMonitor.setWatcher(watcher); return watchMonitor; }
[ "public", "static", "WatchMonitor", "createModify", "(", "Path", "path", ",", "int", "maxDepth", ",", "Watcher", "watcher", ")", "{", "final", "WatchMonitor", "watchMonitor", "=", "create", "(", "path", ",", "maxDepth", ",", "WatchMonitor", ".", "ENTRY_MODIFY", ...
创建并初始化监听,监听修改事件 @param path 路径 @param maxDepth 当监听目录时,监听目录的最大深度,当设置值为1(或小于1)时,表示不递归监听子目录 @param watcher {@link Watcher} @return {@link WatchMonitor} @since 4.5.2
[ "创建并初始化监听,监听修改事件" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/watch/WatchUtil.java#L375-L379
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiMessageImpl.java
JsApiMessageImpl.getUserProperty
@Override public final Serializable getUserProperty(String name) throws IOException, ClassNotFoundException { """ /* Return the User Property stored in the Message under the given name. <p> User Properties are stored as name-value pairs where the value may be any Object which implements java.io.Serializabl...
java
@Override public final Serializable getUserProperty(String name) throws IOException, ClassNotFoundException { /* If the name is null there is nothing to do. so only proceed if it is */ /* supplied. */ if (name != null) { /* Call the real getUserProperty with forMatching set to ...
[ "@", "Override", "public", "final", "Serializable", "getUserProperty", "(", "String", "name", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "/* If the name is null there is nothing to do. so only proceed if it is */", "/* supplied. */", "if", "(", "name", ...
/* Return the User Property stored in the Message under the given name. <p> User Properties are stored as name-value pairs where the value may be any Object which implements java.io.Serializable. Note that the reference returned is to a copy of the actual Object stored. Javadoc description supplied by SIBusSdoMessage ...
[ "/", "*", "Return", "the", "User", "Property", "stored", "in", "the", "Message", "under", "the", "given", "name", ".", "<p", ">", "User", "Properties", "are", "stored", "as", "name", "-", "value", "pairs", "where", "the", "value", "may", "be", "any", "...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiMessageImpl.java#L325-L341
googleads/googleads-java-lib
modules/ads_lib/src/main/java/com/google/api/ads/common/lib/utils/CsvFiles.java
CsvFiles.getCsvDataMap
public static Map<String, String> getCsvDataMap(String fileName, final int key, final int value, boolean headerPresent) throws IOException { """ Returns a {@code Map<String, String>} mapping of the column designated by {@code key} to the column designated by {@code value}. This method also ignores all colu...
java
public static Map<String, String> getCsvDataMap(String fileName, final int key, final int value, boolean headerPresent) throws IOException { final Map<String, String> result = Maps.newHashMap(); new CsvReader(fileName, headerPresent) .processReader((header, line, lineNumber) -> result.put(line...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "getCsvDataMap", "(", "String", "fileName", ",", "final", "int", "key", ",", "final", "int", "value", ",", "boolean", "headerPresent", ")", "throws", "IOException", "{", "final", "Map", "<", "St...
Returns a {@code Map<String, String>} mapping of the column designated by {@code key} to the column designated by {@code value}. This method also ignores all columns other than the columns specified by {@code key} and {@code value}. @param fileName the CSV file to load @param key the 0-indexed column number to map to ...
[ "Returns", "a", "{", "@code", "Map<String", "String", ">", "}", "mapping", "of", "the", "column", "designated", "by", "{", "@code", "key", "}", "to", "the", "column", "designated", "by", "{", "@code", "value", "}", ".", "This", "method", "also", "ignores...
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/utils/CsvFiles.java#L58-L64
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java
JanusConfig.getSystemPropertyAsInteger
public static int getSystemPropertyAsInteger(String name, int defaultValue) { """ Replies the value of the integer system property. @param name - name of the property. @param defaultValue - value to reply if the these is no property found @return the value, or defaultValue. """ final String valu...
java
public static int getSystemPropertyAsInteger(String name, int defaultValue) { final String value = getSystemProperty(name, null); if (value != null) { try { return Integer.parseInt(value); } catch (Throwable exception) { // } } ...
[ "public", "static", "int", "getSystemPropertyAsInteger", "(", "String", "name", ",", "int", "defaultValue", ")", "{", "final", "String", "value", "=", "getSystemProperty", "(", "name", ",", "null", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "try...
Replies the value of the integer system property. @param name - name of the property. @param defaultValue - value to reply if the these is no property found @return the value, or defaultValue.
[ "Replies", "the", "value", "of", "the", "integer", "system", "property", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java#L385-L395
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/StreamingHistogram.java
StreamingHistogram.update
public void update(double p, long m) { """ Adds new point p with value m to this histogram. @param p @param m """ Long mi = bin.get(p); if (mi != null) { // we found the same p so increment that counter bin.put(p, mi + m); } else { ...
java
public void update(double p, long m) { Long mi = bin.get(p); if (mi != null) { // we found the same p so increment that counter bin.put(p, mi + m); } else { bin.put(p, m); // if bin size exceeds maximum bin size then tri...
[ "public", "void", "update", "(", "double", "p", ",", "long", "m", ")", "{", "Long", "mi", "=", "bin", ".", "get", "(", "p", ")", ";", "if", "(", "mi", "!=", "null", ")", "{", "// we found the same p so increment that counter", "bin", ".", "put", "(", ...
Adds new point p with value m to this histogram. @param p @param m
[ "Adds", "new", "point", "p", "with", "value", "m", "to", "this", "histogram", "." ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/StreamingHistogram.java#L77-L115
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/SchemaRepositoryParser.java
SchemaRepositoryParser.addLocationsToBuilder
private void addLocationsToBuilder(Element element, BeanDefinitionBuilder builder) { """ Adds the locations contained in the given locations element to the BeanDefinitionBuilder @param element the element containing the locations to be added to the builder @param builder the BeanDefinitionBuilder to add the loca...
java
private void addLocationsToBuilder(Element element, BeanDefinitionBuilder builder) { Element locationsElement = DomUtils.getChildElementByTagName(element, LOCATIONS); if (locationsElement != null) { List<Element> locationElements = DomUtils.getChildElementsByTagName(locationsElement, LOCATIO...
[ "private", "void", "addLocationsToBuilder", "(", "Element", "element", ",", "BeanDefinitionBuilder", "builder", ")", "{", "Element", "locationsElement", "=", "DomUtils", ".", "getChildElementByTagName", "(", "element", ",", "LOCATIONS", ")", ";", "if", "(", "locatio...
Adds the locations contained in the given locations element to the BeanDefinitionBuilder @param element the element containing the locations to be added to the builder @param builder the BeanDefinitionBuilder to add the locations to
[ "Adds", "the", "locations", "contained", "in", "the", "given", "locations", "element", "to", "the", "BeanDefinitionBuilder" ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/SchemaRepositoryParser.java#L118-L131
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java
ArrayUtil.areEqualSets
public static boolean areEqualSets(int[] arra, int[] arrb) { """ Returns true if arra and arrb contain the same set of integers, not necessarily in the same order. This implies the arrays are of the same length. """ return arra.length == arrb.length && ArrayUtil.haveEqualSets(arra, arr...
java
public static boolean areEqualSets(int[] arra, int[] arrb) { return arra.length == arrb.length && ArrayUtil.haveEqualSets(arra, arrb, arra.length); }
[ "public", "static", "boolean", "areEqualSets", "(", "int", "[", "]", "arra", ",", "int", "[", "]", "arrb", ")", "{", "return", "arra", ".", "length", "==", "arrb", ".", "length", "&&", "ArrayUtil", ".", "haveEqualSets", "(", "arra", ",", "arrb", ",", ...
Returns true if arra and arrb contain the same set of integers, not necessarily in the same order. This implies the arrays are of the same length.
[ "Returns", "true", "if", "arra", "and", "arrb", "contain", "the", "same", "set", "of", "integers", "not", "necessarily", "in", "the", "same", "order", ".", "This", "implies", "the", "arrays", "are", "of", "the", "same", "length", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java#L309-L312
finmath/finmath-lib
src/main/java/net/finmath/marketdata/model/volatilities/SwaptionDataLattice.java
SwaptionDataLattice.getValue
public double getValue(int maturityInMonths, int tenorInMonths, int moneynessBP, QuotingConvention convention, double displacement, AnalyticModel model) { """ Return the value in the given quoting convention. Conversion involving receiver premium assumes zero wide collar. @param maturityInMonths The maturity o...
java
public double getValue(int maturityInMonths, int tenorInMonths, int moneynessBP, QuotingConvention convention, double displacement, AnalyticModel model) { DataKey key = new DataKey(maturityInMonths, tenorInMonths, moneynessBP); return convertToConvention(getValue(key), key, convention, displacement, quotingConven...
[ "public", "double", "getValue", "(", "int", "maturityInMonths", ",", "int", "tenorInMonths", ",", "int", "moneynessBP", ",", "QuotingConvention", "convention", ",", "double", "displacement", ",", "AnalyticModel", "model", ")", "{", "DataKey", "key", "=", "new", ...
Return the value in the given quoting convention. Conversion involving receiver premium assumes zero wide collar. @param maturityInMonths The maturity of the option as offset in months from the reference date. @param tenorInMonths The tenor of the swap as offset in months from the option maturity. @param moneynessBP T...
[ "Return", "the", "value", "in", "the", "given", "quoting", "convention", ".", "Conversion", "involving", "receiver", "premium", "assumes", "zero", "wide", "collar", "." ]
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/volatilities/SwaptionDataLattice.java#L630-L633
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/event/InitFieldHandler.java
InitFieldHandler.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) { BaseField fldSource = this.getSyncedListenersField(m_fldSource, listener); ((InitFieldHandler)listener).init(null, fldSource, m_objSource, m_bInitIfSourceNull...
[ "public", "boolean", "syncClonedListener", "(", "BaseField", "field", ",", "FieldListener", "listener", ",", "boolean", "bInitCalled", ")", "{", "if", "(", "!", "bInitCalled", ")", "{", "BaseField", "fldSource", "=", "this", ".", "getSyncedListenersField", "(", ...
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/InitFieldHandler.java#L114-L122
casbin/jcasbin
src/main/java/org/casbin/jcasbin/main/Enforcer.java
Enforcer.deleteRoleForUserInDomain
public boolean deleteRoleForUserInDomain(String user, String role, String domain) { """ deleteRoleForUserInDomain deletes a role for a user inside a domain. Returns false if the user does not have the role (aka not affected). @param user the user. @param role the role. @param domain the domain. @return succ...
java
public boolean deleteRoleForUserInDomain(String user, String role, String domain) { return removeGroupingPolicy(user, role, domain); }
[ "public", "boolean", "deleteRoleForUserInDomain", "(", "String", "user", ",", "String", "role", ",", "String", "domain", ")", "{", "return", "removeGroupingPolicy", "(", "user", ",", "role", ",", "domain", ")", ";", "}" ]
deleteRoleForUserInDomain deletes a role for a user inside a domain. Returns false if the user does not have the role (aka not affected). @param user the user. @param role the role. @param domain the domain. @return succeeds or not.
[ "deleteRoleForUserInDomain", "deletes", "a", "role", "for", "a", "user", "inside", "a", "domain", ".", "Returns", "false", "if", "the", "user", "does", "not", "have", "the", "role", "(", "aka", "not", "affected", ")", "." ]
train
https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/Enforcer.java#L400-L402
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java
BookKeeperLog.executeWrites
private boolean executeWrites(List<Write> toExecute) { """ Executes the given Writes to BookKeeper. @param toExecute The Writes to execute. @return True if all the writes succeeded, false if at least one failed (if a Write failed, all subsequent writes will be failed as well). """ log.debug("{}: E...
java
private boolean executeWrites(List<Write> toExecute) { log.debug("{}: Executing {} writes.", this.traceObjectId, toExecute.size()); for (int i = 0; i < toExecute.size(); i++) { Write w = toExecute.get(i); try { // Record the beginning of a new attempt. ...
[ "private", "boolean", "executeWrites", "(", "List", "<", "Write", ">", "toExecute", ")", "{", "log", ".", "debug", "(", "\"{}: Executing {} writes.\"", ",", "this", ".", "traceObjectId", ",", "toExecute", ".", "size", "(", ")", ")", ";", "for", "(", "int",...
Executes the given Writes to BookKeeper. @param toExecute The Writes to execute. @return True if all the writes succeeded, false if at least one failed (if a Write failed, all subsequent writes will be failed as well).
[ "Executes", "the", "given", "Writes", "to", "BookKeeper", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L441-L471
traex/RippleEffect
library/src/main/java/com/andexert/library/RippleView.java
RippleView.createAnimation
private void createAnimation(final float x, final float y) { """ Create Ripple animation centered at x, y @param x Horizontal position of the ripple center @param y Vertical position of the ripple center """ if (this.isEnabled() && !animationRunning) { if (hasToZoom) thi...
java
private void createAnimation(final float x, final float y) { if (this.isEnabled() && !animationRunning) { if (hasToZoom) this.startAnimation(scaleAnimation); radiusMax = Math.max(WIDTH, HEIGHT); if (rippleType != 2) radiusMax /= 2; ...
[ "private", "void", "createAnimation", "(", "final", "float", "x", ",", "final", "float", "y", ")", "{", "if", "(", "this", ".", "isEnabled", "(", ")", "&&", "!", "animationRunning", ")", "{", "if", "(", "hasToZoom", ")", "this", ".", "startAnimation", ...
Create Ripple animation centered at x, y @param x Horizontal position of the ripple center @param y Vertical position of the ripple center
[ "Create", "Ripple", "animation", "centered", "at", "x", "y" ]
train
https://github.com/traex/RippleEffect/blob/df5f9e4456eae8a8e98e2827a3c6f9e7185596e1/library/src/main/java/com/andexert/library/RippleView.java#L249-L276
marvinlabs/android-intents
library/src/main/java/com/marvinlabs/intents/PhoneIntents.java
PhoneIntents.newEmptySmsIntent
public static Intent newEmptySmsIntent(Context context, String[] phoneNumbers) { """ Creates an intent that will allow to send an SMS without specifying the phone number @param phoneNumbers The phone numbers to send the SMS to @return the intent """ return newSmsIntent(context, null, phoneNumbers);...
java
public static Intent newEmptySmsIntent(Context context, String[] phoneNumbers) { return newSmsIntent(context, null, phoneNumbers); }
[ "public", "static", "Intent", "newEmptySmsIntent", "(", "Context", "context", ",", "String", "[", "]", "phoneNumbers", ")", "{", "return", "newSmsIntent", "(", "context", ",", "null", ",", "phoneNumbers", ")", ";", "}" ]
Creates an intent that will allow to send an SMS without specifying the phone number @param phoneNumbers The phone numbers to send the SMS to @return the intent
[ "Creates", "an", "intent", "that", "will", "allow", "to", "send", "an", "SMS", "without", "specifying", "the", "phone", "number" ]
train
https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/PhoneIntents.java#L61-L63
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java
CPFriendlyURLEntryPersistenceImpl.removeByG_C_C
@Override public void removeByG_C_C(long groupId, long classNameId, long classPK) { """ Removes all the cp friendly url entries where groupId = &#63; and classNameId = &#63; and classPK = &#63; from the database. @param groupId the group ID @param classNameId the class name ID @param classPK the class pk ...
java
@Override public void removeByG_C_C(long groupId, long classNameId, long classPK) { for (CPFriendlyURLEntry cpFriendlyURLEntry : findByG_C_C(groupId, classNameId, classPK, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(cpFriendlyURLEntry); } }
[ "@", "Override", "public", "void", "removeByG_C_C", "(", "long", "groupId", ",", "long", "classNameId", ",", "long", "classPK", ")", "{", "for", "(", "CPFriendlyURLEntry", "cpFriendlyURLEntry", ":", "findByG_C_C", "(", "groupId", ",", "classNameId", ",", "classP...
Removes all the cp friendly url entries where groupId = &#63; and classNameId = &#63; and classPK = &#63; from the database. @param groupId the group ID @param classNameId the class name ID @param classPK the class pk
[ "Removes", "all", "the", "cp", "friendly", "url", "entries", "where", "groupId", "=", "&#63", ";", "and", "classNameId", "=", "&#63", ";", "and", "classPK", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java#L2555-L2561
airlift/slice
src/main/java/io/airlift/slice/Slices.java
Slices.wrappedLongArray
public static Slice wrappedLongArray(long[] array, int offset, int length) { """ Creates a slice over the specified array range. @param offset the array position at which the slice begins @param length the number of array positions to include in the slice """ if (length == 0) { return E...
java
public static Slice wrappedLongArray(long[] array, int offset, int length) { if (length == 0) { return EMPTY_SLICE; } return new Slice(array, offset, length); }
[ "public", "static", "Slice", "wrappedLongArray", "(", "long", "[", "]", "array", ",", "int", "offset", ",", "int", "length", ")", "{", "if", "(", "length", "==", "0", ")", "{", "return", "EMPTY_SLICE", ";", "}", "return", "new", "Slice", "(", "array", ...
Creates a slice over the specified array range. @param offset the array position at which the slice begins @param length the number of array positions to include in the slice
[ "Creates", "a", "slice", "over", "the", "specified", "array", "range", "." ]
train
https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/Slices.java#L237-L243
RuedigerMoeller/kontraktor
modules/reactive-streams/src/main/java/org/nustaq/kontraktor/reactivestreams/KxReactiveStreams.java
KxReactiveStreams.iterator
public <T> Iterator<T> iterator( Publisher<T> pub ) { """ warning: blocks the calling thread. Need to execute in a separate thread if called from within a callback """ return iterator(pub, batchSize); }
java
public <T> Iterator<T> iterator( Publisher<T> pub ) { return iterator(pub, batchSize); }
[ "public", "<", "T", ">", "Iterator", "<", "T", ">", "iterator", "(", "Publisher", "<", "T", ">", "pub", ")", "{", "return", "iterator", "(", "pub", ",", "batchSize", ")", ";", "}" ]
warning: blocks the calling thread. Need to execute in a separate thread if called from within a callback
[ "warning", ":", "blocks", "the", "calling", "thread", ".", "Need", "to", "execute", "in", "a", "separate", "thread", "if", "called", "from", "within", "a", "callback" ]
train
https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/modules/reactive-streams/src/main/java/org/nustaq/kontraktor/reactivestreams/KxReactiveStreams.java#L260-L262
sai-pullabhotla/catatumbo
src/main/java/com/jmethods/catatumbo/impl/EmbeddedIntrospector.java
EmbeddedIntrospector.processEmbeddedField
private void processEmbeddedField(Field child) { """ Processes a nested embedded field. @param child the nested embedded field. """ EmbeddedField embeddedChild = new EmbeddedField(child, field); EmbeddedMetadata childMetadata = EmbeddedIntrospector.introspect(embeddedChild, entityMetadata); met...
java
private void processEmbeddedField(Field child) { EmbeddedField embeddedChild = new EmbeddedField(child, field); EmbeddedMetadata childMetadata = EmbeddedIntrospector.introspect(embeddedChild, entityMetadata); metadata.putEmbeddedMetadata(childMetadata); }
[ "private", "void", "processEmbeddedField", "(", "Field", "child", ")", "{", "EmbeddedField", "embeddedChild", "=", "new", "EmbeddedField", "(", "child", ",", "field", ")", ";", "EmbeddedMetadata", "childMetadata", "=", "EmbeddedIntrospector", ".", "introspect", "(",...
Processes a nested embedded field. @param child the nested embedded field.
[ "Processes", "a", "nested", "embedded", "field", "." ]
train
https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EmbeddedIntrospector.java#L171-L175
xetorthio/jedis
src/main/java/redis/clients/jedis/BinaryJedis.java
BinaryJedis.zremrangeByScore
@Override public Long zremrangeByScore(final byte[] key, final double min, final double max) { """ Remove all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max). <p> <b>Time complexity:</b> <p> O(log(N))+O(M) with N being the number of ...
java
@Override public Long zremrangeByScore(final byte[] key, final double min, final double max) { checkIsInMultiOrPipeline(); client.zremrangeByScore(key, min, max); return client.getIntegerReply(); }
[ "@", "Override", "public", "Long", "zremrangeByScore", "(", "final", "byte", "[", "]", "key", ",", "final", "double", "min", ",", "final", "double", "max", ")", "{", "checkIsInMultiOrPipeline", "(", ")", ";", "client", ".", "zremrangeByScore", "(", "key", ...
Remove all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max). <p> <b>Time complexity:</b> <p> O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements removed by the operation @param key @param min @param m...
[ "Remove", "all", "the", "elements", "in", "the", "sorted", "set", "at", "key", "with", "a", "score", "between", "min", "and", "max", "(", "including", "elements", "with", "score", "equal", "to", "min", "or", "max", ")", ".", "<p", ">", "<b", ">", "Ti...
train
https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L2607-L2612
elki-project/elki
elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java
Logging.beginStep
public void beginStep(StepProgress prog, int step, String title) { """ Begin a new algorithm step (unless {@code null}). <b>Important:</b> Do not use this method when the parameter are not static. In these cases, check whether logging is enabled first, to avoid computing method parameters! @param prog Prog...
java
public void beginStep(StepProgress prog, int step, String title) { if(prog != null) { prog.beginStep(step, title, this); } }
[ "public", "void", "beginStep", "(", "StepProgress", "prog", ",", "int", "step", ",", "String", "title", ")", "{", "if", "(", "prog", "!=", "null", ")", "{", "prog", ".", "beginStep", "(", "step", ",", "title", ",", "this", ")", ";", "}", "}" ]
Begin a new algorithm step (unless {@code null}). <b>Important:</b> Do not use this method when the parameter are not static. In these cases, check whether logging is enabled first, to avoid computing method parameters! @param prog Progress to increment, may be {@code null}. @param step Step number @param title Step ...
[ "Begin", "a", "new", "algorithm", "step", "(", "unless", "{", "@code", "null", "}", ")", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L657-L661
NoraUi/NoraUi
src/main/java/com/github/noraui/application/steps/CommonSteps.java
CommonSteps.saveValue
@Conditioned @Et("Je sauvegarde la valeur de '(.*)-(.*)' dans la clé '(.*)' du contexte[\\.|\\?]") @And("I save the value of '(.*)-(.*)' in '(.*)' context key[\\.|\\?]") public void saveValue(String page, String field, String targetKey, List<GherkinStepCondition> conditions) throws TechnicalException, Fa...
java
@Conditioned @Et("Je sauvegarde la valeur de '(.*)-(.*)' dans la clé '(.*)' du contexte[\\.|\\?]") @And("I save the value of '(.*)-(.*)' in '(.*)' context key[\\.|\\?]") public void saveValue(String page, String field, String targetKey, List<GherkinStepCondition> conditions) throws TechnicalException, Fa...
[ "@", "Conditioned", "@", "Et", "(", "\"Je sauvegarde la valeur de '(.*)-(.*)' dans la clé '(.*)' du contexte[\\\\.|\\\\?]\")", "\r", "@", "And", "(", "\"I save the value of '(.*)-(.*)' in '(.*)' context key[\\\\.|\\\\?]\"", ")", "public", "void", "saveValue", "(", "String", "page",...
Save field in memory if all 'expected' parameters equals 'actual' parameters in conditions. The value is saved directly into the Context targetKey. @param page The concerned page of field @param field Name of the field to save in memory. @param targetKey Target key to save retrieved value. @param conditions list of 'e...
[ "Save", "field", "in", "memory", "if", "all", "expected", "parameters", "equals", "actual", "parameters", "in", "conditions", ".", "The", "value", "is", "saved", "directly", "into", "the", "Context", "targetKey", "." ]
train
https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L362-L367
raydac/java-binary-block-parser
jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java
JBBPDslBuilder.Custom
public JBBPDslBuilder Custom(final String type, final String name) { """ Add named custom variable. @param type custom type, must not be null @param name name of the field, can be null for anonymous @return the builder instance, must not be null """ return this.Custom(type, name, null); }
java
public JBBPDslBuilder Custom(final String type, final String name) { return this.Custom(type, name, null); }
[ "public", "JBBPDslBuilder", "Custom", "(", "final", "String", "type", ",", "final", "String", "name", ")", "{", "return", "this", ".", "Custom", "(", "type", ",", "name", ",", "null", ")", ";", "}" ]
Add named custom variable. @param type custom type, must not be null @param name name of the field, can be null for anonymous @return the builder instance, must not be null
[ "Add", "named", "custom", "variable", "." ]
train
https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L298-L300
ironjacamar/ironjacamar
codegenerator/src/main/java/org/ironjacamar/codegenerator/code/McfCodeGen.java
McfCodeGen.writeConnectionFactory
private void writeConnectionFactory(Definition def, Writer out, int indent) throws IOException { """ Output ConnectionFactory method @param def definition @param out Writer @param indent space number @throws IOException ioException """ writeWithIndent(out, indent, "/**\n"); writeWithInd...
java
private void writeConnectionFactory(Definition def, Writer out, int indent) throws IOException { writeWithIndent(out, indent, "/**\n"); writeWithIndent(out, indent, " * Creates a Connection Factory instance. \n"); writeWithIndent(out, indent, " *\n"); writeWithIndent(out, indent, " * @param c...
[ "private", "void", "writeConnectionFactory", "(", "Definition", "def", ",", "Writer", "out", ",", "int", "indent", ")", "throws", "IOException", "{", "writeWithIndent", "(", "out", ",", "indent", ",", "\"/**\\n\"", ")", ";", "writeWithIndent", "(", "out", ",",...
Output ConnectionFactory method @param def definition @param out Writer @param indent space number @throws IOException ioException
[ "Output", "ConnectionFactory", "method" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/McfCodeGen.java#L196-L236
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleUtils.java
JBossModuleUtils.addPropertiesToSpec
public static void addPropertiesToSpec(ModuleSpec.Builder moduleSpecBuilder, Map<String, String> properties) { """ Add properties to the {@link ModuleSpec} @param moduleSpecBuilder builder to populate @param properties properties to add """ for (Entry<String, String> entry : properties.entrySet()) ...
java
public static void addPropertiesToSpec(ModuleSpec.Builder moduleSpecBuilder, Map<String, String> properties) { for (Entry<String, String> entry : properties.entrySet()) { moduleSpecBuilder.addProperty(entry.getKey(), entry.getValue()); } }
[ "public", "static", "void", "addPropertiesToSpec", "(", "ModuleSpec", ".", "Builder", "moduleSpecBuilder", ",", "Map", "<", "String", ",", "String", ">", "properties", ")", "{", "for", "(", "Entry", "<", "String", ",", "String", ">", "entry", ":", "propertie...
Add properties to the {@link ModuleSpec} @param moduleSpecBuilder builder to populate @param properties properties to add
[ "Add", "properties", "to", "the", "{", "@link", "ModuleSpec", "}" ]
train
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleUtils.java#L261-L265
line/armeria
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
ServerBuilder.accessLogWriter
public ServerBuilder accessLogWriter(AccessLogWriter accessLogWriter, boolean shutdownOnStop) { """ Sets an access log writer of this {@link Server}. {@link AccessLogWriter#disabled()} is used by default. @param shutdownOnStop whether to shut down the {@link AccessLogWriter} when the {@link Server} stops ""...
java
public ServerBuilder accessLogWriter(AccessLogWriter accessLogWriter, boolean shutdownOnStop) { this.accessLogWriter = requireNonNull(accessLogWriter, "accessLogWriter"); shutdownAccessLogWriterOnStop = shutdownOnStop; return this; }
[ "public", "ServerBuilder", "accessLogWriter", "(", "AccessLogWriter", "accessLogWriter", ",", "boolean", "shutdownOnStop", ")", "{", "this", ".", "accessLogWriter", "=", "requireNonNull", "(", "accessLogWriter", ",", "\"accessLogWriter\"", ")", ";", "shutdownAccessLogWrit...
Sets an access log writer of this {@link Server}. {@link AccessLogWriter#disabled()} is used by default. @param shutdownOnStop whether to shut down the {@link AccessLogWriter} when the {@link Server} stops
[ "Sets", "an", "access", "log", "writer", "of", "this", "{", "@link", "Server", "}", ".", "{", "@link", "AccessLogWriter#disabled", "()", "}", "is", "used", "by", "default", "." ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java#L705-L709
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java
ListManagementTermsImpl.getAllTerms
public Terms getAllTerms(String listId, String language, GetAllTermsOptionalParameter getAllTermsOptionalParameter) { """ Gets all terms from the list with list Id equal to the list Id passed. @param listId List Id of the image list. @param language Language of the terms. @param getAllTermsOptionalParameter t...
java
public Terms getAllTerms(String listId, String language, GetAllTermsOptionalParameter getAllTermsOptionalParameter) { return getAllTermsWithServiceResponseAsync(listId, language, getAllTermsOptionalParameter).toBlocking().single().body(); }
[ "public", "Terms", "getAllTerms", "(", "String", "listId", ",", "String", "language", ",", "GetAllTermsOptionalParameter", "getAllTermsOptionalParameter", ")", "{", "return", "getAllTermsWithServiceResponseAsync", "(", "listId", ",", "language", ",", "getAllTermsOptionalPar...
Gets all terms from the list with list Id equal to the list Id passed. @param listId List Id of the image list. @param language Language of the terms. @param getAllTermsOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if paramet...
[ "Gets", "all", "terms", "from", "the", "list", "with", "list", "Id", "equal", "to", "the", "list", "Id", "passed", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java#L272-L274
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.cleanupData
@Transactional(readOnly = true) public void cleanupData() { """ Delete files not used by this instance in the data directory. """ List<String> allFilesInDatabaseList = getJdbcTemplate().queryForList( "SELECT filename FROM media_files AS m", String.class); File dataDir = getRealDataDir(); ...
java
@Transactional(readOnly = true) public void cleanupData() { List<String> allFilesInDatabaseList = getJdbcTemplate().queryForList( "SELECT filename FROM media_files AS m", String.class); File dataDir = getRealDataDir(); Set<File> allFilesInDatabase = new HashSet<>(); for (String singleFileNa...
[ "@", "Transactional", "(", "readOnly", "=", "true", ")", "public", "void", "cleanupData", "(", ")", "{", "List", "<", "String", ">", "allFilesInDatabaseList", "=", "getJdbcTemplate", "(", ")", ".", "queryForList", "(", "\"SELECT filename FROM media_files AS m\"", ...
Delete files not used by this instance in the data directory.
[ "Delete", "files", "not", "used", "by", "this", "instance", "in", "the", "data", "directory", "." ]
train
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L1421-L1452
looly/hutool
hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java
HandleHelper.handleRs
public static <T extends Collection<Entity>> T handleRs(ResultSet rs, T collection) throws SQLException { """ 处理多条数据 @param <T> 集合类型 @param rs 数据集 @param collection 数据集 @return Entity列表 @throws SQLException SQL执行异常 """ final ResultSetMetaData meta = rs.getMetaData(); final int columnCount = meta.g...
java
public static <T extends Collection<Entity>> T handleRs(ResultSet rs, T collection) throws SQLException { final ResultSetMetaData meta = rs.getMetaData(); final int columnCount = meta.getColumnCount(); while (rs.next()) { collection.add(HandleHelper.handleRow(columnCount, meta, rs)); } return col...
[ "public", "static", "<", "T", "extends", "Collection", "<", "Entity", ">", ">", "T", "handleRs", "(", "ResultSet", "rs", ",", "T", "collection", ")", "throws", "SQLException", "{", "final", "ResultSetMetaData", "meta", "=", "rs", ".", "getMetaData", "(", "...
处理多条数据 @param <T> 集合类型 @param rs 数据集 @param collection 数据集 @return Entity列表 @throws SQLException SQL执行异常
[ "处理多条数据" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java#L165-L174
aaberg/sql2o
core/src/main/java/org/sql2o/Sql2o.java
Sql2o.withConnection
public void withConnection(StatementRunnable runnable, Object argument) { """ Invokes the run method on the {@link org.sql2o.StatementRunnableWithResult} instance. This method guarantees that the connection is closed properly, when either the run method completes or if an exception occurs. @param runnable @para...
java
public void withConnection(StatementRunnable runnable, Object argument) { Connection connection = null; try{ connection = open(); runnable.run(connection, argument); } catch (Throwable t) { throw new Sql2oException("An error occurred while executing Statement...
[ "public", "void", "withConnection", "(", "StatementRunnable", "runnable", ",", "Object", "argument", ")", "{", "Connection", "connection", "=", "null", ";", "try", "{", "connection", "=", "open", "(", ")", ";", "runnable", ".", "run", "(", "connection", ",",...
Invokes the run method on the {@link org.sql2o.StatementRunnableWithResult} instance. This method guarantees that the connection is closed properly, when either the run method completes or if an exception occurs. @param runnable @param argument
[ "Invokes", "the", "run", "method", "on", "the", "{" ]
train
https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/Sql2o.java#L258-L271
apereo/cas
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/DigestUtils.java
DigestUtils.shaBase64
public static String shaBase64(final String salt, final String data) { """ Sha base 64 string. @param salt the salt @param data the data @return the string """ return shaBase64(salt, data, null); }
java
public static String shaBase64(final String salt, final String data) { return shaBase64(salt, data, null); }
[ "public", "static", "String", "shaBase64", "(", "final", "String", "salt", ",", "final", "String", "data", ")", "{", "return", "shaBase64", "(", "salt", ",", "data", ",", "null", ")", ";", "}" ]
Sha base 64 string. @param salt the salt @param data the data @return the string
[ "Sha", "base", "64", "string", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/DigestUtils.java#L71-L73
before/quality-check
modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java
Check.matchesPattern
@ArgumentsChecked @Throws( { """ Ensures that a readable sequence of {@code char} values matches a specified pattern. If the given character sequence does not match against the passed pattern, an {@link IllegalPatternArgumentException} will be thrown. @param pattern pattern, that the {@code chars} must corre...
java
@ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalPatternArgumentException.class }) public static <T extends CharSequence> T matchesPattern(@Nonnull final Pattern pattern, @Nonnull final T chars, @Nullable final String name) { Check.notNull(pattern, "pattern"); Check.notNull(chars, "chars"...
[ "@", "ArgumentsChecked", "@", "Throws", "(", "{", "IllegalNullArgumentException", ".", "class", ",", "IllegalPatternArgumentException", ".", "class", "}", ")", "public", "static", "<", "T", "extends", "CharSequence", ">", "T", "matchesPattern", "(", "@", "Nonnull"...
Ensures that a readable sequence of {@code char} values matches a specified pattern. If the given character sequence does not match against the passed pattern, an {@link IllegalPatternArgumentException} will be thrown. @param pattern pattern, that the {@code chars} must correspond to @param chars a readable sequence o...
[ "Ensures", "that", "a", "readable", "sequence", "of", "{", "@code", "char", "}", "values", "matches", "a", "specified", "pattern", ".", "If", "the", "given", "character", "sequence", "does", "not", "match", "against", "the", "passed", "pattern", "an", "{", ...
train
https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1799-L1809
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/selection/AbstractSelection.java
AbstractSelection.addToAtomContainer
protected void addToAtomContainer(IAtomContainer ac, IChemObject item) { """ Utility method to add an {@link IChemObject} to an {@link IAtomContainer}. @param ac the {@link IAtomContainer} to add to @param item the {@link IChemObject} to add """ if (item instanceof IAtomContainer) { ac....
java
protected void addToAtomContainer(IAtomContainer ac, IChemObject item) { if (item instanceof IAtomContainer) { ac.add((IAtomContainer) item); } else if (item instanceof IAtom) { ac.addAtom((IAtom) item); } else if (item instanceof IBond) { ac.addBond((IBond) i...
[ "protected", "void", "addToAtomContainer", "(", "IAtomContainer", "ac", ",", "IChemObject", "item", ")", "{", "if", "(", "item", "instanceof", "IAtomContainer", ")", "{", "ac", ".", "add", "(", "(", "IAtomContainer", ")", "item", ")", ";", "}", "else", "if...
Utility method to add an {@link IChemObject} to an {@link IAtomContainer}. @param ac the {@link IAtomContainer} to add to @param item the {@link IChemObject} to add
[ "Utility", "method", "to", "add", "an", "{", "@link", "IChemObject", "}", "to", "an", "{", "@link", "IAtomContainer", "}", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/selection/AbstractSelection.java#L84-L92
grails/grails-core
grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java
GrailsASTUtils.addAnnotationOrGetExisting
public static AnnotationNode addAnnotationOrGetExisting(ClassNode classNode, Class<? extends Annotation> annotationClass, Map<String, Object> members) { """ Adds an annotation to the given class node or returns the existing annotation @param classNode The class node @param annotationClass The annotation class ...
java
public static AnnotationNode addAnnotationOrGetExisting(ClassNode classNode, Class<? extends Annotation> annotationClass, Map<String, Object> members) { ClassNode annotationClassNode = ClassHelper.make(annotationClass); return addAnnotationOrGetExisting(classNode, annotationClassNode, members); }
[ "public", "static", "AnnotationNode", "addAnnotationOrGetExisting", "(", "ClassNode", "classNode", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotationClass", ",", "Map", "<", "String", ",", "Object", ">", "members", ")", "{", "ClassNode", "annotation...
Adds an annotation to the given class node or returns the existing annotation @param classNode The class node @param annotationClass The annotation class
[ "Adds", "an", "annotation", "to", "the", "given", "class", "node", "or", "returns", "the", "existing", "annotation" ]
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L836-L839
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.pressText
public static void pressText(ImageInputStream srcStream, ImageOutputStream destStream, String pressText, Color color, Font font, int x, int y, float alpha) { """ 给图片添加文字水印<br> 此方法并不关闭流 @param srcStream 源图像流 @param destStream 目标图像流 @param pressText 水印文字 @param color 水印的字体颜色 @param font {@link Font} 字体相关信息,如...
java
public static void pressText(ImageInputStream srcStream, ImageOutputStream destStream, String pressText, Color color, Font font, int x, int y, float alpha) { pressText(read(srcStream), destStream, pressText, color, font, x, y, alpha); }
[ "public", "static", "void", "pressText", "(", "ImageInputStream", "srcStream", ",", "ImageOutputStream", "destStream", ",", "String", "pressText", ",", "Color", "color", ",", "Font", "font", ",", "int", "x", ",", "int", "y", ",", "float", "alpha", ")", "{", ...
给图片添加文字水印<br> 此方法并不关闭流 @param srcStream 源图像流 @param destStream 目标图像流 @param pressText 水印文字 @param color 水印的字体颜色 @param font {@link Font} 字体相关信息,如果默认则为{@code null} @param x 修正值。 默认在中间,偏移量相对于中间偏移 @param y 修正值。 默认在中间,偏移量相对于中间偏移 @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字
[ "给图片添加文字水印<br", ">", "此方法并不关闭流" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L788-L790
VoltDB/voltdb
src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java
JDBC4DatabaseMetaData.getFunctionColumns
@Override public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException { """ Retrieves a description of the given catalog's system or user function parameters and return type. """ checkClosed(); throw SQL...
java
@Override public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException { checkClosed(); throw SQLError.noSupport(); }
[ "@", "Override", "public", "ResultSet", "getFunctionColumns", "(", "String", "catalog", ",", "String", "schemaPattern", ",", "String", "functionNamePattern", ",", "String", "columnNamePattern", ")", "throws", "SQLException", "{", "checkClosed", "(", ")", ";", "throw...
Retrieves a description of the given catalog's system or user function parameters and return type.
[ "Retrieves", "a", "description", "of", "the", "given", "catalog", "s", "system", "or", "user", "function", "parameters", "and", "return", "type", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java#L362-L367
whitesource/fs-agent
src/main/java/org/whitesource/agent/dependency/resolver/ruby/RubyDependencyResolver.java
RubyDependencyResolver.findGemVersion
private String findGemVersion(String gemName, String pathToGems) { """ in such cases, look for the relevant gem file in the cache with the highest version """ String version = null; File maxVersionFile = findMaxVersionFile(gemName, pathToGems); if (maxVersionFile != null) { ...
java
private String findGemVersion(String gemName, String pathToGems) { String version = null; File maxVersionFile = findMaxVersionFile(gemName, pathToGems); if (maxVersionFile != null) { String fileName = maxVersionFile.getName(); version = getVersionFromFileName(fileName, ge...
[ "private", "String", "findGemVersion", "(", "String", "gemName", ",", "String", "pathToGems", ")", "{", "String", "version", "=", "null", ";", "File", "maxVersionFile", "=", "findMaxVersionFile", "(", "gemName", ",", "pathToGems", ")", ";", "if", "(", "maxVers...
in such cases, look for the relevant gem file in the cache with the highest version
[ "in", "such", "cases", "look", "for", "the", "relevant", "gem", "file", "in", "the", "cache", "with", "the", "highest", "version" ]
train
https://github.com/whitesource/fs-agent/blob/d6ee4842c4f08f4aeda7eb2307b24c49b6bed0e1/src/main/java/org/whitesource/agent/dependency/resolver/ruby/RubyDependencyResolver.java#L617-L625
LGoodDatePicker/LGoodDatePicker
Project/src/main/java/com/privatejgoodies/common/base/Strings.java
Strings.abbreviateCenter
public static String abbreviateCenter(String str, int maxLength) { """ Abbreviates the given string if it exceeds the given maximum length by replacing its center part with an ellipsis ('&hellip;'). If the string is {@code null} or shorter than the limit, it is returned as is.<p> <pre> Strings.abbreviateCent...
java
public static String abbreviateCenter(String str, int maxLength) { if (str == null) { return null; } final int length = str.length(); if (length <= maxLength) { return str; } int headLength = maxLength / 2; int tailLength = maxLength - head...
[ "public", "static", "String", "abbreviateCenter", "(", "String", "str", ",", "int", "maxLength", ")", "{", "if", "(", "str", "==", "null", ")", "{", "return", "null", ";", "}", "final", "int", "length", "=", "str", ".", "length", "(", ")", ";", "if",...
Abbreviates the given string if it exceeds the given maximum length by replacing its center part with an ellipsis ('&hellip;'). If the string is {@code null} or shorter than the limit, it is returned as is.<p> <pre> Strings.abbreviateCenter(null, 3) == null Strings.abbreviateCenter("", 3) == "" Strings.abb...
[ "Abbreviates", "the", "given", "string", "if", "it", "exceeds", "the", "given", "maximum", "length", "by", "replacing", "its", "center", "part", "with", "an", "ellipsis", "(", "&hellip", ";", ")", ".", "If", "the", "string", "is", "{", "@code", "null", "...
train
https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/common/base/Strings.java#L249-L262
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java
Utilities.compareTo
public static <T> int compareTo(Comparable<T> object1, T object2) { """ Null-safe comparison. @param <T> - type of the comparable element. @param object1 the first object. @param object2 the second object. @return Negative number if a lower than b. Positive number if a greater than b. <code>0</code> if a i...
java
public static <T> int compareTo(Comparable<T> object1, T object2) { if (object1 == object2) { return 0; } if (object1 == null) { return Integer.MIN_VALUE; } if (object2 == null) { return Integer.MAX_VALUE; } assert object1 != null && object2 != null; return object1.compareTo(object2); }
[ "public", "static", "<", "T", ">", "int", "compareTo", "(", "Comparable", "<", "T", ">", "object1", ",", "T", "object2", ")", "{", "if", "(", "object1", "==", "object2", ")", "{", "return", "0", ";", "}", "if", "(", "object1", "==", "null", ")", ...
Null-safe comparison. @param <T> - type of the comparable element. @param object1 the first object. @param object2 the second object. @return Negative number if a lower than b. Positive number if a greater than b. <code>0</code> if a is equal to b.
[ "Null", "-", "safe", "comparison", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java#L126-L138
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java
QrCodePositionPatternDetector.createPositionPatternGraph
private void createPositionPatternGraph() { """ Connects together position patterns. For each square, finds all of its neighbors based on center distance. Then considers them for connections """ // Add items to NN search nn.setPoints((List)positionPatterns.toList(),false); for (int i = 0; i < position...
java
private void createPositionPatternGraph() { // Add items to NN search nn.setPoints((List)positionPatterns.toList(),false); for (int i = 0; i < positionPatterns.size(); i++) { PositionPatternNode f = positionPatterns.get(i); // The QR code version specifies the number of "modules"/blocks across the marker...
[ "private", "void", "createPositionPatternGraph", "(", ")", "{", "// Add items to NN search", "nn", ".", "setPoints", "(", "(", "List", ")", "positionPatterns", ".", "toList", "(", ")", ",", "false", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "...
Connects together position patterns. For each square, finds all of its neighbors based on center distance. Then considers them for connections
[ "Connects", "together", "position", "patterns", ".", "For", "each", "square", "finds", "all", "of", "its", "neighbors", "based", "on", "center", "distance", ".", "Then", "considers", "them", "for", "connections" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java#L241-L269
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java
PropertiesUtils.getProperty
public static String getProperty( Properties props, String key, String def ) { """ Return the value of a property. @param props the property file @param key the property key to lookup @param def the default value @return the resolve value """ String value = props.getProperty( key, def ); ...
java
public static String getProperty( Properties props, String key, String def ) { String value = props.getProperty( key, def ); if( value == null ) { return null; } if( "".equals( value ) ) { return value; } value = PropertyResolve...
[ "public", "static", "String", "getProperty", "(", "Properties", "props", ",", "String", "key", ",", "String", "def", ")", "{", "String", "value", "=", "props", ".", "getProperty", "(", "key", ",", "def", ")", ";", "if", "(", "value", "==", "null", ")",...
Return the value of a property. @param props the property file @param key the property key to lookup @param def the default value @return the resolve value
[ "Return", "the", "value", "of", "a", "property", "." ]
train
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java#L153-L166
allengeorge/libraft
libraft-agent/src/main/java/io/libraft/agent/snapshots/OnDiskSnapshotsStore.java
OnDiskSnapshotsStore.reconcileSnapshots
public void reconcileSnapshots() throws StorageException { """ Remove all snapshot metadata entries from the database for which there are no corresponding snapshot files on the filesystem. @throws IllegalStateException if this method is called before {@link OnDiskSnapshotsStore#initialize()} @throws StorageEx...
java
public void reconcileSnapshots() throws StorageException { checkInitialized(); try { // return all snapshots that _do not_ have a corresponding file on the filesystem List<SnapshotMetadata> snapshotsToDelete = getMatchingOrderedSnapshots(new Predicate<SnapshotMetadata>() { ...
[ "public", "void", "reconcileSnapshots", "(", ")", "throws", "StorageException", "{", "checkInitialized", "(", ")", ";", "try", "{", "// return all snapshots that _do not_ have a corresponding file on the filesystem", "List", "<", "SnapshotMetadata", ">", "snapshotsToDelete", ...
Remove all snapshot metadata entries from the database for which there are no corresponding snapshot files on the filesystem. @throws IllegalStateException if this method is called before {@link OnDiskSnapshotsStore#initialize()} @throws StorageException if the snapshot database cannot be accessed or there was a probl...
[ "Remove", "all", "snapshot", "metadata", "entries", "from", "the", "database", "for", "which", "there", "are", "no", "corresponding", "snapshot", "files", "on", "the", "filesystem", "." ]
train
https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-agent/src/main/java/io/libraft/agent/snapshots/OnDiskSnapshotsStore.java#L415-L446
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbManagedConnectionImpl.java
WSRdbManagedConnectionImpl.addConnectionEventListener
public void addConnectionEventListener(ConnectionEventListener listener) { """ Adds a connection event listener to the ManagedConnection instance. <p> The registered ConnectionEventListener instances are notified of connection close and error events, also of local transaction related events on the Managed Conn...
java
public void addConnectionEventListener(ConnectionEventListener listener) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(this, tc, "addConnectionEventListener", listener); if (listener == null) throw new N...
[ "public", "void", "addConnectionEventListener", "(", "ConnectionEventListener", "listener", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ...
Adds a connection event listener to the ManagedConnection instance. <p> The registered ConnectionEventListener instances are notified of connection close and error events, also of local transaction related events on the Managed Connection. @param listener - a new ConnectionEventListener to be registered @throws NullP...
[ "Adds", "a", "connection", "event", "listener", "to", "the", "ManagedConnection", "instance", ".", "<p", ">", "The", "registered", "ConnectionEventListener", "instances", "are", "notified", "of", "connection", "close", "and", "error", "events", "also", "of", "loca...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbManagedConnectionImpl.java#L3672-L3707
cerner/beadledom
guice-dynamicbindings/src/main/java/com/cerner/beadledom/guice/dynamicbindings/DynamicAnnotations.java
DynamicAnnotations.bindDynamicProvider
static <T> void bindDynamicProvider(Binder binder, Key<?> key) { """ Binds a {@link DynamicBindingProvider} for the specified key. <p>The instance bound to the key can later be retrieved through {@link DynamicBindingProvider#get(Class)} given the same annotation provided during binding time. This method also ...
java
static <T> void bindDynamicProvider(Binder binder, Key<?> key) { binder.getProvider(key); ParameterizedType type = Types.newParameterizedType(DynamicBindingProvider.class, key.getTypeLiteral().getType()); @SuppressWarnings("unchecked") DynamicBindingProvider<T> provider = new DynamicBin...
[ "static", "<", "T", ">", "void", "bindDynamicProvider", "(", "Binder", "binder", ",", "Key", "<", "?", ">", "key", ")", "{", "binder", ".", "getProvider", "(", "key", ")", ";", "ParameterizedType", "type", "=", "Types", ".", "newParameterizedType", "(", ...
Binds a {@link DynamicBindingProvider} for the specified key. <p>The instance bound to the key can later be retrieved through {@link DynamicBindingProvider#get(Class)} given the same annotation provided during binding time. This method also 'requires' a binding for {@code key}. <p>This method requires a binder, and m...
[ "Binds", "a", "{", "@link", "DynamicBindingProvider", "}", "for", "the", "specified", "key", "." ]
train
https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/guice-dynamicbindings/src/main/java/com/cerner/beadledom/guice/dynamicbindings/DynamicAnnotations.java#L62-L73
couchbase/couchbase-lite-java-core
src/main/java/com/couchbase/lite/Manager.java
Manager.runAsync
@InterfaceAudience.Private public Future runAsync(String databaseName, final AsyncTask function) throws CouchbaseLiteException { """ Asynchronously dispatches a callback to run on a background thread. The callback will be passed Database instance. There is not currently a known reason to use it, it may not m...
java
@InterfaceAudience.Private public Future runAsync(String databaseName, final AsyncTask function) throws CouchbaseLiteException { final Database database = getDatabase(databaseName); return runAsync(new Runnable() { @Override public void run() { function.run(da...
[ "@", "InterfaceAudience", ".", "Private", "public", "Future", "runAsync", "(", "String", "databaseName", ",", "final", "AsyncTask", "function", ")", "throws", "CouchbaseLiteException", "{", "final", "Database", "database", "=", "getDatabase", "(", "databaseName", ")...
Asynchronously dispatches a callback to run on a background thread. The callback will be passed Database instance. There is not currently a known reason to use it, it may not make sense on the Android API, but it was added for the purpose of having a consistent API with iOS. @exclude
[ "Asynchronously", "dispatches", "a", "callback", "to", "run", "on", "a", "background", "thread", ".", "The", "callback", "will", "be", "passed", "Database", "instance", ".", "There", "is", "not", "currently", "a", "known", "reason", "to", "use", "it", "it", ...
train
https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/Manager.java#L538-L547
emilsjolander/android-FlipView
library/src/se/emilsjolander/flipview/Recycler.java
Recycler.addScrapView
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) void addScrapView(View scrap, int position, int viewType) { """ Put a view into the ScrapViews list. These views are unordered. @param scrap The view to add """ // create a new Scrap Scrap item = new Scrap(scrap, true); if (viewTypeCount == 1) { ...
java
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) void addScrapView(View scrap, int position, int viewType) { // create a new Scrap Scrap item = new Scrap(scrap, true); if (viewTypeCount == 1) { currentScraps.put(position, item); } else { scraps[viewType].put(position, item); } if (Build.VERSION....
[ "@", "TargetApi", "(", "Build", ".", "VERSION_CODES", ".", "ICE_CREAM_SANDWICH", ")", "void", "addScrapView", "(", "View", "scrap", ",", "int", "position", ",", "int", "viewType", ")", "{", "// create a new Scrap", "Scrap", "item", "=", "new", "Scrap", "(", ...
Put a view into the ScrapViews list. These views are unordered. @param scrap The view to add
[ "Put", "a", "view", "into", "the", "ScrapViews", "list", ".", "These", "views", "are", "unordered", "." ]
train
https://github.com/emilsjolander/android-FlipView/blob/7dc0dbd37339dc9691934b60a1c2763b5ed29ffe/library/src/se/emilsjolander/flipview/Recycler.java#L61-L74
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/math/ArrayMath.java
ArrayMath.jensenShannonDivergence
public static double jensenShannonDivergence(double[] a, double[] b) { """ Returns the Jensen Shannon divergence (information radius) between a and b, defined as the average of the kl divergences from a to b and from b to a. """ double[] average = pairwiseAdd(a, b); multiplyInPlace(average, .5); ...
java
public static double jensenShannonDivergence(double[] a, double[] b) { double[] average = pairwiseAdd(a, b); multiplyInPlace(average, .5); return .5 * klDivergence(a, average) + .5 * klDivergence(b, average); }
[ "public", "static", "double", "jensenShannonDivergence", "(", "double", "[", "]", "a", ",", "double", "[", "]", "b", ")", "{", "double", "[", "]", "average", "=", "pairwiseAdd", "(", "a", ",", "b", ")", ";", "multiplyInPlace", "(", "average", ",", ".5"...
Returns the Jensen Shannon divergence (information radius) between a and b, defined as the average of the kl divergences from a to b and from b to a.
[ "Returns", "the", "Jensen", "Shannon", "divergence", "(", "information", "radius", ")", "between", "a", "and", "b", "defined", "as", "the", "average", "of", "the", "kl", "divergences", "from", "a", "to", "b", "and", "from", "b", "to", "a", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/math/ArrayMath.java#L1294-L1298
ThreeTen/threetenbp
src/main/java/org/threeten/bp/format/DateTimeBuilder.java
DateTimeBuilder.addFieldValue
DateTimeBuilder addFieldValue(TemporalField field, long value) { """ Adds a field-value pair to the builder. <p> This adds a field to the builder. If the field is not already present, then the field-value pair is added to the map. If the field is already present and it has the same value as that specified, no ...
java
DateTimeBuilder addFieldValue(TemporalField field, long value) { Jdk8Methods.requireNonNull(field, "field"); Long old = getFieldValue0(field); // check first for better error message if (old != null && old.longValue() != value) { throw new DateTimeException("Conflict found: " + fiel...
[ "DateTimeBuilder", "addFieldValue", "(", "TemporalField", "field", ",", "long", "value", ")", "{", "Jdk8Methods", ".", "requireNonNull", "(", "field", ",", "\"field\"", ")", ";", "Long", "old", "=", "getFieldValue0", "(", "field", ")", ";", "// check first for b...
Adds a field-value pair to the builder. <p> This adds a field to the builder. If the field is not already present, then the field-value pair is added to the map. If the field is already present and it has the same value as that specified, no action occurs. If the field is already present and it has a different value to...
[ "Adds", "a", "field", "-", "value", "pair", "to", "the", "builder", ".", "<p", ">", "This", "adds", "a", "field", "to", "the", "builder", ".", "If", "the", "field", "is", "not", "already", "present", "then", "the", "field", "-", "value", "pair", "is"...
train
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/format/DateTimeBuilder.java#L166-L173
groupon/monsoon
processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java
WavefrontStrings.extractTagSource
private static String extractTagSource(Map<String, String> tag_map) { """ Extract the 'source' tag from the tag_map. Wavefront requires the 'source' tag to be the first tag on the line, hence the special handling. It also *must* be present, so we can never return null. """ return Optional.ofNullab...
java
private static String extractTagSource(Map<String, String> tag_map) { return Optional.ofNullable(tag_map.remove("source")) .orElseGet(() -> { return Optional.ofNullable(tag_map.get("cluster")) .map(WavefrontStrings::escapeTagValue) ...
[ "private", "static", "String", "extractTagSource", "(", "Map", "<", "String", ",", "String", ">", "tag_map", ")", "{", "return", "Optional", ".", "ofNullable", "(", "tag_map", ".", "remove", "(", "\"source\"", ")", ")", ".", "orElseGet", "(", "(", ")", "...
Extract the 'source' tag from the tag_map. Wavefront requires the 'source' tag to be the first tag on the line, hence the special handling. It also *must* be present, so we can never return null.
[ "Extract", "the", "source", "tag", "from", "the", "tag_map", "." ]
train
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L164-L171