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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.purgeDeletedKeyAsync | public Observable<Void> purgeDeletedKeyAsync(String vaultBaseUrl, String keyName) {
"""
Permanently deletes the specified key.
The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enab... | java | public Observable<Void> purgeDeletedKeyAsync(String vaultBaseUrl, String keyName) {
return purgeDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return res... | [
"public",
"Observable",
"<",
"Void",
">",
"purgeDeletedKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
")",
"{",
"return",
"purgeDeletedKeyWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"keyName",
")",
".",
"map",
"(",
"new",
"Func1",
"<"... | Permanently deletes the specified key.
The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission.
@param vaultBaseUrl The vault n... | [
"Permanently",
"deletes",
"the",
"specified",
"key",
".",
"The",
"Purge",
"Deleted",
"Key",
"operation",
"is",
"applicable",
"for",
"soft",
"-",
"delete",
"enabled",
"vaults",
".",
"While",
"the",
"operation",
"can",
"be",
"invoked",
"on",
"any",
"vault",
"i... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3172-L3179 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java | FeaturesImpl.deletePhraseListAsync | public Observable<OperationStatus> deletePhraseListAsync(UUID appId, String versionId, int phraselistId) {
"""
Deletes a phraselist feature.
@param appId The application ID.
@param versionId The version ID.
@param phraselistId The ID of the feature to be deleted.
@throws IllegalArgumentException thrown if pa... | java | public Observable<OperationStatus> deletePhraseListAsync(UUID appId, String versionId, int phraselistId) {
return deletePhraseListWithServiceResponseAsync(appId, versionId, phraselistId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
public OperationStatus... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deletePhraseListAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"int",
"phraselistId",
")",
"{",
"return",
"deletePhraseListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"phraselist... | Deletes a phraselist feature.
@param appId The application ID.
@param versionId The version ID.
@param phraselistId The ID of the feature to be deleted.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Deletes",
"a",
"phraselist",
"feature",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java#L853-L860 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/CopyCallable.java | CopyCallable.copyPartsInParallel | private void copyPartsInParallel(CopyPartRequestFactory requestFactory) {
"""
Submits a callable for each part to be copied to our thread pool and
records its corresponding Future.
"""
while (requestFactory.hasMoreRequests()) {
if (threadPool.isShutdown())
throw new Cancell... | java | private void copyPartsInParallel(CopyPartRequestFactory requestFactory) {
while (requestFactory.hasMoreRequests()) {
if (threadPool.isShutdown())
throw new CancellationException(
"TransferManager has been shutdown");
CopyPartRequest request = reque... | [
"private",
"void",
"copyPartsInParallel",
"(",
"CopyPartRequestFactory",
"requestFactory",
")",
"{",
"while",
"(",
"requestFactory",
".",
"hasMoreRequests",
"(",
")",
")",
"{",
"if",
"(",
"threadPool",
".",
"isShutdown",
"(",
")",
")",
"throw",
"new",
"Cancellat... | Submits a callable for each part to be copied to our thread pool and
records its corresponding Future. | [
"Submits",
"a",
"callable",
"for",
"each",
"part",
"to",
"be",
"copied",
"to",
"our",
"thread",
"pool",
"and",
"records",
"its",
"corresponding",
"Future",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/CopyCallable.java#L200-L208 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java | RedundentExprEliminator.eleminateSharedPartialPaths | protected void eleminateSharedPartialPaths(ElemTemplateElement psuedoVarRecipient, Vector paths) {
"""
Eliminate the shared partial paths in the expression list.
@param psuedoVarRecipient The recipient of the psuedo vars.
@param paths A vector of paths that hold ExpressionOwner objects,
which must yield Loc... | java | protected void eleminateSharedPartialPaths(ElemTemplateElement psuedoVarRecipient, Vector paths)
{
MultistepExprHolder list = createMultistepExprList(paths);
if(null != list)
{
if(DIAGNOSE_MULTISTEPLIST)
list.diagnose();
boolean isGlobal = (paths == m_absPaths);
... | [
"protected",
"void",
"eleminateSharedPartialPaths",
"(",
"ElemTemplateElement",
"psuedoVarRecipient",
",",
"Vector",
"paths",
")",
"{",
"MultistepExprHolder",
"list",
"=",
"createMultistepExprList",
"(",
"paths",
")",
";",
"if",
"(",
"null",
"!=",
"list",
")",
"{",
... | Eliminate the shared partial paths in the expression list.
@param psuedoVarRecipient The recipient of the psuedo vars.
@param paths A vector of paths that hold ExpressionOwner objects,
which must yield LocationPathIterators. | [
"Eliminate",
"the",
"shared",
"partial",
"paths",
"in",
"the",
"expression",
"list",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java#L152-L177 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/GroupWsRef.java | GroupWsRef.fromName | static GroupWsRef fromName(@Nullable String organizationKey, String name) {
"""
Creates a reference to a group by its organization and name. Virtual groups "Anyone" are
supported.
@param organizationKey key of organization. If {@code null}, then default organization will be used.
@param name non-null name. Ca... | java | static GroupWsRef fromName(@Nullable String organizationKey, String name) {
return new GroupWsRef(NULL_ID, organizationKey, requireNonNull(name));
} | [
"static",
"GroupWsRef",
"fromName",
"(",
"@",
"Nullable",
"String",
"organizationKey",
",",
"String",
"name",
")",
"{",
"return",
"new",
"GroupWsRef",
"(",
"NULL_ID",
",",
"organizationKey",
",",
"requireNonNull",
"(",
"name",
")",
")",
";",
"}"
] | Creates a reference to a group by its organization and name. Virtual groups "Anyone" are
supported.
@param organizationKey key of organization. If {@code null}, then default organization will be used.
@param name non-null name. Can refer to anyone group (case-insensitive {@code "anyone"}). | [
"Creates",
"a",
"reference",
"to",
"a",
"group",
"by",
"its",
"organization",
"and",
"name",
".",
"Virtual",
"groups",
"Anyone",
"are",
"supported",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/GroupWsRef.java#L110-L112 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/service/rest/ValueHolders.java | ValueHolders.get | @Override
@Path("/ {
"""
Retrieve value holder IDs for specific names/values (optionally restricted by OwnerType).
"""valueName}/{value}")
public JSONObject get(String path, Map<String, String> headers)
throws ServiceException, JSONException {
Map<String, String> parameters = getPar... | java | @Override
@Path("/{valueName}/{value}")
public JSONObject get(String path, Map<String, String> headers)
throws ServiceException, JSONException {
Map<String, String> parameters = getParameters(headers);
String valueName = getSegment(path, 1);
if (valueName == null)
... | [
"@",
"Override",
"@",
"Path",
"(",
"\"/{valueName}/{value}\"",
")",
"public",
"JSONObject",
"get",
"(",
"String",
"path",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"throws",
"ServiceException",
",",
"JSONException",
"{",
"Map",
"<",
"Str... | Retrieve value holder IDs for specific names/values (optionally restricted by OwnerType). | [
"Retrieve",
"value",
"holder",
"IDs",
"for",
"specific",
"names",
"/",
"values",
"(",
"optionally",
"restricted",
"by",
"OwnerType",
")",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/service/rest/ValueHolders.java#L42-L62 |
kejunxia/AndroidMvc | library/poke/src/main/java/com/shipdream/lib/poke/util/CommonUtils.java | CommonUtils.areObjectsEqual | public static boolean areObjectsEqual(Object obj1, Object obj2) {
"""
Check if the two of the given objects are equal with their {@link Object#equals(Object)}
methods. It's safe to pass NULL as the objects, and when they are both NULL they will be
considered equal.
@param obj1
@param obj2
@return
"""
... | java | public static boolean areObjectsEqual(Object obj1, Object obj2) {
boolean equal = false;
if(obj1 == null && obj2 == null) {
equal = true;
} else {
if(obj1 != null) {
if(obj1.equals(obj2)) {
equal = true;
}
}
... | [
"public",
"static",
"boolean",
"areObjectsEqual",
"(",
"Object",
"obj1",
",",
"Object",
"obj2",
")",
"{",
"boolean",
"equal",
"=",
"false",
";",
"if",
"(",
"obj1",
"==",
"null",
"&&",
"obj2",
"==",
"null",
")",
"{",
"equal",
"=",
"true",
";",
"}",
"e... | Check if the two of the given objects are equal with their {@link Object#equals(Object)}
methods. It's safe to pass NULL as the objects, and when they are both NULL they will be
considered equal.
@param obj1
@param obj2
@return | [
"Check",
"if",
"the",
"two",
"of",
"the",
"given",
"objects",
"are",
"equal",
"with",
"their",
"{"
] | train | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/poke/src/main/java/com/shipdream/lib/poke/util/CommonUtils.java#L28-L40 |
samskivert/samskivert | src/main/java/com/samskivert/velocity/FormTool.java | FormTool.getValue | protected String getValue (String name, Object defaultValue) {
"""
Fetches the requested value from the servlet request and entifies
it appropriately.
"""
String value = getParameter(name);
if (StringUtil.isBlank(value)) {
if (defaultValue == null) {
value = "";
... | java | protected String getValue (String name, Object defaultValue)
{
String value = getParameter(name);
if (StringUtil.isBlank(value)) {
if (defaultValue == null) {
value = "";
} else {
value = String.valueOf(defaultValue);
}
}
... | [
"protected",
"String",
"getValue",
"(",
"String",
"name",
",",
"Object",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getParameter",
"(",
"name",
")",
";",
"if",
"(",
"StringUtil",
".",
"isBlank",
"(",
"value",
")",
")",
"{",
"if",
"(",
"defaultVal... | Fetches the requested value from the servlet request and entifies
it appropriately. | [
"Fetches",
"the",
"requested",
"value",
"from",
"the",
"servlet",
"request",
"and",
"entifies",
"it",
"appropriately",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L400-L411 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/BooleanUtils.java | BooleanUtils.toBooleanObject | public static Boolean toBooleanObject(final int value, final int trueValue, final int falseValue, final int nullValue) {
"""
<p>Converts an int to a Boolean specifying the conversion values.</p>
<p>NOTE: This returns null and will throw a NullPointerException if unboxed to a boolean. </p>
<pre>
BooleanUtils... | java | public static Boolean toBooleanObject(final int value, final int trueValue, final int falseValue, final int nullValue) {
if (value == trueValue) {
return Boolean.TRUE;
}
if (value == falseValue) {
return Boolean.FALSE;
}
if (value == nullValue) {
... | [
"public",
"static",
"Boolean",
"toBooleanObject",
"(",
"final",
"int",
"value",
",",
"final",
"int",
"trueValue",
",",
"final",
"int",
"falseValue",
",",
"final",
"int",
"nullValue",
")",
"{",
"if",
"(",
"value",
"==",
"trueValue",
")",
"{",
"return",
"Boo... | <p>Converts an int to a Boolean specifying the conversion values.</p>
<p>NOTE: This returns null and will throw a NullPointerException if unboxed to a boolean. </p>
<pre>
BooleanUtils.toBooleanObject(0, 0, 2, 3) = Boolean.TRUE
BooleanUtils.toBooleanObject(2, 1, 2, 3) = Boolean.FALSE
BooleanUtils.toBooleanObject(3, 1,... | [
"<p",
">",
"Converts",
"an",
"int",
"to",
"a",
"Boolean",
"specifying",
"the",
"conversion",
"values",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/BooleanUtils.java#L323-L335 |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.doRaid | void doRaid(Configuration conf, PolicyInfo info, List<EncodingCandidate> paths)
throws IOException {
"""
RAID a list of files / directories
@throws InterruptedException
"""
int targetRepl = Integer.parseInt(info.getProperty("targetReplication"));
int metaRepl = Integer.parseInt(info.getProperty(... | java | void doRaid(Configuration conf, PolicyInfo info, List<EncodingCandidate> paths)
throws IOException {
int targetRepl = Integer.parseInt(info.getProperty("targetReplication"));
int metaRepl = Integer.parseInt(info.getProperty("metaReplication"));
Codec codec = Codec.getCodec(info.getCodecId());
Path... | [
"void",
"doRaid",
"(",
"Configuration",
"conf",
",",
"PolicyInfo",
"info",
",",
"List",
"<",
"EncodingCandidate",
">",
"paths",
")",
"throws",
"IOException",
"{",
"int",
"targetRepl",
"=",
"Integer",
".",
"parseInt",
"(",
"info",
".",
"getProperty",
"(",
"\"... | RAID a list of files / directories
@throws InterruptedException | [
"RAID",
"a",
"list",
"of",
"files",
"/",
"directories"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L1349-L1372 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/EnforceTrifocalGeometry.java | EnforceTrifocalGeometry.constructE | protected void constructE( Point3D_F64 e2 , Point3D_F64 e3 ) {
"""
The matrix E is a linear system for computing the trifocal tensor. The columns
are the unknown square matrices from view 2 and 3. The right most column in
both projection matrices are the provided epipoles, whose values are inserted into E
... | java | protected void constructE( Point3D_F64 e2 , Point3D_F64 e3 ) {
E.zero();
for( int i = 0; i < 3; i++ ) {
for( int j = 0; j < 3; j++ ) {
for( int k = 0; k < 3; k++ ) {
// which element in the trifocal tensor is being manipulated
int row = 9*i + 3*j + k;
// which unknowns are being multiplied by... | [
"protected",
"void",
"constructE",
"(",
"Point3D_F64",
"e2",
",",
"Point3D_F64",
"e3",
")",
"{",
"E",
".",
"zero",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0"... | The matrix E is a linear system for computing the trifocal tensor. The columns
are the unknown square matrices from view 2 and 3. The right most column in
both projection matrices are the provided epipoles, whose values are inserted into E | [
"The",
"matrix",
"E",
"is",
"a",
"linear",
"system",
"for",
"computing",
"the",
"trifocal",
"tensor",
".",
"The",
"columns",
"are",
"the",
"unknown",
"square",
"matrices",
"from",
"view",
"2",
"and",
"3",
".",
"The",
"right",
"most",
"column",
"in",
"bot... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/EnforceTrifocalGeometry.java#L140-L157 |
jboss-integration/fuse-bxms-integ | quickstarts/switchyard-demo-helpdesk/src/main/java/org/switchyard/quickstarts/demos/helpdesk/Transformers.java | Transformers.getElementValue | private String getElementValue(Element parent, String elementName) {
"""
Gets the element value.
@param parent the parent
@param elementName the element name
@return the element value
"""
String value = null;
NodeList nodes = parent.getElementsByTagName(elementName);
if (nodes.getL... | java | private String getElementValue(Element parent, String elementName) {
String value = null;
NodeList nodes = parent.getElementsByTagName(elementName);
if (nodes.getLength() > 0) {
value = nodes.item(0).getChildNodes().item(0).getNodeValue();
}
return value;
} | [
"private",
"String",
"getElementValue",
"(",
"Element",
"parent",
",",
"String",
"elementName",
")",
"{",
"String",
"value",
"=",
"null",
";",
"NodeList",
"nodes",
"=",
"parent",
".",
"getElementsByTagName",
"(",
"elementName",
")",
";",
"if",
"(",
"nodes",
... | Gets the element value.
@param parent the parent
@param elementName the element name
@return the element value | [
"Gets",
"the",
"element",
"value",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/quickstarts/switchyard-demo-helpdesk/src/main/java/org/switchyard/quickstarts/demos/helpdesk/Transformers.java#L89-L96 |
alkacon/opencms-core | src/org/opencms/gwt/CmsIconUtil.java | CmsIconUtil.getResourceSubTypeIconClass | static String getResourceSubTypeIconClass(String resourceTypeName, String suffix, boolean small) {
"""
Returns the CSS class for a given resource type name and file name extension.<p>
@param resourceTypeName the resource type name
@param suffix the file name extension
@param small if true, get the icon class ... | java | static String getResourceSubTypeIconClass(String resourceTypeName, String suffix, boolean small) {
StringBuffer buffer = new StringBuffer(CmsGwtConstants.TYPE_ICON_CLASS).append("_").append(
resourceTypeName.hashCode()).append("_").append(suffix);
if (small) {
buffer.append(SMAL... | [
"static",
"String",
"getResourceSubTypeIconClass",
"(",
"String",
"resourceTypeName",
",",
"String",
"suffix",
",",
"boolean",
"small",
")",
"{",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
"CmsGwtConstants",
".",
"TYPE_ICON_CLASS",
")",
".",
"append"... | Returns the CSS class for a given resource type name and file name extension.<p>
@param resourceTypeName the resource type name
@param suffix the file name extension
@param small if true, get the icon class for the small icon, else for the biggest one available
@return the CSS class for the type and extension | [
"Returns",
"the",
"CSS",
"class",
"for",
"a",
"given",
"resource",
"type",
"name",
"and",
"file",
"name",
"extension",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsIconUtil.java#L433-L441 |
Mangopay/mangopay2-java-sdk | src/main/java/com/mangopay/core/UrlTool.java | UrlTool.getRestUrl | public String getRestUrl(String urlKey, Boolean addClientId, Pagination pagination, Map<String, String> additionalUrlParams) throws UnsupportedEncodingException {
"""
Gets REST url.
@param urlKey Url key.
@param addClientId Denotes whether client identifier should be composed into final ur... | java | public String getRestUrl(String urlKey, Boolean addClientId, Pagination pagination, Map<String, String> additionalUrlParams) throws UnsupportedEncodingException {
String url;
if (!addClientId) {
url = "/v2.01" + urlKey;
} else {
url = "/v2.01/" + root.getConfig().getCli... | [
"public",
"String",
"getRestUrl",
"(",
"String",
"urlKey",
",",
"Boolean",
"addClientId",
",",
"Pagination",
"pagination",
",",
"Map",
"<",
"String",
",",
"String",
">",
"additionalUrlParams",
")",
"throws",
"UnsupportedEncodingException",
"{",
"String",
"url",
";... | Gets REST url.
@param urlKey Url key.
@param addClientId Denotes whether client identifier should be composed into final url.
@param pagination Pagination object.
@param additionalUrlParams Additional parameters.
@return Final REST url.
@throws UnsupportedEncodingException | [
"Gets",
"REST",
"url",
"."
] | train | https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/UrlTool.java#L85-L110 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UResourceBundle.java | UResourceBundle.getBundleInstance | public static UResourceBundle getBundleInstance(String baseName, String localeName,
ClassLoader root) {
"""
<strong>[icu]</strong> Creates a resource bundle using the specified base name, locale, and class root.
@param baseName string containing the name of th... | java | public static UResourceBundle getBundleInstance(String baseName, String localeName,
ClassLoader root){
return getBundleInstance(baseName, localeName, root, false);
} | [
"public",
"static",
"UResourceBundle",
"getBundleInstance",
"(",
"String",
"baseName",
",",
"String",
"localeName",
",",
"ClassLoader",
"root",
")",
"{",
"return",
"getBundleInstance",
"(",
"baseName",
",",
"localeName",
",",
"root",
",",
"false",
")",
";",
"}"
... | <strong>[icu]</strong> Creates a resource bundle using the specified base name, locale, and class root.
@param baseName string containing the name of the data package.
If null the default ICU package name is used.
@param localeName the locale for which a resource bundle is desired
@param root the class object from whi... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Creates",
"a",
"resource",
"bundle",
"using",
"the",
"specified",
"base",
"name",
"locale",
"and",
"class",
"root",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UResourceBundle.java#L125-L128 |
alkacon/opencms-core | src/org/opencms/util/CmsDefaultSet.java | CmsDefaultSet.setContains | public void setContains(T value, boolean isMember) {
"""
*
Sets the membership of an object.<p>
@param value the object
@param isMember true if the object should be a member, otherwise false
"""
checkNotFrozen();
m_membershipMap.put(value, new Boolean(isMember));
} | java | public void setContains(T value, boolean isMember) {
checkNotFrozen();
m_membershipMap.put(value, new Boolean(isMember));
} | [
"public",
"void",
"setContains",
"(",
"T",
"value",
",",
"boolean",
"isMember",
")",
"{",
"checkNotFrozen",
"(",
")",
";",
"m_membershipMap",
".",
"put",
"(",
"value",
",",
"new",
"Boolean",
"(",
"isMember",
")",
")",
";",
"}"
] | *
Sets the membership of an object.<p>
@param value the object
@param isMember true if the object should be a member, otherwise false | [
"*",
"Sets",
"the",
"membership",
"of",
"an",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsDefaultSet.java#L114-L118 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/CorruptReplicasMap.java | CorruptReplicasMap.addToCorruptReplicasMap | public boolean addToCorruptReplicasMap(Block blk, DatanodeDescriptor dn) {
"""
Mark the block belonging to datanode as corrupt.
@param blk Block to be added to CorruptReplicasMap
@param dn DatanodeDescriptor which holds the corrupt replica
@return if the block gets added or not
"""
Collection<Datanode... | java | public boolean addToCorruptReplicasMap(Block blk, DatanodeDescriptor dn) {
Collection<DatanodeDescriptor> nodes = getNodes(blk);
if (nodes == null) {
nodes = new TreeSet<DatanodeDescriptor>();
corruptReplicasMap.put(blk, nodes);
}
boolean added = false;
if (!nodes.contains(dn)) {
a... | [
"public",
"boolean",
"addToCorruptReplicasMap",
"(",
"Block",
"blk",
",",
"DatanodeDescriptor",
"dn",
")",
"{",
"Collection",
"<",
"DatanodeDescriptor",
">",
"nodes",
"=",
"getNodes",
"(",
"blk",
")",
";",
"if",
"(",
"nodes",
"==",
"null",
")",
"{",
"nodes",... | Mark the block belonging to datanode as corrupt.
@param blk Block to be added to CorruptReplicasMap
@param dn DatanodeDescriptor which holds the corrupt replica
@return if the block gets added or not | [
"Mark",
"the",
"block",
"belonging",
"to",
"datanode",
"as",
"corrupt",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/CorruptReplicasMap.java#L46-L67 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java | CopyOnWriteArrayList.listIterator | public ListIterator<E> listIterator(int index) {
"""
Returns a {@link ListIterator} that iterates over the elements of this
list as they were at the time of this method call. Changes to the list
made after this method call will not be reflected by the iterator, nor
will they trigger a {@link ConcurrentModificat... | java | public ListIterator<E> listIterator(int index) {
Object[] snapshot = elements;
if (index < 0 || index > snapshot.length) {
throw new IndexOutOfBoundsException("index=" + index + ", length=" + snapshot.length);
}
CowIterator<E> result = new CowIterator<E>(snapshot, 0, snapshot... | [
"public",
"ListIterator",
"<",
"E",
">",
"listIterator",
"(",
"int",
"index",
")",
"{",
"Object",
"[",
"]",
"snapshot",
"=",
"elements",
";",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">",
"snapshot",
".",
"length",
")",
"{",
"throw",
"new",
"Inde... | Returns a {@link ListIterator} that iterates over the elements of this
list as they were at the time of this method call. Changes to the list
made after this method call will not be reflected by the iterator, nor
will they trigger a {@link ConcurrentModificationException}.
<p>The returned iterator does not support {@l... | [
"Returns",
"a",
"{",
"@link",
"ListIterator",
"}",
"that",
"iterates",
"over",
"the",
"elements",
"of",
"this",
"list",
"as",
"they",
"were",
"at",
"the",
"time",
"of",
"this",
"method",
"call",
".",
"Changes",
"to",
"the",
"list",
"made",
"after",
"this... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java#L218-L226 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/userdata/UserDataHelpers.java | UserDataHelpers.processUserData | public static Properties processUserData( Properties properties, File outputDirectory ) throws IOException {
"""
Processes user data that were already read.
<p>
This method handles the {@link #ENCODE_FILE_CONTENT_PREFIX} prefix.
File contents are written on the disk and references are updated if necessary.
</p... | java | public static Properties processUserData( Properties properties, File outputDirectory ) throws IOException {
interceptWritingFiles( properties, outputDirectory );
return properties;
} | [
"public",
"static",
"Properties",
"processUserData",
"(",
"Properties",
"properties",
",",
"File",
"outputDirectory",
")",
"throws",
"IOException",
"{",
"interceptWritingFiles",
"(",
"properties",
",",
"outputDirectory",
")",
";",
"return",
"properties",
";",
"}"
] | Processes user data that were already read.
<p>
This method handles the {@link #ENCODE_FILE_CONTENT_PREFIX} prefix.
File contents are written on the disk and references are updated if necessary.
</p>
@param properties the user data as properties
@param outputDirectory a directory into which files should be written
<p>... | [
"Processes",
"user",
"data",
"that",
"were",
"already",
"read",
".",
"<p",
">",
"This",
"method",
"handles",
"the",
"{",
"@link",
"#ENCODE_FILE_CONTENT_PREFIX",
"}",
"prefix",
".",
"File",
"contents",
"are",
"written",
"on",
"the",
"disk",
"and",
"references",... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/userdata/UserDataHelpers.java#L192-L196 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/snmp_trap.java | snmp_trap.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>
"""
snmp_trap_responses result = (snmp_trap_responses) service.get_payload_... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
snmp_trap_responses result = (snmp_trap_responses) service.get_payload_formatter().string_to_resource(snmp_trap_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESS... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"snmp_trap_responses",
"result",
"=",
"(",
"snmp_trap_responses",
")",
"service",
".",
"get_payload_formatter"... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/snmp_trap.java#L347-L364 |
mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java | LBFGS_port.CUBIC_MINIMIZER2 | private static double CUBIC_MINIMIZER2(double cm, double u, double fu, double du, double v, double fv, double dv, double xmin, double xmax) {
"""
Find a minimizer of an interpolated cubic function.
@param cm The minimizer of the interpolated cubic.
@param u The value of one point, u.
@param fu ... | java | private static double CUBIC_MINIMIZER2(double cm, double u, double fu, double du, double v, double fv, double dv, double xmin, double xmax) {
double a, d, gamma, theta, p, q, r, s;
d = (v) - (u);
theta = ((fu) - (fv)) * 3 / d + (du) + (dv);
p = Math.abs(theta);
q = Math.abs(du);
... | [
"private",
"static",
"double",
"CUBIC_MINIMIZER2",
"(",
"double",
"cm",
",",
"double",
"u",
",",
"double",
"fu",
",",
"double",
"du",
",",
"double",
"v",
",",
"double",
"fv",
",",
"double",
"dv",
",",
"double",
"xmin",
",",
"double",
"xmax",
")",
"{",
... | Find a minimizer of an interpolated cubic function.
@param cm The minimizer of the interpolated cubic.
@param u The value of one point, u.
@param fu The value of f(u).
@param du The value of f'(u).
@param v The value of another point, v.
@param fv The value of f(v).
@param du ... | [
"Find",
"a",
"minimizer",
"of",
"an",
"interpolated",
"cubic",
"function",
"."
] | train | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java#L1817-L1840 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/variational/VariationalAutoencoder.java | VariationalAutoencoder.reconstructionProbability | public INDArray reconstructionProbability(INDArray data, int numSamples) {
"""
Calculate the reconstruction probability, as described in An & Cho, 2015 - "Variational Autoencoder based
Anomaly Detection using Reconstruction Probability" (Algorithm 4)<br>
The authors describe it as follows: "This is essentially t... | java | public INDArray reconstructionProbability(INDArray data, int numSamples) {
INDArray reconstructionLogProb = reconstructionLogProbability(data, numSamples);
return Transforms.exp(reconstructionLogProb.castTo(DataType.DOUBLE), false); //Cast to double to reduce risk of numerical underflow
} | [
"public",
"INDArray",
"reconstructionProbability",
"(",
"INDArray",
"data",
",",
"int",
"numSamples",
")",
"{",
"INDArray",
"reconstructionLogProb",
"=",
"reconstructionLogProbability",
"(",
"data",
",",
"numSamples",
")",
";",
"return",
"Transforms",
".",
"exp",
"(... | Calculate the reconstruction probability, as described in An & Cho, 2015 - "Variational Autoencoder based
Anomaly Detection using Reconstruction Probability" (Algorithm 4)<br>
The authors describe it as follows: "This is essentially the probability of the data being generated from a given
latent variable drawn from the... | [
"Calculate",
"the",
"reconstruction",
"probability",
"as",
"described",
"in",
"An",
"&",
"Cho",
"2015",
"-",
"Variational",
"Autoencoder",
"based",
"Anomaly",
"Detection",
"using",
"Reconstruction",
"Probability",
"(",
"Algorithm",
"4",
")",
"<br",
">",
"The",
"... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/variational/VariationalAutoencoder.java#L943-L946 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/DigestUtils.java | DigestUtils.shaBase64 | public static String shaBase64(final String salt, final String data, final String separator, final boolean chunked) {
"""
Sha base 64 string.
@param salt the salt
@param data the data
@param separator a string separator, if any
@param chunked the chunked
@return the string
"""
val re... | java | public static String shaBase64(final String salt, final String data, final String separator, final boolean chunked) {
val result = rawDigest(MessageDigestAlgorithms.SHA_1, salt, separator == null ? data : data + separator);
return EncodingUtils.encodeBase64(result, chunked);
} | [
"public",
"static",
"String",
"shaBase64",
"(",
"final",
"String",
"salt",
",",
"final",
"String",
"data",
",",
"final",
"String",
"separator",
",",
"final",
"boolean",
"chunked",
")",
"{",
"val",
"result",
"=",
"rawDigest",
"(",
"MessageDigestAlgorithms",
"."... | Sha base 64 string.
@param salt the salt
@param data the data
@param separator a string separator, if any
@param chunked the chunked
@return the string | [
"Sha",
"base",
"64",
"string",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/DigestUtils.java#L84-L87 |
carewebframework/carewebframework-vista | org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Version.java | Version.appendVersion | private void appendVersion(StringBuilder sb, long ver) {
"""
Append version component.
@param sb String builder.
@param ver Version component value.
"""
if (sb.length() > 0) {
sb.append(".");
}
sb.append(ver);
} | java | private void appendVersion(StringBuilder sb, long ver) {
if (sb.length() > 0) {
sb.append(".");
}
sb.append(ver);
} | [
"private",
"void",
"appendVersion",
"(",
"StringBuilder",
"sb",
",",
"long",
"ver",
")",
"{",
"if",
"(",
"sb",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"sb",
".",
"append",
"(",
"\".\"",
")",
";",
"}",
"sb",
".",
"append",
"(",
"ver",
")",
... | Append version component.
@param sb String builder.
@param ver Version component value. | [
"Append",
"version",
"component",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Version.java#L109-L115 |
diffplug/durian | src/com/diffplug/common/base/FieldsAndGetters.java | FieldsAndGetters.dumpAll | public static void dumpAll(String name, Object obj) {
"""
Dumps all fields and getters of {@code obj} to {@code System.out}.
@see #dumpIf
"""
dumpAll(name, obj, StringPrinter.systemOut());
} | java | public static void dumpAll(String name, Object obj) {
dumpAll(name, obj, StringPrinter.systemOut());
} | [
"public",
"static",
"void",
"dumpAll",
"(",
"String",
"name",
",",
"Object",
"obj",
")",
"{",
"dumpAll",
"(",
"name",
",",
"obj",
",",
"StringPrinter",
".",
"systemOut",
"(",
")",
")",
";",
"}"
] | Dumps all fields and getters of {@code obj} to {@code System.out}.
@see #dumpIf | [
"Dumps",
"all",
"fields",
"and",
"getters",
"of",
"{"
] | train | https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/FieldsAndGetters.java#L169-L171 |
belaban/JGroups | src/org/jgroups/util/Bits.java | Bits.readLongSequence | public static void readLongSequence(DataInput in, long[] seqnos, int index) throws IOException {
"""
Reads 2 compressed longs into an array of 2 longs.
<p/>
Once variable-length encoding has been implemented, this method will probably get dropped as we can simply
read the 2 longs individually.
@param in the in... | java | public static void readLongSequence(DataInput in, long[] seqnos, int index) throws IOException {
byte len=in.readByte();
if(len == 0) {
seqnos[index]=seqnos[index+1]=0;
return;
}
byte len1=firstNibble(len), len2=secondNibble(len);
seqnos[index]=makeLong(in... | [
"public",
"static",
"void",
"readLongSequence",
"(",
"DataInput",
"in",
",",
"long",
"[",
"]",
"seqnos",
",",
"int",
"index",
")",
"throws",
"IOException",
"{",
"byte",
"len",
"=",
"in",
".",
"readByte",
"(",
")",
";",
"if",
"(",
"len",
"==",
"0",
")... | Reads 2 compressed longs into an array of 2 longs.
<p/>
Once variable-length encoding has been implemented, this method will probably get dropped as we can simply
read the 2 longs individually.
@param in the input stream to read from
@param seqnos the array to read the seqnos into, needs to have a length of 2
@param in... | [
"Reads",
"2",
"compressed",
"longs",
"into",
"an",
"array",
"of",
"2",
"longs",
".",
"<p",
"/",
">",
"Once",
"variable",
"-",
"length",
"encoding",
"has",
"been",
"implemented",
"this",
"method",
"will",
"probably",
"get",
"dropped",
"as",
"we",
"can",
"... | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Bits.java#L397-L406 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java | UpgradableLock.tryLockForUpgrade | public final boolean tryLockForUpgrade(L locker, long timeout, TimeUnit unit)
throws InterruptedException {
"""
Attempt to acquire an upgrade lock, waiting a maximum amount of time.
@param locker object trying to become lock owner
@return true if acquired
"""
return tryLockForUpgrade_(loc... | java | public final boolean tryLockForUpgrade(L locker, long timeout, TimeUnit unit)
throws InterruptedException
{
return tryLockForUpgrade_(locker, timeout, unit) != Result.FAILED;
} | [
"public",
"final",
"boolean",
"tryLockForUpgrade",
"(",
"L",
"locker",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"return",
"tryLockForUpgrade_",
"(",
"locker",
",",
"timeout",
",",
"unit",
")",
"!=",
"Result",
... | Attempt to acquire an upgrade lock, waiting a maximum amount of time.
@param locker object trying to become lock owner
@return true if acquired | [
"Attempt",
"to",
"acquire",
"an",
"upgrade",
"lock",
"waiting",
"a",
"maximum",
"amount",
"of",
"time",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java#L325-L329 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java | JBossASClient.getStringAttribute | public String getStringAttribute(String attributeName, Address address) throws Exception {
"""
Convienence method that allows you to obtain a single attribute's string value from
a resource.
@param attributeName the attribute whose value is to be returned
@param address identifies the resource
@return the at... | java | public String getStringAttribute(String attributeName, Address address) throws Exception {
return getStringAttribute(false, attributeName, address);
} | [
"public",
"String",
"getStringAttribute",
"(",
"String",
"attributeName",
",",
"Address",
"address",
")",
"throws",
"Exception",
"{",
"return",
"getStringAttribute",
"(",
"false",
",",
"attributeName",
",",
"address",
")",
";",
"}"
] | Convienence method that allows you to obtain a single attribute's string value from
a resource.
@param attributeName the attribute whose value is to be returned
@param address identifies the resource
@return the attribute value
@throws Exception if failed to obtain the attribute value | [
"Convienence",
"method",
"that",
"allows",
"you",
"to",
"obtain",
"a",
"single",
"attribute",
"s",
"string",
"value",
"from",
"a",
"resource",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java#L382-L384 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscCompilationJobStreamsInner.java | DscCompilationJobStreamsInner.listByJobAsync | public Observable<JobStreamListResultInner> listByJobAsync(String resourceGroupName, String automationAccountName, UUID jobId) {
"""
Retrieve all the job streams for the compilation Job.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
... | java | public Observable<JobStreamListResultInner> listByJobAsync(String resourceGroupName, String automationAccountName, UUID jobId) {
return listByJobWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId).map(new Func1<ServiceResponse<JobStreamListResultInner>, JobStreamListResultInner>() {
... | [
"public",
"Observable",
"<",
"JobStreamListResultInner",
">",
"listByJobAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"UUID",
"jobId",
")",
"{",
"return",
"listByJobWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"autom... | Retrieve all the job streams for the compilation Job.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobId The job id.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the JobStreamList... | [
"Retrieve",
"all",
"the",
"job",
"streams",
"for",
"the",
"compilation",
"Job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscCompilationJobStreamsInner.java#L99-L106 |
fabric8io/fabric8-forge | fabric8-forge-core/src/main/java/io/fabric8/forge/rest/dto/UICommands.java | UICommands.convertValueToSafeJson | public static Object convertValueToSafeJson(Converter converter, Object value) {
"""
Uses the given converter to convert to a nicer UI value and return the JSON safe version
"""
value = Proxies.unwrap(value);
if (isJsonObject(value)) {
return value;
}
if (converter !... | java | public static Object convertValueToSafeJson(Converter converter, Object value) {
value = Proxies.unwrap(value);
if (isJsonObject(value)) {
return value;
}
if (converter != null) {
// TODO converters ususally go from String -> CustomType?
try {
... | [
"public",
"static",
"Object",
"convertValueToSafeJson",
"(",
"Converter",
"converter",
",",
"Object",
"value",
")",
"{",
"value",
"=",
"Proxies",
".",
"unwrap",
"(",
"value",
")",
";",
"if",
"(",
"isJsonObject",
"(",
"value",
")",
")",
"{",
"return",
"valu... | Uses the given converter to convert to a nicer UI value and return the JSON safe version | [
"Uses",
"the",
"given",
"converter",
"to",
"convert",
"to",
"a",
"nicer",
"UI",
"value",
"and",
"return",
"the",
"JSON",
"safe",
"version"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/dto/UICommands.java#L166-L187 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java | MapDotApi.dotDissoc | public static Map dotDissoc(final Map map, final String pathString) {
"""
Dissociates value by specified path.
@param map subject original map
@param pathString nodes to walk in map path of value
@return original map
"""
if (pathString == null || pathString.isEmpty()) {
throw new Illegal... | java | public static Map dotDissoc(final Map map, final String pathString) {
if (pathString == null || pathString.isEmpty()) {
throw new IllegalArgumentException(PATH_MUST_BE_SPECIFIED);
}
if (!pathString.contains(SEPARATOR)) {
map.remove(pathString);
return map;
... | [
"public",
"static",
"Map",
"dotDissoc",
"(",
"final",
"Map",
"map",
",",
"final",
"String",
"pathString",
")",
"{",
"if",
"(",
"pathString",
"==",
"null",
"||",
"pathString",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"... | Dissociates value by specified path.
@param map subject original map
@param pathString nodes to walk in map path of value
@return original map | [
"Dissociates",
"value",
"by",
"specified",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java#L342-L352 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/ScrollBarButtonPainter.java | ScrollBarButtonPainter.getScrollBarButtonBackgroundPaint | public Paint getScrollBarButtonBackgroundPaint(Shape s, boolean isIncrease, boolean buttonsTogether) {
"""
DOCUMENT ME!
@param s DOCUMENT ME!
@param isIncrease DOCUMENT ME!
@param buttonsTogether DOCUMENT ME!
@return DOCUMENT ME!
"""
TwoColors colors = getScrollBarButtonBa... | java | public Paint getScrollBarButtonBackgroundPaint(Shape s, boolean isIncrease, boolean buttonsTogether) {
TwoColors colors = getScrollBarButtonBackgroundColors(buttonsTogether, isIncrease);
return createHorizontalGradient(s, colors);
} | [
"public",
"Paint",
"getScrollBarButtonBackgroundPaint",
"(",
"Shape",
"s",
",",
"boolean",
"isIncrease",
",",
"boolean",
"buttonsTogether",
")",
"{",
"TwoColors",
"colors",
"=",
"getScrollBarButtonBackgroundColors",
"(",
"buttonsTogether",
",",
"isIncrease",
")",
";",
... | DOCUMENT ME!
@param s DOCUMENT ME!
@param isIncrease DOCUMENT ME!
@param buttonsTogether DOCUMENT ME!
@return DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/ScrollBarButtonPainter.java#L382-L386 |
jMetal/jMetal | jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/zdt/ZDT3.java | ZDT3.evalH | protected double evalH(double f, double g) {
"""
Returns the value of the ZDT3 function H.
@param f First argument of the function H.
@param g Second argument of the function H.
"""
double h ;
h = 1.0 - Math.sqrt(f / g)
- (f / g) * Math.sin(10.0 * Math.PI * f);
return h;
} | java | protected double evalH(double f, double g) {
double h ;
h = 1.0 - Math.sqrt(f / g)
- (f / g) * Math.sin(10.0 * Math.PI * f);
return h;
} | [
"protected",
"double",
"evalH",
"(",
"double",
"f",
",",
"double",
"g",
")",
"{",
"double",
"h",
";",
"h",
"=",
"1.0",
"-",
"Math",
".",
"sqrt",
"(",
"f",
"/",
"g",
")",
"-",
"(",
"f",
"/",
"g",
")",
"*",
"Math",
".",
"sin",
"(",
"10.0",
"*... | Returns the value of the ZDT3 function H.
@param f First argument of the function H.
@param g Second argument of the function H. | [
"Returns",
"the",
"value",
"of",
"the",
"ZDT3",
"function",
"H",
"."
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/zdt/ZDT3.java#L51-L56 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/shared/CmsContainerElementData.java | CmsContainerElementData.getFormatedIndividualSettings | public List<CmsAdditionalInfoBean> getFormatedIndividualSettings(String containerId) {
"""
Returns the individual element settings formated with nice-names to be used as additional-info.<p>
@param containerId the container id
@return the settings list
"""
List<CmsAdditionalInfoBean> result = new... | java | public List<CmsAdditionalInfoBean> getFormatedIndividualSettings(String containerId) {
List<CmsAdditionalInfoBean> result = new ArrayList<CmsAdditionalInfoBean>();
CmsFormatterConfig config = getFormatterConfig(containerId);
if ((m_settings != null) && (config != null)) {
for (Entry... | [
"public",
"List",
"<",
"CmsAdditionalInfoBean",
">",
"getFormatedIndividualSettings",
"(",
"String",
"containerId",
")",
"{",
"List",
"<",
"CmsAdditionalInfoBean",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"CmsAdditionalInfoBean",
">",
"(",
")",
";",
"CmsFormatte... | Returns the individual element settings formated with nice-names to be used as additional-info.<p>
@param containerId the container id
@return the settings list | [
"Returns",
"the",
"individual",
"element",
"settings",
"formated",
"with",
"nice",
"-",
"names",
"to",
"be",
"used",
"as",
"additional",
"-",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/shared/CmsContainerElementData.java#L144-L162 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TextComponentPainter.java | TextComponentPainter.paintBackgroundSolid | private void paintBackgroundSolid(Graphics2D g, JComponent c, int x, int y, int width, int height) {
"""
Paint the background of an uneditable control, e.g. a JLabel.
@param g DOCUMENT ME!
@param c DOCUMENT ME!
@param x DOCUMENT ME!
@param y DOCUMENT ME!
@param width DOCUMENT ME!
@para... | java | private void paintBackgroundSolid(Graphics2D g, JComponent c, int x, int y, int width, int height) {
Color color = c.getBackground();
if (type == CommonControlState.DISABLED) {
color = new Color(color.getRed(), color.getGreen(), color.getBlue(), 0x80);
}
Shape s = shapeGene... | [
"private",
"void",
"paintBackgroundSolid",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Color",
"color",
"=",
"c",
".",
"getBackground",
"(",
")",
";",
"if",
"... | Paint the background of an uneditable control, e.g. a JLabel.
@param g DOCUMENT ME!
@param c DOCUMENT ME!
@param x DOCUMENT ME!
@param y DOCUMENT ME!
@param width DOCUMENT ME!
@param height DOCUMENT ME! | [
"Paint",
"the",
"background",
"of",
"an",
"uneditable",
"control",
"e",
".",
"g",
".",
"a",
"JLabel",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TextComponentPainter.java#L190-L204 |
apereo/cas | support/cas-server-support-mongo-core/src/main/java/org/apereo/cas/mongo/MongoDbConnectionFactory.java | MongoDbConnectionFactory.buildMongoTemplate | public MongoTemplate buildMongoTemplate(final BaseMongoDbProperties mongo) {
"""
Build mongo template.
@param mongo the mongo properties settings
@return the mongo template
"""
val mongoDbFactory = mongoDbFactory(buildMongoDbClient(mongo), mongo);
return new MongoTemplate(mongoDbFactory, ma... | java | public MongoTemplate buildMongoTemplate(final BaseMongoDbProperties mongo) {
val mongoDbFactory = mongoDbFactory(buildMongoDbClient(mongo), mongo);
return new MongoTemplate(mongoDbFactory, mappingMongoConverter(mongoDbFactory));
} | [
"public",
"MongoTemplate",
"buildMongoTemplate",
"(",
"final",
"BaseMongoDbProperties",
"mongo",
")",
"{",
"val",
"mongoDbFactory",
"=",
"mongoDbFactory",
"(",
"buildMongoDbClient",
"(",
"mongo",
")",
",",
"mongo",
")",
";",
"return",
"new",
"MongoTemplate",
"(",
... | Build mongo template.
@param mongo the mongo properties settings
@return the mongo template | [
"Build",
"mongo",
"template",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-mongo-core/src/main/java/org/apereo/cas/mongo/MongoDbConnectionFactory.java#L105-L108 |
jbundle/jbundle | base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java | ClientTable.doSetHandle | public boolean doSetHandle(Object bookmark, int iHandleType) throws DBException {
"""
Reposition to this record using this bookmark.
@param bookmark The handle to use to position the record.
@param iHandleType The type of handle (DATA_SOURCE/OBJECT_ID,OBJECT_SOURCE,BOOKMARK).
@return - true - record found/fals... | java | public boolean doSetHandle(Object bookmark, int iHandleType) throws DBException
{
boolean bIsOpen = m_bIsOpen;
this.checkCacheMode(Boolean.FALSE); // Make sure the cache is set up correctly for this type of query (typically not needed)
if (((iHandleType & DBConstants.OBJECT_SOURCE_HAND... | [
"public",
"boolean",
"doSetHandle",
"(",
"Object",
"bookmark",
",",
"int",
"iHandleType",
")",
"throws",
"DBException",
"{",
"boolean",
"bIsOpen",
"=",
"m_bIsOpen",
";",
"this",
".",
"checkCacheMode",
"(",
"Boolean",
".",
"FALSE",
")",
";",
"// Make sure the cac... | Reposition to this record using this bookmark.
@param bookmark The handle to use to position the record.
@param iHandleType The type of handle (DATA_SOURCE/OBJECT_ID,OBJECT_SOURCE,BOOKMARK).
@return - true - record found/false - record not found
@exception FILE_NOT_OPEN.
@exception DBException File exception. | [
"Reposition",
"to",
"this",
"record",
"using",
"this",
"bookmark",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java#L459-L495 |
alexvasilkov/Events | library/src/main/java/com/alexvasilkov/events/Event.java | Event.isDeeplyEqual | public static boolean isDeeplyEqual(@NonNull Event e1, @NonNull Event e2) {
"""
<p>Two events are considered deeply equal if they have same key and exactly same
parameters lists.</p>
<p>Parameters are compared using {@link Arrays#deepEquals(Object[], Object[])}, so be sure
to have correct implementation of {@li... | java | public static boolean isDeeplyEqual(@NonNull Event e1, @NonNull Event e2) {
return e1 == e2 || (e1.key.equals(e2.key) && Arrays.deepEquals(e1.params, e2.params));
} | [
"public",
"static",
"boolean",
"isDeeplyEqual",
"(",
"@",
"NonNull",
"Event",
"e1",
",",
"@",
"NonNull",
"Event",
"e2",
")",
"{",
"return",
"e1",
"==",
"e2",
"||",
"(",
"e1",
".",
"key",
".",
"equals",
"(",
"e2",
".",
"key",
")",
"&&",
"Arrays",
".... | <p>Two events are considered deeply equal if they have same key and exactly same
parameters lists.</p>
<p>Parameters are compared using {@link Arrays#deepEquals(Object[], Object[])}, so be sure
to have correct implementation of {@link Object#equals(Object)} method for all parameters.
</p>
<p>If you don't want some of p... | [
"<p",
">",
"Two",
"events",
"are",
"considered",
"deeply",
"equal",
"if",
"they",
"have",
"same",
"key",
"and",
"exactly",
"same",
"parameters",
"lists",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Parameters",
"are",
"compared",
"using",
"{"
] | train | https://github.com/alexvasilkov/Events/blob/4208e11fab35d99229fe6c3b3d434ca1948f3fc5/library/src/main/java/com/alexvasilkov/events/Event.java#L83-L85 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/process/WordShapeClassifier.java | WordShapeClassifier.wordShapeDan2Bio | private static String wordShapeDan2Bio(String s, Collection<String> knownLCWords) {
"""
Returns a fine-grained word shape classifier, that equivalence classes
lower and upper case and digits, and collapses sequences of the
same type, but keeps all punctuation. This adds an extra recognizer
for a greek letter e... | java | private static String wordShapeDan2Bio(String s, Collection<String> knownLCWords) {
if (containsGreekLetter(s)) {
return wordShapeDan2(s, knownLCWords) + "-GREEK";
} else {
return wordShapeDan2(s, knownLCWords);
}
} | [
"private",
"static",
"String",
"wordShapeDan2Bio",
"(",
"String",
"s",
",",
"Collection",
"<",
"String",
">",
"knownLCWords",
")",
"{",
"if",
"(",
"containsGreekLetter",
"(",
"s",
")",
")",
"{",
"return",
"wordShapeDan2",
"(",
"s",
",",
"knownLCWords",
")",
... | Returns a fine-grained word shape classifier, that equivalence classes
lower and upper case and digits, and collapses sequences of the
same type, but keeps all punctuation. This adds an extra recognizer
for a greek letter embedded in the String, which is useful for bio. | [
"Returns",
"a",
"fine",
"-",
"grained",
"word",
"shape",
"classifier",
"that",
"equivalence",
"classes",
"lower",
"and",
"upper",
"case",
"and",
"digits",
"and",
"collapses",
"sequences",
"of",
"the",
"same",
"type",
"but",
"keeps",
"all",
"punctuation",
".",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/process/WordShapeClassifier.java#L658-L664 |
kongchen/swagger-maven-plugin | src/main/java/com/github/kongchen/swagger/docgen/reader/AbstractReader.java | AbstractReader.getParameters | protected final List<Parameter> getParameters(Type type, List<Annotation> annotations) {
"""
this is final to enforce that only the implementation method below can be overridden, to avoid confusion
"""
return getParameters(type, annotations, typesToSkip);
} | java | protected final List<Parameter> getParameters(Type type, List<Annotation> annotations) {
return getParameters(type, annotations, typesToSkip);
} | [
"protected",
"final",
"List",
"<",
"Parameter",
">",
"getParameters",
"(",
"Type",
"type",
",",
"List",
"<",
"Annotation",
">",
"annotations",
")",
"{",
"return",
"getParameters",
"(",
"type",
",",
"annotations",
",",
"typesToSkip",
")",
";",
"}"
] | this is final to enforce that only the implementation method below can be overridden, to avoid confusion | [
"this",
"is",
"final",
"to",
"enforce",
"that",
"only",
"the",
"implementation",
"method",
"below",
"can",
"be",
"overridden",
"to",
"avoid",
"confusion"
] | train | https://github.com/kongchen/swagger-maven-plugin/blob/0709b035ef45e1cb13189cd7f949c52c10557747/src/main/java/com/github/kongchen/swagger/docgen/reader/AbstractReader.java#L310-L312 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.createPreset | public CreatePresetResponse createPreset(CreatePresetRequest request) {
"""
Create a live preset which contains parameters needed in the live stream service.
@param request The request object containing all options for creating presets.
@return the response
"""
checkNotNull(request, "The parameter ... | java | public CreatePresetResponse createPreset(CreatePresetRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getName(),
"The parameter name should NOT be null or empty string.");
if (request.getAudio() != null) {
... | [
"public",
"CreatePresetResponse",
"createPreset",
"(",
"CreatePresetRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getName",
"(",
")",
",",
"\"Th... | Create a live preset which contains parameters needed in the live stream service.
@param request The request object containing all options for creating presets.
@return the response | [
"Create",
"a",
"live",
"preset",
"which",
"contains",
"parameters",
"needed",
"in",
"the",
"live",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L290-L327 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.orMoreThan | public ZealotKhala orMoreThan(String field, Object value) {
"""
生成带" OR "前缀大于查询的SQL片段.
@param field 数据库字段
@param value 值
@return ZealotKhala实例
"""
return this.doNormal(ZealotConst.OR_PREFIX, field, value, ZealotConst.GT_SUFFIX, true);
} | java | public ZealotKhala orMoreThan(String field, Object value) {
return this.doNormal(ZealotConst.OR_PREFIX, field, value, ZealotConst.GT_SUFFIX, true);
} | [
"public",
"ZealotKhala",
"orMoreThan",
"(",
"String",
"field",
",",
"Object",
"value",
")",
"{",
"return",
"this",
".",
"doNormal",
"(",
"ZealotConst",
".",
"OR_PREFIX",
",",
"field",
",",
"value",
",",
"ZealotConst",
".",
"GT_SUFFIX",
",",
"true",
")",
";... | 生成带" OR "前缀大于查询的SQL片段.
@param field 数据库字段
@param value 值
@return ZealotKhala实例 | [
"生成带",
"OR",
"前缀大于查询的SQL片段",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L690-L692 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SDLayerParams.java | SDLayerParams.addWeightParam | public void addWeightParam(@NonNull String paramKey, @NonNull long... paramShape) {
"""
Add a weight parameter to the layer, with the specified shape. For example, a standard fully connected layer
could have weight parameters with shape [numInputs, layerSize]
@param paramKey The parameter key (name) for the ... | java | public void addWeightParam(@NonNull String paramKey, @NonNull long... paramShape) {
Preconditions.checkArgument(paramShape.length > 0, "Provided weight parameter shape is"
+ " invalid: length 0 provided for shape. Parameter: " + paramKey);
weightParams.put(paramKey, paramShape);
... | [
"public",
"void",
"addWeightParam",
"(",
"@",
"NonNull",
"String",
"paramKey",
",",
"@",
"NonNull",
"long",
"...",
"paramShape",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"paramShape",
".",
"length",
">",
"0",
",",
"\"Provided weight parameter shape is... | Add a weight parameter to the layer, with the specified shape. For example, a standard fully connected layer
could have weight parameters with shape [numInputs, layerSize]
@param paramKey The parameter key (name) for the weight parameter
@param paramShape Shape of the weight parameter array | [
"Add",
"a",
"weight",
"parameter",
"to",
"the",
"layer",
"with",
"the",
"specified",
"shape",
".",
"For",
"example",
"a",
"standard",
"fully",
"connected",
"layer",
"could",
"have",
"weight",
"parameters",
"with",
"shape",
"[",
"numInputs",
"layerSize",
"]"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SDLayerParams.java#L65-L72 |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/web/JobsInfoServlet.java | JobsInfoServlet.getJMConnection | private ExtendedManagementProtocol getJMConnection() throws IOException {
"""
Sets up a connection to the JobManager.
@return Connection to the JobManager.
@throws IOException
"""
String jmHost = config.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null);
String jmPort = config.getString(Confi... | java | private ExtendedManagementProtocol getJMConnection() throws IOException {
String jmHost = config.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null);
String jmPort = config.getString(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, null);
return RPC.getProxy(ExtendedManagementProtocol.class,
new InetSock... | [
"private",
"ExtendedManagementProtocol",
"getJMConnection",
"(",
")",
"throws",
"IOException",
"{",
"String",
"jmHost",
"=",
"config",
".",
"getString",
"(",
"ConfigConstants",
".",
"JOB_MANAGER_IPC_ADDRESS_KEY",
",",
"null",
")",
";",
"String",
"jmPort",
"=",
"conf... | Sets up a connection to the JobManager.
@return Connection to the JobManager.
@throws IOException | [
"Sets",
"up",
"a",
"connection",
"to",
"the",
"JobManager",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/web/JobsInfoServlet.java#L104-L110 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPP12Reader.java | MPP12Reader.processResourceEnterpriseColumns | private void processResourceEnterpriseColumns(Resource resource, byte[] metaData2) {
"""
Extracts resource enterprise column data.
@param resource resource instance
@param metaData2 resource meta data
"""
if (metaData2 != null)
{
int bits = MPPUtility.getInt(metaData2, 16);
re... | java | private void processResourceEnterpriseColumns(Resource resource, byte[] metaData2)
{
if (metaData2 != null)
{
int bits = MPPUtility.getInt(metaData2, 16);
resource.set(ResourceField.ENTERPRISE_FLAG1, Boolean.valueOf((bits & 0x00010) != 0));
resource.set(ResourceField.ENTERPRISE... | [
"private",
"void",
"processResourceEnterpriseColumns",
"(",
"Resource",
"resource",
",",
"byte",
"[",
"]",
"metaData2",
")",
"{",
"if",
"(",
"metaData2",
"!=",
"null",
")",
"{",
"int",
"bits",
"=",
"MPPUtility",
".",
"getInt",
"(",
"metaData2",
",",
"16",
... | Extracts resource enterprise column data.
@param resource resource instance
@param metaData2 resource meta data | [
"Extracts",
"resource",
"enterprise",
"column",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP12Reader.java#L1521-L1553 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FileProxyProteinSequenceCreator.java | FileProxyProteinSequenceCreator.getSequence | @Override
public AbstractSequence<AminoAcidCompound> getSequence(String sequence, long index) throws CompoundNotFoundException, IOException {
"""
Even though we are passing in the sequence we really only care about the length of the sequence and the offset
index in the fasta file.
@param sequence
@param index
... | java | @Override
public AbstractSequence<AminoAcidCompound> getSequence(String sequence, long index) throws CompoundNotFoundException, IOException {
SequenceFileProxyLoader<AminoAcidCompound> sequenceFileProxyLoader =
new SequenceFileProxyLoader<AminoAcidCompound>(
file,
sequenceParser,
index,
s... | [
"@",
"Override",
"public",
"AbstractSequence",
"<",
"AminoAcidCompound",
">",
"getSequence",
"(",
"String",
"sequence",
",",
"long",
"index",
")",
"throws",
"CompoundNotFoundException",
",",
"IOException",
"{",
"SequenceFileProxyLoader",
"<",
"AminoAcidCompound",
">",
... | Even though we are passing in the sequence we really only care about the length of the sequence and the offset
index in the fasta file.
@param sequence
@param index
@return
@throws CompoundNotFoundException
@throws IOException | [
"Even",
"though",
"we",
"are",
"passing",
"in",
"the",
"sequence",
"we",
"really",
"only",
"care",
"about",
"the",
"length",
"of",
"the",
"sequence",
"and",
"the",
"offset",
"index",
"in",
"the",
"fasta",
"file",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FileProxyProteinSequenceCreator.java#L76-L87 |
ebean-orm/ebean-querybean | src/main/java/io/ebean/typequery/TQRootBean.java | TQRootBean.textQueryString | public R textQueryString(String query, TextQueryString options) {
"""
Add a Text query string expression (document store only).
<p>
This automatically makes the query a document store query.
</p>
"""
peekExprList().textQueryString(query, options);
return root;
} | java | public R textQueryString(String query, TextQueryString options) {
peekExprList().textQueryString(query, options);
return root;
} | [
"public",
"R",
"textQueryString",
"(",
"String",
"query",
",",
"TextQueryString",
"options",
")",
"{",
"peekExprList",
"(",
")",
".",
"textQueryString",
"(",
"query",
",",
"options",
")",
";",
"return",
"root",
";",
"}"
] | Add a Text query string expression (document store only).
<p>
This automatically makes the query a document store query.
</p> | [
"Add",
"a",
"Text",
"query",
"string",
"expression",
"(",
"document",
"store",
"only",
")",
".",
"<p",
">",
"This",
"automatically",
"makes",
"the",
"query",
"a",
"document",
"store",
"query",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/TQRootBean.java#L1421-L1424 |
mokies/ratelimitj | ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java | RequestLimitRule.withName | public RequestLimitRule withName(String name) {
"""
Applies a name to the rate limit that is useful for metrics.
@param name Defines a descriptive name for the rule limit.
@return a limit rule
"""
return new RequestLimitRule(this.durationSeconds, this.limit, this.precision, name, this.keys);
} | java | public RequestLimitRule withName(String name) {
return new RequestLimitRule(this.durationSeconds, this.limit, this.precision, name, this.keys);
} | [
"public",
"RequestLimitRule",
"withName",
"(",
"String",
"name",
")",
"{",
"return",
"new",
"RequestLimitRule",
"(",
"this",
".",
"durationSeconds",
",",
"this",
".",
"limit",
",",
"this",
".",
"precision",
",",
"name",
",",
"this",
".",
"keys",
")",
";",
... | Applies a name to the rate limit that is useful for metrics.
@param name Defines a descriptive name for the rule limit.
@return a limit rule | [
"Applies",
"a",
"name",
"to",
"the",
"rate",
"limit",
"that",
"is",
"useful",
"for",
"metrics",
"."
] | train | https://github.com/mokies/ratelimitj/blob/eb15ec42055c46b2b3f6f84131d86f570e489c32/ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java#L81-L83 |
phax/ph-web | ph-useragent/src/main/java/com/helger/useragent/UserAgentDecryptor.java | UserAgentDecryptor.decryptUserAgentString | @Nonnull
public static IUserAgent decryptUserAgentString (@Nonnull final String sUserAgent) {
"""
Decrypt the passed user agent string.
@param sUserAgent
The user agent string to decrypt. May not be <code>null</code>.
@return The user agent object. Never <code>null</code>.
"""
ValueEnforcer.notNull ... | java | @Nonnull
public static IUserAgent decryptUserAgentString (@Nonnull final String sUserAgent)
{
ValueEnforcer.notNull (sUserAgent, "UserAgent");
String sRealUserAgent = sUserAgent;
// Check if surrounded with '"' or '''
if (sRealUserAgent.length () >= 2)
{
final char cFirst = sRealUserAgen... | [
"@",
"Nonnull",
"public",
"static",
"IUserAgent",
"decryptUserAgentString",
"(",
"@",
"Nonnull",
"final",
"String",
"sUserAgent",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sUserAgent",
",",
"\"UserAgent\"",
")",
";",
"String",
"sRealUserAgent",
"=",
"sUserA... | Decrypt the passed user agent string.
@param sUserAgent
The user agent string to decrypt. May not be <code>null</code>.
@return The user agent object. Never <code>null</code>. | [
"Decrypt",
"the",
"passed",
"user",
"agent",
"string",
"."
] | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-useragent/src/main/java/com/helger/useragent/UserAgentDecryptor.java#L135-L155 |
apereo/cas | api/cas-server-core-api-authentication/src/main/java/org/apereo/cas/authentication/DefaultAuthenticationTransaction.java | DefaultAuthenticationTransaction.of | public static DefaultAuthenticationTransaction of(final Service service, final Credential... credentials) {
"""
Wrap credentials into an authentication transaction, as a factory method,
and return the final result.
@param service the service
@param credentials the credentials
@return the authentication t... | java | public static DefaultAuthenticationTransaction of(final Service service, final Credential... credentials) {
val creds = sanitizeCredentials(credentials);
return new DefaultAuthenticationTransaction(service, creds);
} | [
"public",
"static",
"DefaultAuthenticationTransaction",
"of",
"(",
"final",
"Service",
"service",
",",
"final",
"Credential",
"...",
"credentials",
")",
"{",
"val",
"creds",
"=",
"sanitizeCredentials",
"(",
"credentials",
")",
";",
"return",
"new",
"DefaultAuthentic... | Wrap credentials into an authentication transaction, as a factory method,
and return the final result.
@param service the service
@param credentials the credentials
@return the authentication transaction | [
"Wrap",
"credentials",
"into",
"an",
"authentication",
"transaction",
"as",
"a",
"factory",
"method",
"and",
"return",
"the",
"final",
"result",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/api/cas-server-core-api-authentication/src/main/java/org/apereo/cas/authentication/DefaultAuthenticationTransaction.java#L46-L49 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.anyOf | public static <T extends Tree> Matcher<T> anyOf(
final Iterable<? extends Matcher<? super T>> matchers) {
"""
Compose several matchers together, such that the composite matches an AST node if any of the
given matchers do.
"""
return new Matcher<T>() {
@Override
public boolean matches(T t... | java | public static <T extends Tree> Matcher<T> anyOf(
final Iterable<? extends Matcher<? super T>> matchers) {
return new Matcher<T>() {
@Override
public boolean matches(T t, VisitorState state) {
for (Matcher<? super T> matcher : matchers) {
if (matcher.matches(t, state)) {
... | [
"public",
"static",
"<",
"T",
"extends",
"Tree",
">",
"Matcher",
"<",
"T",
">",
"anyOf",
"(",
"final",
"Iterable",
"<",
"?",
"extends",
"Matcher",
"<",
"?",
"super",
"T",
">",
">",
"matchers",
")",
"{",
"return",
"new",
"Matcher",
"<",
"T",
">",
"(... | Compose several matchers together, such that the composite matches an AST node if any of the
given matchers do. | [
"Compose",
"several",
"matchers",
"together",
"such",
"that",
"the",
"composite",
"matches",
"an",
"AST",
"node",
"if",
"any",
"of",
"the",
"given",
"matchers",
"do",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L150-L163 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/db/impl/DirectDataSourceProvider.java | DirectDataSourceProvider.createDataSource | @Override
public DataSource createDataSource(String source, Properties configurationProperties, String config) {
"""
protected static PropertiesLoader propLoader = new PropertiesLoader();
"""
DataSource ds = null;
try {
DirectDataSourceConfiguration cfg = new DirectDataSourceConfiguration(configura... | java | @Override
public DataSource createDataSource(String source, Properties configurationProperties, String config) {
DataSource ds = null;
try {
DirectDataSourceConfiguration cfg = new DirectDataSourceConfiguration(configurationProperties);
ds = new DriverManagerDataSource(cfg.getDriverClassName(), cfg.getU... | [
"@",
"Override",
"public",
"DataSource",
"createDataSource",
"(",
"String",
"source",
",",
"Properties",
"configurationProperties",
",",
"String",
"config",
")",
"{",
"DataSource",
"ds",
"=",
"null",
";",
"try",
"{",
"DirectDataSourceConfiguration",
"cfg",
"=",
"n... | protected static PropertiesLoader propLoader = new PropertiesLoader(); | [
"protected",
"static",
"PropertiesLoader",
"propLoader",
"=",
"new",
"PropertiesLoader",
"()",
";"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/impl/DirectDataSourceProvider.java#L40-L52 |
cbeust/jcommander | src/main/java/com/beust/jcommander/JCommander.java | JCommander.setProgramName | public void setProgramName(String name, String... aliases) {
"""
Set the program name
@param name program name
@param aliases aliases to the program name
"""
programName = new ProgramName(name, Arrays.asList(aliases));
} | java | public void setProgramName(String name, String... aliases) {
programName = new ProgramName(name, Arrays.asList(aliases));
} | [
"public",
"void",
"setProgramName",
"(",
"String",
"name",
",",
"String",
"...",
"aliases",
")",
"{",
"programName",
"=",
"new",
"ProgramName",
"(",
"name",
",",
"Arrays",
".",
"asList",
"(",
"aliases",
")",
")",
";",
"}"
] | Set the program name
@param name program name
@param aliases aliases to the program name | [
"Set",
"the",
"program",
"name"
] | train | https://github.com/cbeust/jcommander/blob/85cb6f7217e15f62225185ffd97491f34b7b49bb/src/main/java/com/beust/jcommander/JCommander.java#L1014-L1016 |
jenkinsci/jenkins | core/src/main/java/hudson/model/Items.java | Items.whileUpdatingByXml | public static <V,T extends Throwable> V whileUpdatingByXml(Callable<V,T> callable) throws T {
"""
Runs a block while making {@link #currentlyUpdatingByXml} be temporarily true.
Use this when you are creating or changing an item.
@param <V> a return value type (may be {@link Void})
@param <T> an error type (may ... | java | public static <V,T extends Throwable> V whileUpdatingByXml(Callable<V,T> callable) throws T {
updatingByXml.set(true);
try {
return callable.call();
} finally {
updatingByXml.set(false);
}
} | [
"public",
"static",
"<",
"V",
",",
"T",
"extends",
"Throwable",
">",
"V",
"whileUpdatingByXml",
"(",
"Callable",
"<",
"V",
",",
"T",
">",
"callable",
")",
"throws",
"T",
"{",
"updatingByXml",
".",
"set",
"(",
"true",
")",
";",
"try",
"{",
"return",
"... | Runs a block while making {@link #currentlyUpdatingByXml} be temporarily true.
Use this when you are creating or changing an item.
@param <V> a return value type (may be {@link Void})
@param <T> an error type (may be {@link Error})
@param callable a block, typically running {@link #load} or {@link Item#onLoad}
@return ... | [
"Runs",
"a",
"block",
"while",
"making",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Items.java#L133-L140 |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.getDirection | public static int getDirection (
MisoSceneMetrics metrics, int ax, int ay, int bx, int by) {
"""
Given two points in screen pixel coordinates, return the
compass direction that point B lies in from point A from an
isometric perspective.
@param ax the x-position of point A.
@param ay the y-position of... | java | public static int getDirection (
MisoSceneMetrics metrics, int ax, int ay, int bx, int by)
{
Point afpos = new Point(), bfpos = new Point();
// convert screen coordinates to full coordinates to get both
// tile coordinates and fine coordinates
screenToFull(metrics, ax, ay, a... | [
"public",
"static",
"int",
"getDirection",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"ax",
",",
"int",
"ay",
",",
"int",
"bx",
",",
"int",
"by",
")",
"{",
"Point",
"afpos",
"=",
"new",
"Point",
"(",
")",
",",
"bfpos",
"=",
"new",
"Point",
"(",
... | Given two points in screen pixel coordinates, return the
compass direction that point B lies in from point A from an
isometric perspective.
@param ax the x-position of point A.
@param ay the y-position of point A.
@param bx the x-position of point B.
@param by the y-position of point B.
@return the direction specifie... | [
"Given",
"two",
"points",
"in",
"screen",
"pixel",
"coordinates",
"return",
"the",
"compass",
"direction",
"that",
"point",
"B",
"lies",
"in",
"from",
"point",
"A",
"from",
"an",
"isometric",
"perspective",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L51-L89 |
dihedron/dihedron-commons | src/main/java/org/dihedron/patterns/functional/Functional.java | Functional.forEach | public <E> S forEach(Fx<S, E> functor) {
"""
Iterates over the collection elements or entries and passing each of them
to the given implementation of the functor interface; if state needs to be
propagated, it can be instantiated and returned by the first invocation of
the functor and it will be passed along the... | java | public <E> S forEach(Fx<S, E> functor) {
return forEach(null, functor);
} | [
"public",
"<",
"E",
">",
"S",
"forEach",
"(",
"Fx",
"<",
"S",
",",
"E",
">",
"functor",
")",
"{",
"return",
"forEach",
"(",
"null",
",",
"functor",
")",
";",
"}"
] | Iterates over the collection elements or entries and passing each of them
to the given implementation of the functor interface; if state needs to be
propagated, it can be instantiated and returned by the first invocation of
the functor and it will be passed along the next elements of the collection.
@param functor
an ... | [
"Iterates",
"over",
"the",
"collection",
"elements",
"or",
"entries",
"and",
"passing",
"each",
"of",
"them",
"to",
"the",
"given",
"implementation",
"of",
"the",
"functor",
"interface",
";",
"if",
"state",
"needs",
"to",
"be",
"propagated",
"it",
"can",
"be... | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/functional/Functional.java#L118-L120 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.deleteFace | public void deleteFace(String personGroupId, UUID personId, UUID persistedFaceId) {
"""
Delete a face from a person. Relative image for the persisted face will also be deleted.
@param personGroupId Id referencing a particular person group.
@param personId Id referencing a particular person.
@param persistedFa... | java | public void deleteFace(String personGroupId, UUID personId, UUID persistedFaceId) {
deleteFaceWithServiceResponseAsync(personGroupId, personId, persistedFaceId).toBlocking().single().body();
} | [
"public",
"void",
"deleteFace",
"(",
"String",
"personGroupId",
",",
"UUID",
"personId",
",",
"UUID",
"persistedFaceId",
")",
"{",
"deleteFaceWithServiceResponseAsync",
"(",
"personGroupId",
",",
"personId",
",",
"persistedFaceId",
")",
".",
"toBlocking",
"(",
")",
... | Delete a face from a person. Relative image for the persisted face will also be deleted.
@param personGroupId Id referencing a particular person group.
@param personId Id referencing a particular person.
@param persistedFaceId Id referencing a particular persistedFaceId of an existing face.
@throws IllegalArgumentExce... | [
"Delete",
"a",
"face",
"from",
"a",
"person",
".",
"Relative",
"image",
"for",
"the",
"persisted",
"face",
"will",
"also",
"be",
"deleted",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L799-L801 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/validate/Schema.java | Schema.performValidation | protected void performValidation(String path, Object value, List<ValidationResult> results) {
"""
Validates a given value against the schema and configured validation rules.
@param path a dot notation path to the value.
@param value a value to be validated.
@param results a list with validation results t... | java | protected void performValidation(String path, Object value, List<ValidationResult> results) {
String name = path != null ? path : "value";
if (value == null) {
// Check for required values
if (_required)
results.add(new ValidationResult(path, ValidationResultType.Error, "VALUE_IS_NULL",
name + " ca... | [
"protected",
"void",
"performValidation",
"(",
"String",
"path",
",",
"Object",
"value",
",",
"List",
"<",
"ValidationResult",
">",
"results",
")",
"{",
"String",
"name",
"=",
"path",
"!=",
"null",
"?",
"path",
":",
"\"value\"",
";",
"if",
"(",
"value",
... | Validates a given value against the schema and configured validation rules.
@param path a dot notation path to the value.
@param value a value to be validated.
@param results a list with validation results to add new results. | [
"Validates",
"a",
"given",
"value",
"against",
"the",
"schema",
"and",
"configured",
"validation",
"rules",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/validate/Schema.java#L131-L148 |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java | SqlValidatorImpl.navigationInDefine | private SqlNode navigationInDefine(SqlNode node, String alpha) {
"""
Checks that all pattern variables within a function are the same,
and canonizes expressions such as {@code PREV(B.price)} to
{@code LAST(B.price, 0)}.
"""
Set<String> prefix = node.accept(new PatternValidator(false));
Util.discard(prefi... | java | private SqlNode navigationInDefine(SqlNode node, String alpha) {
Set<String> prefix = node.accept(new PatternValidator(false));
Util.discard(prefix);
node = new NavigationExpander().go(node);
node = new NavigationReplacer(alpha).go(node);
return node;
} | [
"private",
"SqlNode",
"navigationInDefine",
"(",
"SqlNode",
"node",
",",
"String",
"alpha",
")",
"{",
"Set",
"<",
"String",
">",
"prefix",
"=",
"node",
".",
"accept",
"(",
"new",
"PatternValidator",
"(",
"false",
")",
")",
";",
"Util",
".",
"discard",
"(... | Checks that all pattern variables within a function are the same,
and canonizes expressions such as {@code PREV(B.price)} to
{@code LAST(B.price, 0)}. | [
"Checks",
"that",
"all",
"pattern",
"variables",
"within",
"a",
"function",
"are",
"the",
"same",
"and",
"canonizes",
"expressions",
"such",
"as",
"{"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L5152-L5158 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/util/XMLUtilities.java | XMLUtilities.getChildValue | public static String getChildValue(Element element, String name) {
"""
Get the value of the fist child element with the given name.
@param element
The parent element
@param name
The child element name
@return The child element value or null
"""
return getValue(getChild(element, name));
} | java | public static String getChildValue(Element element, String name) {
return getValue(getChild(element, name));
} | [
"public",
"static",
"String",
"getChildValue",
"(",
"Element",
"element",
",",
"String",
"name",
")",
"{",
"return",
"getValue",
"(",
"getChild",
"(",
"element",
",",
"name",
")",
")",
";",
"}"
] | Get the value of the fist child element with the given name.
@param element
The parent element
@param name
The child element name
@return The child element value or null | [
"Get",
"the",
"value",
"of",
"the",
"fist",
"child",
"element",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/util/XMLUtilities.java#L73-L75 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric_ca/sdk/HFCAAffiliation.java | HFCAAffiliation.read | public int read(User registrar) throws AffiliationException, InvalidArgumentException {
"""
gets a specific affiliation
@param registrar The identity of the registrar
@return Returns response
@throws AffiliationException if getting an affiliation fails.
@throws InvalidArgumentException
"""
if (re... | java | public int read(User registrar) throws AffiliationException, InvalidArgumentException {
if (registrar == null) {
throw new InvalidArgumentException("Registrar should be a valid member");
}
String readAffURL = "";
try {
readAffURL = HFCA_AFFILIATION + "/" + name;
... | [
"public",
"int",
"read",
"(",
"User",
"registrar",
")",
"throws",
"AffiliationException",
",",
"InvalidArgumentException",
"{",
"if",
"(",
"registrar",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Registrar should be a valid member\"",
"... | gets a specific affiliation
@param registrar The identity of the registrar
@return Returns response
@throws AffiliationException if getting an affiliation fails.
@throws InvalidArgumentException | [
"gets",
"a",
"specific",
"affiliation"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAAffiliation.java#L194-L224 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/ClassUtils.java | ClassUtils.isVisible | public static boolean isVisible(Class<?> clazz, ClassLoader classLoader) {
"""
Check whether the given class is visible in the given ClassLoader.
@param clazz the class to check (typically an interface)
@param classLoader the ClassLoader to check against
(may be {@code null} in which case this method will alw... | java | public static boolean isVisible(Class<?> clazz, ClassLoader classLoader) {
if (classLoader == null) {
return true;
}
try {
if (clazz.getClassLoader() == classLoader) {
return true;
}
} catch (SecurityException ex) {
// Fall ... | [
"public",
"static",
"boolean",
"isVisible",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"classLoader",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"if",
"(",
"clazz",
".",
"getClassL... | Check whether the given class is visible in the given ClassLoader.
@param clazz the class to check (typically an interface)
@param classLoader the ClassLoader to check against
(may be {@code null} in which case this method will always return {@code true})
@return true if the given class is visible; otherwise false
@si... | [
"Check",
"whether",
"the",
"given",
"class",
"is",
"visible",
"in",
"the",
"given",
"ClassLoader",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/ClassUtils.java#L148-L162 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/AFPChainXMLConverter.java | AFPChainXMLConverter.toXML | public synchronized static void toXML(AFPChain afpChain, StringWriter swriter,Atom[] ca1, Atom[]ca2) throws IOException {
"""
Write the XML representation to a StringWriter
@param afpChain
@param swriter
@throws IOException
"""
PrintWriter writer = new PrintWriter(swriter);
PrettyXMLWriter xml = new ... | java | public synchronized static void toXML(AFPChain afpChain, StringWriter swriter,Atom[] ca1, Atom[]ca2) throws IOException{
PrintWriter writer = new PrintWriter(swriter);
PrettyXMLWriter xml = new PrettyXMLWriter(writer);
xml.openTag("AFPChain");
printXMLHeader(xml,afpChain);
// that is the initial alignmen... | [
"public",
"synchronized",
"static",
"void",
"toXML",
"(",
"AFPChain",
"afpChain",
",",
"StringWriter",
"swriter",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
")",
"throws",
"IOException",
"{",
"PrintWriter",
"writer",
"=",
"new",
"PrintWriter... | Write the XML representation to a StringWriter
@param afpChain
@param swriter
@throws IOException | [
"Write",
"the",
"XML",
"representation",
"to",
"a",
"StringWriter"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/AFPChainXMLConverter.java#L56-L102 |
meertensinstituut/mtas | src/main/java/mtas/search/spans/util/MtasIgnoreItem.java | MtasIgnoreItem.getMaxEndPosition | public int getMaxEndPosition(int docId, int position) throws IOException {
"""
Gets the max end position.
@param docId the doc id
@param position the position
@return the max end position
@throws IOException Signals that an I/O exception has occurred.
"""
if (ignoreSpans != null && docId == currentDo... | java | public int getMaxEndPosition(int docId, int position) throws IOException {
if (ignoreSpans != null && docId == currentDocId) {
if (position < minimumPosition) {
throw new IOException(
"Unexpected position, should be >= " + minimumPosition + "!");
}
computeFullEndPositionList(po... | [
"public",
"int",
"getMaxEndPosition",
"(",
"int",
"docId",
",",
"int",
"position",
")",
"throws",
"IOException",
"{",
"if",
"(",
"ignoreSpans",
"!=",
"null",
"&&",
"docId",
"==",
"currentDocId",
")",
"{",
"if",
"(",
"position",
"<",
"minimumPosition",
")",
... | Gets the max end position.
@param docId the doc id
@param position the position
@return the max end position
@throws IOException Signals that an I/O exception has occurred. | [
"Gets",
"the",
"max",
"end",
"position",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L144-L159 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateSasDefinitionAsync | public ServiceFuture<SasDefinitionBundle> updateSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback<SasDefinitionBundle> serviceCallback) {
"""
Updates the specified attributes associated with the given SAS definition. This operation requires the stora... | java | public ServiceFuture<SasDefinitionBundle> updateSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback<SasDefinitionBundle> serviceCallback) {
return ServiceFuture.fromResponse(updateSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountNam... | [
"public",
"ServiceFuture",
"<",
"SasDefinitionBundle",
">",
"updateSasDefinitionAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"sasDefinitionName",
",",
"final",
"ServiceCallback",
"<",
"SasDefinitionBundle",
">",
"serviceCallback... | Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@param sasDefinitionName The name of the SAS defi... | [
"Updates",
"the",
"specified",
"attributes",
"associated",
"with",
"the",
"given",
"SAS",
"definition",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"setsas",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L11506-L11508 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java | WriterUtils.getWriterOutputDir | public static Path getWriterOutputDir(State state, int numBranches, int branchId) {
"""
Get the {@link Path} corresponding the to the directory a given {@link org.apache.gobblin.writer.DataWriter} should be writing
its output data. The output data directory is determined by combining the
{@link ConfigurationKeys... | java | public static Path getWriterOutputDir(State state, int numBranches, int branchId) {
String writerOutputDirKey =
ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_OUTPUT_DIR, numBranches, branchId);
Preconditions.checkArgument(state.contains(writerOutputDirKey), "Missing required proper... | [
"public",
"static",
"Path",
"getWriterOutputDir",
"(",
"State",
"state",
",",
"int",
"numBranches",
",",
"int",
"branchId",
")",
"{",
"String",
"writerOutputDirKey",
"=",
"ForkOperatorUtils",
".",
"getPropertyNameForBranch",
"(",
"ConfigurationKeys",
".",
"WRITER_OUTP... | Get the {@link Path} corresponding the to the directory a given {@link org.apache.gobblin.writer.DataWriter} should be writing
its output data. The output data directory is determined by combining the
{@link ConfigurationKeys#WRITER_OUTPUT_DIR} and the {@link ConfigurationKeys#WRITER_FILE_PATH}.
@param state is the {@l... | [
"Get",
"the",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java#L111-L117 |
konvergeio/cofoja | src/main/java/com/google/java/contract/core/agent/ContractAnalyzer.java | ContractAnalyzer.descArgumentsMatch | @Requires( {
"""
Returns {@code true} if the argument descriptors {@code desc1}
and {@code desc2} are equal (return type is ignored), ignoring
the last {@code offset} parameters of {@code desc2}.
"""
"desc1 != null",
"desc2 != null",
"offset >= 0"
})
private boolean descArgumentsMatch(String ... | java | @Requires({
"desc1 != null",
"desc2 != null",
"offset >= 0"
})
private boolean descArgumentsMatch(String desc1, String desc2, int offset) {
Type[] types1 = Type.getArgumentTypes(desc1);
Type[] types2 = Type.getArgumentTypes(desc2);
if (types2.length - types1.length != offset) {
return... | [
"@",
"Requires",
"(",
"{",
"\"desc1 != null\"",
",",
"\"desc2 != null\"",
",",
"\"offset >= 0\"",
"}",
")",
"private",
"boolean",
"descArgumentsMatch",
"(",
"String",
"desc1",
",",
"String",
"desc2",
",",
"int",
"offset",
")",
"{",
"Type",
"[",
"]",
"types1",
... | Returns {@code true} if the argument descriptors {@code desc1}
and {@code desc2} are equal (return type is ignored), ignoring
the last {@code offset} parameters of {@code desc2}. | [
"Returns",
"{"
] | train | https://github.com/konvergeio/cofoja/blob/6ded58fa05eb5bf85f16353c8dd4c70bee59121a/src/main/java/com/google/java/contract/core/agent/ContractAnalyzer.java#L195-L213 |
attribyte/acp | src/main/java/org/attribyte/sql/pool/TypesafeConfig.java | TypesafeConfig.initDrivers | static void initDrivers(final Config config) throws InitializationException {
"""
Initialize JDBC drivers from config.
@throws InitializationException if driver could not be initialized
"""
for(String driverName : uniquePrefixSet(config)) {
Config driverConfig = config.getObject(driverName).toC... | java | static void initDrivers(final Config config) throws InitializationException {
for(String driverName : uniquePrefixSet(config)) {
Config driverConfig = config.getObject(driverName).toConfig();
if(driverConfig.hasPath("class")) {
String className = driverConfig.getString("class");
... | [
"static",
"void",
"initDrivers",
"(",
"final",
"Config",
"config",
")",
"throws",
"InitializationException",
"{",
"for",
"(",
"String",
"driverName",
":",
"uniquePrefixSet",
"(",
"config",
")",
")",
"{",
"Config",
"driverConfig",
"=",
"config",
".",
"getObject",... | Initialize JDBC drivers from config.
@throws InitializationException if driver could not be initialized | [
"Initialize",
"JDBC",
"drivers",
"from",
"config",
"."
] | train | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/TypesafeConfig.java#L384-L398 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/RDBMEntityLockStore.java | RDBMEntityLockStore.findUnexpired | @Override
public IEntityLock[] findUnexpired(
Date expiration, Class entityType, String entityKey, Integer lockType, String lockOwner)
throws LockingException {
"""
Retrieve IEntityLocks from the underlying store. Expiration must not be null.
@param expiration Date
@param entityType... | java | @Override
public IEntityLock[] findUnexpired(
Date expiration, Class entityType, String entityKey, Integer lockType, String lockOwner)
throws LockingException {
Timestamp ts = new Timestamp(expiration.getTime());
return selectUnexpired(ts, entityType, entityKey, lockType, loc... | [
"@",
"Override",
"public",
"IEntityLock",
"[",
"]",
"findUnexpired",
"(",
"Date",
"expiration",
",",
"Class",
"entityType",
",",
"String",
"entityKey",
",",
"Integer",
"lockType",
",",
"String",
"lockOwner",
")",
"throws",
"LockingException",
"{",
"Timestamp",
"... | Retrieve IEntityLocks from the underlying store. Expiration must not be null.
@param expiration Date
@param entityType Class
@param entityKey String
@param lockType Integer - so we can accept a null value.
@param lockOwner String
@exception LockingException - wraps an Exception specific to the store. | [
"Retrieve",
"IEntityLocks",
"from",
"the",
"underlying",
"store",
".",
"Expiration",
"must",
"not",
"be",
"null",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/RDBMEntityLockStore.java#L200-L206 |
grails/grails-core | grails-core/src/main/groovy/org/grails/spring/RuntimeSpringConfigUtilities.java | RuntimeSpringConfigUtilities.loadExternalSpringConfig | public static void loadExternalSpringConfig(RuntimeSpringConfiguration config, final GrailsApplication application) {
"""
Loads any external Spring configuration into the given RuntimeSpringConfiguration object.
@param config The config instance
"""
if (springGroovyResourcesBeanBuilder == null) {
... | java | public static void loadExternalSpringConfig(RuntimeSpringConfiguration config, final GrailsApplication application) {
if (springGroovyResourcesBeanBuilder == null) {
try {
Class<?> groovySpringResourcesClass = null;
try {
groovySpringResourcesClass... | [
"public",
"static",
"void",
"loadExternalSpringConfig",
"(",
"RuntimeSpringConfiguration",
"config",
",",
"final",
"GrailsApplication",
"application",
")",
"{",
"if",
"(",
"springGroovyResourcesBeanBuilder",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">"... | Loads any external Spring configuration into the given RuntimeSpringConfiguration object.
@param config The config instance | [
"Loads",
"any",
"external",
"Spring",
"configuration",
"into",
"the",
"given",
"RuntimeSpringConfiguration",
"object",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/spring/RuntimeSpringConfigUtilities.java#L69-L93 |
osiam/connector4java | src/main/java/org/osiam/client/OsiamConnector.java | OsiamConnector.getMe | public User getMe(AccessToken accessToken, String... attributes) {
"""
Retrieves the User holding the given access token.
@param accessToken the OSIAM access token from for the current session
@param attributes the attributes that should be returned in the response. If none are given, all are returned
@retur... | java | public User getMe(AccessToken accessToken, String... attributes) {
return getUserService().getMe(accessToken, attributes);
} | [
"public",
"User",
"getMe",
"(",
"AccessToken",
"accessToken",
",",
"String",
"...",
"attributes",
")",
"{",
"return",
"getUserService",
"(",
")",
".",
"getMe",
"(",
"accessToken",
",",
"attributes",
")",
";",
"}"
] | Retrieves the User holding the given access token.
@param accessToken the OSIAM access token from for the current session
@param attributes the attributes that should be returned in the response. If none are given, all are returned
@return the actual logged in user
@throws UnauthorizedException if the req... | [
"Retrieves",
"the",
"User",
"holding",
"the",
"given",
"access",
"token",
"."
] | train | https://github.com/osiam/connector4java/blob/a5e6ae1e706f4889d662a069fe2f3bf8e3848d12/src/main/java/org/osiam/client/OsiamConnector.java#L292-L294 |
Ellzord/JALSE | src/main/java/jalse/entities/functions/Functions.java | Functions.validateEntityID | public static void validateEntityID(final EntityID id) {
"""
Validates an {@link EntityID} annotation is correctly formed.
@param id
ID to check.
"""
int changes = 0;
// Changed new UUID(m, l)
if (id.mostSigBits() != EntityID.DEFAULT_MOST_SIG_BITS
|| id.leastSigBits() != EntityID.DEFAULT_LEAST_SIG_BIT... | java | public static void validateEntityID(final EntityID id) {
int changes = 0;
// Changed new UUID(m, l)
if (id.mostSigBits() != EntityID.DEFAULT_MOST_SIG_BITS
|| id.leastSigBits() != EntityID.DEFAULT_LEAST_SIG_BITS) {
changes++;
}
// Changed fromString(n)
if (!EntityID.DEFAULT_NAME.equals(id.name())) {
c... | [
"public",
"static",
"void",
"validateEntityID",
"(",
"final",
"EntityID",
"id",
")",
"{",
"int",
"changes",
"=",
"0",
";",
"// Changed new UUID(m, l)",
"if",
"(",
"id",
".",
"mostSigBits",
"(",
")",
"!=",
"EntityID",
".",
"DEFAULT_MOST_SIG_BITS",
"||",
"id",
... | Validates an {@link EntityID} annotation is correctly formed.
@param id
ID to check. | [
"Validates",
"an",
"{",
"@link",
"EntityID",
"}",
"annotation",
"is",
"correctly",
"formed",
"."
] | train | https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/entities/functions/Functions.java#L321-L344 |
skyscreamer/JSONassert | src/main/java/org/skyscreamer/jsonassert/JSONAssert.java | JSONAssert.assertEquals | public static void assertEquals(String expectedStr, JSONArray actual, JSONCompareMode compareMode)
throws JSONException {
"""
Asserts that the JSONArray provided matches the expected string. If it isn't it throws an
{@link AssertionError}.
@param expectedStr Expected JSON string
@param actual JSO... | java | public static void assertEquals(String expectedStr, JSONArray actual, JSONCompareMode compareMode)
throws JSONException {
assertEquals("", expectedStr, actual, compareMode);
} | [
"public",
"static",
"void",
"assertEquals",
"(",
"String",
"expectedStr",
",",
"JSONArray",
"actual",
",",
"JSONCompareMode",
"compareMode",
")",
"throws",
"JSONException",
"{",
"assertEquals",
"(",
"\"\"",
",",
"expectedStr",
",",
"actual",
",",
"compareMode",
")... | Asserts that the JSONArray provided matches the expected string. If it isn't it throws an
{@link AssertionError}.
@param expectedStr Expected JSON string
@param actual JSONArray to compare
@param compareMode Specifies which comparison mode to use
@throws JSONException JSON parsing error | [
"Asserts",
"that",
"the",
"JSONArray",
"provided",
"matches",
"the",
"expected",
"string",
".",
"If",
"it",
"isn",
"t",
"it",
"throws",
"an",
"{",
"@link",
"AssertionError",
"}",
"."
] | train | https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java#L258-L261 |
bladecoder/blade-ink | src/main/java/com/bladecoder/ink/runtime/CallStack.java | CallStack.getTemporaryVariableWithName | public RTObject getTemporaryVariableWithName(String name, int contextIndex) {
"""
Get variable value, dereferencing a variable pointer if necessary
"""
if (contextIndex == -1)
contextIndex = getCurrentElementIndex() + 1;
Element contextElement = getCallStack().get(contextIndex - 1);
RTObject varValue... | java | public RTObject getTemporaryVariableWithName(String name, int contextIndex) {
if (contextIndex == -1)
contextIndex = getCurrentElementIndex() + 1;
Element contextElement = getCallStack().get(contextIndex - 1);
RTObject varValue = contextElement.temporaryVariables.get(name);
return varValue;
} | [
"public",
"RTObject",
"getTemporaryVariableWithName",
"(",
"String",
"name",
",",
"int",
"contextIndex",
")",
"{",
"if",
"(",
"contextIndex",
"==",
"-",
"1",
")",
"contextIndex",
"=",
"getCurrentElementIndex",
"(",
")",
"+",
"1",
";",
"Element",
"contextElement"... | Get variable value, dereferencing a variable pointer if necessary | [
"Get",
"variable",
"value",
"dereferencing",
"a",
"variable",
"pointer",
"if",
"necessary"
] | train | https://github.com/bladecoder/blade-ink/blob/930922099f7073f50f956479adaa3cbd47c70225/src/main/java/com/bladecoder/ink/runtime/CallStack.java#L249-L257 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/EncryptedPrivateKeyReader.java | EncryptedPrivateKeyReader.readPasswordProtectedPrivateKey | public static PrivateKey readPasswordProtectedPrivateKey(final File encryptedPrivateKeyFile,
final String password, final String algorithm)
throws IOException, NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeySpecException, InvalidKeyException, InvalidAlgorithmParameterException {
"""
Reads from t... | java | public static PrivateKey readPasswordProtectedPrivateKey(final File encryptedPrivateKeyFile,
final String password, final String algorithm)
throws IOException, NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeySpecException, InvalidKeyException, InvalidAlgorithmParameterException
{
byte[] encryptedPr... | [
"public",
"static",
"PrivateKey",
"readPasswordProtectedPrivateKey",
"(",
"final",
"File",
"encryptedPrivateKeyFile",
",",
"final",
"String",
"password",
",",
"final",
"String",
"algorithm",
")",
"throws",
"IOException",
",",
"NoSuchAlgorithmException",
",",
"NoSuchPaddin... | Reads from the given {@link File} that contains the password protected private key and
returns it
@param encryptedPrivateKeyFile
the file that contains the password protected private key
@param password
the password
@param algorithm
the algorithm
@return the {@link PrivateKey} object
@throws IOException
Signals that a... | [
"Reads",
"from",
"the",
"given",
"{",
"@link",
"File",
"}",
"that",
"contains",
"the",
"password",
"protected",
"private",
"key",
"and",
"returns",
"it"
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/EncryptedPrivateKeyReader.java#L138-L159 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamFilenameHelper.java | DatastreamFilenameHelper.getFilenameFromId | private static final String getFilenameFromId(String pid, String dsid, String MIMETYPE) throws Exception {
"""
Get filename from datastream id
@param pid
@param dsid
@param MIMETYPE
@return
@throws Exception
"""
return dsid;
} | java | private static final String getFilenameFromId(String pid, String dsid, String MIMETYPE) throws Exception {
return dsid;
} | [
"private",
"static",
"final",
"String",
"getFilenameFromId",
"(",
"String",
"pid",
",",
"String",
"dsid",
",",
"String",
"MIMETYPE",
")",
"throws",
"Exception",
"{",
"return",
"dsid",
";",
"}"
] | Get filename from datastream id
@param pid
@param dsid
@param MIMETYPE
@return
@throws Exception | [
"Get",
"filename",
"from",
"datastream",
"id"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamFilenameHelper.java#L362-L364 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/metadata/builder/HandlerChainInfoBuilder.java | HandlerChainInfoBuilder.buildHandlerChainsInfoFromAnnotation | public HandlerChainsInfo buildHandlerChainsInfoFromAnnotation(ClassInfo clzInfo, String seiClassName, InfoStore infoStore, QName portQName, QName serviceQName, String bindingID) {
"""
Get the handlerChainsInfo from @HandlerChain
@param clz
@param portQName
@param serviceQName
@param bindingID
@return
""... | java | public HandlerChainsInfo buildHandlerChainsInfoFromAnnotation(ClassInfo clzInfo, String seiClassName, InfoStore infoStore, QName portQName, QName serviceQName, String bindingID) {
HandlerChainsInfo chainsInfo = new HandlerChainsInfo();
HandlerChainAnnotation hcAnn = findHandlerChainAnnotation(clzInfo, ... | [
"public",
"HandlerChainsInfo",
"buildHandlerChainsInfoFromAnnotation",
"(",
"ClassInfo",
"clzInfo",
",",
"String",
"seiClassName",
",",
"InfoStore",
"infoStore",
",",
"QName",
"portQName",
",",
"QName",
"serviceQName",
",",
"String",
"bindingID",
")",
"{",
"HandlerChain... | Get the handlerChainsInfo from @HandlerChain
@param clz
@param portQName
@param serviceQName
@param bindingID
@return | [
"Get",
"the",
"handlerChainsInfo",
"from",
"@HandlerChain"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/metadata/builder/HandlerChainInfoBuilder.java#L162-L173 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBClient.java | CouchDBClient.setAggregatedValuesInResult | private void setAggregatedValuesInResult(List results, CouchDBQueryInterpreter interpreter, JsonArray array) {
"""
Sets the aggregated values in result.
@param results
the results
@param interpreter
the interpreter
@param array
the array
"""
for (JsonElement json : array)
{
... | java | private void setAggregatedValuesInResult(List results, CouchDBQueryInterpreter interpreter, JsonArray array)
{
for (JsonElement json : array)
{
JsonElement value = json.getAsJsonObject().get("value");
if (interpreter.getAggregationType().equals(CouchDBConstants.COUNT))
... | [
"private",
"void",
"setAggregatedValuesInResult",
"(",
"List",
"results",
",",
"CouchDBQueryInterpreter",
"interpreter",
",",
"JsonArray",
"array",
")",
"{",
"for",
"(",
"JsonElement",
"json",
":",
"array",
")",
"{",
"JsonElement",
"value",
"=",
"json",
".",
"ge... | Sets the aggregated values in result.
@param results
the results
@param interpreter
the interpreter
@param array
the array | [
"Sets",
"the",
"aggregated",
"values",
"in",
"result",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBClient.java#L976-L986 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/filters/Filter.java | Filter.apply | @SafeVarargs
public static <T> Collection<T> apply(Filter<T> filter, T ... elements) {
"""
Applies the given filter to the input and returns only those elements
that match it.
@param filter
a (possible compound) filter; elements in the input array matching the
filter will be returned.
@param elements
the ... | java | @SafeVarargs
public static <T> Collection<T> apply(Filter<T> filter, T ... elements) {
List<T> list = new ArrayList<T>();
if(elements != null) {
for(T element : elements) {
list.add(element);
}
}
return apply(filter, list);
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"apply",
"(",
"Filter",
"<",
"T",
">",
"filter",
",",
"T",
"...",
"elements",
")",
"{",
"List",
"<",
"T",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"("... | Applies the given filter to the input and returns only those elements
that match it.
@param filter
a (possible compound) filter; elements in the input array matching the
filter will be returned.
@param elements
the collection of objects to filter.
@return
a filtered set of elements. | [
"Applies",
"the",
"given",
"filter",
"to",
"the",
"input",
"and",
"returns",
"only",
"those",
"elements",
"that",
"match",
"it",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/filters/Filter.java#L39-L48 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/locking/RemoteLockMapImpl.java | RemoteLockMapImpl.setWriter | public boolean setWriter(TransactionImpl tx, Object obj) {
"""
generate a writer lock entry for transaction tx on object obj
and write it to the persistent storage.
"""
try
{
LockEntry lock = new LockEntry(new Identity(obj,getBroker()).toString(),
tx.getGUID(),
System.currentTimeMillis()... | java | public boolean setWriter(TransactionImpl tx, Object obj)
{
try
{
LockEntry lock = new LockEntry(new Identity(obj,getBroker()).toString(),
tx.getGUID(),
System.currentTimeMillis(),
LockStrategyFactory.getIsolationLevel(obj),
LockEntry.LOCK_WRITE);
setWriterRemote(lock);
retu... | [
"public",
"boolean",
"setWriter",
"(",
"TransactionImpl",
"tx",
",",
"Object",
"obj",
")",
"{",
"try",
"{",
"LockEntry",
"lock",
"=",
"new",
"LockEntry",
"(",
"new",
"Identity",
"(",
"obj",
",",
"getBroker",
"(",
")",
")",
".",
"toString",
"(",
")",
",... | generate a writer lock entry for transaction tx on object obj
and write it to the persistent storage. | [
"generate",
"a",
"writer",
"lock",
"entry",
"for",
"transaction",
"tx",
"on",
"object",
"obj",
"and",
"write",
"it",
"to",
"the",
"persistent",
"storage",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/locking/RemoteLockMapImpl.java#L381-L399 |
Squarespace/cldr | runtime/src/main/java/com/squarespace/cldr/LanguageMatcher.java | LanguageMatcher.matchImpl | private Match matchImpl(List<Entry> desiredLocales, int threshold) {
"""
Return the best match that exceeds the threshold, or the default.
If the default is returned its distance is set to MAX_DISTANCE.
An exact match has distance of 0.
"""
int bestDistance = MAX_DISTANCE;
Entry bestMatch = null;
... | java | private Match matchImpl(List<Entry> desiredLocales, int threshold) {
int bestDistance = MAX_DISTANCE;
Entry bestMatch = null;
for (Entry desired : desiredLocales) {
List<String> exact = exactMatch.get(desired.locale);
if (exact != null) {
return new Match(exact.get(0), 0);
}
... | [
"private",
"Match",
"matchImpl",
"(",
"List",
"<",
"Entry",
">",
"desiredLocales",
",",
"int",
"threshold",
")",
"{",
"int",
"bestDistance",
"=",
"MAX_DISTANCE",
";",
"Entry",
"bestMatch",
"=",
"null",
";",
"for",
"(",
"Entry",
"desired",
":",
"desiredLocale... | Return the best match that exceeds the threshold, or the default.
If the default is returned its distance is set to MAX_DISTANCE.
An exact match has distance of 0. | [
"Return",
"the",
"best",
"match",
"that",
"exceeds",
"the",
"threshold",
"or",
"the",
"default",
".",
"If",
"the",
"default",
"is",
"returned",
"its",
"distance",
"is",
"set",
"to",
"MAX_DISTANCE",
".",
"An",
"exact",
"match",
"has",
"distance",
"of",
"0",... | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/runtime/src/main/java/com/squarespace/cldr/LanguageMatcher.java#L158-L177 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/util/rawQuerying/RawQueryExecutor.java | RawQueryExecutor.ftsToRawCustom | public <T> T ftsToRawCustom(final SearchQuery query, final Func1<String, T> deserializer) {
"""
Synchronously perform a {@link SearchQuery} and apply a user function to deserialize the raw JSON
FTS response, which is represented as a {@link String}.
Note that the query is executed "as is", without any processi... | java | public <T> T ftsToRawCustom(final SearchQuery query, final Func1<String, T> deserializer) {
return Blocking.blockForSingle(async.ftsToRawCustom(query, deserializer), env.searchTimeout(), TimeUnit.MILLISECONDS);
} | [
"public",
"<",
"T",
">",
"T",
"ftsToRawCustom",
"(",
"final",
"SearchQuery",
"query",
",",
"final",
"Func1",
"<",
"String",
",",
"T",
">",
"deserializer",
")",
"{",
"return",
"Blocking",
".",
"blockForSingle",
"(",
"async",
".",
"ftsToRawCustom",
"(",
"que... | Synchronously perform a {@link SearchQuery} and apply a user function to deserialize the raw JSON
FTS response, which is represented as a {@link String}.
Note that the query is executed "as is", without any processing comparable to what is done in
{@link Bucket#query(SearchQuery)} (like enforcing a server side timeout... | [
"Synchronously",
"perform",
"a",
"{",
"@link",
"SearchQuery",
"}",
"and",
"apply",
"a",
"user",
"function",
"to",
"deserialize",
"the",
"raw",
"JSON",
"FTS",
"response",
"which",
"is",
"represented",
"as",
"a",
"{",
"@link",
"String",
"}",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/util/rawQuerying/RawQueryExecutor.java#L152-L154 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/PropertiesField.java | PropertiesField.updateOrigKey | public boolean updateOrigKey(Map<String,Object> propOrig, String strKey, String strOrigValue, String strNewValue, boolean bOrigChange) {
"""
Given the read, original, and current values for this key, update the original key value.
@param propOrig
@param strKey
@param strReadValue
@param strOrigValue
@param st... | java | public boolean updateOrigKey(Map<String,Object> propOrig, String strKey, String strOrigValue, String strNewValue, boolean bOrigChange)
{
if (((strNewValue != null) && (!strNewValue.equals(strOrigValue)))
|| ((strNewValue == null) && (strOrigValue != null)))
{ // If I am using t... | [
"public",
"boolean",
"updateOrigKey",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"propOrig",
",",
"String",
"strKey",
",",
"String",
"strOrigValue",
",",
"String",
"strNewValue",
",",
"boolean",
"bOrigChange",
")",
"{",
"if",
"(",
"(",
"(",
"strNewValue"... | Given the read, original, and current values for this key, update the original key value.
@param propOrig
@param strKey
@param strReadValue
@param strOrigValue
@param strNewValue
@param bOrigChange
@return | [
"Given",
"the",
"read",
"original",
"and",
"current",
"values",
"for",
"this",
"key",
"update",
"the",
"original",
"key",
"value",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/PropertiesField.java#L591-L603 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/listener/FallbackEventHandler.java | FallbackEventHandler.handleEventMessage | public String handleEventMessage(String message, Object msgdoc, Map<String,String> metaInfo)
throws EventHandlerException {
"""
The handler creates a standard error response message.
The status code and status message are set in the following
ways:
<ul>
<li>If the message cannot be parsed by the ge... | java | public String handleEventMessage(String message, Object msgdoc, Map<String,String> metaInfo)
throws EventHandlerException {
String msg;
int code;
if (msgdoc == null) {
msg = "failed to parse XML message";
code = ListenerHelper.RETURN_STATUS_NON_XML;
} ... | [
"public",
"String",
"handleEventMessage",
"(",
"String",
"message",
",",
"Object",
"msgdoc",
",",
"Map",
"<",
"String",
",",
"String",
">",
"metaInfo",
")",
"throws",
"EventHandlerException",
"{",
"String",
"msg",
";",
"int",
"code",
";",
"if",
"(",
"msgdoc"... | The handler creates a standard error response message.
The status code and status message are set in the following
ways:
<ul>
<li>If the message cannot be parsed by the generic XML Bean,
the status code is set to -2 and the status message is
status message "failed to parse XML message"</li>
<li>If there is no matching ... | [
"The",
"handler",
"creates",
"a",
"standard",
"error",
"response",
"message",
".",
"The",
"status",
"code",
"and",
"status",
"message",
"are",
"set",
"in",
"the",
"following",
"ways",
":",
"<ul",
">",
"<li",
">",
"If",
"the",
"message",
"cannot",
"be",
"... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/listener/FallbackEventHandler.java#L83-L109 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseAdvisorsInner.java | DatabaseAdvisorsInner.createOrUpdate | public AdvisorInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, String advisorName, AutoExecuteStatus autoExecuteValue) {
"""
Creates or updates a database advisor.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value ... | java | public AdvisorInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, String advisorName, AutoExecuteStatus autoExecuteValue) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, advisorName, autoExecuteValue).toBlocking().single().body();
... | [
"public",
"AdvisorInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"advisorName",
",",
"AutoExecuteStatus",
"autoExecuteValue",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsyn... | Creates or updates a database advisor.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param advisorName The name of ... | [
"Creates",
"or",
"updates",
"a",
"database",
"advisor",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseAdvisorsInner.java#L277-L279 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.sendUpgradeProposal | public Collection<ProposalResponse> sendUpgradeProposal(UpgradeProposalRequest upgradeProposalRequest) throws ProposalException, InvalidArgumentException {
"""
Send Upgrade proposal proposal to upgrade chaincode to a new version.
@param upgradeProposalRequest
@return Collection of proposal responses.
@throws ... | java | public Collection<ProposalResponse> sendUpgradeProposal(UpgradeProposalRequest upgradeProposalRequest) throws ProposalException, InvalidArgumentException {
return sendUpgradeProposal(upgradeProposalRequest, getChaincodePeers());
} | [
"public",
"Collection",
"<",
"ProposalResponse",
">",
"sendUpgradeProposal",
"(",
"UpgradeProposalRequest",
"upgradeProposalRequest",
")",
"throws",
"ProposalException",
",",
"InvalidArgumentException",
"{",
"return",
"sendUpgradeProposal",
"(",
"upgradeProposalRequest",
",",
... | Send Upgrade proposal proposal to upgrade chaincode to a new version.
@param upgradeProposalRequest
@return Collection of proposal responses.
@throws ProposalException
@throws InvalidArgumentException
@deprecated See new Lifecycle chaincode management. {@link Channel#sendLifecycleApproveChaincodeDefinitionForMyOrgPro... | [
"Send",
"Upgrade",
"proposal",
"proposal",
"to",
"upgrade",
"chaincode",
"to",
"a",
"new",
"version",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L2571-L2575 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/parallel/AbstractParallelVisualization.java | AbstractParallelVisualization.setupCanvas | public Element setupCanvas(SVGPlot svgp, ProjectionParallel proj, double width, double height) {
"""
Utility function to setup a canvas element for the visualization.
@param svgp Plot element
@param proj Projection to use
@param width Width
@param height Height
@return wrapper element with appropriate view ... | java | public Element setupCanvas(SVGPlot svgp, ProjectionParallel proj, double width, double height) {
Element layer = SVGUtil.svgElement(svgp.getDocument(), SVGConstants.SVG_G_TAG);
final String transform = SVGUtil.makeMarginTransform(width, height, size[0], size[1], margins[0], margins[1], margins[2], margins[3]);
... | [
"public",
"Element",
"setupCanvas",
"(",
"SVGPlot",
"svgp",
",",
"ProjectionParallel",
"proj",
",",
"double",
"width",
",",
"double",
"height",
")",
"{",
"Element",
"layer",
"=",
"SVGUtil",
".",
"svgElement",
"(",
"svgp",
".",
"getDocument",
"(",
")",
",",
... | Utility function to setup a canvas element for the visualization.
@param svgp Plot element
@param proj Projection to use
@param width Width
@param height Height
@return wrapper element with appropriate view box. | [
"Utility",
"function",
"to",
"setup",
"a",
"canvas",
"element",
"for",
"the",
"visualization",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/parallel/AbstractParallelVisualization.java#L107-L112 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/shared/environment/locale/LocaleFacet.java | LocaleFacet.createFor | public static LocaleFacet createFor(final String localeString, final Log log) throws MojoExecutionException {
"""
Helper method used to parse a locale configuration string into a Locale instance.
@param localeString A configuration string parameter on the form
{@code <language>[,<country>[,<vari... | java | public static LocaleFacet createFor(final String localeString, final Log log) throws MojoExecutionException {
// Check sanity
Validate.notNull(log, "log");
Validate.notEmpty(localeString, "localeString");
final StringTokenizer tok = new StringTokenizer(localeString, ",", false);
... | [
"public",
"static",
"LocaleFacet",
"createFor",
"(",
"final",
"String",
"localeString",
",",
"final",
"Log",
"log",
")",
"throws",
"MojoExecutionException",
"{",
"// Check sanity",
"Validate",
".",
"notNull",
"(",
"log",
",",
"\"log\"",
")",
";",
"Validate",
"."... | Helper method used to parse a locale configuration string into a Locale instance.
@param localeString A configuration string parameter on the form
{@code <language>[,<country>[,<variant>]]}
@param log The active Maven Log. Cannot be null.
@return A fully constructed Locale.
@throws MojoExecu... | [
"Helper",
"method",
"used",
"to",
"parse",
"a",
"locale",
"configuration",
"string",
"into",
"a",
"Locale",
"instance",
"."
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/environment/locale/LocaleFacet.java#L107-L127 |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.agentCreationFailed | protected void agentCreationFailed (ClientObject client, int agentId) {
"""
Callback for when the bureau client acknowledges the failure to create an agent.
"""
FoundAgent found = resolve(client, agentId, "agentCreationFailed");
if (found == null) {
return;
}
log.in... | java | protected void agentCreationFailed (ClientObject client, int agentId)
{
FoundAgent found = resolve(client, agentId, "agentCreationFailed");
if (found == null) {
return;
}
log.info("Agent creation failed", "agent", found.agent.which());
if (found.state == AgentSt... | [
"protected",
"void",
"agentCreationFailed",
"(",
"ClientObject",
"client",
",",
"int",
"agentId",
")",
"{",
"FoundAgent",
"found",
"=",
"resolve",
"(",
"client",
",",
"agentId",
",",
"\"agentCreationFailed\"",
")",
";",
"if",
"(",
"found",
"==",
"null",
")",
... | Callback for when the bureau client acknowledges the failure to create an agent. | [
"Callback",
"for",
"when",
"the",
"bureau",
"client",
"acknowledges",
"the",
"failure",
"to",
"create",
"an",
"agent",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L457-L479 |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java | MoskitoHttpServlet.init | @Override public void init(ServletConfig config) throws ServletException {
"""
Creates the stats objects. Registers the servlet at the ProducerRegistry.
"""
super.init(config);
getStats = new ServletStats("get", getMonitoringIntervals());
postStats = new ServletStats("post", getMonito... | java | @Override public void init(ServletConfig config) throws ServletException{
super.init(config);
getStats = new ServletStats("get", getMonitoringIntervals());
postStats = new ServletStats("post", getMonitoringIntervals());
putStats = new ServletStats("put", getMonitoringIntervals());
... | [
"@",
"Override",
"public",
"void",
"init",
"(",
"ServletConfig",
"config",
")",
"throws",
"ServletException",
"{",
"super",
".",
"init",
"(",
"config",
")",
";",
"getStats",
"=",
"new",
"ServletStats",
"(",
"\"get\"",
",",
"getMonitoringIntervals",
"(",
")",
... | Creates the stats objects. Registers the servlet at the ProducerRegistry. | [
"Creates",
"the",
"stats",
"objects",
".",
"Registers",
"the",
"servlet",
"at",
"the",
"ProducerRegistry",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java#L108-L133 |
redkale/redkale | src/org/redkale/util/ByteArray.java | ByteArray.find | public int find(int offset, int limit, byte value) {
"""
从指定的起始位置和长度查询value值出现的位置,没有返回-1
@param offset 起始位置
@param limit 长度限制
@param value 查询值
@return 所在位置
"""
byte[] bytes = this.content;
int end = limit > 0 ? limit : count;
for (int i = offset; i < end; i++) {
... | java | public int find(int offset, int limit, byte value) {
byte[] bytes = this.content;
int end = limit > 0 ? limit : count;
for (int i = offset; i < end; i++) {
if (bytes[i] == value) return i;
}
return -1;
} | [
"public",
"int",
"find",
"(",
"int",
"offset",
",",
"int",
"limit",
",",
"byte",
"value",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"this",
".",
"content",
";",
"int",
"end",
"=",
"limit",
">",
"0",
"?",
"limit",
":",
"count",
";",
"for",
"(",
... | 从指定的起始位置和长度查询value值出现的位置,没有返回-1
@param offset 起始位置
@param limit 长度限制
@param value 查询值
@return 所在位置 | [
"从指定的起始位置和长度查询value值出现的位置",
"没有返回",
"-",
"1"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/ByteArray.java#L213-L220 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerOutboundRulesInner.java | LoadBalancerOutboundRulesInner.listAsync | public Observable<Page<OutboundRuleInner>> listAsync(final String resourceGroupName, final String loadBalancerName) {
"""
Gets all the outbound rules in a load balancer.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@throws IllegalArgumentExcep... | java | public Observable<Page<OutboundRuleInner>> listAsync(final String resourceGroupName, final String loadBalancerName) {
return listWithServiceResponseAsync(resourceGroupName, loadBalancerName)
.map(new Func1<ServiceResponse<Page<OutboundRuleInner>>, Page<OutboundRuleInner>>() {
@Overri... | [
"public",
"Observable",
"<",
"Page",
"<",
"OutboundRuleInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"loadBalancerName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"loadBalan... | Gets all the outbound rules in a load balancer.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<OutboundRuleInner> object | [
"Gets",
"all",
"the",
"outbound",
"rules",
"in",
"a",
"load",
"balancer",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerOutboundRulesInner.java#L123-L131 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/ChatApi.java | ChatApi.sendSystemCommand | public ApiSuccessResponse sendSystemCommand(String id, SystemCommandData systemCommandData) throws ApiException {
"""
Send a system command
Send a system command to the specified chat.
@param id The ID of the chat interaction. (required)
@param systemCommandData Request parameters. (optional)
@return ApiSucces... | java | public ApiSuccessResponse sendSystemCommand(String id, SystemCommandData systemCommandData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = sendSystemCommandWithHttpInfo(id, systemCommandData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"sendSystemCommand",
"(",
"String",
"id",
",",
"SystemCommandData",
"systemCommandData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"sendSystemCommandWithHttpInfo",
"(",
"id",
",",
"sys... | Send a system command
Send a system command to the specified chat.
@param id The ID of the chat interaction. (required)
@param systemCommandData Request parameters. (optional)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Send",
"a",
"system",
"command",
"Send",
"a",
"system",
"command",
"to",
"the",
"specified",
"chat",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L1699-L1702 |
ben-manes/caffeine | caffeine/src/main/java/com/github/benmanes/caffeine/cache/CaffeineSpec.java | CaffeineSpec.durationInNanos | static long durationInNanos(long duration, @Nullable TimeUnit unit) {
"""
Converts an expiration duration/unit pair into a single long for hashing and equality.
"""
return (unit == null) ? UNSET_INT : unit.toNanos(duration);
} | java | static long durationInNanos(long duration, @Nullable TimeUnit unit) {
return (unit == null) ? UNSET_INT : unit.toNanos(duration);
} | [
"static",
"long",
"durationInNanos",
"(",
"long",
"duration",
",",
"@",
"Nullable",
"TimeUnit",
"unit",
")",
"{",
"return",
"(",
"unit",
"==",
"null",
")",
"?",
"UNSET_INT",
":",
"unit",
".",
"toNanos",
"(",
"duration",
")",
";",
"}"
] | Converts an expiration duration/unit pair into a single long for hashing and equality. | [
"Converts",
"an",
"expiration",
"duration",
"/",
"unit",
"pair",
"into",
"a",
"single",
"long",
"for",
"hashing",
"and",
"equality",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/caffeine/src/main/java/com/github/benmanes/caffeine/cache/CaffeineSpec.java#L361-L363 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/JIT_Tie.java | JIT_Tie.addFields | private static void addFields(ClassWriter cw, String servantDescriptor) {
"""
Defines the static and instance variables that are the same
for all Tie classes. <p>
<ul>
<li> private <remote class> target;
<li> private ORB orb;
<li> private static final String _type_ids[];
</ul>
The fields are NOT initial... | java | private static void addFields(ClassWriter cw, String servantDescriptor)
{
FieldVisitor fv;
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d576626
// -----------------------------------------------------------------------
// private <servant class> target;
... | [
"private",
"static",
"void",
"addFields",
"(",
"ClassWriter",
"cw",
",",
"String",
"servantDescriptor",
")",
"{",
"FieldVisitor",
"fv",
";",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"// d576626",
"// ------... | Defines the static and instance variables that are the same
for all Tie classes. <p>
<ul>
<li> private <remote class> target;
<li> private ORB orb;
<li> private static final String _type_ids[];
</ul>
The fields are NOT initialized. <p>
@param cw ASM ClassWriter to add the fields to.
@param servantDescriptor fully qu... | [
"Defines",
"the",
"static",
"and",
"instance",
"variables",
"that",
"are",
"the",
"same",
"for",
"all",
"Tie",
"classes",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/JIT_Tie.java#L259-L291 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/LocaleData.java | LocaleData.getPaperSize | public static final PaperSize getPaperSize(ULocale locale) {
"""
Returns the size of paper used in the locale. The paper sizes returned are always in
<em>milli-meters</em>.
@param locale The locale for which the measurement system to be retrieved.
@return The paper size used in the locale
"""
UResou... | java | public static final PaperSize getPaperSize(ULocale locale){
UResourceBundle obj = measurementTypeBundleForLocale(locale, PAPER_SIZE);
int[] size = obj.getIntVector();
return new PaperSize(size[0], size[1]);
} | [
"public",
"static",
"final",
"PaperSize",
"getPaperSize",
"(",
"ULocale",
"locale",
")",
"{",
"UResourceBundle",
"obj",
"=",
"measurementTypeBundleForLocale",
"(",
"locale",
",",
"PAPER_SIZE",
")",
";",
"int",
"[",
"]",
"size",
"=",
"obj",
".",
"getIntVector",
... | Returns the size of paper used in the locale. The paper sizes returned are always in
<em>milli-meters</em>.
@param locale The locale for which the measurement system to be retrieved.
@return The paper size used in the locale | [
"Returns",
"the",
"size",
"of",
"paper",
"used",
"in",
"the",
"locale",
".",
"The",
"paper",
"sizes",
"returned",
"are",
"always",
"in",
"<em",
">",
"milli",
"-",
"meters<",
"/",
"em",
">",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/LocaleData.java#L388-L392 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.removeByLtE_S | @Override
public void removeByLtE_S(Date expirationDate, int status) {
"""
Removes all the commerce discounts where expirationDate < ? and status = ? from the database.
@param expirationDate the expiration date
@param status the status
"""
for (CommerceDiscount commerceDiscount : findByLtE_S(... | java | @Override
public void removeByLtE_S(Date expirationDate, int status) {
for (CommerceDiscount commerceDiscount : findByLtE_S(expirationDate,
status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceDiscount);
}
} | [
"@",
"Override",
"public",
"void",
"removeByLtE_S",
"(",
"Date",
"expirationDate",
",",
"int",
"status",
")",
"{",
"for",
"(",
"CommerceDiscount",
"commerceDiscount",
":",
"findByLtE_S",
"(",
"expirationDate",
",",
"status",
",",
"QueryUtil",
".",
"ALL_POS",
","... | Removes all the commerce discounts where expirationDate < ? and status = ? from the database.
@param expirationDate the expiration date
@param status the status | [
"Removes",
"all",
"the",
"commerce",
"discounts",
"where",
"expirationDate",
"<",
";",
"?",
";",
"and",
"status",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L4423-L4429 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CProductPersistenceImpl.java | CProductPersistenceImpl.findByGroupId | @Override
public List<CProduct> findByGroupId(long groupId, int start, int end) {
"""
Returns a range of all the c products where groupId = ?.
<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... | java | @Override
public List<CProduct> findByGroupId(long groupId, int start, int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CProduct",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the c products where groupId = ?.
<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... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"c",
"products",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CProductPersistenceImpl.java#L1516-L1519 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/ses/SesClient.java | SesClient.sendEmail | public SendEmailResponse sendEmail(String from, String[] toAddr, String subject, String body,
File...attachmentFiles) {
"""
Send email.
<p>
Simple to send email without display name, all optional parameters use system default value.
@param from The sender, which is required
@param toAddr The rece... | java | public SendEmailResponse sendEmail(String from, String[] toAddr, String subject, String body,
File...attachmentFiles) {
return sendEmail(from, "", toAddr, subject, body, attachmentFiles);
} | [
"public",
"SendEmailResponse",
"sendEmail",
"(",
"String",
"from",
",",
"String",
"[",
"]",
"toAddr",
",",
"String",
"subject",
",",
"String",
"body",
",",
"File",
"...",
"attachmentFiles",
")",
"{",
"return",
"sendEmail",
"(",
"from",
",",
"\"\"",
",",
"t... | Send email.
<p>
Simple to send email without display name, all optional parameters use system default value.
@param from The sender, which is required
@param toAddr The receive, which is required
@param subject The title of the email, which is required
@param body The content of the email, which is required
@param att... | [
"Send",
"email",
".",
"<p",
">",
"Simple",
"to",
"send",
"email",
"without",
"display",
"name",
"all",
"optional",
"parameters",
"use",
"system",
"default",
"value",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/ses/SesClient.java#L402-L405 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/text/i18n/impl/DefaultTextResource.java | DefaultTextResource.getText | public String getText(String key, String defaultValue, Object... args) {
"""
<p>
getText.
</p>
@param key a {@link java.lang.String} object.
@param defaultValue a {@link java.lang.String} object.
@param args an array of {@link java.lang.Object} objects.
@return a {@link java.lang.String} object.
"""
... | java | public String getText(String key, String defaultValue, Object... args) {
String text = doGetText(key);
if (null == text) text = (null == defaultValue && keyAsDefault) ? key : defaultValue;
if (null != text && args.length > 0) return formater.format(text, locale, args);
return text;
} | [
"public",
"String",
"getText",
"(",
"String",
"key",
",",
"String",
"defaultValue",
",",
"Object",
"...",
"args",
")",
"{",
"String",
"text",
"=",
"doGetText",
"(",
"key",
")",
";",
"if",
"(",
"null",
"==",
"text",
")",
"text",
"=",
"(",
"null",
"=="... | <p>
getText.
</p>
@param key a {@link java.lang.String} object.
@param defaultValue a {@link java.lang.String} object.
@param args an array of {@link java.lang.Object} objects.
@return a {@link java.lang.String} object. | [
"<p",
">",
"getText",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/text/i18n/impl/DefaultTextResource.java#L63-L68 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.