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 |
|---|---|---|---|---|---|---|---|---|---|---|
exoplatform/jcr | exo.jcr.component.statistics/src/main/java/org/exoplatform/services/jcr/statistics/JCRAPIAspect.java | JCRAPIAspect.getStatistics | private static Statistics getStatistics(Class<?> target, String signature) {
"""
Gives the corresponding statistics for the given target class and AspectJ signature
@param target the target {@link Class}
@param signature the AspectJ signature
@return the related {@link Statistics} or <code>null</code> if it can... | java | private static Statistics getStatistics(Class<?> target, String signature)
{
initIfNeeded();
Statistics statistics = MAPPING.get(signature);
if (statistics == null)
{
synchronized (JCRAPIAspect.class)
{
Class<?> interfaceClass = findInterface(target);
... | [
"private",
"static",
"Statistics",
"getStatistics",
"(",
"Class",
"<",
"?",
">",
"target",
",",
"String",
"signature",
")",
"{",
"initIfNeeded",
"(",
")",
";",
"Statistics",
"statistics",
"=",
"MAPPING",
".",
"get",
"(",
"signature",
")",
";",
"if",
"(",
... | Gives the corresponding statistics for the given target class and AspectJ signature
@param target the target {@link Class}
@param signature the AspectJ signature
@return the related {@link Statistics} or <code>null</code> if it cannot be found | [
"Gives",
"the",
"corresponding",
"statistics",
"for",
"the",
"given",
"target",
"class",
"and",
"AspectJ",
"signature"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.statistics/src/main/java/org/exoplatform/services/jcr/statistics/JCRAPIAspect.java#L128-L162 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java | ObjectArrayList.isSortedFromTo | public boolean isSortedFromTo(int from, int to) {
"""
Determines whether the receiver is sorted ascending, according to the <i>natural ordering</i> of its
elements. All elements in this range must implement the
<tt>Comparable</tt> interface. Furthermore, all elements in this range
must be <i>mutually comparab... | java | public boolean isSortedFromTo(int from, int to) {
if (size==0) return true;
checkRangeFromTo(from, to, size);
Object[] theElements = elements;
for (int i=from+1; i<=to; i++ ) {
if (((Comparable)theElements[i]).compareTo((Comparable) theElements[i-1]) < 0) return false;
}
return true;
} | [
"public",
"boolean",
"isSortedFromTo",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"return",
"true",
";",
"checkRangeFromTo",
"(",
"from",
",",
"to",
",",
"size",
")",
";",
"Object",
"[",
"]",
"theElements",
"="... | Determines whether the receiver is sorted ascending, according to the <i>natural ordering</i> of its
elements. All elements in this range must implement the
<tt>Comparable</tt> interface. Furthermore, all elements in this range
must be <i>mutually comparable</i> (that is, <tt>e1.compareTo(e2)</tt>
must not throw a <t... | [
"Determines",
"whether",
"the",
"receiver",
"is",
"sorted",
"ascending",
"according",
"to",
"the",
"<i",
">",
"natural",
"ordering<",
"/",
"i",
">",
"of",
"its",
"elements",
".",
"All",
"elements",
"in",
"this",
"range",
"must",
"implement",
"the",
"<tt",
... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L472-L481 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_account_POST | public OvhTask organizationName_service_exchangeService_account_POST(String organizationName, String exchangeService, String SAMAccountName, String company, String displayName, String domain, String firstName, Boolean hiddenFromGAL, String initials, String lastName, OvhOvhLicenceEnum license, Boolean litigation, Long l... | java | public OvhTask organizationName_service_exchangeService_account_POST(String organizationName, String exchangeService, String SAMAccountName, String company, String displayName, String domain, String firstName, Boolean hiddenFromGAL, String initials, String lastName, OvhOvhLicenceEnum license, Boolean litigation, Long l... | [
"public",
"OvhTask",
"organizationName_service_exchangeService_account_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"SAMAccountName",
",",
"String",
"company",
",",
"String",
"displayName",
",",
"String",
"domain",
",",
"Strin... | Create new mailbox in exchange server
REST: POST /email/exchange/{organizationName}/service/{exchangeService}/account
@param outlookLicense [required] Buy outlook license
@param displayName [required] Account display name
@param license [required] Exchange license
@param company [required] Company name
@param initials... | [
"Create",
"new",
"mailbox",
"in",
"exchange",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L2186-L2208 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/SButtonBox.java | SButtonBox.setSFieldValue | public int setSFieldValue(String strParamValue, boolean bDisplayOption, int iMoveMode) {
"""
Set this control's converter to this HTML param.
ie., Check to see if this button was pressed.
"""
String strButtonDesc = this.getButtonDesc();
String strButtonCommand = this.getButtonCommand();
... | java | public int setSFieldValue(String strParamValue, boolean bDisplayOption, int iMoveMode)
{
String strButtonDesc = this.getButtonDesc();
String strButtonCommand = this.getButtonCommand();
if (strButtonCommand != null)
if (strButtonDesc != null)
if (strButtonDesc.equa... | [
"public",
"int",
"setSFieldValue",
"(",
"String",
"strParamValue",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"String",
"strButtonDesc",
"=",
"this",
".",
"getButtonDesc",
"(",
")",
";",
"String",
"strButtonCommand",
"=",
"this",
".",
... | Set this control's converter to this HTML param.
ie., Check to see if this button was pressed. | [
"Set",
"this",
"control",
"s",
"converter",
"to",
"this",
"HTML",
"param",
".",
"ie",
".",
"Check",
"to",
"see",
"if",
"this",
"button",
"was",
"pressed",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/SButtonBox.java#L177-L190 |
pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/records/RetentionSet.java | RetentionSet.removeStreamCutBefore | public static RetentionSet removeStreamCutBefore(RetentionSet set, StreamCutReferenceRecord record) {
"""
Creates a new retention set object by removing all records on or before given record.
@param set retention set to update
@param record reference record
@return updated retention set record after removing al... | java | public static RetentionSet removeStreamCutBefore(RetentionSet set, StreamCutReferenceRecord record) {
Preconditions.checkNotNull(record);
// remove all stream cuts with recordingTime before supplied cut
int beforeIndex = getGreatestLowerBound(set, record.getRecordingTime(), StreamCutReferenceRec... | [
"public",
"static",
"RetentionSet",
"removeStreamCutBefore",
"(",
"RetentionSet",
"set",
",",
"StreamCutReferenceRecord",
"record",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"record",
")",
";",
"// remove all stream cuts with recordingTime before supplied cut",
"in... | Creates a new retention set object by removing all records on or before given record.
@param set retention set to update
@param record reference record
@return updated retention set record after removing all elements before given reference record. | [
"Creates",
"a",
"new",
"retention",
"set",
"object",
"by",
"removing",
"all",
"records",
"on",
"or",
"before",
"given",
"record",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RetentionSet.java#L109-L122 |
xiaosunzhu/resource-utils | src/main/java/net/sunyijun/resource/config/Configs.java | Configs.modifyHavePathSelfConfig | public static void modifyHavePathSelfConfig(IConfigKeyWithPath key, String value) throws IOException {
"""
Modify one self config.
@param key need update config's key with configAbsoluteClassPath
@param value new config value
@throws IOException
"""
String configAbsoluteClassPath = key.getConfi... | java | public static void modifyHavePathSelfConfig(IConfigKeyWithPath key, String value) throws IOException {
String configAbsoluteClassPath = key.getConfigPath();
OneProperties configs = otherConfigs.get(configAbsoluteClassPath);
if (configs == null) {
return;
}
confi... | [
"public",
"static",
"void",
"modifyHavePathSelfConfig",
"(",
"IConfigKeyWithPath",
"key",
",",
"String",
"value",
")",
"throws",
"IOException",
"{",
"String",
"configAbsoluteClassPath",
"=",
"key",
".",
"getConfigPath",
"(",
")",
";",
"OneProperties",
"configs",
"="... | Modify one self config.
@param key need update config's key with configAbsoluteClassPath
@param value new config value
@throws IOException | [
"Modify",
"one",
"self",
"config",
"."
] | train | https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/Configs.java#L577-L584 |
petergeneric/stdlib | guice/webapp/src/main/java/com/peterphi/std/guice/web/servlet/GuiceServlet.java | GuiceServlet.doService | protected void doService(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
"""
Calls {@link HttpServlet#service} should a subclass need to implement that method
@param req
@param resp
@throws ServletException
@throws IOException
"""
super.service(req... | java | protected void doService(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException
{
super.service(req, resp);
} | [
"protected",
"void",
"doService",
"(",
"final",
"HttpServletRequest",
"req",
",",
"final",
"HttpServletResponse",
"resp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"super",
".",
"service",
"(",
"req",
",",
"resp",
")",
";",
"}"
] | Calls {@link HttpServlet#service} should a subclass need to implement that method
@param req
@param resp
@throws ServletException
@throws IOException | [
"Calls",
"{",
"@link",
"HttpServlet#service",
"}",
"should",
"a",
"subclass",
"need",
"to",
"implement",
"that",
"method"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/webapp/src/main/java/com/peterphi/std/guice/web/servlet/GuiceServlet.java#L71-L74 |
icode/ameba | src/main/java/ameba/db/ebean/EbeanUtils.java | EbeanUtils.forceUpdateAllProperties | public static <T> void forceUpdateAllProperties(BeanDescriptor<T> beanDescriptor, T model) {
"""
<p>forceUpdateAllProperties.</p>
@param beanDescriptor a {@link io.ebeaninternal.server.deploy.BeanDescriptor} object.
@param model a T object.
@param <T> a T object.
"""
EntityBean... | java | public static <T> void forceUpdateAllProperties(BeanDescriptor<T> beanDescriptor, T model) {
EntityBeanIntercept intercept = ((EntityBean) model)._ebean_getIntercept();
intercept.setLoaded();
int idIndex = beanDescriptor.getIdProperty().getPropertyIndex();
for (int i = 0; i < intercept.g... | [
"public",
"static",
"<",
"T",
">",
"void",
"forceUpdateAllProperties",
"(",
"BeanDescriptor",
"<",
"T",
">",
"beanDescriptor",
",",
"T",
"model",
")",
"{",
"EntityBeanIntercept",
"intercept",
"=",
"(",
"(",
"EntityBean",
")",
"model",
")",
".",
"_ebean_getInte... | <p>forceUpdateAllProperties.</p>
@param beanDescriptor a {@link io.ebeaninternal.server.deploy.BeanDescriptor} object.
@param model a T object.
@param <T> a T object. | [
"<p",
">",
"forceUpdateAllProperties",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/EbeanUtils.java#L69-L79 |
xwiki/xwiki-rendering | xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/xwiki/xwiki20/XWikiScannerUtil.java | XWikiScannerUtil.unescapeVerbatim | public static String unescapeVerbatim(String content) {
"""
To have }}} or {{{ inside inline block we need to escape it in some
condition. This method remove this escaping to send the correct text to
the event.
"""
StringBuffer unescapedContent = new StringBuffer();
boolean escaped = false;
... | java | public static String unescapeVerbatim(String content)
{
StringBuffer unescapedContent = new StringBuffer();
boolean escaped = false;
char[] buff = content.toCharArray();
for (int i = 0; i < buff.length; ++i) {
if (!escaped) {
if (buff[i] == '~') {
... | [
"public",
"static",
"String",
"unescapeVerbatim",
"(",
"String",
"content",
")",
"{",
"StringBuffer",
"unescapedContent",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"boolean",
"escaped",
"=",
"false",
";",
"char",
"[",
"]",
"buff",
"=",
"content",
".",
"toCh... | To have }}} or {{{ inside inline block we need to escape it in some
condition. This method remove this escaping to send the correct text to
the event. | [
"To",
"have",
"}}}",
"or",
"{{{",
"inside",
"inline",
"block",
"we",
"need",
"to",
"escape",
"it",
"in",
"some",
"condition",
".",
"This",
"method",
"remove",
"this",
"escaping",
"to",
"send",
"the",
"correct",
"text",
"to",
"the",
"event",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/xwiki/xwiki20/XWikiScannerUtil.java#L35-L67 |
netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java | AbstractEpollStreamChannel.writeDefaultFileRegion | private int writeDefaultFileRegion(ChannelOutboundBuffer in, DefaultFileRegion region) throws Exception {
"""
Write a {@link DefaultFileRegion}
@param in the collection which contains objects to write.
@param region the {@link DefaultFileRegion} from which the bytes should be written
@return The value that shou... | java | private int writeDefaultFileRegion(ChannelOutboundBuffer in, DefaultFileRegion region) throws Exception {
final long offset = region.transferred();
final long regionCount = region.count();
if (offset >= regionCount) {
in.remove();
return 0;
}
final long f... | [
"private",
"int",
"writeDefaultFileRegion",
"(",
"ChannelOutboundBuffer",
"in",
",",
"DefaultFileRegion",
"region",
")",
"throws",
"Exception",
"{",
"final",
"long",
"offset",
"=",
"region",
".",
"transferred",
"(",
")",
";",
"final",
"long",
"regionCount",
"=",
... | Write a {@link DefaultFileRegion}
@param in the collection which contains objects to write.
@param region the {@link DefaultFileRegion} from which the bytes should be written
@return The value that should be decremented from the write quantum which starts at
{@link ChannelConfig#getWriteSpinCount()}. The typical use ca... | [
"Write",
"a",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java#L369-L388 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.paymentMean_bankAccount_POST | public OvhPaymentMeanValidation paymentMean_bankAccount_POST(String bic, String description, String iban, String ownerAddress, String ownerName, Boolean setDefault) throws IOException {
"""
Enable payment through a new account
REST: POST /me/paymentMean/bankAccount
@param ownerAddress [required] Account owner'... | java | public OvhPaymentMeanValidation paymentMean_bankAccount_POST(String bic, String description, String iban, String ownerAddress, String ownerName, Boolean setDefault) throws IOException {
String qPath = "/me/paymentMean/bankAccount";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Obj... | [
"public",
"OvhPaymentMeanValidation",
"paymentMean_bankAccount_POST",
"(",
"String",
"bic",
",",
"String",
"description",
",",
"String",
"iban",
",",
"String",
"ownerAddress",
",",
"String",
"ownerName",
",",
"Boolean",
"setDefault",
")",
"throws",
"IOException",
"{",... | Enable payment through a new account
REST: POST /me/paymentMean/bankAccount
@param ownerAddress [required] Account owner's address
@param bic [required] Account's BIC
@param iban [required] Account's IBAN
@param ownerName [required] Account owner's name
@param setDefault [required] Set as default payment mean once val... | [
"Enable",
"payment",
"through",
"a",
"new",
"account"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L717-L729 |
rnorth/visible-assertions | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | VisibleAssertions.assertNotNull | public static void assertNotNull(String message, Object o) {
"""
Assert that a value is not null.
<p>
If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown.
@param message message to display alongside the assertion outcome
@param o value to test
"""
... | java | public static void assertNotNull(String message, Object o) {
if (o != null) {
pass(message);
} else {
fail(message, null);
}
} | [
"public",
"static",
"void",
"assertNotNull",
"(",
"String",
"message",
",",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"!=",
"null",
")",
"{",
"pass",
"(",
"message",
")",
";",
"}",
"else",
"{",
"fail",
"(",
"message",
",",
"null",
")",
";",
"}",
"... | Assert that a value is not null.
<p>
If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown.
@param message message to display alongside the assertion outcome
@param o value to test | [
"Assert",
"that",
"a",
"value",
"is",
"not",
"null",
".",
"<p",
">",
"If",
"the",
"assertion",
"passes",
"a",
"green",
"tick",
"will",
"be",
"shown",
".",
"If",
"the",
"assertion",
"fails",
"a",
"red",
"cross",
"will",
"be",
"shown",
"."
] | train | https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L295-L301 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java | TmdbAccount.getUserLists | public ResultList<UserList> getUserLists(String sessionId, int accountId) throws MovieDbException {
"""
Get all lists of a given user
@param sessionId
@param accountId
@return The lists
@throws MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.SES... | java | public ResultList<UserList> getUserLists(String sessionId, int accountId) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.SESSION_ID, sessionId);
parameters.add(Param.ID, accountId);
URL url = new ApiUrl(apiKey, MethodBase.ACCOUNT).subMet... | [
"public",
"ResultList",
"<",
"UserList",
">",
"getUserLists",
"(",
"String",
"sessionId",
",",
"int",
"accountId",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",... | Get all lists of a given user
@param sessionId
@param accountId
@return The lists
@throws MovieDbException | [
"Get",
"all",
"lists",
"of",
"a",
"given",
"user"
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java#L90-L98 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.beginDeallocateAsync | public Observable<OperationStatusResponseInner> beginDeallocateAsync(String resourceGroupName, String vmScaleSetName) {
"""
Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual mac... | java | public Observable<OperationStatusResponseInner> beginDeallocateAsync(String resourceGroupName, String vmScaleSetName) {
return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Ov... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"beginDeallocateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"beginDeallocateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
... | Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM sc... | [
"Deallocates",
"specific",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
".",
"Shuts",
"down",
"the",
"virtual",
"machines",
"and",
"releases",
"the",
"compute",
"resources",
".",
"You",
"are",
"not",
"billed",
"for",
"the",
"compute",
"resources",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L965-L972 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/DeLiClu.java | DeLiClu.reinsertExpanded | private void reinsertExpanded(SpatialPrimitiveDistanceFunction<V> distFunction, DeLiCluTree index, IndexTreePath<DeLiCluEntry> path, DataStore<KNNList> knns) {
"""
Reinserts the objects of the already expanded nodes.
@param distFunction the spatial distance function of this algorithm
@param index the index sto... | java | private void reinsertExpanded(SpatialPrimitiveDistanceFunction<V> distFunction, DeLiCluTree index, IndexTreePath<DeLiCluEntry> path, DataStore<KNNList> knns) {
int l = 0; // Count the number of components.
for(IndexTreePath<DeLiCluEntry> it = path; it != null; it = it.getParentPath()) {
l++;
}
Arr... | [
"private",
"void",
"reinsertExpanded",
"(",
"SpatialPrimitiveDistanceFunction",
"<",
"V",
">",
"distFunction",
",",
"DeLiCluTree",
"index",
",",
"IndexTreePath",
"<",
"DeLiCluEntry",
">",
"path",
",",
"DataStore",
"<",
"KNNList",
">",
"knns",
")",
"{",
"int",
"l... | Reinserts the objects of the already expanded nodes.
@param distFunction the spatial distance function of this algorithm
@param index the index storing the objects
@param path the path of the object inserted last
@param knns the knn list | [
"Reinserts",
"the",
"objects",
"of",
"the",
"already",
"expanded",
"nodes",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/DeLiClu.java#L299-L313 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/HelloSignClient.java | HelloSignClient.getEmbeddedTemplateEditUrl | public EmbeddedResponse getEmbeddedTemplateEditUrl(String templateId) throws HelloSignException {
"""
Retrieves the necessary information to edit an embedded template.
@param templateId String ID of the signature request to embed
@return EmbeddedResponse
@throws HelloSignException thrown if there's a problem ... | java | public EmbeddedResponse getEmbeddedTemplateEditUrl(String templateId) throws HelloSignException {
return getEmbeddedTemplateEditUrl(templateId, false, false, false);
} | [
"public",
"EmbeddedResponse",
"getEmbeddedTemplateEditUrl",
"(",
"String",
"templateId",
")",
"throws",
"HelloSignException",
"{",
"return",
"getEmbeddedTemplateEditUrl",
"(",
"templateId",
",",
"false",
",",
"false",
",",
"false",
")",
";",
"}"
] | Retrieves the necessary information to edit an embedded template.
@param templateId String ID of the signature request to embed
@return EmbeddedResponse
@throws HelloSignException thrown if there's a problem processing the
HTTP request or the JSON response. | [
"Retrieves",
"the",
"necessary",
"information",
"to",
"edit",
"an",
"embedded",
"template",
"."
] | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/HelloSignClient.java#L856-L858 |
alibaba/jstorm | jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java | UIUtils.getTaskEntities | public static List<TaskEntity> getTaskEntities(TopologyInfo topologyInfo, String componentName) {
"""
get the task entities in the specific component
@param topologyInfo topology info
@param componentName component name
@return the list of task entities
"""
TreeMap<Integer, TaskEntity> tasks = new T... | java | public static List<TaskEntity> getTaskEntities(TopologyInfo topologyInfo, String componentName) {
TreeMap<Integer, TaskEntity> tasks = new TreeMap<>();
for (ComponentSummary cs : topologyInfo.get_components()) {
String compName = cs.get_name();
String type = cs.get_type();
... | [
"public",
"static",
"List",
"<",
"TaskEntity",
">",
"getTaskEntities",
"(",
"TopologyInfo",
"topologyInfo",
",",
"String",
"componentName",
")",
"{",
"TreeMap",
"<",
"Integer",
",",
"TaskEntity",
">",
"tasks",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"for... | get the task entities in the specific component
@param topologyInfo topology info
@param componentName component name
@return the list of task entities | [
"get",
"the",
"task",
"entities",
"in",
"the",
"specific",
"component"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java#L254-L279 |
auth0/Lock.Android | lib/src/main/java/com/auth0/android/lock/provider/AuthResolver.java | AuthResolver.providerFor | @Nullable
public static AuthProvider providerFor(@Nullable String strategy, @NonNull String connection) {
"""
Get an AuthProvider that can handle a given strategy and connection name, or null if there are no
providers to handle them.
@param strategy to handle
@param connection to handle
@return an Auth... | java | @Nullable
public static AuthProvider providerFor(@Nullable String strategy, @NonNull String connection) {
if (authHandlers == null) {
return null;
}
AuthProvider provider = null;
for (AuthHandler p : authHandlers) {
provider = p.providerFor(strategy, connecti... | [
"@",
"Nullable",
"public",
"static",
"AuthProvider",
"providerFor",
"(",
"@",
"Nullable",
"String",
"strategy",
",",
"@",
"NonNull",
"String",
"connection",
")",
"{",
"if",
"(",
"authHandlers",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"AuthProvide... | Get an AuthProvider that can handle a given strategy and connection name, or null if there are no
providers to handle them.
@param strategy to handle
@param connection to handle
@return an AuthProvider to handle the authentication or null if no providers are available. | [
"Get",
"an",
"AuthProvider",
"that",
"can",
"handle",
"a",
"given",
"strategy",
"and",
"connection",
"name",
"or",
"null",
"if",
"there",
"are",
"no",
"providers",
"to",
"handle",
"them",
"."
] | train | https://github.com/auth0/Lock.Android/blob/8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220/lib/src/main/java/com/auth0/android/lock/provider/AuthResolver.java#L41-L55 |
OpenLiberty/open-liberty | dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ExtendedConfigurationImpl.java | ExtendedConfigurationImpl.updateCache | @Override
public void updateCache(Dictionary<String, Object> properties, Set<ConfigID> references, Set<String> newUniques) throws IOException {
"""
Updates ConfigurationAdmin's cache with current config properties.
If replaceProp is set to true, current config properties is replace with
the given properties ... | java | @Override
public void updateCache(Dictionary<String, Object> properties, Set<ConfigID> references, Set<String> newUniques) throws IOException {
lock.lock();
try {
removeReferences();
setProperties(properties);
this.references = references;
this.unique... | [
"@",
"Override",
"public",
"void",
"updateCache",
"(",
"Dictionary",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"Set",
"<",
"ConfigID",
">",
"references",
",",
"Set",
"<",
"String",
">",
"newUniques",
")",
"throws",
"IOException",
"{",
"lock",
"... | Updates ConfigurationAdmin's cache with current config properties.
If replaceProp is set to true, current config properties is replace with
the given properties before caching
and the internal pid-to-config table is updated to reflect the new config
properties.
@param properties
@param replaceProp
@param isMetaTypePro... | [
"Updates",
"ConfigurationAdmin",
"s",
"cache",
"with",
"current",
"config",
"properties",
".",
"If",
"replaceProp",
"is",
"set",
"to",
"true",
"current",
"config",
"properties",
"is",
"replace",
"with",
"the",
"given",
"properties",
"before",
"caching",
"and",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ExtendedConfigurationImpl.java#L474-L492 |
probedock/probedock-java | src/main/java/io/probedock/client/core/connector/Connector.java | Connector.openConnection | private HttpURLConnection openConnection(ServerConfiguration configuration, URL url) throws IOException {
"""
Open a connection regarding the configuration and the URL
@param configuration The configuration to get the proxy information if necessary
@param url The URL to open the connection from
@return The op... | java | private HttpURLConnection openConnection(ServerConfiguration configuration, URL url) throws IOException {
if (configuration.hasProxyConfiguration()) {
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(configuration.getProxyConfiguration().getHost(), configuration.getProxyConfiguration().getPort()));
... | [
"private",
"HttpURLConnection",
"openConnection",
"(",
"ServerConfiguration",
"configuration",
",",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"if",
"(",
"configuration",
".",
"hasProxyConfiguration",
"(",
")",
")",
"{",
"Proxy",
"proxy",
"=",
"new",
"Proxy"... | Open a connection regarding the configuration and the URL
@param configuration The configuration to get the proxy information if necessary
@param url The URL to open the connection from
@return The opened connection
@throws IOException In case of error when opening the connection | [
"Open",
"a",
"connection",
"regarding",
"the",
"configuration",
"and",
"the",
"URL"
] | train | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/core/connector/Connector.java#L172-L180 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/query/filter/JavaScriptDimFilter.java | JavaScriptDimFilter.getPredicateFactory | @EnsuresNonNull("predicateFactory")
private JavaScriptPredicateFactory getPredicateFactory() {
"""
This class can be used by multiple threads, so this function should be thread-safe to avoid extra
script compilation.
"""
// JavaScript configuration should be checked when it's actually used because someo... | java | @EnsuresNonNull("predicateFactory")
private JavaScriptPredicateFactory getPredicateFactory()
{
// JavaScript configuration should be checked when it's actually used because someone might still want Druid
// nodes to be able to deserialize JavaScript-based objects even though JavaScript is disabled.
Prec... | [
"@",
"EnsuresNonNull",
"(",
"\"predicateFactory\"",
")",
"private",
"JavaScriptPredicateFactory",
"getPredicateFactory",
"(",
")",
"{",
"// JavaScript configuration should be checked when it's actually used because someone might still want Druid",
"// nodes to be able to deserialize JavaScri... | This class can be used by multiple threads, so this function should be thread-safe to avoid extra
script compilation. | [
"This",
"class",
"can",
"be",
"used",
"by",
"multiple",
"threads",
"so",
"this",
"function",
"should",
"be",
"thread",
"-",
"safe",
"to",
"avoid",
"extra",
"script",
"compilation",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/query/filter/JavaScriptDimFilter.java#L128-L146 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/beans/AbstractBean.java | AbstractBean.processChange | protected void processChange(String propertyName, Object oldValue, Object newValue) {
"""
Processes the change in state to the particular property of this Bean. A PropertyChangeEvent is created
to notify all listeners of the state change. First, VetoableChangeListeners are notified of the pending change
in ord... | java | protected void processChange(String propertyName, Object oldValue, Object newValue) {
processChange(propertyName, oldValue, newValue, null);
} | [
"protected",
"void",
"processChange",
"(",
"String",
"propertyName",
",",
"Object",
"oldValue",
",",
"Object",
"newValue",
")",
"{",
"processChange",
"(",
"propertyName",
",",
"oldValue",
",",
"newValue",
",",
"null",
")",
";",
"}"
] | Processes the change in state to the particular property of this Bean. A PropertyChangeEvent is created
to notify all listeners of the state change. First, VetoableChangeListeners are notified of the pending change
in order to validate the change and veto any undesired change to the specified property. Next, the sta... | [
"Processes",
"the",
"change",
"in",
"state",
"to",
"the",
"particular",
"property",
"of",
"this",
"Bean",
".",
"A",
"PropertyChangeEvent",
"is",
"created",
"to",
"notify",
"all",
"listeners",
"of",
"the",
"state",
"change",
".",
"First",
"VetoableChangeListeners... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/beans/AbstractBean.java#L642-L644 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getUsersBatch | public OneLoginResponse<User> getUsersBatch(HashMap<String, String> queryParameters, int batchSize, String afterCursor)
throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Get a batch of Users.
@param queryParameters Query parameters of the Resource
@param batchSize Size of the Batc... | java | public OneLoginResponse<User> getUsersBatch(HashMap<String, String> queryParameters, int batchSize, String afterCursor)
throws OAuthSystemException, OAuthProblemException, URISyntaxException {
ExtractionContext context = extractResourceBatch(queryParameters, batchSize, afterCursor, Constants.GET_USERS_URL);
List... | [
"public",
"OneLoginResponse",
"<",
"User",
">",
"getUsersBatch",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"queryParameters",
",",
"int",
"batchSize",
",",
"String",
"afterCursor",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
... | Get a batch of Users.
@param queryParameters Query parameters of the Resource
@param batchSize Size of the Batch
@param afterCursor Reference to continue collecting items of next page
@return OneLoginResponse of User (Batch)
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLCo... | [
"Get",
"a",
"batch",
"of",
"Users",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L397-L403 |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/DoubleHistogram.java | DoubleHistogram.getCountBetweenValues | public double getCountBetweenValues(final double lowValue, final double highValue)
throws ArrayIndexOutOfBoundsException {
"""
Get the count of recorded values within a range of value levels (inclusive to within the histogram's resolution).
@param lowValue The lower value bound on the range for whi... | java | public double getCountBetweenValues(final double lowValue, final double highValue)
throws ArrayIndexOutOfBoundsException {
return integerValuesHistogram.getCountBetweenValues(
(long)(lowValue * doubleToIntegerValueConversionRatio),
(long)(highValue * doubleToIntegerVa... | [
"public",
"double",
"getCountBetweenValues",
"(",
"final",
"double",
"lowValue",
",",
"final",
"double",
"highValue",
")",
"throws",
"ArrayIndexOutOfBoundsException",
"{",
"return",
"integerValuesHistogram",
".",
"getCountBetweenValues",
"(",
"(",
"long",
")",
"(",
"l... | Get the count of recorded values within a range of value levels (inclusive to within the histogram's resolution).
@param lowValue The lower value bound on the range for which
to provide the recorded count. Will be rounded down with
{@link DoubleHistogram#lowestEquivalentValue lowestEquivalentValue}.
@param highValue ... | [
"Get",
"the",
"count",
"of",
"recorded",
"values",
"within",
"a",
"range",
"of",
"value",
"levels",
"(",
"inclusive",
"to",
"within",
"the",
"histogram",
"s",
"resolution",
")",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/DoubleHistogram.java#L1078-L1084 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/tools/BTools.java | BTools.getSDbl | public static String getSDbl( double Value, int DecPrec, boolean ShowPlusSign ) {
"""
<b>getSDbl</b><br>
public static String getSDbl( double Value, int DecPrec, boolean ShowPlusSign )<br>
Returns double converted to string.<br>
If Value is Double.NaN returns "NaN".<br>
If DecPrec is < 0 is DecPrec set 0.<br>
... | java | public static String getSDbl( double Value, int DecPrec, boolean ShowPlusSign ) {
//
String PlusSign = "";
//
if ( ShowPlusSign && Value > 0 ) PlusSign = "+";
if ( ShowPlusSign && Value == 0 ) PlusSign = " ";
//
return PlusSign + getSDbl( Value, DecPrec );
} | [
"public",
"static",
"String",
"getSDbl",
"(",
"double",
"Value",
",",
"int",
"DecPrec",
",",
"boolean",
"ShowPlusSign",
")",
"{",
"//",
"String",
"PlusSign",
"=",
"\"\"",
";",
"//",
"if",
"(",
"ShowPlusSign",
"&&",
"Value",
">",
"0",
")",
"PlusSign",
"="... | <b>getSDbl</b><br>
public static String getSDbl( double Value, int DecPrec, boolean ShowPlusSign )<br>
Returns double converted to string.<br>
If Value is Double.NaN returns "NaN".<br>
If DecPrec is < 0 is DecPrec set 0.<br>
If ShowPlusSign is true:<br>
- If Value is > 0 sign is '+'.<br>
- If Value is 0 sign is ' '.<br... | [
"<b",
">",
"getSDbl<",
"/",
"b",
">",
"<br",
">",
"public",
"static",
"String",
"getSDbl",
"(",
"double",
"Value",
"int",
"DecPrec",
"boolean",
"ShowPlusSign",
")",
"<br",
">",
"Returns",
"double",
"converted",
"to",
"string",
".",
"<br",
">",
"If",
"Val... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/tools/BTools.java#L193-L201 |
aragozin/jvm-tools | hprof-heap/src/main/java/org/netbeans/lib/profiler/heap/HeapFactory.java | HeapFactory.createFastHeap | public static Heap createFastHeap(File heapDump, long bufferSize) throws FileNotFoundException, IOException {
"""
Fast {@link Heap} implementation is optimized for batch processing of dump.
Unlike normal {@link Heap} it doesn't create/use any temporary files.
@param bufferSize if file can be mapped to memory n... | java | public static Heap createFastHeap(File heapDump, long bufferSize) throws FileNotFoundException, IOException {
return new FastHprofHeap(createBuffer(heapDump, bufferSize), 0);
} | [
"public",
"static",
"Heap",
"createFastHeap",
"(",
"File",
"heapDump",
",",
"long",
"bufferSize",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"new",
"FastHprofHeap",
"(",
"createBuffer",
"(",
"heapDump",
",",
"bufferSize",
")",
",",
... | Fast {@link Heap} implementation is optimized for batch processing of dump.
Unlike normal {@link Heap} it doesn't create/use any temporary files.
@param bufferSize if file can be mapped to memory no buffer would be used, overwise limits memory used for buffering | [
"Fast",
"{",
"@link",
"Heap",
"}",
"implementation",
"is",
"optimized",
"for",
"batch",
"processing",
"of",
"dump",
".",
"Unlike",
"normal",
"{",
"@link",
"Heap",
"}",
"it",
"doesn",
"t",
"create",
"/",
"use",
"any",
"temporary",
"files",
"."
] | train | https://github.com/aragozin/jvm-tools/blob/d3a4d0c6a47fb9317f274988569655f30dcd2f76/hprof-heap/src/main/java/org/netbeans/lib/profiler/heap/HeapFactory.java#L102-L104 |
square/javapoet | src/main/java/com/squareup/javapoet/ParameterizedTypeName.java | ParameterizedTypeName.nestedClass | public ParameterizedTypeName nestedClass(String name, List<TypeName> typeArguments) {
"""
Returns a new {@link ParameterizedTypeName} instance for the specified {@code name} as nested
inside this class, with the specified {@code typeArguments}.
"""
checkNotNull(name, "name == null");
return new Parame... | java | public ParameterizedTypeName nestedClass(String name, List<TypeName> typeArguments) {
checkNotNull(name, "name == null");
return new ParameterizedTypeName(this, rawType.nestedClass(name), typeArguments,
new ArrayList<>());
} | [
"public",
"ParameterizedTypeName",
"nestedClass",
"(",
"String",
"name",
",",
"List",
"<",
"TypeName",
">",
"typeArguments",
")",
"{",
"checkNotNull",
"(",
"name",
",",
"\"name == null\"",
")",
";",
"return",
"new",
"ParameterizedTypeName",
"(",
"this",
",",
"ra... | Returns a new {@link ParameterizedTypeName} instance for the specified {@code name} as nested
inside this class, with the specified {@code typeArguments}. | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/square/javapoet/blob/0f93da9a3d9a1da8d29fc993409fcf83d40452bc/src/main/java/com/squareup/javapoet/ParameterizedTypeName.java#L106-L110 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Collectors.java | Collectors.last | public static <T> Collector<T, ?, List<T>> last(final int n) {
"""
Only works for sequential Stream.
@param n
@return
@throws UnsupportedOperationException operated by multiple threads
"""
N.checkArgNotNegative(n, "n");
final Supplier<Deque<T>> supplier = new Supplier<Deque<T>>() {
... | java | public static <T> Collector<T, ?, List<T>> last(final int n) {
N.checkArgNotNegative(n, "n");
final Supplier<Deque<T>> supplier = new Supplier<Deque<T>>() {
@Override
public Deque<T> get() {
return n <= 1024 ? new ArrayDeque<T>(n) : new LinkedList<T>();
... | [
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"List",
"<",
"T",
">",
">",
"last",
"(",
"final",
"int",
"n",
")",
"{",
"N",
".",
"checkArgNotNegative",
"(",
"n",
",",
"\"n\"",
")",
";",
"final",
"Supplier",
"<",
"Deque",... | Only works for sequential Stream.
@param n
@return
@throws UnsupportedOperationException operated by multiple threads | [
"Only",
"works",
"for",
"sequential",
"Stream",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Collectors.java#L1501-L1547 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getSharedFlow | public static SharedFlowController getSharedFlow( String sharedFlowClassName, HttpServletRequest request ) {
"""
Get the shared flow with the given class name.
@deprecated Use {@link #getSharedFlow(String, HttpServletRequest, ServletContext)} instead.
@param sharedFlowClassName the class name of the shared flo... | java | public static SharedFlowController getSharedFlow( String sharedFlowClassName, HttpServletRequest request )
{
ServletContext servletContext = InternalUtils.getServletContext( request );
return getSharedFlow( sharedFlowClassName, request, servletContext );
} | [
"public",
"static",
"SharedFlowController",
"getSharedFlow",
"(",
"String",
"sharedFlowClassName",
",",
"HttpServletRequest",
"request",
")",
"{",
"ServletContext",
"servletContext",
"=",
"InternalUtils",
".",
"getServletContext",
"(",
"request",
")",
";",
"return",
"ge... | Get the shared flow with the given class name.
@deprecated Use {@link #getSharedFlow(String, HttpServletRequest, ServletContext)} instead.
@param sharedFlowClassName the class name of the shared flow to retrieve.
@param request the current HttpServletRequest.
@return the {@link SharedFlowController} of the given class... | [
"Get",
"the",
"shared",
"flow",
"with",
"the",
"given",
"class",
"name",
".",
"@deprecated",
"Use",
"{",
"@link",
"#getSharedFlow",
"(",
"String",
"HttpServletRequest",
"ServletContext",
")",
"}",
"instead",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L361-L365 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.retrieveBean | @Override
public <T> T retrieveBean(String name, T bean) throws CpoException {
"""
Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource. If the retrieve
function defined for this beans returns more than one row, an exception will be thrown.
@param name DOCUMENT ME!... | java | @Override
public <T> T retrieveBean(String name, T bean) throws CpoException {
return processSelectGroup(bean, name, null, null, null);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"retrieveBean",
"(",
"String",
"name",
",",
"T",
"bean",
")",
"throws",
"CpoException",
"{",
"return",
"processSelectGroup",
"(",
"bean",
",",
"name",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource. If the retrieve
function defined for this beans returns more than one row, an exception will be thrown.
@param name DOCUMENT ME!
@param bean This is an bean that has been defined within the metadata of the datasource. If ... | [
"Retrieves",
"the",
"bean",
"from",
"the",
"datasource",
".",
"The",
"assumption",
"is",
"that",
"the",
"bean",
"exists",
"in",
"the",
"datasource",
".",
"If",
"the",
"retrieve",
"function",
"defined",
"for",
"this",
"beans",
"returns",
"more",
"than",
"one"... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L1359-L1362 |
Clivern/Racter | src/main/java/com/clivern/racter/senders/templates/ReceiptTemplate.java | ReceiptTemplate.setSummary | public void setSummary(String subtotal, String shipping_cost, String total_tax, String total_cost) {
"""
Set Summary
@param subtotal the receipt sub-total
@param shipping_cost the receipt shipping cost
@param total_tax the receipt total tax
@param total_cost the receipt total cost
"""
this.summar... | java | public void setSummary(String subtotal, String shipping_cost, String total_tax, String total_cost)
{
this.summary.put("subtotal", subtotal);
this.summary.put("shipping_cost", shipping_cost);
this.summary.put("total_tax", total_tax);
this.summary.put("total_cost", total_cost);
} | [
"public",
"void",
"setSummary",
"(",
"String",
"subtotal",
",",
"String",
"shipping_cost",
",",
"String",
"total_tax",
",",
"String",
"total_cost",
")",
"{",
"this",
".",
"summary",
".",
"put",
"(",
"\"subtotal\"",
",",
"subtotal",
")",
";",
"this",
".",
"... | Set Summary
@param subtotal the receipt sub-total
@param shipping_cost the receipt shipping cost
@param total_tax the receipt total tax
@param total_cost the receipt total cost | [
"Set",
"Summary"
] | train | https://github.com/Clivern/Racter/blob/bbde02f0c2a8a80653ad6b1607376d8408acd71c/src/main/java/com/clivern/racter/senders/templates/ReceiptTemplate.java#L172-L178 |
cloudendpoints/endpoints-management-java | endpoints-control/src/main/java/com/google/api/control/model/PathTemplate.java | PathTemplate.matchFromFullName | @Nullable
public ImmutableMap<String, String> matchFromFullName(String path) {
"""
Matches the path, where the first segment is interpreted as the host name regardless of whether
it starts with '//' or not. Example: <pre>
assert template("{name=shelves/*}").matchFromFullName("somewhere.io/shelves/s1")
.equals... | java | @Nullable
public ImmutableMap<String, String> matchFromFullName(String path) {
return match(path, true);
} | [
"@",
"Nullable",
"public",
"ImmutableMap",
"<",
"String",
",",
"String",
">",
"matchFromFullName",
"(",
"String",
"path",
")",
"{",
"return",
"match",
"(",
"path",
",",
"true",
")",
";",
"}"
] | Matches the path, where the first segment is interpreted as the host name regardless of whether
it starts with '//' or not. Example: <pre>
assert template("{name=shelves/*}").matchFromFullName("somewhere.io/shelves/s1")
.equals(ImmutableMap.of(HOSTNAME_VAR, "somewhere.io", "name", "shelves/s1"));
</pre> | [
"Matches",
"the",
"path",
"where",
"the",
"first",
"segment",
"is",
"interpreted",
"as",
"the",
"host",
"name",
"regardless",
"of",
"whether",
"it",
"starts",
"with",
"//",
"or",
"not",
".",
"Example",
":",
"<pre",
">",
"assert",
"template",
"(",
"{",
"n... | train | https://github.com/cloudendpoints/endpoints-management-java/blob/5bbf20ddadbbd51b890049e3c338c28abe2c9f94/endpoints-control/src/main/java/com/google/api/control/model/PathTemplate.java#L459-L462 |
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/MustBeSmallerOrEqualValidator.java | MustBeSmallerOrEqualValidator.isValid | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
"""
{@inheritDoc} check if given object is valid.
@see javax.validation.ConstraintValidator#isValid(Object,
javax.validation.ConstraintValidatorContext)
"""
if (pvalue == null) {
return true... | java | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
if (pvalue == null) {
return true;
}
try {
final Object field1Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field1Name);
final Object field2Value = BeanPropertyReaderUtil... | [
"@",
"Override",
"public",
"final",
"boolean",
"isValid",
"(",
"final",
"Object",
"pvalue",
",",
"final",
"ConstraintValidatorContext",
"pcontext",
")",
"{",
"if",
"(",
"pvalue",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"final",
"Obj... | {@inheritDoc} check if given object is valid.
@see javax.validation.ConstraintValidator#isValid(Object,
javax.validation.ConstraintValidatorContext) | [
"{",
"@inheritDoc",
"}",
"check",
"if",
"given",
"object",
"is",
"valid",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/MustBeSmallerOrEqualValidator.java#L76-L93 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.multiplyAndRound | private static BigDecimal multiplyAndRound(long x, long y, int scale, MathContext mc) {
"""
Multiplies two long values and rounds according {@code MathContext}
"""
long product = multiply(x, y);
if(product!=INFLATED) {
return doRound(product, scale, mc);
}
// attempt... | java | private static BigDecimal multiplyAndRound(long x, long y, int scale, MathContext mc) {
long product = multiply(x, y);
if(product!=INFLATED) {
return doRound(product, scale, mc);
}
// attempt to do it in 128 bits
int rsign = 1;
if(x < 0) {
x = -x;
... | [
"private",
"static",
"BigDecimal",
"multiplyAndRound",
"(",
"long",
"x",
",",
"long",
"y",
",",
"int",
"scale",
",",
"MathContext",
"mc",
")",
"{",
"long",
"product",
"=",
"multiply",
"(",
"x",
",",
"y",
")",
";",
"if",
"(",
"product",
"!=",
"INFLATED"... | Multiplies two long values and rounds according {@code MathContext} | [
"Multiplies",
"two",
"long",
"values",
"and",
"rounds",
"according",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L5024-L5066 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java | JsonUtil.put | public static void put(Writer writer, Enum<?> value) throws IOException {
"""
Writes the given value with the given writer.
@param writer
@param value
@throws IOException
@author vvakame
"""
if (value == null) {
writer.write("null");
} else {
writer.write("\"");
writer.write(sanitize(value.nam... | java | public static void put(Writer writer, Enum<?> value) throws IOException {
if (value == null) {
writer.write("null");
} else {
writer.write("\"");
writer.write(sanitize(value.name()));
writer.write("\"");
}
} | [
"public",
"static",
"void",
"put",
"(",
"Writer",
"writer",
",",
"Enum",
"<",
"?",
">",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"writer",
".",
"write",
"(",
"\"null\"",
")",
";",
"}",
"else",
"{",
"wr... | Writes the given value with the given writer.
@param writer
@param value
@throws IOException
@author vvakame | [
"Writes",
"the",
"given",
"value",
"with",
"the",
"given",
"writer",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java#L585-L593 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/impl/ImplRectifyImageOps_F64.java | ImplRectifyImageOps_F64.adjustCalibrated | private static void adjustCalibrated(DMatrixRMaj rectifyLeft, DMatrixRMaj rectifyRight,
DMatrixRMaj rectifyK,
RectangleLength2D_F64 bound, double scale) {
"""
Internal function which applies the rectification adjustment to a calibrated stereo pair
"""
// translation
double deltaX = -b... | java | private static void adjustCalibrated(DMatrixRMaj rectifyLeft, DMatrixRMaj rectifyRight,
DMatrixRMaj rectifyK,
RectangleLength2D_F64 bound, double scale) {
// translation
double deltaX = -bound.x0*scale;
double deltaY = -bound.y0*scale;
// adjustment matrix
SimpleMatrix A = new SimpleMat... | [
"private",
"static",
"void",
"adjustCalibrated",
"(",
"DMatrixRMaj",
"rectifyLeft",
",",
"DMatrixRMaj",
"rectifyRight",
",",
"DMatrixRMaj",
"rectifyK",
",",
"RectangleLength2D_F64",
"bound",
",",
"double",
"scale",
")",
"{",
"// translation",
"double",
"deltaX",
"=",
... | Internal function which applies the rectification adjustment to a calibrated stereo pair | [
"Internal",
"function",
"which",
"applies",
"the",
"rectification",
"adjustment",
"to",
"a",
"calibrated",
"stereo",
"pair"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/impl/ImplRectifyImageOps_F64.java#L127-L151 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.deletePublishList | public void deletePublishList(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException {
"""
Deletes the publish list assigned to a publish job.<p>
@param dbc the current database context
@param publishHistoryId the history id identifying the publish job
@throws CmsException if something goes wrong
... | java | public void deletePublishList(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException {
getProjectDriver(dbc).deletePublishList(dbc, publishHistoryId);
} | [
"public",
"void",
"deletePublishList",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUUID",
"publishHistoryId",
")",
"throws",
"CmsException",
"{",
"getProjectDriver",
"(",
"dbc",
")",
".",
"deletePublishList",
"(",
"dbc",
",",
"publishHistoryId",
")",
";",
"}"
] | Deletes the publish list assigned to a publish job.<p>
@param dbc the current database context
@param publishHistoryId the history id identifying the publish job
@throws CmsException if something goes wrong | [
"Deletes",
"the",
"publish",
"list",
"assigned",
"to",
"a",
"publish",
"job",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L2787-L2790 |
ragnor/simple-spring-memcached | simple-spring-memcached/src/main/java/com/google/code/ssm/CacheFactory.java | CacheFactory.createCache | protected Cache createCache() throws IOException {
"""
Only one cache is created.
@return cache
@throws IOException
"""
// this factory creates only one single cache and return it if someone invoked this method twice or
// more
if (cache != null) {
throw new IllegalState... | java | protected Cache createCache() throws IOException {
// this factory creates only one single cache and return it if someone invoked this method twice or
// more
if (cache != null) {
throw new IllegalStateException(String.format("This factory has already created memcached client for cac... | [
"protected",
"Cache",
"createCache",
"(",
")",
"throws",
"IOException",
"{",
"// this factory creates only one single cache and return it if someone invoked this method twice or",
"// more",
"if",
"(",
"cache",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
... | Only one cache is created.
@return cache
@throws IOException | [
"Only",
"one",
"cache",
"is",
"created",
"."
] | train | https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/simple-spring-memcached/src/main/java/com/google/code/ssm/CacheFactory.java#L182-L205 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesInner.java | FavoritesInner.updateAsync | public Observable<ApplicationInsightsComponentFavoriteInner> updateAsync(String resourceGroupName, String resourceName, String favoriteId, ApplicationInsightsComponentFavoriteInner favoriteProperties) {
"""
Updates a favorite that has already been added to an Application Insights component.
@param resourceGroup... | java | public Observable<ApplicationInsightsComponentFavoriteInner> updateAsync(String resourceGroupName, String resourceName, String favoriteId, ApplicationInsightsComponentFavoriteInner favoriteProperties) {
return updateWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties).map(ne... | [
"public",
"Observable",
"<",
"ApplicationInsightsComponentFavoriteInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"favoriteId",
",",
"ApplicationInsightsComponentFavoriteInner",
"favoriteProperties",
")",
"{",
"ret... | Updates a favorite that has already been added to an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param favoriteId The Id of a specific favorite defined in the Application Insights component
@param... | [
"Updates",
"a",
"favorite",
"that",
"has",
"already",
"been",
"added",
"to",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesInner.java#L508-L515 |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.executeScript | public PowerShellResponse executeScript(BufferedReader srcReader, String params) {
"""
Execute the provided PowerShell script in PowerShell console and gets
result.
@param srcReader the script as BufferedReader (when loading File from jar)
@param params the parameters of the script
@return response with t... | java | public PowerShellResponse executeScript(BufferedReader srcReader, String params) {
PowerShellResponse response;
if (srcReader != null) {
File tmpFile = createWriteTempFile(srcReader);
if (tmpFile != null) {
this.scriptMode = true;
response = execut... | [
"public",
"PowerShellResponse",
"executeScript",
"(",
"BufferedReader",
"srcReader",
",",
"String",
"params",
")",
"{",
"PowerShellResponse",
"response",
";",
"if",
"(",
"srcReader",
"!=",
"null",
")",
"{",
"File",
"tmpFile",
"=",
"createWriteTempFile",
"(",
"srcR... | Execute the provided PowerShell script in PowerShell console and gets
result.
@param srcReader the script as BufferedReader (when loading File from jar)
@param params the parameters of the script
@return response with the output of the command | [
"Execute",
"the",
"provided",
"PowerShell",
"script",
"in",
"PowerShell",
"console",
"and",
"gets",
"result",
"."
] | train | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L332-L349 |
wcm-io/wcm-io-tooling | commons/content-package-builder/src/main/java/io/wcm/tooling/commons/contentpackagebuilder/ContentPackage.java | ContentPackage.writeXmlDocument | private void writeXmlDocument(String path, Document doc) throws IOException {
"""
Writes an XML document as binary file entry to the ZIP output stream.
@param path Content path
@param doc XML content
@throws IOException I/O exception
"""
zip.putNextEntry(new ZipEntry(path));
try {
DOMSource so... | java | private void writeXmlDocument(String path, Document doc) throws IOException {
zip.putNextEntry(new ZipEntry(path));
try {
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(zip);
transformer.transform(source, result);
}
catch (TransformerException ex) {
... | [
"private",
"void",
"writeXmlDocument",
"(",
"String",
"path",
",",
"Document",
"doc",
")",
"throws",
"IOException",
"{",
"zip",
".",
"putNextEntry",
"(",
"new",
"ZipEntry",
"(",
"path",
")",
")",
";",
"try",
"{",
"DOMSource",
"source",
"=",
"new",
"DOMSour... | Writes an XML document as binary file entry to the ZIP output stream.
@param path Content path
@param doc XML content
@throws IOException I/O exception | [
"Writes",
"an",
"XML",
"document",
"as",
"binary",
"file",
"entry",
"to",
"the",
"ZIP",
"output",
"stream",
"."
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/commons/content-package-builder/src/main/java/io/wcm/tooling/commons/contentpackagebuilder/ContentPackage.java#L351-L364 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.deletePath | public static void deletePath(FileSystem fs, Path f, boolean recursive) throws IOException {
"""
A wrapper around {@link FileSystem#delete(Path, boolean)} which throws {@link IOException} if the given
{@link Path} exists, and {@link FileSystem#delete(Path, boolean)} returns False.
"""
if (fs.exists(f) && ... | java | public static void deletePath(FileSystem fs, Path f, boolean recursive) throws IOException {
if (fs.exists(f) && !fs.delete(f, recursive)) {
throw new IOException("Failed to delete: " + f);
}
} | [
"public",
"static",
"void",
"deletePath",
"(",
"FileSystem",
"fs",
",",
"Path",
"f",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fs",
".",
"exists",
"(",
"f",
")",
"&&",
"!",
"fs",
".",
"delete",
"(",
"f",
",",
"recurs... | A wrapper around {@link FileSystem#delete(Path, boolean)} which throws {@link IOException} if the given
{@link Path} exists, and {@link FileSystem#delete(Path, boolean)} returns False. | [
"A",
"wrapper",
"around",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L147-L151 |
Karumi/Dexter | dexter/src/main/java/com/karumi/dexter/DexterInstance.java | DexterInstance.checkPermission | void checkPermission(PermissionListener listener, String permission, Thread thread) {
"""
Checks the state of a specific permission reporting it when ready to the listener.
@param listener The class that will be reported when the state of the permission is ready
@param permission One of the values found in {@l... | java | void checkPermission(PermissionListener listener, String permission, Thread thread) {
checkSinglePermission(listener, permission, thread);
} | [
"void",
"checkPermission",
"(",
"PermissionListener",
"listener",
",",
"String",
"permission",
",",
"Thread",
"thread",
")",
"{",
"checkSinglePermission",
"(",
"listener",
",",
"permission",
",",
"thread",
")",
";",
"}"
] | Checks the state of a specific permission reporting it when ready to the listener.
@param listener The class that will be reported when the state of the permission is ready
@param permission One of the values found in {@link android.Manifest.permission}
@param thread thread the Listener methods will be called on | [
"Checks",
"the",
"state",
"of",
"a",
"specific",
"permission",
"reporting",
"it",
"when",
"ready",
"to",
"the",
"listener",
"."
] | train | https://github.com/Karumi/Dexter/blob/11cfa35a2eaa51f01f6678adb69bed0382a867e7/dexter/src/main/java/com/karumi/dexter/DexterInstance.java#L85-L87 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/internal/PageFlowTagUtils.java | PageFlowTagUtils.rewriteActionURL | public static String rewriteActionURL(PageContext pageContext, String action, Map params, String location)
throws URISyntaxException {
"""
Create a fully-rewritten url from an initial action url with query parameters
and an anchor (location on page), checking if it needs to be secure then call
the re... | java | public static String rewriteActionURL(PageContext pageContext, String action, Map params, String location)
throws URISyntaxException
{
ServletContext servletContext = pageContext.getServletContext();
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
Http... | [
"public",
"static",
"String",
"rewriteActionURL",
"(",
"PageContext",
"pageContext",
",",
"String",
"action",
",",
"Map",
"params",
",",
"String",
"location",
")",
"throws",
"URISyntaxException",
"{",
"ServletContext",
"servletContext",
"=",
"pageContext",
".",
"get... | Create a fully-rewritten url from an initial action url with query parameters
and an anchor (location on page), checking if it needs to be secure then call
the rewriter service using a type of {@link org.apache.beehive.netui.core.urls.URLType#ACTION}.
@param pageContext the current PageContext.
@param action the a... | [
"Create",
"a",
"fully",
"-",
"rewritten",
"url",
"from",
"an",
"initial",
"action",
"url",
"with",
"query",
"parameters",
"and",
"an",
"anchor",
"(",
"location",
"on",
"page",
")",
"checking",
"if",
"it",
"needs",
"to",
"be",
"secure",
"then",
"call",
"t... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/internal/PageFlowTagUtils.java#L60-L69 |
google/auto | value/src/main/java/com/google/auto/value/processor/AutoValueOrOneOfProcessor.java | AutoValueOrOneOfProcessor.fixReservedIdentifiers | static void fixReservedIdentifiers(Map<?, String> methodToIdentifier) {
"""
Modifies the values of the given map to avoid reserved words. If we have a getter called {@code
getPackage()} then we can't use the identifier {@code package} to represent its value since
that's a reserved word.
"""
for (Map.Entr... | java | static void fixReservedIdentifiers(Map<?, String> methodToIdentifier) {
for (Map.Entry<?, String> entry : methodToIdentifier.entrySet()) {
if (SourceVersion.isKeyword(entry.getValue())) {
entry.setValue(disambiguate(entry.getValue(), methodToIdentifier.values()));
}
}
} | [
"static",
"void",
"fixReservedIdentifiers",
"(",
"Map",
"<",
"?",
",",
"String",
">",
"methodToIdentifier",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"?",
",",
"String",
">",
"entry",
":",
"methodToIdentifier",
".",
"entrySet",
"(",
")",
")",
"{",
... | Modifies the values of the given map to avoid reserved words. If we have a getter called {@code
getPackage()} then we can't use the identifier {@code package} to represent its value since
that's a reserved word. | [
"Modifies",
"the",
"values",
"of",
"the",
"given",
"map",
"to",
"avoid",
"reserved",
"words",
".",
"If",
"we",
"have",
"a",
"getter",
"called",
"{"
] | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/value/src/main/java/com/google/auto/value/processor/AutoValueOrOneOfProcessor.java#L639-L645 |
rzwitserloot/lombok | src/core/lombok/eclipse/handlers/HandleSuperBuilder.java | HandleSuperBuilder.generateStaticFillValuesMethod | private MethodDeclaration generateStaticFillValuesMethod(EclipseNode tdParent, String builderClassName, TypeParameter[] typeParams, java.util.List<BuilderFieldData> builderFields, ASTNode source) {
"""
Generates a <code>$fillValuesFromInstanceIntoBuilder()</code> method in
the builder implementation class that co... | java | private MethodDeclaration generateStaticFillValuesMethod(EclipseNode tdParent, String builderClassName, TypeParameter[] typeParams, java.util.List<BuilderFieldData> builderFields, ASTNode source) {
MethodDeclaration out = new MethodDeclaration(((CompilationUnitDeclaration) tdParent.top().get()).compilationResult);
... | [
"private",
"MethodDeclaration",
"generateStaticFillValuesMethod",
"(",
"EclipseNode",
"tdParent",
",",
"String",
"builderClassName",
",",
"TypeParameter",
"[",
"]",
"typeParams",
",",
"java",
".",
"util",
".",
"List",
"<",
"BuilderFieldData",
">",
"builderFields",
","... | Generates a <code>$fillValuesFromInstanceIntoBuilder()</code> method in
the builder implementation class that copies all fields from the instance
to the builder. It looks like this:
<pre>
protected B $fillValuesFromInstanceIntoBuilder(Foobar instance, FoobarBuilder<?, ?> b) {
b.field(instance.field);
}
</pre> | [
"Generates",
"a",
"<code",
">",
"$fillValuesFromInstanceIntoBuilder",
"()",
"<",
"/",
"code",
">",
"method",
"in",
"the",
"builder",
"implementation",
"class",
"that",
"copies",
"all",
"fields",
"from",
"the",
"instance",
"to",
"the",
"builder",
".",
"It",
"lo... | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java#L688-L715 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.stripTrailingZeros | public BigDecimal stripTrailingZeros() {
"""
Returns a {@code BigDecimal} which is numerically equal to
this one but with any trailing zeros removed from the
representation. For example, stripping the trailing zeros from
the {@code BigDecimal} value {@code 600.0}, which has
[{@code BigInteger}, {@code scale}]... | java | public BigDecimal stripTrailingZeros() {
if (intCompact == 0 || (intVal != null && intVal.signum() == 0)) {
return BigDecimal.ZERO;
} else if (intCompact != INFLATED) {
return createAndStripZerosToMatchScale(intCompact, scale, Long.MIN_VALUE);
} else {
return ... | [
"public",
"BigDecimal",
"stripTrailingZeros",
"(",
")",
"{",
"if",
"(",
"intCompact",
"==",
"0",
"||",
"(",
"intVal",
"!=",
"null",
"&&",
"intVal",
".",
"signum",
"(",
")",
"==",
"0",
")",
")",
"{",
"return",
"BigDecimal",
".",
"ZERO",
";",
"}",
"els... | Returns a {@code BigDecimal} which is numerically equal to
this one but with any trailing zeros removed from the
representation. For example, stripping the trailing zeros from
the {@code BigDecimal} value {@code 600.0}, which has
[{@code BigInteger}, {@code scale}] components equals to
[6000, 1], yields {@code 6E2} wi... | [
"Returns",
"a",
"{",
"@code",
"BigDecimal",
"}",
"which",
"is",
"numerically",
"equal",
"to",
"this",
"one",
"but",
"with",
"any",
"trailing",
"zeros",
"removed",
"from",
"the",
"representation",
".",
"For",
"example",
"stripping",
"the",
"trailing",
"zeros",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L2596-L2604 |
Azure/azure-sdk-for-java | devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllersInner.java | ControllersInner.beginCreate | public ControllerInner beginCreate(String resourceGroupName, String name, ControllerInner controller) {
"""
Creates an Azure Dev Spaces Controller.
Creates an Azure Dev Spaces Controller with the specified create parameters.
@param resourceGroupName Resource group to which the resource belongs.
@param name Na... | java | public ControllerInner beginCreate(String resourceGroupName, String name, ControllerInner controller) {
return beginCreateWithServiceResponseAsync(resourceGroupName, name, controller).toBlocking().single().body();
} | [
"public",
"ControllerInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"ControllerInner",
"controller",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"controller",
")",
".",
... | Creates an Azure Dev Spaces Controller.
Creates an Azure Dev Spaces Controller with the specified create parameters.
@param resourceGroupName Resource group to which the resource belongs.
@param name Name of the resource.
@param controller Controller create parameters.
@throws IllegalArgumentException thrown if parame... | [
"Creates",
"an",
"Azure",
"Dev",
"Spaces",
"Controller",
".",
"Creates",
"an",
"Azure",
"Dev",
"Spaces",
"Controller",
"with",
"the",
"specified",
"create",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllersInner.java#L300-L302 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.removeEle | public static <T> T[] removeEle(T[] array, T element) throws IllegalArgumentException {
"""
移除数组中指定的元素<br>
只会移除匹配到的第一个元素 copy from commons-lang
@param <T> 数组元素类型
@param array 数组对象,可以是对象数组,也可以原始类型数组
@param element 要移除的元素
@return 去掉指定元素后的新数组或原数组
@throws IllegalArgumentException 参数对象不为数组对象
@since 3.0.8
"... | java | public static <T> T[] removeEle(T[] array, T element) throws IllegalArgumentException {
return remove(array, indexOf(array, element));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"removeEle",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"element",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"remove",
"(",
"array",
",",
"indexOf",
"(",
"array",
",",
"element",
")",
")",
... | 移除数组中指定的元素<br>
只会移除匹配到的第一个元素 copy from commons-lang
@param <T> 数组元素类型
@param array 数组对象,可以是对象数组,也可以原始类型数组
@param element 要移除的元素
@return 去掉指定元素后的新数组或原数组
@throws IllegalArgumentException 参数对象不为数组对象
@since 3.0.8 | [
"移除数组中指定的元素<br",
">",
"只会移除匹配到的第一个元素",
"copy",
"from",
"commons",
"-",
"lang"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L2805-L2807 |
apache/incubator-gobblin | gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/common/impl/InMemoryTopology.java | InMemoryTopology.getImportsRecursively | @Override
public List<ConfigKeyPath> getImportsRecursively(ConfigKeyPath configKey) {
"""
{@inheritDoc}.
<p>
If the result is already in cache, return the result.
Otherwise, delegate the functionality to the fallback object.
If the fallback did not support this operation, will build the entire topology o... | java | @Override
public List<ConfigKeyPath> getImportsRecursively(ConfigKeyPath configKey) {
return getImportsRecursively(configKey, Optional.<Config>absent());
} | [
"@",
"Override",
"public",
"List",
"<",
"ConfigKeyPath",
">",
"getImportsRecursively",
"(",
"ConfigKeyPath",
"configKey",
")",
"{",
"return",
"getImportsRecursively",
"(",
"configKey",
",",
"Optional",
".",
"<",
"Config",
">",
"absent",
"(",
")",
")",
";",
"}"... | {@inheritDoc}.
<p>
If the result is already in cache, return the result.
Otherwise, delegate the functionality to the fallback object.
If the fallback did not support this operation, will build the entire topology of the {@link org.apache.gobblin.config.store.api.ConfigStore}
using default breath first search.
</p> | [
"{",
"@inheritDoc",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/common/impl/InMemoryTopology.java#L184-L187 |
apache/incubator-druid | server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java | BaseAppenderatorDriver.getAppendableSegment | private SegmentIdWithShardSpec getAppendableSegment(final DateTime timestamp, final String sequenceName) {
"""
Find a segment in the {@link SegmentState#APPENDING} state for the given timestamp and sequenceName.
"""
synchronized (segments) {
final SegmentsForSequence segmentsForSequence = segments.ge... | java | private SegmentIdWithShardSpec getAppendableSegment(final DateTime timestamp, final String sequenceName)
{
synchronized (segments) {
final SegmentsForSequence segmentsForSequence = segments.get(sequenceName);
if (segmentsForSequence == null) {
return null;
}
final Map.Entry<Long,... | [
"private",
"SegmentIdWithShardSpec",
"getAppendableSegment",
"(",
"final",
"DateTime",
"timestamp",
",",
"final",
"String",
"sequenceName",
")",
"{",
"synchronized",
"(",
"segments",
")",
"{",
"final",
"SegmentsForSequence",
"segmentsForSequence",
"=",
"segments",
".",
... | Find a segment in the {@link SegmentState#APPENDING} state for the given timestamp and sequenceName. | [
"Find",
"a",
"segment",
"in",
"the",
"{"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java#L279-L305 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsInner.java | ExpressRouteConnectionsInner.beginDelete | public void beginDelete(String resourceGroupName, String expressRouteGatewayName, String connectionName) {
"""
Deletes a connection to a ExpressRoute circuit.
@param resourceGroupName The name of the resource group.
@param expressRouteGatewayName The name of the ExpressRoute gateway.
@param connectionName The... | java | public void beginDelete(String resourceGroupName, String expressRouteGatewayName, String connectionName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRouteGatewayName",
",",
"String",
"connectionName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"expressRouteGatewayName",
",",
"connectionName",
... | Deletes a connection to a ExpressRoute circuit.
@param resourceGroupName The name of the resource group.
@param expressRouteGatewayName The name of the ExpressRoute gateway.
@param connectionName The name of the connection subresource.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws C... | [
"Deletes",
"a",
"connection",
"to",
"a",
"ExpressRoute",
"circuit",
"."
] | 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/ExpressRouteConnectionsInner.java#L440-L442 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagEditable.java | CmsJspTagEditable.setDirectEditProviderParams | protected static void setDirectEditProviderParams(PageContext context, CmsDirectEditParams params) {
"""
Sets the current initialized instance of the direct edit provider parameters to the page context.<p>
@param context the current JSP page context
@param params the current initialized instance of the direct ... | java | protected static void setDirectEditProviderParams(PageContext context, CmsDirectEditParams params) {
// set the direct edit params as attribute to the request
context.getRequest().setAttribute(I_CmsDirectEditProvider.ATTRIBUTE_DIRECT_EDIT_PROVIDER_PARAMS, params);
} | [
"protected",
"static",
"void",
"setDirectEditProviderParams",
"(",
"PageContext",
"context",
",",
"CmsDirectEditParams",
"params",
")",
"{",
"// set the direct edit params as attribute to the request",
"context",
".",
"getRequest",
"(",
")",
".",
"setAttribute",
"(",
"I_Cms... | Sets the current initialized instance of the direct edit provider parameters to the page context.<p>
@param context the current JSP page context
@param params the current initialized instance of the direct edit provider parameters to set | [
"Sets",
"the",
"current",
"initialized",
"instance",
"of",
"the",
"direct",
"edit",
"provider",
"parameters",
"to",
"the",
"page",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagEditable.java#L355-L359 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/recurrent/KerasSimpleRnn.java | KerasSimpleRnn.setWeights | @Override
public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException {
"""
Set weights for layer.
@param weights Simple RNN weights
@throws InvalidKerasConfigurationException Invalid Keras configuration exception
"""
this.weights = new HashMap<>();
... | java | @Override
public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException {
this.weights = new HashMap<>();
INDArray W;
if (weights.containsKey(conf.getKERAS_PARAM_NAME_W()))
W = weights.get(conf.getKERAS_PARAM_NAME_W());
else
... | [
"@",
"Override",
"public",
"void",
"setWeights",
"(",
"Map",
"<",
"String",
",",
"INDArray",
">",
"weights",
")",
"throws",
"InvalidKerasConfigurationException",
"{",
"this",
".",
"weights",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"INDArray",
"W",
";",
... | Set weights for layer.
@param weights Simple RNN weights
@throws InvalidKerasConfigurationException Invalid Keras configuration exception | [
"Set",
"weights",
"for",
"layer",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/recurrent/KerasSimpleRnn.java#L249-L290 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java | VersionsImpl.importMethodWithServiceResponseAsync | public Observable<ServiceResponse<String>> importMethodWithServiceResponseAsync(UUID appId, LuisApp luisApp, ImportMethodVersionsOptionalParameter importMethodOptionalParameter) {
"""
Imports a new version into a LUIS application.
@param appId The application ID.
@param luisApp A LUIS application structure.
@... | java | public Observable<ServiceResponse<String>> importMethodWithServiceResponseAsync(UUID appId, LuisApp luisApp, ImportMethodVersionsOptionalParameter importMethodOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required a... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"String",
">",
">",
"importMethodWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"LuisApp",
"luisApp",
",",
"ImportMethodVersionsOptionalParameter",
"importMethodOptionalParameter",
")",
"{",
"if",
"(",
"this",
... | Imports a new version into a LUIS application.
@param appId The application ID.
@param luisApp A LUIS application structure.
@param importMethodOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@... | [
"Imports",
"a",
"new",
"version",
"into",
"a",
"LUIS",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java#L919-L933 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/collections/JMListTimeSeries.java | JMListTimeSeries.addAll | public void addAll(long timestamp, List<T> objectList) {
"""
Add all.
@param timestamp the timestamp
@param objectList the object list
"""
for (T object : objectList)
add(timestamp, object);
}
/*
* (non-Javadoc)
*
* @see kr.jm.utils.collections.JMTimeSeries#toString()
*/
@Overrid... | java | public void addAll(long timestamp, List<T> objectList) {
for (T object : objectList)
add(timestamp, object);
}
/*
* (non-Javadoc)
*
* @see kr.jm.utils.collections.JMTimeSeries#toString()
*/
@Override
public String toString() {
return "JMListTimeSeries(intervalSeconds=" + getIntervalSeconds(... | [
"public",
"void",
"addAll",
"(",
"long",
"timestamp",
",",
"List",
"<",
"T",
">",
"objectList",
")",
"{",
"for",
"(",
"T",
"object",
":",
"objectList",
")",
"add",
"(",
"timestamp",
",",
"object",
")",
";",
"}",
"/*\n\t * (non-Javadoc)\n *\n * @see k... | Add all.
@param timestamp the timestamp
@param objectList the object list | [
"Add",
"all",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/collections/JMListTimeSeries.java#L41-L57 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/random/Random.java | Random.nextDouble | public double nextDouble(double lo, double hi) {
"""
Generate a uniform random number in the range [lo, hi)
@param lo lower limit of range
@param hi upper limit of range
@return a uniform random real in the range [lo, hi)
"""
if (lo < 0) {
if (nextInt(2) == 0)
return -n... | java | public double nextDouble(double lo, double hi) {
if (lo < 0) {
if (nextInt(2) == 0)
return -nextDouble(0, -lo);
else
return nextDouble(0, hi);
} else {
return (lo + (hi - lo) * nextDouble());
}
} | [
"public",
"double",
"nextDouble",
"(",
"double",
"lo",
",",
"double",
"hi",
")",
"{",
"if",
"(",
"lo",
"<",
"0",
")",
"{",
"if",
"(",
"nextInt",
"(",
"2",
")",
"==",
"0",
")",
"return",
"-",
"nextDouble",
"(",
"0",
",",
"-",
"lo",
")",
";",
"... | Generate a uniform random number in the range [lo, hi)
@param lo lower limit of range
@param hi upper limit of range
@return a uniform random real in the range [lo, hi) | [
"Generate",
"a",
"uniform",
"random",
"number",
"in",
"the",
"range",
"[",
"lo",
"hi",
")"
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/random/Random.java#L92-L101 |
roboconf/roboconf-platform | core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java | Ec2MachineConfigurator.associateElasticIp | private boolean associateElasticIp() {
"""
Associates an elastic IP with the VM.
@return true if there is nothing more to do about elastic IP configuration, false otherwise
"""
String elasticIp = this.targetProperties.get( Ec2Constants.ELASTIC_IP );
if( ! Utils.isEmptyOrWhitespaces( elasticIp )) {
thi... | java | private boolean associateElasticIp() {
String elasticIp = this.targetProperties.get( Ec2Constants.ELASTIC_IP );
if( ! Utils.isEmptyOrWhitespaces( elasticIp )) {
this.logger.fine( "Associating an elastic IP with the instance. IP = " + elasticIp );
AssociateAddressRequest associateAddressRequest = new Associat... | [
"private",
"boolean",
"associateElasticIp",
"(",
")",
"{",
"String",
"elasticIp",
"=",
"this",
".",
"targetProperties",
".",
"get",
"(",
"Ec2Constants",
".",
"ELASTIC_IP",
")",
";",
"if",
"(",
"!",
"Utils",
".",
"isEmptyOrWhitespaces",
"(",
"elasticIp",
")",
... | Associates an elastic IP with the VM.
@return true if there is nothing more to do about elastic IP configuration, false otherwise | [
"Associates",
"an",
"elastic",
"IP",
"with",
"the",
"VM",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java#L207-L217 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatHandlerImpl.java | MediaFormatHandlerImpl.isRenditionMatchSizeSameSmaller | private boolean isRenditionMatchSizeSameSmaller(MediaFormat mediaFormat, MediaFormat mediaFormatRequested) {
"""
Checks if the given media format size is same size or smaller than the requested one.
@param mediaFormat Media format
@param mediaFormatRequested Requested media format
@return true if media format i... | java | private boolean isRenditionMatchSizeSameSmaller(MediaFormat mediaFormat, MediaFormat mediaFormatRequested) {
long widthRequested = mediaFormatRequested.getEffectiveMinWidth();
long heightRequested = mediaFormatRequested.getEffectiveMinHeight();
long widthMin = mediaFormat.getEffectiveMinWidth();
long h... | [
"private",
"boolean",
"isRenditionMatchSizeSameSmaller",
"(",
"MediaFormat",
"mediaFormat",
",",
"MediaFormat",
"mediaFormatRequested",
")",
"{",
"long",
"widthRequested",
"=",
"mediaFormatRequested",
".",
"getEffectiveMinWidth",
"(",
")",
";",
"long",
"heightRequested",
... | Checks if the given media format size is same size or smaller than the requested one.
@param mediaFormat Media format
@param mediaFormatRequested Requested media format
@return true if media format is same size or smaller | [
"Checks",
"if",
"the",
"given",
"media",
"format",
"size",
"is",
"same",
"size",
"or",
"smaller",
"than",
"the",
"requested",
"one",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatHandlerImpl.java#L228-L236 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java | TreeInfo.positionFor | public static int positionFor(final Symbol sym, final JCTree tree) {
"""
Find the position for reporting an error about a symbol, where
that symbol is defined somewhere in the given tree.
"""
JCTree decl = declarationFor(sym, tree);
return ((decl != null) ? decl : tree).pos;
} | java | public static int positionFor(final Symbol sym, final JCTree tree) {
JCTree decl = declarationFor(sym, tree);
return ((decl != null) ? decl : tree).pos;
} | [
"public",
"static",
"int",
"positionFor",
"(",
"final",
"Symbol",
"sym",
",",
"final",
"JCTree",
"tree",
")",
"{",
"JCTree",
"decl",
"=",
"declarationFor",
"(",
"sym",
",",
"tree",
")",
";",
"return",
"(",
"(",
"decl",
"!=",
"null",
")",
"?",
"decl",
... | Find the position for reporting an error about a symbol, where
that symbol is defined somewhere in the given tree. | [
"Find",
"the",
"position",
"for",
"reporting",
"an",
"error",
"about",
"a",
"symbol",
"where",
"that",
"symbol",
"is",
"defined",
"somewhere",
"in",
"the",
"given",
"tree",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java#L599-L602 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java | CacheConfigurationBuilder.withKeyCopier | public CacheConfigurationBuilder<K, V> withKeyCopier(Copier<K> keyCopier) {
"""
Adds by-value semantic using the provided {@link Copier} for the key on heap.
<p>
{@link Copier}s are what enable control of by-reference / by-value semantics for on-heap tier.
@param keyCopier the key copier to use
@return a new... | java | public CacheConfigurationBuilder<K, V> withKeyCopier(Copier<K> keyCopier) {
return withCopier(new DefaultCopierConfiguration<>(requireNonNull(keyCopier, "Null key copier"), DefaultCopierConfiguration.Type.KEY));
} | [
"public",
"CacheConfigurationBuilder",
"<",
"K",
",",
"V",
">",
"withKeyCopier",
"(",
"Copier",
"<",
"K",
">",
"keyCopier",
")",
"{",
"return",
"withCopier",
"(",
"new",
"DefaultCopierConfiguration",
"<>",
"(",
"requireNonNull",
"(",
"keyCopier",
",",
"\"Null ke... | Adds by-value semantic using the provided {@link Copier} for the key on heap.
<p>
{@link Copier}s are what enable control of by-reference / by-value semantics for on-heap tier.
@param keyCopier the key copier to use
@return a new builder with the added key copier | [
"Adds",
"by",
"-",
"value",
"semantic",
"using",
"the",
"provided",
"{",
"@link",
"Copier",
"}",
"for",
"the",
"key",
"on",
"heap",
".",
"<p",
">",
"{",
"@link",
"Copier",
"}",
"s",
"are",
"what",
"enable",
"control",
"of",
"by",
"-",
"reference",
"/... | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java#L408-L410 |
derari/cthul | xml/src/main/java/org/cthul/resolve/RRequest.java | RRequest.expandSystemId | protected String expandSystemId(String baseId, String systemId) {
"""
Calculates the schema file location.
@param baseId
@param systemId
@return schema file path
"""
if (baseId == null || baseId.isEmpty()) return systemId;
if (systemId == null || systemId.isEmpty()) return baseId;
... | java | protected String expandSystemId(String baseId, String systemId) {
if (baseId == null || baseId.isEmpty()) return systemId;
if (systemId == null || systemId.isEmpty()) return baseId;
try {
return new URI(baseId).resolve(new URI(systemId)).toASCIIString();
//
// ... | [
"protected",
"String",
"expandSystemId",
"(",
"String",
"baseId",
",",
"String",
"systemId",
")",
"{",
"if",
"(",
"baseId",
"==",
"null",
"||",
"baseId",
".",
"isEmpty",
"(",
")",
")",
"return",
"systemId",
";",
"if",
"(",
"systemId",
"==",
"null",
"||",... | Calculates the schema file location.
@param baseId
@param systemId
@return schema file path | [
"Calculates",
"the",
"schema",
"file",
"location",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/xml/src/main/java/org/cthul/resolve/RRequest.java#L117-L129 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java | base_resource.post_request | private base_response post_request(nitro_service service, options option) throws Exception {
"""
Use this method to perform a Add operation on netscaler resource.
@param service nitro_service object.
@param option Options class object.
@return status of the operation performed.
@throws Exception if invalid in... | java | private base_response post_request(nitro_service service, options option) throws Exception
{
String sessionid = service.get_sessionid();
String request = resource_to_string(service, sessionid, option);
return post_data(service,request);
} | [
"private",
"base_response",
"post_request",
"(",
"nitro_service",
"service",
",",
"options",
"option",
")",
"throws",
"Exception",
"{",
"String",
"sessionid",
"=",
"service",
".",
"get_sessionid",
"(",
")",
";",
"String",
"request",
"=",
"resource_to_string",
"(",... | Use this method to perform a Add operation on netscaler resource.
@param service nitro_service object.
@param option Options class object.
@return status of the operation performed.
@throws Exception if invalid input is given. | [
"Use",
"this",
"method",
"to",
"perform",
"a",
"Add",
"operation",
"on",
"netscaler",
"resource",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java#L124-L129 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/spi/SecurityDocumentExtension.java | SecurityDocumentExtension.levelOffset | protected int levelOffset(Context context) {
"""
Returns title level offset from 1 to apply to content
@param context context
@return title level offset
"""
//TODO: Unused method, make sure this is never used and then remove it.
int levelOffset;
switch (context.position) {
... | java | protected int levelOffset(Context context) {
//TODO: Unused method, make sure this is never used and then remove it.
int levelOffset;
switch (context.position) {
case DOCUMENT_BEFORE:
case DOCUMENT_AFTER:
levelOffset = 0;
break;
... | [
"protected",
"int",
"levelOffset",
"(",
"Context",
"context",
")",
"{",
"//TODO: Unused method, make sure this is never used and then remove it.",
"int",
"levelOffset",
";",
"switch",
"(",
"context",
".",
"position",
")",
"{",
"case",
"DOCUMENT_BEFORE",
":",
"case",
"DO... | Returns title level offset from 1 to apply to content
@param context context
@return title level offset | [
"Returns",
"title",
"level",
"offset",
"from",
"1",
"to",
"apply",
"to",
"content"
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/spi/SecurityDocumentExtension.java#L38-L61 |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/Sort.java | Sort.insertionSort | @SuppressWarnings("SameParameterValue")
private static void insertionSort(int[] order, double[] values, int start, int n, int limit) {
"""
Limited range insertion sort. We assume that no element has to move more than limit steps
because quick sort has done its thing.
@param order The permutation index
@... | java | @SuppressWarnings("SameParameterValue")
private static void insertionSort(int[] order, double[] values, int start, int n, int limit) {
for (int i = start + 1; i < n; i++) {
int t = order[i];
double v = values[order[i]];
int m = Math.max(i - limit, start);
for ... | [
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"private",
"static",
"void",
"insertionSort",
"(",
"int",
"[",
"]",
"order",
",",
"double",
"[",
"]",
"values",
",",
"int",
"start",
",",
"int",
"n",
",",
"int",
"limit",
")",
"{",
"for",
"(",
... | Limited range insertion sort. We assume that no element has to move more than limit steps
because quick sort has done its thing.
@param order The permutation index
@param values The values we are sorting
@param start Where to start the sort
@param n How many elements to sort
@param limit The largest amount of... | [
"Limited",
"range",
"insertion",
"sort",
".",
"We",
"assume",
"that",
"no",
"element",
"has",
"to",
"move",
"more",
"than",
"limit",
"steps",
"because",
"quick",
"sort",
"has",
"done",
"its",
"thing",
"."
] | train | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/Sort.java#L423-L439 |
mikepenz/FastAdapter | library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java | FastAdapterDialog.withNeutralButton | public FastAdapterDialog<Item> withNeutralButton(String text, OnClickListener listener) {
"""
Set a listener to be invoked when the neutral button of the dialog is pressed.
@param text The text to display in the neutral button
@param listener The {@link DialogInterface.OnClickListener} to use.
@return Thi... | java | public FastAdapterDialog<Item> withNeutralButton(String text, OnClickListener listener) {
return withButton(BUTTON_NEUTRAL, text, listener);
} | [
"public",
"FastAdapterDialog",
"<",
"Item",
">",
"withNeutralButton",
"(",
"String",
"text",
",",
"OnClickListener",
"listener",
")",
"{",
"return",
"withButton",
"(",
"BUTTON_NEUTRAL",
",",
"text",
",",
"listener",
")",
";",
"}"
] | Set a listener to be invoked when the neutral button of the dialog is pressed.
@param text The text to display in the neutral button
@param listener The {@link DialogInterface.OnClickListener} to use.
@return This Builder object to allow for chaining of calls to set methods | [
"Set",
"a",
"listener",
"to",
"be",
"invoked",
"when",
"the",
"neutral",
"button",
"of",
"the",
"dialog",
"is",
"pressed",
"."
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java#L195-L197 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.getLong | public static Long getLong(final LdapEntry ctx, final String attribute) {
"""
Reads a Long value from the LdapEntry.
@param ctx the ldap entry
@param attribute the attribute name
@return the long value
"""
return getLong(ctx, attribute, Long.MIN_VALUE);
} | java | public static Long getLong(final LdapEntry ctx, final String attribute) {
return getLong(ctx, attribute, Long.MIN_VALUE);
} | [
"public",
"static",
"Long",
"getLong",
"(",
"final",
"LdapEntry",
"ctx",
",",
"final",
"String",
"attribute",
")",
"{",
"return",
"getLong",
"(",
"ctx",
",",
"attribute",
",",
"Long",
".",
"MIN_VALUE",
")",
";",
"}"
] | Reads a Long value from the LdapEntry.
@param ctx the ldap entry
@param attribute the attribute name
@return the long value | [
"Reads",
"a",
"Long",
"value",
"from",
"the",
"LdapEntry",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L163-L165 |
alkacon/opencms-core | src/org/opencms/file/wrapper/CmsResourceWrapperXmlPage.java | CmsResourceWrapperXmlPage.getSubPath | private String getSubPath(CmsObject cms, CmsResource xmlPage, String resourcename) {
"""
Returns the path inside a xml page.<p>
The remaining path inside a xml page can be the locale and the element name
or the name of the control code file.<p>
@param cms the initialized CmsObject
@param xmlPage the xml pa... | java | private String getSubPath(CmsObject cms, CmsResource xmlPage, String resourcename) {
if (xmlPage != null) {
String rootPath = cms.getRequestContext().addSiteRoot(resourcename);
String path = rootPath.substring(xmlPage.getRootPath().length());
if (path.startsWith("/")) {
... | [
"private",
"String",
"getSubPath",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"xmlPage",
",",
"String",
"resourcename",
")",
"{",
"if",
"(",
"xmlPage",
"!=",
"null",
")",
"{",
"String",
"rootPath",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"ad... | Returns the path inside a xml page.<p>
The remaining path inside a xml page can be the locale and the element name
or the name of the control code file.<p>
@param cms the initialized CmsObject
@param xmlPage the xml page where the resourcename belongs to
@param resourcename the full path of the resource (pointing ins... | [
"Returns",
"the",
"path",
"inside",
"a",
"xml",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsResourceWrapperXmlPage.java#L1101-L1119 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_account_GET | public ArrayList<String> organizationName_service_exchangeService_account_GET(String organizationName, String exchangeService, OvhOvhLicenceEnum accountLicense, Long id, String primaryEmailAddress) throws IOException {
"""
Accounts associated to this exchange service
REST: GET /email/exchange/{organizationName}... | java | public ArrayList<String> organizationName_service_exchangeService_account_GET(String organizationName, String exchangeService, OvhOvhLicenceEnum accountLicense, Long id, String primaryEmailAddress) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/account";
StringBuil... | [
"public",
"ArrayList",
"<",
"String",
">",
"organizationName_service_exchangeService_account_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"OvhOvhLicenceEnum",
"accountLicense",
",",
"Long",
"id",
",",
"String",
"primaryEmailAddress",
")",
... | Accounts associated to this exchange service
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/account
@param accountLicense [required] Filter the value of accountLicense property (=)
@param primaryEmailAddress [required] Filter the value of primaryEmailAddress property (like)
@param id [required]... | [
"Accounts",
"associated",
"to",
"this",
"exchange",
"service"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L2153-L2161 |
lookfirst/WePay-Java-SDK | src/main/java/com/lookfirst/wepay/WePayApi.java | WePayApi.getAuthorizationUri | public String getAuthorizationUri(List<Scope> scopes, String redirectUri, String state) {
"""
Generate URI used during oAuth authorization
Redirect your user to this URI where they can grant your application
permission to make API calls
@see <a href="https://www.wepay.com/developer/reference/oauth2">https://www... | java | public String getAuthorizationUri(List<Scope> scopes, String redirectUri, String state) {
return getAuthorizationUri(scopes, redirectUri, state, null, null);
} | [
"public",
"String",
"getAuthorizationUri",
"(",
"List",
"<",
"Scope",
">",
"scopes",
",",
"String",
"redirectUri",
",",
"String",
"state",
")",
"{",
"return",
"getAuthorizationUri",
"(",
"scopes",
",",
"redirectUri",
",",
"state",
",",
"null",
",",
"null",
"... | Generate URI used during oAuth authorization
Redirect your user to this URI where they can grant your application
permission to make API calls
@see <a href="https://www.wepay.com/developer/reference/oauth2">https://www.wepay.com/developer/reference/oauth2</a>
@param scopes List of scope fields for which you... | [
"Generate",
"URI",
"used",
"during",
"oAuth",
"authorization",
"Redirect",
"your",
"user",
"to",
"this",
"URI",
"where",
"they",
"can",
"grant",
"your",
"application",
"permission",
"to",
"make",
"API",
"calls"
] | train | https://github.com/lookfirst/WePay-Java-SDK/blob/3c0a47d6fa051d531c8fdbbfd54a0ef2891aa8f0/src/main/java/com/lookfirst/wepay/WePayApi.java#L162-L164 |
james-hu/jabb-core | src/main/java/net/sf/jabb/cache/AbstractEhCachedKeyValueRepository.java | AbstractEhCachedKeyValueRepository.refreshAheadNeeded | protected boolean refreshAheadNeeded(long accessTime, long createdTime, long expirationTime) {
"""
Determine if a refresh ahead is needed.
The default implementation checks if accessTime falls into the 3rd quarter of (expirationTime - createdTime)
@param accessTime last access time
@param createdTime created ... | java | protected boolean refreshAheadNeeded(long accessTime, long createdTime, long expirationTime){
long ttl4 = (expirationTime - createdTime) / 4;
if (ttl4 < 0){
ttl4 = 0;
}
long start = createdTime + ttl4 * 2;
long end = expirationTime - ttl4;
return accessTime > start && accessTime < end;
} | [
"protected",
"boolean",
"refreshAheadNeeded",
"(",
"long",
"accessTime",
",",
"long",
"createdTime",
",",
"long",
"expirationTime",
")",
"{",
"long",
"ttl4",
"=",
"(",
"expirationTime",
"-",
"createdTime",
")",
"/",
"4",
";",
"if",
"(",
"ttl4",
"<",
"0",
"... | Determine if a refresh ahead is needed.
The default implementation checks if accessTime falls into the 3rd quarter of (expirationTime - createdTime)
@param accessTime last access time
@param createdTime created time
@param expirationTime end of TTL/TTI time
@return true if a refresh is needed, false otherwise | [
"Determine",
"if",
"a",
"refresh",
"ahead",
"is",
"needed",
".",
"The",
"default",
"implementation",
"checks",
"if",
"accessTime",
"falls",
"into",
"the",
"3rd",
"quarter",
"of",
"(",
"expirationTime",
"-",
"createdTime",
")"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/cache/AbstractEhCachedKeyValueRepository.java#L75-L85 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.updateDirection | public QueryParameters updateDirection(String key, Direction direction) {
"""
Updates direction of specified key
@param key Key
@param direction Direction
@return this instance of QueryParameters
"""
this.direction.put(processKey(key), direction);
return this;
} | java | public QueryParameters updateDirection(String key, Direction direction) {
this.direction.put(processKey(key), direction);
return this;
} | [
"public",
"QueryParameters",
"updateDirection",
"(",
"String",
"key",
",",
"Direction",
"direction",
")",
"{",
"this",
".",
"direction",
".",
"put",
"(",
"processKey",
"(",
"key",
")",
",",
"direction",
")",
";",
"return",
"this",
";",
"}"
] | Updates direction of specified key
@param key Key
@param direction Direction
@return this instance of QueryParameters | [
"Updates",
"direction",
"of",
"specified",
"key"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L301-L305 |
jMotif/SAX | src/main/java/net/seninp/util/HeatChart.java | HeatChart.saveToFile | public void saveToFile(File outputFile) throws IOException {
"""
Generates a new chart <code>Image</code> based upon the currently held settings and then
attempts to save that image to disk, to the location provided as a File parameter. The image
type of the saved file will equal the extension of the filename pr... | java | public void saveToFile(File outputFile) throws IOException {
String filename = outputFile.getName();
int extPoint = filename.lastIndexOf('.');
if (extPoint < 0) {
throw new IOException("Illegal filename, no extension used.");
}
// Determine the extension of the filename.
String ext = fi... | [
"public",
"void",
"saveToFile",
"(",
"File",
"outputFile",
")",
"throws",
"IOException",
"{",
"String",
"filename",
"=",
"outputFile",
".",
"getName",
"(",
")",
";",
"int",
"extPoint",
"=",
"filename",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"... | Generates a new chart <code>Image</code> based upon the currently held settings and then
attempts to save that image to disk, to the location provided as a File parameter. The image
type of the saved file will equal the extension of the filename provided, so it is essential
that a suitable extension be included on the ... | [
"Generates",
"a",
"new",
"chart",
"<code",
">",
"Image<",
"/",
"code",
">",
"based",
"upon",
"the",
"currently",
"held",
"settings",
"and",
"then",
"attempts",
"to",
"save",
"that",
"image",
"to",
"disk",
"to",
"the",
"location",
"provided",
"as",
"a",
"... | train | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/HeatChart.java#L1167-L1191 |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/convert/reflection/AnnotationUtil.java | AnnotationUtil.populateUsermeta | public static <T> T populateUsermeta(RiakUserMetadata usermetaData, T domainObject) {
"""
Attempts to populate a domain object with user metadata by looking for a
{@literal @RiakUsermeta} annotated member.
@param <T> the type of the domain object
@param usermetaData a Map of user metadata.
@param domainObjec... | java | public static <T> T populateUsermeta(RiakUserMetadata usermetaData, T domainObject)
{
return AnnotationHelper.getInstance().setUsermetaData(usermetaData, domainObject);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"populateUsermeta",
"(",
"RiakUserMetadata",
"usermetaData",
",",
"T",
"domainObject",
")",
"{",
"return",
"AnnotationHelper",
".",
"getInstance",
"(",
")",
".",
"setUsermetaData",
"(",
"usermetaData",
",",
"domainObject",
... | Attempts to populate a domain object with user metadata by looking for a
{@literal @RiakUsermeta} annotated member.
@param <T> the type of the domain object
@param usermetaData a Map of user metadata.
@param domainObject the domain object.
@return the domain object. | [
"Attempts",
"to",
"populate",
"a",
"domain",
"object",
"with",
"user",
"metadata",
"by",
"looking",
"for",
"a",
"{",
"@literal",
"@RiakUsermeta",
"}",
"annotated",
"member",
"."
] | train | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/convert/reflection/AnnotationUtil.java#L279-L282 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getDeletedSasDefinitionAsync | public Observable<DeletedSasDefinitionBundle> getDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) {
"""
Gets the specified deleted sas definition.
The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. Thi... | java | public Observable<DeletedSasDefinitionBundle> getDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) {
return getDeletedSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).map(new Func1<ServiceResponse<DeletedSasDefinitionBun... | [
"public",
"Observable",
"<",
"DeletedSasDefinitionBundle",
">",
"getDeletedSasDefinitionAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"sasDefinitionName",
")",
"{",
"return",
"getDeletedSasDefinitionWithServiceResponseAsync",
"(",
... | Gets the specified deleted sas definition.
The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName T... | [
"Gets",
"the",
"specified",
"deleted",
"sas",
"definition",
".",
"The",
"Get",
"Deleted",
"SAS",
"Definition",
"operation",
"returns",
"the",
"specified",
"deleted",
"SAS",
"definition",
"along",
"with",
"its",
"attributes",
".",
"This",
"operation",
"requires",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L10909-L10916 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java | JSONObject.optLong | public long optLong(String name, long fallback) {
"""
Returns the value mapped by {@code name} if it exists and is a long or can be
coerced to a long. Returns {@code fallback} otherwise. Note that JSON represents
numbers as doubles, so this is <a href="#lossy">lossy</a>; use strings to transfer
numbers via JSON... | java | public long optLong(String name, long fallback) {
Object object = opt(name);
Long result = JSON.toLong(object);
return result != null ? result : fallback;
} | [
"public",
"long",
"optLong",
"(",
"String",
"name",
",",
"long",
"fallback",
")",
"{",
"Object",
"object",
"=",
"opt",
"(",
"name",
")",
";",
"Long",
"result",
"=",
"JSON",
".",
"toLong",
"(",
"object",
")",
";",
"return",
"result",
"!=",
"null",
"?"... | Returns the value mapped by {@code name} if it exists and is a long or can be
coerced to a long. Returns {@code fallback} otherwise. Note that JSON represents
numbers as doubles, so this is <a href="#lossy">lossy</a>; use strings to transfer
numbers via JSON.
@param name the name of the property
@param fallback a fallb... | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java#L548-L552 |
kirgor/enklib | ejb/src/main/java/com/kirgor/enklib/ejb/Bean.java | Bean.createSession | protected Session createSession() throws Exception {
"""
Creates {@link Session} instance, connected to the database.
@throws NamingException
@throws SQLException
"""
Config config = configBean.getConfig();
DataSource dataSource = InitialContext.doLookup(config.getDataSourceJNDI());
... | java | protected Session createSession() throws Exception {
Config config = configBean.getConfig();
DataSource dataSource = InitialContext.doLookup(config.getDataSourceJNDI());
return new Session(dataSource, config.getDialect());
} | [
"protected",
"Session",
"createSession",
"(",
")",
"throws",
"Exception",
"{",
"Config",
"config",
"=",
"configBean",
".",
"getConfig",
"(",
")",
";",
"DataSource",
"dataSource",
"=",
"InitialContext",
".",
"doLookup",
"(",
"config",
".",
"getDataSourceJNDI",
"(... | Creates {@link Session} instance, connected to the database.
@throws NamingException
@throws SQLException | [
"Creates",
"{",
"@link",
"Session",
"}",
"instance",
"connected",
"to",
"the",
"database",
"."
] | train | https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/ejb/src/main/java/com/kirgor/enklib/ejb/Bean.java#L175-L179 |
javalite/activeweb | javalite-async/src/main/java/org/javalite/async/Async.java | Async.configureNetty | public void configureNetty(String host, int port) {
"""
Call this method once after a constructor in order to create a Netty instance to accept out of VM messages.
@param host host to bind to
@param port port to listen on
"""
Map<String, Object> params = map(TransportConstants.HOST_PROP_NAME, host,... | java | public void configureNetty(String host, int port){
Map<String, Object> params = map(TransportConstants.HOST_PROP_NAME, host, TransportConstants.PORT_PROP_NAME, port);
config.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName(), params));
} | [
"public",
"void",
"configureNetty",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
"=",
"map",
"(",
"TransportConstants",
".",
"HOST_PROP_NAME",
",",
"host",
",",
"TransportConstants",
".",
"PORT_PROP... | Call this method once after a constructor in order to create a Netty instance to accept out of VM messages.
@param host host to bind to
@param port port to listen on | [
"Call",
"this",
"method",
"once",
"after",
"a",
"constructor",
"in",
"order",
"to",
"create",
"a",
"Netty",
"instance",
"to",
"accept",
"out",
"of",
"VM",
"messages",
"."
] | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/javalite-async/src/main/java/org/javalite/async/Async.java#L307-L310 |
Chorus-bdd/Chorus | interpreter/chorus-parser/src/main/java/org/chorusbdd/chorus/parser/DirectiveParser.java | DirectiveParser.checkDirectivesForKeyword | public void checkDirectivesForKeyword(DirectiveParser directiveParser, KeyWord keyWord) throws ParseException {
"""
If a keyword supports directives, then we can have one more more 'keyword' directives but no 'step' directives before a keyword
"""
checkNoStepDirectiveBeforeKeyword(directiveParser, keyW... | java | public void checkDirectivesForKeyword(DirectiveParser directiveParser, KeyWord keyWord) throws ParseException {
checkNoStepDirectiveBeforeKeyword(directiveParser, keyWord);
checkForInvalidKeywordDirective(directiveParser, keyWord);
} | [
"public",
"void",
"checkDirectivesForKeyword",
"(",
"DirectiveParser",
"directiveParser",
",",
"KeyWord",
"keyWord",
")",
"throws",
"ParseException",
"{",
"checkNoStepDirectiveBeforeKeyword",
"(",
"directiveParser",
",",
"keyWord",
")",
";",
"checkForInvalidKeywordDirective",... | If a keyword supports directives, then we can have one more more 'keyword' directives but no 'step' directives before a keyword | [
"If",
"a",
"keyword",
"supports",
"directives",
"then",
"we",
"can",
"have",
"one",
"more",
"more",
"keyword",
"directives",
"but",
"no",
"step",
"directives",
"before",
"a",
"keyword"
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-parser/src/main/java/org/chorusbdd/chorus/parser/DirectiveParser.java#L98-L101 |
hdecarne/java-default | src/main/java/de/carne/util/SystemProperties.java | SystemProperties.longValue | public static long longValue(Class<?> clazz, String key, long defaultValue) {
"""
Gets a {@code long} system property value.
@param clazz the {@linkplain Class} to derive the property key from.
@param key the property key (relative to the submitted {@linkplain Class}) to get.
@param defaultValue the default v... | java | public static long longValue(Class<?> clazz, String key, long defaultValue) {
return longValue(clazz.getName() + key, defaultValue);
} | [
"public",
"static",
"long",
"longValue",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"key",
",",
"long",
"defaultValue",
")",
"{",
"return",
"longValue",
"(",
"clazz",
".",
"getName",
"(",
")",
"+",
"key",
",",
"defaultValue",
")",
";",
"}"
] | Gets a {@code long} system property value.
@param clazz the {@linkplain Class} to derive the property key from.
@param key the property key (relative to the submitted {@linkplain Class}) to get.
@param defaultValue the default value to return in case the property is not defined.
@return the property value or the submi... | [
"Gets",
"a",
"{",
"@code",
"long",
"}",
"system",
"property",
"value",
"."
] | train | https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/util/SystemProperties.java#L211-L213 |
Devskiller/jfairy | src/main/java/com/devskiller/jfairy/producer/BaseProducer.java | BaseProducer.letterify | public String letterify(String letterString, char from, char to) {
"""
Replaces all {@code '?'} characters with random chars from [{@code from} - {@code to}] range
@param letterString text to process
@param from start of the range
@param to end of the range
@return text with replaced {@code... | java | public String letterify(String letterString, char from, char to) {
return replaceSymbolWithCharsFromTo(letterString, '?', from, to);
} | [
"public",
"String",
"letterify",
"(",
"String",
"letterString",
",",
"char",
"from",
",",
"char",
"to",
")",
"{",
"return",
"replaceSymbolWithCharsFromTo",
"(",
"letterString",
",",
"'",
"'",
",",
"from",
",",
"to",
")",
";",
"}"
] | Replaces all {@code '?'} characters with random chars from [{@code from} - {@code to}] range
@param letterString text to process
@param from start of the range
@param to end of the range
@return text with replaced {@code '?'} chars | [
"Replaces",
"all",
"{",
"@code",
"?",
"}",
"characters",
"with",
"random",
"chars",
"from",
"[",
"{",
"@code",
"from",
"}",
"-",
"{",
"@code",
"to",
"}",
"]",
"range"
] | train | https://github.com/Devskiller/jfairy/blob/126d1c8b1545f725afd10f969b9d27005ac520b7/src/main/java/com/devskiller/jfairy/producer/BaseProducer.java#L155-L157 |
jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Decoder.java | Decoder.decodeFrame | public Obuffer decodeFrame(Header header, Bitstream stream)
throws DecoderException {
"""
Decodes one frame from an MPEG audio bitstream.
@param header The header describing the frame to decode.
@param bitstream The bistream that provides the bits for the body of the frame.
@return A SampleBuffer contai... | java | public Obuffer decodeFrame(Header header, Bitstream stream)
throws DecoderException
{
try
{
if (!initialized)
{
initialize(header);
}
int layer = header.layer();
output.clear_buffer();
FrameDecoder decoder = retrieveDecoder(header, stream, layer);
decoder.decodeFrame();
... | [
"public",
"Obuffer",
"decodeFrame",
"(",
"Header",
"header",
",",
"Bitstream",
"stream",
")",
"throws",
"DecoderException",
"{",
"try",
"{",
"if",
"(",
"!",
"initialized",
")",
"{",
"initialize",
"(",
"header",
")",
";",
"}",
"int",
"layer",
"=",
"header",... | Decodes one frame from an MPEG audio bitstream.
@param header The header describing the frame to decode.
@param bitstream The bistream that provides the bits for the body of the frame.
@return A SampleBuffer containing the decoded samples. | [
"Decodes",
"one",
"frame",
"from",
"an",
"MPEG",
"audio",
"bitstream",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Decoder.java#L133-L159 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.renderPixel | public static Point2D_F64 renderPixel(CameraPinhole intrinsic , Point3D_F64 X ) {
"""
Renders a point in camera coordinates into the image plane in pixels.
@param intrinsic Intrinsic camera parameters.
@param X 3D Point in world reference frame..
@return 2D Render point on image plane or null if it's behind t... | java | public static Point2D_F64 renderPixel(CameraPinhole intrinsic , Point3D_F64 X ) {
Point2D_F64 norm = new Point2D_F64(X.x/X.z,X.y/X.z);
return convertNormToPixel(intrinsic, norm, norm);
} | [
"public",
"static",
"Point2D_F64",
"renderPixel",
"(",
"CameraPinhole",
"intrinsic",
",",
"Point3D_F64",
"X",
")",
"{",
"Point2D_F64",
"norm",
"=",
"new",
"Point2D_F64",
"(",
"X",
".",
"x",
"/",
"X",
".",
"z",
",",
"X",
".",
"y",
"/",
"X",
".",
"z",
... | Renders a point in camera coordinates into the image plane in pixels.
@param intrinsic Intrinsic camera parameters.
@param X 3D Point in world reference frame..
@return 2D Render point on image plane or null if it's behind the camera | [
"Renders",
"a",
"point",
"in",
"camera",
"coordinates",
"into",
"the",
"image",
"plane",
"in",
"pixels",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L538-L541 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java | PolylineSplitMerge.computePotentialSplitScore | void computePotentialSplitScore( List<Point2D_I32> contour , Element<Corner> e0 , boolean mustSplit ) {
"""
Computes the split location and the score of the two new sides if it's split there
"""
Element<Corner> e1 = next(e0);
e0.object.splitable = canBeSplit(contour,e0,mustSplit);
if( e0.object.splitab... | java | void computePotentialSplitScore( List<Point2D_I32> contour , Element<Corner> e0 , boolean mustSplit )
{
Element<Corner> e1 = next(e0);
e0.object.splitable = canBeSplit(contour,e0,mustSplit);
if( e0.object.splitable ) {
setSplitVariables(contour, e0, e1);
}
} | [
"void",
"computePotentialSplitScore",
"(",
"List",
"<",
"Point2D_I32",
">",
"contour",
",",
"Element",
"<",
"Corner",
">",
"e0",
",",
"boolean",
"mustSplit",
")",
"{",
"Element",
"<",
"Corner",
">",
"e1",
"=",
"next",
"(",
"e0",
")",
";",
"e0",
".",
"o... | Computes the split location and the score of the two new sides if it's split there | [
"Computes",
"the",
"split",
"location",
"and",
"the",
"score",
"of",
"the",
"two",
"new",
"sides",
"if",
"it",
"s",
"split",
"there"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L663-L672 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfFileSpecification.java | PdfFileSpecification.fileEmbedded | public static PdfFileSpecification fileEmbedded(PdfWriter writer, String filePath, String fileDisplay, byte fileStore[]) throws IOException {
"""
Creates a file specification with the file embedded. The file may
come from the file system or from a byte array. The data is flate compressed.
@param writer the <CODE... | java | public static PdfFileSpecification fileEmbedded(PdfWriter writer, String filePath, String fileDisplay, byte fileStore[]) throws IOException {
return fileEmbedded(writer, filePath, fileDisplay, fileStore, PdfStream.BEST_COMPRESSION);
} | [
"public",
"static",
"PdfFileSpecification",
"fileEmbedded",
"(",
"PdfWriter",
"writer",
",",
"String",
"filePath",
",",
"String",
"fileDisplay",
",",
"byte",
"fileStore",
"[",
"]",
")",
"throws",
"IOException",
"{",
"return",
"fileEmbedded",
"(",
"writer",
",",
... | Creates a file specification with the file embedded. The file may
come from the file system or from a byte array. The data is flate compressed.
@param writer the <CODE>PdfWriter</CODE>
@param filePath the file path
@param fileDisplay the file information that is presented to the user
@param fileStore the byte array wit... | [
"Creates",
"a",
"file",
"specification",
"with",
"the",
"file",
"embedded",
".",
"The",
"file",
"may",
"come",
"from",
"the",
"file",
"system",
"or",
"from",
"a",
"byte",
"array",
".",
"The",
"data",
"is",
"flate",
"compressed",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfFileSpecification.java#L95-L97 |
upwork/java-upwork | src/com/Upwork/api/Routers/Messages.java | Messages.sendMessageToRoom | public JSONObject sendMessageToRoom(String company, String roomId, HashMap<String, String> params) throws JSONException {
"""
Send a message to a room
@param company Company ID
@param roomId Room ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject}
"""
... | java | public JSONObject sendMessageToRoom(String company, String roomId, HashMap<String, String> params) throws JSONException {
return oClient.post("/messages/v3/" + company + "/rooms/" + roomId + "/stories", params);
} | [
"public",
"JSONObject",
"sendMessageToRoom",
"(",
"String",
"company",
",",
"String",
"roomId",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"post",
"(",
"\"/messages/v3/\"",
"+",
"... | Send a message to a room
@param company Company ID
@param roomId Room ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Send",
"a",
"message",
"to",
"a",
"room"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Messages.java#L126-L128 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBaseMenuScreen.java | HBaseMenuScreen.printData | public boolean printData(PrintWriter out, int iHtmlAttributes) {
"""
Code to display a Menu.
@param out The html out stream.
@param iHtmlAttributes The HTML attributes.
@return true If fields have been found.
@exception DBException File exception.
"""
boolean bFieldsFound = false;
Record re... | java | public boolean printData(PrintWriter out, int iHtmlAttributes)
{
boolean bFieldsFound = false;
Record recMenu = ((BaseMenuScreen)this.getScreenField()).getMainRecord();
String strCellFormat = this.getHtmlString(recMenu);
XMLParser parser = ((BaseMenuScreen)this.getScreenField()).getX... | [
"public",
"boolean",
"printData",
"(",
"PrintWriter",
"out",
",",
"int",
"iHtmlAttributes",
")",
"{",
"boolean",
"bFieldsFound",
"=",
"false",
";",
"Record",
"recMenu",
"=",
"(",
"(",
"BaseMenuScreen",
")",
"this",
".",
"getScreenField",
"(",
")",
")",
".",
... | Code to display a Menu.
@param out The html out stream.
@param iHtmlAttributes The HTML attributes.
@return true If fields have been found.
@exception DBException File exception. | [
"Code",
"to",
"display",
"a",
"Menu",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBaseMenuScreen.java#L82-L92 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/mediatype/PropertyUtils.java | PropertyUtils.toBeIgnoredByJackson | private static boolean toBeIgnoredByJackson(Class<?> clazz, String field) {
"""
Check if a field name is to be ignored due to {@link JsonIgnoreProperties}.
@param clazz
@param field
@return
"""
Annotation[] annotations = AnnotationUtils.getAnnotations(clazz);
return annotations == null //
? fals... | java | private static boolean toBeIgnoredByJackson(Class<?> clazz, String field) {
Annotation[] annotations = AnnotationUtils.getAnnotations(clazz);
return annotations == null //
? false //
: Arrays.stream(annotations) //
.filter(annotation -> annotation.annotationType().equals(JsonIgnoreProperties.class))... | [
"private",
"static",
"boolean",
"toBeIgnoredByJackson",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"field",
")",
"{",
"Annotation",
"[",
"]",
"annotations",
"=",
"AnnotationUtils",
".",
"getAnnotations",
"(",
"clazz",
")",
";",
"return",
"annotations... | Check if a field name is to be ignored due to {@link JsonIgnoreProperties}.
@param clazz
@param field
@return | [
"Check",
"if",
"a",
"field",
"name",
"is",
"to",
"be",
"ignored",
"due",
"to",
"{",
"@link",
"JsonIgnoreProperties",
"}",
"."
] | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/mediatype/PropertyUtils.java#L208-L219 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/neuralnetwork/BackPropagationNet.java | BackPropagationNet.computeOutputDelta | private double computeOutputDelta(DataSet dataSet, final int idx, Vec delta_out, Vec a_i, Vec d_i) {
"""
Computes the delta between the networks output for a same and its true value
@param dataSet the data set we are learning from
@param idx the index into the data set for the current data point
@param delta_ou... | java | private double computeOutputDelta(DataSet dataSet, final int idx, Vec delta_out, Vec a_i, Vec d_i)
{
double error = 0;
if (dataSet instanceof ClassificationDataSet)
{
ClassificationDataSet cds = (ClassificationDataSet) dataSet;
final int ct = cds.getDataPointCategory(... | [
"private",
"double",
"computeOutputDelta",
"(",
"DataSet",
"dataSet",
",",
"final",
"int",
"idx",
",",
"Vec",
"delta_out",
",",
"Vec",
"a_i",
",",
"Vec",
"d_i",
")",
"{",
"double",
"error",
"=",
"0",
";",
"if",
"(",
"dataSet",
"instanceof",
"Classification... | Computes the delta between the networks output for a same and its true value
@param dataSet the data set we are learning from
@param idx the index into the data set for the current data point
@param delta_out the place to store the delta, may already be initialized with random noise
@param a_i the activation of the fin... | [
"Computes",
"the",
"delta",
"between",
"the",
"networks",
"output",
"for",
"a",
"same",
"and",
"its",
"true",
"value"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/neuralnetwork/BackPropagationNet.java#L780-L816 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java | FieldBuilder.getInstance | public static FieldBuilder getInstance(Context context,
TypeElement typeElement,
FieldWriter writer) {
"""
Construct a new FieldBuilder.
@param context the build context.
@param typeElement the class whoses members are being documented.
@param writer the doclet specific writer.
@retu... | java | public static FieldBuilder getInstance(Context context,
TypeElement typeElement,
FieldWriter writer) {
return new FieldBuilder(context, typeElement, writer);
} | [
"public",
"static",
"FieldBuilder",
"getInstance",
"(",
"Context",
"context",
",",
"TypeElement",
"typeElement",
",",
"FieldWriter",
"writer",
")",
"{",
"return",
"new",
"FieldBuilder",
"(",
"context",
",",
"typeElement",
",",
"writer",
")",
";",
"}"
] | Construct a new FieldBuilder.
@param context the build context.
@param typeElement the class whoses members are being documented.
@param writer the doclet specific writer.
@return the new FieldBuilder | [
"Construct",
"a",
"new",
"FieldBuilder",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java#L106-L110 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/PTSaxton2006.java | PTSaxton2006.getSKSAT | public static String getSKSAT(String[] soilParas) {
"""
For calculating SKSAT
@param soilParas should include 1. Sand weight percentage by layer
([0,100]%), 2. Clay weight percentage by layer ([0,100]%), 3. Organic
matter weight percentage by layer ([0,100]%), (= SLOC * 1.72), 4. Grave
weight percentage by l... | java | public static String getSKSAT(String[] soilParas) {
if (soilParas != null && soilParas.length >= 3) {
if (soilParas.length >= 4) {
return divide(calcSatBulk(soilParas[0], soilParas[1], soilParas[2], divide(soilParas[3], "100")), "10", 3);
} else {
return d... | [
"public",
"static",
"String",
"getSKSAT",
"(",
"String",
"[",
"]",
"soilParas",
")",
"{",
"if",
"(",
"soilParas",
"!=",
"null",
"&&",
"soilParas",
".",
"length",
">=",
"3",
")",
"{",
"if",
"(",
"soilParas",
".",
"length",
">=",
"4",
")",
"{",
"return... | For calculating SKSAT
@param soilParas should include 1. Sand weight percentage by layer
([0,100]%), 2. Clay weight percentage by layer ([0,100]%), 3. Organic
matter weight percentage by layer ([0,100]%), (= SLOC * 1.72), 4. Grave
weight percentage by layer ([0,100]%)
@return Saturated hydraulic conductivity, cm/h | [
"For",
"calculating",
"SKSAT"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/PTSaxton2006.java#L80-L90 |
op4j/op4j | src/main/java/org/op4j/functions/Call.java | Call.listOf | public static <R> Function<Object,List<R>> listOf(final Type<R> resultType, final String methodName, final Object... optionalParameters) {
"""
<p>
Abbreviation for {{@link #methodForListOf(Type, String, Object...)}.
</p>
@since 1.1
@param methodName the name of the method
@param optionalParameters the (op... | java | public static <R> Function<Object,List<R>> listOf(final Type<R> resultType, final String methodName, final Object... optionalParameters) {
return methodForListOf(resultType, methodName, optionalParameters);
} | [
"public",
"static",
"<",
"R",
">",
"Function",
"<",
"Object",
",",
"List",
"<",
"R",
">",
">",
"listOf",
"(",
"final",
"Type",
"<",
"R",
">",
"resultType",
",",
"final",
"String",
"methodName",
",",
"final",
"Object",
"...",
"optionalParameters",
")",
... | <p>
Abbreviation for {{@link #methodForListOf(Type, String, Object...)}.
</p>
@since 1.1
@param methodName the name of the method
@param optionalParameters the (optional) parameters of the method.
@return the result of the method execution | [
"<p",
">",
"Abbreviation",
"for",
"{{",
"@link",
"#methodForListOf",
"(",
"Type",
"String",
"Object",
"...",
")",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/Call.java#L644-L646 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java | JschUtil.createSession | public static Session createSession(String sshHost, int sshPort, String sshUser, String sshPass) {
"""
新建一个新的SSH会话
@param sshHost 主机
@param sshPort 端口
@param sshUser 机用户名
@param sshPass 密码
@return SSH会话
@since 4.5.2
"""
if (StrUtil.isEmpty(sshHost) || sshPort < 0 || StrUtil.isEmpty(sshUser) || StrUt... | java | public static Session createSession(String sshHost, int sshPort, String sshUser, String sshPass) {
if (StrUtil.isEmpty(sshHost) || sshPort < 0 || StrUtil.isEmpty(sshUser) || StrUtil.isEmpty(sshPass)) {
return null;
}
Session session;
try {
session = new JSch().getSession(sshUser, sshHost, sshPort)... | [
"public",
"static",
"Session",
"createSession",
"(",
"String",
"sshHost",
",",
"int",
"sshPort",
",",
"String",
"sshUser",
",",
"String",
"sshPass",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isEmpty",
"(",
"sshHost",
")",
"||",
"sshPort",
"<",
"0",
"||",
"St... | 新建一个新的SSH会话
@param sshHost 主机
@param sshPort 端口
@param sshUser 机用户名
@param sshPass 密码
@return SSH会话
@since 4.5.2 | [
"新建一个新的SSH会话"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java#L89-L104 |
js-lib-com/commons | src/main/java/js/io/FilesOutputStream.java | FilesOutputStream.putMeta | public void putMeta(String key, Object value) {
"""
Put meta data to this archive manifest. If <code>key</code> already exists is overridden. Meta <code>value</code> is
converted to string and can be any type for which there is a {@link Converter} registered.
@param key meta data key,
@param value meta data v... | java | public void putMeta(String key, Object value) {
manifest.getMainAttributes().putValue(key, ConverterRegistry.getConverter().asString(value));
} | [
"public",
"void",
"putMeta",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"manifest",
".",
"getMainAttributes",
"(",
")",
".",
"putValue",
"(",
"key",
",",
"ConverterRegistry",
".",
"getConverter",
"(",
")",
".",
"asString",
"(",
"value",
")",
... | Put meta data to this archive manifest. If <code>key</code> already exists is overridden. Meta <code>value</code> is
converted to string and can be any type for which there is a {@link Converter} registered.
@param key meta data key,
@param value meta data value. | [
"Put",
"meta",
"data",
"to",
"this",
"archive",
"manifest",
".",
"If",
"<code",
">",
"key<",
"/",
"code",
">",
"already",
"exists",
"is",
"overridden",
".",
"Meta",
"<code",
">",
"value<",
"/",
"code",
">",
"is",
"converted",
"to",
"string",
"and",
"ca... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/io/FilesOutputStream.java#L100-L102 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/AbstractLabel.java | AbstractLabel.removeColumn | void removeColumn(String schema, String table, String column) {
"""
remove a column from the table
@param schema the schema
@param table the table name
@param column the column name
"""
StringBuilder sql = new StringBuilder("ALTER TABLE ");
sql.append(sqlgGraph.getSqlDialect().maybeWrapIn... | java | void removeColumn(String schema, String table, String column) {
StringBuilder sql = new StringBuilder("ALTER TABLE ");
sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(schema));
sql.append(".");
sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(table));
sql.append(" DR... | [
"void",
"removeColumn",
"(",
"String",
"schema",
",",
"String",
"table",
",",
"String",
"column",
")",
"{",
"StringBuilder",
"sql",
"=",
"new",
"StringBuilder",
"(",
"\"ALTER TABLE \"",
")",
";",
"sql",
".",
"append",
"(",
"sqlgGraph",
".",
"getSqlDialect",
... | remove a column from the table
@param schema the schema
@param table the table name
@param column the column name | [
"remove",
"a",
"column",
"from",
"the",
"table"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/AbstractLabel.java#L1002-L1024 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/Condition.java | Condition.buildValuePartForBETWEEN | private void buildValuePartForBETWEEN(StringBuilder conditionStrBuilder, List<Object> paramValues) {
"""
构建BETWEEN语句中的值部分<br>
开头必须加空格,类似:" ? AND ?" 或者 " 1 AND 2"
@param conditionStrBuilder 条件语句构建器
@param paramValues 参数集合,用于参数占位符对应参数回填
"""
// BETWEEN x AND y 的情况,两个参数
if (isPlaceHolder()) {
// 使用条... | java | private void buildValuePartForBETWEEN(StringBuilder conditionStrBuilder, List<Object> paramValues) {
// BETWEEN x AND y 的情况,两个参数
if (isPlaceHolder()) {
// 使用条件表达式占位符
conditionStrBuilder.append(" ?");
if(null != paramValues) {
paramValues.add(this.value);
}
} else {
// 直接使用条件值
condi... | [
"private",
"void",
"buildValuePartForBETWEEN",
"(",
"StringBuilder",
"conditionStrBuilder",
",",
"List",
"<",
"Object",
">",
"paramValues",
")",
"{",
"// BETWEEN x AND y 的情况,两个参数\r",
"if",
"(",
"isPlaceHolder",
"(",
")",
")",
"{",
"// 使用条件表达式占位符\r",
"conditionStrBuilder... | 构建BETWEEN语句中的值部分<br>
开头必须加空格,类似:" ? AND ?" 或者 " 1 AND 2"
@param conditionStrBuilder 条件语句构建器
@param paramValues 参数集合,用于参数占位符对应参数回填 | [
"构建BETWEEN语句中的值部分<br",
">",
"开头必须加空格,类似:",
"?",
"AND",
"?",
"或者",
"1",
"AND",
"2"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/Condition.java#L320-L345 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java | ByteOp.copyStream | public static void copyStream(InputStream is, OutputStream os, int size)
throws IOException {
"""
Write all bytes from is to os. Does not close either stream.
@param is to copy bytes from
@param os to copy bytes to
@param size number of bytes to buffer between read and write operations
@throws IOException fo... | java | public static void copyStream(InputStream is, OutputStream os, int size)
throws IOException {
byte[] buffer = new byte[size];
for (int r = -1; (r = is.read(buffer, 0, size)) != -1;) {
os.write(buffer, 0, r);
}
} | [
"public",
"static",
"void",
"copyStream",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
",",
"int",
"size",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"size",
"]",
";",
"for",
"(",
"int",
"r",
"=",
... | Write all bytes from is to os. Does not close either stream.
@param is to copy bytes from
@param os to copy bytes to
@param size number of bytes to buffer between read and write operations
@throws IOException for usual reasons | [
"Write",
"all",
"bytes",
"from",
"is",
"to",
"os",
".",
"Does",
"not",
"close",
"either",
"stream",
"."
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java#L141-L147 |
biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/MultipleAlignmentCoordManager.java | MultipleAlignmentCoordManager.getPanelPos | public Point getPanelPos(int structure, int pos) {
"""
Get the X position on the Panel of a particular sequence position.
@param structure index of the structure for the sequence position.
@param pos sequence position, the aligned position index
@return the point on a panel for a sequence position
"""
P... | java | public Point getPanelPos(int structure, int pos) {
Point p = new Point();
int lineNr = pos / DEFAULT_LINE_LENGTH;
int linePos = pos % DEFAULT_LINE_LENGTH;
int x = linePos * DEFAULT_CHAR_SIZE + DEFAULT_X_SPACE +
DEFAULT_LEGEND_SIZE;
int y = lineNr * DEFAULT_Y_STEP + DEFAULT_Y_SPACE;
y += DEFAULT_LINE_... | [
"public",
"Point",
"getPanelPos",
"(",
"int",
"structure",
",",
"int",
"pos",
")",
"{",
"Point",
"p",
"=",
"new",
"Point",
"(",
")",
";",
"int",
"lineNr",
"=",
"pos",
"/",
"DEFAULT_LINE_LENGTH",
";",
"int",
"linePos",
"=",
"pos",
"%",
"DEFAULT_LINE_LENGT... | Get the X position on the Panel of a particular sequence position.
@param structure index of the structure for the sequence position.
@param pos sequence position, the aligned position index
@return the point on a panel for a sequence position | [
"Get",
"the",
"X",
"position",
"on",
"the",
"Panel",
"of",
"a",
"particular",
"sequence",
"position",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/MultipleAlignmentCoordManager.java#L145-L159 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newCloneException | public static CloneException newCloneException(Throwable cause, String message, Object... args) {
"""
Constructs and initializes a new {@link CloneException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} ide... | java | public static CloneException newCloneException(Throwable cause, String message, Object... args) {
return new CloneException(format(message, args), cause);
} | [
"public",
"static",
"CloneException",
"newCloneException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"CloneException",
"(",
"format",
"(",
"message",
",",
"args",
")",
",",
"cause",
")",
";"... | Constructs and initializes a new {@link CloneException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link CloneException} was thrown.
@param message {@link String} describing the {@l... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"CloneException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L285-L287 |
Waikato/moa | moa/src/main/java/moa/clusterers/outliers/utils/mtree/MTree.java | MTree.getNearest | public Query getNearest(DATA queryData, double range, int limit) {
"""
Performs a nearest-neighbor query on the M-Tree, constrained by distance
and/or the number of neighbors.
@param queryData The query data object.
@param range The maximum distance from {@code queryData} to fetched
neighbors.
@param limi... | java | public Query getNearest(DATA queryData, double range, int limit) {
return new Query(queryData, range, limit);
} | [
"public",
"Query",
"getNearest",
"(",
"DATA",
"queryData",
",",
"double",
"range",
",",
"int",
"limit",
")",
"{",
"return",
"new",
"Query",
"(",
"queryData",
",",
"range",
",",
"limit",
")",
";",
"}"
] | Performs a nearest-neighbor query on the M-Tree, constrained by distance
and/or the number of neighbors.
@param queryData The query data object.
@param range The maximum distance from {@code queryData} to fetched
neighbors.
@param limit The maximum number of neighbors to fetch.
@return A {@link Query} object us... | [
"Performs",
"a",
"nearest",
"-",
"neighbor",
"query",
"on",
"the",
"M",
"-",
"Tree",
"constrained",
"by",
"distance",
"and",
"/",
"or",
"the",
"number",
"of",
"neighbors",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/outliers/utils/mtree/MTree.java#L435-L437 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.