repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 196 | func_name stringlengths 7 107 | whole_func_string stringlengths 76 3.82k | language stringclasses 1
value | func_code_string stringlengths 76 3.82k | func_code_tokens listlengths 22 717 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 508 | split_name stringclasses 1
value | func_code_url stringlengths 111 310 |
|---|---|---|---|---|---|---|---|---|---|---|
milaboratory/milib | src/main/java/com/milaboratory/core/alignment/BandedLinearAligner.java | BandedLinearAligner.alignLeftAdded | public static Alignment<NucleotideSequence> alignLeftAdded(LinearGapAlignmentScoring scoring, NucleotideSequence seq1, NucleotideSequence seq2,
int offset1, int length1, int addedNucleotides1, int offset2, int length2, int addedNucleotides2,
... | java | public static Alignment<NucleotideSequence> alignLeftAdded(LinearGapAlignmentScoring scoring, NucleotideSequence seq1, NucleotideSequence seq2,
int offset1, int length1, int addedNucleotides1, int offset2, int length2, int addedNucleotides2,
... | [
"public",
"static",
"Alignment",
"<",
"NucleotideSequence",
">",
"alignLeftAdded",
"(",
"LinearGapAlignmentScoring",
"scoring",
",",
"NucleotideSequence",
"seq1",
",",
"NucleotideSequence",
"seq2",
",",
"int",
"offset1",
",",
"int",
"length1",
",",
"int",
"addedNucleo... | Semi-semi-global alignment with artificially added letters.
<p>Alignment where second sequence is aligned to the left part of first sequence.</p>
<p>Whole second sequence must be highly similar to the first sequence, except last {@code width} letters, which
are to be checked whether they can improve alignment or not.... | [
"Semi",
"-",
"semi",
"-",
"global",
"alignment",
"with",
"artificially",
"added",
"letters",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/alignment/BandedLinearAligner.java#L596-L610 |
operasoftware/operaprestodriver | src/com/opera/core/systems/OperaWebElement.java | OperaWebElement.saveScreenshot | public String saveScreenshot(String filename, long timeout) {
return saveScreenshot(filename, timeout, true, new ArrayList<String>());
} | java | public String saveScreenshot(String filename, long timeout) {
return saveScreenshot(filename, timeout, true, new ArrayList<String>());
} | [
"public",
"String",
"saveScreenshot",
"(",
"String",
"filename",
",",
"long",
"timeout",
")",
"{",
"return",
"saveScreenshot",
"(",
"filename",
",",
"timeout",
",",
"true",
",",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
")",
";",
"}"
] | Take a screenshot of the area this element covers. Saves a copy of the image to the given
filename.
@param filename the location to save the screenshot
@param timeout the number of milliseconds to wait before taking the screenshot
@return the MD5 hash of the screenshot | [
"Take",
"a",
"screenshot",
"of",
"the",
"area",
"this",
"element",
"covers",
".",
"Saves",
"a",
"copy",
"of",
"the",
"image",
"to",
"the",
"given",
"filename",
"."
] | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaWebElement.java#L345-L347 |
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.queryByCreatedDate | public Iterable<DContact> queryByCreatedDate(Object parent, java.util.Date createdDate) {
return queryByField(parent, DContactMapper.Field.CREATEDDATE.getFieldName(), createdDate);
} | java | public Iterable<DContact> queryByCreatedDate(Object parent, java.util.Date createdDate) {
return queryByField(parent, DContactMapper.Field.CREATEDDATE.getFieldName(), createdDate);
} | [
"public",
"Iterable",
"<",
"DContact",
">",
"queryByCreatedDate",
"(",
"Object",
"parent",
",",
"java",
".",
"util",
".",
"Date",
"createdDate",
")",
"{",
"return",
"queryByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"CREATEDDATE",
".",
... | query-by method for field createdDate
@param createdDate the specified attribute
@return an Iterable of DContacts for the specified createdDate | [
"query",
"-",
"by",
"method",
"for",
"field",
"createdDate"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L142-L144 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.setProperty | @Nonnull
public BugInstance setProperty(String name, String value) {
BugProperty prop = lookupProperty(name);
if (prop != null) {
prop.setValue(value);
} else {
prop = new BugProperty(name, value);
addProperty(prop);
}
return this;
} | java | @Nonnull
public BugInstance setProperty(String name, String value) {
BugProperty prop = lookupProperty(name);
if (prop != null) {
prop.setValue(value);
} else {
prop = new BugProperty(name, value);
addProperty(prop);
}
return this;
} | [
"@",
"Nonnull",
"public",
"BugInstance",
"setProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"BugProperty",
"prop",
"=",
"lookupProperty",
"(",
"name",
")",
";",
"if",
"(",
"prop",
"!=",
"null",
")",
"{",
"prop",
".",
"setValue",
"(",... | Set value of given property.
@param name
name of the property to set
@param value
the value of the property
@return this object, so calls can be chained | [
"Set",
"value",
"of",
"given",
"property",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L711-L721 |
aws/aws-sdk-java | aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/InitiateAuthRequest.java | InitiateAuthRequest.withClientMetadata | public InitiateAuthRequest withClientMetadata(java.util.Map<String, String> clientMetadata) {
setClientMetadata(clientMetadata);
return this;
} | java | public InitiateAuthRequest withClientMetadata(java.util.Map<String, String> clientMetadata) {
setClientMetadata(clientMetadata);
return this;
} | [
"public",
"InitiateAuthRequest",
"withClientMetadata",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"clientMetadata",
")",
"{",
"setClientMetadata",
"(",
"clientMetadata",
")",
";",
"return",
"this",
";",
"}"
] | <p>
This is a random key-value pair map which can contain any key and will be passed to your PreAuthentication Lambda
trigger as-is. It can be used to implement additional validations around authentication.
</p>
@param clientMetadata
This is a random key-value pair map which can contain any key and will be passed to y... | [
"<p",
">",
"This",
"is",
"a",
"random",
"key",
"-",
"value",
"pair",
"map",
"which",
"can",
"contain",
"any",
"key",
"and",
"will",
"be",
"passed",
"to",
"your",
"PreAuthentication",
"Lambda",
"trigger",
"as",
"-",
"is",
".",
"It",
"can",
"be",
"used",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/InitiateAuthRequest.java#L946-L949 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.vps_serviceName_ip_GET | public ArrayList<String> vps_serviceName_ip_GET(String serviceName, OvhGeolocationEnum country, Long number) throws IOException {
String qPath = "/order/vps/{serviceName}/ip";
StringBuilder sb = path(qPath, serviceName);
query(sb, "country", country);
query(sb, "number", number);
String resp = exec(qPath, "GE... | java | public ArrayList<String> vps_serviceName_ip_GET(String serviceName, OvhGeolocationEnum country, Long number) throws IOException {
String qPath = "/order/vps/{serviceName}/ip";
StringBuilder sb = path(qPath, serviceName);
query(sb, "country", country);
query(sb, "number", number);
String resp = exec(qPath, "GE... | [
"public",
"ArrayList",
"<",
"String",
">",
"vps_serviceName_ip_GET",
"(",
"String",
"serviceName",
",",
"OvhGeolocationEnum",
"country",
",",
"Long",
"number",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/vps/{serviceName}/ip\"",
";",
"StringBu... | Get allowed durations for 'ip' option
REST: GET /order/vps/{serviceName}/ip
@param number [required] Number of IPs to order
@param country [required] Choose a geolocation for your IP Address
@param serviceName [required] The internal name of your VPS offer | [
"Get",
"allowed",
"durations",
"for",
"ip",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3400-L3407 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/ResourceBundleMessagesGenerator.java | ResourceBundleMessagesGenerator.addLinkedResources | protected void addLinkedResources(String path, GeneratorContext context) {
List<Locale> locales = new ArrayList<>();
Locale currentLocale = context.getLocale();
if (currentLocale != null) {
locales.add(currentLocale);
if (StringUtils.isNotEmpty(currentLocale.getVariant())) {
locales.add(new Locale(curre... | java | protected void addLinkedResources(String path, GeneratorContext context) {
List<Locale> locales = new ArrayList<>();
Locale currentLocale = context.getLocale();
if (currentLocale != null) {
locales.add(currentLocale);
if (StringUtils.isNotEmpty(currentLocale.getVariant())) {
locales.add(new Locale(curre... | [
"protected",
"void",
"addLinkedResources",
"(",
"String",
"path",
",",
"GeneratorContext",
"context",
")",
"{",
"List",
"<",
"Locale",
">",
"locales",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Locale",
"currentLocale",
"=",
"context",
".",
"getLocale",
... | Adds the linked resources
@param path
the resource path
@param context
the generator context | [
"Adds",
"the",
"linked",
"resources"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/ResourceBundleMessagesGenerator.java#L172-L195 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/MapIterate.java | MapIterate.getIfAbsent | public static <K, V> V getIfAbsent(Map<K, V> map, K key, Function0<? extends V> instanceBlock)
{
if (map instanceof UnsortedMapIterable)
{
return ((MapIterable<K, V>) map).getIfAbsent(key, instanceBlock);
}
V result = map.get(key);
if (MapIterate.isAbsent(result, ... | java | public static <K, V> V getIfAbsent(Map<K, V> map, K key, Function0<? extends V> instanceBlock)
{
if (map instanceof UnsortedMapIterable)
{
return ((MapIterable<K, V>) map).getIfAbsent(key, instanceBlock);
}
V result = map.get(key);
if (MapIterate.isAbsent(result, ... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"getIfAbsent",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"K",
"key",
",",
"Function0",
"<",
"?",
"extends",
"V",
">",
"instanceBlock",
")",
"{",
"if",
"(",
"map",
"instanceof",
"UnsortedMapIt... | Get and return the value in the Map that corresponds to the specified key, or if there is no value
at the key, return the result of evaluating the specified {@link Function0}. | [
"Get",
"and",
"return",
"the",
"value",
"in",
"the",
"Map",
"that",
"corresponds",
"to",
"the",
"specified",
"key",
"or",
"if",
"there",
"is",
"no",
"value",
"at",
"the",
"key",
"return",
"the",
"result",
"of",
"evaluating",
"the",
"specified",
"{"
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/MapIterate.java#L176-L188 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/LocalUnitsManager.java | LocalUnitsManager.replaceUnit | public static void replaceUnit(/*String group, String unitName, */ Unit newUnit) {
String group = newUnit.getGroup().getName(), unitName = newUnit.getName();
readWriteLock.writeLock().lock();
try {
//unitMap
List<Unit> unitList = unitMap.get(group);
unitList.r... | java | public static void replaceUnit(/*String group, String unitName, */ Unit newUnit) {
String group = newUnit.getGroup().getName(), unitName = newUnit.getName();
readWriteLock.writeLock().lock();
try {
//unitMap
List<Unit> unitList = unitMap.get(group);
unitList.r... | [
"public",
"static",
"void",
"replaceUnit",
"(",
"/*String group, String unitName, */",
"Unit",
"newUnit",
")",
"{",
"String",
"group",
"=",
"newUnit",
".",
"getGroup",
"(",
")",
".",
"getName",
"(",
")",
",",
"unitName",
"=",
"newUnit",
".",
"getName",
"(",
... | Dynamically change the unit collections. Currently we use this for aop. | [
"Dynamically",
"change",
"the",
"unit",
"collections",
".",
"Currently",
"we",
"use",
"this",
"for",
"aop",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/LocalUnitsManager.java#L129-L154 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getPetInfo | public void getPetInfo(int[] ids, Callback<List<Pet>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getPetInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | java | public void getPetInfo(int[] ids, Callback<List<Pet>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getPetInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getPetInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Pet",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids",
")",
... | For more info on pets API go <a href="https://wiki.guildwars2.com/wiki/API:2/pets">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of pet id
@param callback callback that is going to b... | [
"For",
"more",
"info",
"on",
"pets",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"pets",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
"the",... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1963-L1966 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WContentRenderer.java | WContentRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WContent content = (WContent) component;
XmlStringBuilder xml = renderContext.getWriter();
if (!content.isDisplayRequested()) {
// This is the normal situation.
return;
}
Object contentAccess = conte... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WContent content = (WContent) component;
XmlStringBuilder xml = renderContext.getWriter();
if (!content.isDisplayRequested()) {
// This is the normal situation.
return;
}
Object contentAccess = conte... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WContent",
"content",
"=",
"(",
"WContent",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderConte... | <p>
Paints the given WContent.</p>
<p>
This paint method outputs a popup that opens browser window in which the content document will be displayed. The
component is only rendered for requests in which the display() method of the content component has just been
called.</p>
<p>
WContent's handleRequest() method will re... | [
"<p",
">",
"Paints",
"the",
"given",
"WContent",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WContentRenderer.java#L39-L77 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.getMessageList | public MessageListResult getMessageList(int count, String begin_time, String end_time)
throws APIConnectionException, APIRequestException {
return _messageClient.getMessageList(count, begin_time, end_time);
} | java | public MessageListResult getMessageList(int count, String begin_time, String end_time)
throws APIConnectionException, APIRequestException {
return _messageClient.getMessageList(count, begin_time, end_time);
} | [
"public",
"MessageListResult",
"getMessageList",
"(",
"int",
"count",
",",
"String",
"begin_time",
",",
"String",
"end_time",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_messageClient",
".",
"getMessageList",
"(",
"count",
","... | Get message list from history, messages will store 60 days.
@param count Necessary parameter. The count of the message list.
@param begin_time Necessary parameter. The format must follow by 'yyyy-MM-dd HH:mm:ss'
@param end_time Necessary parameter. The format must follow by 'yyyy-MM-dd HH:mm:ss'
@return MessageListResu... | [
"Get",
"message",
"list",
"from",
"history",
"messages",
"will",
"store",
"60",
"days",
"."
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L500-L503 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/util/TypedProperties.java | TypedProperties.putIfAbsent | public synchronized TypedProperties putIfAbsent(String key, String value) {
if (getProperty(key) == null) {
put(key, value);
}
return this;
} | java | public synchronized TypedProperties putIfAbsent(String key, String value) {
if (getProperty(key) == null) {
put(key, value);
}
return this;
} | [
"public",
"synchronized",
"TypedProperties",
"putIfAbsent",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"getProperty",
"(",
"key",
")",
"==",
"null",
")",
"{",
"put",
"(",
"key",
",",
"value",
")",
";",
"}",
"return",
"this",
";"... | Put a value if the associated key is not present
@param key new key
@param value new value
@return this TypedProperties instance for method chaining | [
"Put",
"a",
"value",
"if",
"the",
"associated",
"key",
"is",
"not",
"present",
"@param",
"key",
"new",
"key",
"@param",
"value",
"new",
"value",
"@return",
"this",
"TypedProperties",
"instance",
"for",
"method",
"chaining"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/TypedProperties.java#L162-L167 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java | ConfigValidator.checkCacheConfig | public static void checkCacheConfig(CacheSimpleConfig cacheSimpleConfig, CacheMergePolicyProvider mergePolicyProvider) {
checkCacheConfig(cacheSimpleConfig.getInMemoryFormat(), cacheSimpleConfig.getEvictionConfig(),
cacheSimpleConfig.getMergePolicy(), cacheSimpleConfig, mergePolicyProvider);
... | java | public static void checkCacheConfig(CacheSimpleConfig cacheSimpleConfig, CacheMergePolicyProvider mergePolicyProvider) {
checkCacheConfig(cacheSimpleConfig.getInMemoryFormat(), cacheSimpleConfig.getEvictionConfig(),
cacheSimpleConfig.getMergePolicy(), cacheSimpleConfig, mergePolicyProvider);
... | [
"public",
"static",
"void",
"checkCacheConfig",
"(",
"CacheSimpleConfig",
"cacheSimpleConfig",
",",
"CacheMergePolicyProvider",
"mergePolicyProvider",
")",
"{",
"checkCacheConfig",
"(",
"cacheSimpleConfig",
".",
"getInMemoryFormat",
"(",
")",
",",
"cacheSimpleConfig",
".",
... | Validates the given {@link CacheSimpleConfig}.
@param cacheSimpleConfig the {@link CacheSimpleConfig} to check
@param mergePolicyProvider the {@link CacheMergePolicyProvider} to resolve merge policy classes | [
"Validates",
"the",
"given",
"{",
"@link",
"CacheSimpleConfig",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java#L319-L322 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/common/service/SystemMessages.java | SystemMessages.bulletinOff | public static void bulletinOff(Bulletin bulletin, Level level, String message) {
if (bulletin == null)
return;
synchronized (bulletins) {
bulletins.remove(bulletin.getId(), bulletin);
}
try {
WebSocketMessenger.getInstance().send("SystemMessage", bulle... | java | public static void bulletinOff(Bulletin bulletin, Level level, String message) {
if (bulletin == null)
return;
synchronized (bulletins) {
bulletins.remove(bulletin.getId(), bulletin);
}
try {
WebSocketMessenger.getInstance().send("SystemMessage", bulle... | [
"public",
"static",
"void",
"bulletinOff",
"(",
"Bulletin",
"bulletin",
",",
"Level",
"level",
",",
"String",
"message",
")",
"{",
"if",
"(",
"bulletin",
"==",
"null",
")",
"return",
";",
"synchronized",
"(",
"bulletins",
")",
"{",
"bulletins",
".",
"remov... | Should be the same instance or have the same id as the bulletinOn message. | [
"Should",
"be",
"the",
"same",
"instance",
"or",
"have",
"the",
"same",
"id",
"as",
"the",
"bulletinOn",
"message",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/common/service/SystemMessages.java#L76-L88 |
uber/NullAway | nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java | ErrorBuilder.createErrorDescriptionForNullAssignment | Description createErrorDescriptionForNullAssignment(
ErrorMessage errorMessage,
@Nullable Tree suggestTreeIfCastToNonNull,
@Nullable TreePath suggestTreePathIfSuppression,
Description.Builder descriptionBuilder) {
final Tree enclosingSuppressTree = suppressibleNode(suggestTreePathIfSuppressi... | java | Description createErrorDescriptionForNullAssignment(
ErrorMessage errorMessage,
@Nullable Tree suggestTreeIfCastToNonNull,
@Nullable TreePath suggestTreePathIfSuppression,
Description.Builder descriptionBuilder) {
final Tree enclosingSuppressTree = suppressibleNode(suggestTreePathIfSuppressi... | [
"Description",
"createErrorDescriptionForNullAssignment",
"(",
"ErrorMessage",
"errorMessage",
",",
"@",
"Nullable",
"Tree",
"suggestTreeIfCastToNonNull",
",",
"@",
"Nullable",
"TreePath",
"suggestTreePathIfSuppression",
",",
"Description",
".",
"Builder",
"descriptionBuilder",... | create an error description for a generalized @Nullable value to @NonNull location assignment.
<p>This includes: field assignments, method arguments and method returns
@param errorMessage the error message object.
@param suggestTreeIfCastToNonNull the location at which a fix suggestion should be made if a
castToNonNu... | [
"create",
"an",
"error",
"description",
"for",
"a",
"generalized",
"@Nullable",
"value",
"to",
"@NonNull",
"location",
"assignment",
"."
] | train | https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java#L147-L158 |
bingoohuang/westcache | src/main/java/com/github/bingoohuang/westcache/utils/Methods.java | Methods.getAllMethodsInHierarchy | public static Set<Method> getAllMethodsInHierarchy(Method method) {
LinkedHashSet<Method> allMethods = new LinkedHashSet<>();
val declaringClass = method.getDeclaringClass();
return getAllMethodsInHierarchy(allMethods, declaringClass, method);
} | java | public static Set<Method> getAllMethodsInHierarchy(Method method) {
LinkedHashSet<Method> allMethods = new LinkedHashSet<>();
val declaringClass = method.getDeclaringClass();
return getAllMethodsInHierarchy(allMethods, declaringClass, method);
} | [
"public",
"static",
"Set",
"<",
"Method",
">",
"getAllMethodsInHierarchy",
"(",
"Method",
"method",
")",
"{",
"LinkedHashSet",
"<",
"Method",
">",
"allMethods",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"val",
"declaringClass",
"=",
"method",
".",
"g... | /*
Gets an array of all methods in a class hierarchy walking up to parent classes | [
"/",
"*",
"Gets",
"an",
"array",
"of",
"all",
"methods",
"in",
"a",
"class",
"hierarchy",
"walking",
"up",
"to",
"parent",
"classes"
] | train | https://github.com/bingoohuang/westcache/blob/09842bf0b9299abe75551c4b51d326fcc96da42d/src/main/java/com/github/bingoohuang/westcache/utils/Methods.java#L28-L32 |
openengsb/openengsb | connector/userprojectsfile/src/main/java/org/openengsb/connector/userprojects/file/internal/file/AssignmentFileAccessObject.java | AssignmentFileAccessObject.findAllAssignments | public List<Assignment> findAllAssignments() {
List<Assignment> list = new ArrayList<>();
List<String> assignmentStrings;
try {
assignmentStrings = readLines(assignmentsFile);
} catch (IOException e) {
throw new FileBasedRuntimeException(e);
}
for... | java | public List<Assignment> findAllAssignments() {
List<Assignment> list = new ArrayList<>();
List<String> assignmentStrings;
try {
assignmentStrings = readLines(assignmentsFile);
} catch (IOException e) {
throw new FileBasedRuntimeException(e);
}
for... | [
"public",
"List",
"<",
"Assignment",
">",
"findAllAssignments",
"(",
")",
"{",
"List",
"<",
"Assignment",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"String",
">",
"assignmentStrings",
";",
"try",
"{",
"assignmentStrings",
"=",... | Finds all the available assignments.
@return the list of available assignments | [
"Finds",
"all",
"the",
"available",
"assignments",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/connector/userprojectsfile/src/main/java/org/openengsb/connector/userprojects/file/internal/file/AssignmentFileAccessObject.java#L45-L71 |
GwtMaterialDesign/gwt-material-addins | src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java | MaterialComboBox.setSingleValue | public void setSingleValue(T value, boolean fireEvents) {
int index = this.values.indexOf(value);
if (index < 0 && value instanceof String) {
index = getIndexByString((String) value);
}
if (index > -1) {
List<T> before = getValue();
setSelectedIndex(i... | java | public void setSingleValue(T value, boolean fireEvents) {
int index = this.values.indexOf(value);
if (index < 0 && value instanceof String) {
index = getIndexByString((String) value);
}
if (index > -1) {
List<T> before = getValue();
setSelectedIndex(i... | [
"public",
"void",
"setSingleValue",
"(",
"T",
"value",
",",
"boolean",
"fireEvents",
")",
"{",
"int",
"index",
"=",
"this",
".",
"values",
".",
"indexOf",
"(",
"value",
")",
";",
"if",
"(",
"index",
"<",
"0",
"&&",
"value",
"instanceof",
"String",
")",... | Set the selected value using a single item, generally used
in single selection mode. | [
"Set",
"the",
"selected",
"value",
"using",
"a",
"single",
"item",
"generally",
"used",
"in",
"single",
"selection",
"mode",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java#L533-L547 |
Steveice10/OpenNBT | src/main/java/com/github/steveice10/opennbt/NBTIO.java | NBTIO.writeTag | public static void writeTag(DataOutput out, Tag tag) throws IOException {
out.writeByte(TagRegistry.getIdFor(tag.getClass()));
out.writeUTF(tag.getName());
tag.write(out);
} | java | public static void writeTag(DataOutput out, Tag tag) throws IOException {
out.writeByte(TagRegistry.getIdFor(tag.getClass()));
out.writeUTF(tag.getName());
tag.write(out);
} | [
"public",
"static",
"void",
"writeTag",
"(",
"DataOutput",
"out",
",",
"Tag",
"tag",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeByte",
"(",
"TagRegistry",
".",
"getIdFor",
"(",
"tag",
".",
"getClass",
"(",
")",
")",
")",
";",
"out",
".",
"wri... | Writes an NBT tag.
@param out Data output to write to.
@param tag Tag to write.
@throws java.io.IOException If an I/O error occurs. | [
"Writes",
"an",
"NBT",
"tag",
"."
] | train | https://github.com/Steveice10/OpenNBT/blob/9bf4adb2afd206a21bc4309c85d642494d1fb536/src/main/java/com/github/steveice10/opennbt/NBTIO.java#L227-L231 |
jenkinsci/pipeline-maven-plugin | jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/InvokerRunsPublisher.java | InvokerRunsPublisher.process | @Override
public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsElt) throws IOException, InterruptedException {
TaskListener listener = context.get(TaskListener.class);
if (listener == null) {
LOGGER.warning("TaskListener is NULL, default to stderr");
... | java | @Override
public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsElt) throws IOException, InterruptedException {
TaskListener listener = context.get(TaskListener.class);
if (listener == null) {
LOGGER.warning("TaskListener is NULL, default to stderr");
... | [
"@",
"Override",
"public",
"void",
"process",
"(",
"@",
"Nonnull",
"StepContext",
"context",
",",
"@",
"Nonnull",
"Element",
"mavenSpyLogsElt",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"TaskListener",
"listener",
"=",
"context",
".",
"get",
... | /*
<ExecutionEvent type="MojoSucceeded" class="org.apache.maven.lifecycle.internal.DefaultExecutionEvent" _time="2017-06-25 20:47:25.741">
<project baseDir="/home/jenkins/workspace/aProject" file="/home/jenkins/workspace/aProject/pom.xml" groupId="org.myorg" name="My Project" artifactId="my-maven-plugin" version="1.0.0... | [
"/",
"*",
"<ExecutionEvent",
"type",
"=",
"MojoSucceeded",
"class",
"=",
"org",
".",
"apache",
".",
"maven",
".",
"lifecycle",
".",
"internal",
".",
"DefaultExecutionEvent",
"_time",
"=",
"2017",
"-",
"06",
"-",
"25",
"20",
":",
"47",
":",
"25",
".",
"... | train | https://github.com/jenkinsci/pipeline-maven-plugin/blob/685d7dbb894fb4c976dbfa922e3caba8e8d5bed8/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/InvokerRunsPublisher.java#L79-L112 |
mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyFooterItemRangeChanged | public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCount... | java | public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCount... | [
"public",
"final",
"void",
"notifyFooterItemRangeChanged",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
"||",
"positionStart",
"+",
"itemCount",
">",
"footerItemCount",
")",
... | Notifies that multiple footer items are changed.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"footer",
"items",
"are",
"changed",
"."
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L361-L368 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java | DatatypeConverter.parseDurationInThousanthsOfMinutes | public static final Duration parseDurationInThousanthsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit)
{
return parseDurationInFractionsOfMinutes(properties, value, targetTimeUnit, 1000);
} | java | public static final Duration parseDurationInThousanthsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit)
{
return parseDurationInFractionsOfMinutes(properties, value, targetTimeUnit, 1000);
} | [
"public",
"static",
"final",
"Duration",
"parseDurationInThousanthsOfMinutes",
"(",
"ProjectProperties",
"properties",
",",
"Number",
"value",
",",
"TimeUnit",
"targetTimeUnit",
")",
"{",
"return",
"parseDurationInFractionsOfMinutes",
"(",
"properties",
",",
"value",
",",... | Parse duration represented in thousandths of minutes.
@param properties project properties
@param value duration value
@param targetTimeUnit required output time units
@return Duration instance | [
"Parse",
"duration",
"represented",
"in",
"thousandths",
"of",
"minutes",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1309-L1312 |
aol/micro-server | micro-s3/src/main/java/com/oath/micro/server/s3/data/ReadUtils.java | ReadUtils.getInputStream | public InputStream getInputStream(String bucketName, String key)
throws AmazonServiceException, AmazonClientException, InterruptedException, IOException {
Supplier<File> tempFileSupplier = ExceptionSoftener.softenSupplier(() -> Files.createTempFile(FileSystems.getDefault()
... | java | public InputStream getInputStream(String bucketName, String key)
throws AmazonServiceException, AmazonClientException, InterruptedException, IOException {
Supplier<File> tempFileSupplier = ExceptionSoftener.softenSupplier(() -> Files.createTempFile(FileSystems.getDefault()
... | [
"public",
"InputStream",
"getInputStream",
"(",
"String",
"bucketName",
",",
"String",
"key",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
",",
"InterruptedException",
",",
"IOException",
"{",
"Supplier",
"<",
"File",
">",
"tempFileSupplier",
... | Method returns InputStream from S3Object. Multi-part download is used to
get file. s3.tmp.dir property used to store temporary files.
@param bucketName
@param key
@return
@throws AmazonServiceException
@throws AmazonClientException
@throws InterruptedException
@throws IOException | [
"Method",
"returns",
"InputStream",
"from",
"S3Object",
".",
"Multi",
"-",
"part",
"download",
"is",
"used",
"to",
"get",
"file",
".",
"s3",
".",
"tmp",
".",
"dir",
"property",
"used",
"to",
"store",
"temporary",
"files",
"."
] | train | https://github.com/aol/micro-server/blob/5c7103c5b43d2f4d16350dbd2f9802af307c63f7/micro-s3/src/main/java/com/oath/micro/server/s3/data/ReadUtils.java#L68-L76 |
ysc/HtmlExtractor | html-extractor/src/main/java/org/apdplat/extractor/html/impl/ExtractFunctionExecutor.java | ExtractFunctionExecutor.executeSubstring | public static String executeSubstring(String text, String parseExpression) {
LOGGER.debug("substring抽取函数之前:" + text);
String parameter = parseExpression.replace("substring(", "");
parameter = parameter.substring(0, parameter.length() - 1);
String[] attr = parameter.split(",");
if... | java | public static String executeSubstring(String text, String parseExpression) {
LOGGER.debug("substring抽取函数之前:" + text);
String parameter = parseExpression.replace("substring(", "");
parameter = parameter.substring(0, parameter.length() - 1);
String[] attr = parameter.split(",");
if... | [
"public",
"static",
"String",
"executeSubstring",
"(",
"String",
"text",
",",
"String",
"parseExpression",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"substring抽取函数之前:\" + text);",
"",
"",
"",
"",
"String",
"parameter",
"=",
"parseExpression",
".",
"replace",
"(",... | 截取指定范围的文本 使用方法:substring(0,19)
括号内的参数为2个,分别是字符索引下标,截取从0开始到19的字符串,索引包括0,不包括19,即[0 - 19)
@param text CSS路径抽取出来的文本
@param parseExpression 抽取函数
@return 抽取函数处理之后的文本 | [
"截取指定范围的文本",
"使用方法:substring",
"(",
"0",
"19",
")",
"括号内的参数为2个,分别是字符索引下标,截取从0开始到19的字符串,索引包括0,不包括19",
"即",
"[",
"0",
"-",
"19",
")"
] | train | https://github.com/ysc/HtmlExtractor/blob/5378bc5f94138562c55506cf81de1ffe72ab701e/html-extractor/src/main/java/org/apdplat/extractor/html/impl/ExtractFunctionExecutor.java#L74-L86 |
Azure/azure-sdk-for-java | iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java | AppsInner.beginUpdateAsync | public Observable<AppInner> beginUpdateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch).map(new Func1<ServiceResponse<AppInner>, AppInner>() {
@Override
public AppInner call(Ser... | java | public Observable<AppInner> beginUpdateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch).map(new Func1<ServiceResponse<AppInner>, AppInner>() {
@Override
public AppInner call(Ser... | [
"public",
"Observable",
"<",
"AppInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"AppPatch",
"appPatch",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",... | Update the metadata of an IoT Central application.
@param resourceGroupName The name of the resource group that contains the IoT Central application.
@param resourceName The ARM resource name of the IoT Central application.
@param appPatch The IoT Central application metadata and security metadata.
@throws IllegalArgu... | [
"Update",
"the",
"metadata",
"of",
"an",
"IoT",
"Central",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java#L495-L502 |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/ApplicationManager.java | ApplicationManager.modified | @Modified
protected void modified(ComponentContext compcontext, Map<String, Object> properties) {
Boolean autoExpandValue = (Boolean) properties.get("autoExpand");
setExpandApps(autoExpandValue == null ? false : autoExpandValue);
Boolean useJandexValue = getProperty(properties, "useJandex",... | java | @Modified
protected void modified(ComponentContext compcontext, Map<String, Object> properties) {
Boolean autoExpandValue = (Boolean) properties.get("autoExpand");
setExpandApps(autoExpandValue == null ? false : autoExpandValue);
Boolean useJandexValue = getProperty(properties, "useJandex",... | [
"@",
"Modified",
"protected",
"void",
"modified",
"(",
"ComponentContext",
"compcontext",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"Boolean",
"autoExpandValue",
"=",
"(",
"Boolean",
")",
"properties",
".",
"get",
"(",
"\"autoExpan... | DS method to modify the configuration of this component
@param compcontext the context of this component
@param properties the updated configuration properties | [
"DS",
"method",
"to",
"modify",
"the",
"configuration",
"of",
"this",
"component"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/ApplicationManager.java#L53-L68 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/appdev/AppPackageUrl.java | AppPackageUrl.clonePackageUrl | public static MozuUrl clonePackageUrl(String applicationKey, String packageName, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/appdev/apppackages/{applicationKey}/clone/{packageName}?responseFields={responseFields}");
formatter.formatUrl("applicationKey", applicationKey);
... | java | public static MozuUrl clonePackageUrl(String applicationKey, String packageName, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/appdev/apppackages/{applicationKey}/clone/{packageName}?responseFields={responseFields}");
formatter.formatUrl("applicationKey", applicationKey);
... | [
"public",
"static",
"MozuUrl",
"clonePackageUrl",
"(",
"String",
"applicationKey",
",",
"String",
"packageName",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/appdev/apppackages/{applicationKey}/clo... | Get Resource Url for ClonePackage
@param applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
@param packageName
@param responseFields Filtering syn... | [
"Get",
"Resource",
"Url",
"for",
"ClonePackage"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/appdev/AppPackageUrl.java#L115-L122 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.getCertificate | public static Certificate getCertificate(KeyStore keyStore, String alias) {
return KeyUtil.getCertificate(keyStore, alias);
} | java | public static Certificate getCertificate(KeyStore keyStore, String alias) {
return KeyUtil.getCertificate(keyStore, alias);
} | [
"public",
"static",
"Certificate",
"getCertificate",
"(",
"KeyStore",
"keyStore",
",",
"String",
"alias",
")",
"{",
"return",
"KeyUtil",
".",
"getCertificate",
"(",
"keyStore",
",",
"alias",
")",
";",
"}"
] | 获得 Certification
@param keyStore {@link KeyStore}
@param alias 别名
@return {@link Certificate} | [
"获得",
"Certification"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L388-L390 |
Azure/azure-sdk-for-java | policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyAssignmentsInner.java | PolicyAssignmentsInner.createAsync | public Observable<PolicyAssignmentInner> createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) {
return createWithServiceResponseAsync(scope, policyAssignmentName, parameters).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Overrid... | java | public Observable<PolicyAssignmentInner> createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) {
return createWithServiceResponseAsync(scope, policyAssignmentName, parameters).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Overrid... | [
"public",
"Observable",
"<",
"PolicyAssignmentInner",
">",
"createAsync",
"(",
"String",
"scope",
",",
"String",
"policyAssignmentName",
",",
"PolicyAssignmentInner",
"parameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"scope",
",",
"policyAssignmentN... | Creates a policy assignment.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group.
@param scope The scope of the policy assignment.
@param policyAssignmentName The name of the policy assignment.
@param parame... | [
"Creates",
"a",
"policy",
"assignment",
".",
"Policy",
"assignments",
"are",
"inherited",
"by",
"child",
"resources",
".",
"For",
"example",
"when",
"you",
"apply",
"a",
"policy",
"to",
"a",
"resource",
"group",
"that",
"policy",
"is",
"assigned",
"to",
"all... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyAssignmentsInner.java#L241-L248 |
GoogleCloudPlatform/google-cloud-datastore | java/datastore/src/main/java/com/google/datastore/v1/client/DatastoreHelper.java | DatastoreHelper.getServiceAccountCredential | public static Credential getServiceAccountCredential(String serviceAccountId,
PrivateKey privateKey, Collection<String> serviceAccountScopes)
throws GeneralSecurityException, IOException {
return getCredentialBuilderWithoutPrivateKey(serviceAccountId, serviceAccountScopes)
.setServiceAccountPriv... | java | public static Credential getServiceAccountCredential(String serviceAccountId,
PrivateKey privateKey, Collection<String> serviceAccountScopes)
throws GeneralSecurityException, IOException {
return getCredentialBuilderWithoutPrivateKey(serviceAccountId, serviceAccountScopes)
.setServiceAccountPriv... | [
"public",
"static",
"Credential",
"getServiceAccountCredential",
"(",
"String",
"serviceAccountId",
",",
"PrivateKey",
"privateKey",
",",
"Collection",
"<",
"String",
">",
"serviceAccountScopes",
")",
"throws",
"GeneralSecurityException",
",",
"IOException",
"{",
"return"... | Constructs credentials for the given account and key.
@param serviceAccountId service account ID (typically an e-mail address).
@param privateKey the private key for the given account.
@param serviceAccountScopes Collection of OAuth scopes to use with the the service
account flow or {@code null} if not.
@return valid ... | [
"Constructs",
"credentials",
"for",
"the",
"given",
"account",
"and",
"key",
"."
] | train | https://github.com/GoogleCloudPlatform/google-cloud-datastore/blob/a23940d0634d7f537faf01ad9e60598046bcb40a/java/datastore/src/main/java/com/google/datastore/v1/client/DatastoreHelper.java#L194-L200 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/TextBuilder.java | TextBuilder.styledLink | public TextBuilder styledLink(final String text, final TextStyle ts, final String ref) {
this.curParagraphBuilder.styledLink(text, ts, ref);
return this;
} | java | public TextBuilder styledLink(final String text, final TextStyle ts, final String ref) {
this.curParagraphBuilder.styledLink(text, ts, ref);
return this;
} | [
"public",
"TextBuilder",
"styledLink",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
",",
"final",
"String",
"ref",
")",
"{",
"this",
".",
"curParagraphBuilder",
".",
"styledLink",
"(",
"text",
",",
"ts",
",",
"ref",
")",
";",
"return",
... | Create a styled link in the current paragraph.
@param text the text
@param ts the style
@param ref the destination
@return this for fluent style | [
"Create",
"a",
"styled",
"link",
"in",
"the",
"current",
"paragraph",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TextBuilder.java#L199-L202 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java | MapUtil.of | public static <K, V> HashMap<K, V> of(K key, V value) {
return of(key, value, false);
} | java | public static <K, V> HashMap<K, V> of(K key, V value) {
return of(key, value, false);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"HashMap",
"<",
"K",
",",
"V",
">",
"of",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"return",
"of",
"(",
"key",
",",
"value",
",",
"false",
")",
";",
"}"
] | 将单一键值对转换为Map
@param <K> 键类型
@param <V> 值类型
@param key 键
@param value 值
@return {@link HashMap} | [
"将单一键值对转换为Map"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L175-L177 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/gremlin/GremlinExpressionFactory.java | GremlinExpressionFactory.generateUnaryHasExpression | public GroovyExpression generateUnaryHasExpression(GroovyExpression parent, String fieldName) {
return new FunctionCallExpression(TraversalStepType.FILTER, parent, HAS_METHOD, new LiteralExpression(fieldName));
} | java | public GroovyExpression generateUnaryHasExpression(GroovyExpression parent, String fieldName) {
return new FunctionCallExpression(TraversalStepType.FILTER, parent, HAS_METHOD, new LiteralExpression(fieldName));
} | [
"public",
"GroovyExpression",
"generateUnaryHasExpression",
"(",
"GroovyExpression",
"parent",
",",
"String",
"fieldName",
")",
"{",
"return",
"new",
"FunctionCallExpression",
"(",
"TraversalStepType",
".",
"FILTER",
",",
"parent",
",",
"HAS_METHOD",
",",
"new",
"Lite... | Generates an expression which checks whether the vertices in the query have
a field with the given name.
@param parent
@param fieldName
@return | [
"Generates",
"an",
"expression",
"which",
"checks",
"whether",
"the",
"vertices",
"in",
"the",
"query",
"have",
"a",
"field",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/gremlin/GremlinExpressionFactory.java#L421-L423 |
google/closure-compiler | src/com/google/javascript/jscomp/DotFormatter.java | DotFormatter.toDot | static String toDot(Node n, ControlFlowGraph<Node> inCFG)
throws IOException {
StringBuilder builder = new StringBuilder();
new DotFormatter(n, inCFG, builder, false);
return builder.toString();
} | java | static String toDot(Node n, ControlFlowGraph<Node> inCFG)
throws IOException {
StringBuilder builder = new StringBuilder();
new DotFormatter(n, inCFG, builder, false);
return builder.toString();
} | [
"static",
"String",
"toDot",
"(",
"Node",
"n",
",",
"ControlFlowGraph",
"<",
"Node",
">",
"inCFG",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"new",
"DotFormatter",
"(",
"n",
",",
"inCFG",
","... | Converts an AST to dot representation.
@param n the root of the AST described in the dot formatted string
@param inCFG Control Flow Graph.
@return the dot representation of the AST | [
"Converts",
"an",
"AST",
"to",
"dot",
"representation",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DotFormatter.java#L93-L98 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/utils/ReflectUtils.java | ReflectUtils.hasSuperClass | public static boolean hasSuperClass(Class<?> has, Class<?> in)
{
if (in.equals(has))
{
return true;
}
boolean match = false;
// stop if the superclass is Object
if (in.getSuperclass() != null && in.getSuperclass().equals(Object.class))
{
... | java | public static boolean hasSuperClass(Class<?> has, Class<?> in)
{
if (in.equals(has))
{
return true;
}
boolean match = false;
// stop if the superclass is Object
if (in.getSuperclass() != null && in.getSuperclass().equals(Object.class))
{
... | [
"public",
"static",
"boolean",
"hasSuperClass",
"(",
"Class",
"<",
"?",
">",
"has",
",",
"Class",
"<",
"?",
">",
"in",
")",
"{",
"if",
"(",
"in",
".",
"equals",
"(",
"has",
")",
")",
"{",
"return",
"true",
";",
"}",
"boolean",
"match",
"=",
"fals... | Checks for super "has" in class "in".
@param has
the has
@param in
the in
@return true, if exists? | [
"Checks",
"for",
"super",
"has",
"in",
"class",
"in",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/utils/ReflectUtils.java#L108-L122 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAToken2.java | LTPAToken2.toUTF8String | private static final String toUTF8String(byte[] b) {
String ns = null;
try {
ns = new String(b, "UTF8");
} catch (UnsupportedEncodingException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Error converting to string;... | java | private static final String toUTF8String(byte[] b) {
String ns = null;
try {
ns = new String(b, "UTF8");
} catch (UnsupportedEncodingException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Error converting to string;... | [
"private",
"static",
"final",
"String",
"toUTF8String",
"(",
"byte",
"[",
"]",
"b",
")",
"{",
"String",
"ns",
"=",
"null",
";",
"try",
"{",
"ns",
"=",
"new",
"String",
"(",
"b",
",",
"\"UTF8\"",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingExceptio... | Convert the byte representation to the UTF-8 String form.
@param b The byte representation
@return The UTF-8 String form | [
"Convert",
"the",
"byte",
"representation",
"to",
"the",
"UTF",
"-",
"8",
"String",
"form",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAToken2.java#L431-L441 |
zaproxy/zaproxy | src/org/zaproxy/zap/view/StandardFieldsDialog.java | StandardFieldsDialog.addNodeSelectField | public void addNodeSelectField(final String fieldLabel, final SiteNode value,
final boolean editable, final boolean allowRoot) {
validateNotTabbed();
final ZapTextField text = new ZapTextField();
text.setEditable(editable);
if (value != null) {
text.setText(getNodeText(value));
}
JButton selectButton... | java | public void addNodeSelectField(final String fieldLabel, final SiteNode value,
final boolean editable, final boolean allowRoot) {
validateNotTabbed();
final ZapTextField text = new ZapTextField();
text.setEditable(editable);
if (value != null) {
text.setText(getNodeText(value));
}
JButton selectButton... | [
"public",
"void",
"addNodeSelectField",
"(",
"final",
"String",
"fieldLabel",
",",
"final",
"SiteNode",
"value",
",",
"final",
"boolean",
"editable",
",",
"final",
"boolean",
"allowRoot",
")",
"{",
"validateNotTabbed",
"(",
")",
";",
"final",
"ZapTextField",
"te... | /*
Add a 'node select' field which provides a button for showing a Node Select Dialog and a
non editable field for showing the node selected | [
"/",
"*",
"Add",
"a",
"node",
"select",
"field",
"which",
"provides",
"a",
"button",
"for",
"showing",
"a",
"Node",
"Select",
"Dialog",
"and",
"a",
"non",
"editable",
"field",
"for",
"showing",
"the",
"node",
"selected"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/StandardFieldsDialog.java#L1101-L1132 |
spotify/styx | styx-common/src/main/java/com/spotify/styx/util/TimeUtil.java | TimeUtil.addOffset | public static ZonedDateTime addOffset(ZonedDateTime time, String offset) {
final Matcher matcher = OFFSET_PATTERN.matcher(offset);
if (!matcher.matches()) {
throw new DateTimeParseException("Unable to parse offset period", offset, 0);
}
final String sign = matcher.group(1);
final String peri... | java | public static ZonedDateTime addOffset(ZonedDateTime time, String offset) {
final Matcher matcher = OFFSET_PATTERN.matcher(offset);
if (!matcher.matches()) {
throw new DateTimeParseException("Unable to parse offset period", offset, 0);
}
final String sign = matcher.group(1);
final String peri... | [
"public",
"static",
"ZonedDateTime",
"addOffset",
"(",
"ZonedDateTime",
"time",
",",
"String",
"offset",
")",
"{",
"final",
"Matcher",
"matcher",
"=",
"OFFSET_PATTERN",
".",
"matcher",
"(",
"offset",
")",
";",
"if",
"(",
"!",
"matcher",
".",
"matches",
"(",
... | Applies an ISO 8601 Duration to a {@link ZonedDateTime}.
<p>Since the JDK defined different types for the different parts of a Duration
specification, this utility method is needed when a full Duration is to be applied to a
{@link ZonedDateTime}. See {@link Period} and {@link Duration}.
<p>All date-based parts of a D... | [
"Applies",
"an",
"ISO",
"8601",
"Duration",
"to",
"a",
"{",
"@link",
"ZonedDateTime",
"}",
"."
] | train | https://github.com/spotify/styx/blob/0d63999beeb93a17447e3bbccaa62175b74cf6e4/styx-common/src/main/java/com/spotify/styx/util/TimeUtil.java#L217-L232 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/button/ButtonBehavior.java | ButtonBehavior.setIcons | public ButtonBehavior setIcons(UiIcon primary, UiIcon secondary)
{
options.put("icons", new ButtonIcon(primary, secondary));
return this;
} | java | public ButtonBehavior setIcons(UiIcon primary, UiIcon secondary)
{
options.put("icons", new ButtonIcon(primary, secondary));
return this;
} | [
"public",
"ButtonBehavior",
"setIcons",
"(",
"UiIcon",
"primary",
",",
"UiIcon",
"secondary",
")",
"{",
"options",
".",
"put",
"(",
"\"icons\"",
",",
"new",
"ButtonIcon",
"(",
"primary",
",",
"secondary",
")",
")",
";",
"return",
"this",
";",
"}"
] | * Icons to display, with or without text (see text option). The primary icon is
displayed on the left of the label text, the secondary on the right. Value for the
primary and secondary properties must be a classname (String), eg. "ui-icon-gear".
For using only a primary icon: icons: {primary:'ui-icon-locked'}. For usin... | [
"*",
"Icons",
"to",
"display",
"with",
"or",
"without",
"text",
"(",
"see",
"text",
"option",
")",
".",
"The",
"primary",
"icon",
"is",
"displayed",
"on",
"the",
"left",
"of",
"the",
"label",
"text",
"the",
"secondary",
"on",
"the",
"right",
".",
"Valu... | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/button/ButtonBehavior.java#L189-L193 |
maguro/aunit | junit/src/main/java/com/toolazydogs/aunit/Assert.java | Assert.refuteParse | public static void refuteParse(SelectedRule rule, LexerResults lexerResults)
{
try
{
lexerResults.parseAs(rule);
fail("parsed as " + rule);
}
catch (AssertionError e)
{
if (checkMessage(e.getMessage()))
{
// thin... | java | public static void refuteParse(SelectedRule rule, LexerResults lexerResults)
{
try
{
lexerResults.parseAs(rule);
fail("parsed as " + rule);
}
catch (AssertionError e)
{
if (checkMessage(e.getMessage()))
{
// thin... | [
"public",
"static",
"void",
"refuteParse",
"(",
"SelectedRule",
"rule",
",",
"LexerResults",
"lexerResults",
")",
"{",
"try",
"{",
"lexerResults",
".",
"parseAs",
"(",
"rule",
")",
";",
"fail",
"(",
"\"parsed as \"",
"+",
"rule",
")",
";",
"}",
"catch",
"(... | To "refute" a parse means that the scan cannot be parsed with the
specified rule.
<p/>
<pre>
refuteParse("program", myTester.scanInput("5 / * 8"));
</pre>
@param rule the rule to apply from the parser.
@param lexerResults the result of scanning input with the tester. | [
"To",
"refute",
"a",
"parse",
"means",
"that",
"the",
"scan",
"cannot",
"be",
"parsed",
"with",
"the",
"specified",
"rule",
".",
"<p",
"/",
">",
"<pre",
">",
"refuteParse",
"(",
""",
";",
"program"",
";",
"myTester",
".",
"scanInput",
"(",
""... | train | https://github.com/maguro/aunit/blob/1f972e35b28327e5e2e7881befc928df0546d74c/junit/src/main/java/com/toolazydogs/aunit/Assert.java#L196-L214 |
Ekryd/sortpom | sorter/src/main/java/sortpom/XmlOutputGenerator.java | XmlOutputGenerator.getSortedXml | public String getSortedXml(Document newDocument) {
try (ByteArrayOutputStream sortedXml = new ByteArrayOutputStream()) {
BufferedLineSeparatorOutputStream bufferedLineOutputStream =
new BufferedLineSeparatorOutputStream(lineSeparatorUtil.toString(), sortedXml);
XMLOu... | java | public String getSortedXml(Document newDocument) {
try (ByteArrayOutputStream sortedXml = new ByteArrayOutputStream()) {
BufferedLineSeparatorOutputStream bufferedLineOutputStream =
new BufferedLineSeparatorOutputStream(lineSeparatorUtil.toString(), sortedXml);
XMLOu... | [
"public",
"String",
"getSortedXml",
"(",
"Document",
"newDocument",
")",
"{",
"try",
"(",
"ByteArrayOutputStream",
"sortedXml",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
")",
"{",
"BufferedLineSeparatorOutputStream",
"bufferedLineOutputStream",
"=",
"new",
"Buffere... | Returns the sorted xml as an OutputStream.
@return the sorted xml | [
"Returns",
"the",
"sorted",
"xml",
"as",
"an",
"OutputStream",
"."
] | train | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/XmlOutputGenerator.java#L41-L55 |
Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.pipelineWriteHMSET | public String pipelineWriteHMSET(String key, DataGenerator dataGenerator, String hm_key_prefix) {
Map<String, String> map = new HashMap<>();
String hmKey = hm_key_prefix + key;
map.put((hmKey + "__1"), (key + "__" + dataGenerator.getRandomValue() + "__" + key));
map.put((hmKey + "__2"), ... | java | public String pipelineWriteHMSET(String key, DataGenerator dataGenerator, String hm_key_prefix) {
Map<String, String> map = new HashMap<>();
String hmKey = hm_key_prefix + key;
map.put((hmKey + "__1"), (key + "__" + dataGenerator.getRandomValue() + "__" + key));
map.put((hmKey + "__2"), ... | [
"public",
"String",
"pipelineWriteHMSET",
"(",
"String",
"key",
",",
"DataGenerator",
"dataGenerator",
",",
"String",
"hm_key_prefix",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"String",
"hmKey",
... | writes with an pipelined HMSET
@param key
@return the keys of the hash that was stored. | [
"writes",
"with",
"an",
"pipelined",
"HMSET"
] | train | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L217-L229 |
EdwardRaff/JSAT | JSAT/src/jsat/datatransform/NumericalToHistogram.java | NumericalToHistogram.guessNumberOfBins | public static Distribution guessNumberOfBins(DataSet data)
{
if(data.size() < 20)
return new UniformDiscrete(2, data.size()-1);
else if(data.size() >= 1000000)
return new LogUniform(50, 1000);
int sqrt = (int) Math.sqrt(data.size());
return new UniformDiscrete... | java | public static Distribution guessNumberOfBins(DataSet data)
{
if(data.size() < 20)
return new UniformDiscrete(2, data.size()-1);
else if(data.size() >= 1000000)
return new LogUniform(50, 1000);
int sqrt = (int) Math.sqrt(data.size());
return new UniformDiscrete... | [
"public",
"static",
"Distribution",
"guessNumberOfBins",
"(",
"DataSet",
"data",
")",
"{",
"if",
"(",
"data",
".",
"size",
"(",
")",
"<",
"20",
")",
"return",
"new",
"UniformDiscrete",
"(",
"2",
",",
"data",
".",
"size",
"(",
")",
"-",
"1",
")",
";",... | Attempts to guess the number of bins to use
@param data the dataset to be transforms
@return a distribution of the guess | [
"Attempts",
"to",
"guess",
"the",
"number",
"of",
"bins",
"to",
"use"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/datatransform/NumericalToHistogram.java#L138-L146 |
indeedeng/util | io/src/main/java/com/indeed/util/io/Files.java | Files.writeObjectIfChanged | @Deprecated
public static boolean writeObjectIfChanged(Object obj, String filepath) {
try {
return writeObjectIfChangedOrDie(obj, filepath, LOGGER);
} catch (Exception e) {
LOGGER.error(e.getClass() + ": writeObjectIfChanged(" + filepath + ") encountered exception: " + e... | java | @Deprecated
public static boolean writeObjectIfChanged(Object obj, String filepath) {
try {
return writeObjectIfChangedOrDie(obj, filepath, LOGGER);
} catch (Exception e) {
LOGGER.error(e.getClass() + ": writeObjectIfChanged(" + filepath + ") encountered exception: " + e... | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"writeObjectIfChanged",
"(",
"Object",
"obj",
",",
"String",
"filepath",
")",
"{",
"try",
"{",
"return",
"writeObjectIfChangedOrDie",
"(",
"obj",
",",
"filepath",
",",
"LOGGER",
")",
";",
"}",
"catch",
"(",
"... | Writes an object to a file only if it is different from the current
contents of the file, or if the file does not exist. Note that you must
have enough heap to contain the entire contents of the object graph.
@return true if the file was actually written, false otherwise
@deprecated use {@link #writeObjectIfChangedOr... | [
"Writes",
"an",
"object",
"to",
"a",
"file",
"only",
"if",
"it",
"is",
"different",
"from",
"the",
"current",
"contents",
"of",
"the",
"file",
"or",
"if",
"the",
"file",
"does",
"not",
"exist",
".",
"Note",
"that",
"you",
"must",
"have",
"enough",
"hea... | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/io/src/main/java/com/indeed/util/io/Files.java#L354-L362 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/SignOneSample.java | SignOneSample.getPvalue | public static double getPvalue(FlatDataCollection flatDataCollection, double median) {
int n=flatDataCollection.size();
if(n<=0) {
throw new IllegalArgumentException("The provided collection can't be empty.");
}
int Tplus=0;
Iterator<Double> it = flatDataColl... | java | public static double getPvalue(FlatDataCollection flatDataCollection, double median) {
int n=flatDataCollection.size();
if(n<=0) {
throw new IllegalArgumentException("The provided collection can't be empty.");
}
int Tplus=0;
Iterator<Double> it = flatDataColl... | [
"public",
"static",
"double",
"getPvalue",
"(",
"FlatDataCollection",
"flatDataCollection",
",",
"double",
"median",
")",
"{",
"int",
"n",
"=",
"flatDataCollection",
".",
"size",
"(",
")",
";",
"if",
"(",
"n",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalA... | Calculates the p-value of null Hypothesis.
@param flatDataCollection
@param median
@return | [
"Calculates",
"the",
"p",
"-",
"value",
"of",
"null",
"Hypothesis",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/SignOneSample.java#L37-L59 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/beldata/annotation/AnnotationHeaderParser.java | AnnotationHeaderParser.parseAnnotation | public AnnotationHeader parseAnnotation(String resourceLocation,
File annotationFile) throws IOException,
BELDataMissingPropertyException,
BELDataConversionException, BELDataInvalidPropertyException {
if (annotationFile == null) {
throw new InvalidArgument("annota... | java | public AnnotationHeader parseAnnotation(String resourceLocation,
File annotationFile) throws IOException,
BELDataMissingPropertyException,
BELDataConversionException, BELDataInvalidPropertyException {
if (annotationFile == null) {
throw new InvalidArgument("annota... | [
"public",
"AnnotationHeader",
"parseAnnotation",
"(",
"String",
"resourceLocation",
",",
"File",
"annotationFile",
")",
"throws",
"IOException",
",",
"BELDataMissingPropertyException",
",",
"BELDataConversionException",
",",
"BELDataInvalidPropertyException",
"{",
"if",
"(",
... | Parses the annotation {@link File} into a {@link AnnotationHeader} object.
@param annotationFile {@link File}, the annotation file, which cannot be
null, must exist, and must be readable
@return {@link annotationHeader}, the parsed annotation header
@throws IOException Thrown if an IO error occurred reading the
<tt>an... | [
"Parses",
"the",
"annotation",
"{",
"@link",
"File",
"}",
"into",
"a",
"{",
"@link",
"AnnotationHeader",
"}",
"object",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/beldata/annotation/AnnotationHeaderParser.java#L70-L105 |
code4everything/util | src/main/java/com/zhazhapan/util/NetUtils.java | NetUtils.getLocationByIp | public static String getLocationByIp(String ip) throws IOException, XPathExpressionException,
ParserConfigurationException {
return evaluate(ValueConsts.IP_REGION_XPATH, getHtmlFromUrl("http://ip.chinaz.com/" + ip));
} | java | public static String getLocationByIp(String ip) throws IOException, XPathExpressionException,
ParserConfigurationException {
return evaluate(ValueConsts.IP_REGION_XPATH, getHtmlFromUrl("http://ip.chinaz.com/" + ip));
} | [
"public",
"static",
"String",
"getLocationByIp",
"(",
"String",
"ip",
")",
"throws",
"IOException",
",",
"XPathExpressionException",
",",
"ParserConfigurationException",
"{",
"return",
"evaluate",
"(",
"ValueConsts",
".",
"IP_REGION_XPATH",
",",
"getHtmlFromUrl",
"(",
... | 获取ip归属地
@param ip ip地址
@return 归属地
@throws IOException 异常
@throws XPathExpressionException 异常
@throws ParserConfigurationException 异常 | [
"获取ip归属地"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/NetUtils.java#L680-L683 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java | StreamGraph.addVirtualSelectNode | public void addVirtualSelectNode(Integer originalId, Integer virtualId, List<String> selectedNames) {
if (virtualSelectNodes.containsKey(virtualId)) {
throw new IllegalStateException("Already has virtual select node with id " + virtualId);
}
virtualSelectNodes.put(virtualId,
new Tuple2<Integer, List<Stri... | java | public void addVirtualSelectNode(Integer originalId, Integer virtualId, List<String> selectedNames) {
if (virtualSelectNodes.containsKey(virtualId)) {
throw new IllegalStateException("Already has virtual select node with id " + virtualId);
}
virtualSelectNodes.put(virtualId,
new Tuple2<Integer, List<Stri... | [
"public",
"void",
"addVirtualSelectNode",
"(",
"Integer",
"originalId",
",",
"Integer",
"virtualId",
",",
"List",
"<",
"String",
">",
"selectedNames",
")",
"{",
"if",
"(",
"virtualSelectNodes",
".",
"containsKey",
"(",
"virtualId",
")",
")",
"{",
"throw",
"new... | Adds a new virtual node that is used to connect a downstream vertex to only the outputs
with the selected names.
<p>When adding an edge from the virtual node to a downstream node the connection will be made
to the original node, only with the selected names given here.
@param originalId ID of the node that should be ... | [
"Adds",
"a",
"new",
"virtual",
"node",
"that",
"is",
"used",
"to",
"connect",
"a",
"downstream",
"vertex",
"to",
"only",
"the",
"outputs",
"with",
"the",
"selected",
"names",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java#L290-L298 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PeerGroup.java | PeerGroup.waitForPeersWithServiceMask | public ListenableFuture<List<Peer>> waitForPeersWithServiceMask(final int numPeers, final int mask) {
lock.lock();
try {
List<Peer> foundPeers = findPeersWithServiceMask(mask);
if (foundPeers.size() >= numPeers)
return Futures.immediateFuture(foundPeers);
... | java | public ListenableFuture<List<Peer>> waitForPeersWithServiceMask(final int numPeers, final int mask) {
lock.lock();
try {
List<Peer> foundPeers = findPeersWithServiceMask(mask);
if (foundPeers.size() >= numPeers)
return Futures.immediateFuture(foundPeers);
... | [
"public",
"ListenableFuture",
"<",
"List",
"<",
"Peer",
">",
">",
"waitForPeersWithServiceMask",
"(",
"final",
"int",
"numPeers",
",",
"final",
"int",
"mask",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"List",
"<",
"Peer",
">",
"foundPeers... | Returns a future that is triggered when there are at least the requested number of connected peers that support
the given protocol version or higher. To block immediately, just call get() on the result.
@param numPeers How many peers to wait for.
@param mask An integer representing a bit mask that will be ANDed with t... | [
"Returns",
"a",
"future",
"that",
"is",
"triggered",
"when",
"there",
"are",
"at",
"least",
"the",
"requested",
"number",
"of",
"connected",
"peers",
"that",
"support",
"the",
"given",
"protocol",
"version",
"or",
"higher",
".",
"To",
"block",
"immediately",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PeerGroup.java#L1941-L1962 |
revelytix/spark | spark-http-client/src/main/java/spark/protocol/parser/ResultFactory.java | ResultFactory.findParser | private static final ResultParser findParser(String mediaType, ResultType expectedType) {
ResponseFormat format = null;
// Prefer MIME type when choosing result format.
if (mediaType != null) {
mediaType = stripParams(mediaType);
format = mimeFormats.get(mediaType);
if (format == null... | java | private static final ResultParser findParser(String mediaType, ResultType expectedType) {
ResponseFormat format = null;
// Prefer MIME type when choosing result format.
if (mediaType != null) {
mediaType = stripParams(mediaType);
format = mimeFormats.get(mediaType);
if (format == null... | [
"private",
"static",
"final",
"ResultParser",
"findParser",
"(",
"String",
"mediaType",
",",
"ResultType",
"expectedType",
")",
"{",
"ResponseFormat",
"format",
"=",
"null",
";",
"// Prefer MIME type when choosing result format.",
"if",
"(",
"mediaType",
"!=",
"null",
... | Find a parser to handle the protocol response body based on the content type found in the response
and the expected result type specified by the user; if one or both fields is missing then
attempts to choose a sensible default.
@param mediaType The content type in the response, or null if none was given.
@param expecte... | [
"Find",
"a",
"parser",
"to",
"handle",
"the",
"protocol",
"response",
"body",
"based",
"on",
"the",
"content",
"type",
"found",
"in",
"the",
"response",
"and",
"the",
"expected",
"result",
"type",
"specified",
"by",
"the",
"user",
";",
"if",
"one",
"or",
... | train | https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/ResultFactory.java#L153-L187 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createStrictPartialMockAndInvokeDefaultConstructor | public static <T> T createStrictPartialMockAndInvokeDefaultConstructor(Class<T> type, String... methodNames)
throws Exception {
return createStrictMock(type, new ConstructorArgs(Whitebox.getConstructor(type)),
Whitebox.getMethods(type, methodNames));
} | java | public static <T> T createStrictPartialMockAndInvokeDefaultConstructor(Class<T> type, String... methodNames)
throws Exception {
return createStrictMock(type, new ConstructorArgs(Whitebox.getConstructor(type)),
Whitebox.getMethods(type, methodNames));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"createStrictPartialMockAndInvokeDefaultConstructor",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"...",
"methodNames",
")",
"throws",
"Exception",
"{",
"return",
"createStrictMock",
"(",
"type",
",",
"new",
"Const... | A utility method that may be used to strictly mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock). The mock object created will support mocking of final methods and
invokes the default constructor (even if it's private).
@param <T> the type of the mock objec... | [
"A",
"utility",
"method",
"that",
"may",
"be",
"used",
"to",
"strictly",
"mock",
"several",
"methods",
"in",
"an",
"easy",
"way",
"(",
"by",
"just",
"passing",
"in",
"the",
"method",
"names",
"of",
"the",
"method",
"you",
"wish",
"to",
"mock",
")",
"."... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L880-L884 |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java | FeatureValidationCheck.reportError | protected ValidationMessage<Origin> reportError(Origin origin, String messageKey,
Object... params) {
return reportMessage(Severity.ERROR, origin, messageKey, params);
} | java | protected ValidationMessage<Origin> reportError(Origin origin, String messageKey,
Object... params) {
return reportMessage(Severity.ERROR, origin, messageKey, params);
} | [
"protected",
"ValidationMessage",
"<",
"Origin",
">",
"reportError",
"(",
"Origin",
"origin",
",",
"String",
"messageKey",
",",
"Object",
"...",
"params",
")",
"{",
"return",
"reportMessage",
"(",
"Severity",
".",
"ERROR",
",",
"origin",
",",
"messageKey",
","... | Creates an error validation message for the feature and adds it to
the validation result.
@param origin the origin
@param messageKey a message key
@param params message parameters | [
"Creates",
"an",
"error",
"validation",
"message",
"for",
"the",
"feature",
"and",
"adds",
"it",
"to",
"the",
"validation",
"result",
"."
] | train | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java#L67-L70 |
thinkaurelius/faunus | src/main/java/com/thinkaurelius/faunus/FaunusPipeline.java | FaunusPipeline.interval | public FaunusPipeline interval(final String key, final Object startValue, final Object endValue) {
this.state.assertNotLocked();
this.state.assertNoProperty();
this.compiler.addMap(IntervalFilterMap.Map.class,
NullWritable.class,
FaunusVertex.class,
... | java | public FaunusPipeline interval(final String key, final Object startValue, final Object endValue) {
this.state.assertNotLocked();
this.state.assertNoProperty();
this.compiler.addMap(IntervalFilterMap.Map.class,
NullWritable.class,
FaunusVertex.class,
... | [
"public",
"FaunusPipeline",
"interval",
"(",
"final",
"String",
"key",
",",
"final",
"Object",
"startValue",
",",
"final",
"Object",
"endValue",
")",
"{",
"this",
".",
"state",
".",
"assertNotLocked",
"(",
")",
";",
"this",
".",
"state",
".",
"assertNoProper... | Emit the current element it has a property value equal within the provided range.
@param key the property key of the element
@param startValue the start of the range (inclusive)
@param endValue the end of the range (exclusive)
@return the extended FaunusPipeline | [
"Emit",
"the",
"current",
"element",
"it",
"has",
"a",
"property",
"value",
"equal",
"within",
"the",
"provided",
"range",
"."
] | train | https://github.com/thinkaurelius/faunus/blob/1eb8494eeb3fe3b84a98d810d304ba01d55b0d6e/src/main/java/com/thinkaurelius/faunus/FaunusPipeline.java#L705-L715 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.isSub | public static boolean isSub(File parent, File sub) {
Assert.notNull(parent);
Assert.notNull(sub);
return sub.toPath().startsWith(parent.toPath());
} | java | public static boolean isSub(File parent, File sub) {
Assert.notNull(parent);
Assert.notNull(sub);
return sub.toPath().startsWith(parent.toPath());
} | [
"public",
"static",
"boolean",
"isSub",
"(",
"File",
"parent",
",",
"File",
"sub",
")",
"{",
"Assert",
".",
"notNull",
"(",
"parent",
")",
";",
"Assert",
".",
"notNull",
"(",
"sub",
")",
";",
"return",
"sub",
".",
"toPath",
"(",
")",
".",
"startsWith... | 判断给定的目录是否为给定文件或文件夹的父目录
@param parent 父目录
@param sub 子目录
@return 子目录是否为父目录的子目录
@since 4.5.4 | [
"判断给定的目录是否为给定文件或文件夹的父目录"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3431-L3435 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/XhtmlTemplate.java | XhtmlTemplate.setProperty | @Override
public void setProperty(String name, Object value)
{
switch(name) {
case "js.template.serialize.prolog":
serializeProlog = (Boolean)value;
break;
case "js.template.serialize.operator":
serializeOperators = (Boolean)value;
break;
}
} | java | @Override
public void setProperty(String name, Object value)
{
switch(name) {
case "js.template.serialize.prolog":
serializeProlog = (Boolean)value;
break;
case "js.template.serialize.operator":
serializeOperators = (Boolean)value;
break;
}
} | [
"@",
"Override",
"public",
"void",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"switch",
"(",
"name",
")",
"{",
"case",
"\"js.template.serialize.prolog\"",
":",
"serializeProlog",
"=",
"(",
"Boolean",
")",
"value",
";",
"break",
"... | Set template instance properties overriding the template engine ones. Current implementation deals with
<code>js.template.serialize.prolog</code> and <code>js.template.serialize.operator</code> flags.
<p>
First is used to disable prolog serialization. By default prolog serialization is enabled, see
{@link #serializePro... | [
"Set",
"template",
"instance",
"properties",
"overriding",
"the",
"template",
"engine",
"ones",
".",
"Current",
"implementation",
"deals",
"with",
"<code",
">",
"js",
".",
"template",
".",
"serialize",
".",
"prolog<",
"/",
"code",
">",
"and",
"<code",
">",
"... | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/XhtmlTemplate.java#L85-L97 |
BlueBrain/bluima | modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/tools/sentdetect/SDContextGenerator.java | SDContextGenerator.previousSpaceIndex | private static final int previousSpaceIndex(StringBuffer sb, int seek) {
seek--;
while (seek > 0) {
if (sb.charAt(seek) == ' ') {
while (seek > 0 && sb.charAt(seek - 1) == ' ')
seek--;
return seek;
}
seek--;
}
return 0;
} | java | private static final int previousSpaceIndex(StringBuffer sb, int seek) {
seek--;
while (seek > 0) {
if (sb.charAt(seek) == ' ') {
while (seek > 0 && sb.charAt(seek - 1) == ' ')
seek--;
return seek;
}
seek--;
}
return 0;
} | [
"private",
"static",
"final",
"int",
"previousSpaceIndex",
"(",
"StringBuffer",
"sb",
",",
"int",
"seek",
")",
"{",
"seek",
"--",
";",
"while",
"(",
"seek",
">",
"0",
")",
"{",
"if",
"(",
"sb",
".",
"charAt",
"(",
"seek",
")",
"==",
"'",
"'",
")",
... | Finds the index of the nearest space before a specified index.
@param sb The string buffer which contains the text being examined.
@param seek The index to begin searching from.
@return The index which contains the nearest space. | [
"Finds",
"the",
"index",
"of",
"the",
"nearest",
"space",
"before",
"a",
"specified",
"index",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/tools/sentdetect/SDContextGenerator.java#L219-L230 |
hageldave/ImagingKit | ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/Fourier.java | Fourier.horizontalTransform | public static ComplexImg horizontalTransform(ColorImg img, int channel) {
// sanity checks
sanityCheckForward(img, channel);
// make transforms
ComplexImg transformed = new ComplexImg(img.getDimension());
try(
NativeRealArray row = new NativeRealArray(img.getWidth());
NativeRealArray fft_r = new Nativ... | java | public static ComplexImg horizontalTransform(ColorImg img, int channel) {
// sanity checks
sanityCheckForward(img, channel);
// make transforms
ComplexImg transformed = new ComplexImg(img.getDimension());
try(
NativeRealArray row = new NativeRealArray(img.getWidth());
NativeRealArray fft_r = new Nativ... | [
"public",
"static",
"ComplexImg",
"horizontalTransform",
"(",
"ColorImg",
"img",
",",
"int",
"channel",
")",
"{",
"// sanity checks",
"sanityCheckForward",
"(",
"img",
",",
"channel",
")",
";",
"// make transforms",
"ComplexImg",
"transformed",
"=",
"new",
"ComplexI... | Executes row wise Fourier transforms of the specified channel of the specified {@link ColorImg}.
A 1-dimensional Fourier transform is done for each row of the image's channel.
@param img of which one channel is to be transformed
@param channel the channel which will be transformed
@return transform as ComplexImg
@thro... | [
"Executes",
"row",
"wise",
"Fourier",
"transforms",
"of",
"the",
"specified",
"channel",
"of",
"the",
"specified",
"{",
"@link",
"ColorImg",
"}",
".",
"A",
"1",
"-",
"dimensional",
"Fourier",
"transform",
"is",
"done",
"for",
"each",
"row",
"of",
"the",
"i... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/Fourier.java#L173-L191 |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.getAnnisWebResource | public static WebResource getAnnisWebResource()
{
VaadinSession vSession = VaadinSession.getCurrent();
// get URI used by the application
String uri = null;
if (vSession != null)
{
uri = (String) VaadinSession.getCurrent().getAttribute(
KEY_WEB_SERVICE_URL);
}
// if alrea... | java | public static WebResource getAnnisWebResource()
{
VaadinSession vSession = VaadinSession.getCurrent();
// get URI used by the application
String uri = null;
if (vSession != null)
{
uri = (String) VaadinSession.getCurrent().getAttribute(
KEY_WEB_SERVICE_URL);
}
// if alrea... | [
"public",
"static",
"WebResource",
"getAnnisWebResource",
"(",
")",
"{",
"VaadinSession",
"vSession",
"=",
"VaadinSession",
".",
"getCurrent",
"(",
")",
";",
"// get URI used by the application",
"String",
"uri",
"=",
"null",
";",
"if",
"(",
"vSession",
"!=",
"nul... | Gets or creates a web resource to the ANNIS service.
This is a convenience wrapper to {@link #getAnnisWebResource(java.lang.String, annis.security.AnnisUser)
}
that does not need any arguments
@return A reference to the ANNIS service root resource. | [
"Gets",
"or",
"creates",
"a",
"web",
"resource",
"to",
"the",
"ANNIS",
"service",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L322-L340 |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/compat/jodatime/LocalDateIteratorFactory.java | LocalDateIteratorFactory.createLocalDateIterable | public static LocalDateIterable createLocalDateIterable(
String rdata, LocalDate start, boolean strict)
throws ParseException {
return createLocalDateIterable(rdata, start, DateTimeZone.UTC, strict);
} | java | public static LocalDateIterable createLocalDateIterable(
String rdata, LocalDate start, boolean strict)
throws ParseException {
return createLocalDateIterable(rdata, start, DateTimeZone.UTC, strict);
} | [
"public",
"static",
"LocalDateIterable",
"createLocalDateIterable",
"(",
"String",
"rdata",
",",
"LocalDate",
"start",
",",
"boolean",
"strict",
")",
"throws",
"ParseException",
"{",
"return",
"createLocalDateIterable",
"(",
"rdata",
",",
"start",
",",
"DateTimeZone",... | given a block of RRULE, EXRULE, RDATE, and EXDATE content lines, parse
them into a single local date iterable.
@param rdata RRULE, EXRULE, RDATE, and EXDATE lines.
@param start the first occurrence of the series.
@param strict true if any failure to parse should result in a
ParseException. false causes bad content lin... | [
"given",
"a",
"block",
"of",
"RRULE",
"EXRULE",
"RDATE",
"and",
"EXDATE",
"content",
"lines",
"parse",
"them",
"into",
"a",
"single",
"local",
"date",
"iterable",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/compat/jodatime/LocalDateIteratorFactory.java#L104-L108 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/transform/XMLTransformerFactory.java | XMLTransformerFactory.newTransformer | @Nullable
public static Transformer newTransformer (@Nonnull final TransformerFactory aTransformerFactory,
@Nonnull final IReadableResource aResource)
{
ValueEnforcer.notNull (aResource, "Resource");
return newTransformer (aTransformerFactory, TransformSourceFact... | java | @Nullable
public static Transformer newTransformer (@Nonnull final TransformerFactory aTransformerFactory,
@Nonnull final IReadableResource aResource)
{
ValueEnforcer.notNull (aResource, "Resource");
return newTransformer (aTransformerFactory, TransformSourceFact... | [
"@",
"Nullable",
"public",
"static",
"Transformer",
"newTransformer",
"(",
"@",
"Nonnull",
"final",
"TransformerFactory",
"aTransformerFactory",
",",
"@",
"Nonnull",
"final",
"IReadableResource",
"aResource",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aResource"... | Create a new XSLT transformer for the passed resource.
@param aTransformerFactory
The transformer factory to be used. May not be <code>null</code>.
@param aResource
The resource to be transformed. May not be <code>null</code>.
@return <code>null</code> if something goes wrong | [
"Create",
"a",
"new",
"XSLT",
"transformer",
"for",
"the",
"passed",
"resource",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/transform/XMLTransformerFactory.java#L186-L193 |
xm-online/xm-commons | xm-commons-security/src/main/java/com/icthh/xm/commons/security/oauth2/ConfigSignatureVerifierClient.java | ConfigSignatureVerifierClient.getSignatureVerifier | @Override
public SignatureVerifier getSignatureVerifier() throws Exception {
try {
HttpEntity<Void> request = new HttpEntity<>(new HttpHeaders());
String content = restTemplate.exchange(getPublicKeyEndpoint(),
HttpMethod.GET, request, String.class).getBody();
... | java | @Override
public SignatureVerifier getSignatureVerifier() throws Exception {
try {
HttpEntity<Void> request = new HttpEntity<>(new HttpHeaders());
String content = restTemplate.exchange(getPublicKeyEndpoint(),
HttpMethod.GET, request, String.class).getBody();
... | [
"@",
"Override",
"public",
"SignatureVerifier",
"getSignatureVerifier",
"(",
")",
"throws",
"Exception",
"{",
"try",
"{",
"HttpEntity",
"<",
"Void",
">",
"request",
"=",
"new",
"HttpEntity",
"<>",
"(",
"new",
"HttpHeaders",
"(",
")",
")",
";",
"String",
"con... | Fetches the public key from the MS Config.
@return the public key used to verify JWT tokens; or null. | [
"Fetches",
"the",
"public",
"key",
"from",
"the",
"MS",
"Config",
"."
] | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-security/src/main/java/com/icthh/xm/commons/security/oauth2/ConfigSignatureVerifierClient.java#L44-L67 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/document/output/RtfByteArrayBuffer.java | RtfByteArrayBuffer.write | public void write(final byte[] src, int off, int len)
{
if(src == null) throw new NullPointerException();
if((off < 0) || (off > src.length) || (len < 0) || ((off + len) > src.length) || ((off + len) < 0)) throw new IndexOutOfBoundsException();
writeLoop(src, off, len);
} | java | public void write(final byte[] src, int off, int len)
{
if(src == null) throw new NullPointerException();
if((off < 0) || (off > src.length) || (len < 0) || ((off + len) > src.length) || ((off + len) < 0)) throw new IndexOutOfBoundsException();
writeLoop(src, off, len);
} | [
"public",
"void",
"write",
"(",
"final",
"byte",
"[",
"]",
"src",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"if",
"(",
"src",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"if",
"(",
"(",
"off",
"<",
"0",
")",
... | Copies len bytes starting at position off from the array src to the internal buffer.
@param src
@param off
@param len | [
"Copies",
"len",
"bytes",
"starting",
"at",
"position",
"off",
"from",
"the",
"array",
"src",
"to",
"the",
"internal",
"buffer",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/document/output/RtfByteArrayBuffer.java#L182-L188 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.captureAsync | public Observable<VirtualMachineCaptureResultInner> captureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) {
return captureWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1<ServiceResponse<VirtualMachineCaptureResultInner>, VirtualMachineCap... | java | public Observable<VirtualMachineCaptureResultInner> captureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) {
return captureWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1<ServiceResponse<VirtualMachineCaptureResultInner>, VirtualMachineCap... | [
"public",
"Observable",
"<",
"VirtualMachineCaptureResultInner",
">",
"captureAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"VirtualMachineCaptureParameters",
"parameters",
")",
"{",
"return",
"captureWithServiceResponseAsync",
"(",
"resourceGroupN... | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Capture Virtual Machine operation.
@throws IllegalA... | [
"Captures",
"the",
"VM",
"by",
"copying",
"virtual",
"hard",
"disks",
"of",
"the",
"VM",
"and",
"outputs",
"a",
"template",
"that",
"can",
"be",
"used",
"to",
"create",
"similar",
"VMs",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L405-L412 |
cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java | CxSmilesParser.processIntList | private static boolean processIntList(CharIter iter, char sep, List<Integer> dest) {
while (iter.hasNext()) {
char c = iter.curr();
if (isDigit(c)) {
int r = processUnsignedInt(iter);
if (r < 0) return false;
iter.nextIf(sep);
... | java | private static boolean processIntList(CharIter iter, char sep, List<Integer> dest) {
while (iter.hasNext()) {
char c = iter.curr();
if (isDigit(c)) {
int r = processUnsignedInt(iter);
if (r < 0) return false;
iter.nextIf(sep);
... | [
"private",
"static",
"boolean",
"processIntList",
"(",
"CharIter",
"iter",
",",
"char",
"sep",
",",
"List",
"<",
"Integer",
">",
"dest",
")",
"{",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"char",
"c",
"=",
"iter",
".",
"curr",
"(",
... | Process a list of unsigned integers.
@param iter char iter
@param sep the separator
@param dest output
@return int-list was successfully processed | [
"Process",
"a",
"list",
"of",
"unsigned",
"integers",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java#L567-L581 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java | RedisJobStore.doWithLock | private <T> T doWithLock(LockCallback<T> callback, String errorMessage) throws JobPersistenceException {
JedisCommands jedis = null;
try {
jedis = getResource();
try {
storage.waitForLock(jedis);
return callback.doWithLock(jedis);
} cat... | java | private <T> T doWithLock(LockCallback<T> callback, String errorMessage) throws JobPersistenceException {
JedisCommands jedis = null;
try {
jedis = getResource();
try {
storage.waitForLock(jedis);
return callback.doWithLock(jedis);
} cat... | [
"private",
"<",
"T",
">",
"T",
"doWithLock",
"(",
"LockCallback",
"<",
"T",
">",
"callback",
",",
"String",
"errorMessage",
")",
"throws",
"JobPersistenceException",
"{",
"JedisCommands",
"jedis",
"=",
"null",
";",
"try",
"{",
"jedis",
"=",
"getResource",
"(... | Perform a redis operation while lock is acquired
@param callback a callback containing the actions to perform during lock
@param errorMessage optional error message to include in exception should an error arise
@param <T> return class
@return the result of the actions performed while locked, if any
@throws JobPersisten... | [
"Perform",
"a",
"redis",
"operation",
"while",
"lock",
"is",
"acquired"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java#L1148-L1171 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/URIDestinationCreator.java | URIDestinationCreator.charIsEscaped | private static boolean charIsEscaped(String str, int index) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "charIsEscaped", new Object[]{str, index});
// precondition, null str or out of range index returns false.
if (str == null || index < 0 || index >= str.length()) re... | java | private static boolean charIsEscaped(String str, int index) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "charIsEscaped", new Object[]{str, index});
// precondition, null str or out of range index returns false.
if (str == null || index < 0 || index >= str.length()) re... | [
"private",
"static",
"boolean",
"charIsEscaped",
"(",
"String",
"str",
",",
"int",
"index",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
"... | Test if the specified character is escaped.
Checks whether the character at the specified index is preceded by an
escape character. The test is non-trivial because it has to check that
the escape character is itself non-escaped.
@param str The string in which to perform the check
@param index The index in the string of... | [
"Test",
"if",
"the",
"specified",
"character",
"is",
"escaped",
".",
"Checks",
"whether",
"the",
"character",
"at",
"the",
"specified",
"index",
"is",
"preceded",
"by",
"an",
"escape",
"character",
".",
"The",
"test",
"is",
"non",
"-",
"trivial",
"because",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/URIDestinationCreator.java#L1012-L1029 |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundGroup.java | SoundGroup.acquireSource | protected Source acquireSource (Sound acquirer)
{
// start at the beginning of the list looking for an available source
for (int ii = 0, ll = _sources.size(); ii < ll; ii++) {
PooledSource pooled = _sources.get(ii);
if (pooled.holder == null || pooled.holder.reclaim()) {
... | java | protected Source acquireSource (Sound acquirer)
{
// start at the beginning of the list looking for an available source
for (int ii = 0, ll = _sources.size(); ii < ll; ii++) {
PooledSource pooled = _sources.get(ii);
if (pooled.holder == null || pooled.holder.reclaim()) {
... | [
"protected",
"Source",
"acquireSource",
"(",
"Sound",
"acquirer",
")",
"{",
"// start at the beginning of the list looking for an available source",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"ll",
"=",
"_sources",
".",
"size",
"(",
")",
";",
"ii",
"<",
"ll",
";",
... | Called by a {@link Sound} when it wants to obtain a source on which to play its clip. | [
"Called",
"by",
"a",
"{"
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundGroup.java#L141-L156 |
aws/aws-sdk-java | aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/SearchProductsAsAdminRequest.java | SearchProductsAsAdminRequest.setFilters | public void setFilters(java.util.Map<String, java.util.List<String>> filters) {
this.filters = filters;
} | java | public void setFilters(java.util.Map<String, java.util.List<String>> filters) {
this.filters = filters;
} | [
"public",
"void",
"setFilters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"filters",
")",
"{",
"this",
".",
"filters",
"=",
"filters",
";",
"}"
] | <p>
The search filters. If no search filters are specified, the output includes all products to which the
administrator has access.
</p>
@param filters
The search filters. If no search filters are specified, the output includes all products to which the
administrator has access. | [
"<p",
">",
"The",
"search",
"filters",
".",
"If",
"no",
"search",
"filters",
"are",
"specified",
"the",
"output",
"includes",
"all",
"products",
"to",
"which",
"the",
"administrator",
"has",
"access",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/SearchProductsAsAdminRequest.java#L299-L301 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.getVirtualMachineScaleSetNetworkInterfaceAsync | public Observable<NetworkInterfaceInner> getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) {
return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupNam... | java | public Observable<NetworkInterfaceInner> getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) {
return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupNam... | [
"public",
"Observable",
"<",
"NetworkInterfaceInner",
">",
"getVirtualMachineScaleSetNetworkInterfaceAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualMachineScaleSetName",
",",
"String",
"virtualmachineIndex",
",",
"String",
"networkInterfaceName",
",",
"Strin... | Get the specified network interface in a virtual machine scale set.
@param resourceGroupName The name of the resource group.
@param virtualMachineScaleSetName The name of the virtual machine scale set.
@param virtualmachineIndex The virtual machine index.
@param networkInterfaceName The name of the network interface.
... | [
"Get",
"the",
"specified",
"network",
"interface",
"in",
"a",
"virtual",
"machine",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L1872-L1879 |
phoenixnap/springmvc-raml-plugin | src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/data/ApiBodyMetadata.java | ApiBodyMetadata.getCodeModel | public JCodeModel getCodeModel(String basePackage, String schemaLocation, Annotator annotator) {
if (type != null) {
return codeModel;
} else {
return SchemaHelper.buildBodyJCodeModel(schemaLocation, basePackage, name, schema, annotator);
}
} | java | public JCodeModel getCodeModel(String basePackage, String schemaLocation, Annotator annotator) {
if (type != null) {
return codeModel;
} else {
return SchemaHelper.buildBodyJCodeModel(schemaLocation, basePackage, name, schema, annotator);
}
} | [
"public",
"JCodeModel",
"getCodeModel",
"(",
"String",
"basePackage",
",",
"String",
"schemaLocation",
",",
"Annotator",
"annotator",
")",
"{",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"return",
"codeModel",
";",
"}",
"else",
"{",
"return",
"SchemaHelper",
... | Builds a JCodeModel for this body
@param basePackage
The package we will be using for the domain objects
@param schemaLocation
The location of this schema, will be used to create absolute
URIs for $ref tags eg "classpath:/"
@param annotator
JsonSchema2Pojo annotator. if null a default annotator will be
used
@return bu... | [
"Builds",
"a",
"JCodeModel",
"for",
"this",
"body"
] | train | https://github.com/phoenixnap/springmvc-raml-plugin/blob/6387072317cd771eb7d6f30943f556ac20dd3c84/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/data/ApiBodyMetadata.java#L151-L157 |
uber/NullAway | nullaway/src/main/java/com/uber/nullaway/dataflow/DataFlow.java | DataFlow.expressionDataflow | @Nullable
public <A extends AbstractValue<A>, S extends Store<S>, T extends TransferFunction<A, S>>
A expressionDataflow(TreePath exprPath, Context context, T transfer) {
AnalysisResult<A, S> analysisResult = resultForExpr(exprPath, context, transfer);
return analysisResult == null ? null : analysisResu... | java | @Nullable
public <A extends AbstractValue<A>, S extends Store<S>, T extends TransferFunction<A, S>>
A expressionDataflow(TreePath exprPath, Context context, T transfer) {
AnalysisResult<A, S> analysisResult = resultForExpr(exprPath, context, transfer);
return analysisResult == null ? null : analysisResu... | [
"@",
"Nullable",
"public",
"<",
"A",
"extends",
"AbstractValue",
"<",
"A",
">",
",",
"S",
"extends",
"Store",
"<",
"S",
">",
",",
"T",
"extends",
"TransferFunction",
"<",
"A",
",",
"S",
">",
">",
"A",
"expressionDataflow",
"(",
"TreePath",
"exprPath",
... | Run the {@code transfer} dataflow analysis to compute the abstract value of the expression
which is the leaf of {@code exprPath}.
@param exprPath expression
@param context Javac context
@param transfer transfer functions
@param <A> values in abstraction
@param <S> store type
@param <T> transfer function type
@return d... | [
"Run",
"the",
"{",
"@code",
"transfer",
"}",
"dataflow",
"analysis",
"to",
"compute",
"the",
"abstract",
"value",
"of",
"the",
"expression",
"which",
"is",
"the",
"leaf",
"of",
"{",
"@code",
"exprPath",
"}",
"."
] | train | https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/nullaway/src/main/java/com/uber/nullaway/dataflow/DataFlow.java#L170-L175 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/Ansi.java | Ansi.errFormat | public void errFormat(String format, Object... args){
format(System.err, format, args);
} | java | public void errFormat(String format, Object... args){
format(System.err, format, args);
} | [
"public",
"void",
"errFormat",
"(",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"format",
"(",
"System",
".",
"err",
",",
"format",
",",
"args",
")",
";",
"}"
] | Prints formatted and colorized {@code format} to {@link System#err}
@param format A format string whose output to be colorized
@param args Arguments referenced by the format specifiers in the format | [
"Prints",
"formatted",
"and",
"colorized",
"{",
"@code",
"format",
"}",
"to",
"{",
"@link",
"System#err",
"}"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/Ansi.java#L336-L338 |
javers/javers | javers-core/src/main/java/org/javers/core/metamodel/type/TypeMapper.java | TypeMapper.getJaversManagedType | public <T extends ManagedType> T getJaversManagedType(Class javaClass, Class<T> expectedType) {
JaversType mType = getJaversType(javaClass);
if (expectedType.isAssignableFrom(mType.getClass())) {
return (T) mType;
} else {
throw new JaversException(JaversExceptionCode.MA... | java | public <T extends ManagedType> T getJaversManagedType(Class javaClass, Class<T> expectedType) {
JaversType mType = getJaversType(javaClass);
if (expectedType.isAssignableFrom(mType.getClass())) {
return (T) mType;
} else {
throw new JaversException(JaversExceptionCode.MA... | [
"public",
"<",
"T",
"extends",
"ManagedType",
">",
"T",
"getJaversManagedType",
"(",
"Class",
"javaClass",
",",
"Class",
"<",
"T",
">",
"expectedType",
")",
"{",
"JaversType",
"mType",
"=",
"getJaversType",
"(",
"javaClass",
")",
";",
"if",
"(",
"expectedTyp... | If given javaClass is mapped to expected ManagedType, returns its JaversType
@throws JaversException MANAGED_CLASS_MAPPING_ERROR | [
"If",
"given",
"javaClass",
"is",
"mapped",
"to",
"expected",
"ManagedType",
"returns",
"its",
"JaversType"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/core/metamodel/type/TypeMapper.java#L179-L190 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplator.setVariableEsc | public void setVariableEsc(String variableName, String variableValue, boolean isOptional)
throws VariableNotDefinedException {
setVariable(variableName, escapeHtml(variableValue), isOptional);
} | java | public void setVariableEsc(String variableName, String variableValue, boolean isOptional)
throws VariableNotDefinedException {
setVariable(variableName, escapeHtml(variableValue), isOptional);
} | [
"public",
"void",
"setVariableEsc",
"(",
"String",
"variableName",
",",
"String",
"variableValue",
",",
"boolean",
"isOptional",
")",
"throws",
"VariableNotDefinedException",
"{",
"setVariable",
"(",
"variableName",
",",
"escapeHtml",
"(",
"variableValue",
")",
",",
... | Sets a template variable to an escaped value.
<p>
Convenience method for:
<code>setVariable (variableName, MiniTemplator.escapeHtml(variableValue), isOptional)</code>
@param variableName the name of the variable to be set.
@param variableValue the new value of the variable. May be <code>null</code>. Special HTML/XML c... | [
"Sets",
"a",
"template",
"variable",
"to",
"an",
"escaped",
"value",
".",
"<p",
">",
"Convenience",
"method",
"for",
":",
"<code",
">",
"setVariable",
"(",
"variableName",
"MiniTemplator",
".",
"escapeHtml",
"(",
"variableValue",
")",
"isOptional",
")",
"<",
... | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L451-L454 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/WhitelistingApi.java | WhitelistingApi.deleteWhitelistCertificate | public WhitelistEnvelope deleteWhitelistCertificate(String dtid, String cid) throws ApiException {
ApiResponse<WhitelistEnvelope> resp = deleteWhitelistCertificateWithHttpInfo(dtid, cid);
return resp.getData();
} | java | public WhitelistEnvelope deleteWhitelistCertificate(String dtid, String cid) throws ApiException {
ApiResponse<WhitelistEnvelope> resp = deleteWhitelistCertificateWithHttpInfo(dtid, cid);
return resp.getData();
} | [
"public",
"WhitelistEnvelope",
"deleteWhitelistCertificate",
"(",
"String",
"dtid",
",",
"String",
"cid",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"WhitelistEnvelope",
">",
"resp",
"=",
"deleteWhitelistCertificateWithHttpInfo",
"(",
"dtid",
",",
"cid",
... | Delete a whitelist certificate associated with a devicetype.
Delete a whitelist certificate associated with a devicetype.
@param dtid Device Type ID. (required)
@param cid Certificate ID. (required)
@return WhitelistEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the respo... | [
"Delete",
"a",
"whitelist",
"certificate",
"associated",
"with",
"a",
"devicetype",
".",
"Delete",
"a",
"whitelist",
"certificate",
"associated",
"with",
"a",
"devicetype",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/WhitelistingApi.java#L265-L268 |
jhalterman/concurrentunit | src/main/java/net/jodah/concurrentunit/Waiter.java | Waiter.assertEquals | public void assertEquals(Object expected, Object actual) {
if (expected == null && actual == null)
return;
if (expected != null && expected.equals(actual))
return;
fail(format(expected, actual));
} | java | public void assertEquals(Object expected, Object actual) {
if (expected == null && actual == null)
return;
if (expected != null && expected.equals(actual))
return;
fail(format(expected, actual));
} | [
"public",
"void",
"assertEquals",
"(",
"Object",
"expected",
",",
"Object",
"actual",
")",
"{",
"if",
"(",
"expected",
"==",
"null",
"&&",
"actual",
"==",
"null",
")",
"return",
";",
"if",
"(",
"expected",
"!=",
"null",
"&&",
"expected",
".",
"equals",
... | Asserts that the {@code expected} values equals the {@code actual} value
@throws AssertionError when the assertion fails | [
"Asserts",
"that",
"the",
"{",
"@code",
"expected",
"}",
"values",
"equals",
"the",
"{",
"@code",
"actual",
"}",
"value"
] | train | https://github.com/jhalterman/concurrentunit/blob/403b82537866e5ba598017d874753e12fa7aab10/src/main/java/net/jodah/concurrentunit/Waiter.java#L47-L53 |
Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/block/stream/BlockInStream.java | BlockInStream.createRemoteBlockInStream | public static BlockInStream createRemoteBlockInStream(FileSystemContext context, long blockId,
WorkerNetAddress address, BlockInStreamSource blockSource, long blockSize,
Protocol.OpenUfsBlockOptions ufsOptions) {
long chunkSize =
context.getClusterConf()
.getBytes(PropertyKey.USER_NE... | java | public static BlockInStream createRemoteBlockInStream(FileSystemContext context, long blockId,
WorkerNetAddress address, BlockInStreamSource blockSource, long blockSize,
Protocol.OpenUfsBlockOptions ufsOptions) {
long chunkSize =
context.getClusterConf()
.getBytes(PropertyKey.USER_NE... | [
"public",
"static",
"BlockInStream",
"createRemoteBlockInStream",
"(",
"FileSystemContext",
"context",
",",
"long",
"blockId",
",",
"WorkerNetAddress",
"address",
",",
"BlockInStreamSource",
"blockSource",
",",
"long",
"blockSize",
",",
"Protocol",
".",
"OpenUfsBlockOptio... | Creates a {@link BlockInStream} to read from a specific remote server. Should only be used
in cases where the data source and method of reading is known, ie. worker - worker
communication.
@param context the file system context
@param blockId the block id
@param address the address of the gRPC data server
@param block... | [
"Creates",
"a",
"{",
"@link",
"BlockInStream",
"}",
"to",
"read",
"from",
"a",
"specific",
"remote",
"server",
".",
"Should",
"only",
"be",
"used",
"in",
"cases",
"where",
"the",
"data",
"source",
"and",
"method",
"of",
"reading",
"is",
"known",
"ie",
".... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/stream/BlockInStream.java#L193-L204 |
square/dagger | compiler/src/main/java/dagger/internal/codegen/Util.java | Util.rawTypeToString | public static String rawTypeToString(TypeMirror type, char innerClassSeparator) {
if (!(type instanceof DeclaredType)) {
throw new IllegalArgumentException("Unexpected type: " + type);
}
StringBuilder result = new StringBuilder();
DeclaredType declaredType = (DeclaredType) type;
rawTypeToStrin... | java | public static String rawTypeToString(TypeMirror type, char innerClassSeparator) {
if (!(type instanceof DeclaredType)) {
throw new IllegalArgumentException("Unexpected type: " + type);
}
StringBuilder result = new StringBuilder();
DeclaredType declaredType = (DeclaredType) type;
rawTypeToStrin... | [
"public",
"static",
"String",
"rawTypeToString",
"(",
"TypeMirror",
"type",
",",
"char",
"innerClassSeparator",
")",
"{",
"if",
"(",
"!",
"(",
"type",
"instanceof",
"DeclaredType",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Unexpected type:... | Returns a string for the raw type of {@code type}. Primitive types are always boxed. | [
"Returns",
"a",
"string",
"for",
"the",
"raw",
"type",
"of",
"{"
] | train | https://github.com/square/dagger/blob/572cdd2fe97fc3c148fb3d8e1b2ce7beb4dcbcde/compiler/src/main/java/dagger/internal/codegen/Util.java#L104-L112 |
qatools/properties | src/main/java/ru/qatools/properties/utils/PropsReplacer.java | PropsReplacer.replaceProps | public PropsReplacer replaceProps(String pattern, Properties properties) {
List<String> replaced = new ArrayList<>();
for (String path : paths) {
replaced.add(replaceProps(pattern, path, properties));
}
setPaths(replaced);
return this;
} | java | public PropsReplacer replaceProps(String pattern, Properties properties) {
List<String> replaced = new ArrayList<>();
for (String path : paths) {
replaced.add(replaceProps(pattern, path, properties));
}
setPaths(replaced);
return this;
} | [
"public",
"PropsReplacer",
"replaceProps",
"(",
"String",
"pattern",
",",
"Properties",
"properties",
")",
"{",
"List",
"<",
"String",
">",
"replaced",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"path",
":",
"paths",
")",
"{",
"r... | Fluent-api method. Replace properties in each path from paths field using pattern. Change paths filed value
@param pattern - pattern to replace. First group should contains property name
@param properties - list of properties using to replace
@return PropsReplacer | [
"Fluent",
"-",
"api",
"method",
".",
"Replace",
"properties",
"in",
"each",
"path",
"from",
"paths",
"field",
"using",
"pattern",
".",
"Change",
"paths",
"filed",
"value"
] | train | https://github.com/qatools/properties/blob/ae50b460a6bb4fcb21afe888b2e86a7613cd2115/src/main/java/ru/qatools/properties/utils/PropsReplacer.java#L29-L36 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getTMScore | public static double getTMScore(Atom[] atomSet1, Atom[] atomSet2, int len1, int len2) throws StructureException {
return getTMScore(atomSet1, atomSet2, len1, len2,true);
} | java | public static double getTMScore(Atom[] atomSet1, Atom[] atomSet2, int len1, int len2) throws StructureException {
return getTMScore(atomSet1, atomSet2, len1, len2,true);
} | [
"public",
"static",
"double",
"getTMScore",
"(",
"Atom",
"[",
"]",
"atomSet1",
",",
"Atom",
"[",
"]",
"atomSet2",
",",
"int",
"len1",
",",
"int",
"len2",
")",
"throws",
"StructureException",
"{",
"return",
"getTMScore",
"(",
"atomSet1",
",",
"atomSet2",
",... | Calculate the TM-Score for the superposition.
<em>Normalizes by the <strong>minimum</strong>-length structure (that is, {@code min\{len1,len2\}}).</em>
Atom sets must be pre-rotated.
<p>
Citation:<br/>
<i>Zhang Y and Skolnick J (2004). "Scoring function for automated
assessment of protein structure template quality"... | [
"Calculate",
"the",
"TM",
"-",
"Score",
"for",
"the",
"superposition",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L1285-L1287 |
gfk-ba/senbot | SenBotRunner/src/main/java/com/gfk/senbot/framework/data/SenBotReferenceService.java | SenBotReferenceService.getElementLocatorForElementReference | public By getElementLocatorForElementReference(String elementReference, String apendix) {
Map<String, By> objectReferenceMap = getObjectReferenceMap(By.class);
By elementLocator = objectReferenceMap.get(elementReference);
if (elementLocator instanceof ById) {
String xpathExpressio... | java | public By getElementLocatorForElementReference(String elementReference, String apendix) {
Map<String, By> objectReferenceMap = getObjectReferenceMap(By.class);
By elementLocator = objectReferenceMap.get(elementReference);
if (elementLocator instanceof ById) {
String xpathExpressio... | [
"public",
"By",
"getElementLocatorForElementReference",
"(",
"String",
"elementReference",
",",
"String",
"apendix",
")",
"{",
"Map",
"<",
"String",
",",
"By",
">",
"objectReferenceMap",
"=",
"getObjectReferenceMap",
"(",
"By",
".",
"class",
")",
";",
"By",
"ele... | Find a {@link By} locator by its reference name and add something to the xpath before the element gets returned
The drawback of using this method is, that all locators are converted into By.xpath
@param elementReference The name under which the refference is found
@param apendix The part of the xpath that shall be add... | [
"Find",
"a",
"{",
"@link",
"By",
"}",
"locator",
"by",
"its",
"reference",
"name",
"and",
"add",
"something",
"to",
"the",
"xpath",
"before",
"the",
"element",
"gets",
"returned",
"The",
"drawback",
"of",
"using",
"this",
"method",
"is",
"that",
"all",
"... | train | https://github.com/gfk-ba/senbot/blob/e9a152aa67be48b1bb13a4691655caf6d873b553/SenBotRunner/src/main/java/com/gfk/senbot/framework/data/SenBotReferenceService.java#L167-L185 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/platform/PersistentSettings.java | PersistentSettings.saveProperty | public PersistentSettings saveProperty(DbSession dbSession, String key, @Nullable String value) {
savePropertyImpl(dbSession, key, value);
changeNotifier.onGlobalPropertyChange(key, value);
return this;
} | java | public PersistentSettings saveProperty(DbSession dbSession, String key, @Nullable String value) {
savePropertyImpl(dbSession, key, value);
changeNotifier.onGlobalPropertyChange(key, value);
return this;
} | [
"public",
"PersistentSettings",
"saveProperty",
"(",
"DbSession",
"dbSession",
",",
"String",
"key",
",",
"@",
"Nullable",
"String",
"value",
")",
"{",
"savePropertyImpl",
"(",
"dbSession",
",",
"key",
",",
"value",
")",
";",
"changeNotifier",
".",
"onGlobalProp... | Insert property into database if value is not {@code null}, else delete property from
database. Session is not committed but {@link org.sonar.api.config.GlobalPropertyChangeHandler}
are executed. | [
"Insert",
"property",
"into",
"database",
"if",
"value",
"is",
"not",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/platform/PersistentSettings.java#L51-L55 |
threerings/narya | core/src/main/java/com/threerings/presents/client/Client.java | Client.standaloneLogon | public void standaloneLogon (BootstrapData data, DObjectManager omgr)
{
if (!_standalone) {
throw new IllegalStateException("Must call prepareStandaloneLogon() first.");
}
gotBootstrap(data, omgr);
} | java | public void standaloneLogon (BootstrapData data, DObjectManager omgr)
{
if (!_standalone) {
throw new IllegalStateException("Must call prepareStandaloneLogon() first.");
}
gotBootstrap(data, omgr);
} | [
"public",
"void",
"standaloneLogon",
"(",
"BootstrapData",
"data",
",",
"DObjectManager",
"omgr",
")",
"{",
"if",
"(",
"!",
"_standalone",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Must call prepareStandaloneLogon() first.\"",
")",
";",
"}",
"gotBoo... | Logs this client on in standalone mode with the faked bootstrap data and shared local
distributed object manager. | [
"Logs",
"this",
"client",
"on",
"in",
"standalone",
"mode",
"with",
"the",
"faked",
"bootstrap",
"data",
"and",
"shared",
"local",
"distributed",
"object",
"manager",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L635-L641 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_FurthestCoordinate.java | ST_FurthestCoordinate.getFurthestCoordinate | public static Geometry getFurthestCoordinate(Point point, Geometry geom) {
if (point == null || geom == null) {
return null;
}
double maxDistance = Double.NEGATIVE_INFINITY;
Coordinate pointCoordinate = point.getCoordinate();
Set<Coordinate> furthestCoordinates = new ... | java | public static Geometry getFurthestCoordinate(Point point, Geometry geom) {
if (point == null || geom == null) {
return null;
}
double maxDistance = Double.NEGATIVE_INFINITY;
Coordinate pointCoordinate = point.getCoordinate();
Set<Coordinate> furthestCoordinates = new ... | [
"public",
"static",
"Geometry",
"getFurthestCoordinate",
"(",
"Point",
"point",
",",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"point",
"==",
"null",
"||",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"double",
"maxDistance",
"=",
"Double",
... | Computes the furthest coordinate(s) contained in the given geometry starting
from the given point, using the 2D distance.
@param point Point
@param geom Geometry
@return The furthest coordinate(s) contained in the given geometry starting from
the given point, using the 2D distance | [
"Computes",
"the",
"furthest",
"coordinate",
"(",
"s",
")",
"contained",
"in",
"the",
"given",
"geometry",
"starting",
"from",
"the",
"given",
"point",
"using",
"the",
"2D",
"distance",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_FurthestCoordinate.java#L64-L87 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.readFile | public <OUT> DataStreamSource<OUT> readFile(FileInputFormat<OUT> inputFormat,
String filePath) {
return readFile(inputFormat, filePath, FileProcessingMode.PROCESS_ONCE, -1);
} | java | public <OUT> DataStreamSource<OUT> readFile(FileInputFormat<OUT> inputFormat,
String filePath) {
return readFile(inputFormat, filePath, FileProcessingMode.PROCESS_ONCE, -1);
} | [
"public",
"<",
"OUT",
">",
"DataStreamSource",
"<",
"OUT",
">",
"readFile",
"(",
"FileInputFormat",
"<",
"OUT",
">",
"inputFormat",
",",
"String",
"filePath",
")",
"{",
"return",
"readFile",
"(",
"inputFormat",
",",
"filePath",
",",
"FileProcessingMode",
".",
... | Reads the contents of the user-specified {@code filePath} based on the given {@link FileInputFormat}.
<p>Since all data streams need specific information about their types, this method needs to determine the
type of the data produced by the input format. It will attempt to determine the data type by reflection,
unless... | [
"Reads",
"the",
"contents",
"of",
"the",
"user",
"-",
"specified",
"{",
"@code",
"filePath",
"}",
"based",
"on",
"the",
"given",
"{",
"@link",
"FileInputFormat",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L994-L997 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java | SyncMembersInner.createOrUpdate | public SyncMemberInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName, SyncMemberInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters)... | java | public SyncMemberInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName, SyncMemberInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters)... | [
"public",
"SyncMemberInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"String",
"syncMemberName",
",",
"SyncMemberInner",
"parameters",
")",
"{",
"return",
"c... | Creates or updates a sync member.
@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 on which the sync group is hosted.
@p... | [
"Creates",
"or",
"updates",
"a",
"sync",
"member",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L241-L243 |
iipc/webarchive-commons | src/main/java/org/archive/util/Recorder.java | Recorder.wrapInputStreamWithHttpRecord | public static Recorder wrapInputStreamWithHttpRecord(File dir,
String basename, InputStream in, String encoding)
throws IOException {
Recorder rec = new Recorder(dir, basename);
if (encoding != null && encoding.length() > 0) {
rec.setCharset(Charset.forName(encoding));
}
... | java | public static Recorder wrapInputStreamWithHttpRecord(File dir,
String basename, InputStream in, String encoding)
throws IOException {
Recorder rec = new Recorder(dir, basename);
if (encoding != null && encoding.length() > 0) {
rec.setCharset(Charset.forName(encoding));
}
... | [
"public",
"static",
"Recorder",
"wrapInputStreamWithHttpRecord",
"(",
"File",
"dir",
",",
"String",
"basename",
",",
"InputStream",
"in",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"Recorder",
"rec",
"=",
"new",
"Recorder",
"(",
"dir",
",",
... | Record the input stream for later playback by an extractor, etc.
This is convenience method used to setup an artificial HttpRecorder
scenario used in unit tests, etc.
@param dir Directory to write backing file to.
@param basename of what we're recording.
@param in Stream to read.
@param encoding Stream encoding.
@throw... | [
"Record",
"the",
"input",
"stream",
"for",
"later",
"playback",
"by",
"an",
"extractor",
"etc",
".",
"This",
"is",
"convenience",
"method",
"used",
"to",
"setup",
"an",
"artificial",
"HttpRecorder",
"scenario",
"used",
"in",
"unit",
"tests",
"etc",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/Recorder.java#L554-L575 |
webmetrics/browsermob-proxy | src/main/java/org/xbill/DNS/security/CERTConverter.java | CERTConverter.buildRecord | public static CERTRecord
buildRecord(Name name, int dclass, long ttl, Certificate cert, int tag,
int alg)
{
int type;
byte [] data;
try {
if (cert instanceof X509Certificate) {
type = CERTRecord.PKIX;
data = cert.getEncoded();
}
else
return null;
return new CERTRecord(name, dclass, ttl, type,... | java | public static CERTRecord
buildRecord(Name name, int dclass, long ttl, Certificate cert, int tag,
int alg)
{
int type;
byte [] data;
try {
if (cert instanceof X509Certificate) {
type = CERTRecord.PKIX;
data = cert.getEncoded();
}
else
return null;
return new CERTRecord(name, dclass, ttl, type,... | [
"public",
"static",
"CERTRecord",
"buildRecord",
"(",
"Name",
"name",
",",
"int",
"dclass",
",",
"long",
"ttl",
",",
"Certificate",
"cert",
",",
"int",
"tag",
",",
"int",
"alg",
")",
"{",
"int",
"type",
";",
"byte",
"[",
"]",
"data",
";",
"try",
"{",... | Builds a CERT record from a Certificate associated with a key also in DNS | [
"Builds",
"a",
"CERT",
"record",
"from",
"a",
"Certificate",
"associated",
"with",
"a",
"key",
"also",
"in",
"DNS"
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/CERTConverter.java#L56-L78 |
codelibs/jcifs | src/main/java/jcifs/smb1/Config.java | Config.getLong | public static long getLong( String key, long def ) {
String s = prp.getProperty( key );
if( s != null ) {
try {
def = Long.parseLong( s );
} catch( NumberFormatException nfe ) {
if( log.level > 0 )
nfe.printStackTrace( log );
... | java | public static long getLong( String key, long def ) {
String s = prp.getProperty( key );
if( s != null ) {
try {
def = Long.parseLong( s );
} catch( NumberFormatException nfe ) {
if( log.level > 0 )
nfe.printStackTrace( log );
... | [
"public",
"static",
"long",
"getLong",
"(",
"String",
"key",
",",
"long",
"def",
")",
"{",
"String",
"s",
"=",
"prp",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"try",
"{",
"def",
"=",
"Long",
".",
"parseLon... | Retrieve a <code>long</code>. If the key does not exist or
cannot be converted to a <code>long</code>, the provided default
argument will be returned. | [
"Retrieve",
"a",
"<code",
">",
"long<",
"/",
"code",
">",
".",
"If",
"the",
"key",
"does",
"not",
"exist",
"or",
"cannot",
"be",
"converted",
"to",
"a",
"<code",
">",
"long<",
"/",
"code",
">",
"the",
"provided",
"default",
"argument",
"will",
"be",
... | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/Config.java#L259-L270 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/boosting/Bagging.java | Bagging.getWeightSampledDataSet | public static RegressionDataSet getWeightSampledDataSet(RegressionDataSet dataSet, int[] sampledCounts)
{
RegressionDataSet destination = new RegressionDataSet(dataSet.getNumNumericalVars(), dataSet.getCategories());
for (int i = 0; i < sampledCounts.length; i++)
{
if(sampledCou... | java | public static RegressionDataSet getWeightSampledDataSet(RegressionDataSet dataSet, int[] sampledCounts)
{
RegressionDataSet destination = new RegressionDataSet(dataSet.getNumNumericalVars(), dataSet.getCategories());
for (int i = 0; i < sampledCounts.length; i++)
{
if(sampledCou... | [
"public",
"static",
"RegressionDataSet",
"getWeightSampledDataSet",
"(",
"RegressionDataSet",
"dataSet",
",",
"int",
"[",
"]",
"sampledCounts",
")",
"{",
"RegressionDataSet",
"destination",
"=",
"new",
"RegressionDataSet",
"(",
"dataSet",
".",
"getNumNumericalVars",
"("... | Creates a new data set from the given sample counts. Points sampled
multiple times will be added once to the data set with their weight
multiplied by the number of times it was sampled.
@param dataSet the data set that was sampled from
@param sampledCounts the sampling values obtained from
{@link #sampleWithReplacement... | [
"Creates",
"a",
"new",
"data",
"set",
"from",
"the",
"given",
"sample",
"counts",
".",
"Points",
"sampled",
"multiple",
"times",
"will",
"be",
"added",
"once",
"to",
"the",
"data",
"set",
"with",
"their",
"weight",
"multiplied",
"by",
"the",
"number",
"of"... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/boosting/Bagging.java#L345-L358 |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/sender/MultiImplementationSender.java | MultiImplementationSender.addImplementation | public final MultiImplementationSender<M> addImplementation(Condition<Message> condition, MessageSender implementation) {
implementations.add(new Implementation(condition, implementation));
return this;
} | java | public final MultiImplementationSender<M> addImplementation(Condition<Message> condition, MessageSender implementation) {
implementations.add(new Implementation(condition, implementation));
return this;
} | [
"public",
"final",
"MultiImplementationSender",
"<",
"M",
">",
"addImplementation",
"(",
"Condition",
"<",
"Message",
">",
"condition",
",",
"MessageSender",
"implementation",
")",
"{",
"implementations",
".",
"add",
"(",
"new",
"Implementation",
"(",
"condition",
... | Register a new possible implementation with the associated condition. The
implementation is added at the end so any other possible implementation
will be used before this one if the associated condition allow it.
@param condition
the condition that indicates if the implementation can be used
at runtime
@param implemen... | [
"Register",
"a",
"new",
"possible",
"implementation",
"with",
"the",
"associated",
"condition",
".",
"The",
"implementation",
"is",
"added",
"at",
"the",
"end",
"so",
"any",
"other",
"possible",
"implementation",
"will",
"be",
"used",
"before",
"this",
"one",
... | train | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/sender/MultiImplementationSender.java#L90-L93 |
play1-maven-plugin/play1-maven-plugin | surefire-play-junit4/src/main/java/com/google/code/play/surefire/junit4/PlayJUnit4Provider.java | PlayJUnit4Provider.getPlayHome | private File getPlayHome( File applicationPath )
throws TestSetFailedException
{
File targetDir = new File( applicationPath, "target" );
File playTmpDir = new File( targetDir, "play" );
File playTmpHomeDir = new File( playTmpDir, "home" );
if ( !playTmpHomeDir.exists() )
... | java | private File getPlayHome( File applicationPath )
throws TestSetFailedException
{
File targetDir = new File( applicationPath, "target" );
File playTmpDir = new File( targetDir, "play" );
File playTmpHomeDir = new File( playTmpDir, "home" );
if ( !playTmpHomeDir.exists() )
... | [
"private",
"File",
"getPlayHome",
"(",
"File",
"applicationPath",
")",
"throws",
"TestSetFailedException",
"{",
"File",
"targetDir",
"=",
"new",
"File",
"(",
"applicationPath",
",",
"\"target\"",
")",
";",
"File",
"playTmpDir",
"=",
"new",
"File",
"(",
"targetDi... | Copy of AbstractPlayMojo.getPlayHome() method (with getCanonicalPath() changed to getAbsolutePath() ) | [
"Copy",
"of",
"AbstractPlayMojo",
".",
"getPlayHome",
"()",
"method",
"(",
"with",
"getCanonicalPath",
"()",
"changed",
"to",
"getAbsolutePath",
"()",
")"
] | train | https://github.com/play1-maven-plugin/play1-maven-plugin/blob/d5b2c29f4eb911e605a41529bf0aa0f83ec0aded/surefire-play-junit4/src/main/java/com/google/code/play/surefire/junit4/PlayJUnit4Provider.java#L134-L166 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java | LostExceptionStackTrace.addCatchBlock | private void addCatchBlock(int start, int finish) {
CatchInfo ci = new CatchInfo(start, finish);
catchInfos.add(ci);
} | java | private void addCatchBlock(int start, int finish) {
CatchInfo ci = new CatchInfo(start, finish);
catchInfos.add(ci);
} | [
"private",
"void",
"addCatchBlock",
"(",
"int",
"start",
",",
"int",
"finish",
")",
"{",
"CatchInfo",
"ci",
"=",
"new",
"CatchInfo",
"(",
"start",
",",
"finish",
")",
";",
"catchInfos",
".",
"add",
"(",
"ci",
")",
";",
"}"
] | add a catch block info record for the catch block that is guessed to be in the range of start to finish
@param start
the handler pc
@param finish
the guessed end of the catch block | [
"add",
"a",
"catch",
"block",
"info",
"record",
"for",
"the",
"catch",
"block",
"that",
"is",
"guessed",
"to",
"be",
"in",
"the",
"range",
"of",
"start",
"to",
"finish"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java#L423-L426 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.groupBy | public static Map groupBy(Iterable self, Object... closures) {
final Closure head = closures.length == 0 ? Closure.IDENTITY : (Closure) closures[0];
@SuppressWarnings("unchecked")
Map<Object, List> first = groupBy(self, head);
if (closures.length < 2)
return first;
... | java | public static Map groupBy(Iterable self, Object... closures) {
final Closure head = closures.length == 0 ? Closure.IDENTITY : (Closure) closures[0];
@SuppressWarnings("unchecked")
Map<Object, List> first = groupBy(self, head);
if (closures.length < 2)
return first;
... | [
"public",
"static",
"Map",
"groupBy",
"(",
"Iterable",
"self",
",",
"Object",
"...",
"closures",
")",
"{",
"final",
"Closure",
"head",
"=",
"closures",
".",
"length",
"==",
"0",
"?",
"Closure",
".",
"IDENTITY",
":",
"(",
"Closure",
")",
"closures",
"[",
... | Sorts all Iterable members into (sub)groups determined by the supplied
mapping closures. Each closure should return the key that this item
should be grouped by. The returned LinkedHashMap will have an entry for each
distinct 'key path' returned from the closures, with each value being a list
of items for that 'group pa... | [
"Sorts",
"all",
"Iterable",
"members",
"into",
"(",
"sub",
")",
"groups",
"determined",
"by",
"the",
"supplied",
"mapping",
"closures",
".",
"Each",
"closure",
"should",
"return",
"the",
"key",
"that",
"this",
"item",
"should",
"be",
"grouped",
"by",
".",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L5583-L5601 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/AbstractMustBeClosedChecker.java | AbstractMustBeClosedChecker.matchNewClassOrMethodInvocation | protected Description matchNewClassOrMethodInvocation(ExpressionTree tree, VisitorState state) {
Description description = checkClosed(tree, state);
if (description == NO_MATCH) {
return NO_MATCH;
}
if (AbstractReturnValueIgnored.expectedExceptionTest(tree, state)
|| MOCKITO_MATCHER.matche... | java | protected Description matchNewClassOrMethodInvocation(ExpressionTree tree, VisitorState state) {
Description description = checkClosed(tree, state);
if (description == NO_MATCH) {
return NO_MATCH;
}
if (AbstractReturnValueIgnored.expectedExceptionTest(tree, state)
|| MOCKITO_MATCHER.matche... | [
"protected",
"Description",
"matchNewClassOrMethodInvocation",
"(",
"ExpressionTree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"Description",
"description",
"=",
"checkClosed",
"(",
"tree",
",",
"state",
")",
";",
"if",
"(",
"description",
"==",
"NO_MATCH",
... | Check that constructors and methods annotated with {@link MustBeClosed} occur within the
resource variable initializer of a try-with-resources statement. | [
"Check",
"that",
"constructors",
"and",
"methods",
"annotated",
"with",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/AbstractMustBeClosedChecker.java#L75-L85 |
UrielCh/ovh-java-sdk | ovh-java-sdk-core/src/main/java/net/minidev/ovh/core/ApiOvhConfigBasic.java | ApiOvhConfigBasic.gettmpStore | protected File gettmpStore(String nic) {
if (consumer_key_storage == null || !consumer_key_storage.isDirectory()) {
if (e1 == 0) {
e1++;
log.error(
"No cert directory, can not save consumer_key! please set `consumer_key_storage` variable to a valid directory in your {}, or in your environ variale OVH... | java | protected File gettmpStore(String nic) {
if (consumer_key_storage == null || !consumer_key_storage.isDirectory()) {
if (e1 == 0) {
e1++;
log.error(
"No cert directory, can not save consumer_key! please set `consumer_key_storage` variable to a valid directory in your {}, or in your environ variale OVH... | [
"protected",
"File",
"gettmpStore",
"(",
"String",
"nic",
")",
"{",
"if",
"(",
"consumer_key_storage",
"==",
"null",
"||",
"!",
"consumer_key_storage",
".",
"isDirectory",
"(",
")",
")",
"{",
"if",
"(",
"e1",
"==",
"0",
")",
"{",
"e1",
"++",
";",
"log"... | storage for previous CK
@return File used to store consumer key | [
"storage",
"for",
"previous",
"CK"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-core/src/main/java/net/minidev/ovh/core/ApiOvhConfigBasic.java#L128-L140 |
alibaba/jstorm | jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java | FluxBuilder.buildTopology | public static StormTopology buildTopology(ExecutionContext context) throws IllegalAccessException,
InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException {
StormTopology topology = null;
TopologyDef topologyDef = context.getTopologyDef();
i... | java | public static StormTopology buildTopology(ExecutionContext context) throws IllegalAccessException,
InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException {
StormTopology topology = null;
TopologyDef topologyDef = context.getTopologyDef();
i... | [
"public",
"static",
"StormTopology",
"buildTopology",
"(",
"ExecutionContext",
"context",
")",
"throws",
"IllegalAccessException",
",",
"InstantiationException",
",",
"ClassNotFoundException",
",",
"NoSuchMethodException",
",",
"InvocationTargetException",
"{",
"StormTopology",... | Given a topology definition, return a Storm topology that can be run either locally or remotely.
@param context
@return
@throws IllegalAccessException
@throws InstantiationException
@throws ClassNotFoundException
@throws NoSuchMethodException
@throws InvocationTargetException | [
"Given",
"a",
"topology",
"definition",
"return",
"a",
"Storm",
"topology",
"that",
"can",
"be",
"run",
"either",
"locally",
"or",
"remotely",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java#L62-L103 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java | ThinTableModel.isCellEditable | public boolean isCellEditable(int iRowIndex, int iColumnIndex)
{
FieldList fieldList = this.makeRowCurrent(iRowIndex, false);
if (fieldList != null) if (fieldList.getEditMode() == Constants.EDIT_NONE)
if ((m_iLastRecord == RECORD_UNKNOWN) || (iRowIndex != m_iLastRecord + 1))
... | java | public boolean isCellEditable(int iRowIndex, int iColumnIndex)
{
FieldList fieldList = this.makeRowCurrent(iRowIndex, false);
if (fieldList != null) if (fieldList.getEditMode() == Constants.EDIT_NONE)
if ((m_iLastRecord == RECORD_UNKNOWN) || (iRowIndex != m_iLastRecord + 1))
... | [
"public",
"boolean",
"isCellEditable",
"(",
"int",
"iRowIndex",
",",
"int",
"iColumnIndex",
")",
"{",
"FieldList",
"fieldList",
"=",
"this",
".",
"makeRowCurrent",
"(",
"iRowIndex",
",",
"false",
")",
";",
"if",
"(",
"fieldList",
"!=",
"null",
")",
"if",
"... | Is this cell editable.
@return true unless this is a deleted record. | [
"Is",
"this",
"cell",
"editable",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java#L184-L191 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java | PlatformBitmapFactory.createBitmap | public CloseableReference<Bitmap> createBitmap(
Bitmap source,
int x,
int y,
int width,
int height) {
return createBitmap(source, x, y, width, height, null);
} | java | public CloseableReference<Bitmap> createBitmap(
Bitmap source,
int x,
int y,
int width,
int height) {
return createBitmap(source, x, y, width, height, null);
} | [
"public",
"CloseableReference",
"<",
"Bitmap",
">",
"createBitmap",
"(",
"Bitmap",
"source",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"return",
"createBitmap",
"(",
"source",
",",
"x",
",",
"y",
",",
"width... | Creates a bitmap from the specified subset of the source
bitmap. It is initialized with the same density as the original bitmap.
@param source The bitmap we are subsetting
@param x The x coordinate of the first pixel in source
@param y The y coordinate of the first pixel in source
@param width The n... | [
"Creates",
"a",
"bitmap",
"from",
"the",
"specified",
"subset",
"of",
"the",
"source",
"bitmap",
".",
"It",
"is",
"initialized",
"with",
"the",
"same",
"density",
"as",
"the",
"original",
"bitmap",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java#L144-L151 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.