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 |
|---|---|---|---|---|---|---|---|---|---|---|
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CSTransformer.java | CSTransformer.transformSpecTopic | protected static SpecTopic transformSpecTopic(final CSNodeWrapper node, final Map<Integer, Node> nodes,
final Map<String, SpecTopic> targetTopics, final List<CSNodeWrapper> relationshipFromNodes) {
"""
Transform a Topic CSNode entity object into a SpecTopic Object that can be added to a Content Specifi... | java | protected static SpecTopic transformSpecTopic(final CSNodeWrapper node, final Map<Integer, Node> nodes,
final Map<String, SpecTopic> targetTopics, final List<CSNodeWrapper> relationshipFromNodes) {
if (node.getNodeType() != CommonConstants.CS_NODE_TOPIC) {
throw new IllegalArgumentExcept... | [
"protected",
"static",
"SpecTopic",
"transformSpecTopic",
"(",
"final",
"CSNodeWrapper",
"node",
",",
"final",
"Map",
"<",
"Integer",
",",
"Node",
">",
"nodes",
",",
"final",
"Map",
"<",
"String",
",",
"SpecTopic",
">",
"targetTopics",
",",
"final",
"List",
... | Transform a Topic CSNode entity object into a SpecTopic Object that can be added to a Content Specification.
@param node The CSNode entity object to be transformed.
@param nodes A mapping of node entity ids to their transformed counterparts.
@param targetTopics A mapping of ta... | [
"Transform",
"a",
"Topic",
"CSNode",
"entity",
"object",
"into",
"a",
"SpecTopic",
"Object",
"that",
"can",
"be",
"added",
"to",
"a",
"Content",
"Specification",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CSTransformer.java#L464-L471 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/share.java | share.sendEmail | public static void sendEmail(String email, String subject, String emailBody) {
"""
Share via Email
@param email destination email (e.g. support@company.com)
@param subject email subject
@param emailBody email body
"""
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.s... | java | public static void sendEmail(String email, String subject, String emailBody) {
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("message/rfc822");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{email});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
... | [
"public",
"static",
"void",
"sendEmail",
"(",
"String",
"email",
",",
"String",
"subject",
",",
"String",
"emailBody",
")",
"{",
"Intent",
"emailIntent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_SEND",
")",
";",
"emailIntent",
".",
"setType",
"(",
... | Share via Email
@param email destination email (e.g. support@company.com)
@param subject email subject
@param emailBody email body | [
"Share",
"via",
"Email"
] | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/share.java#L22-L36 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiForm.java | GitLabApiForm.withParam | public GitLabApiForm withParam(String name, Date date) throws IllegalArgumentException {
"""
Fluent method for adding Date query and form parameters to a get() or post() call.
@param name the name of the field/attribute to add
@param date the value of the field/attribute to add
@return this GitLabAPiForm inst... | java | public GitLabApiForm withParam(String name, Date date) throws IllegalArgumentException {
return (withParam(name, date, false));
} | [
"public",
"GitLabApiForm",
"withParam",
"(",
"String",
"name",
",",
"Date",
"date",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"(",
"withParam",
"(",
"name",
",",
"date",
",",
"false",
")",
")",
";",
"}"
] | Fluent method for adding Date query and form parameters to a get() or post() call.
@param name the name of the field/attribute to add
@param date the value of the field/attribute to add
@return this GitLabAPiForm instance | [
"Fluent",
"method",
"for",
"adding",
"Date",
"query",
"and",
"form",
"parameters",
"to",
"a",
"get",
"()",
"or",
"post",
"()",
"call",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiForm.java#L57-L59 |
openbase/jul | schedule/src/main/java/org/openbase/jul/schedule/Timeout.java | Timeout.internal_start | private void internal_start(final long waitTime) throws RejectedExecutionException, CouldNotPerformException {
"""
Internal synchronized start method.
@param waitTime The time to wait until the timeout is reached.
@throws RejectedExecutionException is thrown if the timeout task could not be scheduled.
@thro... | java | private void internal_start(final long waitTime) throws RejectedExecutionException, CouldNotPerformException {
synchronized (lock) {
if (isActive()) {
logger.debug("Reject start, not interrupted or expired.");
return;
}
expired = false;
... | [
"private",
"void",
"internal_start",
"(",
"final",
"long",
"waitTime",
")",
"throws",
"RejectedExecutionException",
",",
"CouldNotPerformException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"isActive",
"(",
")",
")",
"{",
"logger",
".",
"debug",
... | Internal synchronized start method.
@param waitTime The time to wait until the timeout is reached.
@throws RejectedExecutionException is thrown if the timeout task could not be scheduled.
@throws CouldNotPerformException is thrown in case the timeout could not be started. | [
"Internal",
"synchronized",
"start",
"method",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/schedule/src/main/java/org/openbase/jul/schedule/Timeout.java#L167-L198 |
daimajia/AndroidImageSlider | library/src/main/java/com/daimajia/slider/library/Tricks/ViewPagerEx.java | ViewPagerEx.executeKeyEvent | public boolean executeKeyEvent(KeyEvent event) {
"""
You can call this function yourself to have the scroll view perform
scrolling from a key event, just as if the event had been dispatched to
it by the view hierarchy.
@param event The key event to execute.
@return Return true if the event was handled, else ... | java | public boolean executeKeyEvent(KeyEvent event) {
boolean handled = false;
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_LEFT:
handled = arrowScroll(FOCUS_LEFT);
break;
... | [
"public",
"boolean",
"executeKeyEvent",
"(",
"KeyEvent",
"event",
")",
"{",
"boolean",
"handled",
"=",
"false",
";",
"if",
"(",
"event",
".",
"getAction",
"(",
")",
"==",
"KeyEvent",
".",
"ACTION_DOWN",
")",
"{",
"switch",
"(",
"event",
".",
"getKeyCode",
... | You can call this function yourself to have the scroll view perform
scrolling from a key event, just as if the event had been dispatched to
it by the view hierarchy.
@param event The key event to execute.
@return Return true if the event was handled, else false. | [
"You",
"can",
"call",
"this",
"function",
"yourself",
"to",
"have",
"the",
"scroll",
"view",
"perform",
"scrolling",
"from",
"a",
"key",
"event",
"just",
"as",
"if",
"the",
"event",
"had",
"been",
"dispatched",
"to",
"it",
"by",
"the",
"view",
"hierarchy",... | train | https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Tricks/ViewPagerEx.java#L2505-L2529 |
gfk-ba/senbot | SenBotRunner/src/main/java/com/gfk/senbot/framework/services/selenium/ElementService.java | ElementService.dragElementTo | public void dragElementTo(By draggable, int x, int y) throws InterruptedException {
"""
Drags an element some place else
@param draggable
The element to drag
@param x
Offset
@param y
Offset
@throws InterruptedException
"""
WebDriver driver = getWebDriver();
Actions clickAndDrag = new Actions(getW... | java | public void dragElementTo(By draggable, int x, int y) throws InterruptedException {
WebDriver driver = getWebDriver();
Actions clickAndDrag = new Actions(getWebDriver());
clickAndDrag.dragAndDropBy(driver.findElement(draggable), x, y);
clickAndDrag.perform();
} | [
"public",
"void",
"dragElementTo",
"(",
"By",
"draggable",
",",
"int",
"x",
",",
"int",
"y",
")",
"throws",
"InterruptedException",
"{",
"WebDriver",
"driver",
"=",
"getWebDriver",
"(",
")",
";",
"Actions",
"clickAndDrag",
"=",
"new",
"Actions",
"(",
"getWeb... | Drags an element some place else
@param draggable
The element to drag
@param x
Offset
@param y
Offset
@throws InterruptedException | [
"Drags",
"an",
"element",
"some",
"place",
"else"
] | train | https://github.com/gfk-ba/senbot/blob/e9a152aa67be48b1bb13a4691655caf6d873b553/SenBotRunner/src/main/java/com/gfk/senbot/framework/services/selenium/ElementService.java#L351-L357 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.leftShift | public static OutputStream leftShift(Process self, byte[] value) throws IOException {
"""
Overloads the left shift operator to provide an append mechanism
to pipe into a Process
@param self a Process instance
@param value data to append
@return an OutputStream
@throws java.io.IOException if an IOException ... | java | public static OutputStream leftShift(Process self, byte[] value) throws IOException {
return IOGroovyMethods.leftShift(self.getOutputStream(), value);
} | [
"public",
"static",
"OutputStream",
"leftShift",
"(",
"Process",
"self",
",",
"byte",
"[",
"]",
"value",
")",
"throws",
"IOException",
"{",
"return",
"IOGroovyMethods",
".",
"leftShift",
"(",
"self",
".",
"getOutputStream",
"(",
")",
",",
"value",
")",
";",
... | Overloads the left shift operator to provide an append mechanism
to pipe into a Process
@param self a Process instance
@param value data to append
@return an OutputStream
@throws java.io.IOException if an IOException occurs.
@since 1.0 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"an",
"append",
"mechanism",
"to",
"pipe",
"into",
"a",
"Process"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L128-L130 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DevicesManagementApi.java | DevicesManagementApi.getTasks | public TaskListEnvelope getTasks(String dtid, Integer count, Integer offset, String status, String order, String sort) throws ApiException {
"""
Returns the all the tasks for a device type.
Returns the all the tasks for a device type.
@param dtid Device Type ID. (required)
@param count Max results count. (optio... | java | public TaskListEnvelope getTasks(String dtid, Integer count, Integer offset, String status, String order, String sort) throws ApiException {
ApiResponse<TaskListEnvelope> resp = getTasksWithHttpInfo(dtid, count, offset, status, order, sort);
return resp.getData();
} | [
"public",
"TaskListEnvelope",
"getTasks",
"(",
"String",
"dtid",
",",
"Integer",
"count",
",",
"Integer",
"offset",
",",
"String",
"status",
",",
"String",
"order",
",",
"String",
"sort",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"TaskListEnvelope"... | Returns the all the tasks for a device type.
Returns the all the tasks for a device type.
@param dtid Device Type ID. (required)
@param count Max results count. (optional)
@param offset Result starting offset. (optional)
@param status Status filter. Comma-separated statuses. (optional)
@param order Sort results by a fi... | [
"Returns",
"the",
"all",
"the",
"tasks",
"for",
"a",
"device",
"type",
".",
"Returns",
"the",
"all",
"the",
"tasks",
"for",
"a",
"device",
"type",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DevicesManagementApi.java#L1279-L1282 |
haraldk/TwelveMonkeys | imageio/imageio-clippath/src/main/java/com/twelvemonkeys/imageio/path/Paths.java | Paths.applyClippingPath | public static BufferedImage applyClippingPath(final Shape clip, final BufferedImage image, final BufferedImage destination) {
"""
Applies the clipping path to the given image.
Client code may decide the type of the {@code destination} image.
The {@code destination} image is assumed to be fully transparent,
and ... | java | public static BufferedImage applyClippingPath(final Shape clip, final BufferedImage image, final BufferedImage destination) {
notNull(clip, "clip");
notNull(image, "image");
isTrue(destination != null && destination != image, "destination may not be null or same instance as image");
Gra... | [
"public",
"static",
"BufferedImage",
"applyClippingPath",
"(",
"final",
"Shape",
"clip",
",",
"final",
"BufferedImage",
"image",
",",
"final",
"BufferedImage",
"destination",
")",
"{",
"notNull",
"(",
"clip",
",",
"\"clip\"",
")",
";",
"notNull",
"(",
"image",
... | Applies the clipping path to the given image.
Client code may decide the type of the {@code destination} image.
The {@code destination} image is assumed to be fully transparent,
and have same dimensions as {@code image}.
All pixels outside the path will be transparent.
@param clip the clipping path, not {@code null}.
... | [
"Applies",
"the",
"clipping",
"path",
"to",
"the",
"given",
"image",
".",
"Client",
"code",
"may",
"decide",
"the",
"type",
"of",
"the",
"{",
"@code",
"destination",
"}",
"image",
".",
"The",
"{",
"@code",
"destination",
"}",
"image",
"is",
"assumed",
"t... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-clippath/src/main/java/com/twelvemonkeys/imageio/path/Paths.java#L204-L229 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleCache.java | StyleCache.setFeatureStyle | public boolean setFeatureStyle(MarkerOptions markerOptions, FeatureStyle featureStyle) {
"""
Set the feature style (icon or style) into the marker options
@param markerOptions marker options
@param featureStyle feature style
@return true if icon or style was set into the marker options
"""
return... | java | public boolean setFeatureStyle(MarkerOptions markerOptions, FeatureStyle featureStyle) {
return StyleUtils.setFeatureStyle(markerOptions, featureStyle, density, iconCache);
} | [
"public",
"boolean",
"setFeatureStyle",
"(",
"MarkerOptions",
"markerOptions",
",",
"FeatureStyle",
"featureStyle",
")",
"{",
"return",
"StyleUtils",
".",
"setFeatureStyle",
"(",
"markerOptions",
",",
"featureStyle",
",",
"density",
",",
"iconCache",
")",
";",
"}"
] | Set the feature style (icon or style) into the marker options
@param markerOptions marker options
@param featureStyle feature style
@return true if icon or style was set into the marker options | [
"Set",
"the",
"feature",
"style",
"(",
"icon",
"or",
"style",
")",
"into",
"the",
"marker",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleCache.java#L156-L158 |
beanshell/beanshell | src/main/java/bsh/NameSpace.java | NameSpace.get | public Object get(final String name, final Interpreter interpreter)
throws UtilEvalError {
"""
Resolve name to an object through this namespace.
@param name the name
@param interpreter the interpreter
@return the object
@throws UtilEvalError the util eval error
"""
final CallStack calls... | java | public Object get(final String name, final Interpreter interpreter)
throws UtilEvalError {
final CallStack callstack = new CallStack(this);
return this.getNameResolver(name).toObject(callstack, interpreter);
} | [
"public",
"Object",
"get",
"(",
"final",
"String",
"name",
",",
"final",
"Interpreter",
"interpreter",
")",
"throws",
"UtilEvalError",
"{",
"final",
"CallStack",
"callstack",
"=",
"new",
"CallStack",
"(",
"this",
")",
";",
"return",
"this",
".",
"getNameResolv... | Resolve name to an object through this namespace.
@param name the name
@param interpreter the interpreter
@return the object
@throws UtilEvalError the util eval error | [
"Resolve",
"name",
"to",
"an",
"object",
"through",
"this",
"namespace",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L218-L222 |
m-m-m/util | nls/src/main/java/net/sf/mmm/util/nls/impl/DefaultNlsTemplateResolver.java | DefaultNlsTemplateResolver.initTemplatesForResourceBundles | protected void initTemplatesForResourceBundles(Map<String, NlsTemplate> map) {
"""
This method initializes the {@link NlsTemplate}s for reverse lookup for {@link ResourceBundle}s.
@param map the {@link Map} where to {@link Map#put(Object, Object) register} the {@link NlsTemplate}s by
their {@link net.sf.mmm.ut... | java | protected void initTemplatesForResourceBundles(Map<String, NlsTemplate> map) {
List<ResourceBundle> bundles = this.resourceBundleLocator.findBundles();
for (ResourceBundle resourceBundle : bundles) {
String name = resourceBundle.getBaseBundleName();
if (name == null) {
name = resourceBundle... | [
"protected",
"void",
"initTemplatesForResourceBundles",
"(",
"Map",
"<",
"String",
",",
"NlsTemplate",
">",
"map",
")",
"{",
"List",
"<",
"ResourceBundle",
">",
"bundles",
"=",
"this",
".",
"resourceBundleLocator",
".",
"findBundles",
"(",
")",
";",
"for",
"("... | This method initializes the {@link NlsTemplate}s for reverse lookup for {@link ResourceBundle}s.
@param map the {@link Map} where to {@link Map#put(Object, Object) register} the {@link NlsTemplate}s by
their {@link net.sf.mmm.util.nls.api.NlsMessage#getInternationalizedMessage() i18n message}. | [
"This",
"method",
"initializes",
"the",
"{",
"@link",
"NlsTemplate",
"}",
"s",
"for",
"reverse",
"lookup",
"for",
"{",
"@link",
"ResourceBundle",
"}",
"s",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/nls/src/main/java/net/sf/mmm/util/nls/impl/DefaultNlsTemplateResolver.java#L97-L113 |
kongchen/swagger-maven-plugin | src/main/java/com/github/kongchen/swagger/docgen/mavenplugin/SecurityDefinition.java | SecurityDefinition.tryFillNameField | private void tryFillNameField(SecuritySchemeDefinition ssd, String value) {
"""
<p>Try to fill the name property of some authentication definition, if no user defined value was set.</p>
<p>If the current value of the name property is empty, this will fill it to be the same as the name of the
security definition.... | java | private void tryFillNameField(SecuritySchemeDefinition ssd, String value) {
if (ssd == null) {
return;
}
Field nameField = FieldUtils.getField(ssd.getClass(), "name", true);
try {
if (nameField != null && nameField.get(ssd) == null) {
nameField.se... | [
"private",
"void",
"tryFillNameField",
"(",
"SecuritySchemeDefinition",
"ssd",
",",
"String",
"value",
")",
"{",
"if",
"(",
"ssd",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Field",
"nameField",
"=",
"FieldUtils",
".",
"getField",
"(",
"ssd",
".",
"getCl... | <p>Try to fill the name property of some authentication definition, if no user defined value was set.</p>
<p>If the current value of the name property is empty, this will fill it to be the same as the name of the
security definition.</br>
If no {@link Field} named "name" is found inside the given SecuritySchemeDefiniti... | [
"<p",
">",
"Try",
"to",
"fill",
"the",
"name",
"property",
"of",
"some",
"authentication",
"definition",
"if",
"no",
"user",
"defined",
"value",
"was",
"set",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"the",
"current",
"value",
"of",
"the",
"name",
"... | train | https://github.com/kongchen/swagger-maven-plugin/blob/0709b035ef45e1cb13189cd7f949c52c10557747/src/main/java/com/github/kongchen/swagger/docgen/mavenplugin/SecurityDefinition.java#L67-L80 |
JOML-CI/JOML | src/org/joml/Quaternionf.java | Quaternionf.rotationAxis | public Quaternionf rotationAxis(float angle, Vector3fc axis) {
"""
Set this quaternion to a rotation of the given angle in radians about the supplied axis.
@see #rotationAxis(float, float, float, float)
@param angle
the rotation angle in radians
@param axis
the axis to rotate about
@return this
"""
... | java | public Quaternionf rotationAxis(float angle, Vector3fc axis) {
return rotationAxis(angle, axis.x(), axis.y(), axis.z());
} | [
"public",
"Quaternionf",
"rotationAxis",
"(",
"float",
"angle",
",",
"Vector3fc",
"axis",
")",
"{",
"return",
"rotationAxis",
"(",
"angle",
",",
"axis",
".",
"x",
"(",
")",
",",
"axis",
".",
"y",
"(",
")",
",",
"axis",
".",
"z",
"(",
")",
")",
";",... | Set this quaternion to a rotation of the given angle in radians about the supplied axis.
@see #rotationAxis(float, float, float, float)
@param angle
the rotation angle in radians
@param axis
the axis to rotate about
@return this | [
"Set",
"this",
"quaternion",
"to",
"a",
"rotation",
"of",
"the",
"given",
"angle",
"in",
"radians",
"about",
"the",
"supplied",
"axis",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaternionf.java#L552-L554 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/PROCLUS.java | PROCLUS.manhattanSegmentalDistance | private double manhattanSegmentalDistance(NumberVector o1, double[] o2, long[] dimensions) {
"""
Returns the Manhattan segmental distance between o1 and o2 relative to the
specified dimensions.
@param o1 the first object
@param o2 the second object
@param dimensions the dimensions to be considered
@return t... | java | private double manhattanSegmentalDistance(NumberVector o1, double[] o2, long[] dimensions) {
double result = 0;
int card = 0;
for(int d = BitsUtil.nextSetBit(dimensions, 0); d >= 0; d = BitsUtil.nextSetBit(dimensions, d + 1)) {
result += Math.abs(o1.doubleValue(d) - o2[d]);
++card;
}
ret... | [
"private",
"double",
"manhattanSegmentalDistance",
"(",
"NumberVector",
"o1",
",",
"double",
"[",
"]",
"o2",
",",
"long",
"[",
"]",
"dimensions",
")",
"{",
"double",
"result",
"=",
"0",
";",
"int",
"card",
"=",
"0",
";",
"for",
"(",
"int",
"d",
"=",
... | Returns the Manhattan segmental distance between o1 and o2 relative to the
specified dimensions.
@param o1 the first object
@param o2 the second object
@param dimensions the dimensions to be considered
@return the Manhattan segmental distance between o1 and o2 relative to the
specified dimensions | [
"Returns",
"the",
"Manhattan",
"segmental",
"distance",
"between",
"o1",
"and",
"o2",
"relative",
"to",
"the",
"specified",
"dimensions",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/PROCLUS.java#L641-L649 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/Utils.java | Utils.isAssignableFrom | public static boolean isAssignableFrom(String lookingFor, TypeDescriptor candidate) {
"""
/*
Determine if the type specified in lookingFor is a supertype (class/interface) of the specified typedescriptor, i.e. can an
object of type 'candidate' be assigned to a variable of typ 'lookingFor'.
@return true if it ... | java | public static boolean isAssignableFrom(String lookingFor, TypeDescriptor candidate) {
String[] interfaces = candidate.getSuperinterfacesName();
for (String intface : interfaces) {
if (intface.equals(lookingFor)) {
return true;
}
boolean b = isAssignableFrom(lookingFor, candidate.getTypeRegistry().getDe... | [
"public",
"static",
"boolean",
"isAssignableFrom",
"(",
"String",
"lookingFor",
",",
"TypeDescriptor",
"candidate",
")",
"{",
"String",
"[",
"]",
"interfaces",
"=",
"candidate",
".",
"getSuperinterfacesName",
"(",
")",
";",
"for",
"(",
"String",
"intface",
":",
... | /*
Determine if the type specified in lookingFor is a supertype (class/interface) of the specified typedescriptor, i.e. can an
object of type 'candidate' be assigned to a variable of typ 'lookingFor'.
@return true if it is a supertype | [
"/",
"*",
"Determine",
"if",
"the",
"type",
"specified",
"in",
"lookingFor",
"is",
"a",
"supertype",
"(",
"class",
"/",
"interface",
")",
"of",
"the",
"specified",
"typedescriptor",
"i",
".",
"e",
".",
"can",
"an",
"object",
"of",
"type",
"candidate",
"b... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/Utils.java#L1662-L1681 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/ClassHelper.java | ClassHelper.newInstance | public static Object newInstance(String className, Class[] types, Object[] args) throws InstantiationException,
IllegalAccessException,
... | java | public static Object newInstance(String className, Class[] types, Object[] args) throws InstantiationException,
IllegalAccessException,
... | [
"public",
"static",
"Object",
"newInstance",
"(",
"String",
"className",
",",
"Class",
"[",
"]",
"types",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
",",
"IllegalArgumentException",
",",
"InvocationTarget... | Returns a new instance of the class with the given qualified name using the constructor with
the specified signature.
@param className The qualified name of the class to instantiate
@param types The parameter types
@param args The arguments
@return The instance | [
"Returns",
"a",
"new",
"instance",
"of",
"the",
"class",
"with",
"the",
"given",
"qualified",
"name",
"using",
"the",
"constructor",
"with",
"the",
"specified",
"signature",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/ClassHelper.java#L301-L310 |
apache/incubator-gobblin | gobblin-config-management/gobblin-config-client/src/main/java/org/apache/gobblin/config/client/ConfigClient.java | ConfigClient.getConfig | public Config getConfig(String configKeyStr) throws ConfigStoreFactoryDoesNotExistsException,
ConfigStoreCreationException, VersionDoesNotExistException, URISyntaxException {
"""
Convenient method to get resolved {@link Config} based on String input.
"""
return getConfig(configKeyStr, Optional.<Confi... | java | public Config getConfig(String configKeyStr) throws ConfigStoreFactoryDoesNotExistsException,
ConfigStoreCreationException, VersionDoesNotExistException, URISyntaxException {
return getConfig(configKeyStr, Optional.<Config>absent());
} | [
"public",
"Config",
"getConfig",
"(",
"String",
"configKeyStr",
")",
"throws",
"ConfigStoreFactoryDoesNotExistsException",
",",
"ConfigStoreCreationException",
",",
"VersionDoesNotExistException",
",",
"URISyntaxException",
"{",
"return",
"getConfig",
"(",
"configKeyStr",
","... | Convenient method to get resolved {@link Config} based on String input. | [
"Convenient",
"method",
"to",
"get",
"resolved",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-client/src/main/java/org/apache/gobblin/config/client/ConfigClient.java#L177-L180 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitInstance | public T visitInstance(Instance elm, C context) {
"""
Visit a Instance. This method will be called for
every node in the tree that is a Instance.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
"""
for (InstanceElement element : elm.getEleme... | java | public T visitInstance(Instance elm, C context) {
for (InstanceElement element : elm.getElement()) {
visitInstanceElement(element, context);
}
return null;
} | [
"public",
"T",
"visitInstance",
"(",
"Instance",
"elm",
",",
"C",
"context",
")",
"{",
"for",
"(",
"InstanceElement",
"element",
":",
"elm",
".",
"getElement",
"(",
")",
")",
"{",
"visitInstanceElement",
"(",
"element",
",",
"context",
")",
";",
"}",
"re... | Visit a Instance. This method will be called for
every node in the tree that is a Instance.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"Instance",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"Instance",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L496-L501 |
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.getPatternAnyEntityRoleAsync | public Observable<EntityRole> getPatternAnyEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
"""
Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity ID.
@param roleId entity role ID.
@throws IllegalArgumen... | java | public Observable<EntityRole> getPatternAnyEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
return getPatternAnyEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).map(new Func1<ServiceResponse<EntityRole>, EntityRole>() {
@Override
public En... | [
"public",
"Observable",
"<",
"EntityRole",
">",
"getPatternAnyEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"getPatternAnyEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
... | Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity ID.
@param roleId entity role ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the EntityRole object | [
"Get",
"one",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | 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#L12786-L12793 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.removeHeader | @Deprecated
public static void removeHeader(HttpMessage message, CharSequence name) {
"""
@deprecated Use {@link #remove(CharSequence)} instead.
Removes the header with the specified name.
"""
message.headers().remove(name);
} | java | @Deprecated
public static void removeHeader(HttpMessage message, CharSequence name) {
message.headers().remove(name);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"removeHeader",
"(",
"HttpMessage",
"message",
",",
"CharSequence",
"name",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"remove",
"(",
"name",
")",
";",
"}"
] | @deprecated Use {@link #remove(CharSequence)} instead.
Removes the header with the specified name. | [
"@deprecated",
"Use",
"{",
"@link",
"#remove",
"(",
"CharSequence",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L689-L692 |
looly/hutool | hutool-system/src/main/java/cn/hutool/system/SystemUtil.java | SystemUtil.append | protected static void append(StringBuilder builder, String caption, Object value) {
"""
输出到<code>StringBuilder</code>。
@param builder <code>StringBuilder</code>对象
@param caption 标题
@param value 值
"""
builder.append(caption).append(StrUtil.nullToDefault(Convert.toStr(value), "[n/a]")).append("\n");
} | java | protected static void append(StringBuilder builder, String caption, Object value) {
builder.append(caption).append(StrUtil.nullToDefault(Convert.toStr(value), "[n/a]")).append("\n");
} | [
"protected",
"static",
"void",
"append",
"(",
"StringBuilder",
"builder",
",",
"String",
"caption",
",",
"Object",
"value",
")",
"{",
"builder",
".",
"append",
"(",
"caption",
")",
".",
"append",
"(",
"StrUtil",
".",
"nullToDefault",
"(",
"Convert",
".",
"... | 输出到<code>StringBuilder</code>。
@param builder <code>StringBuilder</code>对象
@param caption 标题
@param value 值 | [
"输出到<code",
">",
"StringBuilder<",
"/",
"code",
">",
"。"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-system/src/main/java/cn/hutool/system/SystemUtil.java#L469-L471 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayScriptInternal | private static String getDisplayScriptInternal(ULocale locale, ULocale displayLocale) {
"""
displayLocaleID is canonical, localeID need not be since parsing will fix this.
"""
return LocaleDisplayNames.getInstance(displayLocale)
.scriptDisplayName(locale.getScript());
} | java | private static String getDisplayScriptInternal(ULocale locale, ULocale displayLocale) {
return LocaleDisplayNames.getInstance(displayLocale)
.scriptDisplayName(locale.getScript());
} | [
"private",
"static",
"String",
"getDisplayScriptInternal",
"(",
"ULocale",
"locale",
",",
"ULocale",
"displayLocale",
")",
"{",
"return",
"LocaleDisplayNames",
".",
"getInstance",
"(",
"displayLocale",
")",
".",
"scriptDisplayName",
"(",
"locale",
".",
"getScript",
... | displayLocaleID is canonical, localeID need not be since parsing will fix this. | [
"displayLocaleID",
"is",
"canonical",
"localeID",
"need",
"not",
"be",
"since",
"parsing",
"will",
"fix",
"this",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1552-L1555 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/TokenList.java | TokenList.extractSubList | public TokenList extractSubList( Token begin , Token end ) {
"""
Removes elements from begin to end from the list, inclusive. Returns a new list which
is composed of the removed elements
"""
if( begin == end ) {
remove(begin);
return new TokenList(begin,begin);
} else ... | java | public TokenList extractSubList( Token begin , Token end ) {
if( begin == end ) {
remove(begin);
return new TokenList(begin,begin);
} else {
if( first == begin ) {
first = end.next;
}
if( last == end ) {
last = b... | [
"public",
"TokenList",
"extractSubList",
"(",
"Token",
"begin",
",",
"Token",
"end",
")",
"{",
"if",
"(",
"begin",
"==",
"end",
")",
"{",
"remove",
"(",
"begin",
")",
";",
"return",
"new",
"TokenList",
"(",
"begin",
",",
"begin",
")",
";",
"}",
"else... | Removes elements from begin to end from the list, inclusive. Returns a new list which
is composed of the removed elements | [
"Removes",
"elements",
"from",
"begin",
"to",
"end",
"from",
"the",
"list",
"inclusive",
".",
"Returns",
"a",
"new",
"list",
"which",
"is",
"composed",
"of",
"the",
"removed",
"elements"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/TokenList.java#L188-L212 |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/addressing/WsAddressingHeaders.java | WsAddressingHeaders.setFrom | public void setFrom(String from) {
"""
Sets the from endpoint reference by string.
@param from the from to set
"""
try {
this.from = new EndpointReference(new URI(from));
} catch (URISyntaxException e) {
throw new CitrusRuntimeException("Invalid from uri", e);
}... | java | public void setFrom(String from) {
try {
this.from = new EndpointReference(new URI(from));
} catch (URISyntaxException e) {
throw new CitrusRuntimeException("Invalid from uri", e);
}
} | [
"public",
"void",
"setFrom",
"(",
"String",
"from",
")",
"{",
"try",
"{",
"this",
".",
"from",
"=",
"new",
"EndpointReference",
"(",
"new",
"URI",
"(",
"from",
")",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"throw",
"new",
"Ci... | Sets the from endpoint reference by string.
@param from the from to set | [
"Sets",
"the",
"from",
"endpoint",
"reference",
"by",
"string",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/addressing/WsAddressingHeaders.java#L174-L180 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlansInner.java | DdosProtectionPlansInner.createOrUpdateAsync | public Observable<DdosProtectionPlanInner> createOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) {
"""
Creates or updates a DDoS protection plan.
@param resourceGroupName The name of the resource group.
@param ddosProtectionPlanName The name of the DDo... | java | public Observable<DdosProtectionPlanInner> createOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).map(new Func1<ServiceResponse<DdosProtectionPlanInner... | [
"public",
"Observable",
"<",
"DdosProtectionPlanInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"ddosProtectionPlanName",
",",
"DdosProtectionPlanInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"r... | Creates or updates a DDoS protection plan.
@param resourceGroupName The name of the resource group.
@param ddosProtectionPlanName The name of the DDoS protection plan.
@param parameters Parameters supplied to the create or update operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@ret... | [
"Creates",
"or",
"updates",
"a",
"DDoS",
"protection",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlansInner.java#L378-L385 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/TableBucketReader.java | TableBucketReader.findAllExisting | CompletableFuture<List<ResultT>> findAllExisting(long bucketOffset, TimeoutTimer timer) {
"""
Locates all {@link ResultT} instances in a TableBucket.
@param bucketOffset The current segment offset of the Table Bucket we are looking into.
@param timer A {@link TimeoutTimer} for the operation.
@return A ... | java | CompletableFuture<List<ResultT>> findAllExisting(long bucketOffset, TimeoutTimer timer) {
val result = new HashMap<HashedArray, ResultT>();
// This handler ensures that items are only added once (per key) and only if they are not deleted. Since the items
// are processed in descending version o... | [
"CompletableFuture",
"<",
"List",
"<",
"ResultT",
">",
">",
"findAllExisting",
"(",
"long",
"bucketOffset",
",",
"TimeoutTimer",
"timer",
")",
"{",
"val",
"result",
"=",
"new",
"HashMap",
"<",
"HashedArray",
",",
"ResultT",
">",
"(",
")",
";",
"// This handl... | Locates all {@link ResultT} instances in a TableBucket.
@param bucketOffset The current segment offset of the Table Bucket we are looking into.
@param timer A {@link TimeoutTimer} for the operation.
@return A CompletableFuture that, when completed, will contain a List with the desired result items. This list
wi... | [
"Locates",
"all",
"{",
"@link",
"ResultT",
"}",
"instances",
"in",
"a",
"TableBucket",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/TableBucketReader.java#L92-L106 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.postAsync | public <T> CompletableFuture<T> postAsync(final Class<T> type, final Consumer<HttpConfig> configuration) {
"""
Executes an asynchronous POST request on the configured URI (asynchronous alias to `put(Class,Consumer)`), with additional configuration provided
by the configuration function. The result will be cast to... | java | public <T> CompletableFuture<T> postAsync(final Class<T> type, final Consumer<HttpConfig> configuration) {
return CompletableFuture.supplyAsync(() -> post(type, configuration), getExecutor());
} | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"postAsync",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"final",
"Consumer",
"<",
"HttpConfig",
">",
"configuration",
")",
"{",
"return",
"CompletableFuture",
".",
"supplyAsync",
"(",
"("... | Executes an asynchronous POST request on the configured URI (asynchronous alias to `put(Class,Consumer)`), with additional configuration provided
by the configuration function. The result will be cast to the specified `type`.
This method is generally used for Java-specific configuration.
[source,groovy]
----
HttpBuil... | [
"Executes",
"an",
"asynchronous",
"POST",
"request",
"on",
"the",
"configured",
"URI",
"(",
"asynchronous",
"alias",
"to",
"put",
"(",
"Class",
"Consumer",
")",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuration",
"function",
"."... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L883-L885 |
h2oai/h2o-3 | h2o-parsers/h2o-avro-parser/src/main/java/water/parser/avro/AvroParser.java | AvroParser.write2frame | private static void write2frame(GenericRecord gr, String[] columnNames, Schema.Field[] inSchema, byte[] columnTypes, ParseWriter dout) {
"""
The main method transforming Avro record into a row in H2O frame.
@param gr Avro generic record
@param columnNames Column names prepared by parser setup
@param inSchema... | java | private static void write2frame(GenericRecord gr, String[] columnNames, Schema.Field[] inSchema, byte[] columnTypes, ParseWriter dout) {
assert inSchema.length == columnTypes.length : "AVRO field flatenized schema has to match to parser setup";
BufferedString bs = new BufferedString();
for (int cIdx = 0; cI... | [
"private",
"static",
"void",
"write2frame",
"(",
"GenericRecord",
"gr",
",",
"String",
"[",
"]",
"columnNames",
",",
"Schema",
".",
"Field",
"[",
"]",
"inSchema",
",",
"byte",
"[",
"]",
"columnTypes",
",",
"ParseWriter",
"dout",
")",
"{",
"assert",
"inSche... | The main method transforming Avro record into a row in H2O frame.
@param gr Avro generic record
@param columnNames Column names prepared by parser setup
@param inSchema Flattenized Avro schema which corresponds to passed column names
@param columnTypes Target H2O types
@param dout Parser writer | [
"The",
"main",
"method",
"transforming",
"Avro",
"record",
"into",
"a",
"row",
"in",
"H2O",
"frame",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-parsers/h2o-avro-parser/src/main/java/water/parser/avro/AvroParser.java#L208-L253 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/zip/ZipUtils.java | ZipUtils.addFileToZip | private static void addFileToZip(String path, File file, ZipOutputStream zos) throws IOException {
"""
Adds a file to the current zip output stream
@param path the path of the parent folder in the zip
@param file the file to be added
@param zos the current zip output stream
@throws FileNotFoundException
@t... | java | private static void addFileToZip(String path, File file, ZipOutputStream zos) throws IOException {
String currentPath = StringUtils.isNotEmpty(path)? path + "/" + file.getName(): file.getName();
zos.putNextEntry(new ZipEntry(currentPath));
InputStream is = new BufferedInputStream(new FileInput... | [
"private",
"static",
"void",
"addFileToZip",
"(",
"String",
"path",
",",
"File",
"file",
",",
"ZipOutputStream",
"zos",
")",
"throws",
"IOException",
"{",
"String",
"currentPath",
"=",
"StringUtils",
".",
"isNotEmpty",
"(",
"path",
")",
"?",
"path",
"+",
"\"... | Adds a file to the current zip output stream
@param path the path of the parent folder in the zip
@param file the file to be added
@param zos the current zip output stream
@throws FileNotFoundException
@throws IOException | [
"Adds",
"a",
"file",
"to",
"the",
"current",
"zip",
"output",
"stream"
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/zip/ZipUtils.java#L156-L169 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/regex/Matcher.java | Matcher.appendEvaluated | private void appendEvaluated(StringBuffer buffer, String s) {
"""
Internal helper method to append a given string to a given string buffer.
If the string contains any references to groups, these are replaced by
the corresponding group's contents.
@param buffer the string buffer.
@param s the string to append... | java | private void appendEvaluated(StringBuffer buffer, String s) {
boolean escape = false;
boolean dollar = false;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c == '\\' && !escape) {
escape = true;
} else if (c == '$' && !escap... | [
"private",
"void",
"appendEvaluated",
"(",
"StringBuffer",
"buffer",
",",
"String",
"s",
")",
"{",
"boolean",
"escape",
"=",
"false",
";",
"boolean",
"dollar",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(... | Internal helper method to append a given string to a given string buffer.
If the string contains any references to groups, these are replaced by
the corresponding group's contents.
@param buffer the string buffer.
@param s the string to append. | [
"Internal",
"helper",
"method",
"to",
"append",
"a",
"given",
"string",
"to",
"a",
"given",
"string",
"buffer",
".",
"If",
"the",
"string",
"contains",
"any",
"references",
"to",
"groups",
"these",
"are",
"replaced",
"by",
"the",
"corresponding",
"group",
"s... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/regex/Matcher.java#L631-L654 |
aleksandr-m/gitflow-maven-plugin | src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java | AbstractGitFlowMojo.executeGitCommandExitCode | private CommandResult executeGitCommandExitCode(final String... args)
throws CommandLineException, MojoFailureException {
"""
Executes Git command without failing on non successful exit code.
@param args
Git command line arguments.
@return Command result.
@throws CommandLineException
@throws Moj... | java | private CommandResult executeGitCommandExitCode(final String... args)
throws CommandLineException, MojoFailureException {
return executeCommand(cmdGit, false, null, args);
} | [
"private",
"CommandResult",
"executeGitCommandExitCode",
"(",
"final",
"String",
"...",
"args",
")",
"throws",
"CommandLineException",
",",
"MojoFailureException",
"{",
"return",
"executeCommand",
"(",
"cmdGit",
",",
"false",
",",
"null",
",",
"args",
")",
";",
"}... | Executes Git command without failing on non successful exit code.
@param args
Git command line arguments.
@return Command result.
@throws CommandLineException
@throws MojoFailureException | [
"Executes",
"Git",
"command",
"without",
"failing",
"on",
"non",
"successful",
"exit",
"code",
"."
] | train | https://github.com/aleksandr-m/gitflow-maven-plugin/blob/d7be13c653d885c1cb1d8cd0337fa9db985c381e/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java#L1022-L1025 |
mgormley/prim | src/main/java/edu/jhu/prim/vector/LongDoubleDenseVector.java | LongDoubleDenseVector.add | public void add(LongDoubleVector other) {
"""
Updates this vector to be the entrywise sum of this vector with the other.
"""
if (other instanceof LongDoubleUnsortedVector) {
LongDoubleUnsortedVector vec = (LongDoubleUnsortedVector) other;
for (int i=0; i<vec.top; i++) {
... | java | public void add(LongDoubleVector other) {
if (other instanceof LongDoubleUnsortedVector) {
LongDoubleUnsortedVector vec = (LongDoubleUnsortedVector) other;
for (int i=0; i<vec.top; i++) {
this.add(vec.idx[i], vec.vals[i]);
}
} else {
// TO... | [
"public",
"void",
"add",
"(",
"LongDoubleVector",
"other",
")",
"{",
"if",
"(",
"other",
"instanceof",
"LongDoubleUnsortedVector",
")",
"{",
"LongDoubleUnsortedVector",
"vec",
"=",
"(",
"LongDoubleUnsortedVector",
")",
"other",
";",
"for",
"(",
"int",
"i",
"=",
... | 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/edu/jhu/prim/vector/LongDoubleDenseVector.java#L143-L153 |
apache/incubator-gobblin | gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java | GPGFileDecryptor.decryptFile | public InputStream decryptFile(InputStream inputStream, String passPhrase) throws IOException {
"""
Taking in a file inputstream and a passPhrase, generate a decrypted file inputstream.
@param inputStream file inputstream
@param passPhrase passPhrase
@return
@throws IOException
"""
PGPEncryptedDataLis... | java | public InputStream decryptFile(InputStream inputStream, String passPhrase) throws IOException {
PGPEncryptedDataList enc = getPGPEncryptedDataList(inputStream);
PGPPBEEncryptedData pbe = (PGPPBEEncryptedData) enc.get(0);
InputStream clear;
try {
clear = pbe.getDataStream(new JcePBEDataDecryptorF... | [
"public",
"InputStream",
"decryptFile",
"(",
"InputStream",
"inputStream",
",",
"String",
"passPhrase",
")",
"throws",
"IOException",
"{",
"PGPEncryptedDataList",
"enc",
"=",
"getPGPEncryptedDataList",
"(",
"inputStream",
")",
";",
"PGPPBEEncryptedData",
"pbe",
"=",
"... | Taking in a file inputstream and a passPhrase, generate a decrypted file inputstream.
@param inputStream file inputstream
@param passPhrase passPhrase
@return
@throws IOException | [
"Taking",
"in",
"a",
"file",
"inputstream",
"and",
"a",
"passPhrase",
"generate",
"a",
"decrypted",
"file",
"inputstream",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java#L62-L79 |
google/closure-compiler | src/com/google/javascript/jscomp/AbstractCommandLineRunner.java | AbstractCommandLineRunner.createJsonFile | @GwtIncompatible("Unnecessary")
JsonFileSpec createJsonFile(B options, String outputMarker, Function<String, String> escaper)
throws IOException {
"""
Save the compiler output to a JsonFileSpec to be later written to stdout
"""
Appendable jsOutput = new StringBuilder();
writeOutput(
jsO... | java | @GwtIncompatible("Unnecessary")
JsonFileSpec createJsonFile(B options, String outputMarker, Function<String, String> escaper)
throws IOException {
Appendable jsOutput = new StringBuilder();
writeOutput(
jsOutput, compiler, (JSModule) null, config.outputWrapper,
outputMarker, escaper);
... | [
"@",
"GwtIncompatible",
"(",
"\"Unnecessary\"",
")",
"JsonFileSpec",
"createJsonFile",
"(",
"B",
"options",
",",
"String",
"outputMarker",
",",
"Function",
"<",
"String",
",",
"String",
">",
"escaper",
")",
"throws",
"IOException",
"{",
"Appendable",
"jsOutput",
... | Save the compiler output to a JsonFileSpec to be later written to stdout | [
"Save",
"the",
"compiler",
"output",
"to",
"a",
"JsonFileSpec",
"to",
"be",
"later",
"written",
"to",
"stdout"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1463-L1482 |
xcesco/kripton | kripton-arch-integration/src/main/java/android/arch/lifecycle/MediatorLiveData.java | MediatorLiveData.addSource | @MainThread
public <S> void addSource(@NonNull LiveData<S> source, @NonNull Observer<S> onChanged) {
"""
Starts to listen the given {@code source} LiveData, {@code onChanged} observer will be called
when {@code source} value was changed.
<p>
{@code onChanged} callback will be called only when this {@code Me... | java | @MainThread
public <S> void addSource(@NonNull LiveData<S> source, @NonNull Observer<S> onChanged) {
Source<S> e = new Source<>(source, onChanged);
Source<?> existing = mSources.putIfAbsent(source, e);
if (existing != null && existing.mObserver != onChanged) {
throw new IllegalAr... | [
"@",
"MainThread",
"public",
"<",
"S",
">",
"void",
"addSource",
"(",
"@",
"NonNull",
"LiveData",
"<",
"S",
">",
"source",
",",
"@",
"NonNull",
"Observer",
"<",
"S",
">",
"onChanged",
")",
"{",
"Source",
"<",
"S",
">",
"e",
"=",
"new",
"Source",
"<... | Starts to listen the given {@code source} LiveData, {@code onChanged} observer will be called
when {@code source} value was changed.
<p>
{@code onChanged} callback will be called only when this {@code MediatorLiveData} is active.
<p> If the given LiveData is already added as a source but with a different Observer,
{@li... | [
"Starts",
"to",
"listen",
"the",
"given",
"{",
"@code",
"source",
"}",
"LiveData",
"{",
"@code",
"onChanged",
"}",
"observer",
"will",
"be",
"called",
"when",
"{",
"@code",
"source",
"}",
"value",
"was",
"changed",
".",
"<p",
">",
"{",
"@code",
"onChange... | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/lifecycle/MediatorLiveData.java#L85-L99 |
eclipse/xtext-core | org.eclipse.xtext.util/src/org/eclipse/xtext/util/JavaStringConverter.java | JavaStringConverter.convertToJavaString | public String convertToJavaString(String input, boolean useUnicode) {
"""
Escapes control characters with a preceding backslash.
Optionally encodes special chars as unicode escape sequence.
The resulting string is safe to be put into a Java string literal between
the quotes.
"""
int length = input.length(... | java | public String convertToJavaString(String input, boolean useUnicode) {
int length = input.length();
StringBuilder result = new StringBuilder(length + 4);
for (int i = 0; i < length; i++) {
escapeAndAppendTo(input.charAt(i), useUnicode, result);
}
return result.toString();
} | [
"public",
"String",
"convertToJavaString",
"(",
"String",
"input",
",",
"boolean",
"useUnicode",
")",
"{",
"int",
"length",
"=",
"input",
".",
"length",
"(",
")",
";",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"length",
"+",
"4",
")",
";... | Escapes control characters with a preceding backslash.
Optionally encodes special chars as unicode escape sequence.
The resulting string is safe to be put into a Java string literal between
the quotes. | [
"Escapes",
"control",
"characters",
"with",
"a",
"preceding",
"backslash",
".",
"Optionally",
"encodes",
"special",
"chars",
"as",
"unicode",
"escape",
"sequence",
".",
"The",
"resulting",
"string",
"is",
"safe",
"to",
"be",
"put",
"into",
"a",
"Java",
"string... | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.util/src/org/eclipse/xtext/util/JavaStringConverter.java#L181-L188 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuGLMapBufferObject | @Deprecated
public static int cuGLMapBufferObject( CUdeviceptr dptr, long size[], int bufferobj ) {
"""
Maps an OpenGL buffer object.
<pre>
CUresult cuGLMapBufferObject (
CUdeviceptr* dptr,
size_t* size,
GLuint buffer )
</pre>
<div>
<p>Maps an OpenGL buffer object.
Deprecated<span>This function is... | java | @Deprecated
public static int cuGLMapBufferObject( CUdeviceptr dptr, long size[], int bufferobj )
{
return checkResult(cuGLMapBufferObjectNative(dptr, size, bufferobj));
} | [
"@",
"Deprecated",
"public",
"static",
"int",
"cuGLMapBufferObject",
"(",
"CUdeviceptr",
"dptr",
",",
"long",
"size",
"[",
"]",
",",
"int",
"bufferobj",
")",
"{",
"return",
"checkResult",
"(",
"cuGLMapBufferObjectNative",
"(",
"dptr",
",",
"size",
",",
"buffer... | Maps an OpenGL buffer object.
<pre>
CUresult cuGLMapBufferObject (
CUdeviceptr* dptr,
size_t* size,
GLuint buffer )
</pre>
<div>
<p>Maps an OpenGL buffer object.
Deprecated<span>This function is
deprecated as of Cuda 3.0.</span>Maps the buffer object specified by
<tt>buffer</tt> into the address space of the current C... | [
"Maps",
"an",
"OpenGL",
"buffer",
"object",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L15475-L15479 |
Alluxio/alluxio | core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java | ObjectUnderFileSystem.getObjectListingChunkForPath | @Nullable
protected ObjectListingChunk getObjectListingChunkForPath(String path, boolean recursive)
throws IOException {
"""
Gets a (partial) object listing for the given path.
@param path of pseudo-directory
@param recursive whether to request immediate children only, or all descendants
@return chunk... | java | @Nullable
protected ObjectListingChunk getObjectListingChunkForPath(String path, boolean recursive)
throws IOException {
// Check if anything begins with <folder_path>/
String dir = stripPrefixIfPresent(path);
ObjectListingChunk objs = getObjectListingChunk(dir, recursive);
// If there are, this... | [
"@",
"Nullable",
"protected",
"ObjectListingChunk",
"getObjectListingChunkForPath",
"(",
"String",
"path",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"// Check if anything begins with <folder_path>/",
"String",
"dir",
"=",
"stripPrefixIfPresent",
"(",
"... | Gets a (partial) object listing for the given path.
@param path of pseudo-directory
@param recursive whether to request immediate children only, or all descendants
@return chunked object listing, or null if the path does not exist as a pseudo-directory | [
"Gets",
"a",
"(",
"partial",
")",
"object",
"listing",
"for",
"the",
"given",
"path",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java#L926-L942 |
zaproxy/zaproxy | src/org/parosproxy/paros/common/AbstractParam.java | AbstractParam.getInteger | protected Integer getInteger(String key, Integer defaultValue) {
"""
Gets the {@code Integer} with the given configuration key.
<p>
The default value is returned if the key doesn't exist or it's not a {@code Integer}.
@param key the configuration key.
@param defaultValue the default value, if the key doesn't... | java | protected Integer getInteger(String key, Integer defaultValue) {
try {
return getConfig().getInteger(key, defaultValue);
} catch (ConversionException e) {
logConversionException(key, e);
}
return defaultValue;
} | [
"protected",
"Integer",
"getInteger",
"(",
"String",
"key",
",",
"Integer",
"defaultValue",
")",
"{",
"try",
"{",
"return",
"getConfig",
"(",
")",
".",
"getInteger",
"(",
"key",
",",
"defaultValue",
")",
";",
"}",
"catch",
"(",
"ConversionException",
"e",
... | Gets the {@code Integer} with the given configuration key.
<p>
The default value is returned if the key doesn't exist or it's not a {@code Integer}.
@param key the configuration key.
@param defaultValue the default value, if the key doesn't exist or it's not an {@code Integer}.
@return the value of the configuration, ... | [
"Gets",
"the",
"{",
"@code",
"Integer",
"}",
"with",
"the",
"given",
"configuration",
"key",
".",
"<p",
">",
"The",
"default",
"value",
"is",
"returned",
"if",
"the",
"key",
"doesn",
"t",
"exist",
"or",
"it",
"s",
"not",
"a",
"{",
"@code",
"Integer",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/common/AbstractParam.java#L212-L219 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPMeasurementUnitUtil.java | CPMeasurementUnitUtil.removeByUUID_G | public static CPMeasurementUnit removeByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPMeasurementUnitException {
"""
Removes the cp measurement unit where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return th... | java | public static CPMeasurementUnit removeByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPMeasurementUnitException {
return getPersistence().removeByUUID_G(uuid, groupId);
} | [
"public",
"static",
"CPMeasurementUnit",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"product",
".",
"exception",
".",
"NoSuchCPMeasurementUnitException",
"{",
"return",
"getPersistence... | Removes the cp measurement unit where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp measurement unit that was removed | [
"Removes",
"the",
"cp",
"measurement",
"unit",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPMeasurementUnitUtil.java#L315-L318 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java | EqualsBuilder.appendArray | @GwtIncompatible("incompatible method")
private void appendArray(final Object lhs, final Object rhs) {
"""
<p>Test if an <code>Object</code> is equal to an array.</p>
@param lhs the left hand object, an array
@param rhs the right hand object
"""
// First we compare different dimensions, for e... | java | @GwtIncompatible("incompatible method")
private void appendArray(final Object lhs, final Object rhs) {
// First we compare different dimensions, for example: a boolean[][] to a boolean[]
// then we 'Switch' on type of array, to dispatch to the correct handler
// This handles multi dimensiona... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"private",
"void",
"appendArray",
"(",
"final",
"Object",
"lhs",
",",
"final",
"Object",
"rhs",
")",
"{",
"// First we compare different dimensions, for example: a boolean[][] to a boolean[]",
"// then we 'Switch' on ... | <p>Test if an <code>Object</code> is equal to an array.</p>
@param lhs the left hand object, an array
@param rhs the right hand object | [
"<p",
">",
"Test",
"if",
"an",
"<code",
">",
"Object<",
"/",
"code",
">",
"is",
"equal",
"to",
"an",
"array",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java#L644-L653 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/run/Cleaner.java | Cleaner.clearOne | public static void clearOne(String correlationId, Object component) throws ApplicationException {
"""
Clears state of specific component.
To be cleaned state components must implement ICleanable interface. If they
don't the call to this method has no effect.
@param correlationId (optional) transaction id to... | java | public static void clearOne(String correlationId, Object component) throws ApplicationException {
if (component instanceof ICleanable)
((ICleanable) component).clear(correlationId);
} | [
"public",
"static",
"void",
"clearOne",
"(",
"String",
"correlationId",
",",
"Object",
"component",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"component",
"instanceof",
"ICleanable",
")",
"(",
"(",
"ICleanable",
")",
"component",
")",
".",
"clear",
... | Clears state of specific component.
To be cleaned state components must implement ICleanable interface. If they
don't the call to this method has no effect.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param component the component that is to be cleaned.
@throws Applicati... | [
"Clears",
"state",
"of",
"specific",
"component",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/run/Cleaner.java#L24-L28 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java | DBTransaction.deleteColumns | public void deleteColumns(String storeName, String rowKey, Collection<String> columnNames) {
"""
Add updates that will delete all given columns names for the given store name and
row key. If a column update exists for the same store/row/column, the results are
undefined when the transaction is committed.
@par... | java | public void deleteColumns(String storeName, String rowKey, Collection<String> columnNames) {
for(String columnName: columnNames) {
deleteColumn(storeName, rowKey, columnName);
}
} | [
"public",
"void",
"deleteColumns",
"(",
"String",
"storeName",
",",
"String",
"rowKey",
",",
"Collection",
"<",
"String",
">",
"columnNames",
")",
"{",
"for",
"(",
"String",
"columnName",
":",
"columnNames",
")",
"{",
"deleteColumn",
"(",
"storeName",
",",
"... | Add updates that will delete all given columns names for the given store name and
row key. If a column update exists for the same store/row/column, the results are
undefined when the transaction is committed.
@param storeName Name of store that owns row.
@param rowKey Row key in string form.
@param columnNames Col... | [
"Add",
"updates",
"that",
"will",
"delete",
"all",
"given",
"columns",
"names",
"for",
"the",
"given",
"store",
"name",
"and",
"row",
"key",
".",
"If",
"a",
"column",
"update",
"exists",
"for",
"the",
"same",
"store",
"/",
"row",
"/",
"column",
"the",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java#L256-L260 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java | HBaseDataHandler.getExtPropertyFilters | private FilterList getExtPropertyFilters(EntityMetadata m, FilterList filterList) {
"""
Gets the ext property filters.
@param m
the m
@param filterList
the filter list
@return the ext property filters
"""
Filter filter = getFilter(m.getTableName());
if (filter != null)
{
... | java | private FilterList getExtPropertyFilters(EntityMetadata m, FilterList filterList)
{
Filter filter = getFilter(m.getTableName());
if (filter != null)
{
if (filterList == null)
{
filterList = new FilterList();
}
filterList.addFilt... | [
"private",
"FilterList",
"getExtPropertyFilters",
"(",
"EntityMetadata",
"m",
",",
"FilterList",
"filterList",
")",
"{",
"Filter",
"filter",
"=",
"getFilter",
"(",
"m",
".",
"getTableName",
"(",
")",
")",
";",
"if",
"(",
"filter",
"!=",
"null",
")",
"{",
"... | Gets the ext property filters.
@param m
the m
@param filterList
the filter list
@return the ext property filters | [
"Gets",
"the",
"ext",
"property",
"filters",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java#L206-L218 |
headius/invokebinder | src/main/java/com/headius/invokebinder/SmartBinder.java | SmartBinder.invokeStaticQuiet | public SmartHandle invokeStaticQuiet(Lookup lookup, Class<?> target, String name) {
"""
Terminate this binder by looking up the named static method on the
given target type. Perform the actual method lookup using the given
Lookup object. If the lookup fails, a RuntimeException will be raised,
containing the act... | java | public SmartHandle invokeStaticQuiet(Lookup lookup, Class<?> target, String name) {
return new SmartHandle(start, binder.invokeStaticQuiet(lookup, target, name));
} | [
"public",
"SmartHandle",
"invokeStaticQuiet",
"(",
"Lookup",
"lookup",
",",
"Class",
"<",
"?",
">",
"target",
",",
"String",
"name",
")",
"{",
"return",
"new",
"SmartHandle",
"(",
"start",
",",
"binder",
".",
"invokeStaticQuiet",
"(",
"lookup",
",",
"target"... | Terminate this binder by looking up the named static method on the
given target type. Perform the actual method lookup using the given
Lookup object. If the lookup fails, a RuntimeException will be raised,
containing the actual reason. This method is for convenience in (for
example) field declarations, where checked ex... | [
"Terminate",
"this",
"binder",
"by",
"looking",
"up",
"the",
"named",
"static",
"method",
"on",
"the",
"given",
"target",
"type",
".",
"Perform",
"the",
"actual",
"method",
"lookup",
"using",
"the",
"given",
"Lookup",
"object",
".",
"If",
"the",
"lookup",
... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L1039-L1041 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.base64FromBinary | public static String base64FromBinary(byte[] value, int offset, int length) throws IllegalArgumentException {
"""
Convert (encode) the given binary value, beginning at the given offset and
consisting of the given length, using Base64.
@param value A binary value.
@param offset ... | java | public static String base64FromBinary(byte[] value, int offset, int length) throws IllegalArgumentException {
return DatatypeConverter.printBase64Binary(Arrays.copyOfRange(value, offset, offset + length));
} | [
"public",
"static",
"String",
"base64FromBinary",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"DatatypeConverter",
".",
"printBase64Binary",
"(",
"Arrays",
".",
"copyOfRange"... | Convert (encode) the given binary value, beginning at the given offset and
consisting of the given length, using Base64.
@param value A binary value.
@param offset Zero-based index where data begins.
@param length Number of bytes to encode.
@return ... | [
"Convert",
"(",
"encode",
")",
"the",
"given",
"binary",
"value",
"beginning",
"at",
"the",
"given",
"offset",
"and",
"consisting",
"of",
"the",
"given",
"length",
"using",
"Base64",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L189-L191 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_definedRoutes_GET | public ArrayList<OvhDefinedRoute> serviceName_definedRoutes_GET(String serviceName) throws IOException {
"""
List of defined routes, and whether they are HTTP or TCP
REST: GET /ipLoadbalancing/{serviceName}/definedRoutes
@param serviceName [required] The internal name of your IP load balancing
"""
String... | java | public ArrayList<OvhDefinedRoute> serviceName_definedRoutes_GET(String serviceName) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/definedRoutes";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t8);
} | [
"public",
"ArrayList",
"<",
"OvhDefinedRoute",
">",
"serviceName_definedRoutes_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/definedRoutes\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | List of defined routes, and whether they are HTTP or TCP
REST: GET /ipLoadbalancing/{serviceName}/definedRoutes
@param serviceName [required] The internal name of your IP load balancing | [
"List",
"of",
"defined",
"routes",
"and",
"whether",
"they",
"are",
"HTTP",
"or",
"TCP"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1034-L1039 |
ManfredTremmel/gwt-bean-validators | gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/Assert.java | Assert.isTrue | public static void isTrue(final boolean expression, final Supplier<String> messageSupplier) {
"""
Assert a boolean expression, throwing an {@code IllegalArgumentException} if the expression
evaluates to {@code false}.
<pre class="code">
Assert.isTrue(i > 0, () -> "The value '" + i + "' must be greater t... | java | public static void isTrue(final boolean expression, final Supplier<String> messageSupplier) {
if (!expression) {
throw new IllegalArgumentException(Assert.nullSafeGet(messageSupplier));
}
} | [
"public",
"static",
"void",
"isTrue",
"(",
"final",
"boolean",
"expression",
",",
"final",
"Supplier",
"<",
"String",
">",
"messageSupplier",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"Assert",
".",
"n... | Assert a boolean expression, throwing an {@code IllegalArgumentException} if the expression
evaluates to {@code false}.
<pre class="code">
Assert.isTrue(i > 0, () -> "The value '" + i + "' must be greater than zero");
</pre>
@param expression a boolean expression
@param messageSupplier a supplier for the except... | [
"Assert",
"a",
"boolean",
"expression",
"throwing",
"an",
"{",
"@code",
"IllegalArgumentException",
"}",
"if",
"the",
"expression",
"evaluates",
"to",
"{",
"@code",
"false",
"}",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/Assert.java#L148-L152 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceFormatter.java | BaseTraceFormatter.traceLogFormat | public String traceLogFormat(LogRecord logRecord, Object id, String formattedMsg, String formattedVerboseMsg) {
"""
Format a detailed record for trace.log. Previously formatted messages may
be provided and may be reused if possible.
@param logRecord
@param id
@param formattedMsg the result of {@link #formatM... | java | public String traceLogFormat(LogRecord logRecord, Object id, String formattedMsg, String formattedVerboseMsg) {
final String txt;
if (formattedVerboseMsg == null) {
// If we don't already have a formatted message... (for Audit or Info or Warning.. )
// we have to build something ... | [
"public",
"String",
"traceLogFormat",
"(",
"LogRecord",
"logRecord",
",",
"Object",
"id",
",",
"String",
"formattedMsg",
",",
"String",
"formattedVerboseMsg",
")",
"{",
"final",
"String",
"txt",
";",
"if",
"(",
"formattedVerboseMsg",
"==",
"null",
")",
"{",
"/... | Format a detailed record for trace.log. Previously formatted messages may
be provided and may be reused if possible.
@param logRecord
@param id
@param formattedMsg the result of {@link #formatMessage}, or null if that
method was not previously called
@param formattedVerboseMsg the result of {@link #formatVerboseMessag... | [
"Format",
"a",
"detailed",
"record",
"for",
"trace",
".",
"log",
".",
"Previously",
"formatted",
"messages",
"may",
"be",
"provided",
"and",
"may",
"be",
"reused",
"if",
"possible",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceFormatter.java#L205-L216 |
lukas-krecan/JsonUnit | json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java | JsonAssert.assertJsonPartEquals | public static void assertJsonPartEquals(Object expected, Object fullJson, String path) {
"""
Compares part of the JSON. Path has this format "root.array[0].value".
"""
assertJsonPartEquals(expected, fullJson, path, configuration);
} | java | public static void assertJsonPartEquals(Object expected, Object fullJson, String path) {
assertJsonPartEquals(expected, fullJson, path, configuration);
} | [
"public",
"static",
"void",
"assertJsonPartEquals",
"(",
"Object",
"expected",
",",
"Object",
"fullJson",
",",
"String",
"path",
")",
"{",
"assertJsonPartEquals",
"(",
"expected",
",",
"fullJson",
",",
"path",
",",
"configuration",
")",
";",
"}"
] | Compares part of the JSON. Path has this format "root.array[0].value". | [
"Compares",
"part",
"of",
"the",
"JSON",
".",
"Path",
"has",
"this",
"format",
"root",
".",
"array",
"[",
"0",
"]",
".",
"value",
"."
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java#L73-L75 |
wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/Socket.java | Socket.publish | public void publish(byte[] message, EventBus bus) {
"""
Sends a binary frame on the socket.
@param message the message
@param bus the Vert.x event bus.
"""
bus.publish(getBinaryWriteHandlerId(), Buffer.buffer(message));
} | java | public void publish(byte[] message, EventBus bus) {
bus.publish(getBinaryWriteHandlerId(), Buffer.buffer(message));
} | [
"public",
"void",
"publish",
"(",
"byte",
"[",
"]",
"message",
",",
"EventBus",
"bus",
")",
"{",
"bus",
".",
"publish",
"(",
"getBinaryWriteHandlerId",
"(",
")",
",",
"Buffer",
".",
"buffer",
"(",
"message",
")",
")",
";",
"}"
] | Sends a binary frame on the socket.
@param message the message
@param bus the Vert.x event bus. | [
"Sends",
"a",
"binary",
"frame",
"on",
"the",
"socket",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/Socket.java#L95-L97 |
landawn/AbacusUtil | src/com/landawn/abacus/util/IOUtil.java | IOUtil.copyURLToFile | public static void copyURLToFile(final URL source, final File destination, final int connectionTimeout, final int readTimeout) throws UncheckedIOException {
"""
Copies bytes from the URL <code>source</code> to a file
<code>destination</code>. The directories up to <code>destination</code>
will be created if they... | java | public static void copyURLToFile(final URL source, final File destination, final int connectionTimeout, final int readTimeout) throws UncheckedIOException {
InputStream is = null;
try {
final URLConnection connection = source.openConnection();
connection.setConnectTimeout(con... | [
"public",
"static",
"void",
"copyURLToFile",
"(",
"final",
"URL",
"source",
",",
"final",
"File",
"destination",
",",
"final",
"int",
"connectionTimeout",
",",
"final",
"int",
"readTimeout",
")",
"throws",
"UncheckedIOException",
"{",
"InputStream",
"is",
"=",
"... | Copies bytes from the URL <code>source</code> to a file
<code>destination</code>. The directories up to <code>destination</code>
will be created if they don't already exist. <code>destination</code>
will be overwritten if it already exists.
@param source the <code>URL</code> to copy bytes from, must not be {@code nul... | [
"Copies",
"bytes",
"from",
"the",
"URL",
"<code",
">",
"source<",
"/",
"code",
">",
"to",
"a",
"file",
"<code",
">",
"destination<",
"/",
"code",
">",
".",
"The",
"directories",
"up",
"to",
"<code",
">",
"destination<",
"/",
"code",
">",
"will",
"be",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/IOUtil.java#L3026-L3040 |
wiibaker/robotframework-rest-java | src/main/java/org/wuokko/robot/restlib/JsonPathLibrary.java | JsonPathLibrary.jsonShouldBeEqual | @RobotKeyword
public boolean jsonShouldBeEqual(String from, String to, boolean useExactMatch, String method, String data, String contentType) throws Exception {
"""
Checks if the given JSON contents are equal. The third parameter
specifies whether exact string match should be used or diffing by the
JSON obje... | java | @RobotKeyword
public boolean jsonShouldBeEqual(String from, String to, boolean useExactMatch, String method, String data, String contentType) throws Exception {
System.out.println("*DEBUG* Comparing JSON sources");
boolean equal = false;
String fromJson = requestUtil.readSource(from, metho... | [
"@",
"RobotKeyword",
"public",
"boolean",
"jsonShouldBeEqual",
"(",
"String",
"from",
",",
"String",
"to",
",",
"boolean",
"useExactMatch",
",",
"String",
"method",
",",
"String",
"data",
",",
"String",
"contentType",
")",
"throws",
"Exception",
"{",
"System",
... | Checks if the given JSON contents are equal. The third parameter
specifies whether exact string match should be used or diffing by the
JSON objects ie. the order of the attributes does not matter.
`from` and `to` can be either URI or the actual JSON content.
You can add optional method (ie GET, POST, PUT), data or co... | [
"Checks",
"if",
"the",
"given",
"JSON",
"contents",
"are",
"equal",
".",
"The",
"third",
"parameter",
"specifies",
"whether",
"exact",
"string",
"match",
"should",
"be",
"used",
"or",
"diffing",
"by",
"the",
"JSON",
"objects",
"ie",
".",
"the",
"order",
"o... | train | https://github.com/wiibaker/robotframework-rest-java/blob/e30a7e494c143b644ee4282137a5a38e75d9d97b/src/main/java/org/wuokko/robot/restlib/JsonPathLibrary.java#L181-L212 |
spacecowboy/NoNonsense-FilePicker | library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java | AbstractFilePickerFragment.onClickDir | public void onClickDir(@NonNull View view, @NonNull DirViewHolder viewHolder) {
"""
Called when a non-selectable item, typically a directory, is clicked.
@param view that was clicked. Not used in default implementation.
@param viewHolder for the clicked view
"""
if (isDir(viewHolder.file)) {
... | java | public void onClickDir(@NonNull View view, @NonNull DirViewHolder viewHolder) {
if (isDir(viewHolder.file)) {
goToDir(viewHolder.file);
}
} | [
"public",
"void",
"onClickDir",
"(",
"@",
"NonNull",
"View",
"view",
",",
"@",
"NonNull",
"DirViewHolder",
"viewHolder",
")",
"{",
"if",
"(",
"isDir",
"(",
"viewHolder",
".",
"file",
")",
")",
"{",
"goToDir",
"(",
"viewHolder",
".",
"file",
")",
";",
"... | Called when a non-selectable item, typically a directory, is clicked.
@param view that was clicked. Not used in default implementation.
@param viewHolder for the clicked view | [
"Called",
"when",
"a",
"non",
"-",
"selectable",
"item",
"typically",
"a",
"directory",
"is",
"clicked",
"."
] | train | https://github.com/spacecowboy/NoNonsense-FilePicker/blob/396ef7fa5e87791170791f9d94c78f6e42a7679a/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java#L710-L714 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/properties/HystrixPropertiesStrategy.java | HystrixPropertiesStrategy.getThreadPoolProperties | public HystrixThreadPoolProperties getThreadPoolProperties(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolProperties.Setter builder) {
"""
Construct an implementation of {@link HystrixThreadPoolProperties} for {@link HystrixThreadPool} instances with {@link HystrixThreadPoolKey}.
<p>
<b>Default Implementat... | java | public HystrixThreadPoolProperties getThreadPoolProperties(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolProperties.Setter builder) {
return new HystrixPropertiesThreadPoolDefault(threadPoolKey, builder);
} | [
"public",
"HystrixThreadPoolProperties",
"getThreadPoolProperties",
"(",
"HystrixThreadPoolKey",
"threadPoolKey",
",",
"HystrixThreadPoolProperties",
".",
"Setter",
"builder",
")",
"{",
"return",
"new",
"HystrixPropertiesThreadPoolDefault",
"(",
"threadPoolKey",
",",
"builder",... | Construct an implementation of {@link HystrixThreadPoolProperties} for {@link HystrixThreadPool} instances with {@link HystrixThreadPoolKey}.
<p>
<b>Default Implementation</b>
<p>
Constructs instance of {@link HystrixPropertiesThreadPoolDefault}.
@param threadPoolKey
{@link HystrixThreadPoolKey} representing the name ... | [
"Construct",
"an",
"implementation",
"of",
"{",
"@link",
"HystrixThreadPoolProperties",
"}",
"for",
"{",
"@link",
"HystrixThreadPool",
"}",
"instances",
"with",
"{",
"@link",
"HystrixThreadPoolKey",
"}",
".",
"<p",
">",
"<b",
">",
"Default",
"Implementation<",
"/"... | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/properties/HystrixPropertiesStrategy.java#L92-L94 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java | DatabaseImpl.insertLocalDocument | public LocalDocument insertLocalDocument(final String docId, final DocumentBody body) throws
DocumentException {
"""
<p>Inserts a local document with an ID and body. Replacing the current local document of the
same ID if one is present. </p>
<p>Local documents are not replicated between DocumentSto... | java | public LocalDocument insertLocalDocument(final String docId, final DocumentBody body) throws
DocumentException {
Misc.checkState(this.isOpen(), "Database is closed");
CouchUtils.validateDocumentId(docId);
Misc.checkNotNull(body, "Input document body");
try {
retur... | [
"public",
"LocalDocument",
"insertLocalDocument",
"(",
"final",
"String",
"docId",
",",
"final",
"DocumentBody",
"body",
")",
"throws",
"DocumentException",
"{",
"Misc",
".",
"checkState",
"(",
"this",
".",
"isOpen",
"(",
")",
",",
"\"Database is closed\"",
")",
... | <p>Inserts a local document with an ID and body. Replacing the current local document of the
same ID if one is present. </p>
<p>Local documents are not replicated between DocumentStores.</p>
@param docId The document ID for the document
@param body JSON body for the document
@return {@code DocumentRevision... | [
"<p",
">",
"Inserts",
"a",
"local",
"document",
"with",
"an",
"ID",
"and",
"body",
".",
"Replacing",
"the",
"current",
"local",
"document",
"of",
"the",
"same",
"ID",
"if",
"one",
"is",
"present",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java#L453-L464 |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/io/Mutator.java | Mutator.jointSchema | public static Schema jointSchema(String newName, Schema leftSchema, Schema rightSchema) {
"""
Creates a joint schema between two Schemas. All Fields from both schema are deduplicated
and combined into a single Schema. The left Schema has priority so if both Schemas have
the same Field with the same name but diff... | java | public static Schema jointSchema(String newName, Schema leftSchema, Schema rightSchema) {
List<Field> newSchema = new ArrayList<Field>();
for(Field field: leftSchema.getFields()) {
newSchema.add(field);
}
for(Field field: rightSchema.getFields()) {
if(!leftSchema.containsField(field.getName())) {
newS... | [
"public",
"static",
"Schema",
"jointSchema",
"(",
"String",
"newName",
",",
"Schema",
"leftSchema",
",",
"Schema",
"rightSchema",
")",
"{",
"List",
"<",
"Field",
">",
"newSchema",
"=",
"new",
"ArrayList",
"<",
"Field",
">",
"(",
")",
";",
"for",
"(",
"Fi... | Creates a joint schema between two Schemas. All Fields from both schema are deduplicated
and combined into a single Schema. The left Schema has priority so if both Schemas have
the same Field with the same name but different Types, the Type from the left Schema will be
taken.
<p>
The name of the schema is also specifie... | [
"Creates",
"a",
"joint",
"schema",
"between",
"two",
"Schemas",
".",
"All",
"Fields",
"from",
"both",
"schema",
"are",
"deduplicated",
"and",
"combined",
"into",
"a",
"single",
"Schema",
".",
"The",
"left",
"Schema",
"has",
"priority",
"so",
"if",
"both",
... | train | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/io/Mutator.java#L111-L122 |
sannies/mp4parser | muxer/src/main/java/org/mp4parser/muxer/builder/FragmentedMp4Builder.java | FragmentedMp4Builder.createMfra | protected ParsableBox createMfra(Movie movie, Container isoFile) {
"""
Creates a 'mfra' - movie fragment random access box for the given movie in the given
isofile. Uses {@link #createTfra(Track, Container)}
to generate the child boxes.
@param movie concerned movie
@param isoFile concerned isofile
@return... | java | protected ParsableBox createMfra(Movie movie, Container isoFile) {
MovieFragmentRandomAccessBox mfra = new MovieFragmentRandomAccessBox();
for (Track track : movie.getTracks()) {
mfra.addBox(createTfra(track, isoFile));
}
MovieFragmentRandomAccessOffsetBox mfro = new MovieFr... | [
"protected",
"ParsableBox",
"createMfra",
"(",
"Movie",
"movie",
",",
"Container",
"isoFile",
")",
"{",
"MovieFragmentRandomAccessBox",
"mfra",
"=",
"new",
"MovieFragmentRandomAccessBox",
"(",
")",
";",
"for",
"(",
"Track",
"track",
":",
"movie",
".",
"getTracks",... | Creates a 'mfra' - movie fragment random access box for the given movie in the given
isofile. Uses {@link #createTfra(Track, Container)}
to generate the child boxes.
@param movie concerned movie
@param isoFile concerned isofile
@return a complete 'mfra' box | [
"Creates",
"a",
"mfra",
"-",
"movie",
"fragment",
"random",
"access",
"box",
"for",
"the",
"given",
"movie",
"in",
"the",
"given",
"isofile",
".",
"Uses",
"{",
"@link",
"#createTfra",
"(",
"Track",
"Container",
")",
"}",
"to",
"generate",
"the",
"child",
... | train | https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/muxer/src/main/java/org/mp4parser/muxer/builder/FragmentedMp4Builder.java#L646-L656 |
airbnb/lottie-android | lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java | LottieAnimationView.setAnimationFromJson | public void setAnimationFromJson(String jsonString, @Nullable String cacheKey) {
"""
Sets the animation from json string. This is the ideal API to use when loading an animation
over the network because you can use the raw response body here and a conversion to a
JSONObject never has to be done.
"""
setAn... | java | public void setAnimationFromJson(String jsonString, @Nullable String cacheKey) {
setAnimation(new JsonReader(new StringReader(jsonString)), cacheKey);
} | [
"public",
"void",
"setAnimationFromJson",
"(",
"String",
"jsonString",
",",
"@",
"Nullable",
"String",
"cacheKey",
")",
"{",
"setAnimation",
"(",
"new",
"JsonReader",
"(",
"new",
"StringReader",
"(",
"jsonString",
")",
")",
",",
"cacheKey",
")",
";",
"}"
] | Sets the animation from json string. This is the ideal API to use when loading an animation
over the network because you can use the raw response body here and a conversion to a
JSONObject never has to be done. | [
"Sets",
"the",
"animation",
"from",
"json",
"string",
".",
"This",
"is",
"the",
"ideal",
"API",
"to",
"use",
"when",
"loading",
"an",
"animation",
"over",
"the",
"network",
"because",
"you",
"can",
"use",
"the",
"raw",
"response",
"body",
"here",
"and",
... | train | https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java#L322-L324 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/GVRCompressedTextureLoader.java | GVRCompressedTextureLoader.CompressedTexture | protected CompressedTexture CompressedTexture(int internalformat,
int width, int height, int imageSize, int levels, byte[] data,
int dataOffset, int dataBytes) {
"""
Provides external parsers access to the internal
{@code CompressedImage} constructor.
The {@code CompressedImage} class r... | java | protected CompressedTexture CompressedTexture(int internalformat,
int width, int height, int imageSize, int levels, byte[] data,
int dataOffset, int dataBytes) {
ByteBuffer buffer = ByteBuffer.wrap(data, dataOffset, dataBytes);
return new CompressedTexture(internalformat, width, ... | [
"protected",
"CompressedTexture",
"CompressedTexture",
"(",
"int",
"internalformat",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"imageSize",
",",
"int",
"levels",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"dataOffset",
",",
"int",
"dataBytes",
"... | Provides external parsers access to the internal
{@code CompressedImage} constructor.
The {@code CompressedImage} class represents a texture file, loaded
into memory; it's what your {@link #parse(byte[], Reader)} method needs
to return.
<p>
The first four parameters are passed directly to
{@code glCompressedTexImage2... | [
"Provides",
"external",
"parsers",
"access",
"to",
"the",
"internal",
"{",
"@code",
"CompressedImage",
"}",
"constructor",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/GVRCompressedTextureLoader.java#L161-L167 |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java | ProxyFactory.resolveClassLoaderForBeanProxy | public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo, ProxyServices proxyServices) {
"""
Figures out the correct class loader to use for a proxy for a given bean
"""
Class<?> superClass = typeInfo.getSuperClass();
if (superClass.getN... | java | public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo, ProxyServices proxyServices) {
Class<?> superClass = typeInfo.getSuperClass();
if (superClass.getName().startsWith(JAVA)) {
ClassLoader cl = proxyServices.getClassLoader(proxie... | [
"public",
"static",
"ClassLoader",
"resolveClassLoaderForBeanProxy",
"(",
"String",
"contextId",
",",
"Class",
"<",
"?",
">",
"proxiedType",
",",
"TypeInfo",
"typeInfo",
",",
"ProxyServices",
"proxyServices",
")",
"{",
"Class",
"<",
"?",
">",
"superClass",
"=",
... | Figures out the correct class loader to use for a proxy for a given bean | [
"Figures",
"out",
"the",
"correct",
"class",
"loader",
"to",
"use",
"for",
"a",
"proxy",
"for",
"a",
"given",
"bean"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java#L902-L912 |
carewebframework/carewebframework-core | org.carewebframework.messaging-parent/org.carewebframework.messaging.jms-parent/org.carewebframework.messaging.jms.core/src/main/java/org/carewebframework/messaging/jms/JMSService.java | JMSService.createTextMessage | public Message createTextMessage(String text, String sender, String recipients) throws JMSException {
"""
Creates a message.
@param text text data
@param sender Sender client ID.
@param recipients Comma-delimited list of recipient client IDs
@return Message
@throws JMSException if error thrown from creation... | java | public Message createTextMessage(String text, String sender, String recipients) throws JMSException {
return decorateMessage(getSession().createTextMessage(text), sender, recipients);
} | [
"public",
"Message",
"createTextMessage",
"(",
"String",
"text",
",",
"String",
"sender",
",",
"String",
"recipients",
")",
"throws",
"JMSException",
"{",
"return",
"decorateMessage",
"(",
"getSession",
"(",
")",
".",
"createTextMessage",
"(",
"text",
")",
",",
... | Creates a message.
@param text text data
@param sender Sender client ID.
@param recipients Comma-delimited list of recipient client IDs
@return Message
@throws JMSException if error thrown from creation of object message | [
"Creates",
"a",
"message",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.messaging-parent/org.carewebframework.messaging.jms-parent/org.carewebframework.messaging.jms.core/src/main/java/org/carewebframework/messaging/jms/JMSService.java#L210-L212 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java | FileOperations.getFileFromTask | public void getFileFromTask(String jobId, String taskId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors, OutputStream outputStream) throws BatchErrorException, IOException {
"""
Downloads the specified file from the specified task's directory on its compute node.
@param jobId The ID of the j... | java | public void getFileFromTask(String jobId, String taskId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors, OutputStream outputStream) throws BatchErrorException, IOException {
FileGetFromTaskOptions options = new FileGetFromTaskOptions();
BehaviorManager bhMgr = new BehaviorManager(thi... | [
"public",
"void",
"getFileFromTask",
"(",
"String",
"jobId",
",",
"String",
"taskId",
",",
"String",
"fileName",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
",",
"OutputStream",
"outputStream",
")",
"throws",
"BatchErrorException",
",",
... | Downloads the specified file from the specified task's directory on its compute node.
@param jobId The ID of the job containing the task.
@param taskId The ID of the task.
@param fileName The name of the file to download.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied... | [
"Downloads",
"the",
"specified",
"file",
"from",
"the",
"specified",
"task",
"s",
"directory",
"on",
"its",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java#L279-L285 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/MediaApi.java | MediaApi.placeInQueue | public ApiSuccessResponse placeInQueue(String mediatype, String id, PlaceInQueueData placeInQueueData) throws ApiException {
"""
Place an interaction in a queue
Place the interaction in the specified queue.
@param mediatype The media channel. (required)
@param id The ID of the interaction. (required)
@param pl... | java | public ApiSuccessResponse placeInQueue(String mediatype, String id, PlaceInQueueData placeInQueueData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = placeInQueueWithHttpInfo(mediatype, id, placeInQueueData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"placeInQueue",
"(",
"String",
"mediatype",
",",
"String",
"id",
",",
"PlaceInQueueData",
"placeInQueueData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"placeInQueueWithHttpInfo",
"(",... | Place an interaction in a queue
Place the interaction in the specified queue.
@param mediatype The media channel. (required)
@param id The ID of the interaction. (required)
@param placeInQueueData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserializ... | [
"Place",
"an",
"interaction",
"in",
"a",
"queue",
"Place",
"the",
"interaction",
"in",
"the",
"specified",
"queue",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L3118-L3121 |
kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpMergeRequestFilter.java | HttpMergeRequestFilter.mergeRequests | private boolean mergeRequests(HttpRequestMessage from, HttpRequestMessage to) {
"""
Return true iff the extended request matches the initial request.
<p/>
This function, when returning true, additionally ensures that the extended request
contains no illegal headers, and has had selected header elements from the... | java | private boolean mergeRequests(HttpRequestMessage from, HttpRequestMessage to) {
if (from == null || to == null) {
return false;
}
final URI initialRequestURI = from.getRequestURI();
final URI extendedRequestURI = to.getRequestURI();
boolean uriPathOk = initialReque... | [
"private",
"boolean",
"mergeRequests",
"(",
"HttpRequestMessage",
"from",
",",
"HttpRequestMessage",
"to",
")",
"{",
"if",
"(",
"from",
"==",
"null",
"||",
"to",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"final",
"URI",
"initialRequestURI",
"=",
... | Return true iff the extended request matches the initial request.
<p/>
This function, when returning true, additionally ensures that the extended request
contains no illegal headers, and has had selected header elements from the initial
request merged into the extended request.
@param from the initial request
@param ... | [
"Return",
"true",
"iff",
"the",
"extended",
"request",
"matches",
"the",
"initial",
"request",
".",
"<p",
"/",
">",
"This",
"function",
"when",
"returning",
"true",
"additionally",
"ensures",
"that",
"the",
"extended",
"request",
"contains",
"no",
"illegal",
"... | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpMergeRequestFilter.java#L348-L388 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java | OrientedBox3f.setFirstAxis | @Override
public void setFirstAxis(double x, double y, double z) {
"""
Set the first axis of the box.
The third axis is updated to be perpendicular to the two other axis.
@param x
@param y
@param z
"""
setFirstAxis(x, y, z, getFirstAxisExtent());
} | java | @Override
public void setFirstAxis(double x, double y, double z) {
setFirstAxis(x, y, z, getFirstAxisExtent());
} | [
"@",
"Override",
"public",
"void",
"setFirstAxis",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"setFirstAxis",
"(",
"x",
",",
"y",
",",
"z",
",",
"getFirstAxisExtent",
"(",
")",
")",
";",
"}"
] | Set the first axis of the box.
The third axis is updated to be perpendicular to the two other axis.
@param x
@param y
@param z | [
"Set",
"the",
"first",
"axis",
"of",
"the",
"box",
".",
"The",
"third",
"axis",
"is",
"updated",
"to",
"be",
"perpendicular",
"to",
"the",
"two",
"other",
"axis",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java#L426-L429 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java | PyExpressionGenerator._generate | @SuppressWarnings("static-method")
protected XExpression _generate(XBooleanLiteral literal, IAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param literal the boolean literal.
@param it the target for the generated content.
@param context the context.
@return the lit... | java | @SuppressWarnings("static-method")
protected XExpression _generate(XBooleanLiteral literal, IAppendable it, IExtraLanguageGeneratorContext context) {
appendReturnIfExpectedReturnedExpression(it, context);
it.append(literal.isIsTrue() ? "True" : "False"); //$NON-NLS-1$ //$NON-NLS-2$
return literal;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"XExpression",
"_generate",
"(",
"XBooleanLiteral",
"literal",
",",
"IAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"appendReturnIfExpectedReturnedExpression",
"(",
"it",
... | Generate the given object.
@param literal the boolean literal.
@param it the target for the generated content.
@param context the context.
@return the literal. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L674-L679 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/ArgumentUtils.java | ArgumentUtils.requirePositive | public static @Nonnull Number requirePositive(String name, Number value) {
"""
Adds a check that the given number is positive.
@param name The name of the argument
@param value The value
@throws IllegalArgumentException if the argument is not positive
@return The value
"""
requireNonNull(name, va... | java | public static @Nonnull Number requirePositive(String name, Number value) {
requireNonNull(name, value);
requirePositive(name, value.intValue());
return value;
} | [
"public",
"static",
"@",
"Nonnull",
"Number",
"requirePositive",
"(",
"String",
"name",
",",
"Number",
"value",
")",
"{",
"requireNonNull",
"(",
"name",
",",
"value",
")",
";",
"requirePositive",
"(",
"name",
",",
"value",
".",
"intValue",
"(",
")",
")",
... | Adds a check that the given number is positive.
@param name The name of the argument
@param value The value
@throws IllegalArgumentException if the argument is not positive
@return The value | [
"Adds",
"a",
"check",
"that",
"the",
"given",
"number",
"is",
"positive",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/ArgumentUtils.java#L37-L41 |
alkacon/opencms-core | src/org/opencms/ui/editors/A_CmsFrameEditor.java | A_CmsFrameEditor.leaveEditor | void leaveEditor(Navigator navigator, String target) {
"""
Leaves the editor view.<p>
@param navigator the navigator instance
@param target the target view
"""
m_leaving = true;
tryUnlock();
navigator.navigateTo(target);
} | java | void leaveEditor(Navigator navigator, String target) {
m_leaving = true;
tryUnlock();
navigator.navigateTo(target);
} | [
"void",
"leaveEditor",
"(",
"Navigator",
"navigator",
",",
"String",
"target",
")",
"{",
"m_leaving",
"=",
"true",
";",
"tryUnlock",
"(",
")",
";",
"navigator",
".",
"navigateTo",
"(",
"target",
")",
";",
"}"
] | Leaves the editor view.<p>
@param navigator the navigator instance
@param target the target view | [
"Leaves",
"the",
"editor",
"view",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/A_CmsFrameEditor.java#L169-L174 |
scalecube/scalecube-services | services/src/main/java/io/scalecube/services/metrics/Metrics.java | Metrics.mark | public static void mark(Metrics metrics, String component, String methodName, String eventType) {
"""
Reports an event to <code>meter</code> described by given parameters.
@param metrics - {@link Metrics} instance with {@link MetricRegistry} initialized.
@param component - part of metric description.
@param m... | java | public static void mark(Metrics metrics, String component, String methodName, String eventType) {
if (metrics != null) {
mark(metrics.getMeter(component, methodName, eventType));
}
} | [
"public",
"static",
"void",
"mark",
"(",
"Metrics",
"metrics",
",",
"String",
"component",
",",
"String",
"methodName",
",",
"String",
"eventType",
")",
"{",
"if",
"(",
"metrics",
"!=",
"null",
")",
"{",
"mark",
"(",
"metrics",
".",
"getMeter",
"(",
"com... | Reports an event to <code>meter</code> described by given parameters.
@param metrics - {@link Metrics} instance with {@link MetricRegistry} initialized.
@param component - part of metric description.
@param methodName - part of metric description.
@param eventType - part of metric description. | [
"Reports",
"an",
"event",
"to",
"<code",
">",
"meter<",
"/",
"code",
">",
"described",
"by",
"given",
"parameters",
"."
] | train | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/metrics/Metrics.java#L144-L148 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Covers.java | ST_Covers.covers | public static Boolean covers(Geometry geomA, Geometry geomB) {
"""
Returns true if no point in geometry B is outside geometry A.
@param geomA Geometry A
@param geomB Geometry B
@return True if no point in geometry B is outside geometry A
"""
if(geomA == null||geomB == null){
return nul... | java | public static Boolean covers(Geometry geomA, Geometry geomB) {
if(geomA == null||geomB == null){
return null;
}
return geomA.covers(geomB);
} | [
"public",
"static",
"Boolean",
"covers",
"(",
"Geometry",
"geomA",
",",
"Geometry",
"geomB",
")",
"{",
"if",
"(",
"geomA",
"==",
"null",
"||",
"geomB",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"geomA",
".",
"covers",
"(",
"geomB",
... | Returns true if no point in geometry B is outside geometry A.
@param geomA Geometry A
@param geomB Geometry B
@return True if no point in geometry B is outside geometry A | [
"Returns",
"true",
"if",
"no",
"point",
"in",
"geometry",
"B",
"is",
"outside",
"geometry",
"A",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Covers.java#L50-L55 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java | DateFormat.getDateTimeInstance | public final static DateFormat getDateTimeInstance() {
"""
Returns the date/time formatter with the default formatting style
for the default <code>FORMAT</code> locale.
@return a date/time formatter.
@see Category#FORMAT
"""
return get(DEFAULT, DEFAULT, ULocale.getDefault(Category.FORMAT), null);
... | java | public final static DateFormat getDateTimeInstance()
{
return get(DEFAULT, DEFAULT, ULocale.getDefault(Category.FORMAT), null);
} | [
"public",
"final",
"static",
"DateFormat",
"getDateTimeInstance",
"(",
")",
"{",
"return",
"get",
"(",
"DEFAULT",
",",
"DEFAULT",
",",
"ULocale",
".",
"getDefault",
"(",
"Category",
".",
"FORMAT",
")",
",",
"null",
")",
";",
"}"
] | Returns the date/time formatter with the default formatting style
for the default <code>FORMAT</code> locale.
@return a date/time formatter.
@see Category#FORMAT | [
"Returns",
"the",
"date",
"/",
"time",
"formatter",
"with",
"the",
"default",
"formatting",
"style",
"for",
"the",
"default",
"<code",
">",
"FORMAT<",
"/",
"code",
">",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1346-L1349 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java | KeyMap.putIfAbsent | public final V putIfAbsent(K key, LazyFactory<V> factory) {
"""
Inserts a value for the given key, if no value is yet contained for that key. Otherwise,
returns the value currently contained for the key.
<p>The value that is inserted in case that the key is not contained, yet, is lazily created
using the give... | java | public final V putIfAbsent(K key, LazyFactory<V> factory) {
final int hash = hash(key);
final int slot = indexOf(hash);
// search the chain from the slot
for (Entry<K, V> entry = table[slot]; entry != null; entry = entry.next) {
if (entry.hashCode == hash && entry.key.equals(key)) {
// found match
r... | [
"public",
"final",
"V",
"putIfAbsent",
"(",
"K",
"key",
",",
"LazyFactory",
"<",
"V",
">",
"factory",
")",
"{",
"final",
"int",
"hash",
"=",
"hash",
"(",
"key",
")",
";",
"final",
"int",
"slot",
"=",
"indexOf",
"(",
"hash",
")",
";",
"// search the c... | Inserts a value for the given key, if no value is yet contained for that key. Otherwise,
returns the value currently contained for the key.
<p>The value that is inserted in case that the key is not contained, yet, is lazily created
using the given factory.
@param key The key to insert.
@param factory The factory that... | [
"Inserts",
"a",
"value",
"for",
"the",
"given",
"key",
"if",
"no",
"value",
"is",
"yet",
"contained",
"for",
"that",
"key",
".",
"Otherwise",
"returns",
"the",
"value",
"currently",
"contained",
"for",
"the",
"key",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L157-L175 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryConnection.java | DirectoryConnection.onConnected | public void onConnected(int serverSessionTimeout, String sessionId, byte[] sessionPassword, int serverId) {
"""
On the DirectoryConnection setup connection to DirectoryServer.
@param serverSessionTimeout
the session timeout.
@param sessionId
the session id.
@param sessionPassword
the session password.
@pa... | java | public void onConnected(int serverSessionTimeout, String sessionId, byte[] sessionPassword, int serverId) {
if (serverSessionTimeout <= 0) {
closeSession();
LOGGER.error("Unable to reconnect to Directory Server, session 0x" + sessionId + " has expired");
return;
}
... | [
"public",
"void",
"onConnected",
"(",
"int",
"serverSessionTimeout",
",",
"String",
"sessionId",
",",
"byte",
"[",
"]",
"sessionPassword",
",",
"int",
"serverId",
")",
"{",
"if",
"(",
"serverSessionTimeout",
"<=",
"0",
")",
"{",
"closeSession",
"(",
")",
";"... | On the DirectoryConnection setup connection to DirectoryServer.
@param serverSessionTimeout
the session timeout.
@param sessionId
the session id.
@param sessionPassword
the session password.
@param serverId
the remote server id. | [
"On",
"the",
"DirectoryConnection",
"setup",
"connection",
"to",
"DirectoryServer",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryConnection.java#L673-L699 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/StatementsForClassImpl.java | StatementsForClassImpl.createStatement | private Statement createStatement(Connection con, boolean scrollable, int explicitFetchSizeHint)
throws java.sql.SQLException {
"""
Creates a statement with parameters that should work with most RDBMS.
"""
Statement result;
try
{
// if necessary use JDBC1.0 meth... | java | private Statement createStatement(Connection con, boolean scrollable, int explicitFetchSizeHint)
throws java.sql.SQLException
{
Statement result;
try
{
// if necessary use JDBC1.0 methods
if (!FORCEJDBC1_0)
{
result =
... | [
"private",
"Statement",
"createStatement",
"(",
"Connection",
"con",
",",
"boolean",
"scrollable",
",",
"int",
"explicitFetchSizeHint",
")",
"throws",
"java",
".",
"sql",
".",
"SQLException",
"{",
"Statement",
"result",
";",
"try",
"{",
"// if necessary use JDBC1.0 ... | Creates a statement with parameters that should work with most RDBMS. | [
"Creates",
"a",
"statement",
"with",
"parameters",
"that",
"should",
"work",
"with",
"most",
"RDBMS",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/StatementsForClassImpl.java#L352-L409 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_instance_group_GET | public ArrayList<OvhInstanceGroup> project_serviceName_instance_group_GET(String serviceName, String region) throws IOException {
"""
Get the detail of a group
REST: GET /cloud/project/{serviceName}/instance/group
@param region [required] Instance region
@param serviceName [required] Project id
"""
Stri... | java | public ArrayList<OvhInstanceGroup> project_serviceName_instance_group_GET(String serviceName, String region) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/group";
StringBuilder sb = path(qPath, serviceName);
query(sb, "region", region);
String resp = exec(qPath, "GET", sb.toString()... | [
"public",
"ArrayList",
"<",
"OvhInstanceGroup",
">",
"project_serviceName_instance_group_GET",
"(",
"String",
"serviceName",
",",
"String",
"region",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/instance/group\"",
";",
"StringBu... | Get the detail of a group
REST: GET /cloud/project/{serviceName}/instance/group
@param region [required] Instance region
@param serviceName [required] Project id | [
"Get",
"the",
"detail",
"of",
"a",
"group"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2116-L2122 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/reflect/TypeReflector.java | TypeReflector.createInstance | public static Object createInstance(String name, String library, Object... args) throws Exception {
"""
Creates an instance of an object type specified by its name and library where
it is defined.
@param name an object type name.
@param library a library (module) where object type is defined.
@param args ... | java | public static Object createInstance(String name, String library, Object... args) throws Exception {
Class<?> type = getType(name, library);
if (type == null)
throw new NotFoundException(null, "TYPE_NOT_FOUND", "Type " + name + "," + library + " was not found")
.withDetails("type", name).withDetails("library... | [
"public",
"static",
"Object",
"createInstance",
"(",
"String",
"name",
",",
"String",
"library",
",",
"Object",
"...",
"args",
")",
"throws",
"Exception",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"getType",
"(",
"name",
",",
"library",
")",
";",
"if",
... | Creates an instance of an object type specified by its name and library where
it is defined.
@param name an object type name.
@param library a library (module) where object type is defined.
@param args arguments for the object constructor.
@return the created object instance.
@throws Exception when type of insta... | [
"Creates",
"an",
"instance",
"of",
"an",
"object",
"type",
"specified",
"by",
"its",
"name",
"and",
"library",
"where",
"it",
"is",
"defined",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/reflect/TypeReflector.java#L113-L120 |
OpenLiberty/open-liberty | dev/com.ibm.ws.http.plugin.merge/src/com/ibm/ws/http/plugin/merge/internal/PluginMergeToolImpl.java | PluginMergeToolImpl.removeComments | private boolean removeComments(DocumentBuilder parser, Document doc) {
"""
Removes all comments from the document except for the Properties comment
All exceptions are suppressed because this is just a nicety to improve human readability.
@param parser
@param doc
@return
"""
try {
// C... | java | private boolean removeComments(DocumentBuilder parser, Document doc) {
try {
// Check for the traversal module
DOMImplementation impl = parser.getDOMImplementation();
if (!impl.hasFeature("traversal", "2.0")) {
// DOM implementation does not support traversal ... | [
"private",
"boolean",
"removeComments",
"(",
"DocumentBuilder",
"parser",
",",
"Document",
"doc",
")",
"{",
"try",
"{",
"// Check for the traversal module",
"DOMImplementation",
"impl",
"=",
"parser",
".",
"getDOMImplementation",
"(",
")",
";",
"if",
"(",
"!",
"im... | Removes all comments from the document except for the Properties comment
All exceptions are suppressed because this is just a nicety to improve human readability.
@param parser
@param doc
@return | [
"Removes",
"all",
"comments",
"from",
"the",
"document",
"except",
"for",
"the",
"Properties",
"comment",
"All",
"exceptions",
"are",
"suppressed",
"because",
"this",
"is",
"just",
"a",
"nicety",
"to",
"improve",
"human",
"readability",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.http.plugin.merge/src/com/ibm/ws/http/plugin/merge/internal/PluginMergeToolImpl.java#L120-L143 |
OpenBEL/openbel-framework | org.openbel.framework.ws/src/main/java/org/openbel/framework/ws/core/Cache.java | Cache.put | public synchronized void put(T value, long timeToClearMins) {
"""
Adds an object to cache. There is no guarantee that this object will be there by the time
the next get(key) is called. If no other references are pointing to the cached object,
the supplied value are guaranteed to be removed from cache after timeT... | java | public synchronized void put(T value, long timeToClearMins) {
this.put(value);
if (!this.hasMaintenanceThread()) {
startMaintenanceThread();
}
timeMap.put(value.getCacheKey(), new Long(System.currentTimeMillis()
+ (timeToClearMins * 60 * 1000)));
} | [
"public",
"synchronized",
"void",
"put",
"(",
"T",
"value",
",",
"long",
"timeToClearMins",
")",
"{",
"this",
".",
"put",
"(",
"value",
")",
";",
"if",
"(",
"!",
"this",
".",
"hasMaintenanceThread",
"(",
")",
")",
"{",
"startMaintenanceThread",
"(",
")",... | Adds an object to cache. There is no guarantee that this object will be there by the time
the next get(key) is called. If no other references are pointing to the cached object,
the supplied value are guaranteed to be removed from cache after timeToClearMins + 1 minutes.
@param value
@param timeToClearMins | [
"Adds",
"an",
"object",
"to",
"cache",
".",
"There",
"is",
"no",
"guarantee",
"that",
"this",
"object",
"will",
"be",
"there",
"by",
"the",
"time",
"the",
"next",
"get",
"(",
"key",
")",
"is",
"called",
".",
"If",
"no",
"other",
"references",
"are",
... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.ws/src/main/java/org/openbel/framework/ws/core/Cache.java#L95-L102 |
CloudSlang/cs-actions | cs-powershell/src/main/java/io/cloudslang/content/services/WSManRemoteShellService.java | WSManRemoteShellService.setCommonHttpInputs | private static HttpClientInputs setCommonHttpInputs(HttpClientInputs httpClientInputs, URL url, WSManRequestInputs wsManRequestInputs) throws MalformedURLException {
"""
Configures the HttpClientInputs object with the most common http parameters.
@param httpClientInputs
@param url
@param wsManRequestInputs
@... | java | private static HttpClientInputs setCommonHttpInputs(HttpClientInputs httpClientInputs, URL url, WSManRequestInputs wsManRequestInputs) throws MalformedURLException {
httpClientInputs.setUrl(url.toString());
httpClientInputs.setUsername(wsManRequestInputs.getUsername());
httpClientInputs.setPassw... | [
"private",
"static",
"HttpClientInputs",
"setCommonHttpInputs",
"(",
"HttpClientInputs",
"httpClientInputs",
",",
"URL",
"url",
",",
"WSManRequestInputs",
"wsManRequestInputs",
")",
"throws",
"MalformedURLException",
"{",
"httpClientInputs",
".",
"setUrl",
"(",
"url",
"."... | Configures the HttpClientInputs object with the most common http parameters.
@param httpClientInputs
@param url
@param wsManRequestInputs
@return the configured HttpClientInputs object.
@throws MalformedURLException | [
"Configures",
"the",
"HttpClientInputs",
"object",
"with",
"the",
"most",
"common",
"http",
"parameters",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-powershell/src/main/java/io/cloudslang/content/services/WSManRemoteShellService.java#L131-L157 |
finmath/finmath-lib | src/main/java/net/finmath/time/SchedulePrototype.java | SchedulePrototype.generateScheduleDescriptor | public ScheduleDescriptor generateScheduleDescriptor(LocalDate startDate, LocalDate endDate) {
"""
Generate a schedule descriptor for the given start and end date.
@param startDate The start date.
@param endDate The end date.
@return The schedule descriptor
"""
return new ScheduleDescriptor(startDate, ... | java | public ScheduleDescriptor generateScheduleDescriptor(LocalDate startDate, LocalDate endDate) {
return new ScheduleDescriptor(startDate, endDate, getFrequency(), getDaycountConvention(), getShortPeriodConvention(), getDateRollConvention(),
getBusinessdayCalendar(), getFixingOffsetDays(), getPaymentOffsetDays(), ... | [
"public",
"ScheduleDescriptor",
"generateScheduleDescriptor",
"(",
"LocalDate",
"startDate",
",",
"LocalDate",
"endDate",
")",
"{",
"return",
"new",
"ScheduleDescriptor",
"(",
"startDate",
",",
"endDate",
",",
"getFrequency",
"(",
")",
",",
"getDaycountConvention",
"(... | Generate a schedule descriptor for the given start and end date.
@param startDate The start date.
@param endDate The end date.
@return The schedule descriptor | [
"Generate",
"a",
"schedule",
"descriptor",
"for",
"the",
"given",
"start",
"and",
"end",
"date",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/time/SchedulePrototype.java#L126-L129 |
phax/ph-ebinterface | src/main/java/com/helger/ebinterface/visualization/VisualizationManager.java | VisualizationManager.visualizeToDOMDocument | @Nullable
public static Document visualizeToDOMDocument (@Nonnull final EEbInterfaceVersion eVersion,
@Nonnull final IReadableResource aResource) {
"""
Visualize a source to a DOM document for a certain ebInterface version.
@param eVersion
ebInterface version ... | java | @Nullable
public static Document visualizeToDOMDocument (@Nonnull final EEbInterfaceVersion eVersion,
@Nonnull final IReadableResource aResource)
{
return visualizeToDOMDocument (eVersion, TransformSourceFactory.create (aResource));
} | [
"@",
"Nullable",
"public",
"static",
"Document",
"visualizeToDOMDocument",
"(",
"@",
"Nonnull",
"final",
"EEbInterfaceVersion",
"eVersion",
",",
"@",
"Nonnull",
"final",
"IReadableResource",
"aResource",
")",
"{",
"return",
"visualizeToDOMDocument",
"(",
"eVersion",
"... | Visualize a source to a DOM document for a certain ebInterface version.
@param eVersion
ebInterface version to use. May not be <code>null</code>.
@param aResource
Source resource. May not be <code>null</code>.
@return <code>null</code> if the XSLT could not be applied. | [
"Visualize",
"a",
"source",
"to",
"a",
"DOM",
"document",
"for",
"a",
"certain",
"ebInterface",
"version",
"."
] | train | https://github.com/phax/ph-ebinterface/blob/e3d2381f25c2fdfcc98acff2509bf5f33752d087/src/main/java/com/helger/ebinterface/visualization/VisualizationManager.java#L166-L171 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/rest/auth/TokenRESTService.java | TokenRESTService.createToken | @POST
public APIAuthenticationResult createToken(@FormParam("username") String username,
@FormParam("password") String password,
@FormParam("token") String token,
@Context HttpServletRequest consumedRequest,
MultivaluedMap<String, String> parameters)
throw... | java | @POST
public APIAuthenticationResult createToken(@FormParam("username") String username,
@FormParam("password") String password,
@FormParam("token") String token,
@Context HttpServletRequest consumedRequest,
MultivaluedMap<String, String> parameters)
throw... | [
"@",
"POST",
"public",
"APIAuthenticationResult",
"createToken",
"(",
"@",
"FormParam",
"(",
"\"username\"",
")",
"String",
"username",
",",
"@",
"FormParam",
"(",
"\"password\"",
")",
"String",
"password",
",",
"@",
"FormParam",
"(",
"\"token\"",
")",
"String",... | Authenticates a user, generates an auth token, associates that auth token
with the user's UserContext for use by further requests. If an existing
token is provided, the authentication procedure will attempt to update
or reuse the provided token.
@param username
The username of the user who is to be authenticated.
@pa... | [
"Authenticates",
"a",
"user",
"generates",
"an",
"auth",
"token",
"associates",
"that",
"auth",
"token",
"with",
"the",
"user",
"s",
"UserContext",
"for",
"use",
"by",
"further",
"requests",
".",
"If",
"an",
"existing",
"token",
"is",
"provided",
"the",
"aut... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/rest/auth/TokenRESTService.java#L159-L196 |
knowm/Sundial | src/main/java/org/knowm/sundial/SundialJobScheduler.java | SundialJobScheduler.removeTrigger | public static void removeTrigger(String triggerName) throws SundialSchedulerException {
"""
Removes a Trigger matching the the given Trigger Name
@param triggerName
"""
try {
getScheduler().unscheduleJob(triggerName);
} catch (SchedulerException e) {
throw new SundialSchedulerExcep... | java | public static void removeTrigger(String triggerName) throws SundialSchedulerException {
try {
getScheduler().unscheduleJob(triggerName);
} catch (SchedulerException e) {
throw new SundialSchedulerException("ERROR REMOVING TRIGGER!!!", e);
}
} | [
"public",
"static",
"void",
"removeTrigger",
"(",
"String",
"triggerName",
")",
"throws",
"SundialSchedulerException",
"{",
"try",
"{",
"getScheduler",
"(",
")",
".",
"unscheduleJob",
"(",
"triggerName",
")",
";",
"}",
"catch",
"(",
"SchedulerException",
"e",
")... | Removes a Trigger matching the the given Trigger Name
@param triggerName | [
"Removes",
"a",
"Trigger",
"matching",
"the",
"the",
"given",
"Trigger",
"Name"
] | train | https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L490-L497 |
perwendel/spark | src/main/java/spark/embeddedserver/jetty/SocketConnectorFactory.java | SocketConnectorFactory.createSecureSocketConnector | public static ServerConnector createSecureSocketConnector(Server server,
String host,
int port,
SslStores sslStores) {
"""
Create... | java | public static ServerConnector createSecureSocketConnector(Server server,
String host,
int port,
SslStores sslStores) {
Assert.... | [
"public",
"static",
"ServerConnector",
"createSecureSocketConnector",
"(",
"Server",
"server",
",",
"String",
"host",
",",
"int",
"port",
",",
"SslStores",
"sslStores",
")",
"{",
"Assert",
".",
"notNull",
"(",
"server",
",",
"\"'server' must not be null\"",
")",
"... | Creates a ssl jetty socket jetty. Keystore required, truststore
optional. If truststore not specified keystore will be reused.
@param server Jetty server
@param sslStores the security sslStores.
@param host host
@param port port
@return a ssl socket jetty | [
"Creates",
"a",
"ssl",
"jetty",
"socket",
"jetty",
".",
"Keystore",
"required",
"truststore",
"optional",
".",
"If",
"truststore",
"not",
"specified",
"keystore",
"will",
"be",
"reused",
"."
] | train | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/embeddedserver/jetty/SocketConnectorFactory.java#L64-L100 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/filemgr/FileManagerImpl.java | FileManagerImpl.add_new_block_to_freelist | private void add_new_block_to_freelist(long addr, int size, int ql_index) {
"""
/* Add a new block to the beginning of a free list data structure,
increment counters
"""
Block block = new Block();
block.address = addr;
block.size = size;
add_block_to_freelist(block, ql_index);... | java | private void add_new_block_to_freelist(long addr, int size, int ql_index)
{
Block block = new Block();
block.address = addr;
block.size = size;
add_block_to_freelist(block, ql_index);
free_blocks++;
free_words += size;
} | [
"private",
"void",
"add_new_block_to_freelist",
"(",
"long",
"addr",
",",
"int",
"size",
",",
"int",
"ql_index",
")",
"{",
"Block",
"block",
"=",
"new",
"Block",
"(",
")",
";",
"block",
".",
"address",
"=",
"addr",
";",
"block",
".",
"size",
"=",
"size... | /* Add a new block to the beginning of a free list data structure,
increment counters | [
"/",
"*",
"Add",
"a",
"new",
"block",
"to",
"the",
"beginning",
"of",
"a",
"free",
"list",
"data",
"structure",
"increment",
"counters"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/filemgr/FileManagerImpl.java#L1139-L1148 |
moparisthebest/beehive | beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java | RowMapperFactory.getRowMapper | public static RowMapper getRowMapper(ResultSet rs, Class returnTypeClass, Calendar cal) {
"""
Get a RowMapper instance which knows how to map a ResultSet row to the given return type.
@param rs The ResultSet to map.
@param returnTypeClass The class to map a ResultSet row to.
@param cal ... | java | public static RowMapper getRowMapper(ResultSet rs, Class returnTypeClass, Calendar cal) {
Class<? extends RowMapper> rm = _rowMappings.get(returnTypeClass);
if (rm != null) {
return getMapper(rm, rs, returnTypeClass, cal);
}
//
// if we made it to here, check if the... | [
"public",
"static",
"RowMapper",
"getRowMapper",
"(",
"ResultSet",
"rs",
",",
"Class",
"returnTypeClass",
",",
"Calendar",
"cal",
")",
"{",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"rm",
"=",
"_rowMappings",
".",
"get",
"(",
"returnTypeClass",
")",
";... | Get a RowMapper instance which knows how to map a ResultSet row to the given return type.
@param rs The ResultSet to map.
@param returnTypeClass The class to map a ResultSet row to.
@param cal Calendar instance for mapping date/time values.
@return A RowMapper instance. | [
"Get",
"a",
"RowMapper",
"instance",
"which",
"knows",
"how",
"to",
"map",
"a",
"ResultSet",
"row",
"to",
"the",
"given",
"return",
"type",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java#L71-L87 |
wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/util/XHtmlEntityResolver.java | XHtmlEntityResolver.resolveEntity | @Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
"""
Resolve XHtml resource entities, load from classpath resources.
"""
String filename = xhtmlResourceMap.get(publicId);
if (filename != null) {
String resourceName = resourceFolder... | java | @Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
String filename = xhtmlResourceMap.get(publicId);
if (filename != null) {
String resourceName = resourceFolder + "/" + filename;
InputStream is = XHtmlEntityResolver.class.getResourceAs... | [
"@",
"Override",
"public",
"InputSource",
"resolveEntity",
"(",
"String",
"publicId",
",",
"String",
"systemId",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"String",
"filename",
"=",
"xhtmlResourceMap",
".",
"get",
"(",
"publicId",
")",
";",
"if",
... | Resolve XHtml resource entities, load from classpath resources. | [
"Resolve",
"XHtml",
"resource",
"entities",
"load",
"from",
"classpath",
"resources",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/util/XHtmlEntityResolver.java#L61-L77 |
apache/groovy | subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java | SwingGroovyMethods.leftShift | public static MutableTreeNode leftShift(MutableTreeNode self, MutableTreeNode node) {
"""
Overloads the left shift operator to provide an easy way to add
nodes to a MutableTreeNode.<p>
@param self a MutableTreeNode
@param node a node to be added to the treeNode.
@return same treeNode, after the value was add... | java | public static MutableTreeNode leftShift(MutableTreeNode self, MutableTreeNode node) {
self.insert(node, self.getChildCount());
return self;
} | [
"public",
"static",
"MutableTreeNode",
"leftShift",
"(",
"MutableTreeNode",
"self",
",",
"MutableTreeNode",
"node",
")",
"{",
"self",
".",
"insert",
"(",
"node",
",",
"self",
".",
"getChildCount",
"(",
")",
")",
";",
"return",
"self",
";",
"}"
] | Overloads the left shift operator to provide an easy way to add
nodes to a MutableTreeNode.<p>
@param self a MutableTreeNode
@param node a node to be added to the treeNode.
@return same treeNode, after the value was added to it.
@since 1.6.4 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"an",
"easy",
"way",
"to",
"add",
"nodes",
"to",
"a",
"MutableTreeNode",
".",
"<p",
">"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java#L690-L693 |
square/okhttp | mockwebserver/src/main/java/okhttp3/mockwebserver/MockResponse.java | MockResponse.addHeader | public MockResponse addHeader(String name, Object value) {
"""
Adds a new header with the name and value. This may be used to add multiple headers with the
same name.
"""
headers.add(name, String.valueOf(value));
return this;
} | java | public MockResponse addHeader(String name, Object value) {
headers.add(name, String.valueOf(value));
return this;
} | [
"public",
"MockResponse",
"addHeader",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"headers",
".",
"add",
"(",
"name",
",",
"String",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new header with the name and value. This may be used to add multiple headers with the
same name. | [
"Adds",
"a",
"new",
"header",
"with",
"the",
"name",
"and",
"value",
".",
"This",
"may",
"be",
"used",
"to",
"add",
"multiple",
"headers",
"with",
"the",
"same",
"name",
"."
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/mockwebserver/src/main/java/okhttp3/mockwebserver/MockResponse.java#L130-L133 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/BasePrepareStatement.java | BasePrepareStatement.setCharacterStream | public void setCharacterStream(final int parameterIndex, final Reader reader, final int length)
throws SQLException {
"""
Sets the designated parameter to the given <code>Reader</code> object, which is the given
number of characters long. When a very large UNICODE value is input to a
<code>LONGVARCHAR</cod... | java | public void setCharacterStream(final int parameterIndex, final Reader reader, final int length)
throws SQLException {
if (reader == null) {
setNull(parameterIndex, ColumnType.BLOB);
return;
}
setParameter(parameterIndex, new ReaderParameter(reader, length, noBackslashEscapes));
hasLong... | [
"public",
"void",
"setCharacterStream",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"Reader",
"reader",
",",
"final",
"int",
"length",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"reader",
"==",
"null",
")",
"{",
"setNull",
"(",
"parameterIndex",
... | Sets the designated parameter to the given <code>Reader</code> object, which is the given
number of characters long. When a very large UNICODE value is input to a
<code>LONGVARCHAR</code> parameter, it may be more practical to send it via a
<code>java.io.Reader</code> object. The data will be read from the stream as ne... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"<code",
">",
"Reader<",
"/",
"code",
">",
"object",
"which",
"is",
"the",
"given",
"number",
"of",
"characters",
"long",
".",
"When",
"a",
"very",
"large",
"UNICODE",
"value",
"is",
"input",
... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/BasePrepareStatement.java#L207-L215 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Client.java | ContainerAnalysisV1Beta1Client.updateScanConfig | public final ScanConfig updateScanConfig(String name, ScanConfig scanConfig) {
"""
Updates the specified scan configuration.
<p>Sample code:
<pre><code>
try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
ScanConfigName name = ScanConfigName.of("[... | java | public final ScanConfig updateScanConfig(String name, ScanConfig scanConfig) {
UpdateScanConfigRequest request =
UpdateScanConfigRequest.newBuilder().setName(name).setScanConfig(scanConfig).build();
return updateScanConfig(request);
} | [
"public",
"final",
"ScanConfig",
"updateScanConfig",
"(",
"String",
"name",
",",
"ScanConfig",
"scanConfig",
")",
"{",
"UpdateScanConfigRequest",
"request",
"=",
"UpdateScanConfigRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",
"setSca... | Updates the specified scan configuration.
<p>Sample code:
<pre><code>
try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
ScanConfig scanConfig = ScanConfig.newBuilder().build();
ScanConf... | [
"Updates",
"the",
"specified",
"scan",
"configuration",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Client.java#L840-L845 |
orhanobut/hawk | hawk/src/main/java/com/orhanobut/hawk/Hawk.java | Hawk.put | public static <T> boolean put(String key, T value) {
"""
Saves any type including any collection, primitive values or custom objects
@param key is required to differentiate the given data
@param value is the data that is going to be encrypted and persisted
@return true if the operation is successful. Any fa... | java | public static <T> boolean put(String key, T value) {
return hawkFacade.put(key, value);
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"put",
"(",
"String",
"key",
",",
"T",
"value",
")",
"{",
"return",
"hawkFacade",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Saves any type including any collection, primitive values or custom objects
@param key is required to differentiate the given data
@param value is the data that is going to be encrypted and persisted
@return true if the operation is successful. Any failure in any step will return false | [
"Saves",
"any",
"type",
"including",
"any",
"collection",
"primitive",
"values",
"or",
"custom",
"objects"
] | train | https://github.com/orhanobut/hawk/blob/0d22dde128b1ab5f50ac20d802db79cf402aa150/hawk/src/main/java/com/orhanobut/hawk/Hawk.java#L39-L41 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/override/RawResolvedFeatures.java | RawResolvedFeatures.requestNotificationOnChange | protected static void requestNotificationOnChange(JvmType type, Runnable listener) {
"""
Registers the given listener to be notified on type changes, if (and only if) the type
if expected to be changeable.
@see IMirrorExtension#isSealed()
"""
Resource resource = type.eResource();
if (resource instanceo... | java | protected static void requestNotificationOnChange(JvmType type, Runnable listener) {
Resource resource = type.eResource();
if (resource instanceof TypeResource) {
IMirror mirror = ((TypeResource) resource).getMirror();
if (mirror instanceof IMirrorExtension) {
if (((IMirrorExtension) mirror).isSealed())
... | [
"protected",
"static",
"void",
"requestNotificationOnChange",
"(",
"JvmType",
"type",
",",
"Runnable",
"listener",
")",
"{",
"Resource",
"resource",
"=",
"type",
".",
"eResource",
"(",
")",
";",
"if",
"(",
"resource",
"instanceof",
"TypeResource",
")",
"{",
"I... | Registers the given listener to be notified on type changes, if (and only if) the type
if expected to be changeable.
@see IMirrorExtension#isSealed() | [
"Registers",
"the",
"given",
"listener",
"to",
"be",
"notified",
"on",
"type",
"changes",
"if",
"(",
"and",
"only",
"if",
")",
"the",
"type",
"if",
"expected",
"to",
"be",
"changeable",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/override/RawResolvedFeatures.java#L87-L105 |
real-logic/agrona | agrona/src/main/java/org/agrona/BufferUtil.java | BufferUtil.allocateDirectAligned | public static ByteBuffer allocateDirectAligned(final int capacity, final int alignment) {
"""
Allocate a new direct {@link ByteBuffer} that is aligned on a given alignment boundary.
@param capacity required for the buffer.
@param alignment boundary at which the buffer should begin.
@return a new {@link ByteB... | java | public static ByteBuffer allocateDirectAligned(final int capacity, final int alignment)
{
if (!isPowerOfTwo(alignment))
{
throw new IllegalArgumentException("Must be a power of 2: alignment=" + alignment);
}
final ByteBuffer buffer = ByteBuffer.allocateDirect(capacity + ... | [
"public",
"static",
"ByteBuffer",
"allocateDirectAligned",
"(",
"final",
"int",
"capacity",
",",
"final",
"int",
"alignment",
")",
"{",
"if",
"(",
"!",
"isPowerOfTwo",
"(",
"alignment",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Must be a... | Allocate a new direct {@link ByteBuffer} that is aligned on a given alignment boundary.
@param capacity required for the buffer.
@param alignment boundary at which the buffer should begin.
@return a new {@link ByteBuffer} with the required alignment.
@throws IllegalArgumentException if the alignment is not a power of... | [
"Allocate",
"a",
"new",
"direct",
"{",
"@link",
"ByteBuffer",
"}",
"that",
"is",
"aligned",
"on",
"a",
"given",
"alignment",
"boundary",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/BufferUtil.java#L139-L156 |
meertensinstituut/mtas | src/main/java/mtas/analysis/parser/MtasBasicParser.java | MtasBasicParser.addAndEncodeVariable | private String addAndEncodeVariable(String originalValue, String newVariable,
String newVariableName, boolean encode) {
"""
Adds the and encode variable.
@param originalValue the original value
@param newVariable the new variable
@param newVariableName the new variable name
@param encode the encode
@r... | java | private String addAndEncodeVariable(String originalValue, String newVariable,
String newVariableName, boolean encode) {
return addAndEncode(originalValue, newVariable, newVariableName, encode);
} | [
"private",
"String",
"addAndEncodeVariable",
"(",
"String",
"originalValue",
",",
"String",
"newVariable",
",",
"String",
"newVariableName",
",",
"boolean",
"encode",
")",
"{",
"return",
"addAndEncode",
"(",
"originalValue",
",",
"newVariable",
",",
"newVariableName",... | Adds the and encode variable.
@param originalValue the original value
@param newVariable the new variable
@param newVariableName the new variable name
@param encode the encode
@return the string | [
"Adds",
"the",
"and",
"encode",
"variable",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L1018-L1021 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/Normalize.java | Normalize.byCorrelation | public static void byCorrelation(Matrix m, boolean saveNegatives) {
"""
Normalize the values of the {@code Matrix} by using the Pearson
correlation. This will give values between -1 and 1. If {@code
saveNegatives} is is {@code true}, negative correlations will be saved,
and otherwise they are reduced to zero.... | java | public static void byCorrelation(Matrix m, boolean saveNegatives) {
double totalSum = 0;
// Generate the total value in each row and column.
double[] rowSums = new double[m.rows()];
double[] colSums = new double[m.columns()];
for (int i = 0; i < m.rows(); ++i) {
for ... | [
"public",
"static",
"void",
"byCorrelation",
"(",
"Matrix",
"m",
",",
"boolean",
"saveNegatives",
")",
"{",
"double",
"totalSum",
"=",
"0",
";",
"// Generate the total value in each row and column.",
"double",
"[",
"]",
"rowSums",
"=",
"new",
"double",
"[",
"m",
... | Normalize the values of the {@code Matrix} by using the Pearson
correlation. This will give values between -1 and 1. If {@code
saveNegatives} is is {@code true}, negative correlations will be saved,
and otherwise they are reduced to zero.
@param m The {@code Matrix} to normalize.
@param saveNegatives If true, save a... | [
"Normalize",
"the",
"values",
"of",
"the",
"{",
"@code",
"Matrix",
"}",
"by",
"using",
"the",
"Pearson",
"correlation",
".",
"This",
"will",
"give",
"values",
"between",
"-",
"1",
"and",
"1",
".",
"If",
"{",
"@code",
"saveNegatives",
"}",
"is",
"is",
"... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/Normalize.java#L134-L163 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/index/IndexAVL.java | IndexAVL.lastRow | @Override
public Row lastRow(Session session, PersistentStore store) {
"""
Returns the row for the last node of the index
@return last row
"""
readLock.lock();
try {
NodeAVL x = getAccessor(store);
NodeAVL l = x;
while (l != null) {
... | java | @Override
public Row lastRow(Session session, PersistentStore store) {
readLock.lock();
try {
NodeAVL x = getAccessor(store);
NodeAVL l = x;
while (l != null) {
x = l;
l = x.getRight(store);
}
while (sess... | [
"@",
"Override",
"public",
"Row",
"lastRow",
"(",
"Session",
"session",
",",
"PersistentStore",
"store",
")",
"{",
"readLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"NodeAVL",
"x",
"=",
"getAccessor",
"(",
"store",
")",
";",
"NodeAVL",
"l",
"=",
"x",... | Returns the row for the last node of the index
@return last row | [
"Returns",
"the",
"row",
"for",
"the",
"last",
"node",
"of",
"the",
"index"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/index/IndexAVL.java#L1116-L1145 |
GistLabs/mechanize | src/main/java/com/gistlabs/mechanize/document/json/hypermedia/JsonLink.java | JsonLink.lookupWalkForVar | protected Object lookupWalkForVar(String var) {
"""
Return an Object that is either String or List<String> or Map<String, String>.
@param var maybe null if not found
@return
"""
JsonNode current = node;
while (current!=null) {
Object result = lookupVar(current, var);
if (result!=null) return resu... | java | protected Object lookupWalkForVar(String var) {
JsonNode current = node;
while (current!=null) {
Object result = lookupVar(current, var);
if (result!=null) return result;
if (current.hasAttribute("inheritProperties")) {
current = current.getParent();
} else {
current = null;
}
}
r... | [
"protected",
"Object",
"lookupWalkForVar",
"(",
"String",
"var",
")",
"{",
"JsonNode",
"current",
"=",
"node",
";",
"while",
"(",
"current",
"!=",
"null",
")",
"{",
"Object",
"result",
"=",
"lookupVar",
"(",
"current",
",",
"var",
")",
";",
"if",
"(",
... | Return an Object that is either String or List<String> or Map<String, String>.
@param var maybe null if not found
@return | [
"Return",
"an",
"Object",
"that",
"is",
"either",
"String",
"or",
"List<String",
">",
"or",
"Map<String",
"String",
">",
"."
] | train | https://github.com/GistLabs/mechanize/blob/32ddd0774439a4c08513c05d7ac7416a3899efed/src/main/java/com/gistlabs/mechanize/document/json/hypermedia/JsonLink.java#L125-L138 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.