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 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/jsp/decorator/CmsDecorationDefintion.java | CmsDecorationDefintion.getDecorationMaps | private List<CmsDecorationMap> getDecorationMaps(CmsObject cms, List<CmsResource> decorationListFiles) {
"""
Creates a list of decoration map objects from a given list of decoration files.<p>
@param cms the CmsObject
@param decorationListFiles the list of decoration files
@return list of decoration map object... | java | private List<CmsDecorationMap> getDecorationMaps(CmsObject cms, List<CmsResource> decorationListFiles) {
List<CmsDecorationMap> decorationMaps = new ArrayList<CmsDecorationMap>();
Iterator<CmsResource> i = decorationListFiles.iterator();
while (i.hasNext()) {
CmsResource res = i.nex... | [
"private",
"List",
"<",
"CmsDecorationMap",
">",
"getDecorationMaps",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"CmsResource",
">",
"decorationListFiles",
")",
"{",
"List",
"<",
"CmsDecorationMap",
">",
"decorationMaps",
"=",
"new",
"ArrayList",
"<",
"CmsDecorati... | Creates a list of decoration map objects from a given list of decoration files.<p>
@param cms the CmsObject
@param decorationListFiles the list of decoration files
@return list of decoration map objects | [
"Creates",
"a",
"list",
"of",
"decoration",
"map",
"objects",
"from",
"a",
"given",
"list",
"of",
"decoration",
"files",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/decorator/CmsDecorationDefintion.java#L452-L479 |
lite2073/email-validator | src/com/dominicsayers/isemail/IsEMail.java | IsEMail.replaceCharAt | private static String replaceCharAt(String s, int pos, char c) {
"""
Replaces a char in a String
@param s
The input string
@param pos
The position of the char to be replaced
@param c
The new char
@return The new String
@see Source: http://www.rgagnon.com/javadetails/java-0030.html
"""
return s.sub... | java | private static String replaceCharAt(String s, int pos, char c) {
return s.substring(0, pos) + c + s.substring(pos + 1);
} | [
"private",
"static",
"String",
"replaceCharAt",
"(",
"String",
"s",
",",
"int",
"pos",
",",
"char",
"c",
")",
"{",
"return",
"s",
".",
"substring",
"(",
"0",
",",
"pos",
")",
"+",
"c",
"+",
"s",
".",
"substring",
"(",
"pos",
"+",
"1",
")",
";",
... | Replaces a char in a String
@param s
The input string
@param pos
The position of the char to be replaced
@param c
The new char
@return The new String
@see Source: http://www.rgagnon.com/javadetails/java-0030.html | [
"Replaces",
"a",
"char",
"in",
"a",
"String"
] | train | https://github.com/lite2073/email-validator/blob/cfdda77ed630854b44d62def0d5b7228d5c4e712/src/com/dominicsayers/isemail/IsEMail.java#L745-L747 |
alkacon/opencms-core | src/org/opencms/i18n/CmsMultiMessages.java | CmsMultiMessages.addMessages | public void addMessages(CmsMessages messages) throws CmsIllegalArgumentException {
"""
Adds a messages instance to this multi message bundle.<p>
The messages instance should have been initialized with the same locale as this multi bundle,
if not, the locale of the messages instance is automatically replaced. H... | java | public void addMessages(CmsMessages messages) throws CmsIllegalArgumentException {
Locale locale = messages.getLocale();
if (!getLocale().equals(locale)) {
// not the same locale, try to change the locale if this is a simple CmsMessage object
if (!(messages instanceof CmsMultiMe... | [
"public",
"void",
"addMessages",
"(",
"CmsMessages",
"messages",
")",
"throws",
"CmsIllegalArgumentException",
"{",
"Locale",
"locale",
"=",
"messages",
".",
"getLocale",
"(",
")",
";",
"if",
"(",
"!",
"getLocale",
"(",
")",
".",
"equals",
"(",
"locale",
")"... | Adds a messages instance to this multi message bundle.<p>
The messages instance should have been initialized with the same locale as this multi bundle,
if not, the locale of the messages instance is automatically replaced. However, this will not work
if the added messages instance is in face also of type <code>{@link ... | [
"Adds",
"a",
"messages",
"instance",
"to",
"this",
"multi",
"message",
"bundle",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsMultiMessages.java#L129-L153 |
google/closure-templates | java/src/com/google/template/soy/passes/PluginResolver.java | PluginResolver.lookupSoyFunction | public Object lookupSoyFunction(String name, int numArgs, SourceLocation location) {
"""
Returns a function with the given name and arity.
<p>An error will be reported according to the current {@link Mode} and a placeholder function
will be returned if it cannot be found.
"""
Object soyFunction = funct... | java | public Object lookupSoyFunction(String name, int numArgs, SourceLocation location) {
Object soyFunction = functions.get(name);
if (soyFunction == null) {
reportMissing(location, "function", name, functions.keySet());
return ERROR_PLACEHOLDER_FUNCTION;
}
Set<Integer> validArgsSize;
if (so... | [
"public",
"Object",
"lookupSoyFunction",
"(",
"String",
"name",
",",
"int",
"numArgs",
",",
"SourceLocation",
"location",
")",
"{",
"Object",
"soyFunction",
"=",
"functions",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"soyFunction",
"==",
"null",
")",
"... | Returns a function with the given name and arity.
<p>An error will be reported according to the current {@link Mode} and a placeholder function
will be returned if it cannot be found. | [
"Returns",
"a",
"function",
"with",
"the",
"given",
"name",
"and",
"arity",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/passes/PluginResolver.java#L194-L211 |
roboconf/roboconf-platform | core/roboconf-agent-monitoring/src/main/java/net/roboconf/agent/monitoring/internal/nagios/LiveStatusClient.java | LiveStatusClient.format | String format( String request, String liveStatusResponse ) {
"""
When columns are specified, Live Status omits the column names.
<p>
This method adds them.
</p>
@param liveStatusResponse the (non-null) response
@return a non-null string
"""
String columnsDecl = null;
for( String s : request.split( ... | java | String format( String request, String liveStatusResponse ) {
String columnsDecl = null;
for( String s : request.split( "\n" )) {
s = s.trim();
if( s.toLowerCase().startsWith( NAGIOS_COLUMNS )) {
columnsDecl = s.substring( NAGIOS_COLUMNS.length()).trim();
break;
}
}
String result = liveStatusR... | [
"String",
"format",
"(",
"String",
"request",
",",
"String",
"liveStatusResponse",
")",
"{",
"String",
"columnsDecl",
"=",
"null",
";",
"for",
"(",
"String",
"s",
":",
"request",
".",
"split",
"(",
"\"\\n\"",
")",
")",
"{",
"s",
"=",
"s",
".",
"trim",
... | When columns are specified, Live Status omits the column names.
<p>
This method adds them.
</p>
@param liveStatusResponse the (non-null) response
@return a non-null string | [
"When",
"columns",
"are",
"specified",
"Live",
"Status",
"omits",
"the",
"column",
"names",
".",
"<p",
">",
"This",
"method",
"adds",
"them",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent-monitoring/src/main/java/net/roboconf/agent/monitoring/internal/nagios/LiveStatusClient.java#L113-L131 |
jenetics/jenetics | jenetics/src/main/java/io/jenetics/PermutationChromosome.java | PermutationChromosome.ofInteger | public static PermutationChromosome<Integer>
ofInteger(final int start, final int end) {
"""
Create an integer permutation chromosome with the given range.
@since 2.0
@param start the start of the integer range (inclusively) of the returned
chromosome.
@param end the end of the integer range (exclusively)... | java | public static PermutationChromosome<Integer>
ofInteger(final int start, final int end) {
if (end <= start) {
throw new IllegalArgumentException(format(
"end <= start: %d <= %d", end, start
));
}
return ofInteger(IntRange.of(start, end), end - start);
} | [
"public",
"static",
"PermutationChromosome",
"<",
"Integer",
">",
"ofInteger",
"(",
"final",
"int",
"start",
",",
"final",
"int",
"end",
")",
"{",
"if",
"(",
"end",
"<=",
"start",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"format",
"(",
"\... | Create an integer permutation chromosome with the given range.
@since 2.0
@param start the start of the integer range (inclusively) of the returned
chromosome.
@param end the end of the integer range (exclusively) of the returned
chromosome.
@return a integer permutation chromosome with the given integer range
values... | [
"Create",
"an",
"integer",
"permutation",
"chromosome",
"with",
"the",
"given",
"range",
"."
] | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics/src/main/java/io/jenetics/PermutationChromosome.java#L283-L292 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nstimer_binding.java | nstimer_binding.get | public static nstimer_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch nstimer_binding resource of given name .
"""
nstimer_binding obj = new nstimer_binding();
obj.set_name(name);
nstimer_binding response = (nstimer_binding) obj.get_resource(service);
return... | java | public static nstimer_binding get(nitro_service service, String name) throws Exception{
nstimer_binding obj = new nstimer_binding();
obj.set_name(name);
nstimer_binding response = (nstimer_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"nstimer_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"nstimer_binding",
"obj",
"=",
"new",
"nstimer_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"nst... | Use this API to fetch nstimer_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"nstimer_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nstimer_binding.java#L103-L108 |
BlueBrain/bluima | modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/cr/PdfCollectionReader.java | PdfCollectionReader.serializeXMLDocument | public static void serializeXMLDocument (Document doc, Writer output) throws TransformerException {
"""
Writes the given Document to the given Writer using a no-op XSL transformation.
"""
// serialize XML document using identity transformation
Transformer trans = TransformerFactory.newInstance(... | java | public static void serializeXMLDocument (Document doc, Writer output) throws TransformerException {
// serialize XML document using identity transformation
Transformer trans = TransformerFactory.newInstance().newTransformer();
DOMSource source = new DOMSource(doc);
StreamResult result = ... | [
"public",
"static",
"void",
"serializeXMLDocument",
"(",
"Document",
"doc",
",",
"Writer",
"output",
")",
"throws",
"TransformerException",
"{",
"// serialize XML document using identity transformation",
"Transformer",
"trans",
"=",
"TransformerFactory",
".",
"newInstance",
... | Writes the given Document to the given Writer using a no-op XSL transformation. | [
"Writes",
"the",
"given",
"Document",
"to",
"the",
"given",
"Writer",
"using",
"a",
"no",
"-",
"op",
"XSL",
"transformation",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/cr/PdfCollectionReader.java#L392-L398 |
CloudSlang/cs-actions | cs-utilities/src/main/java/io/cloudslang/content/utilities/actions/DefaultIfEmpty.java | DefaultIfEmpty.execute | @Action(name = "Default if empty",
description = OPERATION_DESC,
outputs = {
"""
This operation checks if a string is blank or empty and if it's true a default value
will be assigned instead of the initial string.
@param initialValue The initial string.
@param defaultValue The default ... | java | @Action(name = "Default if empty",
description = OPERATION_DESC,
outputs = {
@Output(value = RETURN_CODE, description = RETURN_CODE_DESC),
@Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC),
@Output(value = EXCEPTION, desc... | [
"@",
"Action",
"(",
"name",
"=",
"\"Default if empty\"",
",",
"description",
"=",
"OPERATION_DESC",
",",
"outputs",
"=",
"{",
"@",
"Output",
"(",
"value",
"=",
"RETURN_CODE",
",",
"description",
"=",
"RETURN_CODE_DESC",
")",
",",
"@",
"Output",
"(",
"value",... | This operation checks if a string is blank or empty and if it's true a default value
will be assigned instead of the initial string.
@param initialValue The initial string.
@param defaultValue The default value used to replace the initial string.
@param trim A variable used to check if the initial string is bl... | [
"This",
"operation",
"checks",
"if",
"a",
"string",
"is",
"blank",
"or",
"empty",
"and",
"if",
"it",
"s",
"true",
"a",
"default",
"value",
"will",
"be",
"assigned",
"instead",
"of",
"the",
"initial",
"string",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-utilities/src/main/java/io/cloudslang/content/utilities/actions/DefaultIfEmpty.java#L66-L92 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.setSearchTabs | @SuppressWarnings("unchecked")
@Resource(name = "searchTabs")
// Map of tab-key to string or collection<string> of search result types
public void setSearchTabs(Map<String, Object> searchTabMappings) {
"""
Set the mappings from TabKey to ResultType. The map keys must be strings but the values can
be e... | java | @SuppressWarnings("unchecked")
@Resource(name = "searchTabs")
// Map of tab-key to string or collection<string> of search result types
public void setSearchTabs(Map<String, Object> searchTabMappings) {
final Map<String, Set<String>> resultTypeMappingsBuilder = new LinkedHashMap<>();
final Li... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Resource",
"(",
"name",
"=",
"\"searchTabs\"",
")",
"// Map of tab-key to string or collection<string> of search result types",
"public",
"void",
"setSearchTabs",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"s... | Set the mappings from TabKey to ResultType. The map keys must be strings but the values can
be either String or Collection<String> | [
"Set",
"the",
"mappings",
"from",
"TabKey",
"to",
"ResultType",
".",
"The",
"map",
"keys",
"must",
"be",
"strings",
"but",
"the",
"values",
"can",
"be",
"either",
"String",
"or",
"Collection<String",
">"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L194-L218 |
omadahealth/CircularBarPager | library/src/main/java/com/github/omadahealth/circularbarpager/library/CircularBarPager.java | CircularBarPager.initializeView | private void initializeView(AttributeSet attrs, int defStyleAttr) {
"""
Init the view by getting the {@link CircularBar},
the {@link android.support.v4.view.ViewPager} and the {@link com.viewpagerindicator.CirclePageIndicator}.
Init also some default values as PageTranformer etc...
"""
if (attrs != n... | java | private void initializeView(AttributeSet attrs, int defStyleAttr) {
if (attrs != null) {
final TypedArray attributes = mContext.getTheme().obtainStyledAttributes(attrs, R.styleable.CircularViewPager,
defStyleAttr, 0);
boolean enableOnClick = attributes.getBoolean(R.s... | [
"private",
"void",
"initializeView",
"(",
"AttributeSet",
"attrs",
",",
"int",
"defStyleAttr",
")",
"{",
"if",
"(",
"attrs",
"!=",
"null",
")",
"{",
"final",
"TypedArray",
"attributes",
"=",
"mContext",
".",
"getTheme",
"(",
")",
".",
"obtainStyledAttributes",... | Init the view by getting the {@link CircularBar},
the {@link android.support.v4.view.ViewPager} and the {@link com.viewpagerindicator.CirclePageIndicator}.
Init also some default values as PageTranformer etc... | [
"Init",
"the",
"view",
"by",
"getting",
"the",
"{"
] | train | https://github.com/omadahealth/CircularBarPager/blob/3a43e8828849da727fd13345e83b8432f7271155/library/src/main/java/com/github/omadahealth/circularbarpager/library/CircularBarPager.java#L102-L148 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.traceOn | public void traceOn(OutputStream traceStream) {
"""
Enables HTTP call tracing and written to traceStream.
@param traceStream {@link OutputStream} for writing HTTP call tracing.
@see #traceOff
"""
if (traceStream == null) {
throw new NullPointerException();
} else {
this.traceStream = ... | java | public void traceOn(OutputStream traceStream) {
if (traceStream == null) {
throw new NullPointerException();
} else {
this.traceStream = new PrintWriter(new OutputStreamWriter(traceStream, StandardCharsets.UTF_8), true);
}
} | [
"public",
"void",
"traceOn",
"(",
"OutputStream",
"traceStream",
")",
"{",
"if",
"(",
"traceStream",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"else",
"{",
"this",
".",
"traceStream",
"=",
"new",
"PrintWriter",
"("... | Enables HTTP call tracing and written to traceStream.
@param traceStream {@link OutputStream} for writing HTTP call tracing.
@see #traceOff | [
"Enables",
"HTTP",
"call",
"tracing",
"and",
"written",
"to",
"traceStream",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L5112-L5118 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/StandardResponsesApi.java | StandardResponsesApi.deleteStandardResponseFavorite | public ApiSuccessResponse deleteStandardResponseFavorite(String id, RemoveFavoritesData removeFavoritesData) throws ApiException {
"""
Remove a Standard Response from Favorites
@param id id of the Standard Response to remove from Favorites (required)
@param removeFavoritesData Request parameters. (optional)
@... | java | public ApiSuccessResponse deleteStandardResponseFavorite(String id, RemoveFavoritesData removeFavoritesData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = deleteStandardResponseFavoriteWithHttpInfo(id, removeFavoritesData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"deleteStandardResponseFavorite",
"(",
"String",
"id",
",",
"RemoveFavoritesData",
"removeFavoritesData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"deleteStandardResponseFavoriteWithHttpInfo"... | Remove a Standard Response from Favorites
@param id id of the Standard Response to remove from Favorites (required)
@param removeFavoritesData Request parameters. (optional)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Remove",
"a",
"Standard",
"Response",
"from",
"Favorites"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/StandardResponsesApi.java#L385-L388 |
jbossas/remoting-jmx | src/main/java/org/jboss/remotingjmx/DelegatingRemotingConnectorServer.java | DelegatingRemotingConnectorServer.writeVersionHeader | private void writeVersionHeader(final Channel channel, final boolean fullVersionList) throws IOException {
"""
Write the header message to the client.
<p/>
The header message will contain the following items to allow the client to select a version: -
<p/>
- The bytes for the characters 'JMX' - not completely f... | java | private void writeVersionHeader(final Channel channel, final boolean fullVersionList) throws IOException {
CancellableDataOutputStream dos = new CancellableDataOutputStream(channel.writeMessage());
try {
dos.writeBytes(JMX);
byte[] versions = getSupportedVersions(fullVersionList)... | [
"private",
"void",
"writeVersionHeader",
"(",
"final",
"Channel",
"channel",
",",
"final",
"boolean",
"fullVersionList",
")",
"throws",
"IOException",
"{",
"CancellableDataOutputStream",
"dos",
"=",
"new",
"CancellableDataOutputStream",
"(",
"channel",
".",
"writeMessag... | Write the header message to the client.
<p/>
The header message will contain the following items to allow the client to select a version: -
<p/>
- The bytes for the characters 'JMX' - not completely fail safe but will allow early detection the client is connected to
the correct channel. - The number of versions support... | [
"Write",
"the",
"header",
"message",
"to",
"the",
"client",
".",
"<p",
"/",
">",
"The",
"header",
"message",
"will",
"contain",
"the",
"following",
"items",
"to",
"allow",
"the",
"client",
"to",
"select",
"a",
"version",
":",
"-",
"<p",
"/",
">",
"-",
... | train | https://github.com/jbossas/remoting-jmx/blob/dbc87bfed47e5bb9e37c355a77ca0ae9a6ea1363/src/main/java/org/jboss/remotingjmx/DelegatingRemotingConnectorServer.java#L185-L210 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/utils/PluginRepositoryUtil.java | PluginRepositoryUtil.parseCommandLine | @SuppressWarnings("rawtypes")
private static void parseCommandLine(final PluginDefinition pluginDef, final Element xmlPluginElement) {
"""
Updates the plugin definition with the commandline read from the xml
file.
@param pluginDef
The plugin definition to be updated
@param xmlPluginElement
the xml eleme... | java | @SuppressWarnings("rawtypes")
private static void parseCommandLine(final PluginDefinition pluginDef, final Element xmlPluginElement) {
Element commandLine = xmlPluginElement.element("command-line");
if (commandLine != null) {
// The plugin has a command line...
Element optio... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"private",
"static",
"void",
"parseCommandLine",
"(",
"final",
"PluginDefinition",
"pluginDef",
",",
"final",
"Element",
"xmlPluginElement",
")",
"{",
"Element",
"commandLine",
"=",
"xmlPluginElement",
".",
"element",... | Updates the plugin definition with the commandline read from the xml
file.
@param pluginDef
The plugin definition to be updated
@param xmlPluginElement
the xml element to be parsed | [
"Updates",
"the",
"plugin",
"definition",
"with",
"the",
"commandline",
"read",
"from",
"the",
"xml",
"file",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/utils/PluginRepositoryUtil.java#L245-L262 |
gwtbootstrap3/gwtbootstrap3-extras | src/main/java/org/gwtbootstrap3/extras/animate/client/ui/Animate.java | Animate.stopAnimation | public static final <T extends UIObject> void stopAnimation(final T widget, final String animation) {
"""
Removes custom animation class and stops animation.
@param widget Element to remove style from.
@param animation Animation CSS class to remove.
"""
if (widget != null && animation != null) {
... | java | public static final <T extends UIObject> void stopAnimation(final T widget, final String animation){
if (widget != null && animation != null) {
stopAnimation(widget.getElement(), animation);
}
} | [
"public",
"static",
"final",
"<",
"T",
"extends",
"UIObject",
">",
"void",
"stopAnimation",
"(",
"final",
"T",
"widget",
",",
"final",
"String",
"animation",
")",
"{",
"if",
"(",
"widget",
"!=",
"null",
"&&",
"animation",
"!=",
"null",
")",
"{",
"stopAni... | Removes custom animation class and stops animation.
@param widget Element to remove style from.
@param animation Animation CSS class to remove. | [
"Removes",
"custom",
"animation",
"class",
"and",
"stops",
"animation",
"."
] | train | https://github.com/gwtbootstrap3/gwtbootstrap3-extras/blob/8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94/src/main/java/org/gwtbootstrap3/extras/animate/client/ui/Animate.java#L334-L338 |
kiswanij/jk-util | src/main/java/com/jk/util/JKCollectionUtil.java | JKCollectionUtil.unifyReferences | public static void unifyReferences(final Hashtable hash, final List list) {
"""
Unify the objects in the list according to the hash code IMPORTANT : hashcode
usage here is different from the Java Spec , IT SHOULD BE UNIUQUE FOR EACH
OBJECT WHICH SHOULD HOLD SOMTHING LIKE THE DATABASE PRIMARY KEY.
@param hash ... | java | public static void unifyReferences(final Hashtable hash, final List list) {
if (list != null) {
for (int i = 0; i < list.size(); i++) {
final Object itemAtList = list.get(i);
final Object unifiedReferences = unifyReferences(hash, itemAtList);
list.set(i, unifiedReferences);
}
}
} | [
"public",
"static",
"void",
"unifyReferences",
"(",
"final",
"Hashtable",
"hash",
",",
"final",
"List",
"list",
")",
"{",
"if",
"(",
"list",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"list",
".",
"size",
"(",
")",
"... | Unify the objects in the list according to the hash code IMPORTANT : hashcode
usage here is different from the Java Spec , IT SHOULD BE UNIUQUE FOR EACH
OBJECT WHICH SHOULD HOLD SOMTHING LIKE THE DATABASE PRIMARY KEY.
@param hash the hash
@param list the list | [
"Unify",
"the",
"objects",
"in",
"the",
"list",
"according",
"to",
"the",
"hash",
"code",
"IMPORTANT",
":",
"hashcode",
"usage",
"here",
"is",
"different",
"from",
"the",
"Java",
"Spec",
"IT",
"SHOULD",
"BE",
"UNIUQUE",
"FOR",
"EACH",
"OBJECT",
"WHICH",
"S... | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKCollectionUtil.java#L102-L110 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getRefIndex | protected int getRefIndex(Class<? extends Ref> refType, String fullyQualifiedname, String name, String descriptor) {
"""
Returns the constant map index to reference
@param refType
@param fullyQualifiedname
@param name
@param descriptor
@return
"""
String internalForm = fullyQualifiedname.replace('... | java | protected int getRefIndex(Class<? extends Ref> refType, String fullyQualifiedname, String name, String descriptor)
{
String internalForm = fullyQualifiedname.replace('.', '/');
for (ConstantInfo ci : listConstantInfo(refType))
{
Ref mr = (Ref) ci;
int classIndex = mr.... | [
"protected",
"int",
"getRefIndex",
"(",
"Class",
"<",
"?",
"extends",
"Ref",
">",
"refType",
",",
"String",
"fullyQualifiedname",
",",
"String",
"name",
",",
"String",
"descriptor",
")",
"{",
"String",
"internalForm",
"=",
"fullyQualifiedname",
".",
"replace",
... | Returns the constant map index to reference
@param refType
@param fullyQualifiedname
@param name
@param descriptor
@return | [
"Returns",
"the",
"constant",
"map",
"index",
"to",
"reference"
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L248-L275 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/FieldReSelectHandler.java | FieldReSelectHandler.init | public void init(BaseField field, GridScreenParent gridScreen, GridComponent sPopupBox) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param gridScreen The grid screen to reselect on change.
"""
super.init(field);
m_gridScreen = gri... | java | public void init(BaseField field, GridScreenParent gridScreen, GridComponent sPopupBox)
{
super.init(field);
m_gridScreen = gridScreen;
m_sPopupBox = sPopupBox;
Record gridFile = null;
if (gridScreen != null)
gridFile = (Record)gridScreen.getMainRecord();
... | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"GridScreenParent",
"gridScreen",
",",
"GridComponent",
"sPopupBox",
")",
"{",
"super",
".",
"init",
"(",
"field",
")",
";",
"m_gridScreen",
"=",
"gridScreen",
";",
"m_sPopupBox",
"=",
"sPopupBox",
";",... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param gridScreen The grid screen to reselect on change. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/FieldReSelectHandler.java#L68-L81 |
frostwire/frostwire-jlibtorrent | src/main/java/com/frostwire/jlibtorrent/FileStorage.java | FileStorage.mapFile | public PeerRequest mapFile(int file, long offset, int size) {
"""
Returns a {@link com.frostwire.jlibtorrent.PeerRequest} representing the
piece index, byte offset and size the specified file range overlaps.
This is the inverse mapping of {@link #mapBlock(int, long, int)}.
<p>
Note that the {@link PeerRequest}... | java | public PeerRequest mapFile(int file, long offset, int size) {
return new PeerRequest(fs.map_file(file, offset, size));
} | [
"public",
"PeerRequest",
"mapFile",
"(",
"int",
"file",
",",
"long",
"offset",
",",
"int",
"size",
")",
"{",
"return",
"new",
"PeerRequest",
"(",
"fs",
".",
"map_file",
"(",
"file",
",",
"offset",
",",
"size",
")",
")",
";",
"}"
] | Returns a {@link com.frostwire.jlibtorrent.PeerRequest} representing the
piece index, byte offset and size the specified file range overlaps.
This is the inverse mapping of {@link #mapBlock(int, long, int)}.
<p>
Note that the {@link PeerRequest} return type
is meant to hold bittorrent block requests, which may not be l... | [
"Returns",
"a",
"{",
"@link",
"com",
".",
"frostwire",
".",
"jlibtorrent",
".",
"PeerRequest",
"}",
"representing",
"the",
"piece",
"index",
"byte",
"offset",
"and",
"size",
"the",
"specified",
"file",
"range",
"overlaps",
".",
"This",
"is",
"the",
"inverse"... | train | https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/FileStorage.java#L212-L214 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photosets/comments/PhotosetsCommentsInterface.java | PhotosetsCommentsInterface.addComment | public String addComment(String photosetId, String commentText) throws FlickrException {
"""
Add a comment to a photoset. This method requires authentication with 'write' permission.
@param photosetId
The id of the photoset to add a comment to.
@param commentText
Text of the comment
@return the comment id
... | java | public String addComment(String photosetId, String commentText) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_ADD_COMMENT);
parameters.put("photoset_id", photosetId);
parameters.put("comment_text", commentTe... | [
"public",
"String",
"addComment",
"(",
"String",
"photosetId",
",",
"String",
"commentText",
")",
"throws",
"FlickrException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
... | Add a comment to a photoset. This method requires authentication with 'write' permission.
@param photosetId
The id of the photoset to add a comment to.
@param commentText
Text of the comment
@return the comment id
@throws FlickrException | [
"Add",
"a",
"comment",
"to",
"a",
"photoset",
".",
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photosets/comments/PhotosetsCommentsInterface.java#L55-L71 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/ScrollBarButtonPainter.java | ScrollBarButtonPainter.getScrollBarButtonBackgroundColors | private TwoColors getScrollBarButtonBackgroundColors(boolean buttonsTogether, boolean isIncrease) {
"""
DOCUMENT ME!
@param buttonsTogether DOCUMENT ME!
@param isIncrease DOCUMENT ME!
@return DOCUMENT ME!
"""
if (state == Which.FOREGROUND_CAP) {
return scrollBarCapColors;
... | java | private TwoColors getScrollBarButtonBackgroundColors(boolean buttonsTogether, boolean isIncrease) {
if (state == Which.FOREGROUND_CAP) {
return scrollBarCapColors;
} else if (isPressed) {
return isIncrease ? scrollBarButtonIncreasePressed : scrollBarButtonDecreasePressed;
... | [
"private",
"TwoColors",
"getScrollBarButtonBackgroundColors",
"(",
"boolean",
"buttonsTogether",
",",
"boolean",
"isIncrease",
")",
"{",
"if",
"(",
"state",
"==",
"Which",
".",
"FOREGROUND_CAP",
")",
"{",
"return",
"scrollBarCapColors",
";",
"}",
"else",
"if",
"("... | DOCUMENT ME!
@param buttonsTogether DOCUMENT ME!
@param isIncrease DOCUMENT ME!
@return DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/ScrollBarButtonPainter.java#L425-L438 |
rometools/rome | rome-fetcher/src/main/java/com/rometools/fetcher/impl/AbstractFeedFetcher.java | AbstractFeedFetcher.combineFeeds | public static SyndFeed combineFeeds(final SyndFeed originalFeed, final SyndFeed newFeed) {
"""
<p>
Combine the entries in two feeds into a single feed.
</p>
<p>
The returned feed will have the same data as the newFeed parameter, with the entries from
originalFeed appended to the end of its entries.
</p>
... | java | public static SyndFeed combineFeeds(final SyndFeed originalFeed, final SyndFeed newFeed) {
try {
final SyndFeed result = (SyndFeed) newFeed.clone();
result.getEntries().addAll(result.getEntries().size(), originalFeed.getEntries());
return result;
} catch (final CloneN... | [
"public",
"static",
"SyndFeed",
"combineFeeds",
"(",
"final",
"SyndFeed",
"originalFeed",
",",
"final",
"SyndFeed",
"newFeed",
")",
"{",
"try",
"{",
"final",
"SyndFeed",
"result",
"=",
"(",
"SyndFeed",
")",
"newFeed",
".",
"clone",
"(",
")",
";",
"result",
... | <p>
Combine the entries in two feeds into a single feed.
</p>
<p>
The returned feed will have the same data as the newFeed parameter, with the entries from
originalFeed appended to the end of its entries.
</p>
@param originalFeed
@param newFeed
@return | [
"<p",
">",
"Combine",
"the",
"entries",
"in",
"two",
"feeds",
"into",
"a",
"single",
"feed",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-fetcher/src/main/java/com/rometools/fetcher/impl/AbstractFeedFetcher.java#L210-L220 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_statistics_disk_disk_smart_GET | public OvhRtmDiskSmart serviceName_statistics_disk_disk_smart_GET(String serviceName, String disk) throws IOException {
"""
Get disk smart informations
REST: GET /dedicated/server/{serviceName}/statistics/disk/{disk}/smart
@param serviceName [required] The internal name of your dedicated server
@param disk [r... | java | public OvhRtmDiskSmart serviceName_statistics_disk_disk_smart_GET(String serviceName, String disk) throws IOException {
String qPath = "/dedicated/server/{serviceName}/statistics/disk/{disk}/smart";
StringBuilder sb = path(qPath, serviceName, disk);
String resp = exec(qPath, "GET", sb.toString(), null);
return ... | [
"public",
"OvhRtmDiskSmart",
"serviceName_statistics_disk_disk_smart_GET",
"(",
"String",
"serviceName",
",",
"String",
"disk",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/statistics/disk/{disk}/smart\"",
";",
"StringBuilder",
"... | Get disk smart informations
REST: GET /dedicated/server/{serviceName}/statistics/disk/{disk}/smart
@param serviceName [required] The internal name of your dedicated server
@param disk [required] Disk | [
"Get",
"disk",
"smart",
"informations"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1346-L1351 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/protocol/AuroraProtocol.java | AuroraProtocol.resetHostList | private static void resetHostList(AuroraListener listener, Deque<HostAddress> loopAddresses) {
"""
Reinitialize loopAddresses with all hosts : all servers in randomize order with cluster
address. If there is an active connection, connected host are remove from list.
@param listener current listener
@para... | java | private static void resetHostList(AuroraListener listener, Deque<HostAddress> loopAddresses) {
//if all servers have been connected without result
//add back all servers
List<HostAddress> servers = new ArrayList<>();
servers.addAll(listener.getUrlParser().getHostAddresses());
Collections.shuffle(se... | [
"private",
"static",
"void",
"resetHostList",
"(",
"AuroraListener",
"listener",
",",
"Deque",
"<",
"HostAddress",
">",
"loopAddresses",
")",
"{",
"//if all servers have been connected without result",
"//add back all servers",
"List",
"<",
"HostAddress",
">",
"servers",
... | Reinitialize loopAddresses with all hosts : all servers in randomize order with cluster
address. If there is an active connection, connected host are remove from list.
@param listener current listener
@param loopAddresses the list to reinitialize | [
"Reinitialize",
"loopAddresses",
"with",
"all",
"hosts",
":",
"all",
"servers",
"in",
"randomize",
"order",
"with",
"cluster",
"address",
".",
"If",
"there",
"is",
"an",
"active",
"connection",
"connected",
"host",
"are",
"remove",
"from",
"list",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AuroraProtocol.java#L306-L325 |
code4everything/util | src/main/java/com/zhazhapan/util/FileExecutor.java | FileExecutor.mergeFiles | public static void mergeFiles(File[] files, File destinationFile, String[] filterRegex) throws IOException {
"""
合并文件
@param files 文件数组
@param destinationFile 目标文件
@param filterRegex 过滤规则数组(正则表达式,与文件数组一一对应,即第个文件使用一个过滤规则,为空时不过滤)
@throws IOException 异常
"""
if (filterRegex.length < files.length) {... | java | public static void mergeFiles(File[] files, File destinationFile, String[] filterRegex) throws IOException {
if (filterRegex.length < files.length) {
filterRegex = ArrayUtils.concatArrays(filterRegex, new String[files.length - filterRegex.length]);
}
createNewFile(destinationFile);
... | [
"public",
"static",
"void",
"mergeFiles",
"(",
"File",
"[",
"]",
"files",
",",
"File",
"destinationFile",
",",
"String",
"[",
"]",
"filterRegex",
")",
"throws",
"IOException",
"{",
"if",
"(",
"filterRegex",
".",
"length",
"<",
"files",
".",
"length",
")",
... | 合并文件
@param files 文件数组
@param destinationFile 目标文件
@param filterRegex 过滤规则数组(正则表达式,与文件数组一一对应,即第个文件使用一个过滤规则,为空时不过滤)
@throws IOException 异常 | [
"合并文件"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/FileExecutor.java#L719-L728 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/util/TextFormatter.java | TextFormatter.appendElapsed | public static void appendElapsed(StringBuilder buf, long elapsedNanos) {
"""
Appends the human-readable representation of the duration given as {@code elapsed} to the specified
{@link StringBuilder}.
"""
if (elapsedNanos >= 100000000000L) { // >= 100 s
buf.append(elapsedNanos / 1000000000L... | java | public static void appendElapsed(StringBuilder buf, long elapsedNanos) {
if (elapsedNanos >= 100000000000L) { // >= 100 s
buf.append(elapsedNanos / 1000000000L).append("s(").append(elapsedNanos).append("ns)");
} else if (elapsedNanos >= 100000000L) { // >= 100 ms
buf.append(elaps... | [
"public",
"static",
"void",
"appendElapsed",
"(",
"StringBuilder",
"buf",
",",
"long",
"elapsedNanos",
")",
"{",
"if",
"(",
"elapsedNanos",
">=",
"100000000000L",
")",
"{",
"// >= 100 s",
"buf",
".",
"append",
"(",
"elapsedNanos",
"/",
"1000000000L",
")",
".",... | Appends the human-readable representation of the duration given as {@code elapsed} to the specified
{@link StringBuilder}. | [
"Appends",
"the",
"human",
"-",
"readable",
"representation",
"of",
"the",
"duration",
"given",
"as",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/util/TextFormatter.java#L50-L60 |
bbottema/simple-java-mail | modules/simple-java-mail/src/main/java/org/simplejavamail/converter/EmailConverter.java | EmailConverter.emlToMimeMessage | public static MimeMessage emlToMimeMessage(@Nonnull final File emlFile, @Nonnull final Session session) {
"""
Relies on JavaMail's native parser of EML data, {@link MimeMessage#MimeMessage(Session, InputStream)}.
@see MimeMessage#MimeMessage(Session, InputStream)
"""
if (!EML_PATH_MATCHER.matches(emlFile.... | java | public static MimeMessage emlToMimeMessage(@Nonnull final File emlFile, @Nonnull final Session session) {
if (!EML_PATH_MATCHER.matches(emlFile.toPath())) {
throw new EmailConverterException(format(EmailConverterException.FILE_NOT_RECOGNIZED_AS_EML, emlFile));
}
try {
InputStream source = new FileInputStrea... | [
"public",
"static",
"MimeMessage",
"emlToMimeMessage",
"(",
"@",
"Nonnull",
"final",
"File",
"emlFile",
",",
"@",
"Nonnull",
"final",
"Session",
"session",
")",
"{",
"if",
"(",
"!",
"EML_PATH_MATCHER",
".",
"matches",
"(",
"emlFile",
".",
"toPath",
"(",
")",... | Relies on JavaMail's native parser of EML data, {@link MimeMessage#MimeMessage(Session, InputStream)}.
@see MimeMessage#MimeMessage(Session, InputStream) | [
"Relies",
"on",
"JavaMail",
"s",
"native",
"parser",
"of",
"EML",
"data",
"{",
"@link",
"MimeMessage#MimeMessage",
"(",
"Session",
"InputStream",
")",
"}",
"."
] | train | https://github.com/bbottema/simple-java-mail/blob/b03635328aeecd525e35eddfef8f5b9a184559d8/modules/simple-java-mail/src/main/java/org/simplejavamail/converter/EmailConverter.java#L217-L227 |
casmi/casmi | src/main/java/casmi/graphics/element/Bezier.java | Bezier.setAnchorColor | public void setAnchorColor(int index, Color color) {
"""
Sets the color of the anchor point for gradation.
@param index The index of anchors. The index of the start anchor point is 0, the index of the
end anchor point is 1.
@param color The color of the anchor point.
"""
if (index <= 0) {
... | java | public void setAnchorColor(int index, Color color) {
if (index <= 0) {
if (startColor == null) {
startColor = new RGBColor(0.0, 0.0, 0.0);
}
setGradation(true);
this.startColor = color;
} else if (index >= 1) {
if (endColor == n... | [
"public",
"void",
"setAnchorColor",
"(",
"int",
"index",
",",
"Color",
"color",
")",
"{",
"if",
"(",
"index",
"<=",
"0",
")",
"{",
"if",
"(",
"startColor",
"==",
"null",
")",
"{",
"startColor",
"=",
"new",
"RGBColor",
"(",
"0.0",
",",
"0.0",
",",
"... | Sets the color of the anchor point for gradation.
@param index The index of anchors. The index of the start anchor point is 0, the index of the
end anchor point is 1.
@param color The color of the anchor point. | [
"Sets",
"the",
"color",
"of",
"the",
"anchor",
"point",
"for",
"gradation",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Bezier.java#L282-L296 |
jayantk/jklol | src/com/jayantkrish/jklol/models/dynamic/DynamicVariableSet.java | DynamicVariableSet.addFixedVariable | public DynamicVariableSet addFixedVariable(String name, Variable variable) {
"""
Returns a copy of {@code this} with an additional fixed variable.
The created variable is named {@code name} and has type
{@code variable}.
@param name
@param variable
@return
"""
int variableIndex = fixedVariableMaxInd... | java | public DynamicVariableSet addFixedVariable(String name, Variable variable) {
int variableIndex = fixedVariableMaxInd + 1;
return new DynamicVariableSet(fixedVariables.addMapping(variableIndex, name, variable),
plateNames, plates, maximumReplications);
} | [
"public",
"DynamicVariableSet",
"addFixedVariable",
"(",
"String",
"name",
",",
"Variable",
"variable",
")",
"{",
"int",
"variableIndex",
"=",
"fixedVariableMaxInd",
"+",
"1",
";",
"return",
"new",
"DynamicVariableSet",
"(",
"fixedVariables",
".",
"addMapping",
"(",... | Returns a copy of {@code this} with an additional fixed variable.
The created variable is named {@code name} and has type
{@code variable}.
@param name
@param variable
@return | [
"Returns",
"a",
"copy",
"of",
"{",
"@code",
"this",
"}",
"with",
"an",
"additional",
"fixed",
"variable",
".",
"The",
"created",
"variable",
"is",
"named",
"{",
"@code",
"name",
"}",
"and",
"has",
"type",
"{",
"@code",
"variable",
"}",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/dynamic/DynamicVariableSet.java#L378-L382 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/UpdateIntegrationRequest.java | UpdateIntegrationRequest.withRequestParameters | public UpdateIntegrationRequest withRequestParameters(java.util.Map<String, String> requestParameters) {
"""
<p>
A key-value map specifying request parameters that are passed from the method request to the backend. The key is
an integration request parameter name and the associated value is a method request para... | java | public UpdateIntegrationRequest withRequestParameters(java.util.Map<String, String> requestParameters) {
setRequestParameters(requestParameters);
return this;
} | [
"public",
"UpdateIntegrationRequest",
"withRequestParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestParameters",
")",
"{",
"setRequestParameters",
"(",
"requestParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A key-value map specifying request parameters that are passed from the method request to the backend. The key is
an integration request parameter name and the associated value is a method request parameter value or static
value that must be enclosed within single quotes and pre-encoded as required by the backend. T... | [
"<p",
">",
"A",
"key",
"-",
"value",
"map",
"specifying",
"request",
"parameters",
"that",
"are",
"passed",
"from",
"the",
"method",
"request",
"to",
"the",
"backend",
".",
"The",
"key",
"is",
"an",
"integration",
"request",
"parameter",
"name",
"and",
"th... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/UpdateIntegrationRequest.java#L1134-L1137 |
samskivert/pythagoras | src/main/java/pythagoras/d/Matrix3.java | Matrix3.setToTransform | public Matrix3 setToTransform (IVector translation, double rotation, IVector scale) {
"""
Sets this to a matrix that first scales, then rotates, then translates.
@return a reference to this matrix, for chaining.
"""
double sx = scale.x(), sy = scale.y();
return setToRotation(rotation).set(m0... | java | public Matrix3 setToTransform (IVector translation, double rotation, IVector scale) {
double sx = scale.x(), sy = scale.y();
return setToRotation(rotation).set(m00 * sx, m10 * sy, translation.x(),
m01 * sx, m11 * sy, translation.y(),
... | [
"public",
"Matrix3",
"setToTransform",
"(",
"IVector",
"translation",
",",
"double",
"rotation",
",",
"IVector",
"scale",
")",
"{",
"double",
"sx",
"=",
"scale",
".",
"x",
"(",
")",
",",
"sy",
"=",
"scale",
".",
"y",
"(",
")",
";",
"return",
"setToRota... | Sets this to a matrix that first scales, then rotates, then translates.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"a",
"matrix",
"that",
"first",
"scales",
"then",
"rotates",
"then",
"translates",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Matrix3.java#L276-L281 |
zandero/rest.vertx | src/main/java/com/zandero/rest/RestRouter.java | RestRouter.notFound | public static void notFound(Router router, String regExPath, Class<? extends NotFoundResponseWriter> notFound) {
"""
Handles not found route in case request regExPath mathes given regExPath prefix
@param router to add route to
@param regExPath prefix
@param notFound hander
"""
Assert.notNull(rout... | java | public static void notFound(Router router, String regExPath, Class<? extends NotFoundResponseWriter> notFound) {
Assert.notNull(router, "Missing router!");
Assert.notNull(notFound, "Missing not found handler!");
addLastHandler(router, regExPath, getNotFoundHandler(notFound));
} | [
"public",
"static",
"void",
"notFound",
"(",
"Router",
"router",
",",
"String",
"regExPath",
",",
"Class",
"<",
"?",
"extends",
"NotFoundResponseWriter",
">",
"notFound",
")",
"{",
"Assert",
".",
"notNull",
"(",
"router",
",",
"\"Missing router!\"",
")",
";",
... | Handles not found route in case request regExPath mathes given regExPath prefix
@param router to add route to
@param regExPath prefix
@param notFound hander | [
"Handles",
"not",
"found",
"route",
"in",
"case",
"request",
"regExPath",
"mathes",
"given",
"regExPath",
"prefix"
] | train | https://github.com/zandero/rest.vertx/blob/ba458720cf59e076953eab9dac7227eeaf9e58ce/src/main/java/com/zandero/rest/RestRouter.java#L304-L310 |
RobAustin/low-latency-primitive-concurrent-queues | src/main/java/uk/co/boundedbuffer/ConcurrentBlockingFloatQueue.java | ConcurrentBlockingFloatQueue.offer | public boolean offer(float value, long timeout, TimeUnit unit)
throws InterruptedException {
"""
Inserts the specified element into this queue, waiting up to the specified wait time if necessary for
space to become available.
@param value the element to add
@param timeout how long to wait before... | java | public boolean offer(float value, long timeout, TimeUnit unit)
throws InterruptedException {
// non volatile read ( which is quicker )
final int writeLocation = this.producerWriteLocation;
// sets the nextWriteLocation my moving it on by 1, this may cause it it wrap back to the st... | [
"public",
"boolean",
"offer",
"(",
"float",
"value",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"// non volatile read ( which is quicker )",
"final",
"int",
"writeLocation",
"=",
"this",
".",
"producerWriteLocation",
... | Inserts the specified element into this queue, waiting up to the specified wait time if necessary for
space to become available.
@param value the element to add
@param timeout how long to wait before giving up, in units of <tt>unit</tt>
@param unit a <tt>TimeUnit</tt> determining how to interpret the <tt>timeout<... | [
"Inserts",
"the",
"specified",
"element",
"into",
"this",
"queue",
"waiting",
"up",
"to",
"the",
"specified",
"wait",
"time",
"if",
"necessary",
"for",
"space",
"to",
"become",
"available",
"."
] | train | https://github.com/RobAustin/low-latency-primitive-concurrent-queues/blob/ffcf95a8135750c0b23cd486346a1f68a4724b1c/src/main/java/uk/co/boundedbuffer/ConcurrentBlockingFloatQueue.java#L240-L283 |
spotify/crtauth-java | src/main/java/com/spotify/crtauth/protocol/CrtAuthCodec.java | CrtAuthCodec.getAuthenticationCode | private static byte[] getAuthenticationCode(byte[] secret, byte[] data, int length) {
"""
Calculate and return a keyed hash message authentication code, HMAC, as specified in RFC2104
using SHA256 as hash function.
@param secret the secret used to authenticate
@param data the data to authenticate
@param len... | java | private static byte[] getAuthenticationCode(byte[] secret, byte[] data, int length) {
try {
SecretKey secretKey = new SecretKeySpec(secret, MAC_ALGORITHM);
Mac mac = Mac.getInstance(MAC_ALGORITHM);
mac.init(secretKey);
mac.update(data, 0, length);
return mac.doFinal();
} catch (Exc... | [
"private",
"static",
"byte",
"[",
"]",
"getAuthenticationCode",
"(",
"byte",
"[",
"]",
"secret",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"length",
")",
"{",
"try",
"{",
"SecretKey",
"secretKey",
"=",
"new",
"SecretKeySpec",
"(",
"secret",
",",
"MAC_AL... | Calculate and return a keyed hash message authentication code, HMAC, as specified in RFC2104
using SHA256 as hash function.
@param secret the secret used to authenticate
@param data the data to authenticate
@param length the number of bytes from data to use when calculating the HMAC
@return an HMAC code for the spec... | [
"Calculate",
"and",
"return",
"a",
"keyed",
"hash",
"message",
"authentication",
"code",
"HMAC",
"as",
"specified",
"in",
"RFC2104",
"using",
"SHA256",
"as",
"hash",
"function",
"."
] | train | https://github.com/spotify/crtauth-java/blob/90f3b40323848740c915b195ad1b547fbeb41700/src/main/java/com/spotify/crtauth/protocol/CrtAuthCodec.java#L183-L193 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/StartupConfiguration.java | StartupConfiguration.append | private static Configuration append(Configuration base, Configuration additional) {
"""
Takes two configuration and returns their union, with the second overriding the first.
@param base the base configuration.
@param additional the additional set of properties, some of which may override those specified in <c... | java | private static Configuration append(Configuration base, Configuration additional) {
final CompositeConfiguration result = new CompositeConfiguration();
result.addConfiguration(additional);
result.addConfiguration(base);
return result;
} | [
"private",
"static",
"Configuration",
"append",
"(",
"Configuration",
"base",
",",
"Configuration",
"additional",
")",
"{",
"final",
"CompositeConfiguration",
"result",
"=",
"new",
"CompositeConfiguration",
"(",
")",
";",
"result",
".",
"addConfiguration",
"(",
"add... | Takes two configuration and returns their union, with the second overriding the first.
@param base the base configuration.
@param additional the additional set of properties, some of which may override those specified in <code>base</code>.
@return the union of the two configurations, as specified above. | [
"Takes",
"two",
"configuration",
"and",
"returns",
"their",
"union",
"with",
"the",
"second",
"overriding",
"the",
"first",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/StartupConfiguration.java#L634-L639 |
tobato/FastDFS_Client | src/main/java/com/github/tobato/fastdfs/service/DefaultFastFileStorageClient.java | DefaultFastFileStorageClient.uploadImage | @Override
public StorePath uploadImage(FastImageFile fastImageFile) {
"""
上传图片
<pre>
可通过fastImageFile对象配置
1. 上传图像分组
2. 上传元数据metaDataSet
3. 是否生成缩略图
3.1 根据默认配置生成缩略图
3.2 根据指定尺寸生成缩略图
3.3 根据指定比例生成缩略图
<pre/>
@param fastImageFile
@return
"""
String fileExtName = fastImageFile.getFileExtName();
... | java | @Override
public StorePath uploadImage(FastImageFile fastImageFile) {
String fileExtName = fastImageFile.getFileExtName();
Validate.notNull(fastImageFile.getInputStream(), "上传文件流不能为空");
Validate.notBlank(fileExtName, "文件扩展名不能为空");
// 检查是否能处理此类图片
if (!isSupportImage(fileExtNam... | [
"@",
"Override",
"public",
"StorePath",
"uploadImage",
"(",
"FastImageFile",
"fastImageFile",
")",
"{",
"String",
"fileExtName",
"=",
"fastImageFile",
".",
"getFileExtName",
"(",
")",
";",
"Validate",
".",
"notNull",
"(",
"fastImageFile",
".",
"getInputStream",
"(... | 上传图片
<pre>
可通过fastImageFile对象配置
1. 上传图像分组
2. 上传元数据metaDataSet
3. 是否生成缩略图
3.1 根据默认配置生成缩略图
3.2 根据指定尺寸生成缩略图
3.3 根据指定比例生成缩略图
<pre/>
@param fastImageFile
@return | [
"上传图片",
"<pre",
">",
"可通过fastImageFile对象配置",
"1",
".",
"上传图像分组",
"2",
".",
"上传元数据metaDataSet",
"3",
".",
"是否生成缩略图",
"3",
".",
"1",
"根据默认配置生成缩略图",
"3",
".",
"2",
"根据指定尺寸生成缩略图",
"3",
".",
"3",
"根据指定比例生成缩略图",
"<pre",
"/",
">"
] | train | https://github.com/tobato/FastDFS_Client/blob/8e3bfe712f1739028beed7f3a6b2cc4579a231e4/src/main/java/com/github/tobato/fastdfs/service/DefaultFastFileStorageClient.java#L130-L155 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/Matrix.java | Matrix.OuterProductUpdate | public static void OuterProductUpdate(Matrix A, Vec x, Vec y, double c) {
"""
Alters the matrix <i>A</i> such that,
<i>A = A + c * <b>x</b> * <b>y</b>'</i>
@param A the matrix to update
@param x the first vector
@param y the second vector
@param c the scalar constant to multiply the outer product by
@throw... | java | public static void OuterProductUpdate(Matrix A, Vec x, Vec y, double c)
{
if (x.length() != A.rows() || y.length() != A.cols())
throw new ArithmeticException("Matrix dimensions do not agree with outer product");
if (x.isSparse())
for (IndexValue iv : x)
A.upda... | [
"public",
"static",
"void",
"OuterProductUpdate",
"(",
"Matrix",
"A",
",",
"Vec",
"x",
",",
"Vec",
"y",
",",
"double",
"c",
")",
"{",
"if",
"(",
"x",
".",
"length",
"(",
")",
"!=",
"A",
".",
"rows",
"(",
")",
"||",
"y",
".",
"length",
"(",
")",... | Alters the matrix <i>A</i> such that,
<i>A = A + c * <b>x</b> * <b>y</b>'</i>
@param A the matrix to update
@param x the first vector
@param y the second vector
@param c the scalar constant to multiply the outer product by
@throws ArithmeticException if the vector dimensions are not compatible
with the matrix <i>A</i> | [
"Alters",
"the",
"matrix",
"<i",
">",
"A<",
"/",
"i",
">",
"such",
"that",
"<i",
">",
"A",
"=",
"A",
"+",
"c",
"*",
"<b",
">",
"x<",
"/",
"b",
">",
"*",
"<b",
">",
"y<",
"/",
"b",
">",
"<",
"/",
"i",
">"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L887-L900 |
apache/groovy | src/main/java/org/codehaus/groovy/control/ErrorCollector.java | ErrorCollector.addWarning | public void addWarning(int importance, String text, CSTNode context, SourceUnit source) {
"""
Convenience wrapper for addWarning() that won't create an object
unless it is relevant.
"""
if (WarningMessage.isRelevant(importance, configuration.getWarningLevel())) {
addWarning(new WarningMess... | java | public void addWarning(int importance, String text, CSTNode context, SourceUnit source) {
if (WarningMessage.isRelevant(importance, configuration.getWarningLevel())) {
addWarning(new WarningMessage(importance, text, context, source));
}
} | [
"public",
"void",
"addWarning",
"(",
"int",
"importance",
",",
"String",
"text",
",",
"CSTNode",
"context",
",",
"SourceUnit",
"source",
")",
"{",
"if",
"(",
"WarningMessage",
".",
"isRelevant",
"(",
"importance",
",",
"configuration",
".",
"getWarningLevel",
... | Convenience wrapper for addWarning() that won't create an object
unless it is relevant. | [
"Convenience",
"wrapper",
"for",
"addWarning",
"()",
"that",
"won",
"t",
"create",
"an",
"object",
"unless",
"it",
"is",
"relevant",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/ErrorCollector.java#L287-L291 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java | SegmentMetadataUpdateTransaction.preProcessOperation | void preProcessOperation(StreamSegmentAppendOperation operation) throws StreamSegmentSealedException, StreamSegmentMergedException,
BadOffsetException, BadAttributeUpdateException {
"""
Pre-processes a StreamSegmentAppendOperation.
After this method returns, the given operation will have its SegmentOf... | java | void preProcessOperation(StreamSegmentAppendOperation operation) throws StreamSegmentSealedException, StreamSegmentMergedException,
BadOffsetException, BadAttributeUpdateException {
ensureSegmentId(operation);
if (this.merged) {
// We do not allow any operation after merging (sin... | [
"void",
"preProcessOperation",
"(",
"StreamSegmentAppendOperation",
"operation",
")",
"throws",
"StreamSegmentSealedException",
",",
"StreamSegmentMergedException",
",",
"BadOffsetException",
",",
"BadAttributeUpdateException",
"{",
"ensureSegmentId",
"(",
"operation",
")",
";"... | Pre-processes a StreamSegmentAppendOperation.
After this method returns, the given operation will have its SegmentOffset property set to the current
SegmentLength, and all AttributeUpdates will be set to the current values.
@param operation The operation to pre-process.
@throws StreamSegmentSealedException If the Segm... | [
"Pre",
"-",
"processes",
"a",
"StreamSegmentAppendOperation",
".",
"After",
"this",
"method",
"returns",
"the",
"given",
"operation",
"will",
"have",
"its",
"SegmentOffset",
"property",
"set",
"to",
"the",
"current",
"SegmentLength",
"and",
"all",
"AttributeUpdates"... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L244-L272 |
finmath/finmath-lib | src/main/java6/net/finmath/randomnumbers/HaltonSequence.java | HaltonSequence.getHaltonNumberForGivenBase | public static double getHaltonNumberForGivenBase(long index, int base) {
"""
Return a Halton number, sequence starting at index = 0, base > 1.
@param index The index of the sequence.
@param base The base of the sequence. Has to be greater than one (this is not checked).
@return The Halton number.
"""
... | java | public static double getHaltonNumberForGivenBase(long index, int base) {
index += 1;
double x = 0.0;
double factor = 1.0 / base;
while(index > 0) {
x += (index % base) * factor;
factor /= base;
index /= base;
}
return x;
} | [
"public",
"static",
"double",
"getHaltonNumberForGivenBase",
"(",
"long",
"index",
",",
"int",
"base",
")",
"{",
"index",
"+=",
"1",
";",
"double",
"x",
"=",
"0.0",
";",
"double",
"factor",
"=",
"1.0",
"/",
"base",
";",
"while",
"(",
"index",
">",
"0",... | Return a Halton number, sequence starting at index = 0, base > 1.
@param index The index of the sequence.
@param base The base of the sequence. Has to be greater than one (this is not checked).
@return The Halton number. | [
"Return",
"a",
"Halton",
"number",
"sequence",
"starting",
"at",
"index",
"=",
"0",
"base",
">",
";",
"1",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/randomnumbers/HaltonSequence.java#L66-L78 |
lessthanoptimal/ddogleg | src/org/ddogleg/optimization/UtilOptimize.java | UtilOptimize.process | public static boolean process( IterativeOptimization search , int maxSteps ) {
"""
Iterate until the line search converges or the maximum number of iterations has been exceeded.
The maximum number of steps is specified. A step is defined as the number of times the
optimization parameters are changed.
@para... | java | public static boolean process( IterativeOptimization search , int maxSteps ) {
for( int i = 0; i < maxSteps; i++ ) {
boolean converged = step(search);
if( converged ) {
return search.isConverged();
}
}
return true;
} | [
"public",
"static",
"boolean",
"process",
"(",
"IterativeOptimization",
"search",
",",
"int",
"maxSteps",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"maxSteps",
";",
"i",
"++",
")",
"{",
"boolean",
"converged",
"=",
"step",
"(",
"search... | Iterate until the line search converges or the maximum number of iterations has been exceeded.
The maximum number of steps is specified. A step is defined as the number of times the
optimization parameters are changed.
@param search Search algorithm
@param maxSteps Maximum number of steps.
@return Value returned by ... | [
"Iterate",
"until",
"the",
"line",
"search",
"converges",
"or",
"the",
"maximum",
"number",
"of",
"iterations",
"has",
"been",
"exceeded",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/optimization/UtilOptimize.java#L38-L47 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java | UtilLepetitEPnP.constraintMatrix6x3 | public static void constraintMatrix6x3( DMatrixRMaj L_6x10 , DMatrixRMaj L_6x3 ) {
"""
Extracts the linear constraint matrix for case 2 from the full 6x10 constraint matrix.
"""
int index = 0;
for( int i = 0; i < 6; i++ ) {
L_6x3.data[index++] = L_6x10.get(i,0);
L_6x3.data[index++] = L_6x10.get(i,1)... | java | public static void constraintMatrix6x3( DMatrixRMaj L_6x10 , DMatrixRMaj L_6x3 ) {
int index = 0;
for( int i = 0; i < 6; i++ ) {
L_6x3.data[index++] = L_6x10.get(i,0);
L_6x3.data[index++] = L_6x10.get(i,1);
L_6x3.data[index++] = L_6x10.get(i,4);
}
} | [
"public",
"static",
"void",
"constraintMatrix6x3",
"(",
"DMatrixRMaj",
"L_6x10",
",",
"DMatrixRMaj",
"L_6x3",
")",
"{",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"6",
";",
"i",
"++",
")",
"{",
"L_6x3",
".",
"da... | Extracts the linear constraint matrix for case 2 from the full 6x10 constraint matrix. | [
"Extracts",
"the",
"linear",
"constraint",
"matrix",
"for",
"case",
"2",
"from",
"the",
"full",
"6x10",
"constraint",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java#L82-L90 |
pmlopes/yoke | framework/src/main/java/com/jetdrone/vertx/yoke/YokeSecurity.java | YokeSecurity.unsign | public static String unsign(@NotNull String val, @NotNull Mac mac) {
"""
Returns the original value is the signature is correct. Null otherwise.
"""
int idx = val.lastIndexOf('.');
if (idx == -1) {
return null;
}
String str = val.substring(0, idx);
if (val.... | java | public static String unsign(@NotNull String val, @NotNull Mac mac) {
int idx = val.lastIndexOf('.');
if (idx == -1) {
return null;
}
String str = val.substring(0, idx);
if (val.equals(sign(str, mac))) {
return str;
}
return null;
} | [
"public",
"static",
"String",
"unsign",
"(",
"@",
"NotNull",
"String",
"val",
",",
"@",
"NotNull",
"Mac",
"mac",
")",
"{",
"int",
"idx",
"=",
"val",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"idx",
"==",
"-",
"1",
")",
"{",
"return"... | Returns the original value is the signature is correct. Null otherwise. | [
"Returns",
"the",
"original",
"value",
"is",
"the",
"signature",
"is",
"correct",
".",
"Null",
"otherwise",
"."
] | train | https://github.com/pmlopes/yoke/blob/fe8a64036f09fb745f0644faddd46162d64faf3c/framework/src/main/java/com/jetdrone/vertx/yoke/YokeSecurity.java#L52-L64 |
Terradue/jcatalogue-client | apis/src/main/java/com/terradue/jcatalogue/repository/Proxy.java | Proxy.setHost | public Proxy setHost( String host ) {
"""
Sets the host of the proxy.
@param host The host of the proxy, may be {@code null}.
@return The new proxy, never {@code null}.
"""
if ( this.host.equals( host ) || ( host == null && this.host.length() <= 0 ) )
{
return this;
}
... | java | public Proxy setHost( String host )
{
if ( this.host.equals( host ) || ( host == null && this.host.length() <= 0 ) )
{
return this;
}
return new Proxy( type, host, port, auth );
} | [
"public",
"Proxy",
"setHost",
"(",
"String",
"host",
")",
"{",
"if",
"(",
"this",
".",
"host",
".",
"equals",
"(",
"host",
")",
"||",
"(",
"host",
"==",
"null",
"&&",
"this",
".",
"host",
".",
"length",
"(",
")",
"<=",
"0",
")",
")",
"{",
"retu... | Sets the host of the proxy.
@param host The host of the proxy, may be {@code null}.
@return The new proxy, never {@code null}. | [
"Sets",
"the",
"host",
"of",
"the",
"proxy",
"."
] | train | https://github.com/Terradue/jcatalogue-client/blob/1f24c4da952d8ad2373c4fa97eed48b0b8a88d21/apis/src/main/java/com/terradue/jcatalogue/repository/Proxy.java#L104-L111 |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/spec/FontSpec.java | FontSpec.getCloneWithDifferentFont | @Nonnull
public FontSpec getCloneWithDifferentFont (@Nonnull final PreloadFont aNewFont) {
"""
Return a clone of this object but with a different font.
@param aNewFont
The new font to use. Must not be <code>null</code>.
@return this if the fonts are equal - a new object otherwise.
"""
ValueEnforcer.... | java | @Nonnull
public FontSpec getCloneWithDifferentFont (@Nonnull final PreloadFont aNewFont)
{
ValueEnforcer.notNull (aNewFont, "NewFont");
if (aNewFont.equals (m_aPreloadFont))
return this;
// Don't copy loaded font!
return new FontSpec (aNewFont, m_fFontSize, m_aColor);
} | [
"@",
"Nonnull",
"public",
"FontSpec",
"getCloneWithDifferentFont",
"(",
"@",
"Nonnull",
"final",
"PreloadFont",
"aNewFont",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aNewFont",
",",
"\"NewFont\"",
")",
";",
"if",
"(",
"aNewFont",
".",
"equals",
"(",
"m_... | Return a clone of this object but with a different font.
@param aNewFont
The new font to use. Must not be <code>null</code>.
@return this if the fonts are equal - a new object otherwise. | [
"Return",
"a",
"clone",
"of",
"this",
"object",
"but",
"with",
"a",
"different",
"font",
"."
] | train | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/spec/FontSpec.java#L112-L120 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.waitForActivity | public boolean waitForActivity(Class<? extends Activity> activityClass, int timeout) {
"""
Waits for the given {@link Activity}.
@param activityClass the class of the {@code Activity} to wait for
@param timeout the amount of time in milliseconds to wait
@return {@code true} if {@code Activity} appears before ... | java | public boolean waitForActivity(Class<? extends Activity> activityClass, int timeout){
if(isActivityMatching(activityClass, activityUtils.getCurrentActivity(false, false))){
return true;
}
boolean foundActivity = false;
ActivityMonitor activityMonitor = getActivityMonitor();
long currentTime = SystemCloc... | [
"public",
"boolean",
"waitForActivity",
"(",
"Class",
"<",
"?",
"extends",
"Activity",
">",
"activityClass",
",",
"int",
"timeout",
")",
"{",
"if",
"(",
"isActivityMatching",
"(",
"activityClass",
",",
"activityUtils",
".",
"getCurrentActivity",
"(",
"false",
",... | Waits for the given {@link Activity}.
@param activityClass the class of the {@code Activity} to wait for
@param timeout the amount of time in milliseconds to wait
@return {@code true} if {@code Activity} appears before the timeout and {@code false} if it does not | [
"Waits",
"for",
"the",
"given",
"{",
"@link",
"Activity",
"}",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L140-L161 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java | CmsXmlContentPropertyHelper.resolveMacrosForPropertyInfo | public static Map<String, CmsXmlContentProperty> resolveMacrosForPropertyInfo(
CmsObject cms,
CmsResource page,
CmsResource resource,
Supplier<CmsXmlContent> contentGetter,
Function<String, String> stringtemplateSource,
Map<String, CmsXmlContentProperty> propertiesConf)
... | java | public static Map<String, CmsXmlContentProperty> resolveMacrosForPropertyInfo(
CmsObject cms,
CmsResource page,
CmsResource resource,
Supplier<CmsXmlContent> contentGetter,
Function<String, String> stringtemplateSource,
Map<String, CmsXmlContentProperty> propertiesConf)
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"CmsXmlContentProperty",
">",
"resolveMacrosForPropertyInfo",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"page",
",",
"CmsResource",
"resource",
",",
"Supplier",
"<",
"CmsXmlContent",
">",
"contentGetter",
",",
"Funct... | Resolves macros in the given property information for the given resource (type) AND the current user.<p>
@param cms the current CMS context
@param page the current container page
@param resource the resource
@param contentGetter loads the actual content
@param propertiesConf the property information
@return the prope... | [
"Resolves",
"macros",
"in",
"the",
"given",
"property",
"information",
"for",
"the",
"given",
"resource",
"(",
"type",
")",
"AND",
"the",
"current",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java#L645-L665 |
pac4j/pac4j | pac4j-config/src/main/java/org/pac4j/config/ldaptive/LdaptiveAuthenticatorBuilder.java | LdaptiveAuthenticatorBuilder.newSearchRequest | public static SearchRequest newSearchRequest(final String baseDn, final SearchFilter filter) {
"""
Builds a new request.
@param baseDn the base dn
@param filter the filter
@return the search request
"""
final SearchRequest sr = new SearchRequest(baseDn, filter);
sr.setBinaryAttributes(Retu... | java | public static SearchRequest newSearchRequest(final String baseDn, final SearchFilter filter) {
final SearchRequest sr = new SearchRequest(baseDn, filter);
sr.setBinaryAttributes(ReturnAttributes.ALL_USER.value());
sr.setReturnAttributes(ReturnAttributes.ALL_USER.value());
sr.setSearchSco... | [
"public",
"static",
"SearchRequest",
"newSearchRequest",
"(",
"final",
"String",
"baseDn",
",",
"final",
"SearchFilter",
"filter",
")",
"{",
"final",
"SearchRequest",
"sr",
"=",
"new",
"SearchRequest",
"(",
"baseDn",
",",
"filter",
")",
";",
"sr",
".",
"setBin... | Builds a new request.
@param baseDn the base dn
@param filter the filter
@return the search request | [
"Builds",
"a",
"new",
"request",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-config/src/main/java/org/pac4j/config/ldaptive/LdaptiveAuthenticatorBuilder.java#L349-L355 |
patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/util/BuilderUtil.java | BuilderUtil.drawViewToBitmap | public static Bitmap drawViewToBitmap(Bitmap dest, View view, int downSampling, Bitmap.Config bitmapConfig) {
"""
Draws the given view to a canvas with the given scale (higher = smaller)
@param dest
@param view
@param downSampling
@return
"""
float scale = 1f / downSampling;
int viewWidth... | java | public static Bitmap drawViewToBitmap(Bitmap dest, View view, int downSampling, Bitmap.Config bitmapConfig) {
float scale = 1f / downSampling;
int viewWidth = view.getWidth();
int viewHeight = view.getHeight();
int bmpWidth = Math.round(viewWidth * scale);
int bmpHeight = Math.ro... | [
"public",
"static",
"Bitmap",
"drawViewToBitmap",
"(",
"Bitmap",
"dest",
",",
"View",
"view",
",",
"int",
"downSampling",
",",
"Bitmap",
".",
"Config",
"bitmapConfig",
")",
"{",
"float",
"scale",
"=",
"1f",
"/",
"downSampling",
";",
"int",
"viewWidth",
"=",
... | Draws the given view to a canvas with the given scale (higher = smaller)
@param dest
@param view
@param downSampling
@return | [
"Draws",
"the",
"given",
"view",
"to",
"a",
"canvas",
"with",
"the",
"given",
"scale",
"(",
"higher",
"=",
"smaller",
")"
] | train | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/util/BuilderUtil.java#L133-L151 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/dfx/Segment3dfx.java | Segment3dfx.y1Property | @Pure
public DoubleProperty y1Property() {
"""
Replies the property that is the y coordinate of the first segment point.
@return the y1 property.
"""
if (this.p1.y == null) {
this.p1.y = new SimpleDoubleProperty(this, MathFXAttributeNames.Y1);
}
return this.p1.y;
} | java | @Pure
public DoubleProperty y1Property() {
if (this.p1.y == null) {
this.p1.y = new SimpleDoubleProperty(this, MathFXAttributeNames.Y1);
}
return this.p1.y;
} | [
"@",
"Pure",
"public",
"DoubleProperty",
"y1Property",
"(",
")",
"{",
"if",
"(",
"this",
".",
"p1",
".",
"y",
"==",
"null",
")",
"{",
"this",
".",
"p1",
".",
"y",
"=",
"new",
"SimpleDoubleProperty",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"Y1",
... | Replies the property that is the y coordinate of the first segment point.
@return the y1 property. | [
"Replies",
"the",
"property",
"that",
"is",
"the",
"y",
"coordinate",
"of",
"the",
"first",
"segment",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/dfx/Segment3dfx.java#L223-L229 |
netty/netty | common/src/main/java/io/netty/util/internal/StringUtil.java | StringUtil.toHexStringPadded | public static <T extends Appendable> T toHexStringPadded(T dst, byte[] src) {
"""
Converts the specified byte array into a hexadecimal value and appends it to the specified buffer.
"""
return toHexStringPadded(dst, src, 0, src.length);
} | java | public static <T extends Appendable> T toHexStringPadded(T dst, byte[] src) {
return toHexStringPadded(dst, src, 0, src.length);
} | [
"public",
"static",
"<",
"T",
"extends",
"Appendable",
">",
"T",
"toHexStringPadded",
"(",
"T",
"dst",
",",
"byte",
"[",
"]",
"src",
")",
"{",
"return",
"toHexStringPadded",
"(",
"dst",
",",
"src",
",",
"0",
",",
"src",
".",
"length",
")",
";",
"}"
] | Converts the specified byte array into a hexadecimal value and appends it to the specified buffer. | [
"Converts",
"the",
"specified",
"byte",
"array",
"into",
"a",
"hexadecimal",
"value",
"and",
"appends",
"it",
"to",
"the",
"specified",
"buffer",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/StringUtil.java#L123-L125 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesInner.java | BackupShortTermRetentionPoliciesInner.beginCreateOrUpdate | public BackupShortTermRetentionPolicyInner beginCreateOrUpdate(String resourceGroupName, String serverName, String databaseName) {
"""
Updates a database's short term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Re... | java | public BackupShortTermRetentionPolicyInner beginCreateOrUpdate(String resourceGroupName, String serverName, String databaseName) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body();
} | [
"public",
"BackupShortTermRetentionPolicyInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName"... | Updates a database's short term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@throws IllegalArgum... | [
"Updates",
"a",
"database",
"s",
"short",
"term",
"retention",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesInner.java#L360-L362 |
apache/flink | flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/data/PythonDualInputSender.java | PythonDualInputSender.sendBuffer1 | public int sendBuffer1(SingleElementPushBackIterator<IN1> input) throws IOException {
"""
Extracts records from an iterator and writes them to the memory-mapped file. This method assumes that all values
in the iterator are of the same type. This method does NOT take care of synchronization. The caller must
guara... | java | public int sendBuffer1(SingleElementPushBackIterator<IN1> input) throws IOException {
if (serializer1 == null) {
IN1 value = input.next();
serializer1 = getSerializer(value);
input.pushBack(value);
}
return sendBuffer(input, serializer1);
} | [
"public",
"int",
"sendBuffer1",
"(",
"SingleElementPushBackIterator",
"<",
"IN1",
">",
"input",
")",
"throws",
"IOException",
"{",
"if",
"(",
"serializer1",
"==",
"null",
")",
"{",
"IN1",
"value",
"=",
"input",
".",
"next",
"(",
")",
";",
"serializer1",
"=... | Extracts records from an iterator and writes them to the memory-mapped file. This method assumes that all values
in the iterator are of the same type. This method does NOT take care of synchronization. The caller must
guarantee that the file may be written to before calling this method.
@param input iterator containin... | [
"Extracts",
"records",
"from",
"an",
"iterator",
"and",
"writes",
"them",
"to",
"the",
"memory",
"-",
"mapped",
"file",
".",
"This",
"method",
"assumes",
"that",
"all",
"values",
"in",
"the",
"iterator",
"are",
"of",
"the",
"same",
"type",
".",
"This",
"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/data/PythonDualInputSender.java#L51-L58 |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryConversionsSingletonSpi.java | BaseMonetaryConversionsSingletonSpi.isConversionAvailable | public boolean isConversionAvailable(CurrencyUnit termCurrency, String... providers) {
"""
Allows to quickly check, if a {@link javax.money.convert.CurrencyConversion} is accessible for the given
{@link javax.money.convert.ConversionQuery}.
@param termCurrency the terminating/target currency unit, not null.
@... | java | public boolean isConversionAvailable(CurrencyUnit termCurrency, String... providers) {
return isConversionAvailable(
ConversionQueryBuilder.of().setTermCurrency(termCurrency).setProviderNames(providers).build());
} | [
"public",
"boolean",
"isConversionAvailable",
"(",
"CurrencyUnit",
"termCurrency",
",",
"String",
"...",
"providers",
")",
"{",
"return",
"isConversionAvailable",
"(",
"ConversionQueryBuilder",
".",
"of",
"(",
")",
".",
"setTermCurrency",
"(",
"termCurrency",
")",
"... | Allows to quickly check, if a {@link javax.money.convert.CurrencyConversion} is accessible for the given
{@link javax.money.convert.ConversionQuery}.
@param termCurrency the terminating/target currency unit, not null.
@param providers the provider names defines a corresponding
provider chain that must be encapsulat... | [
"Allows",
"to",
"quickly",
"check",
"if",
"a",
"{",
"@link",
"javax",
".",
"money",
".",
"convert",
".",
"CurrencyConversion",
"}",
"is",
"accessible",
"for",
"the",
"given",
"{",
"@link",
"javax",
".",
"money",
".",
"convert",
".",
"ConversionQuery",
"}",... | train | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryConversionsSingletonSpi.java#L105-L108 |
moparisthebest/beehive | beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java | JdbcControlImpl.getConnectionFromDriverManager | private Connection getConnectionFromDriverManager(String dbDriverClassName, String dbUrlStr,
String userName, String password, String propertiesString)
throws SQLException {
"""
Get a JDBC connection from the DriverManager.
@param dbDriverClassNa... | java | private Connection getConnectionFromDriverManager(String dbDriverClassName, String dbUrlStr,
String userName, String password, String propertiesString)
throws SQLException
{
Connection con = null;
try {
Class.forName(dbDr... | [
"private",
"Connection",
"getConnectionFromDriverManager",
"(",
"String",
"dbDriverClassName",
",",
"String",
"dbUrlStr",
",",
"String",
"userName",
",",
"String",
"password",
",",
"String",
"propertiesString",
")",
"throws",
"SQLException",
"{",
"Connection",
"con",
... | Get a JDBC connection from the DriverManager.
@param dbDriverClassName Specified in the subclasse's ConnectionDriver annotation.
@param dbUrlStr Specified in the subclasse's ConnectionDriver annotation.
@param userName Specified in the subclasse's ConnectionDriver annotation.
@param password ... | [
"Get",
"a",
"JDBC",
"connection",
"from",
"the",
"DriverManager",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java#L433-L456 |
alkacon/opencms-core | src/org/opencms/loader/CmsImageScaler.java | CmsImageScaler.getWidthScaler | public CmsImageScaler getWidthScaler(CmsImageScaler downScaler) {
"""
Returns a new image scaler that is a width based down scale from the size of <code>this</code> scaler
to the given scaler size.<p>
If no down scale from this to the given scaler is required because the width of <code>this</code>
scaler is n... | java | public CmsImageScaler getWidthScaler(CmsImageScaler downScaler) {
int width = downScaler.getWidth();
int height;
if (getWidth() > width) {
// width is too large, re-calculate height
float scale = (float)width / (float)getWidth();
height = Math.round(getHeigh... | [
"public",
"CmsImageScaler",
"getWidthScaler",
"(",
"CmsImageScaler",
"downScaler",
")",
"{",
"int",
"width",
"=",
"downScaler",
".",
"getWidth",
"(",
")",
";",
"int",
"height",
";",
"if",
"(",
"getWidth",
"(",
")",
">",
"width",
")",
"{",
"// width is too la... | Returns a new image scaler that is a width based down scale from the size of <code>this</code> scaler
to the given scaler size.<p>
If no down scale from this to the given scaler is required because the width of <code>this</code>
scaler is not larger than the target width, then the image dimensions of <code>this</code>... | [
"Returns",
"a",
"new",
"image",
"scaler",
"that",
"is",
"a",
"width",
"based",
"down",
"scale",
"from",
"the",
"size",
"of",
"<code",
">",
"this<",
"/",
"code",
">",
"scaler",
"to",
"the",
"given",
"scaler",
"size",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsImageScaler.java#L876-L893 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java | PlatformBitmapFactory.createBitmap | public CloseableReference<Bitmap> createBitmap(
int width,
int height,
@Nullable Object callerContext) {
"""
Creates a bitmap of the specified width and height.
The bitmap will be created with the default ARGB_8888 configuration
@param width the width of the bitmap
@param height the height o... | java | public CloseableReference<Bitmap> createBitmap(
int width,
int height,
@Nullable Object callerContext) {
return createBitmap(width, height, Bitmap.Config.ARGB_8888, callerContext);
} | [
"public",
"CloseableReference",
"<",
"Bitmap",
">",
"createBitmap",
"(",
"int",
"width",
",",
"int",
"height",
",",
"@",
"Nullable",
"Object",
"callerContext",
")",
"{",
"return",
"createBitmap",
"(",
"width",
",",
"height",
",",
"Bitmap",
".",
"Config",
"."... | Creates a bitmap of the specified width and height.
The bitmap will be created with the default ARGB_8888 configuration
@param width the width of the bitmap
@param height the height of the bitmap
@param callerContext the Tag to track who create the Bitmap
@return a reference to the bitmap
@throws TooManyBitmapsExcepti... | [
"Creates",
"a",
"bitmap",
"of",
"the",
"specified",
"width",
"and",
"height",
".",
"The",
"bitmap",
"will",
"be",
"created",
"with",
"the",
"default",
"ARGB_8888",
"configuration"
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java#L88-L93 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java | DeleteManager.applyAndUpdateDeleteSet | static void applyAndUpdateDeleteSet(Document plf, Document ilf, IntegrationResult result) {
"""
Get the delete set if any from the plf and process each delete command removing any that fail
from the delete set so that the delete set is self cleaning.
"""
Element dSet = null;
try {
... | java | static void applyAndUpdateDeleteSet(Document plf, Document ilf, IntegrationResult result) {
Element dSet = null;
try {
dSet = getDeleteSet(plf, null, false);
} catch (Exception e) {
LOG.error("Exception occurred while getting user's DLM delete-set.", e);
}
... | [
"static",
"void",
"applyAndUpdateDeleteSet",
"(",
"Document",
"plf",
",",
"Document",
"ilf",
",",
"IntegrationResult",
"result",
")",
"{",
"Element",
"dSet",
"=",
"null",
";",
"try",
"{",
"dSet",
"=",
"getDeleteSet",
"(",
"plf",
",",
"null",
",",
"false",
... | Get the delete set if any from the plf and process each delete command removing any that fail
from the delete set so that the delete set is self cleaning. | [
"Get",
"the",
"delete",
"set",
"if",
"any",
"from",
"the",
"plf",
"and",
"process",
"each",
"delete",
"command",
"removing",
"any",
"that",
"fail",
"from",
"the",
"delete",
"set",
"so",
"that",
"the",
"delete",
"set",
"is",
"self",
"cleaning",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java#L55-L81 |
undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/gui/ComponentBorder.java | ComponentBorder.paintBorder | @Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
"""
In this case a real component is to be painted. Setting the location
of the component will cause it to be painted at that location.
"""
float x2 = (width - component.getWidth()) * component.getAli... | java | @Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
float x2 = (width - component.getWidth()) * component.getAlignmentX() + x;
float y2 = (height - component.getHeight()) * component.getAlignmentY() + y;
component.setLocation((int) x2, (int) y2);... | [
"@",
"Override",
"public",
"void",
"paintBorder",
"(",
"Component",
"c",
",",
"Graphics",
"g",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"float",
"x2",
"=",
"(",
"width",
"-",
"component",
".",
"getWidth",... | In this case a real component is to be painted. Setting the location
of the component will cause it to be painted at that location. | [
"In",
"this",
"case",
"a",
"real",
"component",
"is",
"to",
"be",
"painted",
".",
"Setting",
"the",
"location",
"of",
"the",
"component",
"will",
"cause",
"it",
"to",
"be",
"painted",
"at",
"that",
"location",
"."
] | train | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/gui/ComponentBorder.java#L157-L162 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java | PropertiesConfigHelper.getCustomBundlePropertyAsSet | public Set<String> getCustomBundlePropertyAsSet(String bundleName, String key) {
"""
Returns as a set, the comma separated values of a property
@param bundleName
the bundle name
@param key
the key of the property
@return a set of the comma separated values of a property
"""
Set<String> propertiesSet =... | java | public Set<String> getCustomBundlePropertyAsSet(String bundleName, String key) {
Set<String> propertiesSet = new HashSet<>();
StringTokenizer tk = new StringTokenizer(getCustomBundleProperty(bundleName, key, ""), ",");
while (tk.hasMoreTokens())
propertiesSet.add(tk.nextToken().trim());
return propertiesSet;... | [
"public",
"Set",
"<",
"String",
">",
"getCustomBundlePropertyAsSet",
"(",
"String",
"bundleName",
",",
"String",
"key",
")",
"{",
"Set",
"<",
"String",
">",
"propertiesSet",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"StringTokenizer",
"tk",
"=",
"new",
"... | Returns as a set, the comma separated values of a property
@param bundleName
the bundle name
@param key
the key of the property
@return a set of the comma separated values of a property | [
"Returns",
"as",
"a",
"set",
"the",
"comma",
"separated",
"values",
"of",
"a",
"property"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java#L198-L204 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java | PyExpressionGenerator._generate | protected XExpression _generate(XTryCatchFinallyExpression tryStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param tryStatement the try-catch-finally statement.
@param it the target for the generated content.
@param context the context.
@return the statem... | java | protected XExpression _generate(XTryCatchFinallyExpression tryStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
it.append("try:"); //$NON-NLS-1$
it.increaseIndentation().newLine();
generate(tryStatement.getExpression(), context.getExpectedExpressionType(), it, context);
it.decreaseIndentation... | [
"protected",
"XExpression",
"_generate",
"(",
"XTryCatchFinallyExpression",
"tryStatement",
",",
"IAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"it",
".",
"append",
"(",
"\"try:\"",
")",
";",
"//$NON-NLS-1$",
"it",
".",
"increaseInden... | Generate the given object.
@param tryStatement the try-catch-finally statement.
@param it the target for the generated content.
@param context the context.
@return the statement. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L929-L951 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/TicketAPI.java | TicketAPI.ticketGetticket | public static Ticket ticketGetticket(String access_token,String type) {
"""
获取 ticket
@param access_token access_token
@param type jsapi or wx_card
@return ticket
"""
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setUri(BASE_URI + "/cgi-bin/ticket/getticket")
.addParameter(PARAM_ACCESS_... | java | public static Ticket ticketGetticket(String access_token,String type){
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setUri(BASE_URI + "/cgi-bin/ticket/getticket")
.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
.addParameter("type", type)
.build();
return LocalHttpCli... | [
"public",
"static",
"Ticket",
"ticketGetticket",
"(",
"String",
"access_token",
",",
"String",
"type",
")",
"{",
"HttpUriRequest",
"httpUriRequest",
"=",
"RequestBuilder",
".",
"get",
"(",
")",
".",
"setUri",
"(",
"BASE_URI",
"+",
"\"/cgi-bin/ticket/getticket\"",
... | 获取 ticket
@param access_token access_token
@param type jsapi or wx_card
@return ticket | [
"获取",
"ticket"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/TicketAPI.java#L31-L38 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java | ServiceManagementRecord.updateServiceManagementRecord | @Transactional
public static ServiceManagementRecord updateServiceManagementRecord(EntityManager em, ServiceManagementRecord record) {
"""
Updates the ServiceManagementRecord entity.
@param em Entity manager. Cannot be null.
@param record serviceManagementRecord object. Cannot be null.
@return... | java | @Transactional
public static ServiceManagementRecord updateServiceManagementRecord(EntityManager em, ServiceManagementRecord record) {
SystemAssert.requireArgument(em != null, "Entity manager can not be null.");
SystemAssert.requireArgument(record != null, "ServiceManagementRecord cannot be null.");... | [
"@",
"Transactional",
"public",
"static",
"ServiceManagementRecord",
"updateServiceManagementRecord",
"(",
"EntityManager",
"em",
",",
"ServiceManagementRecord",
"record",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"Entity manager ca... | Updates the ServiceManagementRecord entity.
@param em Entity manager. Cannot be null.
@param record serviceManagementRecord object. Cannot be null.
@return updated ServiceManagementRecord entity. | [
"Updates",
"the",
"ServiceManagementRecord",
"entity",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java#L153-L169 |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.checkFileForPackaging | public static boolean checkFileForPackaging(String fileName) {
"""
Checks a file to make sure it should be packaged as standard resources.
@param fileName the name of the file (including extension)
@return true if the file should be packaged as standard java resources.
"""
String[] fileSegments = fil... | java | public static boolean checkFileForPackaging(String fileName) {
String[] fileSegments = fileName.split("\\.");
String fileExt = "";
if (fileSegments.length > 1) {
fileExt = fileSegments[fileSegments.length-1];
}
return checkFileForPackaging(fileName, fileExt);
} | [
"public",
"static",
"boolean",
"checkFileForPackaging",
"(",
"String",
"fileName",
")",
"{",
"String",
"[",
"]",
"fileSegments",
"=",
"fileName",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"String",
"fileExt",
"=",
"\"\"",
";",
"if",
"(",
"fileSegments",
".",... | Checks a file to make sure it should be packaged as standard resources.
@param fileName the name of the file (including extension)
@return true if the file should be packaged as standard java resources. | [
"Checks",
"a",
"file",
"to",
"make",
"sure",
"it",
"should",
"be",
"packaged",
"as",
"standard",
"resources",
"."
] | train | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L1020-L1028 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/Record.java | Record.getBoolean | public Boolean getBoolean(int field, String falseText) {
"""
Accessor method to retrieve a Boolean instance.
@param field the index number of the field to be retrieved
@param falseText locale specific text representing false
@return the value of the required field
"""
Boolean result;
if ((fie... | java | public Boolean getBoolean(int field, String falseText)
{
Boolean result;
if ((field < m_fields.length) && (m_fields[field].length() != 0))
{
result = ((m_fields[field].equalsIgnoreCase(falseText) == true) ? Boolean.FALSE : Boolean.TRUE);
}
else
{
result = null;
... | [
"public",
"Boolean",
"getBoolean",
"(",
"int",
"field",
",",
"String",
"falseText",
")",
"{",
"Boolean",
"result",
";",
"if",
"(",
"(",
"field",
"<",
"m_fields",
".",
"length",
")",
"&&",
"(",
"m_fields",
"[",
"field",
"]",
".",
"length",
"(",
")",
"... | Accessor method to retrieve a Boolean instance.
@param field the index number of the field to be retrieved
@param falseText locale specific text representing false
@return the value of the required field | [
"Accessor",
"method",
"to",
"retrieve",
"a",
"Boolean",
"instance",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/Record.java#L728-L742 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java | JDBCValueContentAddressStorageImpl.isRecordAlreadyExistsException | private boolean isRecordAlreadyExistsException(SQLException e) {
"""
Tell is it a RecordAlreadyExistsException.
@param e
SQLException
@return boolean
"""
// Search in UPPER case
// MySQL 5.0.x - com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException:
// Duplicate entry '... | java | private boolean isRecordAlreadyExistsException(SQLException e)
{
// Search in UPPER case
// MySQL 5.0.x - com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException:
// Duplicate entry '4f684b34c0a800030018c34f99165791-0' for key 1
// HSQLDB 8.x - java.sql.SQLException: Violati... | [
"private",
"boolean",
"isRecordAlreadyExistsException",
"(",
"SQLException",
"e",
")",
"{",
"// Search in UPPER case\r",
"// MySQL 5.0.x - com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException:\r",
"// Duplicate entry '4f684b34c0a800030018c34f99165791-0' for key 1\r",
"// HSQLDB... | Tell is it a RecordAlreadyExistsException.
@param e
SQLException
@return boolean | [
"Tell",
"is",
"it",
"a",
"RecordAlreadyExistsException",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java#L338-L379 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/http/DefaultRetryPolicy.java | DefaultRetryPolicy.getDelayBeforeNextRetryInMillis | @Override
public long getDelayBeforeNextRetryInMillis(BceClientException exception, int retriesAttempted) {
"""
Returns the delay (in milliseconds) before next retry attempt. A negative value indicates that no more retries
should be made.
@param exception the exception from the failed request, repre... | java | @Override
public long getDelayBeforeNextRetryInMillis(BceClientException exception, int retriesAttempted) {
if (!this.shouldRetry(exception, retriesAttempted)) {
return -1;
}
if (retriesAttempted < 0) {
return 0;
}
return (1 << (retriesAttempted + 1)) ... | [
"@",
"Override",
"public",
"long",
"getDelayBeforeNextRetryInMillis",
"(",
"BceClientException",
"exception",
",",
"int",
"retriesAttempted",
")",
"{",
"if",
"(",
"!",
"this",
".",
"shouldRetry",
"(",
"exception",
",",
"retriesAttempted",
")",
")",
"{",
"return",
... | Returns the delay (in milliseconds) before next retry attempt. A negative value indicates that no more retries
should be made.
@param exception the exception from the failed request, represented as an BceClientException object.
@param retriesAttempted the number of times the current request has been attempted
(... | [
"Returns",
"the",
"delay",
"(",
"in",
"milliseconds",
")",
"before",
"next",
"retry",
"attempt",
".",
"A",
"negative",
"value",
"indicates",
"that",
"no",
"more",
"retries",
"should",
"be",
"made",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/http/DefaultRetryPolicy.java#L105-L114 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/Record.java | Record.getField | public BaseField getField(String strTableName, String strFieldName) // Lookup this field {
"""
Get this field in the table/record.
@param strTableName the name of the table this field is in (for query records).
@param The field name.
@return The field.
"""
if (this.getRecord(strTableName) != thi... | java | public BaseField getField(String strTableName, String strFieldName) // Lookup this field
{
if (this.getRecord(strTableName) != this)
return null;
return this.getField(strFieldName);
} | [
"public",
"BaseField",
"getField",
"(",
"String",
"strTableName",
",",
"String",
"strFieldName",
")",
"// Lookup this field",
"{",
"if",
"(",
"this",
".",
"getRecord",
"(",
"strTableName",
")",
"!=",
"this",
")",
"return",
"null",
";",
"return",
"this",
".",
... | Get this field in the table/record.
@param strTableName the name of the table this field is in (for query records).
@param The field name.
@return The field. | [
"Get",
"this",
"field",
"in",
"the",
"table",
"/",
"record",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1015-L1020 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/ReflectionHelper.java | ReflectionHelper.setField | public void setField(Object o, String fieldName, Object newValue) {
"""
Sets (private) field of o (the field may be defined by o's class, or one of its superclasses).
@param o instance to set field of.
@param fieldName name of field.
@param newValue value to set.
"""
if (o == null) {
... | java | public void setField(Object o, String fieldName, Object newValue) {
if (o == null) {
throw new IllegalArgumentException("No object to set on provided");
}
Field field = findField(o, fieldName);
if (field == null) {
throw new IllegalArgumentException(o.getClass() +... | [
"public",
"void",
"setField",
"(",
"Object",
"o",
",",
"String",
"fieldName",
",",
"Object",
"newValue",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"No object to set on provided\"",
")",
";",
"}",
"Fi... | Sets (private) field of o (the field may be defined by o's class, or one of its superclasses).
@param o instance to set field of.
@param fieldName name of field.
@param newValue value to set. | [
"Sets",
"(",
"private",
")",
"field",
"of",
"o",
"(",
"the",
"field",
"may",
"be",
"defined",
"by",
"o",
"s",
"class",
"or",
"one",
"of",
"its",
"superclasses",
")",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/ReflectionHelper.java#L92-L109 |
alkacon/opencms-core | src/org/opencms/module/CmsModule.java | CmsModule.addCalculatedModuleResources | public static void addCalculatedModuleResources(
List<CmsResource> result,
final CmsObject cms,
final List<CmsResource> moduleResources,
final List<String> excludeResources)
throws CmsException {
"""
Determines the resources that are:
<ul>
<li>accessible with the provided {@li... | java | public static void addCalculatedModuleResources(
List<CmsResource> result,
final CmsObject cms,
final List<CmsResource> moduleResources,
final List<String> excludeResources)
throws CmsException {
for (CmsResource resource : moduleResources) {
String sitePath = c... | [
"public",
"static",
"void",
"addCalculatedModuleResources",
"(",
"List",
"<",
"CmsResource",
">",
"result",
",",
"final",
"CmsObject",
"cms",
",",
"final",
"List",
"<",
"CmsResource",
">",
"moduleResources",
",",
"final",
"List",
"<",
"String",
">",
"excludeReso... | Determines the resources that are:
<ul>
<li>accessible with the provided {@link CmsObject},</li>
<li>part of the <code>moduleResources</code> (or in a folder of these resources) and</li>
<li><em>not</em> contained in <code>excludedResources</code> (or a folder of these resources).</li>
</ul>
and adds the to <code>resul... | [
"Determines",
"the",
"resources",
"that",
"are",
":",
"<ul",
">",
"<li",
">",
"accessible",
"with",
"the",
"provided",
"{",
"@link",
"CmsObject",
"}",
"<",
"/",
"li",
">",
"<li",
">",
"part",
"of",
"the",
"<code",
">",
"moduleResources<",
"/",
"code",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/module/CmsModule.java#L368-L398 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java | AiMaterial.getTextureOp | public AiTextureOp getTextureOp(AiTextureType type, int index) {
"""
Returns the texture operation.<p>
If missing, defaults to {@link AiTextureOp#ADD}
@param type the texture type
@param index the index in the texture stack
@return the texture operation
"""
checkTexRange(type, index);
... | java | public AiTextureOp getTextureOp(AiTextureType type, int index) {
checkTexRange(type, index);
Property p = getProperty(PropertyKey.TEX_OP.m_key);
if (null == p || null == p.getData()) {
return (AiTextureOp) m_defaults.get(PropertyKey.TEX_OP);
}
... | [
"public",
"AiTextureOp",
"getTextureOp",
"(",
"AiTextureType",
"type",
",",
"int",
"index",
")",
"{",
"checkTexRange",
"(",
"type",
",",
"index",
")",
";",
"Property",
"p",
"=",
"getProperty",
"(",
"PropertyKey",
".",
"TEX_OP",
".",
"m_key",
")",
";",
"if"... | Returns the texture operation.<p>
If missing, defaults to {@link AiTextureOp#ADD}
@param type the texture type
@param index the index in the texture stack
@return the texture operation | [
"Returns",
"the",
"texture",
"operation",
".",
"<p",
">"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L955-L965 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WatcherUtils.java | WatcherUtils.isInDirectory | public static boolean isInDirectory(File file, File directory) {
"""
Checks whether the given file is inside the given directory.
@param file the file
@param directory the directory
@return {@literal true} if the file is in the directory (or any subdirectories), {@literal false} otherwise.
"""
... | java | public static boolean isInDirectory(File file, File directory) {
try {
return FilenameUtils.directoryContains(directory.getCanonicalPath(), file.getCanonicalPath());
} catch (IOException e) { //NOSONAR
return false;
}
} | [
"public",
"static",
"boolean",
"isInDirectory",
"(",
"File",
"file",
",",
"File",
"directory",
")",
"{",
"try",
"{",
"return",
"FilenameUtils",
".",
"directoryContains",
"(",
"directory",
".",
"getCanonicalPath",
"(",
")",
",",
"file",
".",
"getCanonicalPath",
... | Checks whether the given file is inside the given directory.
@param file the file
@param directory the directory
@return {@literal true} if the file is in the directory (or any subdirectories), {@literal false} otherwise. | [
"Checks",
"whether",
"the",
"given",
"file",
"is",
"inside",
"the",
"given",
"directory",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WatcherUtils.java#L44-L50 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/Stripe.java | Stripe.createToken | public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) {
"""
The simplest way to create a token, using a {@link Card} and {@link TokenCallback}. This
runs on the default {@link Executor} and with the
currently set {@link #mDefaultPublishableKey}.
@param card the {@link Card} ... | java | public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) {
createToken(card, mDefaultPublishableKey, callback);
} | [
"public",
"void",
"createToken",
"(",
"@",
"NonNull",
"final",
"Card",
"card",
",",
"@",
"NonNull",
"final",
"TokenCallback",
"callback",
")",
"{",
"createToken",
"(",
"card",
",",
"mDefaultPublishableKey",
",",
"callback",
")",
";",
"}"
] | The simplest way to create a token, using a {@link Card} and {@link TokenCallback}. This
runs on the default {@link Executor} and with the
currently set {@link #mDefaultPublishableKey}.
@param card the {@link Card} used to create this payment token
@param callback a {@link TokenCallback} to receive either the token or... | [
"The",
"simplest",
"way",
"to",
"create",
"a",
"token",
"using",
"a",
"{",
"@link",
"Card",
"}",
"and",
"{",
"@link",
"TokenCallback",
"}",
".",
"This",
"runs",
"on",
"the",
"default",
"{",
"@link",
"Executor",
"}",
"and",
"with",
"the",
"currently",
"... | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/Stripe.java#L321-L323 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java | CommerceNotificationTemplatePersistenceImpl.removeByUUID_G | @Override
public CommerceNotificationTemplate removeByUUID_G(String uuid, long groupId)
throws NoSuchNotificationTemplateException {
"""
Removes the commerce notification template where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the commerce... | java | @Override
public CommerceNotificationTemplate removeByUUID_G(String uuid, long groupId)
throws NoSuchNotificationTemplateException {
CommerceNotificationTemplate commerceNotificationTemplate = findByUUID_G(uuid,
groupId);
return remove(commerceNotificationTemplate);
} | [
"@",
"Override",
"public",
"CommerceNotificationTemplate",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchNotificationTemplateException",
"{",
"CommerceNotificationTemplate",
"commerceNotificationTemplate",
"=",
"findByUUID_G",
"(",
"uu... | Removes the commerce notification template where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the commerce notification template that was removed | [
"Removes",
"the",
"commerce",
"notification",
"template",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java#L827-L834 |
mijecu25/dsa | src/main/java/com/mijecu25/dsa/algorithms/sort/linearlogarithmic/Quicksort.java | Quicksort.partition | private static int partition(int[] intArray, int start, int end) {
"""
Routine that arranges the elements in ascending order around a pivot. This routine
runs in O(n) time.
@param intArray array that we want to sort
@param start index of the starting point to sort
@param end index of the end point to sort
... | java | private static int partition(int[] intArray, int start, int end) {
int pivot = intArray[end];
int index = start - 1;
for(int j = start; j < end; j++) {
if(intArray[j] <= pivot) {
index++;
XORSwap.swap(intArray, index, j);
}
... | [
"private",
"static",
"int",
"partition",
"(",
"int",
"[",
"]",
"intArray",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"pivot",
"=",
"intArray",
"[",
"end",
"]",
";",
"int",
"index",
"=",
"start",
"-",
"1",
";",
"for",
"(",
"int",
"j... | Routine that arranges the elements in ascending order around a pivot. This routine
runs in O(n) time.
@param intArray array that we want to sort
@param start index of the starting point to sort
@param end index of the end point to sort
@return an integer that represent the index of the pivot | [
"Routine",
"that",
"arranges",
"the",
"elements",
"in",
"ascending",
"order",
"around",
"a",
"pivot",
".",
"This",
"routine",
"runs",
"in",
"O",
"(",
"n",
")",
"time",
"."
] | train | https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/sort/linearlogarithmic/Quicksort.java#L254-L268 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/SATSolver.java | SATSolver.addWithRelaxation | public void addWithRelaxation(final Variable relaxationVar, final ImmutableFormulaList formulas) {
"""
Adds a formula list to the solver.
@param relaxationVar the relaxation variable
@param formulas the formula list
"""
for (final Formula formula : formulas) { this.addWithRelaxation(relaxationVa... | java | public void addWithRelaxation(final Variable relaxationVar, final ImmutableFormulaList formulas) {
for (final Formula formula : formulas) { this.addWithRelaxation(relaxationVar, formula); }
} | [
"public",
"void",
"addWithRelaxation",
"(",
"final",
"Variable",
"relaxationVar",
",",
"final",
"ImmutableFormulaList",
"formulas",
")",
"{",
"for",
"(",
"final",
"Formula",
"formula",
":",
"formulas",
")",
"{",
"this",
".",
"addWithRelaxation",
"(",
"relaxationVa... | Adds a formula list to the solver.
@param relaxationVar the relaxation variable
@param formulas the formula list | [
"Adds",
"a",
"formula",
"list",
"to",
"the",
"solver",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/SATSolver.java#L152-L154 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/OAuthApi.java | OAuthApi.getAccessToken | public OAuthAccessToken getAccessToken(InputStream inputStream) throws JinxException {
"""
Exchange an auth token from the old Authentication API, to an OAuth access token.
Calling this method will delete the auth token used to make the request.
<br>
This method should be called when upgrading your app to use O... | java | public OAuthAccessToken getAccessToken(InputStream inputStream) throws JinxException {
JinxUtils.validateParams(inputStream);
Properties legacyTokenProperties = loadLegacyTokenProperties(inputStream);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.auth.oauth.getAccessToken");... | [
"public",
"OAuthAccessToken",
"getAccessToken",
"(",
"InputStream",
"inputStream",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"inputStream",
")",
";",
"Properties",
"legacyTokenProperties",
"=",
"loadLegacyTokenProperties",
"(",
"inputSt... | Exchange an auth token from the old Authentication API, to an OAuth access token.
Calling this method will delete the auth token used to make the request.
<br>
This method should be called when upgrading your app to use OAuth. Call this method prior to initializing
Jinx, and then use the OAuthExchangedToken to initiali... | [
"Exchange",
"an",
"auth",
"token",
"from",
"the",
"old",
"Authentication",
"API",
"to",
"an",
"OAuth",
"access",
"token",
".",
"Calling",
"this",
"method",
"will",
"delete",
"the",
"auth",
"token",
"used",
"to",
"make",
"the",
"request",
".",
"<br",
">",
... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/OAuthApi.java#L97-L145 |
jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.scheduleBuild2 | @WithBridgeMethods(Future.class)
public QueueTaskFuture<R> scheduleBuild2(int quietPeriod, Cause c, Collection<? extends Action> actions) {
"""
Schedules a build of this project, and returns a {@link Future} object
to wait for the completion of the build.
@param actions
For the convenience of the caller, ... | java | @WithBridgeMethods(Future.class)
public QueueTaskFuture<R> scheduleBuild2(int quietPeriod, Cause c, Collection<? extends Action> actions) {
List<Action> queueActions = new ArrayList<Action>(actions);
if (c != null) {
queueActions.add(new CauseAction(c));
}
return schedule... | [
"@",
"WithBridgeMethods",
"(",
"Future",
".",
"class",
")",
"public",
"QueueTaskFuture",
"<",
"R",
">",
"scheduleBuild2",
"(",
"int",
"quietPeriod",
",",
"Cause",
"c",
",",
"Collection",
"<",
"?",
"extends",
"Action",
">",
"actions",
")",
"{",
"List",
"<",... | Schedules a build of this project, and returns a {@link Future} object
to wait for the completion of the build.
@param actions
For the convenience of the caller, this collection can contain null, and those will be silently ignored.
@since 1.383 | [
"Schedules",
"a",
"build",
"of",
"this",
"project",
"and",
"returns",
"a",
"{",
"@link",
"Future",
"}",
"object",
"to",
"wait",
"for",
"the",
"completion",
"of",
"the",
"build",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L819-L826 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getAppUsersByExternalAppUserID | public static Iterable<BoxUser.Info> getAppUsersByExternalAppUserID(final BoxAPIConnection api,
final String externalAppUserId, final String... fields) {
"""
Gets any app users that has an exact match with the externalAppUserId term.
@param api the API connection to be used when retriev... | java | public static Iterable<BoxUser.Info> getAppUsersByExternalAppUserID(final BoxAPIConnection api,
final String externalAppUserId, final String... fields) {
return getUsersInfoForType(api, null, null, externalAppUserId, fields);
} | [
"public",
"static",
"Iterable",
"<",
"BoxUser",
".",
"Info",
">",
"getAppUsersByExternalAppUserID",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"final",
"String",
"externalAppUserId",
",",
"final",
"String",
"...",
"fields",
")",
"{",
"return",
"getUsersInfoForTyp... | Gets any app users that has an exact match with the externalAppUserId term.
@param api the API connection to be used when retrieving the users.
@param externalAppUserId the external app user id that has been set for app user
@param fields the fields to retrieve. Leave this out for the s... | [
"Gets",
"any",
"app",
"users",
"that",
"has",
"an",
"exact",
"match",
"with",
"the",
"externalAppUserId",
"term",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L235-L238 |
janus-project/guava.janusproject.io | guava/src/com/google/common/util/concurrent/AtomicLongMap.java | AtomicLongMap.putIfAbsent | long putIfAbsent(K key, long newValue) {
"""
If {@code key} is not already associated with a value or if {@code key} is associated with
zero, associate it with {@code newValue}. Returns the previous value associated with
{@code key}, or zero if there was no mapping for {@code key}.
"""
for (;;) {
A... | java | long putIfAbsent(K key, long newValue) {
for (;;) {
AtomicLong atomic = map.get(key);
if (atomic == null) {
atomic = map.putIfAbsent(key, new AtomicLong(newValue));
if (atomic == null) {
return 0L;
}
// atomic is now non-null; fall through
}
long ol... | [
"long",
"putIfAbsent",
"(",
"K",
"key",
",",
"long",
"newValue",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"AtomicLong",
"atomic",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"atomic",
"==",
"null",
")",
"{",
"atomic",
"=",
"map",
... | If {@code key} is not already associated with a value or if {@code key} is associated with
zero, associate it with {@code newValue}. Returns the previous value associated with
{@code key}, or zero if there was no mapping for {@code key}. | [
"If",
"{"
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/util/concurrent/AtomicLongMap.java#L367-L390 |
Netflix/ribbon | ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/reactive/ExecutionContextListenerInvoker.java | ExecutionContextListenerInvoker.onExceptionWithServer | public void onExceptionWithServer(ExecutionContext<I> context, Throwable exception, ExecutionInfo info) {
"""
Called when an exception is received from executing the request on a server.
@param exception Exception received
"""
for (ExecutionListener<I, O> listener: listeners) {
try {
... | java | public void onExceptionWithServer(ExecutionContext<I> context, Throwable exception, ExecutionInfo info) {
for (ExecutionListener<I, O> listener: listeners) {
try {
if (!isListenerDisabled(listener)) {
listener.onExceptionWithServer(context.getChildContext(listener... | [
"public",
"void",
"onExceptionWithServer",
"(",
"ExecutionContext",
"<",
"I",
">",
"context",
",",
"Throwable",
"exception",
",",
"ExecutionInfo",
"info",
")",
"{",
"for",
"(",
"ExecutionListener",
"<",
"I",
",",
"O",
">",
"listener",
":",
"listeners",
")",
... | Called when an exception is received from executing the request on a server.
@param exception Exception received | [
"Called",
"when",
"an",
"exception",
"is",
"received",
"from",
"executing",
"the",
"request",
"on",
"a",
"server",
"."
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/reactive/ExecutionContextListenerInvoker.java#L118-L128 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java | GenericIHEAuditEventMessage.addDocumentUriParticipantObject | public void addDocumentUriParticipantObject(String documentRetrieveUri, String documentUniqueId) {
"""
Adds a Participant Object representing a URI
@param documentRetrieveUri The URI of the Participant Object
@param documentUniqueId The Document Entry Unique ID
"""
List<TypeValuePairType> tvp = new Linke... | java | public void addDocumentUriParticipantObject(String documentRetrieveUri, String documentUniqueId)
{
List<TypeValuePairType> tvp = new LinkedList<>();
if (documentUniqueId != null) {
tvp.add(getTypeValuePair("XDSDocumentEntry.uniqueId", documentUniqueId.getBytes()));
}
addParticipantObjectIdentification(
... | [
"public",
"void",
"addDocumentUriParticipantObject",
"(",
"String",
"documentRetrieveUri",
",",
"String",
"documentUniqueId",
")",
"{",
"List",
"<",
"TypeValuePairType",
">",
"tvp",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"if",
"(",
"documentUniqueId",
"!="... | Adds a Participant Object representing a URI
@param documentRetrieveUri The URI of the Participant Object
@param documentUniqueId The Document Entry Unique ID | [
"Adds",
"a",
"Participant",
"Object",
"representing",
"a",
"URI"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java#L208-L224 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java | SparkComputationGraph.doEvaluation | public IEvaluation[] doEvaluation(JavaRDD<String> data, MultiDataSetLoader loader, IEvaluation... emptyEvaluations) {
"""
Perform evaluation on serialized MultiDataSet objects on disk, (potentially in any format), that are loaded using an {@link MultiDataSetLoader}.<br>
Uses the default number of workers (model r... | java | public IEvaluation[] doEvaluation(JavaRDD<String> data, MultiDataSetLoader loader, IEvaluation... emptyEvaluations) {
return doEvaluation(data, DEFAULT_EVAL_WORKERS, DEFAULT_EVAL_SCORE_BATCH_SIZE, null, loader, emptyEvaluations);
} | [
"public",
"IEvaluation",
"[",
"]",
"doEvaluation",
"(",
"JavaRDD",
"<",
"String",
">",
"data",
",",
"MultiDataSetLoader",
"loader",
",",
"IEvaluation",
"...",
"emptyEvaluations",
")",
"{",
"return",
"doEvaluation",
"(",
"data",
",",
"DEFAULT_EVAL_WORKERS",
",",
... | Perform evaluation on serialized MultiDataSet objects on disk, (potentially in any format), that are loaded using an {@link MultiDataSetLoader}.<br>
Uses the default number of workers (model replicas per JVM) of {@link #DEFAULT_EVAL_WORKERS} with the default
minibatch size of {@link #DEFAULT_EVAL_SCORE_BATCH_SIZE}
@par... | [
"Perform",
"evaluation",
"on",
"serialized",
"MultiDataSet",
"objects",
"on",
"disk",
"(",
"potentially",
"in",
"any",
"format",
")",
"that",
"are",
"loaded",
"using",
"an",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java#L894-L896 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/io/CharStreams.java | CharStreams.copy | @CanIgnoreReturnValue
public static long copy(Readable from, Appendable to) throws IOException {
"""
Copies all characters between the {@link Readable} and {@link Appendable} objects. Does not
close or flush either object.
@param from the object to read from
@param to the object to write to
@return the num... | java | @CanIgnoreReturnValue
public static long copy(Readable from, Appendable to) throws IOException {
checkNotNull(from);
checkNotNull(to);
CharBuffer buf = createBuffer();
long total = 0;
while (from.read(buf) != -1) {
buf.flip();
to.append(buf);
total += buf.remaining();
buf.c... | [
"@",
"CanIgnoreReturnValue",
"public",
"static",
"long",
"copy",
"(",
"Readable",
"from",
",",
"Appendable",
"to",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"from",
")",
";",
"checkNotNull",
"(",
"to",
")",
";",
"CharBuffer",
"buf",
"=",
"creat... | Copies all characters between the {@link Readable} and {@link Appendable} objects. Does not
close or flush either object.
@param from the object to read from
@param to the object to write to
@return the number of characters copied
@throws IOException if an I/O error occurs | [
"Copies",
"all",
"characters",
"between",
"the",
"{",
"@link",
"Readable",
"}",
"and",
"{",
"@link",
"Appendable",
"}",
"objects",
".",
"Does",
"not",
"close",
"or",
"flush",
"either",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/io/CharStreams.java#L68-L81 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformClob.java | TransformClob.transformOut | @Override
public Clob transformOut(JdbcPreparedStatementFactory jpsf, char[] attributeObject) throws CpoException {
"""
Transforms the data from the class attribute to the object required by the datasource
@param cpoAdapter The CpoAdapter for the datasource where the attribute is being persisted
@param paren... | java | @Override
public Clob transformOut(JdbcPreparedStatementFactory jpsf, char[] attributeObject) throws CpoException {
CLOB newClob = null;
try {
if (attributeObject != null) {
newClob = CLOB.createTemporary(jpsf.getPreparedStatement().getConnection(), false, CLOB.DURATION_SESSION);
jpsf.A... | [
"@",
"Override",
"public",
"Clob",
"transformOut",
"(",
"JdbcPreparedStatementFactory",
"jpsf",
",",
"char",
"[",
"]",
"attributeObject",
")",
"throws",
"CpoException",
"{",
"CLOB",
"newClob",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"attributeObject",
"!=",
"... | Transforms the data from the class attribute to the object required by the datasource
@param cpoAdapter The CpoAdapter for the datasource where the attribute is being persisted
@param parentObject The object that contains the attribute being persisted.
@param attributeObject The object that represents the attribute be... | [
"Transforms",
"the",
"data",
"from",
"the",
"class",
"attribute",
"to",
"the",
"object",
"required",
"by",
"the",
"datasource"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformClob.java#L86-L105 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getShort | public short getShort(String key, short defaultValue) {
"""
Returns the Short value for the given key. If the key does not exists it will return the default value given.
The method fails if the value is not a Short.
"""
addToDefaults(key, Short.toString(defaultValue));
String value = get(key);
if (value... | java | public short getShort(String key, short defaultValue) {
addToDefaults(key, Short.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Short.valueOf(value);
}
} | [
"public",
"short",
"getShort",
"(",
"String",
"key",
",",
"short",
"defaultValue",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"Short",
".",
"toString",
"(",
"defaultValue",
")",
")",
";",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",... | Returns the Short value for the given key. If the key does not exists it will return the default value given.
The method fails if the value is not a Short. | [
"Returns",
"the",
"Short",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exists",
"it",
"will",
"return",
"the",
"default",
"value",
"given",
".",
"The",
"method",
"fails",
"if",
"the",
"value",
"is",
"not",
"a",
"Shor... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L423-L431 |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ValidationFilter.java | ValidationFilter.validateLang | private AttributesImpl validateLang(final Attributes atts, final AttributesImpl modified) throws SAXException {
"""
Validate and fix {@code xml:lang} attribute.
@return modified attributes, {@code null} if there have been no changes
"""
AttributesImpl res = modified;
final String lang = atts... | java | private AttributesImpl validateLang(final Attributes atts, final AttributesImpl modified) throws SAXException {
AttributesImpl res = modified;
final String lang = atts.getValue(XML_NS_URI, "lang");
if (lang != null) {
final int i = lang.indexOf('_');
if (i != -1) {
... | [
"private",
"AttributesImpl",
"validateLang",
"(",
"final",
"Attributes",
"atts",
",",
"final",
"AttributesImpl",
"modified",
")",
"throws",
"SAXException",
"{",
"AttributesImpl",
"res",
"=",
"modified",
";",
"final",
"String",
"lang",
"=",
"atts",
".",
"getValue",... | Validate and fix {@code xml:lang} attribute.
@return modified attributes, {@code null} if there have been no changes | [
"Validate",
"and",
"fix",
"{",
"@code",
"xml",
":",
"lang",
"}",
"attribute",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ValidationFilter.java#L111-L130 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java | ImageModerationsImpl.findFacesFileInput | public FoundFaces findFacesFileInput(byte[] imageStream, FindFacesFileInputOptionalParameter findFacesFileInputOptionalParameter) {
"""
Returns the list of faces found.
@param imageStream The image file.
@param findFacesFileInputOptionalParameter the object representing the optional parameters to be set before... | java | public FoundFaces findFacesFileInput(byte[] imageStream, FindFacesFileInputOptionalParameter findFacesFileInputOptionalParameter) {
return findFacesFileInputWithServiceResponseAsync(imageStream, findFacesFileInputOptionalParameter).toBlocking().single().body();
} | [
"public",
"FoundFaces",
"findFacesFileInput",
"(",
"byte",
"[",
"]",
"imageStream",
",",
"FindFacesFileInputOptionalParameter",
"findFacesFileInputOptionalParameter",
")",
"{",
"return",
"findFacesFileInputWithServiceResponseAsync",
"(",
"imageStream",
",",
"findFacesFileInputOpt... | Returns the list of faces found.
@param imageStream The image file.
@param findFacesFileInputOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@throws APIErrorException thrown if the request is r... | [
"Returns",
"the",
"list",
"of",
"faces",
"found",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L722-L724 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/misc/TriangularSolver_DSCC.java | TriangularSolver_DSCC.searchNzRowsInX_DFS | private static int searchNzRowsInX_DFS(int rowB , DMatrixSparseCSC G , int top , int pinv[], int xi[], int w[] ) {
"""
Given the first row in B it performs a DFS seeing which elements in 'X' will be not zero. A row=i in 'X' will
be not zero if any element in row=(j < i) in G is not zero
Tall Matrices: The non... | java | private static int searchNzRowsInX_DFS(int rowB , DMatrixSparseCSC G , int top , int pinv[], int xi[], int w[] )
{
int N = G.numCols; // first N elements in w is the length of X
int head = 0; // put the selected row into the FILO stack
xi[head] = rowB; // use the head of xi to store where t... | [
"private",
"static",
"int",
"searchNzRowsInX_DFS",
"(",
"int",
"rowB",
",",
"DMatrixSparseCSC",
"G",
",",
"int",
"top",
",",
"int",
"pinv",
"[",
"]",
",",
"int",
"xi",
"[",
"]",
",",
"int",
"w",
"[",
"]",
")",
"{",
"int",
"N",
"=",
"G",
".",
"num... | Given the first row in B it performs a DFS seeing which elements in 'X' will be not zero. A row=i in 'X' will
be not zero if any element in row=(j < i) in G is not zero
Tall Matrices: The non-zero pattern of X is entirely determined by the top N by N matrix,
where N is the number of columns.
@param xi recursion stac... | [
"Given",
"the",
"first",
"row",
"in",
"B",
"it",
"performs",
"a",
"DFS",
"seeing",
"which",
"elements",
"in",
"X",
"will",
"be",
"not",
"zero",
".",
"A",
"row",
"=",
"i",
"in",
"X",
"will",
"be",
"not",
"zero",
"if",
"any",
"element",
"in",
"row",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/misc/TriangularSolver_DSCC.java#L375-L414 |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/proxy/internal/BestMatchingConstructor.java | BestMatchingConstructor.typesAreCompatible | private boolean typesAreCompatible(Class<?>[] paramTypes, Class<?>[] constructorParamTypes) {
"""
Checks if a set of types are compatible with the given set of constructor parameter types. If an input type is
null, then it is considered as a wildcard for matching purposes, and always matches.
@param paramTypes... | java | private boolean typesAreCompatible(Class<?>[] paramTypes, Class<?>[] constructorParamTypes) {
boolean matches = true;
for (int i = 0; i < paramTypes.length; i++) {
Class<?> paramType = paramTypes[i];
if (paramType != null) {
Class<?> inputParamType = translateFro... | [
"private",
"boolean",
"typesAreCompatible",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"constructorParamTypes",
")",
"{",
"boolean",
"matches",
"=",
"true",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Checks if a set of types are compatible with the given set of constructor parameter types. If an input type is
null, then it is considered as a wildcard for matching purposes, and always matches.
@param paramTypes A set of input types that are to be matched against constructor parameters.
@param constructor... | [
"Checks",
"if",
"a",
"set",
"of",
"types",
"are",
"compatible",
"with",
"the",
"given",
"set",
"of",
"constructor",
"parameter",
"types",
".",
"If",
"an",
"input",
"type",
"is",
"null",
"then",
"it",
"is",
"considered",
"as",
"a",
"wildcard",
"for",
"mat... | train | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/proxy/internal/BestMatchingConstructor.java#L112-L132 |
jcuda/jnvgraph | JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java | JNvgraph.nvgraphGetEdgeData | public static int nvgraphGetEdgeData(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
Pointer edgeData,
long setnum) {
"""
Copy the edge set #setnum in *edgeData, sets have 0-based index
"""
return checkResult(nvgraphGetEdgeDataNative(handle, descrG, edgeData, setnum)... | java | public static int nvgraphGetEdgeData(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
Pointer edgeData,
long setnum)
{
return checkResult(nvgraphGetEdgeDataNative(handle, descrG, edgeData, setnum));
} | [
"public",
"static",
"int",
"nvgraphGetEdgeData",
"(",
"nvgraphHandle",
"handle",
",",
"nvgraphGraphDescr",
"descrG",
",",
"Pointer",
"edgeData",
",",
"long",
"setnum",
")",
"{",
"return",
"checkResult",
"(",
"nvgraphGetEdgeDataNative",
"(",
"handle",
",",
"descrG",
... | Copy the edge set #setnum in *edgeData, sets have 0-based index | [
"Copy",
"the",
"edge",
"set",
"#setnum",
"in",
"*",
"edgeData",
"sets",
"have",
"0",
"-",
"based",
"index"
] | train | https://github.com/jcuda/jnvgraph/blob/2c6bd7c58edac181753bacf30af2cceeb1989a78/JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java#L366-L373 |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/AnnisBaseUI.java | AnnisBaseUI.injectUniqueCSS | public void injectUniqueCSS(String cssContent, String wrapperClass) {
"""
Inject CSS into the UI.
This function will not add multiple style-elements if the
exact CSS string was already added.
@param cssContent
@param wrapperClass Name of the wrapper class (a CSS class that is applied to a parent element)
"... | java | public void injectUniqueCSS(String cssContent, String wrapperClass)
{
if(alreadyAddedCSS == null)
{
alreadyAddedCSS = new TreeSet<String>();
}
if(wrapperClass != null)
{
cssContent = wrapCSS(cssContent, wrapperClass);
}
String hashForCssContent = Hashing.md5().hashSt... | [
"public",
"void",
"injectUniqueCSS",
"(",
"String",
"cssContent",
",",
"String",
"wrapperClass",
")",
"{",
"if",
"(",
"alreadyAddedCSS",
"==",
"null",
")",
"{",
"alreadyAddedCSS",
"=",
"new",
"TreeSet",
"<",
"String",
">",
"(",
")",
";",
"}",
"if",
"(",
... | Inject CSS into the UI.
This function will not add multiple style-elements if the
exact CSS string was already added.
@param cssContent
@param wrapperClass Name of the wrapper class (a CSS class that is applied to a parent element) | [
"Inject",
"CSS",
"into",
"the",
"UI",
".",
"This",
"function",
"will",
"not",
"add",
"multiple",
"style",
"-",
"elements",
"if",
"the",
"exact",
"CSS",
"string",
"was",
"already",
"added",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/AnnisBaseUI.java#L441-L461 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java | CommonOps_DDF3.elementDiv | public static void elementDiv( DMatrix3 a , DMatrix3 b , DMatrix3 c ) {
"""
<p>Performs an element by element division operation:<br>
<br>
c<sub>i</sub> = a<sub>i</sub> / b<sub>i</sub> <br>
</p>
@param a The left vector in the division operation. Not modified.
@param b The right vector in the division operati... | java | public static void elementDiv( DMatrix3 a , DMatrix3 b , DMatrix3 c ) {
c.a1 = a.a1/b.a1;
c.a2 = a.a2/b.a2;
c.a3 = a.a3/b.a3;
} | [
"public",
"static",
"void",
"elementDiv",
"(",
"DMatrix3",
"a",
",",
"DMatrix3",
"b",
",",
"DMatrix3",
"c",
")",
"{",
"c",
".",
"a1",
"=",
"a",
".",
"a1",
"/",
"b",
".",
"a1",
";",
"c",
".",
"a2",
"=",
"a",
".",
"a2",
"/",
"b",
".",
"a2",
"... | <p>Performs an element by element division operation:<br>
<br>
c<sub>i</sub> = a<sub>i</sub> / b<sub>i</sub> <br>
</p>
@param a The left vector in the division operation. Not modified.
@param b The right vector in the division operation. Not modified.
@param c Where the results of the operation are stored. Modified. | [
"<p",
">",
"Performs",
"an",
"element",
"by",
"element",
"division",
"operation",
":",
"<br",
">",
"<br",
">",
"c<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"/",
"b<sub",
">",
"i<",
"/",
"sub",
">",
"<br",
">",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java#L1141-L1145 |
elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanDistanceKNNQuery.java | LinearScanDistanceKNNQuery.linearScanBatchKNN | private void linearScanBatchKNN(ArrayDBIDs ids, List<KNNHeap> heaps) {
"""
Linear batch knn for arbitrary distance functions.
@param ids DBIDs to process
@param heaps Heaps to store the results in
"""
final DistanceQuery<O> dq = distanceQuery;
// The distance is computed on database IDs
for(DBI... | java | private void linearScanBatchKNN(ArrayDBIDs ids, List<KNNHeap> heaps) {
final DistanceQuery<O> dq = distanceQuery;
// The distance is computed on database IDs
for(DBIDIter iter = getRelation().getDBIDs().iter(); iter.valid(); iter.advance()) {
int index = 0;
for(DBIDIter iter2 = ids.iter(); iter2... | [
"private",
"void",
"linearScanBatchKNN",
"(",
"ArrayDBIDs",
"ids",
",",
"List",
"<",
"KNNHeap",
">",
"heaps",
")",
"{",
"final",
"DistanceQuery",
"<",
"O",
">",
"dq",
"=",
"distanceQuery",
";",
"// The distance is computed on database IDs",
"for",
"(",
"DBIDIter",... | Linear batch knn for arbitrary distance functions.
@param ids DBIDs to process
@param heaps Heaps to store the results in | [
"Linear",
"batch",
"knn",
"for",
"arbitrary",
"distance",
"functions",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanDistanceKNNQuery.java#L103-L113 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/bytecode/simulation/MethodSimulator.java | MethodSimulator.mergeMethodHandleStore | private void mergeMethodHandleStore(final int index, final MethodHandle methodHandle) {
"""
Merges a stored method handle to the local variables.
@param index The index of the variable
@param methodHandle The method handle to merge
"""
localVariables.merge(index, new MethodHandle(methodHandl... | java | private void mergeMethodHandleStore(final int index, final MethodHandle methodHandle) {
localVariables.merge(index, new MethodHandle(methodHandle), Element::merge);
} | [
"private",
"void",
"mergeMethodHandleStore",
"(",
"final",
"int",
"index",
",",
"final",
"MethodHandle",
"methodHandle",
")",
"{",
"localVariables",
".",
"merge",
"(",
"index",
",",
"new",
"MethodHandle",
"(",
"methodHandle",
")",
",",
"Element",
"::",
"merge",
... | Merges a stored method handle to the local variables.
@param index The index of the variable
@param methodHandle The method handle to merge | [
"Merges",
"a",
"stored",
"method",
"handle",
"to",
"the",
"local",
"variables",
"."
] | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/bytecode/simulation/MethodSimulator.java#L236-L238 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_phone_rma_POST | public OvhRmaReturn billingAccount_line_serviceName_phone_rma_POST(String billingAccount, String serviceName, String mondialRelayId, String newMerchandise, Long shippingContactId, OvhRmaPublicTypeEnum type) throws IOException {
"""
Create a specific rma
REST: POST /telephony/{billingAccount}/line/{serviceName}/... | java | public OvhRmaReturn billingAccount_line_serviceName_phone_rma_POST(String billingAccount, String serviceName, String mondialRelayId, String newMerchandise, Long shippingContactId, OvhRmaPublicTypeEnum type) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/phone/rma";
StringBuilder... | [
"public",
"OvhRmaReturn",
"billingAccount_line_serviceName_phone_rma_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"mondialRelayId",
",",
"String",
"newMerchandise",
",",
"Long",
"shippingContactId",
",",
"OvhRmaPublicTypeEnum",
"type",
... | Create a specific rma
REST: POST /telephony/{billingAccount}/line/{serviceName}/phone/rma
@param shippingContactId [required] Shipping contact information id from /me entry point
@param type [required] Typology process of merchandise return
@param mondialRelayId [required] Use /supply/mondialRelay entry point to speci... | [
"Create",
"a",
"specific",
"rma"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1057-L1067 |
HiddenStage/divide | Shared/src/main/java/io/divide/shared/file/FileUtils.java | FileUtils.copyToFile | public static boolean copyToFile(InputStream inputStream, File destFile) {
"""
Copy data from a source stream to destFile.
Return true if succeed, return false if failed.
"""
try {
OutputStream out = new FileOutputStream(destFile);
try {
byte[] buffer = new byte... | java | public static boolean copyToFile(InputStream inputStream, File destFile) {
try {
OutputStream out = new FileOutputStream(destFile);
try {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) >= 0) {
... | [
"public",
"static",
"boolean",
"copyToFile",
"(",
"InputStream",
"inputStream",
",",
"File",
"destFile",
")",
"{",
"try",
"{",
"OutputStream",
"out",
"=",
"new",
"FileOutputStream",
"(",
"destFile",
")",
";",
"try",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"n... | Copy data from a source stream to destFile.
Return true if succeed, return false if failed. | [
"Copy",
"data",
"from",
"a",
"source",
"stream",
"to",
"destFile",
".",
"Return",
"true",
"if",
"succeed",
"return",
"false",
"if",
"failed",
"."
] | train | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Shared/src/main/java/io/divide/shared/file/FileUtils.java#L94-L110 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java | ComponentCollision.removePoint | private void removePoint(Point point, Collidable collidable, Map<Point, Set<Collidable>> elements, Integer group) {
"""
Remove point. Remove list of no more collidable.
@param point The point to remove.
@param collidable The associated collidable.
@param elements The current group elements.
@param group The ... | java | private void removePoint(Point point, Collidable collidable, Map<Point, Set<Collidable>> elements, Integer group)
{
final Set<Collidable> points = elements.get(point);
points.remove(collidable);
if (points.isEmpty())
{
elements.remove(point);
}
if (element... | [
"private",
"void",
"removePoint",
"(",
"Point",
"point",
",",
"Collidable",
"collidable",
",",
"Map",
"<",
"Point",
",",
"Set",
"<",
"Collidable",
">",
">",
"elements",
",",
"Integer",
"group",
")",
"{",
"final",
"Set",
"<",
"Collidable",
">",
"points",
... | Remove point. Remove list of no more collidable.
@param point The point to remove.
@param collidable The associated collidable.
@param elements The current group elements.
@param group The current group. | [
"Remove",
"point",
".",
"Remove",
"list",
"of",
"no",
"more",
"collidable",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java#L88-L100 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/av/FullFrameRect.java | FullFrameRect.adjustForVerticalVideo | public void adjustForVerticalVideo(SCREEN_ROTATION orientation, boolean scaleToFit) {
"""
Adjust the MVP Matrix to rotate and crop the texture
to make vertical video appear upright
"""
synchronized (mDrawLock) {
mCorrectVerticalVideo = true;
mScaleToFit = scaleToFit;
... | java | public void adjustForVerticalVideo(SCREEN_ROTATION orientation, boolean scaleToFit) {
synchronized (mDrawLock) {
mCorrectVerticalVideo = true;
mScaleToFit = scaleToFit;
requestedOrientation = orientation;
Matrix.setIdentityM(IDENTITY_MATRIX, 0);
switch... | [
"public",
"void",
"adjustForVerticalVideo",
"(",
"SCREEN_ROTATION",
"orientation",
",",
"boolean",
"scaleToFit",
")",
"{",
"synchronized",
"(",
"mDrawLock",
")",
"{",
"mCorrectVerticalVideo",
"=",
"true",
";",
"mScaleToFit",
"=",
"scaleToFit",
";",
"requestedOrientati... | Adjust the MVP Matrix to rotate and crop the texture
to make vertical video appear upright | [
"Adjust",
"the",
"MVP",
"Matrix",
"to",
"rotate",
"and",
"crop",
"the",
"texture",
"to",
"make",
"vertical",
"video",
"appear",
"upright"
] | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/FullFrameRect.java#L70-L100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.