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-gwt/org/opencms/gwt/client/ui/CmsPushButton.java | CmsPushButton.setButtonStyle | public void setButtonStyle(I_CmsButton.ButtonStyle style, I_CmsButton.ButtonColor color) {
"""
Sets the button style.<p>
@param style the style to set
@param color the color to set
"""
if (m_buttonStyle != null) {
for (String styleName : m_buttonStyle.getAdditionalClasses()) {
... | java | public void setButtonStyle(I_CmsButton.ButtonStyle style, I_CmsButton.ButtonColor color) {
if (m_buttonStyle != null) {
for (String styleName : m_buttonStyle.getAdditionalClasses()) {
removeStyleName(styleName);
}
}
if (style == ButtonStyle.TRANSPARENT) {... | [
"public",
"void",
"setButtonStyle",
"(",
"I_CmsButton",
".",
"ButtonStyle",
"style",
",",
"I_CmsButton",
".",
"ButtonColor",
"color",
")",
"{",
"if",
"(",
"m_buttonStyle",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"styleName",
":",
"m_buttonStyle",
".",
... | Sets the button style.<p>
@param style the style to set
@param color the color to set | [
"Sets",
"the",
"button",
"style",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsPushButton.java#L278-L298 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/util/BatchWorkUnit.java | BatchWorkUnit.threadBegin | protected void threadBegin() {
"""
All the beginning of thread processing.
Note we are going to fail fast out of here and fail the execution upon experiencing any exception.
"""
//
// Note the 'beforeCallbacks' list is not going to have a well-defined order, so it is of limited use.
... | java | protected void threadBegin() {
//
// Note the 'beforeCallbacks' list is not going to have a well-defined order, so it is of limited use.
// We probably want to revisit this with some kind of priority/order based on ranking to make
// it more useful.
//
// At the moment we... | [
"protected",
"void",
"threadBegin",
"(",
")",
"{",
"//",
"// Note the 'beforeCallbacks' list is not going to have a well-defined order, so it is of limited use.",
"// We probably want to revisit this with some kind of priority/order based on ranking to make",
"// it more useful.",
"//",
"// At... | All the beginning of thread processing.
Note we are going to fail fast out of here and fail the execution upon experiencing any exception. | [
"All",
"the",
"beginning",
"of",
"thread",
"processing",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/util/BatchWorkUnit.java#L171-L197 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_databaseAvailableVersion_GET | public OvhAvailableVersionStruct serviceName_databaseAvailableVersion_GET(String serviceName, OvhDatabaseTypeEnum type) throws IOException {
"""
List available database version following a type
REST: GET /hosting/web/{serviceName}/databaseAvailableVersion
@param type [required] Type of the database
@param ser... | java | public OvhAvailableVersionStruct serviceName_databaseAvailableVersion_GET(String serviceName, OvhDatabaseTypeEnum type) throws IOException {
String qPath = "/hosting/web/{serviceName}/databaseAvailableVersion";
StringBuilder sb = path(qPath, serviceName);
query(sb, "type", type);
String resp = exec(qPath, "GET"... | [
"public",
"OvhAvailableVersionStruct",
"serviceName_databaseAvailableVersion_GET",
"(",
"String",
"serviceName",
",",
"OvhDatabaseTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/databaseAvailableVersion\"",
";",
"StringB... | List available database version following a type
REST: GET /hosting/web/{serviceName}/databaseAvailableVersion
@param type [required] Type of the database
@param serviceName [required] The internal name of your hosting | [
"List",
"available",
"database",
"version",
"following",
"a",
"type"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L753-L759 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java | SparkUtils.readStringFromFile | public static String readStringFromFile(String path, Configuration hadoopConfig) throws IOException {
"""
Read a UTF-8 format String from HDFS (or local)
@param path Path to write the string
@param hadoopConfig Hadoop configuration, for example from SparkContext.hadoopConfiguration()
"""
Fi... | java | public static String readStringFromFile(String path, Configuration hadoopConfig) throws IOException {
FileSystem fileSystem = FileSystem.get(hadoopConfig);
try (BufferedInputStream bis = new BufferedInputStream(fileSystem.open(new Path(path)))) {
byte[] asBytes = IOUtils.toByteArray(bis);
... | [
"public",
"static",
"String",
"readStringFromFile",
"(",
"String",
"path",
",",
"Configuration",
"hadoopConfig",
")",
"throws",
"IOException",
"{",
"FileSystem",
"fileSystem",
"=",
"FileSystem",
".",
"get",
"(",
"hadoopConfig",
")",
";",
"try",
"(",
"BufferedInput... | Read a UTF-8 format String from HDFS (or local)
@param path Path to write the string
@param hadoopConfig Hadoop configuration, for example from SparkContext.hadoopConfiguration() | [
"Read",
"a",
"UTF",
"-",
"8",
"format",
"String",
"from",
"HDFS",
"(",
"or",
"local",
")"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java#L129-L135 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/model/ApplicationTemplateDescriptor.java | ApplicationTemplateDescriptor.getLegacyProperty | static String getLegacyProperty( Properties props, String property, String defaultValue ) {
"""
Gets a property value while supporting legacy ones.
@param props non-null properties
@param property a non-null property name (not legacy)
@param defaultValue the default value if the property is not found
@return a... | java | static String getLegacyProperty( Properties props, String property, String defaultValue ) {
String result = props.getProperty( property, null );
if( result == null )
result = props.getProperty( LEGACY_PREFIX + property, defaultValue );
return result;
} | [
"static",
"String",
"getLegacyProperty",
"(",
"Properties",
"props",
",",
"String",
"property",
",",
"String",
"defaultValue",
")",
"{",
"String",
"result",
"=",
"props",
".",
"getProperty",
"(",
"property",
",",
"null",
")",
";",
"if",
"(",
"result",
"==",
... | Gets a property value while supporting legacy ones.
@param props non-null properties
@param property a non-null property name (not legacy)
@param defaultValue the default value if the property is not found
@return a non-null string if the property was found, the default value otherwise | [
"Gets",
"a",
"property",
"value",
"while",
"supporting",
"legacy",
"ones",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/ApplicationTemplateDescriptor.java#L315-L322 |
Samsung/GearVRf | GVRf/Extensions/MixedReality/src/main/java/org/gearvrf/mixedreality/arcore/ARCoreSession.java | ARCoreSession.onHostAnchor | @Override
synchronized protected void onHostAnchor(GVRAnchor anchor, CloudAnchorCallback cb) {
"""
This method hosts an anchor. The {@code listener} will be invoked when the results are
available.
"""
Anchor newAnchor = mSession.hostCloudAnchor(((ARCoreAnchor) anchor).getAnchorAR());
pendi... | java | @Override
synchronized protected void onHostAnchor(GVRAnchor anchor, CloudAnchorCallback cb) {
Anchor newAnchor = mSession.hostCloudAnchor(((ARCoreAnchor) anchor).getAnchorAR());
pendingAnchors.put(newAnchor, cb);
} | [
"@",
"Override",
"synchronized",
"protected",
"void",
"onHostAnchor",
"(",
"GVRAnchor",
"anchor",
",",
"CloudAnchorCallback",
"cb",
")",
"{",
"Anchor",
"newAnchor",
"=",
"mSession",
".",
"hostCloudAnchor",
"(",
"(",
"(",
"ARCoreAnchor",
")",
"anchor",
")",
".",
... | This method hosts an anchor. The {@code listener} will be invoked when the results are
available. | [
"This",
"method",
"hosts",
"an",
"anchor",
".",
"The",
"{"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/MixedReality/src/main/java/org/gearvrf/mixedreality/arcore/ARCoreSession.java#L443-L447 |
stephenc/simple-java-mail | src/main/java/org/codemonkey/simplejavamail/Mailer.java | Mailer.setEmbeddedImages | private void setEmbeddedImages(final Email email, final MimeMultipart multipartRelated)
throws MessagingException {
"""
Fills the {@link Message} instance with the embedded images from the {@link Email}.
@param email The message in which the embedded images are defined.
@param multipartRelated The branch i... | java | private void setEmbeddedImages(final Email email, final MimeMultipart multipartRelated)
throws MessagingException {
for (final AttachmentResource embeddedImage : email.getEmbeddedImages()) {
multipartRelated.addBodyPart(getBodyPartFromDatasource(embeddedImage, Part.INLINE));
}
} | [
"private",
"void",
"setEmbeddedImages",
"(",
"final",
"Email",
"email",
",",
"final",
"MimeMultipart",
"multipartRelated",
")",
"throws",
"MessagingException",
"{",
"for",
"(",
"final",
"AttachmentResource",
"embeddedImage",
":",
"email",
".",
"getEmbeddedImages",
"("... | Fills the {@link Message} instance with the embedded images from the {@link Email}.
@param email The message in which the embedded images are defined.
@param multipartRelated The branch in the email structure in which we'll stuff the embedded images.
@throws MessagingException See {@link MimeMultipart#addBodyPart(Body... | [
"Fills",
"the",
"{",
"@link",
"Message",
"}",
"instance",
"with",
"the",
"embedded",
"images",
"from",
"the",
"{",
"@link",
"Email",
"}",
"."
] | train | https://github.com/stephenc/simple-java-mail/blob/8c5897e6bbc23c11e7c7eb5064f407625c653923/src/main/java/org/codemonkey/simplejavamail/Mailer.java#L344-L349 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/impl/AbstractMediaFileServlet.java | AbstractMediaFileServlet.getContentType | protected String getContentType(Resource resource, @SuppressWarnings("unused") SlingHttpServletRequest request) {
"""
Get content type from the reference nt:file or nt:resourcer resource.
@param resource Resource
@return Content type (never null)
"""
String mimeType = JcrBinary.getMimeType(resource);
... | java | protected String getContentType(Resource resource, @SuppressWarnings("unused") SlingHttpServletRequest request) {
String mimeType = JcrBinary.getMimeType(resource);
if (StringUtils.isEmpty(mimeType)) {
mimeType = ContentType.OCTET_STREAM;
}
return mimeType;
} | [
"protected",
"String",
"getContentType",
"(",
"Resource",
"resource",
",",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"SlingHttpServletRequest",
"request",
")",
"{",
"String",
"mimeType",
"=",
"JcrBinary",
".",
"getMimeType",
"(",
"resource",
")",
";",
"if",... | Get content type from the reference nt:file or nt:resourcer resource.
@param resource Resource
@return Content type (never null) | [
"Get",
"content",
"type",
"from",
"the",
"reference",
"nt",
":",
"file",
"or",
"nt",
":",
"resourcer",
"resource",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/impl/AbstractMediaFileServlet.java#L134-L140 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/AbstractIntIntMap.java | AbstractIntIntMap.pairsSortedByValue | public void pairsSortedByValue(final IntArrayList keyList, final IntArrayList valueList) {
"""
Fills all keys and values <i>sorted ascending by value</i> into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists both have a new size that equals <tt>this.size... | java | public void pairsSortedByValue(final IntArrayList keyList, final IntArrayList valueList) {
keys(keyList);
values(valueList);
final int[] k = keyList.elements();
final int[] v = valueList.elements();
cern.colt.Swapper swapper = new cern.colt.Swapper() {
public void swap(int a, int b) {
int t2; int t1... | [
"public",
"void",
"pairsSortedByValue",
"(",
"final",
"IntArrayList",
"keyList",
",",
"final",
"IntArrayList",
"valueList",
")",
"{",
"keys",
"(",
"keyList",
")",
";",
"values",
"(",
"valueList",
")",
";",
"final",
"int",
"[",
"]",
"k",
"=",
"keyList",
"."... | Fills all keys and values <i>sorted ascending by value</i> into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists both have a new size that equals <tt>this.size()</tt>.
Primary sort criterium is "value", secondary sort criterium is "key".
This means that if any ... | [
"Fills",
"all",
"keys",
"and",
"values",
"<i",
">",
"sorted",
"ascending",
"by",
"value<",
"/",
"i",
">",
"into",
"the",
"specified",
"lists",
".",
"Fills",
"into",
"the",
"lists",
"starting",
"at",
"index",
"0",
".",
"After",
"this",
"call",
"returns",
... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractIntIntMap.java#L302-L323 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/Analytics.java | Analytics.namespaceSharedPreferences | private void namespaceSharedPreferences() {
"""
Previously (until version 4.1.7) shared preferences were not namespaced by a tag. This meant
that all analytics instances shared the same shared preferences. This migration checks if the
namespaced shared preferences instance contains {@code namespaceSharedPreferen... | java | private void namespaceSharedPreferences() {
SharedPreferences newSharedPreferences = Utils.getSegmentSharedPreferences(application, tag);
BooleanPreference namespaceSharedPreferences =
new BooleanPreference(newSharedPreferences, "namespaceSharedPreferences", true);
if (namespaceSharedPreferences.ge... | [
"private",
"void",
"namespaceSharedPreferences",
"(",
")",
"{",
"SharedPreferences",
"newSharedPreferences",
"=",
"Utils",
".",
"getSegmentSharedPreferences",
"(",
"application",
",",
"tag",
")",
";",
"BooleanPreference",
"namespaceSharedPreferences",
"=",
"new",
"Boolean... | Previously (until version 4.1.7) shared preferences were not namespaced by a tag. This meant
that all analytics instances shared the same shared preferences. This migration checks if the
namespaced shared preferences instance contains {@code namespaceSharedPreferences: true}. If it
does, the migration is already run an... | [
"Previously",
"(",
"until",
"version",
"4",
".",
"1",
".",
"7",
")",
"shared",
"preferences",
"were",
"not",
"namespaced",
"by",
"a",
"tag",
".",
"This",
"meant",
"that",
"all",
"analytics",
"instances",
"shared",
"the",
"same",
"shared",
"preferences",
".... | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/Analytics.java#L1502-L1513 |
alkacon/opencms-core | src/org/opencms/db/CmsUserSettings.java | CmsUserSettings.setAdditionalPreference | public static void setAdditionalPreference(CmsObject cms, String key, String value) {
"""
Sets a configured preference.<p>
@param cms the Cms context
@param key the setting name
@param value the value
"""
CmsUser user = cms.getRequestContext().getCurrentUser();
CmsUserSettings settings = ... | java | public static void setAdditionalPreference(CmsObject cms, String key, String value) {
CmsUser user = cms.getRequestContext().getCurrentUser();
CmsUserSettings settings = new CmsUserSettings(user);
settings.setAdditionalPreference(key, value);
try {
settings.save(cms);
... | [
"public",
"static",
"void",
"setAdditionalPreference",
"(",
"CmsObject",
"cms",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"CmsUser",
"user",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getCurrentUser",
"(",
")",
";",
"CmsUserSettings",
... | Sets a configured preference.<p>
@param cms the Cms context
@param key the setting name
@param value the value | [
"Sets",
"a",
"configured",
"preference",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsUserSettings.java#L469-L479 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/parser/PdfContentReaderTool.java | PdfContentReaderTool.listContentStream | static public void listContentStream(File pdfFile, PrintWriter out) throws IOException {
"""
Writes information about each page in a PDF file to the specified output stream.
@since 2.1.5
@param pdfFile a File instance referring to a PDF file
@param out the output stream to send the content to
@throws IOE... | java | static public void listContentStream(File pdfFile, PrintWriter out) throws IOException {
PdfReader reader = new PdfReader(pdfFile.getCanonicalPath());
int maxPageNum = reader.getNumberOfPages();
for (int pageNum = 1; pageNum <= maxPageNum; pageNum++){
list... | [
"static",
"public",
"void",
"listContentStream",
"(",
"File",
"pdfFile",
",",
"PrintWriter",
"out",
")",
"throws",
"IOException",
"{",
"PdfReader",
"reader",
"=",
"new",
"PdfReader",
"(",
"pdfFile",
".",
"getCanonicalPath",
"(",
")",
")",
";",
"int",
"maxPageN... | Writes information about each page in a PDF file to the specified output stream.
@since 2.1.5
@param pdfFile a File instance referring to a PDF file
@param out the output stream to send the content to
@throws IOException | [
"Writes",
"information",
"about",
"each",
"page",
"in",
"a",
"PDF",
"file",
"to",
"the",
"specified",
"output",
"stream",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/parser/PdfContentReaderTool.java#L163-L172 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/operator/aggregation/histogram/ValueStore.java | ValueStore.addAndGetPosition | public int addAndGetPosition(Type type, Block block, int position, long valueHash) {
"""
This will add an item if not already in the system. It returns a pointer that is unique for multiple instances of the value. If item present,
returns the pointer into the system
"""
if (values.getPositionCount() >... | java | public int addAndGetPosition(Type type, Block block, int position, long valueHash)
{
if (values.getPositionCount() >= maxFill) {
rehash();
}
int bucketId = getBucketId(valueHash, mask);
int valuePointer;
// look for an empty slot or a slot containing this key
... | [
"public",
"int",
"addAndGetPosition",
"(",
"Type",
"type",
",",
"Block",
"block",
",",
"int",
"position",
",",
"long",
"valueHash",
")",
"{",
"if",
"(",
"values",
".",
"getPositionCount",
"(",
")",
">=",
"maxFill",
")",
"{",
"rehash",
"(",
")",
";",
"}... | This will add an item if not already in the system. It returns a pointer that is unique for multiple instances of the value. If item present,
returns the pointer into the system | [
"This",
"will",
"add",
"an",
"item",
"if",
"not",
"already",
"in",
"the",
"system",
".",
"It",
"returns",
"a",
"pointer",
"that",
"is",
"unique",
"for",
"multiple",
"instances",
"of",
"the",
"value",
".",
"If",
"item",
"present",
"returns",
"the",
"point... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/operator/aggregation/histogram/ValueStore.java#L71-L105 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/time/JMTimeUtil.java | JMTimeUtil.changeTimestampToLong | public static long changeTimestampToLong(String dateFormat,
String timestamp, String zoneId) {
"""
Change timestamp to long long.
@param dateFormat the date format
@param timestamp the timestamp
@param zoneId the zone id
@return the long
"""
return changeTimestampToLong(getSimple... | java | public static long changeTimestampToLong(String dateFormat,
String timestamp, String zoneId) {
return changeTimestampToLong(getSimpleDateFormat(dateFormat, zoneId),
timestamp);
} | [
"public",
"static",
"long",
"changeTimestampToLong",
"(",
"String",
"dateFormat",
",",
"String",
"timestamp",
",",
"String",
"zoneId",
")",
"{",
"return",
"changeTimestampToLong",
"(",
"getSimpleDateFormat",
"(",
"dateFormat",
",",
"zoneId",
")",
",",
"timestamp",
... | Change timestamp to long long.
@param dateFormat the date format
@param timestamp the timestamp
@param zoneId the zone id
@return the long | [
"Change",
"timestamp",
"to",
"long",
"long",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/time/JMTimeUtil.java#L554-L558 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/MessageUtils.java | MessageUtils.substituteParams | public static String substituteParams(Locale locale, String msgtext, Object params[]) {
"""
Uses <code>MessageFormat</code> and the supplied parameters to fill in the param placeholders in the String.
@param locale The <code>Locale</code> to use when performing the substitution.
@param msgtext The original par... | java | public static String substituteParams(Locale locale, String msgtext, Object params[])
{
String localizedStr = null;
if(params == null || msgtext == null)
{
return msgtext;
}
if(locale != null)
{
MessageFormat mf = new MessageFormat(msgtext,loc... | [
"public",
"static",
"String",
"substituteParams",
"(",
"Locale",
"locale",
",",
"String",
"msgtext",
",",
"Object",
"params",
"[",
"]",
")",
"{",
"String",
"localizedStr",
"=",
"null",
";",
"if",
"(",
"params",
"==",
"null",
"||",
"msgtext",
"==",
"null",
... | Uses <code>MessageFormat</code> and the supplied parameters to fill in the param placeholders in the String.
@param locale The <code>Locale</code> to use when performing the substitution.
@param msgtext The original parameterized String.
@param params The params to fill in the String with.
@return The updated String. | [
"Uses",
"<code",
">",
"MessageFormat<",
"/",
"code",
">",
"and",
"the",
"supplied",
"parameters",
"to",
"fill",
"in",
"the",
"param",
"placeholders",
"in",
"the",
"String",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/MessageUtils.java#L228-L242 |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java | ResourceClaim.relinquishResource | private void relinquishResource(ZooKeeper zookeeper, String poolNode, int resource) {
"""
Relinquish a claimed resource.
@param zookeeper ZooKeeper connection to use.
@param poolNode Path to the znode representing the resource pool.
@param resource The resource.
"""
logger.debug("Relinquishing cla... | java | private void relinquishResource(ZooKeeper zookeeper, String poolNode, int resource) {
logger.debug("Relinquishing claimed resource {}.", resource);
try {
zookeeper.delete(poolNode + "/" + Integer.toString(resource), -1);
} catch (InterruptedException e) {
Thread.currentTh... | [
"private",
"void",
"relinquishResource",
"(",
"ZooKeeper",
"zookeeper",
",",
"String",
"poolNode",
",",
"int",
"resource",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Relinquishing claimed resource {}.\"",
",",
"resource",
")",
";",
"try",
"{",
"zookeeper",
".",
"... | Relinquish a claimed resource.
@param zookeeper ZooKeeper connection to use.
@param poolNode Path to the znode representing the resource pool.
@param resource The resource. | [
"Relinquish",
"a",
"claimed",
"resource",
"."
] | train | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java#L388-L397 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java | RandomMatrices_DSCC.triangle | public static DMatrixSparseCSC triangle( boolean upper , int N , double minFill , double maxFill , Random rand ) {
"""
Creates a triangular matrix where the amount of fill is randomly selected too.
@param upper true for upper triangular and false for lower
@param N number of rows and columns
er * @param ... | java | public static DMatrixSparseCSC triangle( boolean upper , int N , double minFill , double maxFill , Random rand ) {
int nz = (int)(((N-1)*(N-1)/2)*(rand.nextDouble()*(maxFill-minFill)+minFill))+N;
if( upper ) {
return triangleUpper(N,0,nz,-1,1,rand);
} else {
return trian... | [
"public",
"static",
"DMatrixSparseCSC",
"triangle",
"(",
"boolean",
"upper",
",",
"int",
"N",
",",
"double",
"minFill",
",",
"double",
"maxFill",
",",
"Random",
"rand",
")",
"{",
"int",
"nz",
"=",
"(",
"int",
")",
"(",
"(",
"(",
"N",
"-",
"1",
")",
... | Creates a triangular matrix where the amount of fill is randomly selected too.
@param upper true for upper triangular and false for lower
@param N number of rows and columns
er * @param minFill minimum fill fraction
@param maxFill maximum fill fraction
@param rand random number generator
@return Random matrix | [
"Creates",
"a",
"triangular",
"matrix",
"where",
"the",
"amount",
"of",
"fill",
"is",
"randomly",
"selected",
"too",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java#L236-L244 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java | Operator.setResources | private O setResources(ResourceSpec minResources, ResourceSpec preferredResources) {
"""
Sets the minimum and preferred resources for this operator. This overrides the default resources.
The lower and upper resource limits will be considered in dynamic resource resize feature for future plan.
@param minResourc... | java | private O setResources(ResourceSpec minResources, ResourceSpec preferredResources) {
Preconditions.checkNotNull(minResources, "The min resources must be not null.");
Preconditions.checkNotNull(preferredResources, "The preferred resources must be not null.");
Preconditions.checkArgument(minResources.isValid() && ... | [
"private",
"O",
"setResources",
"(",
"ResourceSpec",
"minResources",
",",
"ResourceSpec",
"preferredResources",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"minResources",
",",
"\"The min resources must be not null.\"",
")",
";",
"Preconditions",
".",
"checkNotNu... | Sets the minimum and preferred resources for this operator. This overrides the default resources.
The lower and upper resource limits will be considered in dynamic resource resize feature for future plan.
@param minResources The minimum resources for this operator.
@param preferredResources The preferred resources for... | [
"Sets",
"the",
"minimum",
"and",
"preferred",
"resources",
"for",
"this",
"operator",
".",
"This",
"overrides",
"the",
"default",
"resources",
".",
"The",
"lower",
"and",
"upper",
"resource",
"limits",
"will",
"be",
"considered",
"in",
"dynamic",
"resource",
"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java#L145-L158 |
lightblueseas/email-tails | src/main/java/de/alpharogroup/email/messages/EmailWithAttachments.java | EmailWithAttachments.addAttachment | public void addAttachment(final File file, final String newFilename) throws MessagingException {
"""
Adds an attachment to the EmailMessage.
@param file
The file to add to the EmailMessage.
@param newFilename
The new Filename for the attachment.
@throws MessagingException
is thrown if the underlying impl... | java | public void addAttachment(final File file, final String newFilename) throws MessagingException
{
DataSource dataSource;
dataSource = new FileDataSource(file);
final DataHandler dataHandler = new DataHandler(dataSource);
addAttachment(dataHandler, newFilename);
} | [
"public",
"void",
"addAttachment",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"newFilename",
")",
"throws",
"MessagingException",
"{",
"DataSource",
"dataSource",
";",
"dataSource",
"=",
"new",
"FileDataSource",
"(",
"file",
")",
";",
"final",
"DataHa... | Adds an attachment to the EmailMessage.
@param file
The file to add to the EmailMessage.
@param newFilename
The new Filename for the attachment.
@throws MessagingException
is thrown if the underlying implementation does not support modification of
existing values | [
"Adds",
"an",
"attachment",
"to",
"the",
"EmailMessage",
"."
] | train | https://github.com/lightblueseas/email-tails/blob/7be6fee3548e61e697cc8e64e90603cb1f505be2/src/main/java/de/alpharogroup/email/messages/EmailWithAttachments.java#L156-L162 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/Nodes.java | Nodes.getNodesDir | private File getNodesDir() throws IOException {
"""
Returns the directory that the nodes are stored in.
@return the directory that the nodes are stored in.
@throws IOException
"""
final File nodesDir = new File(jenkins.getRootDir(), "nodes");
if (!nodesDir.isDirectory() && !nodesDir.mkdirs(... | java | private File getNodesDir() throws IOException {
final File nodesDir = new File(jenkins.getRootDir(), "nodes");
if (!nodesDir.isDirectory() && !nodesDir.mkdirs()) {
throw new IOException(String.format("Could not mkdirs %s", nodesDir));
}
return nodesDir;
} | [
"private",
"File",
"getNodesDir",
"(",
")",
"throws",
"IOException",
"{",
"final",
"File",
"nodesDir",
"=",
"new",
"File",
"(",
"jenkins",
".",
"getRootDir",
"(",
")",
",",
"\"nodes\"",
")",
";",
"if",
"(",
"!",
"nodesDir",
".",
"isDirectory",
"(",
")",
... | Returns the directory that the nodes are stored in.
@return the directory that the nodes are stored in.
@throws IOException | [
"Returns",
"the",
"directory",
"that",
"the",
"nodes",
"are",
"stored",
"in",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Nodes.java#L360-L366 |
venmo/cursor-utils | cursor-utils/src/main/java/com/venmo/cursor/CursorUtils.java | CursorUtils.consumeToArrayList | public static <T> ArrayList<T> consumeToArrayList(IterableCursor<T> cursor) {
"""
Returns an {@link java.util.ArrayList} of the {@link android.database.Cursor} and closes it.
"""
return consumeToCollection(cursor, new ArrayList<T>(cursor.getCount()));
} | java | public static <T> ArrayList<T> consumeToArrayList(IterableCursor<T> cursor) {
return consumeToCollection(cursor, new ArrayList<T>(cursor.getCount()));
} | [
"public",
"static",
"<",
"T",
">",
"ArrayList",
"<",
"T",
">",
"consumeToArrayList",
"(",
"IterableCursor",
"<",
"T",
">",
"cursor",
")",
"{",
"return",
"consumeToCollection",
"(",
"cursor",
",",
"new",
"ArrayList",
"<",
"T",
">",
"(",
"cursor",
".",
"ge... | Returns an {@link java.util.ArrayList} of the {@link android.database.Cursor} and closes it. | [
"Returns",
"an",
"{"
] | train | https://github.com/venmo/cursor-utils/blob/52cf91c4253346632fe70b8d7b7eab8bbcc9b248/cursor-utils/src/main/java/com/venmo/cursor/CursorUtils.java#L42-L44 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java | Item.withNumber | public Item withNumber(String attrName, Number val) {
"""
Sets the value of the specified attribute in the current item to the
given value.
"""
checkInvalidAttribute(attrName, val);
attributes.put(attrName, toBigDecimal(val));
return this;
} | java | public Item withNumber(String attrName, Number val) {
checkInvalidAttribute(attrName, val);
attributes.put(attrName, toBigDecimal(val));
return this;
} | [
"public",
"Item",
"withNumber",
"(",
"String",
"attrName",
",",
"Number",
"val",
")",
"{",
"checkInvalidAttribute",
"(",
"attrName",
",",
"val",
")",
";",
"attributes",
".",
"put",
"(",
"attrName",
",",
"toBigDecimal",
"(",
"val",
")",
")",
";",
"return",
... | Sets the value of the specified attribute in the current item to the
given value. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"attribute",
"in",
"the",
"current",
"item",
"to",
"the",
"given",
"value",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java#L277-L281 |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/serialization/AvroUtils.java | AvroUtils.toBytes | static <T> byte[] toBytes(final T avroObject, final Class<T> theClass) {
"""
Serializes the given avro object to a byte[].
@param avroObject
@param theClass
@param <T>
@return
"""
final DatumWriter<T> datumWriter = new SpecificDatumWriter<>(theClass);
final byte[] theBytes;
try (final ByteArr... | java | static <T> byte[] toBytes(final T avroObject, final Class<T> theClass) {
final DatumWriter<T> datumWriter = new SpecificDatumWriter<>(theClass);
final byte[] theBytes;
try (final ByteArrayOutputStream out = new ByteArrayOutputStream()) {
final BinaryEncoder encoder = EncoderFactory.get().binaryEncoder... | [
"static",
"<",
"T",
">",
"byte",
"[",
"]",
"toBytes",
"(",
"final",
"T",
"avroObject",
",",
"final",
"Class",
"<",
"T",
">",
"theClass",
")",
"{",
"final",
"DatumWriter",
"<",
"T",
">",
"datumWriter",
"=",
"new",
"SpecificDatumWriter",
"<>",
"(",
"theC... | Serializes the given avro object to a byte[].
@param avroObject
@param theClass
@param <T>
@return | [
"Serializes",
"the",
"given",
"avro",
"object",
"to",
"a",
"byte",
"[]",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/serialization/AvroUtils.java#L44-L57 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/favorites/FavoritesInterface.java | FavoritesInterface.getContext | public PhotoContext getContext(String photoId, String userId) throws FlickrException {
"""
Returns next and previous favorites for a photo in a user's favorites
@param photoId
The photo id
@param userId
The user's ID
@see <a href="http://www.flickr.com/services/api/flickr.favorites.getContext.html">flickr.f... | java | public PhotoContext getContext(String photoId, String userId) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_GET_CONTEXT);
parameters.put("photo_id", photoId);
parameters.put("user_id", userId);
Re... | [
"public",
"PhotoContext",
"getContext",
"(",
"String",
"photoId",
",",
"String",
"userId",
")",
"throws",
"FlickrException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";... | Returns next and previous favorites for a photo in a user's favorites
@param photoId
The photo id
@param userId
The user's ID
@see <a href="http://www.flickr.com/services/api/flickr.favorites.getContext.html">flickr.favorites.getContext</a> | [
"Returns",
"next",
"and",
"previous",
"favorites",
"for",
"a",
"photo",
"in",
"a",
"user",
"s",
"favorites"
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/favorites/FavoritesInterface.java#L203-L234 |
VoltDB/voltdb | src/frontend/org/voltdb/exportclient/ExportEncoder.java | ExportEncoder.encodeDecimal | static public void encodeDecimal(final FastSerializer fs, BigDecimal value)
throws IOException {
"""
Read a decimal according to the Export encoding specification.
@param fds
Fastdeserializer containing Export stream data
@return decoded BigDecimal value
@throws IOException
"""
fs.write((byte... | java | static public void encodeDecimal(final FastSerializer fs, BigDecimal value)
throws IOException {
fs.write((byte)VoltDecimalHelper.kDefaultScale);
fs.write((byte)16);
fs.write(VoltDecimalHelper.serializeBigDecimal(value));
} | [
"static",
"public",
"void",
"encodeDecimal",
"(",
"final",
"FastSerializer",
"fs",
",",
"BigDecimal",
"value",
")",
"throws",
"IOException",
"{",
"fs",
".",
"write",
"(",
"(",
"byte",
")",
"VoltDecimalHelper",
".",
"kDefaultScale",
")",
";",
"fs",
".",
"writ... | Read a decimal according to the Export encoding specification.
@param fds
Fastdeserializer containing Export stream data
@return decoded BigDecimal value
@throws IOException | [
"Read",
"a",
"decimal",
"according",
"to",
"the",
"Export",
"encoding",
"specification",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/exportclient/ExportEncoder.java#L222-L227 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java | SDNN.relu | public SDVariable relu(String name, SDVariable x, double cutoff) {
"""
Element-wise rectified linear function with specified cutoff:<br>
out[i] = in[i] if in[i] >= cutoff
out[i] = 0 otherwise
@param name Output variable name
@param x Input variable
@param cutoff Cutoff value. Usually 0
@return Outpu... | java | public SDVariable relu(String name, SDVariable x, double cutoff) {
validateFloatingPoint("ReLU", x);
SDVariable result = f().relu(x, cutoff);
return updateVariableNameAndReference(result, name);
} | [
"public",
"SDVariable",
"relu",
"(",
"String",
"name",
",",
"SDVariable",
"x",
",",
"double",
"cutoff",
")",
"{",
"validateFloatingPoint",
"(",
"\"ReLU\"",
",",
"x",
")",
";",
"SDVariable",
"result",
"=",
"f",
"(",
")",
".",
"relu",
"(",
"x",
",",
"cut... | Element-wise rectified linear function with specified cutoff:<br>
out[i] = in[i] if in[i] >= cutoff
out[i] = 0 otherwise
@param name Output variable name
@param x Input variable
@param cutoff Cutoff value. Usually 0
@return Output variable | [
"Element",
"-",
"wise",
"rectified",
"linear",
"function",
"with",
"specified",
"cutoff",
":",
"<br",
">",
"out",
"[",
"i",
"]",
"=",
"in",
"[",
"i",
"]",
"if",
"in",
"[",
"i",
"]",
">",
"=",
"cutoff",
"out",
"[",
"i",
"]",
"=",
"0",
"otherwise"
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java#L421-L425 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_acl_accountId_GET | public OvhAcl project_serviceName_acl_accountId_GET(String serviceName, String accountId) throws IOException {
"""
Get this object properties
REST: GET /cloud/project/{serviceName}/acl/{accountId}
@param serviceName [required] The project id
@param accountId [required] OVH customer unique identifier
"""
... | java | public OvhAcl project_serviceName_acl_accountId_GET(String serviceName, String accountId) throws IOException {
String qPath = "/cloud/project/{serviceName}/acl/{accountId}";
StringBuilder sb = path(qPath, serviceName, accountId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhA... | [
"public",
"OvhAcl",
"project_serviceName_acl_accountId_GET",
"(",
"String",
"serviceName",
",",
"String",
"accountId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/acl/{accountId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"... | Get this object properties
REST: GET /cloud/project/{serviceName}/acl/{accountId}
@param serviceName [required] The project id
@param accountId [required] OVH customer unique identifier | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L320-L325 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.createSliderThumbDiscrete | public Shape createSliderThumbDiscrete(final int x, final int y, final int w, final int h, final CornerSize size) {
"""
Return a path for a discrete slider thumb's concentric sections.
@param x the X coordinate of the upper-left corner of the section
@param y the Y coordinate of the upper-left corner o... | java | public Shape createSliderThumbDiscrete(final int x, final int y, final int w, final int h, final CornerSize size) {
final double topArc = size.getRadius(w, h);
final double bottomArcH = size == CornerSize.INTERIOR ? 0 : 1;
final double bottomArcW = 3;
path.reset();
path.move... | [
"public",
"Shape",
"createSliderThumbDiscrete",
"(",
"final",
"int",
"x",
",",
"final",
"int",
"y",
",",
"final",
"int",
"w",
",",
"final",
"int",
"h",
",",
"final",
"CornerSize",
"size",
")",
"{",
"final",
"double",
"topArc",
"=",
"size",
".",
"getRadiu... | Return a path for a discrete slider thumb's concentric sections.
@param x the X coordinate of the upper-left corner of the section
@param y the Y coordinate of the upper-left corner of the section
@param w the width of the section
@param h the height of the section
@param size the CornerSize represent... | [
"Return",
"a",
"path",
"for",
"a",
"discrete",
"slider",
"thumb",
"s",
"concentric",
"sections",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L528-L544 |
samskivert/samskivert | src/main/java/com/samskivert/velocity/I18nTool.java | I18nTool.xlate | public String xlate (String key, Object arg1, Object arg2) {
"""
Looks up the specified message and creates the translation string
using the supplied arguments.
"""
return _msgmgr.getMessage(_req, key, new Object[] { arg1, arg2 });
} | java | public String xlate (String key, Object arg1, Object arg2)
{
return _msgmgr.getMessage(_req, key, new Object[] { arg1, arg2 });
} | [
"public",
"String",
"xlate",
"(",
"String",
"key",
",",
"Object",
"arg1",
",",
"Object",
"arg2",
")",
"{",
"return",
"_msgmgr",
".",
"getMessage",
"(",
"_req",
",",
"key",
",",
"new",
"Object",
"[",
"]",
"{",
"arg1",
",",
"arg2",
"}",
")",
";",
"}"... | Looks up the specified message and creates the translation string
using the supplied arguments. | [
"Looks",
"up",
"the",
"specified",
"message",
"and",
"creates",
"the",
"translation",
"string",
"using",
"the",
"supplied",
"arguments",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/I18nTool.java#L80-L83 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java | CmsDefaultXmlContentHandler.initVisibilities | protected void initVisibilities(Element root, CmsXmlContentDefinition contentDefinition) {
"""
Initializes the content visibility settings.<p>
@param root the visibilities appinfo element
@param contentDefinition the content definition
"""
m_visibilityConfigurations = new HashMap<String, Visibilit... | java | protected void initVisibilities(Element root, CmsXmlContentDefinition contentDefinition) {
m_visibilityConfigurations = new HashMap<String, VisibilityConfiguration>();
String mainHandlerClassName = root.attributeValue(APPINFO_ATTR_CLASS);
// using self as the default visibility handler implemen... | [
"protected",
"void",
"initVisibilities",
"(",
"Element",
"root",
",",
"CmsXmlContentDefinition",
"contentDefinition",
")",
"{",
"m_visibilityConfigurations",
"=",
"new",
"HashMap",
"<",
"String",
",",
"VisibilityConfiguration",
">",
"(",
")",
";",
"String",
"mainHandl... | Initializes the content visibility settings.<p>
@param root the visibilities appinfo element
@param contentDefinition the content definition | [
"Initializes",
"the",
"content",
"visibility",
"settings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L3227-L3262 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.stringTemplate | @Deprecated
public static StringTemplate stringTemplate(Template template, ImmutableList<?> args) {
"""
Create a new Template expression
@deprecated Use {@link #stringTemplate(Template, List)} instead.
@param template template
@param args template parameters
@return template expression
"""
... | java | @Deprecated
public static StringTemplate stringTemplate(Template template, ImmutableList<?> args) {
return new StringTemplate(template, args);
} | [
"@",
"Deprecated",
"public",
"static",
"StringTemplate",
"stringTemplate",
"(",
"Template",
"template",
",",
"ImmutableList",
"<",
"?",
">",
"args",
")",
"{",
"return",
"new",
"StringTemplate",
"(",
"template",
",",
"args",
")",
";",
"}"
] | Create a new Template expression
@deprecated Use {@link #stringTemplate(Template, List)} instead.
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L937-L940 |
google/closure-compiler | src/com/google/javascript/jscomp/VariableMap.java | VariableMap.fromBytes | @GwtIncompatible("com.google.common.base.Splitter.onPattern()")
public static VariableMap fromBytes(byte[] bytes) throws ParseException {
"""
Deserializes the variable map from a byte array returned by
{@link #toBytes()}.
"""
String string = new String(bytes, UTF_8);
ImmutableMap.Builder<String, Str... | java | @GwtIncompatible("com.google.common.base.Splitter.onPattern()")
public static VariableMap fromBytes(byte[] bytes) throws ParseException {
String string = new String(bytes, UTF_8);
ImmutableMap.Builder<String, String> map = ImmutableMap.builder();
int startOfLine = 0;
while (startOfLine < string.length... | [
"@",
"GwtIncompatible",
"(",
"\"com.google.common.base.Splitter.onPattern()\"",
")",
"public",
"static",
"VariableMap",
"fromBytes",
"(",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"ParseException",
"{",
"String",
"string",
"=",
"new",
"String",
"(",
"bytes",
",",
... | Deserializes the variable map from a byte array returned by
{@link #toBytes()}. | [
"Deserializes",
"the",
"variable",
"map",
"from",
"a",
"byte",
"array",
"returned",
"by",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/VariableMap.java#L128-L156 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java | TwoPhaseAnnotationProcessor.printWarning | public void printWarning( Declaration d, String id, Object... args ) {
"""
Report a warning detected during the "check" phase. The presence of warnings
will not affect execution of the "generate" phase.
"""
addWarning( d, id, args );
} | java | public void printWarning( Declaration d, String id, Object... args )
{
addWarning( d, id, args );
} | [
"public",
"void",
"printWarning",
"(",
"Declaration",
"d",
",",
"String",
"id",
",",
"Object",
"...",
"args",
")",
"{",
"addWarning",
"(",
"d",
",",
"id",
",",
"args",
")",
";",
"}"
] | Report a warning detected during the "check" phase. The presence of warnings
will not affect execution of the "generate" phase. | [
"Report",
"a",
"warning",
"detected",
"during",
"the",
"check",
"phase",
".",
"The",
"presence",
"of",
"warnings",
"will",
"not",
"affect",
"execution",
"of",
"the",
"generate",
"phase",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java#L166-L169 |
SourcePond/fileobserver | fileobserver-impl/src/main/java/ch/sourcepond/io/fileobserver/impl/fs/DirectoryRegistrationWalker.java | DirectoryRegistrationWalker.rootAdded | void rootAdded(final EventDispatcher pDispatcher, final Directory pNewRoot) {
"""
Registers the directory specified and all its sub-directories with the watch-service held by this object.
Additionally, it passes any detected file to {@link PathChangeListener#modified(PathChangeEvent)} to the listeners
specified.... | java | void rootAdded(final EventDispatcher pDispatcher, final Directory pNewRoot) {
directoryCreated(pDispatcher, pNewRoot, pNewRoot.getPath());
} | [
"void",
"rootAdded",
"(",
"final",
"EventDispatcher",
"pDispatcher",
",",
"final",
"Directory",
"pNewRoot",
")",
"{",
"directoryCreated",
"(",
"pDispatcher",
",",
"pNewRoot",
",",
"pNewRoot",
".",
"getPath",
"(",
")",
")",
";",
"}"
] | Registers the directory specified and all its sub-directories with the watch-service held by this object.
Additionally, it passes any detected file to {@link PathChangeListener#modified(PathChangeEvent)} to the listeners
specified.
@param pNewRoot Newly created directory, must not be {@code null} | [
"Registers",
"the",
"directory",
"specified",
"and",
"all",
"its",
"sub",
"-",
"directories",
"with",
"the",
"watch",
"-",
"service",
"held",
"by",
"this",
"object",
".",
"Additionally",
"it",
"passes",
"any",
"detected",
"file",
"to",
"{",
"@link",
"PathCha... | train | https://github.com/SourcePond/fileobserver/blob/dfb3055ed35759a47f52f6cfdea49879c415fd6b/fileobserver-impl/src/main/java/ch/sourcepond/io/fileobserver/impl/fs/DirectoryRegistrationWalker.java#L111-L113 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/SequenceTools.java | SequenceTools.permuteCyclic | public static <T> void permuteCyclic(T[] array, T[] fill, int n) {
"""
Cyclically permute {@code array} <em>forward</em> by {@code n} elements.
@param array The original result; will not be changed
@param fill The permuted result will be filled into this array
@param n The number of elements to permute by; can ... | java | public static <T> void permuteCyclic(T[] array, T[] fill, int n) {
if (array.length != fill.length) throw new IllegalArgumentException("Lengths do not match");
if (n < 0) n = array.length + n;
while (n > array.length) {
n -= array.length;
}
for (int i = 0; i < array.length; i++) {
if (i + n < array.leng... | [
"public",
"static",
"<",
"T",
">",
"void",
"permuteCyclic",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"[",
"]",
"fill",
",",
"int",
"n",
")",
"{",
"if",
"(",
"array",
".",
"length",
"!=",
"fill",
".",
"length",
")",
"throw",
"new",
"IllegalArgumentExc... | Cyclically permute {@code array} <em>forward</em> by {@code n} elements.
@param array The original result; will not be changed
@param fill The permuted result will be filled into this array
@param n The number of elements to permute by; can be positive or negative; values greater than the length of the array are accept... | [
"Cyclically",
"permute",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/SequenceTools.java#L59-L72 |
crowmagnumb/s6-util | src/main/java/net/crowmagnumb/util/net/AbstractMultipartUtility.java | AbstractMultipartUtility.addHeaderField | public void addHeaderField(final String name, final String value) {
"""
Adds a header field to the request.
@param name - name of the header field
@param value - value of the header field
"""
writer.append(name + ": " + value).append(LINE_FEED);
writer.flush();
} | java | public void addHeaderField(final String name, final String value)
{
writer.append(name + ": " + value).append(LINE_FEED);
writer.flush();
} | [
"public",
"void",
"addHeaderField",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"writer",
".",
"append",
"(",
"name",
"+",
"\": \"",
"+",
"value",
")",
".",
"append",
"(",
"LINE_FEED",
")",
";",
"writer",
".",
"flush",
"(... | Adds a header field to the request.
@param name - name of the header field
@param value - value of the header field | [
"Adds",
"a",
"header",
"field",
"to",
"the",
"request",
"."
] | train | https://github.com/crowmagnumb/s6-util/blob/0f9969bc0809e8a617501fa57c135e9b3984fae0/src/main/java/net/crowmagnumb/util/net/AbstractMultipartUtility.java#L134-L138 |
glookast/commons-timecode | src/main/java/com/glookast/commons/timecode/Timecode.java | Timecode.valueOf | public static Timecode valueOf(String timecode, int timecodeBase) throws IllegalArgumentException {
"""
Returns a Timecode instance for given timecode string and timecode base. Acceptable inputs are
the normal representation HH:MM:SS:FF for non drop frame and HH:MM:SS:FF for drop frame
@param timecode
@param ... | java | public static Timecode valueOf(String timecode, int timecodeBase) throws IllegalArgumentException
{
return valueOf(timecode, timecodeBase, StringType.NORMAL);
} | [
"public",
"static",
"Timecode",
"valueOf",
"(",
"String",
"timecode",
",",
"int",
"timecodeBase",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"valueOf",
"(",
"timecode",
",",
"timecodeBase",
",",
"StringType",
".",
"NORMAL",
")",
";",
"}"
] | Returns a Timecode instance for given timecode string and timecode base. Acceptable inputs are
the normal representation HH:MM:SS:FF for non drop frame and HH:MM:SS:FF for drop frame
@param timecode
@param timecodeBase
@return the timecode
@throws IllegalArgumentException | [
"Returns",
"a",
"Timecode",
"instance",
"for",
"given",
"timecode",
"string",
"and",
"timecode",
"base",
".",
"Acceptable",
"inputs",
"are",
"the",
"normal",
"representation",
"HH",
":",
"MM",
":",
"SS",
":",
"FF",
"for",
"non",
"drop",
"frame",
"and",
"HH... | train | https://github.com/glookast/commons-timecode/blob/ec2f682a51d1cc435d0b42d80de48ff15adb4ee8/src/main/java/com/glookast/commons/timecode/Timecode.java#L97-L100 |
HubSpot/jinjava | src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java | JinjavaInterpreter.resolveProperty | public Object resolveProperty(Object object, List<String> propertyNames) {
"""
Resolve property of bean.
@param object
Bean.
@param propertyNames
Names of properties to resolve recursively.
@return Value of property.
"""
return expressionResolver.resolveProperty(object, propertyNames);
} | java | public Object resolveProperty(Object object, List<String> propertyNames) {
return expressionResolver.resolveProperty(object, propertyNames);
} | [
"public",
"Object",
"resolveProperty",
"(",
"Object",
"object",
",",
"List",
"<",
"String",
">",
"propertyNames",
")",
"{",
"return",
"expressionResolver",
".",
"resolveProperty",
"(",
"object",
",",
"propertyNames",
")",
";",
"}"
] | Resolve property of bean.
@param object
Bean.
@param propertyNames
Names of properties to resolve recursively.
@return Value of property. | [
"Resolve",
"property",
"of",
"bean",
"."
] | train | https://github.com/HubSpot/jinjava/blob/ce570935630f49c666170d2330b0b9ba4eddb955/src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java#L446-L448 |
ineunetOS/knife-commons | knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java | StringUtils.lastIndexOfIgnoreCase | public static int lastIndexOfIgnoreCase(String str, String searchStr) {
"""
<p>Case in-sensitive find of the last index within a String.</p>
<p>A <code>null</code> String will return <code>-1</code>.
A negative start position returns <code>-1</code>.
An empty ("") search String always matches unless the start... | java | public static int lastIndexOfIgnoreCase(String str, String searchStr) {
if (str == null || searchStr == null) {
return INDEX_NOT_FOUND;
}
return lastIndexOfIgnoreCase(str, searchStr, str.length());
} | [
"public",
"static",
"int",
"lastIndexOfIgnoreCase",
"(",
"String",
"str",
",",
"String",
"searchStr",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"searchStr",
"==",
"null",
")",
"{",
"return",
"INDEX_NOT_FOUND",
";",
"}",
"return",
"lastIndexOfIgnoreCase",... | <p>Case in-sensitive find of the last index within a String.</p>
<p>A <code>null</code> String will return <code>-1</code>.
A negative start position returns <code>-1</code>.
An empty ("") search String always matches unless the start position is negative.
A start position greater than the string length searches the w... | [
"<p",
">",
"Case",
"in",
"-",
"sensitive",
"find",
"of",
"the",
"last",
"index",
"within",
"a",
"String",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java#L1129-L1134 |
dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/binary/BinaryUtils.java | BinaryUtils.convertBytesToInt | public static int convertBytesToInt(byte[] bytes, int offset) {
"""
Take four bytes from the specified position in the specified
block and convert them into a 32-bit int, using the big-endian
convention.
@param bytes The data to read from.
@param offset The position to start reading the 4-byte int from.
@retu... | java | public static int convertBytesToInt(byte[] bytes, int offset)
{
return (BITWISE_BYTE_TO_INT & bytes[offset + 3])
| ((BITWISE_BYTE_TO_INT & bytes[offset + 2]) << 8)
| ((BITWISE_BYTE_TO_INT & bytes[offset + 1]) << 16)
| ((BITWISE_BYTE_TO_INT & bytes[offset]) << ... | [
"public",
"static",
"int",
"convertBytesToInt",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"return",
"(",
"BITWISE_BYTE_TO_INT",
"&",
"bytes",
"[",
"offset",
"+",
"3",
"]",
")",
"|",
"(",
"(",
"BITWISE_BYTE_TO_INT",
"&",
"bytes",
"["... | Take four bytes from the specified position in the specified
block and convert them into a 32-bit int, using the big-endian
convention.
@param bytes The data to read from.
@param offset The position to start reading the 4-byte int from.
@return The 32-bit integer represented by the four bytes. | [
"Take",
"four",
"bytes",
"from",
"the",
"specified",
"position",
"in",
"the",
"specified",
"block",
"and",
"convert",
"them",
"into",
"a",
"32",
"-",
"bit",
"int",
"using",
"the",
"big",
"-",
"endian",
"convention",
"."
] | train | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/binary/BinaryUtils.java#L85-L91 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/calibration/ExampleFisheyeToEquirectangular.java | ExampleFisheyeToEquirectangular.createMask | public static GrayU8 createMask( CameraUniversalOmni model ,
LensDistortionWideFOV distortion , double fov ) {
"""
Creates a mask telling the algorithm which pixels are valid and which are not. The field-of-view (FOV) of the
camera is known so we will use that information to do a better job of filterin... | java | public static GrayU8 createMask( CameraUniversalOmni model ,
LensDistortionWideFOV distortion , double fov ) {
GrayU8 mask = new GrayU8(model.width,model.height);
Point2Transform3_F64 p2s = distortion.undistortPtoS_F64();
Point3D_F64 ref = new Point3D_F64(0,0,1);
Point3D_F64 X = new Point3D_F64();
... | [
"public",
"static",
"GrayU8",
"createMask",
"(",
"CameraUniversalOmni",
"model",
",",
"LensDistortionWideFOV",
"distortion",
",",
"double",
"fov",
")",
"{",
"GrayU8",
"mask",
"=",
"new",
"GrayU8",
"(",
"model",
".",
"width",
",",
"model",
".",
"height",
")",
... | Creates a mask telling the algorithm which pixels are valid and which are not. The field-of-view (FOV) of the
camera is known so we will use that information to do a better job of filtering out invalid pixels than
it can do alone. | [
"Creates",
"a",
"mask",
"telling",
"the",
"algorithm",
"which",
"pixels",
"are",
"valid",
"and",
"which",
"are",
"not",
".",
"The",
"field",
"-",
"of",
"-",
"view",
"(",
"FOV",
")",
"of",
"the",
"camera",
"is",
"known",
"so",
"we",
"will",
"use",
"th... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/calibration/ExampleFisheyeToEquirectangular.java#L71-L98 |
innoq/LiQID | ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java | LdapHelper.getUserTemplate | public LdapUser getUserTemplate(String uid) {
"""
Returns a basic LDAP-User-Template for a new LDAP-User.
@param uid of the new LDAP-User.
@return the (prefiled) User-Template.
"""
LdapUser user = new LdapUser(uid, this);
user.set("dn", getDNForNode(user));
for (String oc : userObje... | java | public LdapUser getUserTemplate(String uid) {
LdapUser user = new LdapUser(uid, this);
user.set("dn", getDNForNode(user));
for (String oc : userObjectClasses) {
user.addObjectClass(oc.trim());
}
user = (LdapUser) updateObjectClasses(user);
// TODO this needs ... | [
"public",
"LdapUser",
"getUserTemplate",
"(",
"String",
"uid",
")",
"{",
"LdapUser",
"user",
"=",
"new",
"LdapUser",
"(",
"uid",
",",
"this",
")",
";",
"user",
".",
"set",
"(",
"\"dn\"",
",",
"getDNForNode",
"(",
"user",
")",
")",
";",
"for",
"(",
"S... | Returns a basic LDAP-User-Template for a new LDAP-User.
@param uid of the new LDAP-User.
@return the (prefiled) User-Template. | [
"Returns",
"a",
"basic",
"LDAP",
"-",
"User",
"-",
"Template",
"for",
"a",
"new",
"LDAP",
"-",
"User",
"."
] | train | https://github.com/innoq/LiQID/blob/ae3de2c1fd78c40219780d510eba57c931901279/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java#L619-L654 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/link/KNXNetworkLinkIP.java | KNXNetworkLinkIP.sendRequest | public void sendRequest(KNXAddress dst, Priority p, byte[] nsdu)
throws KNXLinkClosedException, KNXTimeoutException {
"""
{@inheritDoc} When communicating with a KNX network which uses open medium,
messages are broadcasted within domain (as opposite to system broadcast) by
default. Specify <code>dst null</cod... | java | public void sendRequest(KNXAddress dst, Priority p, byte[] nsdu)
throws KNXLinkClosedException, KNXTimeoutException
{
send(dst, p, nsdu, false);
} | [
"public",
"void",
"sendRequest",
"(",
"KNXAddress",
"dst",
",",
"Priority",
"p",
",",
"byte",
"[",
"]",
"nsdu",
")",
"throws",
"KNXLinkClosedException",
",",
"KNXTimeoutException",
"{",
"send",
"(",
"dst",
",",
"p",
",",
"nsdu",
",",
"false",
")",
";",
"... | {@inheritDoc} When communicating with a KNX network which uses open medium,
messages are broadcasted within domain (as opposite to system broadcast) by
default. Specify <code>dst null</code> for system broadcast. | [
"{"
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/link/KNXNetworkLinkIP.java#L352-L356 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java | AbstractAsymmetricCrypto.decryptStr | public String decryptStr(String data, KeyType keyType) {
"""
解密为字符串,密文需为Hex(16进制)或Base64字符串
@param data 数据,Hex(16进制)或Base64字符串
@param keyType 密钥类型
@return 解密后的密文
@since 4.5.2
"""
return decryptStr(data, keyType, CharsetUtil.CHARSET_UTF_8);
} | java | public String decryptStr(String data, KeyType keyType) {
return decryptStr(data, keyType, CharsetUtil.CHARSET_UTF_8);
} | [
"public",
"String",
"decryptStr",
"(",
"String",
"data",
",",
"KeyType",
"keyType",
")",
"{",
"return",
"decryptStr",
"(",
"data",
",",
"keyType",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8",
")",
";",
"}"
] | 解密为字符串,密文需为Hex(16进制)或Base64字符串
@param data 数据,Hex(16进制)或Base64字符串
@param keyType 密钥类型
@return 解密后的密文
@since 4.5.2 | [
"解密为字符串,密文需为Hex(16进制)或Base64字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java#L271-L273 |
fcrepo3/fcrepo | fcrepo-common/src/main/java/org/fcrepo/utilities/xml/DOM.java | DOM.selectNode | public static Node selectNode(Node dom, String xpath) {
"""
<p>Select the Node with the given XPath.
</p><p>
Note: This is a convenience method that logs exceptions instead of
throwing them.
</p>
@param dom the root document.
@param xpath the xpath for the node.
@return the Node or null if unattainable.
... | java | public static Node selectNode(Node dom, String xpath) {
return selector.selectNode(dom, xpath);
} | [
"public",
"static",
"Node",
"selectNode",
"(",
"Node",
"dom",
",",
"String",
"xpath",
")",
"{",
"return",
"selector",
".",
"selectNode",
"(",
"dom",
",",
"xpath",
")",
";",
"}"
] | <p>Select the Node with the given XPath.
</p><p>
Note: This is a convenience method that logs exceptions instead of
throwing them.
</p>
@param dom the root document.
@param xpath the xpath for the node.
@return the Node or null if unattainable. | [
"<p",
">",
"Select",
"the",
"Node",
"with",
"the",
"given",
"XPath",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Note",
":",
"This",
"is",
"a",
"convenience",
"method",
"that",
"logs",
"exceptions",
"instead",
"of",
"throwing",
"them",
".",
"<",
"/",
"p",
... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/utilities/xml/DOM.java#L350-L352 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/handlers/FileStatusTaskStatusHandler.java | FileStatusTaskStatusHandler.taskStatus | private void taskStatus(RESTRequest request, RESTResponse response) {
"""
Returns a JSON string with the status of that task (pending, successful, failed, etc), and the URL for hosts.
{ "taskStatus" : "completed", "propertiesURL" : "url" , "hostsURL" : "url" }
"""
String taskID = RESTHelper.getRequi... | java | private void taskStatus(RESTRequest request, RESTResponse response) {
String taskID = RESTHelper.getRequiredParam(request, APIConstants.PARAM_TASK_ID);
String taskStatusJson = getMultipleRoutingHelper().getStatus(taskID);
OutputHelper.writeJsonOutput(response, taskStatusJson);
} | [
"private",
"void",
"taskStatus",
"(",
"RESTRequest",
"request",
",",
"RESTResponse",
"response",
")",
"{",
"String",
"taskID",
"=",
"RESTHelper",
".",
"getRequiredParam",
"(",
"request",
",",
"APIConstants",
".",
"PARAM_TASK_ID",
")",
";",
"String",
"taskStatusJso... | Returns a JSON string with the status of that task (pending, successful, failed, etc), and the URL for hosts.
{ "taskStatus" : "completed", "propertiesURL" : "url" , "hostsURL" : "url" } | [
"Returns",
"a",
"JSON",
"string",
"with",
"the",
"status",
"of",
"that",
"task",
"(",
"pending",
"successful",
"failed",
"etc",
")",
"and",
"the",
"URL",
"for",
"hosts",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/handlers/FileStatusTaskStatusHandler.java#L120-L125 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/index/RandomIndexVectorGenerator.java | RandomIndexVectorGenerator.generate | public TernaryVector generate() {
"""
Creates an {@code TernaryVector} with the provided length.
@param length the length of the index vector
@return an index vector
"""
HashSet<Integer> pos = new HashSet<Integer>();
HashSet<Integer> neg = new HashSet<Integer>();
// Rando... | java | public TernaryVector generate() {
HashSet<Integer> pos = new HashSet<Integer>();
HashSet<Integer> neg = new HashSet<Integer>();
// Randomly decide how many bits to set in the index vector based on the
// variance.
int bitsToSet = numVectorValues +
(int)(RANDO... | [
"public",
"TernaryVector",
"generate",
"(",
")",
"{",
"HashSet",
"<",
"Integer",
">",
"pos",
"=",
"new",
"HashSet",
"<",
"Integer",
">",
"(",
")",
";",
"HashSet",
"<",
"Integer",
">",
"neg",
"=",
"new",
"HashSet",
"<",
"Integer",
">",
"(",
")",
";",
... | Creates an {@code TernaryVector} with the provided length.
@param length the length of the index vector
@return an index vector | [
"Creates",
"an",
"{",
"@code",
"TernaryVector",
"}",
"with",
"the",
"provided",
"length",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/index/RandomIndexVectorGenerator.java#L170-L212 |
StripesFramework/stripes-stuff | src/main/java/org/stripesstuff/plugin/security/InstanceBasedSecurityManager.java | InstanceBasedSecurityManager.evaluateRoleExpression | private Object evaluateRoleExpression(ActionBean bean, String expression) {
"""
Evaluate the given EL expression using the current action bean to resolve variables.
@param bean the bean to evaluate the expression on
@param expression the EL expression to evaluate
@return the result of the EL expression
... | java | private Object evaluateRoleExpression(ActionBean bean, String expression)
{
try
{
LOG.debug("Evaluating expression: '" + expression + '\'');
// This is somewhat of a hack until the ExpressionEvaluator becomes more accessible.
ParameterName name = new ParameterName("security");
List<Object> values = ne... | [
"private",
"Object",
"evaluateRoleExpression",
"(",
"ActionBean",
"bean",
",",
"String",
"expression",
")",
"{",
"try",
"{",
"LOG",
".",
"debug",
"(",
"\"Evaluating expression: '\"",
"+",
"expression",
"+",
"'",
"'",
")",
";",
"// This is somewhat of a hack until th... | Evaluate the given EL expression using the current action bean to resolve variables.
@param bean the bean to evaluate the expression on
@param expression the EL expression to evaluate
@return the result of the EL expression | [
"Evaluate",
"the",
"given",
"EL",
"expression",
"using",
"the",
"current",
"action",
"bean",
"to",
"resolve",
"variables",
"."
] | train | https://github.com/StripesFramework/stripes-stuff/blob/51ad92b4bd5862ba34d7c18c5829fb00ea3a3811/src/main/java/org/stripesstuff/plugin/security/InstanceBasedSecurityManager.java#L120-L141 |
kcthota/JSONQuery | src/main/java/com/kcthota/JSONQuery/expressions/ValueExpression.java | ValueExpression.getValue | protected JsonNode getValue(JsonNode node, String property) {
"""
Fetches the value for a property from the passed JsonNode. Throws MissingNodeException if the property doesn't exist
@param node JSONNode Object
@param property Property for which the value should be returned
@return returns the value of the prop... | java | protected JsonNode getValue(JsonNode node, String property) {
if(node==null) {
throw new MissingNodeException(property + " is missing");
}
if(property==null) {
return node;
}
JsonNode value = node.at(formatPropertyName(property));
if (value.isMissingNode()) {
throw new MissingNodeException(pr... | [
"protected",
"JsonNode",
"getValue",
"(",
"JsonNode",
"node",
",",
"String",
"property",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"throw",
"new",
"MissingNodeException",
"(",
"property",
"+",
"\" is missing\"",
")",
";",
"}",
"if",
"(",
"proper... | Fetches the value for a property from the passed JsonNode. Throws MissingNodeException if the property doesn't exist
@param node JSONNode Object
@param property Property for which the value should be returned
@return returns the value of the property | [
"Fetches",
"the",
"value",
"for",
"a",
"property",
"from",
"the",
"passed",
"JsonNode",
".",
"Throws",
"MissingNodeException",
"if",
"the",
"property",
"doesn",
"t",
"exist"
] | train | https://github.com/kcthota/JSONQuery/blob/190f8fbcd05d42cfda265ecd8ce4ced192d57c16/src/main/java/com/kcthota/JSONQuery/expressions/ValueExpression.java#L48-L62 |
MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java | ReflectionUtils.getAnnotation | public static <T> T getAnnotation(final Class c, final Class<T> annotation) {
"""
Returns an annotation on a Class if present
@param c the class to examine
@param annotation the annotation to find
@param <T> the type of the annotation
@return the annotation. may be null.
"""
fina... | java | public static <T> T getAnnotation(final Class c, final Class<T> annotation) {
final List<T> found = getAnnotations(c, annotation);
if (found != null && !found.isEmpty()) {
return found.get(0);
} else {
return null;
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getAnnotation",
"(",
"final",
"Class",
"c",
",",
"final",
"Class",
"<",
"T",
">",
"annotation",
")",
"{",
"final",
"List",
"<",
"T",
">",
"found",
"=",
"getAnnotations",
"(",
"c",
",",
"annotation",
")",
";",
... | Returns an annotation on a Class if present
@param c the class to examine
@param annotation the annotation to find
@param <T> the type of the annotation
@return the annotation. may be null. | [
"Returns",
"an",
"annotation",
"on",
"a",
"Class",
"if",
"present"
] | train | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java#L424-L431 |
astrapi69/jaulp-wicket | jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/url/WicketUrlExtensions.java | WicketUrlExtensions.toBaseUrl | public static String toBaseUrl(final Class<? extends Page> pageClass,
final PageParameters parameters) {
"""
Gets the base ur as String.
@param pageClass
the page class
@param parameters
the parameters
@return the base url as String.
"""
return getBaseUrl(pageClass, parameters).canonical().toString(... | java | public static String toBaseUrl(final Class<? extends Page> pageClass,
final PageParameters parameters)
{
return getBaseUrl(pageClass, parameters).canonical().toString();
} | [
"public",
"static",
"String",
"toBaseUrl",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Page",
">",
"pageClass",
",",
"final",
"PageParameters",
"parameters",
")",
"{",
"return",
"getBaseUrl",
"(",
"pageClass",
",",
"parameters",
")",
".",
"canonical",
"(",
... | Gets the base ur as String.
@param pageClass
the page class
@param parameters
the parameters
@return the base url as String. | [
"Gets",
"the",
"base",
"ur",
"as",
"String",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/url/WicketUrlExtensions.java#L416-L420 |
threerings/nenya | tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundlerUtil.java | ComponentBundlerUtil.addTileSetRuleSet | protected static void addTileSetRuleSet (Digester digester, TileSetRuleSet ruleSet) {
"""
Configures <code>ruleSet</code> and hooks it into <code>digester</code>.
"""
ruleSet.setPrefix("actions" + ActionRuleSet.ACTION_PATH);
digester.addRuleSet(ruleSet);
digester.addSetNext(ruleSet.getP... | java | protected static void addTileSetRuleSet (Digester digester, TileSetRuleSet ruleSet)
{
ruleSet.setPrefix("actions" + ActionRuleSet.ACTION_PATH);
digester.addRuleSet(ruleSet);
digester.addSetNext(ruleSet.getPath(), "addTileSet", TileSet.class.getName());
} | [
"protected",
"static",
"void",
"addTileSetRuleSet",
"(",
"Digester",
"digester",
",",
"TileSetRuleSet",
"ruleSet",
")",
"{",
"ruleSet",
".",
"setPrefix",
"(",
"\"actions\"",
"+",
"ActionRuleSet",
".",
"ACTION_PATH",
")",
";",
"digester",
".",
"addRuleSet",
"(",
... | Configures <code>ruleSet</code> and hooks it into <code>digester</code>. | [
"Configures",
"<code",
">",
"ruleSet<",
"/",
"code",
">",
"and",
"hooks",
"it",
"into",
"<code",
">",
"digester<",
"/",
"code",
">",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundlerUtil.java#L76-L81 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Subtract | public static ComplexNumber Subtract(ComplexNumber z1, ComplexNumber z2) {
"""
Subtract two complex numbers.
@param z1 Complex Number.
@param z2 Complex Number.
@return Returns new ComplexNumber instance containing the subtract of specified complex numbers.
"""
return new ComplexNumber(z1.real - ... | java | public static ComplexNumber Subtract(ComplexNumber z1, ComplexNumber z2) {
return new ComplexNumber(z1.real - z2.real, z1.imaginary - z2.imaginary);
} | [
"public",
"static",
"ComplexNumber",
"Subtract",
"(",
"ComplexNumber",
"z1",
",",
"ComplexNumber",
"z2",
")",
"{",
"return",
"new",
"ComplexNumber",
"(",
"z1",
".",
"real",
"-",
"z2",
".",
"real",
",",
"z1",
".",
"imaginary",
"-",
"z2",
".",
"imaginary",
... | Subtract two complex numbers.
@param z1 Complex Number.
@param z2 Complex Number.
@return Returns new ComplexNumber instance containing the subtract of specified complex numbers. | [
"Subtract",
"two",
"complex",
"numbers",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L272-L274 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.lookAt | public Matrix4x3d lookAt(double eyeX, double eyeY, double eyeZ,
double centerX, double centerY, double centerZ,
double upX, double upY, double upZ, Matrix4x3d dest) {
"""
Apply a "lookat" transformation to this matrix for a right-handed coordinate system,
... | java | public Matrix4x3d lookAt(double eyeX, double eyeY, double eyeZ,
double centerX, double centerY, double centerZ,
double upX, double upY, double upZ, Matrix4x3d dest) {
if ((properties & PROPERTY_IDENTITY) != 0)
return dest.setLookAt(eyeX, eyeY... | [
"public",
"Matrix4x3d",
"lookAt",
"(",
"double",
"eyeX",
",",
"double",
"eyeY",
",",
"double",
"eyeZ",
",",
"double",
"centerX",
",",
"double",
"centerY",
",",
"double",
"centerZ",
",",
"double",
"upX",
",",
"double",
"upY",
",",
"double",
"upZ",
",",
"M... | Apply a "lookat" transformation to this matrix for a right-handed coordinate system,
that aligns <code>-z</code> with <code>center - eye</code> and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookat matrix,
then the new matrix will be <code>M * L</code... | [
"Apply",
"a",
"lookat",
"transformation",
"to",
"this",
"matrix",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"aligns",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"with",
"<code",
">",
"center",
"-",
"eye<",
"/",
"code",
">",
"a... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L8250-L8256 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/tm/tmformssoaction.java | tmformssoaction.get | public static tmformssoaction get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch tmformssoaction resource of given name .
"""
tmformssoaction obj = new tmformssoaction();
obj.set_name(name);
tmformssoaction response = (tmformssoaction) obj.get_resource(service);
return... | java | public static tmformssoaction get(nitro_service service, String name) throws Exception{
tmformssoaction obj = new tmformssoaction();
obj.set_name(name);
tmformssoaction response = (tmformssoaction) obj.get_resource(service);
return response;
} | [
"public",
"static",
"tmformssoaction",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"tmformssoaction",
"obj",
"=",
"new",
"tmformssoaction",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"tmf... | Use this API to fetch tmformssoaction resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"tmformssoaction",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/tm/tmformssoaction.java#L452-L457 |
jfoenixadmin/JFoenix | jfoenix/src/main/java/com/jfoenix/svg/SVGGlyph.java | SVGGlyph.setSize | public void setSize(double width, double height) {
"""
resize the svg to a certain width and height
@param width
@param height
"""
this.setMinSize(StackPane.USE_PREF_SIZE, StackPane.USE_PREF_SIZE);
this.setPrefSize(width, height);
this.setMaxSize(StackPane.USE_PREF_SIZE, StackPane.U... | java | public void setSize(double width, double height) {
this.setMinSize(StackPane.USE_PREF_SIZE, StackPane.USE_PREF_SIZE);
this.setPrefSize(width, height);
this.setMaxSize(StackPane.USE_PREF_SIZE, StackPane.USE_PREF_SIZE);
} | [
"public",
"void",
"setSize",
"(",
"double",
"width",
",",
"double",
"height",
")",
"{",
"this",
".",
"setMinSize",
"(",
"StackPane",
".",
"USE_PREF_SIZE",
",",
"StackPane",
".",
"USE_PREF_SIZE",
")",
";",
"this",
".",
"setPrefSize",
"(",
"width",
",",
"hei... | resize the svg to a certain width and height
@param width
@param height | [
"resize",
"the",
"svg",
"to",
"a",
"certain",
"width",
"and",
"height"
] | train | https://github.com/jfoenixadmin/JFoenix/blob/53235b5f561da4a515ef716059b8a8df5239ffa1/jfoenix/src/main/java/com/jfoenix/svg/SVGGlyph.java#L145-L149 |
bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlDataReaderDAO.java | CqlDataReaderDAO.deltaQuery | private Iterator<Iterable<Row>> deltaQuery(DeltaPlacement placement, Statement statement, boolean singleRow,
String errorContext, Object... errorContextArgs) {
"""
Synchronously executes the provided statement. The statement must query the delta table as returned fro... | java | private Iterator<Iterable<Row>> deltaQuery(DeltaPlacement placement, Statement statement, boolean singleRow,
String errorContext, Object... errorContextArgs) {
return doDeltaQuery(placement, statement, singleRow, false, errorContext, errorContextArgs);
} | [
"private",
"Iterator",
"<",
"Iterable",
"<",
"Row",
">",
">",
"deltaQuery",
"(",
"DeltaPlacement",
"placement",
",",
"Statement",
"statement",
",",
"boolean",
"singleRow",
",",
"String",
"errorContext",
",",
"Object",
"...",
"errorContextArgs",
")",
"{",
"return... | Synchronously executes the provided statement. The statement must query the delta table as returned from
{@link com.bazaarvoice.emodb.sor.db.astyanax.DeltaPlacement#getDeltaTableDDL()} | [
"Synchronously",
"executes",
"the",
"provided",
"statement",
".",
"The",
"statement",
"must",
"query",
"the",
"delta",
"table",
"as",
"returned",
"from",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlDataReaderDAO.java#L233-L236 |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/MeterRegistry.java | MeterRegistry.gaugeMapSize | @Nullable
public <T extends Map<?, ?>> T gaugeMapSize(String name, Iterable<Tag> tags, T map) {
"""
Register a gauge that reports the size of the {@link Map}. The registration
will keep a weak reference to the collection so it will not prevent garbage collection.
The collection implementation used should be ... | java | @Nullable
public <T extends Map<?, ?>> T gaugeMapSize(String name, Iterable<Tag> tags, T map) {
return gauge(name, tags, map, Map::size);
} | [
"@",
"Nullable",
"public",
"<",
"T",
"extends",
"Map",
"<",
"?",
",",
"?",
">",
">",
"T",
"gaugeMapSize",
"(",
"String",
"name",
",",
"Iterable",
"<",
"Tag",
">",
"tags",
",",
"T",
"map",
")",
"{",
"return",
"gauge",
"(",
"name",
",",
"tags",
","... | Register a gauge that reports the size of the {@link Map}. The registration
will keep a weak reference to the collection so it will not prevent garbage collection.
The collection implementation used should be thread safe. Note that calling
{@link Map#size()} can be expensive for some collection implementations
and shou... | [
"Register",
"a",
"gauge",
"that",
"reports",
"the",
"size",
"of",
"the",
"{",
"@link",
"Map",
"}",
".",
"The",
"registration",
"will",
"keep",
"a",
"weak",
"reference",
"to",
"the",
"collection",
"so",
"it",
"will",
"not",
"prevent",
"garbage",
"collection... | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/MeterRegistry.java#L515-L518 |
adyliu/jafka | src/main/java/io/jafka/producer/StringProducers.java | StringProducers.buildGlobal | public static StringProducers buildGlobal(String zookeeperConfig) {
"""
build the global producer (thread-safety)
@param zookeeperConfig connect config of zookeeper; ex: 127.0.0.1:2181/jafka
@return the global producer
"""
if (instance == null) {
synchronized (StringProducers.class) {
... | java | public static StringProducers buildGlobal(String zookeeperConfig) {
if (instance == null) {
synchronized (StringProducers.class) {
if (instance == null) {
final Properties props = new Properties();
props.put("zk.connect", zookeeperConfig);
... | [
"public",
"static",
"StringProducers",
"buildGlobal",
"(",
"String",
"zookeeperConfig",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"synchronized",
"(",
"StringProducers",
".",
"class",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
... | build the global producer (thread-safety)
@param zookeeperConfig connect config of zookeeper; ex: 127.0.0.1:2181/jafka
@return the global producer | [
"build",
"the",
"global",
"producer",
"(",
"thread",
"-",
"safety",
")"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/producer/StringProducers.java#L63-L83 |
fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/converters/ValueConverter.java | ValueConverter.nodeForValue | public static javax.jcr.Node nodeForValue(final Session session, final Value v) throws RepositoryException {
"""
Get the node that a property value refers to.
@param session Session to use to load the node.
@param v Value that refers to a node.
@return the JCR node
@throws RepositoryException When there is an ... | java | public static javax.jcr.Node nodeForValue(final Session session, final Value v) throws RepositoryException {
if (v.getType() == PATH) {
return session.getNode(v.getString());
} else if (v.getType() == REFERENCE || v.getType() == WEAKREFERENCE) {
return session.getNodeByIdentifier... | [
"public",
"static",
"javax",
".",
"jcr",
".",
"Node",
"nodeForValue",
"(",
"final",
"Session",
"session",
",",
"final",
"Value",
"v",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"v",
".",
"getType",
"(",
")",
"==",
"PATH",
")",
"{",
"return",
... | Get the node that a property value refers to.
@param session Session to use to load the node.
@param v Value that refers to a node.
@return the JCR node
@throws RepositoryException When there is an error accessing the node.
@throws RepositoryRuntimeException When the value type is not PATH, REFERENCE or WEAKREFERENCE. | [
"Get",
"the",
"node",
"that",
"a",
"property",
"value",
"refers",
"to",
"."
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/converters/ValueConverter.java#L179-L188 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java | ExpressionUtils.predicateTemplate | public static PredicateTemplate predicateTemplate(Template template, List<?> args) {
"""
Create a new Template expression
@param template template
@param args template parameters
@return template expression
"""
return new PredicateTemplate(template, ImmutableList.copyOf(args));
} | java | public static PredicateTemplate predicateTemplate(Template template, List<?> args) {
return new PredicateTemplate(template, ImmutableList.copyOf(args));
} | [
"public",
"static",
"PredicateTemplate",
"predicateTemplate",
"(",
"Template",
"template",
",",
"List",
"<",
"?",
">",
"args",
")",
"{",
"return",
"new",
"PredicateTemplate",
"(",
"template",
",",
"ImmutableList",
".",
"copyOf",
"(",
"args",
")",
")",
";",
"... | Create a new Template expression
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L201-L203 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/remoting/BasicAuthHttpInvokerRequestExecutor.java | BasicAuthHttpInvokerRequestExecutor.prepareConnection | protected void prepareConnection(HttpURLConnection con, int contentLength)
throws IOException {
"""
Called every time a HTTP invocation is made.
<p>
Simply allows the parent to setup the connection, and then adds an
<code>Authorization</code> HTTP header property that will be used for
BASIC authentication. ... | java | protected void prepareConnection(HttpURLConnection con, int contentLength)
throws IOException {
super.prepareConnection(con, contentLength);
Authentication auth = getAuthenticationToken();
if ((auth != null) && (auth.getName() != null)
&& (auth.getCredentials() != null)) {
String base64 = auth.getNam... | [
"protected",
"void",
"prepareConnection",
"(",
"HttpURLConnection",
"con",
",",
"int",
"contentLength",
")",
"throws",
"IOException",
"{",
"super",
".",
"prepareConnection",
"(",
"con",
",",
"contentLength",
")",
";",
"Authentication",
"auth",
"=",
"getAuthenticatio... | Called every time a HTTP invocation is made.
<p>
Simply allows the parent to setup the connection, and then adds an
<code>Authorization</code> HTTP header property that will be used for
BASIC authentication. Following that a call to
{@link #doPrepareConnection} is made to allow subclasses to apply any
additional config... | [
"Called",
"every",
"time",
"a",
"HTTP",
"invocation",
"is",
"made",
".",
"<p",
">",
"Simply",
"allows",
"the",
"parent",
"to",
"setup",
"the",
"connection",
"and",
"then",
"adds",
"an",
"<code",
">",
"Authorization<",
"/",
"code",
">",
"HTTP",
"header",
... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/remoting/BasicAuthHttpInvokerRequestExecutor.java#L131-L157 |
alkacon/opencms-core | src/org/opencms/webdav/CmsWebdavServlet.java | CmsWebdavServlet.generateLockToken | private String generateLockToken(HttpServletRequest req, CmsRepositoryLockInfo lock) {
"""
Generates a lock token out of the lock and some information out of the
request to make it unique.<p>
@param req the servlet request we are processing
@param lock the lock with the information for the lock token
@retu... | java | private String generateLockToken(HttpServletRequest req, CmsRepositoryLockInfo lock) {
String lockTokenStr = req.getServletPath()
+ "-"
+ req.getUserPrincipal()
+ "-"
+ lock.getOwner()
+ "-"
+ lock.getPath()
+ "-"
+... | [
"private",
"String",
"generateLockToken",
"(",
"HttpServletRequest",
"req",
",",
"CmsRepositoryLockInfo",
"lock",
")",
"{",
"String",
"lockTokenStr",
"=",
"req",
".",
"getServletPath",
"(",
")",
"+",
"\"-\"",
"+",
"req",
".",
"getUserPrincipal",
"(",
")",
"+",
... | Generates a lock token out of the lock and some information out of the
request to make it unique.<p>
@param req the servlet request we are processing
@param lock the lock with the information for the lock token
@return the generated lock token | [
"Generates",
"a",
"lock",
"token",
"out",
"of",
"the",
"lock",
"and",
"some",
"information",
"out",
"of",
"the",
"request",
"to",
"make",
"it",
"unique",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/webdav/CmsWebdavServlet.java#L3053-L3066 |
raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.rescaleImageAndEncodeAsBase64 | @Nonnull
public static String rescaleImageAndEncodeAsBase64(@Nonnull Image image, final int maxSize) throws IOException {
"""
Rescale image and encode into Base64.
@param image image to rescale and encode
@param maxSize max size of image, if less or zero then don't rescale
@return scaled and encoded image
... | java | @Nonnull
public static String rescaleImageAndEncodeAsBase64(@Nonnull Image image, final int maxSize) throws IOException {
final int width = image.getWidth(null);
final int height = image.getHeight(null);
final int maxImageSideSize = maxSize > 0 ? maxSize : Math.max(width, height);
final float imageS... | [
"@",
"Nonnull",
"public",
"static",
"String",
"rescaleImageAndEncodeAsBase64",
"(",
"@",
"Nonnull",
"Image",
"image",
",",
"final",
"int",
"maxSize",
")",
"throws",
"IOException",
"{",
"final",
"int",
"width",
"=",
"image",
".",
"getWidth",
"(",
"null",
")",
... | Rescale image and encode into Base64.
@param image image to rescale and encode
@param maxSize max size of image, if less or zero then don't rescale
@return scaled and encoded image
@throws IOException if it was impossible to encode image
@since 1.4.0 | [
"Rescale",
"image",
"and",
"encode",
"into",
"Base64",
"."
] | train | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L333-L378 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/MetadataBlockHeader.java | MetadataBlockHeader.getMetadataBlockHeader | public static EncodedElement getMetadataBlockHeader(boolean lastBlock,
MetadataBlockType type, int length) {
"""
Create a meta-data block header of the given type, and return the result
in a new EncodedElement(so data is ready to be placed directly in FLAC
stream)
@param lastBlock True if this is the la... | java | public static EncodedElement getMetadataBlockHeader(boolean lastBlock,
MetadataBlockType type, int length) {
EncodedElement ele = new EncodedElement(4, 0);
int encodedLastBlock = (lastBlock) ? 1:0;
ele.addInt(encodedLastBlock, 1);
int encodedType = 0;
MetadataBlockType[] vals = MetadataBlockTy... | [
"public",
"static",
"EncodedElement",
"getMetadataBlockHeader",
"(",
"boolean",
"lastBlock",
",",
"MetadataBlockType",
"type",
",",
"int",
"length",
")",
"{",
"EncodedElement",
"ele",
"=",
"new",
"EncodedElement",
"(",
"4",
",",
"0",
")",
";",
"int",
"encodedLas... | Create a meta-data block header of the given type, and return the result
in a new EncodedElement(so data is ready to be placed directly in FLAC
stream)
@param lastBlock True if this is the last meta-block in the stream. False
otherwise.
@param type enum indicating which type of block we're creating.
@param length Len... | [
"Create",
"a",
"meta",
"-",
"data",
"block",
"header",
"of",
"the",
"given",
"type",
"and",
"return",
"the",
"result",
"in",
"a",
"new",
"EncodedElement",
"(",
"so",
"data",
"is",
"ready",
"to",
"be",
"placed",
"directly",
"in",
"FLAC",
"stream",
")"
] | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/MetadataBlockHeader.java#L78-L95 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java | ManagedClustersInner.resetServicePrincipalProfile | public void resetServicePrincipalProfile(String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) {
"""
Reset Service Principal Profile of a managed cluster.
Update the service principal Profile for a managed cluster.
@param resourceGroupName The name of the resource gro... | java | public void resetServicePrincipalProfile(String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) {
resetServicePrincipalProfileWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().last().body();
} | [
"public",
"void",
"resetServicePrincipalProfile",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterServicePrincipalProfile",
"parameters",
")",
"{",
"resetServicePrincipalProfileWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resou... | Reset Service Principal Profile of a managed cluster.
Update the service principal Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Reset Service Principal Profile operation... | [
"Reset",
"Service",
"Principal",
"Profile",
"of",
"a",
"managed",
"cluster",
".",
"Update",
"the",
"service",
"principal",
"Profile",
"for",
"a",
"managed",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java#L1501-L1503 |
tvesalainen/lpg | src/main/java/org/vesalainen/grammar/Grammar.java | Grammar.addRule | protected void addRule(String reducerString, String nonterminal, String document, String... rhs) {
"""
Adds new rule if the same rule doesn't exist already.
@param nonterminal Left hand side of the rule.
@param rhs Strings in BnfGrammarFactory format.
@see BnfGrammarFactory
"""
ExecutableElement re... | java | protected void addRule(String reducerString, String nonterminal, String document, String... rhs)
{
ExecutableElement reducer = null;
if (reducerString != null && !reducerString.isEmpty())
{
reducer = El.getExecutableElement(reducerString);
if (reducer == null)
... | [
"protected",
"void",
"addRule",
"(",
"String",
"reducerString",
",",
"String",
"nonterminal",
",",
"String",
"document",
",",
"String",
"...",
"rhs",
")",
"{",
"ExecutableElement",
"reducer",
"=",
"null",
";",
"if",
"(",
"reducerString",
"!=",
"null",
"&&",
... | Adds new rule if the same rule doesn't exist already.
@param nonterminal Left hand side of the rule.
@param rhs Strings in BnfGrammarFactory format.
@see BnfGrammarFactory | [
"Adds",
"new",
"rule",
"if",
"the",
"same",
"rule",
"doesn",
"t",
"exist",
"already",
"."
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/grammar/Grammar.java#L231-L243 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AsCodeGen.java | AsCodeGen.writeClassBody | @Override
public void writeClassBody(Definition def, Writer out) throws IOException {
"""
Output class
@param def definition
@param out Writer
@throws IOException ioException
"""
if (def.isUseAnnotation())
{
if (!def.isDefaultPackageInbound())
{
out.write("@Act... | java | @Override
public void writeClassBody(Definition def, Writer out) throws IOException
{
if (def.isUseAnnotation())
{
if (!def.isDefaultPackageInbound())
{
out.write("@Activation(messageListeners = { " + def.getMlClass() + ".class })\n");
}
else
{
... | [
"@",
"Override",
"public",
"void",
"writeClassBody",
"(",
"Definition",
"def",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"def",
".",
"isUseAnnotation",
"(",
")",
")",
"{",
"if",
"(",
"!",
"def",
".",
"isDefaultPackageInbound",
"("... | Output class
@param def definition
@param out Writer
@throws IOException ioException | [
"Output",
"class"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AsCodeGen.java#L47-L83 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.listImages | public ListImagesResponse listImages(ListImagesRequest request) {
"""
Listing images owned by the authenticated user.
@param request The request containing all options for listing images owned by user.
@return The response with list of images.
"""
checkNotNull(request, "request should not be null."... | java | public ListImagesResponse listImages(ListImagesRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, IMAGE_PREFIX);
if (!Strings.isNullOrEmpty(request.getMarker())) {
internalRequest.... | [
"public",
"ListImagesResponse",
"listImages",
"(",
"ListImagesRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"this",
".",
"createRequest",
"(",
"request",
",",
... | Listing images owned by the authenticated user.
@param request The request containing all options for listing images owned by user.
@return The response with list of images. | [
"Listing",
"images",
"owned",
"by",
"the",
"authenticated",
"user",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L1281-L1294 |
Netflix/netflix-graph | src/main/java/com/netflix/nfgraph/NFGraph.java | NFGraph.getConnectionIterator | public OrdinalIterator getConnectionIterator(String nodeType, int ordinal, String propertyName) {
"""
Retrieve an {@link OrdinalIterator} over all connected ordinals, given the type and ordinal of the originating node, and the property by which this node is connected.
@return an {@link OrdinalIterator} over all... | java | public OrdinalIterator getConnectionIterator(String nodeType, int ordinal, String propertyName) {
return getConnectionIterator(0, nodeType, ordinal, propertyName);
} | [
"public",
"OrdinalIterator",
"getConnectionIterator",
"(",
"String",
"nodeType",
",",
"int",
"ordinal",
",",
"String",
"propertyName",
")",
"{",
"return",
"getConnectionIterator",
"(",
"0",
",",
"nodeType",
",",
"ordinal",
",",
"propertyName",
")",
";",
"}"
] | Retrieve an {@link OrdinalIterator} over all connected ordinals, given the type and ordinal of the originating node, and the property by which this node is connected.
@return an {@link OrdinalIterator} over all connected ordinals | [
"Retrieve",
"an",
"{",
"@link",
"OrdinalIterator",
"}",
"over",
"all",
"connected",
"ordinals",
"given",
"the",
"type",
"and",
"ordinal",
"of",
"the",
"originating",
"node",
"and",
"the",
"property",
"by",
"which",
"this",
"node",
"is",
"connected",
"."
] | train | https://github.com/Netflix/netflix-graph/blob/ee129252a08a9f51dd296d6fca2f0b28b7be284e/src/main/java/com/netflix/nfgraph/NFGraph.java#L125-L127 |
akarnokd/akarnokd-xml | src/main/java/hu/akarnokd/xml/XNSerializables.java | XNSerializables.storeList | public static XNElement storeList(String container, String item, Iterable<? extends XNSerializable> source) {
"""
Create an XNElement with the given name and items stored from the source sequence.
@param container the container name
@param item the item name
@param source the source of items
@return the list i... | java | public static XNElement storeList(String container, String item, Iterable<? extends XNSerializable> source) {
XNElement result = new XNElement(container);
for (XNSerializable e : source) {
e.save(result.add(item));
}
return result;
} | [
"public",
"static",
"XNElement",
"storeList",
"(",
"String",
"container",
",",
"String",
"item",
",",
"Iterable",
"<",
"?",
"extends",
"XNSerializable",
">",
"source",
")",
"{",
"XNElement",
"result",
"=",
"new",
"XNElement",
"(",
"container",
")",
";",
"for... | Create an XNElement with the given name and items stored from the source sequence.
@param container the container name
@param item the item name
@param source the source of items
@return the list in XNElement | [
"Create",
"an",
"XNElement",
"with",
"the",
"given",
"name",
"and",
"items",
"stored",
"from",
"the",
"source",
"sequence",
"."
] | train | https://github.com/akarnokd/akarnokd-xml/blob/57466a5a9cb455a13d7121557c165287b31ee870/src/main/java/hu/akarnokd/xml/XNSerializables.java#L92-L98 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/Validate.java | Validate.isInstanceOf | public static <T> T isInstanceOf(final Class<?> type, final T obj, final String message, final Object... values) {
"""
<p>Validate that the argument is an instance of the specified class; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary
cl... | java | public static <T> T isInstanceOf(final Class<?> type, final T obj, final String message, final Object... values) {
return INSTANCE.isInstanceOf(type, obj, message, values);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"isInstanceOf",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"T",
"obj",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"return",
"INSTANCE",
".",
"isInstance... | <p>Validate that the argument is an instance of the specified class; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary
class</p>
<pre>Validate.isInstanceOf(OkClass.classs, object, "Wrong class, object is of class %s",
object.getClass().getName())... | [
"<p",
">",
"Validate",
"that",
"the",
"argument",
"is",
"an",
"instance",
"of",
"the",
"specified",
"class",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"This",
"method",
"is",
"useful",
"when",
"validating",
... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/Validate.java#L1737-L1739 |
MenoData/Time4J | base/src/main/java/net/time4j/SystemClock.java | SystemClock.synchronizedWith | public SystemClock synchronizedWith(TimeSource<?> clock) {
"""
/*[deutsch]
<p>Synchronisiert diese Instanz mit der angegebenen Zeitquelle und liefert eine neue Kopie. </p>
<p>Diese Methode ist nur relevant, wenn diese Uhr im monotonen Modus läuft. Es wird dringend
angeraten, nicht während oder nahe ... | java | public SystemClock synchronizedWith(TimeSource<?> clock) {
Moment time = Moment.from(clock.currentTime());
long compare = (MONOTON_MODE ? System.nanoTime() : PROVIDER.getNanos());
long utc = time.getElapsedTime(TimeScale.UTC);
long instantNanos = Math.multiplyExact(utc, MRD) + time.get... | [
"public",
"SystemClock",
"synchronizedWith",
"(",
"TimeSource",
"<",
"?",
">",
"clock",
")",
"{",
"Moment",
"time",
"=",
"Moment",
".",
"from",
"(",
"clock",
".",
"currentTime",
"(",
")",
")",
";",
"long",
"compare",
"=",
"(",
"MONOTON_MODE",
"?",
"Syste... | /*[deutsch]
<p>Synchronisiert diese Instanz mit der angegebenen Zeitquelle und liefert eine neue Kopie. </p>
<p>Diese Methode ist nur relevant, wenn diese Uhr im monotonen Modus läuft. Es wird dringend
angeraten, nicht während oder nahe einer Schaltsekunde zu eichen. Achtung: Diese Methode kann
Zeitsprü... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Synchronisiert",
"diese",
"Instanz",
"mit",
"der",
"angegebenen",
"Zeitquelle",
"und",
"liefert",
"eine",
"neue",
"Kopie",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/SystemClock.java#L454-L465 |
jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/MessageReceiverFilterList.java | MessageReceiverFilterList.setNewFilterTree | public void setNewFilterTree(BaseMessageFilter messageFilter, Object[][] mxProperties) {
"""
Update this filter with this new information.
@param messageFilter The message filter I am updating.
@param propKeys New tree key filter information (ie, bookmark=345).
"""
if (mxProperties != null)
... | java | public void setNewFilterTree(BaseMessageFilter messageFilter, Object[][] mxProperties)
{
if (mxProperties != null)
messageFilter.setNameValueTree(mxProperties); // Update the new properties.
} | [
"public",
"void",
"setNewFilterTree",
"(",
"BaseMessageFilter",
"messageFilter",
",",
"Object",
"[",
"]",
"[",
"]",
"mxProperties",
")",
"{",
"if",
"(",
"mxProperties",
"!=",
"null",
")",
"messageFilter",
".",
"setNameValueTree",
"(",
"mxProperties",
")",
";",
... | Update this filter with this new information.
@param messageFilter The message filter I am updating.
@param propKeys New tree key filter information (ie, bookmark=345). | [
"Update",
"this",
"filter",
"with",
"this",
"new",
"information",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/MessageReceiverFilterList.java#L176-L180 |
wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/RubyObject.java | RubyObject.send | public static <E> E send(Object o, String methodName, Long arg) {
"""
Executes a method of any Object by Java reflection.
@param o
an Object
@param methodName
name of the method
@param arg
a Long
@return the result of the method called
"""
return send(o, methodName, (Object) arg);
} | java | public static <E> E send(Object o, String methodName, Long arg) {
return send(o, methodName, (Object) arg);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"send",
"(",
"Object",
"o",
",",
"String",
"methodName",
",",
"Long",
"arg",
")",
"{",
"return",
"send",
"(",
"o",
",",
"methodName",
",",
"(",
"Object",
")",
"arg",
")",
";",
"}"
] | Executes a method of any Object by Java reflection.
@param o
an Object
@param methodName
name of the method
@param arg
a Long
@return the result of the method called | [
"Executes",
"a",
"method",
"of",
"any",
"Object",
"by",
"Java",
"reflection",
"."
] | train | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/RubyObject.java#L219-L221 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendText | public static <T> void sendText(final ByteBuffer message, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context) {
"""
Sends a complete text message, invoking the callback when complete
@param message The text to send
@param wsChannel The web socket channel
@param callback The callb... | java | public static <T> void sendText(final ByteBuffer message, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context) {
sendInternal(message, WebSocketFrameType.TEXT, wsChannel, callback, context, -1);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"sendText",
"(",
"final",
"ByteBuffer",
"message",
",",
"final",
"WebSocketChannel",
"wsChannel",
",",
"final",
"WebSocketCallback",
"<",
"T",
">",
"callback",
",",
"T",
"context",
")",
"{",
"sendInternal",
"(",
"me... | Sends a complete text message, invoking the callback when complete
@param message The text to send
@param wsChannel The web socket channel
@param callback The callback to invoke on completion
@param context The context object that will be passed to the callback on completion | [
"Sends",
"a",
"complete",
"text",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L111-L113 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/font/StringWalker.java | StringWalker.checkFormatting | protected void checkFormatting() {
"""
Checks if there is {@link TextFormatting} at the current index and applies the corresponding style.<br>
Advances the index by 2.
"""
//previous character was formatting, keep format field set
if (FontOptions.getFormatting(currentText, charIndex - 1) != null)
retur... | java | protected void checkFormatting()
{
//previous character was formatting, keep format field set
if (FontOptions.getFormatting(currentText, charIndex - 1) != null)
return;
format = FontOptions.getFormatting(currentText, charIndex);
if (format == null)
return;
if (applyStyles)
applyStyle(format);
if... | [
"protected",
"void",
"checkFormatting",
"(",
")",
"{",
"//previous character was formatting, keep format field set",
"if",
"(",
"FontOptions",
".",
"getFormatting",
"(",
"currentText",
",",
"charIndex",
"-",
"1",
")",
"!=",
"null",
")",
"return",
";",
"format",
"=",... | Checks if there is {@link TextFormatting} at the current index and applies the corresponding style.<br>
Advances the index by 2. | [
"Checks",
"if",
"there",
"is",
"{"
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/font/StringWalker.java#L220-L238 |
SG-O/miIO | src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java | Vacuum.cleanArea | public boolean cleanArea(int[] bottomLeft, int[] topRight, int passes) throws CommandExecutionException {
"""
Clean the specified area on the map.
@param bottomLeft The bottom left position of the area in millimeters. 25600 millimeter both in x and y is the center of the map. The origin of the map is 0 millimeter... | java | public boolean cleanArea(int[] bottomLeft, int[] topRight, int passes) throws CommandExecutionException {
if (bottomLeft == null || topRight == null || passes < 1) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
if (bottomLeft.length != 2) throw new CommandExecut... | [
"public",
"boolean",
"cleanArea",
"(",
"int",
"[",
"]",
"bottomLeft",
",",
"int",
"[",
"]",
"topRight",
",",
"int",
"passes",
")",
"throws",
"CommandExecutionException",
"{",
"if",
"(",
"bottomLeft",
"==",
"null",
"||",
"topRight",
"==",
"null",
"||",
"pas... | Clean the specified area on the map.
@param bottomLeft The bottom left position of the area in millimeters. 25600 millimeter both in x and y is the center of the map. The origin of the map is 0 millimeters in x and y.
@param topRight The top right position of the area in millimeters. 25600 millimeter both in x and y is... | [
"Clean",
"the",
"specified",
"area",
"on",
"the",
"map",
"."
] | train | https://github.com/SG-O/miIO/blob/f352dbd2a699d2cdb1b412ca5e6cbb0c38ca779b/src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java#L363-L376 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java | AbstractJsonDeserializer.getSubJson | public String getSubJson(String paramName, String errorMessage, Map<String, Object> mapToUse) throws IOException {
"""
Convenience method for subclasses.
@param paramName the name of the parameter
@param errorMessage the errormessage to add to the exception if the param does not exist.
@param mapToUse ... | java | public String getSubJson(String paramName, String errorMessage, Map<String, Object> mapToUse) throws IOException {
Object o = mapToUse.get(paramName);
if (o != null) {
try {
return parent.toJson(o);
} catch (JsonException e) {
throw new IOException... | [
"public",
"String",
"getSubJson",
"(",
"String",
"paramName",
",",
"String",
"errorMessage",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"mapToUse",
")",
"throws",
"IOException",
"{",
"Object",
"o",
"=",
"mapToUse",
".",
"get",
"(",
"paramName",
")",
";... | Convenience method for subclasses.
@param paramName the name of the parameter
@param errorMessage the errormessage to add to the exception if the param does not exist.
@param mapToUse the map to use as input parametersource
@return a stringparameter with given name. If it does not exist and the errormessage is ... | [
"Convenience",
"method",
"for",
"subclasses",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java#L125-L140 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QRDecompositionHouseholderColumn_DDRM.java | QRDecompositionHouseholderColumn_DDRM.getR | @Override
public DMatrixRMaj getR(DMatrixRMaj R, boolean compact) {
"""
Returns an upper triangular matrix which is the R in the QR decomposition. If compact then the input
expected to be size = [min(rows,cols) , numCols] otherwise size = [numRows,numCols].
@param R Storage for upper triangular matrix.
@... | java | @Override
public DMatrixRMaj getR(DMatrixRMaj R, boolean compact) {
if( compact ) {
R = UtilDecompositons_DDRM.checkZerosLT(R,minLength,numCols);
} else {
R = UtilDecompositons_DDRM.checkZerosLT(R,numRows,numCols);
}
for( int j = 0; j < numCols; j++ ) {
... | [
"@",
"Override",
"public",
"DMatrixRMaj",
"getR",
"(",
"DMatrixRMaj",
"R",
",",
"boolean",
"compact",
")",
"{",
"if",
"(",
"compact",
")",
"{",
"R",
"=",
"UtilDecompositons_DDRM",
".",
"checkZerosLT",
"(",
"R",
",",
"minLength",
",",
"numCols",
")",
";",
... | Returns an upper triangular matrix which is the R in the QR decomposition. If compact then the input
expected to be size = [min(rows,cols) , numCols] otherwise size = [numRows,numCols].
@param R Storage for upper triangular matrix.
@param compact If true then a compact matrix is expected. | [
"Returns",
"an",
"upper",
"triangular",
"matrix",
"which",
"is",
"the",
"R",
"in",
"the",
"QR",
"decomposition",
".",
"If",
"compact",
"then",
"the",
"input",
"expected",
"to",
"be",
"size",
"=",
"[",
"min",
"(",
"rows",
"cols",
")",
"numCols",
"]",
"o... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QRDecompositionHouseholderColumn_DDRM.java#L125-L143 |
WiQuery/wiquery | wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java | Options.putBoolean | public Options putBoolean(String key, IModel<Boolean> value) {
"""
<p>
Put an boolean value for the given option name.
</p>
@param key
the option name.
@param value
the boolean value.
"""
putOption(key, new BooleanOption(value));
return this;
} | java | public Options putBoolean(String key, IModel<Boolean> value)
{
putOption(key, new BooleanOption(value));
return this;
} | [
"public",
"Options",
"putBoolean",
"(",
"String",
"key",
",",
"IModel",
"<",
"Boolean",
">",
"value",
")",
"{",
"putOption",
"(",
"key",
",",
"new",
"BooleanOption",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Put an boolean value for the given option name.
</p>
@param key
the option name.
@param value
the boolean value. | [
"<p",
">",
"Put",
"an",
"boolean",
"value",
"for",
"the",
"given",
"option",
"name",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java#L355-L359 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/client/ProviderInfo.java | ProviderInfo.setDynamicAttrs | public ProviderInfo setDynamicAttrs(Map<String, Object> dynamicAttrs) {
"""
Sets dynamic attribute.
@param dynamicAttrs the dynamic attribute
@return this
"""
this.dynamicAttrs.clear();
this.dynamicAttrs.putAll(dynamicAttrs);
return this;
} | java | public ProviderInfo setDynamicAttrs(Map<String, Object> dynamicAttrs) {
this.dynamicAttrs.clear();
this.dynamicAttrs.putAll(dynamicAttrs);
return this;
} | [
"public",
"ProviderInfo",
"setDynamicAttrs",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"dynamicAttrs",
")",
"{",
"this",
".",
"dynamicAttrs",
".",
"clear",
"(",
")",
";",
"this",
".",
"dynamicAttrs",
".",
"putAll",
"(",
"dynamicAttrs",
")",
";",
"retu... | Sets dynamic attribute.
@param dynamicAttrs the dynamic attribute
@return this | [
"Sets",
"dynamic",
"attribute",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/client/ProviderInfo.java#L433-L437 |
arnaudroger/SimpleFlatMapper | sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/CrudDSL.java | CrudDSL.to | public Crud<T, K> to(Connection connection) throws SQLException {
"""
Create a connected crud validating it against the specified connection.
The table name is derived from the jpa annotation or from the class name.
@param connection the connection
@return a new crud instance
@throws SQLException if an error o... | java | public Crud<T, K> to(Connection connection) throws SQLException {
return table(connection, getTable(connection, target));
} | [
"public",
"Crud",
"<",
"T",
",",
"K",
">",
"to",
"(",
"Connection",
"connection",
")",
"throws",
"SQLException",
"{",
"return",
"table",
"(",
"connection",
",",
"getTable",
"(",
"connection",
",",
"target",
")",
")",
";",
"}"
] | Create a connected crud validating it against the specified connection.
The table name is derived from the jpa annotation or from the class name.
@param connection the connection
@return a new crud instance
@throws SQLException if an error occurred | [
"Create",
"a",
"connected",
"crud",
"validating",
"it",
"against",
"the",
"specified",
"connection",
".",
"The",
"table",
"name",
"is",
"derived",
"from",
"the",
"jpa",
"annotation",
"or",
"from",
"the",
"class",
"name",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/CrudDSL.java#L99-L101 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Curve.java | Curve.pointAt | public Vector2f pointAt(float t) {
"""
Get the point at a particular location on the curve
@param t A value between 0 and 1 defining the location of the curve the point is at
@return The point on the curve
"""
float a = 1 - t;
float b = t;
float f1 = a * a * a;
float f2 = 3 * a * a * b;
... | java | public Vector2f pointAt(float t) {
float a = 1 - t;
float b = t;
float f1 = a * a * a;
float f2 = 3 * a * a * b;
float f3 = 3 * a * b * b;
float f4 = b * b * b;
float nx = (p1.x * f1) + (c1.x * f2) + (c2.x * f3) + (p2.x * f4);
float ny = (p1.y * f1) + (c1.y * f2) + (c2.y * f3) + (p2.y * ... | [
"public",
"Vector2f",
"pointAt",
"(",
"float",
"t",
")",
"{",
"float",
"a",
"=",
"1",
"-",
"t",
";",
"float",
"b",
"=",
"t",
";",
"float",
"f1",
"=",
"a",
"*",
"a",
"*",
"a",
";",
"float",
"f2",
"=",
"3",
"*",
"a",
"*",
"a",
"*",
"b",
";"... | Get the point at a particular location on the curve
@param t A value between 0 and 1 defining the location of the curve the point is at
@return The point on the curve | [
"Get",
"the",
"point",
"at",
"a",
"particular",
"location",
"on",
"the",
"curve"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Curve.java#L59-L72 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/redis/Cache.java | Cache.decrBy | public Long decrBy(Object key, long longValue) {
"""
将 key 所储存的值减去减量 decrement 。
如果 key 不存在,那么 key 的值会先被初始化为 0 ,然后再执行 DECRBY 操作。
如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。
本操作的值限制在 64 位(bit)有符号数字表示之内。
关于更多递增(increment) / 递减(decrement)操作的更多信息,请参见 INCR 命令。
"""
Jedis jedis = getJedis();
try {
return jedis... | java | public Long decrBy(Object key, long longValue) {
Jedis jedis = getJedis();
try {
return jedis.decrBy(keyToBytes(key), longValue);
}
finally {close(jedis);}
} | [
"public",
"Long",
"decrBy",
"(",
"Object",
"key",
",",
"long",
"longValue",
")",
"{",
"Jedis",
"jedis",
"=",
"getJedis",
"(",
")",
";",
"try",
"{",
"return",
"jedis",
".",
"decrBy",
"(",
"keyToBytes",
"(",
"key",
")",
",",
"longValue",
")",
";",
"}",... | 将 key 所储存的值减去减量 decrement 。
如果 key 不存在,那么 key 的值会先被初始化为 0 ,然后再执行 DECRBY 操作。
如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。
本操作的值限制在 64 位(bit)有符号数字表示之内。
关于更多递增(increment) / 递减(decrement)操作的更多信息,请参见 INCR 命令。 | [
"将",
"key",
"所储存的值减去减量",
"decrement",
"。",
"如果",
"key",
"不存在,那么",
"key",
"的值会先被初始化为",
"0",
",然后再执行",
"DECRBY",
"操作。",
"如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。",
"本操作的值限制在",
"64",
"位",
"(",
"bit",
")",
"有符号数字表示之内。",
"关于更多递增",
"(",
"increment",
")",
"/",
"递减",
"(",... | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L201-L207 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readQuotedId | private String readQuotedId(boolean returnText) throws IOException, KriptonRuntimeException {
"""
Reads a quoted string, performing no entity escaping of the contents.
@param returnText the return text
@return the string
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeEx... | java | private String readQuotedId(boolean returnText) throws IOException, KriptonRuntimeException {
int quote = peekCharacter();
char[] delimiter;
if (quote == '"') {
delimiter = DOUBLE_QUOTE;
} else if (quote == '\'') {
delimiter = SINGLE_QUOTE;
} else {
throw new KriptonRuntimeException("Expected a quote... | [
"private",
"String",
"readQuotedId",
"(",
"boolean",
"returnText",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"int",
"quote",
"=",
"peekCharacter",
"(",
")",
";",
"char",
"[",
"]",
"delimiter",
";",
"if",
"(",
"quote",
"==",
"'",
"'",... | Reads a quoted string, performing no entity escaping of the contents.
@param returnText the return text
@return the string
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception | [
"Reads",
"a",
"quoted",
"string",
"performing",
"no",
"entity",
"escaping",
"of",
"the",
"contents",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L833-L845 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/ComponentAPI.java | ComponentAPI.api_component_token | public static ComponentAccessToken api_component_token(String component_appid, String component_appsecret, String component_verify_ticket) {
"""
获取公众号第三方平台access_token
@param component_appid 公众号第三方平台appid
@param component_appsecret 公众号第三方平台appsecret
@param component_verify_ticket 微信后台推送的ticket,此ti... | java | public static ComponentAccessToken api_component_token(String component_appid, String component_appsecret, String component_verify_ticket) {
String postJsonData = String.format("{\"component_appid\":\"%1$s\" ,\"component_appsecret\": \"%2$s\",\"component_verify_ticket\": \"%3$s\"}",
component_... | [
"public",
"static",
"ComponentAccessToken",
"api_component_token",
"(",
"String",
"component_appid",
",",
"String",
"component_appsecret",
",",
"String",
"component_verify_ticket",
")",
"{",
"String",
"postJsonData",
"=",
"String",
".",
"format",
"(",
"\"{\\\"component_ap... | 获取公众号第三方平台access_token
@param component_appid 公众号第三方平台appid
@param component_appsecret 公众号第三方平台appsecret
@param component_verify_ticket 微信后台推送的ticket,此ticket会定时推送,具体请见本页末尾的推送说明
@return 公众号第三方平台access_token | [
"获取公众号第三方平台access_token"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ComponentAPI.java#L108-L119 |
belaban/JGroups | src/org/jgroups/jmx/JmxConfigurator.java | JmxConfigurator.registerChannel | public static void registerChannel(JChannel channel, MBeanServer server, String name)
throws Exception {
"""
Registers an already created channel with the given MBeanServer. Wraps instance of JChannel
with DynamicMBean and delegates all calls to the actual JChannel wrapped.
<p>
This method w... | java | public static void registerChannel(JChannel channel, MBeanServer server, String name)
throws Exception {
registerChannel(channel, server, "jgroups", name, true);
} | [
"public",
"static",
"void",
"registerChannel",
"(",
"JChannel",
"channel",
",",
"MBeanServer",
"server",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"registerChannel",
"(",
"channel",
",",
"server",
",",
"\"jgroups\"",
",",
"name",
",",
"true",
")"... | Registers an already created channel with the given MBeanServer. Wraps instance of JChannel
with DynamicMBean and delegates all calls to the actual JChannel wrapped.
<p>
This method will also wrap each protocol in the given channel with DynamicMBean and register
it as well.
@param channel
@param server
@param name
Has... | [
"Registers",
"an",
"already",
"created",
"channel",
"with",
"the",
"given",
"MBeanServer",
".",
"Wraps",
"instance",
"of",
"JChannel",
"with",
"DynamicMBean",
"and",
"delegates",
"all",
"calls",
"to",
"the",
"actual",
"JChannel",
"wrapped",
".",
"<p",
">",
"Th... | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/jmx/JmxConfigurator.java#L78-L81 |
apereo/cas | support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/authn/OidcAccessTokenAuthenticator.java | OidcAccessTokenAuthenticator.validateIdTokenIfAny | protected void validateIdTokenIfAny(final AccessToken accessToken, final CommonProfile profile) throws MalformedClaimException {
"""
Validate id token if any.
@param accessToken the access token
@param profile the profile
@throws MalformedClaimException the malformed claim exception
"""
if (St... | java | protected void validateIdTokenIfAny(final AccessToken accessToken, final CommonProfile profile) throws MalformedClaimException {
if (StringUtils.isNotBlank(accessToken.getIdToken())) {
val idTokenResult = idTokenSigningAndEncryptionService.validate(accessToken.getIdToken());
profile.setI... | [
"protected",
"void",
"validateIdTokenIfAny",
"(",
"final",
"AccessToken",
"accessToken",
",",
"final",
"CommonProfile",
"profile",
")",
"throws",
"MalformedClaimException",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"accessToken",
".",
"getIdToken",
"(",
... | Validate id token if any.
@param accessToken the access token
@param profile the profile
@throws MalformedClaimException the malformed claim exception | [
"Validate",
"id",
"token",
"if",
"any",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/authn/OidcAccessTokenAuthenticator.java#L50-L56 |
guardtime/ksi-java-sdk | ksi-api/src/main/java/com/guardtime/ksi/unisignature/verifier/policies/ContextAwarePolicyAdapter.java | ContextAwarePolicyAdapter.createPolicy | public static ContextAwarePolicy createPolicy(Policy policy, PublicationsHandler handler, KSIExtendingService extendingService) {
"""
Method creating context aware policy using user provided policy with needed components.
@param policy
Policy.
@param handler
Publications handler.
@param extendingService
Ex... | java | public static ContextAwarePolicy createPolicy(Policy policy, PublicationsHandler handler, KSIExtendingService extendingService) {
if(policy instanceof UserProvidedPublicationBasedVerificationPolicy){
throw new IllegalArgumentException("Unsupported verification policy.");
}
Util.notNu... | [
"public",
"static",
"ContextAwarePolicy",
"createPolicy",
"(",
"Policy",
"policy",
",",
"PublicationsHandler",
"handler",
",",
"KSIExtendingService",
"extendingService",
")",
"{",
"if",
"(",
"policy",
"instanceof",
"UserProvidedPublicationBasedVerificationPolicy",
")",
"{",... | Method creating context aware policy using user provided policy with needed components.
@param policy
Policy.
@param handler
Publications handler.
@param extendingService
Extender client.
@return Policy with suitable context. | [
"Method",
"creating",
"context",
"aware",
"policy",
"using",
"user",
"provided",
"policy",
"with",
"needed",
"components",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-api/src/main/java/com/guardtime/ksi/unisignature/verifier/policies/ContextAwarePolicyAdapter.java#L161-L168 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/Medias.java | Medias.getWithSuffix | public static synchronized Media getWithSuffix(Media media, String suffix) {
"""
Get the media with an additional suffix, just before the dot of the extension if has.
@param media The current media reference (must not be <code>null</code>).
@param suffix The suffix to add (must not be <code>null</code>).
@ret... | java | public static synchronized Media getWithSuffix(Media media, String suffix)
{
Check.notNull(media);
Check.notNull(suffix);
final String path = media.getPath();
final int dotIndex = path.lastIndexOf(Constant.DOT);
if (dotIndex > -1)
{
return Medias... | [
"public",
"static",
"synchronized",
"Media",
"getWithSuffix",
"(",
"Media",
"media",
",",
"String",
"suffix",
")",
"{",
"Check",
".",
"notNull",
"(",
"media",
")",
";",
"Check",
".",
"notNull",
"(",
"suffix",
")",
";",
"final",
"String",
"path",
"=",
"me... | Get the media with an additional suffix, just before the dot of the extension if has.
@param media The current media reference (must not be <code>null</code>).
@param suffix The suffix to add (must not be <code>null</code>).
@return The new media with suffix added.
@throws LionEngineException If invalid parameters. | [
"Get",
"the",
"media",
"with",
"an",
"additional",
"suffix",
"just",
"before",
"the",
"dot",
"of",
"the",
"extension",
"if",
"has",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Medias.java#L192-L204 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ScriptVars.java | ScriptVars.setScriptVar | public static void setScriptVar(ScriptContext context, String key, String value) {
"""
Sets or removes a script variable.
<p>
The variable is removed when the {@code value} is {@code null}.
@param context the context of the script.
@param key the key of the variable.
@param value the value of the variable.
... | java | public static void setScriptVar(ScriptContext context, String key, String value) {
setScriptVarImpl(getScriptName(context), key, value);
} | [
"public",
"static",
"void",
"setScriptVar",
"(",
"ScriptContext",
"context",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"setScriptVarImpl",
"(",
"getScriptName",
"(",
"context",
")",
",",
"key",
",",
"value",
")",
";",
"}"
] | Sets or removes a script variable.
<p>
The variable is removed when the {@code value} is {@code null}.
@param context the context of the script.
@param key the key of the variable.
@param value the value of the variable.
@throws IllegalArgumentException if one of the following conditions is met:
<ul>
<li>The {@code co... | [
"Sets",
"or",
"removes",
"a",
"script",
"variable",
".",
"<p",
">",
"The",
"variable",
"is",
"removed",
"when",
"the",
"{",
"@code",
"value",
"}",
"is",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ScriptVars.java#L157-L159 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java | MavenModelScannerPlugin.getMavenArtifactDescriptor | private MavenArtifactDescriptor getMavenArtifactDescriptor(Dependency dependency, ScannerContext context) {
"""
Creates a MavenArtifactDescriptor and fills it with all information from
given dependency.
@param dependency
Dependency.
@param context
The scanner context.
@return The MavenArtifactDescriptor.
... | java | private MavenArtifactDescriptor getMavenArtifactDescriptor(Dependency dependency, ScannerContext context) {
DependencyCoordinates coordinates = new DependencyCoordinates(dependency);
return getArtifactResolver(context).resolve(coordinates, context);
} | [
"private",
"MavenArtifactDescriptor",
"getMavenArtifactDescriptor",
"(",
"Dependency",
"dependency",
",",
"ScannerContext",
"context",
")",
"{",
"DependencyCoordinates",
"coordinates",
"=",
"new",
"DependencyCoordinates",
"(",
"dependency",
")",
";",
"return",
"getArtifactR... | Creates a MavenArtifactDescriptor and fills it with all information from
given dependency.
@param dependency
Dependency.
@param context
The scanner context.
@return The MavenArtifactDescriptor. | [
"Creates",
"a",
"MavenArtifactDescriptor",
"and",
"fills",
"it",
"with",
"all",
"information",
"from",
"given",
"dependency",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L635-L638 |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/GrammarDirectoryScanner.java | GrammarDirectoryScanner.getTargetFiles | protected File [] getTargetFiles (final File targetDirectory, final String grammarFile, final GrammarInfo grammarInfo) {
"""
Determines the output files corresponding to the specified grammar file.
@param targetDirectory
The absolute path to the output directory for the target files, must
not be <code>null</c... | java | protected File [] getTargetFiles (final File targetDirectory, final String grammarFile, final GrammarInfo grammarInfo)
{
final File parserFile = new File (targetDirectory, grammarInfo.getParserFile ());
return new File [] { parserFile };
} | [
"protected",
"File",
"[",
"]",
"getTargetFiles",
"(",
"final",
"File",
"targetDirectory",
",",
"final",
"String",
"grammarFile",
",",
"final",
"GrammarInfo",
"grammarInfo",
")",
"{",
"final",
"File",
"parserFile",
"=",
"new",
"File",
"(",
"targetDirectory",
",",... | Determines the output files corresponding to the specified grammar file.
@param targetDirectory
The absolute path to the output directory for the target files, must
not be <code>null</code>.
@param grammarFile
The path to the grammar file, relative to the scanned source
directory, must not be <code>null</code>.
@param... | [
"Determines",
"the",
"output",
"files",
"corresponding",
"to",
"the",
"specified",
"grammar",
"file",
"."
] | train | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/GrammarDirectoryScanner.java#L220-L224 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Pipelines.java | Pipelines.watchers | public static Pipeline watchers(Context context, File baseDir, Mojo mojo, boolean pomFileMonitoring) {
"""
Creates a 'watching' pipeline.
@param context the Plexus context
@param baseDir the project's base directory
@param mojo the 'run' mojo
@param pomFileMonitoring flag enabling or disabling the pom file mon... | java | public static Pipeline watchers(Context context, File baseDir, Mojo mojo, boolean pomFileMonitoring) {
return new Pipeline(mojo, baseDir, Watchers.all(context), pomFileMonitoring);
} | [
"public",
"static",
"Pipeline",
"watchers",
"(",
"Context",
"context",
",",
"File",
"baseDir",
",",
"Mojo",
"mojo",
",",
"boolean",
"pomFileMonitoring",
")",
"{",
"return",
"new",
"Pipeline",
"(",
"mojo",
",",
"baseDir",
",",
"Watchers",
".",
"all",
"(",
"... | Creates a 'watching' pipeline.
@param context the Plexus context
@param baseDir the project's base directory
@param mojo the 'run' mojo
@param pomFileMonitoring flag enabling or disabling the pom file monitoring
@return the created pipeline | [
"Creates",
"a",
"watching",
"pipeline",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Pipelines.java#L53-L55 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.listByResourceGroupAsync | public Observable<Page<GenericResourceInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) {
"""
Get all the resources for a resource group.
@param resourceGroupName The resource group with the resources to get.
@param filter The filter t... | java | public Observable<Page<GenericResourceInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, expand, top)
.map(new Func1<ServiceResponse<Page<Generic... | [
"public",
"Observable",
"<",
"Page",
"<",
"GenericResourceInner",
">",
">",
"listByResourceGroupAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"filter",
",",
"final",
"String",
"expand",
",",
"final",
"Integer",
"top",
")",
"{",
"re... | Get all the resources for a resource group.
@param resourceGroupName The resource group with the resources to get.
@param filter The filter to apply on the operation.
@param expand The $expand query parameter
@param top The number of results to return. If null is passed, returns all resources.
@throws IllegalArgumentE... | [
"Get",
"all",
"the",
"resources",
"for",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L333-L341 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/mathematics/regularization/ElasticNetRegularizer.java | ElasticNetRegularizer.estimatePenalty | public static <K> double estimatePenalty(double l1, double l2, Map<K, Double> weights) {
"""
Estimates the penalty by adding the ElasticNet regularization.
@param l1
@param l2
@param weights
@param <K>
@return
"""
double penalty = 0.0;
penalty += L2Regularizer.estimatePenalty(l2, weights... | java | public static <K> double estimatePenalty(double l1, double l2, Map<K, Double> weights) {
double penalty = 0.0;
penalty += L2Regularizer.estimatePenalty(l2, weights);
penalty += L1Regularizer.estimatePenalty(l1, weights);
return penalty;
} | [
"public",
"static",
"<",
"K",
">",
"double",
"estimatePenalty",
"(",
"double",
"l1",
",",
"double",
"l2",
",",
"Map",
"<",
"K",
",",
"Double",
">",
"weights",
")",
"{",
"double",
"penalty",
"=",
"0.0",
";",
"penalty",
"+=",
"L2Regularizer",
".",
"estim... | Estimates the penalty by adding the ElasticNet regularization.
@param l1
@param l2
@param weights
@param <K>
@return | [
"Estimates",
"the",
"penalty",
"by",
"adding",
"the",
"ElasticNet",
"regularization",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/mathematics/regularization/ElasticNetRegularizer.java#L54-L59 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ReplaceableContextIterator.java | ReplaceableContextIterator.setContextLimits | public void setContextLimits(int contextStart, int contextLimit) {
"""
Set the start and limit indexes for context iteration with next().
@param contextStart Start of context for next().
@param contextLimit Limit of context for next().
"""
if(contextStart<0) {
this.contextStart=0;
... | java | public void setContextLimits(int contextStart, int contextLimit) {
if(contextStart<0) {
this.contextStart=0;
} else if(contextStart<=rep.length()) {
this.contextStart=contextStart;
} else {
this.contextStart=rep.length();
}
if(contextLimit<this... | [
"public",
"void",
"setContextLimits",
"(",
"int",
"contextStart",
",",
"int",
"contextLimit",
")",
"{",
"if",
"(",
"contextStart",
"<",
"0",
")",
"{",
"this",
".",
"contextStart",
"=",
"0",
";",
"}",
"else",
"if",
"(",
"contextStart",
"<=",
"rep",
".",
... | Set the start and limit indexes for context iteration with next().
@param contextStart Start of context for next().
@param contextLimit Limit of context for next(). | [
"Set",
"the",
"start",
"and",
"limit",
"indexes",
"for",
"context",
"iteration",
"with",
"next",
"()",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ReplaceableContextIterator.java#L96-L112 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBSchemaManager.java | CouchDBSchemaManager.createViewIfNotExist | private void createViewIfNotExist(Map<String, MapReduce> views, String columnName) {
"""
Creates the view if not exist.
@param views
the views
@param columnName
the column name
"""
if (views.get(columnName) == null)
{
createView(views, columnName);
}
} | java | private void createViewIfNotExist(Map<String, MapReduce> views, String columnName)
{
if (views.get(columnName) == null)
{
createView(views, columnName);
}
} | [
"private",
"void",
"createViewIfNotExist",
"(",
"Map",
"<",
"String",
",",
"MapReduce",
">",
"views",
",",
"String",
"columnName",
")",
"{",
"if",
"(",
"views",
".",
"get",
"(",
"columnName",
")",
"==",
"null",
")",
"{",
"createView",
"(",
"views",
",",
... | Creates the view if not exist.
@param views
the views
@param columnName
the column name | [
"Creates",
"the",
"view",
"if",
"not",
"exist",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBSchemaManager.java#L611-L617 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLInverseObjectPropertiesAxiomImpl_CustomFieldSerializer.java | OWLInverseObjectPropertiesAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLInverseObjectPropertiesAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@lin... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLInverseObjectPropertiesAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLInverseObjectPropertiesAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
... | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLInverseObjectPropertiesAxiomImpl_CustomFieldSerializer.java#L97-L100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.