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 |
|---|---|---|---|---|---|---|---|---|---|---|
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/wallet/KeyChainGroup.java | KeyChainGroup.getActiveKeyChain | public final DeterministicKeyChain getActiveKeyChain(Script.ScriptType outputScriptType, long keyRotationTimeSecs) {
"""
Returns the key chain that's used for generation of fresh/current keys of the given type. If it's not the default
type and no active chain for this type exists, {@code null} is returned. No upg... | java | public final DeterministicKeyChain getActiveKeyChain(Script.ScriptType outputScriptType, long keyRotationTimeSecs) {
checkState(isSupportsDeterministicChains(), "doesn't support deterministic chains");
for (DeterministicKeyChain chain : ImmutableList.copyOf(chains).reverse())
if (chain.getOu... | [
"public",
"final",
"DeterministicKeyChain",
"getActiveKeyChain",
"(",
"Script",
".",
"ScriptType",
"outputScriptType",
",",
"long",
"keyRotationTimeSecs",
")",
"{",
"checkState",
"(",
"isSupportsDeterministicChains",
"(",
")",
",",
"\"doesn't support deterministic chains\"",
... | Returns the key chain that's used for generation of fresh/current keys of the given type. If it's not the default
type and no active chain for this type exists, {@code null} is returned. No upgrade or downgrade is tried. | [
"Returns",
"the",
"key",
"chain",
"that",
"s",
"used",
"for",
"generation",
"of",
"fresh",
"/",
"current",
"keys",
"of",
"the",
"given",
"type",
".",
"If",
"it",
"s",
"not",
"the",
"default",
"type",
"and",
"no",
"active",
"chain",
"for",
"this",
"type... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/wallet/KeyChainGroup.java#L411-L418 |
pushtorefresh/storio | storio-sqlite/src/main/java/com/pushtorefresh/storio3/sqlite/operations/delete/DeleteResult.java | DeleteResult.newInstance | @NonNull
public static DeleteResult newInstance(
int numberOfRowsDeleted,
@NonNull Set<String> affectedTables,
@Nullable Collection<String> affectedTags
) {
"""
Creates new instance of immutable container for results of Delete Operation.
@param numberOfRowsDeleted num... | java | @NonNull
public static DeleteResult newInstance(
int numberOfRowsDeleted,
@NonNull Set<String> affectedTables,
@Nullable Collection<String> affectedTags
) {
return new DeleteResult(numberOfRowsDeleted, affectedTables, nonNullSet(affectedTags));
} | [
"@",
"NonNull",
"public",
"static",
"DeleteResult",
"newInstance",
"(",
"int",
"numberOfRowsDeleted",
",",
"@",
"NonNull",
"Set",
"<",
"String",
">",
"affectedTables",
",",
"@",
"Nullable",
"Collection",
"<",
"String",
">",
"affectedTags",
")",
"{",
"return",
... | Creates new instance of immutable container for results of Delete Operation.
@param numberOfRowsDeleted number of rows that were deleted.
@param affectedTables tables that were affected.
@param affectedTags notification tags that were affected.
@return new instance of immutable container for result of Dele... | [
"Creates",
"new",
"instance",
"of",
"immutable",
"container",
"for",
"results",
"of",
"Delete",
"Operation",
"."
] | train | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-sqlite/src/main/java/com/pushtorefresh/storio3/sqlite/operations/delete/DeleteResult.java#L58-L65 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java | ToStream.notationDecl | public void notationDecl(String name, String pubID, String sysID) throws SAXException {
"""
If this method is called, the serializer is used as a
DTDHandler, which changes behavior how the serializer
handles document entities.
@see org.xml.sax.DTDHandler#notationDecl(java.lang.String, java.lang.String, java.lan... | java | public void notationDecl(String name, String pubID, String sysID) throws SAXException {
// TODO Auto-generated method stub
try {
DTDprolog();
m_writer.write("<!NOTATION ");
m_writer.write(name);
if (pubID != null) {
... | [
"public",
"void",
"notationDecl",
"(",
"String",
"name",
",",
"String",
"pubID",
",",
"String",
"sysID",
")",
"throws",
"SAXException",
"{",
"// TODO Auto-generated method stub",
"try",
"{",
"DTDprolog",
"(",
")",
";",
"m_writer",
".",
"write",
"(",
"\"<!NOTATIO... | If this method is called, the serializer is used as a
DTDHandler, which changes behavior how the serializer
handles document entities.
@see org.xml.sax.DTDHandler#notationDecl(java.lang.String, java.lang.String, java.lang.String) | [
"If",
"this",
"method",
"is",
"called",
"the",
"serializer",
"is",
"used",
"as",
"a",
"DTDHandler",
"which",
"changes",
"behavior",
"how",
"the",
"serializer",
"handles",
"document",
"entities",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java#L3489-L3511 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/constraint/StrNotNullOrEmpty.java | StrNotNullOrEmpty.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or isn't a String
@throws SuperCsvConstraintViolationException
if value is an empty String
"""
if (value == null){
throw new SuperCsvConstraintViolationExce... | java | public Object execute(final Object value, final CsvContext context) {
if (value == null){
throw new SuperCsvConstraintViolationException("the String should not be null", context, this);
}
if( value instanceof String ) {
final String stringValue = (String) value;
if( stringValue.length() == 0 ) {
t... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"SuperCsvConstraintViolationException",
"(",
"\"the String should not be null\"",
",",
"con... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or isn't a String
@throws SuperCsvConstraintViolationException
if value is an empty String | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/constraint/StrNotNullOrEmpty.java#L68-L83 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.createAccountAcquisition | public AccountAcquisition createAccountAcquisition(final String accountCode, final AccountAcquisition acquisition) {
"""
Sets the acquisition details for an account
<p>
https://dev.recurly.com/docs/create-account-acquisition
@param accountCode The account's account code
@param acquisition The AccountAcquisit... | java | public AccountAcquisition createAccountAcquisition(final String accountCode, final AccountAcquisition acquisition) {
final String path = Account.ACCOUNT_RESOURCE + "/" + accountCode + AccountAcquisition.ACCOUNT_ACQUISITION_RESOURCE;
return doPOST(path, acquisition, AccountAcquisition.class);
} | [
"public",
"AccountAcquisition",
"createAccountAcquisition",
"(",
"final",
"String",
"accountCode",
",",
"final",
"AccountAcquisition",
"acquisition",
")",
"{",
"final",
"String",
"path",
"=",
"Account",
".",
"ACCOUNT_RESOURCE",
"+",
"\"/\"",
"+",
"accountCode",
"+",
... | Sets the acquisition details for an account
<p>
https://dev.recurly.com/docs/create-account-acquisition
@param accountCode The account's account code
@param acquisition The AccountAcquisition data
@return The created AccountAcquisition object | [
"Sets",
"the",
"acquisition",
"details",
"for",
"an",
"account",
"<p",
">",
"https",
":",
"//",
"dev",
".",
"recurly",
".",
"com",
"/",
"docs",
"/",
"create",
"-",
"account",
"-",
"acquisition"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1961-L1964 |
wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java | AbstractCommandBuilder.setBindAddressHint | public T setBindAddressHint(final String interfaceName, final String address) {
"""
Sets the system property {@code jboss.bind.address.$INTERFACE} to the address given where {@code $INTERFACE} is
the {@code interfaceName} parameter. For example in the default configuration passing {@code management} for the
{@co... | java | public T setBindAddressHint(final String interfaceName, final String address) {
if (interfaceName == null) {
throw LauncherMessages.MESSAGES.nullParam("interfaceName");
}
setSingleServerArg("-b" + interfaceName, address);
return getThis();
} | [
"public",
"T",
"setBindAddressHint",
"(",
"final",
"String",
"interfaceName",
",",
"final",
"String",
"address",
")",
"{",
"if",
"(",
"interfaceName",
"==",
"null",
")",
"{",
"throw",
"LauncherMessages",
".",
"MESSAGES",
".",
"nullParam",
"(",
"\"interfaceName\"... | Sets the system property {@code jboss.bind.address.$INTERFACE} to the address given where {@code $INTERFACE} is
the {@code interfaceName} parameter. For example in the default configuration passing {@code management} for the
{@code interfaceName} parameter would result in the system property {@code jboss.bind.address.m... | [
"Sets",
"the",
"system",
"property",
"{",
"@code",
"jboss",
".",
"bind",
".",
"address",
".",
"$INTERFACE",
"}",
"to",
"the",
"address",
"given",
"where",
"{",
"@code",
"$INTERFACE",
"}",
"is",
"the",
"{",
"@code",
"interfaceName",
"}",
"parameter",
".",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java#L390-L396 |
gallandarakhneorg/afc | advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomablePane.java | ZoomablePane.getPanSensitivity | public double getPanSensitivity(boolean unitSensitivityModifier, boolean hugeSensivityModifier) {
"""
Replies the sensibility of the panning moves after applying dynamic user interaction modifiers.
The sensibility is a strictly positive number that is multiplied to the
distance covered by the mouse motion for ob... | java | public double getPanSensitivity(boolean unitSensitivityModifier, boolean hugeSensivityModifier) {
if (unitSensitivityModifier) {
return DEFAULT_PAN_SENSITIVITY;
}
final double sens = getPanSensitivity();
if (hugeSensivityModifier) {
return sens * LARGE_MOVE_FACTOR;
}
return sens;
} | [
"public",
"double",
"getPanSensitivity",
"(",
"boolean",
"unitSensitivityModifier",
",",
"boolean",
"hugeSensivityModifier",
")",
"{",
"if",
"(",
"unitSensitivityModifier",
")",
"{",
"return",
"DEFAULT_PAN_SENSITIVITY",
";",
"}",
"final",
"double",
"sens",
"=",
"getPa... | Replies the sensibility of the panning moves after applying dynamic user interaction modifiers.
The sensibility is a strictly positive number that is multiplied to the
distance covered by the mouse motion for obtaining the move to
apply to the document.
The default value is 1.
<p>This function is usually used for comp... | [
"Replies",
"the",
"sensibility",
"of",
"the",
"panning",
"moves",
"after",
"applying",
"dynamic",
"user",
"interaction",
"modifiers",
".",
"The",
"sensibility",
"is",
"a",
"strictly",
"positive",
"number",
"that",
"is",
"multiplied",
"to",
"the",
"distance",
"co... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomablePane.java#L816-L825 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_cluster.java | ns_cluster.form_cluster | public static ns_cluster form_cluster(nitro_service client, ns_cluster resource) throws Exception {
"""
<pre>
Use this operation to form one node cluster from NetScaler Instance.
</pre>
"""
return ((ns_cluster[]) resource.perform_operation(client, "form_cluster"))[0];
} | java | public static ns_cluster form_cluster(nitro_service client, ns_cluster resource) throws Exception
{
return ((ns_cluster[]) resource.perform_operation(client, "form_cluster"))[0];
} | [
"public",
"static",
"ns_cluster",
"form_cluster",
"(",
"nitro_service",
"client",
",",
"ns_cluster",
"resource",
")",
"throws",
"Exception",
"{",
"return",
"(",
"(",
"ns_cluster",
"[",
"]",
")",
"resource",
".",
"perform_operation",
"(",
"client",
",",
"\"form_c... | <pre>
Use this operation to form one node cluster from NetScaler Instance.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"form",
"one",
"node",
"cluster",
"from",
"NetScaler",
"Instance",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_cluster.java#L586-L589 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Widgets.java | Widgets.newTextArea | public static TextArea newTextArea (String text, int width, int height) {
"""
Creates a text area with all of the configuration that you're bound to want to do.
@param width the width of the text area or -1 to use the default (or CSS styled) width.
"""
TextArea area = new TextArea();
if (tex... | java | public static TextArea newTextArea (String text, int width, int height)
{
TextArea area = new TextArea();
if (text != null) {
area.setText(text);
}
if (width > 0) {
area.setCharacterWidth(width);
}
if (height > 0) {
area.setVisibleL... | [
"public",
"static",
"TextArea",
"newTextArea",
"(",
"String",
"text",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"TextArea",
"area",
"=",
"new",
"TextArea",
"(",
")",
";",
"if",
"(",
"text",
"!=",
"null",
")",
"{",
"area",
".",
"setText",
"... | Creates a text area with all of the configuration that you're bound to want to do.
@param width the width of the text area or -1 to use the default (or CSS styled) width. | [
"Creates",
"a",
"text",
"area",
"with",
"all",
"of",
"the",
"configuration",
"that",
"you",
"re",
"bound",
"to",
"want",
"to",
"do",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L373-L386 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/PlacePickerFragment.java | PlacePickerFragment.onSearchBoxTextChanged | public void onSearchBoxTextChanged(String searchText, boolean forceReloadEventIfSameText) {
"""
Sets the search text and reloads the data in the control. This is used to provide search-box
functionality where the user may be typing or editing text rapidly. It uses a timer to avoid repeated
requerying, preferring... | java | public void onSearchBoxTextChanged(String searchText, boolean forceReloadEventIfSameText) {
if (!forceReloadEventIfSameText && Utility.stringsEqualOrEmpty(this.searchText, searchText)) {
return;
}
if (TextUtils.isEmpty(searchText)) {
searchText = null;
}
... | [
"public",
"void",
"onSearchBoxTextChanged",
"(",
"String",
"searchText",
",",
"boolean",
"forceReloadEventIfSameText",
")",
"{",
"if",
"(",
"!",
"forceReloadEventIfSameText",
"&&",
"Utility",
".",
"stringsEqualOrEmpty",
"(",
"this",
".",
"searchText",
",",
"searchText... | Sets the search text and reloads the data in the control. This is used to provide search-box
functionality where the user may be typing or editing text rapidly. It uses a timer to avoid repeated
requerying, preferring to wait until the user pauses typing to refresh the data. Note that this
method will NOT update the te... | [
"Sets",
"the",
"search",
"text",
"and",
"reloads",
"the",
"data",
"in",
"the",
"control",
".",
"This",
"is",
"used",
"to",
"provide",
"search",
"-",
"box",
"functionality",
"where",
"the",
"user",
"may",
"be",
"typing",
"or",
"editing",
"text",
"rapidly",
... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/PlacePickerFragment.java#L209-L227 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/zip/ZipUtils.java | ZipUtils.newZipEntry | protected static ZipEntry newZipEntry(File zipDirectory, File file) {
"""
Constructs a new {@link ZipEntry} from the given {@link File}.
@param zipDirectory {@link File} referring to the directory being zipped.
@param file {@link File} used to construct the new {@link ZipEntry}.
@return a new {@link ZipEntry}... | java | protected static ZipEntry newZipEntry(File zipDirectory, File file) {
Assert.notNull(file, "File is required");
ZipEntry zipEntry = new ZipEntry(resolveZipEntryName(zipDirectory, file));
zipEntry.setSize(file.getTotalSpace());
zipEntry.setTime(file.lastModified());
return zipEntry;
} | [
"protected",
"static",
"ZipEntry",
"newZipEntry",
"(",
"File",
"zipDirectory",
",",
"File",
"file",
")",
"{",
"Assert",
".",
"notNull",
"(",
"file",
",",
"\"File is required\"",
")",
";",
"ZipEntry",
"zipEntry",
"=",
"new",
"ZipEntry",
"(",
"resolveZipEntryName"... | Constructs a new {@link ZipEntry} from the given {@link File}.
@param zipDirectory {@link File} referring to the directory being zipped.
@param file {@link File} used to construct the new {@link ZipEntry}.
@return a new {@link ZipEntry} constructed from the given {@link File}.
@throws IllegalArgumentException if {@lin... | [
"Constructs",
"a",
"new",
"{",
"@link",
"ZipEntry",
"}",
"from",
"the",
"given",
"{",
"@link",
"File",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/zip/ZipUtils.java#L63-L73 |
liferay/com-liferay-commerce | commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/persistence/impl/CommerceTaxMethodPersistenceImpl.java | CommerceTaxMethodPersistenceImpl.findByG_E | @Override
public CommerceTaxMethod findByG_E(long groupId, String engineKey)
throws NoSuchTaxMethodException {
"""
Returns the commerce tax method where groupId = ? and engineKey = ? or throws a {@link NoSuchTaxMethodException} if it could not be found.
@param groupId the group ID
@param engineKey t... | java | @Override
public CommerceTaxMethod findByG_E(long groupId, String engineKey)
throws NoSuchTaxMethodException {
CommerceTaxMethod commerceTaxMethod = fetchByG_E(groupId, engineKey);
if (commerceTaxMethod == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.app... | [
"@",
"Override",
"public",
"CommerceTaxMethod",
"findByG_E",
"(",
"long",
"groupId",
",",
"String",
"engineKey",
")",
"throws",
"NoSuchTaxMethodException",
"{",
"CommerceTaxMethod",
"commerceTaxMethod",
"=",
"fetchByG_E",
"(",
"groupId",
",",
"engineKey",
")",
";",
... | Returns the commerce tax method where groupId = ? and engineKey = ? or throws a {@link NoSuchTaxMethodException} if it could not be found.
@param groupId the group ID
@param engineKey the engine key
@return the matching commerce tax method
@throws NoSuchTaxMethodException if a matching commerce tax method coul... | [
"Returns",
"the",
"commerce",
"tax",
"method",
"where",
"groupId",
"=",
"?",
";",
"and",
"engineKey",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchTaxMethodException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/persistence/impl/CommerceTaxMethodPersistenceImpl.java#L624-L650 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.replaceFirst | public static String replaceFirst(CharSequence self, Pattern pattern, CharSequence replacement) {
"""
Replaces the first substring of a CharSequence that matches the given
compiled regular expression with the given replacement.
<p>
Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in the
replace... | java | public static String replaceFirst(CharSequence self, Pattern pattern, CharSequence replacement) {
return pattern.matcher(self).replaceFirst(replacement.toString());
} | [
"public",
"static",
"String",
"replaceFirst",
"(",
"CharSequence",
"self",
",",
"Pattern",
"pattern",
",",
"CharSequence",
"replacement",
")",
"{",
"return",
"pattern",
".",
"matcher",
"(",
"self",
")",
".",
"replaceFirst",
"(",
"replacement",
".",
"toString",
... | Replaces the first substring of a CharSequence that matches the given
compiled regular expression with the given replacement.
<p>
Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in the
replacement string may cause the results to be different than if it were
being treated as a literal replacement string... | [
"Replaces",
"the",
"first",
"substring",
"of",
"a",
"CharSequence",
"that",
"matches",
"the",
"given",
"compiled",
"regular",
"expression",
"with",
"the",
"given",
"replacement",
".",
"<p",
">",
"Note",
"that",
"backslashes",
"(",
"<tt",
">",
"\\",
"<",
"/",... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L2679-L2681 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.beginRunCommand | public RunCommandResultInner beginRunCommand(String resourceGroupName, String vmName, RunCommandInput parameters) {
"""
Run command on the VM.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Run command operat... | java | public RunCommandResultInner beginRunCommand(String resourceGroupName, String vmName, RunCommandInput parameters) {
return beginRunCommandWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().body();
} | [
"public",
"RunCommandResultInner",
"beginRunCommand",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"RunCommandInput",
"parameters",
")",
"{",
"return",
"beginRunCommandWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmName",
",",
"parameters"... | Run command on the VM.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Run command operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is re... | [
"Run",
"command",
"on",
"the",
"VM",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L2703-L2705 |
jfinal/jfinal | src/main/java/com/jfinal/template/stat/Lexer.java | Lexer.addIdParaToken | boolean addIdParaToken(Token idToken, Token paraToken) {
"""
带参指令处于独立行时删除前后空白字符,并且再删除一个后续的换行符
处于独立行是指:向前看无有用内容,在前面情况成立的基础之上
再向后看如果也无可用内容,前一个条件成立才开执行后续动作
向前看时 forward 在移动,意味着正在删除空白字符(通过 lookForwardLineFeed()方法)
向后看时也会在碰到空白 + '\n' 时删空白字符 (通过 deletePreviousTextTokenBlankTails()方法)
"""
tokens.add(idToken)... | java | boolean addIdParaToken(Token idToken, Token paraToken) {
tokens.add(idToken);
tokens.add(paraToken);
// if (lookForwardLineFeed() && (deletePreviousTextTokenBlankTails() || lexemeBegin == 0)) {
if (lookForwardLineFeedAndEof() && deletePreviousTextTokenBlankTails()) {
prepareNextScan(peek() != EOF ? ... | [
"boolean",
"addIdParaToken",
"(",
"Token",
"idToken",
",",
"Token",
"paraToken",
")",
"{",
"tokens",
".",
"add",
"(",
"idToken",
")",
";",
"tokens",
".",
"add",
"(",
"paraToken",
")",
";",
"// if (lookForwardLineFeed() && (deletePreviousTextTokenBlankTails() || lexeme... | 带参指令处于独立行时删除前后空白字符,并且再删除一个后续的换行符
处于独立行是指:向前看无有用内容,在前面情况成立的基础之上
再向后看如果也无可用内容,前一个条件成立才开执行后续动作
向前看时 forward 在移动,意味着正在删除空白字符(通过 lookForwardLineFeed()方法)
向后看时也会在碰到空白 + '\n' 时删空白字符 (通过 deletePreviousTextTokenBlankTails()方法) | [
"带参指令处于独立行时删除前后空白字符,并且再删除一个后续的换行符",
"处于独立行是指:向前看无有用内容,在前面情况成立的基础之上",
"再向后看如果也无可用内容,前一个条件成立才开执行后续动作"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/template/stat/Lexer.java#L508-L520 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/zone/ZoneRules.java | ZoneRules.findOffsetInfo | private Object findOffsetInfo(LocalDateTime dt, ZoneOffsetTransition trans) {
"""
Finds the offset info for a local date-time and transition.
@param dt the date-time, not null
@param trans the transition, not null
@return the offset info, not null
"""
LocalDateTime localTransition = trans.getDat... | java | private Object findOffsetInfo(LocalDateTime dt, ZoneOffsetTransition trans) {
LocalDateTime localTransition = trans.getDateTimeBefore();
if (trans.isGap()) {
if (dt.isBefore(localTransition)) {
return trans.getOffsetBefore();
}
if (dt.isBefore(trans.ge... | [
"private",
"Object",
"findOffsetInfo",
"(",
"LocalDateTime",
"dt",
",",
"ZoneOffsetTransition",
"trans",
")",
"{",
"LocalDateTime",
"localTransition",
"=",
"trans",
".",
"getDateTimeBefore",
"(",
")",
";",
"if",
"(",
"trans",
".",
"isGap",
"(",
")",
")",
"{",
... | Finds the offset info for a local date-time and transition.
@param dt the date-time, not null
@param trans the transition, not null
@return the offset info, not null | [
"Finds",
"the",
"offset",
"info",
"for",
"a",
"local",
"date",
"-",
"time",
"and",
"transition",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/zone/ZoneRules.java#L692-L713 |
JCTools/JCTools | jctools-experimental/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java | MpscRelaxedArrayQueue.validateProducerClaim | private boolean validateProducerClaim(
final int activeCycleIndex,
final long producerCycleClaim,
final long cycleId,
final int positionOnCycle,
final int cycleLengthLog2,
final boolean slowProducer) {
"""
Validate a producer claim to find out if is an overclaim (bey... | java | private boolean validateProducerClaim(
final int activeCycleIndex,
final long producerCycleClaim,
final long cycleId,
final int positionOnCycle,
final int cycleLengthLog2,
final boolean slowProducer)
{
final long producerPosition = producerPosition(positionOnC... | [
"private",
"boolean",
"validateProducerClaim",
"(",
"final",
"int",
"activeCycleIndex",
",",
"final",
"long",
"producerCycleClaim",
",",
"final",
"long",
"cycleId",
",",
"final",
"int",
"positionOnCycle",
",",
"final",
"int",
"cycleLengthLog2",
",",
"final",
"boolea... | Validate a producer claim to find out if is an overclaim (beyond the producer limit).
@return {@code true} if the claim is valid, {@code false} otherwise. | [
"Validate",
"a",
"producer",
"claim",
"to",
"find",
"out",
"if",
"is",
"an",
"overclaim",
"(",
"beyond",
"the",
"producer",
"limit",
")",
"."
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-experimental/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java#L380-L399 |
JodaOrg/joda-money | src/main/java/org/joda/money/Money.java | Money.withAmount | public Money withAmount(double amount, RoundingMode roundingMode) {
"""
Returns a copy of this monetary value with the specified amount using a well-defined
conversion from a {@code double}.
<p>
The returned instance will have this currency and the new amount.
If the scale of the {@code BigDecimal} needs to be... | java | public Money withAmount(double amount, RoundingMode roundingMode) {
return with(money.withAmount(amount).withCurrencyScale(roundingMode));
} | [
"public",
"Money",
"withAmount",
"(",
"double",
"amount",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"with",
"(",
"money",
".",
"withAmount",
"(",
"amount",
")",
".",
"withCurrencyScale",
"(",
"roundingMode",
")",
")",
";",
"}"
] | Returns a copy of this monetary value with the specified amount using a well-defined
conversion from a {@code double}.
<p>
The returned instance will have this currency and the new amount.
If the scale of the {@code BigDecimal} needs to be adjusted, then
it will be rounded using the specified mode.
<p>
The amount is co... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"with",
"the",
"specified",
"amount",
"using",
"a",
"well",
"-",
"defined",
"conversion",
"from",
"a",
"{",
"@code",
"double",
"}",
".",
"<p",
">",
"The",
"returned",
"instance",
"will",
"have",
... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/Money.java#L706-L708 |
BeholderTAF/beholder-selenium | src/main/java/br/ufmg/dcc/saotome/beholder/selenium/ui/form/SeleniumSelectField.java | SeleniumSelectField.isSame | private boolean isSame(Option option1, Option option2) {
"""
This method makes easy to compare between two option components. There are 2 rules
implemented:<br/>
- only class attributes not null in both classes are evaluated;<br/>
- all evaluable attributes must be equals.
@return Returns true only if the 2 ru... | java | private boolean isSame(Option option1, Option option2) {
if (option1 == null || option2 == null) {
return false;
} if (option1.equals(option2)) {
return true;
}
String index1 = (option1.getIndex() == null)?null:Integer.toString(option1.getIndex()),
index2 = (option2.getIndex() == null)?null:Int... | [
"private",
"boolean",
"isSame",
"(",
"Option",
"option1",
",",
"Option",
"option2",
")",
"{",
"if",
"(",
"option1",
"==",
"null",
"||",
"option2",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"option1",
".",
"equals",
"(",
"option2",... | This method makes easy to compare between two option components. There are 2 rules
implemented:<br/>
- only class attributes not null in both classes are evaluated;<br/>
- all evaluable attributes must be equals.
@return Returns true only if the 2 rules above are true. Otherwise the return is false. | [
"This",
"method",
"makes",
"easy",
"to",
"compare",
"between",
"two",
"option",
"components",
".",
"There",
"are",
"2",
"rules",
"implemented",
":",
"<br",
"/",
">",
"-",
"only",
"class",
"attributes",
"not",
"null",
"in",
"both",
"classes",
"are",
"evalua... | train | https://github.com/BeholderTAF/beholder-selenium/blob/8dc999e74a9c3f5c09e4e68ea0ef5634cdb760ee/src/main/java/br/ufmg/dcc/saotome/beholder/selenium/ui/form/SeleniumSelectField.java#L161-L177 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/CcgGrammarUtils.java | CcgGrammarUtils.buildUnrestrictedBinaryDistribution | public static DiscreteFactor buildUnrestrictedBinaryDistribution(DiscreteVariable syntaxType,
Iterable<CcgBinaryRule> rules, boolean allowComposition) {
"""
Constructs a distribution over binary combination rules for CCG,
given a set of syntactic categories. This method compiles out all
of the possible way... | java | public static DiscreteFactor buildUnrestrictedBinaryDistribution(DiscreteVariable syntaxType,
Iterable<CcgBinaryRule> rules, boolean allowComposition) {
List<HeadedSyntacticCategory> allCategories = syntaxType.getValuesWithCast(HeadedSyntacticCategory.class);
Set<List<Object>> validOutcomes = Sets.newHash... | [
"public",
"static",
"DiscreteFactor",
"buildUnrestrictedBinaryDistribution",
"(",
"DiscreteVariable",
"syntaxType",
",",
"Iterable",
"<",
"CcgBinaryRule",
">",
"rules",
",",
"boolean",
"allowComposition",
")",
"{",
"List",
"<",
"HeadedSyntacticCategory",
">",
"allCategori... | Constructs a distribution over binary combination rules for CCG,
given a set of syntactic categories. This method compiles out all
of the possible ways to combine two adjacent CCG categories using
function application, composition, and any other binary rules.
@param syntaxType
@param rules
@param allowComposition
@ret... | [
"Constructs",
"a",
"distribution",
"over",
"binary",
"combination",
"rules",
"for",
"CCG",
"given",
"a",
"set",
"of",
"syntactic",
"categories",
".",
"This",
"method",
"compiles",
"out",
"all",
"of",
"the",
"possible",
"ways",
"to",
"combine",
"two",
"adjacent... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgGrammarUtils.java#L139-L162 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/project/DirectoryFlowLoader.java | DirectoryFlowLoader.loadProjectFlow | @Override
public ValidationReport loadProjectFlow(final Project project, final File projectDir) {
"""
Loads all project flows from the directory.
@param project The project.
@param projectDir The directory to load flows from.
@return the validation report.
"""
this.propsList = new ArrayList<>();
... | java | @Override
public ValidationReport loadProjectFlow(final Project project, final File projectDir) {
this.propsList = new ArrayList<>();
this.flowPropsList = new ArrayList<>();
this.jobPropsMap = new HashMap<>();
this.nodeMap = new HashMap<>();
this.duplicateJobs = new HashSet<>();
this.nodeDepen... | [
"@",
"Override",
"public",
"ValidationReport",
"loadProjectFlow",
"(",
"final",
"Project",
"project",
",",
"final",
"File",
"projectDir",
")",
"{",
"this",
".",
"propsList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"this",
".",
"flowPropsList",
"=",
"ne... | Loads all project flows from the directory.
@param project The project.
@param projectDir The directory to load flows from.
@return the validation report. | [
"Loads",
"all",
"project",
"flows",
"from",
"the",
"directory",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/DirectoryFlowLoader.java#L119-L146 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_owo_field_DELETE | public void serviceName_owo_field_DELETE(String serviceName, net.minidev.ovh.api.domain.OvhWhoisObfuscatorFieldsEnum field) throws IOException {
"""
Delete a whois obfuscator
REST: DELETE /domain/{serviceName}/owo/{field}
@param serviceName [required] The internal name of your domain
@param field [required] O... | java | public void serviceName_owo_field_DELETE(String serviceName, net.minidev.ovh.api.domain.OvhWhoisObfuscatorFieldsEnum field) throws IOException {
String qPath = "/domain/{serviceName}/owo/{field}";
StringBuilder sb = path(qPath, serviceName, field);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_owo_field_DELETE",
"(",
"String",
"serviceName",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"domain",
".",
"OvhWhoisObfuscatorFieldsEnum",
"field",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{... | Delete a whois obfuscator
REST: DELETE /domain/{serviceName}/owo/{field}
@param serviceName [required] The internal name of your domain
@param field [required] Obfuscated field | [
"Delete",
"a",
"whois",
"obfuscator"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1486-L1490 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/util/FileUtils.java | FileUtils.getResourceNames | public static Set<String> getResourceNames(File dir) {
"""
Returns the resource names contained in a directory, and for directory
resource, a trailing '/' is added
@param dir
the directory
@return the resource names
"""
Set<String> resourceNames = new HashSet<String>();
// If the path is not valid ... | java | public static Set<String> getResourceNames(File dir) {
Set<String> resourceNames = new HashSet<String>();
// If the path is not valid throw an exception
String[] resArray = dir.list();
if (resArray != null) {
// Make the returned dirs end with '/', to match a servletcontext
// behavior.
for (int i =... | [
"public",
"static",
"Set",
"<",
"String",
">",
"getResourceNames",
"(",
"File",
"dir",
")",
"{",
"Set",
"<",
"String",
">",
"resourceNames",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"// If the path is not valid throw an exception",
"String",
"... | Returns the resource names contained in a directory, and for directory
resource, a trailing '/' is added
@param dir
the directory
@return the resource names | [
"Returns",
"the",
"resource",
"names",
"contained",
"in",
"a",
"directory",
"and",
"for",
"directory",
"resource",
"a",
"trailing",
"/",
"is",
"added"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/util/FileUtils.java#L498-L515 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/log/InMemoryLogger.java | InMemoryLogger.createLogMessage | @Nullable
@OverrideOnDemand
protected LogMessage createLogMessage (@Nonnull final IErrorLevel eErrorLevel,
@Nonnull final Serializable aMsg,
@Nullable final Throwable t) {
"""
Override this method to create a different LogMessage... | java | @Nullable
@OverrideOnDemand
protected LogMessage createLogMessage (@Nonnull final IErrorLevel eErrorLevel,
@Nonnull final Serializable aMsg,
@Nullable final Throwable t)
{
return new LogMessage (eErrorLevel, aMsg, t);
} | [
"@",
"Nullable",
"@",
"OverrideOnDemand",
"protected",
"LogMessage",
"createLogMessage",
"(",
"@",
"Nonnull",
"final",
"IErrorLevel",
"eErrorLevel",
",",
"@",
"Nonnull",
"final",
"Serializable",
"aMsg",
",",
"@",
"Nullable",
"final",
"Throwable",
"t",
")",
"{",
... | Override this method to create a different LogMessage object or to filter
certain log messages.
@param eErrorLevel
Error level. Never <code>null</code>.
@param aMsg
The message object. Never <code>null</code>.
@param t
An optional exception. May be <code>null</code>.
@return The returned value. May be <code>null</code... | [
"Override",
"this",
"method",
"to",
"create",
"a",
"different",
"LogMessage",
"object",
"or",
"to",
"filter",
"certain",
"log",
"messages",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/log/InMemoryLogger.java#L63-L70 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/thrift/ThriftClient.java | ThriftClient.build | public static ThriftClient build(String host, int port) throws TException {
"""
Returns a new client for the specified host.
@param host the Cassandra host address.
@param port the Cassandra host RPC port.
@return a new client for the specified host.
@throws TException if there is any problem with the {@code... | java | public static ThriftClient build(String host, int port) throws TException {
return build(host, port, null);
} | [
"public",
"static",
"ThriftClient",
"build",
"(",
"String",
"host",
",",
"int",
"port",
")",
"throws",
"TException",
"{",
"return",
"build",
"(",
"host",
",",
"port",
",",
"null",
")",
";",
"}"
] | Returns a new client for the specified host.
@param host the Cassandra host address.
@param port the Cassandra host RPC port.
@return a new client for the specified host.
@throws TException if there is any problem with the {@code set_keyspace} call. | [
"Returns",
"a",
"new",
"client",
"for",
"the",
"specified",
"host",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/thrift/ThriftClient.java#L72-L74 |
bwkimmel/java-util | src/main/java/ca/eandb/util/args/ArgumentProcessor.java | ArgumentProcessor.processOptionField | private void processOptionField(Field field, String key, char shortKey) {
"""
Adds an option for the specified field having the given
{@link OptionArgument} annotation.
@param field The <code>Field</code> to add the option for.
@param key The key that triggers the option.
@param shortKey the shorthand alternat... | java | private void processOptionField(Field field, String key, char shortKey) {
String name = field.getName();
Class<?> type = field.getType();
if (key.equals("")) {
key = name;
}
if (shortKey == '\0') {
shortKey = key.charAt(0);
}
Command<? super T> option = createOption(name, type... | [
"private",
"void",
"processOptionField",
"(",
"Field",
"field",
",",
"String",
"key",
",",
"char",
"shortKey",
")",
"{",
"String",
"name",
"=",
"field",
".",
"getName",
"(",
")",
";",
"Class",
"<",
"?",
">",
"type",
"=",
"field",
".",
"getType",
"(",
... | Adds an option for the specified field having the given
{@link OptionArgument} annotation.
@param field The <code>Field</code> to add the option for.
@param key The key that triggers the option.
@param shortKey the shorthand alternative key that triggers the option. | [
"Adds",
"an",
"option",
"for",
"the",
"specified",
"field",
"having",
"the",
"given",
"{"
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/args/ArgumentProcessor.java#L254-L268 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/internal/core/metadata/token/ByteOrderedTokenRange.java | ByteOrderedTokenRange.toBigInteger | private BigInteger toBigInteger(ByteBuffer bb, int significantBytes) {
"""
For example if the token is 0x01 but significantBytes is 2, the result is 8 (0x0100).
"""
byte[] bytes = Bytes.getArray(bb);
byte[] target;
if (significantBytes != bytes.length) {
target = new byte[significantBytes];
... | java | private BigInteger toBigInteger(ByteBuffer bb, int significantBytes) {
byte[] bytes = Bytes.getArray(bb);
byte[] target;
if (significantBytes != bytes.length) {
target = new byte[significantBytes];
System.arraycopy(bytes, 0, target, 0, bytes.length);
} else {
target = bytes;
}
... | [
"private",
"BigInteger",
"toBigInteger",
"(",
"ByteBuffer",
"bb",
",",
"int",
"significantBytes",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"Bytes",
".",
"getArray",
"(",
"bb",
")",
";",
"byte",
"[",
"]",
"target",
";",
"if",
"(",
"significantBytes",
"!=... | For example if the token is 0x01 but significantBytes is 2, the result is 8 (0x0100). | [
"For",
"example",
"if",
"the",
"token",
"is",
"0x01",
"but",
"significantBytes",
"is",
"2",
"the",
"result",
"is",
"8",
"(",
"0x0100",
")",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/metadata/token/ByteOrderedTokenRange.java#L107-L117 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.searchServices_GET | public ArrayList<OvhTelephonySearchService> searchServices_GET(String axiom) throws IOException {
"""
Search a service with its domain, to get its billing account and type
REST: GET /telephony/searchServices
@param axiom [required] Filter the value of property (like)
"""
String qPath = "/telephony/searc... | java | public ArrayList<OvhTelephonySearchService> searchServices_GET(String axiom) throws IOException {
String qPath = "/telephony/searchServices";
StringBuilder sb = path(qPath);
query(sb, "axiom", axiom);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t20);
} | [
"public",
"ArrayList",
"<",
"OvhTelephonySearchService",
">",
"searchServices_GET",
"(",
"String",
"axiom",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/searchServices\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
... | Search a service with its domain, to get its billing account and type
REST: GET /telephony/searchServices
@param axiom [required] Filter the value of property (like) | [
"Search",
"a",
"service",
"with",
"its",
"domain",
"to",
"get",
"its",
"billing",
"account",
"and",
"type"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8611-L8617 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/resources/Downloader.java | Downloader.downloadAndExtract | public static void downloadAndExtract(String name, URL url, File f, File extractToDir, String targetMD5, int maxTries) throws IOException {
"""
Download the specified URL to the specified file, verify that the MD5 matches, and then extract it to the specified directory.<br>
Note that the file must be an archive, ... | java | public static void downloadAndExtract(String name, URL url, File f, File extractToDir, String targetMD5, int maxTries) throws IOException {
downloadAndExtract(0, maxTries, name, url, f, extractToDir, targetMD5);
} | [
"public",
"static",
"void",
"downloadAndExtract",
"(",
"String",
"name",
",",
"URL",
"url",
",",
"File",
"f",
",",
"File",
"extractToDir",
",",
"String",
"targetMD5",
",",
"int",
"maxTries",
")",
"throws",
"IOException",
"{",
"downloadAndExtract",
"(",
"0",
... | Download the specified URL to the specified file, verify that the MD5 matches, and then extract it to the specified directory.<br>
Note that the file must be an archive, with the correct file extension: .zip, .jar, .tar.gz, .tgz or .gz
@param name Name (mainly for providing useful exceptions)
@param url ... | [
"Download",
"the",
"specified",
"URL",
"to",
"the",
"specified",
"file",
"verify",
"that",
"the",
"MD5",
"matches",
"and",
"then",
"extract",
"it",
"to",
"the",
"specified",
"directory",
".",
"<br",
">",
"Note",
"that",
"the",
"file",
"must",
"be",
"an",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/resources/Downloader.java#L82-L84 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLNegativeDataPropertyAssertionAxiomImpl_CustomFieldSerializer.java | OWLNegativeDataPropertyAssertionAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLNegativeDataPropertyAssertionAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@l... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLNegativeDataPropertyAssertionAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLNegativeDataPropertyAssertionAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",... | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLNegativeDataPropertyAssertionAxiomImpl_CustomFieldSerializer.java#L78-L81 |
ops4j/org.ops4j.pax.swissbox | pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java | ServiceLookup.getService | public static <T> T getService( BundleContext bc, Class<T> type, Map<String, String> props ) {
"""
Returns a service matching the given criteria.
@param <T> class implemented or extended by the service
@param bc bundle context for accessing the OSGi registry
@param type class implemented or extended by the se... | java | public static <T> T getService( BundleContext bc, Class<T> type, Map<String, String> props )
{
return getService( bc, type, DEFAULT_TIMEOUT, props );
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getService",
"(",
"BundleContext",
"bc",
",",
"Class",
"<",
"T",
">",
"type",
",",
"Map",
"<",
"String",
",",
"String",
">",
"props",
")",
"{",
"return",
"getService",
"(",
"bc",
",",
"type",
",",
"DEFAULT_TIM... | Returns a service matching the given criteria.
@param <T> class implemented or extended by the service
@param bc bundle context for accessing the OSGi registry
@param type class implemented or extended by the service
@param props properties to be matched by the service
@return matching service (not null)
@throws Servi... | [
"Returns",
"a",
"service",
"matching",
"the",
"given",
"criteria",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java#L85-L88 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java | KeyVaultClientImpl.deleteKeyAsync | public ServiceFuture<KeyBundle> deleteKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<KeyBundle> serviceCallback) {
"""
Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptogra... | java | public ServiceFuture<KeyBundle> deleteKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<KeyBundle> serviceCallback) {
return ServiceFuture.fromResponse(deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"KeyBundle",
">",
"deleteKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"final",
"ServiceCallback",
"<",
"KeyBundle",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromResponse",
"(",
"... | Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorizatio... | [
"Deletes",
"a",
"key",
"of",
"any",
"type",
"from",
"storage",
"in",
"Azure",
"Key",
"Vault",
".",
"The",
"delete",
"key",
"operation",
"cannot",
"be",
"used",
"to",
"remove",
"individual",
"versions",
"of",
"a",
"key",
".",
"This",
"operation",
"removes",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java#L848-L850 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java | BlobContainersInner.deleteImmutabilityPolicy | public ImmutabilityPolicyInner deleteImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch) {
"""
Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Delet... | java | public ImmutabilityPolicyInner deleteImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch) {
return deleteImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).toBlocking().single().body();
} | [
"public",
"ImmutabilityPolicyInner",
"deleteImmutabilityPolicy",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"containerName",
",",
"String",
"ifMatch",
")",
"{",
"return",
"deleteImmutabilityPolicyWithServiceResponseAsync",
"(",
"resourceG... | Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container.
@param resourceGro... | [
"Aborts",
"an",
"unlocked",
"immutability",
"policy",
".",
"The",
"response",
"of",
"delete",
"has",
"immutabilityPeriodSinceCreationInDays",
"set",
"to",
"0",
".",
"ETag",
"in",
"If",
"-",
"Match",
"is",
"required",
"for",
"this",
"operation",
".",
"Deleting",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java#L1385-L1387 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/Convert.java | Convert.convertByClassName | @SuppressWarnings("unchecked")
public static <T> T convertByClassName(String className, Object value) throws ConvertException {
"""
转换值为指定类型,类型采用字符串表示
@param <T> 目标类型
@param className 类的字符串表示
@param value 值
@return 转换后的值
@since 4.0.7
@throws ConvertException 转换器不存在
"""
return (T) convert(ClassUtil... | java | @SuppressWarnings("unchecked")
public static <T> T convertByClassName(String className, Object value) throws ConvertException{
return (T) convert(ClassUtil.loadClass(className), value);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"convertByClassName",
"(",
"String",
"className",
",",
"Object",
"value",
")",
"throws",
"ConvertException",
"{",
"return",
"(",
"T",
")",
"convert",
"(",
"ClassUtil",
... | 转换值为指定类型,类型采用字符串表示
@param <T> 目标类型
@param className 类的字符串表示
@param value 值
@return 转换后的值
@since 4.0.7
@throws ConvertException 转换器不存在 | [
"转换值为指定类型,类型采用字符串表示"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L539-L542 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java | DwgUtil.getRawLong | public static Vector getRawLong(int[] data, int offset) {
"""
Read a long value from a group of unsigned bytes
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is found in the DWG file... | java | public static Vector getRawLong(int[] data, int offset) {
Vector v = new Vector();
// TODO: Incorrecto. Repasar ...
// _val = struct.unpack('<l', _long)[0]
int val = 0;
v.add(new Integer(offset+32));
v.add(new Integer(val));
return v;
} | [
"public",
"static",
"Vector",
"getRawLong",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"Vector",
"v",
"=",
"new",
"Vector",
"(",
")",
";",
"// TODO: Incorrecto. Repasar ...",
"// _val = struct.unpack('<l', _long)[0]",
"int",
"val",
"=",
"0",
... | Read a long value from a group of unsigned bytes
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.
@return Vector This vecto... | [
"Read",
"a",
"long",
"value",
"from",
"a",
"group",
"of",
"unsigned",
"bytes"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java#L388-L396 |
beangle/beangle3 | commons/model/src/main/java/org/beangle/commons/transfer/exporter/DefaultPropertyExtractor.java | DefaultPropertyExtractor.getPropertyIn | public String getPropertyIn(Collection<?> collection, String property) throws Exception {
"""
<p>
getPropertyIn.
</p>
@param collection a {@link java.util.Collection} object.
@param property a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
@throws java.lang.Exception if any.
... | java | public String getPropertyIn(Collection<?> collection, String property) throws Exception {
StringBuilder sb = new StringBuilder();
if (null != collection) {
for (Iterator<?> iter = collection.iterator(); iter.hasNext();) {
Object one = iter.next();
sb.append(extract(one, property)).append("... | [
"public",
"String",
"getPropertyIn",
"(",
"Collection",
"<",
"?",
">",
"collection",
",",
"String",
"property",
")",
"throws",
"Exception",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"collection",
")",
... | <p>
getPropertyIn.
</p>
@param collection a {@link java.util.Collection} object.
@param property a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
@throws java.lang.Exception if any. | [
"<p",
">",
"getPropertyIn",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/model/src/main/java/org/beangle/commons/transfer/exporter/DefaultPropertyExtractor.java#L102-L115 |
haifengl/smile | data/src/main/java/smile/data/BinarySparseDataset.java | BinarySparseDataset.get | public int get(int i, int j) {
"""
Returns the value at entry (i, j) by binary search.
@param i the row index.
@param j the column index.
"""
if (i < 0 || i >= size()) {
throw new IllegalArgumentException("Invalid index: i = " + i);
}
int[] x = get(i).x;
if (x.len... | java | public int get(int i, int j) {
if (i < 0 || i >= size()) {
throw new IllegalArgumentException("Invalid index: i = " + i);
}
int[] x = get(i).x;
if (x.length == 0) {
return 0;
}
int low = 0;
int high = x.length - 1;
int mid... | [
"public",
"int",
"get",
"(",
"int",
"i",
",",
"int",
"j",
")",
"{",
"if",
"(",
"i",
"<",
"0",
"||",
"i",
">=",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid index: i = \"",
"+",
"i",
")",
";",
"}",
"int",
... | Returns the value at entry (i, j) by binary search.
@param i the row index.
@param j the column index. | [
"Returns",
"the",
"value",
"at",
"entry",
"(",
"i",
"j",
")",
"by",
"binary",
"search",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/data/src/main/java/smile/data/BinarySparseDataset.java#L133-L160 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/util/ImageUtil.java | ImageUtil.createSquareImage | public static Image createSquareImage(String id, String location, double horMargin, double verMargin, double d) {
"""
Creates an {@link Image} with full opacity (new PictureStyle(1)).
horMargin, verMargin and diameter are used to create the {@link Bbox}
@param id is used to create the actual {@link Image} (new I... | java | public static Image createSquareImage(String id, String location, double horMargin, double verMargin, double d) {
return createRectangleImage(id, location, horMargin, verMargin, d, d);
} | [
"public",
"static",
"Image",
"createSquareImage",
"(",
"String",
"id",
",",
"String",
"location",
",",
"double",
"horMargin",
",",
"double",
"verMargin",
",",
"double",
"d",
")",
"{",
"return",
"createRectangleImage",
"(",
"id",
",",
"location",
",",
"horMargi... | Creates an {@link Image} with full opacity (new PictureStyle(1)).
horMargin, verMargin and diameter are used to create the {@link Bbox}
@param id is used to create the actual {@link Image} (new Image(id)).
@param url
@param horMargin
@param verMargin
@param width
@param height
@return | [
"Creates",
"an",
"{"
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/util/ImageUtil.java#L61-L63 |
phax/ph-commons | ph-json/src/main/java/com/helger/json/serialize/JsonReader.java | JsonReader.isValidJson | public static boolean isValidJson (@Nonnull final File aFile, @Nonnull final Charset aFallbackCharset) {
"""
Check if the passed File can be resembled to valid Json content. This is
accomplished by fully parsing the Json file each time the method is called.
This consumes <b>less memory</b> than calling any of th... | java | public static boolean isValidJson (@Nonnull final File aFile, @Nonnull final Charset aFallbackCharset)
{
return isValidJson (new FileSystemResource (aFile), aFallbackCharset);
} | [
"public",
"static",
"boolean",
"isValidJson",
"(",
"@",
"Nonnull",
"final",
"File",
"aFile",
",",
"@",
"Nonnull",
"final",
"Charset",
"aFallbackCharset",
")",
"{",
"return",
"isValidJson",
"(",
"new",
"FileSystemResource",
"(",
"aFile",
")",
",",
"aFallbackChars... | Check if the passed File can be resembled to valid Json content. This is
accomplished by fully parsing the Json file each time the method is called.
This consumes <b>less memory</b> than calling any of the
<code>read...</code> methods and checking for a non-<code>null</code>
result.
@param aFile
The file to be parsed.... | [
"Check",
"if",
"the",
"passed",
"File",
"can",
"be",
"resembled",
"to",
"valid",
"Json",
"content",
".",
"This",
"is",
"accomplished",
"by",
"fully",
"parsing",
"the",
"Json",
"file",
"each",
"time",
"the",
"method",
"is",
"called",
".",
"This",
"consumes"... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L221-L224 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GroupApi.java | GroupApi.removeMember | public void removeMember(Object groupIdOrPath, Integer userId) throws GitLabApiException {
"""
Removes member from the group.
<pre><code>GitLab Endpoint: DELETE /groups/:id/members/:user_id</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path, re... | java | public void removeMember(Object groupIdOrPath, Integer userId) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "groups", getGroupIdOrPath(groupIdOrPath), "members", userId);
} | [
"public",
"void",
"removeMember",
"(",
"Object",
"groupIdOrPath",
",",
"Integer",
"userId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
".",
"Status",
"expectedStatus",
"=",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
"?",
"Response",
".",
... | Removes member from the group.
<pre><code>GitLab Endpoint: DELETE /groups/:id/members/:user_id</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path, required
@param userId the user ID of the member to remove
@throws GitLabApiException if any exception occ... | [
"Removes",
"member",
"from",
"the",
"group",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GroupApi.java#L896-L899 |
apereo/cas | core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/handler/support/AbstractPreAndPostProcessingAuthenticationHandler.java | AbstractPreAndPostProcessingAuthenticationHandler.createHandlerResult | protected AuthenticationHandlerExecutionResult createHandlerResult(final @NonNull Credential credential,
final @NonNull Principal principal,
final @NonNull List<MessageDescriptor... | java | protected AuthenticationHandlerExecutionResult createHandlerResult(final @NonNull Credential credential,
final @NonNull Principal principal,
final @NonNull List<MessageDescriptor... | [
"protected",
"AuthenticationHandlerExecutionResult",
"createHandlerResult",
"(",
"final",
"@",
"NonNull",
"Credential",
"credential",
",",
"final",
"@",
"NonNull",
"Principal",
"principal",
",",
"final",
"@",
"NonNull",
"List",
"<",
"MessageDescriptor",
">",
"warnings",... | Helper method to construct a handler result
on successful authentication events.
@param credential the credential on which the authentication was successfully performed.
Note that this credential instance may be different from what was originally provided
as transformation of the username may have occurred, if one is ... | [
"Helper",
"method",
"to",
"construct",
"a",
"handler",
"result",
"on",
"successful",
"authentication",
"events",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/handler/support/AbstractPreAndPostProcessingAuthenticationHandler.java#L68-L72 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.clipByNorm | public SDVariable clipByNorm(SDVariable x, double clipValue, int... dimensions) {
"""
Clipping by L2 norm, optionally along dimension(s)<br>
if l2Norm(x,dimension) < clipValue, then input is returned unmodifed<br>
Otherwise, out[i] = in[i] * clipValue / l2Norm(in, dimensions) where each value is clipped accordin... | java | public SDVariable clipByNorm(SDVariable x, double clipValue, int... dimensions) {
return clipByNorm(null, x, clipValue, dimensions);
} | [
"public",
"SDVariable",
"clipByNorm",
"(",
"SDVariable",
"x",
",",
"double",
"clipValue",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"clipByNorm",
"(",
"null",
",",
"x",
",",
"clipValue",
",",
"dimensions",
")",
";",
"}"
] | Clipping by L2 norm, optionally along dimension(s)<br>
if l2Norm(x,dimension) < clipValue, then input is returned unmodifed<br>
Otherwise, out[i] = in[i] * clipValue / l2Norm(in, dimensions) where each value is clipped according
to the corresponding l2Norm along the specified dimensions
@param x Input variabl... | [
"Clipping",
"by",
"L2",
"norm",
"optionally",
"along",
"dimension",
"(",
"s",
")",
"<br",
">",
"if",
"l2Norm",
"(",
"x",
"dimension",
")",
"<",
"clipValue",
"then",
"input",
"is",
"returned",
"unmodifed<br",
">",
"Otherwise",
"out",
"[",
"i",
"]",
"=",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L414-L416 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/TableCompactor.java | TableCompactor.parseEntries | @SneakyThrows(IOException.class)
private CompactionArgs parseEntries(InputStream input, long startOffset, int maxLength) {
"""
Parses out a {@link CompactionArgs} object containing Compaction {@link Candidate}s from the given InputStream
representing Segment data.
@param input An InputStream represen... | java | @SneakyThrows(IOException.class)
private CompactionArgs parseEntries(InputStream input, long startOffset, int maxLength) {
val entries = new HashMap<UUID, CandidateSet>();
int count = 0;
long nextOffset = startOffset;
final long maxOffset = startOffset + maxLength;
try {
... | [
"@",
"SneakyThrows",
"(",
"IOException",
".",
"class",
")",
"private",
"CompactionArgs",
"parseEntries",
"(",
"InputStream",
"input",
",",
"long",
"startOffset",
",",
"int",
"maxLength",
")",
"{",
"val",
"entries",
"=",
"new",
"HashMap",
"<",
"UUID",
",",
"C... | Parses out a {@link CompactionArgs} object containing Compaction {@link Candidate}s from the given InputStream
representing Segment data.
@param input An InputStream representing a continuous range of bytes in the Segment.
@param startOffset The offset at which the InputStream begins. This should be the Compacti... | [
"Parses",
"out",
"a",
"{",
"@link",
"CompactionArgs",
"}",
"object",
"containing",
"Compaction",
"{",
"@link",
"Candidate",
"}",
"s",
"from",
"the",
"given",
"InputStream",
"representing",
"Segment",
"data",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/TableCompactor.java#L209-L244 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/PriceListUrl.java | PriceListUrl.getResolvedPriceListUrl | public static MozuUrl getResolvedPriceListUrl(Integer customerAccountId, String responseFields) {
"""
Get Resource Url for GetResolvedPriceList
@param customerAccountId The unique identifier of the customer account for which to retrieve wish lists.
@param responseFields Filtering syntax appended to an API call t... | java | public static MozuUrl getResolvedPriceListUrl(Integer customerAccountId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/pricelists/resolved?customerAccountId={customerAccountId}&responseFields={responseFields}");
formatter.formatUrl("customerAccountId", cust... | [
"public",
"static",
"MozuUrl",
"getResolvedPriceListUrl",
"(",
"Integer",
"customerAccountId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/storefront/pricelists/resolved?customerAccountId={custo... | Get Resource Url for GetResolvedPriceList
@param customerAccountId The unique identifier of the customer account for which to retrieve wish lists.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used t... | [
"Get",
"Resource",
"Url",
"for",
"GetResolvedPriceList"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/PriceListUrl.java#L36-L42 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageRequest.java | SendUsersMessageRequest.withUsers | public SendUsersMessageRequest withUsers(java.util.Map<String, EndpointSendConfiguration> users) {
"""
A map that associates user IDs with EndpointSendConfiguration objects. Within an EndpointSendConfiguration
object, you can tailor the message for a user by specifying message overrides or substitutions.
@para... | java | public SendUsersMessageRequest withUsers(java.util.Map<String, EndpointSendConfiguration> users) {
setUsers(users);
return this;
} | [
"public",
"SendUsersMessageRequest",
"withUsers",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"EndpointSendConfiguration",
">",
"users",
")",
"{",
"setUsers",
"(",
"users",
")",
";",
"return",
"this",
";",
"}"
] | A map that associates user IDs with EndpointSendConfiguration objects. Within an EndpointSendConfiguration
object, you can tailor the message for a user by specifying message overrides or substitutions.
@param users
A map that associates user IDs with EndpointSendConfiguration objects. Within an EndpointSendConfigurat... | [
"A",
"map",
"that",
"associates",
"user",
"IDs",
"with",
"EndpointSendConfiguration",
"objects",
".",
"Within",
"an",
"EndpointSendConfiguration",
"object",
"you",
"can",
"tailor",
"the",
"message",
"for",
"a",
"user",
"by",
"specifying",
"message",
"overrides",
"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageRequest.java#L216-L219 |
wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/RubyObject.java | RubyObject.send | public static <E> E send(Object o, String methodName, Short arg) {
"""
Executes a method of any Object by Java reflection.
@param o
an Object
@param methodName
name of the method
@param arg
a Short
@return the result of the method called
"""
return send(o, methodName, (Object) arg);
} | java | public static <E> E send(Object o, String methodName, Short arg) {
return send(o, methodName, (Object) arg);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"send",
"(",
"Object",
"o",
",",
"String",
"methodName",
",",
"Short",
"arg",
")",
"{",
"return",
"send",
"(",
"o",
",",
"methodName",
",",
"(",
"Object",
")",
"arg",
")",
";",
"}"
] | Executes a method of any Object by Java reflection.
@param o
an Object
@param methodName
name of the method
@param arg
a Short
@return the result of the method called | [
"Executes",
"a",
"method",
"of",
"any",
"Object",
"by",
"Java",
"reflection",
"."
] | train | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/RubyObject.java#L147-L149 |
undertow-io/undertow | core/src/main/java/io/undertow/server/protocol/http/ALPNOfferedClientHelloExplorer.java | ALPNOfferedClientHelloExplorer.exploreRecord | private static List<Integer> exploreRecord(
ByteBuffer input) throws SSLException {
"""
/*
struct {
uint32 gmt_unix_time;
opaque random_bytes[28];
} Random;
opaque SessionID<0..32>;
uint8 CipherSuite[2];
enum { null(0), (255) } CompressionMethod;
struct {
ProtocolVersion client_version... | java | private static List<Integer> exploreRecord(
ByteBuffer input) throws SSLException {
// client version
byte helloMajorVersion = input.get();
byte helloMinorVersion = input.get();
if (helloMajorVersion != 3 && helloMinorVersion != 3) {
//we only care about TLS 1.2
... | [
"private",
"static",
"List",
"<",
"Integer",
">",
"exploreRecord",
"(",
"ByteBuffer",
"input",
")",
"throws",
"SSLException",
"{",
"// client version",
"byte",
"helloMajorVersion",
"=",
"input",
".",
"get",
"(",
")",
";",
"byte",
"helloMinorVersion",
"=",
"input... | /*
struct {
uint32 gmt_unix_time;
opaque random_bytes[28];
} Random;
opaque SessionID<0..32>;
uint8 CipherSuite[2];
enum { null(0), (255) } CompressionMethod;
struct {
ProtocolVersion client_version;
Random random;
SessionID session_id;
CipherSuite cipher_suites<2..2^16-2>;
CompressionMethod compression_methods<1..... | [
"/",
"*",
"struct",
"{",
"uint32",
"gmt_unix_time",
";",
"opaque",
"random_bytes",
"[",
"28",
"]",
";",
"}",
"Random",
";"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/protocol/http/ALPNOfferedClientHelloExplorer.java#L198-L233 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.writeOrganizationalUnit | public void writeOrganizationalUnit(CmsRequestContext context, CmsOrganizationalUnit organizationalUnit)
throws CmsException {
"""
Writes an already existing organizational unit.<p>
The organizational unit id has to be a valid OpenCms organizational unit id.<p>
The organizational unit with the given id w... | java | public void writeOrganizationalUnit(CmsRequestContext context, CmsOrganizationalUnit organizationalUnit)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
checkRole(dbc, CmsRole.ADMINISTRATOR.forOrgUnit(organizationalUnit.getName()));
c... | [
"public",
"void",
"writeOrganizationalUnit",
"(",
"CmsRequestContext",
"context",
",",
"CmsOrganizationalUnit",
"organizationalUnit",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"tr... | Writes an already existing organizational unit.<p>
The organizational unit id has to be a valid OpenCms organizational unit id.<p>
The organizational unit with the given id will be completely overridden
by the given data.<p>
@param context the current request context
@param organizationalUnit the organizational unit... | [
"Writes",
"an",
"already",
"existing",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L6746-L6759 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/push/PushManager.java | PushManager.registerPushReceiver | private void registerPushReceiver(final Handler mainThreadHandler, final Context context, PushTokenProvider provider, final PushTokenListener tokenListener, final PushMessageListener messageListener) {
"""
Register local broadcast listener for refreshed push tokens and push messages.
@param context Appl... | java | private void registerPushReceiver(final Handler mainThreadHandler, final Context context, PushTokenProvider provider, final PushTokenListener tokenListener, final PushMessageListener messageListener) {
IntentFilter filter = new IntentFilter();
filter.addAction(IDService.ACTION_REFRESH_PUSH);
fi... | [
"private",
"void",
"registerPushReceiver",
"(",
"final",
"Handler",
"mainThreadHandler",
",",
"final",
"Context",
"context",
",",
"PushTokenProvider",
"provider",
",",
"final",
"PushTokenListener",
"tokenListener",
",",
"final",
"PushMessageListener",
"messageListener",
"... | Register local broadcast listener for refreshed push tokens and push messages.
@param context Application context.
@param provider Provides fcm push token.
@param tokenListener Listener for refreshed push tokens.
@param messageListener Listener for push messages. | [
"Register",
"local",
"broadcast",
"listener",
"for",
"refreshed",
"push",
"tokens",
"and",
"push",
"messages",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/push/PushManager.java#L76-L84 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.getQuotaMetricsWithServiceResponseAsync | public Observable<ServiceResponse<Page<IotHubQuotaMetricInfoInner>>> getQuotaMetricsWithServiceResponseAsync(final String resourceGroupName, final String resourceName) {
"""
Get the quota metrics for an IoT hub.
Get the quota metrics for an IoT hub.
@param resourceGroupName The name of the resource group that ... | java | public Observable<ServiceResponse<Page<IotHubQuotaMetricInfoInner>>> getQuotaMetricsWithServiceResponseAsync(final String resourceGroupName, final String resourceName) {
return getQuotaMetricsSinglePageAsync(resourceGroupName, resourceName)
.concatMap(new Func1<ServiceResponse<Page<IotHubQuotaMetric... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"IotHubQuotaMetricInfoInner",
">",
">",
">",
"getQuotaMetricsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"resourceName",
")",
"{",
"return",
"getQuotaMe... | Get the quota metrics for an IoT hub.
Get the quota metrics for an IoT hub.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList&l... | [
"Get",
"the",
"quota",
"metrics",
"for",
"an",
"IoT",
"hub",
".",
"Get",
"the",
"quota",
"metrics",
"for",
"an",
"IoT",
"hub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L2364-L2376 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/BarcodeDatamatrix.java | BarcodeDatamatrix.createAwtImage | public java.awt.Image createAwtImage(Color foreground, Color background) {
"""
Creates a <CODE>java.awt.Image</CODE>. A successful call to the method <CODE>generate()</CODE>
before calling this method is required.
@param foreground the color of the bars
@param background the color of the background
@return the... | java | public java.awt.Image createAwtImage(Color foreground, Color background) {
if (image == null)
return null;
int f = foreground.getRGB();
int g = background.getRGB();
Canvas canvas = new Canvas();
int w = width + 2 * ws;
int h = height + 2 * ws;
int pix... | [
"public",
"java",
".",
"awt",
".",
"Image",
"createAwtImage",
"(",
"Color",
"foreground",
",",
"Color",
"background",
")",
"{",
"if",
"(",
"image",
"==",
"null",
")",
"return",
"null",
";",
"int",
"f",
"=",
"foreground",
".",
"getRGB",
"(",
")",
";",
... | Creates a <CODE>java.awt.Image</CODE>. A successful call to the method <CODE>generate()</CODE>
before calling this method is required.
@param foreground the color of the bars
@param background the color of the background
@return the image | [
"Creates",
"a",
"<CODE",
">",
"java",
".",
"awt",
".",
"Image<",
"/",
"CODE",
">",
".",
"A",
"successful",
"call",
"to",
"the",
"method",
"<CODE",
">",
"generate",
"()",
"<",
"/",
"CODE",
">",
"before",
"calling",
"this",
"method",
"is",
"required",
... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/BarcodeDatamatrix.java#L774-L796 |
demidenko05/beigesoft-bcommon | src/main/java/org/beigesoft/holder/HolderRapiFields.java | HolderRapiFields.getFor | @Override
public final Field getFor(final Class<?> pClass, final String pFieldName) {
"""
<p>Get thing for given class and thing name.</p>
@param pClass a Class
@param pFieldName Thing Name
@return a thing
"""
Map<String, Field> fldMap = this.rapiFieldsMap.get(pClass);
if (fldMap == null) {
... | java | @Override
public final Field getFor(final Class<?> pClass, final String pFieldName) {
Map<String, Field> fldMap = this.rapiFieldsMap.get(pClass);
if (fldMap == null) {
// There is no way to get from Map partially initialized bean
// in this double-checked locking implementation
// cause putt... | [
"@",
"Override",
"public",
"final",
"Field",
"getFor",
"(",
"final",
"Class",
"<",
"?",
">",
"pClass",
",",
"final",
"String",
"pFieldName",
")",
"{",
"Map",
"<",
"String",
",",
"Field",
">",
"fldMap",
"=",
"this",
".",
"rapiFieldsMap",
".",
"get",
"("... | <p>Get thing for given class and thing name.</p>
@param pClass a Class
@param pFieldName Thing Name
@return a thing | [
"<p",
">",
"Get",
"thing",
"for",
"given",
"class",
"and",
"thing",
"name",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-bcommon/blob/bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf/src/main/java/org/beigesoft/holder/HolderRapiFields.java#L45-L65 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/file/PathHelper.java | PathHelper.getDirectoryContent | @Nonnull
@ReturnsMutableCopy
public static ICommonsList <Path> getDirectoryContent (@Nonnull final Path aDirectory) {
"""
This is a replacement for <code>Path.listFiles()</code> doing some
additional checks on permissions. The order of the returned files is
undefined. "." and ".." are not contained.
@para... | java | @Nonnull
@ReturnsMutableCopy
public static ICommonsList <Path> getDirectoryContent (@Nonnull final Path aDirectory)
{
ValueEnforcer.notNull (aDirectory, "Directory");
return _getDirectoryContent (aDirectory, null);
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"ICommonsList",
"<",
"Path",
">",
"getDirectoryContent",
"(",
"@",
"Nonnull",
"final",
"Path",
"aDirectory",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aDirectory",
",",
"\"Directory\"",
")",
"... | This is a replacement for <code>Path.listFiles()</code> doing some
additional checks on permissions. The order of the returned files is
undefined. "." and ".." are not contained.
@param aDirectory
The directory to be listed. May not be <code>null</code>.
@return Never <code>null</code>. | [
"This",
"is",
"a",
"replacement",
"for",
"<code",
">",
"Path",
".",
"listFiles",
"()",
"<",
"/",
"code",
">",
"doing",
"some",
"additional",
"checks",
"on",
"permissions",
".",
"The",
"order",
"of",
"the",
"returned",
"files",
"is",
"undefined",
".",
"."... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/PathHelper.java#L655-L662 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.describeImageAsync | public Observable<ImageDescription> describeImageAsync(String url, DescribeImageOptionalParameter describeImageOptionalParameter) {
"""
This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also re... | java | public Observable<ImageDescription> describeImageAsync(String url, DescribeImageOptionalParameter describeImageOptionalParameter) {
return describeImageWithServiceResponseAsync(url, describeImageOptionalParameter).map(new Func1<ServiceResponse<ImageDescription>, ImageDescription>() {
@Override
... | [
"public",
"Observable",
"<",
"ImageDescription",
">",
"describeImageAsync",
"(",
"String",
"url",
",",
"DescribeImageOptionalParameter",
"describeImageOptionalParameter",
")",
"{",
"return",
"describeImageWithServiceResponseAsync",
"(",
"url",
",",
"describeImageOptionalParamet... | This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the operation. More than one description can be generated for each image. Descriptions are ordered by their confidence score. All ... | [
"This",
"operation",
"generates",
"a",
"description",
"of",
"an",
"image",
"in",
"human",
"readable",
"language",
"with",
"complete",
"sentences",
".",
"The",
"description",
"is",
"based",
"on",
"a",
"collection",
"of",
"content",
"tags",
"which",
"are",
"also... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L1762-L1769 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.getAllContinentFloorID | public List<Integer> getAllContinentFloorID(int continentID) throws GuildWars2Exception {
"""
For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Get all continent floor ids
@param continentID {@link Continent#id}
@return list of continent floor ids
@t... | java | public List<Integer> getAllContinentFloorID(int continentID) throws GuildWars2Exception {
try {
Response<List<Integer>> response = gw2API.getAllContinentFloorIDs(Integer.toString(continentID)).execute();
if (!response.isSuccessful()) throwError(response.code(), response.errorBody());
return response.body();
... | [
"public",
"List",
"<",
"Integer",
">",
"getAllContinentFloorID",
"(",
"int",
"continentID",
")",
"throws",
"GuildWars2Exception",
"{",
"try",
"{",
"Response",
"<",
"List",
"<",
"Integer",
">>",
"response",
"=",
"gw2API",
".",
"getAllContinentFloorIDs",
"(",
"Int... | For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Get all continent floor ids
@param continentID {@link Continent#id}
@return list of continent floor ids
@throws GuildWars2Exception see {@link ErrorCode} for detail
@see ContinentFloor continent floor info | [
"For",
"more",
"info",
"on",
"continents",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"continents",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Get",
"all"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L1392-L1400 |
fuinorg/objects4j | src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java | AnnotationAnalyzer.getText | private String getText(@NotNull final ResourceBundle bundle, @NotNull final Annotation annotation, @NotNull final String defaultKey) {
"""
Returns the text for the annotation. If no entry is found in the resource bundle for <code>Annotation#key()</code> then
<code>Annotation#value()</code> will be returned instea... | java | private String getText(@NotNull final ResourceBundle bundle, @NotNull final Annotation annotation, @NotNull final String defaultKey) {
Contract.requireArgNotNull("bundle", bundle);
Contract.requireArgNotNull("annotation", annotation);
Contract.requireArgNotNull("defaultKey", defaultKey);
... | [
"private",
"String",
"getText",
"(",
"@",
"NotNull",
"final",
"ResourceBundle",
"bundle",
",",
"@",
"NotNull",
"final",
"Annotation",
"annotation",
",",
"@",
"NotNull",
"final",
"String",
"defaultKey",
")",
"{",
"Contract",
".",
"requireArgNotNull",
"(",
"\"bund... | Returns the text for the annotation. If no entry is found in the resource bundle for <code>Annotation#key()</code> then
<code>Annotation#value()</code> will be returned instead. If <code>Annotation#value()</code> is also empty then <code>null</code> is
returned. If <code>Annotation#key()</code> is empty <code>defaultKe... | [
"Returns",
"the",
"text",
"for",
"the",
"annotation",
".",
"If",
"no",
"entry",
"is",
"found",
"in",
"the",
"resource",
"bundle",
"for",
"<code",
">",
"Annotation#key",
"()",
"<",
"/",
"code",
">",
"then",
"<code",
">",
"Annotation#value",
"()",
"<",
"/"... | train | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java#L188-L207 |
jenkinsci/jenkins | core/src/main/java/hudson/console/ConsoleLogFilter.java | ConsoleLogFilter.decorateLogger | public OutputStream decorateLogger(@Nonnull Computer computer, OutputStream logger) throws IOException, InterruptedException {
"""
Called to decorate logger for master/agent communication.
@param computer
Agent computer for which the logger is getting decorated. Useful to do
contextual decoration.
@since 1.6... | java | public OutputStream decorateLogger(@Nonnull Computer computer, OutputStream logger) throws IOException, InterruptedException {
return logger; // by default no-op
} | [
"public",
"OutputStream",
"decorateLogger",
"(",
"@",
"Nonnull",
"Computer",
"computer",
",",
"OutputStream",
"logger",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
"logger",
";",
"// by default no-op",
"}"
] | Called to decorate logger for master/agent communication.
@param computer
Agent computer for which the logger is getting decorated. Useful to do
contextual decoration.
@since 1.632 | [
"Called",
"to",
"decorate",
"logger",
"for",
"master",
"/",
"agent",
"communication",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/console/ConsoleLogFilter.java#L104-L106 |
dasein-cloud/dasein-cloud-azure | src/main/java/org/dasein/cloud/azure/network/AzureIpAddressSupport.java | AzureIpAddressSupport.getProviderTermForIpAddress | @Nonnull
@Override
public String getProviderTermForIpAddress(@Nonnull Locale locale) {
"""
The cloud provider-specific term for an IP address. It's hard to fathom what other
than "IP address" anyone could use.
@param locale the locale into which the term should be translated
@return the cloud provider... | java | @Nonnull
@Override
public String getProviderTermForIpAddress(@Nonnull Locale locale) {
try {
return getCapabilities().getProviderTermForIpAddress(locale);
} catch (CloudException e) {
throw new RuntimeException("Unexpected problem with capabilities", e);
} catch (... | [
"@",
"Nonnull",
"@",
"Override",
"public",
"String",
"getProviderTermForIpAddress",
"(",
"@",
"Nonnull",
"Locale",
"locale",
")",
"{",
"try",
"{",
"return",
"getCapabilities",
"(",
")",
".",
"getProviderTermForIpAddress",
"(",
"locale",
")",
";",
"}",
"catch",
... | The cloud provider-specific term for an IP address. It's hard to fathom what other
than "IP address" anyone could use.
@param locale the locale into which the term should be translated
@return the cloud provider-specific term for an IP address
@deprecated use {@link org.dasein.cloud.network.IPAddressCapabilities#getPr... | [
"The",
"cloud",
"provider",
"-",
"specific",
"term",
"for",
"an",
"IP",
"address",
".",
"It",
"s",
"hard",
"to",
"fathom",
"what",
"other",
"than",
"IP",
"address",
"anyone",
"could",
"use",
"."
] | train | https://github.com/dasein-cloud/dasein-cloud-azure/blob/e2abb775c0f23f0d0f2509fba31128c7b2027d7c/src/main/java/org/dasein/cloud/azure/network/AzureIpAddressSupport.java#L170-L180 |
grails/grails-core | grails-core/src/main/groovy/org/grails/core/io/MockStringResourceLoader.java | MockStringResourceLoader.registerMockResource | public void registerMockResource(String location, byte[] contents) {
"""
Registers a mock resource with the first argument as the location and the second as the contents
of the resource.
@param location The location
@param contents The contents of the resource
"""
mockResources.put(location, new G... | java | public void registerMockResource(String location, byte[] contents) {
mockResources.put(location, new GrailsByteArrayResource(contents, location));
} | [
"public",
"void",
"registerMockResource",
"(",
"String",
"location",
",",
"byte",
"[",
"]",
"contents",
")",
"{",
"mockResources",
".",
"put",
"(",
"location",
",",
"new",
"GrailsByteArrayResource",
"(",
"contents",
",",
"location",
")",
")",
";",
"}"
] | Registers a mock resource with the first argument as the location and the second as the contents
of the resource.
@param location The location
@param contents The contents of the resource | [
"Registers",
"a",
"mock",
"resource",
"with",
"the",
"first",
"argument",
"as",
"the",
"location",
"and",
"the",
"second",
"as",
"the",
"contents",
"of",
"the",
"resource",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/core/io/MockStringResourceLoader.java#L76-L78 |
jbundle/jbundle | base/message/remote/src/main/java/org/jbundle/base/message/remote/RunRemoteProcessMessageInProcessor.java | RunRemoteProcessMessageInProcessor.processMessage | public BaseMessage processMessage(BaseMessage internalMessage) {
"""
Process this internal message.
@param internalMessage The message to process.
@return (optional) The return message if applicable.
"""
if (internalMessage.getMessageDataDesc(null) == null)
internalMessage.addMessageDataD... | java | public BaseMessage processMessage(BaseMessage internalMessage)
{
if (internalMessage.getMessageDataDesc(null) == null)
internalMessage.addMessageDataDesc(new RunRemoteProcessMessageData(null, null));
RunRemoteProcessMessageData runRemoteProcessMessageData = (RunRemoteProcessMess... | [
"public",
"BaseMessage",
"processMessage",
"(",
"BaseMessage",
"internalMessage",
")",
"{",
"if",
"(",
"internalMessage",
".",
"getMessageDataDesc",
"(",
"null",
")",
"==",
"null",
")",
"internalMessage",
".",
"addMessageDataDesc",
"(",
"new",
"RunRemoteProcessMessage... | Process this internal message.
@param internalMessage The message to process.
@return (optional) The return message if applicable. | [
"Process",
"this",
"internal",
"message",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/remote/src/main/java/org/jbundle/base/message/remote/RunRemoteProcessMessageInProcessor.java#L51-L77 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.setWanReplicationConfigs | public Config setWanReplicationConfigs(Map<String, WanReplicationConfig> wanReplicationConfigs) {
"""
Sets the map of WAN replication configurations, mapped by config name.
@param wanReplicationConfigs the WAN replication configuration map to set
@return this config instance
"""
this.wanReplication... | java | public Config setWanReplicationConfigs(Map<String, WanReplicationConfig> wanReplicationConfigs) {
this.wanReplicationConfigs.clear();
this.wanReplicationConfigs.putAll(wanReplicationConfigs);
for (final Entry<String, WanReplicationConfig> entry : this.wanReplicationConfigs.entrySet()) {
... | [
"public",
"Config",
"setWanReplicationConfigs",
"(",
"Map",
"<",
"String",
",",
"WanReplicationConfig",
">",
"wanReplicationConfigs",
")",
"{",
"this",
".",
"wanReplicationConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"wanReplicationConfigs",
".",
"putAll",
... | Sets the map of WAN replication configurations, mapped by config name.
@param wanReplicationConfigs the WAN replication configuration map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"WAN",
"replication",
"configurations",
"mapped",
"by",
"config",
"name",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L2423-L2430 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/util/ReflectionUtils.java | ReflectionUtils.getMethodNameForField | private static String getMethodNameForField(final String prefix, final String fieldName) {
"""
Gets the camelcase getter/setter method name for a field.
@param prefix
the method prefix
@param fieldName
the field name
@return the method name
"""
return prefix + fieldName.substring(0, 1).toUpperCase() +... | java | private static String getMethodNameForField(final String prefix, final String fieldName) {
return prefix + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
} | [
"private",
"static",
"String",
"getMethodNameForField",
"(",
"final",
"String",
"prefix",
",",
"final",
"String",
"fieldName",
")",
"{",
"return",
"prefix",
"+",
"fieldName",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toUpperCase",
"(",
")",
"+",
"fi... | Gets the camelcase getter/setter method name for a field.
@param prefix
the method prefix
@param fieldName
the field name
@return the method name | [
"Gets",
"the",
"camelcase",
"getter",
"/",
"setter",
"method",
"name",
"for",
"a",
"field",
"."
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/util/ReflectionUtils.java#L243-L245 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.pack | public static void pack(ZipEntrySource[] entries, OutputStream os) {
"""
Compresses the given entries into an output stream.
@param entries
ZIP entries added.
@param os
output stream for the new ZIP (does not have to be buffered)
@since 1.9
"""
if (log.isDebugEnabled()) {
log.debug("Creating... | java | public static void pack(ZipEntrySource[] entries, OutputStream os) {
if (log.isDebugEnabled()) {
log.debug("Creating stream from {}.", Arrays.asList(entries));
}
pack(entries, os, false);
} | [
"public",
"static",
"void",
"pack",
"(",
"ZipEntrySource",
"[",
"]",
"entries",
",",
"OutputStream",
"os",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Creating stream from {}.\"",
",",
"Arrays",
".",
... | Compresses the given entries into an output stream.
@param entries
ZIP entries added.
@param os
output stream for the new ZIP (does not have to be buffered)
@since 1.9 | [
"Compresses",
"the",
"given",
"entries",
"into",
"an",
"output",
"stream",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1964-L1969 |
Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/MBeanOperationInvoker.java | MBeanOperationInvoker.invokeOperation | public Object invokeOperation(Map<String, String[]> parameterMap) throws JMException {
"""
Invoke the operation.
@param parameterMap the {@link Map} of parameter names to value arrays.
@return the {@link Object} return value from the operation.
@throws JMException Java Management Exception
"""
MBean... | java | public Object invokeOperation(Map<String, String[]> parameterMap) throws JMException {
MBeanParameterInfo[] parameterInfoArray = operationInfo.getSignature();
Object[] values = new Object[parameterInfoArray.length];
String[] types = new String[parameterInfoArray.length];
MBeanValueConv... | [
"public",
"Object",
"invokeOperation",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parameterMap",
")",
"throws",
"JMException",
"{",
"MBeanParameterInfo",
"[",
"]",
"parameterInfoArray",
"=",
"operationInfo",
".",
"getSignature",
"(",
")",
";",
"... | Invoke the operation.
@param parameterMap the {@link Map} of parameter names to value arrays.
@return the {@link Object} return value from the operation.
@throws JMException Java Management Exception | [
"Invoke",
"the",
"operation",
"."
] | train | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/MBeanOperationInvoker.java#L52-L68 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/dml/SQLMergeClause.java | SQLMergeClause.addFlag | public SQLMergeClause addFlag(Position position, String flag) {
"""
Add the given String literal at the given position as a query flag
@param position position
@param flag query flag
@return the current object
"""
metadata.addFlag(new QueryFlag(position, flag));
return this;
} | java | public SQLMergeClause addFlag(Position position, String flag) {
metadata.addFlag(new QueryFlag(position, flag));
return this;
} | [
"public",
"SQLMergeClause",
"addFlag",
"(",
"Position",
"position",
",",
"String",
"flag",
")",
"{",
"metadata",
".",
"addFlag",
"(",
"new",
"QueryFlag",
"(",
"position",
",",
"flag",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add the given String literal at the given position as a query flag
@param position position
@param flag query flag
@return the current object | [
"Add",
"the",
"given",
"String",
"literal",
"at",
"the",
"given",
"position",
"as",
"a",
"query",
"flag"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/dml/SQLMergeClause.java#L88-L91 |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.addFlagImagesSetToProperties | private void addFlagImagesSetToProperties(final Job prop, final Set<URI> set) {
"""
add FlagImangesSet to Properties, which needn't to change the dir level,
just ouput to the ouput dir.
@param prop job configuration
@param set absolute flag image files
"""
final Set<URI> newSet = new LinkedHashSet... | java | private void addFlagImagesSetToProperties(final Job prop, final Set<URI> set) {
final Set<URI> newSet = new LinkedHashSet<>(128);
for (final URI file: set) {
// assert file.isAbsolute();
if (file.isAbsolute()) {
// no need to append relative path before absolute pa... | [
"private",
"void",
"addFlagImagesSetToProperties",
"(",
"final",
"Job",
"prop",
",",
"final",
"Set",
"<",
"URI",
">",
"set",
")",
"{",
"final",
"Set",
"<",
"URI",
">",
"newSet",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
"128",
")",
";",
"for",
"(",
"fina... | add FlagImangesSet to Properties, which needn't to change the dir level,
just ouput to the ouput dir.
@param prop job configuration
@param set absolute flag image files | [
"add",
"FlagImangesSet",
"to",
"Properties",
"which",
"needn",
"t",
"to",
"change",
"the",
"dir",
"level",
"just",
"ouput",
"to",
"the",
"ouput",
"dir",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L954-L986 |
atomix/copycat | server/src/main/java/io/atomix/copycat/server/storage/compaction/MinorCompactionTask.java | MinorCompactionTask.mergeReleasedEntries | private void mergeReleasedEntries(Segment segment, Segment compactSegment) {
"""
Updates the new compact segment with entries that were released from the given segment during compaction.
"""
for (long i = segment.firstIndex(); i <= segment.lastIndex(); i++) {
if (!segment.isLive(i)) {
compact... | java | private void mergeReleasedEntries(Segment segment, Segment compactSegment) {
for (long i = segment.firstIndex(); i <= segment.lastIndex(); i++) {
if (!segment.isLive(i)) {
compactSegment.release(i);
}
}
} | [
"private",
"void",
"mergeReleasedEntries",
"(",
"Segment",
"segment",
",",
"Segment",
"compactSegment",
")",
"{",
"for",
"(",
"long",
"i",
"=",
"segment",
".",
"firstIndex",
"(",
")",
";",
"i",
"<=",
"segment",
".",
"lastIndex",
"(",
")",
";",
"i",
"++",... | Updates the new compact segment with entries that were released from the given segment during compaction. | [
"Updates",
"the",
"new",
"compact",
"segment",
"with",
"entries",
"that",
"were",
"released",
"from",
"the",
"given",
"segment",
"during",
"compaction",
"."
] | train | https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/storage/compaction/MinorCompactionTask.java#L200-L206 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.methodHasParameters | public static MultiMatcher<MethodTree, VariableTree> methodHasParameters(
MatchType matchType, Matcher<VariableTree> parameterMatcher) {
"""
Matches if the given matcher matches all of/any of the parameters to this method.
"""
return new MethodHasParameters(matchType, parameterMatcher);
} | java | public static MultiMatcher<MethodTree, VariableTree> methodHasParameters(
MatchType matchType, Matcher<VariableTree> parameterMatcher) {
return new MethodHasParameters(matchType, parameterMatcher);
} | [
"public",
"static",
"MultiMatcher",
"<",
"MethodTree",
",",
"VariableTree",
">",
"methodHasParameters",
"(",
"MatchType",
"matchType",
",",
"Matcher",
"<",
"VariableTree",
">",
"parameterMatcher",
")",
"{",
"return",
"new",
"MethodHasParameters",
"(",
"matchType",
"... | Matches if the given matcher matches all of/any of the parameters to this method. | [
"Matches",
"if",
"the",
"given",
"matcher",
"matches",
"all",
"of",
"/",
"any",
"of",
"the",
"parameters",
"to",
"this",
"method",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L1008-L1011 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.createPolygonOptions | public static PolygonOptions createPolygonOptions(FeatureStyleExtension featureStyleExtension, FeatureRow featureRow, float density) {
"""
Create new polygon options populated with the feature row style
@param featureStyleExtension feature style extension
@param featureRow feature row
@param densit... | java | public static PolygonOptions createPolygonOptions(FeatureStyleExtension featureStyleExtension, FeatureRow featureRow, float density) {
PolygonOptions polygonOptions = new PolygonOptions();
setFeatureStyle(polygonOptions, featureStyleExtension, featureRow, density);
return polygonOptions;
} | [
"public",
"static",
"PolygonOptions",
"createPolygonOptions",
"(",
"FeatureStyleExtension",
"featureStyleExtension",
",",
"FeatureRow",
"featureRow",
",",
"float",
"density",
")",
"{",
"PolygonOptions",
"polygonOptions",
"=",
"new",
"PolygonOptions",
"(",
")",
";",
"set... | Create new polygon options populated with the feature row style
@param featureStyleExtension feature style extension
@param featureRow feature row
@param density display density: {@link android.util.DisplayMetrics#density}
@return polygon options populated with the feature style | [
"Create",
"new",
"polygon",
"options",
"populated",
"with",
"the",
"feature",
"row",
"style"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L520-L526 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/TableCellWithActionExample.java | TableCellWithActionExample.createTable | private WDataTable createTable() {
"""
Creates and configures the table to be used by the example. The table is configured with global rather than user
data. Although this is not a realistic scenario, it will suffice for this example.
@return a new configured table.
"""
WDataTable table = new WDataTable(... | java | private WDataTable createTable() {
WDataTable table = new WDataTable();
table.addColumn(new WTableColumn("First name", new WTextField()));
table.addColumn(new WTableColumn("Last name", new WTextField()));
table.addColumn(new WTableColumn("DOB", new WDateField()));
table.addColumn(new WTableColumn("Action", ne... | [
"private",
"WDataTable",
"createTable",
"(",
")",
"{",
"WDataTable",
"table",
"=",
"new",
"WDataTable",
"(",
")",
";",
"table",
".",
"addColumn",
"(",
"new",
"WTableColumn",
"(",
"\"First name\"",
",",
"new",
"WTextField",
"(",
")",
")",
")",
";",
"table",... | Creates and configures the table to be used by the example. The table is configured with global rather than user
data. Although this is not a realistic scenario, it will suffice for this example.
@return a new configured table. | [
"Creates",
"and",
"configures",
"the",
"table",
"to",
"be",
"used",
"by",
"the",
"example",
".",
"The",
"table",
"is",
"configured",
"with",
"global",
"rather",
"than",
"user",
"data",
".",
"Although",
"this",
"is",
"not",
"a",
"realistic",
"scenario",
"it... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/TableCellWithActionExample.java#L70-L81 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.getExtensions | public VirtualMachineExtensionsListResultInner getExtensions(String resourceGroupName, String vmName, String expand) {
"""
The operation to get all extensions of a Virtual Machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine containing the extension.
... | java | public VirtualMachineExtensionsListResultInner getExtensions(String resourceGroupName, String vmName, String expand) {
return getExtensionsWithServiceResponseAsync(resourceGroupName, vmName, expand).toBlocking().single().body();
} | [
"public",
"VirtualMachineExtensionsListResultInner",
"getExtensions",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"String",
"expand",
")",
"{",
"return",
"getExtensionsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmName",
",",
"expand",
... | The operation to get all extensions of a Virtual Machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine containing the extension.
@param expand The expand expression to apply on the operation.
@throws IllegalArgumentException thrown if parameters fail the valida... | [
"The",
"operation",
"to",
"get",
"all",
"extensions",
"of",
"a",
"Virtual",
"Machine",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L288-L290 |
nabedge/mixer2 | src/main/java/org/mixer2/xhtml/util/GetDescendantsUtil.java | GetDescendantsUtil.getDescendants | public static <T extends AbstractJaxb> List<T> getDescendants(T target,
List<T> resultList, String clazz, Class<T> tagType) {
"""
タグとclass指定で子孫要素を返す
@param <T>
tag class type. (i.e. Div.class, Span.class...)
@param target
objects for scan
@param resultList
usually, pass new ArrayList
@param cl... | java | public static <T extends AbstractJaxb> List<T> getDescendants(T target,
List<T> resultList, String clazz, Class<T> tagType) {
return execute(target, resultList, tagType, clazz);
} | [
"public",
"static",
"<",
"T",
"extends",
"AbstractJaxb",
">",
"List",
"<",
"T",
">",
"getDescendants",
"(",
"T",
"target",
",",
"List",
"<",
"T",
">",
"resultList",
",",
"String",
"clazz",
",",
"Class",
"<",
"T",
">",
"tagType",
")",
"{",
"return",
"... | タグとclass指定で子孫要素を返す
@param <T>
tag class type. (i.e. Div.class, Span.class...)
@param target
objects for scan
@param resultList
usually, pass new ArrayList
@param clazz
class property of tag
@param tagType
tag class
@return | [
"タグとclass指定で子孫要素を返す"
] | train | https://github.com/nabedge/mixer2/blob/8c2db27cfcd65bf0b1e0242ef9362ebd8033777c/src/main/java/org/mixer2/xhtml/util/GetDescendantsUtil.java#L34-L37 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/SOS.java | SOS.computePi | public static double computePi(DBIDRef ignore, DoubleDBIDListIter it, double[] p, double perplexity, double logPerp) {
"""
Compute row p[i], using binary search on the kernel bandwidth sigma to
obtain the desired perplexity.
@param ignore Object to skip
@param it Distances iterator
@param p Output row
@para... | java | public static double computePi(DBIDRef ignore, DoubleDBIDListIter it, double[] p, double perplexity, double logPerp) {
// Relation to paper: beta == 1. / (2*sigma*sigma)
double beta = estimateInitialBeta(ignore, it, perplexity);
double diff = computeH(ignore, it, p, -beta) - logPerp;
double betaMin = 0.... | [
"public",
"static",
"double",
"computePi",
"(",
"DBIDRef",
"ignore",
",",
"DoubleDBIDListIter",
"it",
",",
"double",
"[",
"]",
"p",
",",
"double",
"perplexity",
",",
"double",
"logPerp",
")",
"{",
"// Relation to paper: beta == 1. / (2*sigma*sigma)",
"double",
"beta... | Compute row p[i], using binary search on the kernel bandwidth sigma to
obtain the desired perplexity.
@param ignore Object to skip
@param it Distances iterator
@param p Output row
@param perplexity Desired perplexity
@param logPerp Log of desired perplexity
@return Beta | [
"Compute",
"row",
"p",
"[",
"i",
"]",
"using",
"binary",
"search",
"on",
"the",
"kernel",
"bandwidth",
"sigma",
"to",
"obtain",
"the",
"desired",
"perplexity",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/SOS.java#L212-L230 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/returns/OrderNoteUrl.java | OrderNoteUrl.getReturnNoteUrl | public static MozuUrl getReturnNoteUrl(String noteId, String responseFields, String returnId) {
"""
Get Resource Url for GetReturnNote
@param noteId Unique identifier of a particular note to retrieve.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data return... | java | public static MozuUrl getReturnNoteUrl(String noteId, String responseFields, String returnId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/returns/{returnId}/notes/{noteId}?responseFields={responseFields}");
formatter.formatUrl("noteId", noteId);
formatter.formatUrl("responseFields", responseFi... | [
"public",
"static",
"MozuUrl",
"getReturnNoteUrl",
"(",
"String",
"noteId",
",",
"String",
"responseFields",
",",
"String",
"returnId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/returns/{returnId}/notes/{noteId}?responseFields=... | Get Resource Url for GetReturnNote
@param noteId Unique identifier of a particular note to retrieve.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data usi... | [
"Get",
"Resource",
"Url",
"for",
"GetReturnNote"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/returns/OrderNoteUrl.java#L35-L42 |
Sefford/fraggle | fraggle/src/main/java/com/sefford/fraggle/FraggleManager.java | FraggleManager.performTransaction | protected void performTransaction(Fragment frag, int flags, FragmentTransaction ft, int containerId) {
"""
Commits the transaction to the Fragment Manager.
@param frag Fragment to add
@param flags Added flags to the Fragment configuration
@param ft Transaction to add the fragment
@param... | java | protected void performTransaction(Fragment frag, int flags, FragmentTransaction ft, int containerId) {
configureAdditionMode(frag, flags, ft, containerId);
ft.commitAllowingStateLoss();
} | [
"protected",
"void",
"performTransaction",
"(",
"Fragment",
"frag",
",",
"int",
"flags",
",",
"FragmentTransaction",
"ft",
",",
"int",
"containerId",
")",
"{",
"configureAdditionMode",
"(",
"frag",
",",
"flags",
",",
"ft",
",",
"containerId",
")",
";",
"ft",
... | Commits the transaction to the Fragment Manager.
@param frag Fragment to add
@param flags Added flags to the Fragment configuration
@param ft Transaction to add the fragment
@param containerId Target containerID | [
"Commits",
"the",
"transaction",
"to",
"the",
"Fragment",
"Manager",
"."
] | train | https://github.com/Sefford/fraggle/blob/d1b65a99ecc3c3faeef8f288ca6225bbf475c3a3/fraggle/src/main/java/com/sefford/fraggle/FraggleManager.java#L270-L273 |
lessthanoptimal/ddogleg | src/org/ddogleg/fitting/modelset/ransac/Ransac.java | Ransac.selectMatchSet | @SuppressWarnings( {
"""
Looks for points in the data set which closely match the current best
fit model in the optimizer.
@param dataSet The points being considered
""""ForLoopReplaceableByForEach"})
protected void selectMatchSet(List<Point> dataSet, double threshold, Model param) {
candidatePoints.cle... | java | @SuppressWarnings({"ForLoopReplaceableByForEach"})
protected void selectMatchSet(List<Point> dataSet, double threshold, Model param) {
candidatePoints.clear();
modelDistance.setModel(param);
for (int i = 0; i < dataSet.size(); i++) {
Point point = dataSet.get(i);
double distance = modelDistance.computeDi... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"ForLoopReplaceableByForEach\"",
"}",
")",
"protected",
"void",
"selectMatchSet",
"(",
"List",
"<",
"Point",
">",
"dataSet",
",",
"double",
"threshold",
",",
"Model",
"param",
")",
"{",
"candidatePoints",
".",
"clear",
"(",
... | Looks for points in the data set which closely match the current best
fit model in the optimizer.
@param dataSet The points being considered | [
"Looks",
"for",
"points",
"in",
"the",
"data",
"set",
"which",
"closely",
"match",
"the",
"current",
"best",
"fit",
"model",
"in",
"the",
"optimizer",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/fitting/modelset/ransac/Ransac.java#L195-L209 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.recoverDeletedSecretAsync | public Observable<SecretBundle> recoverDeletedSecretAsync(String vaultBaseUrl, String secretName) {
"""
Recovers the deleted secret to the latest version.
Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/re... | java | public Observable<SecretBundle> recoverDeletedSecretAsync(String vaultBaseUrl, String secretName) {
return recoverDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1<ServiceResponse<SecretBundle>, SecretBundle>() {
@Override
public SecretBundle call(ServiceRespo... | [
"public",
"Observable",
"<",
"SecretBundle",
">",
"recoverDeletedSecretAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
")",
"{",
"return",
"recoverDeletedSecretWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"secretName",
")",
".",
"map",
"(",
... | Recovers the deleted secret to the latest version.
Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param sec... | [
"Recovers",
"the",
"deleted",
"secret",
"to",
"the",
"latest",
"version",
".",
"Recovers",
"the",
"deleted",
"secret",
"in",
"the",
"specified",
"vault",
".",
"This",
"operation",
"can",
"only",
"be",
"performed",
"on",
"a",
"soft",
"-",
"delete",
"enabled",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L4845-L4852 |
amaembo/streamex | src/main/java/one/util/streamex/EntryStream.java | EntryStream.toMap | public Map<K, V> toMap(BinaryOperator<V> mergeFunction) {
"""
Returns a {@link Map} containing the elements of this stream. There are
no guarantees on the type or serializability of the {@code Map} returned;
if more control over the returned {@code Map} is required, use
{@link #toCustomMap(BinaryOperator, Suppl... | java | public Map<K, V> toMap(BinaryOperator<V> mergeFunction) {
Function<Entry<K, V>, K> keyMapper = Entry::getKey;
Function<Entry<K, V>, V> valueMapper = Entry::getValue;
return collect(Collectors.toMap(keyMapper, valueMapper, mergeFunction, HashMap::new));
} | [
"public",
"Map",
"<",
"K",
",",
"V",
">",
"toMap",
"(",
"BinaryOperator",
"<",
"V",
">",
"mergeFunction",
")",
"{",
"Function",
"<",
"Entry",
"<",
"K",
",",
"V",
">",
",",
"K",
">",
"keyMapper",
"=",
"Entry",
"::",
"getKey",
";",
"Function",
"<",
... | Returns a {@link Map} containing the elements of this stream. There are
no guarantees on the type or serializability of the {@code Map} returned;
if more control over the returned {@code Map} is required, use
{@link #toCustomMap(BinaryOperator, Supplier)}.
<p>
If the mapped keys contains duplicates (according to
{@lin... | [
"Returns",
"a",
"{",
"@link",
"Map",
"}",
"containing",
"the",
"elements",
"of",
"this",
"stream",
".",
"There",
"are",
"no",
"guarantees",
"on",
"the",
"type",
"or",
"serializability",
"of",
"the",
"{",
"@code",
"Map",
"}",
"returned",
";",
"if",
"more"... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/EntryStream.java#L1214-L1218 |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/keywords/GrammarKeywordAccessFragment2.java | GrammarKeywordAccessFragment2.generateKeyword | protected StringConcatenationClient generateKeyword(final String keyword, final String comment, Map<String, String> getters) {
"""
Generate a basic keyword.
@param keyword the keyword to add.
@param comment a comment for the javadoc.
@param getters filled by this function with the getters' names.
@return the... | java | protected StringConcatenationClient generateKeyword(final String keyword, final String comment, Map<String, String> getters) {
final String fieldName = keyword.toUpperCase().replaceAll("[^a-zA-Z0-9_]+", "_"); //$NON-NLS-1$ //$NON-NLS-2$
final String methodName = Strings.toFirstUpper(keyword.replaceAll("[^a-zA-Z0-9_... | [
"protected",
"StringConcatenationClient",
"generateKeyword",
"(",
"final",
"String",
"keyword",
",",
"final",
"String",
"comment",
",",
"Map",
"<",
"String",
",",
"String",
">",
"getters",
")",
"{",
"final",
"String",
"fieldName",
"=",
"keyword",
".",
"toUpperCa... | Generate a basic keyword.
@param keyword the keyword to add.
@param comment a comment for the javadoc.
@param getters filled by this function with the getters' names.
@return the content. | [
"Generate",
"a",
"basic",
"keyword",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/keywords/GrammarKeywordAccessFragment2.java#L287-L328 |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/serializer/binary/BinaryFormatUtils.java | BinaryFormatUtils.readMessage | public static <Message extends PMessage<Message, Field>, Field extends PField>
Message readMessage(BigEndianBinaryReader input,
PMessageDescriptor<Message, Field> descriptor,
boolean strict) throws IOException {
"""
Read message from reader.
@param input The i... | java | public static <Message extends PMessage<Message, Field>, Field extends PField>
Message readMessage(BigEndianBinaryReader input,
PMessageDescriptor<Message, Field> descriptor,
boolean strict) throws IOException {
PMessageBuilder<Message, Field> builder = descri... | [
"public",
"static",
"<",
"Message",
"extends",
"PMessage",
"<",
"Message",
",",
"Field",
">",
",",
"Field",
"extends",
"PField",
">",
"Message",
"readMessage",
"(",
"BigEndianBinaryReader",
"input",
",",
"PMessageDescriptor",
"<",
"Message",
",",
"Field",
">",
... | Read message from reader.
@param input The input reader.
@param descriptor The message descriptor.
@param strict If the message should be read in strict mode.
@param <Message> The message type.
@param <Field> The field type.
@return The read and parsed message.
@throws IOException If read failed. | [
"Read",
"message",
"from",
"reader",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/serializer/binary/BinaryFormatUtils.java#L111-L142 |
jenkinsci/ssh-slaves-plugin | src/main/java/com/trilead/ssh2/jenkins/SFTPClient.java | SFTPClient.mkdirs | public void mkdirs(String path, int posixPermission) throws IOException {
"""
Makes sure that the directory exists, by creating it if necessary.
@param path directory path.
@param posixPermission POSIX permissions.
@throws IOException if it is not possible to access to the directory.
"""
SFTPv3FileA... | java | public void mkdirs(String path, int posixPermission) throws IOException {
SFTPv3FileAttributes atts = _stat(path);
if (atts!=null && atts.isDirectory())
return;
int idx = path.lastIndexOf('/');
if (idx>0)
mkdirs(path.substring(0,idx), posixPermission);
t... | [
"public",
"void",
"mkdirs",
"(",
"String",
"path",
",",
"int",
"posixPermission",
")",
"throws",
"IOException",
"{",
"SFTPv3FileAttributes",
"atts",
"=",
"_stat",
"(",
"path",
")",
";",
"if",
"(",
"atts",
"!=",
"null",
"&&",
"atts",
".",
"isDirectory",
"("... | Makes sure that the directory exists, by creating it if necessary.
@param path directory path.
@param posixPermission POSIX permissions.
@throws IOException if it is not possible to access to the directory. | [
"Makes",
"sure",
"that",
"the",
"directory",
"exists",
"by",
"creating",
"it",
"if",
"necessary",
"."
] | train | https://github.com/jenkinsci/ssh-slaves-plugin/blob/95f528730fc1e01b25983459927b7516ead3ee00/src/main/java/com/trilead/ssh2/jenkins/SFTPClient.java#L80-L94 |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/LocalTrustGraph.java | LocalTrustGraph.addDirectedRoute | public void addDirectedRoute(final TrustGraphNodeId from, final TrustGraphNodeId to) {
"""
create a directed trust link between two nodes. The node with id 'from' will
trust the node with id 'to'.
Note: Although this is useful for testing adverse conditions,
relationships must be symmetric for the normal func... | java | public void addDirectedRoute(final TrustGraphNodeId from, final TrustGraphNodeId to) {
final TrustGraphNode fromNode = nodes.get(from);
fromNode.getRoutingTable().addNeighbor(to);
} | [
"public",
"void",
"addDirectedRoute",
"(",
"final",
"TrustGraphNodeId",
"from",
",",
"final",
"TrustGraphNodeId",
"to",
")",
"{",
"final",
"TrustGraphNode",
"fromNode",
"=",
"nodes",
".",
"get",
"(",
"from",
")",
";",
"fromNode",
".",
"getRoutingTable",
"(",
"... | create a directed trust link between two nodes. The node with id 'from' will
trust the node with id 'to'.
Note: Although this is useful for testing adverse conditions,
relationships must be symmetric for the normal functioning of
the algorithm. An advertising node must trust another node to
send to it, and that same ... | [
"create",
"a",
"directed",
"trust",
"link",
"between",
"two",
"nodes",
".",
"The",
"node",
"with",
"id",
"from",
"will",
"trust",
"the",
"node",
"with",
"id",
"to",
"."
] | train | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/LocalTrustGraph.java#L249-L252 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/RegularFile.java | RegularFile.transferBlocksTo | void transferBlocksTo(RegularFile target, int count) {
"""
Transfers the last {@code count} blocks from this file to the end of the given target file.
"""
copyBlocksTo(target, count);
truncateBlocks(blockCount - count);
} | java | void transferBlocksTo(RegularFile target, int count) {
copyBlocksTo(target, count);
truncateBlocks(blockCount - count);
} | [
"void",
"transferBlocksTo",
"(",
"RegularFile",
"target",
",",
"int",
"count",
")",
"{",
"copyBlocksTo",
"(",
"target",
",",
"count",
")",
";",
"truncateBlocks",
"(",
"blockCount",
"-",
"count",
")",
";",
"}"
] | Transfers the last {@code count} blocks from this file to the end of the given target file. | [
"Transfers",
"the",
"last",
"{"
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L107-L110 |
vlingo/vlingo-http | src/main/java/io/vlingo/http/Body.java | Body.from | public static Body from(final ByteBuffer body, final Encoding encoding) {
"""
Answer a new {@code Body} with binary content using {@code encoding}.
@param body the ByteBuffer content
@param encoding the Encoding to use
@return Body
"""
switch (encoding) {
case Base64:
return new Body(bytesToBa... | java | public static Body from(final ByteBuffer body, final Encoding encoding) {
switch (encoding) {
case Base64:
return new Body(bytesToBase64(bufferToArray(body)));
case UTF8:
return new Body(bytesToUTF8(bufferToArray(body)));
}
throw new IllegalArgumentException("Unmapped encoding: " + encod... | [
"public",
"static",
"Body",
"from",
"(",
"final",
"ByteBuffer",
"body",
",",
"final",
"Encoding",
"encoding",
")",
"{",
"switch",
"(",
"encoding",
")",
"{",
"case",
"Base64",
":",
"return",
"new",
"Body",
"(",
"bytesToBase64",
"(",
"bufferToArray",
"(",
"b... | Answer a new {@code Body} with binary content using {@code encoding}.
@param body the ByteBuffer content
@param encoding the Encoding to use
@return Body | [
"Answer",
"a",
"new",
"{"
] | train | https://github.com/vlingo/vlingo-http/blob/746065fb1eaf1609c550ae45e96e3dbb9bfa37a2/src/main/java/io/vlingo/http/Body.java#L56-L64 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java | AddressClient.insertAddress | @BetaApi
public final Operation insertAddress(ProjectRegionName region, Address addressResource) {
"""
Creates an address resource in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (AddressClient addressClient = AddressClient.create()) {
ProjectRegionName re... | java | @BetaApi
public final Operation insertAddress(ProjectRegionName region, Address addressResource) {
InsertAddressHttpRequest request =
InsertAddressHttpRequest.newBuilder()
.setRegion(region == null ? null : region.toString())
.setAddressResource(addressResource)
.build... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertAddress",
"(",
"ProjectRegionName",
"region",
",",
"Address",
"addressResource",
")",
"{",
"InsertAddressHttpRequest",
"request",
"=",
"InsertAddressHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setRegion",
"("... | Creates an address resource in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (AddressClient addressClient = AddressClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
Address addressResource = Address.newBuilder().build();
Operat... | [
"Creates",
"an",
"address",
"resource",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java#L506-L515 |
oasp/oasp4j | modules/security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXmlMapper.java | AccessControlSchemaXmlMapper.writeXsd | public void writeXsd(File outFile) {
"""
Generates the XSD (XML Schema Definition) to the given {@link File}.
@param outFile is the {@link File} to write to.
"""
File folder = outFile.getParentFile();
if (!folder.isDirectory()) {
boolean success = folder.mkdirs();
if (!success) {
... | java | public void writeXsd(File outFile) {
File folder = outFile.getParentFile();
if (!folder.isDirectory()) {
boolean success = folder.mkdirs();
if (!success) {
throw new IllegalStateException("Failed to create folder " + folder);
}
}
try (FileOutputStream fos = new FileOutputStrea... | [
"public",
"void",
"writeXsd",
"(",
"File",
"outFile",
")",
"{",
"File",
"folder",
"=",
"outFile",
".",
"getParentFile",
"(",
")",
";",
"if",
"(",
"!",
"folder",
".",
"isDirectory",
"(",
")",
")",
"{",
"boolean",
"success",
"=",
"folder",
".",
"mkdirs",... | Generates the XSD (XML Schema Definition) to the given {@link File}.
@param outFile is the {@link File} to write to. | [
"Generates",
"the",
"XSD",
"(",
"XML",
"Schema",
"Definition",
")",
"to",
"the",
"given",
"{",
"@link",
"File",
"}",
"."
] | train | https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXmlMapper.java#L79-L93 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java | WriterTableProcessor.flushWithSingleRetry | private CompletableFuture<TableWriterFlushResult> flushWithSingleRetry(DirectSegmentAccess segment, TimeoutTimer timer) {
"""
Performs a flush attempt, and retries it in case it failed with {@link BadAttributeUpdateException} for the
{@link TableAttributes#INDEX_OFFSET} attribute.
In case of a retry, it reconc... | java | private CompletableFuture<TableWriterFlushResult> flushWithSingleRetry(DirectSegmentAccess segment, TimeoutTimer timer) {
return Futures.exceptionallyComposeExpecting(
flushOnce(segment, timer),
this::canRetryFlushException,
() -> {
reconcileTa... | [
"private",
"CompletableFuture",
"<",
"TableWriterFlushResult",
">",
"flushWithSingleRetry",
"(",
"DirectSegmentAccess",
"segment",
",",
"TimeoutTimer",
"timer",
")",
"{",
"return",
"Futures",
".",
"exceptionallyComposeExpecting",
"(",
"flushOnce",
"(",
"segment",
",",
"... | Performs a flush attempt, and retries it in case it failed with {@link BadAttributeUpdateException} for the
{@link TableAttributes#INDEX_OFFSET} attribute.
In case of a retry, it reconciles the cached value for the {@link TableAttributes#INDEX_OFFSET} attribute and
updates any internal state.
@param segment A {@link ... | [
"Performs",
"a",
"flush",
"attempt",
"and",
"retries",
"it",
"in",
"case",
"it",
"failed",
"with",
"{",
"@link",
"BadAttributeUpdateException",
"}",
"for",
"the",
"{",
"@link",
"TableAttributes#INDEX_OFFSET",
"}",
"attribute",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java#L252-L260 |
allure-framework/allure1 | allure-bundle/src/main/java/ru/yandex/qatools/allure/AllureMain.java | AllureMain.unpackFace | private static void unpackFace(File outputDirectory) throws IOException {
"""
Unpack report face to given directory.
@param outputDirectory the output directory to unpack face.
@throws IOException if any occurs.
"""
ClassLoader loader = AllureMain.class.getClassLoader();
for (ClassPath.Reso... | java | private static void unpackFace(File outputDirectory) throws IOException {
ClassLoader loader = AllureMain.class.getClassLoader();
for (ClassPath.ResourceInfo info : ClassPath.from(loader).getResources()) {
Matcher matcher = REPORT_RESOURCE_PATTERN.matcher(info.getResourceName());
... | [
"private",
"static",
"void",
"unpackFace",
"(",
"File",
"outputDirectory",
")",
"throws",
"IOException",
"{",
"ClassLoader",
"loader",
"=",
"AllureMain",
".",
"class",
".",
"getClassLoader",
"(",
")",
";",
"for",
"(",
"ClassPath",
".",
"ResourceInfo",
"info",
... | Unpack report face to given directory.
@param outputDirectory the output directory to unpack face.
@throws IOException if any occurs. | [
"Unpack",
"report",
"face",
"to",
"given",
"directory",
"."
] | train | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-bundle/src/main/java/ru/yandex/qatools/allure/AllureMain.java#L59-L74 |
atomix/catalyst | common/src/main/java/io/atomix/catalyst/util/PropertiesReader.java | PropertiesReader.getClass | public Class<?> getClass(String property) {
"""
Reads a class property.
@param property The property name.
@return The property value.
@throws ConfigurationException if the property is not present
"""
return getProperty(property, className -> {
try {
return Class.forName(className);
... | java | public Class<?> getClass(String property) {
return getProperty(property, className -> {
try {
return Class.forName(className);
} catch (ClassNotFoundException e) {
throw new ConfigurationException("unknown class: " + className, e);
}
});
} | [
"public",
"Class",
"<",
"?",
">",
"getClass",
"(",
"String",
"property",
")",
"{",
"return",
"getProperty",
"(",
"property",
",",
"className",
"->",
"{",
"try",
"{",
"return",
"Class",
".",
"forName",
"(",
"className",
")",
";",
"}",
"catch",
"(",
"Cla... | Reads a class property.
@param property The property name.
@return The property value.
@throws ConfigurationException if the property is not present | [
"Reads",
"a",
"class",
"property",
"."
] | train | https://github.com/atomix/catalyst/blob/140e762cb975cd8ee1fd85119043c5b8bf917c5c/common/src/main/java/io/atomix/catalyst/util/PropertiesReader.java#L144-L152 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withCharSequenceArray | public Postcard withCharSequenceArray(@Nullable String key, @Nullable CharSequence[] value) {
"""
Inserts a CharSequence array value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence arr... | java | public Postcard withCharSequenceArray(@Nullable String key, @Nullable CharSequence[] value) {
mBundle.putCharSequenceArray(key, value);
return this;
} | [
"public",
"Postcard",
"withCharSequenceArray",
"(",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"CharSequence",
"[",
"]",
"value",
")",
"{",
"mBundle",
".",
"putCharSequenceArray",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a CharSequence array value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence array object, or null
@return current | [
"Inserts",
"a",
"CharSequence",
"array",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L533-L536 |
steveash/bushwhacker | bushwhacker/src/main/java/com/github/steveash/bushwhacker/Bushwhacker.java | Bushwhacker.tryForRules | public static Bushwhacker tryForRules(String rulesFileNameOnClasspath) {
"""
Convenient wrapper of #forRules that swallows any exception (logging it to warn first) then
returns a NoOp implementation of Bushwhacker. This is convenient when you are using
Bushwhacker in its typical usage scenario and want it to si... | java | public static Bushwhacker tryForRules(String rulesFileNameOnClasspath) {
try {
return forRules(rulesFileNameOnClasspath);
} catch (IOException e) {
return logAndMakeNoOp(rulesFileNameOnClasspath, e);
}
} | [
"public",
"static",
"Bushwhacker",
"tryForRules",
"(",
"String",
"rulesFileNameOnClasspath",
")",
"{",
"try",
"{",
"return",
"forRules",
"(",
"rulesFileNameOnClasspath",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"return",
"logAndMakeNoOp",
"(",
... | Convenient wrapper of #forRules that swallows any exception (logging it to warn first) then
returns a NoOp implementation of Bushwhacker. This is convenient when you are using
Bushwhacker in its typical usage scenario and want it to silently fail
@param rulesFileNameOnClasspath
@return | [
"Convenient",
"wrapper",
"of",
"#forRules",
"that",
"swallows",
"any",
"exception",
"(",
"logging",
"it",
"to",
"warn",
"first",
")",
"then",
"returns",
"a",
"NoOp",
"implementation",
"of",
"Bushwhacker",
".",
"This",
"is",
"convenient",
"when",
"you",
"are",
... | train | https://github.com/steveash/bushwhacker/blob/93958dea1f4e1d881e863970fd12b857278813c1/bushwhacker/src/main/java/com/github/steveash/bushwhacker/Bushwhacker.java#L71-L77 |
spotify/helios | helios-tools/src/main/java/com/spotify/helios/cli/CliParser.java | CliParser.handleError | @SuppressWarnings("UseOfSystemOutOrSystemErr")
private void handleError(ArgumentParser parser, ArgumentParserException ex) {
"""
Use this instead of calling parser.handle error directly. This will print a header with
links to jira and documentation before the standard error message is printed.
@param parser ... | java | @SuppressWarnings("UseOfSystemOutOrSystemErr")
private void handleError(ArgumentParser parser, ArgumentParserException ex) {
System.err.println("# " + HELP_ISSUES);
System.err.println("# " + HELP_WIKI);
System.err.println("# ---------------------------------------------------------------");
parser.han... | [
"@",
"SuppressWarnings",
"(",
"\"UseOfSystemOutOrSystemErr\"",
")",
"private",
"void",
"handleError",
"(",
"ArgumentParser",
"parser",
",",
"ArgumentParserException",
"ex",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"# \"",
"+",
"HELP_ISSUES",
")",
";"... | Use this instead of calling parser.handle error directly. This will print a header with
links to jira and documentation before the standard error message is printed.
@param parser the parser which will print the standard error message
@param ex the exception that will be printed | [
"Use",
"this",
"instead",
"of",
"calling",
"parser",
".",
"handle",
"error",
"directly",
".",
"This",
"will",
"print",
"a",
"header",
"with",
"links",
"to",
"jira",
"and",
"documentation",
"before",
"the",
"standard",
"error",
"message",
"is",
"printed",
"."... | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-tools/src/main/java/com/spotify/helios/cli/CliParser.java#L241-L247 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/Jenkins.java | Jenkins.doResources | public void doResources(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
"""
Serves static resources placed along with Jelly view files.
<p>
This method can serve a lot of files, so care needs to be taken
to make this method secure. It's not clear to me what's the best
strategy h... | java | public void doResources(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
String path = req.getRestOfPath();
// cut off the "..." portion of /resources/.../path/to/file
// as this is only used to make path unique (which in turn
// allows us to set a long exp... | [
"public",
"void",
"doResources",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"String",
"path",
"=",
"req",
".",
"getRestOfPath",
"(",
")",
";",
"// cut off the \"...\" portion of /resources/.... | Serves static resources placed along with Jelly view files.
<p>
This method can serve a lot of files, so care needs to be taken
to make this method secure. It's not clear to me what's the best
strategy here, though the current implementation is based on
file extensions. | [
"Serves",
"static",
"resources",
"placed",
"along",
"with",
"Jelly",
"view",
"files",
".",
"<p",
">",
"This",
"method",
"can",
"serve",
"a",
"lot",
"of",
"files",
"so",
"care",
"needs",
"to",
"be",
"taken",
"to",
"make",
"this",
"method",
"secure",
".",
... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4575-L4593 |
geomajas/geomajas-project-server | common-servlet/src/main/java/org/geomajas/servlet/CacheFilter.java | CacheFilter.checkSuffixes | public boolean checkSuffixes(String uri, String[] patterns) {
"""
Check whether the URL end with one of the given suffixes.
@param uri URI
@param patterns possible suffixes
@return true when URL ends with one of the suffixes
"""
for (String pattern : patterns) {
if (pattern.length() > 0) {
if (ur... | java | public boolean checkSuffixes(String uri, String[] patterns) {
for (String pattern : patterns) {
if (pattern.length() > 0) {
if (uri.endsWith(pattern)) {
return true;
}
}
}
return false;
} | [
"public",
"boolean",
"checkSuffixes",
"(",
"String",
"uri",
",",
"String",
"[",
"]",
"patterns",
")",
"{",
"for",
"(",
"String",
"pattern",
":",
"patterns",
")",
"{",
"if",
"(",
"pattern",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"ur... | Check whether the URL end with one of the given suffixes.
@param uri URI
@param patterns possible suffixes
@return true when URL ends with one of the suffixes | [
"Check",
"whether",
"the",
"URL",
"end",
"with",
"one",
"of",
"the",
"given",
"suffixes",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/common-servlet/src/main/java/org/geomajas/servlet/CacheFilter.java#L263-L272 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java | RTreeIndexCoreExtension.createRTreeIndex | public void createRTreeIndex(String tableName, String geometryColumnName) {
"""
Create the RTree Index Virtual Table
@param tableName
table name
@param geometryColumnName
geometry column name
"""
String sqlName = GeoPackageProperties.getProperty(SQL_PROPERTY,
CREATE_PROPERTY);
executeSQL(sqlName... | java | public void createRTreeIndex(String tableName, String geometryColumnName) {
String sqlName = GeoPackageProperties.getProperty(SQL_PROPERTY,
CREATE_PROPERTY);
executeSQL(sqlName, tableName, geometryColumnName);
} | [
"public",
"void",
"createRTreeIndex",
"(",
"String",
"tableName",
",",
"String",
"geometryColumnName",
")",
"{",
"String",
"sqlName",
"=",
"GeoPackageProperties",
".",
"getProperty",
"(",
"SQL_PROPERTY",
",",
"CREATE_PROPERTY",
")",
";",
"executeSQL",
"(",
"sqlName"... | Create the RTree Index Virtual Table
@param tableName
table name
@param geometryColumnName
geometry column name | [
"Create",
"the",
"RTree",
"Index",
"Virtual",
"Table"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java#L421-L426 |
hal/core | gui/src/main/java/org/jboss/as/console/client/tools/ModelBrowserView.java | ModelBrowserView.updateChildrenTypes | public void updateChildrenTypes(ModelNode address, List<ModelNode> modelNodes) {
"""
Update sub parts of the tree
@param address
@param modelNodes
"""
TreeItem rootItem = findTreeItem(tree, address);
addChildrenTypes((ModelTreeItem) rootItem, modelNodes);
} | java | public void updateChildrenTypes(ModelNode address, List<ModelNode> modelNodes) {
TreeItem rootItem = findTreeItem(tree, address);
addChildrenTypes((ModelTreeItem) rootItem, modelNodes);
} | [
"public",
"void",
"updateChildrenTypes",
"(",
"ModelNode",
"address",
",",
"List",
"<",
"ModelNode",
">",
"modelNodes",
")",
"{",
"TreeItem",
"rootItem",
"=",
"findTreeItem",
"(",
"tree",
",",
"address",
")",
";",
"addChildrenTypes",
"(",
"(",
"ModelTreeItem",
... | Update sub parts of the tree
@param address
@param modelNodes | [
"Update",
"sub",
"parts",
"of",
"the",
"tree"
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/tools/ModelBrowserView.java#L471-L476 |
enioka/jqm | jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/JqmEngineFactory.java | JqmEngineFactory.initializeMetadata | public static void initializeMetadata() {
"""
If the database you use is brand new (empty tables) you may want to use this to initialize the metadata instead of using the meta
API.
"""
// TODO: merge inside meta API.
DbConn cnx = null;
try
{
cnx = Helpers.getNewDbSe... | java | public static void initializeMetadata()
{
// TODO: merge inside meta API.
DbConn cnx = null;
try
{
cnx = Helpers.getNewDbSession();
Helpers.updateConfiguration(cnx);
cnx.commit();
}
catch (Exception e)
{
throw ne... | [
"public",
"static",
"void",
"initializeMetadata",
"(",
")",
"{",
"// TODO: merge inside meta API.",
"DbConn",
"cnx",
"=",
"null",
";",
"try",
"{",
"cnx",
"=",
"Helpers",
".",
"getNewDbSession",
"(",
")",
";",
"Helpers",
".",
"updateConfiguration",
"(",
"cnx",
... | If the database you use is brand new (empty tables) you may want to use this to initialize the metadata instead of using the meta
API. | [
"If",
"the",
"database",
"you",
"use",
"is",
"brand",
"new",
"(",
"empty",
"tables",
")",
"you",
"may",
"want",
"to",
"use",
"this",
"to",
"initialize",
"the",
"metadata",
"instead",
"of",
"using",
"the",
"meta",
"API",
"."
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/JqmEngineFactory.java#L46-L64 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.logException | public void logException(Throwable e, String message) {
"""
Log an exception.
@param e
the exception
@param message
message describing how/why the exception occurred
"""
logMessage(IStatus.ERROR, message, e);
} | java | public void logException(Throwable e, String message) {
logMessage(IStatus.ERROR, message, e);
} | [
"public",
"void",
"logException",
"(",
"Throwable",
"e",
",",
"String",
"message",
")",
"{",
"logMessage",
"(",
"IStatus",
".",
"ERROR",
",",
"message",
",",
"e",
")",
";",
"}"
] | Log an exception.
@param e
the exception
@param message
message describing how/why the exception occurred | [
"Log",
"an",
"exception",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L548-L550 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/io/FastByteArrayOutputStream.java | FastByteArrayOutputStream.toByteArray | public void toByteArray(byte[] toBuf, int offset) {
"""
Copy the buffered data to the given array.
@param toBuf the buffer to hold a copy of the data.
@param offset the offset at which to start copying.
"""
int toLen = (toBuf.length > count) ? count : toBuf.length;
System.arraycopy(buf, of... | java | public void toByteArray(byte[] toBuf, int offset) {
int toLen = (toBuf.length > count) ? count : toBuf.length;
System.arraycopy(buf, offset, toBuf, offset, toLen - offset);
} | [
"public",
"void",
"toByteArray",
"(",
"byte",
"[",
"]",
"toBuf",
",",
"int",
"offset",
")",
"{",
"int",
"toLen",
"=",
"(",
"toBuf",
".",
"length",
">",
"count",
")",
"?",
"count",
":",
"toBuf",
".",
"length",
";",
"System",
".",
"arraycopy",
"(",
"... | Copy the buffered data to the given array.
@param toBuf the buffer to hold a copy of the data.
@param offset the offset at which to start copying. | [
"Copy",
"the",
"buffered",
"data",
"to",
"the",
"given",
"array",
"."
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/io/FastByteArrayOutputStream.java#L203-L206 |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java | JavaMailSender.addAttachment | private void addAttachment(Multipart multipart, Attachment attachment) throws AttachmentResourceHandlerException {
"""
Add an attachment on the mime message.
@param multipart
the mime message to fill
@param attachment
the attachment to add
@throws AttachmentResourceHandlerException
when the attachment coul... | java | private void addAttachment(Multipart multipart, Attachment attachment) throws AttachmentResourceHandlerException {
MimeBodyPart part = new MimeBodyPart();
try {
part.setFileName(attachment.getResource().getName());
part.setDisposition(attachment.getDisposition());
part.setDescription(attachment.getDescript... | [
"private",
"void",
"addAttachment",
"(",
"Multipart",
"multipart",
",",
"Attachment",
"attachment",
")",
"throws",
"AttachmentResourceHandlerException",
"{",
"MimeBodyPart",
"part",
"=",
"new",
"MimeBodyPart",
"(",
")",
";",
"try",
"{",
"part",
".",
"setFileName",
... | Add an attachment on the mime message.
@param multipart
the mime message to fill
@param attachment
the attachment to add
@throws AttachmentResourceHandlerException
when the attachment couldn't be attached | [
"Add",
"an",
"attachment",
"on",
"the",
"mime",
"message",
"."
] | train | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java#L278-L290 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.