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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/closure-compiler | src/com/google/javascript/jscomp/StatementFusion.java | StatementFusion.fuseIntoOneStatement | private static Node fuseIntoOneStatement(Node parent, Node first, Node last) {
"""
Given a block, fuse a list of statements with comma's.
@param parent The parent that contains the statements.
@param first The first statement to fuse (inclusive)
@param last The last statement to fuse (exclusive)
@return A si... | java | private static Node fuseIntoOneStatement(Node parent, Node first, Node last) {
// Nothing to fuse if there is only one statement.
if (first.getNext() == last) {
return first;
}
// Step one: Create a comma tree that contains all the statements.
Node commaTree = first.removeFirstChild();
N... | [
"private",
"static",
"Node",
"fuseIntoOneStatement",
"(",
"Node",
"parent",
",",
"Node",
"first",
",",
"Node",
"last",
")",
"{",
"// Nothing to fuse if there is only one statement.",
"if",
"(",
"first",
".",
"getNext",
"(",
")",
"==",
"last",
")",
"{",
"return",... | Given a block, fuse a list of statements with comma's.
@param parent The parent that contains the statements.
@param first The first statement to fuse (inclusive)
@param last The last statement to fuse (exclusive)
@return A single statement that contains all the fused statement as one. | [
"Given",
"a",
"block",
"fuse",
"a",
"list",
"of",
"statements",
"with",
"comma",
"s",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/StatementFusion.java#L164-L185 |
geomajas/geomajas-project-client-gwt2 | common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java | StyleUtil.createGraphic | public static GraphicInfo createGraphic(MarkInfo mark, int size) {
"""
Creates a graphic with the specified mark and size.
@param mark the mark
@param size the size
@return the graphic
"""
GraphicInfo graphicInfo = new GraphicInfo();
ChoiceInfo choice = new ChoiceInfo();
choice.setMark(mark);
grap... | java | public static GraphicInfo createGraphic(MarkInfo mark, int size) {
GraphicInfo graphicInfo = new GraphicInfo();
ChoiceInfo choice = new ChoiceInfo();
choice.setMark(mark);
graphicInfo.getChoiceList().add(choice);
SizeInfo sizeInfo = new SizeInfo();
sizeInfo.setValue(Integer.toString(size));
graphicInfo.se... | [
"public",
"static",
"GraphicInfo",
"createGraphic",
"(",
"MarkInfo",
"mark",
",",
"int",
"size",
")",
"{",
"GraphicInfo",
"graphicInfo",
"=",
"new",
"GraphicInfo",
"(",
")",
";",
"ChoiceInfo",
"choice",
"=",
"new",
"ChoiceInfo",
"(",
")",
";",
"choice",
".",... | Creates a graphic with the specified mark and size.
@param mark the mark
@param size the size
@return the graphic | [
"Creates",
"a",
"graphic",
"with",
"the",
"specified",
"mark",
"and",
"size",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L299-L308 |
rolfl/MicroBench | src/main/java/net/tuis/ubench/UBench.java | UBench.addDoubleTask | public UBench addDoubleTask(String name, DoubleSupplier task, DoublePredicate check) {
"""
Include a double-specialized named task (and validator) in to the
benchmark.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@param check
The check of t... | java | public UBench addDoubleTask(String name, DoubleSupplier task, DoublePredicate check) {
return putTask(name, () -> {
long start = System.nanoTime();
double result = task.getAsDouble();
long time = System.nanoTime() - start;
if (check != null && !check.test(result))... | [
"public",
"UBench",
"addDoubleTask",
"(",
"String",
"name",
",",
"DoubleSupplier",
"task",
",",
"DoublePredicate",
"check",
")",
"{",
"return",
"putTask",
"(",
"name",
",",
"(",
")",
"->",
"{",
"long",
"start",
"=",
"System",
".",
"nanoTime",
"(",
")",
"... | Include a double-specialized named task (and validator) in to the
benchmark.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@param check
The check of the results from the task.
@return The same object, for chaining calls. | [
"Include",
"a",
"double",
"-",
"specialized",
"named",
"task",
"(",
"and",
"validator",
")",
"in",
"to",
"the",
"benchmark",
"."
] | train | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UBench.java#L248-L258 |
bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleQueryForEntities | protected <L extends ListWrapper<T>, T extends QueryEntity> L handleQueryForEntities(Class<T> type, String where, Set<String> fieldSet, QueryParams params) {
"""
Makes the "query" api call
<p>
<p>
HTTP Method: GET
@param type the BullhornEntity type
@param where a SQL type where clause
@param fieldS... | java | protected <L extends ListWrapper<T>, T extends QueryEntity> L handleQueryForEntities(Class<T> type, String where, Set<String> fieldSet, QueryParams params) {
if(where.length() < MAX_URL_LENGTH) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForQuery(BullhornEntityInfo.ge... | [
"protected",
"<",
"L",
"extends",
"ListWrapper",
"<",
"T",
">",
",",
"T",
"extends",
"QueryEntity",
">",
"L",
"handleQueryForEntities",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"where",
",",
"Set",
"<",
"String",
">",
"fieldSet",
",",
"QueryPa... | Makes the "query" api call
<p>
<p>
HTTP Method: GET
@param type the BullhornEntity type
@param where a SQL type where clause
@param fieldSet the fields to return, if null or emtpy will default to "*" all
@param params optional QueryParams.
@return a LinsWrapper containing the records plus some additional info... | [
"Makes",
"the",
"query",
"api",
"call",
"<p",
">",
"<p",
">",
"HTTP",
"Method",
":",
"GET"
] | train | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L938-L949 |
deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java | FingerprintManager.saveFingerprintAsFile | public void saveFingerprintAsFile(byte[] fingerprint, String filename) {
"""
Save fingerprint to a file
@param fingerprint fingerprint bytes
@param filename fingerprint filename
@see FingerprintManager file saved
"""
FileOutputStream fileOutputStream;
try {
fileOutputStream =... | java | public void saveFingerprintAsFile(byte[] fingerprint, String filename) {
FileOutputStream fileOutputStream;
try {
fileOutputStream = new FileOutputStream(filename);
fileOutputStream.write(fingerprint);
fileOutputStream.close();
} catch (IOException e) {
... | [
"public",
"void",
"saveFingerprintAsFile",
"(",
"byte",
"[",
"]",
"fingerprint",
",",
"String",
"filename",
")",
"{",
"FileOutputStream",
"fileOutputStream",
";",
"try",
"{",
"fileOutputStream",
"=",
"new",
"FileOutputStream",
"(",
"filename",
")",
";",
"fileOutpu... | Save fingerprint to a file
@param fingerprint fingerprint bytes
@param filename fingerprint filename
@see FingerprintManager file saved | [
"Save",
"fingerprint",
"to",
"a",
"file"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java#L185-L195 |
apereo/cas | core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java | AbstractCasWebflowConfigurer.getState | public <T> T getState(final Flow flow, final String stateId, final Class<T> clazz) {
"""
Gets state.
@param <T> the type parameter
@param flow the flow
@param stateId the state id
@param clazz the clazz
@return the state
"""
if (containsFlowState(flow, stateId)) {
val state ... | java | public <T> T getState(final Flow flow, final String stateId, final Class<T> clazz) {
if (containsFlowState(flow, stateId)) {
val state = flow.getState(stateId);
return clazz.cast(state);
}
return null;
} | [
"public",
"<",
"T",
">",
"T",
"getState",
"(",
"final",
"Flow",
"flow",
",",
"final",
"String",
"stateId",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"containsFlowState",
"(",
"flow",
",",
"stateId",
")",
")",
"{",
"val",
"... | Gets state.
@param <T> the type parameter
@param flow the flow
@param stateId the state id
@param clazz the clazz
@return the state | [
"Gets",
"state",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java#L726-L732 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java | RoaringBitmap.intersects | public static boolean intersects(final RoaringBitmap x1, final RoaringBitmap x2) {
"""
Checks whether the two bitmaps intersect. This can be much faster than calling "and" and
checking the cardinality of the result.
@param x1 first bitmap
@param x2 other bitmap
@return true if they intersect
"""
fina... | java | public static boolean intersects(final RoaringBitmap x1, final RoaringBitmap x2) {
final int length1 = x1.highLowContainer.size(), length2 = x2.highLowContainer.size();
int pos1 = 0, pos2 = 0;
while (pos1 < length1 && pos2 < length2) {
final short s1 = x1.highLowContainer.getKeyAtIndex(pos1);
f... | [
"public",
"static",
"boolean",
"intersects",
"(",
"final",
"RoaringBitmap",
"x1",
",",
"final",
"RoaringBitmap",
"x2",
")",
"{",
"final",
"int",
"length1",
"=",
"x1",
".",
"highLowContainer",
".",
"size",
"(",
")",
",",
"length2",
"=",
"x2",
".",
"highLowC... | Checks whether the two bitmaps intersect. This can be much faster than calling "and" and
checking the cardinality of the result.
@param x1 first bitmap
@param x2 other bitmap
@return true if they intersect | [
"Checks",
"whether",
"the",
"two",
"bitmaps",
"intersect",
".",
"This",
"can",
"be",
"much",
"faster",
"than",
"calling",
"and",
"and",
"checking",
"the",
"cardinality",
"of",
"the",
"result",
"."
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L625-L647 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java | JsonRpcBasicServer.createResponseSuccess | private ObjectNode createResponseSuccess(String jsonRpc, Object id, JsonNode result) {
"""
Creates a success response.
@param jsonRpc the version string
@param id the id of the request
@param result the result object
@return the response object
"""
ObjectNode response = mapper.createObjectNode();... | java | private ObjectNode createResponseSuccess(String jsonRpc, Object id, JsonNode result) {
ObjectNode response = mapper.createObjectNode();
response.put(JSONRPC, jsonRpc);
if (Integer.class.isInstance(id)) {
response.put(ID, Integer.class.cast(id).intValue());
} else if (Long.class.isInstance(id)) {
response.... | [
"private",
"ObjectNode",
"createResponseSuccess",
"(",
"String",
"jsonRpc",
",",
"Object",
"id",
",",
"JsonNode",
"result",
")",
"{",
"ObjectNode",
"response",
"=",
"mapper",
".",
"createObjectNode",
"(",
")",
";",
"response",
".",
"put",
"(",
"JSONRPC",
",",
... | Creates a success response.
@param jsonRpc the version string
@param id the id of the request
@param result the result object
@return the response object | [
"Creates",
"a",
"success",
"response",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L589-L607 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/appfw/appfwprofile_stats.java | appfwprofile_stats.get | public static appfwprofile_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of appfwprofile_stats resource of given name .
"""
appfwprofile_stats obj = new appfwprofile_stats();
obj.set_name(name);
appfwprofile_stats response = (appfwprofile_stats) obj... | java | public static appfwprofile_stats get(nitro_service service, String name) throws Exception{
appfwprofile_stats obj = new appfwprofile_stats();
obj.set_name(name);
appfwprofile_stats response = (appfwprofile_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"appfwprofile_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"appfwprofile_stats",
"obj",
"=",
"new",
"appfwprofile_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";... | Use this API to fetch statistics of appfwprofile_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"appfwprofile_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/appfw/appfwprofile_stats.java#L769-L774 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java | Configurer.getTextDefault | public final String getTextDefault(String defaultValue, String... path) {
"""
Get the node text value.
@param defaultValue Value used if node does not exist.
@param path The node path.
@return The node text value.
"""
final Xml node = getNodeDefault(path);
if (node != null)
{
... | java | public final String getTextDefault(String defaultValue, String... path)
{
final Xml node = getNodeDefault(path);
if (node != null)
{
return node.getText();
}
return defaultValue;
} | [
"public",
"final",
"String",
"getTextDefault",
"(",
"String",
"defaultValue",
",",
"String",
"...",
"path",
")",
"{",
"final",
"Xml",
"node",
"=",
"getNodeDefault",
"(",
"path",
")",
";",
"if",
"(",
"node",
"!=",
"null",
")",
"{",
"return",
"node",
".",
... | Get the node text value.
@param defaultValue Value used if node does not exist.
@param path The node path.
@return The node text value. | [
"Get",
"the",
"node",
"text",
"value",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java#L140-L148 |
Impetus/Kundera | src/kundera-rdbms/src/main/java/com/impetus/client/rdbms/HibernateClient.java | HibernateClient.findByQuery | public List findByQuery(String query, Map<Parameter, Object> parameterMap, int firstResult, int maxResult) {
"""
Find.
@param query
the native fquery
@param parameterMap
the parameter map
@param maxResult
@param firstResult
@return the list
"""
s = getStatelessSession();
Query q = s.c... | java | public List findByQuery(String query, Map<Parameter, Object> parameterMap, int firstResult, int maxResult)
{
s = getStatelessSession();
Query q = s.createQuery(query);
q.setFirstResult(firstResult);
q.setMaxResults(maxResult);
setParameters(parameterMap, q);
return... | [
"public",
"List",
"findByQuery",
"(",
"String",
"query",
",",
"Map",
"<",
"Parameter",
",",
"Object",
">",
"parameterMap",
",",
"int",
"firstResult",
",",
"int",
"maxResult",
")",
"{",
"s",
"=",
"getStatelessSession",
"(",
")",
";",
"Query",
"q",
"=",
"s... | Find.
@param query
the native fquery
@param parameterMap
the parameter map
@param maxResult
@param firstResult
@return the list | [
"Find",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-rdbms/src/main/java/com/impetus/client/rdbms/HibernateClient.java#L594-L605 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Bindings.java | Bindings.bindEnabled | public static void bindEnabled (Value<Boolean> value, final FocusWidget... targets) {
"""
Binds the enabledness state of the target widget to the supplied boolean value.
"""
value.addListenerAndTrigger(new Value.Listener<Boolean>() {
public void valueChanged (Boolean enabled) {
... | java | public static void bindEnabled (Value<Boolean> value, final FocusWidget... targets)
{
value.addListenerAndTrigger(new Value.Listener<Boolean>() {
public void valueChanged (Boolean enabled) {
for (FocusWidget target : targets) {
target.setEnabled(enabled);
... | [
"public",
"static",
"void",
"bindEnabled",
"(",
"Value",
"<",
"Boolean",
">",
"value",
",",
"final",
"FocusWidget",
"...",
"targets",
")",
"{",
"value",
".",
"addListenerAndTrigger",
"(",
"new",
"Value",
".",
"Listener",
"<",
"Boolean",
">",
"(",
")",
"{",... | Binds the enabledness state of the target widget to the supplied boolean value. | [
"Binds",
"the",
"enabledness",
"state",
"of",
"the",
"target",
"widget",
"to",
"the",
"supplied",
"boolean",
"value",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Bindings.java#L59-L68 |
micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/console/logging/MicronautConsole.java | MicronautConsole.createConsoleReader | protected ConsoleReader createConsoleReader(InputStream systemIn) throws IOException {
"""
Create a console reader.
@param systemIn The input stream
@return The console reader
@throws IOException if there is an error
"""
// need to swap out the output to avoid logging during init
final Pri... | java | protected ConsoleReader createConsoleReader(InputStream systemIn) throws IOException {
// need to swap out the output to avoid logging during init
final PrintStream nullOutput = new PrintStream(new ByteArrayOutputStream());
final PrintStream originalOut = Log.getOutput();
try {
... | [
"protected",
"ConsoleReader",
"createConsoleReader",
"(",
"InputStream",
"systemIn",
")",
"throws",
"IOException",
"{",
"// need to swap out the output to avoid logging during init",
"final",
"PrintStream",
"nullOutput",
"=",
"new",
"PrintStream",
"(",
"new",
"ByteArrayOutputSt... | Create a console reader.
@param systemIn The input stream
@return The console reader
@throws IOException if there is an error | [
"Create",
"a",
"console",
"reader",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/console/logging/MicronautConsole.java#L311-L323 |
geomajas/geomajas-project-client-gwt | plugin/javascript-api/javascript-api-gwt/src/main/java/org/geomajas/plugin/jsapi/gwt/client/exporter/map/feature/FeatureSearchServiceImpl.java | FeatureSearchServiceImpl.searchInBounds | public void searchInBounds(final FeaturesSupported layer, Bbox bbox, final FeatureArrayCallback callback) {
"""
Search all features within a certain layer that intersect a certain bounding box.
@param layer
The features supported layer wherein to search.
@param bbox
The bounding box wherein to search.
@para... | java | public void searchInBounds(final FeaturesSupported layer, Bbox bbox, final FeatureArrayCallback callback) {
MapModel mapModel = map.getMapWidget().getMapModel();
Layer<?> gwtLayer = mapModel.getLayer(layer.getId());
if (gwtLayer != null && gwtLayer instanceof VectorLayer) {
final VectorLayer vLayer = (VectorLa... | [
"public",
"void",
"searchInBounds",
"(",
"final",
"FeaturesSupported",
"layer",
",",
"Bbox",
"bbox",
",",
"final",
"FeatureArrayCallback",
"callback",
")",
"{",
"MapModel",
"mapModel",
"=",
"map",
".",
"getMapWidget",
"(",
")",
".",
"getMapModel",
"(",
")",
";... | Search all features within a certain layer that intersect a certain bounding box.
@param layer
The features supported layer wherein to search.
@param bbox
The bounding box wherein to search.
@param callback
Call-back method executed on return (when features have been found). | [
"Search",
"all",
"features",
"within",
"a",
"certain",
"layer",
"that",
"intersect",
"a",
"certain",
"bounding",
"box",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/javascript-api/javascript-api-gwt/src/main/java/org/geomajas/plugin/jsapi/gwt/client/exporter/map/feature/FeatureSearchServiceImpl.java#L116-L151 |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java | Quicksortables.getQuicksortableIntArray | public static Quicksortable getQuicksortableIntArray(final int [] array) {
"""
the sorting code contained in this class was copied from Arrays.java and then modified
"""
return new Quicksortable() {
public void swap(int i, int j) {
int t = array[i];
array[i] ... | java | public static Quicksortable getQuicksortableIntArray(final int [] array) {
return new Quicksortable() {
public void swap(int i, int j) {
int t = array[i];
array[i] = array[j];
array[j] = t;
}
public int compare(int a, int b) {
... | [
"public",
"static",
"Quicksortable",
"getQuicksortableIntArray",
"(",
"final",
"int",
"[",
"]",
"array",
")",
"{",
"return",
"new",
"Quicksortable",
"(",
")",
"{",
"public",
"void",
"swap",
"(",
"int",
"i",
",",
"int",
"j",
")",
"{",
"int",
"t",
"=",
"... | the sorting code contained in this class was copied from Arrays.java and then modified | [
"the",
"sorting",
"code",
"contained",
"in",
"this",
"class",
"was",
"copied",
"from",
"Arrays",
".",
"java",
"and",
"then",
"modified"
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java#L15-L30 |
mpetazzoni/ttorrent | common/src/main/java/com/turn/ttorrent/common/creation/MetadataBuilder.java | MetadataBuilder.setFilesInfo | public MetadataBuilder setFilesInfo(@NotNull List<byte[]> hashes,
@NotNull List<String> filesPaths,
@NotNull List<Long> filesLengths) {
"""
allow to create information about files via speicified hashes, files paths and files lengths.
Usin... | java | public MetadataBuilder setFilesInfo(@NotNull List<byte[]> hashes,
@NotNull List<String> filesPaths,
@NotNull List<Long> filesLengths) {
if (dataSources.size() != 0) {
throw new IllegalStateException("Unable to add hashes-based files i... | [
"public",
"MetadataBuilder",
"setFilesInfo",
"(",
"@",
"NotNull",
"List",
"<",
"byte",
"[",
"]",
">",
"hashes",
",",
"@",
"NotNull",
"List",
"<",
"String",
">",
"filesPaths",
",",
"@",
"NotNull",
"List",
"<",
"Long",
">",
"filesLengths",
")",
"{",
"if",
... | allow to create information about files via speicified hashes, files paths and files lengths.
Using of this method is not compatible with using source-based methods
({@link #addFile(File)}, {@link #addDataSource(InputStream, String, boolean)}, etc
because it's not possible to calculate concat this hashes and calculated... | [
"allow",
"to",
"create",
"information",
"about",
"files",
"via",
"speicified",
"hashes",
"files",
"paths",
"and",
"files",
"lengths",
".",
"Using",
"of",
"this",
"method",
"is",
"not",
"compatible",
"with",
"using",
"source",
"-",
"based",
"methods",
"(",
"{... | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/common/src/main/java/com/turn/ttorrent/common/creation/MetadataBuilder.java#L252-L262 |
jcuda/jnvgraph | JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java | JNvgraph.nvgraphPagerank | public static int nvgraphPagerank(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
long weight_index,
Pointer alpha,
long bookmark_index,
int has_guess,
long pagerank_index,
float tolerance,
int max_iter) {
"""
nvGRAPH PageRank
Find P... | java | public static int nvgraphPagerank(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
long weight_index,
Pointer alpha,
long bookmark_index,
int has_guess,
long pagerank_index,
float tolerance,
int max_iter)
{
return checkResult(nv... | [
"public",
"static",
"int",
"nvgraphPagerank",
"(",
"nvgraphHandle",
"handle",
",",
"nvgraphGraphDescr",
"descrG",
",",
"long",
"weight_index",
",",
"Pointer",
"alpha",
",",
"long",
"bookmark_index",
",",
"int",
"has_guess",
",",
"long",
"pagerank_index",
",",
"flo... | nvGRAPH PageRank
Find PageRank for each vertex of a graph with a given transition probabilities, a bookmark vector of dangling vertices, and the damping factor. | [
"nvGRAPH",
"PageRank",
"Find",
"PageRank",
"for",
"each",
"vertex",
"of",
"a",
"graph",
"with",
"a",
"given",
"transition",
"probabilities",
"a",
"bookmark",
"vector",
"of",
"dangling",
"vertices",
"and",
"the",
"damping",
"factor",
"."
] | train | https://github.com/jcuda/jnvgraph/blob/2c6bd7c58edac181753bacf30af2cceeb1989a78/JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java#L645-L657 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/MetadataFactory.java | MetadataFactory.getIronJacamarMetaData | public Activation getIronJacamarMetaData(File root) throws Exception {
"""
Get the IronJacamar specific metadata
@param root The root of the deployment
@return The metadata
@exception Exception Thrown if an error occurs
"""
Activation result = null;
File metadataFile = new File(root, "/META-INF... | java | public Activation getIronJacamarMetaData(File root) throws Exception
{
Activation result = null;
File metadataFile = new File(root, "/META-INF/ironjacamar.xml");
if (metadataFile.exists())
{
InputStream input = null;
String url = metadataFile.getAbsolutePath();
tr... | [
"public",
"Activation",
"getIronJacamarMetaData",
"(",
"File",
"root",
")",
"throws",
"Exception",
"{",
"Activation",
"result",
"=",
"null",
";",
"File",
"metadataFile",
"=",
"new",
"File",
"(",
"root",
",",
"\"/META-INF/ironjacamar.xml\"",
")",
";",
"if",
"(",
... | Get the IronJacamar specific metadata
@param root The root of the deployment
@return The metadata
@exception Exception Thrown if an error occurs | [
"Get",
"the",
"IronJacamar",
"specific",
"metadata"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/MetadataFactory.java#L108-L143 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/codec/Base64.java | Base64.encodeUrlSafe | public static String encodeUrlSafe(String source, String charset) {
"""
base64编码,URL安全
@param source 被编码的base64字符串
@param charset 字符集
@return 被加密后的字符串
@since 3.0.6
"""
return Base64Encoder.encodeUrlSafe(source, charset);
} | java | public static String encodeUrlSafe(String source, String charset) {
return Base64Encoder.encodeUrlSafe(source, charset);
} | [
"public",
"static",
"String",
"encodeUrlSafe",
"(",
"String",
"source",
",",
"String",
"charset",
")",
"{",
"return",
"Base64Encoder",
".",
"encodeUrlSafe",
"(",
"source",
",",
"charset",
")",
";",
"}"
] | base64编码,URL安全
@param source 被编码的base64字符串
@param charset 字符集
@return 被加密后的字符串
@since 3.0.6 | [
"base64编码",
"URL安全"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/Base64.java#L86-L88 |
andi12/msbuild-maven-plugin | msbuild-maven-plugin/src/main/java/uk/org/raje/maven/plugin/msbuild/parser/VCProjectHolder.java | VCProjectHolder.getVCProjectHolder | public static VCProjectHolder getVCProjectHolder( File inputFile, boolean isSolution ) {
"""
Find or create a container for parsed Visual C++ projects. If a container has already been created for the given
{@code inputFile} that container is returned; otherwise a new container is created.
@param inputFile the fi... | java | public static VCProjectHolder getVCProjectHolder( File inputFile, boolean isSolution )
{
VCProjectHolder vcProjectHolder = VCPROJECT_HOLDERS.get( inputFile );
if ( vcProjectHolder == null )
{
vcProjectHolder = new VCProjectHolder( inputFile, isSolution, new HashMap<Strin... | [
"public",
"static",
"VCProjectHolder",
"getVCProjectHolder",
"(",
"File",
"inputFile",
",",
"boolean",
"isSolution",
")",
"{",
"VCProjectHolder",
"vcProjectHolder",
"=",
"VCPROJECT_HOLDERS",
".",
"get",
"(",
"inputFile",
")",
";",
"if",
"(",
"vcProjectHolder",
"==",... | Find or create a container for parsed Visual C++ projects. If a container has already been created for the given
{@code inputFile} that container is returned; otherwise a new container is created.
@param inputFile the file to parse, it can be a Visual Studio solution (containing Visual C++ projects) or a
standalone Vis... | [
"Find",
"or",
"create",
"a",
"container",
"for",
"parsed",
"Visual",
"C",
"++",
"projects",
".",
"If",
"a",
"container",
"has",
"already",
"been",
"created",
"for",
"the",
"given",
"{"
] | train | https://github.com/andi12/msbuild-maven-plugin/blob/224159c15efba20d482f8c630f7947339b1a1b86/msbuild-maven-plugin/src/main/java/uk/org/raje/maven/plugin/msbuild/parser/VCProjectHolder.java#L46-L57 |
elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkcop/MkCoPTreeIndex.java | MkCoPTreeIndex.createNewLeafEntry | protected MkCoPEntry createNewLeafEntry(DBID id, O object, double parentDistance) {
"""
Creates a new leaf entry representing the specified data object in the
specified subtree.
@param object the data object to be represented by the new entry
@param parentDistance the distance from the object to the routing o... | java | protected MkCoPEntry createNewLeafEntry(DBID id, O object, double parentDistance) {
MkCoPLeafEntry leafEntry = new MkCoPLeafEntry(id, parentDistance, null, null);
return leafEntry;
} | [
"protected",
"MkCoPEntry",
"createNewLeafEntry",
"(",
"DBID",
"id",
",",
"O",
"object",
",",
"double",
"parentDistance",
")",
"{",
"MkCoPLeafEntry",
"leafEntry",
"=",
"new",
"MkCoPLeafEntry",
"(",
"id",
",",
"parentDistance",
",",
"null",
",",
"null",
")",
";"... | Creates a new leaf entry representing the specified data object in the
specified subtree.
@param object the data object to be represented by the new entry
@param parentDistance the distance from the object to the routing object of
the parent node | [
"Creates",
"a",
"new",
"leaf",
"entry",
"representing",
"the",
"specified",
"data",
"object",
"in",
"the",
"specified",
"subtree",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkcop/MkCoPTreeIndex.java#L78-L81 |
aws/aws-sdk-java | aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/util/StepFactory.java | StepFactory.newRunHiveScriptStepVersioned | public HadoopJarStepConfig newRunHiveScriptStepVersioned(String script,
String hiveVersion, String... scriptArgs) {
"""
Step that runs a Hive script on your job flow using the specified Hive version.
@param script
The script to run.
@param hiveVersion
The Hive version to use.
@param scriptArgs
Argu... | java | public HadoopJarStepConfig newRunHiveScriptStepVersioned(String script,
String hiveVersion, String... scriptArgs) {
List<String> hiveArgs = new ArrayList<String>();
hiveArgs.add("--hive-versions");
hiveArgs.add(hiveVersion);
hiveArgs.add("--run-hive-script");
hiveArgs.add... | [
"public",
"HadoopJarStepConfig",
"newRunHiveScriptStepVersioned",
"(",
"String",
"script",
",",
"String",
"hiveVersion",
",",
"String",
"...",
"scriptArgs",
")",
"{",
"List",
"<",
"String",
">",
"hiveArgs",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
... | Step that runs a Hive script on your job flow using the specified Hive version.
@param script
The script to run.
@param hiveVersion
The Hive version to use.
@param scriptArgs
Arguments that get passed to the script.
@return HadoopJarStepConfig that can be passed to your job flow. | [
"Step",
"that",
"runs",
"a",
"Hive",
"script",
"on",
"your",
"job",
"flow",
"using",
"the",
"specified",
"Hive",
"version",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/util/StepFactory.java#L205-L216 |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.readTableData | private void readTableData(List<SynchroTable> tables, InputStream is) throws IOException {
"""
Read the data for all of the tables we're interested in.
@param tables list of all available tables
@param is input stream
"""
for (SynchroTable table : tables)
{
if (REQUIRED_TABLES.contains... | java | private void readTableData(List<SynchroTable> tables, InputStream is) throws IOException
{
for (SynchroTable table : tables)
{
if (REQUIRED_TABLES.contains(table.getName()))
{
readTable(is, table);
}
}
} | [
"private",
"void",
"readTableData",
"(",
"List",
"<",
"SynchroTable",
">",
"tables",
",",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"for",
"(",
"SynchroTable",
"table",
":",
"tables",
")",
"{",
"if",
"(",
"REQUIRED_TABLES",
".",
"contains",
"("... | Read the data for all of the tables we're interested in.
@param tables list of all available tables
@param is input stream | [
"Read",
"the",
"data",
"for",
"all",
"of",
"the",
"tables",
"we",
"re",
"interested",
"in",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L158-L167 |
tzaeschke/zoodb | src/org/zoodb/tools/ZooXmlImport.java | ZooXmlImport.readln1 | private boolean readln1(String strExpected, String strAlternative) {
"""
Reads '1' token.
@param strExpected
@param strAlternative
@return true if 1st string matches, or false if second matches
@throws IllegalStateException if neither String matches
"""
String sX = scanner.next();
if (sX.equals(strExpe... | java | private boolean readln1(String strExpected, String strAlternative) {
String sX = scanner.next();
if (sX.equals(strExpected)) {
return true;
}
if (sX.equals(strAlternative)) {
return false;
}
throw new IllegalStateException("Expected: " + strAlternative + " but got: " + sX);
} | [
"private",
"boolean",
"readln1",
"(",
"String",
"strExpected",
",",
"String",
"strAlternative",
")",
"{",
"String",
"sX",
"=",
"scanner",
".",
"next",
"(",
")",
";",
"if",
"(",
"sX",
".",
"equals",
"(",
"strExpected",
")",
")",
"{",
"return",
"true",
"... | Reads '1' token.
@param strExpected
@param strAlternative
@return true if 1st string matches, or false if second matches
@throws IllegalStateException if neither String matches | [
"Reads",
"1",
"token",
"."
] | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/tools/ZooXmlImport.java#L349-L358 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync | public Observable<ServiceResponse<Page<NetworkInterfaceInner>>> listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) {
"""
Gets information about all network interfaces in a virtual machine i... | java | public Observable<ServiceResponse<Page<NetworkInterfaceInner>>> listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) {
return listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(r... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"NetworkInterfaceInner",
">",
">",
">",
"listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualMachineScaleSetName",
... | Gets information about all network interfaces in a virtual machine in a virtual machine scale set.
@param resourceGroupName The name of the resource group.
@param virtualMachineScaleSetName The name of the virtual machine scale set.
@param virtualmachineIndex The virtual machine index.
@throws IllegalArgumentException... | [
"Gets",
"information",
"about",
"all",
"network",
"interfaces",
"in",
"a",
"virtual",
"machine",
"in",
"a",
"virtual",
"machine",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L1557-L1569 |
needle4j/needle4j | src/main/java/org/needle4j/db/operation/AbstractDBOperation.java | AbstractDBOperation.executeScript | protected void executeScript(final String filename, final Statement statement) throws SQLException {
"""
Execute the given sql script.
@param filename
the filename of the sql script
@param statement
the {@link Statement} to be used for executing a SQL
statement.
@throws SQLException
if a database access... | java | protected void executeScript(final String filename, final Statement statement) throws SQLException {
LOG.info("Executing sql script: " + filename);
InputStream fileInputStream;
try {
fileInputStream = ConfigurationLoader.loadResource(filename);
} catch (FileNotFoundException... | [
"protected",
"void",
"executeScript",
"(",
"final",
"String",
"filename",
",",
"final",
"Statement",
"statement",
")",
"throws",
"SQLException",
"{",
"LOG",
".",
"info",
"(",
"\"Executing sql script: \"",
"+",
"filename",
")",
";",
"InputStream",
"fileInputStream",
... | Execute the given sql script.
@param filename
the filename of the sql script
@param statement
the {@link Statement} to be used for executing a SQL
statement.
@throws SQLException
if a database access error occurs | [
"Execute",
"the",
"given",
"sql",
"script",
"."
] | train | https://github.com/needle4j/needle4j/blob/55fbcdeed72be5cf26e4404b0fe40282792b51f2/src/main/java/org/needle4j/db/operation/AbstractDBOperation.java#L183-L196 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.orderBandsIntoBuffered | public static Planar orderBandsIntoBuffered(Planar src, BufferedImage dst) {
"""
Returns a new image with the color bands in the appropriate ordering. The returned image will
reference the original image's image arrays.
"""
// see if no change is required
if( dst.getType() == BufferedImage.TYPE_INT_RGB )... | java | public static Planar orderBandsIntoBuffered(Planar src, BufferedImage dst) {
// see if no change is required
if( dst.getType() == BufferedImage.TYPE_INT_RGB )
return src;
Planar tmp = new Planar(src.type, src.getNumBands());
tmp.width = src.width;
tmp.height = src.height;
tmp.stride = src.stride;
tmp.... | [
"public",
"static",
"Planar",
"orderBandsIntoBuffered",
"(",
"Planar",
"src",
",",
"BufferedImage",
"dst",
")",
"{",
"// see if no change is required",
"if",
"(",
"dst",
".",
"getType",
"(",
")",
"==",
"BufferedImage",
".",
"TYPE_INT_RGB",
")",
"return",
"src",
... | Returns a new image with the color bands in the appropriate ordering. The returned image will
reference the original image's image arrays. | [
"Returns",
"a",
"new",
"image",
"with",
"the",
"color",
"bands",
"in",
"the",
"appropriate",
"ordering",
".",
"The",
"returned",
"image",
"will",
"reference",
"the",
"original",
"image",
"s",
"image",
"arrays",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L930-L945 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.setColumn | public Matrix4f setColumn(int column, Vector4fc src) throws IndexOutOfBoundsException {
"""
Set the column at the given <code>column</code> index, starting with <code>0</code>.
@param column
the column index in <code>[0..3]</code>
@param src
the column components to set
@return this
@throws IndexOutOfBound... | java | public Matrix4f setColumn(int column, Vector4fc src) throws IndexOutOfBoundsException {
switch (column) {
case 0:
if (src instanceof Vector4f) {
MemUtil.INSTANCE.getColumn0(this, (Vector4f) src);
} else {
this._m00(src.x());
this._m... | [
"public",
"Matrix4f",
"setColumn",
"(",
"int",
"column",
",",
"Vector4fc",
"src",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"switch",
"(",
"column",
")",
"{",
"case",
"0",
":",
"if",
"(",
"src",
"instanceof",
"Vector4f",
")",
"{",
"MemUtil",
".",
"I... | Set the column at the given <code>column</code> index, starting with <code>0</code>.
@param column
the column index in <code>[0..3]</code>
@param src
the column components to set
@return this
@throws IndexOutOfBoundsException if <code>column</code> is not in <code>[0..3]</code> | [
"Set",
"the",
"column",
"at",
"the",
"given",
"<code",
">",
"column<",
"/",
"code",
">",
"index",
"starting",
"with",
"<code",
">",
"0<",
"/",
"code",
">",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L12459-L12506 |
spring-cloud/spring-cloud-netflix | spring-cloud-netflix-ribbon/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonUtils.java | RibbonUtils.updateToSecureConnectionIfNeeded | public static URI updateToSecureConnectionIfNeeded(URI uri, IClientConfig config,
ServerIntrospector serverIntrospector, Server server) {
"""
Replace the scheme to the secure variant if needed. If the
{@link #unsecureSchemeMapping} map contains the uri scheme and
{@link #isSecure(IClientConfig, ServerIntrospe... | java | public static URI updateToSecureConnectionIfNeeded(URI uri, IClientConfig config,
ServerIntrospector serverIntrospector, Server server) {
String scheme = uri.getScheme();
if (StringUtils.isEmpty(scheme)) {
scheme = "http";
}
if (!StringUtils.isEmpty(uri.toString())
&& unsecureSchemeMapping.containsK... | [
"public",
"static",
"URI",
"updateToSecureConnectionIfNeeded",
"(",
"URI",
"uri",
",",
"IClientConfig",
"config",
",",
"ServerIntrospector",
"serverIntrospector",
",",
"Server",
"server",
")",
"{",
"String",
"scheme",
"=",
"uri",
".",
"getScheme",
"(",
")",
";",
... | Replace the scheme to the secure variant if needed. If the
{@link #unsecureSchemeMapping} map contains the uri scheme and
{@link #isSecure(IClientConfig, ServerIntrospector, Server)} is true, update the
scheme. This assumes the uri is already encoded to avoid double encoding.
@param uri to modify if required
@param con... | [
"Replace",
"the",
"scheme",
"to",
"the",
"secure",
"variant",
"if",
"needed",
".",
"If",
"the",
"{"
] | train | https://github.com/spring-cloud/spring-cloud-netflix/blob/03b1e326ce5971c41239890dc71cae616366cff8/spring-cloud-netflix-ribbon/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonUtils.java#L159-L173 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.clearText | protected void clearText(PageElement pageElement, CharSequence keysToSend, Object... args) throws TechnicalException, FailureException {
"""
Update a html input text with "".
@param pageElement
Is target element
@param keysToSend
character to send to the element after {@link org.openqa.selenium.WebElement#se... | java | protected void clearText(PageElement pageElement, CharSequence keysToSend, Object... args) throws TechnicalException, FailureException {
try {
final WebElement element = Context.waitUntil(ExpectedConditions.presenceOfElementLocated(Utilities.getLocator(pageElement, args)));
element.cl... | [
"protected",
"void",
"clearText",
"(",
"PageElement",
"pageElement",
",",
"CharSequence",
"keysToSend",
",",
"Object",
"...",
"args",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"try",
"{",
"final",
"WebElement",
"element",
"=",
"Context",
"... | Update a html input text with "".
@param pageElement
Is target element
@param keysToSend
character to send to the element after {@link org.openqa.selenium.WebElement#sendKeys(CharSequence...) sendKeys} with textOrKey
@param args
list of arguments to format the found selector with
@throws TechnicalException
is thrown i... | [
"Update",
"a",
"html",
"input",
"text",
"with",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L263-L274 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/registry/MalisisRegistry.java | MalisisRegistry.registerBlockRenderer | @SideOnly(Side.CLIENT)
public static void registerBlockRenderer(Block block, IBlockRenderer renderer) {
"""
Registers a {@link IBlockRenderer} for the {@link Block}, and its {@link Item} if any.
@param block the block
@param renderer the renderer
"""
clientRegistry.blockRenderers.put(checkNotNull(block)... | java | @SideOnly(Side.CLIENT)
public static void registerBlockRenderer(Block block, IBlockRenderer renderer)
{
clientRegistry.blockRenderers.put(checkNotNull(block), checkNotNull(renderer));
Item item = Item.getItemFromBlock(block);
if (item != null)
clientRegistry.itemRenderers.put(item, renderer);
} | [
"@",
"SideOnly",
"(",
"Side",
".",
"CLIENT",
")",
"public",
"static",
"void",
"registerBlockRenderer",
"(",
"Block",
"block",
",",
"IBlockRenderer",
"renderer",
")",
"{",
"clientRegistry",
".",
"blockRenderers",
".",
"put",
"(",
"checkNotNull",
"(",
"block",
"... | Registers a {@link IBlockRenderer} for the {@link Block}, and its {@link Item} if any.
@param block the block
@param renderer the renderer | [
"Registers",
"a",
"{",
"@link",
"IBlockRenderer",
"}",
"for",
"the",
"{",
"@link",
"Block",
"}",
"and",
"its",
"{",
"@link",
"Item",
"}",
"if",
"any",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/registry/MalisisRegistry.java#L198-L205 |
spotify/styx | styx-service-common/src/main/java/com/spotify/styx/util/ShardedCounter.java | ShardedCounter.updateCounter | public void updateCounter(StorageTransaction transaction, String counterId, long delta) throws IOException {
"""
Must be called within a TransactionCallable. Augments the transaction with certain operations
that strongly consistently increment resp. decrement the counter referred to by counterId, and
cause the t... | java | public void updateCounter(StorageTransaction transaction, String counterId, long delta) throws IOException {
CounterSnapshot snapshot = getCounterSnapshot(counterId);
// If delta is negative, try to update shards with excess usage first
if (delta < 0) {
Optional<Integer> shardIndex = snapshot.pickSha... | [
"public",
"void",
"updateCounter",
"(",
"StorageTransaction",
"transaction",
",",
"String",
"counterId",
",",
"long",
"delta",
")",
"throws",
"IOException",
"{",
"CounterSnapshot",
"snapshot",
"=",
"getCounterSnapshot",
"(",
"counterId",
")",
";",
"// If delta is nega... | Must be called within a TransactionCallable. Augments the transaction with certain operations
that strongly consistently increment resp. decrement the counter referred to by counterId, and
cause the transaction to fail to commit if the counter's associated limit is exceeded. Also
spurious failures are possible.
<p>Del... | [
"Must",
"be",
"called",
"within",
"a",
"TransactionCallable",
".",
"Augments",
"the",
"transaction",
"with",
"certain",
"operations",
"that",
"strongly",
"consistently",
"increment",
"resp",
".",
"decrement",
"the",
"counter",
"referred",
"to",
"by",
"counterId",
... | train | https://github.com/spotify/styx/blob/0d63999beeb93a17447e3bbccaa62175b74cf6e4/styx-service-common/src/main/java/com/spotify/styx/util/ShardedCounter.java#L250-L265 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/AbstractSlingBean.java | AbstractSlingBean.initialize | public void initialize(BeanContext context, Resource resource) {
"""
This basic initialization sets up the context and resource attributes only,
all the other attributes are set 'lazy' during their getter calls.
@param context the scripting context (e.g. a JSP PageContext or a Groovy scripting context)
@para... | java | public void initialize(BeanContext context, Resource resource) {
if (LOG.isDebugEnabled()) {
LOG.debug("initialize (" + context + ", " + resource + ")");
}
this.context = context;
this.resource = ResourceHandle.use(resource);
} | [
"public",
"void",
"initialize",
"(",
"BeanContext",
"context",
",",
"Resource",
"resource",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"initialize (\"",
"+",
"context",
"+",
"\", \"",
"+",
"resource",... | This basic initialization sets up the context and resource attributes only,
all the other attributes are set 'lazy' during their getter calls.
@param context the scripting context (e.g. a JSP PageContext or a Groovy scripting context)
@param resource the resource to use (normally the resource addressed by the request... | [
"This",
"basic",
"initialization",
"sets",
"up",
"the",
"context",
"and",
"resource",
"attributes",
"only",
"all",
"the",
"other",
"attributes",
"are",
"set",
"lazy",
"during",
"their",
"getter",
"calls",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/AbstractSlingBean.java#L104-L110 |
OpenBEL/openbel-framework | org.openbel.framework.api/src/main/java/org/openbel/framework/api/Namespaces.java | Namespaces.matchesSpecies | private boolean matchesSpecies(final NamespaceHeader hdr, int species) {
"""
Match a {@link NamespaceHeader namespace header} to a species taxonomy
id.
@param hdr {@link NamespaceHeader}
@param species {@code int} species
@return {@code true} if the namespace data is specific to
{@code species}, {@code fals... | java | private boolean matchesSpecies(final NamespaceHeader hdr, int species) {
final String speciesHdr = hdr.getNamespaceBlock().getSpeciesString();
// empty header, no match
if (noLength(speciesHdr)) {
return false;
}
// non-numeric, no match
if (!isNumeric(speci... | [
"private",
"boolean",
"matchesSpecies",
"(",
"final",
"NamespaceHeader",
"hdr",
",",
"int",
"species",
")",
"{",
"final",
"String",
"speciesHdr",
"=",
"hdr",
".",
"getNamespaceBlock",
"(",
")",
".",
"getSpeciesString",
"(",
")",
";",
"// empty header, no match",
... | Match a {@link NamespaceHeader namespace header} to a species taxonomy
id.
@param hdr {@link NamespaceHeader}
@param species {@code int} species
@return {@code true} if the namespace data is specific to
{@code species}, {@code false} otherwise | [
"Match",
"a",
"{",
"@link",
"NamespaceHeader",
"namespace",
"header",
"}",
"to",
"a",
"species",
"taxonomy",
"id",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.api/src/main/java/org/openbel/framework/api/Namespaces.java#L213-L229 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.deleteRepositoryFile | public void deleteRepositoryFile(GitlabProject project, String path, String branchName, String commitMsg) throws IOException {
"""
Deletes an existing file in the repository
@param project The Project
@param path The file path inside the repository
@param branchName The name of a repository branch
@... | java | public void deleteRepositoryFile(GitlabProject project, String path, String branchName, String commitMsg) throws IOException {
Query query = new Query()
.append("branch", branchName)
.append("commit_message", commitMsg);
String tailUrl = GitlabProject.URL + "/" + project.... | [
"public",
"void",
"deleteRepositoryFile",
"(",
"GitlabProject",
"project",
",",
"String",
"path",
",",
"String",
"branchName",
",",
"String",
"commitMsg",
")",
"throws",
"IOException",
"{",
"Query",
"query",
"=",
"new",
"Query",
"(",
")",
".",
"append",
"(",
... | Deletes an existing file in the repository
@param project The Project
@param path The file path inside the repository
@param branchName The name of a repository branch
@param commitMsg The commit message
@throws IOException on gitlab api call error | [
"Deletes",
"an",
"existing",
"file",
"in",
"the",
"repository"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L2250-L2256 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDeps.java | ModuleDeps.resolveWith | public ModuleDeps resolveWith(Features features, boolean coerceUndefinedToFalse) {
"""
Calls {@link ModuleDepInfo#resolveWith(Features)} on each of the values in the map.
@param features
the feature set to apply.
@param coerceUndefinedToFalse
if true, undefined features will be treated as false
@return th... | java | public ModuleDeps resolveWith(Features features, boolean coerceUndefinedToFalse) {
for (ModuleDepInfo info : values()) {
info.resolveWith(features, coerceUndefinedToFalse);
}
return this;
} | [
"public",
"ModuleDeps",
"resolveWith",
"(",
"Features",
"features",
",",
"boolean",
"coerceUndefinedToFalse",
")",
"{",
"for",
"(",
"ModuleDepInfo",
"info",
":",
"values",
"(",
")",
")",
"{",
"info",
".",
"resolveWith",
"(",
"features",
",",
"coerceUndefinedToFa... | Calls {@link ModuleDepInfo#resolveWith(Features)} on each of the values in the map.
@param features
the feature set to apply.
@param coerceUndefinedToFalse
if true, undefined features will be treated as false
@return the current object | [
"Calls",
"{",
"@link",
"ModuleDepInfo#resolveWith",
"(",
"Features",
")",
"}",
"on",
"each",
"of",
"the",
"values",
"in",
"the",
"map",
"."
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDeps.java#L254-L259 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/StringUtil.java | StringUtil.SQLEqualsIgnoreCase | public static boolean SQLEqualsIgnoreCase(String s1, String s2) {
"""
Compares two strings
Strings will be uppercased in english and compared
equivalent to s1.equalsIgnoreCase(s2)
throws NPE if s1 is null
@param s1 first string to compare
@param s2 second string to compare
@return true if the two upp... | java | public static boolean SQLEqualsIgnoreCase(String s1, String s2) {
if (s2 == null) {
return false;
} else {
return SQLToUpperCase(s1).equals(SQLToUpperCase(s2));
}
} | [
"public",
"static",
"boolean",
"SQLEqualsIgnoreCase",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"s2",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"return",
"SQLToUpperCase",
"(",
"s1",
")",
".",
"equals",
"(",... | Compares two strings
Strings will be uppercased in english and compared
equivalent to s1.equalsIgnoreCase(s2)
throws NPE if s1 is null
@param s1 first string to compare
@param s2 second string to compare
@return true if the two upppercased ENGLISH values are equal
return false if s2 is null | [
"Compares",
"two",
"strings",
"Strings",
"will",
"be",
"uppercased",
"in",
"english",
"and",
"compared",
"equivalent",
"to",
"s1",
".",
"equalsIgnoreCase",
"(",
"s2",
")",
"throws",
"NPE",
"if",
"s1",
"is",
"null"
] | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/StringUtil.java#L689-L696 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVG.java | SVG.renderViewToCanvas | @SuppressWarnings( {
"""
Renders this SVG document to a Canvas using the specified view defined in the document.
<p>
A View is an special element in a SVG documents that describes a rectangular area in the document.
Calling this method with a {@code viewId} will result in the specified view being positioned and... | java | @SuppressWarnings({"WeakerAccess", "unused"})
public void renderViewToCanvas(String viewId, Canvas canvas)
{
renderToCanvas(canvas, RenderOptions.create().view(viewId));
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"public",
"void",
"renderViewToCanvas",
"(",
"String",
"viewId",
",",
"Canvas",
"canvas",
")",
"{",
"renderToCanvas",
"(",
"canvas",
",",
"RenderOptions",
".",
"create",
"(",
"... | Renders this SVG document to a Canvas using the specified view defined in the document.
<p>
A View is an special element in a SVG documents that describes a rectangular area in the document.
Calling this method with a {@code viewId} will result in the specified view being positioned and scaled
to the viewport. In othe... | [
"Renders",
"this",
"SVG",
"document",
"to",
"a",
"Canvas",
"using",
"the",
"specified",
"view",
"defined",
"in",
"the",
"document",
".",
"<p",
">",
"A",
"View",
"is",
"an",
"special",
"element",
"in",
"a",
"SVG",
"documents",
"that",
"describes",
"a",
"r... | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVG.java#L557-L561 |
Bedework/bw-util | bw-util-http/src/main/java/org/bedework/util/http/BasicHttpClient.java | BasicHttpClient.sendRequest | public int sendRequest(final String method, final String url,
final List<Header> hdrs) throws HttpException {
"""
Send a (simple) request to the server
@param method the method, GET, PUT etc
@param url the url
@param hdrs may be null
@return int status code
@throws HttpException
... | java | public int sendRequest(final String method, final String url,
final List<Header> hdrs) throws HttpException {
return sendRequest(method, url, hdrs, null, 0, null);
} | [
"public",
"int",
"sendRequest",
"(",
"final",
"String",
"method",
",",
"final",
"String",
"url",
",",
"final",
"List",
"<",
"Header",
">",
"hdrs",
")",
"throws",
"HttpException",
"{",
"return",
"sendRequest",
"(",
"method",
",",
"url",
",",
"hdrs",
",",
... | Send a (simple) request to the server
@param method the method, GET, PUT etc
@param url the url
@param hdrs may be null
@return int status code
@throws HttpException | [
"Send",
"a",
"(",
"simple",
")",
"request",
"to",
"the",
"server"
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-http/src/main/java/org/bedework/util/http/BasicHttpClient.java#L436-L439 |
Gagravarr/VorbisJava | core/src/main/java/org/gagravarr/theora/TheoraFile.java | TheoraFile.writeAudioData | public void writeAudioData(OggStreamAudioData data, int audioSid) {
"""
Buffers the given audio ready for writing
out, to a given (pre-existing) audio stream.
Data won't be written out yet, you
need to call {@link #close()} to do that,
because we assume you'll still be populating
the Info/Comment/Setup object... | java | public void writeAudioData(OggStreamAudioData data, int audioSid) {
if (! soundtracks.containsKey(audioSid)) {
throw new IllegalArgumentException("Unknown audio stream with id " + audioSid);
}
writtenPackets.add(new AudioVisualDataAndSid(data, audioSid));
} | [
"public",
"void",
"writeAudioData",
"(",
"OggStreamAudioData",
"data",
",",
"int",
"audioSid",
")",
"{",
"if",
"(",
"!",
"soundtracks",
".",
"containsKey",
"(",
"audioSid",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Unknown audio stream wit... | Buffers the given audio ready for writing
out, to a given (pre-existing) audio stream.
Data won't be written out yet, you
need to call {@link #close()} to do that,
because we assume you'll still be populating
the Info/Comment/Setup objects | [
"Buffers",
"the",
"given",
"audio",
"ready",
"for",
"writing",
"out",
"to",
"a",
"given",
"(",
"pre",
"-",
"existing",
")",
"audio",
"stream",
".",
"Data",
"won",
"t",
"be",
"written",
"out",
"yet",
"you",
"need",
"to",
"call",
"{"
] | train | https://github.com/Gagravarr/VorbisJava/blob/22b4d645b00386d59d17a336a2bc9d54db08df16/core/src/main/java/org/gagravarr/theora/TheoraFile.java#L351-L357 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java | BaseNeo4jAssociationQueries.createRelationshipforCollectionOfComponents | private void createRelationshipforCollectionOfComponents(AssociationKey associationKey, String collectionRole, String[] embeddedColumnNames, Object[] embeddedColumnValues, StringBuilder queryBuilder) {
"""
/*
Example 1:
MATCH (owner:ENTITY:MultiAddressAccount {login: {0}})
MERGE (owner) -[r:addresses {name: {... | java | private void createRelationshipforCollectionOfComponents(AssociationKey associationKey, String collectionRole, String[] embeddedColumnNames, Object[] embeddedColumnValues, StringBuilder queryBuilder) {
int offset = associationKey.getEntityKey().getColumnNames().length;
if ( isPartOfEmbedded( collectionRole ) ) {
... | [
"private",
"void",
"createRelationshipforCollectionOfComponents",
"(",
"AssociationKey",
"associationKey",
",",
"String",
"collectionRole",
",",
"String",
"[",
"]",
"embeddedColumnNames",
",",
"Object",
"[",
"]",
"embeddedColumnValues",
",",
"StringBuilder",
"queryBuilder",... | /*
Example 1:
MATCH (owner:ENTITY:MultiAddressAccount {login: {0}})
MERGE (owner) -[r:addresses {name: {1}}]-> (target:EMBEDDED:`MultiAddressAccount_addresses`)
SET target = {city: {2}, country: {3}}
RETURN r
Example 2:
MATCH (owner:ENTITY:StoryGame {id: {0}}) - [:goodBranch] -> (e:EMBEDDED)
CREATE (e) -[r:additiona... | [
"/",
"*",
"Example",
"1",
":"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java#L360-L416 |
amazon-archives/aws-sdk-java-resources | aws-resources-core/src/main/java/com/amazonaws/resources/internal/ReflectionUtils.java | ReflectionUtils.setValue | private static void setValue(Object target, String field, Object value) {
"""
Uses reflection to set the value of the given property on the target
object.
@param target the object to reflect on
@param field the name of the property to set
@param value the new value of the property
"""
// TODO: Sh... | java | private static void setValue(Object target, String field, Object value) {
// TODO: Should we do this for all numbers, not just '0'?
if ("0".equals(field)) {
if (!(target instanceof Collection)) {
throw new IllegalArgumentException(
"Cannot evaluate '0... | [
"private",
"static",
"void",
"setValue",
"(",
"Object",
"target",
",",
"String",
"field",
",",
"Object",
"value",
")",
"{",
"// TODO: Should we do this for all numbers, not just '0'?",
"if",
"(",
"\"0\"",
".",
"equals",
"(",
"field",
")",
")",
"{",
"if",
"(",
... | Uses reflection to set the value of the given property on the target
object.
@param target the object to reflect on
@param field the name of the property to set
@param value the new value of the property | [
"Uses",
"reflection",
"to",
"set",
"the",
"value",
"of",
"the",
"given",
"property",
"on",
"the",
"target",
"object",
"."
] | train | https://github.com/amazon-archives/aws-sdk-java-resources/blob/0f4fef2615d9687997b70a36eed1d62dd42df035/aws-resources-core/src/main/java/com/amazonaws/resources/internal/ReflectionUtils.java#L416-L450 |
jbundle/jbundle | base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/fax/FaxMessageTransport.java | FaxMessageTransport.logMessage | public String logMessage(String strTrxID, BaseMessage trxMessage, String strMessageInfoType, String strMessageProcessType, String strMessageStatus, String strContactType, String strPerson, String strMessageDescription, int iUserID, int iMessageReferenceID, Message message, String strDest) {
"""
Write this outgoing... | java | public String logMessage(String strTrxID, BaseMessage trxMessage, String strMessageInfoType, String strMessageProcessType, String strMessageStatus, String strContactType, String strPerson, String strMessageDescription, int iUserID, int iMessageReferenceID, Message message, String strDest)
{
return super.log... | [
"public",
"String",
"logMessage",
"(",
"String",
"strTrxID",
",",
"BaseMessage",
"trxMessage",
",",
"String",
"strMessageInfoType",
",",
"String",
"strMessageProcessType",
",",
"String",
"strMessageStatus",
",",
"String",
"strContactType",
",",
"String",
"strPerson",
... | Write this outgoing SOAP message into the log.
@param msg The message.
@urlEndpoint The destination.
@return The message log transaction number. | [
"Write",
"this",
"outgoing",
"SOAP",
"message",
"into",
"the",
"log",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/fax/FaxMessageTransport.java#L117-L120 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/linear/BBR.java | BBR.tenativeUpdate | private double tenativeUpdate(final Vec[] columnMajor, final int j, final double w_j, final double[] y, final double[] r, final double lambda, final double s, final double[] delta) {
"""
Gets the tentative update δ<sub>vj</sub>
@param columnMajor the column major vector array. May be null if using
the im... | java | private double tenativeUpdate(final Vec[] columnMajor, final int j, final double w_j, final double[] y, final double[] r, final double lambda, final double s, final double[] delta)
{
double numer = 0, denom = 0;
if (columnMajor != null)
{
Vec col_j = columnMajor[j];
i... | [
"private",
"double",
"tenativeUpdate",
"(",
"final",
"Vec",
"[",
"]",
"columnMajor",
",",
"final",
"int",
"j",
",",
"final",
"double",
"w_j",
",",
"final",
"double",
"[",
"]",
"y",
",",
"final",
"double",
"[",
"]",
"r",
",",
"final",
"double",
"lambda"... | Gets the tentative update δ<sub>vj</sub>
@param columnMajor the column major vector array. May be null if using
the implicit bias term
@param j the column to work on
@param w_j the value of the coefficient, used only under Gaussian prior
@param y the array of label values
@param r the array of r values
@param la... | [
"Gets",
"the",
"tentative",
"update",
"&delta",
";",
"<sub",
">",
"vj<",
"/",
"sub",
">"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/BBR.java#L515-L546 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/CmsGalleryControllerHandler.java | CmsGalleryControllerHandler.setTypesTabContent | public void setTypesTabContent(List<CmsResourceTypeBean> typeInfos, List<String> selectedTypes) {
"""
Sets the list content of the types tab.<p>
@param typeInfos the type info beans
@param selectedTypes the selected types
"""
m_galleryDialog.getTypesTab().fillContent(typeInfos, selectedTypes);
... | java | public void setTypesTabContent(List<CmsResourceTypeBean> typeInfos, List<String> selectedTypes) {
m_galleryDialog.getTypesTab().fillContent(typeInfos, selectedTypes);
} | [
"public",
"void",
"setTypesTabContent",
"(",
"List",
"<",
"CmsResourceTypeBean",
">",
"typeInfos",
",",
"List",
"<",
"String",
">",
"selectedTypes",
")",
"{",
"m_galleryDialog",
".",
"getTypesTab",
"(",
")",
".",
"fillContent",
"(",
"typeInfos",
",",
"selectedTy... | Sets the list content of the types tab.<p>
@param typeInfos the type info beans
@param selectedTypes the selected types | [
"Sets",
"the",
"list",
"content",
"of",
"the",
"types",
"tab",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryControllerHandler.java#L460-L463 |
elvishew/xLog | library/src/main/java/com/elvishew/xlog/printer/AndroidPrinter.java | AndroidPrinter.printChunk | void printChunk(int logLevel, String tag, String msg) {
"""
Print single chunk of log in new line.
@param logLevel the level of log
@param tag the tag of log
@param msg the msg of log
"""
android.util.Log.println(logLevel, tag, msg);
} | java | void printChunk(int logLevel, String tag, String msg) {
android.util.Log.println(logLevel, tag, msg);
} | [
"void",
"printChunk",
"(",
"int",
"logLevel",
",",
"String",
"tag",
",",
"String",
"msg",
")",
"{",
"android",
".",
"util",
".",
"Log",
".",
"println",
"(",
"logLevel",
",",
"tag",
",",
"msg",
")",
";",
"}"
] | Print single chunk of log in new line.
@param logLevel the level of log
@param tag the tag of log
@param msg the msg of log | [
"Print",
"single",
"chunk",
"of",
"log",
"in",
"new",
"line",
"."
] | train | https://github.com/elvishew/xLog/blob/c6fb95555ce619d3e527f5ba6c45d4d247c5a838/library/src/main/java/com/elvishew/xlog/printer/AndroidPrinter.java#L103-L105 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsPushButton.java | CmsPushButton.setDownFace | public void setDownFace(String text, String imageClass) {
"""
Sets the down face text and image.<p>
@param text the down face text to set, set to <code>null</code> to not show any
@param imageClass the down face image class to use, set to <code>null</code> to not show any
"""
m_downImageClass = im... | java | public void setDownFace(String text, String imageClass) {
m_downImageClass = imageClass;
getDownFace().setHTML(getFaceHtml(text, imageClass));
} | [
"public",
"void",
"setDownFace",
"(",
"String",
"text",
",",
"String",
"imageClass",
")",
"{",
"m_downImageClass",
"=",
"imageClass",
";",
"getDownFace",
"(",
")",
".",
"setHTML",
"(",
"getFaceHtml",
"(",
"text",
",",
"imageClass",
")",
")",
";",
"}"
] | Sets the down face text and image.<p>
@param text the down face text to set, set to <code>null</code> to not show any
@param imageClass the down face image class to use, set to <code>null</code> to not show any | [
"Sets",
"the",
"down",
"face",
"text",
"and",
"image",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsPushButton.java#L315-L319 |
padrig64/ValidationFramework | validationframework-core/src/main/java/com/google/code/validationframework/base/validator/ResultCollectorValidator.java | ResultCollectorValidator.processData | protected void processData(Collection<RI> data) {
"""
Validates the specified data all rules.
@param data Data to be validated against all rules.
"""
// Check data against all rules
for (Rule<Collection<RI>, RO> rule : rules) {
processResult(rule.validate(data));
}
} | java | protected void processData(Collection<RI> data) {
// Check data against all rules
for (Rule<Collection<RI>, RO> rule : rules) {
processResult(rule.validate(data));
}
} | [
"protected",
"void",
"processData",
"(",
"Collection",
"<",
"RI",
">",
"data",
")",
"{",
"// Check data against all rules",
"for",
"(",
"Rule",
"<",
"Collection",
"<",
"RI",
">",
",",
"RO",
">",
"rule",
":",
"rules",
")",
"{",
"processResult",
"(",
"rule",... | Validates the specified data all rules.
@param data Data to be validated against all rules. | [
"Validates",
"the",
"specified",
"data",
"all",
"rules",
"."
] | train | https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-core/src/main/java/com/google/code/validationframework/base/validator/ResultCollectorValidator.java#L115-L120 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/NonBlockingProperties.java | NonBlockingProperties.getProperty | @Nullable
public String getProperty (@Nullable final String sKey, @Nullable final String sDefaultValue) {
"""
Searches for the property with the specified key in this property list. If
the key is not found in this property list, the default property list, and
its defaults, recursively, are then checked. The me... | java | @Nullable
public String getProperty (@Nullable final String sKey, @Nullable final String sDefaultValue)
{
final String sValue = getProperty (sKey);
return sValue == null ? sDefaultValue : sValue;
} | [
"@",
"Nullable",
"public",
"String",
"getProperty",
"(",
"@",
"Nullable",
"final",
"String",
"sKey",
",",
"@",
"Nullable",
"final",
"String",
"sDefaultValue",
")",
"{",
"final",
"String",
"sValue",
"=",
"getProperty",
"(",
"sKey",
")",
";",
"return",
"sValue... | Searches for the property with the specified key in this property list. If
the key is not found in this property list, the default property list, and
its defaults, recursively, are then checked. The method returns the default
value argument if the property is not found.
@param sKey
the map key.
@param sDefaultValue
a ... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/NonBlockingProperties.java#L893-L898 |
stripe/stripe-java | src/main/java/com/stripe/model/Dispute.java | Dispute.close | public Dispute close() throws StripeException {
"""
Closing the dispute for a charge indicates that you do not have any evidence to submit and are
essentially dismissing the dispute, acknowledging it as lost.
<p>The status of the dispute will change from <code>needs_response</code> to <code>lost</code>.
<em>C... | java | public Dispute close() throws StripeException {
return close((Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"Dispute",
"close",
"(",
")",
"throws",
"StripeException",
"{",
"return",
"close",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Closing the dispute for a charge indicates that you do not have any evidence to submit and are
essentially dismissing the dispute, acknowledging it as lost.
<p>The status of the dispute will change from <code>needs_response</code> to <code>lost</code>.
<em>Closing a dispute is irreversible</em>. | [
"Closing",
"the",
"dispute",
"for",
"a",
"charge",
"indicates",
"that",
"you",
"do",
"not",
"have",
"any",
"evidence",
"to",
"submit",
"and",
"are",
"essentially",
"dismissing",
"the",
"dispute",
"acknowledging",
"it",
"as",
"lost",
"."
] | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Dispute.java#L265-L267 |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendarWeek.java | ProjectCalendarWeek.setWorkingDay | public void setWorkingDay(Day day, DayType working) {
"""
This is a convenience method provided to allow a day to be set
as working or non-working, by using the day number to
identify the required day.
@param day required day
@param working flag indicating if the day is a working day
"""
DayType va... | java | public void setWorkingDay(Day day, DayType working)
{
DayType value;
if (working == null)
{
if (isDerived())
{
value = DayType.DEFAULT;
}
else
{
value = DayType.WORKING;
}
}
else
{
value = work... | [
"public",
"void",
"setWorkingDay",
"(",
"Day",
"day",
",",
"DayType",
"working",
")",
"{",
"DayType",
"value",
";",
"if",
"(",
"working",
"==",
"null",
")",
"{",
"if",
"(",
"isDerived",
"(",
")",
")",
"{",
"value",
"=",
"DayType",
".",
"DEFAULT",
";"... | This is a convenience method provided to allow a day to be set
as working or non-working, by using the day number to
identify the required day.
@param day required day
@param working flag indicating if the day is a working day | [
"This",
"is",
"a",
"convenience",
"method",
"provided",
"to",
"allow",
"a",
"day",
"to",
"be",
"set",
"as",
"working",
"or",
"non",
"-",
"working",
"by",
"using",
"the",
"day",
"number",
"to",
"identify",
"the",
"required",
"day",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarWeek.java#L307-L328 |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-container-rbc-client/src/main/java/org/ops4j/pax/exam/rbc/client/intern/RemoteBundleContextClientImpl.java | RemoteBundleContextClientImpl.getRemoteBundleContext | private synchronized RemoteBundleContext getRemoteBundleContext() {
"""
Looks up the {@link RemoteBundleContext} via RMI. The lookup will timeout in the specified
number of millis.
@return remote bundle context
"""
if (remoteBundleContext == null) {
// !! Absolutely necesary for RMI cl... | java | private synchronized RemoteBundleContext getRemoteBundleContext() {
if (remoteBundleContext == null) {
// !! Absolutely necesary for RMI class loading to work
// TODO maybe use ContextClassLoaderUtils.doWithClassLoader
Thread.currentThread().setContextClassLoader(this.getCla... | [
"private",
"synchronized",
"RemoteBundleContext",
"getRemoteBundleContext",
"(",
")",
"{",
"if",
"(",
"remoteBundleContext",
"==",
"null",
")",
"{",
"// !! Absolutely necesary for RMI class loading to work",
"// TODO maybe use ContextClassLoaderUtils.doWithClassLoader",
"Thread",
"... | Looks up the {@link RemoteBundleContext} via RMI. The lookup will timeout in the specified
number of millis.
@return remote bundle context | [
"Looks",
"up",
"the",
"{",
"@link",
"RemoteBundleContext",
"}",
"via",
"RMI",
".",
"The",
"lookup",
"will",
"timeout",
"in",
"the",
"specified",
"number",
"of",
"millis",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-container-rbc-client/src/main/java/org/ops4j/pax/exam/rbc/client/intern/RemoteBundleContextClientImpl.java#L226-L260 |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/interceptor/LoggingInterceptorSupport.java | LoggingInterceptorSupport.logRequest | protected void logRequest(String logMessage, MessageContext messageContext, boolean incoming) throws TransformerException {
"""
Logs request message from message context. SOAP messages get logged with envelope transformation
other messages with serialization.
@param logMessage
@param messageContext
@param in... | java | protected void logRequest(String logMessage, MessageContext messageContext, boolean incoming) throws TransformerException {
if (messageContext.getRequest() instanceof SoapMessage) {
logSoapMessage(logMessage, (SoapMessage) messageContext.getRequest(), incoming);
} else {
logWebSe... | [
"protected",
"void",
"logRequest",
"(",
"String",
"logMessage",
",",
"MessageContext",
"messageContext",
",",
"boolean",
"incoming",
")",
"throws",
"TransformerException",
"{",
"if",
"(",
"messageContext",
".",
"getRequest",
"(",
")",
"instanceof",
"SoapMessage",
")... | Logs request message from message context. SOAP messages get logged with envelope transformation
other messages with serialization.
@param logMessage
@param messageContext
@param incoming
@throws TransformerException | [
"Logs",
"request",
"message",
"from",
"message",
"context",
".",
"SOAP",
"messages",
"get",
"logged",
"with",
"envelope",
"transformation",
"other",
"messages",
"with",
"serialization",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/interceptor/LoggingInterceptorSupport.java#L62-L68 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.isValidAddress | private static boolean isValidAddress(InetAddress address, int timeoutMs) throws IOException {
"""
Tests if the address is externally resolvable. Address must not be wildcard, link local,
loopback address, non-IPv4, or other unreachable addresses.
@param address The testing address
@param timeoutMs Timeout in... | java | private static boolean isValidAddress(InetAddress address, int timeoutMs) throws IOException {
return !address.isAnyLocalAddress() && !address.isLinkLocalAddress()
&& !address.isLoopbackAddress() && address.isReachable(timeoutMs)
&& (address instanceof Inet4Address);
} | [
"private",
"static",
"boolean",
"isValidAddress",
"(",
"InetAddress",
"address",
",",
"int",
"timeoutMs",
")",
"throws",
"IOException",
"{",
"return",
"!",
"address",
".",
"isAnyLocalAddress",
"(",
")",
"&&",
"!",
"address",
".",
"isLinkLocalAddress",
"(",
")",
... | Tests if the address is externally resolvable. Address must not be wildcard, link local,
loopback address, non-IPv4, or other unreachable addresses.
@param address The testing address
@param timeoutMs Timeout in milliseconds to use for checking that a possible local IP is
reachable
@return a {@code boolean} indicating... | [
"Tests",
"if",
"the",
"address",
"is",
"externally",
"resolvable",
".",
"Address",
"must",
"not",
"be",
"wildcard",
"link",
"local",
"loopback",
"address",
"non",
"-",
"IPv4",
"or",
"other",
"unreachable",
"addresses",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L525-L529 |
enriquedacostacambio/iotake-suller | iotake-sullerj/src/main/java/com/iotake/suller/sullerj/binder/server/DocumentBinderInjector.java | DocumentBinderInjector.inject | public static SolrServer inject(SolrServer server, DocumentObjectBinder binder) {
"""
Sets the given binder to the given server's {@link SolrServer#binder}
@param server
The server to be altered. Cannot be null.
@param binder
The binder to be set. Cannot be null.
@return the server.
@throws IllegalArgument... | java | public static SolrServer inject(SolrServer server, DocumentObjectBinder binder) {
checkNotNull(server, "Server cannot be null.");
checkNotNull(binder, "Binder cannot be null.");
Field binderField;
try {
binderField = SolrServer.class.getDeclaredField(BINDER_FIELD_NAME);
binderField.setAccess... | [
"public",
"static",
"SolrServer",
"inject",
"(",
"SolrServer",
"server",
",",
"DocumentObjectBinder",
"binder",
")",
"{",
"checkNotNull",
"(",
"server",
",",
"\"Server cannot be null.\"",
")",
";",
"checkNotNull",
"(",
"binder",
",",
"\"Binder cannot be null.\"",
")",... | Sets the given binder to the given server's {@link SolrServer#binder}
@param server
The server to be altered. Cannot be null.
@param binder
The binder to be set. Cannot be null.
@return the server.
@throws IllegalArgumentException
if server or binder are null.
@throws UnsupportedOperationException
if unable to find, a... | [
"Sets",
"the",
"given",
"binder",
"to",
"the",
"given",
"server",
"s",
"{",
"@link",
"SolrServer#binder",
"}"
] | train | https://github.com/enriquedacostacambio/iotake-suller/blob/d2af5c23207013107823892e0c586d455bf62a6a/iotake-sullerj/src/main/java/com/iotake/suller/sullerj/binder/server/DocumentBinderInjector.java#L53-L73 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.convertBlob | public static Object convertBlob(Object blob, InputStream input) throws SQLException {
"""
Transfers data from InputStream into sql.Blob
@param blob sql.Blob which would be filled
@param input InputStream
@return sql.Blob from InputStream
@throws SQLException
"""
return convertBlob(blob, toByteA... | java | public static Object convertBlob(Object blob, InputStream input) throws SQLException {
return convertBlob(blob, toByteArray(input));
} | [
"public",
"static",
"Object",
"convertBlob",
"(",
"Object",
"blob",
",",
"InputStream",
"input",
")",
"throws",
"SQLException",
"{",
"return",
"convertBlob",
"(",
"blob",
",",
"toByteArray",
"(",
"input",
")",
")",
";",
"}"
] | Transfers data from InputStream into sql.Blob
@param blob sql.Blob which would be filled
@param input InputStream
@return sql.Blob from InputStream
@throws SQLException | [
"Transfers",
"data",
"from",
"InputStream",
"into",
"sql",
".",
"Blob"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L149-L151 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/Formula.java | Formula.apply | public <T> T apply(final FormulaFunction<T> function, final boolean cache) {
"""
Applies a given function on this formula and returns the result.
@param function the function
@param cache indicates whether the result should be cached in this formula's cache
@param <T> the result type of the function
@r... | java | public <T> T apply(final FormulaFunction<T> function, final boolean cache) {
return function.apply(this, cache);
} | [
"public",
"<",
"T",
">",
"T",
"apply",
"(",
"final",
"FormulaFunction",
"<",
"T",
">",
"function",
",",
"final",
"boolean",
"cache",
")",
"{",
"return",
"function",
".",
"apply",
"(",
"this",
",",
"cache",
")",
";",
"}"
] | Applies a given function on this formula and returns the result.
@param function the function
@param cache indicates whether the result should be cached in this formula's cache
@param <T> the result type of the function
@return the result of the function application | [
"Applies",
"a",
"given",
"function",
"on",
"this",
"formula",
"and",
"returns",
"the",
"result",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/Formula.java#L317-L319 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java | ReviewsImpl.createReviewsWithServiceResponseAsync | public Observable<ServiceResponse<List<String>>> createReviewsWithServiceResponseAsync(String teamName, String urlContentType, List<CreateReviewBodyItem> createReviewBody, CreateReviewsOptionalParameter createReviewsOptionalParameter) {
"""
The reviews created would show up for Reviewers on your team. As Reviewers... | java | public Observable<ServiceResponse<List<String>>> createReviewsWithServiceResponseAsync(String teamName, String urlContentType, List<CreateReviewBodyItem> createReviewBody, CreateReviewsOptionalParameter createReviewsOptionalParameter) {
if (this.client.baseUrl() == null) {
throw new IllegalArgumentE... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"String",
">",
">",
">",
"createReviewsWithServiceResponseAsync",
"(",
"String",
"teamName",
",",
"String",
"urlContentType",
",",
"List",
"<",
"CreateReviewBodyItem",
">",
"createReviewBody",
",",
"C... | The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.
<h3>CallBack Schemas </h3>
<h4>Review Completion CallBack Sample</h4>
<p>
{<br/>
"ReviewId": "<R... | [
"The",
"reviews",
"created",
"would",
"show",
"up",
"for",
"Reviewers",
"on",
"your",
"team",
".",
"As",
"Reviewers",
"complete",
"reviewing",
"results",
"of",
"the",
"Review",
"would",
"be",
"POSTED",
"(",
"i",
".",
"e",
".",
"HTTP",
"POST",
")",
"on",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L444-L461 |
m-szalik/javamail | javamail-jms-transport/src/main/java/org/jsoftware/javamail/SmtpJmsTransport.java | SmtpJmsTransport.createJmsMessage | private javax.jms.Message createJmsMessage(QueueSession queueSession, Message msg, Address[] addresses) throws JMSException, MessagingException {
"""
Create javax.jms.Message for javax.mail.Message
JMS message contains:
<ul>
<li>protocolToUse (String) - destination / final Transport</li>
<li>addresses (array j... | java | private javax.jms.Message createJmsMessage(QueueSession queueSession, Message msg, Address[] addresses) throws JMSException, MessagingException {
BytesMessage jms = queueSession.createBytesMessage();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
ObjectOutputStream oos = new ObjectOutputStream... | [
"private",
"javax",
".",
"jms",
".",
"Message",
"createJmsMessage",
"(",
"QueueSession",
"queueSession",
",",
"Message",
"msg",
",",
"Address",
"[",
"]",
"addresses",
")",
"throws",
"JMSException",
",",
"MessagingException",
"{",
"BytesMessage",
"jms",
"=",
"que... | Create javax.jms.Message for javax.mail.Message
JMS message contains:
<ul>
<li>protocolToUse (String) - destination / final Transport</li>
<li>addresses (array javax.mail.Address) - who to send to</li>
<li>message (object javax.mail.Message) - message content</li>
</ul> | [
"Create",
"javax",
".",
"jms",
".",
"Message",
"for",
"javax",
".",
"mail",
".",
"Message",
"JMS",
"message",
"contains",
":",
"<ul",
">",
"<li",
">",
"protocolToUse",
"(",
"String",
")",
"-",
"destination",
"/",
"final",
"Transport<",
"/",
"li",
">",
... | train | https://github.com/m-szalik/javamail/blob/4ab516d7c89687008b42af9defa8fdaa71a01aa7/javamail-jms-transport/src/main/java/org/jsoftware/javamail/SmtpJmsTransport.java#L155-L173 |
btc-ag/redg | redg-generator/src/main/java/com/btc/redg/generator/CodeGenerator.java | CodeGenerator.generateCodeForTable | public String generateCodeForTable(final TableModel table, final boolean enableVisualizationSupport) {
"""
Generates a java code file that can later be used to generate SQL insert strings for the given extractor table.
All the data are taken from the {@link TableModel}, which was filled by a {@link com.btc.redg.g... | java | public String generateCodeForTable(final TableModel table, final boolean enableVisualizationSupport) {
final ST template = this.stGroup.getInstanceOf("tableClass");
LOG.debug("Filling template...");
template.add("table", table);
LOG.debug("Package is {} | Class name is {}", table.get... | [
"public",
"String",
"generateCodeForTable",
"(",
"final",
"TableModel",
"table",
",",
"final",
"boolean",
"enableVisualizationSupport",
")",
"{",
"final",
"ST",
"template",
"=",
"this",
".",
"stGroup",
".",
"getInstanceOf",
"(",
"\"tableClass\"",
")",
";",
"LOG",
... | Generates a java code file that can later be used to generate SQL insert strings for the given extractor table.
All the data are taken from the {@link TableModel}, which was filled by a {@link com.btc.redg.generator.extractor.TableExtractor} (normally used by the
{@link com.btc.redg.generator.extractor.MetadataExtracto... | [
"Generates",
"a",
"java",
"code",
"file",
"that",
"can",
"later",
"be",
"used",
"to",
"generate",
"SQL",
"insert",
"strings",
"for",
"the",
"given",
"extractor",
"table",
".",
"All",
"the",
"data",
"are",
"taken",
"from",
"the",
"{",
"@link",
"TableModel",... | train | https://github.com/btc-ag/redg/blob/416a68639d002512cabfebff09afd2e1909e27df/redg-generator/src/main/java/com/btc/redg/generator/CodeGenerator.java#L165-L189 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/TemplateList.java | TemplateList.putHead | private void putHead(String key, TemplateSubPatternAssociation assoc) {
"""
Get the head of the assocation list that is keyed by target.
@param key
@param assoc
"""
if (key.equals(PsuedoNames.PSEUDONAME_TEXT))
m_textPatterns = assoc;
else if (key.equals(PsuedoNames.PSEUDONAME_ROOT))
m_... | java | private void putHead(String key, TemplateSubPatternAssociation assoc)
{
if (key.equals(PsuedoNames.PSEUDONAME_TEXT))
m_textPatterns = assoc;
else if (key.equals(PsuedoNames.PSEUDONAME_ROOT))
m_docPatterns = assoc;
else if (key.equals(PsuedoNames.PSEUDONAME_COMMENT))
m_commentPatterns = ... | [
"private",
"void",
"putHead",
"(",
"String",
"key",
",",
"TemplateSubPatternAssociation",
"assoc",
")",
"{",
"if",
"(",
"key",
".",
"equals",
"(",
"PsuedoNames",
".",
"PSEUDONAME_TEXT",
")",
")",
"m_textPatterns",
"=",
"assoc",
";",
"else",
"if",
"(",
"key",... | Get the head of the assocation list that is keyed by target.
@param key
@param assoc | [
"Get",
"the",
"head",
"of",
"the",
"assocation",
"list",
"that",
"is",
"keyed",
"by",
"target",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/TemplateList.java#L842-L853 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/normalization/KerasBatchNormalization.java | KerasBatchNormalization.getBetaRegularizerFromConfig | private void getBetaRegularizerFromConfig(Map<String, Object> layerConfig, boolean enforceTrainingConfig)
throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException {
"""
Get BatchNormalization beta regularizer from Keras layer configuration. Currently unsupported.
@param laye... | java | private void getBetaRegularizerFromConfig(Map<String, Object> layerConfig, boolean enforceTrainingConfig)
throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
if... | [
"private",
"void",
"getBetaRegularizerFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
",",
"boolean",
"enforceTrainingConfig",
")",
"throws",
"UnsupportedKerasConfigurationException",
",",
"InvalidKerasConfigurationException",
"{",
"Map",
"<",
"... | Get BatchNormalization beta regularizer from Keras layer configuration. Currently unsupported.
@param layerConfig dictionary containing Keras layer configuration
@return Batchnormalization beta regularizer
@throws InvalidKerasConfigurationException Invalid Keras config | [
"Get",
"BatchNormalization",
"beta",
"regularizer",
"from",
"Keras",
"layer",
"configuration",
".",
"Currently",
"unsupported",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/normalization/KerasBatchNormalization.java#L305-L315 |
aws/aws-sdk-java | aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/util/BootstrapActions.java | BootstrapActions.newRunIf | public BootstrapActionConfig newRunIf(String condition, BootstrapActionConfig config) {
"""
Create a new run-if bootstrap action which lets you conditionally run bootstrap actions.
@param condition The condition to evaluate, if true the bootstrap action executes.
@param config The bootstrap action to execute in ... | java | public BootstrapActionConfig newRunIf(String condition, BootstrapActionConfig config) {
List<String> args = config.getScriptBootstrapAction().getArgs();
args.add(0, condition);
args.add(1, config.getScriptBootstrapAction().getPath());
return new BootstrapActionConfig()
.withName("Run If, " + conf... | [
"public",
"BootstrapActionConfig",
"newRunIf",
"(",
"String",
"condition",
",",
"BootstrapActionConfig",
"config",
")",
"{",
"List",
"<",
"String",
">",
"args",
"=",
"config",
".",
"getScriptBootstrapAction",
"(",
")",
".",
"getArgs",
"(",
")",
";",
"args",
".... | Create a new run-if bootstrap action which lets you conditionally run bootstrap actions.
@param condition The condition to evaluate, if true the bootstrap action executes.
@param config The bootstrap action to execute in case of successful evaluation.
@return A BootstrapActionConfig to be provided when running a job fl... | [
"Create",
"a",
"new",
"run",
"-",
"if",
"bootstrap",
"action",
"which",
"lets",
"you",
"conditionally",
"run",
"bootstrap",
"actions",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/util/BootstrapActions.java#L77-L87 |
groovy/groovy-core | src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.extractPropertyNameFromMethodName | public static String extractPropertyNameFromMethodName(String prefix, String methodName) {
"""
Given a method name and a prefix, returns the name of the property that should be looked up,
following the java beans rules. For example, "getName" would return "name", while
"getFullName" would return "fullName".
If ... | java | public static String extractPropertyNameFromMethodName(String prefix, String methodName) {
if (prefix==null || methodName==null) return null;
if (methodName.startsWith(prefix) && prefix.length()<methodName.length()) {
String result = methodName.substring(prefix.length());
String ... | [
"public",
"static",
"String",
"extractPropertyNameFromMethodName",
"(",
"String",
"prefix",
",",
"String",
"methodName",
")",
"{",
"if",
"(",
"prefix",
"==",
"null",
"||",
"methodName",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"methodName",
".",
... | Given a method name and a prefix, returns the name of the property that should be looked up,
following the java beans rules. For example, "getName" would return "name", while
"getFullName" would return "fullName".
If the prefix is not found, returns null.
@param prefix the method name prefix ("get", "is", "set", ...)
@... | [
"Given",
"a",
"method",
"name",
"and",
"a",
"prefix",
"returns",
"the",
"name",
"of",
"the",
"property",
"that",
"should",
"be",
"looked",
"up",
"following",
"the",
"java",
"beans",
"rules",
".",
"For",
"example",
"getName",
"would",
"return",
"name",
"whi... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L3862-L3870 |
wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/util/ByteUtils.java | ByteUtils.fromHexString | public static byte[] fromHexString(String hexStr) {
"""
Converts a hexadecimal string into byte array.
@param hexStr
a hexadecimal string
@return byte array
@throws IllegalArgumentException
if hexadecimal string is invalid
"""
if (!hexStr.matches("^[0-9A-Fa-f]*$"))
throw new IllegalArgumentExc... | java | public static byte[] fromHexString(String hexStr) {
if (!hexStr.matches("^[0-9A-Fa-f]*$"))
throw new IllegalArgumentException("Invalid hexadecimal string");
if (hexStr.isEmpty()) return new byte[0];
int complementary = hexStr.length() % 2;
if (complementary != 0) hexStr += "0";
return rjust(n... | [
"public",
"static",
"byte",
"[",
"]",
"fromHexString",
"(",
"String",
"hexStr",
")",
"{",
"if",
"(",
"!",
"hexStr",
".",
"matches",
"(",
"\"^[0-9A-Fa-f]*$\"",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid hexadecimal string\"",
")",
";",
... | Converts a hexadecimal string into byte array.
@param hexStr
a hexadecimal string
@return byte array
@throws IllegalArgumentException
if hexadecimal string is invalid | [
"Converts",
"a",
"hexadecimal",
"string",
"into",
"byte",
"array",
"."
] | train | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/util/ByteUtils.java#L539-L547 |
sarxos/win-registry | src/main/java/com/github/sarxos/winreg/WindowsRegistry.java | WindowsRegistry.readString | public String readString(HKey hk, String key, String valueName) throws RegistryException {
"""
Read a value from key and value name
@param hk the HKEY
@param key the key
@param valueName the value name
@return String value
@throws RegistryException when something is not right
"""
return readString(hk... | java | public String readString(HKey hk, String key, String valueName) throws RegistryException {
return readString(hk, key, valueName, null);
} | [
"public",
"String",
"readString",
"(",
"HKey",
"hk",
",",
"String",
"key",
",",
"String",
"valueName",
")",
"throws",
"RegistryException",
"{",
"return",
"readString",
"(",
"hk",
",",
"key",
",",
"valueName",
",",
"null",
")",
";",
"}"
] | Read a value from key and value name
@param hk the HKEY
@param key the key
@param valueName the value name
@return String value
@throws RegistryException when something is not right | [
"Read",
"a",
"value",
"from",
"key",
"and",
"value",
"name"
] | train | https://github.com/sarxos/win-registry/blob/5ccbe2157ae0ee894de7c41bec4bd7b1e0f5c437/src/main/java/com/github/sarxos/winreg/WindowsRegistry.java#L45-L47 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java | Configurer.getImplementation | public final <T> T getImplementation(ClassLoader loader, Class<T> type, String... path) {
"""
Get the class implementation from its name. Default constructor must be available.
@param <T> The instance type.
@param loader The class loader to use.
@param type The class type.
@param path The node path.
@return... | java | public final <T> T getImplementation(ClassLoader loader, Class<T> type, String... path)
{
return getImplementation(loader, type, new Class<?>[0], Collections.emptyList(), path);
} | [
"public",
"final",
"<",
"T",
">",
"T",
"getImplementation",
"(",
"ClassLoader",
"loader",
",",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"...",
"path",
")",
"{",
"return",
"getImplementation",
"(",
"loader",
",",
"type",
",",
"new",
"Class",
"<",
... | Get the class implementation from its name. Default constructor must be available.
@param <T> The instance type.
@param loader The class loader to use.
@param type The class type.
@param path The node path.
@return The typed class instance.
@throws LionEngineException If invalid class. | [
"Get",
"the",
"class",
"implementation",
"from",
"its",
"name",
".",
"Default",
"constructor",
"must",
"be",
"available",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java#L310-L313 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addErrorsInvalidQueryUnsupportedSortOrder | public FessMessages addErrorsInvalidQueryUnsupportedSortOrder(String property, String arg0) {
"""
Add the created action message for the key 'errors.invalid_query_unsupported_sort_order' with parameters.
<pre>
message: The given sort order ({0}) is not supported.
</pre>
@param property The property name for th... | java | public FessMessages addErrorsInvalidQueryUnsupportedSortOrder(String property, String arg0) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_invalid_query_unsupported_sort_order, arg0));
return this;
} | [
"public",
"FessMessages",
"addErrorsInvalidQueryUnsupportedSortOrder",
"(",
"String",
"property",
",",
"String",
"arg0",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"ERRORS_invalid_query_unsupport... | Add the created action message for the key 'errors.invalid_query_unsupported_sort_order' with parameters.
<pre>
message: The given sort order ({0}) is not supported.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull)
@return this. (NotNull) | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"errors",
".",
"invalid_query_unsupported_sort_order",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"The",
"given",
"sort",
"order",
"(",
"{",
"0",
"}",
")",
"is",
"not",
"supporte... | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L2080-L2084 |
wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/util/ByteUtils.java | ByteUtils.toBinaryString | public static String toBinaryString(byte[] bytes, boolean isMSB) {
"""
Converts a byte array to a binary String.
@param bytes
a byte array
@param isMSB
true if MSB, false if LSB
@return binary String
"""
StringBuilder sb = new StringBuilder();
for (byte b : bytes) {
String binary = String.... | java | public static String toBinaryString(byte[] bytes, boolean isMSB) {
StringBuilder sb = new StringBuilder();
for (byte b : bytes) {
String binary = String.format("%8s", Integer.toBinaryString(b & 0xFF))
.replace(' ', '0');
if (isMSB)
sb.append(binary);
else
sb.append(ne... | [
"public",
"static",
"String",
"toBinaryString",
"(",
"byte",
"[",
"]",
"bytes",
",",
"boolean",
"isMSB",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"byte",
"b",
":",
"bytes",
")",
"{",
"String",
"binary",
"... | Converts a byte array to a binary String.
@param bytes
a byte array
@param isMSB
true if MSB, false if LSB
@return binary String | [
"Converts",
"a",
"byte",
"array",
"to",
"a",
"binary",
"String",
"."
] | train | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/util/ByteUtils.java#L463-L474 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformNoOp.java | TransformNoOp.transformOut | @Override
public Integer transformOut(JdbcCallableStatementFactory jcsf, Integer attrOut) throws CpoException {
"""
Transforms the data from the class attribute to the object required by the datasource. The type of the attrOut
parameter and the type of the return value must change to match the types being conve... | java | @Override
public Integer transformOut(JdbcCallableStatementFactory jcsf, Integer attrOut) throws CpoException {
logger.debug("Inside TransformNoOp::transformOut(JdbcCallableStatementFactory, " + attrOut + ");");
return attrOut;
} | [
"@",
"Override",
"public",
"Integer",
"transformOut",
"(",
"JdbcCallableStatementFactory",
"jcsf",
",",
"Integer",
"attrOut",
")",
"throws",
"CpoException",
"{",
"logger",
".",
"debug",
"(",
"\"Inside TransformNoOp::transformOut(JdbcCallableStatementFactory, \"",
"+",
"attr... | Transforms the data from the class attribute to the object required by the datasource. The type of the attrOut
parameter and the type of the return value must change to match the types being converted. Reflection is used to
true everything up at runtime.
e.g public Blob transformOut(JdbcCallableStatementFactory jcsf, ... | [
"Transforms",
"the",
"data",
"from",
"the",
"class",
"attribute",
"to",
"the",
"object",
"required",
"by",
"the",
"datasource",
".",
"The",
"type",
"of",
"the",
"attrOut",
"parameter",
"and",
"the",
"type",
"of",
"the",
"return",
"value",
"must",
"change",
... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformNoOp.java#L74-L78 |
BoltsFramework/Bolts-Android | bolts-tasks/src/main/java/bolts/Task.java | Task.waitForCompletion | public boolean waitForCompletion(long duration, TimeUnit timeUnit) throws InterruptedException {
"""
Blocks until the task is complete or times out.
@return {@code true} if the task completed (has a result, an error, or was cancelled).
{@code false} otherwise.
"""
synchronized (lock) {
if (!isCompl... | java | public boolean waitForCompletion(long duration, TimeUnit timeUnit) throws InterruptedException {
synchronized (lock) {
if (!isCompleted()) {
lock.wait(timeUnit.toMillis(duration));
}
return isCompleted();
}
} | [
"public",
"boolean",
"waitForCompletion",
"(",
"long",
"duration",
",",
"TimeUnit",
"timeUnit",
")",
"throws",
"InterruptedException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"!",
"isCompleted",
"(",
")",
")",
"{",
"lock",
".",
"wait",
"(",
... | Blocks until the task is complete or times out.
@return {@code true} if the task completed (has a result, an error, or was cancelled).
{@code false} otherwise. | [
"Blocks",
"until",
"the",
"task",
"is",
"complete",
"or",
"times",
"out",
"."
] | train | https://github.com/BoltsFramework/Bolts-Android/blob/54e9cb8bdd4950aa4d418dcbc0ea65414762aef5/bolts-tasks/src/main/java/bolts/Task.java#L189-L196 |
eclipse/hawkbit | hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java | AmqpMessageHandlerService.registerTarget | private void registerTarget(final Message message, final String virtualHost) {
"""
Method to create a new target or to find the target if it already exists.
@param targetID
the ID of the target/thing
@param ip
the ip of the target/thing
"""
final String thingId = getStringHeaderKey(message, Messa... | java | private void registerTarget(final Message message, final String virtualHost) {
final String thingId = getStringHeaderKey(message, MessageHeaderKey.THING_ID, "ThingId is null");
final String replyTo = message.getMessageProperties().getReplyTo();
if (StringUtils.isEmpty(replyTo)) {
lo... | [
"private",
"void",
"registerTarget",
"(",
"final",
"Message",
"message",
",",
"final",
"String",
"virtualHost",
")",
"{",
"final",
"String",
"thingId",
"=",
"getStringHeaderKey",
"(",
"message",
",",
"MessageHeaderKey",
".",
"THING_ID",
",",
"\"ThingId is null\"",
... | Method to create a new target or to find the target if it already exists.
@param targetID
the ID of the target/thing
@param ip
the ip of the target/thing | [
"Method",
"to",
"create",
"a",
"new",
"target",
"or",
"to",
"find",
"the",
"target",
"if",
"it",
"already",
"exists",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java#L182-L195 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Client.java | ContainerAnalysisV1Beta1Client.updateScanConfig | public final ScanConfig updateScanConfig(ScanConfigName name, ScanConfig scanConfig) {
"""
Updates the specified scan configuration.
<p>Sample code:
<pre><code>
try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
ScanConfigName name = ScanConfigNa... | java | public final ScanConfig updateScanConfig(ScanConfigName name, ScanConfig scanConfig) {
UpdateScanConfigRequest request =
UpdateScanConfigRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setScanConfig(scanConfig)
.build();
return updateScanConfig(... | [
"public",
"final",
"ScanConfig",
"updateScanConfig",
"(",
"ScanConfigName",
"name",
",",
"ScanConfig",
"scanConfig",
")",
"{",
"UpdateScanConfigRequest",
"request",
"=",
"UpdateScanConfigRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
"==",
"null... | Updates the specified scan configuration.
<p>Sample code:
<pre><code>
try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
ScanConfig scanConfig = ScanConfig.newBuilder().build();
ScanConf... | [
"Updates",
"the",
"specified",
"scan",
"configuration",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Client.java#L811-L819 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java | TypeConversion.bytesToInt | public static int bytesToInt(byte[] bytes, int offset) {
"""
A utility method to convert the int from the byte array to an int.
@param bytes
The byte array containing the int.
@param offset
The index at which the int is located.
@return The int value.
"""
return ((bytes[offset + 3] & 0xFF) << 0)... | java | public static int bytesToInt(byte[] bytes, int offset) {
return ((bytes[offset + 3] & 0xFF) << 0) + ((bytes[offset + 2] & 0xFF) << 8)
+ ((bytes[offset + 1] & 0xFF) << 16) + ((bytes[offset + 0] & 0xFF) << 24);
} | [
"public",
"static",
"int",
"bytesToInt",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"return",
"(",
"(",
"bytes",
"[",
"offset",
"+",
"3",
"]",
"&",
"0xFF",
")",
"<<",
"0",
")",
"+",
"(",
"(",
"bytes",
"[",
"offset",
"+",
"2... | A utility method to convert the int from the byte array to an int.
@param bytes
The byte array containing the int.
@param offset
The index at which the int is located.
@return The int value. | [
"A",
"utility",
"method",
"to",
"convert",
"the",
"int",
"from",
"the",
"byte",
"array",
"to",
"an",
"int",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java#L33-L36 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java | DataFrameJoiner.rightOuter | public Table rightOuter(boolean allowDuplicateColumnNames, Table... tables) {
"""
Joins to the given tables assuming that they have a column of the name we're joining on
@param allowDuplicateColumnNames if {@code false} the join will fail if any columns other than the join column have the same name
if {@code t... | java | public Table rightOuter(boolean allowDuplicateColumnNames, Table... tables) {
Table joined = table;
for (Table table2 : tables) {
joined = rightOuter(table2, allowDuplicateColumnNames, columnNames);
}
return joined;
} | [
"public",
"Table",
"rightOuter",
"(",
"boolean",
"allowDuplicateColumnNames",
",",
"Table",
"...",
"tables",
")",
"{",
"Table",
"joined",
"=",
"table",
";",
"for",
"(",
"Table",
"table2",
":",
"tables",
")",
"{",
"joined",
"=",
"rightOuter",
"(",
"table2",
... | Joins to the given tables assuming that they have a column of the name we're joining on
@param allowDuplicateColumnNames if {@code false} the join will fail if any columns other than the join column have the same name
if {@code true} the join will succeed and duplicate columns are renamed
@param tables The tables to j... | [
"Joins",
"to",
"the",
"given",
"tables",
"assuming",
"that",
"they",
"have",
"a",
"column",
"of",
"the",
"name",
"we",
"re",
"joining",
"on"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L562-L568 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bos/BosClient.java | BosClient.putObject | public PutObjectResponse putObject(String bucketName, String key, InputStream input) {
"""
Uploads the specified input stream to Bos under the specified bucket and key name.
@param bucketName The name of an existing bucket, to which you have Write permission.
@param key The key under which to store the specifi... | java | public PutObjectResponse putObject(String bucketName, String key, InputStream input) {
return this.putObject(new PutObjectRequest(bucketName, key, input));
} | [
"public",
"PutObjectResponse",
"putObject",
"(",
"String",
"bucketName",
",",
"String",
"key",
",",
"InputStream",
"input",
")",
"{",
"return",
"this",
".",
"putObject",
"(",
"new",
"PutObjectRequest",
"(",
"bucketName",
",",
"key",
",",
"input",
")",
")",
"... | Uploads the specified input stream to Bos under the specified bucket and key name.
@param bucketName The name of an existing bucket, to which you have Write permission.
@param key The key under which to store the specified file.
@param input The input stream containing the value to be uploaded to Bos.
@return A PutObj... | [
"Uploads",
"the",
"specified",
"input",
"stream",
"to",
"Bos",
"under",
"the",
"specified",
"bucket",
"and",
"key",
"name",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/BosClient.java#L877-L879 |
redkale/redkale | src/org/redkale/util/ResourceFactory.java | ResourceFactory.register | public <A> A register(final boolean autoSync, final A rs) {
"""
将对象以name=""注入到资源池中,并同步已被注入的资源
@param <A> 泛型
@param autoSync 是否同步已被注入的资源
@param rs 资源对象
@return 旧资源对象
"""
if (rs == null) return null;
return (A) register(autoSync, "", rs);
} | java | public <A> A register(final boolean autoSync, final A rs) {
if (rs == null) return null;
return (A) register(autoSync, "", rs);
} | [
"public",
"<",
"A",
">",
"A",
"register",
"(",
"final",
"boolean",
"autoSync",
",",
"final",
"A",
"rs",
")",
"{",
"if",
"(",
"rs",
"==",
"null",
")",
"return",
"null",
";",
"return",
"(",
"A",
")",
"register",
"(",
"autoSync",
",",
"\"\"",
",",
"... | 将对象以name=""注入到资源池中,并同步已被注入的资源
@param <A> 泛型
@param autoSync 是否同步已被注入的资源
@param rs 资源对象
@return 旧资源对象 | [
"将对象以name",
"=",
"注入到资源池中,并同步已被注入的资源"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/ResourceFactory.java#L159-L162 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java | TypicalLoginAssist.doLoginByGivenEntity | protected void doLoginByGivenEntity(USER_ENTITY givenEntity, LoginSpecifiedOption option) {
"""
Do actually login for the user by given entity. (no silent)
@param givenEntity The given entity for user. (NotNull)
@param option The option of login specified by caller. (NotNull)
"""
assertGivenEntityReq... | java | protected void doLoginByGivenEntity(USER_ENTITY givenEntity, LoginSpecifiedOption option) {
assertGivenEntityRequired(givenEntity);
handleLoginSuccess(givenEntity, option);
} | [
"protected",
"void",
"doLoginByGivenEntity",
"(",
"USER_ENTITY",
"givenEntity",
",",
"LoginSpecifiedOption",
"option",
")",
"{",
"assertGivenEntityRequired",
"(",
"givenEntity",
")",
";",
"handleLoginSuccess",
"(",
"givenEntity",
",",
"option",
")",
";",
"}"
] | Do actually login for the user by given entity. (no silent)
@param givenEntity The given entity for user. (NotNull)
@param option The option of login specified by caller. (NotNull) | [
"Do",
"actually",
"login",
"for",
"the",
"user",
"by",
"given",
"entity",
".",
"(",
"no",
"silent",
")"
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java#L292-L295 |
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.createPatternAnyEntityRoleAsync | public Observable<UUID> createPatternAnyEntityRoleAsync(UUID appId, String versionId, UUID entityId, CreatePatternAnyEntityRoleOptionalParameter createPatternAnyEntityRoleOptionalParameter) {
"""
Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The versi... | java | public Observable<UUID> createPatternAnyEntityRoleAsync(UUID appId, String versionId, UUID entityId, CreatePatternAnyEntityRoleOptionalParameter createPatternAnyEntityRoleOptionalParameter) {
return createPatternAnyEntityRoleWithServiceResponseAsync(appId, versionId, entityId, createPatternAnyEntityRoleOptional... | [
"public",
"Observable",
"<",
"UUID",
">",
"createPatternAnyEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"CreatePatternAnyEntityRoleOptionalParameter",
"createPatternAnyEntityRoleOptionalParameter",
")",
"{",
"return",
"cr... | 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 createPatternAnyEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentExce... | [
"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#L9181-L9188 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/raid/GaloisField.java | GaloisField.multiply | public int multiply(int x, int y) {
"""
Compute the multiplication of two fields
@param x input field
@param y input field
@return result of multiplication
"""
assert(x >= 0 && x < getFieldSize() && y >= 0 && y < getFieldSize());
return mulTable[x][y];
} | java | public int multiply(int x, int y) {
assert(x >= 0 && x < getFieldSize() && y >= 0 && y < getFieldSize());
return mulTable[x][y];
} | [
"public",
"int",
"multiply",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"assert",
"(",
"x",
">=",
"0",
"&&",
"x",
"<",
"getFieldSize",
"(",
")",
"&&",
"y",
">=",
"0",
"&&",
"y",
"<",
"getFieldSize",
"(",
")",
")",
";",
"return",
"mulTable",
"[... | Compute the multiplication of two fields
@param x input field
@param y input field
@return result of multiplication | [
"Compute",
"the",
"multiplication",
"of",
"two",
"fields"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/raid/GaloisField.java#L150-L153 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/widget/element/Element.java | Element.waitForAttributePatternMatcher | private void waitForAttributePatternMatcher(String attributeName, String pattern, long timeout, boolean waitCondition) throws WidgetException {
"""
Matches an attribute value to a pattern that is passed.
@param attributeName
the attribute whose value os to be compared
@param pattern
the pattern to which to m... | java | private void waitForAttributePatternMatcher(String attributeName, String pattern, long timeout, boolean waitCondition) throws WidgetException {
long start = System.currentTimeMillis();
long end = start + timeout;
while (System.currentTimeMillis() < end) {
String attribute = getAttribute(attributeName);
if (... | [
"private",
"void",
"waitForAttributePatternMatcher",
"(",
"String",
"attributeName",
",",
"String",
"pattern",
",",
"long",
"timeout",
",",
"boolean",
"waitCondition",
")",
"throws",
"WidgetException",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"... | Matches an attribute value to a pattern that is passed.
@param attributeName
the attribute whose value os to be compared
@param pattern
the pattern to which to match
@param timeout
time in milliseconds after which request timeout occurs
@param waitCondition
true to match the attribute value and false to not match the
... | [
"Matches",
"an",
"attribute",
"value",
"to",
"a",
"pattern",
"that",
"is",
"passed",
"."
] | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/widget/element/Element.java#L980-L994 |
fcrepo3/fcrepo | fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/objecteditor/ContentHandlerFactory.java | ContentHandlerFactory.getEditor | public static ContentEditor getEditor(String type, InputStream data)
throws IOException {
"""
Get an editor for the given type, initialized with the given data. This
should only be called if the caller knows there is an editor for the
type.
"""
ContentEditor editor = (ContentEditor) s_edi... | java | public static ContentEditor getEditor(String type, InputStream data)
throws IOException {
ContentEditor editor = (ContentEditor) s_editors.get(type);
if (editor == null && type.endsWith("+xml")) {
editor = (ContentEditor) s_editors.get("text/xml");
}
return (Conte... | [
"public",
"static",
"ContentEditor",
"getEditor",
"(",
"String",
"type",
",",
"InputStream",
"data",
")",
"throws",
"IOException",
"{",
"ContentEditor",
"editor",
"=",
"(",
"ContentEditor",
")",
"s_editors",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"edi... | Get an editor for the given type, initialized with the given data. This
should only be called if the caller knows there is an editor for the
type. | [
"Get",
"an",
"editor",
"for",
"the",
"given",
"type",
"initialized",
"with",
"the",
"given",
"data",
".",
"This",
"should",
"only",
"be",
"called",
"if",
"the",
"caller",
"knows",
"there",
"is",
"an",
"editor",
"for",
"the",
"type",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/objecteditor/ContentHandlerFactory.java#L92-L99 |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/JDBCUtil.java | JDBCUtil.warnedUpdate | public static void warnedUpdate (PreparedStatement stmt, int expectedCount)
throws SQLException {
"""
Calls <code>stmt.executeUpdate()</code> on the supplied statement, checking to see that it
returns the expected update count and logging a warning if it does not.
"""
int modified = stmt.execu... | java | public static void warnedUpdate (PreparedStatement stmt, int expectedCount)
throws SQLException
{
int modified = stmt.executeUpdate();
if (modified != expectedCount) {
log.warning("Statement did not modify expected number of rows", "stmt", stmt,
"expected"... | [
"public",
"static",
"void",
"warnedUpdate",
"(",
"PreparedStatement",
"stmt",
",",
"int",
"expectedCount",
")",
"throws",
"SQLException",
"{",
"int",
"modified",
"=",
"stmt",
".",
"executeUpdate",
"(",
")",
";",
"if",
"(",
"modified",
"!=",
"expectedCount",
")... | Calls <code>stmt.executeUpdate()</code> on the supplied statement, checking to see that it
returns the expected update count and logging a warning if it does not. | [
"Calls",
"<code",
">",
"stmt",
".",
"executeUpdate",
"()",
"<",
"/",
"code",
">",
"on",
"the",
"supplied",
"statement",
"checking",
"to",
"see",
"that",
"it",
"returns",
"the",
"expected",
"update",
"count",
"and",
"logging",
"a",
"warning",
"if",
"it",
... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/JDBCUtil.java#L125-L133 |
elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/progress/AbstractProgress.java | AbstractProgress.setProcessed | public void setProcessed(int processed, Logging logger) throws IllegalArgumentException {
"""
Sets the number of items already processed at a time being.
@param processed the number of items already processed at a time being
@param logger Logger to report to
@throws IllegalArgumentException if an invalid valu... | java | public void setProcessed(int processed, Logging logger) throws IllegalArgumentException {
setProcessed(processed);
if(testLoggingRate(processed)) {
logger.progress(this);
}
} | [
"public",
"void",
"setProcessed",
"(",
"int",
"processed",
",",
"Logging",
"logger",
")",
"throws",
"IllegalArgumentException",
"{",
"setProcessed",
"(",
"processed",
")",
";",
"if",
"(",
"testLoggingRate",
"(",
"processed",
")",
")",
"{",
"logger",
".",
"prog... | Sets the number of items already processed at a time being.
@param processed the number of items already processed at a time being
@param logger Logger to report to
@throws IllegalArgumentException if an invalid value was passed. | [
"Sets",
"the",
"number",
"of",
"items",
"already",
"processed",
"at",
"a",
"time",
"being",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/progress/AbstractProgress.java#L97-L102 |
alkacon/opencms-core | src/org/opencms/acacia/shared/CmsEntity.java | CmsEntity.createDeepCopy | public CmsEntity createDeepCopy(String entityId) {
"""
Creates a deep copy of this entity.<p>
@param entityId the id of the new entity, if <code>null</code> a generic id will be used
@return the entity copy
"""
CmsEntity result = new CmsEntity(entityId, getTypeName());
for (CmsEntityA... | java | public CmsEntity createDeepCopy(String entityId) {
CmsEntity result = new CmsEntity(entityId, getTypeName());
for (CmsEntityAttribute attribute : getAttributes()) {
if (attribute.isSimpleValue()) {
List<String> values = attribute.getSimpleValues();
for ... | [
"public",
"CmsEntity",
"createDeepCopy",
"(",
"String",
"entityId",
")",
"{",
"CmsEntity",
"result",
"=",
"new",
"CmsEntity",
"(",
"entityId",
",",
"getTypeName",
"(",
")",
")",
";",
"for",
"(",
"CmsEntityAttribute",
"attribute",
":",
"getAttributes",
"(",
")"... | Creates a deep copy of this entity.<p>
@param entityId the id of the new entity, if <code>null</code> a generic id will be used
@return the entity copy | [
"Creates",
"a",
"deep",
"copy",
"of",
"this",
"entity",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsEntity.java#L302-L319 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getMiniInfo | public void getMiniInfo(int[] ids, Callback<List<Mini>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on Mini API go <a href="https://wiki.guildwars2.com/wiki/API:2/minis">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailu... | java | public void getMiniInfo(int[] ids, Callback<List<Mini>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getMiniInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getMiniInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Mini",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids",
")"... | For more info on Mini API go <a href="https://wiki.guildwars2.com/wiki/API:2/minis">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of mini id
@param callback callback that is going to... | [
"For",
"more",
"info",
"on",
"Mini",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"minis",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
"the"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1892-L1895 |
victims/victims-lib-java | src/main/java/com/redhat/victims/database/VictimsSQL.java | VictimsSQL.deleteRecord | protected void deleteRecord(Connection connection, String hash)
throws SQLException {
"""
Remove records matching a given hash. This will cascade to all
references.
@param hash
@throws SQLException
"""
int id = selectRecordId(hash);
if (id > 0) {
String[] queries = ... | java | protected void deleteRecord(Connection connection, String hash)
throws SQLException {
int id = selectRecordId(hash);
if (id > 0) {
String[] queries = new String[] { Query.DELETE_FILEHASHES,
Query.DELETE_METAS, Query.DELETE_CVES,
Query.DELET... | [
"protected",
"void",
"deleteRecord",
"(",
"Connection",
"connection",
",",
"String",
"hash",
")",
"throws",
"SQLException",
"{",
"int",
"id",
"=",
"selectRecordId",
"(",
"hash",
")",
";",
"if",
"(",
"id",
">",
"0",
")",
"{",
"String",
"[",
"]",
"queries"... | Remove records matching a given hash. This will cascade to all
references.
@param hash
@throws SQLException | [
"Remove",
"records",
"matching",
"a",
"given",
"hash",
".",
"This",
"will",
"cascade",
"to",
"all",
"references",
"."
] | train | https://github.com/victims/victims-lib-java/blob/ccd0e2fcc409bb6cdfc5de411c3bb202c9095f8b/src/main/java/com/redhat/victims/database/VictimsSQL.java#L256-L269 |
tvesalainen/util | vfs/src/main/java/org/vesalainen/vfs/Env.java | Env.getDefaultRegularFileAttributes | public static final FileAttribute<?>[] getDefaultRegularFileAttributes(Map<String, ?> env) {
"""
Return default attributes for new regular file. Either from env or default
values.
@param env
@return
"""
FileAttribute<?>[] attrs = (FileAttribute<?>[]) env.get(DEFAULT_REGULAR_FILE_ATTRIBUTES);
... | java | public static final FileAttribute<?>[] getDefaultRegularFileAttributes(Map<String, ?> env)
{
FileAttribute<?>[] attrs = (FileAttribute<?>[]) env.get(DEFAULT_REGULAR_FILE_ATTRIBUTES);
if (attrs == null)
{
attrs = new FileAttribute<?>[]{
PosixFilePermissions.a... | [
"public",
"static",
"final",
"FileAttribute",
"<",
"?",
">",
"[",
"]",
"getDefaultRegularFileAttributes",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"env",
")",
"{",
"FileAttribute",
"<",
"?",
">",
"[",
"]",
"attrs",
"=",
"(",
"FileAttribute",
"<",
"?",
... | Return default attributes for new regular file. Either from env or default
values.
@param env
@return | [
"Return",
"default",
"attributes",
"for",
"new",
"regular",
"file",
".",
"Either",
"from",
"env",
"or",
"default",
"values",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/vfs/src/main/java/org/vesalainen/vfs/Env.java#L120-L132 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java | SegmentSlic.initializeClusters | protected void initializeClusters() {
"""
initialize all the clusters at regularly spaced intervals. Their locations are perturbed a bit to reduce
the likelihood of a bad location. Initial color is set to the image color at the location
"""
int offsetX = Math.max(BORDER,((input.width-1) % gridInterval)/2... | java | protected void initializeClusters() {
int offsetX = Math.max(BORDER,((input.width-1) % gridInterval)/2);
int offsetY = Math.max(BORDER,((input.height-1) % gridInterval)/2);
int clusterId = 0;
clusters.reset();
for( int y = offsetY; y < input.height-BORDER; y += gridInterval ) {
for( int x = offsetX; x < ... | [
"protected",
"void",
"initializeClusters",
"(",
")",
"{",
"int",
"offsetX",
"=",
"Math",
".",
"max",
"(",
"BORDER",
",",
"(",
"(",
"input",
".",
"width",
"-",
"1",
")",
"%",
"gridInterval",
")",
"/",
"2",
")",
";",
"int",
"offsetY",
"=",
"Math",
".... | initialize all the clusters at regularly spaced intervals. Their locations are perturbed a bit to reduce
the likelihood of a bad location. Initial color is set to the image color at the location | [
"initialize",
"all",
"the",
"clusters",
"at",
"regularly",
"spaced",
"intervals",
".",
"Their",
"locations",
"are",
"perturbed",
"a",
"bit",
"to",
"reduce",
"the",
"likelihood",
"of",
"a",
"bad",
"location",
".",
"Initial",
"color",
"is",
"set",
"to",
"the",... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java#L197-L215 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/DirectQuickSelectSketch.java | DirectQuickSelectSketch.writableWrap | static DirectQuickSelectSketch writableWrap(final WritableMemory srcMem, final long seed) {
"""
Wrap a sketch around the given source Memory containing sketch data that originated from
this sketch.
@param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
The given Memory object must be in... | java | static DirectQuickSelectSketch writableWrap(final WritableMemory srcMem, final long seed) {
final int preambleLongs = extractPreLongs(srcMem); //byte 0
final int lgNomLongs = extractLgNomLongs(srcMem); //byte 3
final int lgArrLongs = extractLgArrLongs(srcMem); ... | [
"static",
"DirectQuickSelectSketch",
"writableWrap",
"(",
"final",
"WritableMemory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"int",
"preambleLongs",
"=",
"extractPreLongs",
"(",
"srcMem",
")",
";",
"//byte 0",
"final",
"int",
"lgNomLongs",
"=",
... | Wrap a sketch around the given source Memory containing sketch data that originated from
this sketch.
@param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
The given Memory object must be in hash table form and not read only.
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See ... | [
"Wrap",
"a",
"sketch",
"around",
"the",
"given",
"source",
"Memory",
"containing",
"sketch",
"data",
"that",
"originated",
"from",
"this",
"sketch",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/DirectQuickSelectSketch.java#L156-L175 |
spring-projects/spring-social | spring-social-core/src/main/java/org/springframework/social/oauth2/OAuth2Template.java | OAuth2Template.createAccessGrant | protected AccessGrant createAccessGrant(String accessToken, String scope, String refreshToken, Long expiresIn, Map<String, Object> response) {
"""
Creates an {@link AccessGrant} given the response from the access token exchange with the provider.
May be overridden to create a custom AccessGrant that captures prov... | java | protected AccessGrant createAccessGrant(String accessToken, String scope, String refreshToken, Long expiresIn, Map<String, Object> response) {
return new AccessGrant(accessToken, scope, refreshToken, expiresIn);
} | [
"protected",
"AccessGrant",
"createAccessGrant",
"(",
"String",
"accessToken",
",",
"String",
"scope",
",",
"String",
"refreshToken",
",",
"Long",
"expiresIn",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"response",
")",
"{",
"return",
"new",
"AccessGrant",
... | Creates an {@link AccessGrant} given the response from the access token exchange with the provider.
May be overridden to create a custom AccessGrant that captures provider-specific information from the access token response.
@param accessToken the access token value received from the provider
@param scope the scope of ... | [
"Creates",
"an",
"{"
] | train | https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-core/src/main/java/org/springframework/social/oauth2/OAuth2Template.java#L260-L262 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java | PublicIPPrefixesInner.createOrUpdateAsync | public Observable<PublicIPPrefixInner> createOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) {
"""
Creates or updates a static or dynamic public IP prefix.
@param resourceGroupName The name of the resource group.
@param publicIpPrefixName The name of the publi... | java | public Observable<PublicIPPrefixInner> createOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).map(new Func1<ServiceResponse<PublicIPPrefixInner>, PublicIPPrefixInn... | [
"public",
"Observable",
"<",
"PublicIPPrefixInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"publicIpPrefixName",
",",
"PublicIPPrefixInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroup... | Creates or updates a static or dynamic public IP prefix.
@param resourceGroupName The name of the resource group.
@param publicIpPrefixName The name of the public IP prefix.
@param parameters Parameters supplied to the create or update public IP prefix operation.
@throws IllegalArgumentException thrown if parameters f... | [
"Creates",
"or",
"updates",
"a",
"static",
"or",
"dynamic",
"public",
"IP",
"prefix",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java#L471-L478 |
MGunlogson/CuckooFilter4J | src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java | FilterTable.checkTag | boolean checkTag(long bucketIndex, int posInBucket, long tag) {
"""
Check if a tag in a given position in a bucket matches the tag you passed
it. Faster than regular read because it stops checking if it finds a
non-matching bit.
"""
long tagStartIdx = getTagOffset(bucketIndex, posInBucket);
final int b... | java | boolean checkTag(long bucketIndex, int posInBucket, long tag) {
long tagStartIdx = getTagOffset(bucketIndex, posInBucket);
final int bityPerTag = bitsPerTag;
for (long i = 0; i < bityPerTag; i++) {
if (memBlock.get(i + tagStartIdx) != ((tag & (1L << i)) != 0))
return false;
}
return true;
} | [
"boolean",
"checkTag",
"(",
"long",
"bucketIndex",
",",
"int",
"posInBucket",
",",
"long",
"tag",
")",
"{",
"long",
"tagStartIdx",
"=",
"getTagOffset",
"(",
"bucketIndex",
",",
"posInBucket",
")",
";",
"final",
"int",
"bityPerTag",
"=",
"bitsPerTag",
";",
"f... | Check if a tag in a given position in a bucket matches the tag you passed
it. Faster than regular read because it stops checking if it finds a
non-matching bit. | [
"Check",
"if",
"a",
"tag",
"in",
"a",
"given",
"position",
"in",
"a",
"bucket",
"matches",
"the",
"tag",
"you",
"passed",
"it",
".",
"Faster",
"than",
"regular",
"read",
"because",
"it",
"stops",
"checking",
"if",
"it",
"finds",
"a",
"non",
"-",
"match... | train | https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java#L207-L215 |
graphql-java/graphql-java | src/main/java/graphql/analysis/QueryTraversal.java | QueryTraversal.reducePreOrder | @SuppressWarnings("unchecked")
public <T> T reducePreOrder(QueryReducer<T> queryReducer, T initialValue) {
"""
Reduces the fields of a Document (or parts of it) to a single value. The fields are visited in pre-order.
@param queryReducer the query reducer
@param initialValue the initial value to pass to the... | java | @SuppressWarnings("unchecked")
public <T> T reducePreOrder(QueryReducer<T> queryReducer, T initialValue) {
// compiler hack to make acc final and mutable :-)
final Object[] acc = {initialValue};
visitPreOrder(new QueryVisitorStub() {
@Override
public void visitField(Q... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"reducePreOrder",
"(",
"QueryReducer",
"<",
"T",
">",
"queryReducer",
",",
"T",
"initialValue",
")",
"{",
"// compiler hack to make acc final and mutable :-)",
"final",
"Object",
"[",
... | Reduces the fields of a Document (or parts of it) to a single value. The fields are visited in pre-order.
@param queryReducer the query reducer
@param initialValue the initial value to pass to the reducer
@param <T> the type of reduced value
@return the calucalated overall value | [
"Reduces",
"the",
"fields",
"of",
"a",
"Document",
"(",
"or",
"parts",
"of",
"it",
")",
"to",
"a",
"single",
"value",
".",
"The",
"fields",
"are",
"visited",
"in",
"pre",
"-",
"order",
"."
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/analysis/QueryTraversal.java#L127-L138 |
google/truth | core/src/main/java/com/google/common/truth/Facts.java | Facts.and | Facts and(Fact... moreFacts) {
"""
Returns an instance concatenating the facts wrapped by the current instance followed by the
given facts.
"""
return new Facts(Iterables.concat(facts, asList(moreFacts)));
} | java | Facts and(Fact... moreFacts) {
return new Facts(Iterables.concat(facts, asList(moreFacts)));
} | [
"Facts",
"and",
"(",
"Fact",
"...",
"moreFacts",
")",
"{",
"return",
"new",
"Facts",
"(",
"Iterables",
".",
"concat",
"(",
"facts",
",",
"asList",
"(",
"moreFacts",
")",
")",
")",
";",
"}"
] | Returns an instance concatenating the facts wrapped by the current instance followed by the
given facts. | [
"Returns",
"an",
"instance",
"concatenating",
"the",
"facts",
"wrapped",
"by",
"the",
"current",
"instance",
"followed",
"by",
"the",
"given",
"facts",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/Facts.java#L62-L64 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/FeatureScopes.java | FeatureScopes.createReceiverFeatureScope | protected IScope createReceiverFeatureScope(
EObject featureCall,
XExpression receiver,
LightweightTypeReference receiverType,
JvmIdentifiableElement receiverFeature,
boolean implicitReceiver,
boolean validStatic,
TypeBucket receiverBucket,
IScope parent,
IFeatureScopeSession session) {
"... | java | protected IScope createReceiverFeatureScope(
EObject featureCall,
XExpression receiver,
LightweightTypeReference receiverType,
JvmIdentifiableElement receiverFeature,
boolean implicitReceiver,
boolean validStatic,
TypeBucket receiverBucket,
IScope parent,
IFeatureScopeSession session) {
ret... | [
"protected",
"IScope",
"createReceiverFeatureScope",
"(",
"EObject",
"featureCall",
",",
"XExpression",
"receiver",
",",
"LightweightTypeReference",
"receiverType",
",",
"JvmIdentifiableElement",
"receiverFeature",
",",
"boolean",
"implicitReceiver",
",",
"boolean",
"validSta... | Creates a scope that returns the features of a given receiver type.
@param featureCall the feature call that is currently processed by the scoping infrastructure
@param receiver an optionally available receiver expression
@param receiverType the type of the receiver. It may be available even if the receiver itself is ... | [
"Creates",
"a",
"scope",
"that",
"returns",
"the",
"features",
"of",
"a",
"given",
"receiver",
"type",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/FeatureScopes.java#L660-L671 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/util/MultimapJoiner.java | MultimapJoiner.appendTo | public <A extends Appendable> A appendTo(A appendable, Iterable<? extends Entry<?, ? extends Collection<?>>> entries)
throws IOException {
"""
Appends the string representation of each entry in {@code entries}, using the previously configured separator and
key-value separator, to {@code appendable}.
"""
... | java | public <A extends Appendable> A appendTo(A appendable, Iterable<? extends Entry<?, ? extends Collection<?>>> entries)
throws IOException {
// checkNotNull(appendable);
Iterator<? extends Entry<?, ? extends Collection<?>>> iterator = entries.iterator();
if (iterator.hasNext()) {
Entry<?, ? extends Collect... | [
"public",
"<",
"A",
"extends",
"Appendable",
">",
"A",
"appendTo",
"(",
"A",
"appendable",
",",
"Iterable",
"<",
"?",
"extends",
"Entry",
"<",
"?",
",",
"?",
"extends",
"Collection",
"<",
"?",
">",
">",
">",
"entries",
")",
"throws",
"IOException",
"{"... | Appends the string representation of each entry in {@code entries}, using the previously configured separator and
key-value separator, to {@code appendable}. | [
"Appends",
"the",
"string",
"representation",
"of",
"each",
"entry",
"in",
"{"
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/util/MultimapJoiner.java#L87-L105 |
JadiraOrg/jadira | jms/src/main/java/org/jadira/jms/template/BatchedJmsTemplate.java | BatchedJmsTemplate.receiveSelectedBatch | public List<Message> receiveSelectedBatch(Destination destination, String messageSelector) throws JmsException {
"""
Receive a batch of up to default batch size for given destination and message selector. Other than batching this method is the same as {@link JmsTemplate#receiveSelected(Destination, String)}
@retu... | java | public List<Message> receiveSelectedBatch(Destination destination, String messageSelector) throws JmsException {
return receiveSelectedBatch(destination, messageSelector, getBatchSize());
} | [
"public",
"List",
"<",
"Message",
">",
"receiveSelectedBatch",
"(",
"Destination",
"destination",
",",
"String",
"messageSelector",
")",
"throws",
"JmsException",
"{",
"return",
"receiveSelectedBatch",
"(",
"destination",
",",
"messageSelector",
",",
"getBatchSize",
"... | Receive a batch of up to default batch size for given destination and message selector. Other than batching this method is the same as {@link JmsTemplate#receiveSelected(Destination, String)}
@return A list of {@link Message}
@param destination The Destination
@param messageSelector The Selector
@throws JmsException Th... | [
"Receive",
"a",
"batch",
"of",
"up",
"to",
"default",
"batch",
"size",
"for",
"given",
"destination",
"and",
"message",
"selector",
".",
"Other",
"than",
"batching",
"this",
"method",
"is",
"the",
"same",
"as",
"{"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/jms/src/main/java/org/jadira/jms/template/BatchedJmsTemplate.java#L216-L218 |
Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/ForkJoinTask.java | ForkJoinTask.compareAndSetForkJoinTaskTag | public final boolean compareAndSetForkJoinTaskTag(short expect, short update) {
"""
Atomically conditionally sets the tag value for this task. Among other applications, tags can
be used as visit markers in tasks operating on graphs, as in methods that check: {@code
if (task.compareAndSetForkJoinTaskTag((short)0,... | java | public final boolean compareAndSetForkJoinTaskTag(short expect, short update) {
for (int s;;) {
if ((short) (s = status) != expect)
return false;
if (U.compareAndSwapInt(this, STATUS, s, (s & ~SMASK) | (update & SMASK)))
return true;
}
} | [
"public",
"final",
"boolean",
"compareAndSetForkJoinTaskTag",
"(",
"short",
"expect",
",",
"short",
"update",
")",
"{",
"for",
"(",
"int",
"s",
";",
";",
")",
"{",
"if",
"(",
"(",
"short",
")",
"(",
"s",
"=",
"status",
")",
"!=",
"expect",
")",
"retu... | Atomically conditionally sets the tag value for this task. Among other applications, tags can
be used as visit markers in tasks operating on graphs, as in methods that check: {@code
if (task.compareAndSetForkJoinTaskTag((short)0, (short)1))} before processing, otherwise
exiting because the node has already been visited... | [
"Atomically",
"conditionally",
"sets",
"the",
"tag",
"value",
"for",
"this",
"task",
".",
"Among",
"other",
"applications",
"tags",
"can",
"be",
"used",
"as",
"visit",
"markers",
"in",
"tasks",
"operating",
"on",
"graphs",
"as",
"in",
"methods",
"that",
"che... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/ForkJoinTask.java#L1228-L1235 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerValue.java | DerValue.getBoolean | public boolean getBoolean() throws IOException {
"""
Returns an ASN.1 BOOLEAN
@return the boolean held in this DER value
"""
if (tag != tag_Boolean) {
throw new IOException("DerValue.getBoolean, not a BOOLEAN " + tag);
}
if (length != 1) {
throw new IOExceptio... | java | public boolean getBoolean() throws IOException {
if (tag != tag_Boolean) {
throw new IOException("DerValue.getBoolean, not a BOOLEAN " + tag);
}
if (length != 1) {
throw new IOException("DerValue.getBoolean, invalid length "
+ lengt... | [
"public",
"boolean",
"getBoolean",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"tag",
"!=",
"tag_Boolean",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"DerValue.getBoolean, not a BOOLEAN \"",
"+",
"tag",
")",
";",
"}",
"if",
"(",
"length",
"!=",
"... | Returns an ASN.1 BOOLEAN
@return the boolean held in this DER value | [
"Returns",
"an",
"ASN",
".",
"1",
"BOOLEAN"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerValue.java#L439-L451 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.