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
phax/ph-pdf-layout
src/main/java/com/helger/pdflayout4/spec/FontSpec.java
FontSpec.getCloneWithDifferentFontSize
@Nonnull public FontSpec getCloneWithDifferentFontSize (final float fNewFontSize) { """ Return a clone of this object but with a different font size. @param fNewFontSize The new font size to use. Must be > 0. @return this if the font sizes are equal - a new object otherwise. """ ValueEnforcer.isG...
java
@Nonnull public FontSpec getCloneWithDifferentFontSize (final float fNewFontSize) { ValueEnforcer.isGT0 (fNewFontSize, "FontSize"); if (EqualsHelper.equals (fNewFontSize, m_fFontSize)) return this; return new FontSpec (m_aPreloadFont, fNewFontSize, m_aColor); }
[ "@", "Nonnull", "public", "FontSpec", "getCloneWithDifferentFontSize", "(", "final", "float", "fNewFontSize", ")", "{", "ValueEnforcer", ".", "isGT0", "(", "fNewFontSize", ",", "\"FontSize\"", ")", ";", "if", "(", "EqualsHelper", ".", "equals", "(", "fNewFontSize"...
Return a clone of this object but with a different font size. @param fNewFontSize The new font size to use. Must be > 0. @return this if the font sizes are equal - a new object otherwise.
[ "Return", "a", "clone", "of", "this", "object", "but", "with", "a", "different", "font", "size", "." ]
train
https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/spec/FontSpec.java#L129-L136
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/servlet/ServletBeanContext.java
ServletBeanContext.beginContext
public void beginContext(ServletContext context, ServletRequest req, ServletResponse resp) { """ Begins a new execution context, associated with a specific ServletRequest """ pushRequestContext(context, req, resp); super.beginContext(); }
java
public void beginContext(ServletContext context, ServletRequest req, ServletResponse resp) { pushRequestContext(context, req, resp); super.beginContext(); }
[ "public", "void", "beginContext", "(", "ServletContext", "context", ",", "ServletRequest", "req", ",", "ServletResponse", "resp", ")", "{", "pushRequestContext", "(", "context", ",", "req", ",", "resp", ")", ";", "super", ".", "beginContext", "(", ")", ";", ...
Begins a new execution context, associated with a specific ServletRequest
[ "Begins", "a", "new", "execution", "context", "associated", "with", "a", "specific", "ServletRequest" ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/servlet/ServletBeanContext.java#L81-L85
Azure/azure-sdk-for-java
network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java
VpnConnectionsInner.beginCreateOrUpdateAsync
public Observable<VpnConnectionInner> beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { """ Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @param resourceGroupN...
java
public Observable<VpnConnectionInner> beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Fu...
[ "public", "Observable", "<", "VpnConnectionInner", ">", "beginCreateOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "gatewayName", ",", "String", "connectionName", ",", "VpnConnectionInner", "vpnConnectionParameters", ")", "{", "return", "beginCreateOrUpd...
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @param resourceGroupName The resource group name of the VpnGateway. @param gatewayName The name of the gateway. @param connectionName The name of the connection. @param vpnConnectionParameters Parameters suppli...
[ "Creates", "a", "vpn", "connection", "to", "a", "scalable", "vpn", "gateway", "if", "it", "doesn", "t", "exist", "else", "updates", "the", "existing", "connection", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java#L308-L315
windup/windup
rules-base/api/src/main/java/org/jboss/windup/rules/files/condition/FileContent.java
FileContent.fileNameInput
private void fileNameInput(List<FileModel> vertices, GraphRewrite event, ParameterStore store) { """ Generating the input vertices is quite complex. Therefore there are multiple methods that handles the input vertices based on the attribute specified in specific order. This method handles the {@link FileContent#i...
java
private void fileNameInput(List<FileModel> vertices, GraphRewrite event, ParameterStore store) { if (this.filenamePattern != null) { Pattern filenameRegex = filenamePattern.getCompiledPattern(store); //in case the filename is the first operation generating result, we can use ...
[ "private", "void", "fileNameInput", "(", "List", "<", "FileModel", ">", "vertices", ",", "GraphRewrite", "event", ",", "ParameterStore", "store", ")", "{", "if", "(", "this", ".", "filenamePattern", "!=", "null", ")", "{", "Pattern", "filenameRegex", "=", "f...
Generating the input vertices is quite complex. Therefore there are multiple methods that handles the input vertices based on the attribute specified in specific order. This method handles the {@link FileContent#inFileNamed(String)} attribute.
[ "Generating", "the", "input", "vertices", "is", "quite", "complex", ".", "Therefore", "there", "are", "multiple", "methods", "that", "handles", "the", "input", "vertices", "based", "on", "the", "attribute", "specified", "in", "specific", "order", ".", "This", ...
train
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-base/api/src/main/java/org/jboss/windup/rules/files/condition/FileContent.java#L303-L323
comapi/comapi-sdk-android
COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java
InternalService.queryMessages
public void queryMessages(@NonNull final String conversationId, final Long from, @NonNull final Integer limit, @Nullable Callback<ComapiResult<MessagesQueryResponse>> callback) { """ Query chanel messages. @param conversationId ID of a conversation to query messages in it. @param from ID of the messa...
java
public void queryMessages(@NonNull final String conversationId, final Long from, @NonNull final Integer limit, @Nullable Callback<ComapiResult<MessagesQueryResponse>> callback) { adapter.adapt(queryMessages(conversationId, from, limit), callback); }
[ "public", "void", "queryMessages", "(", "@", "NonNull", "final", "String", "conversationId", ",", "final", "Long", "from", ",", "@", "NonNull", "final", "Integer", "limit", ",", "@", "Nullable", "Callback", "<", "ComapiResult", "<", "MessagesQueryResponse", ">",...
Query chanel messages. @param conversationId ID of a conversation to query messages in it. @param from ID of the message to start from. @param limit Limit of events to obtain in this call. @param callback Callback to deliver new session instance.
[ "Query", "chanel", "messages", "." ]
train
https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L902-L904
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java
TmdbTV.getTVImages
public ResultList<Artwork> getTVImages(int tvID, String language, String... includeImageLanguage) throws MovieDbException { """ Get the images (posters and backdrops) for a TV series. @param tvID @param language @param includeImageLanguage @return @throws com.omertron.themoviedbapi.MovieDbException """ ...
java
public ResultList<Artwork> getTVImages(int tvID, String language, String... includeImageLanguage) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); parameters.add(Param.LANGUAGE, language); parameters.add(Param.INCLUDE_IMAGE_LANGU...
[ "public", "ResultList", "<", "Artwork", ">", "getTVImages", "(", "int", "tvID", ",", "String", "language", ",", "String", "...", "includeImageLanguage", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")",...
Get the images (posters and backdrops) for a TV series. @param tvID @param language @param includeImageLanguage @return @throws com.omertron.themoviedbapi.MovieDbException
[ "Get", "the", "images", "(", "posters", "and", "backdrops", ")", "for", "a", "TV", "series", "." ]
train
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java#L222-L239
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.restoreCertificateAsync
public Observable<CertificateBundle> restoreCertificateAsync(String vaultBaseUrl, byte[] certificateBundleBackup) { """ Restores a backed up certificate to a vault. Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. @param vaultBaseU...
java
public Observable<CertificateBundle> restoreCertificateAsync(String vaultBaseUrl, byte[] certificateBundleBackup) { return restoreCertificateWithServiceResponseAsync(vaultBaseUrl, certificateBundleBackup).map(new Func1<ServiceResponse<CertificateBundle>, CertificateBundle>() { @Override ...
[ "public", "Observable", "<", "CertificateBundle", ">", "restoreCertificateAsync", "(", "String", "vaultBaseUrl", ",", "byte", "[", "]", "certificateBundleBackup", ")", "{", "return", "restoreCertificateWithServiceResponseAsync", "(", "vaultBaseUrl", ",", "certificateBundleB...
Restores a backed up certificate to a vault. Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param certificateBundleBackup The backup blob associated with a...
[ "Restores", "a", "backed", "up", "certificate", "to", "a", "vault", ".", "Restores", "a", "backed", "up", "certificate", "and", "all", "its", "versions", "to", "a", "vault", ".", "This", "operation", "requires", "the", "certificates", "/", "restore", "permis...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L8230-L8237
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPP8Reader.java
MPP8Reader.processHyperlinkData
private void processHyperlinkData(Task task, byte[] data) { """ This method is used to extract the task hyperlink attributes from a block of data and call the appropriate modifier methods to configure the specified task object. @param task task instance @param data hyperlink data block """ if (data...
java
private void processHyperlinkData(Task task, byte[] data) { if (data != null) { int offset = 12; String hyperlink; String address; String subaddress; offset += 12; hyperlink = MPPUtility.getUnicodeString(data, offset); offset += ((hyperlink....
[ "private", "void", "processHyperlinkData", "(", "Task", "task", ",", "byte", "[", "]", "data", ")", "{", "if", "(", "data", "!=", "null", ")", "{", "int", "offset", "=", "12", ";", "String", "hyperlink", ";", "String", "address", ";", "String", "subadd...
This method is used to extract the task hyperlink attributes from a block of data and call the appropriate modifier methods to configure the specified task object. @param task task instance @param data hyperlink data block
[ "This", "method", "is", "used", "to", "extract", "the", "task", "hyperlink", "attributes", "from", "a", "block", "of", "data", "and", "call", "the", "appropriate", "modifier", "methods", "to", "configure", "the", "specified", "task", "object", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP8Reader.java#L782-L806
emilsjolander/sprinkles
library/src/main/java/se/emilsjolander/sprinkles/ManyQuery.java
ManyQuery.getAsync
@TargetApi(Build.VERSION_CODES.HONEYCOMB) public int getAsync(LoaderManager lm, ResultHandler<T> handler, Class<? extends Model>... respondsToUpdatedOf) { """ Execute the query asynchronously @param lm The loader manager to use for loading the data @param handler The ResultHandler to notify of the quer...
java
@TargetApi(Build.VERSION_CODES.HONEYCOMB) public int getAsync(LoaderManager lm, ResultHandler<T> handler, Class<? extends Model>... respondsToUpdatedOf) { if (Model.class.isAssignableFrom(resultClass)) { respondsToUpdatedOf = Utils.concatArrays(respondsToUpdatedOf, new Class[]{resultClass}); ...
[ "@", "TargetApi", "(", "Build", ".", "VERSION_CODES", ".", "HONEYCOMB", ")", "public", "int", "getAsync", "(", "LoaderManager", "lm", ",", "ResultHandler", "<", "T", ">", "handler", ",", "Class", "<", "?", "extends", "Model", ">", "...", "respondsToUpdatedOf...
Execute the query asynchronously @param lm The loader manager to use for loading the data @param handler The ResultHandler to notify of the query result and any updates to that result. @param respondsToUpdatedOf A list of models excluding the queried model that should also trigger a update to the result if they chan...
[ "Execute", "the", "query", "asynchronously" ]
train
https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/ManyQuery.java#L69-L77
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java
PolylineSplitMerge.setSplitVariables
void setSplitVariables(List<Point2D_I32> contour, Element<Corner> e0, Element<Corner> e1) { """ Selects and splits the side defined by the e0 corner. If convex a check is performed to ensure that the polyline will be convex still. """ int distance0 = CircularIndex.distanceP(e0.object.index, e1.object.index...
java
void setSplitVariables(List<Point2D_I32> contour, Element<Corner> e0, Element<Corner> e1) { int distance0 = CircularIndex.distanceP(e0.object.index, e1.object.index, contour.size()); int index0 = CircularIndex.plusPOffset(e0.object.index,minimumSideLength,contour.size()); int index1 = CircularIndex.minusPOffset...
[ "void", "setSplitVariables", "(", "List", "<", "Point2D_I32", ">", "contour", ",", "Element", "<", "Corner", ">", "e0", ",", "Element", "<", "Corner", ">", "e1", ")", "{", "int", "distance0", "=", "CircularIndex", ".", "distanceP", "(", "e0", ".", "objec...
Selects and splits the side defined by the e0 corner. If convex a check is performed to ensure that the polyline will be convex still.
[ "Selects", "and", "splits", "the", "side", "defined", "by", "the", "e0", "corner", ".", "If", "convex", "a", "check", "is", "performed", "to", "ensure", "that", "the", "polyline", "will", "be", "convex", "still", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L678-L712
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/ringsearch/RingPartitioner.java
RingPartitioner.walkRingSystem
private static IRingSet walkRingSystem(IRingSet rs, IRing ring, IRingSet newRs) { """ Perform a walk in the given RingSet, starting at a given Ring and recursively searching for other Rings connected to this ring. By doing this it finds all rings in the RingSet connected to the start ring, putting them in newRs...
java
private static IRingSet walkRingSystem(IRingSet rs, IRing ring, IRingSet newRs) { IRing tempRing; IRingSet tempRings = rs.getConnectedRings(ring); // logger.debug("walkRingSystem -> tempRings.size(): " + tempRings.size()); rs.removeAtomContainer(ring); for (IAtomContainer ...
[ "private", "static", "IRingSet", "walkRingSystem", "(", "IRingSet", "rs", ",", "IRing", "ring", ",", "IRingSet", "newRs", ")", "{", "IRing", "tempRing", ";", "IRingSet", "tempRings", "=", "rs", ".", "getConnectedRings", "(", "ring", ")", ";", "// logger...
Perform a walk in the given RingSet, starting at a given Ring and recursively searching for other Rings connected to this ring. By doing this it finds all rings in the RingSet connected to the start ring, putting them in newRs, and removing them from rs. @param rs The RingSet to be searched @param ring The rin...
[ "Perform", "a", "walk", "in", "the", "given", "RingSet", "starting", "at", "a", "given", "Ring", "and", "recursively", "searching", "for", "other", "Rings", "connected", "to", "this", "ring", ".", "By", "doing", "this", "it", "finds", "all", "rings", "in",...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/ringsearch/RingPartitioner.java#L120-L133
RestComm/media-core
ice/src/main/java/org/restcomm/media/core/ice/network/stun/StunHandler.java
StunHandler.canHandle
@Override public boolean canHandle(byte[] data, int length, int offset) { """ /* All STUN messages MUST start with a 20-byte header followed by zero or more Attributes. The STUN header contains a STUN message type, magic cookie, transaction ID, and message length. 0 1 2 ...
java
@Override public boolean canHandle(byte[] data, int length, int offset) { /* * All STUN messages MUST start with a 20-byte header followed by zero * or more Attributes. */ if(length >= 20) { // The most significant 2 bits of every STUN message MUST be zeroes. byte b0 = data[offset]; boolean first...
[ "@", "Override", "public", "boolean", "canHandle", "(", "byte", "[", "]", "data", ",", "int", "length", ",", "int", "offset", ")", "{", "/*\n\t\t * All STUN messages MUST start with a 20-byte header followed by zero\n\t\t * or more Attributes.\n\t\t */", "if", "(", "length"...
/* All STUN messages MUST start with a 20-byte header followed by zero or more Attributes. The STUN header contains a STUN message type, magic cookie, transaction ID, and message length. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-...
[ "/", "*", "All", "STUN", "messages", "MUST", "start", "with", "a", "20", "-", "byte", "header", "followed", "by", "zero", "or", "more", "Attributes", ".", "The", "STUN", "header", "contains", "a", "STUN", "message", "type", "magic", "cookie", "transaction"...
train
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/network/stun/StunHandler.java#L220-L239
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java
SecureUtil.generateKey
public static SecretKey generateKey(String algorithm, KeySpec keySpec) { """ 生成 {@link SecretKey},仅用于对称加密和摘要算法 @param algorithm 算法 @param keySpec {@link KeySpec} @return {@link SecretKey} """ return KeyUtil.generateKey(algorithm, keySpec); }
java
public static SecretKey generateKey(String algorithm, KeySpec keySpec) { return KeyUtil.generateKey(algorithm, keySpec); }
[ "public", "static", "SecretKey", "generateKey", "(", "String", "algorithm", ",", "KeySpec", "keySpec", ")", "{", "return", "KeyUtil", ".", "generateKey", "(", "algorithm", ",", "keySpec", ")", ";", "}" ]
生成 {@link SecretKey},仅用于对称加密和摘要算法 @param algorithm 算法 @param keySpec {@link KeySpec} @return {@link SecretKey}
[ "生成", "{", "@link", "SecretKey", "}", ",仅用于对称加密和摘要算法" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L129-L131
b3log/latke
latke-core/src/main/java/org/b3log/latke/util/Locales.java
Locales.getLocale
public static Locale getLocale(final String localeString) { """ Gest a {@link java.util.Locale} with the specified locale string. @param localeString the specified locale string @return locale """ final String language = getLanguage(localeString); final String country = getCountry(localeStr...
java
public static Locale getLocale(final String localeString) { final String language = getLanguage(localeString); final String country = getCountry(localeString); // // XXX: variant return new Locale(language, country); }
[ "public", "static", "Locale", "getLocale", "(", "final", "String", "localeString", ")", "{", "final", "String", "language", "=", "getLanguage", "(", "localeString", ")", ";", "final", "String", "country", "=", "getCountry", "(", "localeString", ")", ";", "// /...
Gest a {@link java.util.Locale} with the specified locale string. @param localeString the specified locale string @return locale
[ "Gest", "a", "{", "@link", "java", ".", "util", ".", "Locale", "}", "with", "the", "specified", "locale", "string", "." ]
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/util/Locales.java#L223-L229
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java
DatasetId.of
public static DatasetId of(String project, String dataset) { """ Creates a dataset identity given project's and dataset's user-defined ids. """ return new DatasetId(checkNotNull(project), checkNotNull(dataset)); }
java
public static DatasetId of(String project, String dataset) { return new DatasetId(checkNotNull(project), checkNotNull(dataset)); }
[ "public", "static", "DatasetId", "of", "(", "String", "project", ",", "String", "dataset", ")", "{", "return", "new", "DatasetId", "(", "checkNotNull", "(", "project", ")", ",", "checkNotNull", "(", "dataset", ")", ")", ";", "}" ]
Creates a dataset identity given project's and dataset's user-defined ids.
[ "Creates", "a", "dataset", "identity", "given", "project", "s", "and", "dataset", "s", "user", "-", "defined", "ids", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java#L49-L51
cdk/cdk
storage/smiles/src/main/java/org/openscience/cdk/smiles/BeamToCDK.java
BeamToCDK.toCDKAtom
IAtom toCDKAtom(Atom beamAtom, int hCount) { """ Create a new CDK {@link IAtom} from the Beam Atom. @param beamAtom an Atom from the Beam ChemicalGraph @param hCount hydrogen count for the atom @return the CDK atom to have it's properties set """ IAtom cdkAtom = newCDKAtom(beamAtom); c...
java
IAtom toCDKAtom(Atom beamAtom, int hCount) { IAtom cdkAtom = newCDKAtom(beamAtom); cdkAtom.setImplicitHydrogenCount(hCount); cdkAtom.setFormalCharge(beamAtom.charge()); if (beamAtom.isotope() >= 0) cdkAtom.setMassNumber(beamAtom.isotope()); if (beamAtom.aromatic()) cdkAtom.se...
[ "IAtom", "toCDKAtom", "(", "Atom", "beamAtom", ",", "int", "hCount", ")", "{", "IAtom", "cdkAtom", "=", "newCDKAtom", "(", "beamAtom", ")", ";", "cdkAtom", ".", "setImplicitHydrogenCount", "(", "hCount", ")", ";", "cdkAtom", ".", "setFormalCharge", "(", "bea...
Create a new CDK {@link IAtom} from the Beam Atom. @param beamAtom an Atom from the Beam ChemicalGraph @param hCount hydrogen count for the atom @return the CDK atom to have it's properties set
[ "Create", "a", "new", "CDK", "{", "@link", "IAtom", "}", "from", "the", "Beam", "Atom", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/BeamToCDK.java#L603-L617
fredszaq/Rezenerator
rezenerator-core/src/main/java/com/tlorrain/android/rezenerator/core/definition/DefinitionReader.java
DefinitionReader.computeDef
private Dimensions computeDef(final String propName) { """ Computes a def from a property name. The string contained in the property must have this format : valName[.methodOnDefinitions(int)]+ @param propName the property containg the def to compute @return a {@link Dimensions} created by applying the method...
java
private Dimensions computeDef(final String propName) { final String property = definition.getProperty(propName); final Matcher multiMethodCallMatcher = CALLS.matcher(property); if (multiMethodCallMatcher.matches()) { final String[] methodsLiterals = property.split(CALL_REG); final String dependancyName = mu...
[ "private", "Dimensions", "computeDef", "(", "final", "String", "propName", ")", "{", "final", "String", "property", "=", "definition", ".", "getProperty", "(", "propName", ")", ";", "final", "Matcher", "multiMethodCallMatcher", "=", "CALLS", ".", "matcher", "(",...
Computes a def from a property name. The string contained in the property must have this format : valName[.methodOnDefinitions(int)]+ @param propName the property containg the def to compute @return a {@link Dimensions} created by applying the method calls on the val
[ "Computes", "a", "def", "from", "a", "property", "name", ".", "The", "string", "contained", "in", "the", "property", "must", "have", "this", "format", ":", "valName", "[", ".", "methodOnDefinitions", "(", "int", ")", "]", "+" ]
train
https://github.com/fredszaq/Rezenerator/blob/e0f5e17c39e3f8742615c30677768665c75803cd/rezenerator-core/src/main/java/com/tlorrain/android/rezenerator/core/definition/DefinitionReader.java#L70-L96
zaproxy/zaproxy
src/org/zaproxy/zap/utils/LocaleUtils.java
LocaleUtils.createResourceFilesPattern
public static Pattern createResourceFilesPattern(String fileName, String fileExtension) { """ Returns a {@code Pattern} to match source and translated resource filenames with the given {@code fileName} and {@code fileExtension}. <p> For example, with {@code fileName} as "Messages" and {@code fileExtension} as "...
java
public static Pattern createResourceFilesPattern(String fileName, String fileExtension) { return Pattern.compile(createResourceFilesRegex(fileName, fileExtension)); }
[ "public", "static", "Pattern", "createResourceFilesPattern", "(", "String", "fileName", ",", "String", "fileExtension", ")", "{", "return", "Pattern", ".", "compile", "(", "createResourceFilesRegex", "(", "fileName", ",", "fileExtension", ")", ")", ";", "}" ]
Returns a {@code Pattern} to match source and translated resource filenames with the given {@code fileName} and {@code fileExtension}. <p> For example, with {@code fileName} as "Messages" and {@code fileExtension} as ".properties" the returned pattern would match: <ul> <li>Messages.properties</li> <li>Messages_en.prope...
[ "Returns", "a", "{", "@code", "Pattern", "}", "to", "match", "source", "and", "translated", "resource", "filenames", "with", "the", "given", "{", "@code", "fileName", "}", "and", "{", "@code", "fileExtension", "}", ".", "<p", ">", "For", "example", "with",...
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/LocaleUtils.java#L342-L344
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java
Dl4jReflection.setProperties
public static void setProperties(Object obj, Properties props) throws Exception { """ Sets the properties of the given object @param obj the object o set @param props the properties to set """ for (Field field : obj.getClass().getDeclaredFields()) { field.setAccessible(true); ...
java
public static void setProperties(Object obj, Properties props) throws Exception { for (Field field : obj.getClass().getDeclaredFields()) { field.setAccessible(true); if (props.containsKey(field.getName())) { set(field, obj, props.getProperty(field.getName())); ...
[ "public", "static", "void", "setProperties", "(", "Object", "obj", ",", "Properties", "props", ")", "throws", "Exception", "{", "for", "(", "Field", "field", ":", "obj", ".", "getClass", "(", ")", ".", "getDeclaredFields", "(", ")", ")", "{", "field", "....
Sets the properties of the given object @param obj the object o set @param props the properties to set
[ "Sets", "the", "properties", "of", "the", "given", "object" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java#L70-L78
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/geom/Circle.java
Circle.intersects
private boolean intersects(Rectangle other) { """ Check if this circle touches a rectangle @param other The rectangle to check against @return True if they touch """ Rectangle box = other; Circle circle = this; if (box.contains(x+radius,y+radius)) { return true; } float x1 = box....
java
private boolean intersects(Rectangle other) { Rectangle box = other; Circle circle = this; if (box.contains(x+radius,y+radius)) { return true; } float x1 = box.getX(); float y1 = box.getY(); float x2 = box.getX() + box.getWidth(); float y2 = box.getY() + box.getHeight(); Line[...
[ "private", "boolean", "intersects", "(", "Rectangle", "other", ")", "{", "Rectangle", "box", "=", "other", ";", "Circle", "circle", "=", "this", ";", "if", "(", "box", ".", "contains", "(", "x", "+", "radius", ",", "y", "+", "radius", ")", ")", "{", ...
Check if this circle touches a rectangle @param other The rectangle to check against @return True if they touch
[ "Check", "if", "this", "circle", "touches", "a", "rectangle" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Circle.java#L166-L197
ologolo/streamline-api
src/org/daisy/streamline/api/config/UserConfigurationsCollection.java
UserConfigurationsCollection.addConfiguration
public synchronized Optional<String> addConfiguration(String niceName, String description, Map<String, Object> config) { """ Adds a configuration to this catalog. @param niceName the display name @param description the configuration description @param config the configuration details @return the identifier for...
java
public synchronized Optional<String> addConfiguration(String niceName, String description, Map<String, Object> config) { try { if (catalog==null) { throw new FileNotFoundException(); } return sync(()-> { ConfigurationDetails p = new ConfigurationDetails.Builder(inventory.nextIdentifier()) .nice...
[ "public", "synchronized", "Optional", "<", "String", ">", "addConfiguration", "(", "String", "niceName", ",", "String", "description", ",", "Map", "<", "String", ",", "Object", ">", "config", ")", "{", "try", "{", "if", "(", "catalog", "==", "null", ")", ...
Adds a configuration to this catalog. @param niceName the display name @param description the configuration description @param config the configuration details @return the identifier for the new configuration, or an empty optional if the configuration could not be added
[ "Adds", "a", "configuration", "to", "this", "catalog", "." ]
train
https://github.com/ologolo/streamline-api/blob/4934b6da1de06e364ae90d6ea9b0929500da9cdb/src/org/daisy/streamline/api/config/UserConfigurationsCollection.java#L102-L124
yanzhenjie/AndServer
sample/src/main/java/com/yanzhenjie/andserver/sample/util/JsonUtils.java
JsonUtils.failedJson
public static String failedJson(int code, String message) { """ Business is failed. @param code error code. @param message message. @return json. """ ReturnData returnData = new ReturnData(); returnData.setSuccess(false); returnData.setErrorCode(code); returnData.setError...
java
public static String failedJson(int code, String message) { ReturnData returnData = new ReturnData(); returnData.setSuccess(false); returnData.setErrorCode(code); returnData.setErrorMsg(message); return JSON.toJSONString(returnData); }
[ "public", "static", "String", "failedJson", "(", "int", "code", ",", "String", "message", ")", "{", "ReturnData", "returnData", "=", "new", "ReturnData", "(", ")", ";", "returnData", ".", "setSuccess", "(", "false", ")", ";", "returnData", ".", "setErrorCode...
Business is failed. @param code error code. @param message message. @return json.
[ "Business", "is", "failed", "." ]
train
https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/util/JsonUtils.java#L51-L57
comapi/comapi-chat-sdk-android
COMAPI/chat/src/main/java/com/comapi/chat/ChatController.java
ChatController.synchroniseStore
Observable<ChatResult> synchroniseStore() { """ Check state for all conversations and update from services. @return Result of synchronisation process. """ if (isSynchronising.getAndSet(true)) { log.i("Synchronisation in progress."); return Observable.fromCallable(() -> new Ch...
java
Observable<ChatResult> synchroniseStore() { if (isSynchronising.getAndSet(true)) { log.i("Synchronisation in progress."); return Observable.fromCallable(() -> new ChatResult(true, null)); } log.i("Synchronising store."); return synchroniseConversations() ...
[ "Observable", "<", "ChatResult", ">", "synchroniseStore", "(", ")", "{", "if", "(", "isSynchronising", ".", "getAndSet", "(", "true", ")", ")", "{", "log", ".", "i", "(", "\"Synchronisation in progress.\"", ")", ";", "return", "Observable", ".", "fromCallable"...
Check state for all conversations and update from services. @return Result of synchronisation process.
[ "Check", "state", "for", "all", "conversations", "and", "update", "from", "services", "." ]
train
https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/ChatController.java#L332-L348
landawn/AbacusUtil
src/com/landawn/abacus/util/JdbcUtil.java
JdbcUtil.importData
public static <E extends Exception> long importData(final File file, final long offset, final long count, final PreparedStatement stmt, final int batchSize, final int batchInterval, final Try.Function<String, Object[], E> func) throws UncheckedSQLException, E { """ Imports the data from file to databa...
java
public static <E extends Exception> long importData(final File file, final long offset, final long count, final PreparedStatement stmt, final int batchSize, final int batchInterval, final Try.Function<String, Object[], E> func) throws UncheckedSQLException, E { Reader reader = null; try...
[ "public", "static", "<", "E", "extends", "Exception", ">", "long", "importData", "(", "final", "File", "file", ",", "final", "long", "offset", ",", "final", "long", "count", ",", "final", "PreparedStatement", "stmt", ",", "final", "int", "batchSize", ",", ...
Imports the data from file to database. @param file @param offset @param count @param stmt @param batchSize @param batchInterval @param func convert line to the parameters for record insert. Returns a <code>null</code> array to skip the line. @return @throws UncheckedSQLException
[ "Imports", "the", "data", "from", "file", "to", "database", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2532-L2545
Impetus/Kundera
src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClientFactory.java
DSClientFactory.buildWhiteListCollection
private Collection<InetSocketAddress> buildWhiteListCollection(String whiteList) { """ Builds the white list collection. @param whiteList the white list @return the collection """ String[] list = whiteList.split(Constants.COMMA); Collection<InetSocketAddress> whiteListCollection = new Arra...
java
private Collection<InetSocketAddress> buildWhiteListCollection(String whiteList) { String[] list = whiteList.split(Constants.COMMA); Collection<InetSocketAddress> whiteListCollection = new ArrayList<InetSocketAddress>(); PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getA...
[ "private", "Collection", "<", "InetSocketAddress", ">", "buildWhiteListCollection", "(", "String", "whiteList", ")", "{", "String", "[", "]", "list", "=", "whiteList", ".", "split", "(", "Constants", ".", "COMMA", ")", ";", "Collection", "<", "InetSocketAddress"...
Builds the white list collection. @param whiteList the white list @return the collection
[ "Builds", "the", "white", "list", "collection", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClientFactory.java#L611-L658
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/CollectionUtils.java
CollectionUtils.sampleWithoutReplacement
public static <E> Collection<E> sampleWithoutReplacement(Collection<E> c, int n, Random r) { """ Samples without replacement from a collection, using your own {@link Random} number generator. @param c The collection to be sampled from @param n The number of samples to take @param r the random number gener...
java
public static <E> Collection<E> sampleWithoutReplacement(Collection<E> c, int n, Random r) { if (n < 0) throw new IllegalArgumentException("n < 0: " + n); if (n > c.size()) throw new IllegalArgumentException("n > size of collection: " + n + ", " + c.size()); List<E> copy = new ArrayList<E>(...
[ "public", "static", "<", "E", ">", "Collection", "<", "E", ">", "sampleWithoutReplacement", "(", "Collection", "<", "E", ">", "c", ",", "int", "n", ",", "Random", "r", ")", "{", "if", "(", "n", "<", "0", ")", "throw", "new", "IllegalArgumentException",...
Samples without replacement from a collection, using your own {@link Random} number generator. @param c The collection to be sampled from @param n The number of samples to take @param r the random number generator @return a new collection with the sample
[ "Samples", "without", "replacement", "from", "a", "collection", "using", "your", "own", "{", "@link", "Random", "}", "number", "generator", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/CollectionUtils.java#L347-L361
mojohaus/xml-maven-plugin
src/main/java/org/codehaus/mojo/xml/Resolver.java
Resolver.resolveEntity
public InputSource resolveEntity( String pName, String pPublicId, String pBaseURI, String pSystemId ) throws SAXException, IOException { """ Implementation of {@link EntityResolver2#resolveEntity(String, String, String, String)} """ final InputSource source = resolver.resolveEntity( pPublicId, ...
java
public InputSource resolveEntity( String pName, String pPublicId, String pBaseURI, String pSystemId ) throws SAXException, IOException { final InputSource source = resolver.resolveEntity( pPublicId, pSystemId ); if ( source != null ) { return source; } URI...
[ "public", "InputSource", "resolveEntity", "(", "String", "pName", ",", "String", "pPublicId", ",", "String", "pBaseURI", ",", "String", "pSystemId", ")", "throws", "SAXException", ",", "IOException", "{", "final", "InputSource", "source", "=", "resolver", ".", "...
Implementation of {@link EntityResolver2#resolveEntity(String, String, String, String)}
[ "Implementation", "of", "{" ]
train
https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/Resolver.java#L450-L475
hdbeukel/james-core
src/main/java/org/jamesframework/core/subset/neigh/adv/MultiSwapNeighbourhood.java
MultiSwapNeighbourhood.getRandomMove
@Override public SubsetMove getRandomMove(SubsetSolution solution, Random rnd) { """ <p> Generates a move for the given subset solution that removes a random subset of IDs from the current selection and replaces them with an equally large random subset of the currently unselected IDs. Possible fixed IDs are ...
java
@Override public SubsetMove getRandomMove(SubsetSolution solution, Random rnd) { // get set of candidate IDs for deletion and addition (fixed IDs are discarded) Set<Integer> removeCandidates = getRemoveCandidates(solution); Set<Integer> addCandidates = getAddCandidates(solution); // ...
[ "@", "Override", "public", "SubsetMove", "getRandomMove", "(", "SubsetSolution", "solution", ",", "Random", "rnd", ")", "{", "// get set of candidate IDs for deletion and addition (fixed IDs are discarded)", "Set", "<", "Integer", ">", "removeCandidates", "=", "getRemoveCandi...
<p> Generates a move for the given subset solution that removes a random subset of IDs from the current selection and replaces them with an equally large random subset of the currently unselected IDs. Possible fixed IDs are not considered to be swapped. The maximum number of swaps \(k\) specified at construction is res...
[ "<p", ">", "Generates", "a", "move", "for", "the", "given", "subset", "solution", "that", "removes", "a", "random", "subset", "of", "IDs", "from", "the", "current", "selection", "and", "replaces", "them", "with", "an", "equally", "large", "random", "subset",...
train
https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/adv/MultiSwapNeighbourhood.java#L140-L160
Nexmo/nexmo-java
src/main/java/com/nexmo/client/account/AccountClient.java
AccountClient.getPrefixPrice
public PrefixPricingResponse getPrefixPrice(ServiceType type, String prefix) throws IOException, NexmoClientException { """ Retrieve the pricing for a specified prefix. @param type The type of service to retrieve pricing for. @param prefix The prefix to retrieve the pricing for. @return PrefixPricingRespo...
java
public PrefixPricingResponse getPrefixPrice(ServiceType type, String prefix) throws IOException, NexmoClientException { return getPrefixPrice(new PrefixPricingRequest(type, prefix)); }
[ "public", "PrefixPricingResponse", "getPrefixPrice", "(", "ServiceType", "type", ",", "String", "prefix", ")", "throws", "IOException", ",", "NexmoClientException", "{", "return", "getPrefixPrice", "(", "new", "PrefixPricingRequest", "(", "type", ",", "prefix", ")", ...
Retrieve the pricing for a specified prefix. @param type The type of service to retrieve pricing for. @param prefix The prefix to retrieve the pricing for. @return PrefixPricingResponse object which contains the results from the API. @throws IOException if a network error occurred contacting the Nexmo Acc...
[ "Retrieve", "the", "pricing", "for", "a", "specified", "prefix", "." ]
train
https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/account/AccountClient.java#L108-L110
googleapis/google-http-java-client
google-http-client/src/main/java/com/google/api/client/json/JsonParser.java
JsonParser.parseArrayAndClose
public final <T> Collection<T> parseArrayAndClose( Class<?> destinationCollectionClass, Class<T> destinationItemClass) throws IOException { """ Parse a JSON Array from the given JSON parser (which is closed after parsing completes) into the given destination collection. @param destinationCollectionClass ...
java
public final <T> Collection<T> parseArrayAndClose( Class<?> destinationCollectionClass, Class<T> destinationItemClass) throws IOException { return parseArrayAndClose(destinationCollectionClass, destinationItemClass, null); }
[ "public", "final", "<", "T", ">", "Collection", "<", "T", ">", "parseArrayAndClose", "(", "Class", "<", "?", ">", "destinationCollectionClass", ",", "Class", "<", "T", ">", "destinationItemClass", ")", "throws", "IOException", "{", "return", "parseArrayAndClose"...
Parse a JSON Array from the given JSON parser (which is closed after parsing completes) into the given destination collection. @param destinationCollectionClass class of destination collection (must have a public default constructor) @param destinationItemClass class of destination collection item (must have a public ...
[ "Parse", "a", "JSON", "Array", "from", "the", "given", "JSON", "parser", "(", "which", "is", "closed", "after", "parsing", "completes", ")", "into", "the", "given", "destination", "collection", "." ]
train
https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L482-L485
d-sauer/JCalcAPI
src/main/java/org/jdice/calc/Num.java
Num.toBigDecimal
public BigDecimal toBigDecimal(Integer scale, Rounding rounding, boolean stripTrailingZeros) { """ Return BigDecimal with given parameters. @param scale @param rounding @param stripTrailingZeros @return BigDecimal """ out = this.in; if (scale != null && rounding != null) out ...
java
public BigDecimal toBigDecimal(Integer scale, Rounding rounding, boolean stripTrailingZeros) { out = this.in; if (scale != null && rounding != null) out = out.setScale(scale, rounding.getBigDecimalRound()); else if (scale != null && rounding == null) out = out.setScale(scale...
[ "public", "BigDecimal", "toBigDecimal", "(", "Integer", "scale", ",", "Rounding", "rounding", ",", "boolean", "stripTrailingZeros", ")", "{", "out", "=", "this", ".", "in", ";", "if", "(", "scale", "!=", "null", "&&", "rounding", "!=", "null", ")", "out", ...
Return BigDecimal with given parameters. @param scale @param rounding @param stripTrailingZeros @return BigDecimal
[ "Return", "BigDecimal", "with", "given", "parameters", "." ]
train
https://github.com/d-sauer/JCalcAPI/blob/36ae1f9adfe611a6f1bd8ef87cf1dc0ec88ac035/src/main/java/org/jdice/calc/Num.java#L418-L430
ops4j/org.ops4j.pax.swissbox
pax-swissbox-bnd/src/main/java/org/ops4j/pax/swissbox/bnd/BndUtils.java
BndUtils.createBundle
public static InputStream createBundle( final InputStream jarInputStream, final Properties instructions, final String jarInfo ) throws IOException { """ Processes the input jar and generates the necessary OSGi headers u...
java
public static InputStream createBundle( final InputStream jarInputStream, final Properties instructions, final String jarInfo ) throws IOException { return createBundle( jarInputStream, instructions, jarInfo, Ove...
[ "public", "static", "InputStream", "createBundle", "(", "final", "InputStream", "jarInputStream", ",", "final", "Properties", "instructions", ",", "final", "String", "jarInfo", ")", "throws", "IOException", "{", "return", "createBundle", "(", "jarInputStream", ",", ...
Processes the input jar and generates the necessary OSGi headers using specified instructions. @param jarInputStream input stream for the jar to be processed. Cannot be null. @param instructions bnd specific processing instructions. Cannot be null. @param jarInfo information about the jar to be processed. Usu...
[ "Processes", "the", "input", "jar", "and", "generates", "the", "necessary", "OSGi", "headers", "using", "specified", "instructions", "." ]
train
https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-bnd/src/main/java/org/ops4j/pax/swissbox/bnd/BndUtils.java#L88-L94
52inc/android-52Kit
library/src/main/java/com/ftinc/kit/util/TimeUtils.java
TimeUtils.formatHumanFriendlyShortDate
public static String formatHumanFriendlyShortDate(final Context context, long timestamp) { """ Returns "Today", "Tomorrow", "Yesterday", or a short date format. """ long localTimestamp, localTime; long now = System.currentTimeMillis(); TimeZone tz = TimeZone.getDefault(); local...
java
public static String formatHumanFriendlyShortDate(final Context context, long timestamp) { long localTimestamp, localTime; long now = System.currentTimeMillis(); TimeZone tz = TimeZone.getDefault(); localTimestamp = timestamp + tz.getOffset(timestamp); localTime = now + tz.getOf...
[ "public", "static", "String", "formatHumanFriendlyShortDate", "(", "final", "Context", "context", ",", "long", "timestamp", ")", "{", "long", "localTimestamp", ",", "localTime", ";", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "TimeZon...
Returns "Today", "Tomorrow", "Yesterday", or a short date format.
[ "Returns", "Today", "Tomorrow", "Yesterday", "or", "a", "short", "date", "format", "." ]
train
https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/TimeUtils.java#L141-L161
alkacon/opencms-core
src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java
CmsDefaultXmlContentHandler.initMappings
protected void initMappings(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException { """ Initializes the element mappings for this content handler.<p> Element mappings allow storing values from the XML content in other locations. For example, if you have an element called "Title", it's...
java
protected void initMappings(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException { Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(root, APPINFO_MAPPING); while (i.hasNext()) { // iterate all "mapping" elements in the "mappings" node Element...
[ "protected", "void", "initMappings", "(", "Element", "root", ",", "CmsXmlContentDefinition", "contentDefinition", ")", "throws", "CmsXmlException", "{", "Iterator", "<", "Element", ">", "i", "=", "CmsXmlGenericWrapper", ".", "elementIterator", "(", "root", ",", "APP...
Initializes the element mappings for this content handler.<p> Element mappings allow storing values from the XML content in other locations. For example, if you have an element called "Title", it's likely a good idea to store the value of this element also in the "Title" property of a XML content resource.<p> @param ...
[ "Initializes", "the", "element", "mappings", "for", "this", "content", "handler", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L2737-L2752
mikepenz/FastAdapter
library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java
FastAdapterDiffUtil.calculateDiff
public static <A extends FastItemAdapter<Item>, Item extends IItem> DiffUtil.DiffResult calculateDiff(final A adapter, final List<Item> items, final DiffCallback<Item> callback) { """ convenient function for {@link #calculateDiff(ModelAdapter, List, DiffCallback, boolean)} @return the {@link androidx.recyclervi...
java
public static <A extends FastItemAdapter<Item>, Item extends IItem> DiffUtil.DiffResult calculateDiff(final A adapter, final List<Item> items, final DiffCallback<Item> callback) { return calculateDiff(adapter.getItemAdapter(), items, callback); }
[ "public", "static", "<", "A", "extends", "FastItemAdapter", "<", "Item", ">", ",", "Item", "extends", "IItem", ">", "DiffUtil", ".", "DiffResult", "calculateDiff", "(", "final", "A", "adapter", ",", "final", "List", "<", "Item", ">", "items", ",", "final",...
convenient function for {@link #calculateDiff(ModelAdapter, List, DiffCallback, boolean)} @return the {@link androidx.recyclerview.widget.DiffUtil.DiffResult} computed.
[ "convenient", "function", "for", "{", "@link", "#calculateDiff", "(", "ModelAdapter", "List", "DiffCallback", "boolean", ")", "}" ]
train
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java#L188-L190
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/bcc/BccClient.java
BccClient.attachVolume
public AttachVolumeResponse attachVolume(AttachVolumeRequest request) { """ Attaching the specified volume to a specified instance. You can attach the specified volume to a specified instance only when the volume is Available and the instance is Running or Stopped , otherwise,it's will get <code>409</code> er...
java
public AttachVolumeResponse attachVolume(AttachVolumeRequest request) { checkNotNull(request, "request should not be null."); checkStringNotEmpty(request.getVolumeId(), "request volumeId should not be empty."); checkStringNotEmpty(request.getInstanceId(), "request instanceId should not be empty....
[ "public", "AttachVolumeResponse", "attachVolume", "(", "AttachVolumeRequest", "request", ")", "{", "checkNotNull", "(", "request", ",", "\"request should not be null.\"", ")", ";", "checkStringNotEmpty", "(", "request", ".", "getVolumeId", "(", ")", ",", "\"request volu...
Attaching the specified volume to a specified instance. You can attach the specified volume to a specified instance only when the volume is Available and the instance is Running or Stopped , otherwise,it's will get <code>409</code> errorCode. @param request The request containing all options for attaching the specifi...
[ "Attaching", "the", "specified", "volume", "to", "a", "specified", "instance", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L977-L986
googleapis/google-cloud-java
google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java
Value.float64Array
public static Value float64Array(@Nullable double[] v, int pos, int length) { """ Returns an {@code ARRAY<FLOAT64>} value that takes its elements from a region of an array. @param v the source of element values, which may be null to produce a value for which {@code isNull()} is {@code true} @param pos the sta...
java
public static Value float64Array(@Nullable double[] v, int pos, int length) { return float64ArrayFactory.create(v, pos, length); }
[ "public", "static", "Value", "float64Array", "(", "@", "Nullable", "double", "[", "]", "v", ",", "int", "pos", ",", "int", "length", ")", "{", "return", "float64ArrayFactory", ".", "create", "(", "v", ",", "pos", ",", "length", ")", ";", "}" ]
Returns an {@code ARRAY<FLOAT64>} value that takes its elements from a region of an array. @param v the source of element values, which may be null to produce a value for which {@code isNull()} is {@code true} @param pos the start position of {@code v} to copy values from. Ignored if {@code v} is {@code null}. @param ...
[ "Returns", "an", "{", "@code", "ARRAY<FLOAT64", ">", "}", "value", "that", "takes", "its", "elements", "from", "a", "region", "of", "an", "array", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java#L272-L274
shrinkwrap/shrinkwrap
impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/bzip/BlockSort.java
BlockSort.fvswap
private void fvswap(int[] fmap, int yyp1, int yyp2, int yyn) { """ swaps two intervals starting at yyp1 and yyp2 of length yyn inside fmap. """ while (yyn > 0) { fswap(fmap, yyp1, yyp2); yyp1++; yyp2++; yyn--; } }
java
private void fvswap(int[] fmap, int yyp1, int yyp2, int yyn) { while (yyn > 0) { fswap(fmap, yyp1, yyp2); yyp1++; yyp2++; yyn--; } }
[ "private", "void", "fvswap", "(", "int", "[", "]", "fmap", ",", "int", "yyp1", ",", "int", "yyp2", ",", "int", "yyn", ")", "{", "while", "(", "yyn", ">", "0", ")", "{", "fswap", "(", "fmap", ",", "yyp1", ",", "yyp2", ")", ";", "yyp1", "++", "...
swaps two intervals starting at yyp1 and yyp2 of length yyn inside fmap.
[ "swaps", "two", "intervals", "starting", "at", "yyp1", "and", "yyp2", "of", "length", "yyn", "inside", "fmap", "." ]
train
https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/bzip/BlockSort.java#L316-L321
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java
Text.explode
public static String[] explode(String str, int ch, boolean respectEmpty) { """ returns an array of strings decomposed of the original string, split at every occurance of 'ch'. @param str the string to decompose @param ch the character to use a split pattern @param respectEmpty if <code>true</code>, empty ...
java
public static String[] explode(String str, int ch, boolean respectEmpty) { if (str == null || str.length() == 0) { return new String[0]; } ArrayList strings = new ArrayList(); int pos; int lastpos = 0; // add snipples while ((pos = str.indexOf(ch, lastpos)) ...
[ "public", "static", "String", "[", "]", "explode", "(", "String", "str", ",", "int", "ch", ",", "boolean", "respectEmpty", ")", "{", "if", "(", "str", "==", "null", "||", "str", ".", "length", "(", ")", "==", "0", ")", "{", "return", "new", "String...
returns an array of strings decomposed of the original string, split at every occurance of 'ch'. @param str the string to decompose @param ch the character to use a split pattern @param respectEmpty if <code>true</code>, empty elements are generated @return an array of strings
[ "returns", "an", "array", "of", "strings", "decomposed", "of", "the", "original", "string", "split", "at", "every", "occurance", "of", "ch", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L165-L197
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java
TableId.of
public static TableId of(String dataset, String table) { """ Creates a table identity given dataset's and table's user-defined ids. """ return new TableId(null, checkNotNull(dataset), checkNotNull(table)); }
java
public static TableId of(String dataset, String table) { return new TableId(null, checkNotNull(dataset), checkNotNull(table)); }
[ "public", "static", "TableId", "of", "(", "String", "dataset", ",", "String", "table", ")", "{", "return", "new", "TableId", "(", "null", ",", "checkNotNull", "(", "dataset", ")", ",", "checkNotNull", "(", "table", ")", ")", ";", "}" ]
Creates a table identity given dataset's and table's user-defined ids.
[ "Creates", "a", "table", "identity", "given", "dataset", "s", "and", "table", "s", "user", "-", "defined", "ids", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java#L78-L80
jboss/jboss-jstl-api_spec
src/main/java/org/apache/taglibs/standard/tag/common/fmt/TimeZoneSupport.java
TimeZoneSupport.getTimeZone
static TimeZone getTimeZone(PageContext pc, Tag fromTag) { """ /* Determines and returns the time zone to be used by the given action. <p> If the given action is nested inside a &lt;timeZone&gt; action, the time zone is taken from the enclosing &lt;timeZone&gt; action. <p> Otherwise, the time zone configur...
java
static TimeZone getTimeZone(PageContext pc, Tag fromTag) { TimeZone tz = null; Tag t = findAncestorWithClass(fromTag, TimeZoneSupport.class); if (t != null) { // use time zone from parent <timeZone> tag TimeZoneSupport parent = (TimeZoneSupport) t; tz = paren...
[ "static", "TimeZone", "getTimeZone", "(", "PageContext", "pc", ",", "Tag", "fromTag", ")", "{", "TimeZone", "tz", "=", "null", ";", "Tag", "t", "=", "findAncestorWithClass", "(", "fromTag", ",", "TimeZoneSupport", ".", "class", ")", ";", "if", "(", "t", ...
/* Determines and returns the time zone to be used by the given action. <p> If the given action is nested inside a &lt;timeZone&gt; action, the time zone is taken from the enclosing &lt;timeZone&gt; action. <p> Otherwise, the time zone configuration setting <tt>javax.servlet.jsp.jstl.core.Config.FMT_TIME_ZONE</tt> is...
[ "/", "*", "Determines", "and", "returns", "the", "time", "zone", "to", "be", "used", "by", "the", "given", "action", "." ]
train
https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/tag/common/fmt/TimeZoneSupport.java#L136-L157
boncey/Flickr4Java
src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java
PhotosInterface.getContactsPublicPhotos
public PhotoList<Photo> getContactsPublicPhotos(String userId, int count, boolean justFriends, boolean singlePhoto, boolean includeSelf) throws FlickrException { """ Get public photos from the user's contacts. This method does not require authentication. @see com.flickr4java.flickr.photos.Extras...
java
public PhotoList<Photo> getContactsPublicPhotos(String userId, int count, boolean justFriends, boolean singlePhoto, boolean includeSelf) throws FlickrException { return getContactsPublicPhotos(userId, Extras.MIN_EXTRAS, count, justFriends, singlePhoto, includeSelf); }
[ "public", "PhotoList", "<", "Photo", ">", "getContactsPublicPhotos", "(", "String", "userId", ",", "int", "count", ",", "boolean", "justFriends", ",", "boolean", "singlePhoto", ",", "boolean", "includeSelf", ")", "throws", "FlickrException", "{", "return", "getCon...
Get public photos from the user's contacts. This method does not require authentication. @see com.flickr4java.flickr.photos.Extras @param userId The user ID @param count The number of photos to return @param justFriends True to include friends @param singlePhoto True to get a single photo @param includeSelf True to i...
[ "Get", "public", "photos", "from", "the", "user", "s", "contacts", "." ]
train
https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java#L308-L311
getsentry/sentry-java
sentry/src/main/java/io/sentry/util/Util.java
Util.parseDouble
public static Double parseDouble(String value, Double defaultValue) { """ Parses the provided string value into a double value. <p>If the string is null or empty this returns the default value.</p> @param value value to parse @param defaultValue default value @return double representation of provided ...
java
public static Double parseDouble(String value, Double defaultValue) { if (isNullOrEmpty(value)) { return defaultValue; } return Double.parseDouble(value); }
[ "public", "static", "Double", "parseDouble", "(", "String", "value", ",", "Double", "defaultValue", ")", "{", "if", "(", "isNullOrEmpty", "(", "value", ")", ")", "{", "return", "defaultValue", ";", "}", "return", "Double", ".", "parseDouble", "(", "value", ...
Parses the provided string value into a double value. <p>If the string is null or empty this returns the default value.</p> @param value value to parse @param defaultValue default value @return double representation of provided value or default value.
[ "Parses", "the", "provided", "string", "value", "into", "a", "double", "value", ".", "<p", ">", "If", "the", "string", "is", "null", "or", "empty", "this", "returns", "the", "default", "value", ".", "<", "/", "p", ">" ]
train
https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/util/Util.java#L132-L137
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FSOutputSummer.java
FSOutputSummer.write1
private int write1(byte b[], int off, int len) throws IOException { """ Write a portion of an array, flushing to the underlying stream at most once if necessary. """ eventStartWrite(); try { if(count==0 && bytesSentInChunk + len>=buf.length) { // local buffer is empty and user data can ...
java
private int write1(byte b[], int off, int len) throws IOException { eventStartWrite(); try { if(count==0 && bytesSentInChunk + len>=buf.length) { // local buffer is empty and user data can fill the current chunk // checksum and output data final int length = buf.length - bytesSent...
[ "private", "int", "write1", "(", "byte", "b", "[", "]", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "eventStartWrite", "(", ")", ";", "try", "{", "if", "(", "count", "==", "0", "&&", "bytesSentInChunk", "+", "len", ">=", ...
Write a portion of an array, flushing to the underlying stream at most once if necessary.
[ "Write", "a", "portion", "of", "an", "array", "flushing", "to", "the", "underlying", "stream", "at", "most", "once", "if", "necessary", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FSOutputSummer.java#L118-L147
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/ProvisionerImpl.java
ProvisionerImpl.checkStartStatus
protected void checkStartStatus(BundleStartStatus startStatus) throws InvalidBundleContextException { """ Check the passed in start status for exceptions starting bundles, and issue appropriate diagnostics & messages for this environment. @param startStatus @throws InvalidBundleContextException """ ...
java
protected void checkStartStatus(BundleStartStatus startStatus) throws InvalidBundleContextException { final String m = "checkInstallStatus"; if (startStatus.startExceptions()) { Map<Bundle, Throwable> startExceptions = startStatus.getStartExceptions(); for (Entry<Bundle, Throwabl...
[ "protected", "void", "checkStartStatus", "(", "BundleStartStatus", "startStatus", ")", "throws", "InvalidBundleContextException", "{", "final", "String", "m", "=", "\"checkInstallStatus\"", ";", "if", "(", "startStatus", ".", "startExceptions", "(", ")", ")", "{", "...
Check the passed in start status for exceptions starting bundles, and issue appropriate diagnostics & messages for this environment. @param startStatus @throws InvalidBundleContextException
[ "Check", "the", "passed", "in", "start", "status", "for", "exceptions", "starting", "bundles", "and", "issue", "appropriate", "diagnostics", "&", "messages", "for", "this", "environment", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/ProvisionerImpl.java#L139-L154
to2mbn/JMCCC
jmccc-yggdrasil-authenticator/src/main/java/org/to2mbn/jmccc/auth/yggdrasil/YggdrasilAuthenticator.java
YggdrasilAuthenticator.refreshWithPassword
public synchronized void refreshWithPassword(String username, String password, CharacterSelector characterSelector) throws AuthenticationException { """ Refreshes the current session manually using password. @param username the username @param password the password @param characterSelector the character selec...
java
public synchronized void refreshWithPassword(String username, String password, CharacterSelector characterSelector) throws AuthenticationException { refreshWithPassword(createPasswordProvider(username, password, characterSelector)); }
[ "public", "synchronized", "void", "refreshWithPassword", "(", "String", "username", ",", "String", "password", ",", "CharacterSelector", "characterSelector", ")", "throws", "AuthenticationException", "{", "refreshWithPassword", "(", "createPasswordProvider", "(", "username"...
Refreshes the current session manually using password. @param username the username @param password the password @param characterSelector the character selector @throws AuthenticationException If an exception occurs during the authentication
[ "Refreshes", "the", "current", "session", "manually", "using", "password", "." ]
train
https://github.com/to2mbn/JMCCC/blob/17e5b1b56ff18255cfd60976dca1a24598946647/jmccc-yggdrasil-authenticator/src/main/java/org/to2mbn/jmccc/auth/yggdrasil/YggdrasilAuthenticator.java#L339-L341
smartsheet-platform/smartsheet-java-sdk
src/main/java/com/smartsheet/api/internal/WorkspaceFolderResourcesImpl.java
WorkspaceFolderResourcesImpl.createFolder
public Folder createFolder(long workspaceId, Folder folder) throws SmartsheetException { """ Create a folder in the workspace. It mirrors to the following Smartsheet REST API method: POST /workspace/{id}/folders Exceptions: - IllegalArgumentException : if folder is null - InvalidRequestException : if there...
java
public Folder createFolder(long workspaceId, Folder folder) throws SmartsheetException { return this.createResource("workspaces/" + workspaceId + "/folders", Folder.class, folder); }
[ "public", "Folder", "createFolder", "(", "long", "workspaceId", ",", "Folder", "folder", ")", "throws", "SmartsheetException", "{", "return", "this", ".", "createResource", "(", "\"workspaces/\"", "+", "workspaceId", "+", "\"/folders\"", ",", "Folder", ".", "class...
Create a folder in the workspace. It mirrors to the following Smartsheet REST API method: POST /workspace/{id}/folders Exceptions: - IllegalArgumentException : if folder is null - InvalidRequestException : if there is any problem with the REST API request - AuthorizationException : if there is any problem with the RE...
[ "Create", "a", "folder", "in", "the", "workspace", "." ]
train
https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/WorkspaceFolderResourcesImpl.java#L94-L96
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java
PackageSummaryBuilder.buildEnumSummary
public void buildEnumSummary(XMLNode node, Content summaryContentTree) { """ Build the summary for the enums in this package. @param node the XML element that specifies which components to document @param summaryContentTree the summary tree to which the enum summary will be added """ String enumTa...
java
public void buildEnumSummary(XMLNode node, Content summaryContentTree) { String enumTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Enum_Summary"), configuration.getText("doclet.enums")); String[] enumTable...
[ "public", "void", "buildEnumSummary", "(", "XMLNode", "node", ",", "Content", "summaryContentTree", ")", "{", "String", "enumTableSummary", "=", "configuration", ".", "getText", "(", "\"doclet.Member_Table_Summary\"", ",", "configuration", ".", "getText", "(", "\"docl...
Build the summary for the enums in this package. @param node the XML element that specifies which components to document @param summaryContentTree the summary tree to which the enum summary will be added
[ "Build", "the", "summary", "for", "the", "enums", "in", "this", "package", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java#L224-L245
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/StreamRecord.java
StreamRecord.withOldImage
public StreamRecord withOldImage(java.util.Map<String, AttributeValue> oldImage) { """ <p> The item in the DynamoDB table as it appeared before it was modified. </p> @param oldImage The item in the DynamoDB table as it appeared before it was modified. @return Returns a reference to this object so that metho...
java
public StreamRecord withOldImage(java.util.Map<String, AttributeValue> oldImage) { setOldImage(oldImage); return this; }
[ "public", "StreamRecord", "withOldImage", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "AttributeValue", ">", "oldImage", ")", "{", "setOldImage", "(", "oldImage", ")", ";", "return", "this", ";", "}" ]
<p> The item in the DynamoDB table as it appeared before it was modified. </p> @param oldImage The item in the DynamoDB table as it appeared before it was modified. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "item", "in", "the", "DynamoDB", "table", "as", "it", "appeared", "before", "it", "was", "modified", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/StreamRecord.java#L300-L303
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/ie/crf/CRFClassifier.java
CRFClassifier.classifyMaxEnt
public List<IN> classifyMaxEnt(List<IN> document) { """ Do standard sequence inference, using either Viterbi or Beam inference depending on the value of <code>flags.inferenceType</code>. @param document Document to classify. Classification happens in place. This document is modified. @return The classified ...
java
public List<IN> classifyMaxEnt(List<IN> document) { if (document.isEmpty()) { return document; } SequenceModel model = getSequenceModel(document); return classifyMaxEnt(document, model); }
[ "public", "List", "<", "IN", ">", "classifyMaxEnt", "(", "List", "<", "IN", ">", "document", ")", "{", "if", "(", "document", ".", "isEmpty", "(", ")", ")", "{", "return", "document", ";", "}", "SequenceModel", "model", "=", "getSequenceModel", "(", "d...
Do standard sequence inference, using either Viterbi or Beam inference depending on the value of <code>flags.inferenceType</code>. @param document Document to classify. Classification happens in place. This document is modified. @return The classified document
[ "Do", "standard", "sequence", "inference", "using", "either", "Viterbi", "or", "Beam", "inference", "depending", "on", "the", "value", "of", "<code", ">", "flags", ".", "inferenceType<", "/", "code", ">", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/crf/CRFClassifier.java#L1023-L1030
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/frame/transaction/AbstractDataFrameTransaction.java
AbstractDataFrameTransaction.attemptResend
boolean attemptResend(ZWaveChannelContext ctx, boolean dueToCAN) { """ Attempts to re-send the data frame that initiated this transaction. @param ctx the ChannelHandlerContext @param dueToCAN indicates whether the re-send attempt was due to a CAN frame that was received @return boolean indicating whether re...
java
boolean attemptResend(ZWaveChannelContext ctx, boolean dueToCAN) { if (startFrame.getSendCount() < MAX_SEND_COUNT) { logger.debug("Transaction {} has failed - will reset and resend initial request", getId()); reset(); // if a CAN was received, then we decrement the send count...
[ "boolean", "attemptResend", "(", "ZWaveChannelContext", "ctx", ",", "boolean", "dueToCAN", ")", "{", "if", "(", "startFrame", ".", "getSendCount", "(", ")", "<", "MAX_SEND_COUNT", ")", "{", "logger", ".", "debug", "(", "\"Transaction {} has failed - will reset and r...
Attempts to re-send the data frame that initiated this transaction. @param ctx the ChannelHandlerContext @param dueToCAN indicates whether the re-send attempt was due to a CAN frame that was received @return boolean indicating whether re-send was attempted
[ "Attempts", "to", "re", "-", "send", "the", "data", "frame", "that", "initiated", "this", "transaction", "." ]
train
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/frame/transaction/AbstractDataFrameTransaction.java#L71-L86
milaboratory/milib
src/main/java/com/milaboratory/core/sequence/SequenceQuality.java
SequenceQuality.create
public static SequenceQuality create(QualityFormat format, byte[] data, boolean check) { """ Factory method for the SequenceQualityPhred object. It performs all necessary range checks if required. @param format format of encoded quality values @param data byte with encoded quality values @param check deter...
java
public static SequenceQuality create(QualityFormat format, byte[] data, boolean check) { return create(format, data, 0, data.length, check); }
[ "public", "static", "SequenceQuality", "create", "(", "QualityFormat", "format", ",", "byte", "[", "]", "data", ",", "boolean", "check", ")", "{", "return", "create", "(", "format", ",", "data", ",", "0", ",", "data", ".", "length", ",", "check", ")", ...
Factory method for the SequenceQualityPhred object. It performs all necessary range checks if required. @param format format of encoded quality values @param data byte with encoded quality values @param check determines whether range check is required @return quality line object @throws WrongQualityFormat if encode...
[ "Factory", "method", "for", "the", "SequenceQualityPhred", "object", ".", "It", "performs", "all", "necessary", "range", "checks", "if", "required", "." ]
train
https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/sequence/SequenceQuality.java#L376-L378
micronaut-projects/micronaut-core
function/src/main/java/io/micronaut/function/executor/FunctionApplication.java
FunctionApplication.parseData
static void parseData(String[] args, BiConsumer<String, Boolean> data) { """ Parse entries. @param args command line options @param data data """ CommandLine commandLine = parseCommandLine(args); Object value = commandLine.optionValue("d"); if (value != null) { data.acce...
java
static void parseData(String[] args, BiConsumer<String, Boolean> data) { CommandLine commandLine = parseCommandLine(args); Object value = commandLine.optionValue("d"); if (value != null) { data.accept(value.toString(), commandLine.hasOption("x")); } else { data.ac...
[ "static", "void", "parseData", "(", "String", "[", "]", "args", ",", "BiConsumer", "<", "String", ",", "Boolean", ">", "data", ")", "{", "CommandLine", "commandLine", "=", "parseCommandLine", "(", "args", ")", ";", "Object", "value", "=", "commandLine", "....
Parse entries. @param args command line options @param data data
[ "Parse", "entries", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/function/src/main/java/io/micronaut/function/executor/FunctionApplication.java#L92-L100
lestard/assertj-javafx
src/main/java/eu/lestard/assertj/javafx/api/ReadOnlyDoublePropertyAssert.java
ReadOnlyDoublePropertyAssert.hasValue
public ReadOnlyDoublePropertyAssert hasValue(Double expectedValue, Offset offset) { """ Verifies that the actual observable number has a value that is close to the given one by less then the given offset. @param expectedValue the given value to compare the actual observables value to. @param offset the given p...
java
public ReadOnlyDoublePropertyAssert hasValue(Double expectedValue, Offset offset){ new ObservableNumberValueAssertions(actual).hasValue(expectedValue, offset); return this; }
[ "public", "ReadOnlyDoublePropertyAssert", "hasValue", "(", "Double", "expectedValue", ",", "Offset", "offset", ")", "{", "new", "ObservableNumberValueAssertions", "(", "actual", ")", ".", "hasValue", "(", "expectedValue", ",", "offset", ")", ";", "return", "this", ...
Verifies that the actual observable number has a value that is close to the given one by less then the given offset. @param expectedValue the given value to compare the actual observables value to. @param offset the given positive offset. @return {@code this} assertion object. @throws java.lang.NullPointerException ...
[ "Verifies", "that", "the", "actual", "observable", "number", "has", "a", "value", "that", "is", "close", "to", "the", "given", "one", "by", "less", "then", "the", "given", "offset", "." ]
train
https://github.com/lestard/assertj-javafx/blob/f6b4d22e542a5501c7c1c2fae8700b0f69b956c1/src/main/java/eu/lestard/assertj/javafx/api/ReadOnlyDoublePropertyAssert.java#L46-L50
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.getCounts
private void getCounts(String path, Counts counts) { """ this method gets the count of nodes and the bytes under a subtree @param path the path to be used @param bytes the long bytes @param count the int count """ DataNode node = getNode(path); if (node == null) { return; ...
java
private void getCounts(String path, Counts counts) { DataNode node = getNode(path); if (node == null) { return; } String[] children = null; int len = 0; synchronized (node) { Set<String> childs = node.getChildren(); if (childs != null) ...
[ "private", "void", "getCounts", "(", "String", "path", ",", "Counts", "counts", ")", "{", "DataNode", "node", "=", "getNode", "(", "path", ")", ";", "if", "(", "node", "==", "null", ")", "{", "return", ";", "}", "String", "[", "]", "children", "=", ...
this method gets the count of nodes and the bytes under a subtree @param path the path to be used @param bytes the long bytes @param count the int count
[ "this", "method", "gets", "the", "count", "of", "nodes", "and", "the", "bytes", "under", "a", "subtree" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L853-L876
jOOQ/jOOL
jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java
Unchecked.objLongConsumer
public static <T> ObjLongConsumer<T> objLongConsumer(CheckedObjLongConsumer<T> consumer) { """ Wrap a {@link CheckedObjLongConsumer} in a {@link ObjLongConsumer}. """ return objLongConsumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION); }
java
public static <T> ObjLongConsumer<T> objLongConsumer(CheckedObjLongConsumer<T> consumer) { return objLongConsumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION); }
[ "public", "static", "<", "T", ">", "ObjLongConsumer", "<", "T", ">", "objLongConsumer", "(", "CheckedObjLongConsumer", "<", "T", ">", "consumer", ")", "{", "return", "objLongConsumer", "(", "consumer", ",", "THROWABLE_TO_RUNTIME_EXCEPTION", ")", ";", "}" ]
Wrap a {@link CheckedObjLongConsumer} in a {@link ObjLongConsumer}.
[ "Wrap", "a", "{" ]
train
https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L269-L271
mozilla/rhino
src/org/mozilla/javascript/ScriptRuntime.java
ScriptRuntime.callRef
public static Ref callRef(Callable function, Scriptable thisObj, Object[] args, Context cx) { """ Perform function call in reference context. Should always return value that can be passed to {@link #refGet(Ref, Context)} or {@link #refSet(Ref, Object, Context)} arbitrary number of ...
java
public static Ref callRef(Callable function, Scriptable thisObj, Object[] args, Context cx) { if (function instanceof RefCallable) { RefCallable rfunction = (RefCallable)function; Ref ref = rfunction.refCall(cx, thisObj, args); if (ref == nul...
[ "public", "static", "Ref", "callRef", "(", "Callable", "function", ",", "Scriptable", "thisObj", ",", "Object", "[", "]", "args", ",", "Context", "cx", ")", "{", "if", "(", "function", "instanceof", "RefCallable", ")", "{", "RefCallable", "rfunction", "=", ...
Perform function call in reference context. Should always return value that can be passed to {@link #refGet(Ref, Context)} or {@link #refSet(Ref, Object, Context)} arbitrary number of times. The args array reference should not be stored in any object that is can be GC-reachable after this method returns. If this is nec...
[ "Perform", "function", "call", "in", "reference", "context", ".", "Should", "always", "return", "value", "that", "can", "be", "passed", "to", "{" ]
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2644-L2659
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java
LdapConnection.toKey
@Trivial private static String toKey(String name, String filter, SearchControls cons) { """ Returns a hash key for the name|filter|cons tuple used in the search query-results cache. @param name The name of the object from which to retrieve attributes. @param filter the filter used in the search. @param c...
java
@Trivial private static String toKey(String name, String filter, SearchControls cons) { int length = name.length() + filter.length() + 100; StringBuffer key = new StringBuffer(length); key.append(name); key.append("|"); key.append(filter); key.append("|"); key...
[ "@", "Trivial", "private", "static", "String", "toKey", "(", "String", "name", ",", "String", "filter", ",", "SearchControls", "cons", ")", "{", "int", "length", "=", "name", ".", "length", "(", ")", "+", "filter", ".", "length", "(", ")", "+", "100", ...
Returns a hash key for the name|filter|cons tuple used in the search query-results cache. @param name The name of the object from which to retrieve attributes. @param filter the filter used in the search. @param cons The search controls used in the search. @throws NamingException If a naming exception is encountered.
[ "Returns", "a", "hash", "key", "for", "the", "name|filter|cons", "tuple", "used", "in", "the", "search", "query", "-", "results", "cache", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java#L209-L231
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/HsqlNameManager.java
HsqlNameManager.newAutoName
HsqlName newAutoName(String prefix, String namepart, HsqlName schema, HsqlName parent, int type) { """ Auto names are used for autogenerated indexes or anonymous constraints. """ StringBuffer sb = new StringBuffer(); if (prefix != null) { if (prefix.length...
java
HsqlName newAutoName(String prefix, String namepart, HsqlName schema, HsqlName parent, int type) { StringBuffer sb = new StringBuffer(); if (prefix != null) { if (prefix.length() != 0) { sb.append("SYS_"); sb.append(prefix); ...
[ "HsqlName", "newAutoName", "(", "String", "prefix", ",", "String", "namepart", ",", "HsqlName", "schema", ",", "HsqlName", "parent", ",", "int", "type", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "if", "(", "prefix", "!=", ...
Auto names are used for autogenerated indexes or anonymous constraints.
[ "Auto", "names", "are", "used", "for", "autogenerated", "indexes", "or", "anonymous", "constraints", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/HsqlNameManager.java#L258-L286
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java
ParagraphVectors.inferVector
public INDArray inferVector(String text) { """ This method calculates inferred vector for given text, with default parameters for learning rate and iterations @param text @return """ return inferVector(text, this.learningRate.get(), this.minLearningRate, this.numEpochs * this.numIterations); }
java
public INDArray inferVector(String text) { return inferVector(text, this.learningRate.get(), this.minLearningRate, this.numEpochs * this.numIterations); }
[ "public", "INDArray", "inferVector", "(", "String", "text", ")", "{", "return", "inferVector", "(", "text", ",", "this", ".", "learningRate", ".", "get", "(", ")", ",", "this", ".", "minLearningRate", ",", "this", ".", "numEpochs", "*", "this", ".", "num...
This method calculates inferred vector for given text, with default parameters for learning rate and iterations @param text @return
[ "This", "method", "calculates", "inferred", "vector", "for", "given", "text", "with", "default", "parameters", "for", "learning", "rate", "and", "iterations" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L292-L294
dita-ot/dita-ot
src/main/plugins/org.dita.eclipsehelp/src/main/java/org/dita/dost/writer/EclipseIndexWriter.java
EclipseIndexWriter.outputIndexTerm
private void outputIndexTerm(final IndexTerm term, final XMLStreamWriter serializer, final boolean indexsee) throws XMLStreamException { """ Output the given indexterm into the XML writer. @param term term to serialize @param serializer XML output to write to @param indexsee is term a see term """ ...
java
private void outputIndexTerm(final IndexTerm term, final XMLStreamWriter serializer, final boolean indexsee) throws XMLStreamException { final List<IndexTerm> subTerms = term.getSubTerms(); final int subTermNum = subTerms.size(); outputIndexTermStartElement(term, serializer, indexsee); i...
[ "private", "void", "outputIndexTerm", "(", "final", "IndexTerm", "term", ",", "final", "XMLStreamWriter", "serializer", ",", "final", "boolean", "indexsee", ")", "throws", "XMLStreamException", "{", "final", "List", "<", "IndexTerm", ">", "subTerms", "=", "term", ...
Output the given indexterm into the XML writer. @param term term to serialize @param serializer XML output to write to @param indexsee is term a see term
[ "Output", "the", "given", "indexterm", "into", "the", "XML", "writer", "." ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.eclipsehelp/src/main/java/org/dita/dost/writer/EclipseIndexWriter.java#L122-L132
dickschoeller/gedbrowser
gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/order/ChildrenOrderAnalyzer.java
ChildrenOrderAnalyzer.analyzeChild
private Person analyzeChild(final Person child, final Person prevChild) { """ Check the order of one child against the previous dated child. @param child the child @param prevChild the previous child @return the current child if dated """ Person retChild = prevChild; if (retChild == null) ...
java
private Person analyzeChild(final Person child, final Person prevChild) { Person retChild = prevChild; if (retChild == null) { return child; } final LocalDate birthDate = getNearBirthEventDate(child); if (birthDate == null) { return retChild; } ...
[ "private", "Person", "analyzeChild", "(", "final", "Person", "child", ",", "final", "Person", "prevChild", ")", "{", "Person", "retChild", "=", "prevChild", ";", "if", "(", "retChild", "==", "null", ")", "{", "return", "child", ";", "}", "final", "LocalDat...
Check the order of one child against the previous dated child. @param child the child @param prevChild the previous child @return the current child if dated
[ "Check", "the", "order", "of", "one", "child", "against", "the", "previous", "dated", "child", "." ]
train
https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/order/ChildrenOrderAnalyzer.java#L69-L90
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/pod/MethodRefPod.java
MethodRefPod.findLocalMethod
private MethodRefAmp findLocalMethod() { """ /* @Override public <T> void stream(Headers headers, ResultStream<T> result, long timeout, TimeUnit timeUnit, Object... args) { try { MethodRefAmp method = findActiveMethod(); method.stream(headers, result, timeout, timeUnit, args); } catch (Throwable e) { ...
java
private MethodRefAmp findLocalMethod() { ServiceRefAmp serviceRefLocal = _serviceRef.getLocalService(); if (serviceRefLocal == null) { return null; } MethodRefActive methodRefLocal = _methodRefLocal; MethodRefAmp methodRef; if (methodRefLocal != null) { methodRef = m...
[ "private", "MethodRefAmp", "findLocalMethod", "(", ")", "{", "ServiceRefAmp", "serviceRefLocal", "=", "_serviceRef", ".", "getLocalService", "(", ")", ";", "if", "(", "serviceRefLocal", "==", "null", ")", "{", "return", "null", ";", "}", "MethodRefActive", "meth...
/* @Override public <T> void stream(Headers headers, ResultStream<T> result, long timeout, TimeUnit timeUnit, Object... args) { try { MethodRefAmp method = findActiveMethod(); method.stream(headers, result, timeout, timeUnit, args); } catch (Throwable e) { result.fail(e); } }
[ "/", "*", "@Override", "public", "<T", ">", "void", "stream", "(", "Headers", "headers", "ResultStream<T", ">", "result", "long", "timeout", "TimeUnit", "timeUnit", "Object", "...", "args", ")", "{", "try", "{", "MethodRefAmp", "method", "=", "findActiveMethod...
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/MethodRefPod.java#L196-L225
litsec/swedish-eid-shibboleth-base
shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/service/impl/ProxyIdpAuthnContextServiceImpl.java
ProxyIdpAuthnContextServiceImpl.isIssuedAuthnContextClassRefAccepted
protected boolean isIssuedAuthnContextClassRefAccepted(ProfileRequestContext<?, ?> context, String authnContextUri) { """ Depending on the type of matching of AuthnContextClassRef URI:s that is used we check whether an issued URI is what we can accept (corresponds to what we requested). <p> The default implemen...
java
protected boolean isIssuedAuthnContextClassRefAccepted(ProfileRequestContext<?, ?> context, String authnContextUri) { try { List<String> requested = this.getAuthnContextClassContext(context).getProxiedAuthnContextClassRefs(); if (requested == null || requested.isEmpty()) { // If we did not requ...
[ "protected", "boolean", "isIssuedAuthnContextClassRefAccepted", "(", "ProfileRequestContext", "<", "?", ",", "?", ">", "context", ",", "String", "authnContextUri", ")", "{", "try", "{", "List", "<", "String", ">", "requested", "=", "this", ".", "getAuthnContextCla...
Depending on the type of matching of AuthnContextClassRef URI:s that is used we check whether an issued URI is what we can accept (corresponds to what we requested). <p> The default implementation used "exact" matching. </p> @param context the request context @param authnContextUri the URI received in the assertion fr...
[ "Depending", "on", "the", "type", "of", "matching", "of", "AuthnContextClassRef", "URI", ":", "s", "that", "is", "used", "we", "check", "whether", "an", "issued", "URI", "is", "what", "we", "can", "accept", "(", "corresponds", "to", "what", "we", "requeste...
train
https://github.com/litsec/swedish-eid-shibboleth-base/blob/aaaa467ff61f07d7dfa31627fb36851a37da6804/shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/service/impl/ProxyIdpAuthnContextServiceImpl.java#L235-L249
haifengl/smile
graph/src/main/java/smile/graph/AdjacencyList.java
AdjacencyList.dfs
private void dfs(Visitor visitor, int v, int[] cc, int id) { """ Depth-first search of graph. @param v the start vertex. @param cc the array to store the connected component id of vertices. @param id the current component id. """ visitor.visit(v); cc[v] = id; for (Edge edge : graph[v...
java
private void dfs(Visitor visitor, int v, int[] cc, int id) { visitor.visit(v); cc[v] = id; for (Edge edge : graph[v]) { int t = edge.v2; if (!digraph && t == v) { t = edge.v1; } if (cc[t] == -1) { dfs(visitor, t, cc...
[ "private", "void", "dfs", "(", "Visitor", "visitor", ",", "int", "v", ",", "int", "[", "]", "cc", ",", "int", "id", ")", "{", "visitor", ".", "visit", "(", "v", ")", ";", "cc", "[", "v", "]", "=", "id", ";", "for", "(", "Edge", "edge", ":", ...
Depth-first search of graph. @param v the start vertex. @param cc the array to store the connected component id of vertices. @param id the current component id.
[ "Depth", "-", "first", "search", "of", "graph", "." ]
train
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/graph/src/main/java/smile/graph/AdjacencyList.java#L417-L430
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/common/abstracts/featureselectors/AbstractScoreBasedFeatureSelector.java
AbstractScoreBasedFeatureSelector.keepTopFeatures
protected void keepTopFeatures(Map<Object, Double> featureScores, int maxFeatures) { """ This method keeps the highest scoring features of the provided feature map and removes all the others. @param featureScores @param maxFeatures """ logger.debug("keepTopFeatures()"); logger.debug("Esti...
java
protected void keepTopFeatures(Map<Object, Double> featureScores, int maxFeatures) { logger.debug("keepTopFeatures()"); logger.debug("Estimating the minPermittedScore"); Double minPermittedScore = SelectKth.largest(featureScores.values().iterator(), maxFeatures); //remove any entry wit...
[ "protected", "void", "keepTopFeatures", "(", "Map", "<", "Object", ",", "Double", ">", "featureScores", ",", "int", "maxFeatures", ")", "{", "logger", ".", "debug", "(", "\"keepTopFeatures()\"", ")", ";", "logger", ".", "debug", "(", "\"Estimating the minPermitt...
This method keeps the highest scoring features of the provided feature map and removes all the others. @param featureScores @param maxFeatures
[ "This", "method", "keeps", "the", "highest", "scoring", "features", "of", "the", "provided", "feature", "map", "and", "removes", "all", "the", "others", "." ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/common/abstracts/featureselectors/AbstractScoreBasedFeatureSelector.java#L176-L205
BlueBrain/bluima
modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/GIS.java
GIS.trainModel
public static GISModel trainModel(int iterations, DataIndexer indexer, boolean smoothing) { """ Train a model using the GIS algorithm. @param iterations The number of GIS iterations to perform. @param indexer The object which will be used for event compilation. @param smoothing Defines whether the created train...
java
public static GISModel trainModel(int iterations, DataIndexer indexer, boolean smoothing) { return trainModel(iterations,indexer,false,smoothing); }
[ "public", "static", "GISModel", "trainModel", "(", "int", "iterations", ",", "DataIndexer", "indexer", ",", "boolean", "smoothing", ")", "{", "return", "trainModel", "(", "iterations", ",", "indexer", ",", "false", ",", "smoothing", ")", ";", "}" ]
Train a model using the GIS algorithm. @param iterations The number of GIS iterations to perform. @param indexer The object which will be used for event compilation. @param smoothing Defines whether the created trainer will use smoothing while training the model. @return The newly trained model, which can be used immed...
[ "Train", "a", "model", "using", "the", "GIS", "algorithm", "." ]
train
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/GIS.java#L117-L119
aol/cyclops
cyclops/src/main/java/cyclops/companion/Functions.java
Functions.skipInts
public static Function<? super ReactiveSeq<Integer>, ? extends ReactiveSeq<Integer>> skipInts(long skip) { """ /* Fluent limit operation using primitive types e.g. <pre> {@code import static cyclops.ReactiveSeq.skipInts; ReactiveSeq.ofInts(1,2,3) .to(limitInts(1)); //[1] } </pre> """ ret...
java
public static Function<? super ReactiveSeq<Integer>, ? extends ReactiveSeq<Integer>> skipInts(long skip){ return a->a.ints(i->i,s->s.skip(skip)); }
[ "public", "static", "Function", "<", "?", "super", "ReactiveSeq", "<", "Integer", ">", ",", "?", "extends", "ReactiveSeq", "<", "Integer", ">", ">", "skipInts", "(", "long", "skip", ")", "{", "return", "a", "->", "a", ".", "ints", "(", "i", "->", "i"...
/* Fluent limit operation using primitive types e.g. <pre> {@code import static cyclops.ReactiveSeq.skipInts; ReactiveSeq.ofInts(1,2,3) .to(limitInts(1)); //[1] } </pre>
[ "/", "*", "Fluent", "limit", "operation", "using", "primitive", "types", "e", ".", "g", ".", "<pre", ">", "{", "@code", "import", "static", "cyclops", ".", "ReactiveSeq", ".", "skipInts", ";" ]
train
https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Functions.java#L240-L243
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/VoronoiDraw.java
VoronoiDraw.drawDelaunay
public static SVGPath drawDelaunay(Projection2D proj, List<SweepHullDelaunay2D.Triangle> delaunay, List<double[]> means) { """ Draw the Delaunay triangulation. @param proj Projection @param delaunay Triangulation @param means Means @return Path """ final SVGPath path = new SVGPath(); for(SweepHul...
java
public static SVGPath drawDelaunay(Projection2D proj, List<SweepHullDelaunay2D.Triangle> delaunay, List<double[]> means) { final SVGPath path = new SVGPath(); for(SweepHullDelaunay2D.Triangle del : delaunay) { path.moveTo(proj.fastProjectDataToRenderSpace(means.get(del.a))); path.drawTo(proj.fastPro...
[ "public", "static", "SVGPath", "drawDelaunay", "(", "Projection2D", "proj", ",", "List", "<", "SweepHullDelaunay2D", ".", "Triangle", ">", "delaunay", ",", "List", "<", "double", "[", "]", ">", "means", ")", "{", "final", "SVGPath", "path", "=", "new", "SV...
Draw the Delaunay triangulation. @param proj Projection @param delaunay Triangulation @param means Means @return Path
[ "Draw", "the", "Delaunay", "triangulation", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/VoronoiDraw.java#L57-L66
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeElement.java
TreeElement.findNodeRecurse
private TreeElement findNodeRecurse(String fullName, String currentName) { """ Helper routine that will recursively search the tree for the node. @param fullName The full name that we are looking for @param currentName The name of the current node. @return The node matching the name or <code>null</code> ...
java
private TreeElement findNodeRecurse(String fullName, String currentName) { String remainingName = null; if ((currentName == null) || (fullName == null)) { return null; } if (getName().equals(fullName)) { return this; } if (currentName.indexOf(...
[ "private", "TreeElement", "findNodeRecurse", "(", "String", "fullName", ",", "String", "currentName", ")", "{", "String", "remainingName", "=", "null", ";", "if", "(", "(", "currentName", "==", "null", ")", "||", "(", "fullName", "==", "null", ")", ")", "{...
Helper routine that will recursively search the tree for the node. @param fullName The full name that we are looking for @param currentName The name of the current node. @return The node matching the name or <code>null</code>
[ "Helper", "routine", "that", "will", "recursively", "search", "the", "tree", "for", "the", "node", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeElement.java#L788-L817
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java
UnconditionalValueDerefAnalysis.checkNonNullPutField
private void checkNonNullPutField(Location location, ValueNumberFrame vnaFrame, UnconditionalValueDerefSet fact) throws DataflowAnalysisException { """ If this is a putfield or putstatic instruction, check to see if the field is @NonNull, and treat it as dereferences. @param location the Location ...
java
private void checkNonNullPutField(Location location, ValueNumberFrame vnaFrame, UnconditionalValueDerefSet fact) throws DataflowAnalysisException { INullnessAnnotationDatabase database = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase(); FieldInstruction fieldIns = (F...
[ "private", "void", "checkNonNullPutField", "(", "Location", "location", ",", "ValueNumberFrame", "vnaFrame", ",", "UnconditionalValueDerefSet", "fact", ")", "throws", "DataflowAnalysisException", "{", "INullnessAnnotationDatabase", "database", "=", "AnalysisContext", ".", "...
If this is a putfield or putstatic instruction, check to see if the field is @NonNull, and treat it as dereferences. @param location the Location of the instruction @param vnaFrame the ValueNumberFrame at the Location of the instruction @param fact the dataflow value to modify @throws DataflowAnalysisException
[ "If", "this", "is", "a", "putfield", "or", "putstatic", "instruction", "check", "to", "see", "if", "the", "field", "is", "@NonNull", "and", "treat", "it", "as", "dereferences", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java#L474-L497
menacher/java-game-server
jetserver/src/main/java/org/menacheri/jetserver/event/Events.java
Events.networkEvent
public static NetworkEvent networkEvent(Object source, DeliveryGuaranty deliveryGuaranty) { """ Creates a network event with the source set to the object passed in as parameter and the {@link DeliveryGuaranty} set to the incoming parameter. @param source The payload of the event. This is the actual data that...
java
public static NetworkEvent networkEvent(Object source, DeliveryGuaranty deliveryGuaranty) { Event event = event(source,Events.NETWORK_MESSAGE); NetworkEvent networkEvent = new DefaultNetworkEvent(event); networkEvent.setDeliveryGuaranty(deliveryGuaranty); return networkEvent; }
[ "public", "static", "NetworkEvent", "networkEvent", "(", "Object", "source", ",", "DeliveryGuaranty", "deliveryGuaranty", ")", "{", "Event", "event", "=", "event", "(", "source", ",", "Events", ".", "NETWORK_MESSAGE", ")", ";", "NetworkEvent", "networkEvent", "=",...
Creates a network event with the source set to the object passed in as parameter and the {@link DeliveryGuaranty} set to the incoming parameter. @param source The payload of the event. This is the actual data that gets transmitted to remote machine. @param deliveryGuaranty This decides which transport TCP or UDP to be...
[ "Creates", "a", "network", "event", "with", "the", "source", "set", "to", "the", "object", "passed", "in", "as", "parameter", "and", "the", "{", "@link", "DeliveryGuaranty", "}", "set", "to", "the", "incoming", "parameter", "." ]
train
https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/event/Events.java#L142-L148
jcuda/jcurand
JCurandJava/src/main/java/jcuda/jcurand/JCurand.java
JCurand.curandGenerateLongLong
public static int curandGenerateLongLong(curandGenerator generator, Pointer outputPtr, long num) { """ <pre> Generate 64-bit quasirandom numbers. Use generator to generate num 64-bit results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hol...
java
public static int curandGenerateLongLong(curandGenerator generator, Pointer outputPtr, long num) { return checkResult(curandGenerateLongLongNative(generator, outputPtr, num)); }
[ "public", "static", "int", "curandGenerateLongLong", "(", "curandGenerator", "generator", ",", "Pointer", "outputPtr", ",", "long", "num", ")", "{", "return", "checkResult", "(", "curandGenerateLongLongNative", "(", "generator", ",", "outputPtr", ",", "num", ")", ...
<pre> Generate 64-bit quasirandom numbers. Use generator to generate num 64-bit results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using ::curandSetStream(), or the null stream if no str...
[ "<pre", ">", "Generate", "64", "-", "bit", "quasirandom", "numbers", "." ]
train
https://github.com/jcuda/jcurand/blob/0f463d2bb72cd93b3988f7ce148cdb6069ba4fd9/JCurandJava/src/main/java/jcuda/jcurand/JCurand.java#L560-L563
citrusframework/citrus
modules/citrus-kafka/src/main/java/com/consol/citrus/kafka/embedded/EmbeddedKafkaServer.java
EmbeddedKafkaServer.createLogDir
protected File createLogDir() { """ Creates Zookeeper log directory. By default logs are created in Java temp directory. By default directory is automatically deleted on exit. @return """ File logDir = Optional.ofNullable(logDirPath) .map(Paths::get) ...
java
protected File createLogDir() { File logDir = Optional.ofNullable(logDirPath) .map(Paths::get) .map(Path::toFile) .orElse(new File(System.getProperty("java.io.tmpdir"))); if (!logDir.exists()) { ...
[ "protected", "File", "createLogDir", "(", ")", "{", "File", "logDir", "=", "Optional", ".", "ofNullable", "(", "logDirPath", ")", ".", "map", "(", "Paths", "::", "get", ")", ".", "map", "(", "Path", "::", "toFile", ")", ".", "orElse", "(", "new", "Fi...
Creates Zookeeper log directory. By default logs are created in Java temp directory. By default directory is automatically deleted on exit. @return
[ "Creates", "Zookeeper", "log", "directory", ".", "By", "default", "logs", "are", "created", "in", "Java", "temp", "directory", ".", "By", "default", "directory", "is", "automatically", "deleted", "on", "exit", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-kafka/src/main/java/com/consol/citrus/kafka/embedded/EmbeddedKafkaServer.java#L178-L199
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.indexOfAny
public static int indexOfAny(final CharSequence str, final CharSequence... searchStrs) { """ <p>Find the first index of any of a set of potential substrings.</p> <p>A {@code null} CharSequence will return {@code -1}. A {@code null} or zero length search array will return {@code -1}. A {@code null} search arra...
java
public static int indexOfAny(final CharSequence str, final CharSequence... searchStrs) { if (str == null || searchStrs == null) { return INDEX_NOT_FOUND; } // String's can't have a MAX_VALUEth index. int ret = Integer.MAX_VALUE; int tmp = 0; for (final CharS...
[ "public", "static", "int", "indexOfAny", "(", "final", "CharSequence", "str", ",", "final", "CharSequence", "...", "searchStrs", ")", "{", "if", "(", "str", "==", "null", "||", "searchStrs", "==", "null", ")", "{", "return", "INDEX_NOT_FOUND", ";", "}", "/...
<p>Find the first index of any of a set of potential substrings.</p> <p>A {@code null} CharSequence will return {@code -1}. A {@code null} or zero length search array will return {@code -1}. A {@code null} search array entry will be ignored, but a search array containing "" will return {@code 0} if {@code str} is not ...
[ "<p", ">", "Find", "the", "first", "index", "of", "any", "of", "a", "set", "of", "potential", "substrings", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L2541-L2565
jenkinsci/jenkins
core/src/main/java/hudson/Util.java
Util.loadFile
@Nonnull @Deprecated public static String loadFile(@Nonnull File logfile) throws IOException { """ Reads the entire contents of the text file at <code>logfile</code> into a string using the {@link Charset#defaultCharset() default charset} for decoding. If no such file exists, an empty string is returned....
java
@Nonnull @Deprecated public static String loadFile(@Nonnull File logfile) throws IOException { return loadFile(logfile, Charset.defaultCharset()); }
[ "@", "Nonnull", "@", "Deprecated", "public", "static", "String", "loadFile", "(", "@", "Nonnull", "File", "logfile", ")", "throws", "IOException", "{", "return", "loadFile", "(", "logfile", ",", "Charset", ".", "defaultCharset", "(", ")", ")", ";", "}" ]
Reads the entire contents of the text file at <code>logfile</code> into a string using the {@link Charset#defaultCharset() default charset} for decoding. If no such file exists, an empty string is returned. @param logfile The text file to read in its entirety. @return The entire text content of <code>logfile</code>. @t...
[ "Reads", "the", "entire", "contents", "of", "the", "text", "file", "at", "<code", ">", "logfile<", "/", "code", ">", "into", "a", "string", "using", "the", "{" ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Util.java#L198-L202
Azure/azure-sdk-for-java
cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java
AccountsInner.getUsages
public UsagesResultInner getUsages(String resourceGroupName, String accountName, String filter) { """ Get usages for the requested Cognitive Services account. @param resourceGroupName The name of the resource group within the user's subscription. @param accountName The name of Cognitive Services account. @par...
java
public UsagesResultInner getUsages(String resourceGroupName, String accountName, String filter) { return getUsagesWithServiceResponseAsync(resourceGroupName, accountName, filter).toBlocking().single().body(); }
[ "public", "UsagesResultInner", "getUsages", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "filter", ")", "{", "return", "getUsagesWithServiceResponseAsync", "(", "resourceGroupName", ",", "accountName", ",", "filter", ")", ".", "toBl...
Get usages for the requested Cognitive Services account. @param resourceGroupName The name of the resource group within the user's subscription. @param accountName The name of Cognitive Services account. @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is na...
[ "Get", "usages", "for", "the", "requested", "Cognitive", "Services", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java#L1155-L1157
google/closure-compiler
src/com/google/javascript/rhino/Node.java
Node.addChildAfter
public final void addChildAfter(Node newChild, @Nullable Node node) { """ Add 'newChild' after 'node'. If 'node' is null, add it to the front of this node. """ checkArgument(newChild.next == null, "The new child node has next siblings."); checkArgument(newChild.previous == null, "The new child node ha...
java
public final void addChildAfter(Node newChild, @Nullable Node node) { checkArgument(newChild.next == null, "The new child node has next siblings."); checkArgument(newChild.previous == null, "The new child node has previous siblings."); // NOTE: newChild.next remains null newChild.previous = newChild; ...
[ "public", "final", "void", "addChildAfter", "(", "Node", "newChild", ",", "@", "Nullable", "Node", "node", ")", "{", "checkArgument", "(", "newChild", ".", "next", "==", "null", ",", "\"The new child node has next siblings.\"", ")", ";", "checkArgument", "(", "n...
Add 'newChild' after 'node'. If 'node' is null, add it to the front of this node.
[ "Add", "newChild", "after", "node", ".", "If", "node", "is", "null", "add", "it", "to", "the", "front", "of", "this", "node", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/Node.java#L905-L911
gallandarakhneorg/afc
advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java
BusItinerary.addBusHalt
BusItineraryHalt addBusHalt(UUID id, String name, BusItineraryHaltType type, int insertToIndex) { """ Add a bus halt inside the bus itinerary. @param id is the identifier of the bus halt. @param name is the name of the bus halt @param type is the type of the bus halt. @param insertToIndex the inserted index ...
java
BusItineraryHalt addBusHalt(UUID id, String name, BusItineraryHaltType type, int insertToIndex) { String haltName = name; if (haltName == null || "".equals(haltName)) { //$NON-NLS-1$ haltName = BusItineraryHalt.getFirstFreeBushaltName(this); assert haltName != null && !"".equals(haltName); //$NON-NLS-1$ } ...
[ "BusItineraryHalt", "addBusHalt", "(", "UUID", "id", ",", "String", "name", ",", "BusItineraryHaltType", "type", ",", "int", "insertToIndex", ")", "{", "String", "haltName", "=", "name", ";", "if", "(", "haltName", "==", "null", "||", "\"\"", ".", "equals", ...
Add a bus halt inside the bus itinerary. @param id is the identifier of the bus halt. @param name is the name of the bus halt @param type is the type of the bus halt. @param insertToIndex the inserted index @return the added bus halt, otherwise <code>null</code>
[ "Add", "a", "bus", "halt", "inside", "the", "bus", "itinerary", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1090-L1107
Netflix/Hystrix
hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java
HystrixCommandExecutionHook.onFallbackSuccess
@Deprecated public <T> T onFallbackSuccess(HystrixInvokable<T> commandInstance, T fallbackResponse) { """ DEPRECATED: Change usages of this to {@link #onFallbackEmit} if you want to write a hook that handles each emitted fallback value or to {@link #onFallbackSuccess} if you want to write a hook that handles ...
java
@Deprecated public <T> T onFallbackSuccess(HystrixInvokable<T> commandInstance, T fallbackResponse) { // pass-thru by default return fallbackResponse; }
[ "@", "Deprecated", "public", "<", "T", ">", "T", "onFallbackSuccess", "(", "HystrixInvokable", "<", "T", ">", "commandInstance", ",", "T", "fallbackResponse", ")", "{", "// pass-thru by default", "return", "fallbackResponse", ";", "}" ]
DEPRECATED: Change usages of this to {@link #onFallbackEmit} if you want to write a hook that handles each emitted fallback value or to {@link #onFallbackSuccess} if you want to write a hook that handles success of the fallback method Invoked after successful execution of {@link HystrixCommand#getFallback()} with resp...
[ "DEPRECATED", ":", "Change", "usages", "of", "this", "to", "{", "@link", "#onFallbackEmit", "}", "if", "you", "want", "to", "write", "a", "hook", "that", "handles", "each", "emitted", "fallback", "value", "or", "to", "{", "@link", "#onFallbackSuccess", "}", ...
train
https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java#L391-L395
paymill/paymill-java
src/main/java/com/paymill/services/PaymentService.java
PaymentService.createWithTokenAndClient
public Payment createWithTokenAndClient( String token, String clientId ) { """ Creates a credit card or direct debit {@link Payment} from a given token. With the provided {@link Client}, the {@link Payment} will be created and subsequently be added to the given {@link Client}. @param token Token generated by PA...
java
public Payment createWithTokenAndClient( String token, String clientId ) { ValidationUtils.validatesToken( token ); ValidationUtils.validatesId( clientId ); ParameterMap<String, String> params = new ParameterMap<String, String>(); params.add( "token", token ); params.add( "client", clientId ); ...
[ "public", "Payment", "createWithTokenAndClient", "(", "String", "token", ",", "String", "clientId", ")", "{", "ValidationUtils", ".", "validatesToken", "(", "token", ")", ";", "ValidationUtils", ".", "validatesId", "(", "clientId", ")", ";", "ParameterMap", "<", ...
Creates a credit card or direct debit {@link Payment} from a given token. With the provided {@link Client}, the {@link Payment} will be created and subsequently be added to the given {@link Client}. @param token Token generated by PAYMILL Bridge, which represents a credit card or direct debit. @param clientId The Id of...
[ "Creates", "a", "credit", "card", "or", "direct", "debit", "{" ]
train
https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/PaymentService.java#L134-L143
gallandarakhneorg/afc
core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java
XMLUtil.writeXML
public static void writeXML(DocumentFragment fragment, Writer writer) throws IOException { """ Write the given node tree into a XML file. @param fragment is the object that contains the node tree @param writer is the target stream @throws IOException if the stream cannot be read. """ assert fragment != ...
java
public static void writeXML(DocumentFragment fragment, Writer writer) throws IOException { assert fragment != null : AssertMessages.notNullParameter(0); assert writer != null : AssertMessages.notNullParameter(1); writeNode(fragment, writer); }
[ "public", "static", "void", "writeXML", "(", "DocumentFragment", "fragment", ",", "Writer", "writer", ")", "throws", "IOException", "{", "assert", "fragment", "!=", "null", ":", "AssertMessages", ".", "notNullParameter", "(", "0", ")", ";", "assert", "writer", ...
Write the given node tree into a XML file. @param fragment is the object that contains the node tree @param writer is the target stream @throws IOException if the stream cannot be read.
[ "Write", "the", "given", "node", "tree", "into", "a", "XML", "file", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L2444-L2448
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.findFirstNotOf
public static int findFirstNotOf(String container, String chars, int begin) { """ Find the first occurrence of characters not in the charSeq from begin @param container the container @param chars the chars @param begin the begin @return the int """ //find the first occurrence of characters not in the ...
java
public static int findFirstNotOf(String container, String chars, int begin){ //find the first occurrence of characters not in the charSeq from begin forward for (int i = begin; i < container.length() && i >=0; ++i) if (!chars.contains("" + container.charAt(i))) return i; return -1; }
[ "public", "static", "int", "findFirstNotOf", "(", "String", "container", ",", "String", "chars", ",", "int", "begin", ")", "{", "//find the first occurrence of characters not in the charSeq\tfrom begin forward\t\r", "for", "(", "int", "i", "=", "begin", ";", "i", "<",...
Find the first occurrence of characters not in the charSeq from begin @param container the container @param chars the chars @param begin the begin @return the int
[ "Find", "the", "first", "occurrence", "of", "characters", "not", "in", "the", "charSeq", "from", "begin" ]
train
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L86-L92
lucee/Lucee
core/src/main/java/lucee/runtime/functions/conversion/SerializeJSON.java
SerializeJSON.call
public static String call(PageContext pc, Object var, boolean serializeQueryByColumns) throws PageException { """ FUTURE remove, this methods are only used by compiled code in archives older than 5.2.3 """ return _call(pc, var, serializeQueryByColumns, pc.getWebCharset()); }
java
public static String call(PageContext pc, Object var, boolean serializeQueryByColumns) throws PageException { return _call(pc, var, serializeQueryByColumns, pc.getWebCharset()); }
[ "public", "static", "String", "call", "(", "PageContext", "pc", ",", "Object", "var", ",", "boolean", "serializeQueryByColumns", ")", "throws", "PageException", "{", "return", "_call", "(", "pc", ",", "var", ",", "serializeQueryByColumns", ",", "pc", ".", "get...
FUTURE remove, this methods are only used by compiled code in archives older than 5.2.3
[ "FUTURE", "remove", "this", "methods", "are", "only", "used", "by", "compiled", "code", "in", "archives", "older", "than", "5", ".", "2", ".", "3" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/functions/conversion/SerializeJSON.java#L56-L58
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/ReferenceBasedOutlierDetection.java
ReferenceBasedOutlierDetection.updateDensities
protected void updateDensities(WritableDoubleDataStore rbod_score, DoubleDBIDList referenceDists) { """ Update the density estimates for each object. @param rbod_score Density storage @param referenceDists Distances from current reference point """ DoubleDBIDListIter it = referenceDists.iter(); for...
java
protected void updateDensities(WritableDoubleDataStore rbod_score, DoubleDBIDList referenceDists) { DoubleDBIDListIter it = referenceDists.iter(); for(int l = 0; l < referenceDists.size(); l++) { double density = computeDensity(referenceDists, it, l); // computeDensity modified the iterator, reset: ...
[ "protected", "void", "updateDensities", "(", "WritableDoubleDataStore", "rbod_score", ",", "DoubleDBIDList", "referenceDists", ")", "{", "DoubleDBIDListIter", "it", "=", "referenceDists", ".", "iter", "(", ")", ";", "for", "(", "int", "l", "=", "0", ";", "l", ...
Update the density estimates for each object. @param rbod_score Density storage @param referenceDists Distances from current reference point
[ "Update", "the", "density", "estimates", "for", "each", "object", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/ReferenceBasedOutlierDetection.java#L197-L208
sarxos/win-registry
src/main/java/com/github/sarxos/winreg/WindowsRegistry.java
WindowsRegistry.readStringValues
public Map<String, String> readStringValues(HKey hk, String key, String charsetName) throws RegistryException { """ Read value(s) and value name(s) form given key @param hk the HKEY @param key the key @param charsetName which charset to use @return the value name(s) plus the value(s) @throws RegistryExcepti...
java
public Map<String, String> readStringValues(HKey hk, String key, String charsetName) throws RegistryException { try { return ReflectedMethods.readStringValues(hk.root(), hk.hex(), key, charsetName); } catch (Exception e) { throw new RegistryException("Cannot read values from key " + key, e); } }
[ "public", "Map", "<", "String", ",", "String", ">", "readStringValues", "(", "HKey", "hk", ",", "String", "key", ",", "String", "charsetName", ")", "throws", "RegistryException", "{", "try", "{", "return", "ReflectedMethods", ".", "readStringValues", "(", "hk"...
Read value(s) and value name(s) form given key @param hk the HKEY @param key the key @param charsetName which charset to use @return the value name(s) plus the value(s) @throws RegistryException when something is not right
[ "Read", "value", "(", "s", ")", "and", "value", "name", "(", "s", ")", "form", "given", "key" ]
train
https://github.com/sarxos/win-registry/blob/5ccbe2157ae0ee894de7c41bec4bd7b1e0f5c437/src/main/java/com/github/sarxos/winreg/WindowsRegistry.java#L88-L94
zaproxy/zaproxy
src/org/zaproxy/zap/view/JCheckBoxTree.java
JCheckBoxTree.updatePredecessorsWithCheckMode
protected void updatePredecessorsWithCheckMode(TreePath tp, boolean check) { """ When a node is checked/unchecked, updating the states of the predecessors """ TreePath parentPath = tp.getParentPath(); // If it is the root, stop the recursive calls and return if (parentPath == null) { ...
java
protected void updatePredecessorsWithCheckMode(TreePath tp, boolean check) { TreePath parentPath = tp.getParentPath(); // If it is the root, stop the recursive calls and return if (parentPath == null) { return; } CheckedNode parentCheckedNode = nodesCheckingSta...
[ "protected", "void", "updatePredecessorsWithCheckMode", "(", "TreePath", "tp", ",", "boolean", "check", ")", "{", "TreePath", "parentPath", "=", "tp", ".", "getParentPath", "(", ")", ";", "// If it is the root, stop the recursive calls and return", "if", "(", "parentPat...
When a node is checked/unchecked, updating the states of the predecessors
[ "When", "a", "node", "is", "checked", "/", "unchecked", "updating", "the", "states", "of", "the", "predecessors" ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/JCheckBoxTree.java#L239-L269
Wolfgang-Schuetzelhofer/jcypher
src/main/java/iot/jcypher/query/values/JcString.java
JcString.trim
public JcString trim() { """ <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div> <div color='red' style="font-size:18px;color:red"><i>return the result of removing leading and trailing white spaces form a string, return a <b>JcString</b></i></div> <br/> """ JcString ret = n...
java
public JcString trim() { JcString ret = new JcString(null, this, new FunctionInstance(FUNCTION.String.TRIM, 1)); QueryRecorder.recordInvocationConditional(this, "trim", ret); return ret; }
[ "public", "JcString", "trim", "(", ")", "{", "JcString", "ret", "=", "new", "JcString", "(", "null", ",", "this", ",", "new", "FunctionInstance", "(", "FUNCTION", ".", "String", ".", "TRIM", ",", "1", ")", ")", ";", "QueryRecorder", ".", "recordInvocatio...
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div> <div color='red' style="font-size:18px;color:red"><i>return the result of removing leading and trailing white spaces form a string, return a <b>JcString</b></i></div> <br/>
[ "<div", "color", "=", "red", "style", "=", "font", "-", "size", ":", "24px", ";", "color", ":", "red", ">", "<b", ">", "<i", ">", "<u", ">", "JCYPHER<", "/", "u", ">", "<", "/", "i", ">", "<", "/", "b", ">", "<", "/", "div", ">", "<div", ...
train
https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/JcString.java#L82-L87
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/LSDBC.java
LSDBC.fillDensities
private void fillDensities(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore dens) { """ Collect all densities into an array for sorting. @param knnq kNN query @param ids DBIDs to process @param dens Density storage """ FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Densities", ids.siz...
java
private void fillDensities(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore dens) { FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Densities", ids.size(), LOG) : null; for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { final KNNList neighbors = knnq.getKNNForDBID(iter, k); ...
[ "private", "void", "fillDensities", "(", "KNNQuery", "<", "O", ">", "knnq", ",", "DBIDs", "ids", ",", "WritableDoubleDataStore", "dens", ")", "{", "FiniteProgress", "prog", "=", "LOG", ".", "isVerbose", "(", ")", "?", "new", "FiniteProgress", "(", "\"Densiti...
Collect all densities into an array for sorting. @param knnq kNN query @param ids DBIDs to process @param dens Density storage
[ "Collect", "all", "densities", "into", "an", "array", "for", "sorting", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/LSDBC.java#L282-L290
icode/ameba
src/main/java/ameba/mvc/template/internal/AbstractTemplateProcessor.java
AbstractTemplateProcessor.resolveReader
protected InputStreamReader resolveReader(URL url) { """ <p>resolveReader.</p> @param url a {@link java.net.URL} object. @return a {@link java.io.InputStreamReader} object. """ if (url != null) { try { InputStream in = url.openStream(); if (in != null) ...
java
protected InputStreamReader resolveReader(URL url) { if (url != null) { try { InputStream in = url.openStream(); if (in != null) return new InputStreamReader(in, this.encoding); } catch (IOException e) { logger.warn("re...
[ "protected", "InputStreamReader", "resolveReader", "(", "URL", "url", ")", "{", "if", "(", "url", "!=", "null", ")", "{", "try", "{", "InputStream", "in", "=", "url", ".", "openStream", "(", ")", ";", "if", "(", "in", "!=", "null", ")", "return", "ne...
<p>resolveReader.</p> @param url a {@link java.net.URL} object. @return a {@link java.io.InputStreamReader} object.
[ "<p", ">", "resolveReader", ".", "<", "/", "p", ">" ]
train
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/mvc/template/internal/AbstractTemplateProcessor.java#L298-L310
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/document/json/JsonObject.java
JsonObject.putNullAndEncrypt
public JsonObject putNullAndEncrypt(String name, String providerName) { """ Store a null value as encrypted identified by the field's name. This method is equivalent to calling {@link #put(String, Object)} with either {@link JsonValue#NULL JsonValue.NULL} or a null value explicitly cast to Object. Note: Use...
java
public JsonObject putNullAndEncrypt(String name, String providerName) { addValueEncryptionInfo(name, providerName, true); content.put(name, null); return this; }
[ "public", "JsonObject", "putNullAndEncrypt", "(", "String", "name", ",", "String", "providerName", ")", "{", "addValueEncryptionInfo", "(", "name", ",", "providerName", ",", "true", ")", ";", "content", ".", "put", "(", "name", ",", "null", ")", ";", "return...
Store a null value as encrypted identified by the field's name. This method is equivalent to calling {@link #put(String, Object)} with either {@link JsonValue#NULL JsonValue.NULL} or a null value explicitly cast to Object. Note: Use of the Field Level Encryption functionality provided in the com.couchbase.client.encr...
[ "Store", "a", "null", "value", "as", "encrypted", "identified", "by", "the", "field", "s", "name", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/document/json/JsonObject.java#L1010-L1014
alibaba/jstorm
jstorm-core/src/main/java/storm/trident/Stream.java
Stream.maxBy
public Stream maxBy(String inputFieldName) { """ This aggregator operation computes the maximum of tuples by the given {@code inputFieldName} and it is assumed that its value is an instance of {@code Comparable}. If the value of tuple with field {@code inputFieldName} is not an instance of {@code Comparable} the...
java
public Stream maxBy(String inputFieldName) { Aggregator<ComparisonAggregator.State> max = new Max(inputFieldName); return comparableAggregateStream(inputFieldName, max); }
[ "public", "Stream", "maxBy", "(", "String", "inputFieldName", ")", "{", "Aggregator", "<", "ComparisonAggregator", ".", "State", ">", "max", "=", "new", "Max", "(", "inputFieldName", ")", ";", "return", "comparableAggregateStream", "(", "inputFieldName", ",", "m...
This aggregator operation computes the maximum of tuples by the given {@code inputFieldName} and it is assumed that its value is an instance of {@code Comparable}. If the value of tuple with field {@code inputFieldName} is not an instance of {@code Comparable} then it throws {@code ClassCastException} @param inputFiel...
[ "This", "aggregator", "operation", "computes", "the", "maximum", "of", "tuples", "by", "the", "given", "{", "@code", "inputFieldName", "}", "and", "it", "is", "assumed", "that", "its", "value", "is", "an", "instance", "of", "{", "@code", "Comparable", "}", ...
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L522-L525
DDTH/ddth-dao
ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/GenericBoJdbcDao.java
GenericBoJdbcDao.getAll
protected Stream<T> getAll(Connection conn) { """ Fetch all existing BOs from storage and return the result as a stream. @param conn @return @since 0.9.0 """ return executeSelectAsStream(rowMapper, conn, true, calcSqlSelectAll()); }
java
protected Stream<T> getAll(Connection conn) { return executeSelectAsStream(rowMapper, conn, true, calcSqlSelectAll()); }
[ "protected", "Stream", "<", "T", ">", "getAll", "(", "Connection", "conn", ")", "{", "return", "executeSelectAsStream", "(", "rowMapper", ",", "conn", ",", "true", ",", "calcSqlSelectAll", "(", ")", ")", ";", "}" ]
Fetch all existing BOs from storage and return the result as a stream. @param conn @return @since 0.9.0
[ "Fetch", "all", "existing", "BOs", "from", "storage", "and", "return", "the", "result", "as", "a", "stream", "." ]
train
https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/GenericBoJdbcDao.java#L596-L598
mojohaus/jaxb2-maven-plugin
src/main/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DomHelper.java
DomHelper.getMethodLocation
public static MethodLocation getMethodLocation(final Node aNode, final Set<MethodLocation> methodLocations) { """ Finds the MethodLocation within the given Set, which corresponds to the supplied DOM Node. @param aNode A DOM Node. @param methodLocations The Set of all found/known MethodLocation instan...
java
public static MethodLocation getMethodLocation(final Node aNode, final Set<MethodLocation> methodLocations) { MethodLocation toReturn = null; if (aNode != null && CLASS_FIELD_METHOD_ELEMENT_NAMES.contains(aNode.getLocalName().toLowerCase())) { final MethodLocation validLocation = getField...
[ "public", "static", "MethodLocation", "getMethodLocation", "(", "final", "Node", "aNode", ",", "final", "Set", "<", "MethodLocation", ">", "methodLocations", ")", "{", "MethodLocation", "toReturn", "=", "null", ";", "if", "(", "aNode", "!=", "null", "&&", "CLA...
Finds the MethodLocation within the given Set, which corresponds to the supplied DOM Node. @param aNode A DOM Node. @param methodLocations The Set of all found/known MethodLocation instances. @return The MethodLocation matching the supplied Node - or {@code null} if no match was found.
[ "Finds", "the", "MethodLocation", "within", "the", "given", "Set", "which", "corresponds", "to", "the", "supplied", "DOM", "Node", "." ]
train
https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DomHelper.java#L253-L272
timols/java-gitlab-api
src/main/java/org/gitlab/api/GitlabAPI.java
GitlabAPI.uploadFile
public GitlabUpload uploadFile(GitlabProject project, File file) throws IOException { """ Uploads a file to a project @param project @param file @return @throws IOException on gitlab api call error """ String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(project.getId()) + GitlabUpload.UR...
java
public GitlabUpload uploadFile(GitlabProject project, File file) throws IOException { String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(project.getId()) + GitlabUpload.URL; return dispatch().withAttachment("file", file).to(tailUrl, GitlabUpload.class); }
[ "public", "GitlabUpload", "uploadFile", "(", "GitlabProject", "project", ",", "File", "file", ")", "throws", "IOException", "{", "String", "tailUrl", "=", "GitlabProject", ".", "URL", "+", "\"/\"", "+", "sanitizeProjectId", "(", "project", ".", "getId", "(", "...
Uploads a file to a project @param project @param file @return @throws IOException on gitlab api call error
[ "Uploads", "a", "file", "to", "a", "project" ]
train
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L974-L977
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/energybalance/OmsEnergyBalance.java
OmsEnergyBalance.dpVap
private double dpVap( double T, double P ) { """ Calcola la derivata della pressione di vapore [mbar] a saturazione rispetto dalla temperatura [gradi Celsius]. @param T @param P @return derivata della pressione di vapore. """ double A = 6.1121 * (1.0007 + 3.46E-6 * P); double b = 17.502; ...
java
private double dpVap( double T, double P ) { double A = 6.1121 * (1.0007 + 3.46E-6 * P); double b = 17.502; double c = 240.97; double De = (A * exp(b * T / (c + T))) * (b / (c + T) - b * T / pow(c + T, 2.0)); return De; }
[ "private", "double", "dpVap", "(", "double", "T", ",", "double", "P", ")", "{", "double", "A", "=", "6.1121", "*", "(", "1.0007", "+", "3.46E-6", "*", "P", ")", ";", "double", "b", "=", "17.502", ";", "double", "c", "=", "240.97", ";", "double", ...
Calcola la derivata della pressione di vapore [mbar] a saturazione rispetto dalla temperatura [gradi Celsius]. @param T @param P @return derivata della pressione di vapore.
[ "Calcola", "la", "derivata", "della", "pressione", "di", "vapore", "[", "mbar", "]", "a", "saturazione", "rispetto", "dalla", "temperatura", "[", "gradi", "Celsius", "]", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/energybalance/OmsEnergyBalance.java#L1270-L1277
Harium/keel
src/main/java/com/harium/keel/catalano/math/tools/ImageStatistics.java
ImageStatistics.Mean
public static float Mean(ImageSource fastBitmap, int startX, int startY, int width, int height) { """ Calculate Mean value. @param fastBitmap Image to be processed. @param startX Initial X axis coordinate. @param startY Initial Y axis coordinate. @param width Width. @param height Height. @...
java
public static float Mean(ImageSource fastBitmap, int startX, int startY, int width, int height) { float mean = 0; if (fastBitmap.isGrayscale()) { for (int i = startX; i < height; i++) { for (int j = startY; j < width; j++) { mean += fastBitmap.getRGB(...
[ "public", "static", "float", "Mean", "(", "ImageSource", "fastBitmap", ",", "int", "startX", ",", "int", "startY", ",", "int", "width", ",", "int", "height", ")", "{", "float", "mean", "=", "0", ";", "if", "(", "fastBitmap", ".", "isGrayscale", "(", ")...
Calculate Mean value. @param fastBitmap Image to be processed. @param startX Initial X axis coordinate. @param startY Initial Y axis coordinate. @param width Width. @param height Height. @return Mean.
[ "Calculate", "Mean", "value", "." ]
train
https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/tools/ImageStatistics.java#L181-L193
DV8FromTheWorld/JDA
src/main/java/net/dv8tion/jda/core/JDABuilder.java
JDABuilder.useSharding
public JDABuilder useSharding(int shardId, int shardTotal) { """ This will enable sharding mode for JDA. <br>In sharding mode, guilds are split up and assigned one of multiple shards (clients). <br>The shardId that receives all stuff related to given bot is calculated as follows: shardId == (guildId {@literal >>...
java
public JDABuilder useSharding(int shardId, int shardTotal) { AccountTypeException.check(accountType, AccountType.BOT); Checks.notNegative(shardId, "Shard ID"); Checks.positive(shardTotal, "Shard Total"); Checks.check(shardId < shardTotal, "The shard ID must be lower than ...
[ "public", "JDABuilder", "useSharding", "(", "int", "shardId", ",", "int", "shardTotal", ")", "{", "AccountTypeException", ".", "check", "(", "accountType", ",", "AccountType", ".", "BOT", ")", ";", "Checks", ".", "notNegative", "(", "shardId", ",", "\"Shard ID...
This will enable sharding mode for JDA. <br>In sharding mode, guilds are split up and assigned one of multiple shards (clients). <br>The shardId that receives all stuff related to given bot is calculated as follows: shardId == (guildId {@literal >>} 22) % shardTotal; <br><b>PMs are only sent to shard 0.</b> <p>Please ...
[ "This", "will", "enable", "sharding", "mode", "for", "JDA", ".", "<br", ">", "In", "sharding", "mode", "guilds", "are", "split", "up", "and", "assigned", "one", "of", "multiple", "shards", "(", "clients", ")", ".", "<br", ">", "The", "shardId", "that", ...
train
https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/JDABuilder.java#L720-L729
VoltDB/voltdb
src/frontend/org/voltcore/utils/ShutdownHooks.java
ShutdownHooks.registerShutdownHook
public static void registerShutdownHook(int priority, boolean runOnCrash, Runnable action) { """ Register an action to be run when the JVM exits. @param priority The priority level at which this action should be run. Lower values will run earlier. @param runOnCrash Whether or not this action should be performe...
java
public static void registerShutdownHook(int priority, boolean runOnCrash, Runnable action) { m_instance.addHook(priority, runOnCrash, action); //Any hook registered lets print crash messsage. ShutdownHooks.m_crashMessage = true; }
[ "public", "static", "void", "registerShutdownHook", "(", "int", "priority", ",", "boolean", "runOnCrash", ",", "Runnable", "action", ")", "{", "m_instance", ".", "addHook", "(", "priority", ",", "runOnCrash", ",", "action", ")", ";", "//Any hook registered lets pr...
Register an action to be run when the JVM exits. @param priority The priority level at which this action should be run. Lower values will run earlier. @param runOnCrash Whether or not this action should be performed if the server is shutting down due to a call to crashVoltDB() @param action A Runnable containing th...
[ "Register", "an", "action", "to", "be", "run", "when", "the", "JVM", "exits", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/ShutdownHooks.java#L67-L72
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java
SimpleDateFormat.matchQuarterString
protected int matchQuarterString(String text, int start, int field, String[] data, Calendar cal) { """ Attempt to match the text at a given position against an array of quarter strings. Since multiple strings in the array may match (for example, if the array contains "a", "ab", and "abc", all will match the in...
java
protected int matchQuarterString(String text, int start, int field, String[] data, Calendar cal) { int i = 0; int count = data.length; // There may be multiple strings in the data[] array which begin with // the same prefix (e.g., Cerven and Cervenec (June and July) in Czech). ...
[ "protected", "int", "matchQuarterString", "(", "String", "text", ",", "int", "start", ",", "int", "field", ",", "String", "[", "]", "data", ",", "Calendar", "cal", ")", "{", "int", "i", "=", "0", ";", "int", "count", "=", "data", ".", "length", ";", ...
Attempt to match the text at a given position against an array of quarter strings. Since multiple strings in the array may match (for example, if the array contains "a", "ab", and "abc", all will match the input string "abcd") the longest match is returned. As a side effect, the given field of <code>cal</code> is set...
[ "Attempt", "to", "match", "the", "text", "at", "a", "given", "position", "against", "an", "array", "of", "quarter", "strings", ".", "Since", "multiple", "strings", "in", "the", "array", "may", "match", "(", "for", "example", "if", "the", "array", "contains...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L2960-L2989