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 |
|---|---|---|---|---|---|---|---|---|---|---|
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/FileOutputFormat.java | FileOutputFormat.getPathForCustomFile | public static Path getPathForCustomFile(JobConf conf, String name) {
"""
Helper function to generate a {@link Path} for a file that is unique for
the task within the job output directory.
<p>The path can be used to create custom files from within the map and
reduce tasks. The path name will be unique for each... | java | public static Path getPathForCustomFile(JobConf conf, String name) {
return new Path(getWorkOutputPath(conf), getUniqueName(conf, name));
} | [
"public",
"static",
"Path",
"getPathForCustomFile",
"(",
"JobConf",
"conf",
",",
"String",
"name",
")",
"{",
"return",
"new",
"Path",
"(",
"getWorkOutputPath",
"(",
"conf",
")",
",",
"getUniqueName",
"(",
"conf",
",",
"name",
")",
")",
";",
"}"
] | Helper function to generate a {@link Path} for a file that is unique for
the task within the job output directory.
<p>The path can be used to create custom files from within the map and
reduce tasks. The path name will be unique for each task. The path parent
will be the job output directory.</p>ls
<p>This method use... | [
"Helper",
"function",
"to",
"generate",
"a",
"{",
"@link",
"Path",
"}",
"for",
"a",
"file",
"that",
"is",
"unique",
"for",
"the",
"task",
"within",
"the",
"job",
"output",
"directory",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/FileOutputFormat.java#L299-L301 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java | XML.addClass | public XML addClass(Class<?> aClass,Attribute[] attributes) {
"""
This method adds aClass with the attributes given as input to XML configuration file.<br>
It's mandatory define at least one attribute.
@param aClass Class to adds
@param attributes attributes of Class
@return this instance
"""
checks... | java | public XML addClass(Class<?> aClass,Attribute[] attributes){
checksClassAbsence(aClass);
XmlClass xmlClass = new XmlClass();
xmlClass.name = aClass.getName();
xmlClass.attributes = new ArrayList<XmlAttribute>();
xmlJmapper.classes.add(xmlClass);
addAttributes(aClass, attributes);
re... | [
"public",
"XML",
"addClass",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"Attribute",
"[",
"]",
"attributes",
")",
"{",
"checksClassAbsence",
"(",
"aClass",
")",
";",
"XmlClass",
"xmlClass",
"=",
"new",
"XmlClass",
"(",
")",
";",
"xmlClass",
".",
"name",... | This method adds aClass with the attributes given as input to XML configuration file.<br>
It's mandatory define at least one attribute.
@param aClass Class to adds
@param attributes attributes of Class
@return this instance | [
"This",
"method",
"adds",
"aClass",
"with",
"the",
"attributes",
"given",
"as",
"input",
"to",
"XML",
"configuration",
"file",
".",
"<br",
">",
"It",
"s",
"mandatory",
"define",
"at",
"least",
"one",
"attribute",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java#L237-L249 |
twitter/chill | chill-java/src/main/java/com/twitter/chill/config/ConfiguredInstantiator.java | ConfiguredInstantiator.setReflect | public static void setReflect(Config conf, Class<? extends KryoInstantiator> instClass) {
"""
In this mode, we are just refecting to another delegated class. This is preferred
if you don't have any configuration to do at runtime (i.e. you can make a named class
that has all the logic for your KryoInstantiator).
... | java | public static void setReflect(Config conf, Class<? extends KryoInstantiator> instClass) {
conf.set(KEY, instClass.getName());
} | [
"public",
"static",
"void",
"setReflect",
"(",
"Config",
"conf",
",",
"Class",
"<",
"?",
"extends",
"KryoInstantiator",
">",
"instClass",
")",
"{",
"conf",
".",
"set",
"(",
"KEY",
",",
"instClass",
".",
"getName",
"(",
")",
")",
";",
"}"
] | In this mode, we are just refecting to another delegated class. This is preferred
if you don't have any configuration to do at runtime (i.e. you can make a named class
that has all the logic for your KryoInstantiator). | [
"In",
"this",
"mode",
"we",
"are",
"just",
"refecting",
"to",
"another",
"delegated",
"class",
".",
"This",
"is",
"preferred",
"if",
"you",
"don",
"t",
"have",
"any",
"configuration",
"to",
"do",
"at",
"runtime",
"(",
"i",
".",
"e",
".",
"you",
"can",
... | train | https://github.com/twitter/chill/blob/0919984ec3aeb320ff522911c726425e9f18ea41/chill-java/src/main/java/com/twitter/chill/config/ConfiguredInstantiator.java#L89-L91 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java | TimestampUtils.timeToString | public String timeToString(java.util.Date time, boolean withTimeZone) {
"""
Returns the given time value as String matching what the current postgresql server would send
in text mode.
@param time time value
@param withTimeZone whether timezone should be added
@return given time value as String
"""
Ca... | java | public String timeToString(java.util.Date time, boolean withTimeZone) {
Calendar cal = null;
if (withTimeZone) {
cal = calendarWithUserTz;
cal.setTimeZone(timeZoneProvider.get());
}
if (time instanceof Timestamp) {
return toString(cal, (Timestamp) time, withTimeZone);
}
if (tim... | [
"public",
"String",
"timeToString",
"(",
"java",
".",
"util",
".",
"Date",
"time",
",",
"boolean",
"withTimeZone",
")",
"{",
"Calendar",
"cal",
"=",
"null",
";",
"if",
"(",
"withTimeZone",
")",
"{",
"cal",
"=",
"calendarWithUserTz",
";",
"cal",
".",
"set... | Returns the given time value as String matching what the current postgresql server would send
in text mode.
@param time time value
@param withTimeZone whether timezone should be added
@return given time value as String | [
"Returns",
"the",
"given",
"time",
"value",
"as",
"String",
"matching",
"what",
"the",
"current",
"postgresql",
"server",
"would",
"send",
"in",
"text",
"mode",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L1307-L1320 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java | SimpleAuthenticator.unregisterPasswordAuthentication | public PasswordAuthentication unregisterPasswordAuthentication(InetAddress pAddress, int pPort, String pProtocol, String pPrompt, String pScheme) {
"""
Unregisters a PasswordAuthentication with a given net address.
"""
return passwordAuthentications.remove(new AuthKey(pAddress, pPort, pProtocol, pPromp... | java | public PasswordAuthentication unregisterPasswordAuthentication(InetAddress pAddress, int pPort, String pProtocol, String pPrompt, String pScheme) {
return passwordAuthentications.remove(new AuthKey(pAddress, pPort, pProtocol, pPrompt, pScheme));
} | [
"public",
"PasswordAuthentication",
"unregisterPasswordAuthentication",
"(",
"InetAddress",
"pAddress",
",",
"int",
"pPort",
",",
"String",
"pProtocol",
",",
"String",
"pPrompt",
",",
"String",
"pScheme",
")",
"{",
"return",
"passwordAuthentications",
".",
"remove",
"... | Unregisters a PasswordAuthentication with a given net address. | [
"Unregisters",
"a",
"PasswordAuthentication",
"with",
"a",
"given",
"net",
"address",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java#L183-L185 |
tumblr/jumblr | src/main/java/com/tumblr/jumblr/JumblrClient.java | JumblrClient.blogAvatar | public String blogAvatar(String blogName, Integer size) {
"""
Get a specific size avatar for a given blog
@param blogName the avatar URL of the blog
@param size The size requested
@return a string representing the URL of the avatar
"""
String pathExt = size == null ? "" : "/" + size.toString();
... | java | public String blogAvatar(String blogName, Integer size) {
String pathExt = size == null ? "" : "/" + size.toString();
return requestBuilder.getRedirectUrl(JumblrClient.blogPath(blogName, "/avatar" + pathExt));
} | [
"public",
"String",
"blogAvatar",
"(",
"String",
"blogName",
",",
"Integer",
"size",
")",
"{",
"String",
"pathExt",
"=",
"size",
"==",
"null",
"?",
"\"\"",
":",
"\"/\"",
"+",
"size",
".",
"toString",
"(",
")",
";",
"return",
"requestBuilder",
".",
"getRe... | Get a specific size avatar for a given blog
@param blogName the avatar URL of the blog
@param size The size requested
@return a string representing the URL of the avatar | [
"Get",
"a",
"specific",
"size",
"avatar",
"for",
"a",
"given",
"blog"
] | train | https://github.com/tumblr/jumblr/blob/373629fd545defb016e227ea758f092507fbd624/src/main/java/com/tumblr/jumblr/JumblrClient.java#L272-L275 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java | SystemViewImporter.getAttribute | protected String getAttribute(Map<String, String> attributes, InternalQName name) throws RepositoryException {
"""
Returns the value of the named XML attribute.
@param attributes set of XML attributes
@param name attribute name
@return attribute value, or <code>null</code> if the named attribute is not
found... | java | protected String getAttribute(Map<String, String> attributes, InternalQName name) throws RepositoryException
{
JCRName jname = locationFactory.createJCRName(name);
return attributes.get(jname.getAsString());
} | [
"protected",
"String",
"getAttribute",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
",",
"InternalQName",
"name",
")",
"throws",
"RepositoryException",
"{",
"JCRName",
"jname",
"=",
"locationFactory",
".",
"createJCRName",
"(",
"name",
")",
";",
... | Returns the value of the named XML attribute.
@param attributes set of XML attributes
@param name attribute name
@return attribute value, or <code>null</code> if the named attribute is not
found
@throws RepositoryException | [
"Returns",
"the",
"value",
"of",
"the",
"named",
"XML",
"attribute",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java#L714-L718 |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.addReference | public void addReference(final String propertyName, final BeanId ref) {
"""
Add a reference to a property on this bean.
A reference identify other beans based on schema and instance id.
@param propertyName name of the property as defined by the bean's schema.
@param ref the reference as defined by the bea... | java | public void addReference(final String propertyName, final BeanId ref) {
Preconditions.checkNotNull(ref);
Preconditions.checkNotNull(propertyName);
checkCircularReference(ref);
List<BeanId> list = references.get(propertyName);
if (list == null) {
list = new ArrayList<>... | [
"public",
"void",
"addReference",
"(",
"final",
"String",
"propertyName",
",",
"final",
"BeanId",
"ref",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"ref",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
")",
";",
"checkCircularRefe... | Add a reference to a property on this bean.
A reference identify other beans based on schema and instance id.
@param propertyName name of the property as defined by the bean's schema.
@param ref the reference as defined by the bean's schema. | [
"Add",
"a",
"reference",
"to",
"a",
"property",
"on",
"this",
"bean",
"."
] | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L321-L333 |
JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/BaseMenuPresenter.java | BaseMenuPresenter.addItemView | protected void addItemView(View itemView, int childIndex) {
"""
Add an item view at the given index.
@param itemView View to add
@param childIndex Index within the parent to insert at
"""
final ViewGroup currentParent = (ViewGroup) itemView.getParent();
if (currentParent != null) {
... | java | protected void addItemView(View itemView, int childIndex) {
final ViewGroup currentParent = (ViewGroup) itemView.getParent();
if (currentParent != null) {
currentParent.removeView(itemView);
}
((ViewGroup) mMenuView).addView(itemView, childIndex);
} | [
"protected",
"void",
"addItemView",
"(",
"View",
"itemView",
",",
"int",
"childIndex",
")",
"{",
"final",
"ViewGroup",
"currentParent",
"=",
"(",
"ViewGroup",
")",
"itemView",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"currentParent",
"!=",
"null",
")",
... | Add an item view at the given index.
@param itemView View to add
@param childIndex Index within the parent to insert at | [
"Add",
"an",
"item",
"view",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/BaseMenuPresenter.java#L126-L132 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getPatternAnyEntityInfosWithServiceResponseAsync | public Observable<ServiceResponse<List<PatternAnyEntityExtractor>>> getPatternAnyEntityInfosWithServiceResponseAsync(UUID appId, String versionId, GetPatternAnyEntityInfosOptionalParameter getPatternAnyEntityInfosOptionalParameter) {
"""
Get information about the Pattern.Any entity models.
@param appId The appl... | java | public Observable<ServiceResponse<List<PatternAnyEntityExtractor>>> getPatternAnyEntityInfosWithServiceResponseAsync(UUID appId, String versionId, GetPatternAnyEntityInfosOptionalParameter getPatternAnyEntityInfosOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentExc... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"PatternAnyEntityExtractor",
">",
">",
">",
"getPatternAnyEntityInfosWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"GetPatternAnyEntityInfosOptionalParameter",
"getPatternAny... | Get information about the Pattern.Any entity models.
@param appId The application ID.
@param versionId The version ID.
@param getPatternAnyEntityInfosOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the valida... | [
"Get",
"information",
"about",
"the",
"Pattern",
".",
"Any",
"entity",
"models",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L7435-L7449 |
Inbot/inbot-utils | src/main/java/io/inbot/utils/PasswordHash.java | PasswordHash.validatePassword | public static boolean validatePassword(String password, String correctHash) throws NoSuchAlgorithmException, InvalidKeySpecException {
"""
Validates a password using a hash.
@param password
the password to check
@param correctHash
the hash of the valid password
@return true if the password is correct, false... | java | public static boolean validatePassword(String password, String correctHash) throws NoSuchAlgorithmException, InvalidKeySpecException {
return validatePassword(password.toCharArray(), correctHash);
} | [
"public",
"static",
"boolean",
"validatePassword",
"(",
"String",
"password",
",",
"String",
"correctHash",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
"{",
"return",
"validatePassword",
"(",
"password",
".",
"toCharArray",
"(",
")",
","... | Validates a password using a hash.
@param password
the password to check
@param correctHash
the hash of the valid password
@return true if the password is correct, false if not
@throws NoSuchAlgorithmException if jdk does not support the algorithm
@throws InvalidKeySpecException if the password or salt are invalid | [
"Validates",
"a",
"password",
"using",
"a",
"hash",
"."
] | train | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/PasswordHash.java#L101-L103 |
alkacon/opencms-core | src-gwt/org/opencms/ade/publish/client/CmsPublishConfirmationDialog.java | CmsPublishConfirmationDialog.getMessage | protected String getMessage(String key, Object... args) {
"""
Helper method to get a localized message.<p>
@param key the message key
@param args the message parameters
@return the localized message
"""
return Messages.get().getBundle().key(key, args);
} | java | protected String getMessage(String key, Object... args) {
return Messages.get().getBundle().key(key, args);
} | [
"protected",
"String",
"getMessage",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"Messages",
".",
"get",
"(",
")",
".",
"getBundle",
"(",
")",
".",
"key",
"(",
"key",
",",
"args",
")",
";",
"}"
] | Helper method to get a localized message.<p>
@param key the message key
@param args the message parameters
@return the localized message | [
"Helper",
"method",
"to",
"get",
"a",
"localized",
"message",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/publish/client/CmsPublishConfirmationDialog.java#L139-L142 |
unbescape/unbescape | src/main/java/org/unbescape/properties/PropertiesEscape.java | PropertiesEscape.escapePropertiesKeyMinimal | public static void escapePropertiesKeyMinimal(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform a Java Properties Key level 1 (only basic set) <strong>escape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> me... | java | public static void escapePropertiesKeyMinimal(final String text, final Writer writer)
throws IOException {
escapePropertiesKey(text, writer, PropertiesKeyEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapePropertiesKeyMinimal",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapePropertiesKey",
"(",
"text",
",",
"writer",
",",
"PropertiesKeyEscapeLevel",
".",
"LEVEL_1_BASIC_ESCAP... | <p>
Perform a Java Properties Key level 1 (only basic set) <strong>escape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will only escape the Java Properties Key basic escape set:
</p>
<ul>
<li>The <em>Single Escape Characters</em>:
<tt>&... | [
"<p",
">",
"Perform",
"a",
"Java",
"Properties",
"Key",
"level",
"1",
"(",
"only",
"basic",
"set",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L936-L939 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/ner/CMMClassifier.java | CMMClassifier.getDataset | public Dataset<String, String> getDataset(Collection<List<IN>> data) {
"""
Build a Dataset from some data. Used for training a classifier.
@param data This variable is a list of lists of CoreLabel. That is,
it is a collection of documents, each of which is represented
as a sequence of CoreLabel objects.
@re... | java | public Dataset<String, String> getDataset(Collection<List<IN>> data) {
return getDataset(data, null, null);
} | [
"public",
"Dataset",
"<",
"String",
",",
"String",
">",
"getDataset",
"(",
"Collection",
"<",
"List",
"<",
"IN",
">",
">",
"data",
")",
"{",
"return",
"getDataset",
"(",
"data",
",",
"null",
",",
"null",
")",
";",
"}"
] | Build a Dataset from some data. Used for training a classifier.
@param data This variable is a list of lists of CoreLabel. That is,
it is a collection of documents, each of which is represented
as a sequence of CoreLabel objects.
@return The Dataset which is an efficient encoding of the information
in a List of Datum... | [
"Build",
"a",
"Dataset",
"from",
"some",
"data",
".",
"Used",
"for",
"training",
"a",
"classifier",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/ner/CMMClassifier.java#L629-L631 |
mfornos/humanize | humanize-slim/src/main/java/humanize/Humanize.java | Humanize.fixLength | public static String fixLength(final String text, final int charsNum, final char paddingChar) {
"""
<p>
Pads or truncates a string to a specified length.
</p>
@param text
String to be fixed
@param charsNum
The fixed length in number of chars
@param paddingChar
The padding character
@return A fixed lengt... | java | public static String fixLength(final String text, final int charsNum, final char paddingChar)
{
return fixLength(text, charsNum, paddingChar, false);
} | [
"public",
"static",
"String",
"fixLength",
"(",
"final",
"String",
"text",
",",
"final",
"int",
"charsNum",
",",
"final",
"char",
"paddingChar",
")",
"{",
"return",
"fixLength",
"(",
"text",
",",
"charsNum",
",",
"paddingChar",
",",
"false",
")",
";",
"}"
... | <p>
Pads or truncates a string to a specified length.
</p>
@param text
String to be fixed
@param charsNum
The fixed length in number of chars
@param paddingChar
The padding character
@return A fixed length string | [
"<p",
">",
"Pads",
"or",
"truncates",
"a",
"string",
"to",
"a",
"specified",
"length",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/Humanize.java#L802-L805 |
structurizr/java | structurizr-core/src/com/structurizr/view/ViewSet.java | ViewSet.createSystemContextView | public SystemContextView createSystemContextView(SoftwareSystem softwareSystem, String key, String description) {
"""
Creates a system context view, where the scope of the view is the specified software system.
@param softwareSystem the SoftwareSystem object representing the scope of the view
@param key ... | java | public SystemContextView createSystemContextView(SoftwareSystem softwareSystem, String key, String description) {
assertThatTheSoftwareSystemIsNotNull(softwareSystem);
assertThatTheViewKeyIsSpecifiedAndUnique(key);
SystemContextView view = new SystemContextView(softwareSystem, key, description)... | [
"public",
"SystemContextView",
"createSystemContextView",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"String",
"key",
",",
"String",
"description",
")",
"{",
"assertThatTheSoftwareSystemIsNotNull",
"(",
"softwareSystem",
")",
";",
"assertThatTheViewKeyIsSpecifiedAndUnique",
... | Creates a system context view, where the scope of the view is the specified software system.
@param softwareSystem the SoftwareSystem object representing the scope of the view
@param key the key for the view (must be unique)
@param description a description of the view
@return a... | [
"Creates",
"a",
"system",
"context",
"view",
"where",
"the",
"scope",
"of",
"the",
"view",
"is",
"the",
"specified",
"software",
"system",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/view/ViewSet.java#L71-L79 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java | PCA.pca_factor | public static INDArray pca_factor(INDArray A, int nDims, boolean normalize) {
"""
Calculates pca factors of a matrix, for a flags number of reduced features
returns the factors to scale observations
The return is a factor matrix to reduce (normalized) feature sets
@see pca(INDArray, int, boolean)
@param ... | java | public static INDArray pca_factor(INDArray A, int nDims, boolean normalize) {
if (normalize) {
// Normalize to mean 0 for each feature ( each column has 0 mean )
INDArray mean = A.mean(0);
A.subiRowVector(mean);
}
long m = A.rows();
long n = A.column... | [
"public",
"static",
"INDArray",
"pca_factor",
"(",
"INDArray",
"A",
",",
"int",
"nDims",
",",
"boolean",
"normalize",
")",
"{",
"if",
"(",
"normalize",
")",
"{",
"// Normalize to mean 0 for each feature ( each column has 0 mean )",
"INDArray",
"mean",
"=",
"A",
".",... | Calculates pca factors of a matrix, for a flags number of reduced features
returns the factors to scale observations
The return is a factor matrix to reduce (normalized) feature sets
@see pca(INDArray, int, boolean)
@param A the array of features, rows are results, columns are features - will be changed
@param nDims... | [
"Calculates",
"pca",
"factors",
"of",
"a",
"matrix",
"for",
"a",
"flags",
"number",
"of",
"reduced",
"features",
"returns",
"the",
"factors",
"to",
"scale",
"observations"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java#L173-L202 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/font/MalisisFont.java | MalisisFont.getCharHeight | public float getCharHeight(char c, FontOptions options) {
"""
Gets the rendering height of a character.
@param c the c
@param options the options
@return the char height
"""
return getCharData(c).getCharHeight() / fontGeneratorOptions.fontSize * (options != null ? options.getFontScale() : 1) * 9;
} | java | public float getCharHeight(char c, FontOptions options)
{
return getCharData(c).getCharHeight() / fontGeneratorOptions.fontSize * (options != null ? options.getFontScale() : 1) * 9;
} | [
"public",
"float",
"getCharHeight",
"(",
"char",
"c",
",",
"FontOptions",
"options",
")",
"{",
"return",
"getCharData",
"(",
"c",
")",
".",
"getCharHeight",
"(",
")",
"/",
"fontGeneratorOptions",
".",
"fontSize",
"*",
"(",
"options",
"!=",
"null",
"?",
"op... | Gets the rendering height of a character.
@param c the c
@param options the options
@return the char height | [
"Gets",
"the",
"rendering",
"height",
"of",
"a",
"character",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/font/MalisisFont.java#L540-L543 |
michael-simons/wro4j-spring-boot-starter | src/main/java/ac/simons/spring/boot/wro4j/Wro4jAutoConfiguration.java | Wro4jAutoConfiguration.wroFilter | @Bean
ConfigurableWroFilter wroFilter(WroManagerFactory wroManagerFactory, Wro4jProperties wro4jProperties) {
"""
The final step in configuring the Wro4j filter based on the existing or
previously configured {@code WroManagerFactory} and the additional
properties.
@param wroManagerFactory An existing or the ... | java | @Bean
ConfigurableWroFilter wroFilter(WroManagerFactory wroManagerFactory, Wro4jProperties wro4jProperties) {
ConfigurableWroFilter wroFilter = new ConfigurableWroFilter();
wroFilter.setProperties(wroFilterProperties(wro4jProperties));
wroFilter.setWroManagerFactory(wroManagerFactory);
return wroFilter;
} | [
"@",
"Bean",
"ConfigurableWroFilter",
"wroFilter",
"(",
"WroManagerFactory",
"wroManagerFactory",
",",
"Wro4jProperties",
"wro4jProperties",
")",
"{",
"ConfigurableWroFilter",
"wroFilter",
"=",
"new",
"ConfigurableWroFilter",
"(",
")",
";",
"wroFilter",
".",
"setPropertie... | The final step in configuring the Wro4j filter based on the existing or
previously configured {@code WroManagerFactory} and the additional
properties.
@param wroManagerFactory An existing or the newly configured manager
@param wro4jProperties The properties used to setup this starter
@return A servlet filter which la... | [
"The",
"final",
"step",
"in",
"configuring",
"the",
"Wro4j",
"filter",
"based",
"on",
"the",
"existing",
"or",
"previously",
"configured",
"{",
"@code",
"WroManagerFactory",
"}",
"and",
"the",
"additional",
"properties",
"."
] | train | https://github.com/michael-simons/wro4j-spring-boot-starter/blob/c0d7cc5c03b6f884f63596c36c5e0aa86cd54141/src/main/java/ac/simons/spring/boot/wro4j/Wro4jAutoConfiguration.java#L240-L246 |
akarnokd/akarnokd-xml | src/main/java/hu/akarnokd/xml/XSerializables.java | XSerializables.parseItem | public static <T extends XSerializable> T parseItem(XElement item, Supplier<T> creator) {
"""
Create an XSerializable object through the {@code creator} function
and load it from the {@code item}.
@param <T> the XSerializable object
@param item the item to load from
@param creator the function to create Ts
@r... | java | public static <T extends XSerializable> T parseItem(XElement item, Supplier<T> creator) {
T result = creator.get();
result.load(item);
return result;
} | [
"public",
"static",
"<",
"T",
"extends",
"XSerializable",
">",
"T",
"parseItem",
"(",
"XElement",
"item",
",",
"Supplier",
"<",
"T",
">",
"creator",
")",
"{",
"T",
"result",
"=",
"creator",
".",
"get",
"(",
")",
";",
"result",
".",
"load",
"(",
"item... | Create an XSerializable object through the {@code creator} function
and load it from the {@code item}.
@param <T> the XSerializable object
@param item the item to load from
@param creator the function to create Ts
@return the created and loaded object | [
"Create",
"an",
"XSerializable",
"object",
"through",
"the",
"{"
] | train | https://github.com/akarnokd/akarnokd-xml/blob/57466a5a9cb455a13d7121557c165287b31ee870/src/main/java/hu/akarnokd/xml/XSerializables.java#L80-L84 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java | Transliterator.registerInstance | static void registerInstance(Transliterator trans, boolean visible) {
"""
Register a Transliterator object.
<p>Because ICU may choose to cache Transliterator objects internally, this must
be called at application startup, prior to any calls to
Transliterator.getInstance to avoid undefined behavior.
@param ... | java | static void registerInstance(Transliterator trans, boolean visible) {
registry.put(trans.getID(), trans, visible);
} | [
"static",
"void",
"registerInstance",
"(",
"Transliterator",
"trans",
",",
"boolean",
"visible",
")",
"{",
"registry",
".",
"put",
"(",
"trans",
".",
"getID",
"(",
")",
",",
"trans",
",",
"visible",
")",
";",
"}"
] | Register a Transliterator object.
<p>Because ICU may choose to cache Transliterator objects internally, this must
be called at application startup, prior to any calls to
Transliterator.getInstance to avoid undefined behavior.
@param trans the Transliterator object | [
"Register",
"a",
"Transliterator",
"object",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java#L1715-L1717 |
apache/incubator-gobblin | gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceExtractor.java | SalesforceExtractor.fetchResultBatchWithRetry | private void fetchResultBatchWithRetry(RecordSetList<JsonElement> rs)
throws AsyncApiException, DataRecordException, IOException {
"""
Fetch a result batch with retry for network errors
@param rs the {@link RecordSetList} to fetch into
"""
boolean success = false;
int retryCount = 0;
int rec... | java | private void fetchResultBatchWithRetry(RecordSetList<JsonElement> rs)
throws AsyncApiException, DataRecordException, IOException {
boolean success = false;
int retryCount = 0;
int recordCountBeforeFetch = this.bulkRecordCount;
do {
try {
// reinitialize the reader to establish a new... | [
"private",
"void",
"fetchResultBatchWithRetry",
"(",
"RecordSetList",
"<",
"JsonElement",
">",
"rs",
")",
"throws",
"AsyncApiException",
",",
"DataRecordException",
",",
"IOException",
"{",
"boolean",
"success",
"=",
"false",
";",
"int",
"retryCount",
"=",
"0",
";... | Fetch a result batch with retry for network errors
@param rs the {@link RecordSetList} to fetch into | [
"Fetch",
"a",
"result",
"batch",
"with",
"retry",
"for",
"network",
"errors"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceExtractor.java#L911-L937 |
stephanenicolas/toothpick | toothpick-runtime/src/main/java/toothpick/ScopeImpl.java | ScopeImpl.installInternalProvider | private <T> InternalProviderImpl installInternalProvider(Class<T> clazz, String bindingName, InternalProviderImpl<? extends T> internalProvider,
boolean isBound, boolean isTestProvider) {
"""
Installs a provider either in the scope or the pool of unbound providers.
@param clazz the class for which to inst... | java | private <T> InternalProviderImpl installInternalProvider(Class<T> clazz, String bindingName, InternalProviderImpl<? extends T> internalProvider,
boolean isBound, boolean isTestProvider) {
if (bindingName == null) {
if (isBound) {
return installUnNamedProvider(mapClassesToUnNamedBoundProviders, c... | [
"private",
"<",
"T",
">",
"InternalProviderImpl",
"installInternalProvider",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"bindingName",
",",
"InternalProviderImpl",
"<",
"?",
"extends",
"T",
">",
"internalProvider",
",",
"boolean",
"isBound",
",",
"bool... | Installs a provider either in the scope or the pool of unbound providers.
@param clazz the class for which to install the provider.
@param bindingName the name, possibly {@code null}, for which to install the scoped provider.
@param internalProvider the internal provider to install.
@param isBound whether or not the p... | [
"Installs",
"a",
"provider",
"either",
"in",
"the",
"scope",
"or",
"the",
"pool",
"of",
"unbound",
"providers",
"."
] | train | https://github.com/stephanenicolas/toothpick/blob/54476ca9a5fa48809c15a46e43e38db9ed7e1a75/toothpick-runtime/src/main/java/toothpick/ScopeImpl.java#L479-L490 |
code4everything/util | src/main/java/com/zhazhapan/util/dialog/Alerts.java | Alerts.showException | public static Optional<ButtonType> showException(String title, Exception e) {
"""
弹出异常框
@param title 标题
@param e 异常
@return {@link ButtonType}
"""
return showException(title, null, e);
} | java | public static Optional<ButtonType> showException(String title, Exception e) {
return showException(title, null, e);
} | [
"public",
"static",
"Optional",
"<",
"ButtonType",
">",
"showException",
"(",
"String",
"title",
",",
"Exception",
"e",
")",
"{",
"return",
"showException",
"(",
"title",
",",
"null",
",",
"e",
")",
";",
"}"
] | 弹出异常框
@param title 标题
@param e 异常
@return {@link ButtonType} | [
"弹出异常框"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/dialog/Alerts.java#L132-L134 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Session.java | Session.openActiveSession | public static Session openActiveSession(Activity activity, boolean allowLoginUI,
StatusCallback callback) {
"""
If allowLoginUI is true, this will create a new Session, make it active, and
open it. If the default token cache is not available, then this will request
basic permissions. If the default t... | java | public static Session openActiveSession(Activity activity, boolean allowLoginUI,
StatusCallback callback) {
return openActiveSession(activity, allowLoginUI, new OpenRequest(activity).setCallback(callback));
} | [
"public",
"static",
"Session",
"openActiveSession",
"(",
"Activity",
"activity",
",",
"boolean",
"allowLoginUI",
",",
"StatusCallback",
"callback",
")",
"{",
"return",
"openActiveSession",
"(",
"activity",
",",
"allowLoginUI",
",",
"new",
"OpenRequest",
"(",
"activi... | If allowLoginUI is true, this will create a new Session, make it active, and
open it. If the default token cache is not available, then this will request
basic permissions. If the default token cache is available and cached tokens
are loaded, this will use the cached token and associated permissions.
<p/>
If allowedLog... | [
"If",
"allowLoginUI",
"is",
"true",
"this",
"will",
"create",
"a",
"new",
"Session",
"make",
"it",
"active",
"and",
"open",
"it",
".",
"If",
"the",
"default",
"token",
"cache",
"is",
"not",
"available",
"then",
"this",
"will",
"request",
"basic",
"permissi... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Session.java#L1015-L1018 |
airlift/slice | src/main/java/io/airlift/slice/Slices.java | Slices.wrappedDoubleArray | public static Slice wrappedDoubleArray(double[] array, int offset, int length) {
"""
Creates a slice over the specified array range.
@param offset the array position at which the slice begins
@param length the number of array positions to include in the slice
"""
if (length == 0) {
retu... | java | public static Slice wrappedDoubleArray(double[] array, int offset, int length)
{
if (length == 0) {
return EMPTY_SLICE;
}
return new Slice(array, offset, length);
} | [
"public",
"static",
"Slice",
"wrappedDoubleArray",
"(",
"double",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"EMPTY_SLICE",
";",
"}",
"return",
"new",
"Slice",
"(",
"arra... | Creates a slice over the specified array range.
@param offset the array position at which the slice begins
@param length the number of array positions to include in the slice | [
"Creates",
"a",
"slice",
"over",
"the",
"specified",
"array",
"range",
"."
] | train | https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/Slices.java#L281-L287 |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/proxy/ClientPNCounterProxy.java | ClientPNCounterProxy.invokeGetInternal | private ClientMessage invokeGetInternal(List<Address> excludedAddresses,
HazelcastException lastException,
Address target) {
"""
Returns the current value of the counter.
It will invoke client messages recursively on viable re... | java | private ClientMessage invokeGetInternal(List<Address> excludedAddresses,
HazelcastException lastException,
Address target) {
if (target == null) {
throw lastException != null
? lastException
... | [
"private",
"ClientMessage",
"invokeGetInternal",
"(",
"List",
"<",
"Address",
">",
"excludedAddresses",
",",
"HazelcastException",
"lastException",
",",
"Address",
"target",
")",
"{",
"if",
"(",
"target",
"==",
"null",
")",
"{",
"throw",
"lastException",
"!=",
"... | Returns the current value of the counter.
It will invoke client messages recursively on viable replica addresses
until successful or the list of viable replicas is exhausted.
Replicas with addresses contained in the {@code excludedAddresses} are
skipped. If there are no viable replicas, this method will throw the
{@cod... | [
"Returns",
"the",
"current",
"value",
"of",
"the",
"counter",
".",
"It",
"will",
"invoke",
"client",
"messages",
"recursively",
"on",
"viable",
"replica",
"addresses",
"until",
"successful",
"or",
"the",
"list",
"of",
"viable",
"replicas",
"is",
"exhausted",
"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/proxy/ClientPNCounterProxy.java#L289-L310 |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.readAll | public int readAll(CharBuffer buf, int length) throws IOException {
"""
Reads characters from the stream, appending to the character buffer.
<code>length</code> characters will always be read until the end of
file.
@param buf character buffer to fill
@param length maximum number of characters to read
@retur... | java | public int readAll(CharBuffer buf, int length) throws IOException
{
int len = buf.length();
buf.length(len + length);
int readLength = readAll(buf.buffer(), len, length);
if (readLength < 0)
buf.length(len);
else if (readLength < length)
buf.length(len + readLength);
return lengt... | [
"public",
"int",
"readAll",
"(",
"CharBuffer",
"buf",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"buf",
".",
"length",
"(",
")",
";",
"buf",
".",
"length",
"(",
"len",
"+",
"length",
")",
";",
"int",
"readLength",
"="... | Reads characters from the stream, appending to the character buffer.
<code>length</code> characters will always be read until the end of
file.
@param buf character buffer to fill
@param length maximum number of characters to read
@return number of characters read or -1 on end of file. | [
"Reads",
"characters",
"from",
"the",
"stream",
"appending",
"to",
"the",
"character",
"buffer",
".",
"<code",
">",
"length<",
"/",
"code",
">",
"characters",
"will",
"always",
"be",
"read",
"until",
"the",
"end",
"of",
"file",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L716-L728 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java | RaftNodeImpl.takeSnapshotIfCommitIndexAdvanced | private void takeSnapshotIfCommitIndexAdvanced() {
"""
Takes a snapshot if {@code commitIndex} advanced equal to or more than
{@link RaftAlgorithmConfig#getCommitIndexAdvanceCountToSnapshot()}.
<p>
Snapshot is not created if there's an ongoing membership change or Raft group is being destroyed.
"""
... | java | private void takeSnapshotIfCommitIndexAdvanced() {
long commitIndex = state.commitIndex();
if ((commitIndex - state.log().snapshotIndex()) < commitIndexAdvanceCountToSnapshot) {
return;
}
if (isTerminatedOrSteppedDown()) {
// If the status is UPDATING_MEMBER_LIST... | [
"private",
"void",
"takeSnapshotIfCommitIndexAdvanced",
"(",
")",
"{",
"long",
"commitIndex",
"=",
"state",
".",
"commitIndex",
"(",
")",
";",
"if",
"(",
"(",
"commitIndex",
"-",
"state",
".",
"log",
"(",
")",
".",
"snapshotIndex",
"(",
")",
")",
"<",
"c... | Takes a snapshot if {@code commitIndex} advanced equal to or more than
{@link RaftAlgorithmConfig#getCommitIndexAdvanceCountToSnapshot()}.
<p>
Snapshot is not created if there's an ongoing membership change or Raft group is being destroyed. | [
"Takes",
"a",
"snapshot",
"if",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java#L731-L772 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/FileWatcher.java | FileWatcher.weakAddWatcher | @Deprecated
public void weakAddWatcher(File file, Listener watcher) {
"""
Start watching file path and notify watcher for updates on that file.
The watcher will be kept in a weak reference and will allow GC to delete
the instance.
@param file The file path to watch.
@param watcher The watcher to be notif... | java | @Deprecated
public void weakAddWatcher(File file, Listener watcher) {
weakAddWatcher(file.toPath(), watcher);
} | [
"@",
"Deprecated",
"public",
"void",
"weakAddWatcher",
"(",
"File",
"file",
",",
"Listener",
"watcher",
")",
"{",
"weakAddWatcher",
"(",
"file",
".",
"toPath",
"(",
")",
",",
"watcher",
")",
";",
"}"
] | Start watching file path and notify watcher for updates on that file.
The watcher will be kept in a weak reference and will allow GC to delete
the instance.
@param file The file path to watch.
@param watcher The watcher to be notified.
@deprecated Use {@link #weakAddWatcher(Path, Listener)} | [
"Start",
"watching",
"file",
"path",
"and",
"notify",
"watcher",
"for",
"updates",
"on",
"that",
"file",
".",
"The",
"watcher",
"will",
"be",
"kept",
"in",
"a",
"weak",
"reference",
"and",
"will",
"allow",
"GC",
"to",
"delete",
"the",
"instance",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/FileWatcher.java#L264-L267 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/common/utils/internal/RepositoryCommonUtils.java | RepositoryCommonUtils.localeForString | public static Locale localeForString(String localeString) {
"""
Creates a locale based on a String of the form language_country_variant,
either of the last two parts can be omitted.
@param localeString The locale string
@return The locale
"""
if (localeString == null || localeString.isEmpty()) {
... | java | public static Locale localeForString(String localeString) {
if (localeString == null || localeString.isEmpty()) {
return null;
}
Locale locale;
String[] localeParts = localeString.split("_");
switch (localeParts.length) {
case 1:
locale = n... | [
"public",
"static",
"Locale",
"localeForString",
"(",
"String",
"localeString",
")",
"{",
"if",
"(",
"localeString",
"==",
"null",
"||",
"localeString",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"Locale",
"locale",
";",
"String",
"[",... | Creates a locale based on a String of the form language_country_variant,
either of the last two parts can be omitted.
@param localeString The locale string
@return The locale | [
"Creates",
"a",
"locale",
"based",
"on",
"a",
"String",
"of",
"the",
"form",
"language_country_variant",
"either",
"of",
"the",
"last",
"two",
"parts",
"can",
"be",
"omitted",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/common/utils/internal/RepositoryCommonUtils.java#L27-L51 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Locale.java | Locale.getInstance | static Locale getInstance(String language, String country, String variant) {
"""
Returns a <code>Locale</code> constructed from the given
<code>language</code>, <code>country</code> and
<code>variant</code>. If the same <code>Locale</code> instance
is available in the cache, then that instance is
returned. Oth... | java | static Locale getInstance(String language, String country, String variant) {
return getInstance(language, "", country, variant, null);
} | [
"static",
"Locale",
"getInstance",
"(",
"String",
"language",
",",
"String",
"country",
",",
"String",
"variant",
")",
"{",
"return",
"getInstance",
"(",
"language",
",",
"\"\"",
",",
"country",
",",
"variant",
",",
"null",
")",
";",
"}"
] | Returns a <code>Locale</code> constructed from the given
<code>language</code>, <code>country</code> and
<code>variant</code>. If the same <code>Locale</code> instance
is available in the cache, then that instance is
returned. Otherwise, a new <code>Locale</code> instance is
created and cached.
@param language lowerca... | [
"Returns",
"a",
"<code",
">",
"Locale<",
"/",
"code",
">",
"constructed",
"from",
"the",
"given",
"<code",
">",
"language<",
"/",
"code",
">",
"<code",
">",
"country<",
"/",
"code",
">",
"and",
"<code",
">",
"variant<",
"/",
"code",
">",
".",
"If",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Locale.java#L728-L730 |
Metatavu/edelphi | edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/panels/PanelUserDAO.java | PanelUserDAO.updateJoinType | public PanelUser updateJoinType(PanelUser panelUser, PanelUserJoinType joinType, User modifier) {
"""
Updates panel user's join type
@param panelUser panel user
@param joinType new join type
@param modifier modifier
@return updated user
"""
panelUser.setJoinType(joinType);
panelUser.setLastModifi... | java | public PanelUser updateJoinType(PanelUser panelUser, PanelUserJoinType joinType, User modifier) {
panelUser.setJoinType(joinType);
panelUser.setLastModified(new Date());
panelUser.setLastModifier(modifier);
return persist(panelUser);
} | [
"public",
"PanelUser",
"updateJoinType",
"(",
"PanelUser",
"panelUser",
",",
"PanelUserJoinType",
"joinType",
",",
"User",
"modifier",
")",
"{",
"panelUser",
".",
"setJoinType",
"(",
"joinType",
")",
";",
"panelUser",
".",
"setLastModified",
"(",
"new",
"Date",
... | Updates panel user's join type
@param panelUser panel user
@param joinType new join type
@param modifier modifier
@return updated user | [
"Updates",
"panel",
"user",
"s",
"join",
"type"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/panels/PanelUserDAO.java#L180-L186 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getCascadeValue | public static String getCascadeValue(final Element elem, final String attrName) {
"""
Get cascaded attribute value.
@param elem attribute parent element
@param attrName attribute name
@return attribute value, {@code null} if not set
"""
Element current = elem;
while (current != null) {
... | java | public static String getCascadeValue(final Element elem, final String attrName) {
Element current = elem;
while (current != null) {
final Attr attr = current.getAttributeNode(attrName);
if (attr != null) {
return attr.getValue();
}
final No... | [
"public",
"static",
"String",
"getCascadeValue",
"(",
"final",
"Element",
"elem",
",",
"final",
"String",
"attrName",
")",
"{",
"Element",
"current",
"=",
"elem",
";",
"while",
"(",
"current",
"!=",
"null",
")",
"{",
"final",
"Attr",
"attr",
"=",
"current"... | Get cascaded attribute value.
@param elem attribute parent element
@param attrName attribute name
@return attribute value, {@code null} if not set | [
"Get",
"cascaded",
"attribute",
"value",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L1020-L1035 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java | XsdAsmInterfaces.sequenceMethod | private void sequenceMethod(Stream<XsdAbstractElement> xsdElements, String className, int interfaceIndex, String apiName, String groupName) {
"""
Postpones the sequence method creation due to solution design.
@param xsdElements A {@link Stream} of {@link XsdElement}, ordered, that represent the sequence.
@param ... | java | private void sequenceMethod(Stream<XsdAbstractElement> xsdElements, String className, int interfaceIndex, String apiName, String groupName) {
pendingSequenceMethods.put(className, classWriter -> createSequence(classWriter, xsdElements, className, interfaceIndex, apiName, groupName));
} | [
"private",
"void",
"sequenceMethod",
"(",
"Stream",
"<",
"XsdAbstractElement",
">",
"xsdElements",
",",
"String",
"className",
",",
"int",
"interfaceIndex",
",",
"String",
"apiName",
",",
"String",
"groupName",
")",
"{",
"pendingSequenceMethods",
".",
"put",
"(",
... | Postpones the sequence method creation due to solution design.
@param xsdElements A {@link Stream} of {@link XsdElement}, ordered, that represent the sequence.
@param className The className of the element which contains this sequence.
@param interfaceIndex The current interfaceIndex that serves as a base to distinguis... | [
"Postpones",
"the",
"sequence",
"method",
"creation",
"due",
"to",
"solution",
"design",
"."
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java#L370-L372 |
stephanenicolas/toothpick | toothpick-runtime/src/main/java/toothpick/Toothpick.java | Toothpick.openScope | private static Scope openScope(Object name, boolean shouldCheckMultipleRootScopes) {
"""
Opens a scope without any parent.
If a scope by this {@code name} already exists, it is returned.
Otherwise a new scope is created.
@param name the name of the scope to open.
@param shouldCheckMultipleRootScopes whether ... | java | private static Scope openScope(Object name, boolean shouldCheckMultipleRootScopes) {
if (name == null) {
throw new IllegalArgumentException("null scope names are not allowed.");
}
Scope scope = MAP_KEY_TO_SCOPE.get(name);
if (scope != null) {
return scope;
}
scope = new ScopeImpl(na... | [
"private",
"static",
"Scope",
"openScope",
"(",
"Object",
"name",
",",
"boolean",
"shouldCheckMultipleRootScopes",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null scope names are not allowed.\"",
")",
";"... | Opens a scope without any parent.
If a scope by this {@code name} already exists, it is returned.
Otherwise a new scope is created.
@param name the name of the scope to open.
@param shouldCheckMultipleRootScopes whether or not to check that the return scope
is not introducing a second tree in TP forest of scopes. | [
"Opens",
"a",
"scope",
"without",
"any",
"parent",
".",
"If",
"a",
"scope",
"by",
"this",
"{",
"@code",
"name",
"}",
"already",
"exists",
"it",
"is",
"returned",
".",
"Otherwise",
"a",
"new",
"scope",
"is",
"created",
"."
] | train | https://github.com/stephanenicolas/toothpick/blob/54476ca9a5fa48809c15a46e43e38db9ed7e1a75/toothpick-runtime/src/main/java/toothpick/Toothpick.java#L93-L111 |
cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java | XLogPDescriptor.getHydrogenCount | private int getHydrogenCount(IAtomContainer ac, IAtom atom) {
"""
Gets the hydrogenCount attribute of the XLogPDescriptor object.
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The hydrogenCount value
"""
List<IAtom> neighbours = ac.getConnected... | java | private int getHydrogenCount(IAtomContainer ac, IAtom atom) {
List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
int hcounter = 0;
for (IAtom neighbour : neighbours) {
if (neighbour.getSymbol().equals("H")) {
hcounter += 1;
}
}
return... | [
"private",
"int",
"getHydrogenCount",
"(",
"IAtomContainer",
"ac",
",",
"IAtom",
"atom",
")",
"{",
"List",
"<",
"IAtom",
">",
"neighbours",
"=",
"ac",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
";",
"int",
"hcounter",
"=",
"0",
";",
"for",
"(",
"IAt... | Gets the hydrogenCount attribute of the XLogPDescriptor object.
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The hydrogenCount value | [
"Gets",
"the",
"hydrogenCount",
"attribute",
"of",
"the",
"XLogPDescriptor",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java#L1013-L1022 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationsInner.java | AnnotationsInner.createAsync | public Observable<List<AnnotationInner>> createAsync(String resourceGroupName, String resourceName, AnnotationInner annotationProperties) {
"""
Create an Annotation of an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Ins... | java | public Observable<List<AnnotationInner>> createAsync(String resourceGroupName, String resourceName, AnnotationInner annotationProperties) {
return createWithServiceResponseAsync(resourceGroupName, resourceName, annotationProperties).map(new Func1<ServiceResponse<List<AnnotationInner>>, List<AnnotationInner>>() ... | [
"public",
"Observable",
"<",
"List",
"<",
"AnnotationInner",
">",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"AnnotationInner",
"annotationProperties",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"resourceG... | Create an Annotation of an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param annotationProperties Properties that need to be specified to create an annotation of a Application Insights component.
... | [
"Create",
"an",
"Annotation",
"of",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationsInner.java#L221-L228 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.updateTags | public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, Map<String, String> tags) {
"""
Updates a network watcher tags.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param tags Resource tags.
@throws Ill... | java | public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags).toBlocking().single().body();
} | [
"public",
"NetworkWatcherInner",
"updateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"net... | Updates a network watcher tags.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param tags Resource tags.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@th... | [
"Updates",
"a",
"network",
"watcher",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L610-L612 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/context/limit/Limit.java | Limit.processParameters | public void processParameters(final List<Object> parameters, final boolean isFetchAll, final DatabaseType databaseType) {
"""
Fill parameters for rewrite limit.
@param parameters parameters
@param isFetchAll is fetch all data or not
@param databaseType database type
"""
fill(parameters);
r... | java | public void processParameters(final List<Object> parameters, final boolean isFetchAll, final DatabaseType databaseType) {
fill(parameters);
rewrite(parameters, isFetchAll, databaseType);
} | [
"public",
"void",
"processParameters",
"(",
"final",
"List",
"<",
"Object",
">",
"parameters",
",",
"final",
"boolean",
"isFetchAll",
",",
"final",
"DatabaseType",
"databaseType",
")",
"{",
"fill",
"(",
"parameters",
")",
";",
"rewrite",
"(",
"parameters",
","... | Fill parameters for rewrite limit.
@param parameters parameters
@param isFetchAll is fetch all data or not
@param databaseType database type | [
"Fill",
"parameters",
"for",
"rewrite",
"limit",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/context/limit/Limit.java#L70-L73 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java | Pool.getConnection | public MariaDbConnection getConnection(String username, String password) throws SQLException {
"""
Get new connection from pool if user and password correspond to pool. If username and password
are different from pool, will return a dedicated connection.
@param username username
@param password password
@ret... | java | public MariaDbConnection getConnection(String username, String password) throws SQLException {
try {
if ((urlParser.getUsername() != null ? urlParser.getUsername().equals(username)
: username == null)
&& (urlParser.getPassword() != null ? urlParser.getPassword().equals(password)
... | [
"public",
"MariaDbConnection",
"getConnection",
"(",
"String",
"username",
",",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"if",
"(",
"(",
"urlParser",
".",
"getUsername",
"(",
")",
"!=",
"null",
"?",
"urlParser",
".",
"getUsername",... | Get new connection from pool if user and password correspond to pool. If username and password
are different from pool, will return a dedicated connection.
@param username username
@param password password
@return connection
@throws SQLException if any error occur during connection | [
"Get",
"new",
"connection",
"from",
"pool",
"if",
"user",
"and",
"password",
"correspond",
"to",
"pool",
".",
"If",
"username",
"and",
"password",
"are",
"different",
"from",
"pool",
"will",
"return",
"a",
"dedicated",
"connection",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java#L425-L447 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/windows/WindowsJNIFaxClientSpi.java | WindowsJNIFaxClientSpi.winGetFaxJobStatus | private String winGetFaxJobStatus(String serverName,int faxJobID) {
"""
This function returns the fax job status.
@param serverName
The fax server name
@param faxJobID
The fax job ID
@return The fax job status
"""
String status=null;
synchronized(WindowsFaxClientSpiHelper.NATIVE_LOC... | java | private String winGetFaxJobStatus(String serverName,int faxJobID)
{
String status=null;
synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK)
{
//pre native call
this.preNativeCall();
//invoke native
status=WindowsJNIFaxClientSpi.get... | [
"private",
"String",
"winGetFaxJobStatus",
"(",
"String",
"serverName",
",",
"int",
"faxJobID",
")",
"{",
"String",
"status",
"=",
"null",
";",
"synchronized",
"(",
"WindowsFaxClientSpiHelper",
".",
"NATIVE_LOCK",
")",
"{",
"//pre native call",
"this",
".",
"preNa... | This function returns the fax job status.
@param serverName
The fax server name
@param faxJobID
The fax job ID
@return The fax job status | [
"This",
"function",
"returns",
"the",
"fax",
"job",
"status",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsJNIFaxClientSpi.java#L349-L362 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.pinchToZoom | public void pinchToZoom(PointF startPoint1, PointF startPoint2, PointF endPoint1, PointF endPoint2) {
"""
Zooms in or out if startPoint1 and startPoint2 are larger or smaller then endPoint1 and endPoint2. Requires API level >= 14.
@param startPoint1 First "finger" down on the screen
@param startPoint2 Second "... | java | public void pinchToZoom(PointF startPoint1, PointF startPoint2, PointF endPoint1, PointF endPoint2)
{
if(config.commandLogging){
Log.d(config.commandLoggingTag, "pinchToZoom("+startPoint1+", "+startPoint2+", "+endPoint1+", "+endPoint2+")");
}
if (android.os.Build.VERSION.SDK_INT < 14){
throw new Runtime... | [
"public",
"void",
"pinchToZoom",
"(",
"PointF",
"startPoint1",
",",
"PointF",
"startPoint2",
",",
"PointF",
"endPoint1",
",",
"PointF",
"endPoint2",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"comma... | Zooms in or out if startPoint1 and startPoint2 are larger or smaller then endPoint1 and endPoint2. Requires API level >= 14.
@param startPoint1 First "finger" down on the screen
@param startPoint2 Second "finger" down on the screen
@param endPoint1 Corresponding ending point of startPoint1
@param endPoint2 Correspondi... | [
"Zooms",
"in",
"or",
"out",
"if",
"startPoint1",
"and",
"startPoint2",
"are",
"larger",
"or",
"smaller",
"then",
"endPoint1",
"and",
"endPoint2",
".",
"Requires",
"API",
"level",
">",
"=",
"14",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2409-L2419 |
dwdyer/reportng | reportng/src/java/main/org/uncommons/reportng/HTMLReporter.java | HTMLReporter.createGroups | private void createGroups(List<ISuite> suites,
File outputDirectory) throws Exception {
"""
Generate a groups list for each suite.
@param outputDirectory The target directory for the generated file(s).
"""
int index = 1;
for (ISuite suite : suites)
{
... | java | private void createGroups(List<ISuite> suites,
File outputDirectory) throws Exception
{
int index = 1;
for (ISuite suite : suites)
{
SortedMap<String, SortedSet<ITestNGMethod>> groups = sortGroups(suite.getMethodsByGroups());
if (!groups.... | [
"private",
"void",
"createGroups",
"(",
"List",
"<",
"ISuite",
">",
"suites",
",",
"File",
"outputDirectory",
")",
"throws",
"Exception",
"{",
"int",
"index",
"=",
"1",
";",
"for",
"(",
"ISuite",
"suite",
":",
"suites",
")",
"{",
"SortedMap",
"<",
"Strin... | Generate a groups list for each suite.
@param outputDirectory The target directory for the generated file(s). | [
"Generate",
"a",
"groups",
"list",
"for",
"each",
"suite",
"."
] | train | https://github.com/dwdyer/reportng/blob/df11f9cd9ab3fb5847fbba94ed3098ae0448f770/reportng/src/java/main/org/uncommons/reportng/HTMLReporter.java#L233-L252 |
hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java | DefaultBeanProcessor.isCompatibleType | private boolean isCompatibleType(Object value, Class<?> type) {
"""
ResultSet.getObject() returns an Integer object for an INT column. The
setter method for the property might take an Integer or a primitive int.
This method returns true if the value can be successfully passed into
the setter method. Remember,... | java | private boolean isCompatibleType(Object value, Class<?> type) {
// Do object check first, then primitives
if (value == null || type.isInstance(value) || matchesPrimitive(type, value.getClass())) {
return true;
}
return false;
} | [
"private",
"boolean",
"isCompatibleType",
"(",
"Object",
"value",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"// Do object check first, then primitives",
"if",
"(",
"value",
"==",
"null",
"||",
"type",
".",
"isInstance",
"(",
"value",
")",
"||",
"matchesPr... | ResultSet.getObject() returns an Integer object for an INT column. The
setter method for the property might take an Integer or a primitive int.
This method returns true if the value can be successfully passed into
the setter method. Remember, Method.invoke() handles the unwrapping
of Integer into an int.
@param valu... | [
"ResultSet",
".",
"getObject",
"()",
"returns",
"an",
"Integer",
"object",
"for",
"an",
"INT",
"column",
".",
"The",
"setter",
"method",
"for",
"the",
"property",
"might",
"take",
"an",
"Integer",
"or",
"a",
"primitive",
"int",
".",
"This",
"method",
"retu... | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java#L219-L227 |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.fromHsl | public static RgbaColor fromHsl(float H, float S, float L) {
"""
Creates a new RgbaColor from the specified HSL components.
<p>
<i>Implementation based on <a
href="http://en.wikipedia.org/wiki/HSL_and_HSV">wikipedia</a>
and <a
href="http://www.w3.org/TR/css3-color/#hsl-color">w3c</a></i>
@param H
Hue [0... | java | public static RgbaColor fromHsl(float H, float S, float L) {
// convert to [0-1]
H /= 360f;
S /= 100f;
L /= 100f;
float R, G, B;
if (S == 0) {
// grey
R = G = B = L;
}
else {
float m2 = L <= 0.5 ? L * (S + 1f) : L + S... | [
"public",
"static",
"RgbaColor",
"fromHsl",
"(",
"float",
"H",
",",
"float",
"S",
",",
"float",
"L",
")",
"{",
"// convert to [0-1]",
"H",
"/=",
"360f",
";",
"S",
"/=",
"100f",
";",
"L",
"/=",
"100f",
";",
"float",
"R",
",",
"G",
",",
"B",
";",
"... | Creates a new RgbaColor from the specified HSL components.
<p>
<i>Implementation based on <a
href="http://en.wikipedia.org/wiki/HSL_and_HSV">wikipedia</a>
and <a
href="http://www.w3.org/TR/css3-color/#hsl-color">w3c</a></i>
@param H
Hue [0,360)
@param S
Saturation [0,100]
@param L
Lightness [0,100] | [
"Creates",
"a",
"new",
"RgbaColor",
"from",
"the",
"specified",
"HSL",
"components",
"."
] | train | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L673-L700 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java | DeprecatedAPIListBuilder.composeDeprecatedList | private void composeDeprecatedList(List<Doc> list, MemberDoc[] members) {
"""
Add the members into a single list of deprecated members.
@param list List of all the particular deprecated members, e.g. methods.
@param members members to be added in the list.
"""
for (MemberDoc member : members) {
... | java | private void composeDeprecatedList(List<Doc> list, MemberDoc[] members) {
for (MemberDoc member : members) {
if (utils.isDeprecated(member)) {
list.add(member);
}
}
} | [
"private",
"void",
"composeDeprecatedList",
"(",
"List",
"<",
"Doc",
">",
"list",
",",
"MemberDoc",
"[",
"]",
"members",
")",
"{",
"for",
"(",
"MemberDoc",
"member",
":",
"members",
")",
"{",
"if",
"(",
"utils",
".",
"isDeprecated",
"(",
"member",
")",
... | Add the members into a single list of deprecated members.
@param list List of all the particular deprecated members, e.g. methods.
@param members members to be added in the list. | [
"Add",
"the",
"members",
"into",
"a",
"single",
"list",
"of",
"deprecated",
"members",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java#L133-L139 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/emoji/CustomEmojiBuilder.java | CustomEmojiBuilder.setImage | public CustomEmojiBuilder setImage(BufferedImage image, String type) {
"""
Sets the image of the emoji.
@param image The image of the emoji.
@param type The type of the image, e.g. "png", "jpg" or "gif".
@return The current instance in order to chain call methods.
"""
delegate.setImage(image, type... | java | public CustomEmojiBuilder setImage(BufferedImage image, String type) {
delegate.setImage(image, type);
return this;
} | [
"public",
"CustomEmojiBuilder",
"setImage",
"(",
"BufferedImage",
"image",
",",
"String",
"type",
")",
"{",
"delegate",
".",
"setImage",
"(",
"image",
",",
"type",
")",
";",
"return",
"this",
";",
"}"
] | Sets the image of the emoji.
@param image The image of the emoji.
@param type The type of the image, e.g. "png", "jpg" or "gif".
@return The current instance in order to chain call methods. | [
"Sets",
"the",
"image",
"of",
"the",
"emoji",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/emoji/CustomEmojiBuilder.java#L109-L112 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/MiscSpec.java | MiscSpec.matchWithExpresion | @Then("^'(.+?)' matches the following cases:$")
public void matchWithExpresion(String envVar, DataTable table) throws Exception {
"""
Check if expression defined by JSOPath (http://goessner.net/articles/JsonPath/index.html)
match in JSON stored in a environment variable.
@param envVar environment variable ... | java | @Then("^'(.+?)' matches the following cases:$")
public void matchWithExpresion(String envVar, DataTable table) throws Exception {
String jsonString = ThreadProperty.get(envVar);
for (PickleRow row : table.getPickleRows()) {
String expression = row.getCells().get(0).getValue();
... | [
"@",
"Then",
"(",
"\"^'(.+?)' matches the following cases:$\"",
")",
"public",
"void",
"matchWithExpresion",
"(",
"String",
"envVar",
",",
"DataTable",
"table",
")",
"throws",
"Exception",
"{",
"String",
"jsonString",
"=",
"ThreadProperty",
".",
"get",
"(",
"envVar"... | Check if expression defined by JSOPath (http://goessner.net/articles/JsonPath/index.html)
match in JSON stored in a environment variable.
@param envVar environment variable where JSON is stored
@param table data table in which each row stores one expression | [
"Check",
"if",
"expression",
"defined",
"by",
"JSOPath",
"(",
"http",
":",
"//",
"goessner",
".",
"net",
"/",
"articles",
"/",
"JsonPath",
"/",
"index",
".",
"html",
")",
"match",
"in",
"JSON",
"stored",
"in",
"a",
"environment",
"variable",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/MiscSpec.java#L204-L216 |
netceteragroup/trema-core | src/main/java/com/netcetera/trema/common/TremaCoreUtil.java | TremaCoreUtil.containsStatus | public static boolean containsStatus(final Status status, final Status[] statusArray) {
"""
Checks whether a given status is contained in an array of status.
@param status the status to be looked for
@param statusArray the status array.
@return true if the given status is contained in the array.
"""
if ... | java | public static boolean containsStatus(final Status status, final Status[] statusArray) {
if (status == null) {
return false;
}
for (Status currentStatus : statusArray) {
if (currentStatus == status) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"containsStatus",
"(",
"final",
"Status",
"status",
",",
"final",
"Status",
"[",
"]",
"statusArray",
")",
"{",
"if",
"(",
"status",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"Status",
"currentStatus",
... | Checks whether a given status is contained in an array of status.
@param status the status to be looked for
@param statusArray the status array.
@return true if the given status is contained in the array. | [
"Checks",
"whether",
"a",
"given",
"status",
"is",
"contained",
"in",
"an",
"array",
"of",
"status",
"."
] | train | https://github.com/netceteragroup/trema-core/blob/e5367f4b80b38038d462627aa146a62bc34fc489/src/main/java/com/netcetera/trema/common/TremaCoreUtil.java#L46-L58 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGate.java | ManagementGate.insertBackwardEdge | void insertBackwardEdge(final ManagementEdge managementEdge, final int index) {
"""
Adds a new edge which arrives at this gate.
@param managementEdge
the edge to be added
@param index
the index at which the edge shall be added
"""
while (index >= this.backwardEdges.size()) {
this.backwardEdges.add(... | java | void insertBackwardEdge(final ManagementEdge managementEdge, final int index) {
while (index >= this.backwardEdges.size()) {
this.backwardEdges.add(null);
}
this.backwardEdges.set(index, managementEdge);
} | [
"void",
"insertBackwardEdge",
"(",
"final",
"ManagementEdge",
"managementEdge",
",",
"final",
"int",
"index",
")",
"{",
"while",
"(",
"index",
">=",
"this",
".",
"backwardEdges",
".",
"size",
"(",
")",
")",
"{",
"this",
".",
"backwardEdges",
".",
"add",
"(... | Adds a new edge which arrives at this gate.
@param managementEdge
the edge to be added
@param index
the index at which the edge shall be added | [
"Adds",
"a",
"new",
"edge",
"which",
"arrives",
"at",
"this",
"gate",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGate.java#L117-L124 |
TheBlackChamber/commons-encryption | src/main/java/net/theblackchamber/crypto/implementations/SecureProperties.java | SecureProperties.attemptEncryption | private String attemptEncryption(String key, String property) {
"""
Utility method which will determine if a requested property needs to be
encrypted. If property key ends in -unencrypted and the encryption
provider is configured this method will return the encrypted property
value. If the key does not include ... | java | private String attemptEncryption(String key, String property) {
try {
if (StringUtils.endsWithIgnoreCase(key, UNENCRYPTED_SUFFIX)) {
if (encryptionProvider == null)
throw new RuntimeCryptoException(
"No encryption provider configured");
return encryptionProvider.encrypt(property);
} else {
... | [
"private",
"String",
"attemptEncryption",
"(",
"String",
"key",
",",
"String",
"property",
")",
"{",
"try",
"{",
"if",
"(",
"StringUtils",
".",
"endsWithIgnoreCase",
"(",
"key",
",",
"UNENCRYPTED_SUFFIX",
")",
")",
"{",
"if",
"(",
"encryptionProvider",
"==",
... | Utility method which will determine if a requested property needs to be
encrypted. If property key ends in -unencrypted and the encryption
provider is configured this method will return the encrypted property
value. If the key does not include -unencrypted then the property value
will be returned.
@param key
@param pr... | [
"Utility",
"method",
"which",
"will",
"determine",
"if",
"a",
"requested",
"property",
"needs",
"to",
"be",
"encrypted",
".",
"If",
"property",
"key",
"ends",
"in",
"-",
"unencrypted",
"and",
"the",
"encryption",
"provider",
"is",
"configured",
"this",
"method... | train | https://github.com/TheBlackChamber/commons-encryption/blob/0cbbf7c07ae3c133cc82b6dde7ab7af91ddf64d0/src/main/java/net/theblackchamber/crypto/implementations/SecureProperties.java#L585-L598 |
qiniu/happy-dns-java | src/main/java/qiniu/happydns/local/Hosts.java | Hosts.putAllInRandomOrder | public synchronized Hosts putAllInRandomOrder(String domain, String[] ips) {
"""
avoid many server visit first ip in same time.s
@param domain 域名
@param ips IP 列表
@return 当前host 实例
"""
Random random = new Random();
int index = (int) (random.nextLong() % ips.length);
if (index < ... | java | public synchronized Hosts putAllInRandomOrder(String domain, String[] ips) {
Random random = new Random();
int index = (int) (random.nextLong() % ips.length);
if (index < 0) {
index += ips.length;
}
LinkedList<String> ipList = new LinkedList<String>();
for (in... | [
"public",
"synchronized",
"Hosts",
"putAllInRandomOrder",
"(",
"String",
"domain",
",",
"String",
"[",
"]",
"ips",
")",
"{",
"Random",
"random",
"=",
"new",
"Random",
"(",
")",
";",
"int",
"index",
"=",
"(",
"int",
")",
"(",
"random",
".",
"nextLong",
... | avoid many server visit first ip in same time.s
@param domain 域名
@param ips IP 列表
@return 当前host 实例 | [
"avoid",
"many",
"server",
"visit",
"first",
"ip",
"in",
"same",
"time",
".",
"s"
] | train | https://github.com/qiniu/happy-dns-java/blob/2900e918d6f9609371a073780224eff170a0d499/src/main/java/qiniu/happydns/local/Hosts.java#L49-L61 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/accounts/A_CmsUsersList.java | A_CmsUsersList.setUserData | protected void setUserData(CmsUser user, CmsListItem item) {
"""
Sets all needed data of the user into the list item object.<p>
@param user the user to set the data for
@param item the list item object to set the data into
"""
item.set(LIST_COLUMN_LOGIN, user.getName());
item.set(LIST_COLU... | java | protected void setUserData(CmsUser user, CmsListItem item) {
item.set(LIST_COLUMN_LOGIN, user.getName());
item.set(LIST_COLUMN_DISPLAY, user.getSimpleName());
item.set(LIST_COLUMN_NAME, user.getFullName());
item.set(LIST_COLUMN_EMAIL, user.getEmail());
item.set(LIST_COLUMN_LASTL... | [
"protected",
"void",
"setUserData",
"(",
"CmsUser",
"user",
",",
"CmsListItem",
"item",
")",
"{",
"item",
".",
"set",
"(",
"LIST_COLUMN_LOGIN",
",",
"user",
".",
"getName",
"(",
")",
")",
";",
"item",
".",
"set",
"(",
"LIST_COLUMN_DISPLAY",
",",
"user",
... | Sets all needed data of the user into the list item object.<p>
@param user the user to set the data for
@param item the list item object to set the data into | [
"Sets",
"all",
"needed",
"data",
"of",
"the",
"user",
"into",
"the",
"list",
"item",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/accounts/A_CmsUsersList.java#L720-L728 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/internal/ReturnActionViewRenderer.java | ReturnActionViewRenderer.renderView | public void renderView(ServletRequest request, ServletResponse response, ServletContext servletContext)
throws IOException {
"""
Render the JavaScript for this framework response to a popup window.
The JavaScript passes a map of field values from the popup back to
a JavaScript routine on the originat... | java | public void renderView(ServletRequest request, ServletResponse response, ServletContext servletContext)
throws IOException
{
ResponseRenderAppender appender = new ResponseRenderAppender(response);
ScriptTag.State state = new ScriptTag.State();
ScriptTag br = (ScriptTag) TagRender... | [
"public",
"void",
"renderView",
"(",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
",",
"ServletContext",
"servletContext",
")",
"throws",
"IOException",
"{",
"ResponseRenderAppender",
"appender",
"=",
"new",
"ResponseRenderAppender",
"(",
"response",
... | Render the JavaScript for this framework response to a popup window.
The JavaScript passes a map of field values from the popup back to
a JavaScript routine on the originating page updating its form fields.
(See {@link org.apache.beehive.netui.tags.html.ConfigurePopup})
The javascript also closes the popup window. | [
"Render",
"the",
"JavaScript",
"for",
"this",
"framework",
"response",
"to",
"a",
"popup",
"window",
".",
"The",
"JavaScript",
"passes",
"a",
"map",
"of",
"field",
"values",
"from",
"the",
"popup",
"back",
"to",
"a",
"JavaScript",
"routine",
"on",
"the",
"... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/internal/ReturnActionViewRenderer.java#L103-L136 |
h2oai/h2o-3 | h2o-core/src/main/java/hex/ModelMetricsBinomial.java | ModelMetricsBinomial.make | static public ModelMetricsBinomial make(Vec targetClassProbs, Vec actualLabels) {
"""
Build a Binomial ModelMetrics object from target-class probabilities, from actual labels, and a given domain for both labels (and domain[1] is the target class)
@param targetClassProbs A Vec containing target class probabilities... | java | static public ModelMetricsBinomial make(Vec targetClassProbs, Vec actualLabels) {
return make(targetClassProbs,actualLabels,actualLabels.domain());
} | [
"static",
"public",
"ModelMetricsBinomial",
"make",
"(",
"Vec",
"targetClassProbs",
",",
"Vec",
"actualLabels",
")",
"{",
"return",
"make",
"(",
"targetClassProbs",
",",
"actualLabels",
",",
"actualLabels",
".",
"domain",
"(",
")",
")",
";",
"}"
] | Build a Binomial ModelMetrics object from target-class probabilities, from actual labels, and a given domain for both labels (and domain[1] is the target class)
@param targetClassProbs A Vec containing target class probabilities
@param actualLabels A Vec containing the actual labels (can be for fewer labels than what's... | [
"Build",
"a",
"Binomial",
"ModelMetrics",
"object",
"from",
"target",
"-",
"class",
"probabilities",
"from",
"actual",
"labels",
"and",
"a",
"given",
"domain",
"for",
"both",
"labels",
"(",
"and",
"domain",
"[",
"1",
"]",
"is",
"the",
"target",
"class",
")... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/ModelMetricsBinomial.java#L78-L80 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/stats/StatsInterface.java | StatsInterface.getPhotosetDomains | public DomainList getPhotosetDomains(Date date, String photosetId, int perPage, int page) throws FlickrException {
"""
Get a list of referring domains for a photoset.
@param date
(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamp... | java | public DomainList getPhotosetDomains(Date date, String photosetId, int perPage, int page) throws FlickrException {
return getDomains(METHOD_GET_PHOTOSET_DOMAINS, "photoset_id", photosetId, date, perPage, page);
} | [
"public",
"DomainList",
"getPhotosetDomains",
"(",
"Date",
"date",
",",
"String",
"photosetId",
",",
"int",
"perPage",
",",
"int",
"page",
")",
"throws",
"FlickrException",
"{",
"return",
"getDomains",
"(",
"METHOD_GET_PHOTOSET_DOMAINS",
",",
"\"photoset_id\"",
",",... | Get a list of referring domains for a photoset.
@param date
(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will
automatically be rounded down to the start of the day.
@param photosetId
(Optional) The id of the photoset to get stats ... | [
"Get",
"a",
"list",
"of",
"referring",
"domains",
"for",
"a",
"photoset",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/stats/StatsInterface.java#L220-L222 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/reflect/MethodInvocation.java | MethodInvocation.newMethodInvocation | public static MethodInvocation newMethodInvocation(Object target, String methodName, Object... args) {
"""
Factory method used to construct an instance of {@link MethodInvocation} initialized with the given
{@link Object target} on which the {@code methodName named} {@link Method} accepting the given
array of {@... | java | public static MethodInvocation newMethodInvocation(Object target, String methodName, Object... args) {
Assert.notNull(target, "Target object cannot be null");
return new MethodInvocation(target, ClassUtils.findMethod(target.getClass(), methodName, args), args);
} | [
"public",
"static",
"MethodInvocation",
"newMethodInvocation",
"(",
"Object",
"target",
",",
"String",
"methodName",
",",
"Object",
"...",
"args",
")",
"{",
"Assert",
".",
"notNull",
"(",
"target",
",",
"\"Target object cannot be null\"",
")",
";",
"return",
"new"... | Factory method used to construct an instance of {@link MethodInvocation} initialized with the given
{@link Object target} on which the {@code methodName named} {@link Method} accepting the given
array of {@link Object arguments} will be invoked.
The {@link String named} {@link Method} represents a {@link java.lang.ref... | [
"Factory",
"method",
"used",
"to",
"construct",
"an",
"instance",
"of",
"{",
"@link",
"MethodInvocation",
"}",
"initialized",
"with",
"the",
"given",
"{",
"@link",
"Object",
"target",
"}",
"on",
"which",
"the",
"{",
"@code",
"methodName",
"named",
"}",
"{",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/reflect/MethodInvocation.java#L122-L126 |
treelogic-swe/aws-mock | example/java/full/client-usage/StartInstancesExample.java | StartInstancesExample.startInstances | public static List<InstanceStateChange> startInstances(final List<String> instanceIDs) {
"""
Start specified instances (power-on the instances).
@param instanceIDs
IDs of the instances start
@return a list of state changes for the instances
"""
// pass any credentials as aws-mock does not authenti... | java | public static List<InstanceStateChange> startInstances(final List<String> instanceIDs) {
// pass any credentials as aws-mock does not authenticate them at all
AWSCredentials credentials = new BasicAWSCredentials("foo", "bar");
AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials);
... | [
"public",
"static",
"List",
"<",
"InstanceStateChange",
">",
"startInstances",
"(",
"final",
"List",
"<",
"String",
">",
"instanceIDs",
")",
"{",
"// pass any credentials as aws-mock does not authenticate them at all",
"AWSCredentials",
"credentials",
"=",
"new",
"BasicAWSC... | Start specified instances (power-on the instances).
@param instanceIDs
IDs of the instances start
@return a list of state changes for the instances | [
"Start",
"specified",
"instances",
"(",
"power",
"-",
"on",
"the",
"instances",
")",
"."
] | train | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/example/java/full/client-usage/StartInstancesExample.java#L34-L49 |
xcesco/kripton | kripton-arch-integration/src/main/java/android/arch/core/internal/SafeIterableMap.java | SafeIterableMap.putIfAbsent | public V putIfAbsent(@NonNull K key, @NonNull V v) {
"""
If the specified key is not already associated
with a value, associates it with the given value.
@param key key with which the specified value is to be associated
@param v value to be associated with the specified key
@return the previous value assoc... | java | public V putIfAbsent(@NonNull K key, @NonNull V v) {
Entry<K, V> entry = get(key);
if (entry != null) {
return entry.mValue;
}
put(key, v);
return null;
} | [
"public",
"V",
"putIfAbsent",
"(",
"@",
"NonNull",
"K",
"key",
",",
"@",
"NonNull",
"V",
"v",
")",
"{",
"Entry",
"<",
"K",
",",
"V",
">",
"entry",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"entry",
"!=",
"null",
")",
"{",
"return",
"entry",
... | If the specified key is not already associated
with a value, associates it with the given value.
@param key key with which the specified value is to be associated
@param v value to be associated with the specified key
@return the previous value associated with the specified key,
or {@code null} if there was no mappi... | [
"If",
"the",
"specified",
"key",
"is",
"not",
"already",
"associated",
"with",
"a",
"value",
"associates",
"it",
"with",
"the",
"given",
"value",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/core/internal/SafeIterableMap.java#L76-L83 |
op4j/op4j | src/main/java/org/op4j/functions/FnString.java | FnString.replaceAll | public static final Function<String,String> replaceAll(final String regex, final String replacement) {
"""
<p>
Replaces in the target String all substrings matching the specified regular expression
with the specified replacement String.
</p>
<p>
Regular expressions must conform to the <tt>java.util.regex.Patt... | java | public static final Function<String,String> replaceAll(final String regex, final String replacement) {
return new Replace(regex, replacement, ReplaceType.ALL);
} | [
"public",
"static",
"final",
"Function",
"<",
"String",
",",
"String",
">",
"replaceAll",
"(",
"final",
"String",
"regex",
",",
"final",
"String",
"replacement",
")",
"{",
"return",
"new",
"Replace",
"(",
"regex",
",",
"replacement",
",",
"ReplaceType",
".",... | <p>
Replaces in the target String all substrings matching the specified regular expression
with the specified replacement String.
</p>
<p>
Regular expressions must conform to the <tt>java.util.regex.Pattern</tt> format.
</p>
@param regex the regular expression to match against
@param replacement the replacement string... | [
"<p",
">",
"Replaces",
"in",
"the",
"target",
"String",
"all",
"substrings",
"matching",
"the",
"specified",
"regular",
"expression",
"with",
"the",
"specified",
"replacement",
"String",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Regular",
"expressions",
"must",
"... | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnString.java#L2058-L2060 |
codelibs/minhash | src/main/java/org/codelibs/minhash/MinHash.java | MinHash.createAnalyzer | public static Analyzer createAnalyzer(final Tokenizer tokenizer,
final int hashBit, final int seed, final int num) {
"""
Create an analyzer to calculate a minhash.
@param tokenizer a tokenizer to parse a text
@param hashBit the number of hash bits
@param seed a base seed for hash function
@param ... | java | public static Analyzer createAnalyzer(final Tokenizer tokenizer,
final int hashBit, final int seed, final int num) {
final HashFunction[] hashFunctions = MinHash.createHashFunctions(seed,
num);
final Analyzer minhashAnalyzer = new Analyzer() {
@Override
... | [
"public",
"static",
"Analyzer",
"createAnalyzer",
"(",
"final",
"Tokenizer",
"tokenizer",
",",
"final",
"int",
"hashBit",
",",
"final",
"int",
"seed",
",",
"final",
"int",
"num",
")",
"{",
"final",
"HashFunction",
"[",
"]",
"hashFunctions",
"=",
"MinHash",
"... | Create an analyzer to calculate a minhash.
@param tokenizer a tokenizer to parse a text
@param hashBit the number of hash bits
@param seed a base seed for hash function
@param num the number of hash functions
@return analyzer used by {@link MinHash#calculate(Analyzer, String)} | [
"Create",
"an",
"analyzer",
"to",
"calculate",
"a",
"minhash",
"."
] | train | https://github.com/codelibs/minhash/blob/2aaa16e3096461c0f550d0eb462ae9e69d1b7749/src/main/java/org/codelibs/minhash/MinHash.java#L249-L263 |
greenjoe/lambdaFromString | src/main/java/pl/joegreen/lambdaFromString/LambdaFactory.java | LambdaFactory.createLambda | public <T> T createLambda(String code, TypeReference<T> typeReference) throws LambdaCreationException {
"""
Creates lambda from the given code.
@param code source of the lambda as you would write it in Java expression {TYPE} lambda = ({CODE});
@param typeReference a subclass of TypeReference class wi... | java | public <T> T createLambda(String code, TypeReference<T> typeReference) throws LambdaCreationException {
String helperClassSource = helperProvider.getHelperClassSource(typeReference.toString(), code, imports, staticImports);
try {
Class<?> helperClass = classFactory.createClass(helperProvider... | [
"public",
"<",
"T",
">",
"T",
"createLambda",
"(",
"String",
"code",
",",
"TypeReference",
"<",
"T",
">",
"typeReference",
")",
"throws",
"LambdaCreationException",
"{",
"String",
"helperClassSource",
"=",
"helperProvider",
".",
"getHelperClassSource",
"(",
"typeR... | Creates lambda from the given code.
@param code source of the lambda as you would write it in Java expression {TYPE} lambda = ({CODE});
@param typeReference a subclass of TypeReference class with the generic argument representing the type of the lambda
, for example <br> {@code new TypeReference<Function<In... | [
"Creates",
"lambda",
"from",
"the",
"given",
"code",
"."
] | train | https://github.com/greenjoe/lambdaFromString/blob/67d383f3922ab066e908b852a531880772bbdf29/src/main/java/pl/joegreen/lambdaFromString/LambdaFactory.java#L69-L85 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/TaskEntity.java | TaskEntity.propertyChanged | protected void propertyChanged(String propertyName, Object orgValue, Object newValue) {
"""
Tracks a property change. Therefore the original and new value are stored in a map.
It tracks multiple changes and if a property finally is changed back to the original
value, then the change is removed.
@param propert... | java | protected void propertyChanged(String propertyName, Object orgValue, Object newValue) {
if (propertyChanges.containsKey(propertyName)) { // update an existing change to save the original value
Object oldOrgValue = propertyChanges.get(propertyName).getOrgValue();
if ((oldOrgValue == null && newValue == n... | [
"protected",
"void",
"propertyChanged",
"(",
"String",
"propertyName",
",",
"Object",
"orgValue",
",",
"Object",
"newValue",
")",
"{",
"if",
"(",
"propertyChanges",
".",
"containsKey",
"(",
"propertyName",
")",
")",
"{",
"// update an existing change to save the origi... | Tracks a property change. Therefore the original and new value are stored in a map.
It tracks multiple changes and if a property finally is changed back to the original
value, then the change is removed.
@param propertyName
@param orgValue
@param newValue | [
"Tracks",
"a",
"property",
"change",
".",
"Therefore",
"the",
"original",
"and",
"new",
"value",
"are",
"stored",
"in",
"a",
"map",
".",
"It",
"tracks",
"multiple",
"changes",
"and",
"if",
"a",
"property",
"finally",
"is",
"changed",
"back",
"to",
"the",
... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/TaskEntity.java#L995-L1010 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/OpenLongIntHashMap.java | OpenLongIntHashMap.put | public boolean put(long key, int value) {
"""
Associates the given key with the given value.
Replaces any old <tt>(key,someOtherValue)</tt> association, if existing.
@param key the key the value shall be associated with.
@param value the value to be associated.
@return <tt>true</tt> if the receiver did not a... | java | public boolean put(long key, int value) {
int i = indexOfInsertion(key);
if (i<0) { //already contained
i = -i -1;
this.values[i]=value;
return false;
}
if (this.distinct > this.highWaterMark) {
int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
rehas... | [
"public",
"boolean",
"put",
"(",
"long",
"key",
",",
"int",
"value",
")",
"{",
"int",
"i",
"=",
"indexOfInsertion",
"(",
"key",
")",
";",
"if",
"(",
"i",
"<",
"0",
")",
"{",
"//already contained\r",
"i",
"=",
"-",
"i",
"-",
"1",
";",
"this",
".",... | Associates the given key with the given value.
Replaces any old <tt>(key,someOtherValue)</tt> association, if existing.
@param key the key the value shall be associated with.
@param value the value to be associated.
@return <tt>true</tt> if the receiver did not already contain such a key;
<tt>false</tt> if the receive... | [
"Associates",
"the",
"given",
"key",
"with",
"the",
"given",
"value",
".",
"Replaces",
"any",
"old",
"<tt",
">",
"(",
"key",
"someOtherValue",
")",
"<",
"/",
"tt",
">",
"association",
"if",
"existing",
"."
] | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/OpenLongIntHashMap.java#L346-L372 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/ParsedAddressGrouping.java | ParsedAddressGrouping.getSegmentPrefixLength | public static Integer getSegmentPrefixLength(int bitsPerSegment, Integer prefixLength, int segmentIndex) {
"""
Across an address prefixes are:
IPv6: (null):...:(null):(1 to 16):(0):...:(0)
or IPv4: ...(null).(1 to 8).(0)...
"""
if(prefixLength != null) {
return getPrefixedSegmentPrefixLength(bitsPerSegm... | java | public static Integer getSegmentPrefixLength(int bitsPerSegment, Integer prefixLength, int segmentIndex) {
if(prefixLength != null) {
return getPrefixedSegmentPrefixLength(bitsPerSegment, prefixLength, segmentIndex);
}
return null;
} | [
"public",
"static",
"Integer",
"getSegmentPrefixLength",
"(",
"int",
"bitsPerSegment",
",",
"Integer",
"prefixLength",
",",
"int",
"segmentIndex",
")",
"{",
"if",
"(",
"prefixLength",
"!=",
"null",
")",
"{",
"return",
"getPrefixedSegmentPrefixLength",
"(",
"bitsPerS... | Across an address prefixes are:
IPv6: (null):...:(null):(1 to 16):(0):...:(0)
or IPv4: ...(null).(1 to 8).(0)... | [
"Across",
"an",
"address",
"prefixes",
"are",
":",
"IPv6",
":",
"(",
"null",
")",
":",
"...",
":",
"(",
"null",
")",
":",
"(",
"1",
"to",
"16",
")",
":",
"(",
"0",
")",
":",
"...",
":",
"(",
"0",
")",
"or",
"IPv4",
":",
"...",
"(",
"null",
... | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/ParsedAddressGrouping.java#L67-L72 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/SsoApi.java | SsoApi.getCharacterInfo | public CharacterInfo getCharacterInfo() throws ApiException {
"""
Alias for net.troja.eve.esi.api.MetaApi.getVerify() Return CharacterInfo
that have helper methods: CharacterInfo.getScopes() : Set<String>
CharacterInfo.getExpireOn() : OffsetDateTime
@return
@throws ApiException
"""
return new Cha... | java | public CharacterInfo getCharacterInfo() throws ApiException {
return new CharacterInfo(metaApi.getVerify(null, null, DATASOURCE, null, null));
} | [
"public",
"CharacterInfo",
"getCharacterInfo",
"(",
")",
"throws",
"ApiException",
"{",
"return",
"new",
"CharacterInfo",
"(",
"metaApi",
".",
"getVerify",
"(",
"null",
",",
"null",
",",
"DATASOURCE",
",",
"null",
",",
"null",
")",
")",
";",
"}"
] | Alias for net.troja.eve.esi.api.MetaApi.getVerify() Return CharacterInfo
that have helper methods: CharacterInfo.getScopes() : Set<String>
CharacterInfo.getExpireOn() : OffsetDateTime
@return
@throws ApiException | [
"Alias",
"for",
"net",
".",
"troja",
".",
"eve",
".",
"esi",
".",
"api",
".",
"MetaApi",
".",
"getVerify",
"()",
"Return",
"CharacterInfo",
"that",
"have",
"helper",
"methods",
":",
"CharacterInfo",
".",
"getScopes",
"()",
":",
"Set<String",
">",
"Characte... | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/SsoApi.java#L57-L59 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPlot.java | SVGPlot.svgLine | public Element svgLine(double x1, double y1, double x2, double y2) {
"""
Create a SVG line element
@param x1 first point x
@param y1 first point y
@param x2 second point x
@param y2 second point y
@return new element
"""
return SVGUtil.svgLine(document, x1, y1, x2, y2);
} | java | public Element svgLine(double x1, double y1, double x2, double y2) {
return SVGUtil.svgLine(document, x1, y1, x2, y2);
} | [
"public",
"Element",
"svgLine",
"(",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
")",
"{",
"return",
"SVGUtil",
".",
"svgLine",
"(",
"document",
",",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
")",
";",
"}"
] | Create a SVG line element
@param x1 first point x
@param y1 first point y
@param x2 second point x
@param y2 second point y
@return new element | [
"Create",
"a",
"SVG",
"line",
"element"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPlot.java#L279-L281 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray.element | public JSONArray element( Collection value, JsonConfig jsonConfig ) {
"""
Append a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.
@param value A Collection value.
@return this.
"""
if( value instanceof JSONArray ){
elements.add( value );
... | java | public JSONArray element( Collection value, JsonConfig jsonConfig ) {
if( value instanceof JSONArray ){
elements.add( value );
return this;
}else{
return element( _fromCollection( value, jsonConfig ) );
}
} | [
"public",
"JSONArray",
"element",
"(",
"Collection",
"value",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"value",
"instanceof",
"JSONArray",
")",
"{",
"elements",
".",
"add",
"(",
"value",
")",
";",
"return",
"this",
";",
"}",
"else",
"{",
"re... | Append a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.
@param value A Collection value.
@return this. | [
"Append",
"a",
"value",
"in",
"the",
"JSONArray",
"where",
"the",
"value",
"will",
"be",
"a",
"JSONArray",
"which",
"is",
"produced",
"from",
"a",
"Collection",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L1208-L1215 |
alkacon/opencms-core | src/org/opencms/module/CmsModuleUpdater.java | CmsModuleUpdater.needToUpdateResourceFields | public static boolean needToUpdateResourceFields(CmsResource existingRes, CmsResource newRes, boolean reduced) {
"""
Check if a resource needs to be updated because of its direct fields.<p>
@param existingRes the existing resource
@param newRes the new resource
@param reduced true if we are in reduced export ... | java | public static boolean needToUpdateResourceFields(CmsResource existingRes, CmsResource newRes, boolean reduced) {
boolean result = false;
result |= existingRes.getTypeId() != newRes.getTypeId();
result |= differentDates(existingRes.getDateCreated(), newRes.getDateCreated()); // Export format dat... | [
"public",
"static",
"boolean",
"needToUpdateResourceFields",
"(",
"CmsResource",
"existingRes",
",",
"CmsResource",
"newRes",
",",
"boolean",
"reduced",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"result",
"|=",
"existingRes",
".",
"getTypeId",
"(",
")",
... | Check if a resource needs to be updated because of its direct fields.<p>
@param existingRes the existing resource
@param newRes the new resource
@param reduced true if we are in reduced export mode
@return true if we need to update the resource based on its direct fields | [
"Check",
"if",
"a",
"resource",
"needs",
"to",
"be",
"updated",
"because",
"of",
"its",
"direct",
"fields",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/module/CmsModuleUpdater.java#L172-L186 |
javalite/activeweb | javalite-async/src/main/java/org/javalite/async/Async.java | Async.removeMessages | public int removeMessages(String queueName, String filter) {
"""
Removes messages from queue.
@param queueName queue name
@param filter filter selector as in JMS specification.
See: <a href="http://docs.oracle.com/cd/E19798-01/821-1841/bncer/index.html">JMS Message Selectors</a>
@return number of messages ... | java | public int removeMessages(String queueName, String filter) {
try {
return getQueueControl(queueName).removeMessages(filter);
} catch (Exception e) {
throw new AsyncException(e);
}
} | [
"public",
"int",
"removeMessages",
"(",
"String",
"queueName",
",",
"String",
"filter",
")",
"{",
"try",
"{",
"return",
"getQueueControl",
"(",
"queueName",
")",
".",
"removeMessages",
"(",
"filter",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",... | Removes messages from queue.
@param queueName queue name
@param filter filter selector as in JMS specification.
See: <a href="http://docs.oracle.com/cd/E19798-01/821-1841/bncer/index.html">JMS Message Selectors</a>
@return number of messages removed | [
"Removes",
"messages",
"from",
"queue",
"."
] | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/javalite-async/src/main/java/org/javalite/async/Async.java#L700-L706 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/Point.java | Point.distanceSquared | public static double distanceSquared(Point p1, Point p2) {
"""
Calculates the squared distance between two {@link Point points}.
@param p1 fist point
@param p2 second point
@return the distance squared
"""
double x = p2.x - p1.x;
double y = p2.y - p1.y;
double z = p2.z - p1.z;
return x * x + y * y... | java | public static double distanceSquared(Point p1, Point p2)
{
double x = p2.x - p1.x;
double y = p2.y - p1.y;
double z = p2.z - p1.z;
return x * x + y * y + z * z;
} | [
"public",
"static",
"double",
"distanceSquared",
"(",
"Point",
"p1",
",",
"Point",
"p2",
")",
"{",
"double",
"x",
"=",
"p2",
".",
"x",
"-",
"p1",
".",
"x",
";",
"double",
"y",
"=",
"p2",
".",
"y",
"-",
"p1",
".",
"y",
";",
"double",
"z",
"=",
... | Calculates the squared distance between two {@link Point points}.
@param p1 fist point
@param p2 second point
@return the distance squared | [
"Calculates",
"the",
"squared",
"distance",
"between",
"two",
"{",
"@link",
"Point",
"points",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/Point.java#L176-L182 |
vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java | SkbShellFactory.newShell | public static SkbShell newShell(MessageRenderer renderer, boolean useConsole) {
"""
Returns a new shell with given STG and console flag.
@param renderer a renderer for help messages
@param useConsole flag to use (true) or not to use (false) console, of false then no output will happen (except for errors on runSh... | java | public static SkbShell newShell(MessageRenderer renderer, boolean useConsole){
return SkbShellFactory.newShell(null, renderer, useConsole);
} | [
"public",
"static",
"SkbShell",
"newShell",
"(",
"MessageRenderer",
"renderer",
",",
"boolean",
"useConsole",
")",
"{",
"return",
"SkbShellFactory",
".",
"newShell",
"(",
"null",
",",
"renderer",
",",
"useConsole",
")",
";",
"}"
] | Returns a new shell with given STG and console flag.
@param renderer a renderer for help messages
@param useConsole flag to use (true) or not to use (false) console, of false then no output will happen (except for errors on runShell() and some help commands)
@return new shell | [
"Returns",
"a",
"new",
"shell",
"with",
"given",
"STG",
"and",
"console",
"flag",
"."
] | train | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java#L55-L57 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinding.java | ShuttleListBinding.collectionsEqual | protected boolean collectionsEqual(Collection a1, Collection a2) {
"""
Compare two collections for equality using the configured comparator.
Element order must be the same for the collections to compare equal.
@param a1 First collection to compare
@param a2 Second collection to compare
@return boolean true i... | java | protected boolean collectionsEqual(Collection a1, Collection a2) {
if (a1 != null && a2 != null && a1.size() == a2.size()) {
// Loop over each element and compare them using our comparator
Iterator iterA1 = a1.iterator();
Iterator iterA2 = a2.iterator();
while (iterA1.hasNext()) {
if (!equalByComparat... | [
"protected",
"boolean",
"collectionsEqual",
"(",
"Collection",
"a1",
",",
"Collection",
"a2",
")",
"{",
"if",
"(",
"a1",
"!=",
"null",
"&&",
"a2",
"!=",
"null",
"&&",
"a1",
".",
"size",
"(",
")",
"==",
"a2",
".",
"size",
"(",
")",
")",
"{",
"// Loo... | Compare two collections for equality using the configured comparator.
Element order must be the same for the collections to compare equal.
@param a1 First collection to compare
@param a2 Second collection to compare
@return boolean true if they are equal | [
"Compare",
"two",
"collections",
"for",
"equality",
"using",
"the",
"configured",
"comparator",
".",
"Element",
"order",
"must",
"be",
"the",
"same",
"for",
"the",
"collections",
"to",
"compare",
"equal",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinding.java#L375-L390 |
paymill/paymill-java | src/main/java/com/paymill/services/PreauthorizationService.java | PreauthorizationService.createWithToken | public Preauthorization createWithToken( final String token, final Integer amount, final String currency, final String description ) {
"""
Creates Use either a token or an existing payment to Authorizes the given amount with the given token.
@param token
The identifier of a token.
@param amount
Amount (in cent... | java | public Preauthorization createWithToken( final String token, final Integer amount, final String currency, final String description ) {
ValidationUtils.validatesToken( token );
ValidationUtils.validatesAmount( amount );
ValidationUtils.validatesCurrency( currency );
ParameterMap<String, String> params =... | [
"public",
"Preauthorization",
"createWithToken",
"(",
"final",
"String",
"token",
",",
"final",
"Integer",
"amount",
",",
"final",
"String",
"currency",
",",
"final",
"String",
"description",
")",
"{",
"ValidationUtils",
".",
"validatesToken",
"(",
"token",
")",
... | Creates Use either a token or an existing payment to Authorizes the given amount with the given token.
@param token
The identifier of a token.
@param amount
Amount (in cents) which will be charged.
@param currency
ISO 4217 formatted currency code.
@param description
A short description for the preauthorization.
@return... | [
"Creates",
"Use",
"either",
"a",
"token",
"or",
"an",
"existing",
"payment",
"to",
"Authorizes",
"the",
"given",
"amount",
"with",
"the",
"given",
"token",
"."
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/PreauthorizationService.java#L125-L141 |
gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/ScheduleService.java | ScheduleService.rerunJobs | public Stage rerunJobs(final Stage stage, final List<String> jobNames, final HttpOperationResult result) {
"""
IMPORTANT: this method is only meant for TOP level usage(never use this within a transaction). It gobbles exception.
"""
final StageIdentifier identifier = stage.getIdentifier();
Healt... | java | public Stage rerunJobs(final Stage stage, final List<String> jobNames, final HttpOperationResult result) {
final StageIdentifier identifier = stage.getIdentifier();
HealthStateType healthStateForStage = HealthStateType.general(HealthStateScope.forStage(identifier.getPipelineName(), identifier.getStageNa... | [
"public",
"Stage",
"rerunJobs",
"(",
"final",
"Stage",
"stage",
",",
"final",
"List",
"<",
"String",
">",
"jobNames",
",",
"final",
"HttpOperationResult",
"result",
")",
"{",
"final",
"StageIdentifier",
"identifier",
"=",
"stage",
".",
"getIdentifier",
"(",
")... | IMPORTANT: this method is only meant for TOP level usage(never use this within a transaction). It gobbles exception. | [
"IMPORTANT",
":",
"this",
"method",
"is",
"only",
"meant",
"for",
"TOP",
"level",
"usage",
"(",
"never",
"use",
"this",
"within",
"a",
"transaction",
")",
".",
"It",
"gobbles",
"exception",
"."
] | train | https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/server/src/main/java/com/thoughtworks/go/server/service/ScheduleService.java#L332-L364 |
kite-sdk/kite | kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/AvroEntitySerDe.java | AvroEntitySerDe.getColumnDecoder | private Decoder getColumnDecoder(Schema writtenFieldAvroSchema, InputStream in) {
"""
Returns an Avro Decoder. The implementation it chooses will depend on the
schema of the field.
@param in
InputStream to decode bytes from
@return The avro decoder.
"""
// Use a special Avro decoder that has special ... | java | private Decoder getColumnDecoder(Schema writtenFieldAvroSchema, InputStream in) {
// Use a special Avro decoder that has special handling for int, long,
// and String types. See ColumnDecoder for more information.
if (writtenFieldAvroSchema.getType() == Type.INT
|| writtenFieldAvroSchema.getType() =... | [
"private",
"Decoder",
"getColumnDecoder",
"(",
"Schema",
"writtenFieldAvroSchema",
",",
"InputStream",
"in",
")",
"{",
"// Use a special Avro decoder that has special handling for int, long,",
"// and String types. See ColumnDecoder for more information.",
"if",
"(",
"writtenFieldAvroS... | Returns an Avro Decoder. The implementation it chooses will depend on the
schema of the field.
@param in
InputStream to decode bytes from
@return The avro decoder. | [
"Returns",
"an",
"Avro",
"Decoder",
".",
"The",
"implementation",
"it",
"chooses",
"will",
"depend",
"on",
"the",
"schema",
"of",
"the",
"field",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/AvroEntitySerDe.java#L359-L369 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/FileSpec.java | FileSpec.createFile | @When("^I create file '(.+?)' based on '(.+?)' as '(.+?)' with:$")
public void createFile(String fileName, String baseData, String type, DataTable modifications) throws Exception {
"""
Create a JSON in resources directory with given name, so for using it you've to reference it as:
$(pwd)/target/test-classes/f... | java | @When("^I create file '(.+?)' based on '(.+?)' as '(.+?)' with:$")
public void createFile(String fileName, String baseData, String type, DataTable modifications) throws Exception {
// Retrieve data
String retrievedData = commonspec.retrieveData(baseData, type);
// Modify data
common... | [
"@",
"When",
"(",
"\"^I create file '(.+?)' based on '(.+?)' as '(.+?)' with:$\"",
")",
"public",
"void",
"createFile",
"(",
"String",
"fileName",
",",
"String",
"baseData",
",",
"String",
"type",
",",
"DataTable",
"modifications",
")",
"throws",
"Exception",
"{",
"//... | Create a JSON in resources directory with given name, so for using it you've to reference it as:
$(pwd)/target/test-classes/fileName
@param fileName name of the JSON file to be created
@param baseData path to file containing the schema to be used
@param type element to read from file (element should... | [
"Create",
"a",
"JSON",
"in",
"resources",
"directory",
"with",
"given",
"name",
"so",
"for",
"using",
"it",
"you",
"ve",
"to",
"reference",
"it",
"as",
":",
"$",
"(",
"pwd",
")",
"/",
"target",
"/",
"test",
"-",
"classes",
"/",
"fileName"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/FileSpec.java#L136-L160 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.metrics/src/com/ibm/ws/microprofile/metrics/impl/MetricRegistryImpl.java | MetricRegistryImpl.getTimers | @Override
public SortedMap<String, Timer> getTimers(MetricFilter filter) {
"""
Returns a map of all the timers in the registry and their names which match the given filter.
@param filter the metric filter to match
@return all the timers in the registry
"""
return getMetrics(Timer.class, filter)... | java | @Override
public SortedMap<String, Timer> getTimers(MetricFilter filter) {
return getMetrics(Timer.class, filter);
} | [
"@",
"Override",
"public",
"SortedMap",
"<",
"String",
",",
"Timer",
">",
"getTimers",
"(",
"MetricFilter",
"filter",
")",
"{",
"return",
"getMetrics",
"(",
"Timer",
".",
"class",
",",
"filter",
")",
";",
"}"
] | Returns a map of all the timers in the registry and their names which match the given filter.
@param filter the metric filter to match
@return all the timers in the registry | [
"Returns",
"a",
"map",
"of",
"all",
"the",
"timers",
"in",
"the",
"registry",
"and",
"their",
"names",
"which",
"match",
"the",
"given",
"filter",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.metrics/src/com/ibm/ws/microprofile/metrics/impl/MetricRegistryImpl.java#L426-L429 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepExecutionsInner.java | JobStepExecutionsInner.listByJobExecutionWithServiceResponseAsync | public Observable<ServiceResponse<Page<JobExecutionInner>>> listByJobExecutionWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final UUID jobExecutionId, final DateTime createTimeMin, final DateTime createTimeMax, final DateTime endTimeMi... | java | public Observable<ServiceResponse<Page<JobExecutionInner>>> listByJobExecutionWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final UUID jobExecutionId, final DateTime createTimeMin, final DateTime createTimeMax, final DateTime endTimeMi... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"JobExecutionInner",
">",
">",
">",
"listByJobExecutionWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"jobAgentName",... | Lists the step executions of a job execution.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent.
@param jobName The name... | [
"Lists",
"the",
"step",
"executions",
"of",
"a",
"job",
"execution",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepExecutionsInner.java#L330-L342 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/ContentTypeUtils.java | ContentTypeUtils.containsContentType | public static boolean containsContentType(String contentType, String[] allowedContentTypes) {
"""
Indicate if the passes content type match one of the options passed.
"""
if (allowedContentTypes == null)
{
return false;
}
for (int i = 0; i < allowedContentTypes.lengt... | java | public static boolean containsContentType(String contentType, String[] allowedContentTypes)
{
if (allowedContentTypes == null)
{
return false;
}
for (int i = 0; i < allowedContentTypes.length; i++)
{
if (allowedContentTypes[i].indexOf(contentType) != -... | [
"public",
"static",
"boolean",
"containsContentType",
"(",
"String",
"contentType",
",",
"String",
"[",
"]",
"allowedContentTypes",
")",
"{",
"if",
"(",
"allowedContentTypes",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i",
"=",
... | Indicate if the passes content type match one of the options passed. | [
"Indicate",
"if",
"the",
"passes",
"content",
"type",
"match",
"one",
"of",
"the",
"options",
"passed",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/ContentTypeUtils.java#L48-L62 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java | AtlasTypeDefGraphStoreV1.updateVertexProperty | private void updateVertexProperty(AtlasVertex vertex, String propertyName, Date newValue) {
"""
/*
update the given vertex property, if the new value is not-null
"""
if (newValue != null) {
Number currValue = vertex.getProperty(propertyName, Number.class);
if (currValue == nul... | java | private void updateVertexProperty(AtlasVertex vertex, String propertyName, Date newValue) {
if (newValue != null) {
Number currValue = vertex.getProperty(propertyName, Number.class);
if (currValue == null || !currValue.equals(newValue.getTime())) {
vertex.setProperty(pro... | [
"private",
"void",
"updateVertexProperty",
"(",
"AtlasVertex",
"vertex",
",",
"String",
"propertyName",
",",
"Date",
"newValue",
")",
"{",
"if",
"(",
"newValue",
"!=",
"null",
")",
"{",
"Number",
"currValue",
"=",
"vertex",
".",
"getProperty",
"(",
"propertyNa... | /*
update the given vertex property, if the new value is not-null | [
"/",
"*",
"update",
"the",
"given",
"vertex",
"property",
"if",
"the",
"new",
"value",
"is",
"not",
"-",
"null"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java#L441-L449 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedClient.java | MemcachedClient.asyncGetAndTouch | @Override
public OperationFuture<CASValue<Object>> asyncGetAndTouch(final String key,
final int exp) {
"""
Get the given key to reset its expiration time.
@param key the key to fetch
@param exp the new expiration to set for the given key
@return a future that will hold the return value of the fetch
@... | java | @Override
public OperationFuture<CASValue<Object>> asyncGetAndTouch(final String key,
final int exp) {
return asyncGetAndTouch(key, exp, transcoder);
} | [
"@",
"Override",
"public",
"OperationFuture",
"<",
"CASValue",
"<",
"Object",
">",
">",
"asyncGetAndTouch",
"(",
"final",
"String",
"key",
",",
"final",
"int",
"exp",
")",
"{",
"return",
"asyncGetAndTouch",
"(",
"key",
",",
"exp",
",",
"transcoder",
")",
"... | Get the given key to reset its expiration time.
@param key the key to fetch
@param exp the new expiration to set for the given key
@return a future that will hold the return value of the fetch
@throws IllegalStateException in the rare circumstance where queue is too
full to accept any more requests | [
"Get",
"the",
"given",
"key",
"to",
"reset",
"its",
"expiration",
"time",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedClient.java#L1487-L1491 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexSymbols.java | BitfinexSymbols.rawOrderBook | public static BitfinexOrderBookSymbol rawOrderBook(final BitfinexCurrencyPair currencyPair) {
"""
returns symbol for raw order book channel
@param currencyPair of raw order book channel
@return symbol
"""
return new BitfinexOrderBookSymbol(currencyPair, BitfinexOrderBookSymbol.Precision.R0, null, n... | java | public static BitfinexOrderBookSymbol rawOrderBook(final BitfinexCurrencyPair currencyPair) {
return new BitfinexOrderBookSymbol(currencyPair, BitfinexOrderBookSymbol.Precision.R0, null, null);
} | [
"public",
"static",
"BitfinexOrderBookSymbol",
"rawOrderBook",
"(",
"final",
"BitfinexCurrencyPair",
"currencyPair",
")",
"{",
"return",
"new",
"BitfinexOrderBookSymbol",
"(",
"currencyPair",
",",
"BitfinexOrderBookSymbol",
".",
"Precision",
".",
"R0",
",",
"null",
",",... | returns symbol for raw order book channel
@param currencyPair of raw order book channel
@return symbol | [
"returns",
"symbol",
"for",
"raw",
"order",
"book",
"channel"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexSymbols.java#L107-L109 |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/util/Ensure.java | Ensure.notNullOrEmpty | public static String notNullOrEmpty(String argument, String argumentName) {
"""
Checks if the given String is null or contains only whitespaces.
The String is trimmed before the empty check.
@param argument the String to check for null or emptiness
@param argumentName the name of the argument to check.
T... | java | public static String notNullOrEmpty(String argument, String argumentName) {
if (argument == null || argument.trim().isEmpty()) {
throw new IllegalArgumentException("Argument " + argumentName + " must not be null or empty.");
}
return argument;
} | [
"public",
"static",
"String",
"notNullOrEmpty",
"(",
"String",
"argument",
",",
"String",
"argumentName",
")",
"{",
"if",
"(",
"argument",
"==",
"null",
"||",
"argument",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"Illegal... | Checks if the given String is null or contains only whitespaces.
The String is trimmed before the empty check.
@param argument the String to check for null or emptiness
@param argumentName the name of the argument to check.
This is used in the exception message.
@return the String that was given as argument
@throw... | [
"Checks",
"if",
"the",
"given",
"String",
"is",
"null",
"or",
"contains",
"only",
"whitespaces",
".",
"The",
"String",
"is",
"trimmed",
"before",
"the",
"empty",
"check",
"."
] | train | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/util/Ensure.java#L38-L43 |
jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java | ReflectionUtils.getFieldValue | public static Object getFieldValue(Object object, String fieldName) {
"""
Convenience method for getting the value of a private object field,
without the stress of checked exceptions in the reflection API.
@param object
Object containing the field.
@param fieldName
Name of the field whose value to return.
... | java | public static Object getFieldValue(Object object, String fieldName) {
try {
return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object);
} catch (IllegalArgumentException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Object",
"object",
",",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"getDeclaredFieldInHierarchy",
"(",
"object",
".",
"getClass",
"(",
")",
",",
"fieldName",
")",
".",
"get",
"(",
"object",
")"... | Convenience method for getting the value of a private object field,
without the stress of checked exceptions in the reflection API.
@param object
Object containing the field.
@param fieldName
Name of the field whose value to return. | [
"Convenience",
"method",
"for",
"getting",
"the",
"value",
"of",
"a",
"private",
"object",
"field",
"without",
"the",
"stress",
"of",
"checked",
"exceptions",
"in",
"the",
"reflection",
"API",
"."
] | train | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java#L85-L93 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_POST | public OvhCart cart_POST(String description, Date expire, OvhOvhSubsidiaryEnum ovhSubsidiary) throws IOException {
"""
Create a new OVH order cart
REST: POST /order/cart
@param description [required] Description of your cart
@param expire [required] Time of expiration of the cart
@param ovhSubsidiary [requir... | java | public OvhCart cart_POST(String description, Date expire, OvhOvhSubsidiaryEnum ovhSubsidiary) throws IOException {
String qPath = "/order/cart";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", description);
addBody(o, "expire", expire);
add... | [
"public",
"OvhCart",
"cart_POST",
"(",
"String",
"description",
",",
"Date",
"expire",
",",
"OvhOvhSubsidiaryEnum",
"ovhSubsidiary",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath"... | Create a new OVH order cart
REST: POST /order/cart
@param description [required] Description of your cart
@param expire [required] Time of expiration of the cart
@param ovhSubsidiary [required] OVH Subsidiary where you want to order | [
"Create",
"a",
"new",
"OVH",
"order",
"cart"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L7361-L7370 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaStreamAddCallback | public static int cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback callback, Object userData, int flags) {
"""
Add a callback to a compute stream.
<pre>
cudaError_t cudaStreamAddCallback (
cudaStream_t stream,
cudaStreamCallback_t callback,
void* userData,
unsigned int flags )
</pre>
<div>
... | java | public static int cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback callback, Object userData, int flags)
{
return checkResult(cudaStreamAddCallbackNative(stream, callback, userData, flags));
} | [
"public",
"static",
"int",
"cudaStreamAddCallback",
"(",
"cudaStream_t",
"stream",
",",
"cudaStreamCallback",
"callback",
",",
"Object",
"userData",
",",
"int",
"flags",
")",
"{",
"return",
"checkResult",
"(",
"cudaStreamAddCallbackNative",
"(",
"stream",
",",
"call... | Add a callback to a compute stream.
<pre>
cudaError_t cudaStreamAddCallback (
cudaStream_t stream,
cudaStreamCallback_t callback,
void* userData,
unsigned int flags )
</pre>
<div>
<p>Add a callback to a compute stream. Adds
a callback to be called on the host after all currently enqueued items
in the stream
have com... | [
"Add",
"a",
"callback",
"to",
"a",
"compute",
"stream",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L6807-L6810 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java | ExternalTableDefinition.newBuilder | public static Builder newBuilder(List<String> sourceUris, Schema schema, FormatOptions format) {
"""
Creates a builder for an ExternalTableDefinition object.
@param sourceUris the fully-qualified URIs that point to your data in Google Cloud Storage.
Each URI can contain one '*' wildcard character that must com... | java | public static Builder newBuilder(List<String> sourceUris, Schema schema, FormatOptions format) {
return newBuilder().setSourceUris(sourceUris).setSchema(schema).setFormatOptions(format);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"List",
"<",
"String",
">",
"sourceUris",
",",
"Schema",
"schema",
",",
"FormatOptions",
"format",
")",
"{",
"return",
"newBuilder",
"(",
")",
".",
"setSourceUris",
"(",
"sourceUris",
")",
".",
"setSchema",
"... | Creates a builder for an ExternalTableDefinition object.
@param sourceUris the fully-qualified URIs that point to your data in Google Cloud Storage.
Each URI can contain one '*' wildcard character that must come after the bucket's name.
Size limits related to load jobs apply to external data sources, plus an additiona... | [
"Creates",
"a",
"builder",
"for",
"an",
"ExternalTableDefinition",
"object",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java#L279-L281 |
JRebirth/JRebirth | org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java | StackModel.showPage | private void showPage(final UniqueKey<? extends Model> pageModelKey, final Wave wave) {
"""
Private method used to show another page.
@param pageModelKey the mdoelKey for the page to show
"""
if (pageModelKey != null && !pageModelKey.equals(this.currentModelKey)) {
LOGGER.info("Show Pag... | java | private void showPage(final UniqueKey<? extends Model> pageModelKey, final Wave wave) {
if (pageModelKey != null && !pageModelKey.equals(this.currentModelKey)) {
LOGGER.info("Show Page Model: " + pageModelKey.toString());
// Create the Wave Bean that will hold all data processed by cha... | [
"private",
"void",
"showPage",
"(",
"final",
"UniqueKey",
"<",
"?",
"extends",
"Model",
">",
"pageModelKey",
",",
"final",
"Wave",
"wave",
")",
"{",
"if",
"(",
"pageModelKey",
"!=",
"null",
"&&",
"!",
"pageModelKey",
".",
"equals",
"(",
"this",
".",
"cur... | Private method used to show another page.
@param pageModelKey the mdoelKey for the page to show | [
"Private",
"method",
"used",
"to",
"show",
"another",
"page",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java#L137-L176 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/ItemRule.java | ItemRule.setValue | public void setValue(List<Token[]> tokensList) {
"""
Sets a value to this List type item.
@param tokensList the tokens list
"""
if (type == null) {
type = ItemType.LIST;
}
if (!isListableType()) {
throw new IllegalArgumentException("The item type must be 'arra... | java | public void setValue(List<Token[]> tokensList) {
if (type == null) {
type = ItemType.LIST;
}
if (!isListableType()) {
throw new IllegalArgumentException("The item type must be 'array', 'list' or 'set' for this item " + this);
}
this.tokensList = tokensList... | [
"public",
"void",
"setValue",
"(",
"List",
"<",
"Token",
"[",
"]",
">",
"tokensList",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"ItemType",
".",
"LIST",
";",
"}",
"if",
"(",
"!",
"isListableType",
"(",
")",
")",
"{",
"thro... | Sets a value to this List type item.
@param tokensList the tokens list | [
"Sets",
"a",
"value",
"to",
"this",
"List",
"type",
"item",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/ItemRule.java#L342-L350 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/NDArrayDoubles.java | NDArrayDoubles.valueEquals | public boolean valueEquals(NDArrayDoubles other, double tolerance) {
"""
Does a deep comparison, using equality with tolerance checks against the vector table of values.
@param other the factor to compare to
@param tolerance the tolerance to accept in differences
@return whether the two factors are within... | java | public boolean valueEquals(NDArrayDoubles other, double tolerance) {
if (!Arrays.equals(dimensions, other.dimensions)) return false;
if (dimensions.length != other.dimensions.length) return false;
for (int i = 0; i < dimensions.length; i++) {
if (Math.abs(dimensions[i] - other.dimensions[i]) > toleran... | [
"public",
"boolean",
"valueEquals",
"(",
"NDArrayDoubles",
"other",
",",
"double",
"tolerance",
")",
"{",
"if",
"(",
"!",
"Arrays",
".",
"equals",
"(",
"dimensions",
",",
"other",
".",
"dimensions",
")",
")",
"return",
"false",
";",
"if",
"(",
"dimensions"... | Does a deep comparison, using equality with tolerance checks against the vector table of values.
@param other the factor to compare to
@param tolerance the tolerance to accept in differences
@return whether the two factors are within tolerance of one another | [
"Does",
"a",
"deep",
"comparison",
"using",
"equality",
"with",
"tolerance",
"checks",
"against",
"the",
"vector",
"table",
"of",
"values",
"."
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/NDArrayDoubles.java#L164-L171 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java | InstanceClient.setMetadataInstance | @BetaApi
public final Operation setMetadataInstance(String instance, Metadata metadataResource) {
"""
Sets metadata for the specified instance to the data included in the request.
<p>Sample code:
<pre><code>
try (InstanceClient instanceClient = InstanceClient.create()) {
ProjectZoneInstanceName instance ... | java | @BetaApi
public final Operation setMetadataInstance(String instance, Metadata metadataResource) {
SetMetadataInstanceHttpRequest request =
SetMetadataInstanceHttpRequest.newBuilder()
.setInstance(instance)
.setMetadataResource(metadataResource)
.build();
return set... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"setMetadataInstance",
"(",
"String",
"instance",
",",
"Metadata",
"metadataResource",
")",
"{",
"SetMetadataInstanceHttpRequest",
"request",
"=",
"SetMetadataInstanceHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setIns... | Sets metadata for the specified instance to the data included in the request.
<p>Sample code:
<pre><code>
try (InstanceClient instanceClient = InstanceClient.create()) {
ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
Metadata metadataResource = Metadata.newBuilder(... | [
"Sets",
"metadata",
"for",
"the",
"specified",
"instance",
"to",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java#L2561-L2570 |
OpenTSDB/opentsdb | src/tree/TreeBuilder.java | TreeBuilder.processSplit | private void processSplit(final String parsed_value) {
"""
Performs a split operation on the parsed value using the character set
in the rule's {@code separator} field. When splitting a value, the
{@link #splits} and {@link #split_idx} fields are used to track state and
determine where in the split we currently... | java | private void processSplit(final String parsed_value) {
if (splits == null) {
// then this is the first time we're processing the value, so we need to
// execute the split if there's a separator, after some validation
if (parsed_value == null || parsed_value.isEmpty()) {
throw new IllegalAr... | [
"private",
"void",
"processSplit",
"(",
"final",
"String",
"parsed_value",
")",
"{",
"if",
"(",
"splits",
"==",
"null",
")",
"{",
"// then this is the first time we're processing the value, so we need to",
"// execute the split if there's a separator, after some validation",
"if"... | Performs a split operation on the parsed value using the character set
in the rule's {@code separator} field. When splitting a value, the
{@link #splits} and {@link #split_idx} fields are used to track state and
determine where in the split we currently are. {@link #processRuleset} will
handle incrementing the rule ind... | [
"Performs",
"a",
"split",
"operation",
"on",
"the",
"parsed",
"value",
"using",
"the",
"character",
"set",
"in",
"the",
"rule",
"s",
"{"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tree/TreeBuilder.java#L962-L993 |
kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.modifyURIPort | public static String modifyURIPort(String uri, int newPort) {
"""
Helper method for modifying URI port
@param uri
@param newPort
@return
"""
try {
URI uriObj = new URI(uri);
return uriToString(URLUtils.modifyURIPort(uriObj, newPort));
}
catch (URISyntaxExcepti... | java | public static String modifyURIPort(String uri, int newPort) {
try {
URI uriObj = new URI(uri);
return uriToString(URLUtils.modifyURIPort(uriObj, newPort));
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uri)).modifyURIPo... | [
"public",
"static",
"String",
"modifyURIPort",
"(",
"String",
"uri",
",",
"int",
"newPort",
")",
"{",
"try",
"{",
"URI",
"uriObj",
"=",
"new",
"URI",
"(",
"uri",
")",
";",
"return",
"uriToString",
"(",
"URLUtils",
".",
"modifyURIPort",
"(",
"uriObj",
","... | Helper method for modifying URI port
@param uri
@param newPort
@return | [
"Helper",
"method",
"for",
"modifying",
"URI",
"port"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L335-L348 |
javalite/activeweb | javalite-async/src/main/java/org/javalite/async/Async.java | Async.moveMessages | public int moveMessages(String source, String target) {
"""
Moves all messages from one queue to another
@param source name of source queue
@param target name of target queue
@return number of messages moved
"""
try {
return getQueueControl(source).moveMessages("", target);
... | java | public int moveMessages(String source, String target){
try {
return getQueueControl(source).moveMessages("", target);
} catch (Exception e) {
throw new AsyncException(e);
}
} | [
"public",
"int",
"moveMessages",
"(",
"String",
"source",
",",
"String",
"target",
")",
"{",
"try",
"{",
"return",
"getQueueControl",
"(",
"source",
")",
".",
"moveMessages",
"(",
"\"\"",
",",
"target",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",... | Moves all messages from one queue to another
@param source name of source queue
@param target name of target queue
@return number of messages moved | [
"Moves",
"all",
"messages",
"from",
"one",
"queue",
"to",
"another"
] | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/javalite-async/src/main/java/org/javalite/async/Async.java#L730-L737 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java | JacksonUtils.getValue | public static <T> T getValue(JsonNode node, String dPath, Class<T> clazz) {
"""
Extract a value from the target {@link JsonNode} using DPath expression (generic
version).
@param node
@param dPath
@param clazz
@return
@see DPathUtils
"""
return DPathUtils.getValue(node, dPath, clazz);
} | java | public static <T> T getValue(JsonNode node, String dPath, Class<T> clazz) {
return DPathUtils.getValue(node, dPath, clazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getValue",
"(",
"JsonNode",
"node",
",",
"String",
"dPath",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"DPathUtils",
".",
"getValue",
"(",
"node",
",",
"dPath",
",",
"clazz",
")",
";",
"}"
] | Extract a value from the target {@link JsonNode} using DPath expression (generic
version).
@param node
@param dPath
@param clazz
@return
@see DPathUtils | [
"Extract",
"a",
"value",
"from",
"the",
"target",
"{",
"@link",
"JsonNode",
"}",
"using",
"DPath",
"expression",
"(",
"generic",
"version",
")",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java#L234-L236 |
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, long tolerance) {
"""
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 associ... | java | static public String getFormattedDateTime(long dt, String format, TimeZone tz, String country, long tolerance)
{
String ret = "";
SimpleDateFormat df = null;
try
{
if(dt > tolerance)
{
df = formatPool.getFormat(format);
df.setT... | [
"static",
"public",
"String",
"getFormattedDateTime",
"(",
"long",
"dt",
",",
"String",
"format",
",",
"TimeZone",
"tz",
",",
"String",
"country",
",",
"long",
"tolerance",
")",
"{",
"String",
"ret",
"=",
"\"\"",
";",
"SimpleDateFormat",
"df",
"=",
"null",
... | 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
@param tolerance The tolerance for the date to be form... | [
"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#L207-L230 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/io/async/Timer.java | Timer.insertWorkItem | public void insertWorkItem(TimerWorkItem work, long curTime) {
"""
Put a work item into an existing time slot, or create a new time
slot and put the work item into that time slot.
@param work
@param curTime
"""
// find the time slot, or create a new one
long insertTime = work.timeoutTime;
... | java | public void insertWorkItem(TimerWorkItem work, long curTime) {
// find the time slot, or create a new one
long insertTime = work.timeoutTime;
TimeSlot nextSlot = this.firstSlot;
while (nextSlot != null) {
if ((insertTime == nextSlot.timeoutTime) && (nextSlot.lastEntryIndex !... | [
"public",
"void",
"insertWorkItem",
"(",
"TimerWorkItem",
"work",
",",
"long",
"curTime",
")",
"{",
"// find the time slot, or create a new one",
"long",
"insertTime",
"=",
"work",
".",
"timeoutTime",
";",
"TimeSlot",
"nextSlot",
"=",
"this",
".",
"firstSlot",
";",
... | Put a work item into an existing time slot, or create a new time
slot and put the work item into that time slot.
@param work
@param curTime | [
"Put",
"a",
"work",
"item",
"into",
"an",
"existing",
"time",
"slot",
"or",
"create",
"a",
"new",
"time",
"slot",
"and",
"put",
"the",
"work",
"item",
"into",
"that",
"time",
"slot",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/io/async/Timer.java#L280-L302 |
jenkinsci/jenkins | core/src/main/java/jenkins/util/AntClassLoader.java | AntClassLoader.getClassFromStream | private Class getClassFromStream(InputStream stream, String classname, File container)
throws IOException, SecurityException {
"""
Reads a class definition from a stream.
@param stream The stream from which the class is to be read.
Must not be <code>null</code>.
@param classname The name of the cl... | java | private Class getClassFromStream(InputStream stream, String classname, File container)
throws IOException, SecurityException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int bytesRead = -1;
byte[] buffer = new byte[BUFFER_SIZE];
while ((bytesRead = stream.read... | [
"private",
"Class",
"getClassFromStream",
"(",
"InputStream",
"stream",
",",
"String",
"classname",
",",
"File",
"container",
")",
"throws",
"IOException",
",",
"SecurityException",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
... | Reads a class definition from a stream.
@param stream The stream from which the class is to be read.
Must not be <code>null</code>.
@param classname The name of the class in the stream.
Must not be <code>null</code>.
@param container the file or directory containing the class.
@return the Class object read from the s... | [
"Reads",
"a",
"class",
"definition",
"from",
"a",
"stream",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1300-L1311 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.