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 |
|---|---|---|---|---|---|---|---|---|---|---|
m-m-m/util | pojopath/src/main/java/net/sf/mmm/util/pojo/path/base/AbstractPojoPathNavigator.java | AbstractPojoPathNavigator.getPath | private CachingPojoPath getPath(Object pojo, String pojoPath, PojoPathMode mode, PojoPathContext context) {
"""
This method contains the internal implementation of {@link #get(Object, String, PojoPathMode, PojoPathContext)}.
@param pojo is the initial {@link net.sf.mmm.util.pojo.api.Pojo} to operate on.
@param... | java | private CachingPojoPath getPath(Object pojo, String pojoPath, PojoPathMode mode, PojoPathContext context) {
if (pojo == null) {
if (mode == PojoPathMode.RETURN_IF_NULL) {
return null;
} else if (mode == PojoPathMode.RETURN_IF_NULL) {
throw new PojoPathCreationException(null, pojoPath);
... | [
"private",
"CachingPojoPath",
"getPath",
"(",
"Object",
"pojo",
",",
"String",
"pojoPath",
",",
"PojoPathMode",
"mode",
",",
"PojoPathContext",
"context",
")",
"{",
"if",
"(",
"pojo",
"==",
"null",
")",
"{",
"if",
"(",
"mode",
"==",
"PojoPathMode",
".",
"R... | This method contains the internal implementation of {@link #get(Object, String, PojoPathMode, PojoPathContext)}.
@param pojo is the initial {@link net.sf.mmm.util.pojo.api.Pojo} to operate on.
@param pojoPath is the {@link net.sf.mmm.util.pojo.path.api.PojoPath} to navigate.
@param mode is the {@link PojoPathMode mode... | [
"This",
"method",
"contains",
"the",
"internal",
"implementation",
"of",
"{",
"@link",
"#get",
"(",
"Object",
"String",
"PojoPathMode",
"PojoPathContext",
")",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojopath/src/main/java/net/sf/mmm/util/pojo/path/base/AbstractPojoPathNavigator.java#L281-L294 |
NoraUi/NoraUi | src/main/java/com/github/noraui/utils/Messages.java | Messages.countWildcardsOccurrences | private static int countWildcardsOccurrences(String templateMessage, String occurrence) {
"""
Count the number of occurrences of a given wildcard.
@param templateMessage
Input string
@param occurrence
String searched.
@return The number of occurrences.
"""
if (templateMessage != null && occurre... | java | private static int countWildcardsOccurrences(String templateMessage, String occurrence) {
if (templateMessage != null && occurrence != null) {
final Pattern pattern = Pattern.compile(occurrence);
final Matcher matcher = pattern.matcher(templateMessage);
int count = 0;
... | [
"private",
"static",
"int",
"countWildcardsOccurrences",
"(",
"String",
"templateMessage",
",",
"String",
"occurrence",
")",
"{",
"if",
"(",
"templateMessage",
"!=",
"null",
"&&",
"occurrence",
"!=",
"null",
")",
"{",
"final",
"Pattern",
"pattern",
"=",
"Pattern... | Count the number of occurrences of a given wildcard.
@param templateMessage
Input string
@param occurrence
String searched.
@return The number of occurrences. | [
"Count",
"the",
"number",
"of",
"occurrences",
"of",
"a",
"given",
"wildcard",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Messages.java#L166-L178 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/util/BOMUtil.java | BOMUtil.getBOMType | public static int getBOMType(byte[] bytes, int length) {
"""
<p>getBOMType.</p>
@param bytes an array of byte.
@param length a int.
@return a int.
"""
for (int i = 0; i < BOMBYTES.length; i++)
{
for (int j = 0; j < length && j < BOMBYTES[i].length; j++)
{
... | java | public static int getBOMType(byte[] bytes, int length)
{
for (int i = 0; i < BOMBYTES.length; i++)
{
for (int j = 0; j < length && j < BOMBYTES[i].length; j++)
{
if (bytes[j] != BOMBYTES[i][j])
{
break;
}
... | [
"public",
"static",
"int",
"getBOMType",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"length",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"BOMBYTES",
".",
"length",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
"... | <p>getBOMType.</p>
@param bytes an array of byte.
@param length a int.
@return a int. | [
"<p",
">",
"getBOMType",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/util/BOMUtil.java#L78-L95 |
Trilarion/java-vorbis-support | src/main/java/com/github/trilarion/sound/vorbis/sampled/spi/VorbisAudioFileReader.java | VorbisAudioFileReader.getAudioFileFormat | @Override
public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
"""
Return the AudioFileFormat from the given file.
@return
@throws javax.sound.sampled.UnsupportedAudioFileException
@throws java.io.IOException
"""
LOG.log(Level.FINE, "getAudio... | java | @Override
public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
LOG.log(Level.FINE, "getAudioFileFormat(File file)");
try (InputStream inputStream = new BufferedInputStream(new FileInputStream(file))) {
inputStream.mark(MARK_LIMIT);
... | [
"@",
"Override",
"public",
"AudioFileFormat",
"getAudioFileFormat",
"(",
"File",
"file",
")",
"throws",
"UnsupportedAudioFileException",
",",
"IOException",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"getAudioFileFormat(File file)\"",
")",
";",
"try",... | Return the AudioFileFormat from the given file.
@return
@throws javax.sound.sampled.UnsupportedAudioFileException
@throws java.io.IOException | [
"Return",
"the",
"AudioFileFormat",
"from",
"the",
"given",
"file",
"."
] | train | https://github.com/Trilarion/java-vorbis-support/blob/f72aba7d97167fe0ff20b1b719fdb5bb662ff736/src/main/java/com/github/trilarion/sound/vorbis/sampled/spi/VorbisAudioFileReader.java#L96-L109 |
oboehm/jfachwert | src/main/java/de/jfachwert/bank/Geldbetrag.java | Geldbetrag.valueOf | public static Geldbetrag valueOf(String other) {
"""
Wandelt den angegebenen MonetaryAmount in einen Geldbetrag um. Um die
Anzahl von Objekten gering zu halten, wird nur dann tatsaechlich eine
neues Objekt erzeugt, wenn es sich nicht vermeiden laesst.
<p>
In Anlehnung an {@link BigDecimal} heisst die Methode "... | java | public static Geldbetrag valueOf(String other) {
try {
return DEFAULT_FORMATTER.parse(other);
} catch (MonetaryParseException ex) {
throw new IllegalArgumentException(other, ex);
}
} | [
"public",
"static",
"Geldbetrag",
"valueOf",
"(",
"String",
"other",
")",
"{",
"try",
"{",
"return",
"DEFAULT_FORMATTER",
".",
"parse",
"(",
"other",
")",
";",
"}",
"catch",
"(",
"MonetaryParseException",
"ex",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | Wandelt den angegebenen MonetaryAmount in einen Geldbetrag um. Um die
Anzahl von Objekten gering zu halten, wird nur dann tatsaechlich eine
neues Objekt erzeugt, wenn es sich nicht vermeiden laesst.
<p>
In Anlehnung an {@link BigDecimal} heisst die Methode "valueOf".
</p>
@param other the other
@return ein Geldbetrag | [
"Wandelt",
"den",
"angegebenen",
"MonetaryAmount",
"in",
"einen",
"Geldbetrag",
"um",
".",
"Um",
"die",
"Anzahl",
"von",
"Objekten",
"gering",
"zu",
"halten",
"wird",
"nur",
"dann",
"tatsaechlich",
"eine",
"neues",
"Objekt",
"erzeugt",
"wenn",
"es",
"sich",
"n... | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/bank/Geldbetrag.java#L238-L244 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.putAt | public static <T> void putAt(List<T> self, int idx, T value) {
"""
A helper method to allow lists to work with subscript operators.
<pre class="groovyTestCase">def list = [2, 3]
list[0] = 1
assert list == [1, 3]</pre>
@param self a List
@param idx an index
@param value the value to put at the given inde... | java | public static <T> void putAt(List<T> self, int idx, T value) {
int size = self.size();
idx = normaliseIndex(idx, size);
if (idx < size) {
self.set(idx, value);
} else {
while (size < idx) {
self.add(size++, null);
}
self.add... | [
"public",
"static",
"<",
"T",
">",
"void",
"putAt",
"(",
"List",
"<",
"T",
">",
"self",
",",
"int",
"idx",
",",
"T",
"value",
")",
"{",
"int",
"size",
"=",
"self",
".",
"size",
"(",
")",
";",
"idx",
"=",
"normaliseIndex",
"(",
"idx",
",",
"size... | A helper method to allow lists to work with subscript operators.
<pre class="groovyTestCase">def list = [2, 3]
list[0] = 1
assert list == [1, 3]</pre>
@param self a List
@param idx an index
@param value the value to put at the given index
@since 1.0 | [
"A",
"helper",
"method",
"to",
"allow",
"lists",
"to",
"work",
"with",
"subscript",
"operators",
".",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"def",
"list",
"=",
"[",
"2",
"3",
"]",
"list",
"[",
"0",
"]",
"=",
"1",
"assert",
"list",
"==",
"[",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L7952-L7963 |
czyzby/gdx-lml | autumn/src/main/java/com/github/czyzby/autumn/context/ContextInitializer.java | ContextInitializer.processFields | private void processFields(final Object component, final Context context, final ContextDestroyer contextDestroyer) {
"""
Scans class tree of component to process all its fields.
@param component all fields of its class tree will be processed.
@param context used to resolve dependencies.
@param contextDestroye... | java | private void processFields(final Object component, final Context context, final ContextDestroyer contextDestroyer) {
Class<?> componentClass = component.getClass();
while (componentClass != null && !componentClass.equals(Object.class)) {
final Field[] fields = ClassReflection.getDeclaredFiel... | [
"private",
"void",
"processFields",
"(",
"final",
"Object",
"component",
",",
"final",
"Context",
"context",
",",
"final",
"ContextDestroyer",
"contextDestroyer",
")",
"{",
"Class",
"<",
"?",
">",
"componentClass",
"=",
"component",
".",
"getClass",
"(",
")",
... | Scans class tree of component to process all its fields.
@param component all fields of its class tree will be processed.
@param context used to resolve dependencies.
@param contextDestroyer used to register destruction callbacks. | [
"Scans",
"class",
"tree",
"of",
"component",
"to",
"process",
"all",
"its",
"fields",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/autumn/src/main/java/com/github/czyzby/autumn/context/ContextInitializer.java#L635-L644 |
adyliu/jafka | src/main/java/io/jafka/api/ProducerRequest.java | ProducerRequest.readFrom | public static ProducerRequest readFrom(ByteBuffer buffer) {
"""
read a producer request from buffer
@param buffer data buffer
@return parsed producer request
"""
String topic = Utils.readShortString(buffer);
int partition = buffer.getInt();
int messageSetSize = buffer.getInt();
... | java | public static ProducerRequest readFrom(ByteBuffer buffer) {
String topic = Utils.readShortString(buffer);
int partition = buffer.getInt();
int messageSetSize = buffer.getInt();
ByteBuffer messageSetBuffer = buffer.slice();
messageSetBuffer.limit(messageSetSize);
buffer.po... | [
"public",
"static",
"ProducerRequest",
"readFrom",
"(",
"ByteBuffer",
"buffer",
")",
"{",
"String",
"topic",
"=",
"Utils",
".",
"readShortString",
"(",
"buffer",
")",
";",
"int",
"partition",
"=",
"buffer",
".",
"getInt",
"(",
")",
";",
"int",
"messageSetSiz... | read a producer request from buffer
@param buffer data buffer
@return parsed producer request | [
"read",
"a",
"producer",
"request",
"from",
"buffer"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/api/ProducerRequest.java#L57-L65 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SendMessageBuilder.java | SendMessageBuilder.jsonPath | public T jsonPath(String expression, String value) {
"""
Adds JSONPath manipulating expression that evaluates to message payload before sending.
@param expression
@param value
@return
"""
if (jsonPathMessageConstructionInterceptor == null) {
jsonPathMessageConstructionInterceptor = new J... | java | public T jsonPath(String expression, String value) {
if (jsonPathMessageConstructionInterceptor == null) {
jsonPathMessageConstructionInterceptor = new JsonPathMessageConstructionInterceptor();
if (getAction().getMessageBuilder() != null) {
(getAction().getMessageBuilder... | [
"public",
"T",
"jsonPath",
"(",
"String",
"expression",
",",
"String",
"value",
")",
"{",
"if",
"(",
"jsonPathMessageConstructionInterceptor",
"==",
"null",
")",
"{",
"jsonPathMessageConstructionInterceptor",
"=",
"new",
"JsonPathMessageConstructionInterceptor",
"(",
")... | Adds JSONPath manipulating expression that evaluates to message payload before sending.
@param expression
@param value
@return | [
"Adds",
"JSONPath",
"manipulating",
"expression",
"that",
"evaluates",
"to",
"message",
"payload",
"before",
"sending",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SendMessageBuilder.java#L531-L547 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.loadUtf8 | public static <T> T loadUtf8(File file, ReaderHandler<T> readerHandler) throws IORuntimeException {
"""
按照给定的readerHandler读取文件中的数据
@param <T> 集合类型
@param readerHandler Reader处理类
@param file 文件
@return 从文件中load出的数据
@throws IORuntimeException IO异常
@since 3.1.1
"""
return load(file, CharsetUtil.CHARSET... | java | public static <T> T loadUtf8(File file, ReaderHandler<T> readerHandler) throws IORuntimeException {
return load(file, CharsetUtil.CHARSET_UTF_8, readerHandler);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"loadUtf8",
"(",
"File",
"file",
",",
"ReaderHandler",
"<",
"T",
">",
"readerHandler",
")",
"throws",
"IORuntimeException",
"{",
"return",
"load",
"(",
"file",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8",
",",
"readerHand... | 按照给定的readerHandler读取文件中的数据
@param <T> 集合类型
@param readerHandler Reader处理类
@param file 文件
@return 从文件中load出的数据
@throws IORuntimeException IO异常
@since 3.1.1 | [
"按照给定的readerHandler读取文件中的数据"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2530-L2532 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isSelect | private boolean isSelect(String action, String expected) {
"""
Determines if the element is a select.
@param action - what action is occurring
@param expected - what is the expected result
@return Boolean: is the element enabled?
"""
// wait for element to be displayed
if (!is.select()) ... | java | private boolean isSelect(String action, String expected) {
// wait for element to be displayed
if (!is.select()) {
reporter.fail(action, expected, Element.CANT_SELECT + prettyOutput() + NOT_A_SELECT);
// indicates element not an input
return false;
}
r... | [
"private",
"boolean",
"isSelect",
"(",
"String",
"action",
",",
"String",
"expected",
")",
"{",
"// wait for element to be displayed",
"if",
"(",
"!",
"is",
".",
"select",
"(",
")",
")",
"{",
"reporter",
".",
"fail",
"(",
"action",
",",
"expected",
",",
"E... | Determines if the element is a select.
@param action - what action is occurring
@param expected - what is the expected result
@return Boolean: is the element enabled? | [
"Determines",
"if",
"the",
"element",
"is",
"a",
"select",
"."
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L675-L683 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/SubQuery.java | SubQuery.compare | @Override
public int compare(Object a, Object b) {
"""
This results in the following sort order:
view subqueries, then other subqueries
view subqueries:
views sorted by creation order (earlier declaration first)
other subqueries:
subqueries sorted by depth within select query (deep == higher level)
... | java | @Override
public int compare(Object a, Object b) {
SubQuery sqa = (SubQuery) a;
SubQuery sqb = (SubQuery) b;
if (sqa.parentView == null && sqb.parentView == null) {
return sqb.level - sqa.level;
} else if (sqa.parentView != null && sqb.parentView != null) {
... | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"Object",
"a",
",",
"Object",
"b",
")",
"{",
"SubQuery",
"sqa",
"=",
"(",
"SubQuery",
")",
"a",
";",
"SubQuery",
"sqb",
"=",
"(",
"SubQuery",
")",
"b",
";",
"if",
"(",
"sqa",
".",
"parentView",
"=="... | This results in the following sort order:
view subqueries, then other subqueries
view subqueries:
views sorted by creation order (earlier declaration first)
other subqueries:
subqueries sorted by depth within select query (deep == higher level) | [
"This",
"results",
"in",
"the",
"following",
"sort",
"order",
":"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/SubQuery.java#L250-L280 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.updateTextWithRamdomValueMatchRegexp | @Conditioned
@Quand("Je mets à jour le texte '(.*)-(.*)' avec une valeur aléatoire qui vérifie '(.*)'[\\.|\\?]")
@When("I update text '(.*)-(.*)' with ramdom match '(.*)'[\\.|\\?]")
public void updateTextWithRamdomValueMatchRegexp(String page, String elementName, String randRegex, List<GherkinStepConditi... | java | @Conditioned
@Quand("Je mets à jour le texte '(.*)-(.*)' avec une valeur aléatoire qui vérifie '(.*)'[\\.|\\?]")
@When("I update text '(.*)-(.*)' with ramdom match '(.*)'[\\.|\\?]")
public void updateTextWithRamdomValueMatchRegexp(String page, String elementName, String randRegex, List<GherkinStepConditi... | [
"@",
"Conditioned",
"@",
"Quand",
"(",
"\"Je mets à jour le texte '(.*)-(.*)' avec une valeur aléatoire qui vérifie '(.*)'[\\\\.|\\\\?]\")\r",
"",
"@",
"When",
"(",
"\"I update text '(.*)-(.*)' with ramdom match '(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"updateTextWithRamdomValueMat... | Update a html input text with a random text.
@param page
The concerned page of elementName
@param elementName
Is target element
@param randRegex
Is the new data (random value generated and match with randRegex)
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.... | [
"Update",
"a",
"html",
"input",
"text",
"with",
"a",
"random",
"text",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L606-L611 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.createCustomMapping | @When("^I create a Cassandra index named '(.+?)' with schema '(.+?)' of type '(json|string)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)' with:$")
public void createCustomMapping(String index_name, String schema, String type, String table, String magic_column, String keyspace, DataTable modifi... | java | @When("^I create a Cassandra index named '(.+?)' with schema '(.+?)' of type '(json|string)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)' with:$")
public void createCustomMapping(String index_name, String schema, String type, String table, String magic_column, String keyspace, DataTable modifi... | [
"@",
"When",
"(",
"\"^I create a Cassandra index named '(.+?)' with schema '(.+?)' of type '(json|string)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)' with:$\"",
")",
"public",
"void",
"createCustomMapping",
"(",
"String",
"index_name",
",",
"String",
"schema",
","... | Create a Cassandra index.
@param index_name index name
@param schema the file of configuration (.conf) with the options of mappin
@param type type of the changes in schema (string or json)
@param table table for create the index
@param magic_column magic column where index will be saved
@pa... | [
"Create",
"a",
"Cassandra",
"index",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L488-L496 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageReadChannel.java | GoogleCloudStorageReadChannel.openFooterStream | private InputStream openFooterStream() {
"""
Opens the underlying stream from {@link #footerContent}, sets its position to the {@link
#currentPosition}.
"""
contentChannelPosition = currentPosition;
int offset = Math.toIntExact(currentPosition - (size - footerContent.length));
int length = footerC... | java | private InputStream openFooterStream() {
contentChannelPosition = currentPosition;
int offset = Math.toIntExact(currentPosition - (size - footerContent.length));
int length = footerContent.length - offset;
logger.atFine().log(
"Opened stream (prefetched footer) from %s position for '%s'",
... | [
"private",
"InputStream",
"openFooterStream",
"(",
")",
"{",
"contentChannelPosition",
"=",
"currentPosition",
";",
"int",
"offset",
"=",
"Math",
".",
"toIntExact",
"(",
"currentPosition",
"-",
"(",
"size",
"-",
"footerContent",
".",
"length",
")",
")",
";",
"... | Opens the underlying stream from {@link #footerContent}, sets its position to the {@link
#currentPosition}. | [
"Opens",
"the",
"underlying",
"stream",
"from",
"{"
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageReadChannel.java#L865-L873 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexResponse.java | CmsFlexResponse.setHeaderList | private void setHeaderList(Map<String, List<String>> headers, String name, String value) {
"""
Helper method to set a value in the internal header list.
@param headers the headers to set the value in
@param name the name to set
@param value the value to set
"""
List<String> values = new ArrayList... | java | private void setHeaderList(Map<String, List<String>> headers, String name, String value) {
List<String> values = new ArrayList<String>();
values.add(SET_HEADER + value);
headers.put(name, values);
} | [
"private",
"void",
"setHeaderList",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"List",
"<",
"String",
">",
"values",
"=",
"new",
"ArrayList",
"<",
"String",
">",
... | Helper method to set a value in the internal header list.
@param headers the headers to set the value in
@param name the name to set
@param value the value to set | [
"Helper",
"method",
"to",
"set",
"a",
"value",
"in",
"the",
"internal",
"header",
"list",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexResponse.java#L1198-L1203 |
tropo/tropo-webapi-java | src/main/java/com/voxeo/tropo/Key.java | Key.MACHINE_DETECTION | public static Key MACHINE_DETECTION(String introduction, Voice voice) {
"""
<p>
If introduction is set, Tropo plays the TTS string using voice or plays the
audio file if a URL is defined (same behavior as say) during this wait.
Tropo will not return until introduction is done playing, even if it has
determined... | java | public static Key MACHINE_DETECTION(String introduction, Voice voice) {
Map<String, String> map = new LinkedHashMap<String, String>();
map.put("introduction", introduction);
if (voice != null) {
map.put("voice", voice.toString());
}
return createKey("machineDetection", map);
... | [
"public",
"static",
"Key",
"MACHINE_DETECTION",
"(",
"String",
"introduction",
",",
"Voice",
"voice",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"map",
".",
... | <p>
If introduction is set, Tropo plays the TTS string using voice or plays the
audio file if a URL is defined (same behavior as say) during this wait.
Tropo will not return until introduction is done playing, even if it has
determined a human voice or machine response before the introduction is
complete.
</p>
<p>
For ... | [
"<p",
">",
"If",
"introduction",
"is",
"set",
"Tropo",
"plays",
"the",
"TTS",
"string",
"using",
"voice",
"or",
"plays",
"the",
"audio",
"file",
"if",
"a",
"URL",
"is",
"defined",
"(",
"same",
"behavior",
"as",
"say",
")",
"during",
"this",
"wait",
"."... | train | https://github.com/tropo/tropo-webapi-java/blob/96af1fa292c1d4b6321d85a559d9718d33eec7e0/src/main/java/com/voxeo/tropo/Key.java#L726-L735 |
pravega/pravega | controller/src/main/java/io/pravega/controller/task/TaskSweeper.java | TaskSweeper.initializeMappingTable | private void initializeMappingTable() {
"""
Creates the table mapping method names and versions to Method objects and corresponding TaskBase objects
"""
for (TaskBase taskClassObject : taskClassObjects) {
Class<? extends TaskBase> claz = taskClassObject.getClass();
for (Method m... | java | private void initializeMappingTable() {
for (TaskBase taskClassObject : taskClassObjects) {
Class<? extends TaskBase> claz = taskClassObject.getClass();
for (Method method : claz.getDeclaredMethods()) {
for (Annotation annotation : method.getAnnotations()) {
... | [
"private",
"void",
"initializeMappingTable",
"(",
")",
"{",
"for",
"(",
"TaskBase",
"taskClassObject",
":",
"taskClassObjects",
")",
"{",
"Class",
"<",
"?",
"extends",
"TaskBase",
">",
"claz",
"=",
"taskClassObject",
".",
"getClass",
"(",
")",
";",
"for",
"(... | Creates the table mapping method names and versions to Method objects and corresponding TaskBase objects | [
"Creates",
"the",
"table",
"mapping",
"method",
"names",
"and",
"versions",
"to",
"Method",
"objects",
"and",
"corresponding",
"TaskBase",
"objects"
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/TaskSweeper.java#L249-L269 |
netkicorp/java-wns-resolver | src/main/java/com/netki/tlsa/TLSAValidator.java | TLSAValidator.isValidCertChain | public boolean isValidCertChain(Certificate targetCert, List<Certificate> certs) {
"""
Validate whether the target cert is valid using the CA Certificate KeyStore and any included intermediate certificates
@param targetCert Target certificate to validate
@param certs Intermediate certificates to using during val... | java | public boolean isValidCertChain(Certificate targetCert, List<Certificate> certs) {
try {
KeyStore cacerts = this.caCertService.getCaCertKeystore();
for (Certificate cert : certs) {
if (cert == targetCert) continue;
cacerts.setCertificateEntry(((X509Certif... | [
"public",
"boolean",
"isValidCertChain",
"(",
"Certificate",
"targetCert",
",",
"List",
"<",
"Certificate",
">",
"certs",
")",
"{",
"try",
"{",
"KeyStore",
"cacerts",
"=",
"this",
".",
"caCertService",
".",
"getCaCertKeystore",
"(",
")",
";",
"for",
"(",
"Ce... | Validate whether the target cert is valid using the CA Certificate KeyStore and any included intermediate certificates
@param targetCert Target certificate to validate
@param certs Intermediate certificates to using during validation
@return isCertChainValid? | [
"Validate",
"whether",
"the",
"target",
"cert",
"is",
"valid",
"using",
"the",
"CA",
"Certificate",
"KeyStore",
"and",
"any",
"included",
"intermediate",
"certificates"
] | train | https://github.com/netkicorp/java-wns-resolver/blob/a7aad04d96c03feb05536aef189617beb4f011bc/src/main/java/com/netki/tlsa/TLSAValidator.java#L118-L131 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/VoltTrace.java | VoltTrace.instantAsync | public static TraceEvent instantAsync(String name, Object id, Object... args) {
"""
Creates an async instant trace event. This method does not queue the
event. Call {@link TraceEventBatch#add(Supplier)} to queue the event.
"""
return new TraceEvent(TraceEventType.ASYNC_INSTANT, name, String.valueOf(id... | java | public static TraceEvent instantAsync(String name, Object id, Object... args) {
return new TraceEvent(TraceEventType.ASYNC_INSTANT, name, String.valueOf(id), args);
} | [
"public",
"static",
"TraceEvent",
"instantAsync",
"(",
"String",
"name",
",",
"Object",
"id",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"TraceEvent",
"(",
"TraceEventType",
".",
"ASYNC_INSTANT",
",",
"name",
",",
"String",
".",
"valueOf",
"(",... | Creates an async instant trace event. This method does not queue the
event. Call {@link TraceEventBatch#add(Supplier)} to queue the event. | [
"Creates",
"an",
"async",
"instant",
"trace",
"event",
".",
"This",
"method",
"does",
"not",
"queue",
"the",
"event",
".",
"Call",
"{"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltTrace.java#L505-L507 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java | ManagedClustersInner.updateTagsAsync | public Observable<ManagedClusterInner> updateTagsAsync(String resourceGroupName, String resourceName) {
"""
Updates tags on a managed cluster.
Updates a managed cluster with the specified tags.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resourc... | java | public Observable<ManagedClusterInner> updateTagsAsync(String resourceGroupName, String resourceName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ManagedClusterInner>, ManagedClusterInner>() {
@Override
public ManagedClusterI... | [
"public",
"Observable",
"<",
"ManagedClusterInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
"map",
"(",
... | Updates tags on a managed cluster.
Updates a managed cluster with the specified tags.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"tags",
"on",
"a",
"managed",
"cluster",
".",
"Updates",
"a",
"managed",
"cluster",
"with",
"the",
"specified",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java#L1040-L1047 |
JosePaumard/streams-utils | src/main/java/org/paumard/streams/StreamsUtils.java | StreamsUtils.gate | @Deprecated(since="2.0")
public static <E> Stream<E> gate(Stream<E> stream, Predicate<? super E> validator) {
"""
<p>Generates a stream that does not generate any element, until the validator becomes true for an element of
the provided stream. From this point, the returns stream is identical to the provided s... | java | @Deprecated(since="2.0")
public static <E> Stream<E> gate(Stream<E> stream, Predicate<? super E> validator) {
Objects.requireNonNull(stream);
Objects.requireNonNull(validator);
GatingSpliterator<E> spliterator = GatingSpliterator.of(stream.spliterator(), validator);
return StreamSup... | [
"@",
"Deprecated",
"(",
"since",
"=",
"\"2.0\"",
")",
"public",
"static",
"<",
"E",
">",
"Stream",
"<",
"E",
">",
"gate",
"(",
"Stream",
"<",
"E",
">",
"stream",
",",
"Predicate",
"<",
"?",
"super",
"E",
">",
"validator",
")",
"{",
"Objects",
".",
... | <p>Generates a stream that does not generate any element, until the validator becomes true for an element of
the provided stream. From this point, the returns stream is identical to the provided stream. </p>
<p>If you are using Java 9, then yo should use <code>Stream.dropWhile(Predicate)</code>. </p>
<p>A <code>NullPoi... | [
"<p",
">",
"Generates",
"a",
"stream",
"that",
"does",
"not",
"generate",
"any",
"element",
"until",
"the",
"validator",
"becomes",
"true",
"for",
"an",
"element",
"of",
"the",
"provided",
"stream",
".",
"From",
"this",
"point",
"the",
"returns",
"stream",
... | train | https://github.com/JosePaumard/streams-utils/blob/56152574af0aca44c5f679761202a8f90984ab73/src/main/java/org/paumard/streams/StreamsUtils.java#L509-L516 |
mockito/mockito | src/main/java/org/mockito/internal/matchers/text/ValuePrinter.java | ValuePrinter.printValues | public static String printValues(String start, String separator, String end, Iterator<?> values) {
"""
Print values in a nice format, e.g. (1, 2, 3)
@param start the beginning of the values, e.g. "("
@param separator the separator of values, e.g. ", "
@param end the end of the values, e.g. ")"
@param values ... | java | public static String printValues(String start, String separator, String end, Iterator<?> values) {
if(start == null){
start = "(";
}
if (separator == null){
separator = ",";
}
if (end == null){
end = ")";
}
StringBuilder sb = n... | [
"public",
"static",
"String",
"printValues",
"(",
"String",
"start",
",",
"String",
"separator",
",",
"String",
"end",
",",
"Iterator",
"<",
"?",
">",
"values",
")",
"{",
"if",
"(",
"start",
"==",
"null",
")",
"{",
"start",
"=",
"\"(\"",
";",
"}",
"i... | Print values in a nice format, e.g. (1, 2, 3)
@param start the beginning of the values, e.g. "("
@param separator the separator of values, e.g. ", "
@param end the end of the values, e.g. ")"
@param values the values to print
@return neatly formatted value list | [
"Print",
"values",
"in",
"a",
"nice",
"format",
"e",
".",
"g",
".",
"(",
"1",
"2",
"3",
")"
] | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/matchers/text/ValuePrinter.java#L100-L119 |
vakinge/jeesuite-libs | jeesuite-spring/src/main/java/com/jeesuite/spring/InstanceFactory.java | InstanceFactory.getInstance | public static <T> T getInstance(Class<T> beanClass, String beanName) {
"""
获取指定类型的对象实例。如果IoC容器没配置好或者IoC容器中找不到该实例则抛出异常。
@param <T> 对象的类型
@param beanName 实现类在容器中配置的名字
@param beanClass 对象的类
@return 类型为T的对象实例
"""
return (T) getInstanceProvider().getInstance(beanClass, beanName);
} | java | public static <T> T getInstance(Class<T> beanClass, String beanName) {
return (T) getInstanceProvider().getInstance(beanClass, beanName);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getInstance",
"(",
"Class",
"<",
"T",
">",
"beanClass",
",",
"String",
"beanName",
")",
"{",
"return",
"(",
"T",
")",
"getInstanceProvider",
"(",
")",
".",
"getInstance",
"(",
"beanClass",
",",
"beanName",
")",
... | 获取指定类型的对象实例。如果IoC容器没配置好或者IoC容器中找不到该实例则抛出异常。
@param <T> 对象的类型
@param beanName 实现类在容器中配置的名字
@param beanClass 对象的类
@return 类型为T的对象实例 | [
"获取指定类型的对象实例。如果IoC容器没配置好或者IoC容器中找不到该实例则抛出异常。"
] | train | https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-spring/src/main/java/com/jeesuite/spring/InstanceFactory.java#L61-L63 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/context/configure/AbstractConfiguration.java | AbstractConfiguration.getPropertyValueAs | public <T> T getPropertyValueAs(final String propertyName, final boolean required, final Class<T> type) {
"""
Gets the value of the configuration property identified by name as a value of the specified Class type.
The required parameter can be used to indicate the property is not required and that a Configuration... | java | public <T> T getPropertyValueAs(final String propertyName, final boolean required, final Class<T> type) {
try {
return convert(getPropertyValue(propertyName, required), type);
}
catch (ConversionException e) {
if (required) {
throw new ConfigurationException(String.format(
"Fai... | [
"public",
"<",
"T",
">",
"T",
"getPropertyValueAs",
"(",
"final",
"String",
"propertyName",
",",
"final",
"boolean",
"required",
",",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"try",
"{",
"return",
"convert",
"(",
"getPropertyValue",
"(",
"propert... | Gets the value of the configuration property identified by name as a value of the specified Class type.
The required parameter can be used to indicate the property is not required and that a ConfigurationException
should not be thrown if the property is undeclared or undefined.
@param propertyName a String value indic... | [
"Gets",
"the",
"value",
"of",
"the",
"configuration",
"property",
"identified",
"by",
"name",
"as",
"a",
"value",
"of",
"the",
"specified",
"Class",
"type",
".",
"The",
"required",
"parameter",
"can",
"be",
"used",
"to",
"indicate",
"the",
"property",
"is",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/context/configure/AbstractConfiguration.java#L247-L260 |
MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/mapping/Mapper.java | Mapper.fromDBObject | @Deprecated
<T> T fromDBObject(final Datastore datastore, final DBObject dbObject) {
"""
Converts an entity (POJO) to a DBObject. A special field will be added to keep track of the class type.
@param datastore the Datastore to use when fetching this reference
@param dbObject the DBObject
@param <T> ... | java | @Deprecated
<T> T fromDBObject(final Datastore datastore, final DBObject dbObject) {
if (dbObject.containsField(opts.getDiscriminatorField())) {
T entity = opts.getObjectFactory().createInstance(null, dbObject);
entity = fromDb(datastore, dbObject, entity, createEntityCache());
... | [
"@",
"Deprecated",
"<",
"T",
">",
"T",
"fromDBObject",
"(",
"final",
"Datastore",
"datastore",
",",
"final",
"DBObject",
"dbObject",
")",
"{",
"if",
"(",
"dbObject",
".",
"containsField",
"(",
"opts",
".",
"getDiscriminatorField",
"(",
")",
")",
")",
"{",
... | Converts an entity (POJO) to a DBObject. A special field will be added to keep track of the class type.
@param datastore the Datastore to use when fetching this reference
@param dbObject the DBObject
@param <T> the type of the referenced entity
@return the entity
@morphia.internal
@deprecated no replacement is... | [
"Converts",
"an",
"entity",
"(",
"POJO",
")",
"to",
"a",
"DBObject",
".",
"A",
"special",
"field",
"will",
"be",
"added",
"to",
"keep",
"track",
"of",
"the",
"class",
"type",
"."
] | train | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/mapping/Mapper.java#L237-L248 |
seedstack/i18n-addon | rest/src/main/java/org/seedstack/i18n/rest/internal/key/KeyResource.java | KeyResource.getKey | @GET
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions(I18nPermissions.KEY_READ)
public KeyRepresentation getKey() {
"""
Returns a key with the default translation.
@return translated key
"""
KeyRepresentation keyRepresentation = keyFinder.findKeyWithName(keyName);
if (k... | java | @GET
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions(I18nPermissions.KEY_READ)
public KeyRepresentation getKey() {
KeyRepresentation keyRepresentation = keyFinder.findKeyWithName(keyName);
if (keyRepresentation == null) {
throw new NotFoundException(String.format(KEY_N... | [
"@",
"GET",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"RequiresPermissions",
"(",
"I18nPermissions",
".",
"KEY_READ",
")",
"public",
"KeyRepresentation",
"getKey",
"(",
")",
"{",
"KeyRepresentation",
"keyRepresentation",
"=",
"keyFinder",... | Returns a key with the default translation.
@return translated key | [
"Returns",
"a",
"key",
"with",
"the",
"default",
"translation",
"."
] | train | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/main/java/org/seedstack/i18n/rest/internal/key/KeyResource.java#L66-L75 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.createCustomPrebuiltEntityRoleWithServiceResponseAsync | public Observable<ServiceResponse<UUID>> createCustomPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreateCustomPrebuiltEntityRoleOptionalParameter createCustomPrebuiltEntityRoleOptionalParameter) {
"""
Create an entity role for an entity in the application.
@param appId... | java | public Observable<ServiceResponse<UUID>> createCustomPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreateCustomPrebuiltEntityRoleOptionalParameter createCustomPrebuiltEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgum... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"UUID",
">",
">",
"createCustomPrebuiltEntityRoleWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"CreateCustomPrebuiltEntityRoleOptionalParameter",
"createCustomPre... | Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity model ID.
@param createCustomPrebuiltEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgument... | [
"Create",
"an",
"entity",
"role",
"for",
"an",
"entity",
"in",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L9760-L9776 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.extractRow | public static DMatrixRMaj extractRow(DMatrixRMaj a , int row , DMatrixRMaj out ) {
"""
Extracts the row from a matrix.
@param a Input matrix
@param row Which row is to be extracted
@param out output. Storage for the extracted row. If null then a new vector will be returned.
@return The extracted row.
"""
... | java | public static DMatrixRMaj extractRow(DMatrixRMaj a , int row , DMatrixRMaj out ) {
if( out == null)
out = new DMatrixRMaj(1,a.numCols);
else if( !MatrixFeatures_DDRM.isVector(out) || out.getNumElements() != a.numCols )
throw new MatrixDimensionException("Output must be a vector o... | [
"public",
"static",
"DMatrixRMaj",
"extractRow",
"(",
"DMatrixRMaj",
"a",
",",
"int",
"row",
",",
"DMatrixRMaj",
"out",
")",
"{",
"if",
"(",
"out",
"==",
"null",
")",
"out",
"=",
"new",
"DMatrixRMaj",
"(",
"1",
",",
"a",
".",
"numCols",
")",
";",
"el... | Extracts the row from a matrix.
@param a Input matrix
@param row Which row is to be extracted
@param out output. Storage for the extracted row. If null then a new vector will be returned.
@return The extracted row. | [
"Extracts",
"the",
"row",
"from",
"a",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1330-L1339 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/proxy/BaseSessionHolder.java | BaseSessionHolder.doProcess | public void doProcess(InputStream in, PrintWriter out, Map<String, Object> properties)
throws RemoteException {
"""
Handle the command send from my client peer.
@param in The (optional) Inputstream to get the params from.
@param out The stream to write the results.
"""
String strCommand = thi... | java | public void doProcess(InputStream in, PrintWriter out, Map<String, Object> properties)
throws RemoteException
{
String strCommand = this.getProperty(REMOTE_COMMAND, properties);
try {
if (FREE_REMOTE_SESSION.equals(strCommand))
{
((BaseSession)m_remote... | [
"public",
"void",
"doProcess",
"(",
"InputStream",
"in",
",",
"PrintWriter",
"out",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"throws",
"RemoteException",
"{",
"String",
"strCommand",
"=",
"this",
".",
"getProperty",
"(",
"REMOTE_COMMAN... | Handle the command send from my client peer.
@param in The (optional) Inputstream to get the params from.
@param out The stream to write the results. | [
"Handle",
"the",
"command",
"send",
"from",
"my",
"client",
"peer",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/proxy/BaseSessionHolder.java#L62-L93 |
samskivert/pythagoras | src/main/java/pythagoras/f/Lines.java | Lines.pointSegDist | public static float pointSegDist (float px, float py, float x1, float y1, float x2, float y2) {
"""
Returns the distance between the specified point and the specified line segment.
"""
return FloatMath.sqrt(pointSegDistSq(px, py, x1, y1, x2, y2));
} | java | public static float pointSegDist (float px, float py, float x1, float y1, float x2, float y2) {
return FloatMath.sqrt(pointSegDistSq(px, py, x1, y1, x2, y2));
} | [
"public",
"static",
"float",
"pointSegDist",
"(",
"float",
"px",
",",
"float",
"py",
",",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"x2",
",",
"float",
"y2",
")",
"{",
"return",
"FloatMath",
".",
"sqrt",
"(",
"pointSegDistSq",
"(",
"px",
",",
... | Returns the distance between the specified point and the specified line segment. | [
"Returns",
"the",
"distance",
"between",
"the",
"specified",
"point",
"and",
"the",
"specified",
"line",
"segment",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Lines.java#L121-L123 |
udoprog/ffwd-client-java | src/main/java/com/google/protobuf250/DynamicMessage.java | DynamicMessage.getDefaultInstance | public static DynamicMessage getDefaultInstance(Descriptor type) {
"""
Get a {@code DynamicMessage} representing the default instance of the
given type.
"""
return new DynamicMessage(type, FieldSet.<FieldDescriptor>emptySet(),
UnknownFieldSet.getDefaultInstance());
} | java | public static DynamicMessage getDefaultInstance(Descriptor type) {
return new DynamicMessage(type, FieldSet.<FieldDescriptor>emptySet(),
UnknownFieldSet.getDefaultInstance());
} | [
"public",
"static",
"DynamicMessage",
"getDefaultInstance",
"(",
"Descriptor",
"type",
")",
"{",
"return",
"new",
"DynamicMessage",
"(",
"type",
",",
"FieldSet",
".",
"<",
"FieldDescriptor",
">",
"emptySet",
"(",
")",
",",
"UnknownFieldSet",
".",
"getDefaultInstan... | Get a {@code DynamicMessage} representing the default instance of the
given type. | [
"Get",
"a",
"{"
] | train | https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/com/google/protobuf250/DynamicMessage.java#L67-L70 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Maybe.java | Maybe.doOnComplete | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> doOnComplete(Action onComplete) {
"""
Modifies the source Maybe so that it invokes an action when it calls {@code onComplete}.
<p>
<img width="640" height="358" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-ope... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> doOnComplete(Action onComplete) {
return RxJavaPlugins.onAssembly(new MaybePeek<T>(this,
Functions.emptyConsumer(), // onSubscribe
Functions.emptyConsumer(), // onSuccess
Func... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Maybe",
"<",
"T",
">",
"doOnComplete",
"(",
"Action",
"onComplete",
")",
"{",
"return",
"RxJavaPlugins",
".",
"onAssembly",
"(",
"new",
"MaybePeek",
... | Modifies the source Maybe so that it invokes an action when it calls {@code onComplete}.
<p>
<img width="640" height="358" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnComplete.m.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code doOnComplete} does not operate by default on a particula... | [
"Modifies",
"the",
"source",
"Maybe",
"so",
"that",
"it",
"invokes",
"an",
"action",
"when",
"it",
"calls",
"{",
"@code",
"onComplete",
"}",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"358",
"src",
"=",
"https",
":",
"//",
"raw",
"."... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Maybe.java#L2752-L2763 |
podio/podio-java | src/main/java/com/podio/app/AppAPI.java | AppAPI.getField | public ApplicationField getField(int appId, int fieldId) {
"""
Returns a single field from an app.
@param appId
The id of the app the field is on
@param fieldId
The id of the field to be returned
@return The definition and current configuration of the requested field
"""
return getResourceFactory().ge... | java | public ApplicationField getField(int appId, int fieldId) {
return getResourceFactory().getApiResource(
"/app/" + appId + "/field/" + fieldId).get(
ApplicationField.class);
} | [
"public",
"ApplicationField",
"getField",
"(",
"int",
"appId",
",",
"int",
"fieldId",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/app/\"",
"+",
"appId",
"+",
"\"/field/\"",
"+",
"fieldId",
")",
".",
"get",
"(",
"Applic... | Returns a single field from an app.
@param appId
The id of the app the field is on
@param fieldId
The id of the field to be returned
@return The definition and current configuration of the requested field | [
"Returns",
"a",
"single",
"field",
"from",
"an",
"app",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L144-L148 |
BioPAX/Paxtools | paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java | BFS.isEquivalentInTheSet | protected boolean isEquivalentInTheSet(Node node, boolean direction, Set<Node> set) {
"""
Checks if an equivalent of the given node is in the set.
@param node Node to check equivalents
@param direction Direction to go to get equivalents
@param set Node set
@return true if an equivalent is in the set
"""
... | java | protected boolean isEquivalentInTheSet(Node node, boolean direction, Set<Node> set)
{
for (Node eq : direction == UPWARD ? node.getUpperEquivalent() : node.getLowerEquivalent())
{
if (set.contains(eq)) return true;
boolean isIn = isEquivalentInTheSet(eq, direction, set);
if (isIn) return true;
}
... | [
"protected",
"boolean",
"isEquivalentInTheSet",
"(",
"Node",
"node",
",",
"boolean",
"direction",
",",
"Set",
"<",
"Node",
">",
"set",
")",
"{",
"for",
"(",
"Node",
"eq",
":",
"direction",
"==",
"UPWARD",
"?",
"node",
".",
"getUpperEquivalent",
"(",
")",
... | Checks if an equivalent of the given node is in the set.
@param node Node to check equivalents
@param direction Direction to go to get equivalents
@param set Node set
@return true if an equivalent is in the set | [
"Checks",
"if",
"an",
"equivalent",
"of",
"the",
"given",
"node",
"is",
"in",
"the",
"set",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java#L280-L289 |
ops4j/org.ops4j.base | ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java | ResourceManager.getPackageResources | public static Resources getPackageResources( Class clazz, Locale locale ) {
"""
Retrieve resource for specified Classes package.
The basename is determined by name of classes package
postfixed with ".Resources".
@param clazz the Class
@param locale the locale of the package resources requested.
@return t... | java | public static Resources getPackageResources( Class clazz, Locale locale )
{
return getBaseResources( getPackageResourcesBaseName( clazz ), locale, clazz.getClassLoader() );
} | [
"public",
"static",
"Resources",
"getPackageResources",
"(",
"Class",
"clazz",
",",
"Locale",
"locale",
")",
"{",
"return",
"getBaseResources",
"(",
"getPackageResourcesBaseName",
"(",
"clazz",
")",
",",
"locale",
",",
"clazz",
".",
"getClassLoader",
"(",
")",
"... | Retrieve resource for specified Classes package.
The basename is determined by name of classes package
postfixed with ".Resources".
@param clazz the Class
@param locale the locale of the package resources requested.
@return the Resources | [
"Retrieve",
"resource",
"for",
"specified",
"Classes",
"package",
".",
"The",
"basename",
"is",
"determined",
"by",
"name",
"of",
"classes",
"package",
"postfixed",
"with",
".",
"Resources",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java#L207-L210 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java | BytecodeHelper.isSameCompilationUnit | public static boolean isSameCompilationUnit(ClassNode a, ClassNode b) {
"""
Returns true if the two classes share the same compilation unit.
@param a class a
@param b class b
@return true if both classes share the same compilation unit
"""
CompileUnit cu1 = a.getCompileUnit();
CompileUnit cu... | java | public static boolean isSameCompilationUnit(ClassNode a, ClassNode b) {
CompileUnit cu1 = a.getCompileUnit();
CompileUnit cu2 = b.getCompileUnit();
return cu1 != null && cu1 == cu2;
} | [
"public",
"static",
"boolean",
"isSameCompilationUnit",
"(",
"ClassNode",
"a",
",",
"ClassNode",
"b",
")",
"{",
"CompileUnit",
"cu1",
"=",
"a",
".",
"getCompileUnit",
"(",
")",
";",
"CompileUnit",
"cu2",
"=",
"b",
".",
"getCompileUnit",
"(",
")",
";",
"ret... | Returns true if the two classes share the same compilation unit.
@param a class a
@param b class b
@return true if both classes share the same compilation unit | [
"Returns",
"true",
"if",
"the",
"two",
"classes",
"share",
"the",
"same",
"compilation",
"unit",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java#L565-L569 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.getCanvasArcToPoints | public static final Point2DArray getCanvasArcToPoints(final Point2D p0, final Point2D p1, final Point2D p2, final double r) {
"""
Canvas arcTo's have a variable center, as points a, b and c form two lines from the same point at a tangent to the arc's cirlce.
This returns the arcTo arc start, center and end points... | java | public static final Point2DArray getCanvasArcToPoints(final Point2D p0, final Point2D p1, final Point2D p2, final double r)
{
// see tangents drawn from same point to a circle
// http://www.mathcaptain.com/geometry/tangent-of-a-circle.html
final double a0 = getAngleBetweenTwoLines(p0, p1... | [
"public",
"static",
"final",
"Point2DArray",
"getCanvasArcToPoints",
"(",
"final",
"Point2D",
"p0",
",",
"final",
"Point2D",
"p1",
",",
"final",
"Point2D",
"p2",
",",
"final",
"double",
"r",
")",
"{",
"// see tangents drawn from same point to a circle\r",
"// http://w... | Canvas arcTo's have a variable center, as points a, b and c form two lines from the same point at a tangent to the arc's cirlce.
This returns the arcTo arc start, center and end points.
@param p0
@param p1
@param r
@return | [
"Canvas",
"arcTo",
"s",
"have",
"a",
"variable",
"center",
"as",
"points",
"a",
"b",
"and",
"c",
"form",
"two",
"lines",
"from",
"the",
"same",
"point",
"at",
"a",
"tangent",
"to",
"the",
"arc",
"s",
"cirlce",
".",
"This",
"returns",
"the",
"arcTo",
... | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L1110-L1142 |
knowm/XChange | xchange-mercadobitcoin/src/main/java/org/knowm/xchange/mercadobitcoin/MercadoBitcoinAdapters.java | MercadoBitcoinAdapters.adaptAccountInfo | public static AccountInfo adaptAccountInfo(
MercadoBitcoinBaseTradeApiResult<MercadoBitcoinAccountInfo> accountInfo, String userName) {
"""
Adapts a MercadoBitcoinBaseTradeApiResult<MercadoBitcoinAccountInfo> to an AccountInfo
@param accountInfo The Mercado Bitcoin accountInfo
@param userName The user na... | java | public static AccountInfo adaptAccountInfo(
MercadoBitcoinBaseTradeApiResult<MercadoBitcoinAccountInfo> accountInfo, String userName) {
// Adapt to XChange DTOs
Balance brlBalance = new Balance(Currency.BRL, accountInfo.getTheReturn().getFunds().getBrl());
Balance btcBalance = new Balance(Currency.BT... | [
"public",
"static",
"AccountInfo",
"adaptAccountInfo",
"(",
"MercadoBitcoinBaseTradeApiResult",
"<",
"MercadoBitcoinAccountInfo",
">",
"accountInfo",
",",
"String",
"userName",
")",
"{",
"// Adapt to XChange DTOs",
"Balance",
"brlBalance",
"=",
"new",
"Balance",
"(",
"Cur... | Adapts a MercadoBitcoinBaseTradeApiResult<MercadoBitcoinAccountInfo> to an AccountInfo
@param accountInfo The Mercado Bitcoin accountInfo
@param userName The user name
@return The account info | [
"Adapts",
"a",
"MercadoBitcoinBaseTradeApiResult<MercadoBitcoinAccountInfo",
">",
"to",
"an",
"AccountInfo"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-mercadobitcoin/src/main/java/org/knowm/xchange/mercadobitcoin/MercadoBitcoinAdapters.java#L154-L163 |
google/closure-templates | java/src/com/google/template/soy/msgs/SoyMsgBundleWithFullLocale.java | SoyMsgBundleWithFullLocale.preservingLocaleIfAllowed | public static SoyMsgBundle preservingLocaleIfAllowed(SoyMsgBundle bundle, Locale locale) {
"""
Returns a soy message bundle that exposes `locale` as its locale IF `locale` corresponds to the
same language as `bundle.getLocale()`. Intuitively, the returned bundle retains the passed-in
locale if it's compatible wi... | java | public static SoyMsgBundle preservingLocaleIfAllowed(SoyMsgBundle bundle, Locale locale) {
// When checking compatibility, normalize the locale using toLanguageTag() to convert deprecated
// locale language codes ("iw") to new ones ("he"). Thus, for backward compatiblity, we thus
// avoid wrapping the origi... | [
"public",
"static",
"SoyMsgBundle",
"preservingLocaleIfAllowed",
"(",
"SoyMsgBundle",
"bundle",
",",
"Locale",
"locale",
")",
"{",
"// When checking compatibility, normalize the locale using toLanguageTag() to convert deprecated",
"// locale language codes (\"iw\") to new ones (\"he\"). Th... | Returns a soy message bundle that exposes `locale` as its locale IF `locale` corresponds to the
same language as `bundle.getLocale()`. Intuitively, the returned bundle retains the passed-in
locale if it's compatible with the passed-in translation bundle.
<p>Examples
<ul>
<li>If our translation bundle includes "es-419... | [
"Returns",
"a",
"soy",
"message",
"bundle",
"that",
"exposes",
"locale",
"as",
"its",
"locale",
"IF",
"locale",
"corresponds",
"to",
"the",
"same",
"language",
"as",
"bundle",
".",
"getLocale",
"()",
".",
"Intuitively",
"the",
"returned",
"bundle",
"retains",
... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/msgs/SoyMsgBundleWithFullLocale.java#L51-L59 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/inverse/InvertMatrix.java | InvertMatrix.pinvert | public static INDArray pinvert(INDArray arr, boolean inPlace) {
"""
Calculates pseudo inverse of a matrix using QR decomposition
@param arr the array to invert
@return the pseudo inverted matrix
"""
// TODO : do it natively instead of relying on commons-maths
RealMatrix realMatrix = CheckUt... | java | public static INDArray pinvert(INDArray arr, boolean inPlace) {
// TODO : do it natively instead of relying on commons-maths
RealMatrix realMatrix = CheckUtil.convertToApacheMatrix(arr);
QRDecomposition decomposition = new QRDecomposition(realMatrix, 0);
DecompositionSolver solver = de... | [
"public",
"static",
"INDArray",
"pinvert",
"(",
"INDArray",
"arr",
",",
"boolean",
"inPlace",
")",
"{",
"// TODO : do it natively instead of relying on commons-maths",
"RealMatrix",
"realMatrix",
"=",
"CheckUtil",
".",
"convertToApacheMatrix",
"(",
"arr",
")",
";",
"QRD... | Calculates pseudo inverse of a matrix using QR decomposition
@param arr the array to invert
@return the pseudo inverted matrix | [
"Calculates",
"pseudo",
"inverse",
"of",
"a",
"matrix",
"using",
"QR",
"decomposition"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/inverse/InvertMatrix.java#L76-L96 |
gallandarakhneorg/afc | maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java | AbstractArakhneMojo.getLString | public static final String getLString(Class<?> source, String label, Object... params) {
"""
Read a resource property and replace the parametrized macros by the given parameters.
@param source
is the source of the properties.
@param label
is the name of the property.
@param params
are the parameters to rep... | java | public static final String getLString(Class<?> source, String label, Object... params) {
final ResourceBundle rb = ResourceBundle.getBundle(source.getCanonicalName());
String text = rb.getString(label);
text = text.replaceAll("[\\n\\r]", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
text = text.replaceAll("\\t", "\t"); //... | [
"public",
"static",
"final",
"String",
"getLString",
"(",
"Class",
"<",
"?",
">",
"source",
",",
"String",
"label",
",",
"Object",
"...",
"params",
")",
"{",
"final",
"ResourceBundle",
"rb",
"=",
"ResourceBundle",
".",
"getBundle",
"(",
"source",
".",
"get... | Read a resource property and replace the parametrized macros by the given parameters.
@param source
is the source of the properties.
@param label
is the name of the property.
@param params
are the parameters to replace.
@return the read text. | [
"Read",
"a",
"resource",
"property",
"and",
"replace",
"the",
"parametrized",
"macros",
"by",
"the",
"given",
"parameters",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java#L382-L389 |
Azure/azure-sdk-for-java | eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/implementation/EventGridClientImpl.java | EventGridClientImpl.publishEventsAsync | public Observable<Void> publishEventsAsync(String topicHostname, List<EventGridEvent> events) {
"""
Publishes a batch of events to an Azure Event Grid topic.
@param topicHostname The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net
@param events An array of events to be published to Event Grid... | java | public Observable<Void> publishEventsAsync(String topicHostname, List<EventGridEvent> events) {
return publishEventsWithServiceResponseAsync(topicHostname, events).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
... | [
"public",
"Observable",
"<",
"Void",
">",
"publishEventsAsync",
"(",
"String",
"topicHostname",
",",
"List",
"<",
"EventGridEvent",
">",
"events",
")",
"{",
"return",
"publishEventsWithServiceResponseAsync",
"(",
"topicHostname",
",",
"events",
")",
".",
"map",
"(... | Publishes a batch of events to an Azure Event Grid topic.
@param topicHostname The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net
@param events An array of events to be published to Event Grid.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceRespon... | [
"Publishes",
"a",
"batch",
"of",
"events",
"to",
"an",
"Azure",
"Event",
"Grid",
"topic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/implementation/EventGridClientImpl.java#L232-L239 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/utils/JSONUtils.java | JSONUtils.getStringFromJSONPath | public static String getStringFromJSONPath(JSONObject record, String path) {
"""
Gets a string attribute from a json object given a path to traverse.
@param record a JSONObject to traverse.
@param path the json path to follow.
@return the attribute as a {@link String}, or null if it was not found.
"""
... | java | public static String getStringFromJSONPath(JSONObject record, String path) {
final Object object = getObjectFromJSONPath(record, path);
return object == null ? null : object.toString();
} | [
"public",
"static",
"String",
"getStringFromJSONPath",
"(",
"JSONObject",
"record",
",",
"String",
"path",
")",
"{",
"final",
"Object",
"object",
"=",
"getObjectFromJSONPath",
"(",
"record",
",",
"path",
")",
";",
"return",
"object",
"==",
"null",
"?",
"null",... | Gets a string attribute from a json object given a path to traverse.
@param record a JSONObject to traverse.
@param path the json path to follow.
@return the attribute as a {@link String}, or null if it was not found. | [
"Gets",
"a",
"string",
"attribute",
"from",
"a",
"json",
"object",
"given",
"a",
"path",
"to",
"traverse",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/utils/JSONUtils.java#L21-L24 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java | LoadJobConfiguration.newBuilder | public static Builder newBuilder(
TableId destinationTable, List<String> sourceUris, FormatOptions format) {
"""
Creates a builder for a BigQuery Load Job configuration given the destination table, format and
source URIs.
"""
return newBuilder(destinationTable, sourceUris).setFormatOptions(format);
... | java | public static Builder newBuilder(
TableId destinationTable, List<String> sourceUris, FormatOptions format) {
return newBuilder(destinationTable, sourceUris).setFormatOptions(format);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableId",
"destinationTable",
",",
"List",
"<",
"String",
">",
"sourceUris",
",",
"FormatOptions",
"format",
")",
"{",
"return",
"newBuilder",
"(",
"destinationTable",
",",
"sourceUris",
")",
".",
"setFormatOption... | Creates a builder for a BigQuery Load Job configuration given the destination table, format and
source URIs. | [
"Creates",
"a",
"builder",
"for",
"a",
"BigQuery",
"Load",
"Job",
"configuration",
"given",
"the",
"destination",
"table",
"format",
"and",
"source",
"URIs",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java#L517-L520 |
nathanmarz/dfs-datastores | dfs-datastores-cascading/src/main/java/com/backtype/support/CascadingUtils.java | CascadingUtils.markSuccessfulOutputDir | public static void markSuccessfulOutputDir(Path path, JobConf conf) throws IOException {
"""
Mark the output dir of the job for which the context is passed.
"""
FileSystem fs = FileSystem.get(conf);
// create a file in the folder to mark it
if (fs.exists(path)) {
Path filePa... | java | public static void markSuccessfulOutputDir(Path path, JobConf conf) throws IOException {
FileSystem fs = FileSystem.get(conf);
// create a file in the folder to mark it
if (fs.exists(path)) {
Path filePath = new Path(path, VersionedStore.HADOOP_SUCCESS_FLAG);
fs.create(fi... | [
"public",
"static",
"void",
"markSuccessfulOutputDir",
"(",
"Path",
"path",
",",
"JobConf",
"conf",
")",
"throws",
"IOException",
"{",
"FileSystem",
"fs",
"=",
"FileSystem",
".",
"get",
"(",
"conf",
")",
";",
"// create a file in the folder to mark it",
"if",
"(",... | Mark the output dir of the job for which the context is passed. | [
"Mark",
"the",
"output",
"dir",
"of",
"the",
"job",
"for",
"which",
"the",
"context",
"is",
"passed",
"."
] | train | https://github.com/nathanmarz/dfs-datastores/blob/ad2ce6d1ef748bab8444e81fa1617ab5e8b1a43e/dfs-datastores-cascading/src/main/java/com/backtype/support/CascadingUtils.java#L27-L34 |
fommil/matrix-toolkits-java | src/main/java/no/uib/cipr/matrix/io/MatrixVectorReader.java | MatrixVectorReader.readArray | public void readArray(double[] dataR, double[] dataI) throws IOException {
"""
Reads the array data. The first array will contain real entries, while
the second contain imaginary entries
"""
int size = dataR.length;
if (size != dataI.length)
throw new IllegalArgumentException(
... | java | public void readArray(double[] dataR, double[] dataI) throws IOException {
int size = dataR.length;
if (size != dataI.length)
throw new IllegalArgumentException(
"All arrays must be of the same size");
for (int i = 0; i < size; ++i) {
dataR[i] = getDou... | [
"public",
"void",
"readArray",
"(",
"double",
"[",
"]",
"dataR",
",",
"double",
"[",
"]",
"dataI",
")",
"throws",
"IOException",
"{",
"int",
"size",
"=",
"dataR",
".",
"length",
";",
"if",
"(",
"size",
"!=",
"dataI",
".",
"length",
")",
"throw",
"new... | Reads the array data. The first array will contain real entries, while
the second contain imaginary entries | [
"Reads",
"the",
"array",
"data",
".",
"The",
"first",
"array",
"will",
"contain",
"real",
"entries",
"while",
"the",
"second",
"contain",
"imaginary",
"entries"
] | train | https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/io/MatrixVectorReader.java#L364-L373 |
bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StashReader.java | StashReader.scan | public StashRowIterator scan(String table)
throws StashNotAvailableException, TableNotStashedException {
"""
Gets an iterator over the entire contents of a Stash table. If possible the caller should call
{@link com.bazaarvoice.emodb.common.stash.StashRowIterator#close()} when done with the iterator
... | java | public StashRowIterator scan(String table)
throws StashNotAvailableException, TableNotStashedException {
List<StashSplit> splits = getSplits(table);
return new StashScanIterator(_s3, _bucket, _rootPath, splits);
} | [
"public",
"StashRowIterator",
"scan",
"(",
"String",
"table",
")",
"throws",
"StashNotAvailableException",
",",
"TableNotStashedException",
"{",
"List",
"<",
"StashSplit",
">",
"splits",
"=",
"getSplits",
"(",
"table",
")",
";",
"return",
"new",
"StashScanIterator",... | Gets an iterator over the entire contents of a Stash table. If possible the caller should call
{@link com.bazaarvoice.emodb.common.stash.StashRowIterator#close()} when done with the iterator
to immediately free any S3 connections. | [
"Gets",
"an",
"iterator",
"over",
"the",
"entire",
"contents",
"of",
"a",
"Stash",
"table",
".",
"If",
"possible",
"the",
"caller",
"should",
"call",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StashReader.java#L335-L339 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.rewriteInternal | private void rewriteInternal(
final BatchHelper batchHelper,
final KeySetView<IOException, Boolean> innerExceptions,
final String srcBucketName, final String srcObjectName,
final String dstBucketName, final String dstObjectName)
throws IOException {
"""
Performs copy operation using G... | java | private void rewriteInternal(
final BatchHelper batchHelper,
final KeySetView<IOException, Boolean> innerExceptions,
final String srcBucketName, final String srcObjectName,
final String dstBucketName, final String dstObjectName)
throws IOException {
Storage.Objects.Rewrite rewriteObjec... | [
"private",
"void",
"rewriteInternal",
"(",
"final",
"BatchHelper",
"batchHelper",
",",
"final",
"KeySetView",
"<",
"IOException",
",",
"Boolean",
">",
"innerExceptions",
",",
"final",
"String",
"srcBucketName",
",",
"final",
"String",
"srcObjectName",
",",
"final",
... | Performs copy operation using GCS Rewrite requests
@see GoogleCloudStorage#copy(String, List, String, List) | [
"Performs",
"copy",
"operation",
"using",
"GCS",
"Rewrite",
"requests"
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L915-L969 |
walkmod/walkmod-core | src/main/java/org/walkmod/util/location/LocationAttributes.java | LocationAttributes.getLocation | public static Location getLocation(Element elem, String description) {
"""
Returns the {@link Location} of an element (DOM flavor).
@param elem
the element that holds the location information
@param description
a description for the location (if <code>null</code>, the
element's name is used)
@return a {@li... | java | public static Location getLocation(Element elem, String description) {
Attr srcAttr = elem.getAttributeNodeNS(URI, SRC_ATTR);
if (srcAttr == null) {
return LocationImpl.UNKNOWN;
}
return new LocationImpl(description == null ? elem.getNodeName() : description, srcAttr.getValue(),
getLine(elem), getC... | [
"public",
"static",
"Location",
"getLocation",
"(",
"Element",
"elem",
",",
"String",
"description",
")",
"{",
"Attr",
"srcAttr",
"=",
"elem",
".",
"getAttributeNodeNS",
"(",
"URI",
",",
"SRC_ATTR",
")",
";",
"if",
"(",
"srcAttr",
"==",
"null",
")",
"{",
... | Returns the {@link Location} of an element (DOM flavor).
@param elem
the element that holds the location information
@param description
a description for the location (if <code>null</code>, the
element's name is used)
@return a {@link Location} object | [
"Returns",
"the",
"{",
"@link",
"Location",
"}",
"of",
"an",
"element",
"(",
"DOM",
"flavor",
")",
"."
] | train | https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/util/location/LocationAttributes.java#L160-L167 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/UserDetailsFormatter.java | UserDetailsFormatter.loadAndFormatUsername | public static String loadAndFormatUsername(final String username, final int expectedNameLength) {
"""
Load user details by the user name and format the user name. If the
loaded {@link UserDetails} is not an instance of a {@link UserPrincipal},
then just the {@link UserDetails#getUsername()} will return.
If fi... | java | public static String loadAndFormatUsername(final String username, final int expectedNameLength) {
final UserDetails userDetails = loadUserByUsername(username);
return formatUserName(expectedNameLength, userDetails);
} | [
"public",
"static",
"String",
"loadAndFormatUsername",
"(",
"final",
"String",
"username",
",",
"final",
"int",
"expectedNameLength",
")",
"{",
"final",
"UserDetails",
"userDetails",
"=",
"loadUserByUsername",
"(",
"username",
")",
";",
"return",
"formatUserName",
"... | Load user details by the user name and format the user name. If the
loaded {@link UserDetails} is not an instance of a {@link UserPrincipal},
then just the {@link UserDetails#getUsername()} will return.
If first and last name available, they will combined. Otherwise the
{@link UserPrincipal#getLoginname()} will format... | [
"Load",
"user",
"details",
"by",
"the",
"user",
"name",
"and",
"format",
"the",
"user",
"name",
".",
"If",
"the",
"loaded",
"{",
"@link",
"UserDetails",
"}",
"is",
"not",
"an",
"instance",
"of",
"a",
"{",
"@link",
"UserPrincipal",
"}",
"then",
"just",
... | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/UserDetailsFormatter.java#L113-L116 |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlStreamRenderer.java | HtmlStreamRenderer.error | private final void error(String message, CharSequence identifier) {
"""
Called when the series of calls make no sense.
May be overridden to throw an unchecked throwable, to log, or to take some
other action.
@param message for human consumption.
@param identifier an HTML identifier associated with the messag... | java | private final void error(String message, CharSequence identifier) {
if (badHtmlHandler != Handler.DO_NOTHING) { // Avoid string append.
badHtmlHandler.handle(message + " : " + identifier);
}
} | [
"private",
"final",
"void",
"error",
"(",
"String",
"message",
",",
"CharSequence",
"identifier",
")",
"{",
"if",
"(",
"badHtmlHandler",
"!=",
"Handler",
".",
"DO_NOTHING",
")",
"{",
"// Avoid string append.",
"badHtmlHandler",
".",
"handle",
"(",
"message",
"+"... | Called when the series of calls make no sense.
May be overridden to throw an unchecked throwable, to log, or to take some
other action.
@param message for human consumption.
@param identifier an HTML identifier associated with the message. | [
"Called",
"when",
"the",
"series",
"of",
"calls",
"make",
"no",
"sense",
".",
"May",
"be",
"overridden",
"to",
"throw",
"an",
"unchecked",
"throwable",
"to",
"log",
"or",
"to",
"take",
"some",
"other",
"action",
"."
] | train | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlStreamRenderer.java#L115-L119 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/AbsModule.java | AbsModule.getVersionOrThrow | Integer getVersionOrThrow(CMAResource resource, String action) {
"""
Extracts the version number for the given {@code resource}.
Throws {@link IllegalArgumentException} if the value is not present.
"""
final Integer version = resource.getVersion();
if (version == null) {
throw new IllegalArgumen... | java | Integer getVersionOrThrow(CMAResource resource, String action) {
final Integer version = resource.getVersion();
if (version == null) {
throw new IllegalArgumentException(String.format(
"Cannot perform %s action on a resource that has no version associated.",
action));
}
return ... | [
"Integer",
"getVersionOrThrow",
"(",
"CMAResource",
"resource",
",",
"String",
"action",
")",
"{",
"final",
"Integer",
"version",
"=",
"resource",
".",
"getVersion",
"(",
")",
";",
"if",
"(",
"version",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumen... | Extracts the version number for the given {@code resource}.
Throws {@link IllegalArgumentException} if the value is not present. | [
"Extracts",
"the",
"version",
"number",
"for",
"the",
"given",
"{"
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/AbsModule.java#L97-L105 |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientVerifyBuilder.java | HttpClientVerifyBuilder.withParameter | public HttpClientVerifyBuilder withParameter(String name, Matcher<String> matcher) {
"""
Adds parameter condition. Parameter value must match.
@param name parameter name
@param matcher parameter value matcher
@return verification builder
"""
ruleBuilder.addParameterCondition(name, matcher);
... | java | public HttpClientVerifyBuilder withParameter(String name, Matcher<String> matcher) {
ruleBuilder.addParameterCondition(name, matcher);
return this;
} | [
"public",
"HttpClientVerifyBuilder",
"withParameter",
"(",
"String",
"name",
",",
"Matcher",
"<",
"String",
">",
"matcher",
")",
"{",
"ruleBuilder",
".",
"addParameterCondition",
"(",
"name",
",",
"matcher",
")",
";",
"return",
"this",
";",
"}"
] | Adds parameter condition. Parameter value must match.
@param name parameter name
@param matcher parameter value matcher
@return verification builder | [
"Adds",
"parameter",
"condition",
".",
"Parameter",
"value",
"must",
"match",
"."
] | train | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientVerifyBuilder.java#L84-L87 |
graknlabs/grakn | server/src/server/kb/concept/TypeImpl.java | TypeImpl.checkNonOverlapOfImplicitRelations | private void checkNonOverlapOfImplicitRelations(Schema.ImplicitType implicitType, AttributeType attributeType) {
"""
Checks if the provided AttributeType is already used in an other implicit relation.
@param implicitType The implicit relation to check against.
@param attributeType The AttributeType which shou... | java | private void checkNonOverlapOfImplicitRelations(Schema.ImplicitType implicitType, AttributeType attributeType) {
if (attributes(implicitType).anyMatch(rt -> rt.equals(attributeType))) {
throw TransactionException.duplicateHas(this, attributeType);
}
} | [
"private",
"void",
"checkNonOverlapOfImplicitRelations",
"(",
"Schema",
".",
"ImplicitType",
"implicitType",
",",
"AttributeType",
"attributeType",
")",
"{",
"if",
"(",
"attributes",
"(",
"implicitType",
")",
".",
"anyMatch",
"(",
"rt",
"->",
"rt",
".",
"equals",
... | Checks if the provided AttributeType is already used in an other implicit relation.
@param implicitType The implicit relation to check against.
@param attributeType The AttributeType which should not be in that implicit relation
@throws TransactionException when the AttributeType is already used in another implicit r... | [
"Checks",
"if",
"the",
"provided",
"AttributeType",
"is",
"already",
"used",
"in",
"an",
"other",
"implicit",
"relation",
"."
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/concept/TypeImpl.java#L453-L457 |
pravega/pravega | client/src/main/java/io/pravega/client/stream/impl/ReaderGroupStateManager.java | ReaderGroupStateManager.handleEndOfSegment | boolean handleEndOfSegment(Segment segmentCompleted) throws ReaderNotInReaderGroupException {
"""
Handles a segment being completed by calling the controller to gather all successors to the
completed segment. To ensure consistent checkpoints, a segment cannot be released while a
checkpoint for the reader is pend... | java | boolean handleEndOfSegment(Segment segmentCompleted) throws ReaderNotInReaderGroupException {
final Map<Segment, List<Long>> segmentToPredecessor;
if (sync.getState().getEndSegments().containsKey(segmentCompleted)) {
segmentToPredecessor = Collections.emptyMap();
} else {
... | [
"boolean",
"handleEndOfSegment",
"(",
"Segment",
"segmentCompleted",
")",
"throws",
"ReaderNotInReaderGroupException",
"{",
"final",
"Map",
"<",
"Segment",
",",
"List",
"<",
"Long",
">",
">",
"segmentToPredecessor",
";",
"if",
"(",
"sync",
".",
"getState",
"(",
... | Handles a segment being completed by calling the controller to gather all successors to the
completed segment. To ensure consistent checkpoints, a segment cannot be released while a
checkpoint for the reader is pending, so it may or may not succeed.
@return true if the completed segment was released successfully. | [
"Handles",
"a",
"segment",
"being",
"completed",
"by",
"calling",
"the",
"controller",
"to",
"gather",
"all",
"successors",
"to",
"the",
"completed",
"segment",
".",
"To",
"ensure",
"consistent",
"checkpoints",
"a",
"segment",
"cannot",
"be",
"released",
"while"... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/ReaderGroupStateManager.java#L156-L185 |
pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java | LogMetadata.asDisabled | LogMetadata asDisabled() {
"""
Returns a LogMetadata class with the exact contents of this instance, but the enabled flag set to false. No changes
are performed on this instance.
@return This instance, if isEnabled() == false, of a new instance of the LogMetadata class which will have
isEnabled() == false, ot... | java | LogMetadata asDisabled() {
return this.enabled ? new LogMetadata(this.epoch, false, this.ledgers, this.truncationAddress, this.updateVersion.get()) : this;
} | [
"LogMetadata",
"asDisabled",
"(",
")",
"{",
"return",
"this",
".",
"enabled",
"?",
"new",
"LogMetadata",
"(",
"this",
".",
"epoch",
",",
"false",
",",
"this",
".",
"ledgers",
",",
"this",
".",
"truncationAddress",
",",
"this",
".",
"updateVersion",
".",
... | Returns a LogMetadata class with the exact contents of this instance, but the enabled flag set to false. No changes
are performed on this instance.
@return This instance, if isEnabled() == false, of a new instance of the LogMetadata class which will have
isEnabled() == false, otherwise. | [
"Returns",
"a",
"LogMetadata",
"class",
"with",
"the",
"exact",
"contents",
"of",
"this",
"instance",
"but",
"the",
"enabled",
"flag",
"set",
"to",
"false",
".",
"No",
"changes",
"are",
"performed",
"on",
"this",
"instance",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java#L254-L256 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java | DatanodeDescriptor.insertIntoList | void insertIntoList(BlockInfo head, int headIndex, BlockInfo tail, int tailIndex, int count) {
"""
Adds blocks already connected into list, to this descriptor's blocks.
The blocks in the input list already have this descriptor inserted to them.
Used for parallel initial block reports.
"""
if (head == nul... | java | void insertIntoList(BlockInfo head, int headIndex, BlockInfo tail, int tailIndex, int count) {
if (head == null)
return;
// connect tail to now-head
tail.setNext(tailIndex, blockList);
if (blockList != null)
blockList.setPrevious(blockList.findDatanode(this), tail);
// create n... | [
"void",
"insertIntoList",
"(",
"BlockInfo",
"head",
",",
"int",
"headIndex",
",",
"BlockInfo",
"tail",
",",
"int",
"tailIndex",
",",
"int",
"count",
")",
"{",
"if",
"(",
"head",
"==",
"null",
")",
"return",
";",
"// connect tail to now-head",
"tail",
".",
... | Adds blocks already connected into list, to this descriptor's blocks.
The blocks in the input list already have this descriptor inserted to them.
Used for parallel initial block reports. | [
"Adds",
"blocks",
"already",
"connected",
"into",
"list",
"to",
"this",
"descriptor",
"s",
"blocks",
".",
"The",
"blocks",
"in",
"the",
"input",
"list",
"already",
"have",
"this",
"descriptor",
"inserted",
"to",
"them",
".",
"Used",
"for",
"parallel",
"initi... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java#L270-L285 |
algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataDirectory.java | DataDirectory.getPage | protected DirectoryListResponse getPage(String marker, Boolean getAcl) throws APIException {
"""
Gets a single page of the directory listing. Subsquent pages are fetched with the returned marker value.
@param marker indicates the specific page to fetch; first page is fetched if null
@return a page of files and d... | java | protected DirectoryListResponse getPage(String marker, Boolean getAcl) throws APIException {
String url = getUrl();
Map<String, String> params = new HashMap<String, String>();
if (marker != null) {
params.put("marker", marker);
}
if (getAcl) {
params.put(... | [
"protected",
"DirectoryListResponse",
"getPage",
"(",
"String",
"marker",
",",
"Boolean",
"getAcl",
")",
"throws",
"APIException",
"{",
"String",
"url",
"=",
"getUrl",
"(",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"HashMap",
... | Gets a single page of the directory listing. Subsquent pages are fetched with the returned marker value.
@param marker indicates the specific page to fetch; first page is fetched if null
@return a page of files and directories that exist within this directory
@throws APIException if there were any problems communicatin... | [
"Gets",
"a",
"single",
"page",
"of",
"the",
"directory",
"listing",
".",
"Subsquent",
"pages",
"are",
"fetched",
"with",
"the",
"returned",
"marker",
"value",
"."
] | train | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataDirectory.java#L201-L213 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/logging/PrettyLogger.java | PrettyLogger.log | private static void log(RedwoodChannels channels, String description, Dictionary dict) {
"""
/*
Dictionaries (notably, Properties) -- convert them to Maps and dispatch
"""
//(a real data structure)
Map<Object, Object> map = new HashMap<Object, Object>();
//(copy to map)
Enumeration keys = ... | java | private static void log(RedwoodChannels channels, String description, Dictionary dict) {
//(a real data structure)
Map<Object, Object> map = new HashMap<Object, Object>();
//(copy to map)
Enumeration keys = dict.keys();
while(keys.hasMoreElements()){
Object key = keys.nextElement();
... | [
"private",
"static",
"void",
"log",
"(",
"RedwoodChannels",
"channels",
",",
"String",
"description",
",",
"Dictionary",
"dict",
")",
"{",
"//(a real data structure)\r",
"Map",
"<",
"Object",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<",
"Object",
","... | /*
Dictionaries (notably, Properties) -- convert them to Maps and dispatch | [
"/",
"*",
"Dictionaries",
"(",
"notably",
"Properties",
")",
"--",
"convert",
"them",
"to",
"Maps",
"and",
"dispatch"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/logging/PrettyLogger.java#L213-L225 |
wisdom-framework/wisdom | framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/impl/WisdomMessageResolver.java | WisdomMessageResolver.resolveMessage | @Override
public MessageResolution resolveMessage(Arguments arguments, String key, Object[] messageParameters) {
"""
<p>
Resolve the message, returning a {@link MessageResolution} object.
</p>
<p>
If the message cannot be resolved, this method should return null.
</p>
@param arguments the {@link Argume... | java | @Override
public MessageResolution resolveMessage(Arguments arguments, String key, Object[] messageParameters) {
Locale[] locales = getLocales();
String message = i18n.get(locales, key, messageParameters);
// Same policy as the Thymeleaf standard message resolver.
if (message == nu... | [
"@",
"Override",
"public",
"MessageResolution",
"resolveMessage",
"(",
"Arguments",
"arguments",
",",
"String",
"key",
",",
"Object",
"[",
"]",
"messageParameters",
")",
"{",
"Locale",
"[",
"]",
"locales",
"=",
"getLocales",
"(",
")",
";",
"String",
"message",... | <p>
Resolve the message, returning a {@link MessageResolution} object.
</p>
<p>
If the message cannot be resolved, this method should return null.
</p>
@param arguments the {@link Arguments} object being used for template processing
@param key the message key
@param messageParameters the (optional) message parameters
... | [
"<p",
">",
"Resolve",
"the",
"message",
"returning",
"a",
"{",
"@link",
"MessageResolution",
"}",
"object",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"the",
"message",
"cannot",
"be",
"resolved",
"this",
"method",
"should",
"return",
"null",
".",
"<",
... | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/impl/WisdomMessageResolver.java#L63-L76 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java | DrizzlePreparedStatement.setCharacterStream | public void setCharacterStream(final int parameterIndex, final Reader reader, final int length) throws SQLException {
"""
Sets the designated parameter to the given <code>Reader</code> object, which is the given number of characters
long. When a very large UNICODE value is input to a <code>LONGVARCHAR</code> para... | java | public void setCharacterStream(final int parameterIndex, final Reader reader, final int length) throws SQLException {
try {
setParameter(parameterIndex, new ReaderParameter(reader, length));
} catch (IOException e) {
throw SQLExceptionMapper.getSQLException("Could not read stream... | [
"public",
"void",
"setCharacterStream",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"Reader",
"reader",
",",
"final",
"int",
"length",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"setParameter",
"(",
"parameterIndex",
",",
"new",
"ReaderParameter",
... | Sets the designated parameter to the given <code>Reader</code> object, which is the given number of characters
long. When a very large UNICODE value is input to a <code>LONGVARCHAR</code> parameter, it may be more practical
to send it via a <code>java.io.Reader</code> object. The data will be read from the stream as ne... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"<code",
">",
"Reader<",
"/",
"code",
">",
"object",
"which",
"is",
"the",
"given",
"number",
"of",
"characters",
"long",
".",
"When",
"a",
"very",
"large",
"UNICODE",
"value",
"is",
"input",
... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L224-L231 |
Netflix/servo | servo-graphite/src/main/java/com/netflix/servo/publish/graphite/GraphiteMetricObserver.java | GraphiteMetricObserver.parseStringAsUri | private static URI parseStringAsUri(String ipString) {
"""
It's a lot easier to configure and manage the location of the graphite server if we combine
the ip and port into a single string. Using a "fake" transport and the ipString means we get
standard host/port parsing (including domain names, ipv4 and ipv6) fo... | java | private static URI parseStringAsUri(String ipString) {
try {
URI uri = new URI("socket://" + ipString);
if (uri.getHost() == null || uri.getPort() == -1) {
throw new URISyntaxException(ipString, "URI must have host and port parts");
}
return uri;
} catch (URISyntaxException e) {
... | [
"private",
"static",
"URI",
"parseStringAsUri",
"(",
"String",
"ipString",
")",
"{",
"try",
"{",
"URI",
"uri",
"=",
"new",
"URI",
"(",
"\"socket://\"",
"+",
"ipString",
")",
";",
"if",
"(",
"uri",
".",
"getHost",
"(",
")",
"==",
"null",
"||",
"uri",
... | It's a lot easier to configure and manage the location of the graphite server if we combine
the ip and port into a single string. Using a "fake" transport and the ipString means we get
standard host/port parsing (including domain names, ipv4 and ipv6) for free. | [
"It",
"s",
"a",
"lot",
"easier",
"to",
"configure",
"and",
"manage",
"the",
"location",
"of",
"the",
"graphite",
"server",
"if",
"we",
"combine",
"the",
"ip",
"and",
"port",
"into",
"a",
"single",
"string",
".",
"Using",
"a",
"fake",
"transport",
"and",
... | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-graphite/src/main/java/com/netflix/servo/publish/graphite/GraphiteMetricObserver.java#L189-L200 |
fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.buildLink | protected static String buildLink(final String linkUri, final String relation) {
"""
Utility function for building a Link.
@param linkUri String of URI for the link.
@param relation the relation string.
@return the string version of the link.
"""
return buildLink(URI.create(linkUri), relation);
... | java | protected static String buildLink(final String linkUri, final String relation) {
return buildLink(URI.create(linkUri), relation);
} | [
"protected",
"static",
"String",
"buildLink",
"(",
"final",
"String",
"linkUri",
",",
"final",
"String",
"relation",
")",
"{",
"return",
"buildLink",
"(",
"URI",
".",
"create",
"(",
"linkUri",
")",
",",
"relation",
")",
";",
"}"
] | Utility function for building a Link.
@param linkUri String of URI for the link.
@param relation the relation string.
@return the string version of the link. | [
"Utility",
"function",
"for",
"building",
"a",
"Link",
"."
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L625-L627 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/validate/ValidationException.java | ValidationException.fromResults | public static ValidationException fromResults(String correlationId, List<ValidationResult> results, boolean strict)
throws ValidationException {
"""
Creates a new ValidationException based on errors in validation results. If
validation results have no errors, than null is returned.
@param correlationId (opt... | java | public static ValidationException fromResults(String correlationId, List<ValidationResult> results, boolean strict)
throws ValidationException {
boolean hasErrors = false;
for (ValidationResult result : results) {
if (result.getType() == ValidationResultType.Error)
hasErrors = true;
if (strict && resul... | [
"public",
"static",
"ValidationException",
"fromResults",
"(",
"String",
"correlationId",
",",
"List",
"<",
"ValidationResult",
">",
"results",
",",
"boolean",
"strict",
")",
"throws",
"ValidationException",
"{",
"boolean",
"hasErrors",
"=",
"false",
";",
"for",
"... | Creates a new ValidationException based on errors in validation results. If
validation results have no errors, than null is returned.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param results list of validation results that may contain errors
@param strict true t... | [
"Creates",
"a",
"new",
"ValidationException",
"based",
"on",
"errors",
"in",
"validation",
"results",
".",
"If",
"validation",
"results",
"have",
"no",
"errors",
"than",
"null",
"is",
"returned",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/validate/ValidationException.java#L88-L99 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/process/CountableSequence.java | CountableSequence.loadAll | protected long loadAll( NodeSequence sequence,
QueueBuffer<BufferedRow> buffer,
AtomicLong batchSize ) {
"""
Load all of the rows from the supplied sequence into the buffer.
@param sequence the node sequence; may not be null
@param buffer the buffer into ... | java | protected long loadAll( NodeSequence sequence,
QueueBuffer<BufferedRow> buffer,
AtomicLong batchSize ) {
return loadAll(sequence, buffer, batchSize, null, 0);
} | [
"protected",
"long",
"loadAll",
"(",
"NodeSequence",
"sequence",
",",
"QueueBuffer",
"<",
"BufferedRow",
">",
"buffer",
",",
"AtomicLong",
"batchSize",
")",
"{",
"return",
"loadAll",
"(",
"sequence",
",",
"buffer",
",",
"batchSize",
",",
"null",
",",
"0",
")... | Load all of the rows from the supplied sequence into the buffer.
@param sequence the node sequence; may not be null
@param buffer the buffer into which all rows should be loaded; may not be null
@param batchSize the atomic that should be set with the size of the first batch
@return the total number of rows | [
"Load",
"all",
"of",
"the",
"rows",
"from",
"the",
"supplied",
"sequence",
"into",
"the",
"buffer",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/process/CountableSequence.java#L122-L126 |
cdk/cdk | tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreUtils.java | PharmacophoreUtils.writePharmacophoreDefinition | public static void writePharmacophoreDefinition(List<PharmacophoreQuery> queries, OutputStream out)
throws IOException {
"""
Write out one or more pharmacophore queries in the CDK XML format.
@param queries The pharmacophore queries
@param out The OutputStream to write to
@throws IOException i... | java | public static void writePharmacophoreDefinition(List<PharmacophoreQuery> queries, OutputStream out)
throws IOException {
writePharmacophoreDefinition(queries.toArray(new PharmacophoreQuery[]{}), out);
} | [
"public",
"static",
"void",
"writePharmacophoreDefinition",
"(",
"List",
"<",
"PharmacophoreQuery",
">",
"queries",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"writePharmacophoreDefinition",
"(",
"queries",
".",
"toArray",
"(",
"new",
"Pharmacophor... | Write out one or more pharmacophore queries in the CDK XML format.
@param queries The pharmacophore queries
@param out The OutputStream to write to
@throws IOException if there is a problem writing the XML document | [
"Write",
"out",
"one",
"or",
"more",
"pharmacophore",
"queries",
"in",
"the",
"CDK",
"XML",
"format",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreUtils.java#L166-L169 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/ProtectableContainersInner.java | ProtectableContainersInner.listAsync | public Observable<Page<ProtectableContainerResourceInner>> listAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String filter) {
"""
Lists the containers registered to Recovery Services Vault.
@param vaultName The name of the recovery services vault.
@param resourceG... | java | public Observable<Page<ProtectableContainerResourceInner>> listAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String filter) {
return listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, filter)
.map(new Func1<ServiceResponse<Page<Prote... | [
"public",
"Observable",
"<",
"Page",
"<",
"ProtectableContainerResourceInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"vaultName",
",",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"fabricName",
",",
"final",
"String",
"filter",
")",
"{"... | Lists the containers registered to Recovery Services Vault.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param fabricName Fabric name associated with the container.
@param filter OData filter options.
@t... | [
"Lists",
"the",
"containers",
"registered",
"to",
"Recovery",
"Services",
"Vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/ProtectableContainersInner.java#L247-L255 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java | AmazonDynamoDBClient.deleteItem | public DeleteItemResult deleteItem(DeleteItemRequest deleteItemRequest)
throws AmazonServiceException, AmazonClientException {
"""
<p>
Deletes a single item in a table by primary key.
</p>
<p>
You can perform a conditional delete operation that deletes the item
if it exists, or if it has an expect... | java | public DeleteItemResult deleteItem(DeleteItemRequest deleteItemRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(deleteItemRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
... | [
"public",
"DeleteItemResult",
"deleteItem",
"(",
"DeleteItemRequest",
"deleteItemRequest",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
"{",
"ExecutionContext",
"executionContext",
"=",
"createExecutionContext",
"(",
"deleteItemRequest",
")",
";",
"A... | <p>
Deletes a single item in a table by primary key.
</p>
<p>
You can perform a conditional delete operation that deletes the item
if it exists, or if it has an expected attribute value.
</p>
@param deleteItemRequest Container for the necessary parameters to
execute the DeleteItem service method on AmazonDynamoDB.
@r... | [
"<p",
">",
"Deletes",
"a",
"single",
"item",
"in",
"a",
"table",
"by",
"primary",
"key",
".",
"<",
"/",
"p",
">",
"<p",
">",
"You",
"can",
"perform",
"a",
"conditional",
"delete",
"operation",
"that",
"deletes",
"the",
"item",
"if",
"it",
"exists",
"... | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java#L809-L821 |
eurekaclinical/protempa | protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/LocalConnectionManager.java | LocalConnectionManager.initProject | @SuppressWarnings("unchecked")
@Override
protected Project initProject() {
"""
Opens the project specified by the file path or URI given in
the constructor.
@return a Protege {@link Project}.
@see ConnectionManager#initProject()
"""
Collection errors = new ArrayList();
String proje... | java | @SuppressWarnings("unchecked")
@Override
protected Project initProject() {
Collection errors = new ArrayList();
String projectFilePathOrURI = getProjectIdentifier();
return new Project(projectFilePathOrURI, errors);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"protected",
"Project",
"initProject",
"(",
")",
"{",
"Collection",
"errors",
"=",
"new",
"ArrayList",
"(",
")",
";",
"String",
"projectFilePathOrURI",
"=",
"getProjectIdentifier",
"(",
")",
";... | Opens the project specified by the file path or URI given in
the constructor.
@return a Protege {@link Project}.
@see ConnectionManager#initProject() | [
"Opens",
"the",
"project",
"specified",
"by",
"the",
"file",
"path",
"or",
"URI",
"given",
"in",
"the",
"constructor",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/LocalConnectionManager.java#L56-L62 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/FaxClientSpiFactory.java | FaxClientSpiFactory.createChildFaxClientSpi | public static FaxClientSpi createChildFaxClientSpi(String type,Properties configuration) {
"""
This function creates a new fax client SPI based on the provided configuration.<br>
This is an internal framework method and should not be invoked by classes outside the
fax4j framework.
@param type
The fax clien... | java | public static FaxClientSpi createChildFaxClientSpi(String type,Properties configuration)
{
//create fax client SPI
FaxClientSpi faxClientSpi=FaxClientSpiFactory.createFaxClientSpiImpl(type,configuration,true);
return faxClientSpi;
} | [
"public",
"static",
"FaxClientSpi",
"createChildFaxClientSpi",
"(",
"String",
"type",
",",
"Properties",
"configuration",
")",
"{",
"//create fax client SPI",
"FaxClientSpi",
"faxClientSpi",
"=",
"FaxClientSpiFactory",
".",
"createFaxClientSpiImpl",
"(",
"type",
",",
"con... | This function creates a new fax client SPI based on the provided configuration.<br>
This is an internal framework method and should not be invoked by classes outside the
fax4j framework.
@param type
The fax client type (may be null for default type)
@param configuration
The fax client configuration (may be null)
@... | [
"This",
"function",
"creates",
"a",
"new",
"fax",
"client",
"SPI",
"based",
"on",
"the",
"provided",
"configuration",
".",
"<br",
">",
"This",
"is",
"an",
"internal",
"framework",
"method",
"and",
"should",
"not",
"be",
"invoked",
"by",
"classes",
"outside",... | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/FaxClientSpiFactory.java#L217-L223 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/mappers/CollectionMapperFactory.java | CollectionMapperFactory.createMapper | private Mapper createMapper(Field field, boolean indexed) {
"""
Creates a new Mapper for the given field.
@param field
the field
@param indexed
whether or not the field is to be indexed
@return the Mapper
"""
lock.lock();
try {
Mapper mapper;
Class<?> fieldType = field.getType();
... | java | private Mapper createMapper(Field field, boolean indexed) {
lock.lock();
try {
Mapper mapper;
Class<?> fieldType = field.getType();
Type genericType = field.getGenericType();
String cacheKey = computeCacheKey(genericType, indexed);
mapper = cache.get(cacheKey);
if (mapper != ... | [
"private",
"Mapper",
"createMapper",
"(",
"Field",
"field",
",",
"boolean",
"indexed",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"Mapper",
"mapper",
";",
"Class",
"<",
"?",
">",
"fieldType",
"=",
"field",
".",
"getType",
"(",
")",
";"... | Creates a new Mapper for the given field.
@param field
the field
@param indexed
whether or not the field is to be indexed
@return the Mapper | [
"Creates",
"a",
"new",
"Mapper",
"for",
"the",
"given",
"field",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/mappers/CollectionMapperFactory.java#L104-L129 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.vps_2014v1_cloud_model_modelName_GET | public OvhPrice vps_2014v1_cloud_model_modelName_GET(net.minidev.ovh.api.price.vps._2014v1.cloud.OvhModelEnum modelName) throws IOException {
"""
Get price of VPS Cloud 2014
REST: GET /price/vps/2014v1/cloud/model/{modelName}
@param modelName [required] Model
"""
String qPath = "/price/vps/2014v1/cloud/m... | java | public OvhPrice vps_2014v1_cloud_model_modelName_GET(net.minidev.ovh.api.price.vps._2014v1.cloud.OvhModelEnum modelName) throws IOException {
String qPath = "/price/vps/2014v1/cloud/model/{modelName}";
StringBuilder sb = path(qPath, modelName);
String resp = exec(qPath, "GET", sb.toString(), null);
return conve... | [
"public",
"OvhPrice",
"vps_2014v1_cloud_model_modelName_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"vps",
".",
"_2014v1",
".",
"cloud",
".",
"OvhModelEnum",
"modelName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=... | Get price of VPS Cloud 2014
REST: GET /price/vps/2014v1/cloud/model/{modelName}
@param modelName [required] Model | [
"Get",
"price",
"of",
"VPS",
"Cloud",
"2014"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L6745-L6750 |
aws/aws-sdk-java | jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathEvaluationVisitor.java | JmesPathEvaluationVisitor.visit | @Override
public JsonNode visit(Comparator op, JsonNode input) {
"""
Evaluate the expressions as per the given comparison
operator.
@param op JmesPath comparison operator type
@param input Input json node against which evaluation is done
@return Result of the comparison
"""
JsonNode lhsNod... | java | @Override
public JsonNode visit(Comparator op, JsonNode input) {
JsonNode lhsNode = op.getLhsExpr().accept(this, input);
JsonNode rhsNode = op.getRhsExpr().accept(this, input);
if (op.matches(lhsNode, rhsNode)) {
return BooleanNode.TRUE;
}
return BooleanNode.FALS... | [
"@",
"Override",
"public",
"JsonNode",
"visit",
"(",
"Comparator",
"op",
",",
"JsonNode",
"input",
")",
"{",
"JsonNode",
"lhsNode",
"=",
"op",
".",
"getLhsExpr",
"(",
")",
".",
"accept",
"(",
"this",
",",
"input",
")",
";",
"JsonNode",
"rhsNode",
"=",
... | Evaluate the expressions as per the given comparison
operator.
@param op JmesPath comparison operator type
@param input Input json node against which evaluation is done
@return Result of the comparison | [
"Evaluate",
"the",
"expressions",
"as",
"per",
"the",
"given",
"comparison",
"operator",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathEvaluationVisitor.java#L257-L266 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/UserZoneEventHandler.java | UserZoneEventHandler.notifyHandlers | private void notifyHandlers(ApiZone apiZone, User sfsUser) {
"""
Propagate event to handlers
@param apiZone
api zone reference
@param sfsUser
smartfox user object
"""
ApiUser apiUser = fetchUserAgent(sfsUser);
for (ZoneHandlerClass handler : handlers) {
Object userAgent = chec... | java | private void notifyHandlers(ApiZone apiZone, User sfsUser) {
ApiUser apiUser = fetchUserAgent(sfsUser);
for (ZoneHandlerClass handler : handlers) {
Object userAgent = checkUserAgent(handler, apiUser);
if (!checkHandler(handler, apiZone))
continue;
noti... | [
"private",
"void",
"notifyHandlers",
"(",
"ApiZone",
"apiZone",
",",
"User",
"sfsUser",
")",
"{",
"ApiUser",
"apiUser",
"=",
"fetchUserAgent",
"(",
"sfsUser",
")",
";",
"for",
"(",
"ZoneHandlerClass",
"handler",
":",
"handlers",
")",
"{",
"Object",
"userAgent"... | Propagate event to handlers
@param apiZone
api zone reference
@param sfsUser
smartfox user object | [
"Propagate",
"event",
"to",
"handlers"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/UserZoneEventHandler.java#L75-L83 |
NessComputing/components-ness-pg | src/main/java/com/nesscomputing/db/postgres/embedded/EmbeddedPostgreSQLController.java | EmbeddedPostgreSQLController.getCluster | private synchronized static Cluster getCluster(URI baseUrl, String[] personalities) throws IOException {
"""
Each schema set has its own database cluster. The template1 database has the schema preloaded so that
each test case need only create a new database and not re-invoke Migratory.
"""
final Entr... | java | private synchronized static Cluster getCluster(URI baseUrl, String[] personalities) throws IOException
{
final Entry<URI, Set<String>> key = Maps.immutableEntry(baseUrl, (Set<String>)ImmutableSet.copyOf(personalities));
Cluster result = CLUSTERS.get(key);
if (result != null) {
r... | [
"private",
"synchronized",
"static",
"Cluster",
"getCluster",
"(",
"URI",
"baseUrl",
",",
"String",
"[",
"]",
"personalities",
")",
"throws",
"IOException",
"{",
"final",
"Entry",
"<",
"URI",
",",
"Set",
"<",
"String",
">",
">",
"key",
"=",
"Maps",
".",
... | Each schema set has its own database cluster. The template1 database has the schema preloaded so that
each test case need only create a new database and not re-invoke Migratory. | [
"Each",
"schema",
"set",
"has",
"its",
"own",
"database",
"cluster",
".",
"The",
"template1",
"database",
"has",
"the",
"schema",
"preloaded",
"so",
"that",
"each",
"test",
"case",
"need",
"only",
"create",
"a",
"new",
"database",
"and",
"not",
"re",
"-",
... | train | https://github.com/NessComputing/components-ness-pg/blob/e983d6075645ea1bf51cc5fc16901e5aab0f5c70/src/main/java/com/nesscomputing/db/postgres/embedded/EmbeddedPostgreSQLController.java#L77-L105 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/MatrixFeatures_DSCC.java | MatrixFeatures_DSCC.isSymmetric | public static boolean isSymmetric( DMatrixSparseCSC A , double tol ) {
"""
Checks to see if the matrix is symmetric to within tolerance.
@param A Matrix being tested. Not modified.
@param tol Tolerance that defines how similar two values must be to be considered identical
@return true if symmetric or false i... | java | public static boolean isSymmetric( DMatrixSparseCSC A , double tol ) {
if( A.numRows != A.numCols )
return false;
int N = A.numCols;
for (int i = 0; i < N; i++) {
int idx0 = A.col_idx[i];
int idx1 = A.col_idx[i+1];
for (int index = idx0; index <... | [
"public",
"static",
"boolean",
"isSymmetric",
"(",
"DMatrixSparseCSC",
"A",
",",
"double",
"tol",
")",
"{",
"if",
"(",
"A",
".",
"numRows",
"!=",
"A",
".",
"numCols",
")",
"return",
"false",
";",
"int",
"N",
"=",
"A",
".",
"numCols",
";",
"for",
"(",... | Checks to see if the matrix is symmetric to within tolerance.
@param A Matrix being tested. Not modified.
@param tol Tolerance that defines how similar two values must be to be considered identical
@return true if symmetric or false if not | [
"Checks",
"to",
"see",
"if",
"the",
"matrix",
"is",
"symmetric",
"to",
"within",
"tolerance",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/MatrixFeatures_DSCC.java#L230-L251 |
icon-Systemhaus-GmbH/javassist-maven-plugin | src/main/java/de/icongmbh/oss/maven/plugin/javassist/ClassnameExtractor.java | ClassnameExtractor.iterateClassnames | public static Iterator<String> iterateClassnames(final File parentDirectory,
final File ... classFiles) {
"""
Iterate over the class files and remove the parent directory from file name and replace
directory separator with dots.
@param parentDirectory to remov... | java | public static Iterator<String> iterateClassnames(final File parentDirectory,
final File ... classFiles) {
return iterateClassnames(parentDirectory, Arrays.asList(classFiles).iterator());
} | [
"public",
"static",
"Iterator",
"<",
"String",
">",
"iterateClassnames",
"(",
"final",
"File",
"parentDirectory",
",",
"final",
"File",
"...",
"classFiles",
")",
"{",
"return",
"iterateClassnames",
"(",
"parentDirectory",
",",
"Arrays",
".",
"asList",
"(",
"clas... | Iterate over the class files and remove the parent directory from file name and replace
directory separator with dots.
@param parentDirectory to remove from {@code classFile} and maybe {@code null}.
@param classFiles array to extract the names from. Must not be {@code null}.
@return iterator of full qualified class na... | [
"Iterate",
"over",
"the",
"class",
"files",
"and",
"remove",
"the",
"parent",
"directory",
"from",
"file",
"name",
"and",
"replace",
"directory",
"separator",
"with",
"dots",
"."
] | train | https://github.com/icon-Systemhaus-GmbH/javassist-maven-plugin/blob/798368f79a0bd641648bebd8546388daf013a50e/src/main/java/de/icongmbh/oss/maven/plugin/javassist/ClassnameExtractor.java#L75-L78 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_phone_phonebook_bookKey_DELETE | public void billingAccount_line_serviceName_phone_phonebook_bookKey_DELETE(String billingAccount, String serviceName, String bookKey) throws IOException {
"""
Delete a phonebook
REST: DELETE /telephony/{billingAccount}/line/{serviceName}/phone/phonebook/{bookKey}
@param billingAccount [required] The name of yo... | java | public void billingAccount_line_serviceName_phone_phonebook_bookKey_DELETE(String billingAccount, String serviceName, String bookKey) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/phone/phonebook/{bookKey}";
StringBuilder sb = path(qPath, billingAccount, serviceName, bookKey);
... | [
"public",
"void",
"billingAccount_line_serviceName_phone_phonebook_bookKey_DELETE",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"bookKey",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/line/{serviceNa... | Delete a phonebook
REST: DELETE /telephony/{billingAccount}/line/{serviceName}/phone/phonebook/{bookKey}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param bookKey [required] Identifier of the phonebook | [
"Delete",
"a",
"phonebook"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1273-L1277 |
DDTH/ddth-dlock | ddth-dlock-core/src/main/java/com/github/ddth/dlock/impl/AbstractDLock.java | AbstractDLock.updateLockHolder | protected void updateLockHolder(String clientId, long lockDurationMs) {
"""
Update current lock's holder info.
@param clientId
@param lockDurationMs
@since 0.1.1
"""
this.clientId = clientId;
this.timestampExpiry = System.currentTimeMillis() + lockDurationMs;
} | java | protected void updateLockHolder(String clientId, long lockDurationMs) {
this.clientId = clientId;
this.timestampExpiry = System.currentTimeMillis() + lockDurationMs;
} | [
"protected",
"void",
"updateLockHolder",
"(",
"String",
"clientId",
",",
"long",
"lockDurationMs",
")",
"{",
"this",
".",
"clientId",
"=",
"clientId",
";",
"this",
".",
"timestampExpiry",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"lockDurationMs",
... | Update current lock's holder info.
@param clientId
@param lockDurationMs
@since 0.1.1 | [
"Update",
"current",
"lock",
"s",
"holder",
"info",
"."
] | train | https://github.com/DDTH/ddth-dlock/blob/56786c61a04fe505556a834133b3de36562c6cb6/ddth-dlock-core/src/main/java/com/github/ddth/dlock/impl/AbstractDLock.java#L47-L50 |
ops4j/org.ops4j.base | ops4j-base-lang/src/main/java/org/ops4j/lang/PreConditionException.java | PreConditionException.validateGreaterThan | public static void validateGreaterThan( Number value, Number limit, String identifier )
throws PreConditionException {
"""
Validates that the value is greater than a limit.
<p/>
This method ensures that <code>value > limit</code>.
@param identifier The name of the object.
@param limit The limit ... | java | public static void validateGreaterThan( Number value, Number limit, String identifier )
throws PreConditionException
{
if( value.doubleValue() > limit.doubleValue() )
{
return;
}
throw new PreConditionException( identifier + " was not greater than " + limit + ". W... | [
"public",
"static",
"void",
"validateGreaterThan",
"(",
"Number",
"value",
",",
"Number",
"limit",
",",
"String",
"identifier",
")",
"throws",
"PreConditionException",
"{",
"if",
"(",
"value",
".",
"doubleValue",
"(",
")",
">",
"limit",
".",
"doubleValue",
"("... | Validates that the value is greater than a limit.
<p/>
This method ensures that <code>value > limit</code>.
@param identifier The name of the object.
@param limit The limit that the value must exceed.
@param value The value to be tested.
@throws PreConditionException if the condition is not met. | [
"Validates",
"that",
"the",
"value",
"is",
"greater",
"than",
"a",
"limit",
".",
"<p",
"/",
">",
"This",
"method",
"ensures",
"that",
"<code",
">",
"value",
">",
"limit<",
"/",
"code",
">",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/PreConditionException.java#L127-L135 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.newReader | public static BufferedReader newReader(File file, String charset)
throws FileNotFoundException, UnsupportedEncodingException {
"""
Create a buffered reader for this file, using the specified
charset as the encoding.
@param file a File
@param charset the charset for this File
@return a Buffered... | java | public static BufferedReader newReader(File file, String charset)
throws FileNotFoundException, UnsupportedEncodingException {
return new BufferedReader(new InputStreamReader(new FileInputStream(file), charset));
} | [
"public",
"static",
"BufferedReader",
"newReader",
"(",
"File",
"file",
",",
"String",
"charset",
")",
"throws",
"FileNotFoundException",
",",
"UnsupportedEncodingException",
"{",
"return",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"new",
"FileInp... | Create a buffered reader for this file, using the specified
charset as the encoding.
@param file a File
@param charset the charset for this File
@return a BufferedReader
@throws FileNotFoundException if the File was not found
@throws UnsupportedEncodingException if the encoding specified is not supported
@si... | [
"Create",
"a",
"buffered",
"reader",
"for",
"this",
"file",
"using",
"the",
"specified",
"charset",
"as",
"the",
"encoding",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1756-L1759 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/JobRegistry.java | JobRegistry.analyzeResourceClass | public void analyzeResourceClass(final String className, final ClassResult classResult) {
"""
Adds the (sub-)resource class name to the analysis list with the associated class result.
"""
// TODO check if class has already been analyzed
unhandledClasses.add(Pair.of(className, classResult));
... | java | public void analyzeResourceClass(final String className, final ClassResult classResult) {
// TODO check if class has already been analyzed
unhandledClasses.add(Pair.of(className, classResult));
} | [
"public",
"void",
"analyzeResourceClass",
"(",
"final",
"String",
"className",
",",
"final",
"ClassResult",
"classResult",
")",
"{",
"// TODO check if class has already been analyzed",
"unhandledClasses",
".",
"add",
"(",
"Pair",
".",
"of",
"(",
"className",
",",
"cla... | Adds the (sub-)resource class name to the analysis list with the associated class result. | [
"Adds",
"the",
"(",
"sub",
"-",
")",
"resource",
"class",
"name",
"to",
"the",
"analysis",
"list",
"with",
"the",
"associated",
"class",
"result",
"."
] | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/JobRegistry.java#L26-L29 |
netty/netty | codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrepender.java | ProtobufVarint32LengthFieldPrepender.writeRawVarint32 | static void writeRawVarint32(ByteBuf out, int value) {
"""
Writes protobuf varint32 to (@link ByteBuf).
@param out to be written to
@param value to be written
"""
while (true) {
if ((value & ~0x7F) == 0) {
out.writeByte(value);
return;
} else {
... | java | static void writeRawVarint32(ByteBuf out, int value) {
while (true) {
if ((value & ~0x7F) == 0) {
out.writeByte(value);
return;
} else {
out.writeByte((value & 0x7F) | 0x80);
value >>>= 7;
}
}
} | [
"static",
"void",
"writeRawVarint32",
"(",
"ByteBuf",
"out",
",",
"int",
"value",
")",
"{",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"(",
"value",
"&",
"~",
"0x7F",
")",
"==",
"0",
")",
"{",
"out",
".",
"writeByte",
"(",
"value",
")",
";",
"ret... | Writes protobuf varint32 to (@link ByteBuf).
@param out to be written to
@param value to be written | [
"Writes",
"protobuf",
"varint32",
"to",
"("
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrepender.java#L58-L68 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/script/Script.java | Script.getPubKeyHash | public byte[] getPubKeyHash() throws ScriptException {
"""
<p>If the program somehow pays to a hash, returns the hash.</p>
<p>Otherwise this method throws a ScriptException.</p>
"""
if (ScriptPattern.isP2PKH(this))
return ScriptPattern.extractHashFromP2PKH(this);
else if (ScriptP... | java | public byte[] getPubKeyHash() throws ScriptException {
if (ScriptPattern.isP2PKH(this))
return ScriptPattern.extractHashFromP2PKH(this);
else if (ScriptPattern.isP2SH(this))
return ScriptPattern.extractHashFromP2SH(this);
else if (ScriptPattern.isP2WH(this))
r... | [
"public",
"byte",
"[",
"]",
"getPubKeyHash",
"(",
")",
"throws",
"ScriptException",
"{",
"if",
"(",
"ScriptPattern",
".",
"isP2PKH",
"(",
"this",
")",
")",
"return",
"ScriptPattern",
".",
"extractHashFromP2PKH",
"(",
"this",
")",
";",
"else",
"if",
"(",
"S... | <p>If the program somehow pays to a hash, returns the hash.</p>
<p>Otherwise this method throws a ScriptException.</p> | [
"<p",
">",
"If",
"the",
"program",
"somehow",
"pays",
"to",
"a",
"hash",
"returns",
"the",
"hash",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/Script.java#L255-L264 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/classify/LogConditionalObjectiveFunction.java | LogConditionalObjectiveFunction.calculateStochastic | @Override
public void calculateStochastic(double[] x, double[] v, int[] batch) {
"""
/*
This function is used to comme up with an estimate of the value / gradient based on only a small
portion of the data (refered to as the batchSize for lack of a better term. In this case batch does
not mean All!! It shou... | java | @Override
public void calculateStochastic(double[] x, double[] v, int[] batch){
if(method.calculatesHessianVectorProduct() && v != null){
// This is used for Stochastic Methods that involve second order information (SMD for example)
if(method.equals(StochasticCalculateMethods.AlgorithmicDiffere... | [
"@",
"Override",
"public",
"void",
"calculateStochastic",
"(",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"v",
",",
"int",
"[",
"]",
"batch",
")",
"{",
"if",
"(",
"method",
".",
"calculatesHessianVectorProduct",
"(",
")",
"&&",
"v",
"!=",
"null"... | /*
This function is used to comme up with an estimate of the value / gradient based on only a small
portion of the data (refered to as the batchSize for lack of a better term. In this case batch does
not mean All!! It should be thought of in the sense of "a small batch of the data". | [
"/",
"*",
"This",
"function",
"is",
"used",
"to",
"comme",
"up",
"with",
"an",
"estimate",
"of",
"the",
"value",
"/",
"gradient",
"based",
"on",
"only",
"a",
"small",
"portion",
"of",
"the",
"data",
"(",
"refered",
"to",
"as",
"the",
"batchSize",
"for"... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/LogConditionalObjectiveFunction.java#L115-L130 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java | SphereUtil.sphericalVincentyFormulaRad | @Reference(authors = "T. Vincenty", //
title = "Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations", //
booktitle = "Survey Review 23:176", //
url = "https://doi.org/10.1179/sre.1975.23.176.88", //
bibkey = "doi:10.1179/sre.1975.23.176.88")
public s... | java | @Reference(authors = "T. Vincenty", //
title = "Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations", //
booktitle = "Survey Review 23:176", //
url = "https://doi.org/10.1179/sre.1975.23.176.88", //
bibkey = "doi:10.1179/sre.1975.23.176.88")
public s... | [
"@",
"Reference",
"(",
"authors",
"=",
"\"T. Vincenty\"",
",",
"//",
"title",
"=",
"\"Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations\"",
",",
"//",
"booktitle",
"=",
"\"Survey Review 23:176\"",
",",
"//",
"url",
"=",
"\"https:/... | Compute the approximate great-circle distance of two points.
Uses Vincenty's Formula for the spherical case, which does not require
iterations.
<p>
Complexity: 7 trigonometric functions, 1 sqrt.
<p>
Reference:
<p>
T. Vincenty<br>
Direct and inverse solutions of geodesics on the ellipsoid with application
of nested equ... | [
"Compute",
"the",
"approximate",
"great",
"-",
"circle",
"distance",
"of",
"two",
"points",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java#L279-L296 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryFormat.java | BinaryFormat.readBinaryStringFieldFromSegments | static BinaryString readBinaryStringFieldFromSegments(
MemorySegment[] segments, int baseOffset, int fieldOffset,
long variablePartOffsetAndLen) {
"""
Get binary string, if len less than 8, will be include in variablePartOffsetAndLen.
<p>Note: Need to consider the ByteOrder.
@param baseOffset base offs... | java | static BinaryString readBinaryStringFieldFromSegments(
MemorySegment[] segments, int baseOffset, int fieldOffset,
long variablePartOffsetAndLen) {
long mark = variablePartOffsetAndLen & HIGHEST_FIRST_BIT;
if (mark == 0) {
final int subOffset = (int) (variablePartOffsetAndLen >> 32);
final int len = (int... | [
"static",
"BinaryString",
"readBinaryStringFieldFromSegments",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"baseOffset",
",",
"int",
"fieldOffset",
",",
"long",
"variablePartOffsetAndLen",
")",
"{",
"long",
"mark",
"=",
"variablePartOffsetAndLen",
"&",
"HI... | Get binary string, if len less than 8, will be include in variablePartOffsetAndLen.
<p>Note: Need to consider the ByteOrder.
@param baseOffset base offset of composite binary format.
@param fieldOffset absolute start offset of 'variablePartOffsetAndLen'.
@param variablePartOffsetAndLen a long value, real data or offs... | [
"Get",
"binary",
"string",
"if",
"len",
"less",
"than",
"8",
"will",
"be",
"include",
"in",
"variablePartOffsetAndLen",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryFormat.java#L147-L164 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLUtils.java | SSLUtils.flipBuffers | public static void flipBuffers(WsByteBuffer[] buffers, int totalSize) {
"""
Flip the input list of buffers, walking through the list until the flipped
amount equals the input total size, mark the rest of the buffers as empty.
@param buffers
@param totalSize
"""
int size = 0;
boolean overLi... | java | public static void flipBuffers(WsByteBuffer[] buffers, int totalSize) {
int size = 0;
boolean overLimit = false;
for (int i = 0; i < buffers.length && null != buffers[i]; i++) {
if (overLimit) {
buffers[i].limit(buffers[i].position());
} else {
... | [
"public",
"static",
"void",
"flipBuffers",
"(",
"WsByteBuffer",
"[",
"]",
"buffers",
",",
"int",
"totalSize",
")",
"{",
"int",
"size",
"=",
"0",
";",
"boolean",
"overLimit",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"buffers... | Flip the input list of buffers, walking through the list until the flipped
amount equals the input total size, mark the rest of the buffers as empty.
@param buffers
@param totalSize | [
"Flip",
"the",
"input",
"list",
"of",
"buffers",
"walking",
"through",
"the",
"list",
"until",
"the",
"flipped",
"amount",
"equals",
"the",
"input",
"total",
"size",
"mark",
"the",
"rest",
"of",
"the",
"buffers",
"as",
"empty",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLUtils.java#L355-L367 |
gallandarakhneorg/afc | advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomablePane.java | ZoomablePane.moveUp | public void moveUp(boolean isUnit, boolean isLarge, boolean isVeryLarge) {
"""
Move the viewport up.
@param isUnit indicates if the move is a unit move. If {@code true}, this argument has precedence to the other arguments.
@param isLarge indicates if the move is a large move. If {@code true}, this argument has... | java | public void moveUp(boolean isUnit, boolean isLarge, boolean isVeryLarge) {
double inc = isUnit ? this.vbar.getUnitIncrement()
: (isLarge ? LARGE_MOVE_FACTOR
: (isVeryLarge ? VERY_LARGE_MOVE_FACTOR : STANDARD_MOVE_FACTOR)) * this.vbar.getBlockIncrement();
if (!isInvertedAxisY()) {
inc = -inc;
}
this... | [
"public",
"void",
"moveUp",
"(",
"boolean",
"isUnit",
",",
"boolean",
"isLarge",
",",
"boolean",
"isVeryLarge",
")",
"{",
"double",
"inc",
"=",
"isUnit",
"?",
"this",
".",
"vbar",
".",
"getUnitIncrement",
"(",
")",
":",
"(",
"isLarge",
"?",
"LARGE_MOVE_FAC... | Move the viewport up.
@param isUnit indicates if the move is a unit move. If {@code true}, this argument has precedence to the other arguments.
@param isLarge indicates if the move is a large move. If {@code true}, this argument has precedence
to the very large argument.
@param isVeryLarge indicates if the move is a v... | [
"Move",
"the",
"viewport",
"up",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomablePane.java#L565-L573 |
jnr/jnr-x86asm | src/main/java/jnr/x86asm/SerializerIntrinsics.java | SerializerIntrinsics.pcmpestrm | public final void pcmpestrm(XMMRegister dst, XMMRegister src, Immediate imm8) {
"""
Packed Compare Explicit Length Strings, Return Mask (SSE4.2).
"""
emitX86(INST_PCMPESTRM, dst, src, imm8);
} | java | public final void pcmpestrm(XMMRegister dst, XMMRegister src, Immediate imm8)
{
emitX86(INST_PCMPESTRM, dst, src, imm8);
} | [
"public",
"final",
"void",
"pcmpestrm",
"(",
"XMMRegister",
"dst",
",",
"XMMRegister",
"src",
",",
"Immediate",
"imm8",
")",
"{",
"emitX86",
"(",
"INST_PCMPESTRM",
",",
"dst",
",",
"src",
",",
"imm8",
")",
";",
"}"
] | Packed Compare Explicit Length Strings, Return Mask (SSE4.2). | [
"Packed",
"Compare",
"Explicit",
"Length",
"Strings",
"Return",
"Mask",
"(",
"SSE4",
".",
"2",
")",
"."
] | train | https://github.com/jnr/jnr-x86asm/blob/fdcf68fb3dae49e607a49e33399e3dad1ada5536/src/main/java/jnr/x86asm/SerializerIntrinsics.java#L6540-L6543 |
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.deleteHierarchicalEntity | public OperationStatus deleteHierarchicalEntity(UUID appId, String versionId, UUID hEntityId) {
"""
Deletes a hierarchical entity extractor from the application version.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@throws IllegalArg... | java | public OperationStatus deleteHierarchicalEntity(UUID appId, String versionId, UUID hEntityId) {
return deleteHierarchicalEntityWithServiceResponseAsync(appId, versionId, hEntityId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deleteHierarchicalEntity",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"hEntityId",
")",
"{",
"return",
"deleteHierarchicalEntityWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"hEntityId",
")",
".",
"to... | Deletes a hierarchical entity extractor from the application version.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request i... | [
"Deletes",
"a",
"hierarchical",
"entity",
"extractor",
"from",
"the",
"application",
"version",
"."
] | 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#L3846-L3848 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.eachLine | public static <T> T eachLine(File self, @ClosureParams(value = FromString.class, options = {
"""
Iterates through this file line by line. Each line is passed to the
given 1 or 2 arg closure. The file is read using a reader which
is closed before this method returns.
@param self a File
@param closure a c... | java | public static <T> T eachLine(File self, @ClosureParams(value = FromString.class, options = {"String", "String,Integer"}) Closure<T> closure) throws IOException {
return eachLine(self, 1, closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"eachLine",
"(",
"File",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"{",
"\"String\"",
",",
"\"String,Integer\"",
"}",
")",
"Closure",
"<",
"T",
">",
"c... | Iterates through this file line by line. Each line is passed to the
given 1 or 2 arg closure. The file is read using a reader which
is closed before this method returns.
@param self a File
@param closure a closure (arg 1 is line, optional arg 2 is line number starting at line 1)
@return the last value returned by... | [
"Iterates",
"through",
"this",
"file",
"line",
"by",
"line",
".",
"Each",
"line",
"is",
"passed",
"to",
"the",
"given",
"1",
"or",
"2",
"arg",
"closure",
".",
"The",
"file",
"is",
"read",
"using",
"a",
"reader",
"which",
"is",
"closed",
"before",
"this... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L235-L237 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java | TmdbKeywords.getKeywordMovies | public ResultList<MovieBasic> getKeywordMovies(String keywordId, String language, Integer page) throws MovieDbException {
"""
Get the list of movies for a particular keyword by id.
@param keywordId
@param language
@param page
@return List of movies with the keyword
@throws MovieDbException
"""
T... | java | public ResultList<MovieBasic> getKeywordMovies(String keywordId, String language, Integer page) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, keywordId);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.PAGE, page);
... | [
"public",
"ResultList",
"<",
"MovieBasic",
">",
"getKeywordMovies",
"(",
"String",
"keywordId",
",",
"String",
"language",
",",
"Integer",
"page",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
... | Get the list of movies for a particular keyword by id.
@param keywordId
@param language
@param page
@return List of movies with the keyword
@throws MovieDbException | [
"Get",
"the",
"list",
"of",
"movies",
"for",
"a",
"particular",
"keyword",
"by",
"id",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java#L85-L94 |
rzwitserloot/lombok | src/eclipseAgent/lombok/eclipse/agent/PatchVal.java | PatchVal.skipResolveInitializerIfAlreadyCalled | public static TypeBinding skipResolveInitializerIfAlreadyCalled(Expression expr, BlockScope scope) {
"""
and patches .resolve() on LocalDeclaration itself to just-in-time replace the 'val' vartype with the right one.
"""
if (expr.resolvedType != null) return expr.resolvedType;
try {
return expr.resolveT... | java | public static TypeBinding skipResolveInitializerIfAlreadyCalled(Expression expr, BlockScope scope) {
if (expr.resolvedType != null) return expr.resolvedType;
try {
return expr.resolveType(scope);
} catch (NullPointerException e) {
return null;
} catch (ArrayIndexOutOfBoundsException e) {
// This will o... | [
"public",
"static",
"TypeBinding",
"skipResolveInitializerIfAlreadyCalled",
"(",
"Expression",
"expr",
",",
"BlockScope",
"scope",
")",
"{",
"if",
"(",
"expr",
".",
"resolvedType",
"!=",
"null",
")",
"return",
"expr",
".",
"resolvedType",
";",
"try",
"{",
"retur... | and patches .resolve() on LocalDeclaration itself to just-in-time replace the 'val' vartype with the right one. | [
"and",
"patches",
".",
"resolve",
"()",
"on",
"LocalDeclaration",
"itself",
"to",
"just",
"-",
"in",
"-",
"time",
"replace",
"the",
"val",
"vartype",
"with",
"the",
"right",
"one",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java#L61-L71 |
ben-manes/caffeine | caffeine/src/main/java/com/github/benmanes/caffeine/base/UnsafeAccess.java | UnsafeAccess.objectFieldOffset | public static long objectFieldOffset(Class<?> clazz, String fieldName) {
"""
Returns the location of a given static field.
@param clazz the class containing the field
@param fieldName the name of the field
@return the address offset of the field
"""
try {
return UNSAFE.objectFieldOffset(clazz.ge... | java | public static long objectFieldOffset(Class<?> clazz, String fieldName) {
try {
return UNSAFE.objectFieldOffset(clazz.getDeclaredField(fieldName));
} catch (NoSuchFieldException | SecurityException e) {
throw new Error(e);
}
} | [
"public",
"static",
"long",
"objectFieldOffset",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"UNSAFE",
".",
"objectFieldOffset",
"(",
"clazz",
".",
"getDeclaredField",
"(",
"fieldName",
")",
")",
";",
"... | Returns the location of a given static field.
@param clazz the class containing the field
@param fieldName the name of the field
@return the address offset of the field | [
"Returns",
"the",
"location",
"of",
"a",
"given",
"static",
"field",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/caffeine/src/main/java/com/github/benmanes/caffeine/base/UnsafeAccess.java#L55-L61 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/ServerSecurityInterceptor.java | ServerSecurityInterceptor.acceptTransportContext | private Subject acceptTransportContext(ServerRequestInfo ri, TSSConfig tssPolicy) throws SASException {
"""
/*
Per spec.,
"This action validates that a request that arrives without a SAS protocol message;
that is, EstablishContext or MessageInContext satisfies the CSIv2 security requirements
of the target obje... | java | private Subject acceptTransportContext(ServerRequestInfo ri, TSSConfig tssPolicy) throws SASException {
Subject subject = tssPolicy.check(SSLSessionManager.getSSLSession(ri.request_id()), null, codec);
if (subject != null) {
// Set caller subject only, the EJBSecurityCollaboratorImpl will s... | [
"private",
"Subject",
"acceptTransportContext",
"(",
"ServerRequestInfo",
"ri",
",",
"TSSConfig",
"tssPolicy",
")",
"throws",
"SASException",
"{",
"Subject",
"subject",
"=",
"tssPolicy",
".",
"check",
"(",
"SSLSessionManager",
".",
"getSSLSession",
"(",
"ri",
".",
... | /*
Per spec.,
"This action validates that a request that arrives without a SAS protocol message;
that is, EstablishContext or MessageInContext satisfies the CSIv2 security requirements
of the target object. This routine returns true if the transport layer security context
(including none) over which the request was del... | [
"/",
"*",
"Per",
"spec",
".",
"This",
"action",
"validates",
"that",
"a",
"request",
"that",
"arrives",
"without",
"a",
"SAS",
"protocol",
"message",
";",
"that",
"is",
"EstablishContext",
"or",
"MessageInContext",
"satisfies",
"the",
"CSIv2",
"security",
"req... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/ServerSecurityInterceptor.java#L230-L238 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/api/SoySauceBuilder.java | SoySauceBuilder.withDirectives | SoySauceBuilder withDirectives(Map<String, ? extends SoyPrintDirective> userDirectives) {
"""
Sets user directives. Not exposed externally because internal directives should be enough, and
additional functionality can be built as SoySourceFunctions.
"""
this.userDirectives = ImmutableMap.copyOf(userDirect... | java | SoySauceBuilder withDirectives(Map<String, ? extends SoyPrintDirective> userDirectives) {
this.userDirectives = ImmutableMap.copyOf(userDirectives);
return this;
} | [
"SoySauceBuilder",
"withDirectives",
"(",
"Map",
"<",
"String",
",",
"?",
"extends",
"SoyPrintDirective",
">",
"userDirectives",
")",
"{",
"this",
".",
"userDirectives",
"=",
"ImmutableMap",
".",
"copyOf",
"(",
"userDirectives",
")",
";",
"return",
"this",
";",
... | Sets user directives. Not exposed externally because internal directives should be enough, and
additional functionality can be built as SoySourceFunctions. | [
"Sets",
"user",
"directives",
".",
"Not",
"exposed",
"externally",
"because",
"internal",
"directives",
"should",
"be",
"enough",
"and",
"additional",
"functionality",
"can",
"be",
"built",
"as",
"SoySourceFunctions",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/api/SoySauceBuilder.java#L83-L86 |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeAuditTaskResult.java | DescribeAuditTaskResult.withAuditDetails | public DescribeAuditTaskResult withAuditDetails(java.util.Map<String, AuditCheckDetails> auditDetails) {
"""
<p>
Detailed information about each check performed during this audit.
</p>
@param auditDetails
Detailed information about each check performed during this audit.
@return Returns a reference to this ... | java | public DescribeAuditTaskResult withAuditDetails(java.util.Map<String, AuditCheckDetails> auditDetails) {
setAuditDetails(auditDetails);
return this;
} | [
"public",
"DescribeAuditTaskResult",
"withAuditDetails",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AuditCheckDetails",
">",
"auditDetails",
")",
"{",
"setAuditDetails",
"(",
"auditDetails",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Detailed information about each check performed during this audit.
</p>
@param auditDetails
Detailed information about each check performed during this audit.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Detailed",
"information",
"about",
"each",
"check",
"performed",
"during",
"this",
"audit",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeAuditTaskResult.java#L331-L334 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.tagHtmlContent | public static String tagHtmlContent(String tag, String... content) {
"""
Build a String containing a HTML opening tag with no styling of its own, content and closing tag.
@param tag String name of HTML tag
@param content content string
@return HTML tag element as string
"""
return openTagHtmlContent(tag... | java | public static String tagHtmlContent(String tag, String... content) {
return openTagHtmlContent(tag, null, null, content) + closeTag(tag);
} | [
"public",
"static",
"String",
"tagHtmlContent",
"(",
"String",
"tag",
",",
"String",
"...",
"content",
")",
"{",
"return",
"openTagHtmlContent",
"(",
"tag",
",",
"null",
",",
"null",
",",
"content",
")",
"+",
"closeTag",
"(",
"tag",
")",
";",
"}"
] | Build a String containing a HTML opening tag with no styling of its own, content and closing tag.
@param tag String name of HTML tag
@param content content string
@return HTML tag element as string | [
"Build",
"a",
"String",
"containing",
"a",
"HTML",
"opening",
"tag",
"with",
"no",
"styling",
"of",
"its",
"own",
"content",
"and",
"closing",
"tag",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L275-L277 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.