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 |
|---|---|---|---|---|---|---|---|---|---|---|
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_mailingList_name_moderator_email_GET | public OvhModerator domain_mailingList_name_moderator_email_GET(String domain, String name, String email) throws IOException {
"""
Get this object properties
REST: GET /email/domain/{domain}/mailingList/{name}/moderator/{email}
@param domain [required] Name of your domain name
@param name [required] Name of m... | java | public OvhModerator domain_mailingList_name_moderator_email_GET(String domain, String name, String email) throws IOException {
String qPath = "/email/domain/{domain}/mailingList/{name}/moderator/{email}";
StringBuilder sb = path(qPath, domain, name, email);
String resp = exec(qPath, "GET", sb.toString(), null);
... | [
"public",
"OvhModerator",
"domain_mailingList_name_moderator_email_GET",
"(",
"String",
"domain",
",",
"String",
"name",
",",
"String",
"email",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/mailingList/{name}/moderator/{email}\"",
";",
... | Get this object properties
REST: GET /email/domain/{domain}/mailingList/{name}/moderator/{email}
@param domain [required] Name of your domain name
@param name [required] Name of mailing list
@param email [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L1447-L1452 |
SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.setMenuView | public void setMenuView(View view, LayoutParams params) {
"""
Set the menu view to an explicit view.
@param view The menu view.
@param params Layout parameters for the view.
"""
mMenuView = view;
mMenuContainer.removeAllViews();
mMenuContainer.addView(view, params);
} | java | public void setMenuView(View view, LayoutParams params) {
mMenuView = view;
mMenuContainer.removeAllViews();
mMenuContainer.addView(view, params);
} | [
"public",
"void",
"setMenuView",
"(",
"View",
"view",
",",
"LayoutParams",
"params",
")",
"{",
"mMenuView",
"=",
"view",
";",
"mMenuContainer",
".",
"removeAllViews",
"(",
")",
";",
"mMenuContainer",
".",
"addView",
"(",
"view",
",",
"params",
")",
";",
"}... | Set the menu view to an explicit view.
@param view The menu view.
@param params Layout parameters for the view. | [
"Set",
"the",
"menu",
"view",
"to",
"an",
"explicit",
"view",
"."
] | train | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1431-L1435 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_trunk_serviceName_externalDisplayedNumber_number_validate_POST | public OvhTrunkExternalDisplayedNumberValidation billingAccount_trunk_serviceName_externalDisplayedNumber_number_validate_POST(String billingAccount, String serviceName, String number) throws IOException {
"""
Generate a phone call for validation. Returned validation code should be typed when asked.
REST: POST ... | java | public OvhTrunkExternalDisplayedNumberValidation billingAccount_trunk_serviceName_externalDisplayedNumber_number_validate_POST(String billingAccount, String serviceName, String number) throws IOException {
String qPath = "/telephony/{billingAccount}/trunk/{serviceName}/externalDisplayedNumber/{number}/validate";
St... | [
"public",
"OvhTrunkExternalDisplayedNumberValidation",
"billingAccount_trunk_serviceName_externalDisplayedNumber_number_validate_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"number",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=... | Generate a phone call for validation. Returned validation code should be typed when asked.
REST: POST /telephony/{billingAccount}/trunk/{serviceName}/externalDisplayedNumber/{number}/validate
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] Name of the service
@param numbe... | [
"Generate",
"a",
"phone",
"call",
"for",
"validation",
".",
"Returned",
"validation",
"code",
"should",
"be",
"typed",
"when",
"asked",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8164-L8169 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/sql/planner/SubqueryPlanner.java | SubqueryPlanner.appendExistSubqueryApplyNode | private PlanBuilder appendExistSubqueryApplyNode(PlanBuilder subPlan, ExistsPredicate existsPredicate, boolean correlationAllowed) {
"""
Exists is modeled as:
<pre>
- Project($0 > 0)
- Aggregation(COUNT(*))
- Limit(1)
-- subquery
</pre>
"""
if (subPlan.canTranslate(existsPredicate)) {
... | java | private PlanBuilder appendExistSubqueryApplyNode(PlanBuilder subPlan, ExistsPredicate existsPredicate, boolean correlationAllowed)
{
if (subPlan.canTranslate(existsPredicate)) {
// given subquery is already appended
return subPlan;
}
PlanBuilder subqueryPlan = create... | [
"private",
"PlanBuilder",
"appendExistSubqueryApplyNode",
"(",
"PlanBuilder",
"subPlan",
",",
"ExistsPredicate",
"existsPredicate",
",",
"boolean",
"correlationAllowed",
")",
"{",
"if",
"(",
"subPlan",
".",
"canTranslate",
"(",
"existsPredicate",
")",
")",
"{",
"// gi... | Exists is modeled as:
<pre>
- Project($0 > 0)
- Aggregation(COUNT(*))
- Limit(1)
-- subquery
</pre> | [
"Exists",
"is",
"modeled",
"as",
":",
"<pre",
">",
"-",
"Project",
"(",
"$0",
">",
"0",
")",
"-",
"Aggregation",
"(",
"COUNT",
"(",
"*",
"))",
"-",
"Limit",
"(",
"1",
")",
"--",
"subquery",
"<",
"/",
"pre",
">"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/sql/planner/SubqueryPlanner.java#L275-L302 |
bmelnychuk/AndroidTreeView | library/src/main/java/com/unnamed/b/atv/view/TwoDScrollView.java | TwoDScrollView.smoothScrollBy | public final void smoothScrollBy(int dx, int dy) {
"""
Like {@link View#scrollBy}, but scroll smoothly instead of immediately.
@param dx the number of pixels to scroll by on the X axis
@param dy the number of pixels to scroll by on the Y axis
"""
long duration = AnimationUtils.currentAnimationTimeM... | java | public final void smoothScrollBy(int dx, int dy) {
long duration = AnimationUtils.currentAnimationTimeMillis() - mLastScroll;
if (duration > ANIMATED_SCROLL_GAP) {
mScroller.startScroll(getScrollX(), getScrollY(), dx, dy);
awakenScrollBars(mScroller.getDuration());
in... | [
"public",
"final",
"void",
"smoothScrollBy",
"(",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"long",
"duration",
"=",
"AnimationUtils",
".",
"currentAnimationTimeMillis",
"(",
")",
"-",
"mLastScroll",
";",
"if",
"(",
"duration",
">",
"ANIMATED_SCROLL_GAP",
")",
... | Like {@link View#scrollBy}, but scroll smoothly instead of immediately.
@param dx the number of pixels to scroll by on the X axis
@param dy the number of pixels to scroll by on the Y axis | [
"Like",
"{",
"@link",
"View#scrollBy",
"}",
"but",
"scroll",
"smoothly",
"instead",
"of",
"immediately",
"."
] | train | https://github.com/bmelnychuk/AndroidTreeView/blob/d051ce75f5c9bd5206481808f6133b51f581c8f1/library/src/main/java/com/unnamed/b/atv/view/TwoDScrollView.java#L734-L747 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toUUId | public static Object toUUId(Object o, Object defaultValue) {
"""
cast a Object to a UUID
@param o Object to cast
@param defaultValue
@return casted Query Object
"""
String str = toString(o, null);
if (str == null) return defaultValue;
if (!Decision.isUUId(str)) return defaultValue;
return str;
} | java | public static Object toUUId(Object o, Object defaultValue) {
String str = toString(o, null);
if (str == null) return defaultValue;
if (!Decision.isUUId(str)) return defaultValue;
return str;
} | [
"public",
"static",
"Object",
"toUUId",
"(",
"Object",
"o",
",",
"Object",
"defaultValue",
")",
"{",
"String",
"str",
"=",
"toString",
"(",
"o",
",",
"null",
")",
";",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"defaultValue",
";",
"if",
"(",
"!"... | cast a Object to a UUID
@param o Object to cast
@param defaultValue
@return casted Query Object | [
"cast",
"a",
"Object",
"to",
"a",
"UUID"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L3109-L3115 |
jbundle/jbundle | thin/base/remote/src/main/java/org/jbundle/thin/base/message/remote/RemoteMessageReceiver.java | RemoteMessageReceiver.removeMessageFilter | public boolean removeMessageFilter(MessageFilter messageFilter, boolean bFreeFilter) {
"""
Remove this message filter from this queue.
Also remove the remote message filter.
@param messageFilter The message filter to remove.
@param bFreeFilter If true, free this filter.
@return True if successful.
"""
... | java | public boolean removeMessageFilter(MessageFilter messageFilter, boolean bFreeFilter)
{
boolean bSuccess = false;
try {
if (((BaseMessageFilter)messageFilter).getRemoteFilterID() == null)
bSuccess = true; // No remote filter to remove
else
... | [
"public",
"boolean",
"removeMessageFilter",
"(",
"MessageFilter",
"messageFilter",
",",
"boolean",
"bFreeFilter",
")",
"{",
"boolean",
"bSuccess",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"(",
"(",
"BaseMessageFilter",
")",
"messageFilter",
")",
".",
"getRemote... | Remove this message filter from this queue.
Also remove the remote message filter.
@param messageFilter The message filter to remove.
@param bFreeFilter If true, free this filter.
@return True if successful. | [
"Remove",
"this",
"message",
"filter",
"from",
"this",
"queue",
".",
"Also",
"remove",
"the",
"remote",
"message",
"filter",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/remote/src/main/java/org/jbundle/thin/base/message/remote/RemoteMessageReceiver.java#L130-L144 |
hawkular/hawkular-agent | hawkular-javaagent/src/main/java/org/hawkular/agent/javaagent/Util.java | Util.cloneArray | @SuppressWarnings("unchecked")
public static <T> T[] cloneArray(T[] original) {
"""
Performs a deep copy of the given array by calling a copy constructor to build clones of each array element.
"""
if (original == null) {
return null;
}
try {
Class<?> clazz =... | java | @SuppressWarnings("unchecked")
public static <T> T[] cloneArray(T[] original) {
if (original == null) {
return null;
}
try {
Class<?> clazz = original.getClass().getComponentType();
T[] copy = (T[]) Array.newInstance(clazz, original.length);
i... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"cloneArray",
"(",
"T",
"[",
"]",
"original",
")",
"{",
"if",
"(",
"original",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"Cl... | Performs a deep copy of the given array by calling a copy constructor to build clones of each array element. | [
"Performs",
"a",
"deep",
"copy",
"of",
"the",
"given",
"array",
"by",
"calling",
"a",
"copy",
"constructor",
"to",
"build",
"clones",
"of",
"each",
"array",
"element",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-javaagent/src/main/java/org/hawkular/agent/javaagent/Util.java#L27-L47 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/MapUtils.java | MapUtils.buildClickLatLngBounds | public static LatLngBounds buildClickLatLngBounds(LatLng latLng, View view, GoogleMap map, float screenClickPercentage) {
"""
Build a lat lng bounds using the click location, map view, map, and screen percentage tolerance.
The bounding box can be used to query for features that were clicked
@param latLng ... | java | public static LatLngBounds buildClickLatLngBounds(LatLng latLng, View view, GoogleMap map, float screenClickPercentage) {
LatLngBoundingBox latLngBoundingBox = buildClickLatLngBoundingBox(latLng, view, map, screenClickPercentage);
double southWestLongitude = Math.min(latLngBoundingBox.getLeftCoordinat... | [
"public",
"static",
"LatLngBounds",
"buildClickLatLngBounds",
"(",
"LatLng",
"latLng",
",",
"View",
"view",
",",
"GoogleMap",
"map",
",",
"float",
"screenClickPercentage",
")",
"{",
"LatLngBoundingBox",
"latLngBoundingBox",
"=",
"buildClickLatLngBoundingBox",
"(",
"latL... | Build a lat lng bounds using the click location, map view, map, and screen percentage tolerance.
The bounding box can be used to query for features that were clicked
@param latLng click location
@param view view
@param map Google map
@param screenClickPercentage screen... | [
"Build",
"a",
"lat",
"lng",
"bounds",
"using",
"the",
"click",
"location",
"map",
"view",
"map",
"and",
"screen",
"percentage",
"tolerance",
".",
"The",
"bounding",
"box",
"can",
"be",
"used",
"to",
"query",
"for",
"features",
"that",
"were",
"clicked"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/MapUtils.java#L138-L150 |
luuuis/jcalendar | src/main/java/com/toedter/calendar/JMonthChooser.java | JMonthChooser.setMonth | private void setMonth(int newMonth, boolean select) {
"""
Sets the month attribute of the JMonthChooser object. Fires a property
change "month".
@param newMonth
the new month value
@param select
true, if the month should be selcted in the combo box.
"""
if (!initialized || localInitialize) {
return... | java | private void setMonth(int newMonth, boolean select) {
if (!initialized || localInitialize) {
return;
}
int oldMonth = month;
month = newMonth;
if (select) {
comboBox.setSelectedIndex(month);
}
if (dayChooser != null) {
dayChooser.setMonth(month);
}
firePropertyChange("month", oldMonth, mo... | [
"private",
"void",
"setMonth",
"(",
"int",
"newMonth",
",",
"boolean",
"select",
")",
"{",
"if",
"(",
"!",
"initialized",
"||",
"localInitialize",
")",
"{",
"return",
";",
"}",
"int",
"oldMonth",
"=",
"month",
";",
"month",
"=",
"newMonth",
";",
"if",
... | Sets the month attribute of the JMonthChooser object. Fires a property
change "month".
@param newMonth
the new month value
@param select
true, if the month should be selcted in the combo box. | [
"Sets",
"the",
"month",
"attribute",
"of",
"the",
"JMonthChooser",
"object",
".",
"Fires",
"a",
"property",
"change",
"month",
"."
] | train | https://github.com/luuuis/jcalendar/blob/442e5bc319d92dee93400e6180ca74a5b6bd7775/src/main/java/com/toedter/calendar/JMonthChooser.java#L220-L237 |
undertow-io/undertow | core/src/main/java/io/undertow/util/DateUtils.java | DateUtils.handleIfModifiedSince | public static boolean handleIfModifiedSince(final HttpServerExchange exchange, final Date lastModified) {
"""
Handles the if-modified-since header. returns true if the request should proceed, false otherwise
@param exchange the exchange
@param lastModified The last modified date
@return
"""
re... | java | public static boolean handleIfModifiedSince(final HttpServerExchange exchange, final Date lastModified) {
return handleIfModifiedSince(exchange.getRequestHeaders().getFirst(Headers.IF_MODIFIED_SINCE), lastModified);
} | [
"public",
"static",
"boolean",
"handleIfModifiedSince",
"(",
"final",
"HttpServerExchange",
"exchange",
",",
"final",
"Date",
"lastModified",
")",
"{",
"return",
"handleIfModifiedSince",
"(",
"exchange",
".",
"getRequestHeaders",
"(",
")",
".",
"getFirst",
"(",
"Hea... | Handles the if-modified-since header. returns true if the request should proceed, false otherwise
@param exchange the exchange
@param lastModified The last modified date
@return | [
"Handles",
"the",
"if",
"-",
"modified",
"-",
"since",
"header",
".",
"returns",
"true",
"if",
"the",
"request",
"should",
"proceed",
"false",
"otherwise"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/util/DateUtils.java#L180-L182 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Components.java | Components.getDescription | public static String getDescription(Class<?> comp, Locale loc) {
"""
Get the Component Description
@param comp the component class
@param loc the locale
@return the localized description
"""
Description descr = (Description) comp.getAnnotation(Description.class);
if (descr != null) {
... | java | public static String getDescription(Class<?> comp, Locale loc) {
Description descr = (Description) comp.getAnnotation(Description.class);
if (descr != null) {
String lang = loc.getLanguage();
Method[] m = descr.getClass().getMethods();
for (Method method : m) {
// ... | [
"public",
"static",
"String",
"getDescription",
"(",
"Class",
"<",
"?",
">",
"comp",
",",
"Locale",
"loc",
")",
"{",
"Description",
"descr",
"=",
"(",
"Description",
")",
"comp",
".",
"getAnnotation",
"(",
"Description",
".",
"class",
")",
";",
"if",
"("... | Get the Component Description
@param comp the component class
@param loc the locale
@return the localized description | [
"Get",
"the",
"Component",
"Description"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Components.java#L431-L452 |
jayantk/jklol | src/com/jayantkrish/jklol/tensor/DenseTensorBuilder.java | DenseTensorBuilder.incrementWithMultiplier | @Override
public void incrementWithMultiplier(TensorBase other, double multiplier) {
"""
{@inheritDoc}
This implementation supports increments when {@code other} has a subset of
{@code this}'s dimensions. In this case, the values in {@code other} are
implicitly replicated across all dimensions of {@code thi... | java | @Override
public void incrementWithMultiplier(TensorBase other, double multiplier) {
if (Arrays.equals(other.getDimensionNumbers(), getDimensionNumbers())) {
simpleIncrement(other, multiplier);
} else {
repmatIncrement(other, multiplier);
}
} | [
"@",
"Override",
"public",
"void",
"incrementWithMultiplier",
"(",
"TensorBase",
"other",
",",
"double",
"multiplier",
")",
"{",
"if",
"(",
"Arrays",
".",
"equals",
"(",
"other",
".",
"getDimensionNumbers",
"(",
")",
",",
"getDimensionNumbers",
"(",
")",
")",
... | {@inheritDoc}
This implementation supports increments when {@code other} has a subset of
{@code this}'s dimensions. In this case, the values in {@code other} are
implicitly replicated across all dimensions of {@code this} not present in
{@code other}. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/tensor/DenseTensorBuilder.java#L94-L101 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassUtils.java | ClassUtils.getAbbreviatedName | public static String getAbbreviatedName(final Class<?> cls, final int len) {
"""
<p>Gets the abbreviated name of a {@code Class}.</p>
@param cls the class to get the abbreviated name for, may be {@code null}
@param len the desired length of the abbreviated name
@return the abbreviated name or an empty strin... | java | public static String getAbbreviatedName(final Class<?> cls, final int len) {
if (cls == null) {
return StringUtils.EMPTY;
}
return getAbbreviatedName(cls.getName(), len);
} | [
"public",
"static",
"String",
"getAbbreviatedName",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"int",
"len",
")",
"{",
"if",
"(",
"cls",
"==",
"null",
")",
"{",
"return",
"StringUtils",
".",
"EMPTY",
";",
"}",
"return",
"getAbbreviatedNam... | <p>Gets the abbreviated name of a {@code Class}.</p>
@param cls the class to get the abbreviated name for, may be {@code null}
@param len the desired length of the abbreviated name
@return the abbreviated name or an empty string
@throws IllegalArgumentException if len <= 0
@see #getAbbreviatedName(String, int)
@s... | [
"<p",
">",
"Gets",
"the",
"abbreviated",
"name",
"of",
"a",
"{",
"@code",
"Class",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L416-L421 |
NessComputing/components-ness-jmx | src/main/java/com/nesscomputing/jmx/starter/JmxExporterConfig.java | JmxExporterConfig.defaultJmxExporterConfig | public static JmxExporterConfig defaultJmxExporterConfig(final InetAddress hostname, final Integer rmiRegistryPort, final Integer rmiServerPort, final boolean useRandomIds)
throws IOException {
"""
Creates a default configuration object.
@param hostname The hostname to use. If null, the localhost is use... | java | public static JmxExporterConfig defaultJmxExporterConfig(final InetAddress hostname, final Integer rmiRegistryPort, final Integer rmiServerPort, final boolean useRandomIds)
throws IOException
{
return new JmxExporterConfig(
(hostname != null) ? hostname : InetAddress.getByName(null),
... | [
"public",
"static",
"JmxExporterConfig",
"defaultJmxExporterConfig",
"(",
"final",
"InetAddress",
"hostname",
",",
"final",
"Integer",
"rmiRegistryPort",
",",
"final",
"Integer",
"rmiServerPort",
",",
"final",
"boolean",
"useRandomIds",
")",
"throws",
"IOException",
"{"... | Creates a default configuration object.
@param hostname The hostname to use. If null, the localhost is used.
@param rmiRegistryPort The port for the JMX registry. This is where remote clients will connect to the MBean server.
@param rmiServerPort The port for the JMX Server. If null, a random port is used.
@param useR... | [
"Creates",
"a",
"default",
"configuration",
"object",
"."
] | train | https://github.com/NessComputing/components-ness-jmx/blob/694e0f117e1579019df835528a150257b57330b4/src/main/java/com/nesscomputing/jmx/starter/JmxExporterConfig.java#L43-L51 |
OpenTSDB/opentsdb | src/meta/TSUIDQuery.java | TSUIDQuery.resolveNames | private Deferred<IncomingDataPoint> resolveNames(final IncomingDataPoint dp) {
"""
Resolve the UIDs to names. If the query was for a metric and tags then we
can just use those.
@param dp The data point to fill in values for
@return A deferred with the data point or an exception if something went
wrong.
"""... | java | private Deferred<IncomingDataPoint> resolveNames(final IncomingDataPoint dp) {
// If the caller gave us a metric and tags, save some time by NOT hitting
// our UID tables or storage.
if (metric != null) {
dp.setMetric(metric);
dp.setTags((HashMap<String, String>)tags);
return Deferred.from... | [
"private",
"Deferred",
"<",
"IncomingDataPoint",
">",
"resolveNames",
"(",
"final",
"IncomingDataPoint",
"dp",
")",
"{",
"// If the caller gave us a metric and tags, save some time by NOT hitting",
"// our UID tables or storage.",
"if",
"(",
"metric",
"!=",
"null",
")",
"{",
... | Resolve the UIDs to names. If the query was for a metric and tags then we
can just use those.
@param dp The data point to fill in values for
@return A deferred with the data point or an exception if something went
wrong. | [
"Resolve",
"the",
"UIDs",
"to",
"names",
".",
"If",
"the",
"query",
"was",
"for",
"a",
"metric",
"and",
"tags",
"then",
"we",
"can",
"just",
"use",
"those",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/TSUIDQuery.java#L566-L603 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerConnectionPoliciesInner.java | ServerConnectionPoliciesInner.createOrUpdateAsync | public Observable<ServerConnectionPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerConnectionType connectionType) {
"""
Creates or updates the server's connection policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this va... | java | public Observable<ServerConnectionPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerConnectionType connectionType) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, connectionType).map(new Func1<ServiceResponse<ServerConnectionPolicyInner>, ServerCo... | [
"public",
"Observable",
"<",
"ServerConnectionPolicyInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerConnectionType",
"connectionType",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resource... | Creates or updates the server's connection policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param connectionType The server connection type. Possible values... | [
"Creates",
"or",
"updates",
"the",
"server",
"s",
"connection",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerConnectionPoliciesInner.java#L105-L112 |
chocotan/datepicker4j | src/main/java/io/loli/datepicker/DatePicker.java | DatePicker.datePicker | public static void datePicker(JTextField field, String format,
DateFilter filter) {
"""
Add a date picker to a text field with date format
@param field
the text field you want to add to
@param format
date format string
@param filter
filter
"""
new DatePicker(field, format, filter);
... | java | public static void datePicker(JTextField field, String format,
DateFilter filter) {
new DatePicker(field, format, filter);
} | [
"public",
"static",
"void",
"datePicker",
"(",
"JTextField",
"field",
",",
"String",
"format",
",",
"DateFilter",
"filter",
")",
"{",
"new",
"DatePicker",
"(",
"field",
",",
"format",
",",
"filter",
")",
";",
"}"
] | Add a date picker to a text field with date format
@param field
the text field you want to add to
@param format
date format string
@param filter
filter | [
"Add",
"a",
"date",
"picker",
"to",
"a",
"text",
"field",
"with",
"date",
"format"
] | train | https://github.com/chocotan/datepicker4j/blob/d65d7a6b29f9efe77aeec2024dc31a38a7852676/src/main/java/io/loli/datepicker/DatePicker.java#L152-L155 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/auth/Auth.java | Auth.insertUser | public static void insertUser(String username, boolean isSuper) throws RequestExecutionException {
"""
Inserts the user into AUTH_KS.USERS_CF (or overwrites their superuser status as a result of an ALTER USER query).
@param username Username to insert.
@param isSuper User's new status.
@throws RequestExecutio... | java | public static void insertUser(String username, boolean isSuper) throws RequestExecutionException
{
QueryProcessor.process(String.format("INSERT INTO %s.%s (name, super) VALUES ('%s', %s)",
AUTH_KS,
USERS_CF,
... | [
"public",
"static",
"void",
"insertUser",
"(",
"String",
"username",
",",
"boolean",
"isSuper",
")",
"throws",
"RequestExecutionException",
"{",
"QueryProcessor",
".",
"process",
"(",
"String",
".",
"format",
"(",
"\"INSERT INTO %s.%s (name, super) VALUES ('%s', %s)\"",
... | Inserts the user into AUTH_KS.USERS_CF (or overwrites their superuser status as a result of an ALTER USER query).
@param username Username to insert.
@param isSuper User's new status.
@throws RequestExecutionException | [
"Inserts",
"the",
"user",
"into",
"AUTH_KS",
".",
"USERS_CF",
"(",
"or",
"overwrites",
"their",
"superuser",
"status",
"as",
"a",
"result",
"of",
"an",
"ALTER",
"USER",
"query",
")",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/Auth.java#L108-L116 |
alkacon/opencms-core | src/org/opencms/search/A_CmsSearchIndex.java | A_CmsSearchIndex.excludeFromIndex | public boolean excludeFromIndex(CmsObject cms, CmsResource resource) {
"""
Checks if the provided resource should be excluded from this search index.<p>
@param cms the OpenCms context used for building the search index
@param resource the resource to index
@return true if the resource should be excluded, fa... | java | public boolean excludeFromIndex(CmsObject cms, CmsResource resource) {
// check if this resource should be excluded from the index, if so skip it
boolean excludeFromIndex = false;
if (resource.isInternal()
|| resource.isFolder()
|| resource.isTemporaryFile()
... | [
"public",
"boolean",
"excludeFromIndex",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"{",
"// check if this resource should be excluded from the index, if so skip it",
"boolean",
"excludeFromIndex",
"=",
"false",
";",
"if",
"(",
"resource",
".",
"isInterna... | Checks if the provided resource should be excluded from this search index.<p>
@param cms the OpenCms context used for building the search index
@param resource the resource to index
@return true if the resource should be excluded, false if it should be included in this index | [
"Checks",
"if",
"the",
"provided",
"resource",
"should",
"be",
"excluded",
"from",
"this",
"search",
"index",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/A_CmsSearchIndex.java#L225-L265 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setText | public void setText(int index, String value) {
"""
Set a text value.
@param index text index (1-30)
@param value text value
"""
set(selectField(ResourceFieldLists.CUSTOM_TEXT, index), value);
} | java | public void setText(int index, String value)
{
set(selectField(ResourceFieldLists.CUSTOM_TEXT, index), value);
} | [
"public",
"void",
"setText",
"(",
"int",
"index",
",",
"String",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"CUSTOM_TEXT",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set a text value.
@param index text index (1-30)
@param value text value | [
"Set",
"a",
"text",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L1470-L1473 |
JOML-CI/JOML | src/org/joml/Vector2f.java | Vector2f.setComponent | public Vector2f setComponent(int component, float value) throws IllegalArgumentException {
"""
Set the value of the specified component of this vector.
@param component
the component whose value to set, within <code>[0..1]</code>
@param value
the value to set
@return this
@throws IllegalArgumentException i... | java | public Vector2f setComponent(int component, float value) throws IllegalArgumentException {
switch (component) {
case 0:
x = value;
break;
case 1:
y = value;
break;
default:
throw new IllegalArgume... | [
"public",
"Vector2f",
"setComponent",
"(",
"int",
"component",
",",
"float",
"value",
")",
"throws",
"IllegalArgumentException",
"{",
"switch",
"(",
"component",
")",
"{",
"case",
"0",
":",
"x",
"=",
"value",
";",
"break",
";",
"case",
"1",
":",
"y",
"="... | Set the value of the specified component of this vector.
@param component
the component whose value to set, within <code>[0..1]</code>
@param value
the value to set
@return this
@throws IllegalArgumentException if <code>component</code> is not within <code>[0..1]</code> | [
"Set",
"the",
"value",
"of",
"the",
"specified",
"component",
"of",
"this",
"vector",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector2f.java#L380-L392 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/http/GitlabHTTPRequestor.java | GitlabHTTPRequestor.authenticate | public GitlabHTTPRequestor authenticate(String token, TokenType type, AuthMethod method) {
"""
Sets authentication data for the request.
Has a fluent api for method chaining.
@param token The token value
@param type The type of the token
@param method The authentication method
@return this
"""
... | java | public GitlabHTTPRequestor authenticate(String token, TokenType type, AuthMethod method) {
this.apiToken = token;
this.tokenType = type;
this.authMethod = method;
return this;
} | [
"public",
"GitlabHTTPRequestor",
"authenticate",
"(",
"String",
"token",
",",
"TokenType",
"type",
",",
"AuthMethod",
"method",
")",
"{",
"this",
".",
"apiToken",
"=",
"token",
";",
"this",
".",
"tokenType",
"=",
"type",
";",
"this",
".",
"authMethod",
"=",
... | Sets authentication data for the request.
Has a fluent api for method chaining.
@param token The token value
@param type The type of the token
@param method The authentication method
@return this | [
"Sets",
"authentication",
"data",
"for",
"the",
"request",
".",
"Has",
"a",
"fluent",
"api",
"for",
"method",
"chaining",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/http/GitlabHTTPRequestor.java#L66-L71 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/CFFFontSubset.java | CFFFontSubset.CreateNonCIDSubrs | void CreateNonCIDSubrs(int Font,IndexBaseItem PrivateBase,OffsetItem Subrs) {
"""
the function marks the beginning of the subrs index and adds the subsetted subrs
index to the output list.
@param Font the font
@param PrivateBase IndexBaseItem for the private that's referencing to the subrs
@param Subrs OffsetI... | java | void CreateNonCIDSubrs(int Font,IndexBaseItem PrivateBase,OffsetItem Subrs)
{
// Mark the beginning of the Subrs index
OutputList.addLast(new SubrMarkerItem(Subrs,PrivateBase));
// Put the subsetted new subrs index
OutputList.addLast(new RangeItem(new RandomAccessFileOrArray(NewSubrsIndexNonCID),0,NewSubrsInde... | [
"void",
"CreateNonCIDSubrs",
"(",
"int",
"Font",
",",
"IndexBaseItem",
"PrivateBase",
",",
"OffsetItem",
"Subrs",
")",
"{",
"// Mark the beginning of the Subrs index",
"OutputList",
".",
"addLast",
"(",
"new",
"SubrMarkerItem",
"(",
"Subrs",
",",
"PrivateBase",
")",
... | the function marks the beginning of the subrs index and adds the subsetted subrs
index to the output list.
@param Font the font
@param PrivateBase IndexBaseItem for the private that's referencing to the subrs
@param Subrs OffsetItem for the subrs | [
"the",
"function",
"marks",
"the",
"beginning",
"of",
"the",
"subrs",
"index",
"and",
"adds",
"the",
"subsetted",
"subrs",
"index",
"to",
"the",
"output",
"list",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/CFFFontSubset.java#L1639-L1645 |
konmik/solid | streams/src/main/java/solid/stream/Stream.java | Stream.groupBy | public <K> Stream<Grouped<K, T>> groupBy(final Func1<? super T, ? extends K> groupSelector) {
"""
Returns a new stream of {@link Grouped} that is composed from keys that has been
extracted from each source stream item.
@param groupSelector a function that extracts a key from a given item.
@param <K> ... | java | public <K> Stream<Grouped<K, T>> groupBy(final Func1<? super T, ? extends K> groupSelector) {
return groupBy(groupSelector, new Func1<T, T>() {
@Override
public T call(T value) {
return value;
}
});
} | [
"public",
"<",
"K",
">",
"Stream",
"<",
"Grouped",
"<",
"K",
",",
"T",
">",
">",
"groupBy",
"(",
"final",
"Func1",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
"groupSelector",
")",
"{",
"return",
"groupBy",
"(",
"groupSelector",
",",
"ne... | Returns a new stream of {@link Grouped} that is composed from keys that has been
extracted from each source stream item.
@param groupSelector a function that extracts a key from a given item.
@param <K> a type of key value.
@return a new stream of {@link Grouped} that is grouped by a key extracted from each ... | [
"Returns",
"a",
"new",
"stream",
"of",
"{",
"@link",
"Grouped",
"}",
"that",
"is",
"composed",
"from",
"keys",
"that",
"has",
"been",
"extracted",
"from",
"each",
"source",
"stream",
"item",
"."
] | train | https://github.com/konmik/solid/blob/3d6c452ef3219fd843547f3590b3d2e1ad3f1d17/streams/src/main/java/solid/stream/Stream.java#L616-L623 |
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.updatePatternAnyEntityRoleAsync | public Observable<OperationStatus> updatePatternAnyEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePatternAnyEntityRoleOptionalParameter updatePatternAnyEntityRoleOptionalParameter) {
"""
Update an entity role for a given entity.
@param appId The application ID.
@param versionId... | java | public Observable<OperationStatus> updatePatternAnyEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePatternAnyEntityRoleOptionalParameter updatePatternAnyEntityRoleOptionalParameter) {
return updatePatternAnyEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId, up... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"updatePatternAnyEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
",",
"UpdatePatternAnyEntityRoleOptionalParameter",
"updatePatternAnyEntityRoleOptionalPar... | Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role ID.
@param updatePatternAnyEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws Illeg... | [
"Update",
"an",
"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#L12888-L12895 |
alkacon/opencms-core | src/org/opencms/ui/CmsUserIconHelper.java | CmsUserIconHelper.getBigIconPath | public String getBigIconPath(CmsObject cms, CmsUser user) {
"""
Returns the big ident-icon path for the given user.<p>
@param cms the cms context
@param user the user
@return the icon path
"""
return getIconPath(cms, user, IconSize.Big);
} | java | public String getBigIconPath(CmsObject cms, CmsUser user) {
return getIconPath(cms, user, IconSize.Big);
} | [
"public",
"String",
"getBigIconPath",
"(",
"CmsObject",
"cms",
",",
"CmsUser",
"user",
")",
"{",
"return",
"getIconPath",
"(",
"cms",
",",
"user",
",",
"IconSize",
".",
"Big",
")",
";",
"}"
] | Returns the big ident-icon path for the given user.<p>
@param cms the cms context
@param user the user
@return the icon path | [
"Returns",
"the",
"big",
"ident",
"-",
"icon",
"path",
"for",
"the",
"given",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsUserIconHelper.java#L218-L221 |
amazon-archives/aws-sdk-java-resources | aws-resources-core/src/main/java/com/amazonaws/resources/internal/ResourceImpl.java | ResourceImpl.getSubResource | public ResourceImpl getSubResource(String name, Object parameter) {
"""
Get a subresource of this resource by identifier, (optionally mapping
in other identifiers of this resource).
@param name the name of the subresource type
@param parameter the parameter for this request
@return the referenced subresource... | java | public ResourceImpl getSubResource(String name, Object parameter) {
SubResourceGetterModel getter =
resourceModel.getSubResourceGetter(name);
if (getter == null) {
throw new UnsupportedOperationException(
"No sub-resource named " + name);
}
... | [
"public",
"ResourceImpl",
"getSubResource",
"(",
"String",
"name",
",",
"Object",
"parameter",
")",
"{",
"SubResourceGetterModel",
"getter",
"=",
"resourceModel",
".",
"getSubResourceGetter",
"(",
"name",
")",
";",
"if",
"(",
"getter",
"==",
"null",
")",
"{",
... | Get a subresource of this resource by identifier, (optionally mapping
in other identifiers of this resource).
@param name the name of the subresource type
@param parameter the parameter for this request
@return the referenced subresource | [
"Get",
"a",
"subresource",
"of",
"this",
"resource",
"by",
"identifier",
"(",
"optionally",
"mapping",
"in",
"other",
"identifiers",
"of",
"this",
"resource",
")",
"."
] | train | https://github.com/amazon-archives/aws-sdk-java-resources/blob/0f4fef2615d9687997b70a36eed1d62dd42df035/aws-resources-core/src/main/java/com/amazonaws/resources/internal/ResourceImpl.java#L388-L420 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java | ApiOvhHostingprivateDatabase.serviceName_user_userName_grant_databaseName_GET | public OvhGrant serviceName_user_userName_grant_databaseName_GET(String serviceName, String userName, String databaseName) throws IOException {
"""
Get this object properties
REST: GET /hosting/privateDatabase/{serviceName}/user/{userName}/grant/{databaseName}
@param serviceName [required] The internal name of... | java | public OvhGrant serviceName_user_userName_grant_databaseName_GET(String serviceName, String userName, String databaseName) throws IOException {
String qPath = "/hosting/privateDatabase/{serviceName}/user/{userName}/grant/{databaseName}";
StringBuilder sb = path(qPath, serviceName, userName, databaseName);
String ... | [
"public",
"OvhGrant",
"serviceName_user_userName_grant_databaseName_GET",
"(",
"String",
"serviceName",
",",
"String",
"userName",
",",
"String",
"databaseName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/privateDatabase/{serviceName}/user/{userName}... | Get this object properties
REST: GET /hosting/privateDatabase/{serviceName}/user/{userName}/grant/{databaseName}
@param serviceName [required] The internal name of your private database
@param userName [required] User name used to connect to your databases
@param databaseName [required] Database name where grant is se... | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java#L246-L251 |
craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addDependency | protected void addDependency( final CharSequence name, final CharSequence version, final int flag) {
"""
Adds a dependency to the RPM package. This dependency version will be marked as the exact
requirement, and the package will require the named dependency with exactly this version at
install time.
@param na... | java | protected void addDependency( final CharSequence name, final CharSequence version, final int flag) {
requires.add(new Dependency(name.toString(), version.toString(), flag));
} | [
"protected",
"void",
"addDependency",
"(",
"final",
"CharSequence",
"name",
",",
"final",
"CharSequence",
"version",
",",
"final",
"int",
"flag",
")",
"{",
"requires",
".",
"add",
"(",
"new",
"Dependency",
"(",
"name",
".",
"toString",
"(",
")",
",",
"vers... | Adds a dependency to the RPM package. This dependency version will be marked as the exact
requirement, and the package will require the named dependency with exactly this version at
install time.
@param name the name of the dependency.
@param version the version identifier.
@param flag the file flags | [
"Adds",
"a",
"dependency",
"to",
"the",
"RPM",
"package",
".",
"This",
"dependency",
"version",
"will",
"be",
"marked",
"as",
"the",
"exact",
"requirement",
"and",
"the",
"package",
"will",
"require",
"the",
"named",
"dependency",
"with",
"exactly",
"this",
... | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L210-L212 |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/Log.java | Log.wtf | public static int wtf(String tag, String msg) {
"""
What a Terrible Failure: Report a condition that should never happen. The
error will always be logged at level Constants.ASSERT despite the logging is
disabled. Depending on system configuration, and on Android 2.2+, a
report may be added to the DropBoxManager... | java | public static int wtf(String tag, String msg) {
collectLogEntry(Constants.ASSERT, tag, msg, null);
if (isLoggable(tag, Constants.ASSERT)) {
if (useWTF) {
try {
return (Integer) wtfTagMessageMethod.invoke(null,
new Object[] { tag... | [
"public",
"static",
"int",
"wtf",
"(",
"String",
"tag",
",",
"String",
"msg",
")",
"{",
"collectLogEntry",
"(",
"Constants",
".",
"ASSERT",
",",
"tag",
",",
"msg",
",",
"null",
")",
";",
"if",
"(",
"isLoggable",
"(",
"tag",
",",
"Constants",
".",
"AS... | What a Terrible Failure: Report a condition that should never happen. The
error will always be logged at level Constants.ASSERT despite the logging is
disabled. Depending on system configuration, and on Android 2.2+, a
report may be added to the DropBoxManager and/or the process may be
terminated immediately with an er... | [
"What",
"a",
"Terrible",
"Failure",
":",
"Report",
"a",
"condition",
"that",
"should",
"never",
"happen",
".",
"The",
"error",
"will",
"always",
"be",
"logged",
"at",
"level",
"Constants",
".",
"ASSERT",
"despite",
"the",
"logging",
"is",
"disabled",
".",
... | train | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/Log.java#L976-L991 |
EsotericSoftware/kryo | src/com/esotericsoftware/kryo/util/IdentityObjectIntMap.java | IdentityObjectIntMap.getAndIncrement | public int getAndIncrement (K key, int defaultValue, int increment) {
"""
Returns the key's current value and increments the stored value. If the key is not in the map, defaultValue + increment is
put into the map.
"""
int hashCode = System.identityHashCode(key);
int index = hashCode & mask;
if (key ... | java | public int getAndIncrement (K key, int defaultValue, int increment) {
int hashCode = System.identityHashCode(key);
int index = hashCode & mask;
if (key != keyTable[index]) {
index = hash2(hashCode);
if (key != keyTable[index]) {
index = hash3(hashCode);
if (key != keyTable[index]) {
if ... | [
"public",
"int",
"getAndIncrement",
"(",
"K",
"key",
",",
"int",
"defaultValue",
",",
"int",
"increment",
")",
"{",
"int",
"hashCode",
"=",
"System",
".",
"identityHashCode",
"(",
"key",
")",
";",
"int",
"index",
"=",
"hashCode",
"&",
"mask",
";",
"if",
... | Returns the key's current value and increments the stored value. If the key is not in the map, defaultValue + increment is
put into the map. | [
"Returns",
"the",
"key",
"s",
"current",
"value",
"and",
"increments",
"the",
"stored",
"value",
".",
"If",
"the",
"key",
"is",
"not",
"in",
"the",
"map",
"defaultValue",
"+",
"increment",
"is",
"put",
"into",
"the",
"map",
"."
] | train | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/util/IdentityObjectIntMap.java#L345-L365 |
JOML-CI/JOML | src/org/joml/Quaternionf.java | Quaternionf.lookAlong | public Quaternionf lookAlong(Vector3fc dir, Vector3fc up) {
"""
Apply a rotation to this quaternion that maps the given direction to the positive Z axis.
<p>
Because there are multiple possibilities for such a rotation, this method will choose the one that ensures the given up direction to remain
parallel to th... | java | public Quaternionf lookAlong(Vector3fc dir, Vector3fc up) {
return lookAlong(dir.x(), dir.y(), dir.z(), up.x(), up.y(), up.z(), this);
} | [
"public",
"Quaternionf",
"lookAlong",
"(",
"Vector3fc",
"dir",
",",
"Vector3fc",
"up",
")",
"{",
"return",
"lookAlong",
"(",
"dir",
".",
"x",
"(",
")",
",",
"dir",
".",
"y",
"(",
")",
",",
"dir",
".",
"z",
"(",
")",
",",
"up",
".",
"x",
"(",
")... | Apply a rotation to this quaternion that maps the given direction to the positive Z axis.
<p>
Because there are multiple possibilities for such a rotation, this method will choose the one that ensures the given up direction to remain
parallel to the plane spanned by the <code>up</code> and <code>dir</code> vectors.
<p>... | [
"Apply",
"a",
"rotation",
"to",
"this",
"quaternion",
"that",
"maps",
"the",
"given",
"direction",
"to",
"the",
"positive",
"Z",
"axis",
".",
"<p",
">",
"Because",
"there",
"are",
"multiple",
"possibilities",
"for",
"such",
"a",
"rotation",
"this",
"method",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaternionf.java#L2091-L2093 |
gfk-ba/senbot | SenBotRunner/src/main/java/com/gfk/senbot/framework/services/selenium/ElementService.java | ElementService.dragElementTo | public void dragElementTo(By draggable, By droppable) throws InterruptedException {
"""
Drags an element some place else
@param draggable
The element to drag
@param droppable
The drop aim
@throws InterruptedException
"""
WebDriver driver = getWebDriver();
Actions clickAndDrag = new Actions(getWebDr... | java | public void dragElementTo(By draggable, By droppable) throws InterruptedException {
WebDriver driver = getWebDriver();
Actions clickAndDrag = new Actions(getWebDriver());
clickAndDrag.dragAndDrop(driver.findElement(draggable), driver.findElement(droppable));
clickAndDrag.perform();
} | [
"public",
"void",
"dragElementTo",
"(",
"By",
"draggable",
",",
"By",
"droppable",
")",
"throws",
"InterruptedException",
"{",
"WebDriver",
"driver",
"=",
"getWebDriver",
"(",
")",
";",
"Actions",
"clickAndDrag",
"=",
"new",
"Actions",
"(",
"getWebDriver",
"(",
... | Drags an element some place else
@param draggable
The element to drag
@param droppable
The drop aim
@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#L332-L338 |
klarna/HiveRunner | src/main/java/com/klarna/hiverunner/data/InsertIntoTable.java | InsertIntoTable.newInstance | public static InsertIntoTable newInstance(String databaseName, String tableName, HiveConf conf) {
"""
Factory method for creating an {@link InsertIntoTable}.
<p>
This method is intended to be called via {@link HiveShell#insertInto(String, String)}.
</p>
@param databaseName The database name.
@param tableNam... | java | public static InsertIntoTable newInstance(String databaseName, String tableName, HiveConf conf) {
TableDataBuilder builder = new TableDataBuilder(getHCatTable(databaseName, tableName, conf));
TableDataInserter inserter = new TableDataInserter(databaseName, tableName, conf);
return new InsertIntoTable(builde... | [
"public",
"static",
"InsertIntoTable",
"newInstance",
"(",
"String",
"databaseName",
",",
"String",
"tableName",
",",
"HiveConf",
"conf",
")",
"{",
"TableDataBuilder",
"builder",
"=",
"new",
"TableDataBuilder",
"(",
"getHCatTable",
"(",
"databaseName",
",",
"tableNa... | Factory method for creating an {@link InsertIntoTable}.
<p>
This method is intended to be called via {@link HiveShell#insertInto(String, String)}.
</p>
@param databaseName The database name.
@param tableName The table name.
@param conf The {@link HiveConf}.
@return InsertIntoTable | [
"Factory",
"method",
"for",
"creating",
"an",
"{",
"@link",
"InsertIntoTable",
"}",
".",
"<p",
">",
"This",
"method",
"is",
"intended",
"to",
"be",
"called",
"via",
"{",
"@link",
"HiveShell#insertInto",
"(",
"String",
"String",
")",
"}",
".",
"<",
"/",
"... | train | https://github.com/klarna/HiveRunner/blob/c8899237db6122127f16e3d8a740c1f8657c2ae3/src/main/java/com/klarna/hiverunner/data/InsertIntoTable.java#L46-L50 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/CounterAspect.java | CounterAspect.countByParameter | @Around(value = "execution(* *(..)) && (@annotation(annotation))")
public Object countByParameter(ProceedingJoinPoint pjp, CountByParameter annotation) throws Throwable {
"""
Pointcut definition for @CountByParameter annotation.
@param pjp ProceedingJoinPoint.
@param annotation @CountByParameter annotation.
@r... | java | @Around(value = "execution(* *(..)) && (@annotation(annotation))")
public Object countByParameter(ProceedingJoinPoint pjp, CountByParameter annotation) throws Throwable {
return countByParameter(pjp, annotation.producerId(), annotation.subsystem(), annotation.category());
} | [
"@",
"Around",
"(",
"value",
"=",
"\"execution(* *(..)) && (@annotation(annotation))\"",
")",
"public",
"Object",
"countByParameter",
"(",
"ProceedingJoinPoint",
"pjp",
",",
"CountByParameter",
"annotation",
")",
"throws",
"Throwable",
"{",
"return",
"countByParameter",
"... | Pointcut definition for @CountByParameter annotation.
@param pjp ProceedingJoinPoint.
@param annotation @CountByParameter annotation.
@return
@throws Throwable | [
"Pointcut",
"definition",
"for"
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/CounterAspect.java#L43-L46 |
flow/commons | src/main/java/com/flowpowered/commons/map/impl/TTripleInt21ObjectHashMap.java | TTripleInt21ObjectHashMap.containsKey | @Override
public boolean containsKey(int x, int y, int z) {
"""
Returns true if this map contains a mapping for the specified key. More formally, returns <code>true</code> if and only if this map contains a mapping for a key <code>k</code> such that
<code>key.equals(k)</code>. (There can be at most one such m... | java | @Override
public boolean containsKey(int x, int y, int z) {
long key = Int21TripleHashed.key(x, y, z);
return map.containsKey(key);
} | [
"@",
"Override",
"public",
"boolean",
"containsKey",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"z",
")",
"{",
"long",
"key",
"=",
"Int21TripleHashed",
".",
"key",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
"return",
"map",
".",
"containsKey",
"(",... | Returns true if this map contains a mapping for the specified key. More formally, returns <code>true</code> if and only if this map contains a mapping for a key <code>k</code> such that
<code>key.equals(k)</code>. (There can be at most one such mapping.)
@param x an <code>int</code> value
@param y an <code>int</code> ... | [
"Returns",
"true",
"if",
"this",
"map",
"contains",
"a",
"mapping",
"for",
"the",
"specified",
"key",
".",
"More",
"formally",
"returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"and",
"only",
"if",
"this",
"map",
"contains",
"a",
"mapping",
"for"... | train | https://github.com/flow/commons/blob/0690efdac06fd728fcd7e9cf10f2b1319379c45b/src/main/java/com/flowpowered/commons/map/impl/TTripleInt21ObjectHashMap.java#L120-L124 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/trustmanager/X509ProxyCertPathValidator.java | X509ProxyCertPathValidator.checkCertificate | private void checkCertificate(X509Certificate cert, GSIConstants.CertificateType certType)
throws CertPathValidatorException {
"""
/*
Method to check following for any given certificate
a) Date validity, is it valid for the curent time (see DateValidityChecker)
b) Any unsupported critical extensio... | java | private void checkCertificate(X509Certificate cert, GSIConstants.CertificateType certType)
throws CertPathValidatorException {
for (CertificateChecker checker : getCertificateCheckers()) {
checker.invoke(cert, certType);
}
} | [
"private",
"void",
"checkCertificate",
"(",
"X509Certificate",
"cert",
",",
"GSIConstants",
".",
"CertificateType",
"certType",
")",
"throws",
"CertPathValidatorException",
"{",
"for",
"(",
"CertificateChecker",
"checker",
":",
"getCertificateCheckers",
"(",
")",
")",
... | /*
Method to check following for any given certificate
a) Date validity, is it valid for the curent time (see DateValidityChecker)
b) Any unsupported critical extensions (see UnsupportedCriticalExtensionChecker)
c) Identity of certificate (see IdentityChecker)
d) Revocation (see CRLChecker)
e) Signing policy (see Sign... | [
"/",
"*",
"Method",
"to",
"check",
"following",
"for",
"any",
"given",
"certificate"
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/X509ProxyCertPathValidator.java#L479-L484 |
structr/structr | structr-ui/src/main/java/org/structr/web/common/FileHelper.java | FileHelper.decodeAndSetFileData | public static void decodeAndSetFileData(final File file, final String rawData) throws FrameworkException, IOException {
"""
Decodes base64-encoded raw data into binary data and writes it to the
given file.
@param file
@param rawData
@throws FrameworkException
@throws IOException
"""
Base64URIData uri... | java | public static void decodeAndSetFileData(final File file, final String rawData) throws FrameworkException, IOException {
Base64URIData uriData = new Base64URIData(rawData);
setFileData(file, uriData.getBinaryData(), uriData.getContentType(), true);
} | [
"public",
"static",
"void",
"decodeAndSetFileData",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"rawData",
")",
"throws",
"FrameworkException",
",",
"IOException",
"{",
"Base64URIData",
"uriData",
"=",
"new",
"Base64URIData",
"(",
"rawData",
")",
";",
... | Decodes base64-encoded raw data into binary data and writes it to the
given file.
@param file
@param rawData
@throws FrameworkException
@throws IOException | [
"Decodes",
"base64",
"-",
"encoded",
"raw",
"data",
"into",
"binary",
"data",
"and",
"writes",
"it",
"to",
"the",
"given",
"file",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L255-L259 |
landawn/AbacusUtil | src/com/landawn/abacus/util/AnyDelete.java | AnyDelete.addFamily | public AnyDelete addFamily(String family, long timestamp) {
"""
Delete all columns of the specified family with a timestamp less than
or equal to the specified timestamp.
<p>
Overrides previous calls to deleteColumn and deleteColumns for the
specified family.
@param family
@param timestamp
@return
"""... | java | public AnyDelete addFamily(String family, long timestamp) {
delete.addFamily(toFamilyQualifierBytes(family), timestamp);
return this;
} | [
"public",
"AnyDelete",
"addFamily",
"(",
"String",
"family",
",",
"long",
"timestamp",
")",
"{",
"delete",
".",
"addFamily",
"(",
"toFamilyQualifierBytes",
"(",
"family",
")",
",",
"timestamp",
")",
";",
"return",
"this",
";",
"}"
] | Delete all columns of the specified family with a timestamp less than
or equal to the specified timestamp.
<p>
Overrides previous calls to deleteColumn and deleteColumns for the
specified family.
@param family
@param timestamp
@return | [
"Delete",
"all",
"columns",
"of",
"the",
"specified",
"family",
"with",
"a",
"timestamp",
"less",
"than",
"or",
"equal",
"to",
"the",
"specified",
"timestamp",
".",
"<p",
">",
"Overrides",
"previous",
"calls",
"to",
"deleteColumn",
"and",
"deleteColumns",
"for... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/AnyDelete.java#L107-L111 |
xerial/snappy-java | src/main/java/org/xerial/snappy/SnappyInputStream.java | SnappyInputStream.rawRead | public int rawRead(Object array, int byteOffset, int byteLength)
throws IOException {
"""
Read uncompressed data into the specified array
@param array
@param byteOffset
@param byteLength
@return written bytes
@throws IOException
"""
int writtenBytes = 0;
for (; writtenBytes <... | java | public int rawRead(Object array, int byteOffset, int byteLength)
throws IOException
{
int writtenBytes = 0;
for (; writtenBytes < byteLength; ) {
if (uncompressedCursor >= uncompressedLimit) {
if (hasNextChunk()) {
continue;
... | [
"public",
"int",
"rawRead",
"(",
"Object",
"array",
",",
"int",
"byteOffset",
",",
"int",
"byteLength",
")",
"throws",
"IOException",
"{",
"int",
"writtenBytes",
"=",
"0",
";",
"for",
"(",
";",
"writtenBytes",
"<",
"byteLength",
";",
")",
"{",
"if",
"(",... | Read uncompressed data into the specified array
@param array
@param byteOffset
@param byteLength
@return written bytes
@throws IOException | [
"Read",
"uncompressed",
"data",
"into",
"the",
"specified",
"array"
] | train | https://github.com/xerial/snappy-java/blob/9df6ed7bbce88186c82f2e7cdcb7b974421b3340/src/main/java/org/xerial/snappy/SnappyInputStream.java#L192-L213 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java | InsertAllRequest.newBuilder | public static Builder newBuilder(String datasetId, String tableId) {
"""
Returns a builder for an {@code InsertAllRequest} object given the destination table.
"""
return new Builder().setTable(TableId.of(datasetId, tableId));
} | java | public static Builder newBuilder(String datasetId, String tableId) {
return new Builder().setTable(TableId.of(datasetId, tableId));
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"String",
"datasetId",
",",
"String",
"tableId",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"setTable",
"(",
"TableId",
".",
"of",
"(",
"datasetId",
",",
"tableId",
")",
")",
";",
"}"
] | Returns a builder for an {@code InsertAllRequest} object given the destination table. | [
"Returns",
"a",
"builder",
"for",
"an",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java#L356-L358 |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/epanet/core/EpanetWrapper.java | EpanetWrapper.ENsetnodevalue | public void ENsetnodevalue( int index, NodeParameters nodeParameter, float value ) throws EpanetException {
"""
Sets the value of a parameter for a specific node.
@param index node index.
@param paramcode parameter code.
@param value parameter value.
@throws EpanetException
"""
int errcode = epan... | java | public void ENsetnodevalue( int index, NodeParameters nodeParameter, float value ) throws EpanetException {
int errcode = epanet.ENsetnodevalue(index, nodeParameter.getCode(), value);
checkError(errcode);
} | [
"public",
"void",
"ENsetnodevalue",
"(",
"int",
"index",
",",
"NodeParameters",
"nodeParameter",
",",
"float",
"value",
")",
"throws",
"EpanetException",
"{",
"int",
"errcode",
"=",
"epanet",
".",
"ENsetnodevalue",
"(",
"index",
",",
"nodeParameter",
".",
"getCo... | Sets the value of a parameter for a specific node.
@param index node index.
@param paramcode parameter code.
@param value parameter value.
@throws EpanetException | [
"Sets",
"the",
"value",
"of",
"a",
"parameter",
"for",
"a",
"specific",
"node",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/epanet/core/EpanetWrapper.java#L610-L613 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/cache/tile/VectorTile.java | VectorTile.apply | public void apply(final String filter, final TileFunction<VectorTile> callback) {
"""
Execute a TileFunction on this tile. If the tile is not yet loaded, attach it to the isLoaded event.
@param filter filter which needs to be applied when fetching
@param callback callback to call
"""
switch (getStatus())... | java | public void apply(final String filter, final TileFunction<VectorTile> callback) {
switch (getStatus()) {
case EMPTY:
fetch(filter, callback);
break;
case LOADING:
if (needsReload(filter)) {
deferred.cancel();
fetch(filter, callback);
} else {
final VectorTile self = this;
def... | [
"public",
"void",
"apply",
"(",
"final",
"String",
"filter",
",",
"final",
"TileFunction",
"<",
"VectorTile",
">",
"callback",
")",
"{",
"switch",
"(",
"getStatus",
"(",
")",
")",
"{",
"case",
"EMPTY",
":",
"fetch",
"(",
"filter",
",",
"callback",
")",
... | Execute a TileFunction on this tile. If the tile is not yet loaded, attach it to the isLoaded event.
@param filter filter which needs to be applied when fetching
@param callback callback to call | [
"Execute",
"a",
"TileFunction",
"on",
"this",
"tile",
".",
"If",
"the",
"tile",
"is",
"not",
"yet",
"loaded",
"attach",
"it",
"to",
"the",
"isLoaded",
"event",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/cache/tile/VectorTile.java#L149-L179 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobTargetExecutionsInner.java | JobTargetExecutionsInner.listByStepAsync | public Observable<Page<JobExecutionInner>> listByStepAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final UUID jobExecutionId, final String stepName) {
"""
Lists the target executions of a job step execution.
@param resourceGroupName The name of t... | java | public Observable<Page<JobExecutionInner>> listByStepAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final UUID jobExecutionId, final String stepName) {
return listByStepWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, jobName,... | [
"public",
"Observable",
"<",
"Page",
"<",
"JobExecutionInner",
">",
">",
"listByStepAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"jobAgentName",
",",
"final",
"String",
"jobName",
",",
"final",
... | Lists the target executions of a job step execution.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent.
@param jobName T... | [
"Lists",
"the",
"target",
"executions",
"of",
"a",
"job",
"step",
"execution",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobTargetExecutionsInner.java#L474-L482 |
fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/SubjectMappingUtil.java | SubjectMappingUtil.mapSubject | public static Triple mapSubject(final Triple t, final String resourceUri, final Node destinationNode) {
"""
Maps the subject of t from resourceUri to destinationNode to produce a new Triple.
If the triple does not have the subject resourceUri, then the triple is unchanged.
@param t triple to be remapped.
@par... | java | public static Triple mapSubject(final Triple t, final String resourceUri, final Node destinationNode) {
final Node tripleSubj = t.getSubject();
final String tripleSubjUri = tripleSubj.getURI();
final Node subject;
if (tripleSubjUri.equals(resourceUri)) {
subject = destination... | [
"public",
"static",
"Triple",
"mapSubject",
"(",
"final",
"Triple",
"t",
",",
"final",
"String",
"resourceUri",
",",
"final",
"Node",
"destinationNode",
")",
"{",
"final",
"Node",
"tripleSubj",
"=",
"t",
".",
"getSubject",
"(",
")",
";",
"final",
"String",
... | Maps the subject of t from resourceUri to destinationNode to produce a new Triple.
If the triple does not have the subject resourceUri, then the triple is unchanged.
@param t triple to be remapped.
@param resourceUri resource subject uri to be remapped.
@param destinationNode subject node for the resultant triple.
@re... | [
"Maps",
"the",
"subject",
"of",
"t",
"from",
"resourceUri",
"to",
"destinationNode",
"to",
"produce",
"a",
"new",
"Triple",
".",
"If",
"the",
"triple",
"does",
"not",
"have",
"the",
"subject",
"resourceUri",
"then",
"the",
"triple",
"is",
"unchanged",
"."
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/SubjectMappingUtil.java#L59-L74 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java | Bytes.padHead | public static byte [] padHead(final byte [] a, final int length) {
"""
Return a byte array with value in <code>a</code> plus <code>length</code> prepended 0 bytes.
@param a array
@param length new array size
@return Value in <code>a</code> plus <code>length</code> prepended 0 bytes
"""
byte [] padding =... | java | public static byte [] padHead(final byte [] a, final int length) {
byte [] padding = new byte[length];
for (int i = 0; i < length; i++) {
padding[i] = 0;
}
return add(padding, a);
} | [
"public",
"static",
"byte",
"[",
"]",
"padHead",
"(",
"final",
"byte",
"[",
"]",
"a",
",",
"final",
"int",
"length",
")",
"{",
"byte",
"[",
"]",
"padding",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",... | Return a byte array with value in <code>a</code> plus <code>length</code> prepended 0 bytes.
@param a array
@param length new array size
@return Value in <code>a</code> plus <code>length</code> prepended 0 bytes | [
"Return",
"a",
"byte",
"array",
"with",
"value",
"in",
"<code",
">",
"a<",
"/",
"code",
">",
"plus",
"<code",
">",
"length<",
"/",
"code",
">",
"prepended",
"0",
"bytes",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java#L1064-L1070 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java | Request.mandatoryParamAsInt | public int mandatoryParamAsInt(String key) {
"""
Returns an int value. To be used when parameter is required or has a default value.
@throws java.lang.IllegalArgumentException is value is null or blank
"""
String s = mandatoryParam(key);
return parseInt(key, s);
} | java | public int mandatoryParamAsInt(String key) {
String s = mandatoryParam(key);
return parseInt(key, s);
} | [
"public",
"int",
"mandatoryParamAsInt",
"(",
"String",
"key",
")",
"{",
"String",
"s",
"=",
"mandatoryParam",
"(",
"key",
")",
";",
"return",
"parseInt",
"(",
"key",
",",
"s",
")",
";",
"}"
] | Returns an int value. To be used when parameter is required or has a default value.
@throws java.lang.IllegalArgumentException is value is null or blank | [
"Returns",
"an",
"int",
"value",
".",
"To",
"be",
"used",
"when",
"parameter",
"is",
"required",
"or",
"has",
"a",
"default",
"value",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java#L99-L102 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/write/WriteFileExtensions.java | WriteFileExtensions.string2File | public static boolean string2File(final File file, final String string2write,
final String encoding) throws FileNotFoundException, IOException {
"""
The Method string2File(File, String) writes the String to the File.
@param file
The File to write the String.
@param string2write
The String to write into the... | java | public static boolean string2File(final File file, final String string2write,
final String encoding) throws FileNotFoundException, IOException
{
return writeStringToFile(file, string2write, encoding);
} | [
"public",
"static",
"boolean",
"string2File",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"string2write",
",",
"final",
"String",
"encoding",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"writeStringToFile",
"(",
"file",
","... | The Method string2File(File, String) writes the String to the File.
@param file
The File to write the String.
@param string2write
The String to write into the File.
@param encoding
the encoding
@return The Method return true if the String was write successfull to the file otherwise
false.
@throws FileNotFoundException... | [
"The",
"Method",
"string2File",
"(",
"File",
"String",
")",
"writes",
"the",
"String",
"to",
"the",
"File",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/write/WriteFileExtensions.java#L299-L303 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/cdi/util/BeanProvider.java | BeanProvider.getContextualReference | public static <T> T getContextualReference(BeanManager beanManager,
Class<T> type,
boolean optional,
Annotation... qualifiers) {
"""
{@link #getContextualReference(Class, Ann... | java | public static <T> T getContextualReference(BeanManager beanManager,
Class<T> type,
boolean optional,
Annotation... qualifiers)
{
Set<Bean<?>> beans = beanManager.getBe... | [
"public",
"static",
"<",
"T",
">",
"T",
"getContextualReference",
"(",
"BeanManager",
"beanManager",
",",
"Class",
"<",
"T",
">",
"type",
",",
"boolean",
"optional",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"Set",
"<",
"Bean",
"<",
"?",
">",
">"... | {@link #getContextualReference(Class, Annotation...)} which returns <code>null</code> if the
'optional' parameter is set to <code>true</code>.
This method is intended for usage where the BeanManger is known, e.g. in Extensions.
@param beanManager the BeanManager to use
@param type the type of the bean in question
@par... | [
"{",
"@link",
"#getContextualReference",
"(",
"Class",
"Annotation",
"...",
")",
"}",
"which",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"the",
"optional",
"parameter",
"is",
"set",
"to",
"<code",
">",
"true<",
"/",
"code",
">",
".",
"Thi... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/cdi/util/BeanProvider.java#L126-L145 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PrivateKeyReader.java | PrivateKeyReader.readPrivateKey | public static PrivateKey readPrivateKey(final File file) throws IOException,
NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException {
"""
Reads the given {@link File}( in *.der format) with the default RSA algorithm and returns the
{@link PrivateKey} object.
@param file
the file( in *.de... | java | public static PrivateKey readPrivateKey(final File file) throws IOException,
NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException
{
return readPrivateKey(file, KeyPairGeneratorAlgorithm.RSA.getAlgorithm());
} | [
"public",
"static",
"PrivateKey",
"readPrivateKey",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
",",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"NoSuchProviderException",
"{",
"return",
"readPrivateKey",
"(",
"file",
",",
"KeyPairGe... | Reads the given {@link File}( in *.der format) with the default RSA algorithm and returns the
{@link PrivateKey} object.
@param file
the file( in *.der format) that contains the private key
@return the {@link PrivateKey} object
@throws IOException
Signals that an I/O exception has occurred.
@throws NoSuchAlgorithmExc... | [
"Reads",
"the",
"given",
"{",
"@link",
"File",
"}",
"(",
"in",
"*",
".",
"der",
"format",
")",
"with",
"the",
"default",
"RSA",
"algorithm",
"and",
"returns",
"the",
"{",
"@link",
"PrivateKey",
"}",
"object",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PrivateKeyReader.java#L154-L158 |
pmwmedia/tinylog | tinylog-impl/src/main/java/org/tinylog/writers/JdbcWriter.java | JdbcWriter.renderSql | private static String renderSql(final Map<String, String> properties, final String quote) throws SQLException {
"""
Generates an insert SQL statement for the configured table and its fields.
@param properties
Properties that contains the configured table and fields
@param quote
Character for quoting identifi... | java | private static String renderSql(final Map<String, String> properties, final String quote) throws SQLException {
StringBuilder builder = new StringBuilder();
builder.append("INSERT INTO ");
append(builder, getTable(properties), quote);
builder.append(" (");
int count = 0;
for (Entry<String, String> entry :... | [
"private",
"static",
"String",
"renderSql",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
",",
"final",
"String",
"quote",
")",
"throws",
"SQLException",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"bu... | Generates an insert SQL statement for the configured table and its fields.
@param properties
Properties that contains the configured table and fields
@param quote
Character for quoting identifiers (can be a space if the database doesn't support quote characters)
@return SQL statement for {@link PreparedStatement}
@th... | [
"Generates",
"an",
"insert",
"SQL",
"statement",
"for",
"the",
"configured",
"table",
"and",
"its",
"fields",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-impl/src/main/java/org/tinylog/writers/JdbcWriter.java#L362-L396 |
threerings/nenya | core/src/main/java/com/threerings/media/AbstractMediaManager.java | AbstractMediaManager.queueNotification | public void queueNotification (ObserverList<Object> observers, ObserverOp<Object> event) {
"""
Queues the notification for dispatching after we've ticked all the media.
"""
_notify.add(new Tuple<ObserverList<Object>,ObserverOp<Object>>(observers, event));
} | java | public void queueNotification (ObserverList<Object> observers, ObserverOp<Object> event)
{
_notify.add(new Tuple<ObserverList<Object>,ObserverOp<Object>>(observers, event));
} | [
"public",
"void",
"queueNotification",
"(",
"ObserverList",
"<",
"Object",
">",
"observers",
",",
"ObserverOp",
"<",
"Object",
">",
"event",
")",
"{",
"_notify",
".",
"add",
"(",
"new",
"Tuple",
"<",
"ObserverList",
"<",
"Object",
">",
",",
"ObserverOp",
"... | Queues the notification for dispatching after we've ticked all the media. | [
"Queues",
"the",
"notification",
"for",
"dispatching",
"after",
"we",
"ve",
"ticked",
"all",
"the",
"media",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMediaManager.java#L266-L269 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/CcgParser.java | CcgParser.replaceLexicon | public CcgParser replaceLexicon(int index, CcgLexicon newLexicon) {
"""
Creates a new CCG parser by replacing a lexicon of
this parser with {@code newLexicon}.
@param index
@param newLexicon
@return
"""
List<CcgLexicon> newLexicons = Lists.newArrayList(lexicons);
newLexicons.set(index, newLexicon... | java | public CcgParser replaceLexicon(int index, CcgLexicon newLexicon) {
List<CcgLexicon> newLexicons = Lists.newArrayList(lexicons);
newLexicons.set(index, newLexicon);
return new CcgParser(newLexicons, lexiconScorers, wordSkipWordVar, wordSkipFactor,
dependencyHeadVar, dependencySyntaxVar, dependencyA... | [
"public",
"CcgParser",
"replaceLexicon",
"(",
"int",
"index",
",",
"CcgLexicon",
"newLexicon",
")",
"{",
"List",
"<",
"CcgLexicon",
">",
"newLexicons",
"=",
"Lists",
".",
"newArrayList",
"(",
"lexicons",
")",
";",
"newLexicons",
".",
"set",
"(",
"index",
","... | Creates a new CCG parser by replacing a lexicon of
this parser with {@code newLexicon}.
@param index
@param newLexicon
@return | [
"Creates",
"a",
"new",
"CCG",
"parser",
"by",
"replacing",
"a",
"lexicon",
"of",
"this",
"parser",
"with",
"{",
"@code",
"newLexicon",
"}",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParser.java#L403-L416 |
js-lib-com/commons | src/main/java/js/util/Types.java | Types.typeToClass | private static Class<?> typeToClass(Type t) {
"""
Cast Java reflective type to language class. If <code>type</code> is instance of {@link Class} just return it. If
is parameterized type returns the raw class.
@param t Java reflective type.
@return the class described by given <code>type</code>.
"""
i... | java | private static Class<?> typeToClass(Type t)
{
if(t instanceof Class<?>) {
return (Class<?>)t;
}
if(t instanceof ParameterizedType) {
return (Class<?>)((ParameterizedType)t).getRawType();
}
throw new BugError("Unknown type %s to convert to class.", t);
} | [
"private",
"static",
"Class",
"<",
"?",
">",
"typeToClass",
"(",
"Type",
"t",
")",
"{",
"if",
"(",
"t",
"instanceof",
"Class",
"<",
"?",
">",
")",
"{",
"return",
"(",
"Class",
"<",
"?",
">",
")",
"t",
";",
"}",
"if",
"(",
"t",
"instanceof",
"Pa... | Cast Java reflective type to language class. If <code>type</code> is instance of {@link Class} just return it. If
is parameterized type returns the raw class.
@param t Java reflective type.
@return the class described by given <code>type</code>. | [
"Cast",
"Java",
"reflective",
"type",
"to",
"language",
"class",
".",
"If",
"<code",
">",
"type<",
"/",
"code",
">",
"is",
"instance",
"of",
"{",
"@link",
"Class",
"}",
"just",
"return",
"it",
".",
"If",
"is",
"parameterized",
"type",
"returns",
"the",
... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Types.java#L627-L636 |
Asana/java-asana | src/main/java/com/asana/Client.java | Client.basicAuth | public static Client basicAuth(String apiKey, HttpTransport httpTransport) {
"""
WARNING: API Keys are deprecated and have been removed from Asana's API.
Prefer using {@link #accessToken(String, HttpTransport) accessToken method}.
@param apiKey Basic Auth API key
@param httpTransport HttpTransport implem... | java | public static Client basicAuth(String apiKey, HttpTransport httpTransport) {
return new Client(new BasicAuthDispatcher(apiKey, httpTransport));
} | [
"public",
"static",
"Client",
"basicAuth",
"(",
"String",
"apiKey",
",",
"HttpTransport",
"httpTransport",
")",
"{",
"return",
"new",
"Client",
"(",
"new",
"BasicAuthDispatcher",
"(",
"apiKey",
",",
"httpTransport",
")",
")",
";",
"}"
] | WARNING: API Keys are deprecated and have been removed from Asana's API.
Prefer using {@link #accessToken(String, HttpTransport) accessToken method}.
@param apiKey Basic Auth API key
@param httpTransport HttpTransport implementation to use for requests
@deprecated
@return Client instance | [
"WARNING",
":",
"API",
"Keys",
"are",
"deprecated",
"and",
"have",
"been",
"removed",
"from",
"Asana",
"s",
"API",
".",
"Prefer",
"using",
"{"
] | train | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/Client.java#L269-L271 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Validators.java | Validators.phoneNumber | public static Validator<CharSequence> phoneNumber(@NonNull final Context context) {
"""
Creates and returns a validator, which allows to validate texts to ensure, that they
represent valid phone numbers. Phone numbers, which are only consisting of numbers are
allowed as well as international phone numbers, e.g. ... | java | public static Validator<CharSequence> phoneNumber(@NonNull final Context context) {
return new PhoneNumberValidator(context, R.string.default_error_message);
} | [
"public",
"static",
"Validator",
"<",
"CharSequence",
">",
"phoneNumber",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
")",
"{",
"return",
"new",
"PhoneNumberValidator",
"(",
"context",
",",
"R",
".",
"string",
".",
"default_error_message",
")",
";",
"}... | Creates and returns a validator, which allows to validate texts to ensure, that they
represent valid phone numbers. Phone numbers, which are only consisting of numbers are
allowed as well as international phone numbers, e.g. +49 1624812382. Empty texts are also
accepted.
@param context
The context, which should be use... | [
"Creates",
"and",
"returns",
"a",
"validator",
"which",
"allows",
"to",
"validate",
"texts",
"to",
"ensure",
"that",
"they",
"represent",
"valid",
"phone",
"numbers",
".",
"Phone",
"numbers",
"which",
"are",
"only",
"consisting",
"of",
"numbers",
"are",
"allow... | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/Validators.java#L1153-L1155 |
betfair/cougar | cougar-codegen-plugin/src/main/java/com/betfair/cougar/codegen/IDLReader.java | IDLReader.mergeExtensionsIntoDocument | private void mergeExtensionsIntoDocument(Node target, Node extensions) throws Exception {
"""
Weave the extensions defined in the extensions doc into the target.
"""
final XPathFactory factory = XPathFactory.newInstance();
final NodeList nodes = (NodeList) factory.newXPath().evaluate("//extensi... | java | private void mergeExtensionsIntoDocument(Node target, Node extensions) throws Exception {
final XPathFactory factory = XPathFactory.newInstance();
final NodeList nodes = (NodeList) factory.newXPath().evaluate("//extensions", extensions, XPathConstants.NODESET);
for (int i = 0; i < nodes.getLengt... | [
"private",
"void",
"mergeExtensionsIntoDocument",
"(",
"Node",
"target",
",",
"Node",
"extensions",
")",
"throws",
"Exception",
"{",
"final",
"XPathFactory",
"factory",
"=",
"XPathFactory",
".",
"newInstance",
"(",
")",
";",
"final",
"NodeList",
"nodes",
"=",
"(... | Weave the extensions defined in the extensions doc into the target. | [
"Weave",
"the",
"extensions",
"defined",
"in",
"the",
"extensions",
"doc",
"into",
"the",
"target",
"."
] | train | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-codegen-plugin/src/main/java/com/betfair/cougar/codegen/IDLReader.java#L369-L385 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ObjectDataTypesInner.java | ObjectDataTypesInner.listFieldsByType | public List<TypeFieldInner> listFieldsByType(String resourceGroupName, String automationAccountName, String typeName) {
"""
Retrieve a list of fields of a given type across all accessible modules.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation ... | java | public List<TypeFieldInner> listFieldsByType(String resourceGroupName, String automationAccountName, String typeName) {
return listFieldsByTypeWithServiceResponseAsync(resourceGroupName, automationAccountName, typeName).toBlocking().single().body();
} | [
"public",
"List",
"<",
"TypeFieldInner",
">",
"listFieldsByType",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"typeName",
")",
"{",
"return",
"listFieldsByTypeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automat... | Retrieve a list of fields of a given type across all accessible modules.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param typeName The name of type.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorRe... | [
"Retrieve",
"a",
"list",
"of",
"fields",
"of",
"a",
"given",
"type",
"across",
"all",
"accessible",
"modules",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ObjectDataTypesInner.java#L179-L181 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java | BigDecimalMath.powInteger | private static BigDecimal powInteger(BigDecimal x, BigDecimal integerY, MathContext mathContext) {
"""
Calculates {@link BigDecimal} x to the power of the integer value y (x<sup>y</sup>).
<p>The value y MUST be an integer value.</p>
@param x the {@link BigDecimal} value to take to the power
@param integerY ... | java | private static BigDecimal powInteger(BigDecimal x, BigDecimal integerY, MathContext mathContext) {
if (fractionalPart(integerY).signum() != 0) {
throw new IllegalArgumentException("Not integer value: " + integerY);
}
if (integerY.signum() < 0) {
return ONE.divide(powInteger(x, integerY.negate(), mathCont... | [
"private",
"static",
"BigDecimal",
"powInteger",
"(",
"BigDecimal",
"x",
",",
"BigDecimal",
"integerY",
",",
"MathContext",
"mathContext",
")",
"{",
"if",
"(",
"fractionalPart",
"(",
"integerY",
")",
".",
"signum",
"(",
")",
"!=",
"0",
")",
"{",
"throw",
"... | Calculates {@link BigDecimal} x to the power of the integer value y (x<sup>y</sup>).
<p>The value y MUST be an integer value.</p>
@param x the {@link BigDecimal} value to take to the power
@param integerY the {@link BigDecimal} <strong>integer</strong> value to serve as exponent
@param mathContext the {@link MathCont... | [
"Calculates",
"{",
"@link",
"BigDecimal",
"}",
"x",
"to",
"the",
"power",
"of",
"the",
"integer",
"value",
"y",
"(",
"x<sup",
">",
"y<",
"/",
"sup",
">",
")",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java#L739-L770 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/handler/bundle/AbstractResourceBundleHandler.java | AbstractResourceBundleHandler.getStoredBundlePath | private String getStoredBundlePath(String bundleName, boolean asGzippedBundle) {
"""
Resolves the file name with which a bundle is stored.
@param bundleName
the bundle name
@param asGzippedBundle
the flag indicating if it's a gzipped bundle or not
@return the file name.
"""
String tempFileName;
if ... | java | private String getStoredBundlePath(String bundleName, boolean asGzippedBundle) {
String tempFileName;
if (asGzippedBundle)
tempFileName = gzipDirPath;
else
tempFileName = textDirPath;
return getStoredBundlePath(tempFileName, bundleName);
} | [
"private",
"String",
"getStoredBundlePath",
"(",
"String",
"bundleName",
",",
"boolean",
"asGzippedBundle",
")",
"{",
"String",
"tempFileName",
";",
"if",
"(",
"asGzippedBundle",
")",
"tempFileName",
"=",
"gzipDirPath",
";",
"else",
"tempFileName",
"=",
"textDirPath... | Resolves the file name with which a bundle is stored.
@param bundleName
the bundle name
@param asGzippedBundle
the flag indicating if it's a gzipped bundle or not
@return the file name. | [
"Resolves",
"the",
"file",
"name",
"with",
"which",
"a",
"bundle",
"is",
"stored",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/handler/bundle/AbstractResourceBundleHandler.java#L429-L438 |
Cleveroad/AdaptiveTableLayout | library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java | AdaptiveTableLayout.shiftColumnsViews | private void shiftColumnsViews(final int fromColumn, final int toColumn) {
"""
Method change columns. Change view holders indexes, kay in map, init changing items in adapter.
@param fromColumn from column index which need to shift
@param toColumn to column index which need to shift
"""
if (mAdapt... | java | private void shiftColumnsViews(final int fromColumn, final int toColumn) {
if (mAdapter != null) {
// change data
mAdapter.changeColumns(getBindColumn(fromColumn), getBindColumn(toColumn));
// change view holders
switchHeaders(mHeaderColumnViewHolders, fromColum... | [
"private",
"void",
"shiftColumnsViews",
"(",
"final",
"int",
"fromColumn",
",",
"final",
"int",
"toColumn",
")",
"{",
"if",
"(",
"mAdapter",
"!=",
"null",
")",
"{",
"// change data",
"mAdapter",
".",
"changeColumns",
"(",
"getBindColumn",
"(",
"fromColumn",
")... | Method change columns. Change view holders indexes, kay in map, init changing items in adapter.
@param fromColumn from column index which need to shift
@param toColumn to column index which need to shift | [
"Method",
"change",
"columns",
".",
"Change",
"view",
"holders",
"indexes",
"kay",
"in",
"map",
"init",
"changing",
"items",
"in",
"adapter",
"."
] | train | https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java#L1141-L1169 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java | TypeConverter.convertToFloat | public static float convertToFloat (@Nonnull final Object aSrcValue) {
"""
Convert the passed source value to float
@param aSrcValue
The source value. May not be <code>null</code>.
@return The converted value.
@throws TypeConverterException
if the source value is <code>null</code> or if no converter was
fo... | java | public static float convertToFloat (@Nonnull final Object aSrcValue)
{
if (aSrcValue == null)
throw new TypeConverterException (float.class, EReason.NULL_SOURCE_NOT_ALLOWED);
final Float aValue = convert (aSrcValue, Float.class);
return aValue.floatValue ();
} | [
"public",
"static",
"float",
"convertToFloat",
"(",
"@",
"Nonnull",
"final",
"Object",
"aSrcValue",
")",
"{",
"if",
"(",
"aSrcValue",
"==",
"null",
")",
"throw",
"new",
"TypeConverterException",
"(",
"float",
".",
"class",
",",
"EReason",
".",
"NULL_SOURCE_NOT... | Convert the passed source value to float
@param aSrcValue
The source value. May not be <code>null</code>.
@return The converted value.
@throws TypeConverterException
if the source value is <code>null</code> or if no converter was
found or if the converter returned a <code>null</code> object.
@throws RuntimeException
I... | [
"Convert",
"the",
"passed",
"source",
"value",
"to",
"float"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java#L274-L280 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.removeElement | public static <E> boolean removeElement(Collection<E> self, Object o) {
"""
Modifies this collection by removing a single instance of the specified
element from this collection, if it is present. Essentially an alias for
{@link Collection#remove(Object)} but with no ambiguity for Collection<Integer>.
<p/>... | java | public static <E> boolean removeElement(Collection<E> self, Object o) {
return self.remove(o);
} | [
"public",
"static",
"<",
"E",
">",
"boolean",
"removeElement",
"(",
"Collection",
"<",
"E",
">",
"self",
",",
"Object",
"o",
")",
"{",
"return",
"self",
".",
"remove",
"(",
"o",
")",
";",
"}"
] | Modifies this collection by removing a single instance of the specified
element from this collection, if it is present. Essentially an alias for
{@link Collection#remove(Object)} but with no ambiguity for Collection<Integer>.
<p/>
Example:
<pre class="groovyTestCase">
def list = [1, 2, 3, 2]
list.removeElement(2)... | [
"Modifies",
"this",
"collection",
"by",
"removing",
"a",
"single",
"instance",
"of",
"the",
"specified",
"element",
"from",
"this",
"collection",
"if",
"it",
"is",
"present",
".",
"Essentially",
"an",
"alias",
"for",
"{",
"@link",
"Collection#remove",
"(",
"Ob... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L17867-L17869 |
cdk/cdk | base/valencycheck/src/main/java/org/openscience/cdk/tools/SaturationChecker.java | SaturationChecker.calculateNumberOfImplicitHydrogens | public int calculateNumberOfImplicitHydrogens(IAtom atom, IAtomContainer container) throws CDKException {
"""
Calculate the number of missing hydrogens by subtracting the number of
bonds for the atom from the expected number of bonds. Charges are included
in the calculation. The number of expected bonds is defin... | java | public int calculateNumberOfImplicitHydrogens(IAtom atom, IAtomContainer container) throws CDKException {
return this.calculateNumberOfImplicitHydrogens(atom, container, false);
} | [
"public",
"int",
"calculateNumberOfImplicitHydrogens",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"container",
")",
"throws",
"CDKException",
"{",
"return",
"this",
".",
"calculateNumberOfImplicitHydrogens",
"(",
"atom",
",",
"container",
",",
"false",
")",
";",
"... | Calculate the number of missing hydrogens by subtracting the number of
bonds for the atom from the expected number of bonds. Charges are included
in the calculation. The number of expected bonds is defined by the AtomType
generated with the AtomTypeFactory.
@param atom Description of the Parameter
@param contai... | [
"Calculate",
"the",
"number",
"of",
"missing",
"hydrogens",
"by",
"subtracting",
"the",
"number",
"of",
"bonds",
"for",
"the",
"atom",
"from",
"the",
"expected",
"number",
"of",
"bonds",
".",
"Charges",
"are",
"included",
"in",
"the",
"calculation",
".",
"Th... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/valencycheck/src/main/java/org/openscience/cdk/tools/SaturationChecker.java#L582-L584 |
datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.setParam | public Request setParam(String name, Iterable<String> values) {
"""
set a request param and return modified request
@param name : name of the request param
@param values : values of the request param
@return : Request Object with request param name, value set
"""
this.params.putAll(name, values);
... | java | public Request setParam(String name, Iterable<String> values) {
this.params.putAll(name, values);
return this;
} | [
"public",
"Request",
"setParam",
"(",
"String",
"name",
",",
"Iterable",
"<",
"String",
">",
"values",
")",
"{",
"this",
".",
"params",
".",
"putAll",
"(",
"name",
",",
"values",
")",
";",
"return",
"this",
";",
"}"
] | set a request param and return modified request
@param name : name of the request param
@param values : values of the request param
@return : Request Object with request param name, value set | [
"set",
"a",
"request",
"param",
"and",
"return",
"modified",
"request"
] | train | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L324-L327 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java | SecondaryIndexManager.deleteFromIndexes | public void deleteFromIndexes(DecoratedKey key, List<Cell> indexedColumnsInRow, OpOrder.Group opGroup) {
"""
Delete all columns from all indexes for this row. For when cleanup rips a row out entirely.
@param key the row key
@param indexedColumnsInRow all column names in row
"""
// Update entire ro... | java | public void deleteFromIndexes(DecoratedKey key, List<Cell> indexedColumnsInRow, OpOrder.Group opGroup)
{
// Update entire row only once per row level index
Set<Class<? extends SecondaryIndex>> cleanedRowLevelIndexes = null;
for (Cell cell : indexedColumnsInRow)
{
for (Se... | [
"public",
"void",
"deleteFromIndexes",
"(",
"DecoratedKey",
"key",
",",
"List",
"<",
"Cell",
">",
"indexedColumnsInRow",
",",
"OpOrder",
".",
"Group",
"opGroup",
")",
"{",
"// Update entire row only once per row level index",
"Set",
"<",
"Class",
"<",
"?",
"extends"... | Delete all columns from all indexes for this row. For when cleanup rips a row out entirely.
@param key the row key
@param indexedColumnsInRow all column names in row | [
"Delete",
"all",
"columns",
"from",
"all",
"indexes",
"for",
"this",
"row",
".",
"For",
"when",
"cleanup",
"rips",
"a",
"row",
"out",
"entirely",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L473-L495 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java | ImplicitObjectUtil.loadGlobalApp | public static void loadGlobalApp(ServletRequest request, GlobalApp globalApp) {
"""
Load the global app into the request
@param request the request
@param globalApp the global app
"""
if(globalApp != null)
request.setAttribute(GLOBAL_APP_IMPLICIT_OBJECT_KEY, globalApp);
} | java | public static void loadGlobalApp(ServletRequest request, GlobalApp globalApp) {
if(globalApp != null)
request.setAttribute(GLOBAL_APP_IMPLICIT_OBJECT_KEY, globalApp);
} | [
"public",
"static",
"void",
"loadGlobalApp",
"(",
"ServletRequest",
"request",
",",
"GlobalApp",
"globalApp",
")",
"{",
"if",
"(",
"globalApp",
"!=",
"null",
")",
"request",
".",
"setAttribute",
"(",
"GLOBAL_APP_IMPLICIT_OBJECT_KEY",
",",
"globalApp",
")",
";",
... | Load the global app into the request
@param request the request
@param globalApp the global app | [
"Load",
"the",
"global",
"app",
"into",
"the",
"request"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java#L146-L149 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/protocol/RedisStateMachine.java | RedisStateMachine.safeSet | protected void safeSet(CommandOutput<?, ?, ?> output, ByteBuffer bytes, RedisCommand<?, ?, ?> command) {
"""
Safely sets {@link CommandOutput#set(ByteBuffer)}. Completes a command exceptionally in case an exception occurs.
@param output
@param bytes
@param command
"""
try {
output.set... | java | protected void safeSet(CommandOutput<?, ?, ?> output, ByteBuffer bytes, RedisCommand<?, ?, ?> command) {
try {
output.set(bytes);
} catch (Exception e) {
command.completeExceptionally(e);
}
} | [
"protected",
"void",
"safeSet",
"(",
"CommandOutput",
"<",
"?",
",",
"?",
",",
"?",
">",
"output",
",",
"ByteBuffer",
"bytes",
",",
"RedisCommand",
"<",
"?",
",",
"?",
",",
"?",
">",
"command",
")",
"{",
"try",
"{",
"output",
".",
"set",
"(",
"byte... | Safely sets {@link CommandOutput#set(ByteBuffer)}. Completes a command exceptionally in case an exception occurs.
@param output
@param bytes
@param command | [
"Safely",
"sets",
"{",
"@link",
"CommandOutput#set",
"(",
"ByteBuffer",
")",
"}",
".",
"Completes",
"a",
"command",
"exceptionally",
"in",
"case",
"an",
"exception",
"occurs",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/protocol/RedisStateMachine.java#L370-L377 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createAward | public GitlabAward createAward(GitlabIssue issue, Integer noteId, String awardName) throws IOException {
"""
Create an award for an issue note
@param issue
@param noteId
@param awardName
@throws IOException on gitlab api call error
"""
Query query = new Query().append("name", awardName);
... | java | public GitlabAward createAward(GitlabIssue issue, Integer noteId, String awardName) throws IOException {
Query query = new Query().append("name", awardName);
String tailUrl = GitlabProject.URL + "/" + issue.getProjectId() + GitlabIssue.URL + "/" + issue.getId()
+ GitlabNote.URL + noteId ... | [
"public",
"GitlabAward",
"createAward",
"(",
"GitlabIssue",
"issue",
",",
"Integer",
"noteId",
",",
"String",
"awardName",
")",
"throws",
"IOException",
"{",
"Query",
"query",
"=",
"new",
"Query",
"(",
")",
".",
"append",
"(",
"\"name\"",
",",
"awardName",
"... | Create an award for an issue note
@param issue
@param noteId
@param awardName
@throws IOException on gitlab api call error | [
"Create",
"an",
"award",
"for",
"an",
"issue",
"note"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3589-L3595 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/Stripe.java | Stripe.createBankAccountTokenSynchronous | public Token createBankAccountTokenSynchronous(final BankAccount bankAccount)
throws AuthenticationException,
InvalidRequestException,
APIConnectionException,
CardException,
APIException {
"""
Blocking method to create a {@link Token} for a {@link BankAcc... | java | public Token createBankAccountTokenSynchronous(final BankAccount bankAccount)
throws AuthenticationException,
InvalidRequestException,
APIConnectionException,
CardException,
APIException {
return createBankAccountTokenSynchronous(bankAccount, mDefaultP... | [
"public",
"Token",
"createBankAccountTokenSynchronous",
"(",
"final",
"BankAccount",
"bankAccount",
")",
"throws",
"AuthenticationException",
",",
"InvalidRequestException",
",",
"APIConnectionException",
",",
"CardException",
",",
"APIException",
"{",
"return",
"createBankAc... | Blocking method to create a {@link Token} for a {@link BankAccount}. Do not call this on
the UI thread or your app will crash.
This method uses the default publishable key for this {@link Stripe} instance.
@param bankAccount the {@link Card} to use for this token
@return a {@link Token} that can be used for this {@li... | [
"Blocking",
"method",
"to",
"create",
"a",
"{",
"@link",
"Token",
"}",
"for",
"a",
"{",
"@link",
"BankAccount",
"}",
".",
"Do",
"not",
"call",
"this",
"on",
"the",
"UI",
"thread",
"or",
"your",
"app",
"will",
"crash",
"."
] | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/Stripe.java#L202-L209 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java | GlobalConfiguration.getIntegerInternal | private int getIntegerInternal(final String key, final int defaultValue) {
"""
Returns the value associated with the given key as an integer.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@r... | java | private int getIntegerInternal(final String key, final int defaultValue) {
int retVal = defaultValue;
try {
synchronized (this.confData) {
if (this.confData.containsKey(key)) {
retVal = Integer.parseInt(this.confData.get(key));
}
}
} catch (NumberFormatException e) {
if (LOG.isDebugEnabl... | [
"private",
"int",
"getIntegerInternal",
"(",
"final",
"String",
"key",
",",
"final",
"int",
"defaultValue",
")",
"{",
"int",
"retVal",
"=",
"defaultValue",
";",
"try",
"{",
"synchronized",
"(",
"this",
".",
"confData",
")",
"{",
"if",
"(",
"this",
".",
"... | Returns the value associated with the given key as an integer.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value associated with the given key | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"as",
"an",
"integer",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java#L191-L210 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/products/DigitalCaplet.java | DigitalCaplet.getValue | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value c... | java | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
// Set payment date and period length
double paymentDate = periodEnd;
double periodLength = periodEnd - periodStart;
// Get random variables
RandomVariable libor = mode... | [
"@",
"Override",
"public",
"RandomVariable",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationModel",
"model",
")",
"throws",
"CalculationException",
"{",
"// Set payment date and period length",
"double",
"paymentDate",
"=",
"periodEnd",
";",
... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/DigitalCaplet.java#L58-L85 |
waldheinz/fat32-lib | src/main/java/de/waldheinz/fs/fat/LittleEndian.java | LittleEndian.setInt32 | public static void setInt32(byte[] dst, int offset, long value)
throws IllegalArgumentException {
"""
Sets a 32-bit integer in the given byte array at the given offset.
"""
assert value <= Integer.MAX_VALUE : "value out of range";
dst[offset + 0] = (byte) (value & ... | java | public static void setInt32(byte[] dst, int offset, long value)
throws IllegalArgumentException {
assert value <= Integer.MAX_VALUE : "value out of range";
dst[offset + 0] = (byte) (value & 0xFF);
dst[offset + 1] = (byte) ((value >>> 8) & 0xFF);
dst[offset +... | [
"public",
"static",
"void",
"setInt32",
"(",
"byte",
"[",
"]",
"dst",
",",
"int",
"offset",
",",
"long",
"value",
")",
"throws",
"IllegalArgumentException",
"{",
"assert",
"value",
"<=",
"Integer",
".",
"MAX_VALUE",
":",
"\"value out of range\"",
";",
"dst",
... | Sets a 32-bit integer in the given byte array at the given offset. | [
"Sets",
"a",
"32",
"-",
"bit",
"integer",
"in",
"the",
"given",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/waldheinz/fat32-lib/blob/3d8f1a986339573576e02eb0b6ea49bfdc9cce26/src/main/java/de/waldheinz/fs/fat/LittleEndian.java#L92-L101 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java | CommerceDiscountRulePersistenceImpl.findAll | @Override
public List<CommerceDiscountRule> findAll() {
"""
Returns all the commerce discount rules.
@return the commerce discount rules
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceDiscountRule> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscountRule",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce discount rules.
@return the commerce discount rules | [
"Returns",
"all",
"the",
"commerce",
"discount",
"rules",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java#L1142-L1145 |
moleculer-java/moleculer-java | src/main/java/services/moleculer/cacher/JCacheCacher.java | JCacheCacher.addCacheConfiguration | public void addCacheConfiguration(String partition, Configuration<String, byte[]> configuration) {
"""
--- ADD / REMOVE CACHE CONFIGURATIONS BY CACHE REGION / PARTITION ---
"""
cacheConfigurations.put(partition, configuration);
} | java | public void addCacheConfiguration(String partition, Configuration<String, byte[]> configuration) {
cacheConfigurations.put(partition, configuration);
} | [
"public",
"void",
"addCacheConfiguration",
"(",
"String",
"partition",
",",
"Configuration",
"<",
"String",
",",
"byte",
"[",
"]",
">",
"configuration",
")",
"{",
"cacheConfigurations",
".",
"put",
"(",
"partition",
",",
"configuration",
")",
";",
"}"
] | --- ADD / REMOVE CACHE CONFIGURATIONS BY CACHE REGION / PARTITION --- | [
"---",
"ADD",
"/",
"REMOVE",
"CACHE",
"CONFIGURATIONS",
"BY",
"CACHE",
"REGION",
"/",
"PARTITION",
"---"
] | train | https://github.com/moleculer-java/moleculer-java/blob/27575c44b9ecacc17c4456ceacf5d1851abf1cc4/src/main/java/services/moleculer/cacher/JCacheCacher.java#L381-L383 |
wildfly/wildfly-core | controller-client/src/main/java/org/jboss/as/controller/client/helpers/Operations.java | Operations.createUndefineAttributeOperation | public static ModelNode createUndefineAttributeOperation(final ModelNode address, final String attributeName) {
"""
Creates an operation to undefine an attribute value represented by the {@code attributeName} parameter.
@param address the address to create the write attribute for
@param attributeName the... | java | public static ModelNode createUndefineAttributeOperation(final ModelNode address, final String attributeName) {
final ModelNode op = createOperation(UNDEFINE_ATTRIBUTE_OPERATION, address);
op.get(NAME).set(attributeName);
return op;
} | [
"public",
"static",
"ModelNode",
"createUndefineAttributeOperation",
"(",
"final",
"ModelNode",
"address",
",",
"final",
"String",
"attributeName",
")",
"{",
"final",
"ModelNode",
"op",
"=",
"createOperation",
"(",
"UNDEFINE_ATTRIBUTE_OPERATION",
",",
"address",
")",
... | Creates an operation to undefine an attribute value represented by the {@code attributeName} parameter.
@param address the address to create the write attribute for
@param attributeName the name attribute to undefine
@return the operation | [
"Creates",
"an",
"operation",
"to",
"undefine",
"an",
"attribute",
"value",
"represented",
"by",
"the",
"{",
"@code",
"attributeName",
"}",
"parameter",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller-client/src/main/java/org/jboss/as/controller/client/helpers/Operations.java#L259-L263 |
cdk/cdk | storage/ctab/src/main/java/org/openscience/cdk/io/MDLV2000Writer.java | MDLV2000Writer.formatMDLInt | protected static String formatMDLInt(int x, int n) {
"""
Formats an integer to fit into the connection table and changes it
to a String.
@param x The int to be formated
@param n Length of the String
@return The String to be written into the connectiontable
"""
char[] buf = new char[n];
Ar... | java | protected static String formatMDLInt(int x, int n) {
char[] buf = new char[n];
Arrays.fill(buf, ' ');
String val = Integer.toString(x);
if (val.length() > n)
val = "0";
int off = n - val.length();
for (int i = 0; i < val.length(); i++)
buf[off+i] =... | [
"protected",
"static",
"String",
"formatMDLInt",
"(",
"int",
"x",
",",
"int",
"n",
")",
"{",
"char",
"[",
"]",
"buf",
"=",
"new",
"char",
"[",
"n",
"]",
";",
"Arrays",
".",
"fill",
"(",
"buf",
",",
"'",
"'",
")",
";",
"String",
"val",
"=",
"Int... | Formats an integer to fit into the connection table and changes it
to a String.
@param x The int to be formated
@param n Length of the String
@return The String to be written into the connectiontable | [
"Formats",
"an",
"integer",
"to",
"fit",
"into",
"the",
"connection",
"table",
"and",
"changes",
"it",
"to",
"a",
"String",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLV2000Writer.java#L1112-L1122 |
di2e/Argo | clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java | CLIContext.getString | public String getString(String key, String defaultValue) {
"""
Get the string value, or the defaultValue if not found.
@param key The key to search for.
@return The value, or defaultValue if not found.
"""
Object o = getObject(key);
if (o == null) {
return defaultValue;
}
if (!(o instanceof S... | java | public String getString(String key, String defaultValue) {
Object o = getObject(key);
if (o == null) {
return defaultValue;
}
if (!(o instanceof String)) {
throw new IllegalArgumentException("Object ["+o+"] associated with key ["+key+"] is not of type String.");
}
return (String)o;
} | [
"public",
"String",
"getString",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"Object",
"o",
"=",
"getObject",
"(",
"key",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"if",
"(",
"!",
"(",
... | Get the string value, or the defaultValue if not found.
@param key The key to search for.
@return The value, or defaultValue if not found. | [
"Get",
"the",
"string",
"value",
"or",
"the",
"defaultValue",
"if",
"not",
"found",
"."
] | train | https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java#L156-L165 |
geomajas/geomajas-project-server | common-servlet/src/main/java/org/geomajas/servlet/CacheFilter.java | CacheFilter.shouldNotCache | public boolean shouldNotCache(String requestUri) {
"""
Should the URI explicitly not be cached.
@param requestUri request URI
@return true when caching is prohibited
"""
String uri = requestUri.toLowerCase();
return checkContains(uri, noCacheIdentifiers) || checkSuffixes(uri, noCacheSuffixes);
} | java | public boolean shouldNotCache(String requestUri) {
String uri = requestUri.toLowerCase();
return checkContains(uri, noCacheIdentifiers) || checkSuffixes(uri, noCacheSuffixes);
} | [
"public",
"boolean",
"shouldNotCache",
"(",
"String",
"requestUri",
")",
"{",
"String",
"uri",
"=",
"requestUri",
".",
"toLowerCase",
"(",
")",
";",
"return",
"checkContains",
"(",
"uri",
",",
"noCacheIdentifiers",
")",
"||",
"checkSuffixes",
"(",
"uri",
",",
... | Should the URI explicitly not be cached.
@param requestUri request URI
@return true when caching is prohibited | [
"Should",
"the",
"URI",
"explicitly",
"not",
"be",
"cached",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/common-servlet/src/main/java/org/geomajas/servlet/CacheFilter.java#L222-L225 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/Launcher.java | Launcher.handleActions | protected ReturnCode handleActions(BootstrapConfig bootProps, LaunchArguments launchArgs) {
"""
Handle the process action.
@param bootProps An instance of BootstrapConfig
@param launchArgs An instance of LaunchArguments
"""
ReturnCode rc = launchArgs.getRc();
switch (rc) {
case... | java | protected ReturnCode handleActions(BootstrapConfig bootProps, LaunchArguments launchArgs) {
ReturnCode rc = launchArgs.getRc();
switch (rc) {
case OK:
rc = new KernelBootstrap(bootProps).go();
break;
case CREATE_ACTION:
// Use ini... | [
"protected",
"ReturnCode",
"handleActions",
"(",
"BootstrapConfig",
"bootProps",
",",
"LaunchArguments",
"launchArgs",
")",
"{",
"ReturnCode",
"rc",
"=",
"launchArgs",
".",
"getRc",
"(",
")",
";",
"switch",
"(",
"rc",
")",
"{",
"case",
"OK",
":",
"rc",
"=",
... | Handle the process action.
@param bootProps An instance of BootstrapConfig
@param launchArgs An instance of LaunchArguments | [
"Handle",
"the",
"process",
"action",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/Launcher.java#L236-L299 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java | GPXTablesFactory.dropOSMTables | public static void dropOSMTables(Connection connection, boolean isH2, String tablePrefix) throws SQLException {
"""
Drop the existing GPX tables used to store the imported OSM GPX
@param connection
@param isH2
@param tablePrefix
@throws SQLException
"""
TableLocation requestedTable = TableLocatio... | java | public static void dropOSMTables(Connection connection, boolean isH2, String tablePrefix) throws SQLException {
TableLocation requestedTable = TableLocation.parse(tablePrefix, isH2);
String gpxTableName = requestedTable.getTable();
String[] gpxTables = new String[]{WAYPOINT,ROUTE,ROUTEPO... | [
"public",
"static",
"void",
"dropOSMTables",
"(",
"Connection",
"connection",
",",
"boolean",
"isH2",
",",
"String",
"tablePrefix",
")",
"throws",
"SQLException",
"{",
"TableLocation",
"requestedTable",
"=",
"TableLocation",
".",
"parse",
"(",
"tablePrefix",
",",
... | Drop the existing GPX tables used to store the imported OSM GPX
@param connection
@param isH2
@param tablePrefix
@throws SQLException | [
"Drop",
"the",
"existing",
"GPX",
"tables",
"used",
"to",
"store",
"the",
"imported",
"OSM",
"GPX"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java#L331-L347 |
threerings/narya | core/src/main/java/com/threerings/presents/client/InvocationDirector.java | InvocationDirector.handleClientObjectChanged | protected void handleClientObjectChanged (int newCloid) {
"""
Called when the server has informed us that our previous client object is going the way of
the Dodo because we're changing screen names. We subscribe to the new object and report to
the client once we've got our hands on it.
"""
// subscri... | java | protected void handleClientObjectChanged (int newCloid)
{
// subscribe to the new client object
_omgr.subscribeToObject(newCloid, new Subscriber<ClientObject>() {
public void objectAvailable (ClientObject clobj) {
// grab a reference to our old receiver registrations
... | [
"protected",
"void",
"handleClientObjectChanged",
"(",
"int",
"newCloid",
")",
"{",
"// subscribe to the new client object",
"_omgr",
".",
"subscribeToObject",
"(",
"newCloid",
",",
"new",
"Subscriber",
"<",
"ClientObject",
">",
"(",
")",
"{",
"public",
"void",
"obj... | Called when the server has informed us that our previous client object is going the way of
the Dodo because we're changing screen names. We subscribe to the new object and report to
the client once we've got our hands on it. | [
"Called",
"when",
"the",
"server",
"has",
"informed",
"us",
"that",
"our",
"previous",
"client",
"object",
"is",
"going",
"the",
"way",
"of",
"the",
"Dodo",
"because",
"we",
"re",
"changing",
"screen",
"names",
".",
"We",
"subscribe",
"to",
"the",
"new",
... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/InvocationDirector.java#L338-L372 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/annotation/AuditAnnotationAttributes.java | AuditAnnotationAttributes.getAction | private String getAction(final Annotation[] annotations, final Method method) {
"""
Gets the action.
@param annotations
the annotations
@param method
the method
@return the action
"""
for (final Annotation annotation : annotations) {
if (annotation instanceof Audit) {
... | java | private String getAction(final Annotation[] annotations, final Method method) {
for (final Annotation annotation : annotations) {
if (annotation instanceof Audit) {
final Audit audit = (Audit) annotation;
String action = audit.action();
if (ACTION.equa... | [
"private",
"String",
"getAction",
"(",
"final",
"Annotation",
"[",
"]",
"annotations",
",",
"final",
"Method",
"method",
")",
"{",
"for",
"(",
"final",
"Annotation",
"annotation",
":",
"annotations",
")",
"{",
"if",
"(",
"annotation",
"instanceof",
"Audit",
... | Gets the action.
@param annotations
the annotations
@param method
the method
@return the action | [
"Gets",
"the",
"action",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/annotation/AuditAnnotationAttributes.java#L168-L181 |
junit-team/junit4 | src/main/java/org/junit/runner/Request.java | Request.errorReport | public static Request errorReport(Class<?> klass, Throwable cause) {
"""
Creates a {@link Request} that, when processed, will report an error for the given
test class with the given cause.
"""
return runner(new ErrorReportingRunner(klass, cause));
} | java | public static Request errorReport(Class<?> klass, Throwable cause) {
return runner(new ErrorReportingRunner(klass, cause));
} | [
"public",
"static",
"Request",
"errorReport",
"(",
"Class",
"<",
"?",
">",
"klass",
",",
"Throwable",
"cause",
")",
"{",
"return",
"runner",
"(",
"new",
"ErrorReportingRunner",
"(",
"klass",
",",
"cause",
")",
")",
";",
"}"
] | Creates a {@link Request} that, when processed, will report an error for the given
test class with the given cause. | [
"Creates",
"a",
"{"
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runner/Request.java#L100-L102 |
crawljax/crawljax | core/src/main/java/com/crawljax/forms/TrainingFormHandler.java | TrainingFormHandler.getInputValue | private InputValue getInputValue(FormInput input) {
"""
Generates the InputValue for the form input by inspecting the current
value of the corresponding WebElement on the DOM.
@return The current InputValue for the element on the DOM.
"""
/* Get the DOM element from Selenium. */
WebElement inputElemen... | java | private InputValue getInputValue(FormInput input) {
/* Get the DOM element from Selenium. */
WebElement inputElement = browser.getWebElement(input.getIdentification());
switch (input.getType()) {
case TEXT:
case PASSWORD:
case HIDDEN:
case SELECT:
case TEXTAREA:
return new InputValue(inputEle... | [
"private",
"InputValue",
"getInputValue",
"(",
"FormInput",
"input",
")",
"{",
"/* Get the DOM element from Selenium. */",
"WebElement",
"inputElement",
"=",
"browser",
".",
"getWebElement",
"(",
"input",
".",
"getIdentification",
"(",
")",
")",
";",
"switch",
"(",
... | Generates the InputValue for the form input by inspecting the current
value of the corresponding WebElement on the DOM.
@return The current InputValue for the element on the DOM. | [
"Generates",
"the",
"InputValue",
"for",
"the",
"form",
"input",
"by",
"inspecting",
"the",
"current",
"value",
"of",
"the",
"corresponding",
"WebElement",
"on",
"the",
"DOM",
"."
] | train | https://github.com/crawljax/crawljax/blob/d339f4f622ca902ccd35322065821e52a62ec543/core/src/main/java/com/crawljax/forms/TrainingFormHandler.java#L195-L215 |
cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java | CxSmilesParser.processFragmentGrouping | private static boolean processFragmentGrouping(final CharIter iter, final CxSmilesState state) {
"""
Fragment grouping defines disconnected components that should be considered part of a single molecule (i.e.
Salts). Examples include NaH, AlCl3, Cs2CO3, HATU, etc.
@param iter input characters, iterator is prog... | java | private static boolean processFragmentGrouping(final CharIter iter, final CxSmilesState state) {
if (state.fragGroups == null)
state.fragGroups = new ArrayList<>();
List<Integer> dest = new ArrayList<>();
while (iter.hasNext()) {
dest.clear();
if (!processIntL... | [
"private",
"static",
"boolean",
"processFragmentGrouping",
"(",
"final",
"CharIter",
"iter",
",",
"final",
"CxSmilesState",
"state",
")",
"{",
"if",
"(",
"state",
".",
"fragGroups",
"==",
"null",
")",
"state",
".",
"fragGroups",
"=",
"new",
"ArrayList",
"<>",
... | Fragment grouping defines disconnected components that should be considered part of a single molecule (i.e.
Salts). Examples include NaH, AlCl3, Cs2CO3, HATU, etc.
@param iter input characters, iterator is progressed by this method
@param state output CXSMILES state
@return parse was a success (or not) | [
"Fragment",
"grouping",
"defines",
"disconnected",
"components",
"that",
"should",
"be",
"considered",
"part",
"of",
"a",
"single",
"molecule",
"(",
"i",
".",
"e",
".",
"Salts",
")",
".",
"Examples",
"include",
"NaH",
"AlCl3",
"Cs2CO3",
"HATU",
"etc",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java#L189-L203 |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/util/UIUtils.java | UIUtils.getDrawableAttr | public static Drawable getDrawableAttr(Context ctx, @AttrRes int drawableAttrId) {
"""
Get a Drawable attribute value
@param ctx
@param drawableAttrId
@return
"""
int[] attrs = new int[] { drawableAttrId /* index 0 */};
TypedArray ta = ctx.obtainStyledAttributes(attrs);
Drawable dr... | java | public static Drawable getDrawableAttr(Context ctx, @AttrRes int drawableAttrId){
int[] attrs = new int[] { drawableAttrId /* index 0 */};
TypedArray ta = ctx.obtainStyledAttributes(attrs);
Drawable drawable = ta.getDrawable(0);
ta.recycle();
return drawable;
} | [
"public",
"static",
"Drawable",
"getDrawableAttr",
"(",
"Context",
"ctx",
",",
"@",
"AttrRes",
"int",
"drawableAttrId",
")",
"{",
"int",
"[",
"]",
"attrs",
"=",
"new",
"int",
"[",
"]",
"{",
"drawableAttrId",
"/* index 0 */",
"}",
";",
"TypedArray",
"ta",
"... | Get a Drawable attribute value
@param ctx
@param drawableAttrId
@return | [
"Get",
"a",
"Drawable",
"attribute",
"value"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/UIUtils.java#L151-L157 |
xwiki/xwiki-rendering | xwiki-rendering-transformations/xwiki-rendering-transformation-linkchecker/src/main/java/org/xwiki/rendering/internal/transformation/linkchecker/DefaultLinkCheckerThread.java | DefaultLinkCheckerThread.checkLink | private void checkLink(LinkQueueItem queueItem) {
"""
Perform the HTTP connection and save the result in the {@link LinkStateManager}.
@param queueItem the link to check
"""
int responseCode = this.httpChecker.check(queueItem.getLinkReference());
Map<String, LinkState> contentReferences =
... | java | private void checkLink(LinkQueueItem queueItem)
{
int responseCode = this.httpChecker.check(queueItem.getLinkReference());
Map<String, LinkState> contentReferences =
this.linkStateManager.getLinkStates().get(queueItem.getLinkReference());
if (contentReferences == null) {
... | [
"private",
"void",
"checkLink",
"(",
"LinkQueueItem",
"queueItem",
")",
"{",
"int",
"responseCode",
"=",
"this",
".",
"httpChecker",
".",
"check",
"(",
"queueItem",
".",
"getLinkReference",
"(",
")",
")",
";",
"Map",
"<",
"String",
",",
"LinkState",
">",
"... | Perform the HTTP connection and save the result in the {@link LinkStateManager}.
@param queueItem the link to check | [
"Perform",
"the",
"HTTP",
"connection",
"and",
"save",
"the",
"result",
"in",
"the",
"{",
"@link",
"LinkStateManager",
"}",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-transformations/xwiki-rendering-transformation-linkchecker/src/main/java/org/xwiki/rendering/internal/transformation/linkchecker/DefaultLinkCheckerThread.java#L197-L219 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.isPrimitiveOrBoxedPrimitiveType | public static <T extends Tree> Matcher<T> isPrimitiveOrBoxedPrimitiveType() {
"""
Matches an AST node if its type is a primitive type, or a boxed version of a primitive type.
"""
return new Matcher<T>() {
@Override
public boolean matches(Tree t, VisitorState state) {
Type type = getType... | java | public static <T extends Tree> Matcher<T> isPrimitiveOrBoxedPrimitiveType() {
return new Matcher<T>() {
@Override
public boolean matches(Tree t, VisitorState state) {
Type type = getType(t);
return type != null && state.getTypes().unboxedTypeOrType(type).isPrimitive();
}
};
} | [
"public",
"static",
"<",
"T",
"extends",
"Tree",
">",
"Matcher",
"<",
"T",
">",
"isPrimitiveOrBoxedPrimitiveType",
"(",
")",
"{",
"return",
"new",
"Matcher",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"Tree",
"t",... | Matches an AST node if its type is a primitive type, or a boxed version of a primitive type. | [
"Matches",
"an",
"AST",
"node",
"if",
"its",
"type",
"is",
"a",
"primitive",
"type",
"or",
"a",
"boxed",
"version",
"of",
"a",
"primitive",
"type",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L510-L518 |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/XMLRPCClient.java | XMLRPCClient.callAsync | public long callAsync(XMLRPCCallback listener, String methodName, Object... params) {
"""
Asynchronously call a remote procedure on the server. The method must be
described by a method name. If the method requires parameters, this must
be set. When the server returns a response the onResponse method is called
... | java | public long callAsync(XMLRPCCallback listener, String methodName, Object... params) {
long id = System.currentTimeMillis();
new Caller(listener, id, methodName, params).start();
return id;
} | [
"public",
"long",
"callAsync",
"(",
"XMLRPCCallback",
"listener",
",",
"String",
"methodName",
",",
"Object",
"...",
"params",
")",
"{",
"long",
"id",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"new",
"Caller",
"(",
"listener",
",",
"id",
",",... | Asynchronously call a remote procedure on the server. The method must be
described by a method name. If the method requires parameters, this must
be set. When the server returns a response the onResponse method is called
on the listener. If the server returns an error the onServerError method
is called on the listener... | [
"Asynchronously",
"call",
"a",
"remote",
"procedure",
"on",
"the",
"server",
".",
"The",
"method",
"must",
"be",
"described",
"by",
"a",
"method",
"name",
".",
"If",
"the",
"method",
"requires",
"parameters",
"this",
"must",
"be",
"set",
".",
"When",
"the"... | train | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/XMLRPCClient.java#L485-L489 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/JobmanagerInfoServlet.java | JobmanagerInfoServlet.writeJsonForArchivedJobGroupvertex | private void writeJsonForArchivedJobGroupvertex(PrintWriter wrt, RecentJobEvent jobEvent, ManagementGroupVertexID groupvertexId) {
"""
Writes infos about one particular archived groupvertex in a job, including all groupmembers, their times and status
@param wrt
@param jobEvent
@param groupvertexId
"""
... | java | private void writeJsonForArchivedJobGroupvertex(PrintWriter wrt, RecentJobEvent jobEvent, ManagementGroupVertexID groupvertexId) {
try {
ManagementGraph jobManagementGraph = jobmanager.getManagementGraph(jobEvent.getJobID());
ManagementGroupVertex groupvertex = jobManagementGraph.getGroupVertexByID(gr... | [
"private",
"void",
"writeJsonForArchivedJobGroupvertex",
"(",
"PrintWriter",
"wrt",
",",
"RecentJobEvent",
"jobEvent",
",",
"ManagementGroupVertexID",
"groupvertexId",
")",
"{",
"try",
"{",
"ManagementGraph",
"jobManagementGraph",
"=",
"jobmanager",
".",
"getManagementGraph... | Writes infos about one particular archived groupvertex in a job, including all groupmembers, their times and status
@param wrt
@param jobEvent
@param groupvertexId | [
"Writes",
"infos",
"about",
"one",
"particular",
"archived",
"groupvertex",
"in",
"a",
"job",
"including",
"all",
"groupmembers",
"their",
"times",
"and",
"status"
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/JobmanagerInfoServlet.java#L457-L507 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_instance_instanceId_reboot_POST | public void project_serviceName_instance_instanceId_reboot_POST(String serviceName, String instanceId, OvhRebootTypeEnum type) throws IOException {
"""
Reboot an instance
REST: POST /cloud/project/{serviceName}/instance/{instanceId}/reboot
@param instanceId [required] Instance id
@param serviceName [required]... | java | public void project_serviceName_instance_instanceId_reboot_POST(String serviceName, String instanceId, OvhRebootTypeEnum type) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/reboot";
StringBuilder sb = path(qPath, serviceName, instanceId);
HashMap<String, Object>o = new Ha... | [
"public",
"void",
"project_serviceName_instance_instanceId_reboot_POST",
"(",
"String",
"serviceName",
",",
"String",
"instanceId",
",",
"OvhRebootTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/instance/{instanceId}... | Reboot an instance
REST: POST /cloud/project/{serviceName}/instance/{instanceId}/reboot
@param instanceId [required] Instance id
@param serviceName [required] Service name
@param type [required] Reboot type (default soft) | [
"Reboot",
"an",
"instance"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1909-L1915 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuGraphAddEmptyNode | public static int cuGraphAddEmptyNode(CUgraphNode phGraphNode, CUgraph hGraph, CUgraphNode dependencies[], long numDependencies) {
"""
Creates an empty node and adds it to a graph.<br>
<br>
Creates a new node which performs no operation, and adds it to \p hGraph with
\p numDependencies dependencies specified vi... | java | public static int cuGraphAddEmptyNode(CUgraphNode phGraphNode, CUgraph hGraph, CUgraphNode dependencies[], long numDependencies)
{
return checkResult(cuGraphAddEmptyNodeNative(phGraphNode, hGraph, dependencies, numDependencies));
} | [
"public",
"static",
"int",
"cuGraphAddEmptyNode",
"(",
"CUgraphNode",
"phGraphNode",
",",
"CUgraph",
"hGraph",
",",
"CUgraphNode",
"dependencies",
"[",
"]",
",",
"long",
"numDependencies",
")",
"{",
"return",
"checkResult",
"(",
"cuGraphAddEmptyNodeNative",
"(",
"ph... | Creates an empty node and adds it to a graph.<br>
<br>
Creates a new node which performs no operation, and adds it to \p hGraph with
\p numDependencies dependencies specified via \p dependencies.
It is possible for \p numDependencies to be 0, in which case the node will be placed
at the root of the graph. \p dependenci... | [
"Creates",
"an",
"empty",
"node",
"and",
"adds",
"it",
"to",
"a",
"graph",
".",
"<br",
">",
"<br",
">",
"Creates",
"a",
"new",
"node",
"which",
"performs",
"no",
"operation",
"and",
"adds",
"it",
"to",
"\\",
"p",
"hGraph",
"with",
"\\",
"p",
"numDepe... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L12551-L12554 |
auth0/auth0-java | src/main/java/com/auth0/client/mgmt/filter/ConnectionFilter.java | ConnectionFilter.withPage | public ConnectionFilter withPage(int pageNumber, int amountPerPage) {
"""
Filter by page
@param pageNumber the page number to retrieve.
@param amountPerPage the amount of items per page to retrieve.
@return this filter instance
"""
parameters.put("page", pageNumber);
parameters.put("per... | java | public ConnectionFilter withPage(int pageNumber, int amountPerPage) {
parameters.put("page", pageNumber);
parameters.put("per_page", amountPerPage);
return this;
} | [
"public",
"ConnectionFilter",
"withPage",
"(",
"int",
"pageNumber",
",",
"int",
"amountPerPage",
")",
"{",
"parameters",
".",
"put",
"(",
"\"page\"",
",",
"pageNumber",
")",
";",
"parameters",
".",
"put",
"(",
"\"per_page\"",
",",
"amountPerPage",
")",
";",
... | Filter by page
@param pageNumber the page number to retrieve.
@param amountPerPage the amount of items per page to retrieve.
@return this filter instance | [
"Filter",
"by",
"page"
] | train | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/mgmt/filter/ConnectionFilter.java#L37-L41 |
sababado/CircularView | library/src/main/java/com/sababado/circularview/CircularView.java | CircularView.getDefaultSize | public static int getDefaultSize(final int size, final int measureSpec) {
"""
Utility to return a default size. Uses the supplied size if the
MeasureSpec imposed no constraints. Will get larger if allowed
by the MeasureSpec.
@param size Default size for this view
@param measureSpec Constraints imposed... | java | public static int getDefaultSize(final int size, final int measureSpec) {
final int result;
final int specMode = MeasureSpec.getMode(measureSpec);
final int specSize = MeasureSpec.getSize(measureSpec);
switch (specMode) {
case MeasureSpec.AT_MOST:
result = Ma... | [
"public",
"static",
"int",
"getDefaultSize",
"(",
"final",
"int",
"size",
",",
"final",
"int",
"measureSpec",
")",
"{",
"final",
"int",
"result",
";",
"final",
"int",
"specMode",
"=",
"MeasureSpec",
".",
"getMode",
"(",
"measureSpec",
")",
";",
"final",
"i... | Utility to return a default size. Uses the supplied size if the
MeasureSpec imposed no constraints. Will get larger if allowed
by the MeasureSpec.
@param size Default size for this view
@param measureSpec Constraints imposed by the parent
@return The size this view should be. | [
"Utility",
"to",
"return",
"a",
"default",
"size",
".",
"Uses",
"the",
"supplied",
"size",
"if",
"the",
"MeasureSpec",
"imposed",
"no",
"constraints",
".",
"Will",
"get",
"larger",
"if",
"allowed",
"by",
"the",
"MeasureSpec",
"."
] | train | https://github.com/sababado/CircularView/blob/c9ab818d063bcc0796183616f8a82166a9b80aac/library/src/main/java/com/sababado/circularview/CircularView.java#L203-L220 |
simbiose/Encryption | Encryption/main/se/simbio/encryption/Encryption.java | Encryption.getSecretKey | private SecretKey getSecretKey(char[] key) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeySpecException {
"""
creates a 128bit salted aes key
@param key encoded input key
@return aes 128 bit salted key
@throws NoSuchAlgorithmException if no installed provider that can provide... | java | private SecretKey getSecretKey(char[] key) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeySpecException {
SecretKeyFactory factory = SecretKeyFactory.getInstance(mBuilder.getSecretKeyType());
KeySpec spec = new PBEKeySpec(key, mBuilder.getSalt().getBytes(mBuilder.getCharsetName... | [
"private",
"SecretKey",
"getSecretKey",
"(",
"char",
"[",
"]",
"key",
")",
"throws",
"NoSuchAlgorithmException",
",",
"UnsupportedEncodingException",
",",
"InvalidKeySpecException",
"{",
"SecretKeyFactory",
"factory",
"=",
"SecretKeyFactory",
".",
"getInstance",
"(",
"m... | creates a 128bit salted aes key
@param key encoded input key
@return aes 128 bit salted key
@throws NoSuchAlgorithmException if no installed provider that can provide the requested
by the Builder secret key type
@throws UnsupportedEncodingException if the Builder charset name is not supported
@throws InvalidKeyS... | [
"creates",
"a",
"128bit",
"salted",
"aes",
"key"
] | train | https://github.com/simbiose/Encryption/blob/a344761a10add131cbe9962f895b416e5217d0e9/Encryption/main/se/simbio/encryption/Encryption.java#L241-L246 |
structurizr/java | structurizr-core/src/com/structurizr/model/Person.java | Person.interactsWith | public Relationship interactsWith(Person destination, String description, String technology) {
"""
Adds an interaction between this person and another.
@param destination the Person being interacted with
@param description a description of the interaction
@param technology the technology of... | java | public Relationship interactsWith(Person destination, String description, String technology) {
return interactsWith(destination, description, technology, InteractionStyle.Synchronous);
} | [
"public",
"Relationship",
"interactsWith",
"(",
"Person",
"destination",
",",
"String",
"description",
",",
"String",
"technology",
")",
"{",
"return",
"interactsWith",
"(",
"destination",
",",
"description",
",",
"technology",
",",
"InteractionStyle",
".",
"Synchro... | Adds an interaction between this person and another.
@param destination the Person being interacted with
@param description a description of the interaction
@param technology the technology of the interaction (e.g. Telephone)
@return the resulting Relatioship | [
"Adds",
"an",
"interaction",
"between",
"this",
"person",
"and",
"another",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Person.java#L87-L89 |
ow2-chameleon/fuchsia | core/src/main/java/org/ow2/chameleon/fuchsia/core/component/manager/LinkerManagement.java | LinkerManagement.canBeLinked | public boolean canBeLinked(D declaration, ServiceReference<S> declarationBinderRef) {
"""
Return true if the Declaration can be linked to the ImporterService.
@param declaration The Declaration
@param declarationBinderRef The ServiceReference<ImporterService> of the ImporterService
@return true if th... | java | public boolean canBeLinked(D declaration, ServiceReference<S> declarationBinderRef) {
// Evaluate the target filter of the ImporterService on the Declaration
Filter filter = bindersManager.getTargetFilter(declarationBinderRef);
return filter.matches(declaration.getMetadata());
} | [
"public",
"boolean",
"canBeLinked",
"(",
"D",
"declaration",
",",
"ServiceReference",
"<",
"S",
">",
"declarationBinderRef",
")",
"{",
"// Evaluate the target filter of the ImporterService on the Declaration",
"Filter",
"filter",
"=",
"bindersManager",
".",
"getTargetFilter",... | Return true if the Declaration can be linked to the ImporterService.
@param declaration The Declaration
@param declarationBinderRef The ServiceReference<ImporterService> of the ImporterService
@return true if the Declaration can be linked to the ImporterService | [
"Return",
"true",
"if",
"the",
"Declaration",
"can",
"be",
"linked",
"to",
"the",
"ImporterService",
"."
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/core/src/main/java/org/ow2/chameleon/fuchsia/core/component/manager/LinkerManagement.java#L53-L57 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/LinkOptionsExample.java | LinkOptionsExample.getButtonControls | private WFieldSet getButtonControls(final WValidationErrors errors) {
"""
build the button controls field set.
@param errors the error pane from the page.
@return a field set for the controls.
"""
// Options Layout
WFieldSet fieldSet = new WFieldSet("Link configuration");
WFieldLayout layout = new WF... | java | private WFieldSet getButtonControls(final WValidationErrors errors) {
// Options Layout
WFieldSet fieldSet = new WFieldSet("Link configuration");
WFieldLayout layout = new WFieldLayout();
layout.setLabelWidth(30);
layout.addField("Link text", tfLinkLabel);
layout.addField("Link address", tfUrlField);
lay... | [
"private",
"WFieldSet",
"getButtonControls",
"(",
"final",
"WValidationErrors",
"errors",
")",
"{",
"// Options Layout",
"WFieldSet",
"fieldSet",
"=",
"new",
"WFieldSet",
"(",
"\"Link configuration\"",
")",
";",
"WFieldLayout",
"layout",
"=",
"new",
"WFieldLayout",
"(... | build the button controls field set.
@param errors the error pane from the page.
@return a field set for the controls. | [
"build",
"the",
"button",
"controls",
"field",
"set",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/LinkOptionsExample.java#L117-L146 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.