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 |
|---|---|---|---|---|---|---|---|---|---|---|
PrashamTrivedi/SharedPreferenceInspector | sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/SharedPrefsBrowser.java | SharedPrefsBrowser.startFragment | public void startFragment(Fragment fragment, String tag, boolean canAddToBackstack) {
"""
Start given Fragment
@param fragment
: Fragment Instance to start.
@param tag
: Tag to be notified when adding to backstack
@param canAddToBackstack
: pass <code>true</code> if you want to add this item in backstack. ... | java | public void startFragment(Fragment fragment, String tag, boolean canAddToBackstack) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction().replace(R.id.fragmentContainer, fragment);
if (canAddToBackstack) {
transaction.addToBackStack(tag);
}
transaction.commit();
} | [
"public",
"void",
"startFragment",
"(",
"Fragment",
"fragment",
",",
"String",
"tag",
",",
"boolean",
"canAddToBackstack",
")",
"{",
"FragmentTransaction",
"transaction",
"=",
"getSupportFragmentManager",
"(",
")",
".",
"beginTransaction",
"(",
")",
".",
"replace",
... | Start given Fragment
@param fragment
: Fragment Instance to start.
@param tag
: Tag to be notified when adding to backstack
@param canAddToBackstack
: pass <code>true</code> if you want to add this item in backstack. pass <code>false</code> otherwise | [
"Start",
"given",
"Fragment"
] | train | https://github.com/PrashamTrivedi/SharedPreferenceInspector/blob/c04d567c4d0fc5e0f8cda308ca85df19c6b3b838/sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/SharedPrefsBrowser.java#L36-L43 |
killbill/killbill | util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java | InternalCallContextFactory.createInternalTenantContext | public InternalTenantContext createInternalTenantContext(final UUID objectId, final ObjectType objectType, final TenantContext context) {
"""
Crate an internal tenant callcontext from a tenant callcontext, and retrieving the account_record_id from another table
@param objectId the id of the row in the table p... | java | public InternalTenantContext createInternalTenantContext(final UUID objectId, final ObjectType objectType, final TenantContext context) {
// The callcontext may come from a user API - for security, check we're not doing cross-tenants operations
//final Long tenantRecordIdFromObject = retrieveTenantRecor... | [
"public",
"InternalTenantContext",
"createInternalTenantContext",
"(",
"final",
"UUID",
"objectId",
",",
"final",
"ObjectType",
"objectType",
",",
"final",
"TenantContext",
"context",
")",
"{",
"// The callcontext may come from a user API - for security, check we're not doing cross... | Crate an internal tenant callcontext from a tenant callcontext, and retrieving the account_record_id from another table
@param objectId the id of the row in the table pointed by object type where to look for account_record_id
@param objectType the object type pointed by this objectId
@param context original tenan... | [
"Crate",
"an",
"internal",
"tenant",
"callcontext",
"from",
"a",
"tenant",
"callcontext",
"and",
"retrieving",
"the",
"account_record_id",
"from",
"another",
"table"
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java#L138-L147 |
sannies/mp4parser | muxer/src/main/java/org/mp4parser/muxer/tracks/AbstractH26XTrack.java | AbstractH26XTrack.createSampleObject | protected Sample createSampleObject(List<? extends ByteBuffer> nals) {
"""
Builds an MP4 sample from a list of NALs. Each NAL will be preceded by its
4 byte (unit32) length.
@param nals a list of NALs that form the sample
@return sample as it appears in the MP4 file
"""
byte[] sizeInfo = new byte[... | java | protected Sample createSampleObject(List<? extends ByteBuffer> nals) {
byte[] sizeInfo = new byte[nals.size() * 4];
ByteBuffer sizeBuf = ByteBuffer.wrap(sizeInfo);
for (ByteBuffer b : nals) {
sizeBuf.putInt(b.remaining());
}
ByteBuffer[] data = new ByteBuffer[nals.si... | [
"protected",
"Sample",
"createSampleObject",
"(",
"List",
"<",
"?",
"extends",
"ByteBuffer",
">",
"nals",
")",
"{",
"byte",
"[",
"]",
"sizeInfo",
"=",
"new",
"byte",
"[",
"nals",
".",
"size",
"(",
")",
"*",
"4",
"]",
";",
"ByteBuffer",
"sizeBuf",
"=",
... | Builds an MP4 sample from a list of NALs. Each NAL will be preceded by its
4 byte (unit32) length.
@param nals a list of NALs that form the sample
@return sample as it appears in the MP4 file | [
"Builds",
"an",
"MP4",
"sample",
"from",
"a",
"list",
"of",
"NALs",
".",
"Each",
"NAL",
"will",
"be",
"preceded",
"by",
"its",
"4",
"byte",
"(",
"unit32",
")",
"length",
"."
] | train | https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/muxer/src/main/java/org/mp4parser/muxer/tracks/AbstractH26XTrack.java#L81-L96 |
alkacon/opencms-core | src/org/opencms/workflow/CmsExtendedWorkflowManager.java | CmsExtendedWorkflowManager.generateProjectName | protected String generateProjectName(CmsObject userCms, boolean shortTime) {
"""
Generates the name for a new workflow project based on the user for whom it is created.<p>
@param userCms the user's current CMS context
@param shortTime if true, the short time format will be used, else the medium time format
... | java | protected String generateProjectName(CmsObject userCms, boolean shortTime) {
CmsUser user = userCms.getRequestContext().getCurrentUser();
long time = System.currentTimeMillis();
Date date = new Date(time);
OpenCms.getLocaleManager();
Locale locale = CmsLocaleManager.getDef... | [
"protected",
"String",
"generateProjectName",
"(",
"CmsObject",
"userCms",
",",
"boolean",
"shortTime",
")",
"{",
"CmsUser",
"user",
"=",
"userCms",
".",
"getRequestContext",
"(",
")",
".",
"getCurrentUser",
"(",
")",
";",
"long",
"time",
"=",
"System",
".",
... | Generates the name for a new workflow project based on the user for whom it is created.<p>
@param userCms the user's current CMS context
@param shortTime if true, the short time format will be used, else the medium time format
@return the workflow project name | [
"Generates",
"the",
"name",
"for",
"a",
"new",
"workflow",
"project",
"based",
"on",
"the",
"user",
"for",
"whom",
"it",
"is",
"created",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workflow/CmsExtendedWorkflowManager.java#L521-L536 |
infinispan/infinispan | extended-statistics/src/main/java/org/infinispan/stats/topK/StreamSummaryContainer.java | StreamSummaryContainer.addGet | public void addGet(Object key, boolean remote) {
"""
Adds the key to the read top-key.
@param remote {@code true} if the key is remote, {@code false} otherwise.
"""
if (!isEnabled()) {
return;
}
syncOffer(remote ? Stat.REMOTE_GET : Stat.LOCAL_GET, key);
} | java | public void addGet(Object key, boolean remote) {
if (!isEnabled()) {
return;
}
syncOffer(remote ? Stat.REMOTE_GET : Stat.LOCAL_GET, key);
} | [
"public",
"void",
"addGet",
"(",
"Object",
"key",
",",
"boolean",
"remote",
")",
"{",
"if",
"(",
"!",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"syncOffer",
"(",
"remote",
"?",
"Stat",
".",
"REMOTE_GET",
":",
"Stat",
".",
"LOCAL_GET",
",",... | Adds the key to the read top-key.
@param remote {@code true} if the key is remote, {@code false} otherwise. | [
"Adds",
"the",
"key",
"to",
"the",
"read",
"top",
"-",
"key",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/extended-statistics/src/main/java/org/infinispan/stats/topK/StreamSummaryContainer.java#L102-L107 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/carts/ExtendedPropertyUrl.java | ExtendedPropertyUrl.updateExtendedPropertyUrl | public static MozuUrl updateExtendedPropertyUrl(String key, String responseFields, Boolean upsert) {
"""
Get Resource Url for UpdateExtendedProperty
@param key Key used for metadata defined for objects, including extensible attributes, custom attributes associated with a shipping provider, and search synonyms def... | java | public static MozuUrl updateExtendedPropertyUrl(String key, String responseFields, Boolean upsert)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/extendedproperties/{key}?upsert={upsert}&responseFields={responseFields}");
formatter.formatUrl("key", key);
formatter.formatUrl("respons... | [
"public",
"static",
"MozuUrl",
"updateExtendedPropertyUrl",
"(",
"String",
"key",
",",
"String",
"responseFields",
",",
"Boolean",
"upsert",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/carts/current/extendedproperties/{key}?upser... | Get Resource Url for UpdateExtendedProperty
@param key Key used for metadata defined for objects, including extensible attributes, custom attributes associated with a shipping provider, and search synonyms definitions. This content may be user-defined depending on the object and usage.
@param responseFields Filtering s... | [
"Get",
"Resource",
"Url",
"for",
"UpdateExtendedProperty"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/carts/ExtendedPropertyUrl.java#L43-L50 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/URLConnectionFactory.java | URLConnectionFactory.configureTLS | private void configureTLS(URL url, URLConnection conn) {
"""
If the protocol is HTTPS, this will configure the cipher suites so that
connections can be made to the NVD, and others, using older versions of
Java.
@param url the URL
@param conn the connection
"""
if ("https".equals(url.getProtocol()... | java | private void configureTLS(URL url, URLConnection conn) {
if ("https".equals(url.getProtocol())) {
try {
final HttpsURLConnection secCon = (HttpsURLConnection) conn;
final SSLSocketFactoryEx factory = new SSLSocketFactoryEx(settings);
secCon.setSSLSocke... | [
"private",
"void",
"configureTLS",
"(",
"URL",
"url",
",",
"URLConnection",
"conn",
")",
"{",
"if",
"(",
"\"https\"",
".",
"equals",
"(",
"url",
".",
"getProtocol",
"(",
")",
")",
")",
"{",
"try",
"{",
"final",
"HttpsURLConnection",
"secCon",
"=",
"(",
... | If the protocol is HTTPS, this will configure the cipher suites so that
connections can be made to the NVD, and others, using older versions of
Java.
@param url the URL
@param conn the connection | [
"If",
"the",
"protocol",
"is",
"HTTPS",
"this",
"will",
"configure",
"the",
"cipher",
"suites",
"so",
"that",
"connections",
"can",
"be",
"made",
"to",
"the",
"NVD",
"and",
"others",
"using",
"older",
"versions",
"of",
"Java",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/URLConnectionFactory.java#L213-L225 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/ClusterSampling.java | ClusterSampling.xbarStd | public static double xbarStd(TransposeDataCollection sampleDataCollection, int populationM, double Nbar) {
"""
Calculates Standard Deviation for Xbar
@param sampleDataCollection
@param populationM
@param Nbar
@return
"""
return Math.sqrt(xbarVariance(sampleDataCollection, populationM, Nbar));
... | java | public static double xbarStd(TransposeDataCollection sampleDataCollection, int populationM, double Nbar) {
return Math.sqrt(xbarVariance(sampleDataCollection, populationM, Nbar));
} | [
"public",
"static",
"double",
"xbarStd",
"(",
"TransposeDataCollection",
"sampleDataCollection",
",",
"int",
"populationM",
",",
"double",
"Nbar",
")",
"{",
"return",
"Math",
".",
"sqrt",
"(",
"xbarVariance",
"(",
"sampleDataCollection",
",",
"populationM",
",",
"... | Calculates Standard Deviation for Xbar
@param sampleDataCollection
@param populationM
@param Nbar
@return | [
"Calculates",
"Standard",
"Deviation",
"for",
"Xbar"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/ClusterSampling.java#L132-L134 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java | ConditionalCheck.noNullElements | @ArgumentsChecked
@Throws( {
"""
Ensures that an array does not contain {@code null}.
<p>
We recommend to use the overloaded method {@link Check#noNullElements(Object[], String)} and pass as second
argument the name of the parameter to enhance the exception message.
@param condition
condition must be {@c... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalNullElementsException.class })
public static <T> void noNullElements(final boolean condition, @Nonnull final T[] array) {
if (condition) {
Check.noNullElements(array);
}
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalNullElementsException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
">",
"void",
"noNullElements",
"(",
"final",
"boolean",
"condition",
",",
"... | Ensures that an array does not contain {@code null}.
<p>
We recommend to use the overloaded method {@link Check#noNullElements(Object[], String)} and pass as second
argument the name of the parameter to enhance the exception message.
@param condition
condition must be {@code true}^ so that the check will be performed... | [
"Ensures",
"that",
"an",
"array",
"does",
"not",
"contain",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L1112-L1118 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/util/ReorderingBlockingQueue.java | ReorderingBlockingQueue.put | public void put(final E e, final long timeStamp) throws InterruptedException {
"""
Inserts an element with given timestamp, waiting for space to become available
if the timestamp of the element minus the current timestamp of the queue exceeds
the queue capacity.
@param e an element.
@param timeStamp the time... | java | public void put(final E e, final long timeStamp) throws InterruptedException {
final ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try {
// mask is a.length - 1
while(timeStamp - this.timeStamp > mask) newSpaceAvailable.await();
final int timeOffset = (int)(timeStamp - this.timeStamp);
ass... | [
"public",
"void",
"put",
"(",
"final",
"E",
"e",
",",
"final",
"long",
"timeStamp",
")",
"throws",
"InterruptedException",
"{",
"final",
"ReentrantLock",
"lock",
"=",
"this",
".",
"lock",
";",
"lock",
".",
"lockInterruptibly",
"(",
")",
";",
"try",
"{",
... | Inserts an element with given timestamp, waiting for space to become available
if the timestamp of the element minus the current timestamp of the queue exceeds
the queue capacity.
@param e an element.
@param timeStamp the timestamp of {@code e}. | [
"Inserts",
"an",
"element",
"with",
"given",
"timestamp",
"waiting",
"for",
"space",
"to",
"become",
"available",
"if",
"the",
"timestamp",
"of",
"the",
"element",
"minus",
"the",
"current",
"timestamp",
"of",
"the",
"queue",
"exceeds",
"the",
"queue",
"capaci... | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/util/ReorderingBlockingQueue.java#L77-L92 |
sniffy/sniffy | sniffy-core/src/main/java/io/sniffy/LegacySpy.java | LegacySpy.expectBetween | @Deprecated
public C expectBetween(int minAllowedStatements, int maxAllowedStatements, Threads threadMatcher) {
"""
Adds an expectation to the current instance that at least {@code minAllowedStatements} and at most
{@code maxAllowedStatements} were called between the creation of the current instance
and a ca... | java | @Deprecated
public C expectBetween(int minAllowedStatements, int maxAllowedStatements, Threads threadMatcher) {
return expect(SqlQueries.queriesBetween(minAllowedStatements, maxAllowedStatements).threads(threadMatcher));
} | [
"@",
"Deprecated",
"public",
"C",
"expectBetween",
"(",
"int",
"minAllowedStatements",
",",
"int",
"maxAllowedStatements",
",",
"Threads",
"threadMatcher",
")",
"{",
"return",
"expect",
"(",
"SqlQueries",
".",
"queriesBetween",
"(",
"minAllowedStatements",
",",
"max... | Adds an expectation to the current instance that at least {@code minAllowedStatements} and at most
{@code maxAllowedStatements} were called between the creation of the current instance
and a call to {@link #verify()} method
@since 2.0 | [
"Adds",
"an",
"expectation",
"to",
"the",
"current",
"instance",
"that",
"at",
"least",
"{"
] | train | https://github.com/sniffy/sniffy/blob/7bdddb9593e6b6e9fe5c7c87519f864acbc3a5c0/sniffy-core/src/main/java/io/sniffy/LegacySpy.java#L597-L600 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/ClassUtils.java | ClassUtils.buildApplicationObject | public static <T> T buildApplicationObject(Class<T> interfaceClass,
Collection<String> classNamesIterator, T defaultObject, FacesConfigurator config) {
"""
Creates ApplicationObjects like NavigationHandler or StateManager and creates
the right wrapping chain of the A... | java | public static <T> T buildApplicationObject(Class<T> interfaceClass,
Collection<String> classNamesIterator, T defaultObject, FacesConfigurator config)
{
return buildApplicationObject(interfaceClass, null, null, classNamesIterator, defaultObject, config);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"buildApplicationObject",
"(",
"Class",
"<",
"T",
">",
"interfaceClass",
",",
"Collection",
"<",
"String",
">",
"classNamesIterator",
",",
"T",
"defaultObject",
",",
"FacesConfigurator",
"config",
")",
"{",
"return",
"bu... | Creates ApplicationObjects like NavigationHandler or StateManager and creates
the right wrapping chain of the ApplicationObjects known as the decorator pattern.
@param <T>
@param interfaceClass The class from which the implementation has to inherit from.
@param classNamesIterator All the class names of the actual Appl... | [
"Creates",
"ApplicationObjects",
"like",
"NavigationHandler",
"or",
"StateManager",
"and",
"creates",
"the",
"right",
"wrapping",
"chain",
"of",
"the",
"ApplicationObjects",
"known",
"as",
"the",
"decorator",
"pattern",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/ClassUtils.java#L557-L561 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.getRelativeSubPath | public static String getRelativeSubPath(String base, String path) {
"""
Converts the given path to a path relative to a base folder,
but only if it actually is a sub-path of the latter,
otherwise <code>null</code> is returned.<p>
<b>Directly exposed for JSP EL</b>, not through {@link org.opencms.jsp.util.CmsJ... | java | public static String getRelativeSubPath(String base, String path) {
String result = null;
base = CmsStringUtil.joinPaths(base, "/");
path = CmsStringUtil.joinPaths(path, "/");
if (path.startsWith(base)) {
result = path.substring(base.length());
}
if (result !... | [
"public",
"static",
"String",
"getRelativeSubPath",
"(",
"String",
"base",
",",
"String",
"path",
")",
"{",
"String",
"result",
"=",
"null",
";",
"base",
"=",
"CmsStringUtil",
".",
"joinPaths",
"(",
"base",
",",
"\"/\"",
")",
";",
"path",
"=",
"CmsStringUt... | Converts the given path to a path relative to a base folder,
but only if it actually is a sub-path of the latter,
otherwise <code>null</code> is returned.<p>
<b>Directly exposed for JSP EL</b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p>
@param base the base path
@param path the path which should b... | [
"Converts",
"the",
"given",
"path",
"to",
"a",
"path",
"relative",
"to",
"a",
"base",
"folder",
"but",
"only",
"if",
"it",
"actually",
"is",
"a",
"sub",
"-",
"path",
"of",
"the",
"latter",
"otherwise",
"<code",
">",
"null<",
"/",
"code",
">",
"is",
"... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L992-L1009 |
alexa/alexa-skills-kit-sdk-for-java | ask-sdk-runtime/src/com/amazon/ask/response/template/impl/BaseTemplateFactory.java | BaseTemplateFactory.processTemplate | @Override
public Output processTemplate(String responseTemplateName, Map<String, Object> dataMap, Input input) throws TemplateFactoryException {
"""
Process template and data using provided {@link TemplateLoader} and {@link TemplateRenderer} to generate skill response output.
@param responseTemplateName nam... | java | @Override
public Output processTemplate(String responseTemplateName, Map<String, Object> dataMap, Input input) throws TemplateFactoryException {
if (templateLoaders == null || templateLoaders.isEmpty() || templateRenderer == null) {
String message = "Template Loader list is null or empty, or Tem... | [
"@",
"Override",
"public",
"Output",
"processTemplate",
"(",
"String",
"responseTemplateName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"dataMap",
",",
"Input",
"input",
")",
"throws",
"TemplateFactoryException",
"{",
"if",
"(",
"templateLoaders",
"==",
"n... | Process template and data using provided {@link TemplateLoader} and {@link TemplateRenderer} to generate skill response output.
@param responseTemplateName name of response template
@param dataMap map contains injecting data
@param input skill input
@return Output skill response output if loading and rendering success... | [
"Process",
"template",
"and",
"data",
"using",
"provided",
"{",
"@link",
"TemplateLoader",
"}",
"and",
"{",
"@link",
"TemplateRenderer",
"}",
"to",
"generate",
"skill",
"response",
"output",
"."
] | train | https://github.com/alexa/alexa-skills-kit-sdk-for-java/blob/c49194da0693898c70f3f2c4a372f5a12da04e3e/ask-sdk-runtime/src/com/amazon/ask/response/template/impl/BaseTemplateFactory.java#L64-L74 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.createRequest | private InternalRequest createRequest(
HttpMethodName httpMethod, AbstractBceRequest request, String...pathVariables) {
"""
Creates and initializes a new request object for the specified resource. This method is responsible for
determining HTTP method, URI path, credentials and request body for POST m... | java | private InternalRequest createRequest(
HttpMethodName httpMethod, AbstractBceRequest request, String...pathVariables) {
// build URL paths
List<String> pathComponents = new ArrayList<String>();
pathComponents.add(VERSION);
// append resourceKeys,pathVariables,
// Fo... | [
"private",
"InternalRequest",
"createRequest",
"(",
"HttpMethodName",
"httpMethod",
",",
"AbstractBceRequest",
"request",
",",
"String",
"...",
"pathVariables",
")",
"{",
"// build URL paths",
"List",
"<",
"String",
">",
"pathComponents",
"=",
"new",
"ArrayList",
"<",... | Creates and initializes a new request object for the specified resource. This method is responsible for
determining HTTP method, URI path, credentials and request body for POST method.
<p>
<b>Note: </b> The Query parameters in URL should be specified by caller method.
</p>
@param httpMethod The HTTP method to use when... | [
"Creates",
"and",
"initializes",
"a",
"new",
"request",
"object",
"for",
"the",
"specified",
"resource",
".",
"This",
"method",
"is",
"responsible",
"for",
"determining",
"HTTP",
"method",
"URI",
"path",
"credentials",
"and",
"request",
"body",
"for",
"POST",
... | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L1046-L1072 |
op4j/op4j | src/main/java/org/op4j/functions/FnString.java | FnString.toShort | public static final Function<String,Short> toShort(final RoundingMode roundingMode, final Locale locale) {
"""
<p>
Converts a String into a Short, using the specified locale for determining
decimal point. Rounding mode is used for removing the
decimal part of the number. The integer part of the input string mus... | java | public static final Function<String,Short> toShort(final RoundingMode roundingMode, final Locale locale) {
return new ToShort(roundingMode, locale);
} | [
"public",
"static",
"final",
"Function",
"<",
"String",
",",
"Short",
">",
"toShort",
"(",
"final",
"RoundingMode",
"roundingMode",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"new",
"ToShort",
"(",
"roundingMode",
",",
"locale",
")",
";",
"}"
] | <p>
Converts a String into a Short, using the specified locale for determining
decimal point. Rounding mode is used for removing the
decimal part of the number. The integer part of the input string must be between
{@link Short#MIN_VALUE} and {@link Short#MAX_VALUE}
</p>
@param roundingMode the rounding mode to be used... | [
"<p",
">",
"Converts",
"a",
"String",
"into",
"a",
"Short",
"using",
"the",
"specified",
"locale",
"for",
"determining",
"decimal",
"point",
".",
"Rounding",
"mode",
"is",
"used",
"for",
"removing",
"the",
"decimal",
"part",
"of",
"the",
"number",
".",
"Th... | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnString.java#L1104-L1106 |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onArrayFor | public static <T> Level0ArrayOperator<String[],String> onArrayFor(final String... elements) {
"""
<p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining
"""
re... | java | public static <T> Level0ArrayOperator<String[],String> onArrayFor(final String... elements) {
return onArrayOf(Types.STRING, VarArgsUtil.asRequiredObjectArray(elements));
} | [
"public",
"static",
"<",
"T",
">",
"Level0ArrayOperator",
"<",
"String",
"[",
"]",
",",
"String",
">",
"onArrayFor",
"(",
"final",
"String",
"...",
"elements",
")",
"{",
"return",
"onArrayOf",
"(",
"Types",
".",
"STRING",
",",
"VarArgsUtil",
".",
"asRequir... | <p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining | [
"<p",
">",
"Creates",
"an",
"array",
"with",
"the",
"specified",
"elements",
"and",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"it",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L984-L986 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/host_interface.java | host_interface.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
host_interface_responses result = (host_interface_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
host_interface_responses result = (host_interface_responses) service.get_payload_formatter().string_to_resource(host_interface_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"host_interface_responses",
"result",
"=",
"(",
"host_interface_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/host_interface.java#L986-L1003 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_ftw.java | xen_health_ftw.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_health_ftw_responses result = (xen_health_ftw_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_health_ftw_responses result = (xen_health_ftw_responses) service.get_payload_formatter().string_to_resource(xen_health_ftw_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_health_ftw_responses",
"result",
"=",
"(",
"xen_health_ftw_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_ftw.java#L289-L306 |
maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java | SharedPreferencesHelper.loadPreferenceAsLong | public Long loadPreferenceAsLong(String key, Long defaultValue) {
"""
Retrieve a long value from the preferences.
@param key The name of the preference to retrieve
@param defaultValue Value to return if this preference does not exist
@return the preference value if it exists, or defaultValue.
"""
Long v... | java | public Long loadPreferenceAsLong(String key, Long defaultValue) {
Long value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getLong(key, 0L);
}
logLoad(key, value);
return value;
} | [
"public",
"Long",
"loadPreferenceAsLong",
"(",
"String",
"key",
",",
"Long",
"defaultValue",
")",
"{",
"Long",
"value",
"=",
"defaultValue",
";",
"if",
"(",
"hasPreference",
"(",
"key",
")",
")",
"{",
"value",
"=",
"getSharedPreferences",
"(",
")",
".",
"g... | Retrieve a long value from the preferences.
@param key The name of the preference to retrieve
@param defaultValue Value to return if this preference does not exist
@return the preference value if it exists, or defaultValue. | [
"Retrieve",
"a",
"long",
"value",
"from",
"the",
"preferences",
"."
] | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java#L228-L236 |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/DeployCommand.java | DeployCommand.canCheckWar | public boolean canCheckWar(String warName, String url, HttpClient client) {
"""
Checks via an http options request that the endpoint exists to check for deployment state.
@param warName
@param url
@param client
@return
"""
HttpOptions opt = new HttpOptions(url + "/" + warName);
try {
HttpResp... | java | public boolean canCheckWar(String warName, String url, HttpClient client) {
HttpOptions opt = new HttpOptions(url + "/" + warName);
try {
HttpResponse response = client.execute(opt);
if(response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
Header allowHeader[] = response.getHeaders... | [
"public",
"boolean",
"canCheckWar",
"(",
"String",
"warName",
",",
"String",
"url",
",",
"HttpClient",
"client",
")",
"{",
"HttpOptions",
"opt",
"=",
"new",
"HttpOptions",
"(",
"url",
"+",
"\"/\"",
"+",
"warName",
")",
";",
"try",
"{",
"HttpResponse",
"res... | Checks via an http options request that the endpoint exists to check for deployment state.
@param warName
@param url
@param client
@return | [
"Checks",
"via",
"an",
"http",
"options",
"request",
"that",
"the",
"endpoint",
"exists",
"to",
"check",
"for",
"deployment",
"state",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/DeployCommand.java#L200-L220 |
LearnLib/automatalib | util/src/main/java/net/automatalib/util/automata/transducers/MealyFilter.java | MealyFilter.retainTransitionsWithOutput | public static <I, O> CompactMealy<I, O> retainTransitionsWithOutput(MealyMachine<?, I, ?, O> in,
Alphabet<I> inputs,
Collection<? super O> outputs) {
"""
Returns a Mealy m... | java | public static <I, O> CompactMealy<I, O> retainTransitionsWithOutput(MealyMachine<?, I, ?, O> in,
Alphabet<I> inputs,
Collection<? super O> outputs) {
return filterByOut... | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"CompactMealy",
"<",
"I",
",",
"O",
">",
"retainTransitionsWithOutput",
"(",
"MealyMachine",
"<",
"?",
",",
"I",
",",
"?",
",",
"O",
">",
"in",
",",
"Alphabet",
"<",
"I",
">",
"inputs",
",",
"Collection",
... | Returns a Mealy machine with all transitions removed that have an output not among the specified values. The
resulting Mealy machine will not contain any unreachable states.
@param in
the input Mealy machine
@param inputs
the input alphabet
@param outputs
the outputs to retain
@return a Mealy machine with all transit... | [
"Returns",
"a",
"Mealy",
"machine",
"with",
"all",
"transitions",
"removed",
"that",
"have",
"an",
"output",
"not",
"among",
"the",
"specified",
"values",
".",
"The",
"resulting",
"Mealy",
"machine",
"will",
"not",
"contain",
"any",
"unreachable",
"states",
".... | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/automata/transducers/MealyFilter.java#L138-L142 |
jmeetsma/Iglu-Http | src/main/java/org/ijsberg/iglu/util/http/MultiPartReader.java | MultiPartReader.readMultipartUpload | public long readMultipartUpload() throws IOException {
"""
Reads uploaded files and form variables from POSTed data.
Files are stored on disk in case uploadDir is not null.
Otherwise files are stored as attributes on the http-request in the form of FileObjects, using the name of the html-form-variable as key.
P... | java | public long readMultipartUpload() throws IOException
{
input = request.getInputStream();
//the next variable stores all post data and is useful for debug purposes
bytesReadAsLine = input.readLine(line, 0, BUFFER_SIZE);
if (bytesReadAsLine <= 2)
{
return 0;
}
bytesRead = bytesReadAsLine;
//save ... | [
"public",
"long",
"readMultipartUpload",
"(",
")",
"throws",
"IOException",
"{",
"input",
"=",
"request",
".",
"getInputStream",
"(",
")",
";",
"//the next variable stores all post data and is useful for debug purposes",
"bytesReadAsLine",
"=",
"input",
".",
"readLine",
"... | Reads uploaded files and form variables from POSTed data.
Files are stored on disk in case uploadDir is not null.
Otherwise files are stored as attributes on the http-request in the form of FileObjects, using the name of the html-form-variable as key.
Plain properties are stored as String attributes on the http-request... | [
"Reads",
"uploaded",
"files",
"and",
"form",
"variables",
"from",
"POSTed",
"data",
".",
"Files",
"are",
"stored",
"on",
"disk",
"in",
"case",
"uploadDir",
"is",
"not",
"null",
".",
"Otherwise",
"files",
"are",
"stored",
"as",
"attributes",
"on",
"the",
"h... | train | https://github.com/jmeetsma/Iglu-Http/blob/5b5ed3b417285dc79b7aa013bf2340bb5ba1ffbe/src/main/java/org/ijsberg/iglu/util/http/MultiPartReader.java#L87-L151 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaasqueue/src/main/java/net/minidev/ovh/api/ApiOvhDbaasqueue.java | ApiOvhDbaasqueue.serviceName_topic_topicId_DELETE | public void serviceName_topic_topicId_DELETE(String serviceName, String topicId) throws IOException {
"""
Delete a topic
REST: DELETE /dbaas/queue/{serviceName}/topic/{topicId}
@param serviceName [required] Application ID
@param topicId [required] Topic ID
API beta
"""
String qPath = "/dbaas/queue/{s... | java | public void serviceName_topic_topicId_DELETE(String serviceName, String topicId) throws IOException {
String qPath = "/dbaas/queue/{serviceName}/topic/{topicId}";
StringBuilder sb = path(qPath, serviceName, topicId);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_topic_topicId_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"topicId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/queue/{serviceName}/topic/{topicId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPat... | Delete a topic
REST: DELETE /dbaas/queue/{serviceName}/topic/{topicId}
@param serviceName [required] Application ID
@param topicId [required] Topic ID
API beta | [
"Delete",
"a",
"topic"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaasqueue/src/main/java/net/minidev/ovh/api/ApiOvhDbaasqueue.java#L258-L262 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/compiler/AbstractProcessor.java | AbstractProcessor.getIdentifier | protected static String getIdentifier(final String[] command, final String fallback) {
"""
Determines the identification of a command line processor by capture the
first line of its output for a specific command.
@param command
array of command line arguments starting with executable
name. For example, { "cl... | java | protected static String getIdentifier(final String[] command, final String fallback) {
String identifier = fallback;
try {
final String[] cmdout = CaptureStreamHandler.run(command);
if (cmdout.length > 0) {
identifier = cmdout[0];
}
} catch (final Throwable ex) {
identifier =... | [
"protected",
"static",
"String",
"getIdentifier",
"(",
"final",
"String",
"[",
"]",
"command",
",",
"final",
"String",
"fallback",
")",
"{",
"String",
"identifier",
"=",
"fallback",
";",
"try",
"{",
"final",
"String",
"[",
"]",
"cmdout",
"=",
"CaptureStreamH... | Determines the identification of a command line processor by capture the
first line of its output for a specific command.
@param command
array of command line arguments starting with executable
name. For example, { "cl" }
@param fallback
start of identifier if there is an error in executing the
command
@return identif... | [
"Determines",
"the",
"identification",
"of",
"a",
"command",
"line",
"processor",
"by",
"capture",
"the",
"first",
"line",
"of",
"its",
"output",
"for",
"a",
"specific",
"command",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/compiler/AbstractProcessor.java#L52-L63 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/GHUtility.java | GHUtility.sortDFS | public static Graph sortDFS(Graph g, Graph sortedGraph) {
"""
Sorts the graph according to depth-first search traversal. Other traversals have either no
significant difference (bfs) for querying or are worse (z-curve).
"""
int nodes = g.getNodes();
final GHIntArrayList list = new GHIntArrayLis... | java | public static Graph sortDFS(Graph g, Graph sortedGraph) {
int nodes = g.getNodes();
final GHIntArrayList list = new GHIntArrayList(nodes);
list.fill(nodes, -1);
final GHBitSetImpl bitset = new GHBitSetImpl(nodes);
final AtomicInteger ref = new AtomicInteger(-1);
EdgeExplo... | [
"public",
"static",
"Graph",
"sortDFS",
"(",
"Graph",
"g",
",",
"Graph",
"sortedGraph",
")",
"{",
"int",
"nodes",
"=",
"g",
".",
"getNodes",
"(",
")",
";",
"final",
"GHIntArrayList",
"list",
"=",
"new",
"GHIntArrayList",
"(",
"nodes",
")",
";",
"list",
... | Sorts the graph according to depth-first search traversal. Other traversals have either no
significant difference (bfs) for querying or are worse (z-curve). | [
"Sorts",
"the",
"graph",
"according",
"to",
"depth",
"-",
"first",
"search",
"traversal",
".",
"Other",
"traversals",
"have",
"either",
"no",
"significant",
"difference",
"(",
"bfs",
")",
"for",
"querying",
"or",
"are",
"worse",
"(",
"z",
"-",
"curve",
")"... | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/GHUtility.java#L308-L331 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParametersLazyList.java | QueryParametersLazyList.updateCache | private void updateCache(int index, QueryParameters params) {
"""
Updates value in cache.
After cache update - cache trim is performed {@link LinkedHashMap#removeEldestEntry(java.util.Map.Entry)}
@param index index at which the specified element is to be inserted
@param params element to be inserted
"""
... | java | private void updateCache(int index, QueryParameters params) {
if (generatedCacheMap.containsKey(index) == true) {
this.generatedCacheMap.put(index, params);
} else {
this.resultSetCacheMap.put(index, params);
}
} | [
"private",
"void",
"updateCache",
"(",
"int",
"index",
",",
"QueryParameters",
"params",
")",
"{",
"if",
"(",
"generatedCacheMap",
".",
"containsKey",
"(",
"index",
")",
"==",
"true",
")",
"{",
"this",
".",
"generatedCacheMap",
".",
"put",
"(",
"index",
",... | Updates value in cache.
After cache update - cache trim is performed {@link LinkedHashMap#removeEldestEntry(java.util.Map.Entry)}
@param index index at which the specified element is to be inserted
@param params element to be inserted | [
"Updates",
"value",
"in",
"cache",
".",
"After",
"cache",
"update",
"-",
"cache",
"trim",
"is",
"performed",
"{",
"@link",
"LinkedHashMap#removeEldestEntry",
"(",
"java",
".",
"util",
".",
"Map",
".",
"Entry",
")",
"}"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParametersLazyList.java#L909-L915 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.getMetadataWithChildrenIfChangedC | public <C> Maybe<DbxEntry./*@Nullable*/WithChildrenC<C>> getMetadataWithChildrenIfChangedC(
String path, /*@Nullable*/String previousFolderHash, Collector<DbxEntry,? extends C> collector)
throws DbxException {
"""
Same as {@link #getMetadataWithChildrenIfChangedC(String, boolean, String, Collec... | java | public <C> Maybe<DbxEntry./*@Nullable*/WithChildrenC<C>> getMetadataWithChildrenIfChangedC(
String path, /*@Nullable*/String previousFolderHash, Collector<DbxEntry,? extends C> collector)
throws DbxException
{
return getMetadataWithChildrenIfChangedC(path, false, previousFolderHash, coll... | [
"public",
"<",
"C",
">",
"Maybe",
"<",
"DbxEntry",
".",
"/*@Nullable*/",
"WithChildrenC",
"<",
"C",
">",
">",
"getMetadataWithChildrenIfChangedC",
"(",
"String",
"path",
",",
"/*@Nullable*/",
"String",
"previousFolderHash",
",",
"Collector",
"<",
"DbxEntry",
",",
... | Same as {@link #getMetadataWithChildrenIfChangedC(String, boolean, String, Collector)} with
{@code includeMediaInfo} set to {@code false}. | [
"Same",
"as",
"{"
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L305-L310 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/PortletPreferencesJsonDaoImpl.java | PortletPreferencesJsonDaoImpl.storeJson | @Override
public void storeJson(PortletPreferences prefs, String key, Object data)
throws IOException, ReadOnlyException, ValidatorException {
"""
Stores a Java object as JSON in a portlet preference
@param prefs Preferences to persist to
@param key Preference key to store in
@param data Objec... | java | @Override
public void storeJson(PortletPreferences prefs, String key, Object data)
throws IOException, ReadOnlyException, ValidatorException {
final String configData = mapper.writeValueAsString(data);
prefs.setValue(key, configData);
prefs.store();
} | [
"@",
"Override",
"public",
"void",
"storeJson",
"(",
"PortletPreferences",
"prefs",
",",
"String",
"key",
",",
"Object",
"data",
")",
"throws",
"IOException",
",",
"ReadOnlyException",
",",
"ValidatorException",
"{",
"final",
"String",
"configData",
"=",
"mapper",... | Stores a Java object as JSON in a portlet preference
@param prefs Preferences to persist to
@param key Preference key to store in
@param data Object to store as JSON | [
"Stores",
"a",
"Java",
"object",
"as",
"JSON",
"in",
"a",
"portlet",
"preference"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/PortletPreferencesJsonDaoImpl.java#L48-L54 |
goshippo/shippo-java-client | src/main/java/com/shippo/model/Track.java | Track.trackingNumberURL | private static String trackingNumberURL(String carrier, String trackingNumber)
throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException {
"""
Return URL that maps given tracking number on given carrier as
https://api.goshippo.com/tracks/<i>carrier</i>/<i>tracking number</i>... | java | private static String trackingNumberURL(String carrier, String trackingNumber)
throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException {
try {
return String.format("%s/%s/%s", classURL(Track.class), urlEncode(carrier), urlEncode(trackingNumber));
} catch (UnsupportedEncod... | [
"private",
"static",
"String",
"trackingNumberURL",
"(",
"String",
"carrier",
",",
"String",
"trackingNumber",
")",
"throws",
"AuthenticationException",
",",
"InvalidRequestException",
",",
"APIConnectionException",
",",
"APIException",
"{",
"try",
"{",
"return",
"Strin... | Return URL that maps given tracking number on given carrier as
https://api.goshippo.com/tracks/<i>carrier</i>/<i>tracking number</i> | [
"Return",
"URL",
"that",
"maps",
"given",
"tracking",
"number",
"on",
"given",
"carrier",
"as",
"https",
":",
"//",
"api",
".",
"goshippo",
".",
"com",
"/",
"tracks",
"/",
"<i",
">",
"carrier<",
"/",
"i",
">",
"/",
"<i",
">",
"tracking",
"number<",
"... | train | https://github.com/goshippo/shippo-java-client/blob/eecf801c7e07a627c3677a331c0cfcf36cb1678b/src/main/java/com/shippo/model/Track.java#L166-L174 |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/files/FileServiceRootImpl.java | FileServiceRootImpl.bind | public void bind(String address, @Service FileServiceBind service) {
"""
/*
public void addFile(String dir, String tail)
{
boolean isEphemeral = false;
if (isEphemeral) {
String metaKey = getMetaKey(dir + "/" + tail);
_metaStore.put(metaKey, _selfServer);
}
BfsFileImpl dirService = lookupImpl(dir);
... | java | public void bind(String address, @Service FileServiceBind service)
{
_bindMap.put(address, service);
} | [
"public",
"void",
"bind",
"(",
"String",
"address",
",",
"@",
"Service",
"FileServiceBind",
"service",
")",
"{",
"_bindMap",
".",
"put",
"(",
"address",
",",
"service",
")",
";",
"}"
] | /*
public void addFile(String dir, String tail)
{
boolean isEphemeral = false;
if (isEphemeral) {
String metaKey = getMetaKey(dir + "/" + tail);
_metaStore.put(metaKey, _selfServer);
}
BfsFileImpl dirService = lookupImpl(dir);
dirService.addFile(tail, Result.ignore());
} | [
"/",
"*",
"public",
"void",
"addFile",
"(",
"String",
"dir",
"String",
"tail",
")",
"{",
"boolean",
"isEphemeral",
"=",
"false",
";"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/files/FileServiceRootImpl.java#L889-L892 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java | ServiceBuilder.withCacheFactory | public ServiceBuilder withCacheFactory(Function<ComponentSetup, CacheFactory> cacheFactoryCreator) {
"""
Attaches the given CacheFactory creator to this ServiceBuilder. The given Function will only not be invoked
right away; it will be called when needed.
@param cacheFactoryCreator The Function to attach.
@re... | java | public ServiceBuilder withCacheFactory(Function<ComponentSetup, CacheFactory> cacheFactoryCreator) {
Preconditions.checkNotNull(cacheFactoryCreator, "cacheFactoryCreator");
this.cacheFactoryCreator = cacheFactoryCreator;
return this;
} | [
"public",
"ServiceBuilder",
"withCacheFactory",
"(",
"Function",
"<",
"ComponentSetup",
",",
"CacheFactory",
">",
"cacheFactoryCreator",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"cacheFactoryCreator",
",",
"\"cacheFactoryCreator\"",
")",
";",
"this",
".",
... | Attaches the given CacheFactory creator to this ServiceBuilder. The given Function will only not be invoked
right away; it will be called when needed.
@param cacheFactoryCreator The Function to attach.
@return This ServiceBuilder. | [
"Attaches",
"the",
"given",
"CacheFactory",
"creator",
"to",
"this",
"ServiceBuilder",
".",
"The",
"given",
"Function",
"will",
"only",
"not",
"be",
"invoked",
"right",
"away",
";",
"it",
"will",
"be",
"called",
"when",
"needed",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java#L209-L213 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java | DynamicReportBuilder.addAutoText | public DynamicReportBuilder addAutoText(String message, byte position, byte alignment, int width) {
"""
Adds a custom fixed message (literal) in header or footer. The message
width will be the page width<br>
The parameters are all constants from the
<code>ar.com.fdvs.dj.domain.AutoText</code> class
<br>
<br>
... | java | public DynamicReportBuilder addAutoText(String message, byte position, byte alignment, int width) {
HorizontalBandAlignment alignment_ = HorizontalBandAlignment.buildAligment(alignment);
AutoText text = new AutoText(message, position, alignment_, width);
addAutoText(text);
return this;
... | [
"public",
"DynamicReportBuilder",
"addAutoText",
"(",
"String",
"message",
",",
"byte",
"position",
",",
"byte",
"alignment",
",",
"int",
"width",
")",
"{",
"HorizontalBandAlignment",
"alignment_",
"=",
"HorizontalBandAlignment",
".",
"buildAligment",
"(",
"alignment"... | Adds a custom fixed message (literal) in header or footer. The message
width will be the page width<br>
The parameters are all constants from the
<code>ar.com.fdvs.dj.domain.AutoText</code> class
<br>
<br>
@param message The text to show
@param position POSITION_HEADER or POSITION_FOOTER
@param alignment <br>ALIGME... | [
"Adds",
"a",
"custom",
"fixed",
"message",
"(",
"literal",
")",
"in",
"header",
"or",
"footer",
".",
"The",
"message",
"width",
"will",
"be",
"the",
"page",
"width<br",
">",
"The",
"parameters",
"are",
"all",
"constants",
"from",
"the",
"<code",
">",
"ar... | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java#L223-L228 |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.url/src/com/ibm/ws/artifact/url/internal/WSJarURLStreamHandler.java | WSJarURLStreamHandler.constructUNCTolerantURL | protected static URL constructUNCTolerantURL(String protocolPrefix, String urlString) throws IOException {
"""
<liberty> brought across from ClassLoaderUtils from /SERV1/ws/code/classloader/src/com/ibm/ws/classloader/</liberty>
A method for constructing a purely path based URL from an input string that may
optio... | java | protected static URL constructUNCTolerantURL(String protocolPrefix, String urlString) throws IOException {
int protocolDelimiterIndex = urlString.indexOf(':');
String urlProtocol, urlPath;
if (protocolDelimiterIndex < 0 || !(urlProtocol = urlString.substring(0, protocolDelimiterIndex)).equalsIgn... | [
"protected",
"static",
"URL",
"constructUNCTolerantURL",
"(",
"String",
"protocolPrefix",
",",
"String",
"urlString",
")",
"throws",
"IOException",
"{",
"int",
"protocolDelimiterIndex",
"=",
"urlString",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"String",
"urlProto... | <liberty> brought across from ClassLoaderUtils from /SERV1/ws/code/classloader/src/com/ibm/ws/classloader/</liberty>
A method for constructing a purely path based URL from an input string that may
optionally contain UNC compliant host names. Examples of properly formatted urlString inputs
are as follows:
Remote file s... | [
"<liberty",
">",
"brought",
"across",
"from",
"ClassLoaderUtils",
"from",
"/",
"SERV1",
"/",
"ws",
"/",
"code",
"/",
"classloader",
"/",
"src",
"/",
"com",
"/",
"ibm",
"/",
"ws",
"/",
"classloader",
"/",
"<",
"/",
"liberty",
">",
"A",
"method",
"for",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.url/src/com/ibm/ws/artifact/url/internal/WSJarURLStreamHandler.java#L426-L440 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/charset/CoderResult.java | CoderResult.malformedForLength | public static synchronized CoderResult malformedForLength(int length)
throws IllegalArgumentException {
"""
Gets a <code>CoderResult</code> object indicating a malformed-input
error.
@param length
the length of the malformed-input.
@return a <code>CoderResult</code> object indicating a malformed-... | java | public static synchronized CoderResult malformedForLength(int length)
throws IllegalArgumentException {
if (length > 0) {
Integer key = Integer.valueOf(length);
synchronized (_malformedErrors) {
CoderResult r = _malformedErrors.get(key);
if (r ... | [
"public",
"static",
"synchronized",
"CoderResult",
"malformedForLength",
"(",
"int",
"length",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"length",
">",
"0",
")",
"{",
"Integer",
"key",
"=",
"Integer",
".",
"valueOf",
"(",
"length",
")",
";",
... | Gets a <code>CoderResult</code> object indicating a malformed-input
error.
@param length
the length of the malformed-input.
@return a <code>CoderResult</code> object indicating a malformed-input
error.
@throws IllegalArgumentException
if <code>length</code> is non-positive. | [
"Gets",
"a",
"<code",
">",
"CoderResult<",
"/",
"code",
">",
"object",
"indicating",
"a",
"malformed",
"-",
"input",
"error",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/charset/CoderResult.java#L112-L126 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/BaseSerializer.java | BaseSerializer.deserializeDataActionList | public List<DataAction> deserializeDataActionList(String str) {
"""
Deserialize a DataAction List serialized using {@link #serializeDataActionList(List)}, or
an array serialized using {@link #serialize(DataAction[])}
@param str String representation (YAML/JSON) of the DataAction list
@return {@code List<DataA... | java | public List<DataAction> deserializeDataActionList(String str) {
return load(str, ListWrappers.DataActionList.class).getList();
} | [
"public",
"List",
"<",
"DataAction",
">",
"deserializeDataActionList",
"(",
"String",
"str",
")",
"{",
"return",
"load",
"(",
"str",
",",
"ListWrappers",
".",
"DataActionList",
".",
"class",
")",
".",
"getList",
"(",
")",
";",
"}"
] | Deserialize a DataAction List serialized using {@link #serializeDataActionList(List)}, or
an array serialized using {@link #serialize(DataAction[])}
@param str String representation (YAML/JSON) of the DataAction list
@return {@code List<DataAction>} | [
"Deserialize",
"a",
"DataAction",
"List",
"serialized",
"using",
"{",
"@link",
"#serializeDataActionList",
"(",
"List",
")",
"}",
"or",
"an",
"array",
"serialized",
"using",
"{",
"@link",
"#serialize",
"(",
"DataAction",
"[]",
")",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/BaseSerializer.java#L333-L335 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java | GeometryUtilities.getLineWithPlaneIntersection | public static Coordinate getLineWithPlaneIntersection( Coordinate lC1, Coordinate lC2, Coordinate pC1, Coordinate pC2,
Coordinate pC3 ) {
"""
Get the intersection coordinate between a line and plane.
<p>The line is defined by 2 3d coordinates and the plane by 3 3d coordinates.</p>
<p>from http://... | java | public static Coordinate getLineWithPlaneIntersection( Coordinate lC1, Coordinate lC2, Coordinate pC1, Coordinate pC2,
Coordinate pC3 ) {
double[] p = getPlaneCoefficientsFrom3Points(pC1, pC2, pC3);
double denominator = p[0] * (lC1.x - lC2.x) + p[1] * (lC1.y - lC2.y) + p[2] * (lC1.z - lC2.z... | [
"public",
"static",
"Coordinate",
"getLineWithPlaneIntersection",
"(",
"Coordinate",
"lC1",
",",
"Coordinate",
"lC2",
",",
"Coordinate",
"pC1",
",",
"Coordinate",
"pC2",
",",
"Coordinate",
"pC3",
")",
"{",
"double",
"[",
"]",
"p",
"=",
"getPlaneCoefficientsFrom3Po... | Get the intersection coordinate between a line and plane.
<p>The line is defined by 2 3d coordinates and the plane by 3 3d coordinates.</p>
<p>from http://paulbourke.net/geometry/pointlineplane/</p>
@param lC1 line coordinate 1.
@param lC2 line coordinate 2.
@param pC1 plane coordinate 1.
@param pC2 plane coordinate... | [
"Get",
"the",
"intersection",
"coordinate",
"between",
"a",
"line",
"and",
"plane",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java#L766-L780 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.clearCall | public void clearCall(
String connId,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
"""
End the conference call for all parties. This can be performed by any agent participating in the conference.
@param connId The connection... | java | public void clearCall(
String connId,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
try {
VoicecallsidanswerData clearData = new VoicecallsidanswerData();
clearData.setReasons(Util.toKVList(reason... | [
"public",
"void",
"clearCall",
"(",
"String",
"connId",
",",
"KeyValueCollection",
"reasons",
",",
"KeyValueCollection",
"extensions",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"VoicecallsidanswerData",
"clearData",
"=",
"new",
"VoicecallsidanswerData",
"... | End the conference call for all parties. This can be performed by any agent participating in the conference.
@param connId The connection ID of the call to clear.
@param reasons Information on causes for, and results of, actions taken by the user of the current DN. For details about reasons, refer to the [*Genesys Even... | [
"End",
"the",
"conference",
"call",
"for",
"all",
"parties",
".",
"This",
"can",
"be",
"performed",
"by",
"any",
"agent",
"participating",
"in",
"the",
"conference",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L1328-L1346 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java | CommerceRegionPersistenceImpl.findAll | @Override
public List<CommerceRegion> findAll(int start, int end) {
"""
Returns a range of all the commerce regions.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Th... | java | @Override
public List<CommerceRegion> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceRegion",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce regions.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>star... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"regions",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java#L3506-L3509 |
micronaut-projects/micronaut-core | http-server-netty/src/main/java/io/micronaut/http/server/netty/NettyHttpResponseFactory.java | NettyHttpResponseFactory.getOr | @Internal
public static NettyMutableHttpResponse getOr(NettyHttpRequest<?> request, io.micronaut.http.HttpResponse<?> alternative) {
"""
Lookup the response from the context.
@param request The context
@param alternative The alternative HttpResponse
@return The {@link NettyMutableHttpResponse}
"""... | java | @Internal
public static NettyMutableHttpResponse getOr(NettyHttpRequest<?> request, io.micronaut.http.HttpResponse<?> alternative) {
Attribute<NettyMutableHttpResponse> attr = request.attr(KEY);
NettyMutableHttpResponse nettyHttpResponse = attr.get();
if (nettyHttpResponse == null) {
... | [
"@",
"Internal",
"public",
"static",
"NettyMutableHttpResponse",
"getOr",
"(",
"NettyHttpRequest",
"<",
"?",
">",
"request",
",",
"io",
".",
"micronaut",
".",
"http",
".",
"HttpResponse",
"<",
"?",
">",
"alternative",
")",
"{",
"Attribute",
"<",
"NettyMutableH... | Lookup the response from the context.
@param request The context
@param alternative The alternative HttpResponse
@return The {@link NettyMutableHttpResponse} | [
"Lookup",
"the",
"response",
"from",
"the",
"context",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/NettyHttpResponseFactory.java#L89-L98 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optString | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static String optString(@Nullable Bundle bundle, @Nullable String key, @Nullable String fallback) {
"""
Returns a optional {@link java.lang.String} value. In other words, returns the value mapped by key if it exists and is a {@link java.lang.String}.
The bundle ... | java | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static String optString(@Nullable Bundle bundle, @Nullable String key, @Nullable String fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getString(key, fallback);
} | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"LOLLIPOP",
")",
"public",
"static",
"String",
"optString",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"String",
"fallback",
")",
"{",
"i... | Returns a optional {@link java.lang.String} value. In other words, returns the value mapped by key if it exists and is a {@link java.lang.String}.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a fallback value.
@param bundle a bundle. If the bundle is null, this method wi... | [
"Returns",
"a",
"optional",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L979-L985 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/impl/GeldKarteParser.java | GeldKarteParser.readEF_BLOG | protected void readEF_BLOG(final Application pApplication) throws CommunicationException {
"""
Read EF_BLOG
@param pApplication emv application
@throws CommunicationException communication error
"""
List<EmvTransactionRecord> list = new ArrayList<EmvTransactionRecord>();
SimpleDateFormat dateFormat = n... | java | protected void readEF_BLOG(final Application pApplication) throws CommunicationException{
List<EmvTransactionRecord> list = new ArrayList<EmvTransactionRecord>();
SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy");
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
// Read each record... | [
"protected",
"void",
"readEF_BLOG",
"(",
"final",
"Application",
"pApplication",
")",
"throws",
"CommunicationException",
"{",
"List",
"<",
"EmvTransactionRecord",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"EmvTransactionRecord",
">",
"(",
")",
";",
"SimpleDateForm... | Read EF_BLOG
@param pApplication emv application
@throws CommunicationException communication error | [
"Read",
"EF_BLOG"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/GeldKarteParser.java#L126-L155 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java | ClassesManager.getFieldName | private static String getFieldName(Class<?> aClass,String regex) {
"""
This method returns the name of the field whose name matches with regex.
@param aClass class to check
@param regex regex used to find the field
@return the field name if exists, null otherwise
"""
for (Field field : aClass.getDeclared... | java | private static String getFieldName(Class<?> aClass,String regex){
for (Field field : aClass.getDeclaredFields())
if(field.getName().matches(regex))
return field.getName();
return null;
} | [
"private",
"static",
"String",
"getFieldName",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"String",
"regex",
")",
"{",
"for",
"(",
"Field",
"field",
":",
"aClass",
".",
"getDeclaredFields",
"(",
")",
")",
"if",
"(",
"field",
".",
"getName",
"(",
")",
... | This method returns the name of the field whose name matches with regex.
@param aClass class to check
@param regex regex used to find the field
@return the field name if exists, null otherwise | [
"This",
"method",
"returns",
"the",
"name",
"of",
"the",
"field",
"whose",
"name",
"matches",
"with",
"regex",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java#L413-L419 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cos/CloudFile.java | CloudFile.save | @SuppressWarnings("unused")
public static Completable save(String path, String data) {
"""
保存文件到云上,阻塞直到保存成功返回
@param path 文件相对路径
@param data 文件内容
@return successful/unsuccessful unit response
"""
Map<String, Object> map = new HashMap<String, Object>() {{
put("path", path);
... | java | @SuppressWarnings("unused")
public static Completable save(String path, String data) {
Map<String, Object> map = new HashMap<String, Object>() {{
put("path", path);
put("data", data);
}};
return SingleRxXian.call("cosService", "cosWrite", map).toCompletable();
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"static",
"Completable",
"save",
"(",
"String",
"path",
",",
"String",
"data",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",... | 保存文件到云上,阻塞直到保存成功返回
@param path 文件相对路径
@param data 文件内容
@return successful/unsuccessful unit response | [
"保存文件到云上,阻塞直到保存成功返回"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cos/CloudFile.java#L26-L33 |
leadware/jpersistence-tools | jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorHelper.java | DAOValidatorHelper.arraryContains | public static <T extends Object> boolean arraryContains(T[] array, T value) {
"""
Methode permettant de savoir si un Objet de type T est contenu dans un Tableau d'objet de type T
@param array Tableau d'objet d'un type T
@param value Objet d'un Type T
@param <T> Type de valeurs du tableau
@return Etat de presen... | java | public static <T extends Object> boolean arraryContains(T[] array, T value) {
// Si le tableau est vide
if(array == null || array.length == 0) {
// On retourne false
return false;
}
// Si le mode est vide
if(value == null) {
// On retourne false
return false;
}
... | [
"public",
"static",
"<",
"T",
"extends",
"Object",
">",
"boolean",
"arraryContains",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"value",
")",
"{",
"// Si le tableau est vide\r",
"if",
"(",
"array",
"==",
"null",
"||",
"array",
".",
"length",
"==",
"0",
")",
... | Methode permettant de savoir si un Objet de type T est contenu dans un Tableau d'objet de type T
@param array Tableau d'objet d'un type T
@param value Objet d'un Type T
@param <T> Type de valeurs du tableau
@return Etat de presence | [
"Methode",
"permettant",
"de",
"savoir",
"si",
"un",
"Objet",
"de",
"type",
"T",
"est",
"contenu",
"dans",
"un",
"Tableau",
"d",
"objet",
"de",
"type",
"T"
] | train | https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorHelper.java#L373-L406 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEquivalentObjectPropertiesAxiomImpl_CustomFieldSerializer.java | OWLEquivalentObjectPropertiesAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLEquivalentObjectPropertiesAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLEquivalentObjectPropertiesAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLEquivalentObjectPropertiesAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";"... | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEquivalentObjectPropertiesAxiomImpl_CustomFieldSerializer.java#L96-L99 |
elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/AbstractCoverTree.java | AbstractCoverTree.collectByCover | protected void collectByCover(DBIDRef cur, ModifiableDoubleDBIDList candidates, double fmax, ModifiableDoubleDBIDList collect) {
"""
Collect all elements with respect to a new routing object.
@param cur Routing object
@param candidates Candidate list
@param fmax Maximum distance
@param collect Output list
... | java | protected void collectByCover(DBIDRef cur, ModifiableDoubleDBIDList candidates, double fmax, ModifiableDoubleDBIDList collect) {
assert (collect.size() == 0) : "Not empty";
DoubleDBIDListIter it = candidates.iter().advance(); // Except first = cur!
while(it.valid()) {
assert (!DBIDUtil.equal(cur, it))... | [
"protected",
"void",
"collectByCover",
"(",
"DBIDRef",
"cur",
",",
"ModifiableDoubleDBIDList",
"candidates",
",",
"double",
"fmax",
",",
"ModifiableDoubleDBIDList",
"collect",
")",
"{",
"assert",
"(",
"collect",
".",
"size",
"(",
")",
"==",
"0",
")",
":",
"\"N... | Collect all elements with respect to a new routing object.
@param cur Routing object
@param candidates Candidate list
@param fmax Maximum distance
@param collect Output list | [
"Collect",
"all",
"elements",
"with",
"respect",
"to",
"a",
"new",
"routing",
"object",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/AbstractCoverTree.java#L193-L207 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.trapezoidCrop | public Matrix4f trapezoidCrop(float p0x, float p0y, float p1x, float p1y, float p2x, float p2y, float p3x, float p3y) {
"""
Set <code>this</code> matrix to a perspective transformation that maps the trapezoid spanned by the four corner coordinates
<code>(p0x, p0y)</code>, <code>(p1x, p1y)</code>, <code>(p2x, p2y)... | java | public Matrix4f trapezoidCrop(float p0x, float p0y, float p1x, float p1y, float p2x, float p2y, float p3x, float p3y) {
float aX = p1y - p0y, aY = p0x - p1x;
float m00 = aY;
float m10 = -aX;
float m30 = aX * p0y - aY * p0x;
float m01 = aX;
float m11 = aY;
float m3... | [
"public",
"Matrix4f",
"trapezoidCrop",
"(",
"float",
"p0x",
",",
"float",
"p0y",
",",
"float",
"p1x",
",",
"float",
"p1y",
",",
"float",
"p2x",
",",
"float",
"p2y",
",",
"float",
"p3x",
",",
"float",
"p3y",
")",
"{",
"float",
"aX",
"=",
"p1y",
"-",
... | Set <code>this</code> matrix to a perspective transformation that maps the trapezoid spanned by the four corner coordinates
<code>(p0x, p0y)</code>, <code>(p1x, p1y)</code>, <code>(p2x, p2y)</code> and <code>(p3x, p3y)</code> to the unit square <code>[(-1, -1)..(+1, +1)]</code>.
<p>
The corner coordinates are given in ... | [
"Set",
"<code",
">",
"this<",
"/",
"code",
">",
"matrix",
"to",
"a",
"perspective",
"transformation",
"that",
"maps",
"the",
"trapezoid",
"spanned",
"by",
"the",
"four",
"corner",
"coordinates",
"<code",
">",
"(",
"p0x",
"p0y",
")",
"<",
"/",
"code",
">"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L13935-L13971 |
jenkinsci/jenkins | core/src/main/java/hudson/util/AlternativeUiTextProvider.java | AlternativeUiTextProvider.get | public static <T> String get(Message<T> text, T context) {
"""
Consults all the existing {@link AlternativeUiTextProvider} and return an override, if any,
or null.
"""
for (AlternativeUiTextProvider p : all()) {
String s = p.getText(text, context);
if (s!=null)
... | java | public static <T> String get(Message<T> text, T context) {
for (AlternativeUiTextProvider p : all()) {
String s = p.getText(text, context);
if (s!=null)
return s;
}
return null;
} | [
"public",
"static",
"<",
"T",
">",
"String",
"get",
"(",
"Message",
"<",
"T",
">",
"text",
",",
"T",
"context",
")",
"{",
"for",
"(",
"AlternativeUiTextProvider",
"p",
":",
"all",
"(",
")",
")",
"{",
"String",
"s",
"=",
"p",
".",
"getText",
"(",
... | Consults all the existing {@link AlternativeUiTextProvider} and return an override, if any,
or null. | [
"Consults",
"all",
"the",
"existing",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/AlternativeUiTextProvider.java#L84-L91 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/doc/DocClient.java | DocClient.deleteNotification | public DeleteNotificationResponse deleteNotification(DeleteNotificationRequest request) {
"""
Delete your doc notification by doc notification name.
@param request The request object containing all parameters for deleting dco notification.
@return the response
"""
checkNotNull(request, "The paramet... | java | public DeleteNotificationResponse deleteNotification(DeleteNotificationRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getName(), "The parameter name should NOT be null or empty string.");
InternalRequest internalRequest = create... | [
"public",
"DeleteNotificationResponse",
"deleteNotification",
"(",
"DeleteNotificationRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getName",
"(",
"... | Delete your doc notification by doc notification name.
@param request The request object containing all parameters for deleting dco notification.
@return the response | [
"Delete",
"your",
"doc",
"notification",
"by",
"doc",
"notification",
"name",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/doc/DocClient.java#L841-L847 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.appendString | public static File appendString(String content, String path, String charset) throws IORuntimeException {
"""
将String写入文件,追加模式
@param content 写入的内容
@param path 文件路径
@param charset 字符集
@return 写入的文件
@throws IORuntimeException IO异常
"""
return appendString(content, touch(path), charset);
} | java | public static File appendString(String content, String path, String charset) throws IORuntimeException {
return appendString(content, touch(path), charset);
} | [
"public",
"static",
"File",
"appendString",
"(",
"String",
"content",
",",
"String",
"path",
",",
"String",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"appendString",
"(",
"content",
",",
"touch",
"(",
"path",
")",
",",
"charset",
")",
";... | 将String写入文件,追加模式
@param content 写入的内容
@param path 文件路径
@param charset 字符集
@return 写入的文件
@throws IORuntimeException IO异常 | [
"将String写入文件,追加模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2787-L2789 |
haifengl/smile | math/src/main/java/smile/math/special/Gamma.java | Gamma.regularizedIncompleteGamma | public static double regularizedIncompleteGamma(double s, double x) {
"""
Regularized Incomplete Gamma Function
P(s,x) = <i><big>∫</big><sub><small>0</small></sub><sup><small>x</small></sup> e<sup>-t</sup> t<sup>(s-1)</sup> dt</i>
"""
if (s < 0.0) {
throw new IllegalArgumentException... | java | public static double regularizedIncompleteGamma(double s, double x) {
if (s < 0.0) {
throw new IllegalArgumentException("Invalid s: " + s);
}
if (x < 0.0) {
throw new IllegalArgumentException("Invalid x: " + x);
}
double igf = 0.0;
if (x < s + 1... | [
"public",
"static",
"double",
"regularizedIncompleteGamma",
"(",
"double",
"s",
",",
"double",
"x",
")",
"{",
"if",
"(",
"s",
"<",
"0.0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid s: \"",
"+",
"s",
")",
";",
"}",
"if",
"(",
"x... | Regularized Incomplete Gamma Function
P(s,x) = <i><big>∫</big><sub><small>0</small></sub><sup><small>x</small></sup> e<sup>-t</sup> t<sup>(s-1)</sup> dt</i> | [
"Regularized",
"Incomplete",
"Gamma",
"Function",
"P",
"(",
"s",
"x",
")",
"=",
"<i",
">",
"<big",
">",
"∫",
";",
"<",
"/",
"big",
">",
"<sub",
">",
"<small",
">",
"0<",
"/",
"small",
">",
"<",
"/",
"sub",
">",
"<sup",
">",
"<small",
">",
... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/special/Gamma.java#L122-L142 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/EmailApi.java | EmailApi.saveEmail | public ApiSuccessResponse saveEmail(String id, SaveData saveData) throws ApiException {
"""
Save email information to UCS
Save email information of interaction specified in the id path parameter
@param id id of interaction to save (required)
@param saveData Request parameters. (optional)
@return ApiSuccessResp... | java | public ApiSuccessResponse saveEmail(String id, SaveData saveData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = saveEmailWithHttpInfo(id, saveData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"saveEmail",
"(",
"String",
"id",
",",
"SaveData",
"saveData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"saveEmailWithHttpInfo",
"(",
"id",
",",
"saveData",
")",
";",
"return",
... | Save email information to UCS
Save email information of interaction specified in the id path parameter
@param id id of interaction to save (required)
@param saveData Request parameters. (optional)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the respon... | [
"Save",
"email",
"information",
"to",
"UCS",
"Save",
"email",
"information",
"of",
"interaction",
"specified",
"in",
"the",
"id",
"path",
"parameter"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/EmailApi.java#L763-L766 |
Azure/azure-sdk-for-java | compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/SnapshotsInner.java | SnapshotsInner.createOrUpdateAsync | public Observable<SnapshotInner> createOrUpdateAsync(String resourceGroupName, String snapshotName, SnapshotInner snapshot) {
"""
Creates or updates a snapshot.
@param resourceGroupName The name of the resource group.
@param snapshotName The name of the snapshot that is being created. The name can't be changed... | java | public Observable<SnapshotInner> createOrUpdateAsync(String resourceGroupName, String snapshotName, SnapshotInner snapshot) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot).map(new Func1<ServiceResponse<SnapshotInner>, SnapshotInner>() {
@Override
... | [
"public",
"Observable",
"<",
"SnapshotInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"snapshotName",
",",
"SnapshotInner",
"snapshot",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"sna... | Creates or updates a snapshot.
@param resourceGroupName The name of the resource group.
@param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
@param sn... | [
"Creates",
"or",
"updates",
"a",
"snapshot",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/SnapshotsInner.java#L171-L178 |
JavaMoney/jsr354-ri | moneta-core/src/main/java/org/javamoney/moneta/spi/MoneyUtils.java | MoneyUtils.getBigDecimal | public static BigDecimal getBigDecimal(Number num, MonetaryContext moneyContext) {
"""
Creates a {@link BigDecimal} from the given {@link Number} doing the
valid conversion depending the type given, if a {@link MonetaryContext}
is given, it is applied to the number returned.
@param num the number type
@retur... | java | public static BigDecimal getBigDecimal(Number num, MonetaryContext moneyContext) {
BigDecimal bd = getBigDecimal(num);
if (Objects.nonNull(moneyContext)) {
MathContext mc = getMathContext(moneyContext, HALF_EVEN);
bd = new BigDecimal(bd.toString(), mc);
int maxScale = mo... | [
"public",
"static",
"BigDecimal",
"getBigDecimal",
"(",
"Number",
"num",
",",
"MonetaryContext",
"moneyContext",
")",
"{",
"BigDecimal",
"bd",
"=",
"getBigDecimal",
"(",
"num",
")",
";",
"if",
"(",
"Objects",
".",
"nonNull",
"(",
"moneyContext",
")",
")",
"{... | Creates a {@link BigDecimal} from the given {@link Number} doing the
valid conversion depending the type given, if a {@link MonetaryContext}
is given, it is applied to the number returned.
@param num the number type
@return the corresponding {@link BigDecimal} | [
"Creates",
"a",
"{",
"@link",
"BigDecimal",
"}",
"from",
"the",
"given",
"{",
"@link",
"Number",
"}",
"doing",
"the",
"valid",
"conversion",
"depending",
"the",
"type",
"given",
"if",
"a",
"{",
"@link",
"MonetaryContext",
"}",
"is",
"given",
"it",
"is",
... | train | https://github.com/JavaMoney/jsr354-ri/blob/cf8ff2bbaf9b115acc05eb9b0c76c8397c308284/moneta-core/src/main/java/org/javamoney/moneta/spi/MoneyUtils.java#L101-L117 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java | XPathParser.errorForDOM3 | void errorForDOM3(String msg, Object[] args) throws TransformerException {
"""
This method is added to support DOM 3 XPath API.
<p>
This method is exactly like error(String, Object[]); except that
the underlying TransformerException is
XpathStylesheetDOM3Exception (which extends TransformerException).
<p>
So... | java | void errorForDOM3(String msg, Object[] args) throws TransformerException
{
String fmsg = XSLMessages.createXPATHMessage(msg, args);
ErrorListener ehandler = this.getErrorListener();
TransformerException te = new XPathStylesheetDOM3Exception(fmsg, m_sourceLocator);
if (null != ehandler)
{
// TO DO: Need to g... | [
"void",
"errorForDOM3",
"(",
"String",
"msg",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"TransformerException",
"{",
"String",
"fmsg",
"=",
"XSLMessages",
".",
"createXPATHMessage",
"(",
"msg",
",",
"args",
")",
";",
"ErrorListener",
"ehandler",
"=",
"... | This method is added to support DOM 3 XPath API.
<p>
This method is exactly like error(String, Object[]); except that
the underlying TransformerException is
XpathStylesheetDOM3Exception (which extends TransformerException).
<p>
So older XPath code in Xalan is not affected by this. To older XPath code
the behavior of wh... | [
"This",
"method",
"is",
"added",
"to",
"support",
"DOM",
"3",
"XPath",
"API",
".",
"<p",
">",
"This",
"method",
"is",
"exactly",
"like",
"error",
"(",
"String",
"Object",
"[]",
")",
";",
"except",
"that",
"the",
"underlying",
"TransformerException",
"is",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java#L649-L666 |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java | MessageProcessor.sendAndListen | public <T extends BasicMessage> RPCConnectionContext sendAndListen(ProducerConnectionContext context,
BasicMessage basicMessage, BasicMessageListener<T> responseListener) throws JMSException {
"""
Same as {@link #sendAndListen(ProducerConnectionContext, BasicMessage, BasicMessageListener, Map)} with
<... | java | public <T extends BasicMessage> RPCConnectionContext sendAndListen(ProducerConnectionContext context,
BasicMessage basicMessage, BasicMessageListener<T> responseListener) throws JMSException {
return sendAndListen(context, basicMessage, responseListener, null);
} | [
"public",
"<",
"T",
"extends",
"BasicMessage",
">",
"RPCConnectionContext",
"sendAndListen",
"(",
"ProducerConnectionContext",
"context",
",",
"BasicMessage",
"basicMessage",
",",
"BasicMessageListener",
"<",
"T",
">",
"responseListener",
")",
"throws",
"JMSException",
... | Same as {@link #sendAndListen(ProducerConnectionContext, BasicMessage, BasicMessageListener, Map)} with
<code>null</code> headers. | [
"Same",
"as",
"{"
] | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java#L250-L253 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Flowable.java | Flowable.throttleFirst | @CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Flowable<T> throttleFirst(long skipDuration, TimeUnit unit, Scheduler scheduler) {
"""
Returns a Flowable that emits only the first item emitted by the source Publisher during sequenti... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Flowable<T> throttleFirst(long skipDuration, TimeUnit unit, Scheduler scheduler) {
ObjectHelper.requireNonNull(unit, "unit is null");
ObjectHelper.requireNonNull(scheduler, ... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"ERROR",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"CUSTOM",
")",
"public",
"final",
"Flowable",
"<",
"T",
">",
"throttleFirst",
"(",
"long",
"skipDuration",
",",
... | Returns a Flowable that emits only the first item emitted by the source Publisher during sequential
time windows of a specified duration, where the windows are managed by a specified Scheduler.
<p>
This differs from {@link #throttleLast} in that this only tracks the passage of time whereas
{@link #throttleLast} ticks a... | [
"Returns",
"a",
"Flowable",
"that",
"emits",
"only",
"the",
"first",
"item",
"emitted",
"by",
"the",
"source",
"Publisher",
"during",
"sequential",
"time",
"windows",
"of",
"a",
"specified",
"duration",
"where",
"the",
"windows",
"are",
"managed",
"by",
"a",
... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L15592-L15599 |
loldevs/riotapi | rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsChampionTradeService.java | LcdsChampionTradeService.attemptTrade | public Object attemptTrade(String summonerInternalName, int championId) {
"""
Attempt to trade with the target player
@param summonerInternalName The summoner's internal name, as sent by {@link #getPotentialTraders()}
@param championId Unknown - id of sent champion? id of trade?
@return unknown
"""
... | java | public Object attemptTrade(String summonerInternalName, int championId) {
return client.sendRpcAndWait(SERVICE, "attemptTrade", summonerInternalName, championId, false);
} | [
"public",
"Object",
"attemptTrade",
"(",
"String",
"summonerInternalName",
",",
"int",
"championId",
")",
"{",
"return",
"client",
".",
"sendRpcAndWait",
"(",
"SERVICE",
",",
"\"attemptTrade\"",
",",
"summonerInternalName",
",",
"championId",
",",
"false",
")",
";... | Attempt to trade with the target player
@param summonerInternalName The summoner's internal name, as sent by {@link #getPotentialTraders()}
@param championId Unknown - id of sent champion? id of trade?
@return unknown | [
"Attempt",
"to",
"trade",
"with",
"the",
"target",
"player"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsChampionTradeService.java#L45-L47 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/animation/NavigationAnimationFactory.java | NavigationAnimationFactory.createZoomIn | public static NavigationAnimation createZoomIn(MapPresenter mapPresenter, Coordinate position) {
"""
Create a new zoom in {@link NavigationAnimation} that zooms in one resolution, to the requested position.
@param mapPresenter The map onto which you want the zoom in animation to run.
@param position The po... | java | public static NavigationAnimation createZoomIn(MapPresenter mapPresenter, Coordinate position) {
View endView = null;
int index = mapPresenter.getViewPort().getResolutionIndex(mapPresenter.getViewPort().getResolution());
if (index < mapPresenter.getViewPort().getResolutionCount() - 1) {
endView = new View(posi... | [
"public",
"static",
"NavigationAnimation",
"createZoomIn",
"(",
"MapPresenter",
"mapPresenter",
",",
"Coordinate",
"position",
")",
"{",
"View",
"endView",
"=",
"null",
";",
"int",
"index",
"=",
"mapPresenter",
".",
"getViewPort",
"(",
")",
".",
"getResolutionInde... | Create a new zoom in {@link NavigationAnimation} that zooms in one resolution, to the requested position.
@param mapPresenter The map onto which you want the zoom in animation to run.
@param position The position to arrive at.
@return The animation. Just call "run" to have it animate the map. | [
"Create",
"a",
"new",
"zoom",
"in",
"{",
"@link",
"NavigationAnimation",
"}",
"that",
"zooms",
"in",
"one",
"resolution",
"to",
"the",
"requested",
"position",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/animation/NavigationAnimationFactory.java#L81-L91 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseShortObj | @Nullable
public static Short parseShortObj (@Nullable final String sStr, @Nullable final Short aDefault) {
"""
Parse the given {@link String} as {@link Short} with radix
{@link #DEFAULT_RADIX}.
@param sStr
The string to parse. May be <code>null</code>.
@param aDefault
The default value to be returned if ... | java | @Nullable
public static Short parseShortObj (@Nullable final String sStr, @Nullable final Short aDefault)
{
return parseShortObj (sStr, DEFAULT_RADIX, aDefault);
} | [
"@",
"Nullable",
"public",
"static",
"Short",
"parseShortObj",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nullable",
"final",
"Short",
"aDefault",
")",
"{",
"return",
"parseShortObj",
"(",
"sStr",
",",
"DEFAULT_RADIX",
",",
"aDefault",
")",
... | Parse the given {@link String} as {@link Short} with radix
{@link #DEFAULT_RADIX}.
@param sStr
The string to parse. May be <code>null</code>.
@param aDefault
The default value to be returned if the passed string could not be
converted to a valid value. May be <code>null</code>.
@return <code>aDefault</code> if the str... | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"{",
"@link",
"Short",
"}",
"with",
"radix",
"{",
"@link",
"#DEFAULT_RADIX",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L1335-L1339 |
alipay/sofa-rpc | extension-impl/registry-zk/src/main/java/com/alipay/sofa/rpc/registry/zk/ZookeeperRegistry.java | ZookeeperRegistry.subscribeOverride | protected void subscribeOverride(final ConsumerConfig config, ConfigListener listener) {
"""
订阅IP级配置(服务发布暂时不支持动态配置,暂时支持订阅ConsumerConfig参数设置)
@param config consumer config
@param listener config listener
"""
try {
if (overrideObserver == null) { // 初始化
overrideObserver ... | java | protected void subscribeOverride(final ConsumerConfig config, ConfigListener listener) {
try {
if (overrideObserver == null) { // 初始化
overrideObserver = new ZookeeperOverrideObserver();
}
overrideObserver.addConfigListener(config, listener);
final ... | [
"protected",
"void",
"subscribeOverride",
"(",
"final",
"ConsumerConfig",
"config",
",",
"ConfigListener",
"listener",
")",
"{",
"try",
"{",
"if",
"(",
"overrideObserver",
"==",
"null",
")",
"{",
"// 初始化",
"overrideObserver",
"=",
"new",
"ZookeeperOverrideObserver",... | 订阅IP级配置(服务发布暂时不支持动态配置,暂时支持订阅ConsumerConfig参数设置)
@param config consumer config
@param listener config listener | [
"订阅IP级配置(服务发布暂时不支持动态配置",
"暂时支持订阅ConsumerConfig参数设置)"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-zk/src/main/java/com/alipay/sofa/rpc/registry/zk/ZookeeperRegistry.java#L453-L490 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ThemeUtil.java | ThemeUtil.getFraction | public static float getFraction(@NonNull final Context context, @AttrRes final int resourceId,
final int base, final int pbase) {
"""
Obtains the fraction, which corresponds to a specific resource id, from a context's theme. If
the given resource id is invalid, a {@link NotFoun... | java | public static float getFraction(@NonNull final Context context, @AttrRes final int resourceId,
final int base, final int pbase) {
return getFraction(context, -1, resourceId, base, pbase);
} | [
"public",
"static",
"float",
"getFraction",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"AttrRes",
"final",
"int",
"resourceId",
",",
"final",
"int",
"base",
",",
"final",
"int",
"pbase",
")",
"{",
"return",
"getFraction",
"(",
"context",
... | Obtains the fraction, which corresponds to a specific resource id, from a context's theme. If
the given resource id is invalid, a {@link NotFoundException} will be thrown.
@param context
The context, which should be used, as an instance of the class {@link Context}. The
context may not be null
@param resourceId
The re... | [
"Obtains",
"the",
"fraction",
"which",
"corresponds",
"to",
"a",
"specific",
"resource",
"id",
"from",
"a",
"context",
"s",
"theme",
".",
"If",
"the",
"given",
"resource",
"id",
"is",
"invalid",
"a",
"{",
"@link",
"NotFoundException",
"}",
"will",
"be",
"t... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L603-L606 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java | ScopedServletUtils.removeScopedSessionAttr | public static void removeScopedSessionAttr( String attrName, HttpServletRequest request ) {
"""
If the request is a ScopedRequest, this removes an attribute whose name is scoped to that request's scope-ID;
otherwise, it is a straight passthrough to {@link HttpSession#removeAttribute}.
@exclude
"""
... | java | public static void removeScopedSessionAttr( String attrName, HttpServletRequest request )
{
HttpSession session = request.getSession( false );
if ( session != null )
{
session.removeAttribute( getScopedSessionAttrName( attrName, request ) );
}
} | [
"public",
"static",
"void",
"removeScopedSessionAttr",
"(",
"String",
"attrName",
",",
"HttpServletRequest",
"request",
")",
"{",
"HttpSession",
"session",
"=",
"request",
".",
"getSession",
"(",
"false",
")",
";",
"if",
"(",
"session",
"!=",
"null",
")",
"{",... | If the request is a ScopedRequest, this removes an attribute whose name is scoped to that request's scope-ID;
otherwise, it is a straight passthrough to {@link HttpSession#removeAttribute}.
@exclude | [
"If",
"the",
"request",
"is",
"a",
"ScopedRequest",
"this",
"removes",
"an",
"attribute",
"whose",
"name",
"is",
"scoped",
"to",
"that",
"request",
"s",
"scope",
"-",
"ID",
";",
"otherwise",
"it",
"is",
"a",
"straight",
"passthrough",
"to",
"{",
"@link",
... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L341-L349 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_easyHunting_serviceName_screenListConditions_conditions_GET | public ArrayList<Long> billingAccount_easyHunting_serviceName_screenListConditions_conditions_GET(String billingAccount, String serviceName, OvhOvhPabxDialplanExtensionConditionScreenListTypeEnum screenListType) throws IOException {
"""
Screen lists conditions checked when a call is received
REST: GET /telephon... | java | public ArrayList<Long> billingAccount_easyHunting_serviceName_screenListConditions_conditions_GET(String billingAccount, String serviceName, OvhOvhPabxDialplanExtensionConditionScreenListTypeEnum screenListType) throws IOException {
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/screenListCondi... | [
"public",
"ArrayList",
"<",
"Long",
">",
"billingAccount_easyHunting_serviceName_screenListConditions_conditions_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhOvhPabxDialplanExtensionConditionScreenListTypeEnum",
"screenListType",
")",
"throws",
"IOE... | Screen lists conditions checked when a call is received
REST: GET /telephony/{billingAccount}/easyHunting/{serviceName}/screenListConditions/conditions
@param screenListType [required] Filter the value of screenListType property (=)
@param billingAccount [required] The name of your billingAccount
@param serviceName [r... | [
"Screen",
"lists",
"conditions",
"checked",
"when",
"a",
"call",
"is",
"received"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3216-L3222 |
Steveice10/OpenNBT | src/main/java/com/github/steveice10/opennbt/NBTIO.java | NBTIO.writeFile | public static void writeFile(CompoundTag tag, String path, boolean compressed, boolean littleEndian) throws IOException {
"""
Writes the given root CompoundTag to the given file.
@param tag Tag to write.
@param path Path to write to.
@param compressed Whether the NBT file should be compress... | java | public static void writeFile(CompoundTag tag, String path, boolean compressed, boolean littleEndian) throws IOException {
writeFile(tag, new File(path), compressed, littleEndian);
} | [
"public",
"static",
"void",
"writeFile",
"(",
"CompoundTag",
"tag",
",",
"String",
"path",
",",
"boolean",
"compressed",
",",
"boolean",
"littleEndian",
")",
"throws",
"IOException",
"{",
"writeFile",
"(",
"tag",
",",
"new",
"File",
"(",
"path",
")",
",",
... | Writes the given root CompoundTag to the given file.
@param tag Tag to write.
@param path Path to write to.
@param compressed Whether the NBT file should be compressed.
@param littleEndian Whether to write little endian NBT.
@throws java.io.IOException If an I/O error occurs. | [
"Writes",
"the",
"given",
"root",
"CompoundTag",
"to",
"the",
"given",
"file",
"."
] | train | https://github.com/Steveice10/OpenNBT/blob/9bf4adb2afd206a21bc4309c85d642494d1fb536/src/main/java/com/github/steveice10/opennbt/NBTIO.java#L117-L119 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsOuTree.java | CmsOuTree.loadAndExpand | private void loadAndExpand(Object itemId, I_CmsOuTreeType type) {
"""
Load and expand given item.<p>
@param itemId to be expanded
@param type of item
"""
if (type.isOrgUnit()) {
addChildrenForOUNode((CmsOrganizationalUnit)itemId);
}
if (type.isGroup()) {
add... | java | private void loadAndExpand(Object itemId, I_CmsOuTreeType type) {
if (type.isOrgUnit()) {
addChildrenForOUNode((CmsOrganizationalUnit)itemId);
}
if (type.isGroup()) {
addChildrenForGroupsNode(type, (String)itemId);
}
if (type.isRole()) {
addCh... | [
"private",
"void",
"loadAndExpand",
"(",
"Object",
"itemId",
",",
"I_CmsOuTreeType",
"type",
")",
"{",
"if",
"(",
"type",
".",
"isOrgUnit",
"(",
")",
")",
"{",
"addChildrenForOUNode",
"(",
"(",
"CmsOrganizationalUnit",
")",
"itemId",
")",
";",
"}",
"if",
"... | Load and expand given item.<p>
@param itemId to be expanded
@param type of item | [
"Load",
"and",
"expand",
"given",
"item",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsOuTree.java#L454-L466 |
aol/cyclops | cyclops-anym/src/main/java/cyclops/monads/transformers/ReaderT.java | ReaderT.mapFn | public <B> ReaderT<W,T,B> mapFn(final Function<? super R, ? extends B> f) {
"""
Map the wrapped Future
<pre>
{@code
FutureT.of(AnyM.fromStream(Arrays.asFuture(10))
.map(t->t=t+1);
//FutureT<AnyMSeq<Stream<Future[11]>>>
}
</pre>
@param f Mapping function for the wrapped Future
@return FutureT that ... | java | public <B> ReaderT<W,T,B> mapFn(final Function<? super R, ? extends B> f) {
return new ReaderT<W,T,B>(
run.map(o -> o.mapFn(f)));
} | [
"public",
"<",
"B",
">",
"ReaderT",
"<",
"W",
",",
"T",
",",
"B",
">",
"mapFn",
"(",
"final",
"Function",
"<",
"?",
"super",
"R",
",",
"?",
"extends",
"B",
">",
"f",
")",
"{",
"return",
"new",
"ReaderT",
"<",
"W",
",",
"T",
",",
"B",
">",
"... | Map the wrapped Future
<pre>
{@code
FutureT.of(AnyM.fromStream(Arrays.asFuture(10))
.map(t->t=t+1);
//FutureT<AnyMSeq<Stream<Future[11]>>>
}
</pre>
@param f Mapping function for the wrapped Future
@return FutureT that applies the transform function to the wrapped Future | [
"Map",
"the",
"wrapped",
"Future"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-anym/src/main/java/cyclops/monads/transformers/ReaderT.java#L95-L98 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/FlexibleLOF.java | FlexibleLOF.doRunInTime | protected LOFResult<O> doRunInTime(DBIDs ids, KNNQuery<O> kNNRefer, KNNQuery<O> kNNReach, StepProgress stepprog) {
"""
Performs the Generalized LOF_SCORE algorithm on the given database and
returns a {@link FlexibleLOF.LOFResult} encapsulating information that may
be needed by an OnlineLOF algorithm.
@param i... | java | protected LOFResult<O> doRunInTime(DBIDs ids, KNNQuery<O> kNNRefer, KNNQuery<O> kNNReach, StepProgress stepprog) {
// Assert we got something
if(kNNRefer == null) {
throw new AbortException("No kNN queries supported by database for reference neighborhood distance function.");
}
if(kNNReach == null... | [
"protected",
"LOFResult",
"<",
"O",
">",
"doRunInTime",
"(",
"DBIDs",
"ids",
",",
"KNNQuery",
"<",
"O",
">",
"kNNRefer",
",",
"KNNQuery",
"<",
"O",
">",
"kNNReach",
",",
"StepProgress",
"stepprog",
")",
"{",
"// Assert we got something",
"if",
"(",
"kNNRefer... | Performs the Generalized LOF_SCORE algorithm on the given database and
returns a {@link FlexibleLOF.LOFResult} encapsulating information that may
be needed by an OnlineLOF algorithm.
@param ids Object ids
@param kNNRefer the kNN query w.r.t. reference neighborhood distance
function
@param kNNReach the kNN query w.r.t.... | [
"Performs",
"the",
"Generalized",
"LOF_SCORE",
"algorithm",
"on",
"the",
"given",
"database",
"and",
"returns",
"a",
"{",
"@link",
"FlexibleLOF",
".",
"LOFResult",
"}",
"encapsulating",
"information",
"that",
"may",
"be",
"needed",
"by",
"an",
"OnlineLOF",
"algo... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/FlexibleLOF.java#L212-L240 |
ujmp/universal-java-matrix-package | ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java | Ginv.addColTimes | public static void addColTimes(double[][] matrix, int diag, int fromRow, int col, double factor) {
"""
Add a factor times one column to another column
@param matrix
the matrix to modify
@param diag
coordinate on the diagonal
@param fromRow
first row to process
@param col
column to process
@param factor
... | java | public static void addColTimes(double[][] matrix, int diag, int fromRow, int col, double factor) {
int rows = matrix.length;
double[] r = null;
for (int row = fromRow; row < rows; row++) {
r = matrix[row];
r[col] -= factor * r[diag];
}
} | [
"public",
"static",
"void",
"addColTimes",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"int",
"diag",
",",
"int",
"fromRow",
",",
"int",
"col",
",",
"double",
"factor",
")",
"{",
"int",
"rows",
"=",
"matrix",
".",
"length",
";",
"double",
"[",
... | Add a factor times one column to another column
@param matrix
the matrix to modify
@param diag
coordinate on the diagonal
@param fromRow
first row to process
@param col
column to process
@param factor
factor to multiply | [
"Add",
"a",
"factor",
"times",
"one",
"column",
"to",
"another",
"column"
] | train | https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java#L562-L569 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitCluster.java | SubunitCluster.mergeSequence | public boolean mergeSequence(SubunitCluster other, SubunitClustererParameters params) throws CompoundNotFoundException {
"""
Merges the other SubunitCluster into this one if their representatives
sequences are similar (according to the criteria in params).
<p>
The sequence alignment is performed using linear {@... | java | public boolean mergeSequence(SubunitCluster other, SubunitClustererParameters params) throws CompoundNotFoundException {
PairwiseSequenceAlignerType alignerType = PairwiseSequenceAlignerType.LOCAL;
if (params.isUseGlobalMetrics()) {
alignerType = PairwiseSequenceAlignerType.GLOBAL;
}
return mergeSequence(oth... | [
"public",
"boolean",
"mergeSequence",
"(",
"SubunitCluster",
"other",
",",
"SubunitClustererParameters",
"params",
")",
"throws",
"CompoundNotFoundException",
"{",
"PairwiseSequenceAlignerType",
"alignerType",
"=",
"PairwiseSequenceAlignerType",
".",
"LOCAL",
";",
"if",
"("... | Merges the other SubunitCluster into this one if their representatives
sequences are similar (according to the criteria in params).
<p>
The sequence alignment is performed using linear {@link SimpleGapPenalty} and
BLOSUM62 as scoring matrix.
@param other
SubunitCluster
@param params
SubunitClustererParameters, with in... | [
"Merges",
"the",
"other",
"SubunitCluster",
"into",
"this",
"one",
"if",
"their",
"representatives",
"sequences",
"are",
"similar",
"(",
"according",
"to",
"the",
"criteria",
"in",
"params",
")",
".",
"<p",
">",
"The",
"sequence",
"alignment",
"is",
"performed... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitCluster.java#L221-L229 |
LearnLib/automatalib | util/src/main/java/net/automatalib/util/partitionrefinement/PaigeTarjanExtractors.java | PaigeTarjanExtractors.toDeterministic | public static <S1, S2, I, T1, T2, SP, TP, A extends MutableDeterministic<S2, I, T2, SP, TP>> A toDeterministic(
PaigeTarjan pt,
AutomatonCreator<A, I> creator,
Alphabet<I> inputs,
DeterministicAutomaton<S1, I, T1> original,
StateIDs<S1> origIds,
Fu... | java | public static <S1, S2, I, T1, T2, SP, TP, A extends MutableDeterministic<S2, I, T2, SP, TP>> A toDeterministic(
PaigeTarjan pt,
AutomatonCreator<A, I> creator,
Alphabet<I> inputs,
DeterministicAutomaton<S1, I, T1> original,
StateIDs<S1> origIds,
Fu... | [
"public",
"static",
"<",
"S1",
",",
"S2",
",",
"I",
",",
"T1",
",",
"T2",
",",
"SP",
",",
"TP",
",",
"A",
"extends",
"MutableDeterministic",
"<",
"S2",
",",
"I",
",",
"T2",
",",
"SP",
",",
"TP",
">",
">",
"A",
"toDeterministic",
"(",
"PaigeTarjan... | Translates the results of a coarsest stable partition computation into a deterministic automaton.
<p>
This method is designed to match the following methods from {@link PaigeTarjanInitializers}: <ul>
<li> {@link PaigeTarjanInitializers#initDeterministic(PaigeTarjan,
net.automatalib.automata.simple.SimpleDeterministicAu... | [
"Translates",
"the",
"results",
"of",
"a",
"coarsest",
"stable",
"partition",
"computation",
"into",
"a",
"deterministic",
"automaton",
".",
"<p",
">",
"This",
"method",
"is",
"designed",
"to",
"match",
"the",
"following",
"methods",
"from",
"{",
"@link",
"Pai... | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/partitionrefinement/PaigeTarjanExtractors.java#L85-L102 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/savedialog/SVGSaveDialog.java | SVGSaveDialog.showError | private static void showError(Component parent, String title, String msg) {
"""
Helper method to show a error message as "popup". Calls
{@link JOptionPane#showMessageDialog(java.awt.Component, Object)}.
@param parent The parent component for the popup.
@param msg The message to be displayed.
"""
JOpti... | java | private static void showError(Component parent, String title, String msg) {
JOptionPane.showMessageDialog(parent, msg, title, JOptionPane.ERROR_MESSAGE);
} | [
"private",
"static",
"void",
"showError",
"(",
"Component",
"parent",
",",
"String",
"title",
",",
"String",
"msg",
")",
"{",
"JOptionPane",
".",
"showMessageDialog",
"(",
"parent",
",",
"msg",
",",
"title",
",",
"JOptionPane",
".",
"ERROR_MESSAGE",
")",
";"... | Helper method to show a error message as "popup". Calls
{@link JOptionPane#showMessageDialog(java.awt.Component, Object)}.
@param parent The parent component for the popup.
@param msg The message to be displayed. | [
"Helper",
"method",
"to",
"show",
"a",
"error",
"message",
"as",
"popup",
".",
"Calls",
"{",
"@link",
"JOptionPane#showMessageDialog",
"(",
"java",
".",
"awt",
".",
"Component",
"Object",
")",
"}",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/savedialog/SVGSaveDialog.java#L220-L222 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.createPolylineOptions | public static PolylineOptions createPolylineOptions(FeatureStyle featureStyle, float density) {
"""
Create new polyline options populated with the feature style
@param featureStyle feature style
@param density display density: {@link android.util.DisplayMetrics#density}
@return polyline options populated... | java | public static PolylineOptions createPolylineOptions(FeatureStyle featureStyle, float density) {
PolylineOptions polylineOptions = new PolylineOptions();
setFeatureStyle(polylineOptions, featureStyle, density);
return polylineOptions;
} | [
"public",
"static",
"PolylineOptions",
"createPolylineOptions",
"(",
"FeatureStyle",
"featureStyle",
",",
"float",
"density",
")",
"{",
"PolylineOptions",
"polylineOptions",
"=",
"new",
"PolylineOptions",
"(",
")",
";",
"setFeatureStyle",
"(",
"polylineOptions",
",",
... | Create new polyline options populated with the feature style
@param featureStyle feature style
@param density display density: {@link android.util.DisplayMetrics#density}
@return polyline options populated with the feature style | [
"Create",
"new",
"polyline",
"options",
"populated",
"with",
"the",
"feature",
"style"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L413-L419 |
resourcepool/ssdp-client | src/main/java/io/resourcepool/ssdp/client/request/SsdpDiscovery.java | SsdpDiscovery.getDatagram | public static DatagramPacket getDatagram(String serviceType) {
"""
Get Datagram from serviceType.
@param serviceType the serviceType
@return the DatagramPacket matching the search request
"""
StringBuilder sb = new StringBuilder("M-SEARCH * HTTP/1.1\r\n");
sb.append("HOST: " + SsdpParams.getSsdpMul... | java | public static DatagramPacket getDatagram(String serviceType) {
StringBuilder sb = new StringBuilder("M-SEARCH * HTTP/1.1\r\n");
sb.append("HOST: " + SsdpParams.getSsdpMulticastAddress().getHostAddress() + ":" + SsdpParams.getSsdpMulticastPort() + "\r\n");
sb.append("MAN: \"ssdp:discover\"\r\n");
sb.appe... | [
"public",
"static",
"DatagramPacket",
"getDatagram",
"(",
"String",
"serviceType",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"\"M-SEARCH * HTTP/1.1\\r\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"HOST: \"",
"+",
"SsdpParams",
".",
"getSsd... | Get Datagram from serviceType.
@param serviceType the serviceType
@return the DatagramPacket matching the search request | [
"Get",
"Datagram",
"from",
"serviceType",
"."
] | train | https://github.com/resourcepool/ssdp-client/blob/5c44131c159189e53dfed712bc10b8b3444776b6/src/main/java/io/resourcepool/ssdp/client/request/SsdpDiscovery.java#L22-L31 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java | AbstractLogger.checkMessageFactory | public static void checkMessageFactory(final ExtendedLogger logger, final MessageFactory messageFactory) {
"""
Checks that the message factory a logger was created with is the same as the given messageFactory. If they are
different log a warning to the {@linkplain StatusLogger}. A null MessageFactory translates t... | java | public static void checkMessageFactory(final ExtendedLogger logger, final MessageFactory messageFactory) {
final String name = logger.getName();
final MessageFactory loggerMessageFactory = logger.getMessageFactory();
if (messageFactory != null && !loggerMessageFactory.equals(messageFactory)) {
... | [
"public",
"static",
"void",
"checkMessageFactory",
"(",
"final",
"ExtendedLogger",
"logger",
",",
"final",
"MessageFactory",
"messageFactory",
")",
"{",
"final",
"String",
"name",
"=",
"logger",
".",
"getName",
"(",
")",
";",
"final",
"MessageFactory",
"loggerMess... | Checks that the message factory a logger was created with is the same as the given messageFactory. If they are
different log a warning to the {@linkplain StatusLogger}. A null MessageFactory translates to the default
MessageFactory {@link #DEFAULT_MESSAGE_FACTORY_CLASS}.
@param logger The logger to check
@param messag... | [
"Checks",
"that",
"the",
"message",
"factory",
"a",
"logger",
"was",
"created",
"with",
"is",
"the",
"same",
"as",
"the",
"given",
"messageFactory",
".",
"If",
"they",
"are",
"different",
"log",
"a",
"warning",
"to",
"the",
"{",
"@linkplain",
"StatusLogger",... | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java#L146-L162 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java | ProxyDataSourceBuilder.logSlowQueryByCommons | public ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit, CommonsLogLevel logLevel, String logName) {
"""
Register {@link CommonsSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@param logLevel log leve... | java | public ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit, CommonsLogLevel logLevel, String logName) {
this.createCommonsSlowQueryListener = true;
this.slowQueryThreshold = thresholdTime;
this.slowQueryTimeUnit = timeUnit;
this.commonsSlowQueryLogLevel = l... | [
"public",
"ProxyDataSourceBuilder",
"logSlowQueryByCommons",
"(",
"long",
"thresholdTime",
",",
"TimeUnit",
"timeUnit",
",",
"CommonsLogLevel",
"logLevel",
",",
"String",
"logName",
")",
"{",
"this",
".",
"createCommonsSlowQueryListener",
"=",
"true",
";",
"this",
"."... | Register {@link CommonsSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@param logLevel log level for commons
@param logName commons logger name
@return builder
@since 1.4.1 | [
"Register",
"{",
"@link",
"CommonsSlowQueryListener",
"}",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java#L273-L280 |
Commonjava/webdav-handler | common/src/main/java/net/sf/webdav/methods/AbstractMethod.java | AbstractMethod.sendReport | protected void sendReport( final WebdavRequest req, final WebdavResponse resp, final Hashtable<String, WebdavStatus> errorList )
throws IOException {
"""
Send a multistatus element containing a complete error report to the
client.
@param req
Servlet request
@param resp
Servlet response
@param error... | java | protected void sendReport( final WebdavRequest req, final WebdavResponse resp, final Hashtable<String, WebdavStatus> errorList )
throws IOException
{
resp.setStatus( WebdavStatus.SC_MULTI_STATUS );
final String absoluteUri = req.getRequestURI();
// String relativePath = getRelative... | [
"protected",
"void",
"sendReport",
"(",
"final",
"WebdavRequest",
"req",
",",
"final",
"WebdavResponse",
"resp",
",",
"final",
"Hashtable",
"<",
"String",
",",
"WebdavStatus",
">",
"errorList",
")",
"throws",
"IOException",
"{",
"resp",
".",
"setStatus",
"(",
... | Send a multistatus element containing a complete error report to the
client.
@param req
Servlet request
@param resp
Servlet response
@param errorList
List of error to be displayed | [
"Send",
"a",
"multistatus",
"element",
"containing",
"a",
"complete",
"error",
"report",
"to",
"the",
"client",
"."
] | train | https://github.com/Commonjava/webdav-handler/blob/39bb7032fc75c1b67d3f2440dd1c234ead96cb9d/common/src/main/java/net/sf/webdav/methods/AbstractMethod.java#L402-L462 |
kiegroup/drools | drools-model/drools-canonical-model/src/main/java/org/drools/model/bitmask/OpenBitSet.java | OpenBitSet.intersectionCount | public static long intersectionCount(OpenBitSet a, OpenBitSet b) {
"""
Returns the popcount or cardinality of the intersection of the two sets.
Neither set is modified.
"""
return BitUtil.pop_intersect( a.bits, b.bits, 0, Math.min( a.wlen, b.wlen ) );
} | java | public static long intersectionCount(OpenBitSet a, OpenBitSet b) {
return BitUtil.pop_intersect( a.bits, b.bits, 0, Math.min( a.wlen, b.wlen ) );
} | [
"public",
"static",
"long",
"intersectionCount",
"(",
"OpenBitSet",
"a",
",",
"OpenBitSet",
"b",
")",
"{",
"return",
"BitUtil",
".",
"pop_intersect",
"(",
"a",
".",
"bits",
",",
"b",
".",
"bits",
",",
"0",
",",
"Math",
".",
"min",
"(",
"a",
".",
"wle... | Returns the popcount or cardinality of the intersection of the two sets.
Neither set is modified. | [
"Returns",
"the",
"popcount",
"or",
"cardinality",
"of",
"the",
"intersection",
"of",
"the",
"two",
"sets",
".",
"Neither",
"set",
"is",
"modified",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-model/drools-canonical-model/src/main/java/org/drools/model/bitmask/OpenBitSet.java#L567-L569 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java | CacheProviderWrapper.getEntry | @Override
public com.ibm.websphere.cache.CacheEntry getEntry(Object id, int source, boolean ignoreCounting, boolean incrementRefCount) {
"""
This returns the cache entry identified by the specified cache id.
It returns null if not in the cache.
@param id The cache id for the entry. The id cannot be null.
... | java | @Override
public com.ibm.websphere.cache.CacheEntry getEntry(Object id, int source, boolean ignoreCounting, boolean incrementRefCount) {
final String methodName = "getEntry()";
com.ibm.websphere.cache.CacheEntry ce = this.coreCache.get(id);
if (tc.isDebugEnabled()) {
Tr.debug(tc,... | [
"@",
"Override",
"public",
"com",
".",
"ibm",
".",
"websphere",
".",
"cache",
".",
"CacheEntry",
"getEntry",
"(",
"Object",
"id",
",",
"int",
"source",
",",
"boolean",
"ignoreCounting",
",",
"boolean",
"incrementRefCount",
")",
"{",
"final",
"String",
"metho... | This returns the cache entry identified by the specified cache id.
It returns null if not in the cache.
@param id The cache id for the entry. The id cannot be null.
@param source The source - local or remote (No effect on CoreCache)
@param ignoreCounting true to ignore the statistics counting (No effect on CoreCache)
... | [
"This",
"returns",
"the",
"cache",
"entry",
"identified",
"by",
"the",
"specified",
"cache",
"id",
".",
"It",
"returns",
"null",
"if",
"not",
"in",
"the",
"cache",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java#L198-L206 |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/spi/MoneyUtils.java | MoneyUtils.getMathContext | public static MathContext getMathContext(MonetaryContext monetaryContext, RoundingMode defaultMode) {
"""
Evaluates the {@link MathContext} from the given {@link MonetaryContext}.
@param monetaryContext the {@link MonetaryContext}
@param defaultMode the default {@link RoundingMode}, to be used if no one is... | java | public static MathContext getMathContext(MonetaryContext monetaryContext, RoundingMode defaultMode) {
MathContext ctx = monetaryContext.get(MathContext.class);
if (ctx!=null) {
return ctx;
}
RoundingMode roundingMode = monetaryContext.get(RoundingMode.class);
if (roun... | [
"public",
"static",
"MathContext",
"getMathContext",
"(",
"MonetaryContext",
"monetaryContext",
",",
"RoundingMode",
"defaultMode",
")",
"{",
"MathContext",
"ctx",
"=",
"monetaryContext",
".",
"get",
"(",
"MathContext",
".",
"class",
")",
";",
"if",
"(",
"ctx",
... | Evaluates the {@link MathContext} from the given {@link MonetaryContext}.
@param monetaryContext the {@link MonetaryContext}
@param defaultMode the default {@link RoundingMode}, to be used if no one is set
in {@link MonetaryContext}.
@return the corresponding {@link MathContext} | [
"Evaluates",
"the",
"{",
"@link",
"MathContext",
"}",
"from",
"the",
"given",
"{",
"@link",
"MonetaryContext",
"}",
"."
] | train | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/spi/MoneyUtils.java#L117-L130 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/imageprocessing/ExampleConvolution.java | ExampleConvolution.normalize2D | private static void normalize2D(GrayU8 gray) {
"""
Convolves a 2D normalized kernel. This kernel is divided by its sum after computation.
"""
// Create a Gaussian kernel with radius of 3
Kernel2D_S32 kernel = FactoryKernelGaussian.gaussian2D(GrayU8.class, -1, 3);
// Note that there is a more efficient w... | java | private static void normalize2D(GrayU8 gray) {
// Create a Gaussian kernel with radius of 3
Kernel2D_S32 kernel = FactoryKernelGaussian.gaussian2D(GrayU8.class, -1, 3);
// Note that there is a more efficient way to compute this convolution since it is a separable kernel
// just use BlurImageOps instead.
// S... | [
"private",
"static",
"void",
"normalize2D",
"(",
"GrayU8",
"gray",
")",
"{",
"// Create a Gaussian kernel with radius of 3",
"Kernel2D_S32",
"kernel",
"=",
"FactoryKernelGaussian",
".",
"gaussian2D",
"(",
"GrayU8",
".",
"class",
",",
"-",
"1",
",",
"3",
")",
";",
... | Convolves a 2D normalized kernel. This kernel is divided by its sum after computation. | [
"Convolves",
"a",
"2D",
"normalized",
"kernel",
".",
"This",
"kernel",
"is",
"divided",
"by",
"its",
"sum",
"after",
"computation",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/imageprocessing/ExampleConvolution.java#L101-L112 |
astrapi69/mystic-crypt | crypt-core/src/main/java/de/alpharogroup/crypto/gm/GoogleMapsUrlSigner.java | GoogleMapsUrlSigner.signRequest | public static String signRequest(final URL url, final String yourGooglePrivateKeyString)
throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException,
URISyntaxException {
"""
Returns the full url as String object with the signature as parameter.
@param url
the url
@param yourGoogleP... | java | public static String signRequest(final URL url, final String yourGooglePrivateKeyString)
throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException,
URISyntaxException
{
// Retrieve the proper URL components to sign
final String resource = url.getPath() + '?' + url.getQuery();
// Ge... | [
"public",
"static",
"String",
"signRequest",
"(",
"final",
"URL",
"url",
",",
"final",
"String",
"yourGooglePrivateKeyString",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
",",
"UnsupportedEncodingException",
",",
"URISyntaxException",
"{",
"// R... | Returns the full url as String object with the signature as parameter.
@param url
the url
@param yourGooglePrivateKeyString
the your google private key string
@return the string
@throws NoSuchAlgorithmException
the no such algorithm exception
@throws InvalidKeyException
the invalid key exception
@throws UnsupportedEnc... | [
"Returns",
"the",
"full",
"url",
"as",
"String",
"object",
"with",
"the",
"signature",
"as",
"parameter",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-core/src/main/java/de/alpharogroup/crypto/gm/GoogleMapsUrlSigner.java#L130-L162 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/StreamUtil.java | StreamUtil.getInputStreamReader | public static Reader getInputStreamReader(InputStream in, String charset) {
"""
Returns a reader for the specified input stream, using specified encoding.
@param in the input stream to wrap
@param charset the input stream to wrap
@return a reader for this input stream
"""
try {
return new InputStr... | java | public static Reader getInputStreamReader(InputStream in, String charset) {
try {
return new InputStreamReader(in, charset);
}
catch (UnsupportedEncodingException ex) {
throw new RuntimeException(ex); // shouldn't happen since UTF-8 is supported by all JVMs per spec
}
} | [
"public",
"static",
"Reader",
"getInputStreamReader",
"(",
"InputStream",
"in",
",",
"String",
"charset",
")",
"{",
"try",
"{",
"return",
"new",
"InputStreamReader",
"(",
"in",
",",
"charset",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"ex",
... | Returns a reader for the specified input stream, using specified encoding.
@param in the input stream to wrap
@param charset the input stream to wrap
@return a reader for this input stream | [
"Returns",
"a",
"reader",
"for",
"the",
"specified",
"input",
"stream",
"using",
"specified",
"encoding",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/StreamUtil.java#L119-L126 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.sunionstore | @Override
public Long sunionstore(final byte[] dstkey, final byte[]... keys) {
"""
This command works exactly like {@link #sunion(byte[]...) SUNION} but instead of being returned
the resulting set is stored as dstkey. Any existing value in dstkey will be over-written.
<p>
Time complexity O(N) where N is the t... | java | @Override
public Long sunionstore(final byte[] dstkey, final byte[]... keys) {
checkIsInMultiOrPipeline();
client.sunionstore(dstkey, keys);
return client.getIntegerReply();
} | [
"@",
"Override",
"public",
"Long",
"sunionstore",
"(",
"final",
"byte",
"[",
"]",
"dstkey",
",",
"final",
"byte",
"[",
"]",
"...",
"keys",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"sunionstore",
"(",
"dstkey",
",",
"keys",
")",... | This command works exactly like {@link #sunion(byte[]...) SUNION} but instead of being returned
the resulting set is stored as dstkey. Any existing value in dstkey will be over-written.
<p>
Time complexity O(N) where N is the total number of elements in all the provided sets
@param dstkey
@param keys
@return Status cod... | [
"This",
"command",
"works",
"exactly",
"like",
"{"
] | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L1570-L1575 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/BorderLayoutRenderer.java | BorderLayoutRenderer.getConstraints | private static BorderLayoutConstraint getConstraints(final WPanel panel, final WComponent child) {
"""
Retrieves the layout constraint for the given component. If the constraint is incorrectly configured, an
{@link IllegalStateException} will be thrown.
@param panel the panel which contains the child
@param c... | java | private static BorderLayoutConstraint getConstraints(final WPanel panel, final WComponent child) {
Object constraints = panel.getLayoutConstraints(child);
if (constraints instanceof BorderLayoutConstraint) {
return (BorderLayoutConstraint) constraints;
} else if (constraints == null) {
return BorderLayout.... | [
"private",
"static",
"BorderLayoutConstraint",
"getConstraints",
"(",
"final",
"WPanel",
"panel",
",",
"final",
"WComponent",
"child",
")",
"{",
"Object",
"constraints",
"=",
"panel",
".",
"getLayoutConstraints",
"(",
"child",
")",
";",
"if",
"(",
"constraints",
... | Retrieves the layout constraint for the given component. If the constraint is incorrectly configured, an
{@link IllegalStateException} will be thrown.
@param panel the panel which contains the child
@param child the component to retrieve the constraint for.
@return the layout constraint for the given component. | [
"Retrieves",
"the",
"layout",
"constraint",
"for",
"the",
"given",
"component",
".",
"If",
"the",
"constraint",
"is",
"incorrectly",
"configured",
"an",
"{",
"@link",
"IllegalStateException",
"}",
"will",
"be",
"thrown",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/BorderLayoutRenderer.java#L131-L141 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java | GeneratedDOAuth2UserDaoImpl.queryByUpdatedBy | public Iterable<DOAuth2User> queryByUpdatedBy(java.lang.String updatedBy) {
"""
query-by method for field updatedBy
@param updatedBy the specified attribute
@return an Iterable of DOAuth2Users for the specified updatedBy
"""
return queryByField(null, DOAuth2UserMapper.Field.UPDATEDBY.getFieldName(), upda... | java | public Iterable<DOAuth2User> queryByUpdatedBy(java.lang.String updatedBy) {
return queryByField(null, DOAuth2UserMapper.Field.UPDATEDBY.getFieldName(), updatedBy);
} | [
"public",
"Iterable",
"<",
"DOAuth2User",
">",
"queryByUpdatedBy",
"(",
"java",
".",
"lang",
".",
"String",
"updatedBy",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DOAuth2UserMapper",
".",
"Field",
".",
"UPDATEDBY",
".",
"getFieldName",
"(",
")",
... | query-by method for field updatedBy
@param updatedBy the specified attribute
@return an Iterable of DOAuth2Users for the specified updatedBy | [
"query",
"-",
"by",
"method",
"for",
"field",
"updatedBy"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java#L142-L144 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/util/ElementUtil.java | ElementUtil.hasNamedAnnotation | public static boolean hasNamedAnnotation(AnnotatedConstruct ac, String name) {
"""
Less strict version of the above where we don't care about the annotation's package.
"""
for (AnnotationMirror annotation : ac.getAnnotationMirrors()) {
if (getName(annotation.getAnnotationType().asElement()).equals(na... | java | public static boolean hasNamedAnnotation(AnnotatedConstruct ac, String name) {
for (AnnotationMirror annotation : ac.getAnnotationMirrors()) {
if (getName(annotation.getAnnotationType().asElement()).equals(name)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"hasNamedAnnotation",
"(",
"AnnotatedConstruct",
"ac",
",",
"String",
"name",
")",
"{",
"for",
"(",
"AnnotationMirror",
"annotation",
":",
"ac",
".",
"getAnnotationMirrors",
"(",
")",
")",
"{",
"if",
"(",
"getName",
"(",
"annotat... | Less strict version of the above where we don't care about the annotation's package. | [
"Less",
"strict",
"version",
"of",
"the",
"above",
"where",
"we",
"don",
"t",
"care",
"about",
"the",
"annotation",
"s",
"package",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/util/ElementUtil.java#L662-L669 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/Document.java | Document.create | public static Document create(@NonNull String id, @NonNull String text) {
"""
Convenience method for creating a document using the default document factory.
@param id the document id
@param text the text content making up the document
@return the document
"""
return DocumentFactory.getInstance().c... | java | public static Document create(@NonNull String id, @NonNull String text) {
return DocumentFactory.getInstance().create(id, text);
} | [
"public",
"static",
"Document",
"create",
"(",
"@",
"NonNull",
"String",
"id",
",",
"@",
"NonNull",
"String",
"text",
")",
"{",
"return",
"DocumentFactory",
".",
"getInstance",
"(",
")",
".",
"create",
"(",
"id",
",",
"text",
")",
";",
"}"
] | Convenience method for creating a document using the default document factory.
@param id the document id
@param text the text content making up the document
@return the document | [
"Convenience",
"method",
"for",
"creating",
"a",
"document",
"using",
"the",
"default",
"document",
"factory",
"."
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/Document.java#L149-L151 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/content/CmsElementChangeLocaleDialog.java | CmsElementChangeLocaleDialog.getTemplateConfigOptions | public List getTemplateConfigOptions() {
"""
returns the selector widget options to build a template selector widget.<p>
@return the selector widget options to build a template selector widget
"""
List result = new ArrayList();
result.add(new CmsSelectWidgetOption("", true, key(Messages.GUI... | java | public List getTemplateConfigOptions() {
List result = new ArrayList();
result.add(new CmsSelectWidgetOption("", true, key(Messages.GUI_CHANGEELEMENTLOCALE_DIALOG_TEMPLATE_ALL_0)));
TreeMap templates = null;
try {
// get all available templates
templates = CmsNe... | [
"public",
"List",
"getTemplateConfigOptions",
"(",
")",
"{",
"List",
"result",
"=",
"new",
"ArrayList",
"(",
")",
";",
"result",
".",
"add",
"(",
"new",
"CmsSelectWidgetOption",
"(",
"\"\"",
",",
"true",
",",
"key",
"(",
"Messages",
".",
"GUI_CHANGEELEMENTLO... | returns the selector widget options to build a template selector widget.<p>
@return the selector widget options to build a template selector widget | [
"returns",
"the",
"selector",
"widget",
"options",
"to",
"build",
"a",
"template",
"selector",
"widget",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/content/CmsElementChangeLocaleDialog.java#L170-L196 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.location_pccZone_stock_pcc_GET | public ArrayList<OvhPccStockProfile> location_pccZone_stock_pcc_GET(String pccZone) throws IOException {
"""
Available PCC stock
REST: GET /dedicatedCloud/location/{pccZone}/stock/pcc
@param pccZone [required] Name of pccZone
"""
String qPath = "/dedicatedCloud/location/{pccZone}/stock/pcc";
StringBuil... | java | public ArrayList<OvhPccStockProfile> location_pccZone_stock_pcc_GET(String pccZone) throws IOException {
String qPath = "/dedicatedCloud/location/{pccZone}/stock/pcc";
StringBuilder sb = path(qPath, pccZone);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t9);
} | [
"public",
"ArrayList",
"<",
"OvhPccStockProfile",
">",
"location_pccZone_stock_pcc_GET",
"(",
"String",
"pccZone",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/location/{pccZone}/stock/pcc\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Available PCC stock
REST: GET /dedicatedCloud/location/{pccZone}/stock/pcc
@param pccZone [required] Name of pccZone | [
"Available",
"PCC",
"stock"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L3053-L3058 |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/platform/DefaultDecoder.java | DefaultDecoder.decodeStaticImageFromStream | protected CloseableReference<Bitmap> decodeStaticImageFromStream(
InputStream inputStream, BitmapFactory.Options options, @Nullable Rect regionToDecode) {
"""
This method is needed because of dependency issues.
@param inputStream the InputStream
@param options the {@link android.graphics.BitmapFactory.Op... | java | protected CloseableReference<Bitmap> decodeStaticImageFromStream(
InputStream inputStream, BitmapFactory.Options options, @Nullable Rect regionToDecode) {
return decodeFromStream(inputStream, options, regionToDecode, null);
} | [
"protected",
"CloseableReference",
"<",
"Bitmap",
">",
"decodeStaticImageFromStream",
"(",
"InputStream",
"inputStream",
",",
"BitmapFactory",
".",
"Options",
"options",
",",
"@",
"Nullable",
"Rect",
"regionToDecode",
")",
"{",
"return",
"decodeFromStream",
"(",
"inpu... | This method is needed because of dependency issues.
@param inputStream the InputStream
@param options the {@link android.graphics.BitmapFactory.Options} used to decode the stream
@param regionToDecode optional image region to decode or null to decode the whole image
@return the bitmap | [
"This",
"method",
"is",
"needed",
"because",
"of",
"dependency",
"issues",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/platform/DefaultDecoder.java#L173-L176 |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/easy/EasyPredictModelWrapper.java | EasyPredictModelWrapper.predictMultinomial | public MultinomialModelPrediction predictMultinomial(RowData data, double offset) throws PredictException {
"""
Make a prediction on a new data point using a Multinomial model.
@param data A new data point.
@param offset Prediction offset
@return The prediction.
@throws PredictException
"""
double[] ... | java | public MultinomialModelPrediction predictMultinomial(RowData data, double offset) throws PredictException {
double[] preds = preamble(ModelCategory.Multinomial, data, offset);
MultinomialModelPrediction p = new MultinomialModelPrediction();
if (enableLeafAssignment) { // only get leaf node assignment if en... | [
"public",
"MultinomialModelPrediction",
"predictMultinomial",
"(",
"RowData",
"data",
",",
"double",
"offset",
")",
"throws",
"PredictException",
"{",
"double",
"[",
"]",
"preds",
"=",
"preamble",
"(",
"ModelCategory",
".",
"Multinomial",
",",
"data",
",",
"offset... | Make a prediction on a new data point using a Multinomial model.
@param data A new data point.
@param offset Prediction offset
@return The prediction.
@throws PredictException | [
"Make",
"a",
"prediction",
"on",
"a",
"new",
"data",
"point",
"using",
"a",
"Multinomial",
"model",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/easy/EasyPredictModelWrapper.java#L603-L623 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEConfigData.java | CmsADEConfigData.getDetailInfos | public List<DetailInfo> getDetailInfos(CmsObject cms) {
"""
Gets the detail information for this sitemap config data object.<p>
@param cms the CMS context
@return the list of detail information
"""
List<DetailInfo> result = Lists.newArrayList();
List<CmsDetailPageInfo> detailPages = getAll... | java | public List<DetailInfo> getDetailInfos(CmsObject cms) {
List<DetailInfo> result = Lists.newArrayList();
List<CmsDetailPageInfo> detailPages = getAllDetailPages(true);
Collections.reverse(detailPages); // make sure primary detail pages come later in the list and override other detail pages for t... | [
"public",
"List",
"<",
"DetailInfo",
">",
"getDetailInfos",
"(",
"CmsObject",
"cms",
")",
"{",
"List",
"<",
"DetailInfo",
">",
"result",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"List",
"<",
"CmsDetailPageInfo",
">",
"detailPages",
"=",
"getAllDetai... | Gets the detail information for this sitemap config data object.<p>
@param cms the CMS context
@return the list of detail information | [
"Gets",
"the",
"detail",
"information",
"for",
"this",
"sitemap",
"config",
"data",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEConfigData.java#L452-L471 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/ControlCreateDurableImpl.java | ControlCreateDurableImpl.getDurableSelectorNamespaceMap | public Map<String,String> getDurableSelectorNamespaceMap() {
"""
Get the map of prefixes to namespace URLs that are associated with the selector.
@return the map of namespace prefixes
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getDurableSelectorNamespaceM... | java | public Map<String,String> getDurableSelectorNamespaceMap() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getDurableSelectorNamespaceMap");
Map<String,String> map = null;
if (jmo.getChoiceField(ControlAccess.BODY_CREATEDURABLE_NAMESPACEMAP) == ControlAccess.IS_BODY... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getDurableSelectorNamespaceMap",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",... | Get the map of prefixes to namespace URLs that are associated with the selector.
@return the map of namespace prefixes | [
"Get",
"the",
"map",
"of",
"prefixes",
"to",
"namespace",
"URLs",
"that",
"are",
"associated",
"with",
"the",
"selector",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/ControlCreateDurableImpl.java#L158-L168 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/resource/Resource.java | Resource.create | public static Resource create(@Nullable String type, Map<String, String> labels) {
"""
Returns a {@link Resource}.
@param type the type identifier for the resource.
@param labels a map of labels that describe the resource.
@return a {@code Resource}.
@throws NullPointerException if {@code labels} is null.
@... | java | public static Resource create(@Nullable String type, Map<String, String> labels) {
return createInternal(
type,
Collections.unmodifiableMap(
new LinkedHashMap<String, String>(Utils.checkNotNull(labels, "labels"))));
} | [
"public",
"static",
"Resource",
"create",
"(",
"@",
"Nullable",
"String",
"type",
",",
"Map",
"<",
"String",
",",
"String",
">",
"labels",
")",
"{",
"return",
"createInternal",
"(",
"type",
",",
"Collections",
".",
"unmodifiableMap",
"(",
"new",
"LinkedHashM... | Returns a {@link Resource}.
@param type the type identifier for the resource.
@param labels a map of labels that describe the resource.
@return a {@code Resource}.
@throws NullPointerException if {@code labels} is null.
@throws IllegalArgumentException if type or label key or label value is not a valid printable
ASCII... | [
"Returns",
"a",
"{",
"@link",
"Resource",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/resource/Resource.java#L104-L109 |
52inc/android-52Kit | library-winds/src/main/java/com/ftinc/kit/winds/Winds.java | Winds.validateVersion | private static boolean validateVersion(Context ctx, ChangeLog clog) {
"""
Validate the last seen stored verion code against the current changelog configuration
to see if there is any updates and whether or not we should show the changelog dialog when
called.
@param ctx
@param clog
@return
"""
/... | java | private static boolean validateVersion(Context ctx, ChangeLog clog){
// Get Preferences
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
int lastSeen = prefs.getInt(PREF_CHANGELOG_LAST_SEEN, -1);
// Second sort versions by it's code
int latest = Int... | [
"private",
"static",
"boolean",
"validateVersion",
"(",
"Context",
"ctx",
",",
"ChangeLog",
"clog",
")",
"{",
"// Get Preferences",
"SharedPreferences",
"prefs",
"=",
"PreferenceManager",
".",
"getDefaultSharedPreferences",
"(",
"ctx",
")",
";",
"int",
"lastSeen",
"... | Validate the last seen stored verion code against the current changelog configuration
to see if there is any updates and whether or not we should show the changelog dialog when
called.
@param ctx
@param clog
@return | [
"Validate",
"the",
"last",
"seen",
"stored",
"verion",
"code",
"against",
"the",
"current",
"changelog",
"configuration",
"to",
"see",
"if",
"there",
"is",
"any",
"updates",
"and",
"whether",
"or",
"not",
"we",
"should",
"show",
"the",
"changelog",
"dialog",
... | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library-winds/src/main/java/com/ftinc/kit/winds/Winds.java#L190-L211 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/LocaleUtility.java | LocaleUtility.isFallbackOf | public static boolean isFallbackOf(String parent, String child) {
"""
Compare two locale strings of the form aa_BB_CC, and
return true if parent is a 'strict' fallback of child, that is,
if child =~ "^parent(_.+)*" (roughly).
"""
if (!child.startsWith(parent)) {
return false;
}
... | java | public static boolean isFallbackOf(String parent, String child) {
if (!child.startsWith(parent)) {
return false;
}
int i = parent.length();
return (i == child.length() ||
child.charAt(i) == '_');
} | [
"public",
"static",
"boolean",
"isFallbackOf",
"(",
"String",
"parent",
",",
"String",
"child",
")",
"{",
"if",
"(",
"!",
"child",
".",
"startsWith",
"(",
"parent",
")",
")",
"{",
"return",
"false",
";",
"}",
"int",
"i",
"=",
"parent",
".",
"length",
... | Compare two locale strings of the form aa_BB_CC, and
return true if parent is a 'strict' fallback of child, that is,
if child =~ "^parent(_.+)*" (roughly). | [
"Compare",
"two",
"locale",
"strings",
"of",
"the",
"form",
"aa_BB_CC",
"and",
"return",
"true",
"if",
"parent",
"is",
"a",
"strict",
"fallback",
"of",
"child",
"that",
"is",
"if",
"child",
"=",
"~",
"^parent",
"(",
"_",
".",
"+",
")",
"*",
"(",
"rou... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/LocaleUtility.java#L55-L62 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbCollections.java | TmdbCollections.getCollectionImages | public ResultList<Artwork> getCollectionImages(int collectionId, String language) throws MovieDbException {
"""
Get all of the images for a particular collection by collection id.
@param collectionId
@param language
@return
@throws MovieDbException
"""
TmdbParameters parameters = new TmdbParamete... | java | public ResultList<Artwork> getCollectionImages(int collectionId, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, collectionId);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBase.COLLECT... | [
"public",
"ResultList",
"<",
"Artwork",
">",
"getCollectionImages",
"(",
"int",
"collectionId",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add"... | Get all of the images for a particular collection by collection id.
@param collectionId
@param language
@return
@throws MovieDbException | [
"Get",
"all",
"of",
"the",
"images",
"for",
"a",
"particular",
"collection",
"by",
"collection",
"id",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbCollections.java#L90-L106 |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/KafkaClient.java | KafkaClient.commitAsync | public boolean commitAsync(String topic, String groupId) {
"""
Commit offsets returned on the last poll for all the subscribed
partitions.
@param topic
@param groupId
@return
@since 1.3.2
"""
KafkaMsgConsumer kafkaConsumer = cacheConsumers.get(groupId);
return kafkaConsumer != null ? kaf... | java | public boolean commitAsync(String topic, String groupId) {
KafkaMsgConsumer kafkaConsumer = cacheConsumers.get(groupId);
return kafkaConsumer != null ? kafkaConsumer.commitAsync(topic) : false;
} | [
"public",
"boolean",
"commitAsync",
"(",
"String",
"topic",
",",
"String",
"groupId",
")",
"{",
"KafkaMsgConsumer",
"kafkaConsumer",
"=",
"cacheConsumers",
".",
"get",
"(",
"groupId",
")",
";",
"return",
"kafkaConsumer",
"!=",
"null",
"?",
"kafkaConsumer",
".",
... | Commit offsets returned on the last poll for all the subscribed
partitions.
@param topic
@param groupId
@return
@since 1.3.2 | [
"Commit",
"offsets",
"returned",
"on",
"the",
"last",
"poll",
"for",
"all",
"the",
"subscribed",
"partitions",
"."
] | train | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/KafkaClient.java#L608-L611 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.