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 |
|---|---|---|---|---|---|---|---|---|---|---|
camunda/camunda-xml-model | src/main/java/org/camunda/bpm/model/xml/impl/util/ModelUtil.java | ModelUtil.setGeneratedUniqueIdentifier | public static void setGeneratedUniqueIdentifier(ModelElementType type, ModelElementInstance modelElementInstance, boolean withReferenceUpdate) {
"""
Set unique identifier if the type has a String id attribute
@param type the type of the model element
@param modelElementInstance the model element instance to se... | java | public static void setGeneratedUniqueIdentifier(ModelElementType type, ModelElementInstance modelElementInstance, boolean withReferenceUpdate) {
setNewIdentifier(type, modelElementInstance, ModelUtil.getUniqueIdentifier(type), withReferenceUpdate);
} | [
"public",
"static",
"void",
"setGeneratedUniqueIdentifier",
"(",
"ModelElementType",
"type",
",",
"ModelElementInstance",
"modelElementInstance",
",",
"boolean",
"withReferenceUpdate",
")",
"{",
"setNewIdentifier",
"(",
"type",
",",
"modelElementInstance",
",",
"ModelUtil",... | Set unique identifier if the type has a String id attribute
@param type the type of the model element
@param modelElementInstance the model element instance to set the id
@param withReferenceUpdate true to update id references in other elements, false otherwise | [
"Set",
"unique",
"identifier",
"if",
"the",
"type",
"has",
"a",
"String",
"id",
"attribute"
] | train | https://github.com/camunda/camunda-xml-model/blob/85b3f879e26d063f71c94cfd21ac17d9ff6baf4d/src/main/java/org/camunda/bpm/model/xml/impl/util/ModelUtil.java#L263-L265 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/GeometryDeserializer.java | GeometryDeserializer.asMultiLineString | private MultiLineString asMultiLineString(List<List<List>> coords, CrsId crsId) throws IOException {
"""
Parses the JSON as a MultiLineString geometry
@param coords the coordinates of a multlinestring (which is a list of coordinates of linestrings)
@param crsId
@return an instance of multilinestring
@throw... | java | private MultiLineString asMultiLineString(List<List<List>> coords, CrsId crsId) throws IOException {
if (coords == null || coords.isEmpty()) {
throw new IOException("A multilinestring requires at least one line string");
}
LineString[] lineStrings = new LineString[coords.size()];
... | [
"private",
"MultiLineString",
"asMultiLineString",
"(",
"List",
"<",
"List",
"<",
"List",
">",
">",
"coords",
",",
"CrsId",
"crsId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"coords",
"==",
"null",
"||",
"coords",
".",
"isEmpty",
"(",
")",
")",
"{",... | Parses the JSON as a MultiLineString geometry
@param coords the coordinates of a multlinestring (which is a list of coordinates of linestrings)
@param crsId
@return an instance of multilinestring
@throws IOException if the given json does not correspond to a multilinestring or can be parsed as such | [
"Parses",
"the",
"JSON",
"as",
"a",
"MultiLineString",
"geometry"
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/GeometryDeserializer.java#L236-L245 |
samskivert/samskivert | src/main/java/com/samskivert/swing/Label.java | Label.textIterator | protected AttributedCharacterIterator textIterator (Graphics2D gfx) {
"""
Constructs an attributed character iterator with our text and the appropriate font.
"""
// first set up any attributes that apply to the entire text
Font font = (_font == null) ? gfx.getFont() : _font;
HashMap<Tex... | java | protected AttributedCharacterIterator textIterator (Graphics2D gfx)
{
// first set up any attributes that apply to the entire text
Font font = (_font == null) ? gfx.getFont() : _font;
HashMap<TextAttribute,Object> map = new HashMap<TextAttribute,Object>();
map.put(TextAttribute.FONT,... | [
"protected",
"AttributedCharacterIterator",
"textIterator",
"(",
"Graphics2D",
"gfx",
")",
"{",
"// first set up any attributes that apply to the entire text",
"Font",
"font",
"=",
"(",
"_font",
"==",
"null",
")",
"?",
"gfx",
".",
"getFont",
"(",
")",
":",
"_font",
... | Constructs an attributed character iterator with our text and the appropriate font. | [
"Constructs",
"an",
"attributed",
"character",
"iterator",
"with",
"our",
"text",
"and",
"the",
"appropriate",
"font",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/Label.java#L611-L624 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/extension/LanguageResourceService.java | LanguageResourceService.addLanguageResource | public void addLanguageResource(String key, Resource resource) {
"""
Adds or overlays the given language resource, which need not exist in
the ServletContext. If a language resource is already defined for the
given language key, the strings from the given resource will be overlaid
on top of the existing strings... | java | public void addLanguageResource(String key, Resource resource) {
// Skip loading of language if not allowed
if (!isLanguageAllowed(key)) {
logger.debug("OMITTING language: \"{}\"", key);
return;
}
// Merge language resources if already defined
Resource e... | [
"public",
"void",
"addLanguageResource",
"(",
"String",
"key",
",",
"Resource",
"resource",
")",
"{",
"// Skip loading of language if not allowed",
"if",
"(",
"!",
"isLanguageAllowed",
"(",
"key",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"OMITTING language: \\\... | Adds or overlays the given language resource, which need not exist in
the ServletContext. If a language resource is already defined for the
given language key, the strings from the given resource will be overlaid
on top of the existing strings, augmenting or overriding the available
strings for that language.
@param k... | [
"Adds",
"or",
"overlays",
"the",
"given",
"language",
"resource",
"which",
"need",
"not",
"exist",
"in",
"the",
"ServletContext",
".",
"If",
"a",
"language",
"resource",
"is",
"already",
"defined",
"for",
"the",
"given",
"language",
"key",
"the",
"strings",
... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/extension/LanguageResourceService.java#L275-L323 |
gallandarakhneorg/afc | advanced/gis/gisroadinputoutput/src/main/java/org/arakhne/afc/gis/road/io/XMLRoadUtil.java | XMLRoadUtil.writeRoadPolyline | public static Element writeRoadPolyline(RoadPolyline primitive, XMLBuilder builder,
XMLResources resources) throws IOException {
"""
Write the XML description for the given road.
@param primitive is the road to output.
@param builder is the tool to create XML nodes.
@param resources is the tool that permit... | java | public static Element writeRoadPolyline(RoadPolyline primitive, XMLBuilder builder,
XMLResources resources) throws IOException {
return writeMapElement(primitive, NODE_ROAD, builder, resources);
} | [
"public",
"static",
"Element",
"writeRoadPolyline",
"(",
"RoadPolyline",
"primitive",
",",
"XMLBuilder",
"builder",
",",
"XMLResources",
"resources",
")",
"throws",
"IOException",
"{",
"return",
"writeMapElement",
"(",
"primitive",
",",
"NODE_ROAD",
",",
"builder",
... | Write the XML description for the given road.
@param primitive is the road to output.
@param builder is the tool to create XML nodes.
@param resources is the tool that permits to gather the resources.
@return the XML node of the map element.
@throws IOException in case of error. | [
"Write",
"the",
"XML",
"description",
"for",
"the",
"given",
"road",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroadinputoutput/src/main/java/org/arakhne/afc/gis/road/io/XMLRoadUtil.java#L87-L90 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.printToFile | public static void printToFile(File file, String message, boolean append,
boolean printLn, String encoding) {
"""
Prints to a file. If the file already exists, appends if
<code>append=true</code>, and overwrites if <code>append=false</code>.
"""
PrintWriter pw = null;
... | java | public static void printToFile(File file, String message, boolean append,
boolean printLn, String encoding) {
PrintWriter pw = null;
try {
Writer fw;
if (encoding != null) {
fw = new OutputStreamWriter(new FileOutputStream(file, append),
... | [
"public",
"static",
"void",
"printToFile",
"(",
"File",
"file",
",",
"String",
"message",
",",
"boolean",
"append",
",",
"boolean",
"printLn",
",",
"String",
"encoding",
")",
"{",
"PrintWriter",
"pw",
"=",
"null",
";",
"try",
"{",
"Writer",
"fw",
";",
"i... | Prints to a file. If the file already exists, appends if
<code>append=true</code>, and overwrites if <code>append=false</code>. | [
"Prints",
"to",
"a",
"file",
".",
"If",
"the",
"file",
"already",
"exists",
"appends",
"if",
"<code",
">",
"append",
"=",
"true<",
"/",
"code",
">",
"and",
"overwrites",
"if",
"<code",
">",
"append",
"=",
"false<",
"/",
"code",
">",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L876-L902 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java | ICUResourceBundle.getAvailEntry | private static AvailEntry getAvailEntry(String key, ClassLoader loader) {
"""
Stores the locale information in a cache accessed by key (bundle prefix).
The cached objects are AvailEntries. The cache is implemented by SoftCache
so it can be GC'd.
"""
return GET_AVAILABLE_CACHE.getInstance(key, loader)... | java | private static AvailEntry getAvailEntry(String key, ClassLoader loader) {
return GET_AVAILABLE_CACHE.getInstance(key, loader);
} | [
"private",
"static",
"AvailEntry",
"getAvailEntry",
"(",
"String",
"key",
",",
"ClassLoader",
"loader",
")",
"{",
"return",
"GET_AVAILABLE_CACHE",
".",
"getInstance",
"(",
"key",
",",
"loader",
")",
";",
"}"
] | Stores the locale information in a cache accessed by key (bundle prefix).
The cached objects are AvailEntries. The cache is implemented by SoftCache
so it can be GC'd. | [
"Stores",
"the",
"locale",
"information",
"in",
"a",
"cache",
"accessed",
"by",
"key",
"(",
"bundle",
"prefix",
")",
".",
"The",
"cached",
"objects",
"are",
"AvailEntries",
".",
"The",
"cache",
"is",
"implemented",
"by",
"SoftCache",
"so",
"it",
"can",
"be... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java#L798-L800 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java | DataLabelingServiceClient.formatInstructionName | @Deprecated
public static final String formatInstructionName(String project, String instruction) {
"""
Formats a string containing the fully-qualified path to represent a instruction resource.
@deprecated Use the {@link InstructionName} class instead.
"""
return INSTRUCTION_PATH_TEMPLATE.instantiate(
... | java | @Deprecated
public static final String formatInstructionName(String project, String instruction) {
return INSTRUCTION_PATH_TEMPLATE.instantiate(
"project", project,
"instruction", instruction);
} | [
"@",
"Deprecated",
"public",
"static",
"final",
"String",
"formatInstructionName",
"(",
"String",
"project",
",",
"String",
"instruction",
")",
"{",
"return",
"INSTRUCTION_PATH_TEMPLATE",
".",
"instantiate",
"(",
"\"project\"",
",",
"project",
",",
"\"instruction\"",
... | Formats a string containing the fully-qualified path to represent a instruction resource.
@deprecated Use the {@link InstructionName} class instead. | [
"Formats",
"a",
"string",
"containing",
"the",
"fully",
"-",
"qualified",
"path",
"to",
"represent",
"a",
"instruction",
"resource",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java#L214-L219 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/util/Utils.java | Utils.getConstantName | public static String getConstantName(Object value, Class c) {
"""
Gets user-friendly name of the public static final constant defined in a
class or an interface for display purpose.
@param value the constant value
@param c type of class or interface
@return name
"""
for (Field f : c.getDeclaredFi... | java | public static String getConstantName(Object value, Class c) {
for (Field f : c.getDeclaredFields()) {
int mod = f.getModifiers();
if (Modifier.isStatic(mod) && Modifier.isPublic(mod) && Modifier.isFinal(mod)) {
try {
if (f.get(null).equals(value)) {
... | [
"public",
"static",
"String",
"getConstantName",
"(",
"Object",
"value",
",",
"Class",
"c",
")",
"{",
"for",
"(",
"Field",
"f",
":",
"c",
".",
"getDeclaredFields",
"(",
")",
")",
"{",
"int",
"mod",
"=",
"f",
".",
"getModifiers",
"(",
")",
";",
"if",
... | Gets user-friendly name of the public static final constant defined in a
class or an interface for display purpose.
@param value the constant value
@param c type of class or interface
@return name | [
"Gets",
"user",
"-",
"friendly",
"name",
"of",
"the",
"public",
"static",
"final",
"constant",
"defined",
"in",
"a",
"class",
"or",
"an",
"interface",
"for",
"display",
"purpose",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/Utils.java#L56-L70 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.rawQuery | public Cursor rawQuery(String sql, String[] selectionArgs,
CancellationSignal cancellationSignal) {
"""
Runs the provided SQL and returns a {@link Cursor} over the result set.
@param sql the SQL query. The SQL string must not be ; terminated
@param selectionArgs You may include ?s in where clause i... | java | public Cursor rawQuery(String sql, String[] selectionArgs,
CancellationSignal cancellationSignal) {
return rawQueryWithFactory(null, sql, selectionArgs, null, cancellationSignal);
} | [
"public",
"Cursor",
"rawQuery",
"(",
"String",
"sql",
",",
"String",
"[",
"]",
"selectionArgs",
",",
"CancellationSignal",
"cancellationSignal",
")",
"{",
"return",
"rawQueryWithFactory",
"(",
"null",
",",
"sql",
",",
"selectionArgs",
",",
"null",
",",
"cancella... | Runs the provided SQL and returns a {@link Cursor} over the result set.
@param sql the SQL query. The SQL string must not be ; terminated
@param selectionArgs You may include ?s in where clause in the query,
which will be replaced by the values from selectionArgs. The
values will be bound as Strings.
@param cancellati... | [
"Runs",
"the",
"provided",
"SQL",
"and",
"returns",
"a",
"{",
"@link",
"Cursor",
"}",
"over",
"the",
"result",
"set",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L1275-L1278 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java | StandardGenerator.getColorProperty | static Color getColorProperty(IChemObject object, String key) {
"""
Safely access a chem object color property for a chem object.
@param object chem object
@return the highlight color
@throws java.lang.IllegalArgumentException the highlight property was set but was not a
{@link Color} instance
"""
... | java | static Color getColorProperty(IChemObject object, String key) {
Object value = object.getProperty(key);
if (value instanceof Color) return (Color) value;
if (value != null) throw new IllegalArgumentException(key + " property should be a java.awt.Color");
return null;
} | [
"static",
"Color",
"getColorProperty",
"(",
"IChemObject",
"object",
",",
"String",
"key",
")",
"{",
"Object",
"value",
"=",
"object",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"value",
"instanceof",
"Color",
")",
"return",
"(",
"Color",
")",
... | Safely access a chem object color property for a chem object.
@param object chem object
@return the highlight color
@throws java.lang.IllegalArgumentException the highlight property was set but was not a
{@link Color} instance | [
"Safely",
"access",
"a",
"chem",
"object",
"color",
"property",
"for",
"a",
"chem",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java#L635-L640 |
threerings/nenya | core/src/main/java/com/threerings/cast/CharacterComponent.java | CharacterComponent.getFrames | public ActionFrames getFrames (String action, String type) {
"""
Returns the image frames for the specified action animation or null if no animation for the
specified action is available for this component.
@param type null for the normal action frames or one of the custom action sub-types:
{@link StandardAct... | java | public ActionFrames getFrames (String action, String type)
{
return _frameProvider.getFrames(this, action, type);
} | [
"public",
"ActionFrames",
"getFrames",
"(",
"String",
"action",
",",
"String",
"type",
")",
"{",
"return",
"_frameProvider",
".",
"getFrames",
"(",
"this",
",",
"action",
",",
"type",
")",
";",
"}"
] | Returns the image frames for the specified action animation or null if no animation for the
specified action is available for this component.
@param type null for the normal action frames or one of the custom action sub-types:
{@link StandardActions#SHADOW_TYPE}, etc. | [
"Returns",
"the",
"image",
"frames",
"for",
"the",
"specified",
"action",
"animation",
"or",
"null",
"if",
"no",
"animation",
"for",
"the",
"specified",
"action",
"is",
"available",
"for",
"this",
"component",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CharacterComponent.java#L74-L77 |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | MapCore/src/main/java/org/wwarn/mapcore/client/common/types/Range.java | Range.calcCI95 | public static Range<Double> calcCI95(Double percentageValue, Integer sampleSize) {
"""
/*
Calculate CI95% value using the no continuity correction formula found here: http://faculty.vassar.edu/lowry/prop1.html
"""
// GWT.log("calcCI95", null);
GWT.log("percentageValue: " + percentageValue.toStr... | java | public static Range<Double> calcCI95(Double percentageValue, Integer sampleSize) {
// GWT.log("calcCI95", null);
GWT.log("percentageValue: " + percentageValue.toString(), null);
GWT.log("sampleSize: " + sampleSize, null);
if (sampleSize==0) {
return null;
}
if ... | [
"public",
"static",
"Range",
"<",
"Double",
">",
"calcCI95",
"(",
"Double",
"percentageValue",
",",
"Integer",
"sampleSize",
")",
"{",
"// GWT.log(\"calcCI95\", null);",
"GWT",
".",
"log",
"(",
"\"percentageValue: \"",
"+",
"percentageValue",
".",
"toString",
... | /*
Calculate CI95% value using the no continuity correction formula found here: http://faculty.vassar.edu/lowry/prop1.html | [
"/",
"*",
"Calculate",
"CI95%",
"value",
"using",
"the",
"no",
"continuity",
"correction",
"formula",
"found",
"here",
":",
"http",
":",
"//",
"faculty",
".",
"vassar",
".",
"edu",
"/",
"lowry",
"/",
"prop1",
".",
"html"
] | train | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/MapCore/src/main/java/org/wwarn/mapcore/client/common/types/Range.java#L64-L100 |
Netflix/zeno | src/main/java/com/netflix/zeno/util/collections/algorithms/BinarySearch.java | BinarySearch.rangeCheck | private static void rangeCheck(int length, int fromIndex, int toIndex) {
"""
Checks that {@code fromIndex} and {@code toIndex} are in the range and
throws an appropriate exception, if they aren't.
"""
if (fromIndex > toIndex) {
throw new IllegalArgumentException("fromIndex(" + fromIndex + ... | java | private static void rangeCheck(int length, int fromIndex, int toIndex) {
if (fromIndex > toIndex) {
throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")");
}
if (fromIndex < 0) {
throw new ArrayIndexOutOfBoundsException(fromIndex);
... | [
"private",
"static",
"void",
"rangeCheck",
"(",
"int",
"length",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
")",
"{",
"if",
"(",
"fromIndex",
">",
"toIndex",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"fromIndex(\"",
"+",
"fromIndex",
... | Checks that {@code fromIndex} and {@code toIndex} are in the range and
throws an appropriate exception, if they aren't. | [
"Checks",
"that",
"{"
] | train | https://github.com/Netflix/zeno/blob/e571a3f1e304942724d454408fe6417fe18c20fd/src/main/java/com/netflix/zeno/util/collections/algorithms/BinarySearch.java#L34-L44 |
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.addCompositeEntity | public UUID addCompositeEntity(UUID appId, String versionId, CompositeEntityModel compositeModelCreateObject) {
"""
Adds a composite entity extractor to the application.
@param appId The application ID.
@param versionId The version ID.
@param compositeModelCreateObject A model containing the name and children... | java | public UUID addCompositeEntity(UUID appId, String versionId, CompositeEntityModel compositeModelCreateObject) {
return addCompositeEntityWithServiceResponseAsync(appId, versionId, compositeModelCreateObject).toBlocking().single().body();
} | [
"public",
"UUID",
"addCompositeEntity",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"CompositeEntityModel",
"compositeModelCreateObject",
")",
"{",
"return",
"addCompositeEntityWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"compositeModelCreateO... | Adds a composite entity extractor to the application.
@param appId The application ID.
@param versionId The version ID.
@param compositeModelCreateObject A model containing the name and children of the new entity extractor.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponse... | [
"Adds",
"a",
"composite",
"entity",
"extractor",
"to",
"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#L1550-L1552 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java | ImageLoader.displayImage | public void displayImage(String uri, ImageAware imageAware, ImageLoadingListener listener) {
"""
Adds display image task to execution pool. Image will be set to ImageAware when it's turn.<br />
Default {@linkplain DisplayImageOptions display image options} from {@linkplain ImageLoaderConfiguration
configuration}... | java | public void displayImage(String uri, ImageAware imageAware, ImageLoadingListener listener) {
displayImage(uri, imageAware, null, listener, null);
} | [
"public",
"void",
"displayImage",
"(",
"String",
"uri",
",",
"ImageAware",
"imageAware",
",",
"ImageLoadingListener",
"listener",
")",
"{",
"displayImage",
"(",
"uri",
",",
"imageAware",
",",
"null",
",",
"listener",
",",
"null",
")",
";",
"}"
] | Adds display image task to execution pool. Image will be set to ImageAware when it's turn.<br />
Default {@linkplain DisplayImageOptions display image options} from {@linkplain ImageLoaderConfiguration
configuration} will be used.<br />
<b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before t... | [
"Adds",
"display",
"image",
"task",
"to",
"execution",
"pool",
".",
"Image",
"will",
"be",
"set",
"to",
"ImageAware",
"when",
"it",
"s",
"turn",
".",
"<br",
"/",
">",
"Default",
"{",
"@linkplain",
"DisplayImageOptions",
"display",
"image",
"options",
"}",
... | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java#L143-L145 |
jnr/jnr-x86asm | src/main/java/jnr/x86asm/SerializerIntrinsics.java | SerializerIntrinsics.pcmpistri | public final void pcmpistri(XMMRegister dst, XMMRegister src, Immediate imm8) {
"""
Packed Compare Implicit Length Strings, Return Index (SSE4.2).
"""
emitX86(INST_PCMPISTRI, dst, src, imm8);
} | java | public final void pcmpistri(XMMRegister dst, XMMRegister src, Immediate imm8)
{
emitX86(INST_PCMPISTRI, dst, src, imm8);
} | [
"public",
"final",
"void",
"pcmpistri",
"(",
"XMMRegister",
"dst",
",",
"XMMRegister",
"src",
",",
"Immediate",
"imm8",
")",
"{",
"emitX86",
"(",
"INST_PCMPISTRI",
",",
"dst",
",",
"src",
",",
"imm8",
")",
";",
"}"
] | Packed Compare Implicit Length Strings, Return Index (SSE4.2). | [
"Packed",
"Compare",
"Implicit",
"Length",
"Strings",
"Return",
"Index",
"(",
"SSE4",
".",
"2",
")",
"."
] | train | https://github.com/jnr/jnr-x86asm/blob/fdcf68fb3dae49e607a49e33399e3dad1ada5536/src/main/java/jnr/x86asm/SerializerIntrinsics.java#L6551-L6554 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java | PossibleMemoryBloat.visitCode | @Override
public void visitCode(Code obj) {
"""
implements the visitor to reset the opcode stack
@param obj
the context object of the currently parsed code block
"""
stack.resetForMethodEntry(this);
userValues.clear();
jaxbContextRegs.clear();
if (Values.STATIC_INITIALI... | java | @Override
public void visitCode(Code obj) {
stack.resetForMethodEntry(this);
userValues.clear();
jaxbContextRegs.clear();
if (Values.STATIC_INITIALIZER.equals(methodName) || Values.CONSTRUCTOR.equals(methodName)) {
return;
}
super.visitCode(obj);
... | [
"@",
"Override",
"public",
"void",
"visitCode",
"(",
"Code",
"obj",
")",
"{",
"stack",
".",
"resetForMethodEntry",
"(",
"this",
")",
";",
"userValues",
".",
"clear",
"(",
")",
";",
"jaxbContextRegs",
".",
"clear",
"(",
")",
";",
"if",
"(",
"Values",
".... | implements the visitor to reset the opcode stack
@param obj
the context object of the currently parsed code block | [
"implements",
"the",
"visitor",
"to",
"reset",
"the",
"opcode",
"stack"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java#L181-L197 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/UISelectOne.java | UISelectOne.validateValue | protected void validateValue(FacesContext context, Object value) {
"""
<p><span class="changed_modified_2_0">In</span> addition to the
standard validation behavior inherited from {@link UIInput},
ensure that any specified value is equal to one of the available
options. Before comparing each option, coerce the ... | java | protected void validateValue(FacesContext context, Object value) {
// Skip validation if it is not necessary
super.validateValue(context, value);
if (!isValid() || (value == null)) {
return;
}
// Ensure that the value matches one of the available options
bo... | [
"protected",
"void",
"validateValue",
"(",
"FacesContext",
"context",
",",
"Object",
"value",
")",
"{",
"// Skip validation if it is not necessary",
"super",
".",
"validateValue",
"(",
"context",
",",
"value",
")",
";",
"if",
"(",
"!",
"isValid",
"(",
")",
"||",... | <p><span class="changed_modified_2_0">In</span> addition to the
standard validation behavior inherited from {@link UIInput},
ensure that any specified value is equal to one of the available
options. Before comparing each option, coerce the option value
type to the type of this component's value following the
Expressio... | [
"<p",
">",
"<span",
"class",
"=",
"changed_modified_2_0",
">",
"In<",
"/",
"span",
">",
"addition",
"to",
"the",
"standard",
"validation",
"behavior",
"inherited",
"from",
"{",
"@link",
"UIInput",
"}",
"ensure",
"that",
"any",
"specified",
"value",
"is",
"eq... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UISelectOne.java#L143-L175 |
juebanlin/util4j | util4j/src/main/java/net/jueb/util4j/proxy/methodProxy/MethodHandleUtil.java | MethodHandleUtil.findMethodHandle | public static MethodHandle findMethodHandle(Object target,String methodName,Object ...args) {
"""
获取对象方法句柄
@param target 对象
@param methodName 方法名
@param ptypes 方法参数列表
@return
"""
Class<?>[] ptypes = new Class<?>[args.length];
for(int i=0;i<args.length;i++)
{
ptypes[i]=args[i].getClass();
}
... | java | public static MethodHandle findMethodHandle(Object target,String methodName,Object ...args)
{
Class<?>[] ptypes = new Class<?>[args.length];
for(int i=0;i<args.length;i++)
{
ptypes[i]=args[i].getClass();
}
return findMethodHandle(target, methodName, ptypes);
} | [
"public",
"static",
"MethodHandle",
"findMethodHandle",
"(",
"Object",
"target",
",",
"String",
"methodName",
",",
"Object",
"...",
"args",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"ptypes",
"=",
"new",
"Class",
"<",
"?",
">",
"[",
"args",
".",
"len... | 获取对象方法句柄
@param target 对象
@param methodName 方法名
@param ptypes 方法参数列表
@return | [
"获取对象方法句柄"
] | train | https://github.com/juebanlin/util4j/blob/c404b2dbdedf7a8890533b351257fa8af4f1439f/util4j/src/main/java/net/jueb/util4j/proxy/methodProxy/MethodHandleUtil.java#L51-L59 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java | LibraryCacheManager.registerInternal | private void registerInternal(final JobID id, final Path[] clientPaths) throws IOException {
"""
Registers a job ID with a set of library paths that are required to run the job. The library paths are given in
terms
of client paths, so the method first translates the client paths into the corresponding internal c... | java | private void registerInternal(final JobID id, final Path[] clientPaths) throws IOException {
final String[] cacheNames = new String[clientPaths.length];
for (int i = 0; i < clientPaths.length; ++i) {
final LibraryTranslationKey key = new LibraryTranslationKey(id, clientPaths[i]);
cacheNames[i] = this.client... | [
"private",
"void",
"registerInternal",
"(",
"final",
"JobID",
"id",
",",
"final",
"Path",
"[",
"]",
"clientPaths",
")",
"throws",
"IOException",
"{",
"final",
"String",
"[",
"]",
"cacheNames",
"=",
"new",
"String",
"[",
"clientPaths",
".",
"length",
"]",
"... | Registers a job ID with a set of library paths that are required to run the job. The library paths are given in
terms
of client paths, so the method first translates the client paths into the corresponding internal cache names. For
every registered
job the library cache manager creates a class loader that is used to in... | [
"Registers",
"a",
"job",
"ID",
"with",
"a",
"set",
"of",
"library",
"paths",
"that",
"are",
"required",
"to",
"run",
"the",
"job",
".",
"The",
"library",
"paths",
"are",
"given",
"in",
"terms",
"of",
"client",
"paths",
"so",
"the",
"method",
"first",
"... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java#L246-L260 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.getProfileAfter | public ProfileRequest getProfileAfter(@NonNull AuthenticationRequest authenticationRequest) {
"""
Fetch the user's profile after it's authenticated by a login request.
If the login request fails, the returned request will fail
@param authenticationRequest that will authenticate a user with Auth0 and return a {... | java | public ProfileRequest getProfileAfter(@NonNull AuthenticationRequest authenticationRequest) {
final ParameterizableRequest<UserProfile, AuthenticationException> profileRequest = profileRequest();
return new ProfileRequest(authenticationRequest, profileRequest);
} | [
"public",
"ProfileRequest",
"getProfileAfter",
"(",
"@",
"NonNull",
"AuthenticationRequest",
"authenticationRequest",
")",
"{",
"final",
"ParameterizableRequest",
"<",
"UserProfile",
",",
"AuthenticationException",
">",
"profileRequest",
"=",
"profileRequest",
"(",
")",
"... | Fetch the user's profile after it's authenticated by a login request.
If the login request fails, the returned request will fail
@param authenticationRequest that will authenticate a user with Auth0 and return a {@link Credentials}
@return a {@link ProfileRequest} that first logins and the fetches the profile | [
"Fetch",
"the",
"user",
"s",
"profile",
"after",
"it",
"s",
"authenticated",
"by",
"a",
"login",
"request",
".",
"If",
"the",
"login",
"request",
"fails",
"the",
"returned",
"request",
"will",
"fail"
] | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L1027-L1030 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Beta.java | Beta.PowerSeries | public static double PowerSeries(double a, double b, double x) {
"""
Power series for incomplete beta integral. Use when b*x is small and x not too close to 1.
@param a Value.
@param b Value.
@param x Value.
@return Result.
"""
double s, t, u, v, n, t1, z, ai;
ai = 1.0 / a;
u = (... | java | public static double PowerSeries(double a, double b, double x) {
double s, t, u, v, n, t1, z, ai;
ai = 1.0 / a;
u = (1.0 - b) * x;
v = u / (a + 1.0);
t1 = v;
t = u;
n = 2.0;
s = 0.0;
z = Constants.DoubleEpsilon * ai;
while (Math.abs(v) > z... | [
"public",
"static",
"double",
"PowerSeries",
"(",
"double",
"a",
",",
"double",
"b",
",",
"double",
"x",
")",
"{",
"double",
"s",
",",
"t",
",",
"u",
",",
"v",
",",
"n",
",",
"t1",
",",
"z",
",",
"ai",
";",
"ai",
"=",
"1.0",
"/",
"a",
";",
... | Power series for incomplete beta integral. Use when b*x is small and x not too close to 1.
@param a Value.
@param b Value.
@param x Value.
@return Result. | [
"Power",
"series",
"for",
"incomplete",
"beta",
"integral",
".",
"Use",
"when",
"b",
"*",
"x",
"is",
"small",
"and",
"x",
"not",
"too",
"close",
"to",
"1",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Beta.java#L345-L376 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/commons/IOUtils.java | IOUtils.copyLarge | public static long copyLarge(InputStream input, OutputStream output)
throws IOException {
"""
Copy bytes from a large (over 2GB) <code>InputStream</code> to an
<code>OutputStream</code>.
<p>
This method buffers the input internally, so there is no need to use a
<code>BufferedInputStream</code>.
<p>
The... | java | public static long copyLarge(InputStream input, OutputStream output)
throws IOException {
return copyLarge(input, output, new byte[DEFAULT_BUFFER_SIZE]);
} | [
"public",
"static",
"long",
"copyLarge",
"(",
"InputStream",
"input",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"return",
"copyLarge",
"(",
"input",
",",
"output",
",",
"new",
"byte",
"[",
"DEFAULT_BUFFER_SIZE",
"]",
")",
";",
"}"
] | Copy bytes from a large (over 2GB) <code>InputStream</code> to an
<code>OutputStream</code>.
<p>
This method buffers the input internally, so there is no need to use a
<code>BufferedInputStream</code>.
<p>
The buffer size is given by {@link #DEFAULT_BUFFER_SIZE}.
@param input the <code>InputStream</code> to read from... | [
"Copy",
"bytes",
"from",
"a",
"large",
"(",
"over",
"2GB",
")",
"<code",
">",
"InputStream<",
"/",
"code",
">",
"to",
"an",
"<code",
">",
"OutputStream<",
"/",
"code",
">",
".",
"<p",
">",
"This",
"method",
"buffers",
"the",
"input",
"internally",
"so"... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/commons/IOUtils.java#L297-L300 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java | AmazonDynamoDBClient.getItem | public GetItemResult getItem(GetItemRequest getItemRequest)
throws AmazonServiceException, AmazonClientException {
"""
<p>
Retrieves a set of Attributes for an item that matches the primary
key.
</p>
<p>
The <code>GetItem</code> operation provides an eventually-consistent
read by default. If even... | java | public GetItemResult getItem(GetItemRequest getItemRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(getItemRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request<GetIte... | [
"public",
"GetItemResult",
"getItem",
"(",
"GetItemRequest",
"getItemRequest",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
"{",
"ExecutionContext",
"executionContext",
"=",
"createExecutionContext",
"(",
"getItemRequest",
")",
";",
"AWSRequestMetric... | <p>
Retrieves a set of Attributes for an item that matches the primary
key.
</p>
<p>
The <code>GetItem</code> operation provides an eventually-consistent
read by default. If eventually-consistent reads are not acceptable for
your application, use <code>ConsistentRead</code> . Although this
operation might take longer t... | [
"<p",
">",
"Retrieves",
"a",
"set",
"of",
"Attributes",
"for",
"an",
"item",
"that",
"matches",
"the",
"primary",
"key",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"<code",
">",
"GetItem<",
"/",
"code",
">",
"operation",
"provides",
"an",
"eventually",... | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java#L854-L866 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.getValidSkusWithServiceResponseAsync | public Observable<ServiceResponse<Page<IotHubSkuDescriptionInner>>> getValidSkusWithServiceResponseAsync(final String resourceGroupName, final String resourceName) {
"""
Get the list of valid SKUs for an IoT hub.
Get the list of valid SKUs for an IoT hub.
@param resourceGroupName The name of the resource group... | java | public Observable<ServiceResponse<Page<IotHubSkuDescriptionInner>>> getValidSkusWithServiceResponseAsync(final String resourceGroupName, final String resourceName) {
return getValidSkusSinglePageAsync(resourceGroupName, resourceName)
.concatMap(new Func1<ServiceResponse<Page<IotHubSkuDescriptionInne... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"IotHubSkuDescriptionInner",
">",
">",
">",
"getValidSkusWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"resourceName",
")",
"{",
"return",
"getValidSkusSi... | Get the list of valid SKUs for an IoT hub.
Get the list of valid SKUs for an IoT hub.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the P... | [
"Get",
"the",
"list",
"of",
"valid",
"SKUs",
"for",
"an",
"IoT",
"hub",
".",
"Get",
"the",
"list",
"of",
"valid",
"SKUs",
"for",
"an",
"IoT",
"hub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L1564-L1576 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobHistory.java | JobHistory.parseHistoryFromFS | public static void parseHistoryFromFS(String path, Listener l, FileSystem fs)
throws IOException {
"""
Parses history file and invokes Listener.handle() for
each line of history. It can be used for looking through history
files for specific items without having to keep whole history in memory.
@param path pat... | java | public static void parseHistoryFromFS(String path, Listener l, FileSystem fs)
throws IOException{
FSDataInputStream in = fs.open(new Path(path));
BufferedReader reader = new BufferedReader(new InputStreamReader (in));
try {
String line = null;
StringBuffer buf = new StringBuffer();
... | [
"public",
"static",
"void",
"parseHistoryFromFS",
"(",
"String",
"path",
",",
"Listener",
"l",
",",
"FileSystem",
"fs",
")",
"throws",
"IOException",
"{",
"FSDataInputStream",
"in",
"=",
"fs",
".",
"open",
"(",
"new",
"Path",
"(",
"path",
")",
")",
";",
... | Parses history file and invokes Listener.handle() for
each line of history. It can be used for looking through history
files for specific items without having to keep whole history in memory.
@param path path to history file
@param l Listener for history events
@param fs FileSystem where history file is present
@throws... | [
"Parses",
"history",
"file",
"and",
"invokes",
"Listener",
".",
"handle",
"()",
"for",
"each",
"line",
"of",
"history",
".",
"It",
"can",
"be",
"used",
"for",
"looking",
"through",
"history",
"files",
"for",
"specific",
"items",
"without",
"having",
"to",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobHistory.java#L573-L611 |
mgormley/prim | src/main/java_generated/edu/jhu/prim/vector/LongIntDenseVector.java | LongIntDenseVector.add | public void add(LongIntVector other) {
"""
Updates this vector to be the entrywise sum of this vector with the other.
"""
if (other instanceof LongIntUnsortedVector) {
LongIntUnsortedVector vec = (LongIntUnsortedVector) other;
for (int i=0; i<vec.top; i++) {
this... | java | public void add(LongIntVector other) {
if (other instanceof LongIntUnsortedVector) {
LongIntUnsortedVector vec = (LongIntUnsortedVector) other;
for (int i=0; i<vec.top; i++) {
this.add(vec.idx[i], vec.vals[i]);
}
} else {
// TODO: Add spec... | [
"public",
"void",
"add",
"(",
"LongIntVector",
"other",
")",
"{",
"if",
"(",
"other",
"instanceof",
"LongIntUnsortedVector",
")",
"{",
"LongIntUnsortedVector",
"vec",
"=",
"(",
"LongIntUnsortedVector",
")",
"other",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Updates this vector to be the entrywise sum of this vector with the other. | [
"Updates",
"this",
"vector",
"to",
"be",
"the",
"entrywise",
"sum",
"of",
"this",
"vector",
"with",
"the",
"other",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/vector/LongIntDenseVector.java#L143-L153 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPLepetitEPnP.java | PnPLepetitEPnP.selectWorldControlPoints | public void selectWorldControlPoints(List<Point3D_F64> worldPts, FastQueue<Point3D_F64> controlWorldPts) {
"""
Selects control points along the data's axis and the data's centroid. If the data is determined
to be planar then only 3 control points are selected.
The data's axis is determined by computing the co... | java | public void selectWorldControlPoints(List<Point3D_F64> worldPts, FastQueue<Point3D_F64> controlWorldPts) {
UtilPoint3D_F64.mean(worldPts,meanWorldPts);
// covariance matrix elements, summed up here for speed
double c11=0,c12=0,c13=0,c22=0,c23=0,c33=0;
final int N = worldPts.size();
for( int i = 0; i < N; i... | [
"public",
"void",
"selectWorldControlPoints",
"(",
"List",
"<",
"Point3D_F64",
">",
"worldPts",
",",
"FastQueue",
"<",
"Point3D_F64",
">",
"controlWorldPts",
")",
"{",
"UtilPoint3D_F64",
".",
"mean",
"(",
"worldPts",
",",
"meanWorldPts",
")",
";",
"// covariance m... | Selects control points along the data's axis and the data's centroid. If the data is determined
to be planar then only 3 control points are selected.
The data's axis is determined by computing the covariance matrix then performing SVD. The axis
is contained along the | [
"Selects",
"control",
"points",
"along",
"the",
"data",
"s",
"axis",
"and",
"the",
"data",
"s",
"centroid",
".",
"If",
"the",
"data",
"is",
"determined",
"to",
"be",
"planar",
"then",
"only",
"3",
"control",
"points",
"are",
"selected",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPLepetitEPnP.java#L314-L364 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/CharacterApi.java | CharacterApi.getCharactersCharacterId | public CharacterResponse getCharactersCharacterId(Integer characterId, String datasource, String ifNoneMatch)
throws ApiException {
"""
Get character's public information Public information about a
character --- This route is cached for up to 3600 seconds
@param characterId
An EVE character ID... | java | public CharacterResponse getCharactersCharacterId(Integer characterId, String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<CharacterResponse> resp = getCharactersCharacterIdWithHttpInfo(characterId, datasource, ifNoneMatch);
return resp.getData();
} | [
"public",
"CharacterResponse",
"getCharactersCharacterId",
"(",
"Integer",
"characterId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"CharacterResponse",
">",
"resp",
"=",
"getCharactersCharacterIdWit... | Get character's public information Public information about a
character --- This route is cached for up to 3600 seconds
@param characterId
An EVE character ID (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous request. A ... | [
"Get",
"character'",
";",
"s",
"public",
"information",
"Public",
"information",
"about",
"a",
"character",
"---",
"This",
"route",
"is",
"cached",
"for",
"up",
"to",
"3600",
"seconds"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/CharacterApi.java#L153-L157 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/endpoint/resolver/DynamicEndpointUriResolver.java | DynamicEndpointUriResolver.appendRequestPath | private String appendRequestPath(String uri, Map<String, Object> headers) {
"""
Appends optional request path to endpoint uri.
@param uri
@param headers
@return
"""
if (!headers.containsKey(REQUEST_PATH_HEADER_NAME)) {
return uri;
}
String requestUri = uri;
Strin... | java | private String appendRequestPath(String uri, Map<String, Object> headers) {
if (!headers.containsKey(REQUEST_PATH_HEADER_NAME)) {
return uri;
}
String requestUri = uri;
String path = headers.get(REQUEST_PATH_HEADER_NAME).toString();
while (requestUri.endsWith("/")) ... | [
"private",
"String",
"appendRequestPath",
"(",
"String",
"uri",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
")",
"{",
"if",
"(",
"!",
"headers",
".",
"containsKey",
"(",
"REQUEST_PATH_HEADER_NAME",
")",
")",
"{",
"return",
"uri",
";",
"}",
... | Appends optional request path to endpoint uri.
@param uri
@param headers
@return | [
"Appends",
"optional",
"request",
"path",
"to",
"endpoint",
"uri",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/endpoint/resolver/DynamicEndpointUriResolver.java#L76-L93 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.putUnauthorizedRedirectUrlIntoFlowScope | public static void putUnauthorizedRedirectUrlIntoFlowScope(final RequestContext context, final URI url) {
"""
Adds the unauthorized redirect url to the flow scope.
@param context the request context
@param url the uri to redirect the flow
"""
context.getFlowScope().put(PARAMETER_UNAUTHORIZED_RE... | java | public static void putUnauthorizedRedirectUrlIntoFlowScope(final RequestContext context, final URI url) {
context.getFlowScope().put(PARAMETER_UNAUTHORIZED_REDIRECT_URL, url);
} | [
"public",
"static",
"void",
"putUnauthorizedRedirectUrlIntoFlowScope",
"(",
"final",
"RequestContext",
"context",
",",
"final",
"URI",
"url",
")",
"{",
"context",
".",
"getFlowScope",
"(",
")",
".",
"put",
"(",
"PARAMETER_UNAUTHORIZED_REDIRECT_URL",
",",
"url",
")",... | Adds the unauthorized redirect url to the flow scope.
@param context the request context
@param url the uri to redirect the flow | [
"Adds",
"the",
"unauthorized",
"redirect",
"url",
"to",
"the",
"flow",
"scope",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L249-L251 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/tsdb/model/ValueFilter.java | ValueFilter.createValueFilter | public static ValueFilter createValueFilter(String operation, String value) {
"""
Create value filter for String type.
@param operation Operation for comparing which only support =, !=, >, <, >= and <=.
@param value Value for comparing with.
@return ValueFilter
"""
checkArgument(STRING... | java | public static ValueFilter createValueFilter(String operation, String value) {
checkArgument(STRING_SUPPORTED_OPERATION.contains(operation), "String value only support operations in "
+ STRING_SUPPORTED_OPERATION.toString());
ValueFilter valueFilter = new ValueFilter(operation, SINGLE_QUO... | [
"public",
"static",
"ValueFilter",
"createValueFilter",
"(",
"String",
"operation",
",",
"String",
"value",
")",
"{",
"checkArgument",
"(",
"STRING_SUPPORTED_OPERATION",
".",
"contains",
"(",
"operation",
")",
",",
"\"String value only support operations in \"",
"+",
"S... | Create value filter for String type.
@param operation Operation for comparing which only support =, !=, >, <, >= and <=.
@param value Value for comparing with.
@return ValueFilter | [
"Create",
"value",
"filter",
"for",
"String",
"type",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/tsdb/model/ValueFilter.java#L79-L84 |
fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/SimpleObserver.java | SimpleObserver.handleMoveEvents | private static Function<FedoraEvent, Stream<FedoraEvent>> handleMoveEvents(final Session session) {
"""
Note: This function maps a FedoraEvent to a Stream of some number of FedoraEvents. This is because a MOVE event
may lead to an arbitrarily large number of additional events for any child resources. In the event... | java | private static Function<FedoraEvent, Stream<FedoraEvent>> handleMoveEvents(final Session session) {
return evt -> {
if (evt.getTypes().contains(RESOURCE_RELOCATION)) {
final Map<String, String> movePath = evt.getInfo();
final String dest = movePath.get("destAbsPath");... | [
"private",
"static",
"Function",
"<",
"FedoraEvent",
",",
"Stream",
"<",
"FedoraEvent",
">",
">",
"handleMoveEvents",
"(",
"final",
"Session",
"session",
")",
"{",
"return",
"evt",
"->",
"{",
"if",
"(",
"evt",
".",
"getTypes",
"(",
")",
".",
"contains",
... | Note: This function maps a FedoraEvent to a Stream of some number of FedoraEvents. This is because a MOVE event
may lead to an arbitrarily large number of additional events for any child resources. In the event of this not
being a MOVE event, the same FedoraEvent is returned, wrapped in a Stream. For a MOVEd resource, ... | [
"Note",
":",
"This",
"function",
"maps",
"a",
"FedoraEvent",
"to",
"a",
"Stream",
"of",
"some",
"number",
"of",
"FedoraEvents",
".",
"This",
"is",
"because",
"a",
"MOVE",
"event",
"may",
"lead",
"to",
"an",
"arbitrarily",
"large",
"number",
"of",
"addition... | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/SimpleObserver.java#L107-L129 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/Convert.java | Convert.toBool | public static Boolean toBool(Object value, Boolean defaultValue) {
"""
转换为boolean<br>
String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值<br>
转换失败不会报错
@param value 被转换的值
@param defaultValue 转换错误时的默认值
@return 结果
"""
return convert(Boolean.class, value, defaultValue);
} | java | public static Boolean toBool(Object value, Boolean defaultValue) {
return convert(Boolean.class, value, defaultValue);
} | [
"public",
"static",
"Boolean",
"toBool",
"(",
"Object",
"value",
",",
"Boolean",
"defaultValue",
")",
"{",
"return",
"convert",
"(",
"Boolean",
".",
"class",
",",
"value",
",",
"defaultValue",
")",
";",
"}"
] | 转换为boolean<br>
String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值<br>
转换失败不会报错
@param value 被转换的值
@param defaultValue 转换错误时的默认值
@return 结果 | [
"转换为boolean<br",
">",
"String支持的值为:true、false、yes、ok、no,1",
"0",
"如果给定的值为空,或者转换失败,返回默认值<br",
">",
"转换失败不会报错"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L361-L363 |
dkmfbk/knowledgestore | ks-core/src/main/java/eu/fbk/knowledgestore/data/XPath.java | XPath.asFunctionUnique | public final <T> Function<Object, T> asFunctionUnique(final Class<T> resultClass) {
"""
Returns a function view of this {@code XPath} expression that produces a unique {@code T}
result given an input object. If this {@code XPath} is lenient, evaluation of the function
will return null on failure, rather than thr... | java | public final <T> Function<Object, T> asFunctionUnique(final Class<T> resultClass) {
Preconditions.checkNotNull(resultClass);
return new Function<Object, T>() {
@Override
public T apply(@Nullable final Object object) {
Preconditions.checkNotNull(object);
... | [
"public",
"final",
"<",
"T",
">",
"Function",
"<",
"Object",
",",
"T",
">",
"asFunctionUnique",
"(",
"final",
"Class",
"<",
"T",
">",
"resultClass",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"resultClass",
")",
";",
"return",
"new",
"Function",
... | Returns a function view of this {@code XPath} expression that produces a unique {@code T}
result given an input object. If this {@code XPath} is lenient, evaluation of the function
will return null on failure, rather than throwing an {@link IllegalArgumentException}.
@param resultClass
the {@code Class} object for the... | [
"Returns",
"a",
"function",
"view",
"of",
"this",
"{",
"@code",
"XPath",
"}",
"expression",
"that",
"produces",
"a",
"unique",
"{",
"@code",
"T",
"}",
"result",
"given",
"an",
"input",
"object",
".",
"If",
"this",
"{",
"@code",
"XPath",
"}",
"is",
"len... | train | https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-core/src/main/java/eu/fbk/knowledgestore/data/XPath.java#L852-L865 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.getAccountTransactions | public Transactions getAccountTransactions(final String accountCode, final TransactionState state, final TransactionType type, final QueryParams params) {
"""
Lookup an account's transactions history given query params
<p>
Returns the account's transaction history
@param accountCode recurly account id
@param... | java | public Transactions getAccountTransactions(final String accountCode, final TransactionState state, final TransactionType type, final QueryParams params) {
if (state != null) params.put("state", state.getType());
if (type != null) params.put("type", type.getType());
return doGET(Accounts.ACCOUNT... | [
"public",
"Transactions",
"getAccountTransactions",
"(",
"final",
"String",
"accountCode",
",",
"final",
"TransactionState",
"state",
",",
"final",
"TransactionType",
"type",
",",
"final",
"QueryParams",
"params",
")",
"{",
"if",
"(",
"state",
"!=",
"null",
")",
... | Lookup an account's transactions history given query params
<p>
Returns the account's transaction history
@param accountCode recurly account id
@param state {@link TransactionState}
@param type {@link TransactionType}
@param params {@link QueryParams}
@return the transaction history associated with this account on suc... | [
"Lookup",
"an",
"account",
"s",
"transactions",
"history",
"given",
"query",
"params",
"<p",
">",
"Returns",
"the",
"account",
"s",
"transaction",
"history"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L879-L885 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java | BigtableDataClient.readRowCallable | public <RowT> UnaryCallable<Query, RowT> readRowCallable(RowAdapter<RowT> rowAdapter) {
"""
Reads a single row. This callable allows for customization of the logical representation of a
row. It's meant for advanced use cases.
<p>Sample code:
<pre>{@code
try (BigtableDataClient bigtableDataClient = Bigtable... | java | public <RowT> UnaryCallable<Query, RowT> readRowCallable(RowAdapter<RowT> rowAdapter) {
return stub.createReadRowCallable(rowAdapter);
} | [
"public",
"<",
"RowT",
">",
"UnaryCallable",
"<",
"Query",
",",
"RowT",
">",
"readRowCallable",
"(",
"RowAdapter",
"<",
"RowT",
">",
"rowAdapter",
")",
"{",
"return",
"stub",
".",
"createReadRowCallable",
"(",
"rowAdapter",
")",
";",
"}"
] | Reads a single row. This callable allows for customization of the logical representation of a
row. It's meant for advanced use cases.
<p>Sample code:
<pre>{@code
try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
String tableId = "[TABLE]";
Query query = Query.create... | [
"Reads",
"a",
"single",
"row",
".",
"This",
"callable",
"allows",
"for",
"customization",
"of",
"the",
"logical",
"representation",
"of",
"a",
"row",
".",
"It",
"s",
"meant",
"for",
"advanced",
"use",
"cases",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java#L496-L498 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java | ParagraphVectors.nearestLabels | public Collection<String> nearestLabels(@NonNull Collection<VocabWord> document, int topN) {
"""
This method returns top N labels nearest to specified set of vocab words
@param document
@param topN
@return
"""
if (document.isEmpty())
throw new ND4JIllegalStateException("Impossible to g... | java | public Collection<String> nearestLabels(@NonNull Collection<VocabWord> document, int topN) {
if (document.isEmpty())
throw new ND4JIllegalStateException("Impossible to get nearestLabels for empty list of words");
INDArray vector = inferVector(new ArrayList<VocabWord>(document));
ret... | [
"public",
"Collection",
"<",
"String",
">",
"nearestLabels",
"(",
"@",
"NonNull",
"Collection",
"<",
"VocabWord",
">",
"document",
",",
"int",
"topN",
")",
"{",
"if",
"(",
"document",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"ND4JIllegalStateException"... | This method returns top N labels nearest to specified set of vocab words
@param document
@param topN
@return | [
"This",
"method",
"returns",
"top",
"N",
"labels",
"nearest",
"to",
"specified",
"set",
"of",
"vocab",
"words"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L558-L564 |
cverges/expect4j | src/main/java/expect4j/ExpectUtils.java | ExpectUtils.Http | public static String Http(String remotehost, String url) throws Exception {
"""
Creates an HTTP client connection to a specified HTTP server and
returns the entire response. This function simulates <code>curl
http://remotehost/url</code>.
@param remotehost the DNS or IP address of the HTTP server
@param url... | java | public static String Http(String remotehost, String url) throws Exception {
return Http(remotehost, 80, url);
} | [
"public",
"static",
"String",
"Http",
"(",
"String",
"remotehost",
",",
"String",
"url",
")",
"throws",
"Exception",
"{",
"return",
"Http",
"(",
"remotehost",
",",
"80",
",",
"url",
")",
";",
"}"
] | Creates an HTTP client connection to a specified HTTP server and
returns the entire response. This function simulates <code>curl
http://remotehost/url</code>.
@param remotehost the DNS or IP address of the HTTP server
@param url the path/file of the resource to look up on the HTTP
server
@return the response from the... | [
"Creates",
"an",
"HTTP",
"client",
"connection",
"to",
"a",
"specified",
"HTTP",
"server",
"and",
"returns",
"the",
"entire",
"response",
".",
"This",
"function",
"simulates",
"<code",
">",
"curl",
"http",
":",
"//",
"remotehost",
"/",
"url<",
"/",
"code",
... | train | https://github.com/cverges/expect4j/blob/97b1da9b7bd231344cd7b7ce26d14caf8bb16cd6/src/main/java/expect4j/ExpectUtils.java#L56-L58 |
lessthanoptimal/ddogleg | src/org/ddogleg/solver/PolynomialSolver.java | PolynomialSolver.cubicDiscriminant | public static double cubicDiscriminant(double a, double b, double c, double d) {
"""
<p>The cubic discriminant is used to determine the type of roots.</p>
<ul>
<li>if d {@code >} 0, then three distinct real roots</li>
<li>if d = 0, then it has a multiple root and all will be real</li>
<li>if d {@code <} 0, the... | java | public static double cubicDiscriminant(double a, double b, double c, double d) {
return 18.0*d*c*b*a -4*c*c*c*a + c*c*b*b -4*d*b*b*b - 27*d*d*a*a;
} | [
"public",
"static",
"double",
"cubicDiscriminant",
"(",
"double",
"a",
",",
"double",
"b",
",",
"double",
"c",
",",
"double",
"d",
")",
"{",
"return",
"18.0",
"*",
"d",
"*",
"c",
"*",
"b",
"*",
"a",
"-",
"4",
"*",
"c",
"*",
"c",
"*",
"c",
"*",
... | <p>The cubic discriminant is used to determine the type of roots.</p>
<ul>
<li>if d {@code >} 0, then three distinct real roots</li>
<li>if d = 0, then it has a multiple root and all will be real</li>
<li>if d {@code <} 0, then one real and two non-real complex conjugate roots</li>
</ul>
<p>
From http://en.wikipedia.o... | [
"<p",
">",
"The",
"cubic",
"discriminant",
"is",
"used",
"to",
"determine",
"the",
"type",
"of",
"roots",
".",
"<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"if",
"d",
"{",
"@code",
">",
"}",
"0",
"then",
"three",
"distinct",
"real",
"roots<",
"/",
... | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/solver/PolynomialSolver.java#L159-L161 |
Red5/red5-io | src/main/java/org/red5/io/matroska/parser/TagCrawler.java | TagCrawler.addHandler | public TagCrawler addHandler(String name, TagHandler handler) {
"""
Method to add {@link TagHandler}
@param name
- unique name of tag handler
@param handler
- handler
@return - this for chaining
"""
handlers.put(name, handler);
return this;
} | java | public TagCrawler addHandler(String name, TagHandler handler) {
handlers.put(name, handler);
return this;
} | [
"public",
"TagCrawler",
"addHandler",
"(",
"String",
"name",
",",
"TagHandler",
"handler",
")",
"{",
"handlers",
".",
"put",
"(",
"name",
",",
"handler",
")",
";",
"return",
"this",
";",
"}"
] | Method to add {@link TagHandler}
@param name
- unique name of tag handler
@param handler
- handler
@return - this for chaining | [
"Method",
"to",
"add",
"{",
"@link",
"TagHandler",
"}"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/matroska/parser/TagCrawler.java#L60-L63 |
calimero-project/calimero-core | src/tuwien/auto/calimero/knxnetip/util/CRI.java | CRI.createRequest | public static CRI createRequest(final byte[] data, final int offset) throws KNXFormatException {
"""
Creates a new CRI out of a byte array.
<p>
If possible, a matching, more specific, CRI subtype is returned. Note, that CRIs
for specific communication types might expect certain characteristics on
<code>data</c... | java | public static CRI createRequest(final byte[] data, final int offset) throws KNXFormatException
{
return (CRI) create(true, data, offset);
} | [
"public",
"static",
"CRI",
"createRequest",
"(",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"int",
"offset",
")",
"throws",
"KNXFormatException",
"{",
"return",
"(",
"CRI",
")",
"create",
"(",
"true",
",",
"data",
",",
"offset",
")",
";",
"}"
] | Creates a new CRI out of a byte array.
<p>
If possible, a matching, more specific, CRI subtype is returned. Note, that CRIs
for specific communication types might expect certain characteristics on
<code>data</code> (regarding contained data).<br>
@param data byte array containing the CRI structure
@param offset start ... | [
"Creates",
"a",
"new",
"CRI",
"out",
"of",
"a",
"byte",
"array",
".",
"<p",
">",
"If",
"possible",
"a",
"matching",
"more",
"specific",
"CRI",
"subtype",
"is",
"returned",
".",
"Note",
"that",
"CRIs",
"for",
"specific",
"communication",
"types",
"might",
... | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/util/CRI.java#L100-L103 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.notNullOrEmpty | public static void notNullOrEmpty(String parameter, String name) throws IllegalArgumentException {
"""
Test if string parameter is not null or empty.
@param parameter invocation string parameter,
@param name the name of invocation parameter.
@throws IllegalArgumentException if <code>parameter</code> is null o... | java | public static void notNullOrEmpty(String parameter, String name) throws IllegalArgumentException {
if (parameter == null || parameter.isEmpty()) {
throw new IllegalArgumentException(name + " is null or empty.");
}
} | [
"public",
"static",
"void",
"notNullOrEmpty",
"(",
"String",
"parameter",
",",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"parameter",
"==",
"null",
"||",
"parameter",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"Ill... | Test if string parameter is not null or empty.
@param parameter invocation string parameter,
@param name the name of invocation parameter.
@throws IllegalArgumentException if <code>parameter</code> is null or empty. | [
"Test",
"if",
"string",
"parameter",
"is",
"not",
"null",
"or",
"empty",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L94-L98 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/HibernateMappingContextConfiguration.java | HibernateMappingContextConfiguration.setDataSourceConnectionSource | public void setDataSourceConnectionSource(ConnectionSource<DataSource, DataSourceSettings> connectionSource) {
"""
Set the target SQL {@link DataSource}
@param connectionSource The data source to use
"""
this.dataSourceName = connectionSource.getName();
DataSource source = connectionSource.g... | java | public void setDataSourceConnectionSource(ConnectionSource<DataSource, DataSourceSettings> connectionSource) {
this.dataSourceName = connectionSource.getName();
DataSource source = connectionSource.getSource();
getProperties().put(Environment.DATASOURCE, source);
getProperties().put(Envi... | [
"public",
"void",
"setDataSourceConnectionSource",
"(",
"ConnectionSource",
"<",
"DataSource",
",",
"DataSourceSettings",
">",
"connectionSource",
")",
"{",
"this",
".",
"dataSourceName",
"=",
"connectionSource",
".",
"getName",
"(",
")",
";",
"DataSource",
"source",
... | Set the target SQL {@link DataSource}
@param connectionSource The data source to use | [
"Set",
"the",
"target",
"SQL",
"{",
"@link",
"DataSource",
"}"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/HibernateMappingContextConfiguration.java#L103-L114 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java | JdbcAccessImpl.setLockingValues | private void setLockingValues(ClassDescriptor cld, Object obj, ValueContainer[] oldLockingValues) {
"""
Set the locking values
@param cld
@param obj
@param oldLockingValues
"""
FieldDescriptor fields[] = cld.getLockingFields();
for (int i=0; i<fields.length; i++)
{
... | java | private void setLockingValues(ClassDescriptor cld, Object obj, ValueContainer[] oldLockingValues)
{
FieldDescriptor fields[] = cld.getLockingFields();
for (int i=0; i<fields.length; i++)
{
PersistentField field = fields[i].getPersistentField();
Object lockVal ... | [
"private",
"void",
"setLockingValues",
"(",
"ClassDescriptor",
"cld",
",",
"Object",
"obj",
",",
"ValueContainer",
"[",
"]",
"oldLockingValues",
")",
"{",
"FieldDescriptor",
"fields",
"[",
"]",
"=",
"cld",
".",
"getLockingFields",
"(",
")",
";",
"for",
"(",
... | Set the locking values
@param cld
@param obj
@param oldLockingValues | [
"Set",
"the",
"locking",
"values"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java#L625-L636 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Utils.java | Utils.abbreviateInt | public static String abbreviateInt(Number number, int decPlaces) {
"""
Abbreviates an integer by adding a letter suffix at the end.
E.g. "M" for millions, "K" for thousands, etc.
@param number a big integer
@param decPlaces decimal places
@return the rounded integer as a string
"""
if (number == null) {
... | java | public static String abbreviateInt(Number number, int decPlaces) {
if (number == null) {
return "";
}
String abbrevn = number.toString();
// 2 decimal places => 100, 3 => 1000, etc
decPlaces = (int) Math.pow(10, decPlaces);
// Enumerate number abbreviations
String[] abbrev = {"K", "M", "B", "T"};
boo... | [
"public",
"static",
"String",
"abbreviateInt",
"(",
"Number",
"number",
",",
"int",
"decPlaces",
")",
"{",
"if",
"(",
"number",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"String",
"abbrevn",
"=",
"number",
".",
"toString",
"(",
")",
";",
"// ... | Abbreviates an integer by adding a letter suffix at the end.
E.g. "M" for millions, "K" for thousands, etc.
@param number a big integer
@param decPlaces decimal places
@return the rounded integer as a string | [
"Abbreviates",
"an",
"integer",
"by",
"adding",
"a",
"letter",
"suffix",
"at",
"the",
"end",
".",
"E",
".",
"g",
".",
"M",
"for",
"millions",
"K",
"for",
"thousands",
"etc",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Utils.java#L561-L587 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java | InstanceFailoverGroupsInner.createOrUpdateAsync | public Observable<InstanceFailoverGroupInner> createOrUpdateAsync(String resourceGroupName, String locationName, String failoverGroupName, InstanceFailoverGroupInner parameters) {
"""
Creates or updates a failover group.
@param resourceGroupName The name of the resource group that contains the resource. You can... | java | public Observable<InstanceFailoverGroupInner> createOrUpdateAsync(String resourceGroupName, String locationName, String failoverGroupName, InstanceFailoverGroupInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName, parameters).map(new Func1<ServiceR... | [
"public",
"Observable",
"<",
"InstanceFailoverGroupInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"locationName",
",",
"String",
"failoverGroupName",
",",
"InstanceFailoverGroupInner",
"parameters",
")",
"{",
"return",
"createOrUpdate... | Creates or updates a failover group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param locationName The name of the region where the resource is located.
@param failoverGroupName The name of the failov... | [
"Creates",
"or",
"updates",
"a",
"failover",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java#L245-L252 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java | BitsUtil.previousSetBit | public static int previousSetBit(long v, int start) {
"""
Find the previous set bit.
@param v Value to process
@param start Start position (inclusive)
@return Position of previous set bit, or -1.
"""
if(start < 0) {
return -1;
}
start = start < Long.SIZE ? start : Long.SIZE - 1;
long... | java | public static int previousSetBit(long v, int start) {
if(start < 0) {
return -1;
}
start = start < Long.SIZE ? start : Long.SIZE - 1;
long cur = v & (LONG_ALL_BITS >>> -(start + 1));
return cur == 0 ? -1 : cur == LONG_ALL_BITS ? 0 : 63 - Long.numberOfLeadingZeros(cur);
} | [
"public",
"static",
"int",
"previousSetBit",
"(",
"long",
"v",
",",
"int",
"start",
")",
"{",
"if",
"(",
"start",
"<",
"0",
")",
"{",
"return",
"-",
"1",
";",
"}",
"start",
"=",
"start",
"<",
"Long",
".",
"SIZE",
"?",
"start",
":",
"Long",
".",
... | Find the previous set bit.
@param v Value to process
@param start Start position (inclusive)
@return Position of previous set bit, or -1. | [
"Find",
"the",
"previous",
"set",
"bit",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java#L1217-L1224 |
iipc/webarchive-commons | src/main/java/org/archive/util/zip/GzipHeader.java | GzipHeader.readShort | private int readShort(InputStream in, CRC32 crc) throws IOException {
"""
Read a short.
We do not expect to get a -1 reading. If we do, we throw exception.
Update the crc as we go.
@param in InputStream to read.
@param crc CRC to update.
@return Short read.
@throws IOException
"""
int b = ... | java | private int readShort(InputStream in, CRC32 crc) throws IOException {
int b = readByte(in, crc);
return ((readByte(in, crc) << 8) & 0x00ff00) | b;
} | [
"private",
"int",
"readShort",
"(",
"InputStream",
"in",
",",
"CRC32",
"crc",
")",
"throws",
"IOException",
"{",
"int",
"b",
"=",
"readByte",
"(",
"in",
",",
"crc",
")",
";",
"return",
"(",
"(",
"readByte",
"(",
"in",
",",
"crc",
")",
"<<",
"8",
")... | Read a short.
We do not expect to get a -1 reading. If we do, we throw exception.
Update the crc as we go.
@param in InputStream to read.
@param crc CRC to update.
@return Short read.
@throws IOException | [
"Read",
"a",
"short",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/zip/GzipHeader.java#L230-L233 |
landawn/AbacusUtil | src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java | PoolablePreparedStatement.setRef | @Override
public void setRef(int parameterIndex, Ref x) throws SQLException {
"""
Method setRef.
@param parameterIndex
@param x
@throws SQLException
@see java.sql.PreparedStatement#setRef(int, Ref)
"""
internalStmt.setRef(parameterIndex, x);
} | java | @Override
public void setRef(int parameterIndex, Ref x) throws SQLException {
internalStmt.setRef(parameterIndex, x);
} | [
"@",
"Override",
"public",
"void",
"setRef",
"(",
"int",
"parameterIndex",
",",
"Ref",
"x",
")",
"throws",
"SQLException",
"{",
"internalStmt",
".",
"setRef",
"(",
"parameterIndex",
",",
"x",
")",
";",
"}"
] | Method setRef.
@param parameterIndex
@param x
@throws SQLException
@see java.sql.PreparedStatement#setRef(int, Ref) | [
"Method",
"setRef",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L939-L942 |
igniterealtime/Smack | smack-java7/src/main/java/org/jivesoftware/smack/java7/XmppHostnameVerifier.java | XmppHostnameVerifier.matchWildCards | private static boolean matchWildCards(String name, String template) {
"""
Returns true if the name matches against the template that may contain the wildcard char '*'.
@param name
@param template
@return true if <code>name</code> matches <code>template</code>.
"""
int wildcardIndex = template.inde... | java | private static boolean matchWildCards(String name, String template) {
int wildcardIndex = template.indexOf("*");
if (wildcardIndex == -1) {
return name.equals(template);
}
boolean isBeginning = true;
String beforeWildcard;
String afterWildcard = template;
... | [
"private",
"static",
"boolean",
"matchWildCards",
"(",
"String",
"name",
",",
"String",
"template",
")",
"{",
"int",
"wildcardIndex",
"=",
"template",
".",
"indexOf",
"(",
"\"*\"",
")",
";",
"if",
"(",
"wildcardIndex",
"==",
"-",
"1",
")",
"{",
"return",
... | Returns true if the name matches against the template that may contain the wildcard char '*'.
@param name
@param template
@return true if <code>name</code> matches <code>template</code>. | [
"Returns",
"true",
"if",
"the",
"name",
"matches",
"against",
"the",
"template",
"that",
"may",
"contain",
"the",
"wildcard",
"char",
"*",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-java7/src/main/java/org/jivesoftware/smack/java7/XmppHostnameVerifier.java#L210-L234 |
talenguyen/PrettySharedPreferences | prettysharedpreferences/src/main/java/com/tale/prettysharedpreferences/PrettySharedPreferences.java | PrettySharedPreferences.getIntegerEditor | protected IntegerEditor getIntegerEditor(String key) {
"""
Call to get a {@link com.tale.prettysharedpreferences.IntegerEditor} object for the specific
key. <code>NOTE:</code> There is a unique {@link com.tale.prettysharedpreferences.TypeEditor}
object for a unique key.
@param key The name of the preference.
... | java | protected IntegerEditor getIntegerEditor(String key) {
TypeEditor typeEditor = TYPE_EDITOR_MAP.get(key);
if (typeEditor == null) {
typeEditor = new IntegerEditor(this, sharedPreferences, key);
TYPE_EDITOR_MAP.put(key, typeEditor);
} else if (!(typeEditor instanceof Intege... | [
"protected",
"IntegerEditor",
"getIntegerEditor",
"(",
"String",
"key",
")",
"{",
"TypeEditor",
"typeEditor",
"=",
"TYPE_EDITOR_MAP",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"typeEditor",
"==",
"null",
")",
"{",
"typeEditor",
"=",
"new",
"IntegerEditor",
... | Call to get a {@link com.tale.prettysharedpreferences.IntegerEditor} object for the specific
key. <code>NOTE:</code> There is a unique {@link com.tale.prettysharedpreferences.TypeEditor}
object for a unique key.
@param key The name of the preference.
@return {@link com.tale.prettysharedpreferences.IntegerEditor} objec... | [
"Call",
"to",
"get",
"a",
"{",
"@link",
"com",
".",
"tale",
".",
"prettysharedpreferences",
".",
"IntegerEditor",
"}",
"object",
"for",
"the",
"specific",
"key",
".",
"<code",
">",
"NOTE",
":",
"<",
"/",
"code",
">",
"There",
"is",
"a",
"unique",
"{",
... | train | https://github.com/talenguyen/PrettySharedPreferences/blob/b97edf86c8fa65be2165f2cd790545c78c971c22/prettysharedpreferences/src/main/java/com/tale/prettysharedpreferences/PrettySharedPreferences.java#L52-L61 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/util/SparseLongArray.java | SparseLongArray.append | public void append(int key, long value) {
"""
Puts a key/value pair into the array, optimizing for the case where
the key is greater than all existing keys in the array.
"""
if (mSize != 0 && key <= mKeys[mSize - 1]) {
put(key, value);
return;
}
int pos = mSize... | java | public void append(int key, long value) {
if (mSize != 0 && key <= mKeys[mSize - 1]) {
put(key, value);
return;
}
int pos = mSize;
if (pos >= mKeys.length) {
growKeyAndValueArrays(pos + 1);
}
mKeys[pos] = key;
mValues[pos] = v... | [
"public",
"void",
"append",
"(",
"int",
"key",
",",
"long",
"value",
")",
"{",
"if",
"(",
"mSize",
"!=",
"0",
"&&",
"key",
"<=",
"mKeys",
"[",
"mSize",
"-",
"1",
"]",
")",
"{",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
";",
"}",
"i... | Puts a key/value pair into the array, optimizing for the case where
the key is greater than all existing keys in the array. | [
"Puts",
"a",
"key",
"/",
"value",
"pair",
"into",
"the",
"array",
"optimizing",
"for",
"the",
"case",
"where",
"the",
"key",
"is",
"greater",
"than",
"all",
"existing",
"keys",
"in",
"the",
"array",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/SparseLongArray.java#L229-L243 |
GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/IndirectBigQueryOutputCommitter.java | IndirectBigQueryOutputCommitter.commitJob | @Override
public void commitJob(JobContext context) throws IOException {
"""
Runs an import job on BigQuery for the data in the output path in addition to calling the
delegate's commitJob.
"""
super.commitJob(context);
// Get the destination configuration information.
Configuration conf = conte... | java | @Override
public void commitJob(JobContext context) throws IOException {
super.commitJob(context);
// Get the destination configuration information.
Configuration conf = context.getConfiguration();
TableReference destTable = BigQueryOutputConfiguration.getTableReference(conf);
String destProjectI... | [
"@",
"Override",
"public",
"void",
"commitJob",
"(",
"JobContext",
"context",
")",
"throws",
"IOException",
"{",
"super",
".",
"commitJob",
"(",
"context",
")",
";",
"// Get the destination configuration information.",
"Configuration",
"conf",
"=",
"context",
".",
"... | Runs an import job on BigQuery for the data in the output path in addition to calling the
delegate's commitJob. | [
"Runs",
"an",
"import",
"job",
"on",
"BigQuery",
"for",
"the",
"data",
"in",
"the",
"output",
"path",
"in",
"addition",
"to",
"calling",
"the",
"delegate",
"s",
"commitJob",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/IndirectBigQueryOutputCommitter.java#L55-L85 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagImage.java | CmsJspTagImage.imageTagAction | public static String imageTagAction(
String src,
CmsImageScaler scaler,
Map<String, String> attributes,
boolean partialTag,
ServletRequest req)
throws CmsException {
"""
Internal action method to create the tag content.<p>
@param src the image source
@param scaler th... | java | public static String imageTagAction(
String src,
CmsImageScaler scaler,
Map<String, String> attributes,
boolean partialTag,
ServletRequest req)
throws CmsException {
return imageTagAction(src, scaler, attributes, partialTag, false, req);
} | [
"public",
"static",
"String",
"imageTagAction",
"(",
"String",
"src",
",",
"CmsImageScaler",
"scaler",
",",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
",",
"boolean",
"partialTag",
",",
"ServletRequest",
"req",
")",
"throws",
"CmsException",
"{",
... | Internal action method to create the tag content.<p>
@param src the image source
@param scaler the image scaleing parameters
@param attributes the additional image HTML attributes
@param partialTag if <code>true</code>, the opening <code><img</code> and closing <code> /></code> is omitted
@param req the current ... | [
"Internal",
"action",
"method",
"to",
"create",
"the",
"tag",
"content",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagImage.java#L288-L297 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.escapeXML | public static String escapeXML(final char[] chars, final int offset, final int length) {
"""
Escape XML characters.
@param chars char arrays
@param offset start position
@param length arrays lenth
@return escaped value
"""
final StringBuilder escaped = new StringBuilder();
final int end ... | java | public static String escapeXML(final char[] chars, final int offset, final int length) {
final StringBuilder escaped = new StringBuilder();
final int end = offset + length;
for (int i = offset; i < end; ++i) {
final char c = chars[i];
switch (c) {
case '\'':... | [
"public",
"static",
"String",
"escapeXML",
"(",
"final",
"char",
"[",
"]",
"chars",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
")",
"{",
"final",
"StringBuilder",
"escaped",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"final",
"int",
"... | Escape XML characters.
@param chars char arrays
@param offset start position
@param length arrays lenth
@return escaped value | [
"Escape",
"XML",
"characters",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L650-L679 |
lviggiano/owner | owner/src/main/java/org/aeonbits/owner/ConfigFactory.java | ConfigFactory.setTypeConverter | public static void setTypeConverter(Class<?> type, Class<? extends Converter<?>> converter) {
"""
Sets a converter for the given type. Setting a converter via this method will override any default converters
but not {@link Config.ConverterClass} annotations.
@param type the type for which to set a converter.
... | java | public static void setTypeConverter(Class<?> type, Class<? extends Converter<?>> converter) {
INSTANCE.setTypeConverter(type, converter);
} | [
"public",
"static",
"void",
"setTypeConverter",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"?",
"extends",
"Converter",
"<",
"?",
">",
">",
"converter",
")",
"{",
"INSTANCE",
".",
"setTypeConverter",
"(",
"type",
",",
"converter",
")",
";",
... | Sets a converter for the given type. Setting a converter via this method will override any default converters
but not {@link Config.ConverterClass} annotations.
@param type the type for which to set a converter.
@param converter the converter class to use for the specified type.
@since 1.0.10 | [
"Sets",
"a",
"converter",
"for",
"the",
"given",
"type",
".",
"Setting",
"a",
"converter",
"via",
"this",
"method",
"will",
"override",
"any",
"default",
"converters",
"but",
"not",
"{",
"@link",
"Config",
".",
"ConverterClass",
"}",
"annotations",
"."
] | train | https://github.com/lviggiano/owner/blob/1223ecfbe3c275b3b7c5ec13e9238c9bb888754f/owner/src/main/java/org/aeonbits/owner/ConfigFactory.java#L152-L154 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/UniverseApi.java | UniverseApi.getUniversePlanetsPlanetId | public PlanetResponse getUniversePlanetsPlanetId(Integer planetId, String datasource, String ifNoneMatch)
throws ApiException {
"""
Get planet information Get information on a planet --- This route expires
daily at 11:05
@param planetId
planet_id integer (required)
@param datasource
The server n... | java | public PlanetResponse getUniversePlanetsPlanetId(Integer planetId, String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<PlanetResponse> resp = getUniversePlanetsPlanetIdWithHttpInfo(planetId, datasource, ifNoneMatch);
return resp.getData();
} | [
"public",
"PlanetResponse",
"getUniversePlanetsPlanetId",
"(",
"Integer",
"planetId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"PlanetResponse",
">",
"resp",
"=",
"getUniversePlanetsPlanetIdWithHttp... | Get planet information Get information on a planet --- This route expires
daily at 11:05
@param planetId
planet_id integer (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous request. A 304 will be returned if this
matches the... | [
"Get",
"planet",
"information",
"Get",
"information",
"on",
"a",
"planet",
"---",
"This",
"route",
"expires",
"daily",
"at",
"11",
":",
"05"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/UniverseApi.java#L2167-L2171 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.groupBy | public static Map groupBy(Object[] self, Object... closures) {
"""
Sorts all array members into (sub)groups determined by the supplied
mapping closures as per the Iterable variant of this method.
@param self an array to group
@param closures an array of closures, each mapping entries on keys
@return a ne... | java | public static Map groupBy(Object[] self, Object... closures) {
return groupBy((Iterable)Arrays.asList(self), closures);
} | [
"public",
"static",
"Map",
"groupBy",
"(",
"Object",
"[",
"]",
"self",
",",
"Object",
"...",
"closures",
")",
"{",
"return",
"groupBy",
"(",
"(",
"Iterable",
")",
"Arrays",
".",
"asList",
"(",
"self",
")",
",",
"closures",
")",
";",
"}"
] | Sorts all array members into (sub)groups determined by the supplied
mapping closures as per the Iterable variant of this method.
@param self an array to group
@param closures an array of closures, each mapping entries on keys
@return a new Map grouped by keys on each criterion
@see #groupBy(Iterable, Object...)
@s... | [
"Sorts",
"all",
"array",
"members",
"into",
"(",
"sub",
")",
"groups",
"determined",
"by",
"the",
"supplied",
"mapping",
"closures",
"as",
"per",
"the",
"Iterable",
"variant",
"of",
"this",
"method",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L5614-L5616 |
sarxos/v4l4j | src/main/java/au/edu/jcu/v4l4j/ImageFormatList.java | ImageFormatList.getFormat | private ImageFormat getFormat(List<ImageFormat> l, String n) {
"""
this method returns a format in a list given its name
@param l the image format list
@param n the name of the format
@return the image format with the given name, or null
"""
for(ImageFormat f:l)
if(f.getName().equals(n))
return f;
... | java | private ImageFormat getFormat(List<ImageFormat> l, String n){
for(ImageFormat f:l)
if(f.getName().equals(n))
return f;
return null;
} | [
"private",
"ImageFormat",
"getFormat",
"(",
"List",
"<",
"ImageFormat",
">",
"l",
",",
"String",
"n",
")",
"{",
"for",
"(",
"ImageFormat",
"f",
":",
"l",
")",
"if",
"(",
"f",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"n",
")",
")",
"return",
... | this method returns a format in a list given its name
@param l the image format list
@param n the name of the format
@return the image format with the given name, or null | [
"this",
"method",
"returns",
"a",
"format",
"in",
"a",
"list",
"given",
"its",
"name"
] | train | https://github.com/sarxos/v4l4j/blob/4fc0eec2c3a1a4260593f6ac03b7a8013e3804c9/src/main/java/au/edu/jcu/v4l4j/ImageFormatList.java#L208-L213 |
google/closure-templates | java/src/com/google/template/soy/soytree/TagName.java | TagName.checkOpenTagClosesOptional | public static boolean checkOpenTagClosesOptional(TagName openTag, TagName optionalOpenTag) {
"""
Checks if the given open tag can implicitly close the given optional tag.
<p>This implements the content model described in
https://www.w3.org/TR/html5/syntax.html#optional-tags.
<p><b>Note:</b>If {@code this} i... | java | public static boolean checkOpenTagClosesOptional(TagName openTag, TagName optionalOpenTag) {
checkArgument(optionalOpenTag.isDefinitelyOptional(), "Open tag is not optional.");
if (!(openTag.isStatic() && optionalOpenTag.isStatic())) {
return false;
}
String optionalTagName = optionalOpenTag.getSt... | [
"public",
"static",
"boolean",
"checkOpenTagClosesOptional",
"(",
"TagName",
"openTag",
",",
"TagName",
"optionalOpenTag",
")",
"{",
"checkArgument",
"(",
"optionalOpenTag",
".",
"isDefinitelyOptional",
"(",
")",
",",
"\"Open tag is not optional.\"",
")",
";",
"if",
"... | Checks if the given open tag can implicitly close the given optional tag.
<p>This implements the content model described in
https://www.w3.org/TR/html5/syntax.html#optional-tags.
<p><b>Note:</b>If {@code this} is a dynamic tag, then this test alsways returns {@code false}
because the tag name can't be determined at p... | [
"Checks",
"if",
"the",
"given",
"open",
"tag",
"can",
"implicitly",
"close",
"the",
"given",
"optional",
"tag",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soytree/TagName.java#L314-L322 |
grails/grails-core | grails-encoder/src/main/groovy/org/grails/encoder/DefaultEncodingStateRegistry.java | DefaultEncodingStateRegistry.shouldEncodeWith | public static boolean shouldEncodeWith(Encoder encoderToApply, EncodingState currentEncodingState) {
"""
Checks if encoder should be applied to a input with given encoding state
@param encoderToApply
the encoder to apply
@param currentEncodingState
the current encoding state
@return true, if should encode
... | java | public static boolean shouldEncodeWith(Encoder encoderToApply, EncodingState currentEncodingState) {
if(isNoneEncoder(encoderToApply)) return false;
if (currentEncodingState != null && currentEncodingState.getEncoders() != null) {
for (Encoder encoder : currentEncodingState.getEncoders()) {
... | [
"public",
"static",
"boolean",
"shouldEncodeWith",
"(",
"Encoder",
"encoderToApply",
",",
"EncodingState",
"currentEncodingState",
")",
"{",
"if",
"(",
"isNoneEncoder",
"(",
"encoderToApply",
")",
")",
"return",
"false",
";",
"if",
"(",
"currentEncodingState",
"!=",... | Checks if encoder should be applied to a input with given encoding state
@param encoderToApply
the encoder to apply
@param currentEncodingState
the current encoding state
@return true, if should encode | [
"Checks",
"if",
"encoder",
"should",
"be",
"applied",
"to",
"a",
"input",
"with",
"given",
"encoding",
"state"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/encoder/DefaultEncodingStateRegistry.java#L100-L110 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java | CommerceNotificationQueueEntryPersistenceImpl.findBySent | @Override
public List<CommerceNotificationQueueEntry> findBySent(boolean sent,
int start, int end) {
"""
Returns a range of all the commerce notification queue entries where sent = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <cod... | java | @Override
public List<CommerceNotificationQueueEntry> findBySent(boolean sent,
int start, int end) {
return findBySent(sent, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationQueueEntry",
">",
"findBySent",
"(",
"boolean",
"sent",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findBySent",
"(",
"sent",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"... | Returns a range of all the commerce notification queue entries where sent = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first resu... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"notification",
"queue",
"entries",
"where",
"sent",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java#L1196-L1200 |
bwkimmel/java-util | src/main/java/ca/eandb/util/ByteArray.java | ByteArray.setAll | public void setAll(int index, byte[] items) {
"""
Sets a range of elements of this array.
@param index
The index of the first element to set.
@param items
The values to set.
@throws IndexOutOfBoundsException
if
<code>index < 0 || index + items.length > size()</code>.
"""
rangeCheck(index, in... | java | public void setAll(int index, byte[] items) {
rangeCheck(index, index + items.length);
for (int i = index, j = 0; j < items.length; i++, j++) {
elements[i] = items[j];
}
} | [
"public",
"void",
"setAll",
"(",
"int",
"index",
",",
"byte",
"[",
"]",
"items",
")",
"{",
"rangeCheck",
"(",
"index",
",",
"index",
"+",
"items",
".",
"length",
")",
";",
"for",
"(",
"int",
"i",
"=",
"index",
",",
"j",
"=",
"0",
";",
"j",
"<",... | Sets a range of elements of this array.
@param index
The index of the first element to set.
@param items
The values to set.
@throws IndexOutOfBoundsException
if
<code>index < 0 || index + items.length > size()</code>. | [
"Sets",
"a",
"range",
"of",
"elements",
"of",
"this",
"array",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/ByteArray.java#L255-L260 |
tommyettinger/RegExodus | src/main/java/regexodus/CharacterClass.java | CharacterClass.makeDigit | static void makeDigit(Term term, boolean inverse, boolean unicode) {
"""
/*
static void makeICase(Term term, char c) {
BlockSet bs = new BlockSet();
bs.setChar(Character.toLowerCase(c));
bs.setChar(Character.toUpperCase(c));
bs.setChar(Character.toTitleCase(c));
bs.setChar(Category.caseFold(c));
BlockSe... | java | static void makeDigit(Term term, boolean inverse, boolean unicode) {
BlockSet digit = unicode ? inverse ? UNONDIGIT : UDIGIT :
inverse ? NONDIGIT : DIGIT;
BlockSet.unify(digit, term);
} | [
"static",
"void",
"makeDigit",
"(",
"Term",
"term",
",",
"boolean",
"inverse",
",",
"boolean",
"unicode",
")",
"{",
"BlockSet",
"digit",
"=",
"unicode",
"?",
"inverse",
"?",
"UNONDIGIT",
":",
"UDIGIT",
":",
"inverse",
"?",
"NONDIGIT",
":",
"DIGIT",
";",
... | /*
static void makeICase(Term term, char c) {
BlockSet bs = new BlockSet();
bs.setChar(Character.toLowerCase(c));
bs.setChar(Character.toUpperCase(c));
bs.setChar(Character.toTitleCase(c));
bs.setChar(Category.caseFold(c));
BlockSet.unify(bs, term);
} | [
"/",
"*",
"static",
"void",
"makeICase",
"(",
"Term",
"term",
"char",
"c",
")",
"{",
"BlockSet",
"bs",
"=",
"new",
"BlockSet",
"()",
";"
] | train | https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/CharacterClass.java#L281-L285 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/common/lib/factory/helper/BaseAdsServiceClientFactoryHelper.java | BaseAdsServiceClientFactoryHelper.createAdsServiceClient | @Override
public C createAdsServiceClient(D adsServiceDescriptor, S adsSession) throws ServiceException {
"""
Creates an {@link AdsServiceClient} given an {@link AdsServiceDescriptor}
descriptor and an {@link AdsSession}.
@param adsServiceDescriptor descriptor with information on ads service
@param adsSessi... | java | @Override
public C createAdsServiceClient(D adsServiceDescriptor, S adsSession) throws ServiceException {
Object soapClient = createSoapClient(adsServiceDescriptor);
C adsServiceClient = createServiceClient(soapClient, adsServiceDescriptor, adsSession);
try {
adsServiceClient.setEndpointAddress(adsS... | [
"@",
"Override",
"public",
"C",
"createAdsServiceClient",
"(",
"D",
"adsServiceDescriptor",
",",
"S",
"adsSession",
")",
"throws",
"ServiceException",
"{",
"Object",
"soapClient",
"=",
"createSoapClient",
"(",
"adsServiceDescriptor",
")",
";",
"C",
"adsServiceClient",... | Creates an {@link AdsServiceClient} given an {@link AdsServiceDescriptor}
descriptor and an {@link AdsSession}.
@param adsServiceDescriptor descriptor with information on ads service
@param adsSession the session associated with the desired
client
@return the created {@link AdsServiceClient}
@throws ServiceException i... | [
"Creates",
"an",
"{",
"@link",
"AdsServiceClient",
"}",
"given",
"an",
"{",
"@link",
"AdsServiceDescriptor",
"}",
"descriptor",
"and",
"an",
"{",
"@link",
"AdsSession",
"}",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/factory/helper/BaseAdsServiceClientFactoryHelper.java#L68-L79 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/FileLocator.java | FileLocator.getFile | private static File getFile(File dirPath, String name) {
"""
Internal method: performs test common to
{@link #findFileInNamedPath(String, List)}
and {@link #findFileInFilePath(String, Collection)
@param dirPath
Directory to check for named file
@param name
The name of the file to find
@return The File obj... | java | private static File getFile(File dirPath, String name) {
if (dirPath != null && dirPath.isDirectory()) {
File myFile = new File(dirPath, name);
if (myFile.exists())
return myFile;
}
return null;
} | [
"private",
"static",
"File",
"getFile",
"(",
"File",
"dirPath",
",",
"String",
"name",
")",
"{",
"if",
"(",
"dirPath",
"!=",
"null",
"&&",
"dirPath",
".",
"isDirectory",
"(",
")",
")",
"{",
"File",
"myFile",
"=",
"new",
"File",
"(",
"dirPath",
",",
"... | Internal method: performs test common to
{@link #findFileInNamedPath(String, List)}
and {@link #findFileInFilePath(String, Collection)
@param dirPath
Directory to check for named file
@param name
The name of the file to find
@return The File object if the file is found;
null if the dirPath is null, does not exist, or ... | [
"Internal",
"method",
":",
"performs",
"test",
"common",
"to",
"{",
"@link",
"#findFileInNamedPath",
"(",
"String",
"List",
")",
"}",
"and",
"{",
"@link",
"#findFileInFilePath",
"(",
"String",
"Collection",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/FileLocator.java#L125-L132 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/SyntacticCategory.java | SyntacticCategory.addArgument | public SyntacticCategory addArgument(SyntacticCategory argument, Direction direction) {
"""
Gets the syntactic category which accepts {@code argument} in
{@code direction} and returns {@code this}.
@param argument
@param direction
@return
"""
return SyntacticCategory.createFunctional(direction, this,... | java | public SyntacticCategory addArgument(SyntacticCategory argument, Direction direction) {
return SyntacticCategory.createFunctional(direction, this, argument);
} | [
"public",
"SyntacticCategory",
"addArgument",
"(",
"SyntacticCategory",
"argument",
",",
"Direction",
"direction",
")",
"{",
"return",
"SyntacticCategory",
".",
"createFunctional",
"(",
"direction",
",",
"this",
",",
"argument",
")",
";",
"}"
] | Gets the syntactic category which accepts {@code argument} in
{@code direction} and returns {@code this}.
@param argument
@param direction
@return | [
"Gets",
"the",
"syntactic",
"category",
"which",
"accepts",
"{",
"@code",
"argument",
"}",
"in",
"{",
"@code",
"direction",
"}",
"and",
"returns",
"{",
"@code",
"this",
"}",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/SyntacticCategory.java#L262-L264 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/cellprocessor/conversion/CharReplacer.java | CharReplacer.register | public void register(final String word, final String replacement) {
"""
置換対象の文字を登録する。
@param word 置換対象の文字
@param replacement 置換後の文字
@throws IllegalArgumentException word is empty.
@throws NullPointerException replacement is null.
"""
ArgUtils.notEmpty(word, "word");
ArgUtils.notNull(repla... | java | public void register(final String word, final String replacement) {
ArgUtils.notEmpty(word, "word");
ArgUtils.notNull(replacement, "replacement");
if(word.length() == 1) {
singles.computeIfAbsent(word.charAt(0), key -> replacement);
} else {
... | [
"public",
"void",
"register",
"(",
"final",
"String",
"word",
",",
"final",
"String",
"replacement",
")",
"{",
"ArgUtils",
".",
"notEmpty",
"(",
"word",
",",
"\"word\"",
")",
";",
"ArgUtils",
".",
"notNull",
"(",
"replacement",
",",
"\"replacement\"",
")",
... | 置換対象の文字を登録する。
@param word 置換対象の文字
@param replacement 置換後の文字
@throws IllegalArgumentException word is empty.
@throws NullPointerException replacement is null. | [
"置換対象の文字を登録する。"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/cellprocessor/conversion/CharReplacer.java#L55-L66 |
scireum/parsii | src/main/java/parsii/tokenizer/Tokenizer.java | Tokenizer.handleStringEscape | protected boolean handleStringEscape(char separator, char escapeChar, Token stringToken) {
"""
Evaluates an string escape like \n
<p>
The escape character is already consumed. Therefore the input points at the character to escape. This method
must consume all escaped characters.
@param separator the delimi... | java | protected boolean handleStringEscape(char separator, char escapeChar, Token stringToken) {
if (input.current().is(separator)) {
stringToken.addToContent(separator);
stringToken.addToSource(input.consume());
return true;
} else if (input.current().is(escapeChar)) {
... | [
"protected",
"boolean",
"handleStringEscape",
"(",
"char",
"separator",
",",
"char",
"escapeChar",
",",
"Token",
"stringToken",
")",
"{",
"if",
"(",
"input",
".",
"current",
"(",
")",
".",
"is",
"(",
"separator",
")",
")",
"{",
"stringToken",
".",
"addToCo... | Evaluates an string escape like \n
<p>
The escape character is already consumed. Therefore the input points at the character to escape. This method
must consume all escaped characters.
@param separator the delimiter of this string constant
@param escapeChar the escape character used
@param stringToken the resulting... | [
"Evaluates",
"an",
"string",
"escape",
"like",
"\\",
"n",
"<p",
">",
"The",
"escape",
"character",
"is",
"already",
"consumed",
".",
"Therefore",
"the",
"input",
"points",
"at",
"the",
"character",
"to",
"escape",
".",
"This",
"method",
"must",
"consume",
... | train | https://github.com/scireum/parsii/blob/fbf686155b1147b9e07ae21dcd02820b15c79a8c/src/main/java/parsii/tokenizer/Tokenizer.java#L361-L381 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configurebandwidth5x.java | br_configurebandwidth5x.configurebandwidth5x | public static br_configurebandwidth5x configurebandwidth5x(nitro_service client, br_configurebandwidth5x resource) throws Exception {
"""
<pre>
Use this operation to configure Repeater bandwidth of devices of version 5.x or earlier.
</pre>
"""
return ((br_configurebandwidth5x[]) resource.perform_operation... | java | public static br_configurebandwidth5x configurebandwidth5x(nitro_service client, br_configurebandwidth5x resource) throws Exception
{
return ((br_configurebandwidth5x[]) resource.perform_operation(client, "configurebandwidth5x"))[0];
} | [
"public",
"static",
"br_configurebandwidth5x",
"configurebandwidth5x",
"(",
"nitro_service",
"client",
",",
"br_configurebandwidth5x",
"resource",
")",
"throws",
"Exception",
"{",
"return",
"(",
"(",
"br_configurebandwidth5x",
"[",
"]",
")",
"resource",
".",
"perform_op... | <pre>
Use this operation to configure Repeater bandwidth of devices of version 5.x or earlier.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"configure",
"Repeater",
"bandwidth",
"of",
"devices",
"of",
"version",
"5",
".",
"x",
"or",
"earlier",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configurebandwidth5x.java#L189-L192 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/CacheManagerBuilder.java | CacheManagerBuilder.withDefaultSizeOfMaxObjectSize | public CacheManagerBuilder<T> withDefaultSizeOfMaxObjectSize(long size, MemoryUnit unit) {
"""
Adds a default {@link SizeOfEngine} configuration, that limits the max object size, to
the returned builder.
@param size the max object size
@param unit the max object size unit
@return a new builder with the added... | java | public CacheManagerBuilder<T> withDefaultSizeOfMaxObjectSize(long size, MemoryUnit unit) {
DefaultSizeOfEngineProviderConfiguration configuration = configBuilder.findServiceByClass(DefaultSizeOfEngineProviderConfiguration.class);
if (configuration == null) {
return new CacheManagerBuilder<>(this, configBu... | [
"public",
"CacheManagerBuilder",
"<",
"T",
">",
"withDefaultSizeOfMaxObjectSize",
"(",
"long",
"size",
",",
"MemoryUnit",
"unit",
")",
"{",
"DefaultSizeOfEngineProviderConfiguration",
"configuration",
"=",
"configBuilder",
".",
"findServiceByClass",
"(",
"DefaultSizeOfEngin... | Adds a default {@link SizeOfEngine} configuration, that limits the max object size, to
the returned builder.
@param size the max object size
@param unit the max object size unit
@return a new builder with the added configuration | [
"Adds",
"a",
"default",
"{",
"@link",
"SizeOfEngine",
"}",
"configuration",
"that",
"limits",
"the",
"max",
"object",
"size",
"to",
"the",
"returned",
"builder",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheManagerBuilder.java#L265-L274 |
mozilla/rhino | src/org/mozilla/javascript/commonjs/module/RequireBuilder.java | RequireBuilder.createRequire | public Require createRequire(Context cx, Scriptable globalScope) {
"""
Creates a new require() function. You are still responsible for invoking
either {@link Require#install(Scriptable)} or
{@link Require#requireMain(Context, String)} to effectively make it
available to its JavaScript program.
@param cx the cu... | java | public Require createRequire(Context cx, Scriptable globalScope) {
return new Require(cx, globalScope, moduleScriptProvider, preExec,
postExec, sandboxed);
} | [
"public",
"Require",
"createRequire",
"(",
"Context",
"cx",
",",
"Scriptable",
"globalScope",
")",
"{",
"return",
"new",
"Require",
"(",
"cx",
",",
"globalScope",
",",
"moduleScriptProvider",
",",
"preExec",
",",
"postExec",
",",
"sandboxed",
")",
";",
"}"
] | Creates a new require() function. You are still responsible for invoking
either {@link Require#install(Scriptable)} or
{@link Require#requireMain(Context, String)} to effectively make it
available to its JavaScript program.
@param cx the current context
@param globalScope the global scope containing the JS standard nat... | [
"Creates",
"a",
"new",
"require",
"()",
"function",
".",
"You",
"are",
"still",
"responsible",
"for",
"invoking",
"either",
"{"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/commonjs/module/RequireBuilder.java#L90-L93 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ConcurrentCountingMap.java | ConcurrentCountingMap.addTo | public int addTo(final byte[] array, final int offset, final int length, final int delta) {
"""
Adds a value to the counter associated with a given key.
@param array a byte array.
@param offset the first valid byte in {@code array}.
@param length the number of valid elements in {@code array}.
@param delta a ... | java | public int addTo(final byte[] array, final int offset, final int length, final int delta) {
final long hash = MurmurHash3.hash(array, offset, length);
final WriteLock writeLock = lock[(int)(hash >>> shift)].writeLock();
try {
writeLock.lock();
return stripe[(int)(hash >>> shift)].addTo(array, offset, length... | [
"public",
"int",
"addTo",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
",",
"final",
"int",
"delta",
")",
"{",
"final",
"long",
"hash",
"=",
"MurmurHash3",
".",
"hash",
"(",
"array",
",",
"off... | Adds a value to the counter associated with a given key.
@param array a byte array.
@param offset the first valid byte in {@code array}.
@param length the number of valid elements in {@code array}.
@param delta a value to be added to the counter associated with the specified key.
@return the previous value of the coun... | [
"Adds",
"a",
"value",
"to",
"the",
"counter",
"associated",
"with",
"a",
"given",
"key",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ConcurrentCountingMap.java#L115-L125 |
killbill/killbill | util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java | InternalCallContextFactory.createInternalCallContext | public InternalCallContext createInternalCallContext(final UUID accountId, final CallContext context) {
"""
Create an internal call callcontext using an existing account to retrieve tenant and account record ids
<p/>
This is used for r/w operations - we need the account id to populate the account_record_id field... | java | public InternalCallContext createInternalCallContext(final UUID accountId, final CallContext context) {
return createInternalCallContext(accountId, ObjectType.ACCOUNT, context);
} | [
"public",
"InternalCallContext",
"createInternalCallContext",
"(",
"final",
"UUID",
"accountId",
",",
"final",
"CallContext",
"context",
")",
"{",
"return",
"createInternalCallContext",
"(",
"accountId",
",",
"ObjectType",
".",
"ACCOUNT",
",",
"context",
")",
";",
"... | Create an internal call callcontext using an existing account to retrieve tenant and account record ids
<p/>
This is used for r/w operations - we need the account id to populate the account_record_id field
@param accountId account id
@param context original call callcontext
@return internal call callcontext | [
"Create",
"an",
"internal",
"call",
"callcontext",
"using",
"an",
"existing",
"account",
"to",
"retrieve",
"tenant",
"and",
"account",
"record",
"ids",
"<p",
"/",
">",
"This",
"is",
"used",
"for",
"r",
"/",
"w",
"operations",
"-",
"we",
"need",
"the",
"a... | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java#L182-L184 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/MediaApi.java | MediaApi.removeAttachment | public ApiSuccessResponse removeAttachment(String mediatype, String id, String documentId, RemoveAttachmentData removeAttachmentData) throws ApiException {
"""
Remove the attachment of the open-media interaction
Remove the attachment of the interaction specified in the documentId path parameter
@param mediatype ... | java | public ApiSuccessResponse removeAttachment(String mediatype, String id, String documentId, RemoveAttachmentData removeAttachmentData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = removeAttachmentWithHttpInfo(mediatype, id, documentId, removeAttachmentData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"removeAttachment",
"(",
"String",
"mediatype",
",",
"String",
"id",
",",
"String",
"documentId",
",",
"RemoveAttachmentData",
"removeAttachmentData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"res... | Remove the attachment of the open-media interaction
Remove the attachment of the interaction specified in the documentId path parameter
@param mediatype media-type of interaction to remove attachment (required)
@param id id of interaction (required)
@param documentId id of document to remove (required)
@param removeAtt... | [
"Remove",
"the",
"attachment",
"of",
"the",
"open",
"-",
"media",
"interaction",
"Remove",
"the",
"attachment",
"of",
"the",
"interaction",
"specified",
"in",
"the",
"documentId",
"path",
"parameter"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L3781-L3784 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java | RelatedTablesCoreExtension.addMediaRelationship | public ExtendedRelation addMediaRelationship(String baseTableName,
MediaTable mediaTable, UserMappingTable userMappingTable) {
"""
Adds a media relationship between the base table and user media related
table. Creates the user mapping table and media table if needed.
@param baseTableName
base table name
@... | java | public ExtendedRelation addMediaRelationship(String baseTableName,
MediaTable mediaTable, UserMappingTable userMappingTable) {
return addRelationship(baseTableName, mediaTable, userMappingTable);
} | [
"public",
"ExtendedRelation",
"addMediaRelationship",
"(",
"String",
"baseTableName",
",",
"MediaTable",
"mediaTable",
",",
"UserMappingTable",
"userMappingTable",
")",
"{",
"return",
"addRelationship",
"(",
"baseTableName",
",",
"mediaTable",
",",
"userMappingTable",
")"... | Adds a media relationship between the base table and user media related
table. Creates the user mapping table and media table if needed.
@param baseTableName
base table name
@param mediaTable
user media table
@param userMappingTable
user mapping table
@return The relationship that was added | [
"Adds",
"a",
"media",
"relationship",
"between",
"the",
"base",
"table",
"and",
"user",
"media",
"related",
"table",
".",
"Creates",
"the",
"user",
"mapping",
"table",
"and",
"media",
"table",
"if",
"needed",
"."
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java#L544-L547 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java | H2GISDBFactory.createDataSource | public static DataSource createDataSource(String dbName ,boolean initSpatial, String h2Parameters) throws SQLException {
"""
Create a database and return a DataSource
@param dbName
@param initSpatial
@param h2Parameters
@return
@throws SQLException
"""
// Create H2 memory DataSource
org.h2... | java | public static DataSource createDataSource(String dbName ,boolean initSpatial, String h2Parameters) throws SQLException {
// Create H2 memory DataSource
org.h2.Driver driver = org.h2.Driver.load();
OsgiDataSourceFactory dataSourceFactory = new OsgiDataSourceFactory(driver);
Properties pro... | [
"public",
"static",
"DataSource",
"createDataSource",
"(",
"String",
"dbName",
",",
"boolean",
"initSpatial",
",",
"String",
"h2Parameters",
")",
"throws",
"SQLException",
"{",
"// Create H2 memory DataSource",
"org",
".",
"h2",
".",
"Driver",
"driver",
"=",
"org",
... | Create a database and return a DataSource
@param dbName
@param initSpatial
@param h2Parameters
@return
@throws SQLException | [
"Create",
"a",
"database",
"and",
"return",
"a",
"DataSource"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java#L105-L122 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.contact_contactId_fields_GET | public ArrayList<OvhFieldInformation> contact_contactId_fields_GET(Long contactId) throws IOException {
"""
Display mandatory/read-only informations of a contact
REST: GET /me/contact/{contactId}/fields
@param contactId [required] Contact Identifier
"""
String qPath = "/me/contact/{contactId}/fields";
... | java | public ArrayList<OvhFieldInformation> contact_contactId_fields_GET(Long contactId) throws IOException {
String qPath = "/me/contact/{contactId}/fields";
StringBuilder sb = path(qPath, contactId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t8);
} | [
"public",
"ArrayList",
"<",
"OvhFieldInformation",
">",
"contact_contactId_fields_GET",
"(",
"Long",
"contactId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/contact/{contactId}/fields\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",... | Display mandatory/read-only informations of a contact
REST: GET /me/contact/{contactId}/fields
@param contactId [required] Contact Identifier | [
"Display",
"mandatory",
"/",
"read",
"-",
"only",
"informations",
"of",
"a",
"contact"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3011-L3016 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/ReferenceDataUrl.java | ReferenceDataUrl.getBehaviorsUrl | public static MozuUrl getBehaviorsUrl(String responseFields, String userType) {
"""
Get Resource Url for GetBehaviors
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attemp... | java | public static MozuUrl getBehaviorsUrl(String responseFields, String userType)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/reference/behaviors?userType={userType}&responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("userType", userType);... | [
"public",
"static",
"MozuUrl",
"getBehaviorsUrl",
"(",
"String",
"responseFields",
",",
"String",
"userType",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/reference/behaviors?userType={userType}&responseFields={responseFields}\"",
")"... | Get Resource Url for GetBehaviors
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@param userType The user typ... | [
"Get",
"Resource",
"Url",
"for",
"GetBehaviors"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/ReferenceDataUrl.java#L88-L94 |
signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageReceiver.java | SignalServiceMessageReceiver.createMessagePipe | public SignalServiceMessagePipe createMessagePipe() {
"""
Creates a pipe for receiving SignalService messages.
Callers must call {@link SignalServiceMessagePipe#shutdown()} when finished with the pipe.
@return A SignalServiceMessagePipe for receiving Signal Service messages.
"""
WebSocketConnection w... | java | public SignalServiceMessagePipe createMessagePipe() {
WebSocketConnection webSocket = new WebSocketConnection(urls.getSignalServiceUrls()[0].getUrl(),
urls.getSignalServiceUrls()[0].getTrustStore(),
... | [
"public",
"SignalServiceMessagePipe",
"createMessagePipe",
"(",
")",
"{",
"WebSocketConnection",
"webSocket",
"=",
"new",
"WebSocketConnection",
"(",
"urls",
".",
"getSignalServiceUrls",
"(",
")",
"[",
"0",
"]",
".",
"getUrl",
"(",
")",
",",
"urls",
".",
"getSig... | Creates a pipe for receiving SignalService messages.
Callers must call {@link SignalServiceMessagePipe#shutdown()} when finished with the pipe.
@return A SignalServiceMessagePipe for receiving Signal Service messages. | [
"Creates",
"a",
"pipe",
"for",
"receiving",
"SignalService",
"messages",
"."
] | train | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageReceiver.java#L146-L153 |
alibaba/java-dns-cache-manipulator | library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java | DnsCacheManipulator.removeDnsCache | public static void removeDnsCache(String host) {
"""
Remove dns cache entry, cause lookup dns server for host after.
@param host host
@throws DnsCacheManipulatorException Operation fail
@see DnsCacheManipulator#clearDnsCache
"""
try {
InetAddressCacheUtil.removeInetAddressCache(host);
... | java | public static void removeDnsCache(String host) {
try {
InetAddressCacheUtil.removeInetAddressCache(host);
} catch (Exception e) {
final String message = String.format("Fail to removeDnsCache for host %s, cause: %s", host, e.toString());
throw new DnsCacheManipulatorEx... | [
"public",
"static",
"void",
"removeDnsCache",
"(",
"String",
"host",
")",
"{",
"try",
"{",
"InetAddressCacheUtil",
".",
"removeInetAddressCache",
"(",
"host",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"final",
"String",
"message",
"=",
"String... | Remove dns cache entry, cause lookup dns server for host after.
@param host host
@throws DnsCacheManipulatorException Operation fail
@see DnsCacheManipulator#clearDnsCache | [
"Remove",
"dns",
"cache",
"entry",
"cause",
"lookup",
"dns",
"server",
"for",
"host",
"after",
"."
] | train | https://github.com/alibaba/java-dns-cache-manipulator/blob/eab50ee5c27671f9159b55458301f9429b2fcc47/library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java#L192-L199 |
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/core/misc/ClassUtils.java | ClassUtils.collectMethods | public static Method[] collectMethods(Class<?> c, int inclusiveModifiers, int exclusiveModifiers) {
"""
Produces an array with all the methods of the specified class
@param c The class specified
@param inclusiveModifiers An int indicating the {@link Modifier}s that may be applied
@param exclusiveModifiers An in... | java | public static Method[] collectMethods(Class<?> c, int inclusiveModifiers, int exclusiveModifiers) {
return collectMethods(c, inclusiveModifiers, exclusiveModifiers, Object.class);
} | [
"public",
"static",
"Method",
"[",
"]",
"collectMethods",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"int",
"inclusiveModifiers",
",",
"int",
"exclusiveModifiers",
")",
"{",
"return",
"collectMethods",
"(",
"c",
",",
"inclusiveModifiers",
",",
"exclusiveModifiers",
... | Produces an array with all the methods of the specified class
@param c The class specified
@param inclusiveModifiers An int indicating the {@link Modifier}s that may be applied
@param exclusiveModifiers An int indicating the {@link Modifier}s that must be excluded
@return The array of matched Methods | [
"Produces",
"an",
"array",
"with",
"all",
"the",
"methods",
"of",
"the",
"specified",
"class"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/core/misc/ClassUtils.java#L271-L274 |
code-disaster/steamworks4j | java-wrapper/src/main/java/com/codedisaster/steamworks/SteamNetworking.java | SteamNetworking.readP2PPacket | public int readP2PPacket(SteamID steamIDRemote, ByteBuffer dest, int channel) throws SteamException {
"""
Read incoming packet data into a direct {@link ByteBuffer}.
On success, returns the number of bytes received, and the <code>steamIDRemote</code> parameter contains the
sender's ID.
"""
if (!dest.isD... | java | public int readP2PPacket(SteamID steamIDRemote, ByteBuffer dest, int channel) throws SteamException {
if (!dest.isDirect()) {
throw new SteamException("Direct buffer required!");
}
if (readP2PPacket(pointer, dest, dest.position(), dest.remaining(), tmpIntResult, tmpLongResult, channel)) {
steamIDRemote.ha... | [
"public",
"int",
"readP2PPacket",
"(",
"SteamID",
"steamIDRemote",
",",
"ByteBuffer",
"dest",
",",
"int",
"channel",
")",
"throws",
"SteamException",
"{",
"if",
"(",
"!",
"dest",
".",
"isDirect",
"(",
")",
")",
"{",
"throw",
"new",
"SteamException",
"(",
"... | Read incoming packet data into a direct {@link ByteBuffer}.
On success, returns the number of bytes received, and the <code>steamIDRemote</code> parameter contains the
sender's ID. | [
"Read",
"incoming",
"packet",
"data",
"into",
"a",
"direct",
"{",
"@link",
"ByteBuffer",
"}",
"."
] | train | https://github.com/code-disaster/steamworks4j/blob/8813f680dfacd510fe8af35ce6c73be9b7d1cecb/java-wrapper/src/main/java/com/codedisaster/steamworks/SteamNetworking.java#L107-L119 |
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/Speed.java | Speed.of | public static Speed of(final double speed, final Unit unit) {
"""
Create a new GPS {@code Speed} object.
@param speed the GPS speed value
@param unit the speed unit
@return a new GPS {@code Speed} object
@throws NullPointerException if the given speed {@code unit} is
{@code null}
"""
requireNonNull(un... | java | public static Speed of(final double speed, final Unit unit) {
requireNonNull(unit);
return new Speed(Unit.METERS_PER_SECOND.convert(speed, unit));
} | [
"public",
"static",
"Speed",
"of",
"(",
"final",
"double",
"speed",
",",
"final",
"Unit",
"unit",
")",
"{",
"requireNonNull",
"(",
"unit",
")",
";",
"return",
"new",
"Speed",
"(",
"Unit",
".",
"METERS_PER_SECOND",
".",
"convert",
"(",
"speed",
",",
"unit... | Create a new GPS {@code Speed} object.
@param speed the GPS speed value
@param unit the speed unit
@return a new GPS {@code Speed} object
@throws NullPointerException if the given speed {@code unit} is
{@code null} | [
"Create",
"a",
"new",
"GPS",
"{",
"@code",
"Speed",
"}",
"object",
"."
] | train | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/Speed.java#L192-L195 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/executor/AbstractMBeanServerExecutor.java | AbstractMBeanServerExecutor.registerForMBeanNotifications | protected void registerForMBeanNotifications() {
"""
Add this executor as listener for MBeanServer notification so that we can update
the local timestamp for when the set of registered MBeans has changed last.
"""
Set<MBeanServerConnection> servers = getMBeanServers();
Exception lastExp = null... | java | protected void registerForMBeanNotifications() {
Set<MBeanServerConnection> servers = getMBeanServers();
Exception lastExp = null;
StringBuilder errors = new StringBuilder();
for (MBeanServerConnection server : servers) {
try {
JmxUtil.addMBeanRegistrationList... | [
"protected",
"void",
"registerForMBeanNotifications",
"(",
")",
"{",
"Set",
"<",
"MBeanServerConnection",
">",
"servers",
"=",
"getMBeanServers",
"(",
")",
";",
"Exception",
"lastExp",
"=",
"null",
";",
"StringBuilder",
"errors",
"=",
"new",
"StringBuilder",
"(",
... | Add this executor as listener for MBeanServer notification so that we can update
the local timestamp for when the set of registered MBeans has changed last. | [
"Add",
"this",
"executor",
"as",
"listener",
"for",
"MBeanServer",
"notification",
"so",
"that",
"we",
"can",
"update",
"the",
"local",
"timestamp",
"for",
"when",
"the",
"set",
"of",
"registered",
"MBeans",
"has",
"changed",
"last",
"."
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/executor/AbstractMBeanServerExecutor.java#L122-L136 |
kevinherron/opc-ua-stack | stack-client/src/main/java/com/digitalpetri/opcua/stack/client/UaTcpStackClient.java | UaTcpStackClient.getEndpoints | public static CompletableFuture<EndpointDescription[]> getEndpoints(String endpointUrl) {
"""
Query the GetEndpoints service at the given endpoint URL.
@param endpointUrl the endpoint URL to get endpoints from.
@return the {@link EndpointDescription}s returned by the GetEndpoints service.
"""
UaTcp... | java | public static CompletableFuture<EndpointDescription[]> getEndpoints(String endpointUrl) {
UaTcpStackClientConfig config = UaTcpStackClientConfig.builder()
.setEndpointUrl(endpointUrl)
.build();
UaTcpStackClient client = new UaTcpStackClient(config);
GetEndpoints... | [
"public",
"static",
"CompletableFuture",
"<",
"EndpointDescription",
"[",
"]",
">",
"getEndpoints",
"(",
"String",
"endpointUrl",
")",
"{",
"UaTcpStackClientConfig",
"config",
"=",
"UaTcpStackClientConfig",
".",
"builder",
"(",
")",
".",
"setEndpointUrl",
"(",
"endp... | Query the GetEndpoints service at the given endpoint URL.
@param endpointUrl the endpoint URL to get endpoints from.
@return the {@link EndpointDescription}s returned by the GetEndpoints service. | [
"Query",
"the",
"GetEndpoints",
"service",
"at",
"the",
"given",
"endpoint",
"URL",
"."
] | train | https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-client/src/main/java/com/digitalpetri/opcua/stack/client/UaTcpStackClient.java#L412-L426 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidDetail.java | ST_IsValidDetail.isValidDetail | public static Object[] isValidDetail(Geometry geometry, int flag) {
"""
Returns a valid_detail as an array of objects
[0] = isvalid,[1] = reason, [2] = error location
isValid equals true if the geometry is valid.
reason correponds to an error message describing this error.
error returns the location of this ... | java | public static Object[] isValidDetail(Geometry geometry, int flag) {
if (geometry != null) {
if (flag == 0) {
return detail(geometry, false);
} else if (flag == 1) {
return detail(geometry, true);
} else {
thr... | [
"public",
"static",
"Object",
"[",
"]",
"isValidDetail",
"(",
"Geometry",
"geometry",
",",
"int",
"flag",
")",
"{",
"if",
"(",
"geometry",
"!=",
"null",
")",
"{",
"if",
"(",
"flag",
"==",
"0",
")",
"{",
"return",
"detail",
"(",
"geometry",
",",
"fals... | Returns a valid_detail as an array of objects
[0] = isvalid,[1] = reason, [2] = error location
isValid equals true if the geometry is valid.
reason correponds to an error message describing this error.
error returns the location of this error (on the {@link Geometry}
containing the error.
@param geometry
@param flag
... | [
"Returns",
"a",
"valid_detail",
"as",
"an",
"array",
"of",
"objects",
"[",
"0",
"]",
"=",
"isvalid",
"[",
"1",
"]",
"=",
"reason",
"[",
"2",
"]",
"=",
"error",
"location"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidDetail.java#L76-L87 |
jayantk/jklol | src/com/jayantkrish/jklol/tensor/SparseTensor.java | SparseTensor.fromUnorderedKeyValues | public static SparseTensor fromUnorderedKeyValues(int[] dimensionNumbers, int[] dimensionSizes,
long[] keyNums, double[] values) {
"""
Similar to the constructor, except does not require
{@code keyNums} to occur in ascending order.
@param dimensionNumbers
@param dimensionSizes
@param keyNums
@param va... | java | public static SparseTensor fromUnorderedKeyValues(int[] dimensionNumbers, int[] dimensionSizes,
long[] keyNums, double[] values) {
long[] keyNumsCopy = ArrayUtils.copyOf(keyNums, keyNums.length);
double[] valuesCopy = ArrayUtils.copyOf(values, values.length);
return fromUnorderedKeyValuesNoCopy(dimens... | [
"public",
"static",
"SparseTensor",
"fromUnorderedKeyValues",
"(",
"int",
"[",
"]",
"dimensionNumbers",
",",
"int",
"[",
"]",
"dimensionSizes",
",",
"long",
"[",
"]",
"keyNums",
",",
"double",
"[",
"]",
"values",
")",
"{",
"long",
"[",
"]",
"keyNumsCopy",
... | Similar to the constructor, except does not require
{@code keyNums} to occur in ascending order.
@param dimensionNumbers
@param dimensionSizes
@param keyNums
@param values
@return | [
"Similar",
"to",
"the",
"constructor",
"except",
"does",
"not",
"require",
"{",
"@code",
"keyNums",
"}",
"to",
"occur",
"in",
"ascending",
"order",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/tensor/SparseTensor.java#L1269-L1274 |
aoindustries/semanticcms-openfile-servlet | src/main/java/com/semanticcms/openfile/servlet/OpenFile.java | OpenFile.isAllowed | public static boolean isAllowed(ServletContext servletContext, ServletRequest request) {
"""
Checks if the given request is allowed to open files on the server.
The servlet init param must have it enabled, as well as be from an allowed IP.
"""
return
Boolean.parseBoolean(servletContext.getInitParameter(E... | java | public static boolean isAllowed(ServletContext servletContext, ServletRequest request) {
return
Boolean.parseBoolean(servletContext.getInitParameter(ENABLE_INIT_PARAM))
&& isAllowedAddr(request.getRemoteAddr())
;
} | [
"public",
"static",
"boolean",
"isAllowed",
"(",
"ServletContext",
"servletContext",
",",
"ServletRequest",
"request",
")",
"{",
"return",
"Boolean",
".",
"parseBoolean",
"(",
"servletContext",
".",
"getInitParameter",
"(",
"ENABLE_INIT_PARAM",
")",
")",
"&&",
"isAl... | Checks if the given request is allowed to open files on the server.
The servlet init param must have it enabled, as well as be from an allowed IP. | [
"Checks",
"if",
"the",
"given",
"request",
"is",
"allowed",
"to",
"open",
"files",
"on",
"the",
"server",
".",
"The",
"servlet",
"init",
"param",
"must",
"have",
"it",
"enabled",
"as",
"well",
"as",
"be",
"from",
"an",
"allowed",
"IP",
"."
] | train | https://github.com/aoindustries/semanticcms-openfile-servlet/blob/d22b2580b57708311949ac1088e3275355774921/src/main/java/com/semanticcms/openfile/servlet/OpenFile.java#L70-L75 |
jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/form/elements/JQMSlider.java | JQMSlider.setValue | @Override
public void setValue(Double value, boolean fireEvents) {
"""
Sets the value of the slider to the given value
@param value the new value of the slider, must be in the range of the slider
"""
Double old = getValue();
if (old == value || old != null && old.equals(value)) return;
... | java | @Override
public void setValue(Double value, boolean fireEvents) {
Double old = getValue();
if (old == value || old != null && old.equals(value)) return;
internVal = value;
setInputValueAttr(value);
ignoreChange = true;
try {
refresh(input.getElement().get... | [
"@",
"Override",
"public",
"void",
"setValue",
"(",
"Double",
"value",
",",
"boolean",
"fireEvents",
")",
"{",
"Double",
"old",
"=",
"getValue",
"(",
")",
";",
"if",
"(",
"old",
"==",
"value",
"||",
"old",
"!=",
"null",
"&&",
"old",
".",
"equals",
"(... | Sets the value of the slider to the given value
@param value the new value of the slider, must be in the range of the slider | [
"Sets",
"the",
"value",
"of",
"the",
"slider",
"to",
"the",
"given",
"value"
] | train | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/form/elements/JQMSlider.java#L481-L494 |
alkacon/opencms-core | src/org/opencms/workplace/CmsDialog.java | CmsDialog.pageHtml | @Override
public String pageHtml(int segment, String helpUrl) {
"""
Builds the start html of the page, including setting of DOCTYPE and
inserting a header with the content-type.<p>
This overloads the default method of the parent class.<p>
@param segment the HTML segment (START / END)
@param helpUrl the... | java | @Override
public String pageHtml(int segment, String helpUrl) {
return pageHtml(segment, helpUrl, null);
} | [
"@",
"Override",
"public",
"String",
"pageHtml",
"(",
"int",
"segment",
",",
"String",
"helpUrl",
")",
"{",
"return",
"pageHtml",
"(",
"segment",
",",
"helpUrl",
",",
"null",
")",
";",
"}"
] | Builds the start html of the page, including setting of DOCTYPE and
inserting a header with the content-type.<p>
This overloads the default method of the parent class.<p>
@param segment the HTML segment (START / END)
@param helpUrl the url for the online help to include on the page
@return the start html of the page | [
"Builds",
"the",
"start",
"html",
"of",
"the",
"page",
"including",
"setting",
"of",
"DOCTYPE",
"and",
"inserting",
"a",
"header",
"with",
"the",
"content",
"-",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsDialog.java#L1458-L1462 |
google/truth | core/src/main/java/com/google/common/truth/GraphMatching.java | GraphMatching.maximumCardinalityBipartiteMatching | static <U, V> ImmutableBiMap<U, V> maximumCardinalityBipartiteMatching(Multimap<U, V> graph) {
"""
Finds a <a
href="https://en.wikipedia.org/wiki/Matching_(graph_theory)#In_unweighted_bipartite_graphs">
maximum cardinality matching of a bipartite graph</a>. The vertices of one part of the
bipartite graph are id... | java | static <U, V> ImmutableBiMap<U, V> maximumCardinalityBipartiteMatching(Multimap<U, V> graph) {
return HopcroftKarp.overBipartiteGraph(graph).perform();
} | [
"static",
"<",
"U",
",",
"V",
">",
"ImmutableBiMap",
"<",
"U",
",",
"V",
">",
"maximumCardinalityBipartiteMatching",
"(",
"Multimap",
"<",
"U",
",",
"V",
">",
"graph",
")",
"{",
"return",
"HopcroftKarp",
".",
"overBipartiteGraph",
"(",
"graph",
")",
".",
... | Finds a <a
href="https://en.wikipedia.org/wiki/Matching_(graph_theory)#In_unweighted_bipartite_graphs">
maximum cardinality matching of a bipartite graph</a>. The vertices of one part of the
bipartite graph are identified by objects of type {@code U} using object equality. The vertices
of the other part are similarly i... | [
"Finds",
"a",
"<a",
"href",
"=",
"https",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Matching_",
"(",
"graph_theory",
")",
"#In_unweighted_bipartite_graphs",
">",
"maximum",
"cardinality",
"matching",
"of",
"a",
"bipartite",
"graph<",
... | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/GraphMatching.java#L54-L56 |
ops4j/org.ops4j.base | ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java | ElementHelper.getChild | public static Element getChild( Element root, String name ) {
"""
Return a named child relative to a supplied element.
@param root the parent DOM element
@param name the name of a child element
@return the child element of null if the child does not exist
"""
if( null == root )
{
... | java | public static Element getChild( Element root, String name )
{
if( null == root )
{
return null;
}
NodeList list = root.getElementsByTagName( name );
int n = list.getLength();
if( n < 1 )
{
return null;
}
return (Element)... | [
"public",
"static",
"Element",
"getChild",
"(",
"Element",
"root",
",",
"String",
"name",
")",
"{",
"if",
"(",
"null",
"==",
"root",
")",
"{",
"return",
"null",
";",
"}",
"NodeList",
"list",
"=",
"root",
".",
"getElementsByTagName",
"(",
"name",
")",
"... | Return a named child relative to a supplied element.
@param root the parent DOM element
@param name the name of a child element
@return the child element of null if the child does not exist | [
"Return",
"a",
"named",
"child",
"relative",
"to",
"a",
"supplied",
"element",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java#L115-L128 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java | EscapedFunctions.sqlsubstring | public static String sqlsubstring(List<?> parsedArgs) throws SQLException {
"""
substring to substr translation.
@param parsedArgs arguments
@return sql call
@throws SQLException if something wrong happens
"""
if (parsedArgs.size() == 2) {
return "substr(" + parsedArgs.get(0) + "," + parsedArgs.... | java | public static String sqlsubstring(List<?> parsedArgs) throws SQLException {
if (parsedArgs.size() == 2) {
return "substr(" + parsedArgs.get(0) + "," + parsedArgs.get(1) + ")";
} else if (parsedArgs.size() == 3) {
return "substr(" + parsedArgs.get(0) + "," + parsedArgs.get(1) + "," + parsedArgs.get(2... | [
"public",
"static",
"String",
"sqlsubstring",
"(",
"List",
"<",
"?",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"parsedArgs",
".",
"size",
"(",
")",
"==",
"2",
")",
"{",
"return",
"\"substr(\"",
"+",
"parsedArgs",
".",
"get",
"(",
... | substring to substr translation.
@param parsedArgs arguments
@return sql call
@throws SQLException if something wrong happens | [
"substring",
"to",
"substr",
"translation",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L377-L387 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_number_serviceName_PUT | public void billingAccount_number_serviceName_PUT(String billingAccount, String serviceName, OvhNumber body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/number/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The name o... | java | public void billingAccount_number_serviceName_PUT(String billingAccount, String serviceName, OvhNumber body) throws IOException {
String qPath = "/telephony/{billingAccount}/number/{serviceName}";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_number_serviceName_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhNumber",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/number/{serviceName}\"",
";",
"Strin... | Alter this object properties
REST: PUT /telephony/{billingAccount}/number/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] Name of the service | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5666-L5670 |
Azure/azure-sdk-for-java | signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java | SignalRsInner.beginRegenerateKey | public SignalRKeysInner beginRegenerateKey(String resourceGroupName, String resourceName, KeyType keyType) {
"""
Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time.
@param resourceGroupName The name of the resource group that contains the resource. You can ... | java | public SignalRKeysInner beginRegenerateKey(String resourceGroupName, String resourceName, KeyType keyType) {
return beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName, keyType).toBlocking().single().body();
} | [
"public",
"SignalRKeysInner",
"beginRegenerateKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"KeyType",
"keyType",
")",
"{",
"return",
"beginRegenerateKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",",
"keyType",... | Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param resourceName The name of the SignalR resourc... | [
"Regenerate",
"SignalR",
"service",
"access",
"key",
".",
"PrimaryKey",
"and",
"SecondaryKey",
"cannot",
"be",
"regenerated",
"at",
"the",
"same",
"time",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java#L819-L821 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.decodeByte | private int decodeByte( QrCode qr , PackedBits8 data, int bitLocation ) {
"""
Decodes byte messages
@param qr QR code
@param data encoded data
@return Location it has read up to in bits
"""
int lengthBits = QrCodeEncoder.getLengthBitsBytes(qr.version);
int length = data.read(bitLocation,lengthBits,tr... | java | private int decodeByte( QrCode qr , PackedBits8 data, int bitLocation ) {
int lengthBits = QrCodeEncoder.getLengthBitsBytes(qr.version);
int length = data.read(bitLocation,lengthBits,true);
bitLocation += lengthBits;
if( length*8 > data.size-bitLocation ) {
qr.failureCause = QrCode.Failure.MESSAGE_OVERFLOW... | [
"private",
"int",
"decodeByte",
"(",
"QrCode",
"qr",
",",
"PackedBits8",
"data",
",",
"int",
"bitLocation",
")",
"{",
"int",
"lengthBits",
"=",
"QrCodeEncoder",
".",
"getLengthBitsBytes",
"(",
"qr",
".",
"version",
")",
";",
"int",
"length",
"=",
"data",
"... | Decodes byte messages
@param qr QR code
@param data encoded data
@return Location it has read up to in bits | [
"Decodes",
"byte",
"messages"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L337-L367 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/DialogUtils.java | DialogUtils.waitForDialogToOpen | public boolean waitForDialogToOpen(long timeout, boolean sleepFirst) {
"""
Waits for a {@link android.app.Dialog} to open.
@param timeout the amount of time in milliseconds to wait
@return {@code true} if the {@code Dialog} is opened before the timeout and {@code false} if it is not opened
"""
final long... | java | public boolean waitForDialogToOpen(long timeout, boolean sleepFirst) {
final long endTime = SystemClock.uptimeMillis() + timeout;
boolean dialogIsOpen = isDialogOpen();
if(sleepFirst)
sleeper.sleep();
if(dialogIsOpen){
return true;
}
while (SystemClock.uptimeMillis() < endTime) {
if(isDialogO... | [
"public",
"boolean",
"waitForDialogToOpen",
"(",
"long",
"timeout",
",",
"boolean",
"sleepFirst",
")",
"{",
"final",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"+",
"timeout",
";",
"boolean",
"dialogIsOpen",
"=",
"isDialogOpen",
"(",
... | Waits for a {@link android.app.Dialog} to open.
@param timeout the amount of time in milliseconds to wait
@return {@code true} if the {@code Dialog} is opened before the timeout and {@code false} if it is not opened | [
"Waits",
"for",
"a",
"{",
"@link",
"android",
".",
"app",
".",
"Dialog",
"}",
"to",
"open",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/DialogUtils.java#L76-L95 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.