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 |
|---|---|---|---|---|---|---|---|---|---|---|
jbundle/webapp | upload-unjar/src/main/java/org/jbundle/util/webapp/upload/unjar/UploadServletUnjar.java | UploadServletUnjar.successfulFileUpload | public String successfulFileUpload(File file, Properties properties) {
"""
The file was uploaded successfully, return an HTML string to display.
NOTE: This is supplied to provide a convenient place to override this servlet and
do some processing or supply a different (or no) return string.
"""
String strHT... | java | public String successfulFileUpload(File file, Properties properties)
{
String strHTML = super.successfulFileUpload(file, properties);
strHTML = "<a href=\"/\">Home</a>" + RETURN + strHTML;
// Create a properties object to describe where to move these files
String strPath = file.getPath();
// May as well us... | [
"public",
"String",
"successfulFileUpload",
"(",
"File",
"file",
",",
"Properties",
"properties",
")",
"{",
"String",
"strHTML",
"=",
"super",
".",
"successfulFileUpload",
"(",
"file",
",",
"properties",
")",
";",
"strHTML",
"=",
"\"<a href=\\\"/\\\">Home</a>\"",
... | The file was uploaded successfully, return an HTML string to display.
NOTE: This is supplied to provide a convenient place to override this servlet and
do some processing or supply a different (or no) return string. | [
"The",
"file",
"was",
"uploaded",
"successfully",
"return",
"an",
"HTML",
"string",
"to",
"display",
".",
"NOTE",
":",
"This",
"is",
"supplied",
"to",
"provide",
"a",
"convenient",
"place",
"to",
"override",
"this",
"servlet",
"and",
"do",
"some",
"processin... | train | https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/upload-unjar/src/main/java/org/jbundle/util/webapp/upload/unjar/UploadServletUnjar.java#L53-L72 |
google/closure-templates | java/src/com/google/template/soy/sharedpasses/render/RenderException.java | RenderException.addStackTraceElement | RenderException addStackTraceElement(TemplateNode template, SourceLocation location) {
"""
Add a partial stack trace element by specifying the source location of the soy file.
"""
// Typically, this is fast since templates aren't that deep and we only do this in error
// situations so performance matte... | java | RenderException addStackTraceElement(TemplateNode template, SourceLocation location) {
// Typically, this is fast since templates aren't that deep and we only do this in error
// situations so performance matters less.
soyStackTrace.add(template.createStackTraceElement(location));
return this;
} | [
"RenderException",
"addStackTraceElement",
"(",
"TemplateNode",
"template",
",",
"SourceLocation",
"location",
")",
"{",
"// Typically, this is fast since templates aren't that deep and we only do this in error",
"// situations so performance matters less.",
"soyStackTrace",
".",
"add",
... | Add a partial stack trace element by specifying the source location of the soy file. | [
"Add",
"a",
"partial",
"stack",
"trace",
"element",
"by",
"specifying",
"the",
"source",
"location",
"of",
"the",
"soy",
"file",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/sharedpasses/render/RenderException.java#L83-L88 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/crf/CRFCliqueTree.java | CRFCliqueTree.condLogProbGivenPrevious | public double condLogProbGivenPrevious(int position, int label, int[] prevLabels) {
"""
Gives the probability of a tag at a single position conditioned on a
sequence of previous labels.
@param position
Index in sequence
@param label
Label of item at index
@param prevLabels
@return conditional log probabil... | java | public double condLogProbGivenPrevious(int position, int label, int[] prevLabels) {
if (prevLabels.length + 1 == windowSize) {
return factorTables[position].conditionalLogProbGivenPrevious(prevLabels, label);
} else if (prevLabels.length + 1 < windowSize) {
FactorTable ft = factorTables[position... | [
"public",
"double",
"condLogProbGivenPrevious",
"(",
"int",
"position",
",",
"int",
"label",
",",
"int",
"[",
"]",
"prevLabels",
")",
"{",
"if",
"(",
"prevLabels",
".",
"length",
"+",
"1",
"==",
"windowSize",
")",
"{",
"return",
"factorTables",
"[",
"posit... | Gives the probability of a tag at a single position conditioned on a
sequence of previous labels.
@param position
Index in sequence
@param label
Label of item at index
@param prevLabels
@return conditional log probability | [
"Gives",
"the",
"probability",
"of",
"a",
"tag",
"at",
"a",
"single",
"position",
"conditioned",
"on",
"a",
"sequence",
"of",
"previous",
"labels",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/crf/CRFCliqueTree.java#L396-L410 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_ssl_core.java | xen_health_ssl_core.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_health_ssl_core_responses result = (xen_health_ssl_core_responses) ... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_health_ssl_core_responses result = (xen_health_ssl_core_responses) service.get_payload_formatter().string_to_resource(xen_health_ssl_core_responses.class, response);
if(result.errorcode != 0)
{
... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_health_ssl_core_responses",
"result",
"=",
"(",
"xen_health_ssl_core_responses",
")",
"service",
".",
"ge... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_ssl_core.java#L256-L273 |
lightblue-platform/lightblue-migrator | facade/src/main/java/com/redhat/lightblue/migrator/facade/TimeoutConfiguration.java | TimeoutConfiguration.getSlowWarningMS | public long getSlowWarningMS(String methodName, FacadeOperation op) {
"""
See ${link
{@link TimeoutConfiguration#getMS(String, FacadeOperation, Type)}
@param methodName
@param op
@return
"""
return getMS(methodName, op, Type.slowwarning);
} | java | public long getSlowWarningMS(String methodName, FacadeOperation op) {
return getMS(methodName, op, Type.slowwarning);
} | [
"public",
"long",
"getSlowWarningMS",
"(",
"String",
"methodName",
",",
"FacadeOperation",
"op",
")",
"{",
"return",
"getMS",
"(",
"methodName",
",",
"op",
",",
"Type",
".",
"slowwarning",
")",
";",
"}"
] | See ${link
{@link TimeoutConfiguration#getMS(String, FacadeOperation, Type)}
@param methodName
@param op
@return | [
"See",
"$",
"{",
"link",
"{",
"@link",
"TimeoutConfiguration#getMS",
"(",
"String",
"FacadeOperation",
"Type",
")",
"}"
] | train | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/facade/src/main/java/com/redhat/lightblue/migrator/facade/TimeoutConfiguration.java#L181-L183 |
openCage/eightyfs | src/main/java/de/pfabulist/lindwurm/eighty/attributes/AttributeProvider.java | AttributeProvider.addIsLinkIfPossible | @SuppressWarnings( "PMD.CollapsibleIfStatements" )
private <V extends FileAttributeView> V addIsLinkIfPossible( Class<V> type, V fav ) {
"""
if the the FAV is actually a BasicFileAttributeView then there is an isLink method
if this is not already set and FAV implements LinkInfoSettable use it to add this link... | java | @SuppressWarnings( "PMD.CollapsibleIfStatements" )
private <V extends FileAttributeView> V addIsLinkIfPossible( Class<V> type, V fav ) {
if( BasicFileAttributeView.class.isAssignableFrom( type ) ) {
if( (! v( () -> BasicFileAttributeView.class.cast( fav ).readAttributes()).isSymbolicLink() )) {
... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.CollapsibleIfStatements\"",
")",
"private",
"<",
"V",
"extends",
"FileAttributeView",
">",
"V",
"addIsLinkIfPossible",
"(",
"Class",
"<",
"V",
">",
"type",
",",
"V",
"fav",
")",
"{",
"if",
"(",
"BasicFileAttributeView",
".",
... | if the the FAV is actually a BasicFileAttributeView then there is an isLink method
if this is not already set and FAV implements LinkInfoSettable use it to add this link info | [
"if",
"the",
"the",
"FAV",
"is",
"actually",
"a",
"BasicFileAttributeView",
"then",
"there",
"is",
"an",
"isLink",
"method",
"if",
"this",
"is",
"not",
"already",
"set",
"and",
"FAV",
"implements",
"LinkInfoSettable",
"use",
"it",
"to",
"add",
"this",
"link"... | train | https://github.com/openCage/eightyfs/blob/708ec4d336ee5e3dbd4196099f64091eaf6b3387/src/main/java/de/pfabulist/lindwurm/eighty/attributes/AttributeProvider.java#L106-L119 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java | Util.getOrGenerateMatchLabel | public static String getOrGenerateMatchLabel(QuerySolution row, boolean operationDiscovery) {
"""
Obtain or generate a label for the match result given a row resulting
from a query.
@param row the result from a SPARQL query
@param operationDiscovery true if we are doing operation discovery
@re... | java | public static String getOrGenerateMatchLabel(QuerySolution row, boolean operationDiscovery) {
String label;
if (operationDiscovery) {
label = getOrGenerateOperationLabel(row);
} else {
label = getOrGenerateServiceLabel(row);
}
return label;
} | [
"public",
"static",
"String",
"getOrGenerateMatchLabel",
"(",
"QuerySolution",
"row",
",",
"boolean",
"operationDiscovery",
")",
"{",
"String",
"label",
";",
"if",
"(",
"operationDiscovery",
")",
"{",
"label",
"=",
"getOrGenerateOperationLabel",
"(",
"row",
")",
"... | Obtain or generate a label for the match result given a row resulting
from a query.
@param row the result from a SPARQL query
@param operationDiscovery true if we are doing operation discovery
@return | [
"Obtain",
"or",
"generate",
"a",
"label",
"for",
"the",
"match",
"result",
"given",
"a",
"row",
"resulting",
"from",
"a",
"query",
"."
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java#L639-L647 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/FormatUtilities.java | FormatUtilities.getFormattedDateTime | static public String getFormattedDateTime(long dt, String format, TimeZone tz, String country) {
"""
Returns the given date formatted using the given format, timezone and country.
@param dt The date to be formatted
@param format The format to use to display the date
@param tz The timezone associated with the da... | java | static public String getFormattedDateTime(long dt, String format, TimeZone tz, String country)
{
return getFormattedDateTime(dt, format, tz, country, 0L);
} | [
"static",
"public",
"String",
"getFormattedDateTime",
"(",
"long",
"dt",
",",
"String",
"format",
",",
"TimeZone",
"tz",
",",
"String",
"country",
")",
"{",
"return",
"getFormattedDateTime",
"(",
"dt",
",",
"format",
",",
"tz",
",",
"country",
",",
"0L",
"... | Returns the given date formatted using the given format, timezone and country.
@param dt The date to be formatted
@param format The format to use to display the date
@param tz The timezone associated with the date
@param country The country associated with the date
@return The given date formatted using the given forma... | [
"Returns",
"the",
"given",
"date",
"formatted",
"using",
"the",
"given",
"format",
"timezone",
"and",
"country",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/FormatUtilities.java#L193-L196 |
sirthias/pegdown | src/main/java/org/pegdown/PegDownProcessor.java | PegDownProcessor.markdownToHtml | public String markdownToHtml(char[] markdownSource, LinkRenderer linkRenderer) {
"""
Converts the given markdown source to HTML.
If the input cannot be parsed within the configured parsing timeout the method returns null.
@param markdownSource the markdown source to convert
@param linkRenderer the LinkRendere... | java | public String markdownToHtml(char[] markdownSource, LinkRenderer linkRenderer) {
return markdownToHtml(markdownSource, linkRenderer, Collections.<String, VerbatimSerializer>emptyMap());
} | [
"public",
"String",
"markdownToHtml",
"(",
"char",
"[",
"]",
"markdownSource",
",",
"LinkRenderer",
"linkRenderer",
")",
"{",
"return",
"markdownToHtml",
"(",
"markdownSource",
",",
"linkRenderer",
",",
"Collections",
".",
"<",
"String",
",",
"VerbatimSerializer",
... | Converts the given markdown source to HTML.
If the input cannot be parsed within the configured parsing timeout the method returns null.
@param markdownSource the markdown source to convert
@param linkRenderer the LinkRenderer to use
@return the HTML | [
"Converts",
"the",
"given",
"markdown",
"source",
"to",
"HTML",
".",
"If",
"the",
"input",
"cannot",
"be",
"parsed",
"within",
"the",
"configured",
"parsing",
"timeout",
"the",
"method",
"returns",
"null",
"."
] | train | https://github.com/sirthias/pegdown/blob/19ca3d3d2bea5df19eb885260ab24f1200a16452/src/main/java/org/pegdown/PegDownProcessor.java#L152-L154 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java | CrystalBuilder.getUniqueInterfaces | public StructureInterfaceList getUniqueInterfaces(double cutoff) {
"""
Returns the list of unique interfaces that the given Structure has upon
generation of all crystal symmetry mates. An interface is defined as any pair of chains
that contact, i.e. for which there is at least a pair of atoms (one from each chai... | java | public StructureInterfaceList getUniqueInterfaces(double cutoff) {
StructureInterfaceList set = new StructureInterfaceList();
// certain structures in the PDB are not macromolecules (contain no polymeric chains at all), e.g. 1ao2
// with the current mmCIF parsing, those will be empty since purely non-polymeric... | [
"public",
"StructureInterfaceList",
"getUniqueInterfaces",
"(",
"double",
"cutoff",
")",
"{",
"StructureInterfaceList",
"set",
"=",
"new",
"StructureInterfaceList",
"(",
")",
";",
"// certain structures in the PDB are not macromolecules (contain no polymeric chains at all), e.g. 1ao2... | Returns the list of unique interfaces that the given Structure has upon
generation of all crystal symmetry mates. An interface is defined as any pair of chains
that contact, i.e. for which there is at least a pair of atoms (one from each chain) within
the given cutoff distance.
@param cutoff the distance cutoff for 2 c... | [
"Returns",
"the",
"list",
"of",
"unique",
"interfaces",
"that",
"the",
"given",
"Structure",
"has",
"upon",
"generation",
"of",
"all",
"crystal",
"symmetry",
"mates",
".",
"An",
"interface",
"is",
"defined",
"as",
"any",
"pair",
"of",
"chains",
"that",
"cont... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java#L211-L244 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java | ApplicationsInner.listByClusterAsync | public Observable<Page<ApplicationInner>> listByClusterAsync(final String resourceGroupName, final String clusterName) {
"""
Lists all of the applications for the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentExce... | java | public Observable<Page<ApplicationInner>> listByClusterAsync(final String resourceGroupName, final String clusterName) {
return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName)
.map(new Func1<ServiceResponse<Page<ApplicationInner>>, Page<ApplicationInner>>() {
@O... | [
"public",
"Observable",
"<",
"Page",
"<",
"ApplicationInner",
">",
">",
"listByClusterAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"clusterName",
")",
"{",
"return",
"listByClusterWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Lists all of the applications for the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<ApplicationInner> object | [
"Lists",
"all",
"of",
"the",
"applications",
"for",
"the",
"HDInsight",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java#L143-L151 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java | HandleHelper.handleRow | public static <T> T handleRow(int columnCount, ResultSetMetaData meta, ResultSet rs, T bean) throws SQLException {
"""
处理单条数据
@param columnCount 列数
@param meta ResultSetMetaData
@param rs 数据集
@param bean 目标Bean
@return 每一行的Entity
@throws SQLException SQL执行异常
@since 3.3.1
"""
return handleRow(column... | java | public static <T> T handleRow(int columnCount, ResultSetMetaData meta, ResultSet rs, T bean) throws SQLException {
return handleRow(columnCount, meta, rs).toBeanIgnoreCase(bean);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"handleRow",
"(",
"int",
"columnCount",
",",
"ResultSetMetaData",
"meta",
",",
"ResultSet",
"rs",
",",
"T",
"bean",
")",
"throws",
"SQLException",
"{",
"return",
"handleRow",
"(",
"columnCount",
",",
"meta",
",",
"rs... | 处理单条数据
@param columnCount 列数
@param meta ResultSetMetaData
@param rs 数据集
@param bean 目标Bean
@return 每一行的Entity
@throws SQLException SQL执行异常
@since 3.3.1 | [
"处理单条数据"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java#L41-L43 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.analyzeImageAsync | public Observable<ImageAnalysis> analyzeImageAsync(String url, AnalyzeImageOptionalParameter analyzeImageOptionalParameter) {
"""
This operation extracts a rich set of visual features based on the image content. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. Within your ... | java | public Observable<ImageAnalysis> analyzeImageAsync(String url, AnalyzeImageOptionalParameter analyzeImageOptionalParameter) {
return analyzeImageWithServiceResponseAsync(url, analyzeImageOptionalParameter).map(new Func1<ServiceResponse<ImageAnalysis>, ImageAnalysis>() {
@Override
public ... | [
"public",
"Observable",
"<",
"ImageAnalysis",
">",
"analyzeImageAsync",
"(",
"String",
"url",
",",
"AnalyzeImageOptionalParameter",
"analyzeImageOptionalParameter",
")",
"{",
"return",
"analyzeImageWithServiceResponseAsync",
"(",
"url",
",",
"analyzeImageOptionalParameter",
"... | This operation extracts a rich set of visual features based on the image content. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. Within your request, there is an optional parameter to allow you to choose which features to return. By default, image categories are returned in ... | [
"This",
"operation",
"extracts",
"a",
"rich",
"set",
"of",
"visual",
"features",
"based",
"on",
"the",
"image",
"content",
".",
"Two",
"input",
"methods",
"are",
"supported",
"--",
"(",
"1",
")",
"Uploading",
"an",
"image",
"or",
"(",
"2",
")",
"specifyi... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L2266-L2273 |
klarna/HiveRunner | src/main/java/com/klarna/hiverunner/HiveServerContainer.java | HiveServerContainer.init | public void init(Map<String, String> testConfig, Map<String, String> hiveVars) {
"""
Will start the HiveServer.
@param testConfig Specific test case properties. Will be merged with the HiveConf of the context
@param hiveVars HiveVars to pass on to the HiveServer for this session
"""
context.init... | java | public void init(Map<String, String> testConfig, Map<String, String> hiveVars) {
context.init();
HiveConf hiveConf = context.getHiveConf();
// merge test case properties with hive conf before HiveServer is started.
for (Map.Entry<String, String> property : testConfig.entrySet()) {
... | [
"public",
"void",
"init",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"testConfig",
",",
"Map",
"<",
"String",
",",
"String",
">",
"hiveVars",
")",
"{",
"context",
".",
"init",
"(",
")",
";",
"HiveConf",
"hiveConf",
"=",
"context",
".",
"getHiveConf... | Will start the HiveServer.
@param testConfig Specific test case properties. Will be merged with the HiveConf of the context
@param hiveVars HiveVars to pass on to the HiveServer for this session | [
"Will",
"start",
"the",
"HiveServer",
"."
] | train | https://github.com/klarna/HiveRunner/blob/c8899237db6122127f16e3d8a740c1f8657c2ae3/src/main/java/com/klarna/hiverunner/HiveServerContainer.java#L72-L108 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/DoubleArrayList.java | DoubleArrayList.partFromTo | public AbstractDoubleList partFromTo(int from, int to) {
"""
Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@param from the index of the first element (inclusive).
@param to the index of the last element (inclusive).
@return a new list
@exce... | java | public AbstractDoubleList partFromTo(int from, int to) {
if (size==0) return new DoubleArrayList(0);
checkRangeFromTo(from, to, size);
double[] part = new double[to-from+1];
System.arraycopy(elements, from, part, 0, to-from+1);
return new DoubleArrayList(part);
} | [
"public",
"AbstractDoubleList",
"partFromTo",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"return",
"new",
"DoubleArrayList",
"(",
"0",
")",
";",
"checkRangeFromTo",
"(",
"from",
",",
"to",
",",
"size",
")",
";",
... | Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@param from the index of the first element (inclusive).
@param to the index of the last element (inclusive).
@return a new list
@exception IndexOutOfBoundsException index is out of range (<tt>size()>0... | [
"Returns",
"a",
"new",
"list",
"of",
"the",
"part",
"of",
"the",
"receiver",
"between",
"<code",
">",
"from<",
"/",
"code",
">",
"inclusive",
"and",
"<code",
">",
"to<",
"/",
"code",
">",
"inclusive",
"."
] | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/DoubleArrayList.java#L279-L287 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java | ExpressRouteCircuitsInner.listRoutesTableSummary | public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
"""
Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
@param resourceGroupNam... | java | public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body();
... | [
"public",
"ExpressRouteCircuitsRoutesTableSummaryListResultInner",
"listRoutesTableSummary",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"peeringName",
",",
"String",
"devicePath",
")",
"{",
"return",
"listRoutesTableSummaryWithServiceResponse... | Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param peeringName The name of the peering.
@param devicePath The path of the device.
@thr... | [
"Gets",
"the",
"currently",
"advertised",
"routes",
"table",
"summary",
"associated",
"with",
"the",
"express",
"route",
"circuit",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java#L1238-L1240 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/normalize/SMSDNormalizer.java | SMSDNormalizer.getImplicitHydrogenCount | public static int getImplicitHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
"""
Returns The number of Implicit Hydrogen Count for a given IAtom.
@param atomContainer
@param atom
@return Implicit Hydrogen Count
"""
return atom.getImplicitHydrogenCount() == CDKConstants.UNSET ? 0 : atom.get... | java | public static int getImplicitHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
return atom.getImplicitHydrogenCount() == CDKConstants.UNSET ? 0 : atom.getImplicitHydrogenCount();
} | [
"public",
"static",
"int",
"getImplicitHydrogenCount",
"(",
"IAtomContainer",
"atomContainer",
",",
"IAtom",
"atom",
")",
"{",
"return",
"atom",
".",
"getImplicitHydrogenCount",
"(",
")",
"==",
"CDKConstants",
".",
"UNSET",
"?",
"0",
":",
"atom",
".",
"getImplic... | Returns The number of Implicit Hydrogen Count for a given IAtom.
@param atomContainer
@param atom
@return Implicit Hydrogen Count | [
"Returns",
"The",
"number",
"of",
"Implicit",
"Hydrogen",
"Count",
"for",
"a",
"given",
"IAtom",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/normalize/SMSDNormalizer.java#L203-L205 |
JodaOrg/joda-time | src/main/java/org/joda/time/chrono/GJDayOfWeekDateTimeField.java | GJDayOfWeekDateTimeField.getAsText | public String getAsText(int fieldValue, Locale locale) {
"""
Get the textual value of the specified time instant.
@param fieldValue the field value to query
@param locale the locale to use
@return the day of the week, such as 'Monday'
"""
return GJLocaleSymbols.forLocale(locale).dayOfWeekValueTo... | java | public String getAsText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToText(fieldValue);
} | [
"public",
"String",
"getAsText",
"(",
"int",
"fieldValue",
",",
"Locale",
"locale",
")",
"{",
"return",
"GJLocaleSymbols",
".",
"forLocale",
"(",
"locale",
")",
".",
"dayOfWeekValueToText",
"(",
"fieldValue",
")",
";",
"}"
] | Get the textual value of the specified time instant.
@param fieldValue the field value to query
@param locale the locale to use
@return the day of the week, such as 'Monday' | [
"Get",
"the",
"textual",
"value",
"of",
"the",
"specified",
"time",
"instant",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/GJDayOfWeekDateTimeField.java#L67-L69 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseScsrcolor | public static int cusparseScsrcolor(
cusparseHandle handle,
int m,
int nnz,
cusparseMatDescr descrA,
Pointer csrSortedValA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA,
Pointer fractionToColor,
Pointer ncolors,
Poi... | java | public static int cusparseScsrcolor(
cusparseHandle handle,
int m,
int nnz,
cusparseMatDescr descrA,
Pointer csrSortedValA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA,
Pointer fractionToColor,
Pointer ncolors,
Poi... | [
"public",
"static",
"int",
"cusparseScsrcolor",
"(",
"cusparseHandle",
"handle",
",",
"int",
"m",
",",
"int",
"nnz",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"csrSortedValA",
",",
"Pointer",
"csrSortedRowPtrA",
",",
"Pointer",
"csrSortedColIndA",
",",
"P... | Description: Find an approximate coloring of a matrix stored in CSR format. | [
"Description",
":",
"Find",
"an",
"approximate",
"coloring",
"of",
"a",
"matrix",
"stored",
"in",
"CSR",
"format",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L10716-L10731 |
dynjs/dynjs | src/main/java/org/dynjs/runtime/modules/FilesystemModuleProvider.java | FilesystemModuleProvider.findFile | protected File findFile(List<String> loadPaths, String moduleName) {
"""
Finds the module file based on the known load paths.
@param loadPaths the list of load paths to search
@param moduleName the name of the module to find
@return the File if found, else null
"""
String fileName = normalizeName(... | java | protected File findFile(List<String> loadPaths, String moduleName) {
String fileName = normalizeName(moduleName);
File file = new File( moduleName );
if ( file.isAbsolute() ) {
if ( file.exists() ) {
return file;
}
}
for (String loadPath : ... | [
"protected",
"File",
"findFile",
"(",
"List",
"<",
"String",
">",
"loadPaths",
",",
"String",
"moduleName",
")",
"{",
"String",
"fileName",
"=",
"normalizeName",
"(",
"moduleName",
")",
";",
"File",
"file",
"=",
"new",
"File",
"(",
"moduleName",
")",
";",
... | Finds the module file based on the known load paths.
@param loadPaths the list of load paths to search
@param moduleName the name of the module to find
@return the File if found, else null | [
"Finds",
"the",
"module",
"file",
"based",
"on",
"the",
"known",
"load",
"paths",
"."
] | train | https://github.com/dynjs/dynjs/blob/4bc6715eff8768f8cd92c6a167d621bbfc1e1a91/src/main/java/org/dynjs/runtime/modules/FilesystemModuleProvider.java#L64-L79 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray.join | public String join( String separator, boolean stripQuotes ) {
"""
Make a string from the contents of this JSONArray. The
<code>separator</code> string is inserted between each element. Warning:
This method assumes that the data structure is acyclical.
@param separator A string that will be inserted between th... | java | public String join( String separator, boolean stripQuotes ) {
int len = size();
StringBuffer sb = new StringBuffer();
for( int i = 0; i < len; i += 1 ){
if( i > 0 ){
sb.append( separator );
}
String value = JSONUtils.valueToString( this.elements.get( i ) );
... | [
"public",
"String",
"join",
"(",
"String",
"separator",
",",
"boolean",
"stripQuotes",
")",
"{",
"int",
"len",
"=",
"size",
"(",
")",
";",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Make a string from the contents of this JSONArray. The
<code>separator</code> string is inserted between each element. Warning:
This method assumes that the data structure is acyclical.
@param separator A string that will be inserted between the elements.
@return a string.
@throws JSONException If the array contains a... | [
"Make",
"a",
"string",
"from",
"the",
"contents",
"of",
"this",
"JSONArray",
".",
"The",
"<code",
">",
"separator<",
"/",
"code",
">",
"string",
"is",
"inserted",
"between",
"each",
"element",
".",
"Warning",
":",
"This",
"method",
"assumes",
"that",
"the"... | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L1911-L1923 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/IOUtil.java | IOUtil.pump | public static ByteArrayOutputStream2 pump(InputStream is, boolean closeIn) throws IOException {
"""
Reads data from <code>is</code> and writes it into an instanceof {@link ByteArrayOutputStream2}.<br>
@param is inputstream from which data is read
@param closeIn close inputstream or not
@return ... | java | public static ByteArrayOutputStream2 pump(InputStream is, boolean closeIn) throws IOException{
return pump(is, new ByteArrayOutputStream2(), closeIn, true);
} | [
"public",
"static",
"ByteArrayOutputStream2",
"pump",
"(",
"InputStream",
"is",
",",
"boolean",
"closeIn",
")",
"throws",
"IOException",
"{",
"return",
"pump",
"(",
"is",
",",
"new",
"ByteArrayOutputStream2",
"(",
")",
",",
"closeIn",
",",
"true",
")",
";",
... | Reads data from <code>is</code> and writes it into an instanceof {@link ByteArrayOutputStream2}.<br>
@param is inputstream from which data is read
@param closeIn close inputstream or not
@return the instance of {@link ByteArrayOutputStream2} into which data is written
@throws IOException if an I/O er... | [
"Reads",
"data",
"from",
"<code",
">",
"is<",
"/",
"code",
">",
"and",
"writes",
"it",
"into",
"an",
"instanceof",
"{",
"@link",
"ByteArrayOutputStream2",
"}",
".",
"<br",
">"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/IOUtil.java#L100-L102 |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/PropertyConnectionCalculator.java | PropertyConnectionCalculator.deleteTemporaryProperties | private void deleteTemporaryProperties(Map<String, Set<String>> map) {
"""
Iterates over the map entries and removes all temporary properties so that a clean map can be returned to the
user which is interested in the property connections.
"""
Iterator<String> iterator = map.keySet().iterator();
... | java | private void deleteTemporaryProperties(Map<String, Set<String>> map) {
Iterator<String> iterator = map.keySet().iterator();
while (iterator.hasNext()) {
String key = iterator.next();
if (isTemporaryProperty(key)) {
LOGGER.debug("Delete temporary field {} from the ... | [
"private",
"void",
"deleteTemporaryProperties",
"(",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"map",
")",
"{",
"Iterator",
"<",
"String",
">",
"iterator",
"=",
"map",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
... | Iterates over the map entries and removes all temporary properties so that a clean map can be returned to the
user which is interested in the property connections. | [
"Iterates",
"over",
"the",
"map",
"entries",
"and",
"removes",
"all",
"temporary",
"properties",
"so",
"that",
"a",
"clean",
"map",
"can",
"be",
"returned",
"to",
"the",
"user",
"which",
"is",
"interested",
"in",
"the",
"property",
"connections",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/PropertyConnectionCalculator.java#L144-L153 |
elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/AbstractMTree.java | AbstractMTree.getSortedEntries | protected final List<DoubleIntPair> getSortedEntries(N node, DBID q) {
"""
Sorts the entries of the specified node according to their minimum distance
to the specified object.
@param node the node
@param q the id of the object
@return a list of the sorted entries
"""
List<DoubleIntPair> result = new ... | java | protected final List<DoubleIntPair> getSortedEntries(N node, DBID q) {
List<DoubleIntPair> result = new ArrayList<>();
for(int i = 0; i < node.getNumEntries(); i++) {
E entry = node.getEntry(i);
double distance = distance(entry.getRoutingObjectID(), q);
double radius = entry.getCoveringRadius... | [
"protected",
"final",
"List",
"<",
"DoubleIntPair",
">",
"getSortedEntries",
"(",
"N",
"node",
",",
"DBID",
"q",
")",
"{",
"List",
"<",
"DoubleIntPair",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";... | Sorts the entries of the specified node according to their minimum distance
to the specified object.
@param node the node
@param q the id of the object
@return a list of the sorted entries | [
"Sorts",
"the",
"entries",
"of",
"the",
"specified",
"node",
"according",
"to",
"their",
"minimum",
"distance",
"to",
"the",
"specified",
"object",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/AbstractMTree.java#L221-L235 |
h2oai/h2o-3 | h2o-core/src/main/java/water/ExternalFrameWriterBackend.java | ExternalFrameWriterBackend.handleWriteToChunk | static void handleWriteToChunk(ByteChannel sock, AutoBuffer ab) throws IOException {
"""
Internal method use on the h2o backend side to handle writing to the chunk from non-h2o environment
@param sock socket channel originating from non-h2o node
@param ab {@link AutoBuffer} containing information necessary for p... | java | static void handleWriteToChunk(ByteChannel sock, AutoBuffer ab) throws IOException {
String frameKey = ab.getStr();
byte[] expectedTypes = ab.getA1();
if( expectedTypes == null){
throw new RuntimeException("Expected types can't be null.");
}
int[] maxVecSizes = ab.getA4... | [
"static",
"void",
"handleWriteToChunk",
"(",
"ByteChannel",
"sock",
",",
"AutoBuffer",
"ab",
")",
"throws",
"IOException",
"{",
"String",
"frameKey",
"=",
"ab",
".",
"getStr",
"(",
")",
";",
"byte",
"[",
"]",
"expectedTypes",
"=",
"ab",
".",
"getA1",
"(",
... | Internal method use on the h2o backend side to handle writing to the chunk from non-h2o environment
@param sock socket channel originating from non-h2o node
@param ab {@link AutoBuffer} containing information necessary for preparing backend for writing | [
"Internal",
"method",
"use",
"on",
"the",
"h2o",
"backend",
"side",
"to",
"handle",
"writing",
"to",
"the",
"chunk",
"from",
"non",
"-",
"h2o",
"environment"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/ExternalFrameWriterBackend.java#L20-L86 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/MonitoringAspect.java | MonitoringAspect.doProfilingClass | @Around (value = "execution(* (@(@net.anotheria.moskito.aop.annotation.Monitor *) *).*(..)) && !@annotation(net.anotheria.moskito.aop.annotation.DontMonitor)")
public Object doProfilingClass(final ProceedingJoinPoint pjp) throws Throwable {
"""
Special class profiling entry-point, which allow to fetch {@link Moni... | java | @Around (value = "execution(* (@(@net.anotheria.moskito.aop.annotation.Monitor *) *).*(..)) && !@annotation(net.anotheria.moskito.aop.annotation.DontMonitor)")
public Object doProfilingClass(final ProceedingJoinPoint pjp) throws Throwable {
return doProfilingClass(pjp, resolveAnnotation(pjp));
} | [
"@",
"Around",
"(",
"value",
"=",
"\"execution(* (@(@net.anotheria.moskito.aop.annotation.Monitor *) *).*(..)) && !@annotation(net.anotheria.moskito.aop.annotation.DontMonitor)\"",
")",
"public",
"Object",
"doProfilingClass",
"(",
"final",
"ProceedingJoinPoint",
"pjp",
")",
"throws",
... | Special class profiling entry-point, which allow to fetch {@link Monitor} from one lvl up of class annotation.
Pattern will pre-select 2-nd lvl annotation on class scope.
@param pjp
{@link ProceedingJoinPoint}
@return call result
@throws Throwable
in case of error during {@link ProceedingJoinPoint#proceed()} | [
"Special",
"class",
"profiling",
"entry",
"-",
"point",
"which",
"allow",
"to",
"fetch",
"{",
"@link",
"Monitor",
"}",
"from",
"one",
"lvl",
"up",
"of",
"class",
"annotation",
".",
"Pattern",
"will",
"pre",
"-",
"select",
"2",
"-",
"nd",
"lvl",
"annotati... | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/MonitoringAspect.java#L82-L85 |
Appendium/objectlabkit | utils/src/main/java/net/objectlab/kit/util/StringUtil.java | StringUtil.equalsIgnoreCaseOrValueIsWildcard | public static boolean equalsIgnoreCaseOrValueIsWildcard(final String value, final String toCheck) {
"""
Does equalsIgnoreCase call but if the value is '*', immediately returns true.
"""
if (value == null && toCheck == null) {
return true;
}
if (value != null && StringUti... | java | public static boolean equalsIgnoreCaseOrValueIsWildcard(final String value, final String toCheck) {
if (value == null && toCheck == null) {
return true;
}
if (value != null && StringUtil.WILDCARD.equals(value)) {
return true;
}
if (value != null && ... | [
"public",
"static",
"boolean",
"equalsIgnoreCaseOrValueIsWildcard",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"toCheck",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"&&",
"toCheck",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"... | Does equalsIgnoreCase call but if the value is '*', immediately returns true. | [
"Does",
"equalsIgnoreCase",
"call",
"but",
"if",
"the",
"value",
"is",
"*",
"immediately",
"returns",
"true",
"."
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/util/StringUtil.java#L577-L588 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_domain_GET | public ArrayList<String> organizationName_service_exchangeService_domain_GET(String organizationName, String exchangeService, Boolean main, OvhObjectStateEnum state) throws IOException {
"""
Domains associated to this service
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/domain
@param ... | java | public ArrayList<String> organizationName_service_exchangeService_domain_GET(String organizationName, String exchangeService, Boolean main, OvhObjectStateEnum state) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/domain";
StringBuilder sb = path(qPath, organization... | [
"public",
"ArrayList",
"<",
"String",
">",
"organizationName_service_exchangeService_domain_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"Boolean",
"main",
",",
"OvhObjectStateEnum",
"state",
")",
"throws",
"IOException",
"{",
"String",
... | Domains associated to this service
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/domain
@param main [required] Filter the value of main property (like)
@param state [required] Filter the value of state property (=)
@param organizationName [required] The internal name of your exchange organizat... | [
"Domains",
"associated",
"to",
"this",
"service"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L422-L429 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/BeanUtil.java | BeanUtil.getSetterMethod | public static Method getSetterMethod(Class<?> beanClass, String property) {
"""
Returns setter method for <code>property</code> in specified <code>beanClass</code>
@param beanClass bean class
@param property name of the property
@return setter method. null if <code>property</code> is not found, or it is re... | java | public static Method getSetterMethod(Class<?> beanClass, String property){
Method getter = getGetterMethod(beanClass, property);
if(getter==null)
return null;
else
return getSetterMethod(beanClass, property, getter.getReturnType());
} | [
"public",
"static",
"Method",
"getSetterMethod",
"(",
"Class",
"<",
"?",
">",
"beanClass",
",",
"String",
"property",
")",
"{",
"Method",
"getter",
"=",
"getGetterMethod",
"(",
"beanClass",
",",
"property",
")",
";",
"if",
"(",
"getter",
"==",
"null",
")",... | Returns setter method for <code>property</code> in specified <code>beanClass</code>
@param beanClass bean class
@param property name of the property
@return setter method. null if <code>property</code> is not found, or it is readonly property
@see #getSetterMethod(Class, String, Class) | [
"Returns",
"setter",
"method",
"for",
"<code",
">",
"property<",
"/",
"code",
">",
"in",
"specified",
"<code",
">",
"beanClass<",
"/",
"code",
">"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/BeanUtil.java#L146-L152 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/search/LocalSearch.java | LocalSearch.updateCurrentAndBestSolution | protected boolean updateCurrentAndBestSolution(SolutionType solution, Evaluation evaluation, Validation validation) {
"""
Update the current and best solution during search, given that the respective solution has already
been evaluated and validated. The current solution is always updated, also if it is invalid. ... | java | protected boolean updateCurrentAndBestSolution(SolutionType solution, Evaluation evaluation, Validation validation){
// update current solution
updateCurrentSolution(solution, evaluation, validation);
// update best solution (only updates if solution is valid)
return updateBestSolution(s... | [
"protected",
"boolean",
"updateCurrentAndBestSolution",
"(",
"SolutionType",
"solution",
",",
"Evaluation",
"evaluation",
",",
"Validation",
"validation",
")",
"{",
"// update current solution",
"updateCurrentSolution",
"(",
"solution",
",",
"evaluation",
",",
"validation",... | Update the current and best solution during search, given that the respective solution has already
been evaluated and validated. The current solution is always updated, also if it is invalid. Conversely,
the best solution is only updated if the given solution is valid and improves over the best solution
found so far.
... | [
"Update",
"the",
"current",
"and",
"best",
"solution",
"during",
"search",
"given",
"that",
"the",
"respective",
"solution",
"has",
"already",
"been",
"evaluated",
"and",
"validated",
".",
"The",
"current",
"solution",
"is",
"always",
"updated",
"also",
"if",
... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/LocalSearch.java#L278-L283 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.getDataLakeStoreAccount | public DataLakeStoreAccountInfoInner getDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName) {
"""
Gets the specified Data Lake Store account details in the specified Data Lake Analytics account.
@param resourceGroupName The name of the Azure resource group that co... | java | public DataLakeStoreAccountInfoInner getDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName) {
return getDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).toBlocking().single().body();
} | [
"public",
"DataLakeStoreAccountInfoInner",
"getDataLakeStoreAccount",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"dataLakeStoreAccountName",
")",
"{",
"return",
"getDataLakeStoreAccountWithServiceResponseAsync",
"(",
"resourceGroupName",
",",... | Gets the specified Data Lake Store account details in the specified Data Lake Analytics account.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account... | [
"Gets",
"the",
"specified",
"Data",
"Lake",
"Store",
"account",
"details",
"in",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L947-L949 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoProcessingBase.java | StereoProcessingBase.computeHomo3D | public void computeHomo3D(double x, double y, Point3D_F64 pointLeft) {
"""
Given a coordinate of a point in the left rectified frame, compute the point's 3D
coordinate in the camera's reference frame in homogeneous coordinates. To convert the coordinate
into normal 3D, divide each element by the disparity.
@p... | java | public void computeHomo3D(double x, double y, Point3D_F64 pointLeft) {
// Coordinate in rectified camera frame
pointRect.z = baseline*fx;
pointRect.x = pointRect.z*(x - cx)/fx;
pointRect.y = pointRect.z*(y - cy)/fy;
// rotate into the original left camera frame
GeometryMath_F64.multTran(rectR,pointRect,poi... | [
"public",
"void",
"computeHomo3D",
"(",
"double",
"x",
",",
"double",
"y",
",",
"Point3D_F64",
"pointLeft",
")",
"{",
"// Coordinate in rectified camera frame",
"pointRect",
".",
"z",
"=",
"baseline",
"*",
"fx",
";",
"pointRect",
".",
"x",
"=",
"pointRect",
".... | Given a coordinate of a point in the left rectified frame, compute the point's 3D
coordinate in the camera's reference frame in homogeneous coordinates. To convert the coordinate
into normal 3D, divide each element by the disparity.
@param x x-coordinate of pixel in rectified left image
@param y y-coordinate of pixel ... | [
"Given",
"a",
"coordinate",
"of",
"a",
"point",
"in",
"the",
"left",
"rectified",
"frame",
"compute",
"the",
"point",
"s",
"3D",
"coordinate",
"in",
"the",
"camera",
"s",
"reference",
"frame",
"in",
"homogeneous",
"coordinates",
".",
"To",
"convert",
"the",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoProcessingBase.java#L147-L155 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java | CPDefinitionLinkPersistenceImpl.countByCP_T | @Override
public int countByCP_T(long CProductId, String type) {
"""
Returns the number of cp definition links where CProductId = ? and type = ?.
@param CProductId the c product ID
@param type the type
@return the number of matching cp definition links
"""
FinderPath finderPath = FINDER_PATH_CO... | java | @Override
public int countByCP_T(long CProductId, String type) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_CP_T;
Object[] finderArgs = new Object[] { CProductId, type };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBundler... | [
"@",
"Override",
"public",
"int",
"countByCP_T",
"(",
"long",
"CProductId",
",",
"String",
"type",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_CP_T",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{",
"CProductId",... | Returns the number of cp definition links where CProductId = ? and type = ?.
@param CProductId the c product ID
@param type the type
@return the number of matching cp definition links | [
"Returns",
"the",
"number",
"of",
"cp",
"definition",
"links",
"where",
"CProductId",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L3627-L3688 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/CorruptReplicasMap.java | CorruptReplicasMap.removeFromCorruptReplicasMap | boolean removeFromCorruptReplicasMap(Block blk, DatanodeDescriptor datanode) {
"""
Remove the block at the given datanode from CorruptBlockMap
@param blk block to be removed
@param datanode datanode where the block is located
@return true if the removal is successful;
false if the replica is not in the map
... | java | boolean removeFromCorruptReplicasMap(Block blk, DatanodeDescriptor datanode) {
Collection<DatanodeDescriptor> datanodes = corruptReplicasMap.get(blk);
if (datanodes==null)
return false;
if (datanodes.remove(datanode)) { // remove the replicas
if (datanodes.isEmpty()) {
// remove the bloc... | [
"boolean",
"removeFromCorruptReplicasMap",
"(",
"Block",
"blk",
",",
"DatanodeDescriptor",
"datanode",
")",
"{",
"Collection",
"<",
"DatanodeDescriptor",
">",
"datanodes",
"=",
"corruptReplicasMap",
".",
"get",
"(",
"blk",
")",
";",
"if",
"(",
"datanodes",
"==",
... | Remove the block at the given datanode from CorruptBlockMap
@param blk block to be removed
@param datanode datanode where the block is located
@return true if the removal is successful;
false if the replica is not in the map | [
"Remove",
"the",
"block",
"at",
"the",
"given",
"datanode",
"from",
"CorruptBlockMap"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/CorruptReplicasMap.java#L87-L99 |
JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.findToStringMethod | private Method findToStringMethod(Class<?> cls, String methodName) {
"""
Finds the conversion method.
@param cls the class to find a method for, not null
@param methodName the name of the method to find, not null
@return the method to call, null means use {@code toString}
"""
Method m;
... | java | private Method findToStringMethod(Class<?> cls, String methodName) {
Method m;
try {
m = cls.getMethod(methodName);
} catch (NoSuchMethodException ex) {
throw new IllegalArgumentException(ex);
}
if (Modifier.isStatic(m.getModifiers())) {
... | [
"private",
"Method",
"findToStringMethod",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"methodName",
")",
"{",
"Method",
"m",
";",
"try",
"{",
"m",
"=",
"cls",
".",
"getMethod",
"(",
"methodName",
")",
";",
"}",
"catch",
"(",
"NoSuchMethodExceptio... | Finds the conversion method.
@param cls the class to find a method for, not null
@param methodName the name of the method to find, not null
@return the method to call, null means use {@code toString} | [
"Finds",
"the",
"conversion",
"method",
"."
] | train | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L796-L807 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newCloneException | public static CloneException newCloneException(String message, Object... args) {
"""
Constructs and initializes a new {@link CloneException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link CloneException exception}.
... | java | public static CloneException newCloneException(String message, Object... args) {
return newCloneException(null, message, args);
} | [
"public",
"static",
"CloneException",
"newCloneException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newCloneException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link CloneException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link CloneException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@link Stri... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"CloneException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L271-L273 |
alkacon/opencms-core | src/org/opencms/util/CmsMacroResolver.java | CmsMacroResolver.localizedKeyMacro | public static String localizedKeyMacro(String keyName, Object[] params) {
"""
Returns a macro for the given localization key with the given parameters.<p>
@param keyName the name of the localized key
@param params the optional parameter array
@return a macro for the given localization key with the given par... | java | public static String localizedKeyMacro(String keyName, Object[] params) {
String parameters = "";
if ((params != null) && (params.length > 0)) {
for (int i = 0; i < params.length; i++) {
if (params[i] != null) {
parameters += "|" + params[i].toString();
... | [
"public",
"static",
"String",
"localizedKeyMacro",
"(",
"String",
"keyName",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"String",
"parameters",
"=",
"\"\"",
";",
"if",
"(",
"(",
"params",
"!=",
"null",
")",
"&&",
"(",
"params",
".",
"length",
">",
"0... | Returns a macro for the given localization key with the given parameters.<p>
@param keyName the name of the localized key
@param params the optional parameter array
@return a macro for the given localization key with the given parameters | [
"Returns",
"a",
"macro",
"for",
"the",
"given",
"localization",
"key",
"with",
"the",
"given",
"parameters",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsMacroResolver.java#L462-L479 |
wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getConfiguration | @Override
public Configuration getConfiguration(String prefix) {
"""
Gets a configuration object with all the properties starting with the given prefix.
@param prefix the prefix (without the ending `.`)
@return a configuration object with all properties with a name starting with `prefix.`,
or {@literal nu... | java | @Override
public Configuration getConfiguration(String prefix) {
try {
Config value = configuration.getConfig(prefix);
return new ConfigurationImpl(converters, value);
} catch (ConfigException.Missing e) {
// Ignore the exception.
return null;
... | [
"@",
"Override",
"public",
"Configuration",
"getConfiguration",
"(",
"String",
"prefix",
")",
"{",
"try",
"{",
"Config",
"value",
"=",
"configuration",
".",
"getConfig",
"(",
"prefix",
")",
";",
"return",
"new",
"ConfigurationImpl",
"(",
"converters",
",",
"va... | Gets a configuration object with all the properties starting with the given prefix.
@param prefix the prefix (without the ending `.`)
@return a configuration object with all properties with a name starting with `prefix.`,
or {@literal null} if no properties start with the given prefix. | [
"Gets",
"a",
"configuration",
"object",
"with",
"all",
"the",
"properties",
"starting",
"with",
"the",
"given",
"prefix",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L455-L464 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/listeners/OnBindViewHolderListenerImpl.java | OnBindViewHolderListenerImpl.onViewDetachedFromWindow | @Override
public void onViewDetachedFromWindow(RecyclerView.ViewHolder viewHolder, int position) {
"""
is called in onViewDetachedFromWindow when the view is detached from the window
@param viewHolder the viewHolder for the type at this position
@param position the position of this viewHolder
"""
... | java | @Override
public void onViewDetachedFromWindow(RecyclerView.ViewHolder viewHolder, int position) {
IItem item = FastAdapter.getHolderAdapterItemTag(viewHolder);
if (item != null) {
item.detachFromWindow(viewHolder);
if (viewHolder instanceof FastAdapter.ViewHolder) {
... | [
"@",
"Override",
"public",
"void",
"onViewDetachedFromWindow",
"(",
"RecyclerView",
".",
"ViewHolder",
"viewHolder",
",",
"int",
"position",
")",
"{",
"IItem",
"item",
"=",
"FastAdapter",
".",
"getHolderAdapterItemTag",
"(",
"viewHolder",
")",
";",
"if",
"(",
"i... | is called in onViewDetachedFromWindow when the view is detached from the window
@param viewHolder the viewHolder for the type at this position
@param position the position of this viewHolder | [
"is",
"called",
"in",
"onViewDetachedFromWindow",
"when",
"the",
"view",
"is",
"detached",
"from",
"the",
"window"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/listeners/OnBindViewHolderListenerImpl.java#L87-L96 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java | EnhanceImageOps.applyTransform | public static void applyTransform(GrayS8 input , int transform[] , int minValue, GrayS8 output ) {
"""
Applies the transformation table to the provided input image.
@param input Input image.
@param minValue Minimum possible pixel value.
@param transform Input transformation table.
@param output Output image.... | java | public static void applyTransform(GrayS8 input , int transform[] , int minValue, GrayS8 output ) {
output.reshape(input.width,input.height);
if( BoofConcurrency.USE_CONCURRENT ) {
ImplEnhanceHistogram_MT.applyTransform(input, transform, minValue, output);
} else {
ImplEnhanceHistogram.applyTransform(input,... | [
"public",
"static",
"void",
"applyTransform",
"(",
"GrayS8",
"input",
",",
"int",
"transform",
"[",
"]",
",",
"int",
"minValue",
",",
"GrayS8",
"output",
")",
"{",
"output",
".",
"reshape",
"(",
"input",
".",
"width",
",",
"input",
".",
"height",
")",
... | Applies the transformation table to the provided input image.
@param input Input image.
@param minValue Minimum possible pixel value.
@param transform Input transformation table.
@param output Output image. | [
"Applies",
"the",
"transformation",
"table",
"to",
"the",
"provided",
"input",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java#L121-L129 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java | AlignmentTools.alignmentAsMap | public static Map<Integer, Integer> alignmentAsMap(AFPChain afpChain) throws StructureException {
"""
Creates a Map specifying the alignment as a mapping between residue indices
of protein 1 and residue indices of protein 2.
<p>For example,<pre>
1234
5678</pre>
becomes<pre>
1->5
2->6
3->7
4->8</pre>
... | java | public static Map<Integer, Integer> alignmentAsMap(AFPChain afpChain) throws StructureException {
Map<Integer,Integer> map = new HashMap<Integer,Integer>();
if( afpChain.getAlnLength() < 1 ) {
return map;
}
int[][][] optAln = afpChain.getOptAln();
int[] optLen = afpChain.getOptLen();
for(int block = 0; ... | [
"public",
"static",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"alignmentAsMap",
"(",
"AFPChain",
"afpChain",
")",
"throws",
"StructureException",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"map",
"=",
"new",
"HashMap",
"<",
"Integer",
",",
"Integer",... | Creates a Map specifying the alignment as a mapping between residue indices
of protein 1 and residue indices of protein 2.
<p>For example,<pre>
1234
5678</pre>
becomes<pre>
1->5
2->6
3->7
4->8</pre>
@param afpChain An alignment
@return A mapping from aligned residues of protein 1 to their partners in protein 2.
@thro... | [
"Creates",
"a",
"Map",
"specifying",
"the",
"alignment",
"as",
"a",
"mapping",
"between",
"residue",
"indices",
"of",
"protein",
"1",
"and",
"residue",
"indices",
"of",
"protein",
"2",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L159-L178 |
tvesalainen/util | util/src/main/java/org/vesalainen/lang/Primitives.java | Primitives.writeInt | public static final void writeInt(int value, byte[] array, int offset) {
"""
Write value to byte array
@param value
@param array
@param offset
@see java.nio.ByteBuffer#putInt(int)
"""
if (array.length < offset + 4)
{
throw new IllegalArgumentException("no room in array");
... | java | public static final void writeInt(int value, byte[] array, int offset)
{
if (array.length < offset + 4)
{
throw new IllegalArgumentException("no room in array");
}
array[offset] = (byte) (value >> 24);
array[offset + 1] = (byte) ((value >> 16) & 0xff);
... | [
"public",
"static",
"final",
"void",
"writeInt",
"(",
"int",
"value",
",",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"array",
".",
"length",
"<",
"offset",
"+",
"4",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",... | Write value to byte array
@param value
@param array
@param offset
@see java.nio.ByteBuffer#putInt(int) | [
"Write",
"value",
"to",
"byte",
"array"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/lang/Primitives.java#L330-L340 |
alkacon/opencms-core | src/org/opencms/relations/CmsCategoryService.java | CmsCategoryService.createCategory | public CmsCategory createCategory(
CmsObject cms,
CmsCategory parent,
String name,
String title,
String description,
String referencePath)
throws CmsException {
"""
Creates a new category.<p>
Will use the same category repository as the parent if specified,
o... | java | public CmsCategory createCategory(
CmsObject cms,
CmsCategory parent,
String name,
String title,
String description,
String referencePath)
throws CmsException {
List<CmsProperty> properties = new ArrayList<CmsProperty>();
if (CmsStringUtil.isNotEmptyO... | [
"public",
"CmsCategory",
"createCategory",
"(",
"CmsObject",
"cms",
",",
"CmsCategory",
"parent",
",",
"String",
"name",
",",
"String",
"title",
",",
"String",
"description",
",",
"String",
"referencePath",
")",
"throws",
"CmsException",
"{",
"List",
"<",
"CmsPr... | Creates a new category.<p>
Will use the same category repository as the parent if specified,
or the closest category repository to the reference path if specified,
or the centralized category repository in all other cases.<p>
@param cms the current cms context
@param parent the parent category or <code>null</code> fo... | [
"Creates",
"a",
"new",
"category",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsCategoryService.java#L193-L232 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/AbstractUserArgumentProcessor.java | AbstractUserArgumentProcessor.fixStructureName | private Structure fixStructureName(Structure s, String file) {
"""
apply a number of rules to fix the name of the structure if it did not get set during loading.
@param s
@param file
@return
"""
if ( s.getName() != null && (! s.getName().equals("")))
return s;
s.setName(s.getPDBCode());
if ( s... | java | private Structure fixStructureName(Structure s, String file) {
if ( s.getName() != null && (! s.getName().equals("")))
return s;
s.setName(s.getPDBCode());
if ( s.getName() == null || s.getName().equals("")){
File f = new File(file);
s.setName(f.getName());
}
return s;
} | [
"private",
"Structure",
"fixStructureName",
"(",
"Structure",
"s",
",",
"String",
"file",
")",
"{",
"if",
"(",
"s",
".",
"getName",
"(",
")",
"!=",
"null",
"&&",
"(",
"!",
"s",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
")",
... | apply a number of rules to fix the name of the structure if it did not get set during loading.
@param s
@param file
@return | [
"apply",
"a",
"number",
"of",
"rules",
"to",
"fix",
"the",
"name",
"of",
"the",
"structure",
"if",
"it",
"did",
"not",
"get",
"set",
"during",
"loading",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/AbstractUserArgumentProcessor.java#L717-L729 |
sdl/odata | odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java | EntityDataModelUtil.getAndCheckPrimitiveType | public static PrimitiveType getAndCheckPrimitiveType(EntityDataModel entityDataModel, String typeName) {
"""
Gets the OData type with a specified name and checks if the OData type is a primitive type; throws an exception
if the OData type is not a primitive type.
@param entityDataModel The entity data model.
... | java | public static PrimitiveType getAndCheckPrimitiveType(EntityDataModel entityDataModel, String typeName) {
return checkIsPrimitiveType(getAndCheckType(entityDataModel, typeName));
} | [
"public",
"static",
"PrimitiveType",
"getAndCheckPrimitiveType",
"(",
"EntityDataModel",
"entityDataModel",
",",
"String",
"typeName",
")",
"{",
"return",
"checkIsPrimitiveType",
"(",
"getAndCheckType",
"(",
"entityDataModel",
",",
"typeName",
")",
")",
";",
"}"
] | Gets the OData type with a specified name and checks if the OData type is a primitive type; throws an exception
if the OData type is not a primitive type.
@param entityDataModel The entity data model.
@param typeName The type name.
@return The OData primitive type with the specified name.
@throws ODataSystemExc... | [
"Gets",
"the",
"OData",
"type",
"with",
"a",
"specified",
"name",
"and",
"checks",
"if",
"the",
"OData",
"type",
"is",
"a",
"primitive",
"type",
";",
"throws",
"an",
"exception",
"if",
"the",
"OData",
"type",
"is",
"not",
"a",
"primitive",
"type",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L129-L131 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Searcher.java | Searcher.searchWithTimeoutFor | public boolean searchWithTimeoutFor(Class<? extends TextView> viewClass, String regex, int expectedMinimumNumberOfMatches, boolean scroll, boolean onlyVisible) {
"""
Searches for a {@code View} with the given regex string and returns {@code true} if the
searched {@code Button} is found a given number of times. Wi... | java | public boolean searchWithTimeoutFor(Class<? extends TextView> viewClass, String regex, int expectedMinimumNumberOfMatches, boolean scroll, boolean onlyVisible) {
final long endTime = SystemClock.uptimeMillis() + TIMEOUT;
TextView foundAnyMatchingView = null;
while (SystemClock.uptimeMillis() < endTime) {
sle... | [
"public",
"boolean",
"searchWithTimeoutFor",
"(",
"Class",
"<",
"?",
"extends",
"TextView",
">",
"viewClass",
",",
"String",
"regex",
",",
"int",
"expectedMinimumNumberOfMatches",
",",
"boolean",
"scroll",
",",
"boolean",
"onlyVisible",
")",
"{",
"final",
"long",
... | Searches for a {@code View} with the given regex string and returns {@code true} if the
searched {@code Button} is found a given number of times. Will automatically scroll when needed.
@param viewClass what kind of {@code View} to search for, e.g. {@code Button.class} or {@code TextView.class}
@param regex the text to... | [
"Searches",
"for",
"a",
"{",
"@code",
"View",
"}",
"with",
"the",
"given",
"regex",
"string",
"and",
"returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"searched",
"{",
"@code",
"Button",
"}",
"is",
"found",
"a",
"given",
"number",
"of",
"times",
".",
... | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Searcher.java#L70-L83 |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java | Quicksortables.med3 | private static int med3(Quicksortable q, int a, int b, int c) {
"""
/*
Returns the index of the median of the three indexed integers.
"""
return (q.compare(a, b) < 0 ?
(q.compare(b, c) < 0 ? b : q.compare(a, c) < 0 ? c : a) :
(q.compare(b, c) > 0 ? b : q.compare(a, c) >... | java | private static int med3(Quicksortable q, int a, int b, int c) {
return (q.compare(a, b) < 0 ?
(q.compare(b, c) < 0 ? b : q.compare(a, c) < 0 ? c : a) :
(q.compare(b, c) > 0 ? b : q.compare(a, c) > 0 ? c : a));
} | [
"private",
"static",
"int",
"med3",
"(",
"Quicksortable",
"q",
",",
"int",
"a",
",",
"int",
"b",
",",
"int",
"c",
")",
"{",
"return",
"(",
"q",
".",
"compare",
"(",
"a",
",",
"b",
")",
"<",
"0",
"?",
"(",
"q",
".",
"compare",
"(",
"b",
",",
... | /*
Returns the index of the median of the three indexed integers. | [
"/",
"*",
"Returns",
"the",
"index",
"of",
"the",
"median",
"of",
"the",
"three",
"indexed",
"integers",
"."
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java#L229-L233 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/SwingUtils.java | SwingUtils.runInEventDispatcherThread | public static void runInEventDispatcherThread(Runnable runnable, Boolean wait) {
"""
Ensures the given runnable is executed into the event dispatcher thread.
@param runnable
the runnable.
@param wait
whether should wait until execution is completed.
"""
Assert.notNull(runnable, "runnable");
... | java | public static void runInEventDispatcherThread(Runnable runnable, Boolean wait) {
Assert.notNull(runnable, "runnable");
Assert.notNull(wait, "wait");
if (EventQueue.isDispatchThread()) {
runnable.run();
} else if (wait) {
try {
EventQueue.invokeAn... | [
"public",
"static",
"void",
"runInEventDispatcherThread",
"(",
"Runnable",
"runnable",
",",
"Boolean",
"wait",
")",
"{",
"Assert",
".",
"notNull",
"(",
"runnable",
",",
"\"runnable\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"wait",
",",
"\"wait\"",
")",
";... | Ensures the given runnable is executed into the event dispatcher thread.
@param runnable
the runnable.
@param wait
whether should wait until execution is completed. | [
"Ensures",
"the",
"given",
"runnable",
"is",
"executed",
"into",
"the",
"event",
"dispatcher",
"thread",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/SwingUtils.java#L61-L79 |
jbundle/jbundle | base/model/src/main/java/org/jbundle/base/model/Utility.java | Utility.copyTreeToResult | public static boolean copyTreeToResult(Node tree, Result result) {
"""
Copy DOM tree to a SOAP tree.
@param tree
@param node
@return The parent of the new child node.
"""
try {
// Use a Transformer for output
TransformerFactory tFactory = TransformerFactory.newInstance();
... | java | public static boolean copyTreeToResult(Node tree, Result result)
{
try {
// Use a Transformer for output
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
DOMSource source = new DOMSource(tree... | [
"public",
"static",
"boolean",
"copyTreeToResult",
"(",
"Node",
"tree",
",",
"Result",
"result",
")",
"{",
"try",
"{",
"// Use a Transformer for output",
"TransformerFactory",
"tFactory",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
";",
"Transformer",
"... | Copy DOM tree to a SOAP tree.
@param tree
@param node
@return The parent of the new child node. | [
"Copy",
"DOM",
"tree",
"to",
"a",
"SOAP",
"tree",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/model/src/main/java/org/jbundle/base/model/Utility.java#L782-L800 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.replaceVariables | public static String replaceVariables(Properties variables, String value, boolean ignoreMissing)
throws IllegalArgumentException {
"""
Performs variable replacement on the given string value. Each <code>${...}</code> sequence
within the given value is replaced with the value of the named parser variable. If... | java | public static String replaceVariables(Properties variables, String value, boolean ignoreMissing)
throws IllegalArgumentException
{
StringBuilder result = new StringBuilder();
// Value:
// +--+-+--------+-+-----------------+
// | |p|--> |q|--> |
// +--+-+--------+-+---------------... | [
"public",
"static",
"String",
"replaceVariables",
"(",
"Properties",
"variables",
",",
"String",
"value",
",",
"boolean",
"ignoreMissing",
")",
"throws",
"IllegalArgumentException",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// Valu... | Performs variable replacement on the given string value. Each <code>${...}</code> sequence
within the given value is replaced with the value of the named parser variable. If a variable
is not found in the properties an IllegalArgumentException is thrown unless
<code>ignoreMissing</code> is <code>true</code>. In the lat... | [
"Performs",
"variable",
"replacement",
"on",
"the",
"given",
"string",
"value",
".",
"Each",
"<code",
">",
"$",
"{",
"...",
"}",
"<",
"/",
"code",
">",
"sequence",
"within",
"the",
"given",
"value",
"is",
"replaced",
"with",
"the",
"value",
"of",
"the",
... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L844-L882 |
Abnaxos/markdown-doclet | doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentValidators.java | PredefinedArgumentValidators.argumentTypeValidator | public static ArgumentValidator argumentTypeValidator(String description, IndexFilter indexFilter, ArgumentPredicate argumentPredicate) {
"""
# Creates a {@link ArgumentValidator} which apply the {@link ArgumentPredicate} on all arguments an the accepting {@code indexFilter}.
Example:
```java
// Creates a {... | java | public static ArgumentValidator argumentTypeValidator(String description, IndexFilter indexFilter, ArgumentPredicate argumentPredicate) {
return new EachArgumentTypeValidator(description, indexFilter, argumentPredicate);
} | [
"public",
"static",
"ArgumentValidator",
"argumentTypeValidator",
"(",
"String",
"description",
",",
"IndexFilter",
"indexFilter",
",",
"ArgumentPredicate",
"argumentPredicate",
")",
"{",
"return",
"new",
"EachArgumentTypeValidator",
"(",
"description",
",",
"indexFilter",
... | # Creates a {@link ArgumentValidator} which apply the {@link ArgumentPredicate} on all arguments an the accepting {@code indexFilter}.
Example:
```java
// Creates a {@link ArgumentValidator} which check's if 2nd and 3rd argument has an integer value
// in range 3 to 7
argumentTypeValidator(
"only 3..7 for 2nd and 3rd... | [
"#",
"Creates",
"a",
"{",
"@link",
"ArgumentValidator",
"}",
"which",
"apply",
"the",
"{",
"@link",
"ArgumentPredicate",
"}",
"on",
"all",
"arguments",
"an",
"the",
"accepting",
"{",
"@code",
"indexFilter",
"}",
"."
] | train | https://github.com/Abnaxos/markdown-doclet/blob/e98a9630206fc9c8d813cf2349ff594be8630054/doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentValidators.java#L372-L374 |
jeremylong/DependencyCheck | maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java | BaseDependencyCheckMojo.toDependencyNode | private DependencyNode toDependencyNode(ProjectBuildingRequest buildingRequest, DependencyNode parent,
org.apache.maven.model.Dependency dependency) throws ArtifactResolverException {
"""
Converts the dependency to a dependency node object.
@param buildingRequest the Maven project building request
... | java | private DependencyNode toDependencyNode(ProjectBuildingRequest buildingRequest, DependencyNode parent,
org.apache.maven.model.Dependency dependency) throws ArtifactResolverException {
final DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
coordinate.setGroupId(depend... | [
"private",
"DependencyNode",
"toDependencyNode",
"(",
"ProjectBuildingRequest",
"buildingRequest",
",",
"DependencyNode",
"parent",
",",
"org",
".",
"apache",
".",
"maven",
".",
"model",
".",
"Dependency",
"dependency",
")",
"throws",
"ArtifactResolverException",
"{",
... | Converts the dependency to a dependency node object.
@param buildingRequest the Maven project building request
@param parent the parent node
@param dependency the dependency to convert
@return the resulting dependency node
@throws ArtifactResolverException thrown if the artifact could not be
retrieved | [
"Converts",
"the",
"dependency",
"to",
"a",
"dependency",
"node",
"object",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L882-L903 |
aboutsip/pkts | pkts-core/src/main/java/io/pkts/framer/SllFramer.java | SllFramer.accept | @Override
public boolean accept(final Buffer buffer) throws IOException {
"""
(taken from pcap/sll.sh)
For captures on Linux cooked sockets, we construct a fake header that
includes:
a 2-byte "packet type" which is one of:
LINUX_SLL_HOST packet was sent to us LINUX_SLL_BROADCAST packet was
broadcast... | java | @Override
public boolean accept(final Buffer buffer) throws IOException {
buffer.markReaderIndex();
try {
final Buffer test = buffer.readBytes(16);
final byte b1 = test.getByte(0);
final byte b2 = test.getByte(1);
final byte b14 = test.getByte(14);
... | [
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"final",
"Buffer",
"buffer",
")",
"throws",
"IOException",
"{",
"buffer",
".",
"markReaderIndex",
"(",
")",
";",
"try",
"{",
"final",
"Buffer",
"test",
"=",
"buffer",
".",
"readBytes",
"(",
"16",
")",
... | (taken from pcap/sll.sh)
For captures on Linux cooked sockets, we construct a fake header that
includes:
a 2-byte "packet type" which is one of:
LINUX_SLL_HOST packet was sent to us LINUX_SLL_BROADCAST packet was
broadcast LINUX_SLL_MULTICAST packet was multicast LINUX_SLL_OTHERHOST
packet was sent to somebody else ... | [
"(",
"taken",
"from",
"pcap",
"/",
"sll",
".",
"sh",
")"
] | train | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-core/src/main/java/io/pkts/framer/SllFramer.java#L115-L130 |
apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/MRCompactor.java | MRCompactor.checkAlreadyCompactedBasedOnCompletionFile | private static boolean checkAlreadyCompactedBasedOnCompletionFile(FileSystem fs, Dataset dataset) {
"""
When completion file strategy is used, a compaction completion means there is a file named
{@link MRCompactor#COMPACTION_COMPLETE_FILE_NAME} in its {@link Dataset#outputPath()}.
"""
Path filePath = new ... | java | private static boolean checkAlreadyCompactedBasedOnCompletionFile(FileSystem fs, Dataset dataset) {
Path filePath = new Path(dataset.outputPath(), MRCompactor.COMPACTION_COMPLETE_FILE_NAME);
try {
return fs.exists(filePath);
} catch (IOException e) {
LOG.error("Failed to verify the existence of ... | [
"private",
"static",
"boolean",
"checkAlreadyCompactedBasedOnCompletionFile",
"(",
"FileSystem",
"fs",
",",
"Dataset",
"dataset",
")",
"{",
"Path",
"filePath",
"=",
"new",
"Path",
"(",
"dataset",
".",
"outputPath",
"(",
")",
",",
"MRCompactor",
".",
"COMPACTION_CO... | When completion file strategy is used, a compaction completion means there is a file named
{@link MRCompactor#COMPACTION_COMPLETE_FILE_NAME} in its {@link Dataset#outputPath()}. | [
"When",
"completion",
"file",
"strategy",
"is",
"used",
"a",
"compaction",
"completion",
"means",
"there",
"is",
"a",
"file",
"named",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/MRCompactor.java#L634-L642 |
geomajas/geomajas-project-server | api/src/main/java/org/geomajas/layer/feature/attribute/AssociationValue.java | AssociationValue.setStringAttribute | public void setStringAttribute(String name, String value) {
"""
Sets the specified string attribute to the specified value.
@param name name of the attribute
@param value value of the attribute
@since 1.9.0
"""
ensureAttributes();
Attribute attribute = new StringAttribute(value);
attribute.setEditab... | java | public void setStringAttribute(String name, String value) {
ensureAttributes();
Attribute attribute = new StringAttribute(value);
attribute.setEditable(isEditable(name));
getAllAttributes().put(name, attribute);
} | [
"public",
"void",
"setStringAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"ensureAttributes",
"(",
")",
";",
"Attribute",
"attribute",
"=",
"new",
"StringAttribute",
"(",
"value",
")",
";",
"attribute",
".",
"setEditable",
"(",
"isEditab... | Sets the specified string attribute to the specified value.
@param name name of the attribute
@param value value of the attribute
@since 1.9.0 | [
"Sets",
"the",
"specified",
"string",
"attribute",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/api/src/main/java/org/geomajas/layer/feature/attribute/AssociationValue.java#L350-L356 |
astrapi69/jaulp-wicket | jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java | PackageResourceReferences.addCssFiles | public static void addCssFiles(final IHeaderResponse response, final Class<?> scope,
final String... cssFilenames) {
"""
Adds the given css files to the given response object in the given scope.
@param response
the {@link org.apache.wicket.markup.head.IHeaderResponse}
@param scope
The scope of the css file... | java | public static void addCssFiles(final IHeaderResponse response, final Class<?> scope,
final String... cssFilenames)
{
for (final String cssFilename : cssFilenames)
{
final HeaderItem item = CssHeaderItem
.forReference(new PackageResourceReference(scope, cssFilename));
response.render(item);
}
} | [
"public",
"static",
"void",
"addCssFiles",
"(",
"final",
"IHeaderResponse",
"response",
",",
"final",
"Class",
"<",
"?",
">",
"scope",
",",
"final",
"String",
"...",
"cssFilenames",
")",
"{",
"for",
"(",
"final",
"String",
"cssFilename",
":",
"cssFilenames",
... | Adds the given css files to the given response object in the given scope.
@param response
the {@link org.apache.wicket.markup.head.IHeaderResponse}
@param scope
The scope of the css files.
@param cssFilenames
The css file names. | [
"Adds",
"the",
"given",
"css",
"files",
"to",
"the",
"given",
"response",
"object",
"in",
"the",
"given",
"scope",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java#L59-L68 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java | DateFormatSymbols.setQuarters | public void setQuarters(String[] newQuarters, int context, int width) {
"""
<strong>[icu]</strong> Sets quarter strings. For example: "1st Quarter", "2nd Quarter", etc.
@param newQuarters the new quarter strings.
@param context The formatting context, FORMAT or STANDALONE.
@param width The width of the ... | java | public void setQuarters(String[] newQuarters, int context, int width) {
switch (context) {
case FORMAT :
switch(width) {
case WIDE :
quarters = duplicate(newQuarters);
break;
case ABBREVIATED :
... | [
"public",
"void",
"setQuarters",
"(",
"String",
"[",
"]",
"newQuarters",
",",
"int",
"context",
",",
"int",
"width",
")",
"{",
"switch",
"(",
"context",
")",
"{",
"case",
"FORMAT",
":",
"switch",
"(",
"width",
")",
"{",
"case",
"WIDE",
":",
"quarters",... | <strong>[icu]</strong> Sets quarter strings. For example: "1st Quarter", "2nd Quarter", etc.
@param newQuarters the new quarter strings.
@param context The formatting context, FORMAT or STANDALONE.
@param width The width of the quarter string,
either WIDE or ABBREVIATED. There are no NARROW quarters. | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Sets",
"quarter",
"strings",
".",
"For",
"example",
":",
"1st",
"Quarter",
"2nd",
"Quarter",
"etc",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java#L1063-L1096 |
ops4j/org.ops4j.pax.exam2 | legacy/maven-paxexam-plugin/src/main/java/org/ops4j/pax/exam/mavenplugin/GenerateConfigMojo.java | GenerateConfigMojo.getSettingsForArtifact | public String getSettingsForArtifact( String fullSettings, String groupId, String artifactId ) {
"""
Example:
getSettingsForArtifact ( "foo:bar@1,chees:ham2@3@nostart","cheese","ham") --> @3@nostart
@param fullSettings settings separated by comma. GA patter + @options
@param groupId GA part groupId to be... | java | public String getSettingsForArtifact( String fullSettings, String groupId, String artifactId )
{
if( fullSettings != null )
{
for( String token : fullSettings.split( "," ) )
{
int end = ( token.indexOf( "@" ) >= 0 ) ? token.indexOf( "@" ) : token.length();
... | [
"public",
"String",
"getSettingsForArtifact",
"(",
"String",
"fullSettings",
",",
"String",
"groupId",
",",
"String",
"artifactId",
")",
"{",
"if",
"(",
"fullSettings",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"token",
":",
"fullSettings",
".",
"split",
... | Example:
getSettingsForArtifact ( "foo:bar@1,chees:ham2@3@nostart","cheese","ham") --> @3@nostart
@param fullSettings settings separated by comma. GA patter + @options
@param groupId GA part groupId to be matched inside fulllSettings
@param artifactId GA part artifactId to be matched inside fulllSettings
@retu... | [
"Example",
":",
"getSettingsForArtifact",
"(",
"foo",
":",
"bar@1",
"chees",
":",
"ham2@3@nostart",
"cheese",
"ham",
")",
"--",
">",
"@3@nostart"
] | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/legacy/maven-paxexam-plugin/src/main/java/org/ops4j/pax/exam/mavenplugin/GenerateConfigMojo.java#L283-L299 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.voteDown | public boolean voteDown(ParaObject obj, String voterid) {
"""
Downvote an object and register the vote in DB.
@param obj the object to receive -1 votes
@param voterid the userid of the voter
@return true if vote was successful
"""
if (obj == null || StringUtils.isBlank(voterid)) {
return false;
}
r... | java | public boolean voteDown(ParaObject obj, String voterid) {
if (obj == null || StringUtils.isBlank(voterid)) {
return false;
}
return getEntity(invokePatch(obj.getType().concat("/").concat(obj.getId()),
Entity.json(Collections.singletonMap("_votedown", voterid))), Boolean.class);
} | [
"public",
"boolean",
"voteDown",
"(",
"ParaObject",
"obj",
",",
"String",
"voterid",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
"||",
"StringUtils",
".",
"isBlank",
"(",
"voterid",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"getEntity",
"(",
... | Downvote an object and register the vote in DB.
@param obj the object to receive -1 votes
@param voterid the userid of the voter
@return true if vote was successful | [
"Downvote",
"an",
"object",
"and",
"register",
"the",
"vote",
"in",
"DB",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L1322-L1328 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WRepeaterRenderer.java | WRepeaterRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WText.
@param component the WText to paint.
@param renderContext the RenderContext to paint to.
"""
WRepeater repeater = (WRepeater) component;
XmlStringBuilder xml = renderContex... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WRepeater repeater = (WRepeater) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:panel");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class"... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WRepeater",
"repeater",
"=",
"(",
"WRepeater",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderCo... | Paints the given WText.
@param component the WText to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WText",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WRepeaterRenderer.java#L25-L41 |
Mthwate/DatLib | src/main/java/com/mthwate/datlib/HashUtils.java | HashUtils.sha512Hex | public static String sha512Hex(String data, Charset charset) throws NoSuchAlgorithmException {
"""
Hashes a string using the SHA-512 algorithm. Returns a hexadecimal result.
@since 1.1
@param data the string to hash
@param charset the charset of the string
@return the hexadecimal SHA-512 hash of the string
... | java | public static String sha512Hex(String data, Charset charset) throws NoSuchAlgorithmException {
return sha512Hex(data.getBytes(charset));
} | [
"public",
"static",
"String",
"sha512Hex",
"(",
"String",
"data",
",",
"Charset",
"charset",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"return",
"sha512Hex",
"(",
"data",
".",
"getBytes",
"(",
"charset",
")",
")",
";",
"}"
] | Hashes a string using the SHA-512 algorithm. Returns a hexadecimal result.
@since 1.1
@param data the string to hash
@param charset the charset of the string
@return the hexadecimal SHA-512 hash of the string
@throws NoSuchAlgorithmException the algorithm is not supported by existing providers | [
"Hashes",
"a",
"string",
"using",
"the",
"SHA",
"-",
"512",
"algorithm",
".",
"Returns",
"a",
"hexadecimal",
"result",
"."
] | train | https://github.com/Mthwate/DatLib/blob/f0b3a9f9cf6fdc773d4f86234ebd95986c9b6077/src/main/java/com/mthwate/datlib/HashUtils.java#L582-L584 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java | BlobContainersInner.createAsync | public Observable<BlobContainerInner> createAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map<String, String> metadata) {
"""
Creates a new container under the specified account as described by request body. The container resource includes metadata and propert... | java | public Observable<BlobContainerInner> createAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map<String, String> metadata) {
return createWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata).map(new Func1<ServiceRespo... | [
"public",
"Observable",
"<",
"BlobContainerInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"containerName",
",",
"PublicAccess",
"publicAccess",
",",
"Map",
"<",
"String",
",",
"String",
">",
"metadata",
... | Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container.
@param resourceGroupName The name of the resource group within the user's subscription. The n... | [
"Creates",
"a",
"new",
"container",
"under",
"the",
"specified",
"account",
"as",
"described",
"by",
"request",
"body",
".",
"The",
"container",
"resource",
"includes",
"metadata",
"and",
"properties",
"for",
"that",
"container",
".",
"It",
"does",
"not",
"inc... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java#L340-L347 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/css/CssTransformer.java | CssTransformer.transform | public static void transform(InputStream css, OutputStream stylerSetup, boolean validate) throws ClassNotFoundException, IllegalAccessException, InstantiationException, CSSException, IOException {
"""
Set the system property "org.w3c.css.sac.parser" to point to your {@link Parser} and optionally {@link #DOCUMENTHA... | java | public static void transform(InputStream css, OutputStream stylerSetup, boolean validate) throws ClassNotFoundException, IllegalAccessException, InstantiationException, CSSException, IOException {
// find and use a SAC parser and document handler
String handler = System.getProperty(DOCUMENTHANDLERPROPERTY);... | [
"public",
"static",
"void",
"transform",
"(",
"InputStream",
"css",
",",
"OutputStream",
"stylerSetup",
",",
"boolean",
"validate",
")",
"throws",
"ClassNotFoundException",
",",
"IllegalAccessException",
",",
"InstantiationException",
",",
"CSSException",
",",
"IOExcept... | Set the system property "org.w3c.css.sac.parser" to point to your {@link Parser} and optionally {@link #DOCUMENTHANDLERPROPERTY} to
point to your document handler.
@param css
@param stylerSetup
@param validate when true validate css input (see {@link CssDocumentHandler#setMustFindStylersForCssNames(java.lang.Boolean) ... | [
"Set",
"the",
"system",
"property",
"org",
".",
"w3c",
".",
"css",
".",
"sac",
".",
"parser",
"to",
"point",
"to",
"your",
"{",
"@link",
"Parser",
"}",
"and",
"optionally",
"{",
"@link",
"#DOCUMENTHANDLERPROPERTY",
"}",
"to",
"point",
"to",
"your",
"docu... | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/css/CssTransformer.java#L108-L120 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/CompositeELResolver.java | CompositeELResolver.isReadOnly | @Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
"""
For a given base and property, attempts to determine whether a call to
{@link #setValue(ELContext, Object, Object, Object)} will always fail. The result is obtained
by querying all component resolvers. If this resolver ha... | java | @Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
context.setPropertyResolved(false);
for (ELResolver resolver : resolvers) {
boolean readOnly = resolver.isReadOnly(context, base, property);
if (context.isPropertyResolved()) {
return readOnly;
}
}
return false;... | [
"@",
"Override",
"public",
"boolean",
"isReadOnly",
"(",
"ELContext",
"context",
",",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"context",
".",
"setPropertyResolved",
"(",
"false",
")",
";",
"for",
"(",
"ELResolver",
"resolver",
":",
"resolvers",
... | For a given base and property, attempts to determine whether a call to
{@link #setValue(ELContext, Object, Object, Object)} will always fail. The result is obtained
by querying all component resolvers. If this resolver handles the given (base, property)
pair, the propertyResolved property of the ELContext object must b... | [
"For",
"a",
"given",
"base",
"and",
"property",
"attempts",
"to",
"determine",
"whether",
"a",
"call",
"to",
"{",
"@link",
"#setValue",
"(",
"ELContext",
"Object",
"Object",
"Object",
")",
"}",
"will",
"always",
"fail",
".",
"The",
"result",
"is",
"obtaine... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/CompositeELResolver.java#L275-L285 |
lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.findCurrentPlugin | protected Plugin findCurrentPlugin( Plugin plugin, MavenProject project ) {
"""
Given a plugin, this will retrieve the matching plugin artifact from the model.
@param plugin plugin to lookup
@param project project to search
@return matching plugin, <code>null</code> if not found.
"""
Plugin found ... | java | protected Plugin findCurrentPlugin( Plugin plugin, MavenProject project )
{
Plugin found = null;
try
{
Model model = project.getModel();
@SuppressWarnings( "unchecked" )
Map<String, Plugin> plugins = model.getBuild().getPluginsAsMap();
found = ... | [
"protected",
"Plugin",
"findCurrentPlugin",
"(",
"Plugin",
"plugin",
",",
"MavenProject",
"project",
")",
"{",
"Plugin",
"found",
"=",
"null",
";",
"try",
"{",
"Model",
"model",
"=",
"project",
".",
"getModel",
"(",
")",
";",
"@",
"SuppressWarnings",
"(",
... | Given a plugin, this will retrieve the matching plugin artifact from the model.
@param plugin plugin to lookup
@param project project to search
@return matching plugin, <code>null</code> if not found. | [
"Given",
"a",
"plugin",
"this",
"will",
"retrieve",
"the",
"matching",
"plugin",
"artifact",
"from",
"the",
"model",
"."
] | train | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L524-L545 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/AbstractParser.java | AbstractParser.elementAsLong | protected Long elementAsLong(XMLStreamReader reader, String key, Map<String, String> expressions)
throws XMLStreamException, ParserException {
"""
convert an xml element in Long value
@param reader the StAX reader
@param key The key
@param expressions The expressions
@return the long representing eleme... | java | protected Long elementAsLong(XMLStreamReader reader, String key, Map<String, String> expressions)
throws XMLStreamException, ParserException
{
Long longValue = null;
String elementtext = rawElementText(reader);
if (key != null && expressions != null && elementtext != null && elementtext.inde... | [
"protected",
"Long",
"elementAsLong",
"(",
"XMLStreamReader",
"reader",
",",
"String",
"key",
",",
"Map",
"<",
"String",
",",
"String",
">",
"expressions",
")",
"throws",
"XMLStreamException",
",",
"ParserException",
"{",
"Long",
"longValue",
"=",
"null",
";",
... | convert an xml element in Long value
@param reader the StAX reader
@param key The key
@param expressions The expressions
@return the long representing element
@throws XMLStreamException StAX exception
@throws ParserException in case it isn't a number | [
"convert",
"an",
"xml",
"element",
"in",
"Long",
"value"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/AbstractParser.java#L286-L305 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.acceptSessionFromEntityPath | public static IMessageSession acceptSessionFromEntityPath(String namespaceName, String entityPath, String sessionId, ClientSettings clientSettings) throws InterruptedException, ServiceBusException {
"""
Accept a {@link IMessageSession} from service bus using the client settings with specified session id in PeekLoc... | java | public static IMessageSession acceptSessionFromEntityPath(String namespaceName, String entityPath, String sessionId, ClientSettings clientSettings) throws InterruptedException, ServiceBusException {
return Utils.completeFuture(acceptSessionFromEntityPathAsync(namespaceName, entityPath, sessionId, clientSettings... | [
"public",
"static",
"IMessageSession",
"acceptSessionFromEntityPath",
"(",
"String",
"namespaceName",
",",
"String",
"entityPath",
",",
"String",
"sessionId",
",",
"ClientSettings",
"clientSettings",
")",
"throws",
"InterruptedException",
",",
"ServiceBusException",
"{",
... | Accept a {@link IMessageSession} from service bus using the client settings with specified session id in PeekLock mode. Session Id can be null, if null, service will return the first available session.
@param namespaceName namespace of entity
@param entityPath path of entity
@param sessionId session id, if null, servic... | [
"Accept",
"a",
"{"
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L540-L542 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.onPushReceived | @ObjectiveCName("onPushReceivedWithSeq:withAuthId:")
public void onPushReceived(int seq, long authId) {
"""
MUST be called when external push received
@param seq sequence number of update
@param authId auth id
"""
if (modules.getUpdatesModule() != null) {
modules.getUpdatesModule... | java | @ObjectiveCName("onPushReceivedWithSeq:withAuthId:")
public void onPushReceived(int seq, long authId) {
if (modules.getUpdatesModule() != null) {
modules.getUpdatesModule().onPushReceived(seq, authId);
}
} | [
"@",
"ObjectiveCName",
"(",
"\"onPushReceivedWithSeq:withAuthId:\"",
")",
"public",
"void",
"onPushReceived",
"(",
"int",
"seq",
",",
"long",
"authId",
")",
"{",
"if",
"(",
"modules",
".",
"getUpdatesModule",
"(",
")",
"!=",
"null",
")",
"{",
"modules",
".",
... | MUST be called when external push received
@param seq sequence number of update
@param authId auth id | [
"MUST",
"be",
"called",
"when",
"external",
"push",
"received"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L696-L701 |
scireum/server-sass | src/main/java/org/serversass/Generator.java | Generator.resolveIntoStream | protected InputStream resolveIntoStream(String sheet) throws IOException {
"""
Resolves the given file name into an {@link InputStream}
@param sheet the file to resolve (already cleaned up by replacing \ with / and appending .scss if necessary).
@return an InputStream for the resolved data or <tt>null</tt> to ... | java | protected InputStream resolveIntoStream(String sheet) throws IOException {
if (baseDir != null) {
File file = baseDir;
for (String part : sheet.split("/")) {
file = new File(file, part);
}
if (file.exists() && file.isFile()) {
retur... | [
"protected",
"InputStream",
"resolveIntoStream",
"(",
"String",
"sheet",
")",
"throws",
"IOException",
"{",
"if",
"(",
"baseDir",
"!=",
"null",
")",
"{",
"File",
"file",
"=",
"baseDir",
";",
"for",
"(",
"String",
"part",
":",
"sheet",
".",
"split",
"(",
... | Resolves the given file name into an {@link InputStream}
@param sheet the file to resolve (already cleaned up by replacing \ with / and appending .scss if necessary).
@return an InputStream for the resolved data or <tt>null</tt> to indicate that the resource cannot be found
@throws IOException in case of an error whil... | [
"Resolves",
"the",
"given",
"file",
"name",
"into",
"an",
"{",
"@link",
"InputStream",
"}"
] | train | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/Generator.java#L160-L178 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java | CmsSitemapController.updateEntry | public void updateEntry(CmsUUID entryId, final AsyncCallback<Void> callback) {
"""
Updates the given entry.<p>
@param entryId the entry id
@param callback the callback to call after the entry has been updated
"""
getChildren(
entryId,
CmsSitemapTreeItem.getItemById(entryId)... | java | public void updateEntry(CmsUUID entryId, final AsyncCallback<Void> callback) {
getChildren(
entryId,
CmsSitemapTreeItem.getItemById(entryId).isOpen(),
new AsyncCallback<CmsClientSitemapEntry>() {
public void onFailure(Throwable caught) {
... | [
"public",
"void",
"updateEntry",
"(",
"CmsUUID",
"entryId",
",",
"final",
"AsyncCallback",
"<",
"Void",
">",
"callback",
")",
"{",
"getChildren",
"(",
"entryId",
",",
"CmsSitemapTreeItem",
".",
"getItemById",
"(",
"entryId",
")",
".",
"isOpen",
"(",
")",
","... | Updates the given entry.<p>
@param entryId the entry id
@param callback the callback to call after the entry has been updated | [
"Updates",
"the",
"given",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L1962-L1982 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/TrueTypeFont.java | TrueTypeFont.setKerning | public boolean setKerning(int char1, int char2, int kern) {
"""
Sets the kerning between two Unicode chars.
@param char1 the first char
@param char2 the second char
@param kern the kerning to apply in normalized 1000 units
@return <code>true</code> if the kerning was applied, <code>false</code> otherwise
"... | java | public boolean setKerning(int char1, int char2, int kern) {
int metrics[] = getMetricsTT(char1);
if (metrics == null)
return false;
int c1 = metrics[0];
metrics = getMetricsTT(char2);
if (metrics == null)
return false;
int c2 = metrics[0];
... | [
"public",
"boolean",
"setKerning",
"(",
"int",
"char1",
",",
"int",
"char2",
",",
"int",
"kern",
")",
"{",
"int",
"metrics",
"[",
"]",
"=",
"getMetricsTT",
"(",
"char1",
")",
";",
"if",
"(",
"metrics",
"==",
"null",
")",
"return",
"false",
";",
"int"... | Sets the kerning between two Unicode chars.
@param char1 the first char
@param char2 the second char
@param kern the kerning to apply in normalized 1000 units
@return <code>true</code> if the kerning was applied, <code>false</code> otherwise | [
"Sets",
"the",
"kerning",
"between",
"two",
"Unicode",
"chars",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/TrueTypeFont.java#L1515-L1526 |
powermock/powermock | powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/PowerMockito.java | PowerMockito.verifyNew | @SuppressWarnings("unchecked")
public static synchronized <T> ConstructorArgumentsVerification verifyNew(Class<T> mock) {
"""
Verifies certain behavior <b>happened once</b>
<p>
Alias to <code>verifyNew(mockClass, times(1))</code> E.g:
<p>
<pre>
verifyNew(ClassWithStaticMethod.class);
</pre>
<p>
Above i... | java | @SuppressWarnings("unchecked")
public static synchronized <T> ConstructorArgumentsVerification verifyNew(Class<T> mock) {
return verifyNew(mock, times(1));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"synchronized",
"<",
"T",
">",
"ConstructorArgumentsVerification",
"verifyNew",
"(",
"Class",
"<",
"T",
">",
"mock",
")",
"{",
"return",
"verifyNew",
"(",
"mock",
",",
"times",
"(",
"1",
... | Verifies certain behavior <b>happened once</b>
<p>
Alias to <code>verifyNew(mockClass, times(1))</code> E.g:
<p>
<pre>
verifyNew(ClassWithStaticMethod.class);
</pre>
<p>
Above is equivalent to:
<p>
<pre>
verifyNew(ClassWithStaticMethod.class, times(1));
</pre>
<p>
<p>
@param mock Class mocked by PowerMock. | [
"Verifies",
"certain",
"behavior",
"<b",
">",
"happened",
"once<",
"/",
"b",
">",
"<p",
">",
"Alias",
"to",
"<code",
">",
"verifyNew",
"(",
"mockClass",
"times",
"(",
"1",
"))",
"<",
"/",
"code",
">",
"E",
".",
"g",
":",
"<p",
">",
"<pre",
">",
"... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/PowerMockito.java#L324-L327 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java | ExpressionBuilder.lessThan | public ExpressionBuilder lessThan(final SubordinateTrigger trigger, final Object compare) {
"""
Appends a less than test to the condition.
@param trigger the trigger field.
@param compare the value to use in the compare.
@return this ExpressionBuilder.
"""
BooleanExpression exp = new CompareExpression(C... | java | public ExpressionBuilder lessThan(final SubordinateTrigger trigger, final Object compare) {
BooleanExpression exp = new CompareExpression(CompareType.LESS_THAN, trigger, compare);
appendExpression(exp);
return this;
} | [
"public",
"ExpressionBuilder",
"lessThan",
"(",
"final",
"SubordinateTrigger",
"trigger",
",",
"final",
"Object",
"compare",
")",
"{",
"BooleanExpression",
"exp",
"=",
"new",
"CompareExpression",
"(",
"CompareType",
".",
"LESS_THAN",
",",
"trigger",
",",
"compare",
... | Appends a less than test to the condition.
@param trigger the trigger field.
@param compare the value to use in the compare.
@return this ExpressionBuilder. | [
"Appends",
"a",
"less",
"than",
"test",
"to",
"the",
"condition",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L91-L96 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.tutorial/src/main/java/de/tudarmstadt/ukp/wikipedia/tutorial/parser/T6_NestedLists.java | T6_NestedLists.outputNestedList | public static String outputNestedList(NestedList nl, int depth) {
"""
Returns String with all elements of a NestedList
@param nl NestedList
@param depth Current depth of the Nestedlist
@return
"""
String result = "";
if(nl == null)
{
return result; // If null return empty string
}
for(int i =... | java | public static String outputNestedList(NestedList nl, int depth){
String result = "";
if(nl == null)
{
return result; // If null return empty string
}
for(int i = 0; i<depth; i++)
{
result += " "; // insert indentation according to depth
}
if(nl.getClass() == NestedListElement.class){ // If it... | [
"public",
"static",
"String",
"outputNestedList",
"(",
"NestedList",
"nl",
",",
"int",
"depth",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"if",
"(",
"nl",
"==",
"null",
")",
"{",
"return",
"result",
";",
"// If null return empty string",
"}",
"for",
... | Returns String with all elements of a NestedList
@param nl NestedList
@param depth Current depth of the Nestedlist
@return | [
"Returns",
"String",
"with",
"all",
"elements",
"of",
"a",
"NestedList"
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.tutorial/src/main/java/de/tudarmstadt/ukp/wikipedia/tutorial/parser/T6_NestedLists.java#L71-L95 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ConversionSchemas.java | ConversionSchemas.v2CompatibleBuilder | public static Builder v2CompatibleBuilder(String name) {
"""
A ConversionSchema builder that defaults to building {@link #V2_COMPATIBLE}.
"""
return new Builder(name, V2CompatibleMarshallerSet.marshallers(),
V2CompatibleMarshallerSet.setMarshallers(),
... | java | public static Builder v2CompatibleBuilder(String name) {
return new Builder(name, V2CompatibleMarshallerSet.marshallers(),
V2CompatibleMarshallerSet.setMarshallers(),
StandardUnmarshallerSet.unmarshallers(),
StandardUnmarshallerSet... | [
"public",
"static",
"Builder",
"v2CompatibleBuilder",
"(",
"String",
"name",
")",
"{",
"return",
"new",
"Builder",
"(",
"name",
",",
"V2CompatibleMarshallerSet",
".",
"marshallers",
"(",
")",
",",
"V2CompatibleMarshallerSet",
".",
"setMarshallers",
"(",
")",
",",
... | A ConversionSchema builder that defaults to building {@link #V2_COMPATIBLE}. | [
"A",
"ConversionSchema",
"builder",
"that",
"defaults",
"to",
"building",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ConversionSchemas.java#L165-L170 |
google/closure-templates | java/src/com/google/template/soy/msgs/internal/InsertMsgsVisitor.java | InsertMsgsVisitor.buildReplacementNodesFromTranslation | private void buildReplacementNodesFromTranslation(MsgNode msg, SoyMsg translation) {
"""
Private helper for visitMsgFallbackGroupNode() to build the list of replacement nodes for a
message from its translation.
"""
currReplacementNodes = Lists.newArrayList();
for (SoyMsgPart msgPart : translation.ge... | java | private void buildReplacementNodesFromTranslation(MsgNode msg, SoyMsg translation) {
currReplacementNodes = Lists.newArrayList();
for (SoyMsgPart msgPart : translation.getParts()) {
if (msgPart instanceof SoyMsgRawTextPart) {
// Append a new RawTextNode to the currReplacementNodes list.
... | [
"private",
"void",
"buildReplacementNodesFromTranslation",
"(",
"MsgNode",
"msg",
",",
"SoyMsg",
"translation",
")",
"{",
"currReplacementNodes",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"SoyMsgPart",
"msgPart",
":",
"translation",
".",
"getPa... | Private helper for visitMsgFallbackGroupNode() to build the list of replacement nodes for a
message from its translation. | [
"Private",
"helper",
"for",
"visitMsgFallbackGroupNode",
"()",
"to",
"build",
"the",
"list",
"of",
"replacement",
"nodes",
"for",
"a",
"message",
"from",
"its",
"translation",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/msgs/internal/InsertMsgsVisitor.java#L139-L170 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/apache/harmony/xml/dom/DocumentImpl.java | DocumentImpl.cloneOrImportNode | Node cloneOrImportNode(short operation, Node node, boolean deep) {
"""
Returns a copy of the given node or subtree with this document as its
owner.
@param operation either {@link UserDataHandler#NODE_CLONED} or
{@link UserDataHandler#NODE_IMPORTED}.
@param node a node belonging to any document or DOM impleme... | java | Node cloneOrImportNode(short operation, Node node, boolean deep) {
NodeImpl copy = shallowCopy(operation, node);
if (deep) {
NodeList list = node.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
copy.appendChild(cloneOrImportNode(operation, list.item... | [
"Node",
"cloneOrImportNode",
"(",
"short",
"operation",
",",
"Node",
"node",
",",
"boolean",
"deep",
")",
"{",
"NodeImpl",
"copy",
"=",
"shallowCopy",
"(",
"operation",
",",
"node",
")",
";",
"if",
"(",
"deep",
")",
"{",
"NodeList",
"list",
"=",
"node",
... | Returns a copy of the given node or subtree with this document as its
owner.
@param operation either {@link UserDataHandler#NODE_CLONED} or
{@link UserDataHandler#NODE_IMPORTED}.
@param node a node belonging to any document or DOM implementation.
@param deep true to recursively copy any child nodes; false to do no suc... | [
"Returns",
"a",
"copy",
"of",
"the",
"given",
"node",
"or",
"subtree",
"with",
"this",
"document",
"as",
"its",
"owner",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/apache/harmony/xml/dom/DocumentImpl.java#L219-L231 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/DiffToolLogMessages.java | DiffToolLogMessages.logShutdown | public static void logShutdown(final Logger logger, final long endTime) {
"""
Logs the shutdown of the logger.
@param logger
reference to the logger
@param endTime
time since start
"""
logger.logMessage(Level.INFO,
"DiffTool initiates SHUTDOWN\t" + Time.toClock(endTime));
} | java | public static void logShutdown(final Logger logger, final long endTime)
{
logger.logMessage(Level.INFO,
"DiffTool initiates SHUTDOWN\t" + Time.toClock(endTime));
} | [
"public",
"static",
"void",
"logShutdown",
"(",
"final",
"Logger",
"logger",
",",
"final",
"long",
"endTime",
")",
"{",
"logger",
".",
"logMessage",
"(",
"Level",
".",
"INFO",
",",
"\"DiffTool initiates SHUTDOWN\\t\"",
"+",
"Time",
".",
"toClock",
"(",
"endTim... | Logs the shutdown of the logger.
@param logger
reference to the logger
@param endTime
time since start | [
"Logs",
"the",
"shutdown",
"of",
"the",
"logger",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/DiffToolLogMessages.java#L118-L122 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java | SingleEvaluatedMoveCache.cacheMoveEvaluation | @Override
public final void cacheMoveEvaluation(Move<?> move, Evaluation evaluation) {
"""
Cache the given evaluation, discarding any previously cached evaluations.
@param move move applied to the current solution
@param evaluation evaluation of obtained neighbour
"""
evaluatedMove = move;
... | java | @Override
public final void cacheMoveEvaluation(Move<?> move, Evaluation evaluation) {
evaluatedMove = move;
this.evaluation = evaluation;
} | [
"@",
"Override",
"public",
"final",
"void",
"cacheMoveEvaluation",
"(",
"Move",
"<",
"?",
">",
"move",
",",
"Evaluation",
"evaluation",
")",
"{",
"evaluatedMove",
"=",
"move",
";",
"this",
".",
"evaluation",
"=",
"evaluation",
";",
"}"
] | Cache the given evaluation, discarding any previously cached evaluations.
@param move move applied to the current solution
@param evaluation evaluation of obtained neighbour | [
"Cache",
"the",
"given",
"evaluation",
"discarding",
"any",
"previously",
"cached",
"evaluations",
"."
] | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java#L58-L62 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Math.java | Math.min | public static float min(float a, float b) {
"""
Returns the smaller of two {@code float} values. That is,
the result is the value closer to negative infinity. If the
arguments have the same value, the result is that same
value. If either value is NaN, then the result is NaN. Unlike
the numerical comparison o... | java | public static float min(float a, float b) {
if (a != a)
return a; // a is NaN
if ((a == 0.0f) &&
(b == 0.0f) &&
(Float.floatToRawIntBits(b) == negativeZeroFloatBits)) {
// Raw conversion ok since NaN can't map to -0.0.
return b;
}
... | [
"public",
"static",
"float",
"min",
"(",
"float",
"a",
",",
"float",
"b",
")",
"{",
"if",
"(",
"a",
"!=",
"a",
")",
"return",
"a",
";",
"// a is NaN",
"if",
"(",
"(",
"a",
"==",
"0.0f",
")",
"&&",
"(",
"b",
"==",
"0.0f",
")",
"&&",
"(",
"Floa... | Returns the smaller of two {@code float} values. That is,
the result is the value closer to negative infinity. If the
arguments have the same value, the result is that same
value. If either value is NaN, then the result is NaN. Unlike
the numerical comparison operators, this method considers
negative zero to be stric... | [
"Returns",
"the",
"smaller",
"of",
"two",
"{",
"@code",
"float",
"}",
"values",
".",
"That",
"is",
"the",
"result",
"is",
"the",
"value",
"closer",
"to",
"negative",
"infinity",
".",
"If",
"the",
"arguments",
"have",
"the",
"same",
"value",
"the",
"resul... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Math.java#L1378-L1388 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/schedule/Schedulers.java | Schedulers.newThreadPoolScheduler | public static Schedulers newThreadPoolScheduler(int poolSize) {
"""
New thread pool scheduler.
@param poolSize
the pool size
@return the schedulers
"""
createSingleton();
Schedulers.increaseNoOfSchedullers();
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
... | java | public static Schedulers newThreadPoolScheduler(int poolSize) {
createSingleton();
Schedulers.increaseNoOfSchedullers();
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
CustomizableThreadFactory factory = new CustomizableThreadFactory();
scheduler.initializeExe... | [
"public",
"static",
"Schedulers",
"newThreadPoolScheduler",
"(",
"int",
"poolSize",
")",
"{",
"createSingleton",
"(",
")",
";",
"Schedulers",
".",
"increaseNoOfSchedullers",
"(",
")",
";",
"ThreadPoolTaskScheduler",
"scheduler",
"=",
"new",
"ThreadPoolTaskScheduler",
... | New thread pool scheduler.
@param poolSize
the pool size
@return the schedulers | [
"New",
"thread",
"pool",
"scheduler",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/schedule/Schedulers.java#L68-L82 |
VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java | VueComponentOptions.addJavaProp | @JsOverlay
public final void addJavaProp(String propName, String fieldName, boolean required,
String exposedTypeName) {
"""
Add a prop to our ComponentOptions. This will allow to receive data from the outside of our
Component.
@param propName The name of the prop
@param fieldName The name of the java ... | java | @JsOverlay
public final void addJavaProp(String propName, String fieldName, boolean required,
String exposedTypeName) {
if (propsToProxy == null) {
propsToProxy = new HashSet<>();
}
PropOptions propDefinition = new PropOptions();
propDefinition.required = required;
if (exposedTypeNam... | [
"@",
"JsOverlay",
"public",
"final",
"void",
"addJavaProp",
"(",
"String",
"propName",
",",
"String",
"fieldName",
",",
"boolean",
"required",
",",
"String",
"exposedTypeName",
")",
"{",
"if",
"(",
"propsToProxy",
"==",
"null",
")",
"{",
"propsToProxy",
"=",
... | Add a prop to our ComponentOptions. This will allow to receive data from the outside of our
Component.
@param propName The name of the prop
@param fieldName The name of the java field for that prop
@param required Is the property required (mandatory)
@param exposedTypeName JS name of the type of this property, if not ... | [
"Add",
"a",
"prop",
"to",
"our",
"ComponentOptions",
".",
"This",
"will",
"allow",
"to",
"receive",
"data",
"from",
"the",
"outside",
"of",
"our",
"Component",
"."
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java#L171-L187 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.rotateAround | public Matrix4x3d rotateAround(Quaterniondc quat, double ox, double oy, double oz, Matrix4x3d dest) {
"""
/* (non-Javadoc)
@see org.joml.Matrix4x3dc#rotateAround(org.joml.Quaterniondc, double, double, double, org.joml.Matrix4x3d)
"""
if ((properties & PROPERTY_IDENTITY) != 0)
return rotati... | java | public Matrix4x3d rotateAround(Quaterniondc quat, double ox, double oy, double oz, Matrix4x3d dest) {
if ((properties & PROPERTY_IDENTITY) != 0)
return rotationAround(quat, ox, oy, oz);
return rotateAroundAffine(quat, ox, oy, oz, dest);
} | [
"public",
"Matrix4x3d",
"rotateAround",
"(",
"Quaterniondc",
"quat",
",",
"double",
"ox",
",",
"double",
"oy",
",",
"double",
"oz",
",",
"Matrix4x3d",
"dest",
")",
"{",
"if",
"(",
"(",
"properties",
"&",
"PROPERTY_IDENTITY",
")",
"!=",
"0",
")",
"return",
... | /* (non-Javadoc)
@see org.joml.Matrix4x3dc#rotateAround(org.joml.Quaterniondc, double, double, double, org.joml.Matrix4x3d) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L3395-L3399 |
telly/groundy | library/src/main/java/com/telly/groundy/GroundyManager.java | GroundyManager.cancelTasks | public static void cancelTasks(final Context context,
Class<? extends GroundyService> groundyServiceClass, final int groupId, final int reason,
final CancelListener cancelListener) {
"""
Cancels all tasks of the specified group w/ the specified reason.
@param context used to interact with the servic... | java | public static void cancelTasks(final Context context,
Class<? extends GroundyService> groundyServiceClass, final int groupId, final int reason,
final CancelListener cancelListener) {
if (groupId <= 0) {
throw new IllegalStateException("Group id must be greater than zero");
}
new GroundySer... | [
"public",
"static",
"void",
"cancelTasks",
"(",
"final",
"Context",
"context",
",",
"Class",
"<",
"?",
"extends",
"GroundyService",
">",
"groundyServiceClass",
",",
"final",
"int",
"groupId",
",",
"final",
"int",
"reason",
",",
"final",
"CancelListener",
"cancel... | Cancels all tasks of the specified group w/ the specified reason.
@param context used to interact with the service
@param groupId the group id to cancel
@param cancelListener callback for cancel result | [
"Cancels",
"all",
"tasks",
"of",
"the",
"specified",
"group",
"w",
"/",
"the",
"specified",
"reason",
"."
] | train | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/GroundyManager.java#L123-L139 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.addStringValue | protected void addStringValue(Document doc, String fieldName, Object internalValue, boolean tokenized,
boolean includeInNodeIndex, float boost, boolean useInExcerpt) {
"""
Adds the string value to the document both as the named field and
optionally for full text indexing if <code>tokenized</code> is
<code>... | java | protected void addStringValue(Document doc, String fieldName, Object internalValue, boolean tokenized,
boolean includeInNodeIndex, float boost, boolean useInExcerpt)
{
// simple String
String stringValue = (String)internalValue;
doc.add(createFieldWithoutNorms(fieldName, stringValue, Propert... | [
"protected",
"void",
"addStringValue",
"(",
"Document",
"doc",
",",
"String",
"fieldName",
",",
"Object",
"internalValue",
",",
"boolean",
"tokenized",
",",
"boolean",
"includeInNodeIndex",
",",
"float",
"boost",
",",
"boolean",
"useInExcerpt",
")",
"{",
"// simpl... | Adds the string value to the document both as the named field and
optionally for full text indexing if <code>tokenized</code> is
<code>true</code>.
@param doc The document to which to add the field
@param fieldName The name of the field to add
@param internalValue The value for the field t... | [
"Adds",
"the",
"string",
"value",
"to",
"the",
"document",
"both",
"as",
"the",
"named",
"field",
"and",
"optionally",
"for",
"full",
"text",
"indexing",
"if",
"<code",
">",
"tokenized<",
"/",
"code",
">",
"is",
"<code",
">",
"true<",
"/",
"code",
">",
... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L847-L882 |
alkacon/opencms-core | src/org/opencms/gwt/CmsClientUserSettingConverter.java | CmsClientUserSettingConverter.saveSetting | private void saveSetting(String key, String value) throws Exception {
"""
Saves an individual user preference value.<p>
@param key the key of the user preference
@param value the value of the user preference
@throws Exception if something goes wrong
"""
Map<String, I_CmsPreference> prefs = Open... | java | private void saveSetting(String key, String value) throws Exception {
Map<String, I_CmsPreference> prefs = OpenCms.getWorkplaceManager().getDefaultUserSettings().getPreferences();
if (prefs.containsKey(key)) {
prefs.get(key).setValue(m_currentPreferences, value);
} else {
... | [
"private",
"void",
"saveSetting",
"(",
"String",
"key",
",",
"String",
"value",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"I_CmsPreference",
">",
"prefs",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getDefaultUserSettings",
"(... | Saves an individual user preference value.<p>
@param key the key of the user preference
@param value the value of the user preference
@throws Exception if something goes wrong | [
"Saves",
"an",
"individual",
"user",
"preference",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsClientUserSettingConverter.java#L186-L194 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java | IntegralImageOps.block_zero | public static int block_zero(GrayS32 integral , int x0 , int y0 , int x1 , int y1 ) {
"""
<p>
Computes the value of a block inside an integral image and treats pixels outside of the
image as zero. The block is defined as follows: x0 < x ≤ x1 and y0 < y ≤ y1.
</p>
@param integral Integral image.
... | java | public static int block_zero(GrayS32 integral , int x0 , int y0 , int x1 , int y1 )
{
return ImplIntegralImageOps.block_zero(integral,x0,y0,x1,y1);
} | [
"public",
"static",
"int",
"block_zero",
"(",
"GrayS32",
"integral",
",",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"return",
"ImplIntegralImageOps",
".",
"block_zero",
"(",
"integral",
",",
"x0",
",",
"y0",
",",
"x1"... | <p>
Computes the value of a block inside an integral image and treats pixels outside of the
image as zero. The block is defined as follows: x0 < x ≤ x1 and y0 < y ≤ y1.
</p>
@param integral Integral image.
@param x0 Lower bound of the block. Exclusive.
@param y0 Lower bound of the block. Exclusive.
@par... | [
"<p",
">",
"Computes",
"the",
"value",
"of",
"a",
"block",
"inside",
"an",
"integral",
"image",
"and",
"treats",
"pixels",
"outside",
"of",
"the",
"image",
"as",
"zero",
".",
"The",
"block",
"is",
"defined",
"as",
"follows",
":",
"x0",
"<",
";",
"x",... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java#L480-L483 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/convert/MultipleFieldConverter.java | MultipleFieldConverter.setValue | public int setValue(double value, boolean bDisplayOption, int iMoveMode) {
"""
For numeric fields, set the current value.
Override this method to convert the value to the actual Physical Data Type.
@param bState the state to set the data to.
@param bDisplayOption Display the data on the screen if true.
@param ... | java | public int setValue(double value, boolean bDisplayOption, int iMoveMode)
{
m_bSetData = true; // Make sure getNextConverter is called correctly (if it is called).
int iErrorCode = super.setValue(value, bDisplayOption, iMoveMode);
m_bSetData = false;
return iErrorCode;
} | [
"public",
"int",
"setValue",
"(",
"double",
"value",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"m_bSetData",
"=",
"true",
";",
"// Make sure getNextConverter is called correctly (if it is called).",
"int",
"iErrorCode",
"=",
"super",
".",
"s... | For numeric fields, set the current value.
Override this method to convert the value to the actual Physical Data Type.
@param bState the state to set the data to.
@param bDisplayOption Display the data on the screen if true.
@param iMoveMode INIT, SCREEN, or READ move mode.
@return The error code. | [
"For",
"numeric",
"fields",
"set",
"the",
"current",
"value",
".",
"Override",
"this",
"method",
"to",
"convert",
"the",
"value",
"to",
"the",
"actual",
"Physical",
"Data",
"Type",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/MultipleFieldConverter.java#L173-L179 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/eip/EipClient.java | EipClient.createEip | public CreateEipResponse createEip(CreateEipRequest request) {
"""
Create an eip with the specified options.
This is an asynchronous interface
@param request The request containing all options for creating an eip.
@return created eip address
"""
checkNotNull(request.getBandwidthInMbps(), "bandwidt... | java | public CreateEipResponse createEip(CreateEipRequest request) {
checkNotNull(request.getBandwidthInMbps(), "bandwidthInMbps should not be null");
if (Strings.isNullOrEmpty(request.getClientToken())) {
request.setClientToken(generateDefaultClientToken());
}
if (null == request.... | [
"public",
"CreateEipResponse",
"createEip",
"(",
"CreateEipRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
".",
"getBandwidthInMbps",
"(",
")",
",",
"\"bandwidthInMbps should not be null\"",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"... | Create an eip with the specified options.
This is an asynchronous interface
@param request The request containing all options for creating an eip.
@return created eip address | [
"Create",
"an",
"eip",
"with",
"the",
"specified",
"options",
".",
"This",
"is",
"an",
"asynchronous",
"interface"
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/eip/EipClient.java#L102-L116 |
advantageous/boon | reflekt/src/main/java/io/advantageous/boon/primitive/Int.java | Int.atIndex | public static void atIndex( final int[] array, int index, int value ) {
"""
Sets the value at the given index.
@param array the array you are setting the value to.
@param value the new value.
"""
final int i = calculateIndex( array, index );
array[ i ] = value;
} | java | public static void atIndex( final int[] array, int index, int value ) {
final int i = calculateIndex( array, index );
array[ i ] = value;
} | [
"public",
"static",
"void",
"atIndex",
"(",
"final",
"int",
"[",
"]",
"array",
",",
"int",
"index",
",",
"int",
"value",
")",
"{",
"final",
"int",
"i",
"=",
"calculateIndex",
"(",
"array",
",",
"index",
")",
";",
"array",
"[",
"i",
"]",
"=",
"value... | Sets the value at the given index.
@param array the array you are setting the value to.
@param value the new value. | [
"Sets",
"the",
"value",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/advantageous/boon/blob/12712d376761aa3b33223a9f1716720ddb67cb5e/reflekt/src/main/java/io/advantageous/boon/primitive/Int.java#L217-L221 |
HeidelTime/heideltime | src/jvntextpro/util/StringUtils.java | StringUtils.findFirstOf | public static int findFirstOf (String container, String chars, int begin) {
"""
Find the first occurrence .
@param container the string on which we search
@param chars the string which we search for the occurrence
@param begin the start position to search from
@return the position where chars first occur in ... | java | public static int findFirstOf (String container, String chars, int begin){
int minIdx = -1;
for (int i = 0; i < chars.length() && i >= 0; ++i){
int idx = container.indexOf(chars.charAt(i), begin);
if ( (idx < minIdx && idx != -1) || minIdx == -1){ ... | [
"public",
"static",
"int",
"findFirstOf",
"(",
"String",
"container",
",",
"String",
"chars",
",",
"int",
"begin",
")",
"{",
"int",
"minIdx",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"chars",
".",
"length",
"(",
")",
"... | Find the first occurrence .
@param container the string on which we search
@param chars the string which we search for the occurrence
@param begin the start position to search from
@return the position where chars first occur in the container | [
"Find",
"the",
"first",
"occurrence",
"."
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L50-L59 |
esigate/esigate | esigate-core/src/main/java/org/esigate/impl/UrlRewriter.java | UrlRewriter.rewriteReferer | public String rewriteReferer(String referer, String baseUrl, String visibleBaseUrl) {
"""
Fixes a referer url in a request.
@param referer
the url to fix (can be anything found in an html page, relative, absolute, empty...)
@param baseUrl
The base URL selected for this request.
@param visibleBaseUrl
The ba... | java | public String rewriteReferer(String referer, String baseUrl, String visibleBaseUrl) {
URI uri = UriUtils.createURI(referer);
// Base url should end with /
if (!baseUrl.endsWith("/")) {
baseUrl = baseUrl + "/";
}
URI baseUri = UriUtils.createURI(baseUrl);
// ... | [
"public",
"String",
"rewriteReferer",
"(",
"String",
"referer",
",",
"String",
"baseUrl",
",",
"String",
"visibleBaseUrl",
")",
"{",
"URI",
"uri",
"=",
"UriUtils",
".",
"createURI",
"(",
"referer",
")",
";",
"// Base url should end with /",
"if",
"(",
"!",
"ba... | Fixes a referer url in a request.
@param referer
the url to fix (can be anything found in an html page, relative, absolute, empty...)
@param baseUrl
The base URL selected for this request.
@param visibleBaseUrl
The base URL viewed by the browser.
@return the fixed url. | [
"Fixes",
"a",
"referer",
"url",
"in",
"a",
"request",
"."
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/impl/UrlRewriter.java#L87-L113 |
google/truth | core/src/main/java/com/google/common/truth/MultimapSubject.java | MultimapSubject.containsExactly | @CanIgnoreReturnValue
public Ordered containsExactly(@NullableDecl Object k0, @NullableDecl Object v0, Object... rest) {
"""
Fails if the multimap does not contain exactly the given set of key/value pairs.
<p><b>Warning:</b> the use of varargs means that we cannot guarantee an equal number of
key/value pairs... | java | @CanIgnoreReturnValue
public Ordered containsExactly(@NullableDecl Object k0, @NullableDecl Object v0, Object... rest) {
return containsExactlyEntriesIn(accumulateMultimap(k0, v0, rest));
} | [
"@",
"CanIgnoreReturnValue",
"public",
"Ordered",
"containsExactly",
"(",
"@",
"NullableDecl",
"Object",
"k0",
",",
"@",
"NullableDecl",
"Object",
"v0",
",",
"Object",
"...",
"rest",
")",
"{",
"return",
"containsExactlyEntriesIn",
"(",
"accumulateMultimap",
"(",
"... | Fails if the multimap does not contain exactly the given set of key/value pairs.
<p><b>Warning:</b> the use of varargs means that we cannot guarantee an equal number of
key/value pairs at compile time. Please make sure you provide varargs in key/value pairs! | [
"Fails",
"if",
"the",
"multimap",
"does",
"not",
"contain",
"exactly",
"the",
"given",
"set",
"of",
"key",
"/",
"value",
"pairs",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/MultimapSubject.java#L296-L299 |
azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/webapp/servlet/ExecutorServlet.java | ExecutorServlet.ajaxFetchExecFlowLogs | private void ajaxFetchExecFlowLogs(final HttpServletRequest req,
final HttpServletResponse resp, final HashMap<String, Object> ret, final User user,
final ExecutableFlow exFlow) throws ServletException {
"""
Gets the logs through plain text stream to reduce memory overhead.
"""
final long start... | java | private void ajaxFetchExecFlowLogs(final HttpServletRequest req,
final HttpServletResponse resp, final HashMap<String, Object> ret, final User user,
final ExecutableFlow exFlow) throws ServletException {
final long startMs = System.currentTimeMillis();
final Project project = getProjectAjaxByPermiss... | [
"private",
"void",
"ajaxFetchExecFlowLogs",
"(",
"final",
"HttpServletRequest",
"req",
",",
"final",
"HttpServletResponse",
"resp",
",",
"final",
"HashMap",
"<",
"String",
",",
"Object",
">",
"ret",
",",
"final",
"User",
"user",
",",
"final",
"ExecutableFlow",
"... | Gets the logs through plain text stream to reduce memory overhead. | [
"Gets",
"the",
"logs",
"through",
"plain",
"text",
"stream",
"to",
"reduce",
"memory",
"overhead",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ExecutorServlet.java#L528-L557 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_service_serviceName_task_GET | public ArrayList<Long> billingAccount_service_serviceName_task_GET(String billingAccount, String serviceName, String action, String serviceType, OvhTaskStatusEnum status) throws IOException {
"""
Operations on a telephony service
REST: GET /telephony/{billingAccount}/service/{serviceName}/task
@param action [r... | java | public ArrayList<Long> billingAccount_service_serviceName_task_GET(String billingAccount, String serviceName, String action, String serviceType, OvhTaskStatusEnum status) throws IOException {
String qPath = "/telephony/{billingAccount}/service/{serviceName}/task";
StringBuilder sb = path(qPath, billingAccount, serv... | [
"public",
"ArrayList",
"<",
"Long",
">",
"billingAccount_service_serviceName_task_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"action",
",",
"String",
"serviceType",
",",
"OvhTaskStatusEnum",
"status",
")",
"throws",
"IOException"... | Operations on a telephony service
REST: GET /telephony/{billingAccount}/service/{serviceName}/task
@param action [required] Filter the value of action property (=)
@param status [required] Filter the value of status property (=)
@param serviceType [required] Filter the value of serviceType property (=)
@param billingA... | [
"Operations",
"on",
"a",
"telephony",
"service"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3878-L3886 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/DoubleExtensions.java | DoubleExtensions.operator_power | @Pure
public static double operator_power(Double a, Number b) {
"""
The <code>power</code> operator.
@param a
a double. May not be <code>null</code>.
@param b
a number. May not be <code>null</code>.
@return <code>a ** b</code>
@throws NullPointerException
if {@code a} or {@code b} is <code>null</code>.
... | java | @Pure
public static double operator_power(Double a, Number b) {
return Math.pow(a, b.doubleValue());
} | [
"@",
"Pure",
"public",
"static",
"double",
"operator_power",
"(",
"Double",
"a",
",",
"Number",
"b",
")",
"{",
"return",
"Math",
".",
"pow",
"(",
"a",
",",
"b",
".",
"doubleValue",
"(",
")",
")",
";",
"}"
] | The <code>power</code> operator.
@param a
a double. May not be <code>null</code>.
@param b
a number. May not be <code>null</code>.
@return <code>a ** b</code>
@throws NullPointerException
if {@code a} or {@code b} is <code>null</code>. | [
"The",
"<code",
">",
"power<",
"/",
"code",
">",
"operator",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/DoubleExtensions.java#L78-L81 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslWithProvider.java | PactDslWithProvider.uponReceiving | public PactDslRequestWithoutPath uponReceiving(String description) {
"""
Description of the request that is expected to be received
@param description request description
"""
return new PactDslWithState(consumerPactBuilder, consumerPactBuilder.getConsumerName(), providerName,
defaultReques... | java | public PactDslRequestWithoutPath uponReceiving(String description) {
return new PactDslWithState(consumerPactBuilder, consumerPactBuilder.getConsumerName(), providerName,
defaultRequestValues, defaultResponseValues)
.uponReceiving(description);
} | [
"public",
"PactDslRequestWithoutPath",
"uponReceiving",
"(",
"String",
"description",
")",
"{",
"return",
"new",
"PactDslWithState",
"(",
"consumerPactBuilder",
",",
"consumerPactBuilder",
".",
"getConsumerName",
"(",
")",
",",
"providerName",
",",
"defaultRequestValues",... | Description of the request that is expected to be received
@param description request description | [
"Description",
"of",
"the",
"request",
"that",
"is",
"expected",
"to",
"be",
"received"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslWithProvider.java#L71-L75 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspStatusBean.java | CmsJspStatusBean.includeTemplatePart | public void includeTemplatePart(String target, String element) throws JspException {
"""
Include a template part to display on the error page.<p>
@param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
@param element the element (template selector) to display from the target
... | java | public void includeTemplatePart(String target, String element) throws JspException {
includeTemplatePart(target, element, null);
} | [
"public",
"void",
"includeTemplatePart",
"(",
"String",
"target",
",",
"String",
"element",
")",
"throws",
"JspException",
"{",
"includeTemplatePart",
"(",
"target",
",",
"element",
",",
"null",
")",
";",
"}"
] | Include a template part to display on the error page.<p>
@param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
@param element the element (template selector) to display from the target
@throws JspException in case there were problems including the target | [
"Include",
"a",
"template",
"part",
"to",
"display",
"on",
"the",
"error",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspStatusBean.java#L371-L374 |
elibom/jogger | src/main/java/com/elibom/jogger/middleware/router/RouterMiddleware.java | RouterMiddleware.addInterceptor | public void addInterceptor(Interceptor interceptor, String... paths) {
"""
Adds the <code>interceptor</code> to the list of interceptors that will matches the specified
<code>paths</code>.
@param interceptor the interceptor object to be added.
@param paths the paths in which this interceptor will be invoked, ... | java | public void addInterceptor(Interceptor interceptor, String... paths) {
Preconditions.notNull(interceptor, "no interceptor provided");
interceptors.add(new InterceptorEntry(interceptor, paths));
} | [
"public",
"void",
"addInterceptor",
"(",
"Interceptor",
"interceptor",
",",
"String",
"...",
"paths",
")",
"{",
"Preconditions",
".",
"notNull",
"(",
"interceptor",
",",
"\"no interceptor provided\"",
")",
";",
"interceptors",
".",
"add",
"(",
"new",
"InterceptorE... | Adds the <code>interceptor</code> to the list of interceptors that will matches the specified
<code>paths</code>.
@param interceptor the interceptor object to be added.
@param paths the paths in which this interceptor will be invoked, an empty array to respond to all paths. | [
"Adds",
"the",
"<code",
">",
"interceptor<",
"/",
"code",
">",
"to",
"the",
"list",
"of",
"interceptors",
"that",
"will",
"matches",
"the",
"specified",
"<code",
">",
"paths<",
"/",
"code",
">",
"."
] | train | https://github.com/elibom/jogger/blob/d5892ff45e76328d444a68b5a38c26e7bdd0692b/src/main/java/com/elibom/jogger/middleware/router/RouterMiddleware.java#L286-L289 |
protostuff/protostuff | protostuff-json/src/main/java/io/protostuff/JsonIOUtil.java | JsonIOUtil.parseListFrom | public static <T> List<T> parseListFrom(Reader reader, Schema<T> schema,
boolean numeric) throws IOException {
"""
Parses the {@code messages} from the reader using the given {@code schema}.
"""
final JsonParser parser = DEFAULT_JSON_FACTORY.createJsonParser(reader);
try
... | java | public static <T> List<T> parseListFrom(Reader reader, Schema<T> schema,
boolean numeric) throws IOException
{
final JsonParser parser = DEFAULT_JSON_FACTORY.createJsonParser(reader);
try
{
return parseListFrom(parser, schema, numeric);
}
final... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"parseListFrom",
"(",
"Reader",
"reader",
",",
"Schema",
"<",
"T",
">",
"schema",
",",
"boolean",
"numeric",
")",
"throws",
"IOException",
"{",
"final",
"JsonParser",
"parser",
"=",
"DEFAULT_JSON_FA... | Parses the {@code messages} from the reader using the given {@code schema}. | [
"Parses",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-json/src/main/java/io/protostuff/JsonIOUtil.java#L606-L618 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.