repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
mangstadt/biweekly | src/main/java/biweekly/io/ICalTimeZone.java | ICalTimeZone.calculateSortedObservances | private List<Observance> calculateSortedObservances() {
"""
Builds a list of all the observances in the VTIMEZONE component, sorted
by DTSTART.
@return the sorted observances
"""
List<DaylightSavingsTime> daylights = component.getDaylightSavingsTime();
List<StandardTime> standards = component.getStandard... | java | private List<Observance> calculateSortedObservances() {
List<DaylightSavingsTime> daylights = component.getDaylightSavingsTime();
List<StandardTime> standards = component.getStandardTimes();
int numObservances = standards.size() + daylights.size();
List<Observance> sortedObservances = new ArrayList<Observance>... | [
"private",
"List",
"<",
"Observance",
">",
"calculateSortedObservances",
"(",
")",
"{",
"List",
"<",
"DaylightSavingsTime",
">",
"daylights",
"=",
"component",
".",
"getDaylightSavingsTime",
"(",
")",
";",
"List",
"<",
"StandardTime",
">",
"standards",
"=",
"com... | Builds a list of all the observances in the VTIMEZONE component, sorted
by DTSTART.
@return the sorted observances | [
"Builds",
"a",
"list",
"of",
"all",
"the",
"observances",
"in",
"the",
"VTIMEZONE",
"component",
"sorted",
"by",
"DTSTART",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/ICalTimeZone.java#L106-L135 |
groupon/robo-remote | RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/Client.java | Client.isListening | public boolean isListening() throws Exception {
"""
Returns true if there is RoboRemoteServer currently listening
@return
@throws Exception
"""
try {
JSONObject resp = new JSONObject(Get.get(API_BASE_URL + ":" + API_PORT, Constants.REQUEST_HEARTBEAT, ""));
return true;
... | java | public boolean isListening() throws Exception {
try {
JSONObject resp = new JSONObject(Get.get(API_BASE_URL + ":" + API_PORT, Constants.REQUEST_HEARTBEAT, ""));
return true;
} catch (Exception e) {
return false;
}
} | [
"public",
"boolean",
"isListening",
"(",
")",
"throws",
"Exception",
"{",
"try",
"{",
"JSONObject",
"resp",
"=",
"new",
"JSONObject",
"(",
"Get",
".",
"get",
"(",
"API_BASE_URL",
"+",
"\":\"",
"+",
"API_PORT",
",",
"Constants",
".",
"REQUEST_HEARTBEAT",
",",... | Returns true if there is RoboRemoteServer currently listening
@return
@throws Exception | [
"Returns",
"true",
"if",
"there",
"is",
"RoboRemoteServer",
"currently",
"listening"
] | train | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/Client.java#L78-L86 |
elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/evaluation/scores/NDCGEvaluation.java | NDCGEvaluation.computeNDCG | public static <I extends ScoreIter> double computeNDCG(Predicate<? super I> predicate, I iter) {
"""
Compute the DCG given a set of positive IDs and a sorted list of entries,
which may include ties.
@param <I> Iterator type
@param predicate Predicate to test for positive objects
@param iter Iterator over res... | java | public static <I extends ScoreIter> double computeNDCG(Predicate<? super I> predicate, I iter) {
double sum = 0.;
int i = 0, positive = 0, tied = 0, totalpos = 0;
while(iter.valid()) {
// positive or negative match?
do {
if(predicate.test(iter)) {
++positive;
}
... | [
"public",
"static",
"<",
"I",
"extends",
"ScoreIter",
">",
"double",
"computeNDCG",
"(",
"Predicate",
"<",
"?",
"super",
"I",
">",
"predicate",
",",
"I",
"iter",
")",
"{",
"double",
"sum",
"=",
"0.",
";",
"int",
"i",
"=",
"0",
",",
"positive",
"=",
... | Compute the DCG given a set of positive IDs and a sorted list of entries,
which may include ties.
@param <I> Iterator type
@param predicate Predicate to test for positive objects
@param iter Iterator over results, with ties.
@return area under curve | [
"Compute",
"the",
"DCG",
"given",
"a",
"set",
"of",
"positive",
"IDs",
"and",
"a",
"sorted",
"list",
"of",
"entries",
"which",
"may",
"include",
"ties",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/evaluation/scores/NDCGEvaluation.java#L80-L106 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listMultiRolePoolInstanceMetricDefinitionsAsync | public Observable<Page<ResourceMetricDefinitionInner>> listMultiRolePoolInstanceMetricDefinitionsAsync(final String resourceGroupName, final String name, final String instance) {
"""
Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.
Get metric definitions for a spe... | java | public Observable<Page<ResourceMetricDefinitionInner>> listMultiRolePoolInstanceMetricDefinitionsAsync(final String resourceGroupName, final String name, final String instance) {
return listMultiRolePoolInstanceMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name, instance)
.map(new Fun... | [
"public",
"Observable",
"<",
"Page",
"<",
"ResourceMetricDefinitionInner",
">",
">",
"listMultiRolePoolInstanceMetricDefinitionsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
"String",
"instance",
")",
"{",
"return",
... | Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.
Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service En... | [
"Get",
"metric",
"definitions",
"for",
"a",
"specific",
"instance",
"of",
"a",
"multi",
"-",
"role",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"metric",
"definitions",
"for",
"a",
"specific",
"instance",
"of",
"a",
"multi",
"-",
"rol... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L2601-L2609 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/CommandLineUtil.java | CommandLineUtil.getOptionValue | public static String getOptionValue(String[] args, String optionName) {
"""
Search for an argument "-<option>=<value>" where option is the given option name, and return the value.
"""
String opt = "-" + optionName + "=";
for (String arg : args) {
if (arg.startsWith(opt))
return arg.subst... | java | public static String getOptionValue(String[] args, String optionName) {
String opt = "-" + optionName + "=";
for (String arg : args) {
if (arg.startsWith(opt))
return arg.substring(opt.length());
}
return null;
} | [
"public",
"static",
"String",
"getOptionValue",
"(",
"String",
"[",
"]",
"args",
",",
"String",
"optionName",
")",
"{",
"String",
"opt",
"=",
"\"-\"",
"+",
"optionName",
"+",
"\"=\"",
";",
"for",
"(",
"String",
"arg",
":",
"args",
")",
"{",
"if",
"(",
... | Search for an argument "-<option>=<value>" where option is the given option name, and return the value. | [
"Search",
"for",
"an",
"argument",
"-",
"<",
";",
"option>",
";",
"=",
"<",
";",
"value>",
";",
"where",
"option",
"is",
"the",
"given",
"option",
"name",
"and",
"return",
"the",
"value",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/CommandLineUtil.java#L11-L18 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.dedicatedCloud_2018v2_rbx2a_infrastructure_filer_hourly_filerProfile_GET | public OvhPrice dedicatedCloud_2018v2_rbx2a_infrastructure_filer_hourly_filerProfile_GET(net.minidev.ovh.api.price.dedicatedcloud._2018v2.rbx2a.infrastructure.filer.OvhHourlyEnum filerProfile) throws IOException {
"""
Get price of dedicated Cloud hourly filer ressources
REST: GET /price/dedicatedCloud/2018v2/rb... | java | public OvhPrice dedicatedCloud_2018v2_rbx2a_infrastructure_filer_hourly_filerProfile_GET(net.minidev.ovh.api.price.dedicatedcloud._2018v2.rbx2a.infrastructure.filer.OvhHourlyEnum filerProfile) throws IOException {
String qPath = "/price/dedicatedCloud/2018v2/rbx2a/infrastructure/filer/hourly/{filerProfile}";
String... | [
"public",
"OvhPrice",
"dedicatedCloud_2018v2_rbx2a_infrastructure_filer_hourly_filerProfile_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"dedicatedcloud",
".",
"_2018v2",
".",
"rbx2a",
".",
"infrastructure",
".",
"filer",
".",
"OvhHourl... | Get price of dedicated Cloud hourly filer ressources
REST: GET /price/dedicatedCloud/2018v2/rbx2a/infrastructure/filer/hourly/{filerProfile}
@param filerProfile [required] type of the hourly ressources you want to order | [
"Get",
"price",
"of",
"dedicated",
"Cloud",
"hourly",
"filer",
"ressources"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L4327-L4332 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/extra/ZipShort.java | ZipShort.getValue | public static int getValue(byte[] bytes, int offset) {
"""
Helper method to get the value as a java int from two bytes starting at given array offset
@param bytes the array of bytes
@param offset the offset to start
@return the corresponding java int value
"""
int value = (bytes[offset + 1] << BYTE_1_... | java | public static int getValue(byte[] bytes, int offset) {
int value = (bytes[offset + 1] << BYTE_1_SHIFT) & BYTE_1_MASK;
value += (bytes[offset] & BYTE_MASK);
return value;
} | [
"public",
"static",
"int",
"getValue",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"int",
"value",
"=",
"(",
"bytes",
"[",
"offset",
"+",
"1",
"]",
"<<",
"BYTE_1_SHIFT",
")",
"&",
"BYTE_1_MASK",
";",
"value",
"+=",
"(",
"bytes",
... | Helper method to get the value as a java int from two bytes starting at given array offset
@param bytes the array of bytes
@param offset the offset to start
@return the corresponding java int value | [
"Helper",
"method",
"to",
"get",
"the",
"value",
"as",
"a",
"java",
"int",
"from",
"two",
"bytes",
"starting",
"at",
"given",
"array",
"offset"
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/extra/ZipShort.java#L112-L116 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_abbreviatedNumber_abbreviatedNumber_PUT | public void billingAccount_line_serviceName_abbreviatedNumber_abbreviatedNumber_PUT(String billingAccount, String serviceName, Long abbreviatedNumber, OvhAbbreviatedNumber body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/line/{serviceName}/abbreviatedNumber/{abbr... | java | public void billingAccount_line_serviceName_abbreviatedNumber_abbreviatedNumber_PUT(String billingAccount, String serviceName, Long abbreviatedNumber, OvhAbbreviatedNumber body) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/abbreviatedNumber/{abbreviatedNumber}";
StringBuilder ... | [
"public",
"void",
"billingAccount_line_serviceName_abbreviatedNumber_abbreviatedNumber_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"abbreviatedNumber",
",",
"OvhAbbreviatedNumber",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPa... | Alter this object properties
REST: PUT /telephony/{billingAccount}/line/{serviceName}/abbreviatedNumber/{abbreviatedNumber}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param abbreviatedNumber [required] The abbreviated num... | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1608-L1612 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.isGreaterOrEqual | public static boolean isGreaterOrEqual(BigDecimal bigNum1, BigDecimal bigNum2) {
"""
比较大小,参数1 >= 参数2 返回true
@param bigNum1 数字1
@param bigNum2 数字2
@return 是否大于等于
@since 3,0.9
"""
Assert.notNull(bigNum1);
Assert.notNull(bigNum2);
return bigNum1.compareTo(bigNum2) >= 0;
} | java | public static boolean isGreaterOrEqual(BigDecimal bigNum1, BigDecimal bigNum2) {
Assert.notNull(bigNum1);
Assert.notNull(bigNum2);
return bigNum1.compareTo(bigNum2) >= 0;
} | [
"public",
"static",
"boolean",
"isGreaterOrEqual",
"(",
"BigDecimal",
"bigNum1",
",",
"BigDecimal",
"bigNum2",
")",
"{",
"Assert",
".",
"notNull",
"(",
"bigNum1",
")",
";",
"Assert",
".",
"notNull",
"(",
"bigNum2",
")",
";",
"return",
"bigNum1",
".",
"compar... | 比较大小,参数1 >= 参数2 返回true
@param bigNum1 数字1
@param bigNum2 数字2
@return 是否大于等于
@since 3,0.9 | [
"比较大小,参数1",
">",
";",
"=",
"参数2",
"返回true"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1636-L1640 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Interpolate3DLine.java | ST_Interpolate3DLine.linearZInterpolation | private static LineString linearZInterpolation(LineString lineString) {
"""
Interpolate a linestring according the start and the end coordinates z
value. If the start or the end z is NaN return the input linestring
@param lineString
@return
"""
double startz = lineString.getStartPoint().getCoordin... | java | private static LineString linearZInterpolation(LineString lineString) {
double startz = lineString.getStartPoint().getCoordinate().z;
double endz = lineString.getEndPoint().getCoordinate().z;
if (Double.isNaN(startz) || Double.isNaN(endz)) {
return lineString;
} else {
... | [
"private",
"static",
"LineString",
"linearZInterpolation",
"(",
"LineString",
"lineString",
")",
"{",
"double",
"startz",
"=",
"lineString",
".",
"getStartPoint",
"(",
")",
".",
"getCoordinate",
"(",
")",
".",
"z",
";",
"double",
"endz",
"=",
"lineString",
"."... | Interpolate a linestring according the start and the end coordinates z
value. If the start or the end z is NaN return the input linestring
@param lineString
@return | [
"Interpolate",
"a",
"linestring",
"according",
"the",
"start",
"and",
"the",
"end",
"coordinates",
"z",
"value",
".",
"If",
"the",
"start",
"or",
"the",
"end",
"z",
"is",
"NaN",
"return",
"the",
"input",
"linestring"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Interpolate3DLine.java#L70-L80 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/VertexLabel.java | VertexLabel.ensureEdgeLabelExist | public EdgeLabel ensureEdgeLabelExist(final String edgeLabelName, final VertexLabel inVertexLabel) {
"""
Ensures that the {@link EdgeLabel} exists. It will be created if it does not exists.
"this" is the out {@link VertexLabel} and inVertexLabel is the inVertexLabel
This method is equivalent to {@link Schema#ens... | java | public EdgeLabel ensureEdgeLabelExist(final String edgeLabelName, final VertexLabel inVertexLabel) {
return this.getSchema().ensureEdgeLabelExist(edgeLabelName, this, inVertexLabel, Collections.emptyMap());
} | [
"public",
"EdgeLabel",
"ensureEdgeLabelExist",
"(",
"final",
"String",
"edgeLabelName",
",",
"final",
"VertexLabel",
"inVertexLabel",
")",
"{",
"return",
"this",
".",
"getSchema",
"(",
")",
".",
"ensureEdgeLabelExist",
"(",
"edgeLabelName",
",",
"this",
",",
"inVe... | Ensures that the {@link EdgeLabel} exists. It will be created if it does not exists.
"this" is the out {@link VertexLabel} and inVertexLabel is the inVertexLabel
This method is equivalent to {@link Schema#ensureEdgeLabelExist(String, VertexLabel, VertexLabel, Map)}
@param edgeLabelName The EdgeLabel's label's name.
@p... | [
"Ensures",
"that",
"the",
"{",
"@link",
"EdgeLabel",
"}",
"exists",
".",
"It",
"will",
"be",
"created",
"if",
"it",
"does",
"not",
"exists",
".",
"this",
"is",
"the",
"out",
"{",
"@link",
"VertexLabel",
"}",
"and",
"inVertexLabel",
"is",
"the",
"inVertex... | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/VertexLabel.java#L285-L287 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java | ClassesManager.isMapped | private static boolean isMapped(Class<?> aClass,XML xml) {
"""
Returns true if the class is configured in annotation or xml, false otherwise.
@param aClass a class
@param xml xml to check
@return true if the class is configured in annotation or xml, false otherwise
"""
return xml.isInheritedMapped(aClass... | java | private static boolean isMapped(Class<?> aClass,XML xml){
return xml.isInheritedMapped(aClass) || Annotation.isInheritedMapped(aClass);
} | [
"private",
"static",
"boolean",
"isMapped",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"XML",
"xml",
")",
"{",
"return",
"xml",
".",
"isInheritedMapped",
"(",
"aClass",
")",
"||",
"Annotation",
".",
"isInheritedMapped",
"(",
"aClass",
")",
";",
"}"
] | Returns true if the class is configured in annotation or xml, false otherwise.
@param aClass a class
@param xml xml to check
@return true if the class is configured in annotation or xml, false otherwise | [
"Returns",
"true",
"if",
"the",
"class",
"is",
"configured",
"in",
"annotation",
"or",
"xml",
"false",
"otherwise",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java#L438-L440 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.readLines | public static void readLines(RandomAccessFile file, Charset charset, LineHandler lineHandler) {
"""
按行处理文件内容
@param file {@link RandomAccessFile}文件
@param charset 编码
@param lineHandler {@link LineHandler}行处理器
@throws IORuntimeException IO异常
@since 4.5.2
"""
String line = null;
try {
while ((li... | java | public static void readLines(RandomAccessFile file, Charset charset, LineHandler lineHandler) {
String line = null;
try {
while ((line = file.readLine()) != null) {
lineHandler.handle(CharsetUtil.convert(line, CharsetUtil.CHARSET_ISO_8859_1, charset));
}
} catch (IOException e) {
throw new IOR... | [
"public",
"static",
"void",
"readLines",
"(",
"RandomAccessFile",
"file",
",",
"Charset",
"charset",
",",
"LineHandler",
"lineHandler",
")",
"{",
"String",
"line",
"=",
"null",
";",
"try",
"{",
"while",
"(",
"(",
"line",
"=",
"file",
".",
"readLine",
"(",
... | 按行处理文件内容
@param file {@link RandomAccessFile}文件
@param charset 编码
@param lineHandler {@link LineHandler}行处理器
@throws IORuntimeException IO异常
@since 4.5.2 | [
"按行处理文件内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2428-L2437 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/FirewallRulesInner.java | FirewallRulesInner.createOrUpdate | public RedisFirewallRuleInner createOrUpdate(String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleCreateParameters parameters) {
"""
Create or update a redis cache firewall rule.
@param resourceGroupName The name of the resource group.
@param cacheName The name of the Redis cache.
@pa... | java | public RedisFirewallRuleInner createOrUpdate(String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleCreateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, ruleName, parameters).toBlocking().single().body();
} | [
"public",
"RedisFirewallRuleInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"cacheName",
",",
"String",
"ruleName",
",",
"RedisFirewallRuleCreateParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourc... | Create or update a redis cache firewall rule.
@param resourceGroupName The name of the resource group.
@param cacheName The name of the Redis cache.
@param ruleName The name of the firewall rule.
@param parameters Parameters supplied to the create or update redis firewall rule operation.
@throws IllegalArgumentExcepti... | [
"Create",
"or",
"update",
"a",
"redis",
"cache",
"firewall",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/FirewallRulesInner.java#L222-L224 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java | CmsDomUtil.getCurrentStyle | public static String getCurrentStyle(Element element, Style style) {
"""
Returns the computed style of the given element.<p>
@param element the element
@param style the CSS property
@return the currently computed style
"""
return getStyleImpl().getCurrentStyle(element, style.toString());
} | java | public static String getCurrentStyle(Element element, Style style) {
return getStyleImpl().getCurrentStyle(element, style.toString());
} | [
"public",
"static",
"String",
"getCurrentStyle",
"(",
"Element",
"element",
",",
"Style",
"style",
")",
"{",
"return",
"getStyleImpl",
"(",
")",
".",
"getCurrentStyle",
"(",
"element",
",",
"style",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Returns the computed style of the given element.<p>
@param element the element
@param style the CSS property
@return the currently computed style | [
"Returns",
"the",
"computed",
"style",
"of",
"the",
"given",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java#L1205-L1208 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/EncodingInfo.java | EncodingInfo.isInEncoding | public boolean isInEncoding(char high, char low) {
"""
This is not a public API. It returns true if the
character formed by the high/low pair is in the encoding.
@param high a char that the a high char of a high/low surrogate pair.
@param low a char that is the low char of a high/low surrogate pair.
<p>
This ... | java | public boolean isInEncoding(char high, char low) {
if (m_encoding == null) {
m_encoding = new EncodingImpl();
// One could put alternate logic in here to
// instantiate another object that implements the
// InEncoding interface. For example if the JRE... | [
"public",
"boolean",
"isInEncoding",
"(",
"char",
"high",
",",
"char",
"low",
")",
"{",
"if",
"(",
"m_encoding",
"==",
"null",
")",
"{",
"m_encoding",
"=",
"new",
"EncodingImpl",
"(",
")",
";",
"// One could put alternate logic in here to",
"// instantiate another... | This is not a public API. It returns true if the
character formed by the high/low pair is in the encoding.
@param high a char that the a high char of a high/low surrogate pair.
@param low a char that is the low char of a high/low surrogate pair.
<p>
This method is not a public API.
@xsl.usage internal | [
"This",
"is",
"not",
"a",
"public",
"API",
".",
"It",
"returns",
"true",
"if",
"the",
"character",
"formed",
"by",
"the",
"high",
"/",
"low",
"pair",
"is",
"in",
"the",
"encoding",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/EncodingInfo.java#L125-L135 |
morimekta/utils | console-util/src/main/java/net/morimekta/console/args/SubCommandSet.java | SubCommandSet.printUsage | public void printUsage(PrintWriter writer, String name, boolean showHidden) {
"""
Print the option usage list. Essentially printed as a list of options
with the description indented where it overflows the available line
width.
@param writer The output printer.
@param name The sub-command to print help for.
... | java | public void printUsage(PrintWriter writer, String name, boolean showHidden) {
for (SubCommand<SubCommandDef> cmd : subCommands) {
if (name.equals(cmd.getName())) {
cmd.getArgumentParser(cmd.newInstance()).printUsage(writer, showHidden);
return;
}
}... | [
"public",
"void",
"printUsage",
"(",
"PrintWriter",
"writer",
",",
"String",
"name",
",",
"boolean",
"showHidden",
")",
"{",
"for",
"(",
"SubCommand",
"<",
"SubCommandDef",
">",
"cmd",
":",
"subCommands",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
... | Print the option usage list. Essentially printed as a list of options
with the description indented where it overflows the available line
width.
@param writer The output printer.
@param name The sub-command to print help for.
@param showHidden Whether to show hidden options. | [
"Print",
"the",
"option",
"usage",
"list",
".",
"Essentially",
"printed",
"as",
"a",
"list",
"of",
"options",
"with",
"the",
"description",
"indented",
"where",
"it",
"overflows",
"the",
"available",
"line",
"width",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/console-util/src/main/java/net/morimekta/console/args/SubCommandSet.java#L252-L260 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/strings/Strings.java | Strings.padRight | public static String padRight(String string, int size, char padding) {
"""
Formats a string by padding it with the given character to the right, until
the given length is reached.
@param string
the string to pad.
@param size
the final length of the resulting padded string.
@param padding
the character to ... | java | public static String padRight(String string, int size, char padding) {
if(string == null || size <= string.length()) {
return string;
}
StringBuilder sb = new StringBuilder();
sb.append(string);
while (sb.length() < size) {
sb.append(padding);
}
return sb.toString();
} | [
"public",
"static",
"String",
"padRight",
"(",
"String",
"string",
",",
"int",
"size",
",",
"char",
"padding",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"size",
"<=",
"string",
".",
"length",
"(",
")",
")",
"{",
"return",
"string",
";",
"}",... | Formats a string by padding it with the given character to the right, until
the given length is reached.
@param string
the string to pad.
@param size
the final length of the resulting padded string.
@param padding
the character to use as padding.
@return
the original string padded to the right. | [
"Formats",
"a",
"string",
"by",
"padding",
"it",
"with",
"the",
"given",
"character",
"to",
"the",
"right",
"until",
"the",
"given",
"length",
"is",
"reached",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/strings/Strings.java#L421-L431 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.xmlWrongMethod | public static void xmlWrongMethod(Class<?> aClass) {
"""
Thrown when the class has only one attribute.
@param aClass class analyzed
"""
throw new WrongMethodException (MSG.INSTANCE.message(wrongMethodException1,aClass.getSimpleName()));
} | java | public static void xmlWrongMethod(Class<?> aClass){
throw new WrongMethodException (MSG.INSTANCE.message(wrongMethodException1,aClass.getSimpleName()));
} | [
"public",
"static",
"void",
"xmlWrongMethod",
"(",
"Class",
"<",
"?",
">",
"aClass",
")",
"{",
"throw",
"new",
"WrongMethodException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"wrongMethodException1",
",",
"aClass",
".",
"getSimpleName",
"(",
")",
"... | Thrown when the class has only one attribute.
@param aClass class analyzed | [
"Thrown",
"when",
"the",
"class",
"has",
"only",
"one",
"attribute",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L285-L287 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java | AbstractCachedGenerator.createTempResource | protected Reader createTempResource(GeneratorContext context, CacheMode cacheMode, Reader rd) {
"""
Creates the temporary resource
@param context
the context
@param cacheMode
the cache mode
@param rd
the reader of the compiled resource
@return the reader
"""
String filePath = getTempFilePath(context... | java | protected Reader createTempResource(GeneratorContext context, CacheMode cacheMode, Reader rd) {
String filePath = getTempFilePath(context, cacheMode);
Writer wr = null;
FileOutputStream fos = null;
try {
File f = new File(filePath);
if (!f.getParentFile().exists()) {
f.getParentFile().mkdirs();
}
... | [
"protected",
"Reader",
"createTempResource",
"(",
"GeneratorContext",
"context",
",",
"CacheMode",
"cacheMode",
",",
"Reader",
"rd",
")",
"{",
"String",
"filePath",
"=",
"getTempFilePath",
"(",
"context",
",",
"cacheMode",
")",
";",
"Writer",
"wr",
"=",
"null",
... | Creates the temporary resource
@param context
the context
@param cacheMode
the cache mode
@param rd
the reader of the compiled resource
@return the reader | [
"Creates",
"the",
"temporary",
"resource"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java#L491-L516 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java | ModulePackageIndexFrameWriter.getPackage | protected Content getPackage(PackageElement pkg, ModuleElement mdle) {
"""
Returns each package name as a separate link.
@param pkg PackageElement
@param mdle the module being documented
@return content for the package link
"""
Content packageLinkContent;
Content pkgLabel;
if (!pkg... | java | protected Content getPackage(PackageElement pkg, ModuleElement mdle) {
Content packageLinkContent;
Content pkgLabel;
if (!pkg.isUnnamed()) {
pkgLabel = getPackageLabel(utils.getPackageName(pkg));
packageLinkContent = getHyperLink(pathString(pkg,
DocPa... | [
"protected",
"Content",
"getPackage",
"(",
"PackageElement",
"pkg",
",",
"ModuleElement",
"mdle",
")",
"{",
"Content",
"packageLinkContent",
";",
"Content",
"pkgLabel",
";",
"if",
"(",
"!",
"pkg",
".",
"isUnnamed",
"(",
")",
")",
"{",
"pkgLabel",
"=",
"getPa... | Returns each package name as a separate link.
@param pkg PackageElement
@param mdle the module being documented
@return content for the package link | [
"Returns",
"each",
"package",
"name",
"as",
"a",
"separate",
"link",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java#L141-L156 |
percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java | ViewUtils.findViewById | @SuppressWarnings("unchecked")
public static <T extends View> T findViewById(Activity context, int id) {
"""
Utility method to make getting a View via findViewById() more safe & simple.
<p/>
- Casts view to appropriate type based on expected return value
- Handles & logs invalid casts
@param context The ... | java | @SuppressWarnings("unchecked")
public static <T extends View> T findViewById(Activity context, int id) {
T view = null;
View genericView = context.findViewById(id);
try {
view = (T) (genericView);
} catch (Exception ex) {
String message = "Can't cast view (" +... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"View",
">",
"T",
"findViewById",
"(",
"Activity",
"context",
",",
"int",
"id",
")",
"{",
"T",
"view",
"=",
"null",
";",
"View",
"genericView",
"=",
"context",
"... | Utility method to make getting a View via findViewById() more safe & simple.
<p/>
- Casts view to appropriate type based on expected return value
- Handles & logs invalid casts
@param context The current Context or Activity that this method is called from.
@param id R.id value for view.
@return View object, cast ... | [
"Utility",
"method",
"to",
"make",
"getting",
"a",
"View",
"via",
"findViewById",
"()",
"more",
"safe",
"&",
"simple",
".",
"<p",
"/",
">",
"-",
"Casts",
"view",
"to",
"appropriate",
"type",
"based",
"on",
"expected",
"return",
"value",
"-",
"Handles",
"... | train | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java#L46-L59 |
icode/ameba-utils | src/main/java/ameba/util/ClassUtils.java | ClassUtils.newInstance | public static <T> T newInstance(Class clazz, Object... args) {
"""
<p>newInstance.</p>
@param clazz a {@link java.lang.Class} object.
@param args a {@link java.lang.Object} object.
@param <T> a T object.
@return a T object.
"""
if (clazz == null) return null;
Class[] argsClass = getArgs... | java | public static <T> T newInstance(Class clazz, Object... args) {
if (clazz == null) return null;
Class[] argsClass = getArgsClasses(args);
try {
Constructor<T> constructor = clazz.<T>getConstructor(argsClass);
return constructor.newInstance(args);
} catch (Instan... | [
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"clazz",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
")",
"return",
"null",
";",
"Class",
"[",
"]",
"argsClass",
"=",
"getArgsClasses",
"(",
"args",
")... | <p>newInstance.</p>
@param clazz a {@link java.lang.Class} object.
@param args a {@link java.lang.Object} object.
@param <T> a T object.
@return a T object. | [
"<p",
">",
"newInstance",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/util/ClassUtils.java#L92-L104 |
azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java | HadoopJobUtils.javaOptStringFromHadoopConfiguration | public static String javaOptStringFromHadoopConfiguration(Configuration conf, String key) {
"""
<pre>
constructions a javaOpts string based on the Props, and the key given, will return
String.format("-D%s=%s", key, value);
</pre>
@return will return String.format("-D%s=%s", key, value). Throws RuntimeExcepti... | java | public static String javaOptStringFromHadoopConfiguration(Configuration conf, String key) {
String value = conf.get(key);
if (value == null) {
throw new RuntimeException(
String.format("Cannot find property [%s], in Hadoop configuration: [%s]",
key, value));
}
return String... | [
"public",
"static",
"String",
"javaOptStringFromHadoopConfiguration",
"(",
"Configuration",
"conf",
",",
"String",
"key",
")",
"{",
"String",
"value",
"=",
"conf",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new"... | <pre>
constructions a javaOpts string based on the Props, and the key given, will return
String.format("-D%s=%s", key, value);
</pre>
@return will return String.format("-D%s=%s", key, value). Throws RuntimeException if props not
present | [
"<pre",
">",
"constructions",
"a",
"javaOpts",
"string",
"based",
"on",
"the",
"Props",
"and",
"the",
"key",
"given",
"will",
"return",
"String",
".",
"format",
"(",
"-",
"D%s",
"=",
"%s",
"key",
"value",
")",
";",
"<",
"/",
"pre",
">"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java#L564-L572 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newObjectNotFoundException | public static ObjectNotFoundException newObjectNotFoundException(Throwable cause, String message, Object... args) {
"""
Constructs and initializes a new {@link ObjectNotFoundException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param ... | java | public static ObjectNotFoundException newObjectNotFoundException(Throwable cause, String message, Object... args) {
return new ObjectNotFoundException(format(message, args), cause);
} | [
"public",
"static",
"ObjectNotFoundException",
"newObjectNotFoundException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"ObjectNotFoundException",
"(",
"format",
"(",
"message",
",",
"args",
")",
"... | Constructs and initializes a new {@link ObjectNotFoundException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link ObjectNotFoundException} was thrown.
@param message {@link String} ... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"ObjectNotFoundException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L481-L483 |
Netflix/spectator | spectator-ext-ipc/src/jmh/java/com/netflix/spectator/ipc/SeqServerGroup.java | SeqServerGroup.parse | public static SeqServerGroup parse(String asg) {
"""
Create a new instance of a server group object by parsing the group name.
"""
int d1 = asg.indexOf('-');
int d2 = asg.indexOf('-', d1 + 1);
int dN = asg.lastIndexOf('-');
if (dN < 0 || !isSequence(asg, dN)) {
dN = asg.length();
}
... | java | public static SeqServerGroup parse(String asg) {
int d1 = asg.indexOf('-');
int d2 = asg.indexOf('-', d1 + 1);
int dN = asg.lastIndexOf('-');
if (dN < 0 || !isSequence(asg, dN)) {
dN = asg.length();
}
return new SeqServerGroup(asg, d1, d2, dN);
} | [
"public",
"static",
"SeqServerGroup",
"parse",
"(",
"String",
"asg",
")",
"{",
"int",
"d1",
"=",
"asg",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"int",
"d2",
"=",
"asg",
".",
"indexOf",
"(",
"'",
"'",
",",
"d1",
"+",
"1",
")",
";",
"int",
"dN",... | Create a new instance of a server group object by parsing the group name. | [
"Create",
"a",
"new",
"instance",
"of",
"a",
"server",
"group",
"object",
"by",
"parsing",
"the",
"group",
"name",
"."
] | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-ext-ipc/src/jmh/java/com/netflix/spectator/ipc/SeqServerGroup.java#L34-L42 |
attribyte/wpdb | src/main/java/org/attribyte/wp/db/DB.java | DB.updatePostContent | public boolean updatePostContent(long postId, final String content) throws SQLException {
"""
Updates the content for a post.
@param postId The post to update.
@param content The new content.
@return Was the post modified?
@throws SQLException on database error or missing post id.
"""
Connection conn... | java | public boolean updatePostContent(long postId, final String content) throws SQLException {
Connection conn = null;
PreparedStatement stmt = null;
Timer.Context ctx = metrics.updatePostTimer.time();
try {
conn = connectionSupplier.getConnection();
stmt = conn.prepareStatement(upd... | [
"public",
"boolean",
"updatePostContent",
"(",
"long",
"postId",
",",
"final",
"String",
"content",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"Timer",
".",
"Context",
"ctx",
"=",
... | Updates the content for a post.
@param postId The post to update.
@param content The new content.
@return Was the post modified?
@throws SQLException on database error or missing post id. | [
"Updates",
"the",
"content",
"for",
"a",
"post",
"."
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L1525-L1539 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getUntaggedImageCountWithServiceResponseAsync | public Observable<ServiceResponse<Integer>> getUntaggedImageCountWithServiceResponseAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) {
"""
Gets the number of untagged images.
This API returns the images which have no tags for a given project and optionally an it... | java | public Observable<ServiceResponse<Integer>> getUntaggedImageCountWithServiceResponseAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null."... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Integer",
">",
">",
"getUntaggedImageCountWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"GetUntaggedImageCountOptionalParameter",
"getUntaggedImageCountOptionalParameter",
")",
"{",
"if",
"(",
"projectId",
"=="... | Gets the number of untagged images.
This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the
current workspace is used.
@param projectId The project id
@param getUntaggedImageCountOptionalParameter the object representing the optional parameters t... | [
"Gets",
"the",
"number",
"of",
"untagged",
"images",
".",
"This",
"API",
"returns",
"the",
"images",
"which",
"have",
"no",
"tags",
"for",
"a",
"given",
"project",
"and",
"optionally",
"an",
"iteration",
".",
"If",
"no",
"iteration",
"is",
"specified",
"th... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L4502-L4512 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/FeatureScopes.java | FeatureScopes.createTypeLiteralScope | protected IScope createTypeLiteralScope(EObject featureCall, QualifiedName parentSegments, IScope parent, IFeatureScopeSession session, IResolvedTypes resolvedTypes) {
"""
Create a scope that returns types, e.g. for member feature calls that are actually type references like
{@code java.lang.String}.
@param fe... | java | protected IScope createTypeLiteralScope(EObject featureCall, QualifiedName parentSegments, IScope parent, IFeatureScopeSession session, IResolvedTypes resolvedTypes) {
return new TypeLiteralScope(parent, session, asAbstractFeatureCall(featureCall), resolvedTypes, parentSegments);
} | [
"protected",
"IScope",
"createTypeLiteralScope",
"(",
"EObject",
"featureCall",
",",
"QualifiedName",
"parentSegments",
",",
"IScope",
"parent",
",",
"IFeatureScopeSession",
"session",
",",
"IResolvedTypes",
"resolvedTypes",
")",
"{",
"return",
"new",
"TypeLiteralScope",
... | Create a scope that returns types, e.g. for member feature calls that are actually type references like
{@code java.lang.String}.
@param featureCall the feature call that is currently processed by the scoping infrastructure
@param parentSegments the segments of the fully qualified type name that are already known. The... | [
"Create",
"a",
"scope",
"that",
"returns",
"types",
"e",
".",
"g",
".",
"for",
"member",
"feature",
"calls",
"that",
"are",
"actually",
"type",
"references",
"like",
"{",
"@code",
"java",
".",
"lang",
".",
"String",
"}",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/FeatureScopes.java#L587-L589 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesInner.java | DatabasesInner.upgradeDataWarehouse | public void upgradeDataWarehouse(String resourceGroupName, String serverName, String databaseName) {
"""
Upgrades a data warehouse.
@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 ... | java | public void upgradeDataWarehouse(String resourceGroupName, String serverName, String databaseName) {
upgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().last().body();
} | [
"public",
"void",
"upgradeDataWarehouse",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"upgradeDataWarehouseWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"databaseName",
")",
".",
... | Upgrades a data warehouse.
@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 to be upgraded.
@throws IllegalArgumentExcep... | [
"Upgrades",
"a",
"data",
"warehouse",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesInner.java#L152-L154 |
rpau/javalang-compiler | src/main/java/org/walkmod/javalang/compiler/symbols/SymbolType.java | SymbolType.typeVariableOf | private static SymbolType typeVariableOf(String typeVariable, final String name, final int arrayCount,
final List<SymbolType> upperBounds, final List<SymbolType> lowerBounds) {
"""
Builds a symbol for a type variable.
@param typeVariable the name of the variable
@param name type name of the variable
... | java | private static SymbolType typeVariableOf(String typeVariable, final String name, final int arrayCount,
final List<SymbolType> upperBounds, final List<SymbolType> lowerBounds) {
return new SymbolType(name, arrayCount, upperBounds, lowerBounds, typeVariable);
} | [
"private",
"static",
"SymbolType",
"typeVariableOf",
"(",
"String",
"typeVariable",
",",
"final",
"String",
"name",
",",
"final",
"int",
"arrayCount",
",",
"final",
"List",
"<",
"SymbolType",
">",
"upperBounds",
",",
"final",
"List",
"<",
"SymbolType",
">",
"l... | Builds a symbol for a type variable.
@param typeVariable the name of the variable
@param name type name of the variable
@param arrayCount the array dimensions
@param upperBounds the upper bounds of the variable
@param lowerBounds the lower bounds of the variable
@return a SymbolType that represents a variable (for gene... | [
"Builds",
"a",
"symbol",
"for",
"a",
"type",
"variable",
"."
] | train | https://github.com/rpau/javalang-compiler/blob/d7da81359161feef2bc7ff186c4e1b73c6a5a8ef/src/main/java/org/walkmod/javalang/compiler/symbols/SymbolType.java#L817-L820 |
susom/database | src/main/java/com/github/susom/database/DatabaseProviderVertx.java | DatabaseProviderVertx.transactAsync | public <T> void transactAsync(final DbCodeTypedTx<T> code, Handler<AsyncResult<T>> resultHandler) {
"""
Execute a transaction on a Vert.x worker thread, with default semantics (commit if
the code completes successfully, or rollback if it throws an error). The provided
result handler will be call after the commit... | java | public <T> void transactAsync(final DbCodeTypedTx<T> code, Handler<AsyncResult<T>> resultHandler) {
VertxUtil.executeBlocking(executor, future -> {
try {
T returnValue = null;
Transaction tx = new TransactionImpl();
tx.setRollbackOnError(true);
tx.setRollbackOnly(false);
... | [
"public",
"<",
"T",
">",
"void",
"transactAsync",
"(",
"final",
"DbCodeTypedTx",
"<",
"T",
">",
"code",
",",
"Handler",
"<",
"AsyncResult",
"<",
"T",
">",
">",
"resultHandler",
")",
"{",
"VertxUtil",
".",
"executeBlocking",
"(",
"executor",
",",
"future",
... | Execute a transaction on a Vert.x worker thread, with default semantics (commit if
the code completes successfully, or rollback if it throws an error). The provided
result handler will be call after the commit or rollback, and will run on the event
loop thread (the same thread that is calling this method). | [
"Execute",
"a",
"transaction",
"on",
"a",
"Vert",
".",
"x",
"worker",
"thread",
"with",
"default",
"semantics",
"(",
"commit",
"if",
"the",
"code",
"completes",
"successfully",
"or",
"rollback",
"if",
"it",
"throws",
"an",
"error",
")",
".",
"The",
"provid... | train | https://github.com/susom/database/blob/25add9e08ad863712f9b5e319b6cb826f6f97640/src/main/java/com/github/susom/database/DatabaseProviderVertx.java#L254-L283 |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/Zhang99CalibrationMatrixFromHomographies.java | Zhang99CalibrationMatrixFromHomographies.setupA | private void setupA( List<DMatrixRMaj> homographies ) {
"""
Sets up the system of equations which are to be solved. This equation is derived from
constraints (3) and (4) in the paper. See section 3.1.
@param homographies set of observed homographies.
"""
A.reshape(2*homographies.size(),6, false);
D... | java | private void setupA( List<DMatrixRMaj> homographies ) {
A.reshape(2*homographies.size(),6, false);
DMatrixRMaj h1 = new DMatrixRMaj(3,1);
DMatrixRMaj h2 = new DMatrixRMaj(3,1);
DMatrixRMaj v12 = new DMatrixRMaj(1,6);
DMatrixRMaj v11 = new DMatrixRMaj(1,6);
DMatrixRMaj v22 = new DMatrixRMaj(1,6);
DMatri... | [
"private",
"void",
"setupA",
"(",
"List",
"<",
"DMatrixRMaj",
">",
"homographies",
")",
"{",
"A",
".",
"reshape",
"(",
"2",
"*",
"homographies",
".",
"size",
"(",
")",
",",
"6",
",",
"false",
")",
";",
"DMatrixRMaj",
"h1",
"=",
"new",
"DMatrixRMaj",
... | Sets up the system of equations which are to be solved. This equation is derived from
constraints (3) and (4) in the paper. See section 3.1.
@param homographies set of observed homographies. | [
"Sets",
"up",
"the",
"system",
"of",
"equations",
"which",
"are",
"to",
"be",
"solved",
".",
"This",
"equation",
"is",
"derived",
"from",
"constraints",
"(",
"3",
")",
"and",
"(",
"4",
")",
"in",
"the",
"paper",
".",
"See",
"section",
"3",
".",
"1",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/Zhang99CalibrationMatrixFromHomographies.java#L123-L160 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java | AnnotationProxyMaker.generateValue | private Object generateValue(MethodSymbol meth, Attribute attr) {
"""
Converts an element value to its "dynamic proxy return form".
Returns an exception proxy on some errors, but may return null if
a useful exception cannot or should not be generated at this point.
"""
ValueVisitor vv = new ValueVisi... | java | private Object generateValue(MethodSymbol meth, Attribute attr) {
ValueVisitor vv = new ValueVisitor(meth);
return vv.getValue(attr);
} | [
"private",
"Object",
"generateValue",
"(",
"MethodSymbol",
"meth",
",",
"Attribute",
"attr",
")",
"{",
"ValueVisitor",
"vv",
"=",
"new",
"ValueVisitor",
"(",
"meth",
")",
";",
"return",
"vv",
".",
"getValue",
"(",
"attr",
")",
";",
"}"
] | Converts an element value to its "dynamic proxy return form".
Returns an exception proxy on some errors, but may return null if
a useful exception cannot or should not be generated at this point. | [
"Converts",
"an",
"element",
"value",
"to",
"its",
"dynamic",
"proxy",
"return",
"form",
".",
"Returns",
"an",
"exception",
"proxy",
"on",
"some",
"errors",
"but",
"may",
"return",
"null",
"if",
"a",
"useful",
"exception",
"cannot",
"or",
"should",
"not",
... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java#L143-L146 |
VoltDB/voltdb | src/frontend/org/voltdb/client/Distributer.java | Distributer.getPartitionForParameter | public long getPartitionForParameter(byte typeValue, Object value) {
"""
This is used by clients such as CSVLoader which puts processing into buckets.
@param typeValue volt Type
@param value the representative value
@return
"""
if (m_hashinator == null) {
return -1;
}
r... | java | public long getPartitionForParameter(byte typeValue, Object value) {
if (m_hashinator == null) {
return -1;
}
return m_hashinator.getHashedPartitionForParameter(typeValue, value);
} | [
"public",
"long",
"getPartitionForParameter",
"(",
"byte",
"typeValue",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"m_hashinator",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"return",
"m_hashinator",
".",
"getHashedPartitionForParameter",
"(",
"ty... | This is used by clients such as CSVLoader which puts processing into buckets.
@param typeValue volt Type
@param value the representative value
@return | [
"This",
"is",
"used",
"by",
"clients",
"such",
"as",
"CSVLoader",
"which",
"puts",
"processing",
"into",
"buckets",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/client/Distributer.java#L1546-L1551 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java | Window.writeDefaultWindowToLocation | public static void writeDefaultWindowToLocation( String locationPath, Window window ) throws IOException {
"""
Write default region window to the PERMANENT mapset
@param locationPath the path to the location folder
@param the active Window object
@throws IOException
"""
writeWindowFile(locationPat... | java | public static void writeDefaultWindowToLocation( String locationPath, Window window ) throws IOException {
writeWindowFile(locationPath + File.separator + GrassLegacyConstans.PERMANENT_MAPSET + File.separator
+ GrassLegacyConstans.DEFAULT_WIND, window);
} | [
"public",
"static",
"void",
"writeDefaultWindowToLocation",
"(",
"String",
"locationPath",
",",
"Window",
"window",
")",
"throws",
"IOException",
"{",
"writeWindowFile",
"(",
"locationPath",
"+",
"File",
".",
"separator",
"+",
"GrassLegacyConstans",
".",
"PERMANENT_MA... | Write default region window to the PERMANENT mapset
@param locationPath the path to the location folder
@param the active Window object
@throws IOException | [
"Write",
"default",
"region",
"window",
"to",
"the",
"PERMANENT",
"mapset"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java#L491-L494 |
dwdyer/watchmaker | swing/src/java/main/org/uncommons/swing/SwingBackgroundTask.java | SwingBackgroundTask.execute | public void execute() {
"""
Asynchronous call that begins execution of the task and returns immediately.
The {@link #performTask()} method will be invoked on a background thread and,
when it has completed, {@link #postProcessing(Object)} will be invoked on the
Event Dispatch Thread (or, if there is an exception... | java | public void execute()
{
Runnable task = new Runnable()
{
public void run()
{
try
{
final V result = performTask();
SwingUtilities.invokeLater(new Runnable()
{
p... | [
"public",
"void",
"execute",
"(",
")",
"{",
"Runnable",
"task",
"=",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"final",
"V",
"result",
"=",
"performTask",
"(",
")",
";",
"SwingUtilities",
".",
"invokeLater",
... | Asynchronous call that begins execution of the task and returns immediately.
The {@link #performTask()} method will be invoked on a background thread and,
when it has completed, {@link #postProcessing(Object)} will be invoked on the
Event Dispatch Thread (or, if there is an exception, {@link #onError(Throwable)}
will b... | [
"Asynchronous",
"call",
"that",
"begins",
"execution",
"of",
"the",
"task",
"and",
"returns",
"immediately",
".",
"The",
"{"
] | train | https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/swing/src/java/main/org/uncommons/swing/SwingBackgroundTask.java#L55-L89 |
datasift/datasift-java | src/main/java/com/datasift/client/managedsource/sources/BaseSource.java | BaseSource.newAuthParams | public AuthParams newAuthParams(String name, long expires) {
"""
/*
Creates a set of auth parameters that can be used for this source
@param name a human friendly name for this auth set
@param expires identity resource expiry date/time as a UTC timestamp
@return a new auth set
"""
AuthParams s... | java | public AuthParams newAuthParams(String name, long expires) {
AuthParams set = new AuthParams();
set.name(name);
set.expires(expires);
auth.add(set);
return set;
} | [
"public",
"AuthParams",
"newAuthParams",
"(",
"String",
"name",
",",
"long",
"expires",
")",
"{",
"AuthParams",
"set",
"=",
"new",
"AuthParams",
"(",
")",
";",
"set",
".",
"name",
"(",
"name",
")",
";",
"set",
".",
"expires",
"(",
"expires",
")",
";",
... | /*
Creates a set of auth parameters that can be used for this source
@param name a human friendly name for this auth set
@param expires identity resource expiry date/time as a UTC timestamp
@return a new auth set | [
"/",
"*",
"Creates",
"a",
"set",
"of",
"auth",
"parameters",
"that",
"can",
"be",
"used",
"for",
"this",
"source"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/managedsource/sources/BaseSource.java#L69-L75 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addCustomPrebuiltDomain | public List<UUID> addCustomPrebuiltDomain(UUID appId, String versionId, AddCustomPrebuiltDomainModelsOptionalParameter addCustomPrebuiltDomainOptionalParameter) {
"""
Adds a customizable prebuilt domain along with all of its models to this application.
@param appId The application ID.
@param versionId The vers... | java | public List<UUID> addCustomPrebuiltDomain(UUID appId, String versionId, AddCustomPrebuiltDomainModelsOptionalParameter addCustomPrebuiltDomainOptionalParameter) {
return addCustomPrebuiltDomainWithServiceResponseAsync(appId, versionId, addCustomPrebuiltDomainOptionalParameter).toBlocking().single().body();
... | [
"public",
"List",
"<",
"UUID",
">",
"addCustomPrebuiltDomain",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"AddCustomPrebuiltDomainModelsOptionalParameter",
"addCustomPrebuiltDomainOptionalParameter",
")",
"{",
"return",
"addCustomPrebuiltDomainWithServiceResponseAsync... | Adds a customizable prebuilt domain along with all of its models to this application.
@param appId The application ID.
@param versionId The version ID.
@param addCustomPrebuiltDomainOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thro... | [
"Adds",
"a",
"customizable",
"prebuilt",
"domain",
"along",
"with",
"all",
"of",
"its",
"models",
"to",
"this",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L5543-L5545 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.webcontainer/src/com/ibm/ws/jaxws/webcontainer/LibertyJaxWsServlet.java | LibertyJaxWsServlet.reportAvailableService | private void reportAvailableService(HttpServletRequest request, HttpServletResponse response) throws IOException {
"""
Prints a welcome message for the endpoint
@param resquest
@param response
"""
PrintWriter writer = response.getWriter();
response.setContentType(HTML_CONTENT_TYPE);
... | java | private void reportAvailableService(HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter writer = response.getWriter();
response.setContentType(HTML_CONTENT_TYPE);
writer.println("<h2>" + request.getServletPath() + "</h2>");
writer.println("<h3>Hello... | [
"private",
"void",
"reportAvailableService",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"PrintWriter",
"writer",
"=",
"response",
".",
"getWriter",
"(",
")",
";",
"response",
".",
"setContentType",
... | Prints a welcome message for the endpoint
@param resquest
@param response | [
"Prints",
"a",
"welcome",
"message",
"for",
"the",
"endpoint"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.webcontainer/src/com/ibm/ws/jaxws/webcontainer/LibertyJaxWsServlet.java#L111-L116 |
bignerdranch/expandable-recycler-view | expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java | ExpandableRecyclerAdapter.updateExpandedParent | @UiThread
private void updateExpandedParent(@NonNull ExpandableWrapper<P, C> parentWrapper, int flatParentPosition, boolean expansionTriggeredByListItemClick) {
"""
Expands a specified parent. Calls through to the
ExpandCollapseListener and adds children of the specified parent to the
flat list of items.
... | java | @UiThread
private void updateExpandedParent(@NonNull ExpandableWrapper<P, C> parentWrapper, int flatParentPosition, boolean expansionTriggeredByListItemClick) {
if (parentWrapper.isExpanded()) {
return;
}
parentWrapper.setExpanded(true);
mExpansionStateMap.put(parentWrap... | [
"@",
"UiThread",
"private",
"void",
"updateExpandedParent",
"(",
"@",
"NonNull",
"ExpandableWrapper",
"<",
"P",
",",
"C",
">",
"parentWrapper",
",",
"int",
"flatParentPosition",
",",
"boolean",
"expansionTriggeredByListItemClick",
")",
"{",
"if",
"(",
"parentWrapper... | Expands a specified parent. Calls through to the
ExpandCollapseListener and adds children of the specified parent to the
flat list of items.
@param parentWrapper The ExpandableWrapper of the parent to expand
@param flatParentPosition The index of the parent to expand
@param expansionTriggeredByListItemClick true if ex... | [
"Expands",
"a",
"specified",
"parent",
".",
"Calls",
"through",
"to",
"the",
"ExpandCollapseListener",
"and",
"adds",
"children",
"of",
"the",
"specified",
"parent",
"to",
"the",
"flat",
"list",
"of",
"items",
"."
] | train | https://github.com/bignerdranch/expandable-recycler-view/blob/930912510620894c531d236856fa79d646e2f1ed/expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java#L694-L716 |
meltmedia/cadmium | email/src/main/java/com/meltmedia/cadmium/email/Email.java | Email.addAddressHelper | private void addAddressHelper(InternetAddressSet set, String address) {
"""
Checks if the addresses need to be split either on , or ;
@param set Internet address set to add the address to
@param address address or addresses to add to the given set
"""
if (address.contains(",") || address.contains(";"))... | java | private void addAddressHelper(InternetAddressSet set, String address) {
if (address.contains(",") || address.contains(";")) {
String[] addresses = address.split("[,;]");
for (String a : addresses) {
set.add(a);
}
}
else {
set.add(address);
}
} | [
"private",
"void",
"addAddressHelper",
"(",
"InternetAddressSet",
"set",
",",
"String",
"address",
")",
"{",
"if",
"(",
"address",
".",
"contains",
"(",
"\",\"",
")",
"||",
"address",
".",
"contains",
"(",
"\";\"",
")",
")",
"{",
"String",
"[",
"]",
"add... | Checks if the addresses need to be split either on , or ;
@param set Internet address set to add the address to
@param address address or addresses to add to the given set | [
"Checks",
"if",
"the",
"addresses",
"need",
"to",
"be",
"split",
"either",
"on",
"or",
";"
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/email/src/main/java/com/meltmedia/cadmium/email/Email.java#L59-L70 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java | MimeTypeDeterminator.getMimeTypeFromString | @Nonnull
public IMimeType getMimeTypeFromString (@Nullable final String s, @Nonnull final Charset aCharset) {
"""
Try to find the MIME type that matches the passed content string.
@param s
The content string to check. May be <code>null</code>.
@param aCharset
The charset used to convert the string to a byt... | java | @Nonnull
public IMimeType getMimeTypeFromString (@Nullable final String s, @Nonnull final Charset aCharset)
{
return getMimeTypeFromString (s, aCharset, DEFAULT_MIME_TYPE);
} | [
"@",
"Nonnull",
"public",
"IMimeType",
"getMimeTypeFromString",
"(",
"@",
"Nullable",
"final",
"String",
"s",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"return",
"getMimeTypeFromString",
"(",
"s",
",",
"aCharset",
",",
"DEFAULT_MIME_TYPE",
"... | Try to find the MIME type that matches the passed content string.
@param s
The content string to check. May be <code>null</code>.
@param aCharset
The charset used to convert the string to a byte array. May not be
<code>null</code>.
@return {@link #DEFAULT_MIME_TYPE} if no matching MIME type was found.
Never <code>null... | [
"Try",
"to",
"find",
"the",
"MIME",
"type",
"that",
"matches",
"the",
"passed",
"content",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java#L180-L184 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/NetworkUtils.java | NetworkUtils.setLearningRate | public static void setLearningRate(ComputationGraph net, String layerName, ISchedule lrSchedule) {
"""
Set the learning rate schedule for a single layer in the network to the specified value.<br>
Note also that {@link #setLearningRate(ComputationGraph, ISchedule)} should also be used in preference, when all
laye... | java | public static void setLearningRate(ComputationGraph net, String layerName, ISchedule lrSchedule) {
setLearningRate(net, layerName, Double.NaN, lrSchedule, true);
} | [
"public",
"static",
"void",
"setLearningRate",
"(",
"ComputationGraph",
"net",
",",
"String",
"layerName",
",",
"ISchedule",
"lrSchedule",
")",
"{",
"setLearningRate",
"(",
"net",
",",
"layerName",
",",
"Double",
".",
"NaN",
",",
"lrSchedule",
",",
"true",
")"... | Set the learning rate schedule for a single layer in the network to the specified value.<br>
Note also that {@link #setLearningRate(ComputationGraph, ISchedule)} should also be used in preference, when all
layers need to be set to a new LR schedule.<br>
This schedule will replace any/all existing schedules, and also an... | [
"Set",
"the",
"learning",
"rate",
"schedule",
"for",
"a",
"single",
"layer",
"in",
"the",
"network",
"to",
"the",
"specified",
"value",
".",
"<br",
">",
"Note",
"also",
"that",
"{",
"@link",
"#setLearningRate",
"(",
"ComputationGraph",
"ISchedule",
")",
"}",... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/NetworkUtils.java#L313-L315 |
soklet/soklet | src/main/java/com/soklet/classindex/ClassIndex.java | ClassIndex.getClassSummary | public static String getClassSummary(Class<?> klass, ClassLoader classLoader) {
"""
Returns the Javadoc summary for given class.
<p>
Javadoc summary is the first sentence of a Javadoc.
</p>
<p>
You need to use {@link IndexSubclasses} or {@link IndexAnnotated} with {@link IndexAnnotated#storeJavadoc()}
set to... | java | public static String getClassSummary(Class<?> klass, ClassLoader classLoader) {
URL resource = classLoader.getResource(JAVADOC_PREFIX + klass.getCanonicalName());
if (resource == null) {
return null;
}
try {
try (@SuppressWarnings("resource")
BufferedReader reader = new BufferedReader(new InputStrea... | [
"public",
"static",
"String",
"getClassSummary",
"(",
"Class",
"<",
"?",
">",
"klass",
",",
"ClassLoader",
"classLoader",
")",
"{",
"URL",
"resource",
"=",
"classLoader",
".",
"getResource",
"(",
"JAVADOC_PREFIX",
"+",
"klass",
".",
"getCanonicalName",
"(",
")... | Returns the Javadoc summary for given class.
<p>
Javadoc summary is the first sentence of a Javadoc.
</p>
<p>
You need to use {@link IndexSubclasses} or {@link IndexAnnotated} with {@link IndexAnnotated#storeJavadoc()}
set to true.
</p>
@param klass class to retrieve summary for
@param classLoader classloader fo... | [
"Returns",
"the",
"Javadoc",
"summary",
"for",
"given",
"class",
".",
"<p",
">",
"Javadoc",
"summary",
"is",
"the",
"first",
"sentence",
"of",
"a",
"Javadoc",
".",
"<",
"/",
"p",
">",
"<p",
">",
"You",
"need",
"to",
"use",
"{",
"@link",
"IndexSubclasse... | train | https://github.com/soklet/soklet/blob/4f12de07d9c132e0126d50ad11cc1d8576594700/src/main/java/com/soklet/classindex/ClassIndex.java#L341-L369 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.removeByLtD_S | @Override
public void removeByLtD_S(Date displayDate, int status) {
"""
Removes all the cp instances where displayDate < ? and status = ? from the database.
@param displayDate the display date
@param status the status
"""
for (CPInstance cpInstance : findByLtD_S(displayDate, status,
Query... | java | @Override
public void removeByLtD_S(Date displayDate, int status) {
for (CPInstance cpInstance : findByLtD_S(displayDate, status,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpInstance);
}
} | [
"@",
"Override",
"public",
"void",
"removeByLtD_S",
"(",
"Date",
"displayDate",
",",
"int",
"status",
")",
"{",
"for",
"(",
"CPInstance",
"cpInstance",
":",
"findByLtD_S",
"(",
"displayDate",
",",
"status",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
... | Removes all the cp instances where displayDate < ? and status = ? from the database.
@param displayDate the display date
@param status the status | [
"Removes",
"all",
"the",
"cp",
"instances",
"where",
"displayDate",
"<",
";",
"?",
";",
"and",
"status",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L6119-L6125 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerCommunicationLinksInner.java | ServerCommunicationLinksInner.createOrUpdate | public ServerCommunicationLinkInner createOrUpdate(String resourceGroupName, String serverName, String communicationLinkName, String partnerServer) {
"""
Creates a server communication link.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Az... | java | public ServerCommunicationLinkInner createOrUpdate(String resourceGroupName, String serverName, String communicationLinkName, String partnerServer) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, communicationLinkName, partnerServer).toBlocking().last().body();
} | [
"public",
"ServerCommunicationLinkInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"communicationLinkName",
",",
"String",
"partnerServer",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGro... | Creates a server communication link.
@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 communicationLinkName The name of the server communication link.
@param ... | [
"Creates",
"a",
"server",
"communication",
"link",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerCommunicationLinksInner.java#L277-L279 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/lock/LockTable.java | LockTable.waitForUnlockAndLock | public SessionInfo waitForUnlockAndLock(Object bookmark, SessionInfo sessionInfo, int iTimeToWait) {
"""
Add this lock to the table.
@param bookmark The bookmark to lock.
@param session The session to lock.
@return null if successful, the session of the locking user if not successful (timeout).
"""
... | java | public SessionInfo waitForUnlockAndLock(Object bookmark, SessionInfo sessionInfo, int iTimeToWait)
{
Utility.getLogger().info("Wait for unlock: " + bookmark + ", Session: " + sessionInfo.m_iSessionID);
try {
synchronized (sessionInfo)
{
if (!this.containsKey(bookmar... | [
"public",
"SessionInfo",
"waitForUnlockAndLock",
"(",
"Object",
"bookmark",
",",
"SessionInfo",
"sessionInfo",
",",
"int",
"iTimeToWait",
")",
"{",
"Utility",
".",
"getLogger",
"(",
")",
".",
"info",
"(",
"\"Wait for unlock: \"",
"+",
"bookmark",
"+",
"\", Session... | Add this lock to the table.
@param bookmark The bookmark to lock.
@param session The session to lock.
@return null if successful, the session of the locking user if not successful (timeout). | [
"Add",
"this",
"lock",
"to",
"the",
"table",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/lock/LockTable.java#L76-L93 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.findFieldInHierarchy | private static Field findFieldInHierarchy(Object object, String fieldName) {
"""
Find field in hierarchy.
@param object the object
@param fieldName the field name
@return the field
"""
return findFieldInHierarchy(object, new FieldNameMatcherStrategy(fieldName));
} | java | private static Field findFieldInHierarchy(Object object, String fieldName) {
return findFieldInHierarchy(object, new FieldNameMatcherStrategy(fieldName));
} | [
"private",
"static",
"Field",
"findFieldInHierarchy",
"(",
"Object",
"object",
",",
"String",
"fieldName",
")",
"{",
"return",
"findFieldInHierarchy",
"(",
"object",
",",
"new",
"FieldNameMatcherStrategy",
"(",
"fieldName",
")",
")",
";",
"}"
] | Find field in hierarchy.
@param object the object
@param fieldName the field name
@return the field | [
"Find",
"field",
"in",
"hierarchy",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L441-L443 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/FieldDataScratchHandler.java | FieldDataScratchHandler.fieldChanged | public int fieldChanged(boolean bDisplayOption, int iMoveMode) {
"""
/*
The Field has Changed.
Don't need to call inherited.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay).
"""
if (i... | java | public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
if (iMoveMode != DBConstants.SCREEN_MOVE) // This is necessary if an override change the repondsTo.
// Also, if just refreshing the record, don't change this if set
if ((m_bChangeDataOnRefresh) || ((this.getOwner().getRecord().g... | [
"public",
"int",
"fieldChanged",
"(",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"iMoveMode",
"!=",
"DBConstants",
".",
"SCREEN_MOVE",
")",
"// This is necessary if an override change the repondsTo.",
"// Also, if just refreshing the record, do... | /*
The Field has Changed.
Don't need to call inherited.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay). | [
"/",
"*",
"The",
"Field",
"has",
"Changed",
".",
"Don",
"t",
"need",
"to",
"call",
"inherited",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/FieldDataScratchHandler.java#L103-L111 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java | CommercePriceListPersistenceImpl.findByGroupId | @Override
public List<CommercePriceList> findByGroupId(long groupId, int start,
int end) {
"""
Returns a range of all the commerce price lists where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not p... | java | @Override
public List<CommercePriceList> findByGroupId(long groupId, int start,
int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceList",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce price lists where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the se... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"price",
"lists",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java#L1541-L1545 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.getVirtualURL | public static URL getVirtualURL(VirtualFile file) throws MalformedURLException {
"""
Get the virtual URL for a virtual file. This URL can be used to access the virtual file; however, taking the file
part of the URL and attempting to use it with the {@link java.io.File} class may fail if the file is not present
... | java | public static URL getVirtualURL(VirtualFile file) throws MalformedURLException {
try {
final URI uri = getVirtualURI(file);
final String scheme = uri.getScheme();
return AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {
@Override
... | [
"public",
"static",
"URL",
"getVirtualURL",
"(",
"VirtualFile",
"file",
")",
"throws",
"MalformedURLException",
"{",
"try",
"{",
"final",
"URI",
"uri",
"=",
"getVirtualURI",
"(",
"file",
")",
";",
"final",
"String",
"scheme",
"=",
"uri",
".",
"getScheme",
"(... | Get the virtual URL for a virtual file. This URL can be used to access the virtual file; however, taking the file
part of the URL and attempting to use it with the {@link java.io.File} class may fail if the file is not present
on the physical filesystem, and in general should not be attempted.
<b>Note:</b> if the give... | [
"Get",
"the",
"virtual",
"URL",
"for",
"a",
"virtual",
"file",
".",
"This",
"URL",
"can",
"be",
"used",
"to",
"access",
"the",
"virtual",
"file",
";",
"however",
"taking",
"the",
"file",
"part",
"of",
"the",
"URL",
"and",
"attempting",
"to",
"use",
"it... | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L493-L514 |
brettonw/Bag | src/main/java/com/brettonw/bag/Bag.java | Bag.getString | public String getString (String key, Supplier<String> notFound) {
"""
Retrieve a mapped element and return it as a String.
@param key A string value used to index the element.
@param notFound A function to create a new String if the requested key was not found
@return The element as a string, or notFound if t... | java | public String getString (String key, Supplier<String> notFound) {
Object object = getObject (key);
return (object instanceof String) ? (String) object : notFound.get ();
} | [
"public",
"String",
"getString",
"(",
"String",
"key",
",",
"Supplier",
"<",
"String",
">",
"notFound",
")",
"{",
"Object",
"object",
"=",
"getObject",
"(",
"key",
")",
";",
"return",
"(",
"object",
"instanceof",
"String",
")",
"?",
"(",
"String",
")",
... | Retrieve a mapped element and return it as a String.
@param key A string value used to index the element.
@param notFound A function to create a new String if the requested key was not found
@return The element as a string, or notFound if the element is not found. | [
"Retrieve",
"a",
"mapped",
"element",
"and",
"return",
"it",
"as",
"a",
"String",
"."
] | train | https://github.com/brettonw/Bag/blob/25c0ff74893b6c9a2c61bf0f97189ab82e0b2f56/src/main/java/com/brettonw/bag/Bag.java#L86-L89 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/iot/control/IoTControlManager.java | IoTControlManager.setUsingIq | public IoTSetResponse setUsingIq(FullJid jid, Collection<? extends SetData> data) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Control a thing by sending a collection of {@link SetData} instructions.
@param jid the thing to control.
@param data a collection ... | java | public IoTSetResponse setUsingIq(FullJid jid, Collection<? extends SetData> data) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
IoTSetRequest request = new IoTSetRequest(data);
request.setTo(jid);
IoTSetResponse response = connection().createStanza... | [
"public",
"IoTSetResponse",
"setUsingIq",
"(",
"FullJid",
"jid",
",",
"Collection",
"<",
"?",
"extends",
"SetData",
">",
"data",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"IoTSetReq... | Control a thing by sending a collection of {@link SetData} instructions.
@param jid the thing to control.
@param data a collection of {@link SetData} instructions.
@return the {@link IoTSetResponse} if successful.
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedException
@throws InterruptedE... | [
"Control",
"a",
"thing",
"by",
"sending",
"a",
"collection",
"of",
"{",
"@link",
"SetData",
"}",
"instructions",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/iot/control/IoTControlManager.java#L128-L133 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/trustmanager/PKITrustManager.java | PKITrustManager.checkClientTrusted | public void checkClientTrusted(X509Certificate[] x509Certificates, String authType)
throws CertificateException {
"""
Test if the client is trusted based on the certificate chain. Does not currently support anonymous clients.
@param x509Certificates The certificate chain to test for validity.
@para... | java | public void checkClientTrusted(X509Certificate[] x509Certificates, String authType)
throws CertificateException {
// JGLOBUS-97 : anonymous clients?
CertPath certPath = CertificateUtil.getCertPath(x509Certificates);
try {
this.result = this.validator.engineValidate(certPa... | [
"public",
"void",
"checkClientTrusted",
"(",
"X509Certificate",
"[",
"]",
"x509Certificates",
",",
"String",
"authType",
")",
"throws",
"CertificateException",
"{",
"// JGLOBUS-97 : anonymous clients?",
"CertPath",
"certPath",
"=",
"CertificateUtil",
".",
"getCertPath",
"... | Test if the client is trusted based on the certificate chain. Does not currently support anonymous clients.
@param x509Certificates The certificate chain to test for validity.
@param authType The authentication type based on the client certificate.
@throws CertificateException If the path validation fails. | [
"Test",
"if",
"the",
"client",
"is",
"trusted",
"based",
"on",
"the",
"certificate",
"chain",
".",
"Does",
"not",
"currently",
"support",
"anonymous",
"clients",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/PKITrustManager.java#L89-L100 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ExecuteSQLQueryBuilder.java | ExecuteSQLQueryBuilder.validateScript | public ExecuteSQLQueryBuilder validateScript(Resource scriptResource, String type) {
"""
Validate SQL result set via validation script, for instance Groovy.
@param scriptResource
@param type
"""
return validateScript(scriptResource, type, FileUtils.getDefaultCharset());
} | java | public ExecuteSQLQueryBuilder validateScript(Resource scriptResource, String type) {
return validateScript(scriptResource, type, FileUtils.getDefaultCharset());
} | [
"public",
"ExecuteSQLQueryBuilder",
"validateScript",
"(",
"Resource",
"scriptResource",
",",
"String",
"type",
")",
"{",
"return",
"validateScript",
"(",
"scriptResource",
",",
"type",
",",
"FileUtils",
".",
"getDefaultCharset",
"(",
")",
")",
";",
"}"
] | Validate SQL result set via validation script, for instance Groovy.
@param scriptResource
@param type | [
"Validate",
"SQL",
"result",
"set",
"via",
"validation",
"script",
"for",
"instance",
"Groovy",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ExecuteSQLQueryBuilder.java#L187-L189 |
Cornutum/tcases | tcases-maven-plugin/src/main/java/org/cornutum/tcases/maven/TcasesMojo.java | TcasesMojo.getProjectFile | private String getProjectFile( String projectName, String filePattern) {
"""
Returns the file name defined by applying the given pattern to the project name.
Returns null if the file pattern is invalid.
"""
String projectFile = null;
if( !StringUtils.isBlank( filePattern))
{
Matcher matche... | java | private String getProjectFile( String projectName, String filePattern)
{
String projectFile = null;
if( !StringUtils.isBlank( filePattern))
{
Matcher matcher = projectFilePattern_.matcher( filePattern);
if( matcher.matches())
{
projectFile =
StringUtils.isBlank( m... | [
"private",
"String",
"getProjectFile",
"(",
"String",
"projectName",
",",
"String",
"filePattern",
")",
"{",
"String",
"projectFile",
"=",
"null",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isBlank",
"(",
"filePattern",
")",
")",
"{",
"Matcher",
"matcher",
"=... | Returns the file name defined by applying the given pattern to the project name.
Returns null if the file pattern is invalid. | [
"Returns",
"the",
"file",
"name",
"defined",
"by",
"applying",
"the",
"given",
"pattern",
"to",
"the",
"project",
"name",
".",
"Returns",
"null",
"if",
"the",
"file",
"pattern",
"is",
"invalid",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-maven-plugin/src/main/java/org/cornutum/tcases/maven/TcasesMojo.java#L159-L175 |
graknlabs/grakn | server/src/server/kb/structure/VertexElement.java | VertexElement.deleteEdge | public void deleteEdge(Direction direction, Schema.EdgeLabel label, VertexElement... targets) {
"""
Deletes all the edges of a specific Schema.EdgeLabel to or from a specific set of targets.
If no targets are provided then all the edges of the specified type are deleted
@param direction The direction of the ed... | java | public void deleteEdge(Direction direction, Schema.EdgeLabel label, VertexElement... targets) {
Iterator<Edge> edges = element().edges(direction, label.getLabel());
if (targets.length == 0) {
edges.forEachRemaining(Edge::remove);
} else {
Set<Vertex> verticesToDelete = Ar... | [
"public",
"void",
"deleteEdge",
"(",
"Direction",
"direction",
",",
"Schema",
".",
"EdgeLabel",
"label",
",",
"VertexElement",
"...",
"targets",
")",
"{",
"Iterator",
"<",
"Edge",
">",
"edges",
"=",
"element",
"(",
")",
".",
"edges",
"(",
"direction",
",",... | Deletes all the edges of a specific Schema.EdgeLabel to or from a specific set of targets.
If no targets are provided then all the edges of the specified type are deleted
@param direction The direction of the edges to delete
@param label The edge label to delete
@param targets An optional set of targets to delet... | [
"Deletes",
"all",
"the",
"edges",
"of",
"a",
"specific",
"Schema",
".",
"EdgeLabel",
"to",
"or",
"from",
"a",
"specific",
"set",
"of",
"targets",
".",
"If",
"no",
"targets",
"are",
"provided",
"then",
"all",
"the",
"edges",
"of",
"the",
"specified",
"typ... | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/structure/VertexElement.java#L93-L116 |
TonicArtos/StickyGridHeaders | Example/src/com/tonicartos/stickygridheadersexample/ItemListActivity.java | ItemListActivity.onItemSelected | @Override
public void onItemSelected(int id) {
"""
Callback method from {@link ItemListFragment.Callbacks} indicating that
the item with the given ID was selected.
"""
if (mTwoPane) {
// In two-pane mode, show the detail view in this activity by
// adding or replacing the d... | java | @Override
public void onItemSelected(int id) {
if (mTwoPane) {
// In two-pane mode, show the detail view in this activity by
// adding or replacing the detail fragment using a
// fragment transaction.
Bundle arguments = new Bundle();
arguments.putI... | [
"@",
"Override",
"public",
"void",
"onItemSelected",
"(",
"int",
"id",
")",
"{",
"if",
"(",
"mTwoPane",
")",
"{",
"// In two-pane mode, show the detail view in this activity by",
"// adding or replacing the detail fragment using a",
"// fragment transaction.",
"Bundle",
"argume... | Callback method from {@link ItemListFragment.Callbacks} indicating that
the item with the given ID was selected. | [
"Callback",
"method",
"from",
"{"
] | train | https://github.com/TonicArtos/StickyGridHeaders/blob/e3e4f8fa5d5c01edc9af26ff800302a931103b31/Example/src/com/tonicartos/stickygridheadersexample/ItemListActivity.java#L51-L71 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.genArgs | public void genArgs(List<JCExpression> trees, List<Type> pts) {
"""
Derived visitor method: generate code for a list of method arguments.
@param trees The argument expressions to be visited.
@param pts The expression's expected types (i.e. the formal parameter
types of the invoked method).
"""
... | java | public void genArgs(List<JCExpression> trees, List<Type> pts) {
for (List<JCExpression> l = trees; l.nonEmpty(); l = l.tail) {
genExpr(l.head, pts.head).load();
pts = pts.tail;
}
// require lists be of same length
Assert.check(pts.isEmpty());
} | [
"public",
"void",
"genArgs",
"(",
"List",
"<",
"JCExpression",
">",
"trees",
",",
"List",
"<",
"Type",
">",
"pts",
")",
"{",
"for",
"(",
"List",
"<",
"JCExpression",
">",
"l",
"=",
"trees",
";",
"l",
".",
"nonEmpty",
"(",
")",
";",
"l",
"=",
"l",... | Derived visitor method: generate code for a list of method arguments.
@param trees The argument expressions to be visited.
@param pts The expression's expected types (i.e. the formal parameter
types of the invoked method). | [
"Derived",
"visitor",
"method",
":",
"generate",
"code",
"for",
"a",
"list",
"of",
"method",
"arguments",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java#L832-L839 |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Report.java | Report.setUser | public Report setUser(String id, String email, String name) {
"""
Helper method to set all the user attributes.
@param id the identifier of the user.
@param email the email of the user.
@param name the name of the user.
@return the modified report.
"""
diagnostics.user.put("id", id);
... | java | public Report setUser(String id, String email, String name) {
diagnostics.user.put("id", id);
diagnostics.user.put("email", email);
diagnostics.user.put("name", name);
return this;
} | [
"public",
"Report",
"setUser",
"(",
"String",
"id",
",",
"String",
"email",
",",
"String",
"name",
")",
"{",
"diagnostics",
".",
"user",
".",
"put",
"(",
"\"id\"",
",",
"id",
")",
";",
"diagnostics",
".",
"user",
".",
"put",
"(",
"\"email\"",
",",
"e... | Helper method to set all the user attributes.
@param id the identifier of the user.
@param email the email of the user.
@param name the name of the user.
@return the modified report. | [
"Helper",
"method",
"to",
"set",
"all",
"the",
"user",
"attributes",
"."
] | train | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Report.java#L297-L302 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/audio/AudioFactory.java | AudioFactory.loadAudio | public static synchronized <A extends Audio> A loadAudio(Media media, Class<A> type) {
"""
Load an audio file and prepare it to be played.
@param <A> The audio type.
@param media The audio media (must not be <code>null</code>).
@param type The expected audio type (must not be <code>null</code>).
@return The ... | java | public static synchronized <A extends Audio> A loadAudio(Media media, Class<A> type)
{
Check.notNull(media);
Check.notNull(type);
final String extension = UtilFile.getExtension(media.getPath());
try
{
return type.cast(Optional.ofNullable(FACTORIES.get(extension))... | [
"public",
"static",
"synchronized",
"<",
"A",
"extends",
"Audio",
">",
"A",
"loadAudio",
"(",
"Media",
"media",
",",
"Class",
"<",
"A",
">",
"type",
")",
"{",
"Check",
".",
"notNull",
"(",
"media",
")",
";",
"Check",
".",
"notNull",
"(",
"type",
")",... | Load an audio file and prepare it to be played.
@param <A> The audio type.
@param media The audio media (must not be <code>null</code>).
@param type The expected audio type (must not be <code>null</code>).
@return The loaded audio.
@throws LionEngineException If invalid arguments or invalid audio. | [
"Load",
"an",
"audio",
"file",
"and",
"prepare",
"it",
"to",
"be",
"played",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/audio/AudioFactory.java#L70-L86 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/UtilReflection.java | UtilReflection.hasCompatibleConstructor | private static boolean hasCompatibleConstructor(Class<?>[] paramTypes, Class<?>[] constructorTypes) {
"""
Check if there is a compatible constructor for the types.
@param paramTypes The types as input.
@param constructorTypes The constructors to check.
@return <code>true</code> if at least one constructor is ... | java | private static boolean hasCompatibleConstructor(Class<?>[] paramTypes, Class<?>[] constructorTypes)
{
for (int i = 0; i < paramTypes.length; i++)
{
if (constructorTypes[i].isAssignableFrom(paramTypes[i]))
{
return true;
}
}
... | [
"private",
"static",
"boolean",
"hasCompatibleConstructor",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"constructorTypes",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"paramTypes",
".",
... | Check if there is a compatible constructor for the types.
@param paramTypes The types as input.
@param constructorTypes The constructors to check.
@return <code>true</code> if at least one constructor is compatible, <code>false</code> else. | [
"Check",
"if",
"there",
"is",
"a",
"compatible",
"constructor",
"for",
"the",
"types",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/UtilReflection.java#L443-L453 |
UrielCh/ovh-java-sdk | ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java | ApiOvhRouter.serviceName_privateLink_peerServiceName_request_GET | public OvhPrivateLinkRequest serviceName_privateLink_peerServiceName_request_GET(String serviceName, String peerServiceName) throws IOException {
"""
Get this object properties
REST: GET /router/{serviceName}/privateLink/{peerServiceName}/request
@param serviceName [required] The internal name of your Router o... | java | public OvhPrivateLinkRequest serviceName_privateLink_peerServiceName_request_GET(String serviceName, String peerServiceName) throws IOException {
String qPath = "/router/{serviceName}/privateLink/{peerServiceName}/request";
StringBuilder sb = path(qPath, serviceName, peerServiceName);
String resp = exec(qPath, "G... | [
"public",
"OvhPrivateLinkRequest",
"serviceName_privateLink_peerServiceName_request_GET",
"(",
"String",
"serviceName",
",",
"String",
"peerServiceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/router/{serviceName}/privateLink/{peerServiceName}/request\"",
";... | Get this object properties
REST: GET /router/{serviceName}/privateLink/{peerServiceName}/request
@param serviceName [required] The internal name of your Router offer
@param peerServiceName [required] Service name of the other side of this link | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java#L375-L380 |
infinispan/infinispan | core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java | ParseUtils.requireSingleAttribute | public static String requireSingleAttribute(final XMLStreamReader reader, final String attributeName)
throws XMLStreamException {
"""
Require that the current element have only a single attribute with the
given name.
@param reader the reader
@param attributeName the attribute name
@throws javax.xml... | java | public static String requireSingleAttribute(final XMLStreamReader reader, final String attributeName)
throws XMLStreamException {
final int count = reader.getAttributeCount();
if (count == 0) {
throw missingRequired(reader, Collections.singleton(attributeName));
}
... | [
"public",
"static",
"String",
"requireSingleAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"String",
"attributeName",
")",
"throws",
"XMLStreamException",
"{",
"final",
"int",
"count",
"=",
"reader",
".",
"getAttributeCount",
"(",
")",
";",
"... | Require that the current element have only a single attribute with the
given name.
@param reader the reader
@param attributeName the attribute name
@throws javax.xml.stream.XMLStreamException if an error occurs | [
"Require",
"that",
"the",
"current",
"element",
"have",
"only",
"a",
"single",
"attribute",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java#L210-L224 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/NameUtil.java | NameUtil.getHomeRemoteImplClassName | public static String getHomeRemoteImplClassName(EnterpriseBean enterpriseBean, boolean isPost11DD) // d114199 {
"""
Return the name of the deployed class that implements the home
interface of the bean. <p>
@param enterpriseBean bean impl class
@param isPost11DD true if bean is defined using later than 1.1 dep... | java | public static String getHomeRemoteImplClassName(EnterpriseBean enterpriseBean, boolean isPost11DD) // d114199
{
String homeInterfaceName = getHomeInterfaceName(enterpriseBean);
if (homeInterfaceName == null) {
return null;
}
String remoteInterfaceName = getRemoteInterfac... | [
"public",
"static",
"String",
"getHomeRemoteImplClassName",
"(",
"EnterpriseBean",
"enterpriseBean",
",",
"boolean",
"isPost11DD",
")",
"// d114199",
"{",
"String",
"homeInterfaceName",
"=",
"getHomeInterfaceName",
"(",
"enterpriseBean",
")",
";",
"if",
"(",
"homeInterf... | Return the name of the deployed class that implements the home
interface of the bean. <p>
@param enterpriseBean bean impl class
@param isPost11DD true if bean is defined using later than 1.1 deployment description. | [
"Return",
"the",
"name",
"of",
"the",
"deployed",
"class",
"that",
"implements",
"the",
"home",
"interface",
"of",
"the",
"bean",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/NameUtil.java#L267-L288 |
rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgent.java | JvmAgent.agentmain | public static void agentmain(String agentArgs, Instrumentation instrumentation) {
"""
Entry point for the agent, using dynamic attach
(this is post VM initialisation attachment, via com.sun.attach)
@param agentArgs arguments as given on the command line
"""
JvmAgentConfig config = new JvmAgentConfi... | java | public static void agentmain(String agentArgs, Instrumentation instrumentation) {
JvmAgentConfig config = new JvmAgentConfig(agentArgs);
if (!config.isModeStop()) {
startAgent(config,false, instrumentation);
} else {
stopAgent();
}
} | [
"public",
"static",
"void",
"agentmain",
"(",
"String",
"agentArgs",
",",
"Instrumentation",
"instrumentation",
")",
"{",
"JvmAgentConfig",
"config",
"=",
"new",
"JvmAgentConfig",
"(",
"agentArgs",
")",
";",
"if",
"(",
"!",
"config",
".",
"isModeStop",
"(",
")... | Entry point for the agent, using dynamic attach
(this is post VM initialisation attachment, via com.sun.attach)
@param agentArgs arguments as given on the command line | [
"Entry",
"point",
"for",
"the",
"agent",
"using",
"dynamic",
"attach",
"(",
"this",
"is",
"post",
"VM",
"initialisation",
"attachment",
"via",
"com",
".",
"sun",
".",
"attach",
")"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgent.java#L81-L88 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/internal/InnerClasses.java | InnerClasses.registerInnerClass | public TypeInfo registerInnerClass(String simpleName, int accessModifiers) {
"""
Register the given name as an inner class with the given access modifiers.
@return A {@link TypeInfo} with the full class name
"""
classNames.claimName(simpleName);
TypeInfo innerClass = outer.innerClass(simpleName);
... | java | public TypeInfo registerInnerClass(String simpleName, int accessModifiers) {
classNames.claimName(simpleName);
TypeInfo innerClass = outer.innerClass(simpleName);
innerClassesAccessModifiers.put(innerClass, accessModifiers);
return innerClass;
} | [
"public",
"TypeInfo",
"registerInnerClass",
"(",
"String",
"simpleName",
",",
"int",
"accessModifiers",
")",
"{",
"classNames",
".",
"claimName",
"(",
"simpleName",
")",
";",
"TypeInfo",
"innerClass",
"=",
"outer",
".",
"innerClass",
"(",
"simpleName",
")",
";",... | Register the given name as an inner class with the given access modifiers.
@return A {@link TypeInfo} with the full class name | [
"Register",
"the",
"given",
"name",
"as",
"an",
"inner",
"class",
"with",
"the",
"given",
"access",
"modifiers",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/internal/InnerClasses.java#L51-L56 |
ehcache/ehcache3 | core/src/main/java/org/ehcache/core/config/ExpiryUtils.java | ExpiryUtils.getExpiryForCreation | public static <K, V> Duration getExpiryForCreation(K key, V value, ExpiryPolicy<? super K, ? super V> expiry) {
"""
Returns the expiry for creation duration returned by the provided {@link ExpiryPolicy} but checks for immediate
expiry, null expiry and exceptions. In all those cases, {@code null} will be returned.... | java | public static <K, V> Duration getExpiryForCreation(K key, V value, ExpiryPolicy<? super K, ? super V> expiry) {
Duration duration;
try {
duration = expiry.getExpiryForCreation(key, value);
} catch (RuntimeException e) {
LOG.error("Expiry computation caused an exception - Expiry duration will be ... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Duration",
"getExpiryForCreation",
"(",
"K",
"key",
",",
"V",
"value",
",",
"ExpiryPolicy",
"<",
"?",
"super",
"K",
",",
"?",
"super",
"V",
">",
"expiry",
")",
"{",
"Duration",
"duration",
";",
"try",
"{"... | Returns the expiry for creation duration returned by the provided {@link ExpiryPolicy} but checks for immediate
expiry, null expiry and exceptions. In all those cases, {@code null} will be returned.
@param key key to pass to {@link ExpiryPolicy#getExpiryForCreation(Object, Object)}
@param value value to pass to to pas... | [
"Returns",
"the",
"expiry",
"for",
"creation",
"duration",
"returned",
"by",
"the",
"provided",
"{",
"@link",
"ExpiryPolicy",
"}",
"but",
"checks",
"for",
"immediate",
"expiry",
"null",
"expiry",
"and",
"exceptions",
".",
"In",
"all",
"those",
"cases",
"{",
... | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/config/ExpiryUtils.java#L195-L214 |
apiman/apiman | gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/connector/ConnectorFactory.java | ConnectorFactory.setAttributesFromApiEndpointProperties | private void setAttributesFromApiEndpointProperties(Api api, ApimanHttpConnectorOptions options) {
"""
If the endpoint properties includes a read timeout override, then
set it here.
@param connection
"""
try {
Map<String, String> endpointProperties = api.getEndpointProperties();
... | java | private void setAttributesFromApiEndpointProperties(Api api, ApimanHttpConnectorOptions options) {
try {
Map<String, String> endpointProperties = api.getEndpointProperties();
if (endpointProperties.containsKey("timeouts.read")) { //$NON-NLS-1$
int connectTimeoutMs = Integ... | [
"private",
"void",
"setAttributesFromApiEndpointProperties",
"(",
"Api",
"api",
",",
"ApimanHttpConnectorOptions",
"options",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"endpointProperties",
"=",
"api",
".",
"getEndpointProperties",
"(",
")",
... | If the endpoint properties includes a read timeout override, then
set it here.
@param connection | [
"If",
"the",
"endpoint",
"properties",
"includes",
"a",
"read",
"timeout",
"override",
"then",
"set",
"it",
"here",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/connector/ConnectorFactory.java#L126-L140 |
jblas-project/jblas | src/main/java/org/jblas/Eigen.java | Eigen.symmetricGeneralizedEigenvalues | public static DoubleMatrix symmetricGeneralizedEigenvalues(DoubleMatrix A, DoubleMatrix B, int il, int iu) {
"""
Computes selected eigenvalues of the real generalized symmetric-definite eigenproblem of the form A x = L B x
or, equivalently, (A - L B)x = 0. Here A and B are assumed to be symmetric and B is also po... | java | public static DoubleMatrix symmetricGeneralizedEigenvalues(DoubleMatrix A, DoubleMatrix B, int il, int iu) {
A.assertSquare();
B.assertSquare();
A.assertSameSize(B);
if (iu < il) {
throw new IllegalArgumentException("Index exception: make sure iu >= il");
}
if (il < 0) {
throw new Il... | [
"public",
"static",
"DoubleMatrix",
"symmetricGeneralizedEigenvalues",
"(",
"DoubleMatrix",
"A",
",",
"DoubleMatrix",
"B",
",",
"int",
"il",
",",
"int",
"iu",
")",
"{",
"A",
".",
"assertSquare",
"(",
")",
";",
"B",
".",
"assertSquare",
"(",
")",
";",
"A",
... | Computes selected eigenvalues of the real generalized symmetric-definite eigenproblem of the form A x = L B x
or, equivalently, (A - L B)x = 0. Here A and B are assumed to be symmetric and B is also positive definite.
The selection is based on the given range of indices for the desired eigenvalues.
@param A symmetric... | [
"Computes",
"selected",
"eigenvalues",
"of",
"the",
"real",
"generalized",
"symmetric",
"-",
"definite",
"eigenproblem",
"of",
"the",
"form",
"A",
"x",
"=",
"L",
"B",
"x",
"or",
"equivalently",
"(",
"A",
"-",
"L",
"B",
")",
"x",
"=",
"0",
".",
"Here",
... | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Eigen.java#L208-L227 |
JoeKerouac/utils | src/main/java/com/joe/utils/poi/WorkBookAccesser.java | WorkBookAccesser.mergedRegion | private void mergedRegion(Sheet sheet, int firstRow, int lastRow, int firstCol, int lastCol) {
"""
合并指定sheet指定区域的单元格
@param sheet sheet
@param firstRow 要合并的第一行
@param lastRow 要合并的最后一行
@param firstCol 要合并的第一列
@param lastCol 要合并的最后一列
"""
sheet.addMergedRegion(new CellRangeAddress(firstRow, la... | java | private void mergedRegion(Sheet sheet, int firstRow, int lastRow, int firstCol, int lastCol) {
sheet.addMergedRegion(new CellRangeAddress(firstRow, lastRow, firstCol, lastCol));
} | [
"private",
"void",
"mergedRegion",
"(",
"Sheet",
"sheet",
",",
"int",
"firstRow",
",",
"int",
"lastRow",
",",
"int",
"firstCol",
",",
"int",
"lastCol",
")",
"{",
"sheet",
".",
"addMergedRegion",
"(",
"new",
"CellRangeAddress",
"(",
"firstRow",
",",
"lastRow"... | 合并指定sheet指定区域的单元格
@param sheet sheet
@param firstRow 要合并的第一行
@param lastRow 要合并的最后一行
@param firstCol 要合并的第一列
@param lastCol 要合并的最后一列 | [
"合并指定sheet指定区域的单元格"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/poi/WorkBookAccesser.java#L116-L118 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/Member.java | Member.normalizeY | void normalizeY(double yMax, int normMax) {
"""
Create the normalized point set.
<p>
@param yMax the overall max value
@param normMax the normalized max
"""
exploded.forEach(y -> {
int norm = (int) Math.round((y / yMax) * normMax);
normalized.add(norm);
});
} | java | void normalizeY(double yMax, int normMax) {
exploded.forEach(y -> {
int norm = (int) Math.round((y / yMax) * normMax);
normalized.add(norm);
});
} | [
"void",
"normalizeY",
"(",
"double",
"yMax",
",",
"int",
"normMax",
")",
"{",
"exploded",
".",
"forEach",
"(",
"y",
"->",
"{",
"int",
"norm",
"=",
"(",
"int",
")",
"Math",
".",
"round",
"(",
"(",
"y",
"/",
"yMax",
")",
"*",
"normMax",
")",
";",
... | Create the normalized point set.
<p>
@param yMax the overall max value
@param normMax the normalized max | [
"Create",
"the",
"normalized",
"point",
"set",
".",
"<p",
">"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/Member.java#L326-L331 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContext.java | ProcessContext.createRandomContext | public static ProcessContext createRandomContext(Set<String> activities, int originatorCount, List<String> roles) {
"""
Creates a new context using an RBAC access control model.<br>
Users and permissions to execute transactions are randomly assigned
to the given roles.<br>
Each person is assigned to exactly one... | java | public static ProcessContext createRandomContext(Set<String> activities, int originatorCount, List<String> roles) {
Validate.notNull(activities);
Validate.noNullElements(activities);
Validate.notNegative(originatorCount);
Validate.notNull(roles);
... | [
"public",
"static",
"ProcessContext",
"createRandomContext",
"(",
"Set",
"<",
"String",
">",
"activities",
",",
"int",
"originatorCount",
",",
"List",
"<",
"String",
">",
"roles",
")",
"{",
"Validate",
".",
"notNull",
"(",
"activities",
")",
";",
"Validate",
... | Creates a new context using an RBAC access control model.<br>
Users and permissions to execute transactions are randomly assigned
to the given roles.<br>
Each person is assigned to exactly one role.
@param activities The process activities.
@param originatorCount The number of desired originators.
@param roles The rol... | [
"Creates",
"a",
"new",
"context",
"using",
"an",
"RBAC",
"access",
"control",
"model",
".",
"<br",
">",
"Users",
"and",
"permissions",
"to",
"execute",
"transactions",
"are",
"randomly",
"assigned",
"to",
"the",
"given",
"roles",
".",
"<br",
">",
"Each",
"... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContext.java#L961-L975 |
josueeduardo/snappy | plugin-parent/snappy-maven-plugin/src/main/java/io/joshworks/snappy/maven/tools/JarWriter.java | JarWriter.writeNestedLibrary | public void writeNestedLibrary(String destination, Library library)
throws IOException {
"""
Write a nested library.
@param destination the destination of the library
@param library the library
@throws IOException if the write fails
"""
File file = library.getFile();
JarEnt... | java | public void writeNestedLibrary(String destination, Library library)
throws IOException {
File file = library.getFile();
JarEntry entry = new JarEntry(destination + library.getName());
entry.setTime(getNestedLibraryTime(file));
if (library.isUnpackRequired()) {
ent... | [
"public",
"void",
"writeNestedLibrary",
"(",
"String",
"destination",
",",
"Library",
"library",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"library",
".",
"getFile",
"(",
")",
";",
"JarEntry",
"entry",
"=",
"new",
"JarEntry",
"(",
"destination",
... | Write a nested library.
@param destination the destination of the library
@param library the library
@throws IOException if the write fails | [
"Write",
"a",
"nested",
"library",
"."
] | train | https://github.com/josueeduardo/snappy/blob/d95a9e811eda3c24a5e53086369208819884fa49/plugin-parent/snappy-maven-plugin/src/main/java/io/joshworks/snappy/maven/tools/JarWriter.java#L165-L175 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/ProjectManager.java | ProjectManager.getProjectByKey | public Project getProjectByKey(String projectKey) throws RedmineException {
"""
@param projectKey string key like "project-ABC", NOT a database numeric ID
@return Redmine's project
@throws RedmineAuthenticationException invalid or no API access key is used with the server, which
requires authorization. Check ... | java | public Project getProjectByKey(String projectKey) throws RedmineException {
return transport.getObject(Project.class, projectKey,
new BasicNameValuePair("include", "trackers"));
} | [
"public",
"Project",
"getProjectByKey",
"(",
"String",
"projectKey",
")",
"throws",
"RedmineException",
"{",
"return",
"transport",
".",
"getObject",
"(",
"Project",
".",
"class",
",",
"projectKey",
",",
"new",
"BasicNameValuePair",
"(",
"\"include\"",
",",
"\"tra... | @param projectKey string key like "project-ABC", NOT a database numeric ID
@return Redmine's project
@throws RedmineAuthenticationException invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
@throws NotFoundException the project with the given key... | [
"@param",
"projectKey",
"string",
"key",
"like",
"project",
"-",
"ABC",
"NOT",
"a",
"database",
"numeric",
"ID"
] | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/ProjectManager.java#L82-L85 |
Azure/azure-sdk-for-java | cognitiveservices/resource-manager/v2016_02_01_preview/src/main/java/com/microsoft/azure/management/cognitiveservices/v2016_02_01_preview/implementation/CognitiveServicesAccountsInner.java | CognitiveServicesAccountsInner.regenerateKey | public CognitiveServicesAccountKeysInner regenerateKey(String resourceGroupName, String accountName) {
"""
Regenerates the specified account key for the specified Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of t... | java | public CognitiveServicesAccountKeysInner regenerateKey(String resourceGroupName, String accountName) {
return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body();
} | [
"public",
"CognitiveServicesAccountKeysInner",
"regenerateKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"return",
"regenerateKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")",
".",
"toBlocking",
"(",
")",
"... | Regenerates the specified account key for the specified Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of the cognitive services account within the specified resource group. Cognitive Services account names must be between... | [
"Regenerates",
"the",
"specified",
"account",
"key",
"for",
"the",
"specified",
"Cognitive",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/resource-manager/v2016_02_01_preview/src/main/java/com/microsoft/azure/management/cognitiveservices/v2016_02_01_preview/implementation/CognitiveServicesAccountsInner.java#L825-L827 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java | RuntimeExceptionsFactory.newNullPointerException | public static NullPointerException newNullPointerException(String message, Object... args) {
"""
Constructs and initializes a new {@link NullPointerException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link NullPoint... | java | public static NullPointerException newNullPointerException(String message, Object... args) {
return newNullPointerException(null, message, args);
} | [
"public",
"static",
"NullPointerException",
"newNullPointerException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newNullPointerException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link NullPointerException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link NullPointerException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"NullPointerException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java#L162-L164 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/CapsuleLauncher.java | CapsuleLauncher.setProperty | public CapsuleLauncher setProperty(String property, String value) {
"""
Sets a property for the capsules created by {@code newCapsule}
@param property the name of the property
@param value the property's value
@return {@code this}
"""
if (value != null)
properties.setProperty(proper... | java | public CapsuleLauncher setProperty(String property, String value) {
if (value != null)
properties.setProperty(property, value);
else
properties.remove(property);
return this;
} | [
"public",
"CapsuleLauncher",
"setProperty",
"(",
"String",
"property",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"properties",
".",
"setProperty",
"(",
"property",
",",
"value",
")",
";",
"else",
"properties",
".",
"remove",
... | Sets a property for the capsules created by {@code newCapsule}
@param property the name of the property
@param value the property's value
@return {@code this} | [
"Sets",
"a",
"property",
"for",
"the",
"capsules",
"created",
"by",
"{",
"@code",
"newCapsule",
"}"
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/CapsuleLauncher.java#L82-L88 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/TagsInner.java | TagsInner.createOrUpdateValue | public TagValueInner createOrUpdateValue(String tagName, String tagValue) {
"""
Creates a tag value. The name of the tag must already exist.
@param tagName The name of the tag.
@param tagValue The value of the tag to create.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Cl... | java | public TagValueInner createOrUpdateValue(String tagName, String tagValue) {
return createOrUpdateValueWithServiceResponseAsync(tagName, tagValue).toBlocking().single().body();
} | [
"public",
"TagValueInner",
"createOrUpdateValue",
"(",
"String",
"tagName",
",",
"String",
"tagValue",
")",
"{",
"return",
"createOrUpdateValueWithServiceResponseAsync",
"(",
"tagName",
",",
"tagValue",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".... | Creates a tag value. The name of the tag must already exist.
@param tagName The name of the tag.
@param tagValue The value of the tag to create.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all othe... | [
"Creates",
"a",
"tag",
"value",
".",
"The",
"name",
"of",
"the",
"tag",
"must",
"already",
"exist",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/TagsInner.java#L184-L186 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleIO.java | ParticleIO.loadConfiguredSystem | public static ParticleSystem loadConfiguredSystem(String ref, Color mask)
throws IOException {
"""
Load a set of configured emitters into a single system
@param ref
The reference to the XML file (file or classpath)
@param mask
@return A configured particle system
@throws IOException
Indicates a failure... | java | public static ParticleSystem loadConfiguredSystem(String ref, Color mask)
throws IOException {
return loadConfiguredSystem(ResourceLoader.getResourceAsStream(ref),
null, null, mask);
} | [
"public",
"static",
"ParticleSystem",
"loadConfiguredSystem",
"(",
"String",
"ref",
",",
"Color",
"mask",
")",
"throws",
"IOException",
"{",
"return",
"loadConfiguredSystem",
"(",
"ResourceLoader",
".",
"getResourceAsStream",
"(",
"ref",
")",
",",
"null",
",",
"nu... | Load a set of configured emitters into a single system
@param ref
The reference to the XML file (file or classpath)
@param mask
@return A configured particle system
@throws IOException
Indicates a failure to find, read or parse the XML file | [
"Load",
"a",
"set",
"of",
"configured",
"emitters",
"into",
"a",
"single",
"system"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleIO.java#L50-L54 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java | PatternBox.inSameComplex | public static Pattern inSameComplex() {
"""
Pattern for two different EntityReference have member PhysicalEntity in the same Complex.
Complex membership can be through multiple nesting and/or through homology relations.
@return the pattern
"""
Pattern p = new Pattern(EntityReference.class, "first ER");
p... | java | public static Pattern inSameComplex()
{
Pattern p = new Pattern(EntityReference.class, "first ER");
p.add(erToPE(), "first ER", "first simple PE");
p.add(linkToComplex(), "first simple PE", "Complex");
p.add(new Type(Complex.class), "Complex");
p.add(linkToSpecific(), "Complex", "second simple PE");
p.add(... | [
"public",
"static",
"Pattern",
"inSameComplex",
"(",
")",
"{",
"Pattern",
"p",
"=",
"new",
"Pattern",
"(",
"EntityReference",
".",
"class",
",",
"\"first ER\"",
")",
";",
"p",
".",
"add",
"(",
"erToPE",
"(",
")",
",",
"\"first ER\"",
",",
"\"first simple P... | Pattern for two different EntityReference have member PhysicalEntity in the same Complex.
Complex membership can be through multiple nesting and/or through homology relations.
@return the pattern | [
"Pattern",
"for",
"two",
"different",
"EntityReference",
"have",
"member",
"PhysicalEntity",
"in",
"the",
"same",
"Complex",
".",
"Complex",
"membership",
"can",
"be",
"through",
"multiple",
"nesting",
"and",
"/",
"or",
"through",
"homology",
"relations",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L716-L728 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/kiteconnect/kitehttp/KiteRequestHandler.java | KiteRequestHandler.createPostRequest | public Request createPostRequest(String url, Map<String, Object> params, String apiKey, String accessToken) {
"""
Creates a POST request.
@param url is the endpoint to which request has to be done.
@param apiKey is the api key of the Kite Connect app.
@param accessToken is the access token obtained after succes... | java | public Request createPostRequest(String url, Map<String, Object> params, String apiKey, String accessToken) {
FormBody.Builder builder = new FormBody.Builder();
for(Map.Entry<String, Object> entry: params.entrySet()){
builder.add(entry.getKey(), entry.getValue().toString());
}
... | [
"public",
"Request",
"createPostRequest",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"String",
"apiKey",
",",
"String",
"accessToken",
")",
"{",
"FormBody",
".",
"Builder",
"builder",
"=",
"new",
"FormBody",
".",
"B... | Creates a POST request.
@param url is the endpoint to which request has to be done.
@param apiKey is the api key of the Kite Connect app.
@param accessToken is the access token obtained after successful login process.
@param params is the map of data that has to be sent in the body. | [
"Creates",
"a",
"POST",
"request",
"."
] | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/kiteconnect/kitehttp/KiteRequestHandler.java#L198-L207 |
dkmfbk/knowledgestore | ks-core/src/main/java/eu/fbk/knowledgestore/data/Representation.java | Representation.getInputStream | public InputStream getInputStream() {
"""
Returns an {@code InputStream} over the binary data of this representation object.
Conversion from character to byte data, if required, is performed according to the charset
specified by the MIME type metadata property ({@link NIE#MIME_TYPE}).
@return an {@code InputS... | java | public InputStream getInputStream() {
if (this.data instanceof InputStream) {
return (InputStream) this.data;
} else {
final Reader reader = (Reader) this.data;
return new ReaderInputStream(reader, getCharset());
}
} | [
"public",
"InputStream",
"getInputStream",
"(",
")",
"{",
"if",
"(",
"this",
".",
"data",
"instanceof",
"InputStream",
")",
"{",
"return",
"(",
"InputStream",
")",
"this",
".",
"data",
";",
"}",
"else",
"{",
"final",
"Reader",
"reader",
"=",
"(",
"Reader... | Returns an {@code InputStream} over the binary data of this representation object.
Conversion from character to byte data, if required, is performed according to the charset
specified by the MIME type metadata property ({@link NIE#MIME_TYPE}).
@return an {@code InputStream} over the binary content of this representati... | [
"Returns",
"an",
"{",
"@code",
"InputStream",
"}",
"over",
"the",
"binary",
"data",
"of",
"this",
"representation",
"object",
".",
"Conversion",
"from",
"character",
"to",
"byte",
"data",
"if",
"required",
"is",
"performed",
"according",
"to",
"the",
"charset"... | train | https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-core/src/main/java/eu/fbk/knowledgestore/data/Representation.java#L349-L356 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/ImplDisparityScoreSadRectFive_U8.java | ImplDisparityScoreSadRectFive_U8.computeFirstRow | private void computeFirstRow(GrayU8 left, GrayU8 right ) {
"""
Initializes disparity calculation by finding the scores for the initial block of horizontal
rows.
"""
int firstRow[] = verticalScore[0];
activeVerticalScore = 1;
// compute horizontal scores for first row block
for( int row = 0; row < reg... | java | private void computeFirstRow(GrayU8 left, GrayU8 right ) {
int firstRow[] = verticalScore[0];
activeVerticalScore = 1;
// compute horizontal scores for first row block
for( int row = 0; row < regionHeight; row++ ) {
int scores[] = horizontalScore[row];
UtilDisparityScore.computeScoreRow(left, right, ro... | [
"private",
"void",
"computeFirstRow",
"(",
"GrayU8",
"left",
",",
"GrayU8",
"right",
")",
"{",
"int",
"firstRow",
"[",
"]",
"=",
"verticalScore",
"[",
"0",
"]",
";",
"activeVerticalScore",
"=",
"1",
";",
"// compute horizontal scores for first row block",
"for",
... | Initializes disparity calculation by finding the scores for the initial block of horizontal
rows. | [
"Initializes",
"disparity",
"calculation",
"by",
"finding",
"the",
"scores",
"for",
"the",
"initial",
"block",
"of",
"horizontal",
"rows",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/ImplDisparityScoreSadRectFive_U8.java#L85-L106 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/features/FilterUtilities.java | FilterUtilities.getBboxFilter | public static Filter getBboxFilter( String attribute, double west, double east, double south, double north )
throws CQLException {
"""
Create a bounding box filter from the bounds coordinates.
@param attribute the geometry attribute or null in the case of default "the_geom".
@param west western bou... | java | public static Filter getBboxFilter( String attribute, double west, double east, double south, double north )
throws CQLException {
if (attribute == null) {
attribute = "the_geom";
}
StringBuilder sB = new StringBuilder();
sB.append("BBOX(");
sB.append(at... | [
"public",
"static",
"Filter",
"getBboxFilter",
"(",
"String",
"attribute",
",",
"double",
"west",
",",
"double",
"east",
",",
"double",
"south",
",",
"double",
"north",
")",
"throws",
"CQLException",
"{",
"if",
"(",
"attribute",
"==",
"null",
")",
"{",
"at... | Create a bounding box filter from the bounds coordinates.
@param attribute the geometry attribute or null in the case of default "the_geom".
@param west western bound coordinate.
@param east eastern bound coordinate.
@param south southern bound coordinate.
@param north northern bound coordinate.
@return the filter.
@t... | [
"Create",
"a",
"bounding",
"box",
"filter",
"from",
"the",
"bounds",
"coordinates",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FilterUtilities.java#L64-L87 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsVfsDriver.java | CmsVfsDriver.internalReadCounter | protected Integer internalReadCounter(CmsDbContext dbc, String name) throws CmsDbSqlException {
"""
Reads the current value of a counter.<p>
@param dbc the database context
@param name the name of the counter
@return the current value of the counter, or null if the counter was not found
@throws CmsDbSqlEx... | java | protected Integer internalReadCounter(CmsDbContext dbc, String name) throws CmsDbSqlException {
PreparedStatement stmt = null;
Connection conn = null;
ResultSet resultSet = null;
try {
conn = m_sqlManager.getConnection(dbc);
stmt = m_sqlManager.getPreparedStateme... | [
"protected",
"Integer",
"internalReadCounter",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"name",
")",
"throws",
"CmsDbSqlException",
"{",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"Connection",
"conn",
"=",
"null",
";",
"ResultSet",
"resultSet",
"=",
"null",... | Reads the current value of a counter.<p>
@param dbc the database context
@param name the name of the counter
@return the current value of the counter, or null if the counter was not found
@throws CmsDbSqlException if something goes wrong | [
"Reads",
"the",
"current",
"value",
"of",
"a",
"counter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsVfsDriver.java#L3801-L3825 |
xiaosunzhu/resource-utils | src/main/java/net/sunyijun/resource/config/Configs.java | Configs.modifySystemConfig | public static void modifySystemConfig(IConfigKey key, String value) throws IOException {
"""
Modify one system config.
@param key need update config's key
@param value new config value
@throws IOException
"""
systemConfigs.modifyConfig(key, value);
} | java | public static void modifySystemConfig(IConfigKey key, String value) throws IOException {
systemConfigs.modifyConfig(key, value);
} | [
"public",
"static",
"void",
"modifySystemConfig",
"(",
"IConfigKey",
"key",
",",
"String",
"value",
")",
"throws",
"IOException",
"{",
"systemConfigs",
".",
"modifyConfig",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Modify one system config.
@param key need update config's key
@param value new config value
@throws IOException | [
"Modify",
"one",
"system",
"config",
"."
] | train | https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/Configs.java#L433-L435 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.setInternalState | public static void setInternalState(Object object, Object value, Class<?> where) {
"""
Set the value of a field using reflection at at specific place in the
class hierarchy (<tt>where</tt>). This first field assignable to
<tt>object</tt> will then be set to <tt>value</tt>.
@param object the object to modify
... | java | public static void setInternalState(Object object, Object value, Class<?> where) {
setField(object, value, findField(object, new AssignableFromFieldTypeMatcherStrategy(getType(value)), where));
} | [
"public",
"static",
"void",
"setInternalState",
"(",
"Object",
"object",
",",
"Object",
"value",
",",
"Class",
"<",
"?",
">",
"where",
")",
"{",
"setField",
"(",
"object",
",",
"value",
",",
"findField",
"(",
"object",
",",
"new",
"AssignableFromFieldTypeMat... | Set the value of a field using reflection at at specific place in the
class hierarchy (<tt>where</tt>). This first field assignable to
<tt>object</tt> will then be set to <tt>value</tt>.
@param object the object to modify
@param value the new value of the field
@param where the class in the hierarchy where the field... | [
"Set",
"the",
"value",
"of",
"a",
"field",
"using",
"reflection",
"at",
"at",
"specific",
"place",
"in",
"the",
"class",
"hierarchy",
"(",
"<tt",
">",
"where<",
"/",
"tt",
">",
")",
".",
"This",
"first",
"field",
"assignable",
"to",
"<tt",
">",
"object... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L366-L368 |
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.beginRefreshMemberSchema | public void beginRefreshMemberSchema(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
"""
Refreshes a sync member database schema.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from th... | java | public void beginRefreshMemberSchema(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
beginRefreshMemberSchemaWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).toBlocking().single().body();
} | [
"public",
"void",
"beginRefreshMemberSchema",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"String",
"syncMemberName",
")",
"{",
"beginRefreshMemberSchemaWithServiceResponseAsync",
"(",
... | Refreshes a sync member database schema.
@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 hos... | [
"Refreshes",
"a",
"sync",
"member",
"database",
"schema",
"."
] | 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#L1240-L1242 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/Cron.java | Cron.shouldRun | public static boolean shouldRun(String entry, Date atTime) {
"""
Determines if the given CRON entry is runnable at this current moment in time. This mimics the original implementation of the CRON table.
<p>This implementation supports only the following types of entries:</p>
<ol>
<li>Standard Entries having... | java | public static boolean shouldRun(String entry, Date atTime) {
entry = entry.trim().toUpperCase();
if (ANNUALLY.equals(entry) || (YEARLY.equals(entry))) {
entry = "0 0 1 1 *";
} else if (MONTHLY.equals(entry)) {
entry = "0 0 1 * *";
} else if (WEEKLY.equals(entry)) {
entry = "0 0 * * 0";
} else if (DAI... | [
"public",
"static",
"boolean",
"shouldRun",
"(",
"String",
"entry",
",",
"Date",
"atTime",
")",
"{",
"entry",
"=",
"entry",
".",
"trim",
"(",
")",
".",
"toUpperCase",
"(",
")",
";",
"if",
"(",
"ANNUALLY",
".",
"equals",
"(",
"entry",
")",
"||",
"(",
... | Determines if the given CRON entry is runnable at this current moment in time. This mimics the original implementation of the CRON table.
<p>This implementation supports only the following types of entries:</p>
<ol>
<li>Standard Entries having form: <minutes> <hours> <days> <months> <days o... | [
"Determines",
"if",
"the",
"given",
"CRON",
"entry",
"is",
"runnable",
"at",
"this",
"current",
"moment",
"in",
"time",
".",
"This",
"mimics",
"the",
"original",
"implementation",
"of",
"the",
"CRON",
"table",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Cron.java#L99-L113 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppEventsLogger.java | AppEventsLogger.logEvent | public void logEvent(String eventName, double valueToSum, Bundle parameters) {
"""
Log an app event with the specified name, supplied value, and set of parameters.
@param eventName eventName used to denote the event. Choose amongst the EVENT_NAME_* constants in
{@link AppEventsConstants} when possible. Or c... | java | public void logEvent(String eventName, double valueToSum, Bundle parameters) {
logEvent(eventName, valueToSum, parameters, false);
} | [
"public",
"void",
"logEvent",
"(",
"String",
"eventName",
",",
"double",
"valueToSum",
",",
"Bundle",
"parameters",
")",
"{",
"logEvent",
"(",
"eventName",
",",
"valueToSum",
",",
"parameters",
",",
"false",
")",
";",
"}"
] | Log an app event with the specified name, supplied value, and set of parameters.
@param eventName eventName used to denote the event. Choose amongst the EVENT_NAME_* constants in
{@link AppEventsConstants} when possible. Or create your own if none of the EVENT_NAME_*
constants are applicable.
Event names should be ... | [
"Log",
"an",
"app",
"event",
"with",
"the",
"specified",
"name",
"supplied",
"value",
"and",
"set",
"of",
"parameters",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppEventsLogger.java#L492-L494 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/internalCssScriptResource/InternalCssScriptResourceRenderer.java | InternalCssScriptResourceRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
"""
This methods generates the HTML code of the current b:internalCssScriptResource.
@param context the FacesContext.
@param component the current b:internalCssScriptResource.
@throws IOException thrown if somet... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
InternalCssScriptResource internalCssScriptResource = (InternalCssScriptResource) component;
ResponseWriter rw = context.getResponseWriter();
rw.startElement("link"... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"InternalCssScriptReso... | This methods generates the HTML code of the current b:internalCssScriptResource.
@param context the FacesContext.
@param component the current b:internalCssScriptResource.
@throws IOException thrown if something goes wrong when writing the HTML code. | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"internalCssScriptResource",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/internalCssScriptResource/InternalCssScriptResourceRenderer.java#L40-L55 |
apereo/cas | support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/profile/DefaultOAuth20UserProfileDataCreator.java | DefaultOAuth20UserProfileDataCreator.getAccessTokenAuthenticationPrincipal | protected Principal getAccessTokenAuthenticationPrincipal(final AccessToken accessToken, final J2EContext context, final RegisteredService registeredService) {
"""
Gets access token authentication principal.
@param accessToken the access token
@param context the context
@param registeredServic... | java | protected Principal getAccessTokenAuthenticationPrincipal(final AccessToken accessToken, final J2EContext context, final RegisteredService registeredService) {
val currentPrincipal = accessToken.getAuthentication().getPrincipal();
LOGGER.debug("Preparing user profile response based on CAS principal [{}]... | [
"protected",
"Principal",
"getAccessTokenAuthenticationPrincipal",
"(",
"final",
"AccessToken",
"accessToken",
",",
"final",
"J2EContext",
"context",
",",
"final",
"RegisteredService",
"registeredService",
")",
"{",
"val",
"currentPrincipal",
"=",
"accessToken",
".",
"get... | Gets access token authentication principal.
@param accessToken the access token
@param context the context
@param registeredService the registered service
@return the access token authentication principal | [
"Gets",
"access",
"token",
"authentication",
"principal",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/profile/DefaultOAuth20UserProfileDataCreator.java#L68-L76 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java | RunbookDraftsInner.publishAsync | public Observable<Void> publishAsync(String resourceGroupName, String automationAccountName, String runbookName) {
"""
Publish runbook draft.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param runbookName The parameters supplied to... | java | public Observable<Void> publishAsync(String resourceGroupName, String automationAccountName, String runbookName) {
return publishWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName).map(new Func1<ServiceResponseWithHeaders<Void, RunbookDraftPublishHeaders>, Void>() {
@Over... | [
"public",
"Observable",
"<",
"Void",
">",
"publishAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"runbookName",
")",
"{",
"return",
"publishWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName... | Publish runbook draft.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param runbookName The parameters supplied to the publish runbook operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable... | [
"Publish",
"runbook",
"draft",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java#L490-L497 |
lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigFactory.java | XMLConfigFactory.createFileFromResource | static void createFileFromResource(String resource, Resource file, String password) throws IOException {
"""
creates a File and his content froma a resurce
@param resource
@param file
@param password
@throws IOException
"""
SystemOut.printDate(SystemUtil.getPrintWriter(SystemUtil.OUT), "write file:" + f... | java | static void createFileFromResource(String resource, Resource file, String password) throws IOException {
SystemOut.printDate(SystemUtil.getPrintWriter(SystemUtil.OUT), "write file:" + file);
file.delete();
InputStream is = InfoImpl.class.getResourceAsStream(resource);
if (is == null) throw new IOException("file ["... | [
"static",
"void",
"createFileFromResource",
"(",
"String",
"resource",
",",
"Resource",
"file",
",",
"String",
"password",
")",
"throws",
"IOException",
"{",
"SystemOut",
".",
"printDate",
"(",
"SystemUtil",
".",
"getPrintWriter",
"(",
"SystemUtil",
".",
"OUT",
... | creates a File and his content froma a resurce
@param resource
@param file
@param password
@throws IOException | [
"creates",
"a",
"File",
"and",
"his",
"content",
"froma",
"a",
"resurce"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigFactory.java#L270-L278 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/operators/DualInputSemanticProperties.java | DualInputSemanticProperties.addForwardedField | public void addForwardedField(int input, int sourceField, int targetField) {
"""
Adds, to the existing information, a field that is forwarded directly
from the source record(s) in the first input to the destination
record(s).
@param input the input of the source field
@param sourceField the position in the s... | java | public void addForwardedField(int input, int sourceField, int targetField) {
Map<Integer, FieldSet> fieldMapping;
if (input != 0 && input != 1) {
throw new IndexOutOfBoundsException();
} else if (input == 0) {
fieldMapping = this.fieldMapping1;
} else {
fieldMapping = this.fieldMapping2;
}
if(is... | [
"public",
"void",
"addForwardedField",
"(",
"int",
"input",
",",
"int",
"sourceField",
",",
"int",
"targetField",
")",
"{",
"Map",
"<",
"Integer",
",",
"FieldSet",
">",
"fieldMapping",
";",
"if",
"(",
"input",
"!=",
"0",
"&&",
"input",
"!=",
"1",
")",
... | Adds, to the existing information, a field that is forwarded directly
from the source record(s) in the first input to the destination
record(s).
@param input the input of the source field
@param sourceField the position in the source record
@param targetField the position in the destination record | [
"Adds",
"to",
"the",
"existing",
"information",
"a",
"field",
"that",
"is",
"forwarded",
"directly",
"from",
"the",
"source",
"record",
"(",
"s",
")",
"in",
"the",
"first",
"input",
"to",
"the",
"destination",
"record",
"(",
"s",
")",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/DualInputSemanticProperties.java#L122-L144 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.scaling | public Matrix4d scaling(double x, double y, double z) {
"""
Set this matrix to be a simple scale matrix.
@param x
the scale in x
@param y
the scale in y
@param z
the scale in z
@return this
"""
if ((properties & PROPERTY_IDENTITY) == 0)
identity();
m00 = x;
m11 = y;... | java | public Matrix4d scaling(double x, double y, double z) {
if ((properties & PROPERTY_IDENTITY) == 0)
identity();
m00 = x;
m11 = y;
m22 = z;
boolean one = Math.abs(x) == 1.0 && Math.abs(y) == 1.0 && Math.abs(z) == 1.0;
properties = PROPERTY_AFFINE | (one ? PROPER... | [
"public",
"Matrix4d",
"scaling",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"if",
"(",
"(",
"properties",
"&",
"PROPERTY_IDENTITY",
")",
"==",
"0",
")",
"identity",
"(",
")",
";",
"m00",
"=",
"x",
";",
"m11",
"=",
"y",
... | Set this matrix to be a simple scale matrix.
@param x
the scale in x
@param y
the scale in y
@param z
the scale in z
@return this | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"simple",
"scale",
"matrix",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L3559-L3568 |
CloudSlang/cs-actions | cs-amazon/src/main/java/io/cloudslang/content/amazon/services/helpers/AwsSignatureV4.java | AwsSignatureV4.getDerivedSigningKey | public byte[] getDerivedSigningKey(String secretAccessKey, String dateStamp, String region, String amazonApi)
throws SignatureException {
"""
Derives a signing key from the AWS secret access key.
@param secretAccessKey Amazon secret a access key.
@param dateStamp Credential scope date stamp i... | java | public byte[] getDerivedSigningKey(String secretAccessKey, String dateStamp, String region, String amazonApi)
throws SignatureException {
try {
byte[] kSecret = (AWS_SIGNATURE_VERSION + secretAccessKey).getBytes(ENCODING);
byte[] kDate = calculateHmacSHA256(dateStamp, kSecret... | [
"public",
"byte",
"[",
"]",
"getDerivedSigningKey",
"(",
"String",
"secretAccessKey",
",",
"String",
"dateStamp",
",",
"String",
"region",
",",
"String",
"amazonApi",
")",
"throws",
"SignatureException",
"{",
"try",
"{",
"byte",
"[",
"]",
"kSecret",
"=",
"(",
... | Derives a signing key from the AWS secret access key.
@param secretAccessKey Amazon secret a access key.
@param dateStamp Credential scope date stamp in "yyyyMMdd" format.
@param region Amazon region name.
@param amazonApi Amazon service name.
@return Signing key's bytes. This result is not encode... | [
"Derives",
"a",
"signing",
"key",
"from",
"the",
"AWS",
"secret",
"access",
"key",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-amazon/src/main/java/io/cloudslang/content/amazon/services/helpers/AwsSignatureV4.java#L99-L111 |
geomajas/geomajas-project-server | api/src/main/java/org/geomajas/layer/feature/attribute/ManyToOneAttribute.java | ManyToOneAttribute.setStringAttribute | public void setStringAttribute(String name, String value) {
"""
Sets the specified string attribute to the specified value.
@param name name of the attribute
@param value value of the attribute
@since 1.9.0
"""
ensureValue();
Attribute attribute = new StringAttribute(value);
attribute.setEditable(is... | java | public void setStringAttribute(String name, String value) {
ensureValue();
Attribute attribute = new StringAttribute(value);
attribute.setEditable(isEditable(name));
getValue().getAllAttributes().put(name, attribute);
} | [
"public",
"void",
"setStringAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"ensureValue",
"(",
")",
";",
"Attribute",
"attribute",
"=",
"new",
"StringAttribute",
"(",
"value",
")",
";",
"attribute",
".",
"setEditable",
"(",
"isEditable",
... | Sets the specified string attribute to the specified value.
@param name name of the attribute
@param value value of the attribute
@since 1.9.0 | [
"Sets",
"the",
"specified",
"string",
"attribute",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/api/src/main/java/org/geomajas/layer/feature/attribute/ManyToOneAttribute.java#L244-L249 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.