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 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.context/src/com/ibm/ws/context/service/serializable/ThreadContextDescriptorImpl.java | ThreadContextDescriptorImpl.containsAll | @Trivial
private static final boolean containsAll(LinkedHashMap<ThreadContextProvider, ThreadContext> contextProviders, List<ThreadContextProvider> prereqs) {
"""
Utility method that indicates whether or not a list of thread context providers contains all of the specified prerequisites.
@param contextProvid... | java | @Trivial
private static final boolean containsAll(LinkedHashMap<ThreadContextProvider, ThreadContext> contextProviders, List<ThreadContextProvider> prereqs) {
for (ThreadContextProvider prereq : prereqs)
if (!contextProviders.containsKey(prereq))
return false;
return true... | [
"@",
"Trivial",
"private",
"static",
"final",
"boolean",
"containsAll",
"(",
"LinkedHashMap",
"<",
"ThreadContextProvider",
",",
"ThreadContext",
">",
"contextProviders",
",",
"List",
"<",
"ThreadContextProvider",
">",
"prereqs",
")",
"{",
"for",
"(",
"ThreadContext... | Utility method that indicates whether or not a list of thread context providers contains all of the specified prerequisites.
@param contextProviders list of thread context providers (actually a map, but the keys are used as a list)
@param prereqs prerequisite thread context providers
@return true if all prerequisites ... | [
"Utility",
"method",
"that",
"indicates",
"whether",
"or",
"not",
"a",
"list",
"of",
"thread",
"context",
"providers",
"contains",
"all",
"of",
"the",
"specified",
"prerequisites",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.context/src/com/ibm/ws/context/service/serializable/ThreadContextDescriptorImpl.java#L229-L235 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/RowUtil.java | RowUtil.writeRow | public static void writeRow(Row row, Iterable<?> rowData, StyleSet styleSet, boolean isHeader) {
"""
写一行数据
@param row 行
@param rowData 一行的数据
@param styleSet 单元格样式集,包括日期等样式
@param isHeader 是否为标题行
"""
int i = 0;
Cell cell;
for (Object value : rowData) {
cell = row.createCell(i);
CellUtil.s... | java | public static void writeRow(Row row, Iterable<?> rowData, StyleSet styleSet, boolean isHeader) {
int i = 0;
Cell cell;
for (Object value : rowData) {
cell = row.createCell(i);
CellUtil.setCellValue(cell, value, styleSet, isHeader);
i++;
}
} | [
"public",
"static",
"void",
"writeRow",
"(",
"Row",
"row",
",",
"Iterable",
"<",
"?",
">",
"rowData",
",",
"StyleSet",
"styleSet",
",",
"boolean",
"isHeader",
")",
"{",
"int",
"i",
"=",
"0",
";",
"Cell",
"cell",
";",
"for",
"(",
"Object",
"value",
":... | 写一行数据
@param row 行
@param rowData 一行的数据
@param styleSet 单元格样式集,包括日期等样式
@param isHeader 是否为标题行 | [
"写一行数据"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/RowUtil.java#L76-L84 |
alkacon/opencms-core | src/org/opencms/widgets/A_CmsFormatterWidget.java | A_CmsFormatterWidget.getWidgetOptionForType | public static CmsSelectWidgetOption getWidgetOptionForType(CmsObject cms, String typeName) {
"""
Creates a widget option for a resource type.<p>
@param cms the current CMS context
@param typeName the type for which we want a widget option
@return the created widget option
"""
String niceTypeNam... | java | public static CmsSelectWidgetOption getWidgetOptionForType(CmsObject cms, String typeName) {
String niceTypeName = typeName;
try {
Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
niceTypeName = CmsWorkplaceMessages.getResourceTypeName(locale, typeName);
... | [
"public",
"static",
"CmsSelectWidgetOption",
"getWidgetOptionForType",
"(",
"CmsObject",
"cms",
",",
"String",
"typeName",
")",
"{",
"String",
"niceTypeName",
"=",
"typeName",
";",
"try",
"{",
"Locale",
"locale",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")... | Creates a widget option for a resource type.<p>
@param cms the current CMS context
@param typeName the type for which we want a widget option
@return the created widget option | [
"Creates",
"a",
"widget",
"option",
"for",
"a",
"resource",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/A_CmsFormatterWidget.java#L123-L137 |
Mangopay/mangopay2-java-sdk | src/main/java/com/mangopay/core/APIs/ApiBase.java | ApiBase.getObject | protected <T extends Dto> T getObject(Class<T> classOfT, String methodKey, String entityId, String secondEntityId) throws Exception {
"""
Gets the Dto instance from API.
@param <T> Type on behalf of which the request is being called.
@param classOfT Type on behalf of which the request is b... | java | protected <T extends Dto> T getObject(Class<T> classOfT, String methodKey, String entityId, String secondEntityId) throws Exception {
String urlMethod = String.format(this.getRequestUrl(methodKey), entityId, secondEntityId);
RestTool rest = new RestTool(this.root, true);
T response = rest.requ... | [
"protected",
"<",
"T",
"extends",
"Dto",
">",
"T",
"getObject",
"(",
"Class",
"<",
"T",
">",
"classOfT",
",",
"String",
"methodKey",
",",
"String",
"entityId",
",",
"String",
"secondEntityId",
")",
"throws",
"Exception",
"{",
"String",
"urlMethod",
"=",
"S... | Gets the Dto instance from API.
@param <T> Type on behalf of which the request is being called.
@param classOfT Type on behalf of which the request is being called.
@param methodKey Relevant method key.
@param entityId Entity identifier.
@param secondEntityId Entity identifier... | [
"Gets",
"the",
"Dto",
"instance",
"from",
"API",
"."
] | train | https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/APIs/ApiBase.java#L287-L295 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.createOrUpdateAsync | public Observable<AppServicePlanInner> createOrUpdateAsync(String resourceGroupName, String name, AppServicePlanInner appServicePlan) {
"""
Creates or updates an App Service Plan.
Creates or updates an App Service Plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param ... | java | public Observable<AppServicePlanInner> createOrUpdateAsync(String resourceGroupName, String name, AppServicePlanInner appServicePlan) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, appServicePlan).map(new Func1<ServiceResponse<AppServicePlanInner>, AppServicePlanInner>() {
... | [
"public",
"Observable",
"<",
"AppServicePlanInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"AppServicePlanInner",
"appServicePlan",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
"... | Creates or updates an App Service Plan.
Creates or updates an App Service Plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param appServicePlan Details of the App Service plan.
@throws IllegalArgumentException thrown if parameters fail ... | [
"Creates",
"or",
"updates",
"an",
"App",
"Service",
"Plan",
".",
"Creates",
"or",
"updates",
"an",
"App",
"Service",
"Plan",
"."
] | 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/AppServicePlansInner.java#L704-L711 |
peterbencze/serritor | src/main/java/com/github/peterbencze/serritor/api/BaseCrawler.java | BaseCrawler.createCrawlDelayMechanism | @SuppressWarnings("checkstyle:MissingSwitchDefault")
private CrawlDelayMechanism createCrawlDelayMechanism() {
"""
Creates the crawl delay mechanism according to the configuration.
@return the created crawl delay mechanism
"""
switch (config.getCrawlDelayStrategy()) {
case FIXED:
... | java | @SuppressWarnings("checkstyle:MissingSwitchDefault")
private CrawlDelayMechanism createCrawlDelayMechanism() {
switch (config.getCrawlDelayStrategy()) {
case FIXED:
return new FixedCrawlDelayMechanism(config);
case RANDOM:
return new RandomCrawlD... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:MissingSwitchDefault\"",
")",
"private",
"CrawlDelayMechanism",
"createCrawlDelayMechanism",
"(",
")",
"{",
"switch",
"(",
"config",
".",
"getCrawlDelayStrategy",
"(",
")",
")",
"{",
"case",
"FIXED",
":",
"return",
"new",
... | Creates the crawl delay mechanism according to the configuration.
@return the created crawl delay mechanism | [
"Creates",
"the",
"crawl",
"delay",
"mechanism",
"according",
"to",
"the",
"configuration",
"."
] | train | https://github.com/peterbencze/serritor/blob/10ed6f82c90fa1dccd684382b68b5d77a37652c0/src/main/java/com/github/peterbencze/serritor/api/BaseCrawler.java#L376-L388 |
app55/app55-java | src/main/java/com/app55/util/Base64.java | Base64.decodeFromFile | public static byte[] decodeFromFile(String filename) {
"""
Convenience method for reading a base64-encoded file and decoding it.
@param filename
Filename for reading encoded data
@return decoded byte array or null if unsuccessful
@since 2.1
"""
byte[] decodedData = null;
Base64.InputStream bis = nu... | java | public static byte[] decodeFromFile(String filename)
{
byte[] decodedData = null;
Base64.InputStream bis = null;
try
{
// Set up some useful variables
java.io.File file = new java.io.File(filename);
byte[] buffer = null;
int length = 0;
int numBytes = 0;
// Check for size of file
if (file... | [
"public",
"static",
"byte",
"[",
"]",
"decodeFromFile",
"(",
"String",
"filename",
")",
"{",
"byte",
"[",
"]",
"decodedData",
"=",
"null",
";",
"Base64",
".",
"InputStream",
"bis",
"=",
"null",
";",
"try",
"{",
"// Set up some useful variables",
"java",
".",... | Convenience method for reading a base64-encoded file and decoding it.
@param filename
Filename for reading encoded data
@return decoded byte array or null if unsuccessful
@since 2.1 | [
"Convenience",
"method",
"for",
"reading",
"a",
"base64",
"-",
"encoded",
"file",
"and",
"decoding",
"it",
"."
] | train | https://github.com/app55/app55-java/blob/73e51d0f3141a859dfbd37ca9becef98477e553e/src/main/java/com/app55/util/Base64.java#L1185-L1232 |
logic-ng/LogicNG | src/main/java/org/logicng/graphs/datastructures/HypergraphEdge.java | HypergraphEdge.centerOfGravity | public double centerOfGravity(final Map<HypergraphNode<T>, Integer> nodeOrdering) {
"""
Computes the center of gravity for this edge (see Aloul, Markov, and Sakallah).
@param nodeOrdering the node ordering for which the COG is computed
@return the center of gravity for this edge
"""
int cog = 0;
for ... | java | public double centerOfGravity(final Map<HypergraphNode<T>, Integer> nodeOrdering) {
int cog = 0;
for (final HypergraphNode<T> node : this.nodes) {
final Integer level = nodeOrdering.get(node);
if (level == null)
throw new IllegalStateException("Could not find node " + node + " in the node or... | [
"public",
"double",
"centerOfGravity",
"(",
"final",
"Map",
"<",
"HypergraphNode",
"<",
"T",
">",
",",
"Integer",
">",
"nodeOrdering",
")",
"{",
"int",
"cog",
"=",
"0",
";",
"for",
"(",
"final",
"HypergraphNode",
"<",
"T",
">",
"node",
":",
"this",
"."... | Computes the center of gravity for this edge (see Aloul, Markov, and Sakallah).
@param nodeOrdering the node ordering for which the COG is computed
@return the center of gravity for this edge | [
"Computes",
"the",
"center",
"of",
"gravity",
"for",
"this",
"edge",
"(",
"see",
"Aloul",
"Markov",
"and",
"Sakallah",
")",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/graphs/datastructures/HypergraphEdge.java#L79-L88 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ras/SibTr.java | SibTr.formatSlices | public static String formatSlices(List<DataSlice> slices, int max) {
"""
Produce a formatted view of a list of DataSlices. Duplicate output lines are
suppressed to save space.
<p>
@param slices The list of DataSlices to be formatted
@return the formatted data slice
@param max maximun number of bytes that sho... | java | public static String formatSlices(List<DataSlice> slices, int max)
{
if (slices != null)
{
StringBuilder builder = new StringBuilder();
if (slices.size() != 0)
{
int number = 1;
int sliceCount = slices.size();
for(DataSlice slice : slices)
{
builde... | [
"public",
"static",
"String",
"formatSlices",
"(",
"List",
"<",
"DataSlice",
">",
"slices",
",",
"int",
"max",
")",
"{",
"if",
"(",
"slices",
"!=",
"null",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"sl... | Produce a formatted view of a list of DataSlices. Duplicate output lines are
suppressed to save space.
<p>
@param slices The list of DataSlices to be formatted
@return the formatted data slice
@param max maximun number of bytes that should be formatted for each slice. | [
"Produce",
"a",
"formatted",
"view",
"of",
"a",
"list",
"of",
"DataSlices",
".",
"Duplicate",
"output",
"lines",
"are",
"suppressed",
"to",
"save",
"space",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ras/SibTr.java#L1369-L1408 |
aws/aws-sdk-java | aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/AttributeValue.java | AttributeValue.withSDM | public AttributeValue withSDM(java.util.Map<String, Double> sDM) {
"""
<p>
For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.
</p>
@param sDM
For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.
@return Returns... | java | public AttributeValue withSDM(java.util.Map<String, Double> sDM) {
setSDM(sDM);
return this;
} | [
"public",
"AttributeValue",
"withSDM",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"Double",
">",
"sDM",
")",
"{",
"setSDM",
"(",
"sDM",
")",
";",
"return",
"this",
";",
"}"
] | <p>
For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.
</p>
@param sDM
For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"For",
"a",
"map",
"of",
"up",
"to",
"10",
"data",
"type",
":",
"value",
"pairs",
".",
"Maximum",
"length",
"for",
"each",
"string",
"value",
"is",
"100",
"characters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/AttributeValue.java#L252-L255 |
keenlabs/KeenClient-Java | core/src/main/java/io/keen/client/java/FileEventStore.java | FileEventStore.getKeenCacheDirectory | private File getKeenCacheDirectory() throws IOException {
"""
Gets the root directory of the Keen cache, based on the root directory passed to the
constructor of this file store. If necessary, this method will attempt to create the
directory.
@return The root directory of the cache.
"""
File file ... | java | private File getKeenCacheDirectory() throws IOException {
File file = new File(root, "keen");
if (!file.exists()) {
boolean dirMade = file.mkdir();
if (!dirMade) {
throw new IOException("Could not make keen cache directory at: " + file.getAbsolutePath());
... | [
"private",
"File",
"getKeenCacheDirectory",
"(",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"root",
",",
"\"keen\"",
")",
";",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
")",
"{",
"boolean",
"dirMade",
"=",
"file"... | Gets the root directory of the Keen cache, based on the root directory passed to the
constructor of this file store. If necessary, this method will attempt to create the
directory.
@return The root directory of the cache. | [
"Gets",
"the",
"root",
"directory",
"of",
"the",
"Keen",
"cache",
"based",
"on",
"the",
"root",
"directory",
"passed",
"to",
"the",
"constructor",
"of",
"this",
"file",
"store",
".",
"If",
"necessary",
"this",
"method",
"will",
"attempt",
"to",
"create",
"... | train | https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/core/src/main/java/io/keen/client/java/FileEventStore.java#L227-L236 |
baratine/baratine | core/src/main/java/com/caucho/v5/util/LruCache.java | LruCache.putIfNew | public V putIfNew(K key, V value) {
"""
Puts a new item in the cache. If the cache is full, remove the
LRU item.
@param key key to store data
@param value value to be stored
@return the value actually stored
"""
V oldValue = compareAndPut(null, key, value, true);
if (oldValue != null)
r... | java | public V putIfNew(K key, V value)
{
V oldValue = compareAndPut(null, key, value, true);
if (oldValue != null)
return oldValue;
else
return value;
} | [
"public",
"V",
"putIfNew",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"V",
"oldValue",
"=",
"compareAndPut",
"(",
"null",
",",
"key",
",",
"value",
",",
"true",
")",
";",
"if",
"(",
"oldValue",
"!=",
"null",
")",
"return",
"oldValue",
";",
"else... | Puts a new item in the cache. If the cache is full, remove the
LRU item.
@param key key to store data
@param value value to be stored
@return the value actually stored | [
"Puts",
"a",
"new",
"item",
"in",
"the",
"cache",
".",
"If",
"the",
"cache",
"is",
"full",
"remove",
"the",
"LRU",
"item",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/LruCache.java#L283-L291 |
js-lib-com/commons | src/main/java/js/util/Strings.java | Strings.setPrefix | public static String setPrefix(String text, String prefix) {
"""
Ensure a given text start with requested prefix. If <code>text</code> argument is empty returns given prefix;
returns null if <code>text</code> argument is null.
@param text text to add prefix to, null accepted,
@param prefix prefix to force on ... | java | public static String setPrefix(String text, String prefix)
{
if(text == null) {
return null;
}
if(!text.startsWith(prefix)) {
text = prefix + text;
}
return text;
} | [
"public",
"static",
"String",
"setPrefix",
"(",
"String",
"text",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"text",
".",
"startsWith",
"(",
"prefix",
")",
")",
"{",
"te... | Ensure a given text start with requested prefix. If <code>text</code> argument is empty returns given prefix;
returns null if <code>text</code> argument is null.
@param text text to add prefix to, null accepted,
@param prefix prefix to force on text start.
@return prefixed text or null. | [
"Ensure",
"a",
"given",
"text",
"start",
"with",
"requested",
"prefix",
".",
"If",
"<code",
">",
"text<",
"/",
"code",
">",
"argument",
"is",
"empty",
"returns",
"given",
"prefix",
";",
"returns",
"null",
"if",
"<code",
">",
"text<",
"/",
"code",
">",
... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Strings.java#L1551-L1560 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/core/DictionaryFactory.java | DictionaryFactory.createDefaultDictionary | public static ADictionary createDefaultDictionary(JcsegTaskConfig config, boolean loadDic) {
"""
create the ADictionary according to the JcsegTaskConfig
@param config
@param loadDic
@return ADictionary
"""
return createDefaultDictionary(config, config.isAutoload(), loadDic);
} | java | public static ADictionary createDefaultDictionary(JcsegTaskConfig config, boolean loadDic)
{
return createDefaultDictionary(config, config.isAutoload(), loadDic);
} | [
"public",
"static",
"ADictionary",
"createDefaultDictionary",
"(",
"JcsegTaskConfig",
"config",
",",
"boolean",
"loadDic",
")",
"{",
"return",
"createDefaultDictionary",
"(",
"config",
",",
"config",
".",
"isAutoload",
"(",
")",
",",
"loadDic",
")",
";",
"}"
] | create the ADictionary according to the JcsegTaskConfig
@param config
@param loadDic
@return ADictionary | [
"create",
"the",
"ADictionary",
"according",
"to",
"the",
"JcsegTaskConfig"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/core/DictionaryFactory.java#L123-L126 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/ngmf/util/cosu/Efficiencies.java | Efficiencies.nashSutcliffe | public static double nashSutcliffe(double[] obs, double[] sim, double pow) {
"""
Calculates the efficiency between a test data set and a verification data set
after Nash & Sutcliffe (1970). The efficiency is described as the proportion of
the cumulated cubic deviation between both data sets and the cumulated cub... | java | public static double nashSutcliffe(double[] obs, double[] sim, double pow) {
sameArrayLen(obs, sim);
int pre_size = sim.length;
int steps = pre_size;
double sum_td = 0;
double sum_vd = 0;
/**summing up both data sets */
for (int i = 0; i < steps; i++) {
... | [
"public",
"static",
"double",
"nashSutcliffe",
"(",
"double",
"[",
"]",
"obs",
",",
"double",
"[",
"]",
"sim",
",",
"double",
"pow",
")",
"{",
"sameArrayLen",
"(",
"obs",
",",
"sim",
")",
";",
"int",
"pre_size",
"=",
"sim",
".",
"length",
";",
"int",... | Calculates the efficiency between a test data set and a verification data set
after Nash & Sutcliffe (1970). The efficiency is described as the proportion of
the cumulated cubic deviation between both data sets and the cumulated cubic
deviation between the verification data set and its mean value.
@param sim the simula... | [
"Calculates",
"the",
"efficiency",
"between",
"a",
"test",
"data",
"set",
"and",
"a",
"verification",
"data",
"set",
"after",
"Nash",
"&",
"Sutcliffe",
"(",
"1970",
")",
".",
"The",
"efficiency",
"is",
"described",
"as",
"the",
"proportion",
"of",
"the",
"... | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/util/cosu/Efficiencies.java#L41-L67 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/OCSPResponseBuilder.java | OCSPResponseBuilder.getAIALocations | public static List<String> getAIALocations(X509Certificate userCertificate)
throws CertificateVerificationException {
"""
List Certificate authority url information.
@param userCertificate User's own certificate.
@return AIA Locations
@throws CertificateVerificationException If an error occurs whi... | java | public static List<String> getAIALocations(X509Certificate userCertificate)
throws CertificateVerificationException {
List<String> locations;
//List the AIA locations from the certificate. Those are the URL's of CA s.
try {
locations = OCSPVerifier.getAIALocations(userCer... | [
"public",
"static",
"List",
"<",
"String",
">",
"getAIALocations",
"(",
"X509Certificate",
"userCertificate",
")",
"throws",
"CertificateVerificationException",
"{",
"List",
"<",
"String",
">",
"locations",
";",
"//List the AIA locations from the certificate. Those are the UR... | List Certificate authority url information.
@param userCertificate User's own certificate.
@return AIA Locations
@throws CertificateVerificationException If an error occurs while getting the AIA locations from the certificate. | [
"List",
"Certificate",
"authority",
"url",
"information",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/OCSPResponseBuilder.java#L162-L172 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/exceptions/ExceptionUtil.java | ExceptionUtil.stacktraceToString | public static String stacktraceToString(Throwable throwable, int limit, Map<Character, String> replaceCharToStrMap) {
"""
堆栈转为完整字符串
@param throwable 异常对象
@param limit 限制最大长度
@param replaceCharToStrMap 替换字符为指定字符串
@return 堆栈转为的字符串
"""
final FastByteArrayOutputStream baos = new FastByteArrayOutputStream()... | java | public static String stacktraceToString(Throwable throwable, int limit, Map<Character, String> replaceCharToStrMap) {
final FastByteArrayOutputStream baos = new FastByteArrayOutputStream();
throwable.printStackTrace(new PrintStream(baos));
String exceptionStr = baos.toString();
int length = exceptionStr.length(... | [
"public",
"static",
"String",
"stacktraceToString",
"(",
"Throwable",
"throwable",
",",
"int",
"limit",
",",
"Map",
"<",
"Character",
",",
"String",
">",
"replaceCharToStrMap",
")",
"{",
"final",
"FastByteArrayOutputStream",
"baos",
"=",
"new",
"FastByteArrayOutputS... | 堆栈转为完整字符串
@param throwable 异常对象
@param limit 限制最大长度
@param replaceCharToStrMap 替换字符为指定字符串
@return 堆栈转为的字符串 | [
"堆栈转为完整字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/exceptions/ExceptionUtil.java#L185-L211 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.getActiveConnections | public int getActiveConnections(String dbPoolUrl) throws CmsDbException {
"""
Returns the number of active connections managed by a pool.<p>
@param dbPoolUrl the url of a pool
@return the number of active connections
@throws CmsDbException if something goes wrong
"""
CmsDbPoolV11 pool = m_pools.g... | java | public int getActiveConnections(String dbPoolUrl) throws CmsDbException {
CmsDbPoolV11 pool = m_pools.get(dbPoolUrl);
if (pool == null) {
CmsMessageContainer message = Messages.get().container(Messages.ERR_UNKNOWN_POOL_URL_1, dbPoolUrl);
throw new CmsDbException(message);
... | [
"public",
"int",
"getActiveConnections",
"(",
"String",
"dbPoolUrl",
")",
"throws",
"CmsDbException",
"{",
"CmsDbPoolV11",
"pool",
"=",
"m_pools",
".",
"get",
"(",
"dbPoolUrl",
")",
";",
"if",
"(",
"pool",
"==",
"null",
")",
"{",
"CmsMessageContainer",
"messag... | Returns the number of active connections managed by a pool.<p>
@param dbPoolUrl the url of a pool
@return the number of active connections
@throws CmsDbException if something goes wrong | [
"Returns",
"the",
"number",
"of",
"active",
"connections",
"managed",
"by",
"a",
"pool",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L3494-L3508 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/writer/JsonReader.java | JsonReader.remapField | public <T> void remapField(Class<T> type, String fromJson, String toJava) {
"""
remap field name in custom classes
@param fromJson
field name in json
@param toJava
field name in Java
@since 2.1.1
"""
JsonReaderI<T> map = this.getMapper(type);
if (!(map instanceof MapperRemapped)) {
map = new Mapp... | java | public <T> void remapField(Class<T> type, String fromJson, String toJava) {
JsonReaderI<T> map = this.getMapper(type);
if (!(map instanceof MapperRemapped)) {
map = new MapperRemapped<T>(map);
registerReader(type, map);
}
((MapperRemapped<T>) map).renameField(fromJson, toJava);
} | [
"public",
"<",
"T",
">",
"void",
"remapField",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"fromJson",
",",
"String",
"toJava",
")",
"{",
"JsonReaderI",
"<",
"T",
">",
"map",
"=",
"this",
".",
"getMapper",
"(",
"type",
")",
";",
"if",
"(",
... | remap field name in custom classes
@param fromJson
field name in json
@param toJava
field name in Java
@since 2.1.1 | [
"remap",
"field",
"name",
"in",
"custom",
"classes"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/writer/JsonReader.java#L83-L90 |
FINRAOS/DataGenerator | dg-core/src/main/java/org/finra/datagenerator/engine/scxml/SCXMLEngine.java | SCXMLEngine.process | public void process(SearchDistributor distributor) {
"""
Performs the BFS and gives the results to a distributor to distribute
@param distributor the distributor
"""
List<PossibleState> bootStrap;
try {
bootStrap = bfs(bootStrapMin);
} catch (ModelException e) {
... | java | public void process(SearchDistributor distributor) {
List<PossibleState> bootStrap;
try {
bootStrap = bfs(bootStrapMin);
} catch (ModelException e) {
bootStrap = new LinkedList<>();
}
List<Frontier> frontiers = new LinkedList<>();
for (Pos... | [
"public",
"void",
"process",
"(",
"SearchDistributor",
"distributor",
")",
"{",
"List",
"<",
"PossibleState",
">",
"bootStrap",
";",
"try",
"{",
"bootStrap",
"=",
"bfs",
"(",
"bootStrapMin",
")",
";",
"}",
"catch",
"(",
"ModelException",
"e",
")",
"{",
"bo... | Performs the BFS and gives the results to a distributor to distribute
@param distributor the distributor | [
"Performs",
"the",
"BFS",
"and",
"gives",
"the",
"results",
"to",
"a",
"distributor",
"to",
"distribute"
] | train | https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-core/src/main/java/org/finra/datagenerator/engine/scxml/SCXMLEngine.java#L212-L227 |
craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addTrigger | public void addTrigger( final File script, final String prog, final Map< String, IntString> depends, final int flag) throws IOException {
"""
Adds a trigger to the RPM package.
@param script the script to add.
@param prog the interpreter with which to run the script.
@param depends the map of rpms and version... | java | public void addTrigger( final File script, final String prog, final Map< String, IntString> depends, final int flag) throws IOException {
triggerscripts.add(readScript(script));
if ( null == prog) {
triggerscriptprogs.add(DEFAULTSCRIPTPROG);
} else if ( 0 == prog.length()){
triggerscriptprogs.add(DEFAULTSCR... | [
"public",
"void",
"addTrigger",
"(",
"final",
"File",
"script",
",",
"final",
"String",
"prog",
",",
"final",
"Map",
"<",
"String",
",",
"IntString",
">",
"depends",
",",
"final",
"int",
"flag",
")",
"throws",
"IOException",
"{",
"triggerscripts",
".",
"ad... | Adds a trigger to the RPM package.
@param script the script to add.
@param prog the interpreter with which to run the script.
@param depends the map of rpms and versions that will trigger the script
@param flag the trigger type (SCRIPT_TRIGGERPREIN, SCRIPT_TRIGGERIN, SCRIPT_TRIGGERUN, or SCRIPT_TRIGGERPOSTUN)
@throws ... | [
"Adds",
"a",
"trigger",
"to",
"the",
"RPM",
"package",
"."
] | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L835-L851 |
mikepenz/FastAdapter | library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterUIUtils.java | FastAdapterUIUtils.getSelectablePressedBackground | public static StateListDrawable getSelectablePressedBackground(Context ctx, @ColorInt int selected_color, int pressed_alpha, boolean animate) {
"""
helper to get the system default selectable background inclusive an active and pressed state
@param ctx the context
@param selected_color the selected c... | java | public static StateListDrawable getSelectablePressedBackground(Context ctx, @ColorInt int selected_color, int pressed_alpha, boolean animate) {
StateListDrawable states = getSelectableBackground(ctx, selected_color, animate);
ColorDrawable clrPressed = new ColorDrawable(adjustAlpha(selected_color, press... | [
"public",
"static",
"StateListDrawable",
"getSelectablePressedBackground",
"(",
"Context",
"ctx",
",",
"@",
"ColorInt",
"int",
"selected_color",
",",
"int",
"pressed_alpha",
",",
"boolean",
"animate",
")",
"{",
"StateListDrawable",
"states",
"=",
"getSelectableBackgroun... | helper to get the system default selectable background inclusive an active and pressed state
@param ctx the context
@param selected_color the selected color
@param pressed_alpha 0-255
@param animate true if you want to fade over the states (only animates if API newer than Build.VERSION_CODES.HONEYCO... | [
"helper",
"to",
"get",
"the",
"system",
"default",
"selectable",
"background",
"inclusive",
"an",
"active",
"and",
"pressed",
"state"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterUIUtils.java#L60-L65 |
structurizr/java | structurizr-core/src/com/structurizr/view/ViewSet.java | ViewSet.createContainerView | public ContainerView createContainerView(SoftwareSystem softwareSystem, String key, String description) {
"""
Creates a container view, where the scope of the view is the specified software system.
@param softwareSystem the SoftwareSystem object representing the scope of the view
@param key th... | java | public ContainerView createContainerView(SoftwareSystem softwareSystem, String key, String description) {
assertThatTheSoftwareSystemIsNotNull(softwareSystem);
assertThatTheViewKeyIsSpecifiedAndUnique(key);
ContainerView view = new ContainerView(softwareSystem, key, description);
view.s... | [
"public",
"ContainerView",
"createContainerView",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"String",
"key",
",",
"String",
"description",
")",
"{",
"assertThatTheSoftwareSystemIsNotNull",
"(",
"softwareSystem",
")",
";",
"assertThatTheViewKeyIsSpecifiedAndUnique",
"(",
... | Creates a container view, where the scope of the view is the specified software system.
@param softwareSystem the SoftwareSystem object representing the scope of the view
@param key the key for the view (must be unique)
@param description a description of the view
@return a Cont... | [
"Creates",
"a",
"container",
"view",
"where",
"the",
"scope",
"of",
"the",
"view",
"is",
"the",
"specified",
"software",
"system",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/view/ViewSet.java#L90-L98 |
mangstadt/biweekly | src/main/java/biweekly/component/ICalComponent.java | ICalComponent.setExperimentalProperty | public RawProperty setExperimentalProperty(String name, ICalDataType dataType, String value) {
"""
Adds an experimental property to this component, removing all existing
properties that have the same name.
@param name the property name (e.g. "X-ALT-DESC")
@param dataType the property's data type or null if unkn... | java | public RawProperty setExperimentalProperty(String name, ICalDataType dataType, String value) {
removeExperimentalProperties(name);
return addExperimentalProperty(name, dataType, value);
} | [
"public",
"RawProperty",
"setExperimentalProperty",
"(",
"String",
"name",
",",
"ICalDataType",
"dataType",
",",
"String",
"value",
")",
"{",
"removeExperimentalProperties",
"(",
"name",
")",
";",
"return",
"addExperimentalProperty",
"(",
"name",
",",
"dataType",
",... | Adds an experimental property to this component, removing all existing
properties that have the same name.
@param name the property name (e.g. "X-ALT-DESC")
@param dataType the property's data type or null if unknown
@param value the property value
@return the property object that was created | [
"Adds",
"an",
"experimental",
"property",
"to",
"this",
"component",
"removing",
"all",
"existing",
"properties",
"that",
"have",
"the",
"same",
"name",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L266-L269 |
plume-lib/options | src/main/java/org/plumelib/options/Options.java | Options.settings | public String settings(boolean showUnpublicized) {
"""
Returns a string containing the current setting for each option, in command-line format that
can be parsed by Options. Contains every known option even if the option was not specified on
the command line. Never contains duplicates.
@param showUnpublicized... | java | public String settings(boolean showUnpublicized) {
StringJoiner out = new StringJoiner(lineSeparator);
// Determine the length of the longest name
int maxLength = maxOptionLength(options, showUnpublicized);
// Create the settings string
for (OptionInfo oi : options) {
@SuppressWarnings("form... | [
"public",
"String",
"settings",
"(",
"boolean",
"showUnpublicized",
")",
"{",
"StringJoiner",
"out",
"=",
"new",
"StringJoiner",
"(",
"lineSeparator",
")",
";",
"// Determine the length of the longest name",
"int",
"maxLength",
"=",
"maxOptionLength",
"(",
"options",
... | Returns a string containing the current setting for each option, in command-line format that
can be parsed by Options. Contains every known option even if the option was not specified on
the command line. Never contains duplicates.
@param showUnpublicized if true, treat all unpublicized options and option groups as pu... | [
"Returns",
"a",
"string",
"containing",
"the",
"current",
"setting",
"for",
"each",
"option",
"in",
"command",
"-",
"line",
"format",
"that",
"can",
"be",
"parsed",
"by",
"Options",
".",
"Contains",
"every",
"known",
"option",
"even",
"if",
"the",
"option",
... | train | https://github.com/plume-lib/options/blob/1bdd0ac7a1794bdf9dd373e279f69d43395154f0/src/main/java/org/plumelib/options/Options.java#L1533-L1552 |
berkesa/datatree-promise | src/main/java/io/datatree/Promise.java | Promise.toTree | @SuppressWarnings("unchecked")
protected static final Tree toTree(Object object) {
"""
Converts an Object to a Tree.
@param object
input Object
@return object converted to Tree
"""
if (object == null) {
return new Tree((Tree) null, null, null);
}
if (object instanceof Tree) {
return (Tr... | java | @SuppressWarnings("unchecked")
protected static final Tree toTree(Object object) {
if (object == null) {
return new Tree((Tree) null, null, null);
}
if (object instanceof Tree) {
return (Tree) object;
}
if (object instanceof Map) {
return new Tree((Map<String, Object>) object);
}
retu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"static",
"final",
"Tree",
"toTree",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
"new",
"Tree",
"(",
"(",
"Tree",
")",
"null",
",",
"null",
"... | Converts an Object to a Tree.
@param object
input Object
@return object converted to Tree | [
"Converts",
"an",
"Object",
"to",
"a",
"Tree",
"."
] | train | https://github.com/berkesa/datatree-promise/blob/d9093bdb549f69b83b3eff5e29cd511f2014f177/src/main/java/io/datatree/Promise.java#L959-L971 |
luuuis/jcalendar | src/main/java/com/toedter/calendar/JTextFieldDateEditor.java | JTextFieldDateEditor.setDate | protected void setDate(Date date, boolean firePropertyChange) {
"""
Sets the date.
@param date
the date
@param firePropertyChange
true, if the date property should be fired.
"""
Date oldDate = this.date;
this.date = date;
if (date == null) {
setText("");
} else {
String formattedDate = dat... | java | protected void setDate(Date date, boolean firePropertyChange) {
Date oldDate = this.date;
this.date = date;
if (date == null) {
setText("");
} else {
String formattedDate = dateFormatter.format(date);
try {
setText(formattedDate);
} catch (RuntimeException e) {
e.printStackTrace();
}
}... | [
"protected",
"void",
"setDate",
"(",
"Date",
"date",
",",
"boolean",
"firePropertyChange",
")",
"{",
"Date",
"oldDate",
"=",
"this",
".",
"date",
";",
"this",
".",
"date",
"=",
"date",
";",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"setText",
"(",
"... | Sets the date.
@param date
the date
@param firePropertyChange
true, if the date property should be fired. | [
"Sets",
"the",
"date",
"."
] | train | https://github.com/luuuis/jcalendar/blob/442e5bc319d92dee93400e6180ca74a5b6bd7775/src/main/java/com/toedter/calendar/JTextFieldDateEditor.java#L151-L173 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/RestClient.java | RestClient.createOkHttpClient | private OkHttpClient createOkHttpClient(OkHttpAuthenticator authenticator, int logLevel) {
"""
Create and configure OkHTTP client.
@param authenticator Class to intercept unauthorised responses and authenticate.
@param logLevel Log level threshold for logging service requests and responses.
@return OkHTT... | java | private OkHttpClient createOkHttpClient(OkHttpAuthenticator authenticator, int logLevel) {
OkHttpClient.Builder builder = new OkHttpClient.Builder()
.addInterceptor(loggingInterceptor(logLevel))
.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS)
.writeTimeout(WRI... | [
"private",
"OkHttpClient",
"createOkHttpClient",
"(",
"OkHttpAuthenticator",
"authenticator",
",",
"int",
"logLevel",
")",
"{",
"OkHttpClient",
".",
"Builder",
"builder",
"=",
"new",
"OkHttpClient",
".",
"Builder",
"(",
")",
".",
"addInterceptor",
"(",
"loggingInter... | Create and configure OkHTTP client.
@param authenticator Class to intercept unauthorised responses and authenticate.
@param logLevel Log level threshold for logging service requests and responses.
@return OkHTTP client. | [
"Create",
"and",
"configure",
"OkHTTP",
"client",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/RestClient.java#L98-L108 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | @SuppressWarnings("unchecked")
public static List<Double> getAt(double[] array, ObjectRange range) {
"""
Support the subscript operator with an ObjectRange for a double array
@param array a double array
@param range an ObjectRange indicating the indices for the items to retrieve
@return list of the retrie... | java | @SuppressWarnings("unchecked")
public static List<Double> getAt(double[] array, ObjectRange range) {
return primitiveArrayGet(array, range);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"Double",
">",
"getAt",
"(",
"double",
"[",
"]",
"array",
",",
"ObjectRange",
"range",
")",
"{",
"return",
"primitiveArrayGet",
"(",
"array",
",",
"range",
")",
";",
"}"
] | Support the subscript operator with an ObjectRange for a double array
@param array a double array
@param range an ObjectRange indicating the indices for the items to retrieve
@return list of the retrieved doubles
@since 1.0 | [
"Support",
"the",
"subscript",
"operator",
"with",
"an",
"ObjectRange",
"for",
"a",
"double",
"array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13912-L13915 |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java | AbstractChunkTopicParser.writeProcessingInstruction | void writeProcessingInstruction(final Writer output, final String name, final String value)
throws SAXException {
"""
Convenience method to write a processing instruction.
@param name PI name
@param value PI value, may be {@code null}
"""
try {
output.write(LESS_THAN);
... | java | void writeProcessingInstruction(final Writer output, final String name, final String value)
throws SAXException {
try {
output.write(LESS_THAN);
output.write(QUESTION);
output.write(name);
if (value != null) {
output.write(STRING_BLANK)... | [
"void",
"writeProcessingInstruction",
"(",
"final",
"Writer",
"output",
",",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"throws",
"SAXException",
"{",
"try",
"{",
"output",
".",
"write",
"(",
"LESS_THAN",
")",
";",
"output",
".",
"write... | Convenience method to write a processing instruction.
@param name PI name
@param value PI value, may be {@code null} | [
"Convenience",
"method",
"to",
"write",
"a",
"processing",
"instruction",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java#L496-L511 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java | CloudStorageFileSystemProvider.getFileSystem | @Override
public CloudStorageFileSystem getFileSystem(URI uri) {
"""
Returns Cloud Storage file system, provided a URI with no path, e.g. {@code gs://bucket}.
"""
initStorage();
return newFileSystem(uri, Collections.<String, Object>emptyMap());
} | java | @Override
public CloudStorageFileSystem getFileSystem(URI uri) {
initStorage();
return newFileSystem(uri, Collections.<String, Object>emptyMap());
} | [
"@",
"Override",
"public",
"CloudStorageFileSystem",
"getFileSystem",
"(",
"URI",
"uri",
")",
"{",
"initStorage",
"(",
")",
";",
"return",
"newFileSystem",
"(",
"uri",
",",
"Collections",
".",
"<",
"String",
",",
"Object",
">",
"emptyMap",
"(",
")",
")",
"... | Returns Cloud Storage file system, provided a URI with no path, e.g. {@code gs://bucket}. | [
"Returns",
"Cloud",
"Storage",
"file",
"system",
"provided",
"a",
"URI",
"with",
"no",
"path",
"e",
".",
"g",
".",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java#L226-L230 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/SignatureFileVerifier.java | SignatureFileVerifier.matches | static boolean matches(CodeSigner[] signers, CodeSigner[] oldSigners,
CodeSigner[] newSigners) {
"""
returns true if signer contains exactly the same code signers as
oldSigner and newSigner, false otherwise. oldSigner
is allowed to be null.
"""
// special case
if ((oldSigners == null... | java | static boolean matches(CodeSigner[] signers, CodeSigner[] oldSigners,
CodeSigner[] newSigners) {
// special case
if ((oldSigners == null) && (signers == newSigners))
return true;
boolean match;
// make sure all oldSigners are in signers
if ((oldSigners != n... | [
"static",
"boolean",
"matches",
"(",
"CodeSigner",
"[",
"]",
"signers",
",",
"CodeSigner",
"[",
"]",
"oldSigners",
",",
"CodeSigner",
"[",
"]",
"newSigners",
")",
"{",
"// special case",
"if",
"(",
"(",
"oldSigners",
"==",
"null",
")",
"&&",
"(",
"signers"... | returns true if signer contains exactly the same code signers as
oldSigner and newSigner, false otherwise. oldSigner
is allowed to be null. | [
"returns",
"true",
"if",
"signer",
"contains",
"exactly",
"the",
"same",
"code",
"signers",
"as",
"oldSigner",
"and",
"newSigner",
"false",
"otherwise",
".",
"oldSigner",
"is",
"allowed",
"to",
"be",
"null",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/SignatureFileVerifier.java#L636-L665 |
hector-client/hector | core/src/main/java/me/prettyprint/cassandra/service/template/ColumnFamilyTemplate.java | ColumnFamilyTemplate.queryColumns | public <T> T queryColumns(K key, List<N> columns,
ColumnFamilyRowMapper<K, N, T> mapper) {
"""
Queries all columns at a given key and maps them to an object of type OBJ
using the given mapping object
@param <T>
@param key
@param columns
@param mapper
@return
"""
HSlicePredicate<N> predicate =... | java | public <T> T queryColumns(K key, List<N> columns,
ColumnFamilyRowMapper<K, N, T> mapper) {
HSlicePredicate<N> predicate = new HSlicePredicate<N>(topSerializer);
predicate.setColumnNames(columns);
return doExecuteSlice(key, predicate, mapper);
} | [
"public",
"<",
"T",
">",
"T",
"queryColumns",
"(",
"K",
"key",
",",
"List",
"<",
"N",
">",
"columns",
",",
"ColumnFamilyRowMapper",
"<",
"K",
",",
"N",
",",
"T",
">",
"mapper",
")",
"{",
"HSlicePredicate",
"<",
"N",
">",
"predicate",
"=",
"new",
"H... | Queries all columns at a given key and maps them to an object of type OBJ
using the given mapping object
@param <T>
@param key
@param columns
@param mapper
@return | [
"Queries",
"all",
"columns",
"at",
"a",
"given",
"key",
"and",
"maps",
"them",
"to",
"an",
"object",
"of",
"type",
"OBJ",
"using",
"the",
"given",
"mapping",
"object"
] | train | https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/cassandra/service/template/ColumnFamilyTemplate.java#L150-L155 |
google/closure-compiler | src/com/google/javascript/jscomp/FunctionTypeBuilder.java | FunctionTypeBuilder.inferConstructorParameters | FunctionTypeBuilder inferConstructorParameters(Node argsParent, @Nullable JSDocInfo info) {
"""
Infer parameters from the params list and info. Also maybe add extra templates.
"""
// Look for template parameters in 'info': these will be added to anything from the class.
if (info != null) {
setCon... | java | FunctionTypeBuilder inferConstructorParameters(Node argsParent, @Nullable JSDocInfo info) {
// Look for template parameters in 'info': these will be added to anything from the class.
if (info != null) {
setConstructorTemplateTypeNames(
buildTemplateTypesFromJSDocInfo(info, true), argsParent.getP... | [
"FunctionTypeBuilder",
"inferConstructorParameters",
"(",
"Node",
"argsParent",
",",
"@",
"Nullable",
"JSDocInfo",
"info",
")",
"{",
"// Look for template parameters in 'info': these will be added to anything from the class.",
"if",
"(",
"info",
"!=",
"null",
")",
"{",
"setCo... | Infer parameters from the params list and info. Also maybe add extra templates. | [
"Infer",
"parameters",
"from",
"the",
"params",
"list",
"and",
"info",
".",
"Also",
"maybe",
"add",
"extra",
"templates",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L681-L691 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/base/Preconditions.java | Preconditions.checkArgument | public static void checkArgument(boolean b, String message, Object... args) {
"""
Check the specified boolean argument. Throws an IllegalArgumentException with the specified message if {@code b} is false.
Note that the message may specify argument locations using "%s" - for example,
{@code checkArgument(false, "... | java | public static void checkArgument(boolean b, String message, Object... args) {
if (!b) {
throwEx(message, args);
}
} | [
"public",
"static",
"void",
"checkArgument",
"(",
"boolean",
"b",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"b",
")",
"{",
"throwEx",
"(",
"message",
",",
"args",
")",
";",
"}",
"}"
] | Check the specified boolean argument. Throws an IllegalArgumentException with the specified message if {@code b} is false.
Note that the message may specify argument locations using "%s" - for example,
{@code checkArgument(false, "Got %s values, expected %s", 3, "more"} would throw an IllegalArgumentException
with the ... | [
"Check",
"the",
"specified",
"boolean",
"argument",
".",
"Throws",
"an",
"IllegalArgumentException",
"with",
"the",
"specified",
"message",
"if",
"{",
"@code",
"b",
"}",
"is",
"false",
".",
"Note",
"that",
"the",
"message",
"may",
"specify",
"argument",
"locat... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/base/Preconditions.java#L242-L246 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/AbstractMappedClassFieldObserver.java | AbstractMappedClassFieldObserver.readFieldValue | private static Object readFieldValue(final Object obj, final Field field) {
"""
Inside auxiliary method to read object field value.
@param obj an object which field is read
@param field a field to be read
@return a value from the field of the object
@throws JBBPException if the field can't be read
@since ... | java | private static Object readFieldValue(final Object obj, final Field field) {
try {
return field.get(obj);
} catch (Exception ex) {
throw new JBBPException("Can't get value from field [" + field + ']', ex);
}
} | [
"private",
"static",
"Object",
"readFieldValue",
"(",
"final",
"Object",
"obj",
",",
"final",
"Field",
"field",
")",
"{",
"try",
"{",
"return",
"field",
".",
"get",
"(",
"obj",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"throw",
"new",
... | Inside auxiliary method to read object field value.
@param obj an object which field is read
@param field a field to be read
@return a value from the field of the object
@throws JBBPException if the field can't be read
@since 1.1 | [
"Inside",
"auxiliary",
"method",
"to",
"read",
"object",
"field",
"value",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/AbstractMappedClassFieldObserver.java#L61-L67 |
mozilla/rhino | src/org/mozilla/javascript/Parser.java | Parser.xmlElemRef | private XmlElemRef xmlElemRef(int atPos, Name namespace, int colonPos)
throws IOException {
"""
Parse the [expr] portion of an xml element reference, e.g.
@[expr], @*::[expr], or ns::[expr].
"""
int lb = ts.tokenBeg, rb = -1, pos = atPos != -1 ? atPos : lb;
AstNode expr = expr();
... | java | private XmlElemRef xmlElemRef(int atPos, Name namespace, int colonPos)
throws IOException
{
int lb = ts.tokenBeg, rb = -1, pos = atPos != -1 ? atPos : lb;
AstNode expr = expr();
int end = getNodeEnd(expr);
if (mustMatchToken(Token.RB, "msg.no.bracket.index", true)) {
... | [
"private",
"XmlElemRef",
"xmlElemRef",
"(",
"int",
"atPos",
",",
"Name",
"namespace",
",",
"int",
"colonPos",
")",
"throws",
"IOException",
"{",
"int",
"lb",
"=",
"ts",
".",
"tokenBeg",
",",
"rb",
"=",
"-",
"1",
",",
"pos",
"=",
"atPos",
"!=",
"-",
"... | Parse the [expr] portion of an xml element reference, e.g.
@[expr], @*::[expr], or ns::[expr]. | [
"Parse",
"the",
"[",
"expr",
"]",
"portion",
"of",
"an",
"xml",
"element",
"reference",
"e",
".",
"g",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Parser.java#L3067-L3084 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/bolt/dialect/impl/BoltNeo4jSequenceGenerator.java | BoltNeo4jSequenceGenerator.createSequencesConstraintsStatements | private void createSequencesConstraintsStatements(List<Statement> statements, Iterable<Sequence> sequences) {
"""
Create the sequence nodes setting the initial value if the node does not exist already.
<p>
All nodes are created inside the same transaction.
"""
Statement statement = createUniqueConstraintSt... | java | private void createSequencesConstraintsStatements(List<Statement> statements, Iterable<Sequence> sequences) {
Statement statement = createUniqueConstraintStatement( SEQUENCE_NAME_PROPERTY, NodeLabel.SEQUENCE.name() );
statements.add( statement );
} | [
"private",
"void",
"createSequencesConstraintsStatements",
"(",
"List",
"<",
"Statement",
">",
"statements",
",",
"Iterable",
"<",
"Sequence",
">",
"sequences",
")",
"{",
"Statement",
"statement",
"=",
"createUniqueConstraintStatement",
"(",
"SEQUENCE_NAME_PROPERTY",
",... | Create the sequence nodes setting the initial value if the node does not exist already.
<p>
All nodes are created inside the same transaction. | [
"Create",
"the",
"sequence",
"nodes",
"setting",
"the",
"initial",
"value",
"if",
"the",
"node",
"does",
"not",
"exist",
"already",
".",
"<p",
">",
"All",
"nodes",
"are",
"created",
"inside",
"the",
"same",
"transaction",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/bolt/dialect/impl/BoltNeo4jSequenceGenerator.java#L70-L73 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/types/BasicDigitalObject.java | BasicDigitalObject.newID | private String newID(Iterator<String> iter, String start) {
"""
Given an iterator of existing ids, return a new id that starts with
<code>start</code> and is guaranteed to be unique. This algorithm adds
one to the highest existing id that starts with <code>start</code>. If
no such existing id exists, it will re... | java | private String newID(Iterator<String> iter, String start) {
int highest = 0;
if (iter != null) {
while (iter.hasNext()) {
String id = iter.next();
if (id.startsWith(start) && id.length() > start.length()) {
try {
int... | [
"private",
"String",
"newID",
"(",
"Iterator",
"<",
"String",
">",
"iter",
",",
"String",
"start",
")",
"{",
"int",
"highest",
"=",
"0",
";",
"if",
"(",
"iter",
"!=",
"null",
")",
"{",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"St... | Given an iterator of existing ids, return a new id that starts with
<code>start</code> and is guaranteed to be unique. This algorithm adds
one to the highest existing id that starts with <code>start</code>. If
no such existing id exists, it will return <i>start</i> + "1". | [
"Given",
"an",
"iterator",
"of",
"existing",
"ids",
"return",
"a",
"new",
"id",
"that",
"starts",
"with",
"<code",
">",
"start<",
"/",
"code",
">",
"and",
"is",
"guaranteed",
"to",
"be",
"unique",
".",
"This",
"algorithm",
"adds",
"one",
"to",
"the",
"... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/types/BasicDigitalObject.java#L463-L481 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/TCPProxyResponse.java | TCPProxyResponse.setForwardProxyBuffers | protected boolean setForwardProxyBuffers(Map<Object, Object> config) {
"""
If SSL tunneling is enabled set the forward proxy connect buffers
on the TCPWriteRequestContext.
Forward proxy connect buffers contain ->
"CONNECT <proxy.TargetHostname:proxy.TargetPort> HTTP/1.0CRLF"
"Proxy-authorization: basic <base64... | java | protected boolean setForwardProxyBuffers(Map<Object, Object> config) {
byte[] target = (byte[]) config.get(PROXY_TARGET_HOST_PORT);
if (null == target) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Proxy tunnel attempt missing target host... | [
"protected",
"boolean",
"setForwardProxyBuffers",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"config",
")",
"{",
"byte",
"[",
"]",
"target",
"=",
"(",
"byte",
"[",
"]",
")",
"config",
".",
"get",
"(",
"PROXY_TARGET_HOST_PORT",
")",
";",
"if",
"(",
... | If SSL tunneling is enabled set the forward proxy connect buffers
on the TCPWriteRequestContext.
Forward proxy connect buffers contain ->
"CONNECT <proxy.TargetHostname:proxy.TargetPort> HTTP/1.0CRLF"
"Proxy-authorization: basic <base64 encoded(username:password)>CRLF"
"CRLF"
Note: Proxy-authorization is optional head... | [
"If",
"SSL",
"tunneling",
"is",
"enabled",
"set",
"the",
"forward",
"proxy",
"connect",
"buffers",
"on",
"the",
"TCPWriteRequestContext",
".",
"Forward",
"proxy",
"connect",
"buffers",
"contain",
"-",
">",
"CONNECT",
"<proxy",
".",
"TargetHostname",
":",
"proxy"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/TCPProxyResponse.java#L472-L508 |
jglobus/JGlobus | io/src/main/java/org/globus/io/urlcopy/UrlCopy.java | UrlCopy.negotiateDCAU | protected void negotiateDCAU(FTPClient src, FTPClient dst)
throws IOException, FTPException {
"""
/*
This could replaced later with something more inteligent
where the user would set if dcau is required or not, etc.
"""
if (src instanceof GridFTPClient) {
// src: dcau can be on or... | java | protected void negotiateDCAU(FTPClient src, FTPClient dst)
throws IOException, FTPException {
if (src instanceof GridFTPClient) {
// src: dcau can be on or off
if (dst instanceof GridFTPClient) {
// dst: dca can be on or off
GridFTPClient s = (Grid... | [
"protected",
"void",
"negotiateDCAU",
"(",
"FTPClient",
"src",
",",
"FTPClient",
"dst",
")",
"throws",
"IOException",
",",
"FTPException",
"{",
"if",
"(",
"src",
"instanceof",
"GridFTPClient",
")",
"{",
"// src: dcau can be on or off",
"if",
"(",
"dst",
"instanceo... | /*
This could replaced later with something more inteligent
where the user would set if dcau is required or not, etc. | [
"/",
"*",
"This",
"could",
"replaced",
"later",
"with",
"something",
"more",
"inteligent",
"where",
"the",
"user",
"would",
"set",
"if",
"dcau",
"is",
"required",
"or",
"not",
"etc",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/io/src/main/java/org/globus/io/urlcopy/UrlCopy.java#L781-L818 |
knowm/XChange | xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/service/OkCoinTradeServiceRaw.java | OkCoinTradeServiceRaw.futureExplosive | public OkCoinFutureExplosiveResult futureExplosive(
CurrencyPair pair,
FuturesContract type,
String status,
Integer currentPage,
Integer pageNumber,
Integer pageLength) {
"""
获取合约爆仓单
@param pair
@param type
@param status //状态 0:最近7天未成交 1:最近7天已成交
@param currentPage
@param ... | java | public OkCoinFutureExplosiveResult futureExplosive(
CurrencyPair pair,
FuturesContract type,
String status,
Integer currentPage,
Integer pageNumber,
Integer pageLength) {
return okCoin.futureExplosive(
apikey,
OkCoinAdapters.adaptSymbol(pair),
type.getName... | [
"public",
"OkCoinFutureExplosiveResult",
"futureExplosive",
"(",
"CurrencyPair",
"pair",
",",
"FuturesContract",
"type",
",",
"String",
"status",
",",
"Integer",
"currentPage",
",",
"Integer",
"pageNumber",
",",
"Integer",
"pageLength",
")",
"{",
"return",
"okCoin",
... | 获取合约爆仓单
@param pair
@param type
@param status //状态 0:最近7天未成交 1:最近7天已成交
@param currentPage
@param pageNumber
@param pageLength //每页获取条数,最多不超过50
@return | [
"获取合约爆仓单"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/service/OkCoinTradeServiceRaw.java#L374-L390 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/cache/CacheRegistration.java | CacheRegistration.onStartup | public void onStartup() {
"""
Method that gets invoked when the server comes up
Load all the cache objects when the server starts
@throws StartupException
"""
try {
preloadCaches();
SpringAppContext.getInstance().loadPackageContexts(); // trigger dynamic context loading
... | java | public void onStartup() {
try {
preloadCaches();
SpringAppContext.getInstance().loadPackageContexts(); // trigger dynamic context loading
preloadDynamicCaches();
// implementor cache relies on kotlin from preloadDynamicCaches()
ImplementorCache implem... | [
"public",
"void",
"onStartup",
"(",
")",
"{",
"try",
"{",
"preloadCaches",
"(",
")",
";",
"SpringAppContext",
".",
"getInstance",
"(",
")",
".",
"loadPackageContexts",
"(",
")",
";",
"// trigger dynamic context loading",
"preloadDynamicCaches",
"(",
")",
";",
"/... | Method that gets invoked when the server comes up
Load all the cache objects when the server starts
@throws StartupException | [
"Method",
"that",
"gets",
"invoked",
"when",
"the",
"server",
"comes",
"up",
"Load",
"all",
"the",
"cache",
"objects",
"when",
"the",
"server",
"starts"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/cache/CacheRegistration.java#L78-L93 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.makeAbsolute | @Pure
public static URL makeAbsolute(File filename, URL current) {
"""
Make the given filename absolute from the given root if it is not already absolute.
<table border="1" width="100%" summary="Cases">
<thead>
<tr>
<td>{@code filename}</td><td>{@code current}</td><td>Result</td>
</tr>
</thead>
<tr>
<td... | java | @Pure
public static URL makeAbsolute(File filename, URL current) {
if (filename != null) {
if (!filename.isAbsolute() && current != null) {
return join(current, filename);
}
try {
return new URL(URISchemeType.FILE.toString() + fromFileStandardToURLStandard(filename.getAbsolutePath()));
} catch (M... | [
"@",
"Pure",
"public",
"static",
"URL",
"makeAbsolute",
"(",
"File",
"filename",
",",
"URL",
"current",
")",
"{",
"if",
"(",
"filename",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"filename",
".",
"isAbsolute",
"(",
")",
"&&",
"current",
"!=",
"null",
"... | Make the given filename absolute from the given root if it is not already absolute.
<table border="1" width="100%" summary="Cases">
<thead>
<tr>
<td>{@code filename}</td><td>{@code current}</td><td>Result</td>
</tr>
</thead>
<tr>
<td><code>null</code></td>
<td><code>null</code></td>
<td><code>null</code></td>
</tr>
<t... | [
"Make",
"the",
"given",
"filename",
"absolute",
"from",
"the",
"given",
"root",
"if",
"it",
"is",
"not",
"already",
"absolute",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L2447-L2460 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/stylers/AbstractStyler.java | AbstractStyler.shouldStyle | @Override
public boolean shouldStyle(Object data, Object element) {
"""
returns false when a condition is present for which {@link StylingCondition#shouldStyle(java.lang.Object, java.lang.Object)
}
is false
@param data
@param element the value of element
@return
"""
for (StylingCondition sc : c... | java | @Override
public boolean shouldStyle(Object data, Object element) {
for (StylingCondition sc : conditions) {
if (!sc.shouldStyle(data, null)) {
return false;
}
}
return true;
} | [
"@",
"Override",
"public",
"boolean",
"shouldStyle",
"(",
"Object",
"data",
",",
"Object",
"element",
")",
"{",
"for",
"(",
"StylingCondition",
"sc",
":",
"conditions",
")",
"{",
"if",
"(",
"!",
"sc",
".",
"shouldStyle",
"(",
"data",
",",
"null",
")",
... | returns false when a condition is present for which {@link StylingCondition#shouldStyle(java.lang.Object, java.lang.Object)
}
is false
@param data
@param element the value of element
@return | [
"returns",
"false",
"when",
"a",
"condition",
"is",
"present",
"for",
"which",
"{",
"@link",
"StylingCondition#shouldStyle",
"(",
"java",
".",
"lang",
".",
"Object",
"java",
".",
"lang",
".",
"Object",
")",
"}",
"is",
"false"
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/AbstractStyler.java#L170-L178 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_vm_vmId_backupJob_restorePoints_restorePointId_GET | public OvhRestorePoint serviceName_datacenter_datacenterId_vm_vmId_backupJob_restorePoints_restorePointId_GET(String serviceName, Long datacenterId, Long vmId, Long restorePointId) throws IOException {
"""
Get this object properties
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/bac... | java | public OvhRestorePoint serviceName_datacenter_datacenterId_vm_vmId_backupJob_restorePoints_restorePointId_GET(String serviceName, Long datacenterId, Long vmId, Long restorePointId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/backupJob/restorePoints/{restorePo... | [
"public",
"OvhRestorePoint",
"serviceName_datacenter_datacenterId_vm_vmId_backupJob_restorePoints_restorePointId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"Long",
"vmId",
",",
"Long",
"restorePointId",
")",
"throws",
"IOException",
"{",
"String",
"... | Get this object properties
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/backupJob/restorePoints/{restorePointId}
@param serviceName [required] Domain of the service
@param datacenterId [required]
@param vmId [required] Id of the virtual machine.
@param restorePointId [required] Id of the... | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2074-L2079 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/constraint/InterToPartER.java | InterToPartER.generate | @Override
public Collection<BioPAXElement> generate(Match match, int... ind) {
"""
Iterated over non-taboo participants and collectes related ER.
@param match current pattern match
@param ind mapped indices
@return related participants
"""
Interaction inter = (Interaction) match.get(ind[0]);
Set<Entit... | java | @Override
public Collection<BioPAXElement> generate(Match match, int... ind)
{
Interaction inter = (Interaction) match.get(ind[0]);
Set<Entity> taboo = new HashSet<Entity>();
for (int i = 1; i < getVariableSize() - 1; i++)
{
taboo.add((Entity) match.get(ind[i]));
}
if (direction == null) return gene... | [
"@",
"Override",
"public",
"Collection",
"<",
"BioPAXElement",
">",
"generate",
"(",
"Match",
"match",
",",
"int",
"...",
"ind",
")",
"{",
"Interaction",
"inter",
"=",
"(",
"Interaction",
")",
"match",
".",
"get",
"(",
"ind",
"[",
"0",
"]",
")",
";",
... | Iterated over non-taboo participants and collectes related ER.
@param match current pattern match
@param ind mapped indices
@return related participants | [
"Iterated",
"over",
"non",
"-",
"taboo",
"participants",
"and",
"collectes",
"related",
"ER",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/InterToPartER.java#L106-L120 |
jbundle/jbundle | app/program/db/src/main/java/org/jbundle/app/program/db/FieldTypeField.java | FieldTypeField.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) {
"""
Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param t... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties)
{
converter = new CheckConverter((Converter)converter, VIRTUAL_FIELD, null, true);
return createScreenComponent(ScreenModel.CHECK_BOX... | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"converter"... | Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param converter The converter to set the screenfield to.
@param iDisplayFieldDesc Display the labe... | [
"Set",
"up",
"the",
"default",
"screen",
"control",
"for",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/db/src/main/java/org/jbundle/app/program/db/FieldTypeField.java#L77-L81 |
eclipse/xtext-core | org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/editor/contentassist/IdeContentProposalCreator.java | IdeContentProposalCreator.createProposal | public ContentAssistEntry createProposal(final String proposal, final String prefix, final ContentAssistContext context, final String kind, final Procedure1<? super ContentAssistEntry> init) {
"""
Returns an entry with the given proposal and prefix, or null if the proposal is not valid.
If it is valid, the initia... | java | public ContentAssistEntry createProposal(final String proposal, final String prefix, final ContentAssistContext context, final String kind, final Procedure1<? super ContentAssistEntry> init) {
boolean _isValidProposal = this.isValidProposal(proposal, prefix, context);
if (_isValidProposal) {
final Content... | [
"public",
"ContentAssistEntry",
"createProposal",
"(",
"final",
"String",
"proposal",
",",
"final",
"String",
"prefix",
",",
"final",
"ContentAssistContext",
"context",
",",
"final",
"String",
"kind",
",",
"final",
"Procedure1",
"<",
"?",
"super",
"ContentAssistEntr... | Returns an entry with the given proposal and prefix, or null if the proposal is not valid.
If it is valid, the initializer function is applied to it. | [
"Returns",
"an",
"entry",
"with",
"the",
"given",
"proposal",
"and",
"prefix",
"or",
"null",
"if",
"the",
"proposal",
"is",
"not",
"valid",
".",
"If",
"it",
"is",
"valid",
"the",
"initializer",
"function",
"is",
"applied",
"to",
"it",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/editor/contentassist/IdeContentProposalCreator.java#L71-L86 |
square/phrase | src/main/java/com/squareup/phrase/Phrase.java | Phrase.fromPlural | public static Phrase fromPlural(Context c, @PluralsRes int patternResourceId, int quantity) {
"""
Entry point into this API.
@throws IllegalArgumentException if pattern contains any syntax errors.
"""
return fromPlural(c.getResources(), patternResourceId, quantity);
} | java | public static Phrase fromPlural(Context c, @PluralsRes int patternResourceId, int quantity) {
return fromPlural(c.getResources(), patternResourceId, quantity);
} | [
"public",
"static",
"Phrase",
"fromPlural",
"(",
"Context",
"c",
",",
"@",
"PluralsRes",
"int",
"patternResourceId",
",",
"int",
"quantity",
")",
"{",
"return",
"fromPlural",
"(",
"c",
".",
"getResources",
"(",
")",
",",
"patternResourceId",
",",
"quantity",
... | Entry point into this API.
@throws IllegalArgumentException if pattern contains any syntax errors. | [
"Entry",
"point",
"into",
"this",
"API",
"."
] | train | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/Phrase.java#L123-L125 |
threerings/nenya | core/src/main/java/com/threerings/media/animation/AnimationArranger.java | AnimationArranger.positionAvoidAnimation | public void positionAvoidAnimation (Animation anim, Rectangle viewBounds) {
"""
Position the specified animation so that it is not overlapping
any still-running animations previously passed to this method.
"""
Rectangle abounds = new Rectangle(anim.getBounds());
@SuppressWarnings("unchecked") ... | java | public void positionAvoidAnimation (Animation anim, Rectangle viewBounds)
{
Rectangle abounds = new Rectangle(anim.getBounds());
@SuppressWarnings("unchecked") ArrayList<Animation> avoidables =
(ArrayList<Animation>) _avoidAnims.clone();
// if we are able to place it somewhere, d... | [
"public",
"void",
"positionAvoidAnimation",
"(",
"Animation",
"anim",
",",
"Rectangle",
"viewBounds",
")",
"{",
"Rectangle",
"abounds",
"=",
"new",
"Rectangle",
"(",
"anim",
".",
"getBounds",
"(",
")",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
"... | Position the specified animation so that it is not overlapping
any still-running animations previously passed to this method. | [
"Position",
"the",
"specified",
"animation",
"so",
"that",
"it",
"is",
"not",
"overlapping",
"any",
"still",
"-",
"running",
"animations",
"previously",
"passed",
"to",
"this",
"method",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/animation/AnimationArranger.java#L41-L55 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java | FSDataset.validateBlockFile | File validateBlockFile(int namespaceId, Block b) throws IOException {
"""
Find the file corresponding to the block and return it if it exists.
"""
return getValidateBlockFile(namespaceId, b, false);
} | java | File validateBlockFile(int namespaceId, Block b) throws IOException {
return getValidateBlockFile(namespaceId, b, false);
} | [
"File",
"validateBlockFile",
"(",
"int",
"namespaceId",
",",
"Block",
"b",
")",
"throws",
"IOException",
"{",
"return",
"getValidateBlockFile",
"(",
"namespaceId",
",",
"b",
",",
"false",
")",
";",
"}"
] | Find the file corresponding to the block and return it if it exists. | [
"Find",
"the",
"file",
"corresponding",
"to",
"the",
"block",
"and",
"return",
"it",
"if",
"it",
"exists",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java#L2536-L2538 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/AuthenticateApi.java | AuthenticateApi.simpleLogout | public void simpleLogout(HttpServletRequest req, HttpServletResponse res) {
"""
Perform logout an user by doing the following:
1) Invalidate the session
2) Remove cookie if SSO is enabled
3) Clear out the client subject
@param req
@param res
"""
createSubjectAndPushItOnThreadAsNeeded(req, res);
... | java | public void simpleLogout(HttpServletRequest req, HttpServletResponse res) {
createSubjectAndPushItOnThreadAsNeeded(req, res);
AuthenticationResult authResult = new AuthenticationResult(AuthResult.SUCCESS, subjectManager.getCallerSubject());
authResult.setAuditCredType(req.getAuthType());
... | [
"public",
"void",
"simpleLogout",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"{",
"createSubjectAndPushItOnThreadAsNeeded",
"(",
"req",
",",
"res",
")",
";",
"AuthenticationResult",
"authResult",
"=",
"new",
"AuthenticationResult",
"(",
... | Perform logout an user by doing the following:
1) Invalidate the session
2) Remove cookie if SSO is enabled
3) Clear out the client subject
@param req
@param res | [
"Perform",
"logout",
"an",
"user",
"by",
"doing",
"the",
"following",
":",
"1",
")",
"Invalidate",
"the",
"session",
"2",
")",
"Remove",
"cookie",
"if",
"SSO",
"is",
"enabled",
"3",
")",
"Clear",
"out",
"the",
"client",
"subject"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/AuthenticateApi.java#L289-L303 |
CloudSlang/cs-actions | cs-json/src/main/java/io/cloudslang/content/json/actions/ArraySize.java | ArraySize.execute | @Action(name = "Array Size",
outputs = {
"""
This operation determines the number of elements in the given JSON array. If an element
is itself another JSON array, it only counts as 1 element; in other
words, it will not expand and count embedded arrays. Null values are also
considered to be an ele... | java | @Action(name = "Array Size",
outputs = {
@Output(OutputNames.RETURN_RESULT),
@Output(OutputNames.RETURN_CODE),
@Output(OutputNames.EXCEPTION)
},
responses = {
@Response(text = ResponseNames.SUCCESS, field... | [
"@",
"Action",
"(",
"name",
"=",
"\"Array Size\"",
",",
"outputs",
"=",
"{",
"@",
"Output",
"(",
"OutputNames",
".",
"RETURN_RESULT",
")",
",",
"@",
"Output",
"(",
"OutputNames",
".",
"RETURN_CODE",
")",
",",
"@",
"Output",
"(",
"OutputNames",
".",
"EXCE... | This operation determines the number of elements in the given JSON array. If an element
is itself another JSON array, it only counts as 1 element; in other
words, it will not expand and count embedded arrays. Null values are also
considered to be an element.
@param array The string representation of a JSON array obj... | [
"This",
"operation",
"determines",
"the",
"number",
"of",
"elements",
"in",
"the",
"given",
"JSON",
"array",
".",
"If",
"an",
"element",
"is",
"itself",
"another",
"JSON",
"array",
"it",
"only",
"counts",
"as",
"1",
"element",
";",
"in",
"other",
"words",
... | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-json/src/main/java/io/cloudslang/content/json/actions/ArraySize.java#L63-L96 |
op4j/op4j | src/main/java/org/op4j/functions/FnNumber.java | FnNumber.toCurrencyStr | public static final Function<Number,String> toCurrencyStr(Locale locale) {
"""
<p>
It returns the {@link String} representation of the target as a currency in the
given {@link Locale}
</p>
@param locale the {@link Locale} to be used
@return the {@link String} representation of the input as a currency
""... | java | public static final Function<Number,String> toCurrencyStr(Locale locale) {
return new ToString(NumberFormatType.CURRENCY, locale);
} | [
"public",
"static",
"final",
"Function",
"<",
"Number",
",",
"String",
">",
"toCurrencyStr",
"(",
"Locale",
"locale",
")",
"{",
"return",
"new",
"ToString",
"(",
"NumberFormatType",
".",
"CURRENCY",
",",
"locale",
")",
";",
"}"
] | <p>
It returns the {@link String} representation of the target as a currency in the
given {@link Locale}
</p>
@param locale the {@link Locale} to be used
@return the {@link String} representation of the input as a currency | [
"<p",
">",
"It",
"returns",
"the",
"{",
"@link",
"String",
"}",
"representation",
"of",
"the",
"target",
"as",
"a",
"currency",
"in",
"the",
"given",
"{",
"@link",
"Locale",
"}",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnNumber.java#L615-L617 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ReflectionUtils.java | ReflectionUtils.getterOrFieldHasAnnotation | static <T extends Annotation> boolean getterOrFieldHasAnnotation(
Method getter, Class<T> annotationClass) {
"""
Returns true if an annotation for the specified type is found on the
getter method or its corresponding class field.
"""
return getAnnotationFromGetterOrField(getter, annotation... | java | static <T extends Annotation> boolean getterOrFieldHasAnnotation(
Method getter, Class<T> annotationClass) {
return getAnnotationFromGetterOrField(getter, annotationClass) != null;
} | [
"static",
"<",
"T",
"extends",
"Annotation",
">",
"boolean",
"getterOrFieldHasAnnotation",
"(",
"Method",
"getter",
",",
"Class",
"<",
"T",
">",
"annotationClass",
")",
"{",
"return",
"getAnnotationFromGetterOrField",
"(",
"getter",
",",
"annotationClass",
")",
"!... | Returns true if an annotation for the specified type is found on the
getter method or its corresponding class field. | [
"Returns",
"true",
"if",
"an",
"annotation",
"for",
"the",
"specified",
"type",
"is",
"found",
"on",
"the",
"getter",
"method",
"or",
"its",
"corresponding",
"class",
"field",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ReflectionUtils.java#L114-L117 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java | PaymentSession.createFromUrl | public static ListenableFuture<PaymentSession> createFromUrl(final String url) throws PaymentProtocolException {
"""
Returns a future that will be notified with a PaymentSession object after it is fetched using the provided url.
url is an address where the {@link Protos.PaymentRequest} object may be fetched.
If ... | java | public static ListenableFuture<PaymentSession> createFromUrl(final String url) throws PaymentProtocolException {
return createFromUrl(url, true, null);
} | [
"public",
"static",
"ListenableFuture",
"<",
"PaymentSession",
">",
"createFromUrl",
"(",
"final",
"String",
"url",
")",
"throws",
"PaymentProtocolException",
"{",
"return",
"createFromUrl",
"(",
"url",
",",
"true",
",",
"null",
")",
";",
"}"
] | Returns a future that will be notified with a PaymentSession object after it is fetched using the provided url.
url is an address where the {@link Protos.PaymentRequest} object may be fetched.
If verifyPki is specified and the payment request object specifies a PKI method, then the system trust store will
be used to ve... | [
"Returns",
"a",
"future",
"that",
"will",
"be",
"notified",
"with",
"a",
"PaymentSession",
"object",
"after",
"it",
"is",
"fetched",
"using",
"the",
"provided",
"url",
".",
"url",
"is",
"an",
"address",
"where",
"the",
"{"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java#L138-L140 |
ModeShape/modeshape | modeshape-jdbc/src/main/java/org/modeshape/jdbc/rest/ModeShapeRestClient.java | ModeShapeRestClient.getWorkspaces | public Workspaces getWorkspaces( String repositoryName ) {
"""
Returns all the workspaces for the named repository.
@param repositoryName a {@code String} the name of a repository; may not be {@code null}
@return a {@link Workspaces} instance; never {@code null}
"""
String url = jsonRestClient.appe... | java | public Workspaces getWorkspaces( String repositoryName ) {
String url = jsonRestClient.appendToBaseURL(repositoryName);
JSONRestClient.Response response = jsonRestClient.doGet(url);
if (!response.isOK()) {
throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.a... | [
"public",
"Workspaces",
"getWorkspaces",
"(",
"String",
"repositoryName",
")",
"{",
"String",
"url",
"=",
"jsonRestClient",
".",
"appendToBaseURL",
"(",
"repositoryName",
")",
";",
"JSONRestClient",
".",
"Response",
"response",
"=",
"jsonRestClient",
".",
"doGet",
... | Returns all the workspaces for the named repository.
@param repositoryName a {@code String} the name of a repository; may not be {@code null}
@return a {@link Workspaces} instance; never {@code null} | [
"Returns",
"all",
"the",
"workspaces",
"for",
"the",
"named",
"repository",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jdbc/src/main/java/org/modeshape/jdbc/rest/ModeShapeRestClient.java#L96-L103 |
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeEndpoint.java | RespokeEndpoint.getConnection | public RespokeConnection getConnection(String connectionID, boolean skipCreate) {
"""
Returns a connection with the specified ID, and optionally creates one if it does not exist
@param connectionID The ID of the connection
@param skipCreate Whether or not to create a new connection if it is not found
@r... | java | public RespokeConnection getConnection(String connectionID, boolean skipCreate) {
RespokeConnection connection = null;
for (RespokeConnection eachConnection : connections) {
if (eachConnection.connectionID.equals(connectionID)) {
connection = eachConnection;
... | [
"public",
"RespokeConnection",
"getConnection",
"(",
"String",
"connectionID",
",",
"boolean",
"skipCreate",
")",
"{",
"RespokeConnection",
"connection",
"=",
"null",
";",
"for",
"(",
"RespokeConnection",
"eachConnection",
":",
"connections",
")",
"{",
"if",
"(",
... | Returns a connection with the specified ID, and optionally creates one if it does not exist
@param connectionID The ID of the connection
@param skipCreate Whether or not to create a new connection if it is not found
@return The connection that matches the specified ID, or null if not found and skipCreate is true | [
"Returns",
"a",
"connection",
"with",
"the",
"specified",
"ID",
"and",
"optionally",
"creates",
"one",
"if",
"it",
"does",
"not",
"exist"
] | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeEndpoint.java#L177-L193 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java | ListManagementImagesImpl.addImageFileInputAsync | public Observable<Image> addImageFileInputAsync(String listId, byte[] imageStream, AddImageFileInputOptionalParameter addImageFileInputOptionalParameter) {
"""
Add an image to the list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param imageStream The image file.
@param addI... | java | public Observable<Image> addImageFileInputAsync(String listId, byte[] imageStream, AddImageFileInputOptionalParameter addImageFileInputOptionalParameter) {
return addImageFileInputWithServiceResponseAsync(listId, imageStream, addImageFileInputOptionalParameter).map(new Func1<ServiceResponse<Image>, Image>() {
... | [
"public",
"Observable",
"<",
"Image",
">",
"addImageFileInputAsync",
"(",
"String",
"listId",
",",
"byte",
"[",
"]",
"imageStream",
",",
"AddImageFileInputOptionalParameter",
"addImageFileInputOptionalParameter",
")",
"{",
"return",
"addImageFileInputWithServiceResponseAsync"... | Add an image to the list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param imageStream The image file.
@param addImageFileInputOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fa... | [
"Add",
"an",
"image",
"to",
"the",
"list",
"with",
"list",
"Id",
"equal",
"to",
"list",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java#L729-L736 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java | ProjectiveInitializeAllCommon.computeCameraMatrix | private boolean computeCameraMatrix(View seed, Motion edge, FastQueue<Point2D_F64> featsB, DMatrixRMaj cameraMatrix ) {
"""
Computes camera matrix between the seed view and a connected view
@param seed This will be the source view. It's observations have already been added to assocPixel
@param edge The edge whic... | java | private boolean computeCameraMatrix(View seed, Motion edge, FastQueue<Point2D_F64> featsB, DMatrixRMaj cameraMatrix ) {
boolean seedSrc = edge.src == seed;
int matched = 0;
for (int i = 0; i < edge.inliers.size; i++) {
// need to go from i to index of detected features in view 'seed' to index index of feature... | [
"private",
"boolean",
"computeCameraMatrix",
"(",
"View",
"seed",
",",
"Motion",
"edge",
",",
"FastQueue",
"<",
"Point2D_F64",
">",
"featsB",
",",
"DMatrixRMaj",
"cameraMatrix",
")",
"{",
"boolean",
"seedSrc",
"=",
"edge",
".",
"src",
"==",
"seed",
";",
"int... | Computes camera matrix between the seed view and a connected view
@param seed This will be the source view. It's observations have already been added to assocPixel
@param edge The edge which connects them
@param featsB The dst view
@param cameraMatrix (Output) resulting camera matrix
@return true if successful | [
"Computes",
"camera",
"matrix",
"between",
"the",
"seed",
"view",
"and",
"a",
"connected",
"view"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java#L431-L456 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java | AbstractDrawerItem.onPostBindView | public void onPostBindView(IDrawerItem drawerItem, View view) {
"""
is called after bindView to allow some post creation setps
@param drawerItem the drawerItem which is bound to the view
@param view the currently view which will be bound
"""
if (mOnPostBindViewListener != null) {
... | java | public void onPostBindView(IDrawerItem drawerItem, View view) {
if (mOnPostBindViewListener != null) {
mOnPostBindViewListener.onBindView(drawerItem, view);
}
} | [
"public",
"void",
"onPostBindView",
"(",
"IDrawerItem",
"drawerItem",
",",
"View",
"view",
")",
"{",
"if",
"(",
"mOnPostBindViewListener",
"!=",
"null",
")",
"{",
"mOnPostBindViewListener",
".",
"onBindView",
"(",
"drawerItem",
",",
"view",
")",
";",
"}",
"}"
... | is called after bindView to allow some post creation setps
@param drawerItem the drawerItem which is bound to the view
@param view the currently view which will be bound | [
"is",
"called",
"after",
"bindView",
"to",
"allow",
"some",
"post",
"creation",
"setps"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java#L204-L208 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/KeyRange.java | KeyRange.openClosed | public static KeyRange openClosed(Key start, Key end) {
"""
Returns a key range from {@code start} exclusive to {@code end} inclusive.
"""
return new KeyRange(checkNotNull(start), Endpoint.OPEN, checkNotNull(end), Endpoint.CLOSED);
} | java | public static KeyRange openClosed(Key start, Key end) {
return new KeyRange(checkNotNull(start), Endpoint.OPEN, checkNotNull(end), Endpoint.CLOSED);
} | [
"public",
"static",
"KeyRange",
"openClosed",
"(",
"Key",
"start",
",",
"Key",
"end",
")",
"{",
"return",
"new",
"KeyRange",
"(",
"checkNotNull",
"(",
"start",
")",
",",
"Endpoint",
".",
"OPEN",
",",
"checkNotNull",
"(",
"end",
")",
",",
"Endpoint",
".",... | Returns a key range from {@code start} exclusive to {@code end} inclusive. | [
"Returns",
"a",
"key",
"range",
"from",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/KeyRange.java#L167-L169 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/csskit/antlr4/CSSErrorStrategy.java | CSSErrorStrategy.consumeUntilGreedy | public void consumeUntilGreedy(Parser recognizer, IntervalSet follow, CSSLexerState.RecoveryMode mode, CSSLexerState ls) {
"""
Consumes token until lexer state is function-balanced and
token from follow is matched. Matched token is also consumed.
"""
consumeUntil(recognizer, follow, mode, ls);
... | java | public void consumeUntilGreedy(Parser recognizer, IntervalSet follow, CSSLexerState.RecoveryMode mode, CSSLexerState ls) {
consumeUntil(recognizer, follow, mode, ls);
recognizer.getInputStream().consume();
} | [
"public",
"void",
"consumeUntilGreedy",
"(",
"Parser",
"recognizer",
",",
"IntervalSet",
"follow",
",",
"CSSLexerState",
".",
"RecoveryMode",
"mode",
",",
"CSSLexerState",
"ls",
")",
"{",
"consumeUntil",
"(",
"recognizer",
",",
"follow",
",",
"mode",
",",
"ls",
... | Consumes token until lexer state is function-balanced and
token from follow is matched. Matched token is also consumed. | [
"Consumes",
"token",
"until",
"lexer",
"state",
"is",
"function",
"-",
"balanced",
"and",
"token",
"from",
"follow",
"is",
"matched",
".",
"Matched",
"token",
"is",
"also",
"consumed",
"."
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/antlr4/CSSErrorStrategy.java#L95-L98 |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/Controller.java | Controller.multipartFormItems | protected MultiList<FormItem> multipartFormItems(String encoding) {
"""
Returns a collection of uploaded files and form fields from a multi-part request.
This method uses <a href="http://commons.apache.org/proper/commons-fileupload/apidocs/org/apache/commons/fileupload/disk/DiskFileItemFactory.html">DiskFileItemF... | java | protected MultiList<FormItem> multipartFormItems(String encoding) {
if (!context.isRequestMultiPart())
throw new MediaTypeException("this is not a multipart request, be sure to add this attribute to the form: ... enctype=\"multipart/form-data\" ...");
MultiList<FormItem> parts = new MultiL... | [
"protected",
"MultiList",
"<",
"FormItem",
">",
"multipartFormItems",
"(",
"String",
"encoding",
")",
"{",
"if",
"(",
"!",
"context",
".",
"isRequestMultiPart",
"(",
")",
")",
"throw",
"new",
"MediaTypeException",
"(",
"\"this is not a multipart request, be sure to ad... | Returns a collection of uploaded files and form fields from a multi-part request.
This method uses <a href="http://commons.apache.org/proper/commons-fileupload/apidocs/org/apache/commons/fileupload/disk/DiskFileItemFactory.html">DiskFileItemFactory</a>.
As a result, it is recommended to add the following to your web.xm... | [
"Returns",
"a",
"collection",
"of",
"uploaded",
"files",
"and",
"form",
"fields",
"from",
"a",
"multi",
"-",
"part",
"request",
".",
"This",
"method",
"uses",
"<a",
"href",
"=",
"http",
":",
"//",
"commons",
".",
"apache",
".",
"org",
"/",
"proper",
"/... | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/Controller.java#L953-L971 |
revapi/revapi | revapi-java-spi/src/main/java/org/revapi/java/spi/CheckBase.java | CheckBase.visitField | @Override
public final void visitField(@Nullable JavaFieldElement oldField, @Nullable JavaFieldElement newField) {
"""
Please override the
{@link #doVisitField(JavaFieldElement, JavaFieldElement)}
instead.
@see Check#visitField(JavaFieldElement, JavaFieldElement)
"""
depth++;
doVisitFi... | java | @Override
public final void visitField(@Nullable JavaFieldElement oldField, @Nullable JavaFieldElement newField) {
depth++;
doVisitField(oldField, newField);
} | [
"@",
"Override",
"public",
"final",
"void",
"visitField",
"(",
"@",
"Nullable",
"JavaFieldElement",
"oldField",
",",
"@",
"Nullable",
"JavaFieldElement",
"newField",
")",
"{",
"depth",
"++",
";",
"doVisitField",
"(",
"oldField",
",",
"newField",
")",
";",
"}"
... | Please override the
{@link #doVisitField(JavaFieldElement, JavaFieldElement)}
instead.
@see Check#visitField(JavaFieldElement, JavaFieldElement) | [
"Please",
"override",
"the",
"{",
"@link",
"#doVisitField",
"(",
"JavaFieldElement",
"JavaFieldElement",
")",
"}",
"instead",
"."
] | train | https://github.com/revapi/revapi/blob/e070b136d977441ab96fdce067a13e7e0423295b/revapi-java-spi/src/main/java/org/revapi/java/spi/CheckBase.java#L298-L302 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.collectAllInterfaces | private static void collectAllInterfaces(final ClassNode node, final Set<ClassNode> out) {
"""
Collects all interfaces of a class node, including those defined by the
super class.
@param node a class for which we want to retrieve all interfaces
@param out the set where to collect interfaces
"""
i... | java | private static void collectAllInterfaces(final ClassNode node, final Set<ClassNode> out) {
if (node == null) return;
Set<ClassNode> allInterfaces = node.getAllInterfaces();
out.addAll(allInterfaces);
collectAllInterfaces(node.getSuperClass(), out);
} | [
"private",
"static",
"void",
"collectAllInterfaces",
"(",
"final",
"ClassNode",
"node",
",",
"final",
"Set",
"<",
"ClassNode",
">",
"out",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"return",
";",
"Set",
"<",
"ClassNode",
">",
"allInterfaces",
"=",
... | Collects all interfaces of a class node, including those defined by the
super class.
@param node a class for which we want to retrieve all interfaces
@param out the set where to collect interfaces | [
"Collects",
"all",
"interfaces",
"of",
"a",
"class",
"node",
"including",
"those",
"defined",
"by",
"the",
"super",
"class",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L2509-L2514 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Short.java | Short.valueOf | public static Short valueOf(String s, int radix)
throws NumberFormatException {
"""
Returns a {@code Short} object holding the value
extracted from the specified {@code String} when parsed
with the radix given by the second argument. The first argument
is interpreted as representing a signed {@code shor... | java | public static Short valueOf(String s, int radix)
throws NumberFormatException {
return valueOf(parseShort(s, radix));
} | [
"public",
"static",
"Short",
"valueOf",
"(",
"String",
"s",
",",
"int",
"radix",
")",
"throws",
"NumberFormatException",
"{",
"return",
"valueOf",
"(",
"parseShort",
"(",
"s",
",",
"radix",
")",
")",
";",
"}"
] | Returns a {@code Short} object holding the value
extracted from the specified {@code String} when parsed
with the radix given by the second argument. The first argument
is interpreted as representing a signed {@code short} in
the radix specified by the second argument, exactly as if the
argument were given to the {@lin... | [
"Returns",
"a",
"{",
"@code",
"Short",
"}",
"object",
"holding",
"the",
"value",
"extracted",
"from",
"the",
"specified",
"{",
"@code",
"String",
"}",
"when",
"parsed",
"with",
"the",
"radix",
"given",
"by",
"the",
"second",
"argument",
".",
"The",
"first"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Short.java#L173-L176 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java | Client.simpleRequest | public synchronized Message simpleRequest(Message.KnownType requestType, Message.KnownType responseType,
Field... arguments)
throws IOException {
"""
Send a request that expects a single message as its response, then read and return that response.
@param... | java | public synchronized Message simpleRequest(Message.KnownType requestType, Message.KnownType responseType,
Field... arguments)
throws IOException {
final NumberField transaction = assignTransactionNumber();
final Message request = new Message(trans... | [
"public",
"synchronized",
"Message",
"simpleRequest",
"(",
"Message",
".",
"KnownType",
"requestType",
",",
"Message",
".",
"KnownType",
"responseType",
",",
"Field",
"...",
"arguments",
")",
"throws",
"IOException",
"{",
"final",
"NumberField",
"transaction",
"=",
... | Send a request that expects a single message as its response, then read and return that response.
@param requestType identifies what kind of request to send
@param responseType identifies the type of response we expect, or {@code null} if we’ll accept anything
@param arguments The argument fields to send in the reques... | [
"Send",
"a",
"request",
"that",
"expects",
"a",
"single",
"message",
"as",
"its",
"response",
"then",
"read",
"and",
"return",
"that",
"response",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L345-L361 |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/util/HexUtil.java | HexUtil.byteArrayToInt | public static int byteArrayToInt(byte[] b, int offset) {
"""
Convert the byte array to an int starting from the given offset.
@param b The byte array
@param offset The array offset
@return The integer
"""
int value = 0;
for (int i = 0; i < 4; i++) {
int shift = (4 - 1 - i) * 8;... | java | public static int byteArrayToInt(byte[] b, int offset) {
int value = 0;
for (int i = 0; i < 4; i++) {
int shift = (4 - 1 - i) * 8;
value += (b[i + offset] & 0x000000FF) << shift;
}
return value;
} | [
"public",
"static",
"int",
"byteArrayToInt",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
")",
"{",
"int",
"value",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"4",
";",
"i",
"++",
")",
"{",
"int",
"shift",
"=",
"(",
... | Convert the byte array to an int starting from the given offset.
@param b The byte array
@param offset The array offset
@return The integer | [
"Convert",
"the",
"byte",
"array",
"to",
"an",
"int",
"starting",
"from",
"the",
"given",
"offset",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/util/HexUtil.java#L81-L88 |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java | EventExtractor.sortEventsByTokenIndex | private static void sortEventsByTokenIndex(Row row) {
"""
Sort events of a row. The sorting is depending on the left value of the
event
@param row
"""
Collections.sort(row.getEvents(), new Comparator<GridEvent>() {
@Override
public int compare(GridEvent o1, GridEvent o2) {
if (o1 ==... | java | private static void sortEventsByTokenIndex(Row row) {
Collections.sort(row.getEvents(), new Comparator<GridEvent>() {
@Override
public int compare(GridEvent o1, GridEvent o2) {
if (o1 == o2) {
return 0;
}
if (o1 == null) {
return -1;
}
if (o2 =... | [
"private",
"static",
"void",
"sortEventsByTokenIndex",
"(",
"Row",
"row",
")",
"{",
"Collections",
".",
"sort",
"(",
"row",
".",
"getEvents",
"(",
")",
",",
"new",
"Comparator",
"<",
"GridEvent",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"com... | Sort events of a row. The sorting is depending on the left value of the
event
@param row | [
"Sort",
"events",
"of",
"a",
"row",
".",
"The",
"sorting",
"is",
"depending",
"on",
"the",
"left",
"value",
"of",
"the",
"event"
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L690-L707 |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/management/impl/PersistenceTypeConversion.java | PersistenceTypeConversion.fromPersistenceType | public static Object fromPersistenceType(Object value, Class<?> parameterType) {
"""
Convert object from persistence to be used in configuration.
@param value Persisted value
@param parameterType Parameter type
@return Configured value
"""
if (!isTypeConversionRequired(parameterType)) {
return val... | java | public static Object fromPersistenceType(Object value, Class<?> parameterType) {
if (!isTypeConversionRequired(parameterType)) {
return value;
}
if (Map.class.isAssignableFrom(parameterType) && (value instanceof String[])) {
String[] rows = (String[])value;
Map<String, String> map = new Li... | [
"public",
"static",
"Object",
"fromPersistenceType",
"(",
"Object",
"value",
",",
"Class",
"<",
"?",
">",
"parameterType",
")",
"{",
"if",
"(",
"!",
"isTypeConversionRequired",
"(",
"parameterType",
")",
")",
"{",
"return",
"value",
";",
"}",
"if",
"(",
"M... | Convert object from persistence to be used in configuration.
@param value Persisted value
@param parameterType Parameter type
@return Configured value | [
"Convert",
"object",
"from",
"persistence",
"to",
"be",
"used",
"in",
"configuration",
"."
] | train | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/management/impl/PersistenceTypeConversion.java#L88-L106 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java | PathMetadataFactory.forMapAccess | public static <KT> PathMetadata forMapAccess(Path<?> parent, Expression<KT> key) {
"""
Create a new PathMetadata instance for key based map access
@param parent parent path
@param key key for map access
@return map access path
"""
return new PathMetadata(parent, key, PathType.MAPVALUE);
} | java | public static <KT> PathMetadata forMapAccess(Path<?> parent, Expression<KT> key) {
return new PathMetadata(parent, key, PathType.MAPVALUE);
} | [
"public",
"static",
"<",
"KT",
">",
"PathMetadata",
"forMapAccess",
"(",
"Path",
"<",
"?",
">",
"parent",
",",
"Expression",
"<",
"KT",
">",
"key",
")",
"{",
"return",
"new",
"PathMetadata",
"(",
"parent",
",",
"key",
",",
"PathType",
".",
"MAPVALUE",
... | Create a new PathMetadata instance for key based map access
@param parent parent path
@param key key for map access
@return map access path | [
"Create",
"a",
"new",
"PathMetadata",
"instance",
"for",
"key",
"based",
"map",
"access"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java#L97-L99 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java | Monitors.newTimer | public static Timer newTimer(String name, TimeUnit unit, TaggingContext context) {
"""
Create a new timer with a name and context. The returned timer will maintain separate
sub-monitors for each distinct set of tags returned from the context on an update operation.
"""
final MonitorConfig config = Monitor... | java | public static Timer newTimer(String name, TimeUnit unit, TaggingContext context) {
final MonitorConfig config = MonitorConfig.builder(name).build();
return new ContextualTimer(config, context, new TimerFactory(unit));
} | [
"public",
"static",
"Timer",
"newTimer",
"(",
"String",
"name",
",",
"TimeUnit",
"unit",
",",
"TaggingContext",
"context",
")",
"{",
"final",
"MonitorConfig",
"config",
"=",
"MonitorConfig",
".",
"builder",
"(",
"name",
")",
".",
"build",
"(",
")",
";",
"r... | Create a new timer with a name and context. The returned timer will maintain separate
sub-monitors for each distinct set of tags returned from the context on an update operation. | [
"Create",
"a",
"new",
"timer",
"with",
"a",
"name",
"and",
"context",
".",
"The",
"returned",
"timer",
"will",
"maintain",
"separate",
"sub",
"-",
"monitors",
"for",
"each",
"distinct",
"set",
"of",
"tags",
"returned",
"from",
"the",
"context",
"on",
"an",... | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java#L105-L108 |
tango-controls/JTango | server/src/main/java/org/tango/server/build/DevicePropertiesBuilder.java | DevicePropertiesBuilder.build | public void build(final Class<?> clazz, final Field field, final DeviceImpl device, final Object businessObject)
throws DevFailed {
"""
Create class properties {@link DeviceProperties}
@param clazz
@param field
@param device
@param businessObject
@throws DevFailed
"""
xlogger.entry();
// Inject e... | java | public void build(final Class<?> clazz, final Field field, final DeviceImpl device, final Object businessObject)
throws DevFailed {
xlogger.entry();
// Inject each device property
final String fieldName = field.getName();
logger.debug("Has a DeviceProperties : {}", fieldName);
BuilderUtils.checkStatic(field);... | [
"public",
"void",
"build",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"Field",
"field",
",",
"final",
"DeviceImpl",
"device",
",",
"final",
"Object",
"businessObject",
")",
"throws",
"DevFailed",
"{",
"xlogger",
".",
"entry",
"(",
")",
... | Create class properties {@link DeviceProperties}
@param clazz
@param field
@param device
@param businessObject
@throws DevFailed | [
"Create",
"class",
"properties",
"{",
"@link",
"DeviceProperties",
"}"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/build/DevicePropertiesBuilder.java#L62-L81 |
apache/spark | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java | UTF8String.copyUTF8String | private UTF8String copyUTF8String(int start, int end) {
"""
Copy the bytes from the current UTF8String, and make a new UTF8String.
@param start the start position of the current UTF8String in bytes.
@param end the end position of the current UTF8String in bytes.
@return a new UTF8String in the position of [star... | java | private UTF8String copyUTF8String(int start, int end) {
int len = end - start + 1;
byte[] newBytes = new byte[len];
copyMemory(base, offset + start, newBytes, BYTE_ARRAY_OFFSET, len);
return UTF8String.fromBytes(newBytes);
} | [
"private",
"UTF8String",
"copyUTF8String",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"len",
"=",
"end",
"-",
"start",
"+",
"1",
";",
"byte",
"[",
"]",
"newBytes",
"=",
"new",
"byte",
"[",
"len",
"]",
";",
"copyMemory",
"(",
"base",
"... | Copy the bytes from the current UTF8String, and make a new UTF8String.
@param start the start position of the current UTF8String in bytes.
@param end the end position of the current UTF8String in bytes.
@return a new UTF8String in the position of [start, end] of current UTF8String bytes. | [
"Copy",
"the",
"bytes",
"from",
"the",
"current",
"UTF8String",
"and",
"make",
"a",
"new",
"UTF8String",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L525-L530 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/security/BESecurityConfig.java | BESecurityConfig.toStream | public void toStream(boolean skipNonOverrides, OutputStream out)
throws Exception {
"""
Serialize to the given stream, closing it when finished. If
skipNonOverrides is true, any configuration whose values are all null
will not be written.
"""
PrintWriter writer = null;
try {
... | java | public void toStream(boolean skipNonOverrides, OutputStream out)
throws Exception {
PrintWriter writer = null;
try {
writer = new PrintWriter(new OutputStreamWriter(out, "UTF-8"));
write(skipNonOverrides, true, writer);
} finally {
try {
... | [
"public",
"void",
"toStream",
"(",
"boolean",
"skipNonOverrides",
",",
"OutputStream",
"out",
")",
"throws",
"Exception",
"{",
"PrintWriter",
"writer",
"=",
"null",
";",
"try",
"{",
"writer",
"=",
"new",
"PrintWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"o... | Serialize to the given stream, closing it when finished. If
skipNonOverrides is true, any configuration whose values are all null
will not be written. | [
"Serialize",
"to",
"the",
"given",
"stream",
"closing",
"it",
"when",
"finished",
".",
"If",
"skipNonOverrides",
"is",
"true",
"any",
"configuration",
"whose",
"values",
"are",
"all",
"null",
"will",
"not",
"be",
"written",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/security/BESecurityConfig.java#L440-L456 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleriesTab.java | CmsGalleriesTab.fillContent | public void fillContent(List<CmsGalleryFolderBean> galleryInfos, List<String> selectedGalleries) {
"""
Fill the content of the galleries tab panel.<p>
@param galleryInfos the gallery info beans
@param selectedGalleries the list of galleries to select
"""
clearList();
m_selectedGalleries = ... | java | public void fillContent(List<CmsGalleryFolderBean> galleryInfos, List<String> selectedGalleries) {
clearList();
m_selectedGalleries = selectedGalleries;
if (!galleryInfos.isEmpty()) {
for (CmsGalleryFolderBean galleryInfo : galleryInfos) {
m_galleries.put(galleryInfo... | [
"public",
"void",
"fillContent",
"(",
"List",
"<",
"CmsGalleryFolderBean",
">",
"galleryInfos",
",",
"List",
"<",
"String",
">",
"selectedGalleries",
")",
"{",
"clearList",
"(",
")",
";",
"m_selectedGalleries",
"=",
"selectedGalleries",
";",
"if",
"(",
"!",
"g... | Fill the content of the galleries tab panel.<p>
@param galleryInfos the gallery info beans
@param selectedGalleries the list of galleries to select | [
"Fill",
"the",
"content",
"of",
"the",
"galleries",
"tab",
"panel",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleriesTab.java#L315-L330 |
alkacon/opencms-core | src/org/opencms/jlan/CmsJlanDiskInterface.java | CmsJlanDiskInterface.internalCreateFile | protected NetworkFile internalCreateFile(
SrvSession session,
TreeConnection connection,
FileOpenParams params,
String typeName) throws IOException {
"""
Internal method for creating a new file.<p>
@param session the session
@param connection the tree connection
@param para... | java | protected NetworkFile internalCreateFile(
SrvSession session,
TreeConnection connection,
FileOpenParams params,
String typeName) throws IOException {
String path = params.getPath();
String cmsPath = getCmsPath(path);
try {
CmsObjectWrapper cm... | [
"protected",
"NetworkFile",
"internalCreateFile",
"(",
"SrvSession",
"session",
",",
"TreeConnection",
"connection",
",",
"FileOpenParams",
"params",
",",
"String",
"typeName",
")",
"throws",
"IOException",
"{",
"String",
"path",
"=",
"params",
".",
"getPath",
"(",
... | Internal method for creating a new file.<p>
@param session the session
@param connection the tree connection
@param params the parameters for opening the file
@param typeName the name of the resource type for the new file
@return a NetworkFile instance representing the newly created file
@throws IOException if somet... | [
"Internal",
"method",
"for",
"creating",
"a",
"new",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jlan/CmsJlanDiskInterface.java#L493-L519 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeJobExecution.java | RuntimeJobExecution.publishEvent | private void publishEvent(WSJobExecution execution, WSJobInstance jobInstance, BatchStatus batchStatus) {
"""
Helper method to publish execution data to appropriate topic per batchStatus
@param execution
@param jobInstance
@param batchStatus
"""
if (batchStatus == BatchStatus.FAILED) {
... | java | private void publishEvent(WSJobExecution execution, WSJobInstance jobInstance, BatchStatus batchStatus) {
if (batchStatus == BatchStatus.FAILED) {
publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_FAILED);
publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_FAILED);... | [
"private",
"void",
"publishEvent",
"(",
"WSJobExecution",
"execution",
",",
"WSJobInstance",
"jobInstance",
",",
"BatchStatus",
"batchStatus",
")",
"{",
"if",
"(",
"batchStatus",
"==",
"BatchStatus",
".",
"FAILED",
")",
"{",
"publishEvent",
"(",
"execution",
",",
... | Helper method to publish execution data to appropriate topic per batchStatus
@param execution
@param jobInstance
@param batchStatus | [
"Helper",
"method",
"to",
"publish",
"execution",
"data",
"to",
"appropriate",
"topic",
"per",
"batchStatus"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeJobExecution.java#L215-L235 |
CenturyLinkCloud/mdw | mdw-workflow/src/com/centurylink/mdw/workflow/activity/task/ManualTaskActivity.java | ManualTaskActivity.resumeWaiting | public final boolean resumeWaiting(InternalEvent event) throws ActivityException {
"""
This method is made final for the class, as it contains internal logic handling resumption
of waiting. It re-register the event waits including waiting for task to complete.
If any event has already arrived, it processes it im... | java | public final boolean resumeWaiting(InternalEvent event) throws ActivityException {
boolean done;
EventWaitInstance received;
try {
received = getEngine().createEventWaitInstance(getActivityInstanceId(), getWaitEvent(), null, true, false);
if (received == null)
... | [
"public",
"final",
"boolean",
"resumeWaiting",
"(",
"InternalEvent",
"event",
")",
"throws",
"ActivityException",
"{",
"boolean",
"done",
";",
"EventWaitInstance",
"received",
";",
"try",
"{",
"received",
"=",
"getEngine",
"(",
")",
".",
"createEventWaitInstance",
... | This method is made final for the class, as it contains internal logic handling resumption
of waiting. It re-register the event waits including waiting for task to complete.
If any event has already arrived, it processes it immediately.
Customization should be done with the methods {@link #processOtherMessage(String, ... | [
"This",
"method",
"is",
"made",
"final",
"for",
"the",
"class",
"as",
"it",
"contains",
"internal",
"logic",
"handling",
"resumption",
"of",
"waiting",
".",
"It",
"re",
"-",
"register",
"the",
"event",
"waits",
"including",
"waiting",
"for",
"task",
"to",
... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/src/com/centurylink/mdw/workflow/activity/task/ManualTaskActivity.java#L162-L181 |
structr/structr | structr-core/src/main/java/org/structr/schema/action/Function.java | Function.logParameterError | protected void logParameterError(final Object caller, final Object[] parameters, final boolean inJavaScriptContext) {
"""
Basic logging for functions called with wrong parameter count
@param caller The element that caused the error
@param parameters The function parameters
@param inJavaScriptContext Has the f... | java | protected void logParameterError(final Object caller, final Object[] parameters, final boolean inJavaScriptContext) {
logParameterError(caller, parameters, "Unsupported parameter combination/count in", inJavaScriptContext);
} | [
"protected",
"void",
"logParameterError",
"(",
"final",
"Object",
"caller",
",",
"final",
"Object",
"[",
"]",
"parameters",
",",
"final",
"boolean",
"inJavaScriptContext",
")",
"{",
"logParameterError",
"(",
"caller",
",",
"parameters",
",",
"\"Unsupported parameter... | Basic logging for functions called with wrong parameter count
@param caller The element that caused the error
@param parameters The function parameters
@param inJavaScriptContext Has the function been called from a JavaScript context? | [
"Basic",
"logging",
"for",
"functions",
"called",
"with",
"wrong",
"parameter",
"count"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/action/Function.java#L76-L78 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_user_userId_objectRight_objectRightId_GET | public OvhObjectRight serviceName_user_userId_objectRight_objectRightId_GET(String serviceName, Long userId, Long objectRightId) throws IOException {
"""
Get this object properties
REST: GET /dedicatedCloud/{serviceName}/user/{userId}/objectRight/{objectRightId}
@param serviceName [required] Domain of the serv... | java | public OvhObjectRight serviceName_user_userId_objectRight_objectRightId_GET(String serviceName, Long userId, Long objectRightId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/user/{userId}/objectRight/{objectRightId}";
StringBuilder sb = path(qPath, serviceName, userId, objectRightId);
String... | [
"public",
"OvhObjectRight",
"serviceName_user_userId_objectRight_objectRightId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"userId",
",",
"Long",
"objectRightId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/user/{userId}/obje... | Get this object properties
REST: GET /dedicatedCloud/{serviceName}/user/{userId}/objectRight/{objectRightId}
@param serviceName [required] Domain of the service
@param userId [required]
@param objectRightId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L686-L691 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.queryApp | public GetAppResponse queryApp(GetAppRequest request) {
"""
get detail of your app by name
@param request The request object containing all parameters for querying app.
@return the response
"""
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.g... | java | public GetAppResponse queryApp(GetAppRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getApp(), "The parameter app should NOT be null or empty string.");
InternalRequest internalRequest = createRequest(HttpMethodName.GET, request,... | [
"public",
"GetAppResponse",
"queryApp",
"(",
"GetAppRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getApp",
"(",
")",
",",
"\"The parameter app s... | get detail of your app by name
@param request The request object containing all parameters for querying app.
@return the response | [
"get",
"detail",
"of",
"your",
"app",
"by",
"name"
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L798-L804 |
drewwills/cernunnos | cernunnos-core/src/main/java/org/danann/cernunnos/runtime/ScriptRunner.java | ScriptRunner.evaluate | public Object evaluate(String location, TaskRequest req) {
"""
Invokes the script found at the specified location (file system or URL)
and returns the <code>RETURN_VALUE</code>.
@param location A file on the file system or a URL.
@param req A <code>TaskRequest</code> prepared externally.
@return The <code>RE... | java | public Object evaluate(String location, TaskRequest req) {
// Assertions.
if (location == null) {
String msg = "Argument 'location' cannot be null.";
throw new IllegalArgumentException(msg);
}
return evaluate(compileTask(location), req);
} | [
"public",
"Object",
"evaluate",
"(",
"String",
"location",
",",
"TaskRequest",
"req",
")",
"{",
"// Assertions.",
"if",
"(",
"location",
"==",
"null",
")",
"{",
"String",
"msg",
"=",
"\"Argument 'location' cannot be null.\"",
";",
"throw",
"new",
"IllegalArgumentE... | Invokes the script found at the specified location (file system or URL)
and returns the <code>RETURN_VALUE</code>.
@param location A file on the file system or a URL.
@param req A <code>TaskRequest</code> prepared externally.
@return The <code>RETURN_VALUE</code> of the specified task. | [
"Invokes",
"the",
"script",
"found",
"at",
"the",
"specified",
"location",
"(",
"file",
"system",
"or",
"URL",
")",
"and",
"returns",
"the",
"<code",
">",
"RETURN_VALUE<",
"/",
"code",
">",
"."
] | train | https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/runtime/ScriptRunner.java#L312-L322 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ValidationUtils.java | ValidationUtils.validate2NonNegative | public static int[] validate2NonNegative(int[] data, boolean allowSz1, String paramName) {
"""
Reformats the input array to a length 2 array and checks that all values are >= 0.
If the array is length 1, returns [a, a]
If the array is length 2, returns the array.
@param data An array
@param paramName The p... | java | public static int[] validate2NonNegative(int[] data, boolean allowSz1, String paramName) {
validateNonNegative(data, paramName);
return validate2(data, allowSz1, paramName);
} | [
"public",
"static",
"int",
"[",
"]",
"validate2NonNegative",
"(",
"int",
"[",
"]",
"data",
",",
"boolean",
"allowSz1",
",",
"String",
"paramName",
")",
"{",
"validateNonNegative",
"(",
"data",
",",
"paramName",
")",
";",
"return",
"validate2",
"(",
"data",
... | Reformats the input array to a length 2 array and checks that all values are >= 0.
If the array is length 1, returns [a, a]
If the array is length 2, returns the array.
@param data An array
@param paramName The param name, for error reporting
@return An int array of length 2 that represents the input | [
"Reformats",
"the",
"input",
"array",
"to",
"a",
"length",
"2",
"array",
"and",
"checks",
"that",
"all",
"values",
"are",
">",
"=",
"0",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ValidationUtils.java#L124-L127 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.listLocatedStatus | @Deprecated
public RemoteIterator<LocatedFileStatus> listLocatedStatus(final Path f)
throws FileNotFoundException, IOException {
"""
List the statuses of the files/directories in the given path if the path is
a directory.
Return the file's status and block locations If the path is a file.
If a returned st... | java | @Deprecated
public RemoteIterator<LocatedFileStatus> listLocatedStatus(final Path f)
throws FileNotFoundException, IOException {
return listLocatedStatus(f, DEFAULT_FILTER);
} | [
"@",
"Deprecated",
"public",
"RemoteIterator",
"<",
"LocatedFileStatus",
">",
"listLocatedStatus",
"(",
"final",
"Path",
"f",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"listLocatedStatus",
"(",
"f",
",",
"DEFAULT_FILTER",
")",
";",
... | List the statuses of the files/directories in the given path if the path is
a directory.
Return the file's status and block locations If the path is a file.
If a returned status is a file, it contains the file's block locations.
@param f is the path
@return an iterator that traverses statuses of the files/directorie... | [
"List",
"the",
"statuses",
"of",
"the",
"files",
"/",
"directories",
"in",
"the",
"given",
"path",
"if",
"the",
"path",
"is",
"a",
"directory",
".",
"Return",
"the",
"file",
"s",
"status",
"and",
"block",
"locations",
"If",
"the",
"path",
"is",
"a",
"f... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L1042-L1046 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/math/Fraction.java | Fraction.addSub | private Fraction addSub(final Fraction fraction, final boolean isAdd) {
"""
Implement add and subtract using algorithm described in Knuth 4.5.1.
@param fraction the fraction to subtract, must not be <code>null</code>
@param isAdd true to add, false to subtract
@return a <code>Fraction</code> instance with the... | java | private Fraction addSub(final Fraction fraction, final boolean isAdd) {
Validate.isTrue(fraction != null, "The fraction must not be null");
// zero is identity for addition.
if (numerator == 0) {
return isAdd ? fraction : fraction.negate();
}
if (fraction.numerator ==... | [
"private",
"Fraction",
"addSub",
"(",
"final",
"Fraction",
"fraction",
",",
"final",
"boolean",
"isAdd",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"fraction",
"!=",
"null",
",",
"\"The fraction must not be null\"",
")",
";",
"// zero is identity for addition.",
"if"... | Implement add and subtract using algorithm described in Knuth 4.5.1.
@param fraction the fraction to subtract, must not be <code>null</code>
@param isAdd true to add, false to subtract
@return a <code>Fraction</code> instance with the resulting values
@throws IllegalArgumentException if the fraction is <code>null</cod... | [
"Implement",
"add",
"and",
"subtract",
"using",
"algorithm",
"described",
"in",
"Knuth",
"4",
".",
"5",
".",
"1",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/math/Fraction.java#L735-L771 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java | FileWriter.appendLines | public <T> File appendLines(Collection<T> list) throws IORuntimeException {
"""
将列表写入文件,追加模式
@param <T> 集合元素类型
@param list 列表
@return 目标文件
@throws IORuntimeException IO异常
"""
return writeLines(list, true);
} | java | public <T> File appendLines(Collection<T> list) throws IORuntimeException {
return writeLines(list, true);
} | [
"public",
"<",
"T",
">",
"File",
"appendLines",
"(",
"Collection",
"<",
"T",
">",
"list",
")",
"throws",
"IORuntimeException",
"{",
"return",
"writeLines",
"(",
"list",
",",
"true",
")",
";",
"}"
] | 将列表写入文件,追加模式
@param <T> 集合元素类型
@param list 列表
@return 目标文件
@throws IORuntimeException IO异常 | [
"将列表写入文件,追加模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java#L169-L171 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectButtonStyle | private String buildSelectButtonStyle(String htmlAttributes, int selectedIndex) {
"""
Builds the html for a common button style select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@param selectedIndex the index of the selected option
@return the html for the common button... | java | private String buildSelectButtonStyle(String htmlAttributes, int selectedIndex) {
List<String> options = new ArrayList<String>(3);
options.add(key(Messages.GUI_PREF_BUTTONSTYLE_IMG_0));
options.add(key(Messages.GUI_PREF_BUTTONSTYLE_IMGTXT_0));
options.add(key(Messages.GUI_PREF_BUTTONSTY... | [
"private",
"String",
"buildSelectButtonStyle",
"(",
"String",
"htmlAttributes",
",",
"int",
"selectedIndex",
")",
"{",
"List",
"<",
"String",
">",
"options",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"3",
")",
";",
"options",
".",
"add",
"(",
"key"... | Builds the html for a common button style select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@param selectedIndex the index of the selected option
@return the html for the common button style select box | [
"Builds",
"the",
"html",
"for",
"a",
"common",
"button",
"style",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L2269-L2278 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java | XPathParser.parseItemType | private AbsFilter parseItemType() {
"""
Parses the the rule ItemType according to the following production rule:
<p>
[51] ItemType ::= AtomicType | KindTest | <"item" "(" ")"> .
</p>
@return filter
"""
AbsFilter filter;
if (isKindTest()) {
filter = parseKindTest();
} ... | java | private AbsFilter parseItemType() {
AbsFilter filter;
if (isKindTest()) {
filter = parseKindTest();
} else if (is("item", true)) {
consume(TokenType.OPEN_BR, true);
consume(TokenType.CLOSE_BR, true);
filter = new ItemFilter(getTransaction());
... | [
"private",
"AbsFilter",
"parseItemType",
"(",
")",
"{",
"AbsFilter",
"filter",
";",
"if",
"(",
"isKindTest",
"(",
")",
")",
"{",
"filter",
"=",
"parseKindTest",
"(",
")",
";",
"}",
"else",
"if",
"(",
"is",
"(",
"\"item\"",
",",
"true",
")",
")",
"{",... | Parses the the rule ItemType according to the following production rule:
<p>
[51] ItemType ::= AtomicType | KindTest | <"item" "(" ")"> .
</p>
@return filter | [
"Parses",
"the",
"the",
"rule",
"ItemType",
"according",
"to",
"the",
"following",
"production",
"rule",
":",
"<p",
">",
"[",
"51",
"]",
"ItemType",
"::",
"=",
"AtomicType",
"|",
"KindTest",
"|",
"<",
"item",
"(",
")",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java#L1398-L1413 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/linear/STGD.java | STGD.performUpdate | private void performUpdate(final Vec x, final double y, final double yHat) {
"""
Performs the sparse update of the weight vector
@param x the input vector
@param y the true value
@param yHat the predicted value
"""
for(IndexValue iv : x)
{
final int j = iv.getIndex();
... | java | private void performUpdate(final Vec x, final double y, final double yHat)
{
for(IndexValue iv : x)
{
final int j = iv.getIndex();
w.set(j,
T(w.get(j)+2*learningRate*(y-yHat)*iv.getValue(),
((time-t[j])/K)*gravity*learningRate,
... | [
"private",
"void",
"performUpdate",
"(",
"final",
"Vec",
"x",
",",
"final",
"double",
"y",
",",
"final",
"double",
"yHat",
")",
"{",
"for",
"(",
"IndexValue",
"iv",
":",
"x",
")",
"{",
"final",
"int",
"j",
"=",
"iv",
".",
"getIndex",
"(",
")",
";",... | Performs the sparse update of the weight vector
@param x the input vector
@param y the true value
@param yHat the predicted value | [
"Performs",
"the",
"sparse",
"update",
"of",
"the",
"weight",
"vector"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/STGD.java#L277-L289 |
knowm/Sundial | src/main/java/org/knowm/sundial/SundialJobScheduler.java | SundialJobScheduler.startJob | public static void startJob(String jobName, Map<String, Object> params)
throws SundialSchedulerException {
"""
Starts a Job matching the the given Job Name found in jobs.xml or jobs manually added.
@param jobName
"""
try {
JobDataMap jobDataMap = new JobDataMap();
for (String k... | java | public static void startJob(String jobName, Map<String, Object> params)
throws SundialSchedulerException {
try {
JobDataMap jobDataMap = new JobDataMap();
for (String key : params.keySet()) {
// logger.debug("key= " + key);
// logger.debug("value= " + pParams.get(key));
... | [
"public",
"static",
"void",
"startJob",
"(",
"String",
"jobName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"throws",
"SundialSchedulerException",
"{",
"try",
"{",
"JobDataMap",
"jobDataMap",
"=",
"new",
"JobDataMap",
"(",
")",
";",
"for"... | Starts a Job matching the the given Job Name found in jobs.xml or jobs manually added.
@param jobName | [
"Starts",
"a",
"Job",
"matching",
"the",
"the",
"given",
"Job",
"Name",
"found",
"in",
"jobs",
".",
"xml",
"or",
"jobs",
"manually",
"added",
"."
] | train | https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L299-L314 |
jsurfer/JsonSurfer | jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java | JsonSurfer.collectOne | @Deprecated
public Object collectOne(Reader reader, String... paths) {
"""
Collect the first matched value and stop parsing immediately
@param reader Json reader
@param paths JsonPath
@return Value
@deprecated use {@link #collectOne(InputStream, String...)} instead
"""
return collectOne(read... | java | @Deprecated
public Object collectOne(Reader reader, String... paths) {
return collectOne(reader, compile(paths));
} | [
"@",
"Deprecated",
"public",
"Object",
"collectOne",
"(",
"Reader",
"reader",
",",
"String",
"...",
"paths",
")",
"{",
"return",
"collectOne",
"(",
"reader",
",",
"compile",
"(",
"paths",
")",
")",
";",
"}"
] | Collect the first matched value and stop parsing immediately
@param reader Json reader
@param paths JsonPath
@return Value
@deprecated use {@link #collectOne(InputStream, String...)} instead | [
"Collect",
"the",
"first",
"matched",
"value",
"and",
"stop",
"parsing",
"immediately"
] | train | https://github.com/jsurfer/JsonSurfer/blob/52bd75a453338b86e115092803da140bf99cee62/jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java#L429-L432 |
before/quality-check | modules/quality-immutable-object/src/main/java/net/sf/qualitycheck/immutableobject/util/SourceCodeFormatter.java | SourceCodeFormatter.findDefaultProperties | @Nonnull
private static Properties findDefaultProperties() {
"""
Gets the default options to be passed when no custom properties are given.
@return properties with formatter options
"""
final InputStream in = SourceCodeFormatter.class.getClassLoader().getResourceAsStream(DEFAULT_PROPERTIES_PATH);
final... | java | @Nonnull
private static Properties findDefaultProperties() {
final InputStream in = SourceCodeFormatter.class.getClassLoader().getResourceAsStream(DEFAULT_PROPERTIES_PATH);
final Properties p = new Properties();
try {
p.load(in);
} catch (final IOException e) {
throw new RuntimeException(String.format("C... | [
"@",
"Nonnull",
"private",
"static",
"Properties",
"findDefaultProperties",
"(",
")",
"{",
"final",
"InputStream",
"in",
"=",
"SourceCodeFormatter",
".",
"class",
".",
"getClassLoader",
"(",
")",
".",
"getResourceAsStream",
"(",
"DEFAULT_PROPERTIES_PATH",
")",
";",
... | Gets the default options to be passed when no custom properties are given.
@return properties with formatter options | [
"Gets",
"the",
"default",
"options",
"to",
"be",
"passed",
"when",
"no",
"custom",
"properties",
"are",
"given",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-immutable-object/src/main/java/net/sf/qualitycheck/immutableobject/util/SourceCodeFormatter.java#L146-L156 |
GenesysPureEngage/authentication-client-java | src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java | AuthenticationApi.retrieveToken | public DefaultOAuth2AccessToken retrieveToken(String grantType, String accept, String authorization, String clientId, String password, String refreshToken, String scope, String username) throws ApiException {
"""
Retrieve access token
Retrieve an access token based on the grant type &mdash; Authorization Code... | java | public DefaultOAuth2AccessToken retrieveToken(String grantType, String accept, String authorization, String clientId, String password, String refreshToken, String scope, String username) throws ApiException {
ApiResponse<DefaultOAuth2AccessToken> resp = retrieveTokenWithHttpInfo(grantType, accept, authorization... | [
"public",
"DefaultOAuth2AccessToken",
"retrieveToken",
"(",
"String",
"grantType",
",",
"String",
"accept",
",",
"String",
"authorization",
",",
"String",
"clientId",
",",
"String",
"password",
",",
"String",
"refreshToken",
",",
"String",
"scope",
",",
"String",
... | Retrieve access token
Retrieve an access token based on the grant type &mdash; Authorization Code Grant, Resource Owner Password Credentials Grant or Client Credentials Grant. For more information, see [Token Endpoint](https://tools.ietf.org/html/rfc6749). **Note:** For the optional **scope** parameter, the Authent... | [
"Retrieve",
"access",
"token",
"Retrieve",
"an",
"access",
"token",
"based",
"on",
"the",
"grant",
"type",
"&",
";",
"mdash",
";",
"Authorization",
"Code",
"Grant",
"Resource",
"Owner",
"Password",
"Credentials",
"Grant",
"or",
"Client",
"Credentials",
"Grant... | train | https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java#L1049-L1052 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/servlet/ServletMapPrinterFactory.java | ServletMapPrinterFactory.setConfigurationFiles | public final void setConfigurationFiles(final Map<String, String> configurationFiles)
throws URISyntaxException {
"""
The setter for setting configuration file. It will convert the value to a URI.
@param configurationFiles the configuration file map.
"""
this.configurationFiles.clear();... | java | public final void setConfigurationFiles(final Map<String, String> configurationFiles)
throws URISyntaxException {
this.configurationFiles.clear();
this.configurationFileLastModifiedTimes.clear();
for (Map.Entry<String, String> entry: configurationFiles.entrySet()) {
if (!... | [
"public",
"final",
"void",
"setConfigurationFiles",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"configurationFiles",
")",
"throws",
"URISyntaxException",
"{",
"this",
".",
"configurationFiles",
".",
"clear",
"(",
")",
";",
"this",
".",
"configuratio... | The setter for setting configuration file. It will convert the value to a URI.
@param configurationFiles the configuration file map. | [
"The",
"setter",
"for",
"setting",
"configuration",
"file",
".",
"It",
"will",
"convert",
"the",
"value",
"to",
"a",
"URI",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/servlet/ServletMapPrinterFactory.java#L149-L165 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.wrapIfMissing | public static String wrapIfMissing(final String str, final String wrapWith) {
"""
<p>
Wraps a string with a string if that string is missing from the start or end of the given string.
</p>
<pre>
StringUtils.wrap(null, *) = null
StringUtils.wrap("", *) = ""
StringUtils.wrap("ab", null) ... | java | public static String wrapIfMissing(final String str, final String wrapWith) {
if (isEmpty(str) || isEmpty(wrapWith)) {
return str;
}
final StringBuilder builder = new StringBuilder(str.length() + wrapWith.length() + wrapWith.length());
if (!str.startsWith(wrapWith)) {
... | [
"public",
"static",
"String",
"wrapIfMissing",
"(",
"final",
"String",
"str",
",",
"final",
"String",
"wrapWith",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
"||",
"isEmpty",
"(",
"wrapWith",
")",
")",
"{",
"return",
"str",
";",
"}",
"final",
"Str... | <p>
Wraps a string with a string if that string is missing from the start or end of the given string.
</p>
<pre>
StringUtils.wrap(null, *) = null
StringUtils.wrap("", *) = ""
StringUtils.wrap("ab", null) = "ab"
StringUtils.wrap("ab", "x") = "xabx"
StringUtils.wrap("ab", "\"") = "\"ab\... | [
"<p",
">",
"Wraps",
"a",
"string",
"with",
"a",
"string",
"if",
"that",
"string",
"is",
"missing",
"from",
"the",
"start",
"or",
"end",
"of",
"the",
"given",
"string",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L9133-L9146 |
square/okhttp | okhttp/src/main/java/okhttp3/internal/http2/Http2Connection.java | Http2Connection.pushStream | public Http2Stream pushStream(int associatedStreamId, List<Header> requestHeaders, boolean out)
throws IOException {
"""
Returns a new server-initiated stream.
@param associatedStreamId the stream that triggered the sender to create this stream.
@param out true to create an output stream that we can use ... | java | public Http2Stream pushStream(int associatedStreamId, List<Header> requestHeaders, boolean out)
throws IOException {
if (client) throw new IllegalStateException("Client cannot push requests.");
return newStream(associatedStreamId, requestHeaders, out);
} | [
"public",
"Http2Stream",
"pushStream",
"(",
"int",
"associatedStreamId",
",",
"List",
"<",
"Header",
">",
"requestHeaders",
",",
"boolean",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"client",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Clien... | Returns a new server-initiated stream.
@param associatedStreamId the stream that triggered the sender to create this stream.
@param out true to create an output stream that we can use to send data to the remote peer.
Corresponds to {@code FLAG_FIN}. | [
"Returns",
"a",
"new",
"server",
"-",
"initiated",
"stream",
"."
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/http2/Http2Connection.java#L214-L218 |
atomix/atomix | utils/src/main/java/io/atomix/utils/concurrent/Threads.java | Threads.namedThreads | public static ThreadFactory namedThreads(String pattern, Logger log) {
"""
Returns a thread factory that produces threads named according to the
supplied name pattern.
@param pattern name pattern
@return thread factory
"""
return new ThreadFactoryBuilder()
.setNameFormat(pattern)
.setT... | java | public static ThreadFactory namedThreads(String pattern, Logger log) {
return new ThreadFactoryBuilder()
.setNameFormat(pattern)
.setThreadFactory(new AtomixThreadFactory())
.setUncaughtExceptionHandler((t, e) -> log.error("Uncaught exception on " + t.getName(), e))
.build();
} | [
"public",
"static",
"ThreadFactory",
"namedThreads",
"(",
"String",
"pattern",
",",
"Logger",
"log",
")",
"{",
"return",
"new",
"ThreadFactoryBuilder",
"(",
")",
".",
"setNameFormat",
"(",
"pattern",
")",
".",
"setThreadFactory",
"(",
"new",
"AtomixThreadFactory",... | Returns a thread factory that produces threads named according to the
supplied name pattern.
@param pattern name pattern
@return thread factory | [
"Returns",
"a",
"thread",
"factory",
"that",
"produces",
"threads",
"named",
"according",
"to",
"the",
"supplied",
"name",
"pattern",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/concurrent/Threads.java#L35-L41 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.