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
zxing/zxing
core/src/main/java/com/google/zxing/common/BitArray.java
BitArray.appendBits
public void appendBits(int value, int numBits) { """ Appends the least-significant bits, from value, in order from most-significant to least-significant. For example, appending 6 bits from 0x000001E will append the bits 0, 1, 1, 1, 1, 0 in that order. @param value {@code int} containing bits to append @param...
java
public void appendBits(int value, int numBits) { if (numBits < 0 || numBits > 32) { throw new IllegalArgumentException("Num bits must be between 0 and 32"); } ensureCapacity(size + numBits); for (int numBitsLeft = numBits; numBitsLeft > 0; numBitsLeft--) { appendBit(((value >> (numBitsLeft -...
[ "public", "void", "appendBits", "(", "int", "value", ",", "int", "numBits", ")", "{", "if", "(", "numBits", "<", "0", "||", "numBits", ">", "32", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Num bits must be between 0 and 32\"", ")", ";", "}...
Appends the least-significant bits, from value, in order from most-significant to least-significant. For example, appending 6 bits from 0x000001E will append the bits 0, 1, 1, 1, 1, 0 in that order. @param value {@code int} containing bits to append @param numBits bits from value to append
[ "Appends", "the", "least", "-", "significant", "bits", "from", "value", "in", "order", "from", "most", "-", "significant", "to", "least", "-", "significant", ".", "For", "example", "appending", "6", "bits", "from", "0x000001E", "will", "append", "the", "bits...
train
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/common/BitArray.java#L232-L240
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/classify/LinearClassifier.java
LinearClassifier.getTopFeatures
public List<Triple<F,L,Double>> getTopFeatures(Set<L> labels, double threshold, boolean useMagnitude, int numFeatures, boolean descending) { """ Returns list of top features with weight above a certain threshold @p...
java
public List<Triple<F,L,Double>> getTopFeatures(Set<L> labels, double threshold, boolean useMagnitude, int numFeatures, boolean descending) { if (labels != null) { Set<Integer> iLabels = getLabelIndices(lab...
[ "public", "List", "<", "Triple", "<", "F", ",", "L", ",", "Double", ">", ">", "getTopFeatures", "(", "Set", "<", "L", ">", "labels", ",", "double", "threshold", ",", "boolean", "useMagnitude", ",", "int", "numFeatures", ",", "boolean", "descending", ")",...
Returns list of top features with weight above a certain threshold @param labels Set of labels we care about when getting features Use null to get features across all labels @param threshold Threshold above which we will count the feature @param useMagnitude Whether the notion of "large" should ignore the sign of the ...
[ "Returns", "list", "of", "top", "features", "with", "weight", "above", "a", "certain", "threshold" ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/LinearClassifier.java#L451-L461
RogerParkinson/madura-workflows
madura-workflow/src/main/java/nz/co/senanque/workflow/WorkflowManagerImpl.java
WorkflowManagerImpl.endOfProcessDetected
protected TaskBase endOfProcessDetected(ProcessInstance processInstance, Audit currentAudit) { """ If this is just the end of the handler then return the next task after the handler If it is the end of the whole process then return null. @param processInstance @param currentAudit @return TaskBase """ Tas...
java
protected TaskBase endOfProcessDetected(ProcessInstance processInstance, Audit currentAudit) { TaskBase ret = null; TaskBase currentTask = getCurrentTask(processInstance); ProcessInstanceUtils.clearQueue(processInstance, TaskStatus.DONE); currentAudit.setStatus(TaskStatus.DONE); // End of process can mean jus...
[ "protected", "TaskBase", "endOfProcessDetected", "(", "ProcessInstance", "processInstance", ",", "Audit", "currentAudit", ")", "{", "TaskBase", "ret", "=", "null", ";", "TaskBase", "currentTask", "=", "getCurrentTask", "(", "processInstance", ")", ";", "ProcessInstanc...
If this is just the end of the handler then return the next task after the handler If it is the end of the whole process then return null. @param processInstance @param currentAudit @return TaskBase
[ "If", "this", "is", "just", "the", "end", "of", "the", "handler", "then", "return", "the", "next", "task", "after", "the", "handler", "If", "it", "is", "the", "end", "of", "the", "whole", "process", "then", "return", "null", "." ]
train
https://github.com/RogerParkinson/madura-workflows/blob/3d26c322fc85a006ff0d0cbebacbc453aed8e492/madura-workflow/src/main/java/nz/co/senanque/workflow/WorkflowManagerImpl.java#L396-L436
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/IDOS.java
IDOS.computeIDOS
protected DoubleDataStore computeIDOS(DBIDs ids, KNNQuery<O> knnQ, DoubleDataStore intDims, DoubleMinMax idosminmax) { """ Computes all IDOS scores. @param ids the DBIDs to process @param knnQ the KNN query @param intDims Precomputed intrinsic dimensionalities @param idosminmax Output of minimum and maximum,...
java
protected DoubleDataStore computeIDOS(DBIDs ids, KNNQuery<O> knnQ, DoubleDataStore intDims, DoubleMinMax idosminmax) { WritableDoubleDataStore ldms = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_STATIC); FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("ID Outlier Scores for objects", id...
[ "protected", "DoubleDataStore", "computeIDOS", "(", "DBIDs", "ids", ",", "KNNQuery", "<", "O", ">", "knnQ", ",", "DoubleDataStore", "intDims", ",", "DoubleMinMax", "idosminmax", ")", "{", "WritableDoubleDataStore", "ldms", "=", "DataStoreUtil", ".", "makeDoubleStora...
Computes all IDOS scores. @param ids the DBIDs to process @param knnQ the KNN query @param intDims Precomputed intrinsic dimensionalities @param idosminmax Output of minimum and maximum, for metadata @return ID scores
[ "Computes", "all", "IDOS", "scores", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/IDOS.java#L180-L206
ReactiveX/RxJavaAsyncUtil
src/main/java/rx/util/async/Async.java
Async.toAsyncThrowing
public static <R> Func0<Observable<R>> toAsyncThrowing(final Callable<? extends R> func, final Scheduler scheduler) { """ Convert a synchronous callable call into an asynchronous function call through an Observable. <p> <img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsyn...
java
public static <R> Func0<Observable<R>> toAsyncThrowing(final Callable<? extends R> func, final Scheduler scheduler) { return new Func0<Observable<R>>() { @Override public Observable<R> call() { return startCallable(func, scheduler); } }; }
[ "public", "static", "<", "R", ">", "Func0", "<", "Observable", "<", "R", ">", ">", "toAsyncThrowing", "(", "final", "Callable", "<", "?", "extends", "R", ">", "func", ",", "final", "Scheduler", "scheduler", ")", "{", "return", "new", "Func0", "<", "Obs...
Convert a synchronous callable call into an asynchronous function call through an Observable. <p> <img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.s.png" alt=""> @param <R> the result type @param func the callable to convert @param scheduler the Scheduler used to call the ...
[ "Convert", "a", "synchronous", "callable", "call", "into", "an", "asynchronous", "function", "call", "through", "an", "Observable", ".", "<p", ">", "<img", "width", "=", "640", "src", "=", "https", ":", "//", "raw", ".", "github", ".", "com", "/", "wiki"...
train
https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L800-L807
alkacon/opencms-core
src-modules/org/opencms/workplace/tools/searchindex/CmsDocumentTypeAddList.java
CmsDocumentTypeAddList.fillDetailResourceTypes
private void fillDetailResourceTypes(CmsListItem item, String detailId) { """ Fills details about resource types of the document type into the given item. <p> @param item the list item to fill @param detailId the id for the detail to fill """ CmsSearchManager searchManager = OpenCms.getSearchManag...
java
private void fillDetailResourceTypes(CmsListItem item, String detailId) { CmsSearchManager searchManager = OpenCms.getSearchManager(); StringBuffer html = new StringBuffer(); String doctypeName = (String)item.get(LIST_COLUMN_NAME); CmsSearchDocumentType docType = searchManager.getDocum...
[ "private", "void", "fillDetailResourceTypes", "(", "CmsListItem", "item", ",", "String", "detailId", ")", "{", "CmsSearchManager", "searchManager", "=", "OpenCms", ".", "getSearchManager", "(", ")", ";", "StringBuffer", "html", "=", "new", "StringBuffer", "(", ")"...
Fills details about resource types of the document type into the given item. <p> @param item the list item to fill @param detailId the id for the detail to fill
[ "Fills", "details", "about", "resource", "types", "of", "the", "document", "type", "into", "the", "given", "item", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/searchindex/CmsDocumentTypeAddList.java#L519-L537
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java
AiMaterial.getTextureMapModeW
public AiTextureMapMode getTextureMapModeW(AiTextureType type, int index) { """ Returns the texture mapping mode for the w axis.<p> If missing, defaults to {@link AiTextureMapMode#CLAMP} @param type the texture type @param index the index in the texture stack @return the texture mapping mode """ ...
java
public AiTextureMapMode getTextureMapModeW(AiTextureType type, int index) { checkTexRange(type, index); Property p = getProperty(PropertyKey.TEX_MAP_MODE_W.m_key); if (null == p || null == p.getData()) { return (AiTextureMapMode) m_defaults.get( ...
[ "public", "AiTextureMapMode", "getTextureMapModeW", "(", "AiTextureType", "type", ",", "int", "index", ")", "{", "checkTexRange", "(", "type", ",", "index", ")", ";", "Property", "p", "=", "getProperty", "(", "PropertyKey", ".", "TEX_MAP_MODE_W", ".", "m_key", ...
Returns the texture mapping mode for the w axis.<p> If missing, defaults to {@link AiTextureMapMode#CLAMP} @param type the texture type @param index the index in the texture stack @return the texture mapping mode
[ "Returns", "the", "texture", "mapping", "mode", "for", "the", "w", "axis", ".", "<p", ">" ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L1138-L1149
lessthanoptimal/ejml
main/ejml-zdense/src/org/ejml/dense/row/RandomMatrices_ZDRM.java
RandomMatrices_ZDRM.rectangle
public static ZMatrixRMaj rectangle(int numRow , int numCol , double min , double max , Random rand ) { """ <p> Returns a matrix where all the elements are selected independently from a uniform distribution between 'min' and 'max' inclusive. </p> @param numRow Number of rows in the new matrix. @param numCol...
java
public static ZMatrixRMaj rectangle(int numRow , int numCol , double min , double max , Random rand ) { ZMatrixRMaj mat = new ZMatrixRMaj(numRow,numCol); fillUniform(mat,min,max,rand); return mat; }
[ "public", "static", "ZMatrixRMaj", "rectangle", "(", "int", "numRow", ",", "int", "numCol", ",", "double", "min", ",", "double", "max", ",", "Random", "rand", ")", "{", "ZMatrixRMaj", "mat", "=", "new", "ZMatrixRMaj", "(", "numRow", ",", "numCol", ")", "...
<p> Returns a matrix where all the elements are selected independently from a uniform distribution between 'min' and 'max' inclusive. </p> @param numRow Number of rows in the new matrix. @param numCol Number of columns in the new matrix. @param min The minimum value each element can be. @param max The maximum value ea...
[ "<p", ">", "Returns", "a", "matrix", "where", "all", "the", "elements", "are", "selected", "independently", "from", "a", "uniform", "distribution", "between", "min", "and", "max", "inclusive", ".", "<", "/", "p", ">" ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/RandomMatrices_ZDRM.java#L60-L66
passwordmaker/java-passwordmaker-lib
src/main/java/org/daveware/passwordmaker/AccountManager.java
AccountManager.generatePassword
public SecureCharArray generatePassword(CharSequence masterPassword, String inputText) { """ Same as the other version with username being sent null. @param masterPassword master password to use @param inputText the input text @return the generated password @see #generatePassword(CharSequence, String, String) ...
java
public SecureCharArray generatePassword(CharSequence masterPassword, String inputText) { return generatePassword(masterPassword, inputText, null); }
[ "public", "SecureCharArray", "generatePassword", "(", "CharSequence", "masterPassword", ",", "String", "inputText", ")", "{", "return", "generatePassword", "(", "masterPassword", ",", "inputText", ",", "null", ")", ";", "}" ]
Same as the other version with username being sent null. @param masterPassword master password to use @param inputText the input text @return the generated password @see #generatePassword(CharSequence, String, String)
[ "Same", "as", "the", "other", "version", "with", "username", "being", "sent", "null", "." ]
train
https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/AccountManager.java#L71-L73
hal/core
gui/src/main/java/org/jboss/as/console/client/widgets/forms/AddressBinding.java
AddressBinding.asSubresource
public ModelNode asSubresource(ModelNode baseAddress, String... args) { """ Turns this address into a subresource address, including the address and child-type properties.<br/> The child-type is derived from the last address token qualifier. This method allows to specify a base address prefix (i.e server vs. ...
java
public ModelNode asSubresource(ModelNode baseAddress, String... args) { int numWildCards = getNumWildCards(); int wildcards = (numWildCards - 1) > 0 ? numWildCards-1 : 0; assert wildcards == args.length : "Address arguments don't match number of wildcards: "+wildcards+" -> "+ A...
[ "public", "ModelNode", "asSubresource", "(", "ModelNode", "baseAddress", ",", "String", "...", "args", ")", "{", "int", "numWildCards", "=", "getNumWildCards", "(", ")", ";", "int", "wildcards", "=", "(", "numWildCards", "-", "1", ")", ">", "0", "?", "numW...
Turns this address into a subresource address, including the address and child-type properties.<br/> The child-type is derived from the last address token qualifier. This method allows to specify a base address prefix (i.e server vs. domain addressing). @param baseAddress @param args parameters for address wildcards ...
[ "Turns", "this", "address", "into", "a", "subresource", "address", "including", "the", "address", "and", "child", "-", "type", "properties", ".", "<br", "/", ">", "The", "child", "-", "type", "is", "derived", "from", "the", "last", "address", "token", "qua...
train
https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/widgets/forms/AddressBinding.java#L123-L171
strator-dev/greenpepper
samples-application/src/main/java/com/greenpepper/samples/application/system/AccountManager.java
AccountManager.deleteUser
public boolean deleteUser(String name) { """ <p>deleteUser.</p> @param name a {@link java.lang.String} object. @return a boolean. """ if (ADMIN_USER_ID.equals(name)) { throw new SystemException(String.format("Cannot delete '%s' user.", ADMIN_USER_ID)); } if (!isUserExist(name)) { throw new...
java
public boolean deleteUser(String name) { if (ADMIN_USER_ID.equals(name)) { throw new SystemException(String.format("Cannot delete '%s' user.", ADMIN_USER_ID)); } if (!isUserExist(name)) { throw new SystemException(String.format("User '%s' does not exist.", name)); } allAssociations.remove(name); ...
[ "public", "boolean", "deleteUser", "(", "String", "name", ")", "{", "if", "(", "ADMIN_USER_ID", ".", "equals", "(", "name", ")", ")", "{", "throw", "new", "SystemException", "(", "String", ".", "format", "(", "\"Cannot delete '%s' user.\"", ",", "ADMIN_USER_ID...
<p>deleteUser.</p> @param name a {@link java.lang.String} object. @return a boolean.
[ "<p", ">", "deleteUser", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/samples-application/src/main/java/com/greenpepper/samples/application/system/AccountManager.java#L138-L153
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
MultiUserChat.fireInvitationRejectionListeners
private void fireInvitationRejectionListeners(Message message, MUCUser.Decline rejection) { """ Fires invitation rejection listeners. @param invitee the user being invited. @param reason the reason for the rejection """ EntityBareJid invitee = rejection.getFrom(); String reason = rejection....
java
private void fireInvitationRejectionListeners(Message message, MUCUser.Decline rejection) { EntityBareJid invitee = rejection.getFrom(); String reason = rejection.getReason(); InvitationRejectionListener[] listeners; synchronized (invitationRejectionListeners) { listeners = n...
[ "private", "void", "fireInvitationRejectionListeners", "(", "Message", "message", ",", "MUCUser", ".", "Decline", "rejection", ")", "{", "EntityBareJid", "invitee", "=", "rejection", ".", "getFrom", "(", ")", ";", "String", "reason", "=", "rejection", ".", "getR...
Fires invitation rejection listeners. @param invitee the user being invited. @param reason the reason for the rejection
[ "Fires", "invitation", "rejection", "listeners", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java#L988-L999
cybazeitalia/emaze-dysfunctional
src/main/java/net/emaze/dysfunctional/Reductions.java
Reductions.minimum
public static <E extends Comparable<E>> E minimum(Iterator<E> iterator, E init) { """ Returns the min element contained in the iterator @param <E> the iterator element type parameter @param iterator the iterator to be consumed @param init the initial value to be used @return the min element contained in the ...
java
public static <E extends Comparable<E>> E minimum(Iterator<E> iterator, E init) { return Reductions.reduce(iterator, BinaryOperator.minBy(new ComparableComparator<E>()), init); }
[ "public", "static", "<", "E", "extends", "Comparable", "<", "E", ">", ">", "E", "minimum", "(", "Iterator", "<", "E", ">", "iterator", ",", "E", "init", ")", "{", "return", "Reductions", ".", "reduce", "(", "iterator", ",", "BinaryOperator", ".", "minB...
Returns the min element contained in the iterator @param <E> the iterator element type parameter @param iterator the iterator to be consumed @param init the initial value to be used @return the min element contained in the iterator
[ "Returns", "the", "min", "element", "contained", "in", "the", "iterator" ]
train
https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Reductions.java#L251-L253
jenkinsci/jenkins
core/src/main/java/hudson/PluginManager.java
PluginManager.parseRequestedPlugins
public Map<String,VersionNumber> parseRequestedPlugins(InputStream configXml) throws IOException { """ Parses configuration XML files and picks up references to XML files. """ final Map<String,VersionNumber> requestedPlugins = new TreeMap<>(); try { SAXParserFactory.newInstance().ne...
java
public Map<String,VersionNumber> parseRequestedPlugins(InputStream configXml) throws IOException { final Map<String,VersionNumber> requestedPlugins = new TreeMap<>(); try { SAXParserFactory.newInstance().newSAXParser().parse(configXml, new DefaultHandler() { @Override public ...
[ "public", "Map", "<", "String", ",", "VersionNumber", ">", "parseRequestedPlugins", "(", "InputStream", "configXml", ")", "throws", "IOException", "{", "final", "Map", "<", "String", ",", "VersionNumber", ">", "requestedPlugins", "=", "new", "TreeMap", "<>", "("...
Parses configuration XML files and picks up references to XML files.
[ "Parses", "configuration", "XML", "files", "and", "picks", "up", "references", "to", "XML", "files", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/PluginManager.java#L1900-L1933
voldemort/voldemort
src/java/voldemort/store/stats/ClientSocketStats.java
ClientSocketStats.recordConnectionEstablishmentTimeUs
public void recordConnectionEstablishmentTimeUs(SocketDestination dest, long connEstTimeUs) { """ Record the connection establishment time @param dest Destination of the socket to connect to. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param c...
java
public void recordConnectionEstablishmentTimeUs(SocketDestination dest, long connEstTimeUs) { if(dest != null) { getOrCreateNodeStats(dest).recordConnectionEstablishmentTimeUs(null, connEstTimeUs); recordConnectionEstablishmentTimeUs(null, connEstTimeUs); } else { thi...
[ "public", "void", "recordConnectionEstablishmentTimeUs", "(", "SocketDestination", "dest", ",", "long", "connEstTimeUs", ")", "{", "if", "(", "dest", "!=", "null", ")", "{", "getOrCreateNodeStats", "(", "dest", ")", ".", "recordConnectionEstablishmentTimeUs", "(", "...
Record the connection establishment time @param dest Destination of the socket to connect to. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param connEstTimeUs The number of us to wait before establishing a connection
[ "Record", "the", "connection", "establishment", "time" ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L248-L255
grails/grails-core
grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java
DefaultGrailsApplication.isArtefactOfType
public boolean isArtefactOfType(String artefactType, @SuppressWarnings("rawtypes") Class theClazz) { """ Returns true if the specified class is of the given artefact type as defined by the ArtefactHandler. @param artefactType The type of the artefact @param theClazz The class @return true if it is of the ...
java
public boolean isArtefactOfType(String artefactType, @SuppressWarnings("rawtypes") Class theClazz) { ArtefactHandler handler = artefactHandlersByName.get(artefactType); if (handler == null) { throw new GrailsConfigurationException( "Unable to locate arefact handler for sp...
[ "public", "boolean", "isArtefactOfType", "(", "String", "artefactType", ",", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "Class", "theClazz", ")", "{", "ArtefactHandler", "handler", "=", "artefactHandlersByName", ".", "get", "(", "artefactType", ")", ";", "...
Returns true if the specified class is of the given artefact type as defined by the ArtefactHandler. @param artefactType The type of the artefact @param theClazz The class @return true if it is of the specified artefactType @see grails.core.ArtefactHandler
[ "Returns", "true", "if", "the", "specified", "class", "is", "of", "the", "given", "artefact", "type", "as", "defined", "by", "the", "ArtefactHandler", "." ]
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L435-L443
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
Property.with
final public <T> Property with(Option<T> option, T value) { """ Adds an option @param option Option type to be added @param value Option value @param <T> Type of option value @return current property instance (this) """ if(value != null){ options.addOrSet(option, value); } ...
java
final public <T> Property with(Option<T> option, T value) { if(value != null){ options.addOrSet(option, value); } return this; }
[ "final", "public", "<", "T", ">", "Property", "with", "(", "Option", "<", "T", ">", "option", ",", "T", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "options", ".", "addOrSet", "(", "option", ",", "value", ")", ";", "}", "return...
Adds an option @param option Option type to be added @param value Option value @param <T> Type of option value @return current property instance (this)
[ "Adds", "an", "option" ]
train
https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java#L91-L96
exoplatform/jcr
exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/MembershipHandlerImpl.java
MembershipHandlerImpl.findMembershipByUserGroupAndType
private Membership findMembershipByUserGroupAndType(Session session, String userName, String groupId, String type) throws Exception { """ Use this method to search for a specific membership type of an user in a group. """ MembershipImpl membership = getFromCache(userName, groupId, type); if (...
java
private Membership findMembershipByUserGroupAndType(Session session, String userName, String groupId, String type) throws Exception { MembershipImpl membership = getFromCache(userName, groupId, type); if (membership != null) { return membership; } try { No...
[ "private", "Membership", "findMembershipByUserGroupAndType", "(", "Session", "session", ",", "String", "userName", ",", "String", "groupId", ",", "String", "type", ")", "throws", "Exception", "{", "MembershipImpl", "membership", "=", "getFromCache", "(", "userName", ...
Use this method to search for a specific membership type of an user in a group.
[ "Use", "this", "method", "to", "search", "for", "a", "specific", "membership", "type", "of", "an", "user", "in", "a", "group", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/MembershipHandlerImpl.java#L274-L308
jMetal/jMetal
jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/mochc/MOCHC.java
MOCHC.hammingDistance
private int hammingDistance(BinarySolution solutionOne, BinarySolution solutionTwo) { """ Calculate the hamming distance between two solutions @param solutionOne A <code>Solution</code> @param solutionTwo A <code>Solution</code> @return the hamming distance between solutions """ int distance = 0; ...
java
private int hammingDistance(BinarySolution solutionOne, BinarySolution solutionTwo) { int distance = 0; for (int i = 0; i < problem.getNumberOfVariables(); i++) { distance += hammingDistance(solutionOne.getVariableValue(i), solutionTwo.getVariableValue(i)); } return distance; }
[ "private", "int", "hammingDistance", "(", "BinarySolution", "solutionOne", ",", "BinarySolution", "solutionTwo", ")", "{", "int", "distance", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "problem", ".", "getNumberOfVariables", "(", ")", ...
Calculate the hamming distance between two solutions @param solutionOne A <code>Solution</code> @param solutionTwo A <code>Solution</code> @return the hamming distance between solutions
[ "Calculate", "the", "hamming", "distance", "between", "two", "solutions" ]
train
https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/mochc/MOCHC.java#L192-L199
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobVersionsInner.java
JobVersionsInner.getAsync
public Observable<JobVersionInner> getAsync(String resourceGroupName, String serverName, String jobAgentName, String jobName, int jobVersion) { """ Gets a job version. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager AP...
java
public Observable<JobVersionInner> getAsync(String resourceGroupName, String serverName, String jobAgentName, String jobName, int jobVersion) { return getWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, jobName, jobVersion).map(new Func1<ServiceResponse<JobVersionInner>, JobVersionInner>() ...
[ "public", "Observable", "<", "JobVersionInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "jobAgentName", ",", "String", "jobName", ",", "int", "jobVersion", ")", "{", "return", "getWithServiceResponseAsync", "(...
Gets a job version. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param jobAgentName The name of the job agent. @param jobName The name of the job. @param jobVer...
[ "Gets", "a", "job", "version", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobVersionsInner.java#L257-L264
eserating/siren4j
src/main/java/com/google/code/siren4j/util/ReflectionUtils.java
ReflectionUtils.getFieldInfoByName
public static ReflectedInfo getFieldInfoByName(List<ReflectedInfo> infoList, String name) { """ Helper method to find the field info by its name from the passed in list of info. @param infoList cannot be <code>null</code>. @param name cannot be <code>null</code> or empty. @return the info or <code>null</code>...
java
public static ReflectedInfo getFieldInfoByName(List<ReflectedInfo> infoList, String name) { if (infoList == null) { throw new IllegalArgumentException("infoList cannot be null."); } if (StringUtils.isBlank(name)) { throw new IllegalArgumentException("name cannot be n...
[ "public", "static", "ReflectedInfo", "getFieldInfoByName", "(", "List", "<", "ReflectedInfo", ">", "infoList", ",", "String", "name", ")", "{", "if", "(", "infoList", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"infoList cannot be nu...
Helper method to find the field info by its name from the passed in list of info. @param infoList cannot be <code>null</code>. @param name cannot be <code>null</code> or empty. @return the info or <code>null</code> if not found.
[ "Helper", "method", "to", "find", "the", "field", "info", "by", "its", "name", "from", "the", "passed", "in", "list", "of", "info", "." ]
train
https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/util/ReflectionUtils.java#L500-L518
watson-developer-cloud/java-sdk
speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/SpeechToText.java
SpeechToText.recognizeUsingWebSocket
public WebSocket recognizeUsingWebSocket(RecognizeOptions recognizeOptions, RecognizeCallback callback) { """ Sends audio and returns transcription results for recognition requests over a WebSocket connection. Requests and responses are enabled over a single TCP connection that abstracts much of the complexity of...
java
public WebSocket recognizeUsingWebSocket(RecognizeOptions recognizeOptions, RecognizeCallback callback) { Validator.notNull(recognizeOptions, "recognizeOptions cannot be null"); Validator.notNull(recognizeOptions.audio(), "audio cannot be null"); Validator.notNull(callback, "callback cannot be null"); ...
[ "public", "WebSocket", "recognizeUsingWebSocket", "(", "RecognizeOptions", "recognizeOptions", ",", "RecognizeCallback", "callback", ")", "{", "Validator", ".", "notNull", "(", "recognizeOptions", ",", "\"recognizeOptions cannot be null\"", ")", ";", "Validator", ".", "no...
Sends audio and returns transcription results for recognition requests over a WebSocket connection. Requests and responses are enabled over a single TCP connection that abstracts much of the complexity of the request to offer efficient implementation, low latency, high throughput, and an asynchronous response. By defau...
[ "Sends", "audio", "and", "returns", "transcription", "results", "for", "recognition", "requests", "over", "a", "WebSocket", "connection", ".", "Requests", "and", "responses", "are", "enabled", "over", "a", "single", "TCP", "connection", "that", "abstracts", "much"...
train
https://github.com/watson-developer-cloud/java-sdk/blob/c926117afd20e2002b69942537720ab733a914f3/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/SpeechToText.java#L381-L412
spring-projects/spring-shell
spring-shell-core/src/main/java/org/springframework/shell/CompletionContext.java
CompletionContext.drop
public CompletionContext drop(int nbWords) { """ Return a copy of this context, as if the first {@literal nbWords} were not present """ return new CompletionContext(new ArrayList<String>(words.subList(nbWords, words.size())), wordIndex-nbWords, position); }
java
public CompletionContext drop(int nbWords) { return new CompletionContext(new ArrayList<String>(words.subList(nbWords, words.size())), wordIndex-nbWords, position); }
[ "public", "CompletionContext", "drop", "(", "int", "nbWords", ")", "{", "return", "new", "CompletionContext", "(", "new", "ArrayList", "<", "String", ">", "(", "words", ".", "subList", "(", "nbWords", ",", "words", ".", "size", "(", ")", ")", ")", ",", ...
Return a copy of this context, as if the first {@literal nbWords} were not present
[ "Return", "a", "copy", "of", "this", "context", "as", "if", "the", "first", "{" ]
train
https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-core/src/main/java/org/springframework/shell/CompletionContext.java#L86-L88
raydac/java-binary-block-parser
jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java
JBBPDslBuilder.BitArray
public JBBPDslBuilder BitArray(final String bitLenExpression, final String sizeExpression) { """ Add anonymous bit array with size calculated through expression. @param bitLenExpression expression to calculate length of the bit field, must not be null @param sizeExpression expression to be used to calculate ...
java
public JBBPDslBuilder BitArray(final String bitLenExpression, final String sizeExpression) { return this.BitArray(null, bitLenExpression, assertExpressionChars(sizeExpression)); }
[ "public", "JBBPDslBuilder", "BitArray", "(", "final", "String", "bitLenExpression", ",", "final", "String", "sizeExpression", ")", "{", "return", "this", ".", "BitArray", "(", "null", ",", "bitLenExpression", ",", "assertExpressionChars", "(", "sizeExpression", ")",...
Add anonymous bit array with size calculated through expression. @param bitLenExpression expression to calculate length of the bit field, must not be null @param sizeExpression expression to be used to calculate array size, must not be null @return the builder instance, must not be null
[ "Add", "anonymous", "bit", "array", "with", "size", "calculated", "through", "expression", "." ]
train
https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L710-L712
knowm/XChange
xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/v2/service/CoinbaseMarketDataServiceRaw.java
CoinbaseMarketDataServiceRaw.getCoinbaseHistoricalSpotRate
public CoinbasePrice getCoinbaseHistoricalSpotRate(Currency base, Currency counter, Date date) throws IOException { """ Unauthenticated resource that tells you the current price of one unit. This is usually somewhere in between the buy and sell price, current to within a few minutes. @param pair The curr...
java
public CoinbasePrice getCoinbaseHistoricalSpotRate(Currency base, Currency counter, Date date) throws IOException { String datespec = new SimpleDateFormat("yyyy-MM-dd").format(date); return coinbase .getHistoricalSpotRate(Coinbase.CB_VERSION_VALUE, base + "-" + counter, datespec) .getData(...
[ "public", "CoinbasePrice", "getCoinbaseHistoricalSpotRate", "(", "Currency", "base", ",", "Currency", "counter", ",", "Date", "date", ")", "throws", "IOException", "{", "String", "datespec", "=", "new", "SimpleDateFormat", "(", "\"yyyy-MM-dd\"", ")", ".", "format", ...
Unauthenticated resource that tells you the current price of one unit. This is usually somewhere in between the buy and sell price, current to within a few minutes. @param pair The currency pair. @param date The given date. @return The price in the desired {@code currency} ont the give {@code date} for one unit. @thro...
[ "Unauthenticated", "resource", "that", "tells", "you", "the", "current", "price", "of", "one", "unit", ".", "This", "is", "usually", "somewhere", "in", "between", "the", "buy", "and", "sell", "price", "current", "to", "within", "a", "few", "minutes", "." ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/v2/service/CoinbaseMarketDataServiceRaw.java#L89-L95
rundeck/rundeck
core/src/main/java/com/dtolabs/rundeck/core/rules/WorkflowEngineOperationsProcessor.java
WorkflowEngineOperationsProcessor.getAvailableChanges
private void getAvailableChanges( final Map<String, String> changes) { """ Poll for changes from the queue, and process all changes that are immediately available without waiting @param changes changes map """ WorkflowSystem.OperationCompleted<DAT> task = stateChangeQueue.poll(); while (task !...
java
private void getAvailableChanges( final Map<String, String> changes) { WorkflowSystem.OperationCompleted<DAT> task = stateChangeQueue.poll(); while (task != null && task.getNewState() != null) { changes.putAll(task.getNewState().getState()); DAT result = task.getResult(); ...
[ "private", "void", "getAvailableChanges", "(", "final", "Map", "<", "String", ",", "String", ">", "changes", ")", "{", "WorkflowSystem", ".", "OperationCompleted", "<", "DAT", ">", "task", "=", "stateChangeQueue", ".", "poll", "(", ")", ";", "while", "(", ...
Poll for changes from the queue, and process all changes that are immediately available without waiting @param changes changes map
[ "Poll", "for", "changes", "from", "the", "queue", "and", "process", "all", "changes", "that", "are", "immediately", "available", "without", "waiting" ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/rules/WorkflowEngineOperationsProcessor.java#L143-L153
k0shk0sh/PermissionHelper
permission/src/main/java/com/fastaccess/permission/base/PermissionHelper.java
PermissionHelper.isPermissionGranted
public static boolean isPermissionGranted(@NonNull Context context, @NonNull String permission) { """ return true if permission is granted, false otherwise. <p/> can be used outside of activity. """ return ActivityCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED; ...
java
public static boolean isPermissionGranted(@NonNull Context context, @NonNull String permission) { return ActivityCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED; }
[ "public", "static", "boolean", "isPermissionGranted", "(", "@", "NonNull", "Context", "context", ",", "@", "NonNull", "String", "permission", ")", "{", "return", "ActivityCompat", ".", "checkSelfPermission", "(", "context", ",", "permission", ")", "==", "PackageMa...
return true if permission is granted, false otherwise. <p/> can be used outside of activity.
[ "return", "true", "if", "permission", "is", "granted", "false", "otherwise", ".", "<p", "/", ">", "can", "be", "used", "outside", "of", "activity", "." ]
train
https://github.com/k0shk0sh/PermissionHelper/blob/04edce2af49981d1dd321bcdfbe981a1000b29d7/permission/src/main/java/com/fastaccess/permission/base/PermissionHelper.java#L337-L339
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfLayer.java
PdfLayer.setName
public void setName(String name) { """ Sets the name of this layer. @param name the name of this layer """ put(PdfName.NAME, new PdfString(name, PdfObject.TEXT_UNICODE)); }
java
public void setName(String name) { put(PdfName.NAME, new PdfString(name, PdfObject.TEXT_UNICODE)); }
[ "public", "void", "setName", "(", "String", "name", ")", "{", "put", "(", "PdfName", ".", "NAME", ",", "new", "PdfString", "(", "name", ",", "PdfObject", ".", "TEXT_UNICODE", ")", ")", ";", "}" ]
Sets the name of this layer. @param name the name of this layer
[ "Sets", "the", "name", "of", "this", "layer", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfLayer.java#L160-L162
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java
DistRaid.setup
private boolean setup() throws IOException { """ set up input file which has the list of input files. @return boolean @throws IOException """ estimateSavings(); final String randomId = getRandomId(); JobClient jClient = new JobClient(jobconf); Path jobdir = new Path(jClient.getSystemDir(),...
java
private boolean setup() throws IOException { estimateSavings(); final String randomId = getRandomId(); JobClient jClient = new JobClient(jobconf); Path jobdir = new Path(jClient.getSystemDir(), NAME + "_" + randomId); LOG.info(JOB_DIR_LABEL + "=" + jobdir); jobconf.set(JOB_DIR_LABEL, jobdir.to...
[ "private", "boolean", "setup", "(", ")", "throws", "IOException", "{", "estimateSavings", "(", ")", ";", "final", "String", "randomId", "=", "getRandomId", "(", ")", ";", "JobClient", "jClient", "=", "new", "JobClient", "(", "jobconf", ")", ";", "Path", "j...
set up input file which has the list of input files. @return boolean @throws IOException
[ "set", "up", "input", "file", "which", "has", "the", "list", "of", "input", "files", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java#L525-L583
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrameModelingVisitor.java
ValueNumberFrameModelingVisitor.storeStaticField
private void storeStaticField(XField staticField, Instruction obj, boolean pushStoredValue) { """ Store a static field. @param staticField the static field @param obj the instruction which stores the field @param pushStoredValue push the stored value onto the stack (because we are modeling an inner-class ...
java
private void storeStaticField(XField staticField, Instruction obj, boolean pushStoredValue) { if (RLE_DEBUG) { System.out.println("[storeStaticField for field " + staticField + " in instruction " + handle); } ValueNumberFrame frame = getFrame(); AvailableLoad availableLoad ...
[ "private", "void", "storeStaticField", "(", "XField", "staticField", ",", "Instruction", "obj", ",", "boolean", "pushStoredValue", ")", "{", "if", "(", "RLE_DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"[storeStaticField for field \"", "+", "st...
Store a static field. @param staticField the static field @param obj the instruction which stores the field @param pushStoredValue push the stored value onto the stack (because we are modeling an inner-class field access method)
[ "Store", "a", "static", "field", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrameModelingVisitor.java#L831-L860
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/util/SeaGlassGraphicsUtils.java
SeaGlassGraphicsUtils.drawEmphasizedText
public void drawEmphasizedText(Graphics g, Color foreground, Color emphasis, String s, int underlinedIndex, int x, int y) { """ Draw text with an emphasized background. @param g the Graphics context to draw with. @param foreground the foreground color. @param emphasis the emphasis color. @param s the tex...
java
public void drawEmphasizedText(Graphics g, Color foreground, Color emphasis, String s, int underlinedIndex, int x, int y) { Graphics2D g2d = (Graphics2D) g.create(); g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2d.setColor(emphasis); ...
[ "public", "void", "drawEmphasizedText", "(", "Graphics", "g", ",", "Color", "foreground", ",", "Color", "emphasis", ",", "String", "s", ",", "int", "underlinedIndex", ",", "int", "x", ",", "int", "y", ")", "{", "Graphics2D", "g2d", "=", "(", "Graphics2D", ...
Draw text with an emphasized background. @param g the Graphics context to draw with. @param foreground the foreground color. @param emphasis the emphasis color. @param s the text to draw. @param underlinedIndex the index to underline. @param x the x coordinate to draw at. @param y the y coordinate to draw at.
[ "Draw", "text", "with", "an", "emphasized", "background", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/util/SeaGlassGraphicsUtils.java#L365-L374
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getDetailedGuildInfo
public void getDetailedGuildInfo(String id, String api, Callback<Guild> callback) throws GuildWars2Exception, NullPointerException { """ For more info on guild upgrades API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/upgrades">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Res...
java
public void getDetailedGuildInfo(String id, String api, Callback<Guild> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); gw2API.getDetailedGuildInfo(id, api).enqueue(callback); }
[ "public", "void", "getDetailedGuildInfo", "(", "String", "id", ",", "String", "api", ",", "Callback", "<", "Guild", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isParamValid", "(", "new", "ParamChecker", "(", "ParamType...
For more info on guild upgrades API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/upgrades">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions<br/> Note: if the given account is not a member, someti...
[ "For", "more", "info", "on", "guild", "upgrades", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "guild", "/", "upgrades", ">", "here<", "/", "a", ">", "<br", "/"...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1451-L1454
erlang/otp
lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
OtpOutputStream.write_bitstr
public void write_bitstr(final byte[] bin, final int pad_bits) { """ Write an array of bytes to the stream as an Erlang bitstr. @param bin the array of bytes to write. @param pad_bits the number of zero pad bits at the low end of the last byte """ if (pad_bits == 0) { write_binary(bin...
java
public void write_bitstr(final byte[] bin, final int pad_bits) { if (pad_bits == 0) { write_binary(bin); return; } write1(OtpExternal.bitBinTag); write4BE(bin.length); write1(8 - pad_bits); writeN(bin); }
[ "public", "void", "write_bitstr", "(", "final", "byte", "[", "]", "bin", ",", "final", "int", "pad_bits", ")", "{", "if", "(", "pad_bits", "==", "0", ")", "{", "write_binary", "(", "bin", ")", ";", "return", ";", "}", "write1", "(", "OtpExternal", "....
Write an array of bytes to the stream as an Erlang bitstr. @param bin the array of bytes to write. @param pad_bits the number of zero pad bits at the low end of the last byte
[ "Write", "an", "array", "of", "bytes", "to", "the", "stream", "as", "an", "Erlang", "bitstr", "." ]
train
https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java#L462-L471
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java
UnicodeSet.resemblesPropertyPattern
private static boolean resemblesPropertyPattern(String pattern, int pos) { """ Return true if the given position, in the given pattern, appears to be the start of a property set pattern. """ // Patterns are at least 5 characters long if ((pos+5) > pattern.length()) { return false; ...
java
private static boolean resemblesPropertyPattern(String pattern, int pos) { // Patterns are at least 5 characters long if ((pos+5) > pattern.length()) { return false; } // Look for an opening [:, [:^, \p, or \P return pattern.regionMatches(pos, "[:", 0, 2) || ...
[ "private", "static", "boolean", "resemblesPropertyPattern", "(", "String", "pattern", ",", "int", "pos", ")", "{", "// Patterns are at least 5 characters long", "if", "(", "(", "pos", "+", "5", ")", ">", "pattern", ".", "length", "(", ")", ")", "{", "return", ...
Return true if the given position, in the given pattern, appears to be the start of a property set pattern.
[ "Return", "true", "if", "the", "given", "position", "in", "the", "given", "pattern", "appears", "to", "be", "the", "start", "of", "a", "property", "set", "pattern", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java#L3522-L3532
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java
CreateInstanceRequest.addLabel
@SuppressWarnings("WeakerAccess") public CreateInstanceRequest addLabel(@Nonnull String key, @Nonnull String value) { """ Adds an arbitrary label to the instance. <p>Labels are key-value pairs that you can use to group related instances and store metadata about an instance. @see <a href="https://cloud.goo...
java
@SuppressWarnings("WeakerAccess") public CreateInstanceRequest addLabel(@Nonnull String key, @Nonnull String value) { Preconditions.checkNotNull(key, "Key can't be null"); Preconditions.checkNotNull(value, "Value can't be null"); builder.getInstanceBuilder().putLabels(key, value); return this; }
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "public", "CreateInstanceRequest", "addLabel", "(", "@", "Nonnull", "String", "key", ",", "@", "Nonnull", "String", "value", ")", "{", "Preconditions", ".", "checkNotNull", "(", "key", ",", "\"Key can't be nul...
Adds an arbitrary label to the instance. <p>Labels are key-value pairs that you can use to group related instances and store metadata about an instance. @see <a href="https://cloud.google.com/bigtable/docs/creating-managing-labels">For more details</a>
[ "Adds", "an", "arbitrary", "label", "to", "the", "instance", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java#L112-L118
dita-ot/dita-ot
src/main/java/org/dita/dost/reader/MergeTopicParser.java
MergeTopicParser.handleHref
private void handleHref(final String classValue, final AttributesImpl atts) { """ Rewrite href attribute. @param classValue element class value @param atts attributes """ final URI attValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF)); if (attValue != null) { final String scopeVa...
java
private void handleHref(final String classValue, final AttributesImpl atts) { final URI attValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF)); if (attValue != null) { final String scopeValue = atts.getValue(ATTRIBUTE_NAME_SCOPE); if ((scopeValue == null || ATTR_SCOPE_VALUE_LOCAL.e...
[ "private", "void", "handleHref", "(", "final", "String", "classValue", ",", "final", "AttributesImpl", "atts", ")", "{", "final", "URI", "attValue", "=", "toURI", "(", "atts", ".", "getValue", "(", "ATTRIBUTE_NAME_HREF", ")", ")", ";", "if", "(", "attValue",...
Rewrite href attribute. @param classValue element class value @param atts attributes
[ "Rewrite", "href", "attribute", "." ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L228-L251
alipay/sofa-rpc
core/api/src/main/java/com/alipay/sofa/rpc/filter/FilterChain.java
FilterChain.buildConsumerChain
public static FilterChain buildConsumerChain(ConsumerConfig<?> consumerConfig, FilterInvoker lastFilter) { """ 构造调用端的执行链 @param consumerConfig consumer配置 @param lastFilter 最后一个filter @return filter执行链 """ return new FilterChain(selectActualFilters(consumerConfig, CONSUMER_AUTO_ACTIVES), lastFi...
java
public static FilterChain buildConsumerChain(ConsumerConfig<?> consumerConfig, FilterInvoker lastFilter) { return new FilterChain(selectActualFilters(consumerConfig, CONSUMER_AUTO_ACTIVES), lastFilter, consumerConfig); }
[ "public", "static", "FilterChain", "buildConsumerChain", "(", "ConsumerConfig", "<", "?", ">", "consumerConfig", ",", "FilterInvoker", "lastFilter", ")", "{", "return", "new", "FilterChain", "(", "selectActualFilters", "(", "consumerConfig", ",", "CONSUMER_AUTO_ACTIVES"...
构造调用端的执行链 @param consumerConfig consumer配置 @param lastFilter 最后一个filter @return filter执行链
[ "构造调用端的执行链" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/filter/FilterChain.java#L156-L158
SeaCloudsEU/SeaCloudsPlatform
sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/TemplateRestEntity.java
TemplateRestEntity.updateTemplate
@PUT @Path(" { """ Updates the information of an specific template If the template it is not in the database, it returns 404 with empty payload <pre> PUT /templates Request: POST /templates HTTP/1.1 Accept: application/xml Response: {@code <?xml version="1.0" encoding="UTF-8" standalone="yes...
java
@PUT @Path("{uuid}") public ITemplate updateTemplate(@PathParam("uuid") String uuid, TemplateParam templateParam) throws InternalException, NotFoundException, ConflictException{ logger.debug("StartOf updateTemplate"); ITemplate updatedTemplate = null; try{ TemplateHelperE tem...
[ "@", "PUT", "@", "Path", "(", "\"{uuid}\"", ")", "public", "ITemplate", "updateTemplate", "(", "@", "PathParam", "(", "\"uuid\"", ")", "String", "uuid", ",", "TemplateParam", "templateParam", ")", "throws", "InternalException", ",", "NotFoundException", ",", "Co...
Updates the information of an specific template If the template it is not in the database, it returns 404 with empty payload <pre> PUT /templates Request: POST /templates HTTP/1.1 Accept: application/xml Response: {@code <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <message code="204" message="The templ...
[ "Updates", "the", "information", "of", "an", "specific", "template", "If", "the", "template", "it", "is", "not", "in", "the", "database", "it", "returns", "404", "with", "empty", "payload" ]
train
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/TemplateRestEntity.java#L357-L387
mfornos/humanize
humanize-slim/src/main/java/humanize/Humanize.java
Humanize.lossyEquals
public static boolean lossyEquals(final String source, final String target) { """ <p> Locale-sensitive string comparison for primary differences. </p> <pre> <code> loosyEquals("Aáà-aa", "aaaaa") // == true loosyEquals("abc", "cba") // == false </code> </pre> @param source The source string to be comp...
java
public static boolean lossyEquals(final String source, final String target) { Collator c = Collator.getInstance(currentLocale()); c.setStrength(Collator.PRIMARY); return c.equals(source, target); }
[ "public", "static", "boolean", "lossyEquals", "(", "final", "String", "source", ",", "final", "String", "target", ")", "{", "Collator", "c", "=", "Collator", ".", "getInstance", "(", "currentLocale", "(", ")", ")", ";", "c", ".", "setStrength", "(", "Colla...
<p> Locale-sensitive string comparison for primary differences. </p> <pre> <code> loosyEquals("Aáà-aa", "aaaaa") // == true loosyEquals("abc", "cba") // == false </code> </pre> @param source The source string to be compared @param target The target string to be compared @return true if the two strings are equals acco...
[ "<p", ">", "Locale", "-", "sensitive", "string", "comparison", "for", "primary", "differences", ".", "<", "/", "p", ">" ]
train
https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/Humanize.java#L1274-L1279
att/openstacksdk
openstack-java-sdk/openstack-client/src/main/java/com/woorea/openstack/common/client/JULWrapper.java
JULWrapper.entering
@SuppressWarnings("nls") @Override public void entering(String sourceClass, String sourceMethod) { """ Log a method entry. <p> This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY", log level FINER, and the given sourceMethod and sourceClass is logged. ...
java
@SuppressWarnings("nls") @Override public void entering(String sourceClass, String sourceMethod) { writeLog(Level.FINER, "ENTRY {0}.{1}", null, new Object[] { sourceClass, sourceMethod }); }
[ "@", "SuppressWarnings", "(", "\"nls\"", ")", "@", "Override", "public", "void", "entering", "(", "String", "sourceClass", ",", "String", "sourceMethod", ")", "{", "writeLog", "(", "Level", ".", "FINER", ",", "\"ENTRY {0}.{1}\"", ",", "null", ",", "new", "Ob...
Log a method entry. <p> This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY", log level FINER, and the given sourceMethod and sourceClass is logged. </p>
[ "Log", "a", "method", "entry", ".", "<p", ">", "This", "is", "a", "convenience", "method", "that", "can", "be", "used", "to", "log", "entry", "to", "a", "method", ".", "A", "LogRecord", "with", "message", "ENTRY", "log", "level", "FINER", "and", "the",...
train
https://github.com/att/openstacksdk/blob/16a81c460a7186ebe1ea63b7682486ba147208b9/openstack-java-sdk/openstack-client/src/main/java/com/woorea/openstack/common/client/JULWrapper.java#L224-L230
leancloud/java-sdk-all
realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java
AVIMConversation.queryMessages
public void queryMessages(final AVIMMessageInterval interval, AVIMMessageQueryDirection direction, final int limit, final AVIMMessagesQueryCallback callback) { """ 根据指定的区间来查询历史消息,可以指定区间开闭、查询方向以及最大条目限制 @param interval - 区间,由起止 AVIMMessageIntervalBound 组成 @param direction - 查询方向,支持向前(A...
java
public void queryMessages(final AVIMMessageInterval interval, AVIMMessageQueryDirection direction, final int limit, final AVIMMessagesQueryCallback callback) { if (null == interval || limit < 0) { if (null != callback) { callback.internalDone(null, new AVExc...
[ "public", "void", "queryMessages", "(", "final", "AVIMMessageInterval", "interval", ",", "AVIMMessageQueryDirection", "direction", ",", "final", "int", "limit", ",", "final", "AVIMMessagesQueryCallback", "callback", ")", "{", "if", "(", "null", "==", "interval", "||...
根据指定的区间来查询历史消息,可以指定区间开闭、查询方向以及最大条目限制 @param interval - 区间,由起止 AVIMMessageIntervalBound 组成 @param direction - 查询方向,支持向前(AVIMMessageQueryDirection.AVIMMessageQueryDirectionFromNewToOld) 或向后(AVIMMessageQueryDirection.AVIMMessageQueryDirectionFromOldToNew)查询 @param limit - 结果最大条目限制 @param callback - 结果回调函数
[ "根据指定的区间来查询历史消息,可以指定区间开闭、查询方向以及最大条目限制" ]
train
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java#L1094-L1120
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.updateSpaceConsumed
void updateSpaceConsumed(String path, INode[] inodes, long nsDelta, long dsDelta) throws QuotaExceededException, FileNotFoundException { """ Updates namespace and diskspace consumed for all directories until the parent directory of file represented by path. @param path path for the file. @param ino...
java
void updateSpaceConsumed(String path, INode[] inodes, long nsDelta, long dsDelta) throws QuotaExceededException, FileNotFoundException { writeLock(); try { if (inodes == null) { inodes = rootDir.getExistingPathINodes(path); } int len = inodes.length; if (inodes[len - 1...
[ "void", "updateSpaceConsumed", "(", "String", "path", ",", "INode", "[", "]", "inodes", ",", "long", "nsDelta", ",", "long", "dsDelta", ")", "throws", "QuotaExceededException", ",", "FileNotFoundException", "{", "writeLock", "(", ")", ";", "try", "{", "if", ...
Updates namespace and diskspace consumed for all directories until the parent directory of file represented by path. @param path path for the file. @param inodes inode array representation of the path @param nsDelta the delta change of namespace @param dsDelta the delta change of diskspace @throws QuotaExceededExcepti...
[ "Updates", "namespace", "and", "diskspace", "consumed", "for", "all", "directories", "until", "the", "parent", "directory", "of", "file", "represented", "by", "path", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2070-L2087
owetterau/neo4j-websockets
client/src/main/java/de/oliverwetterau/neo4j/websockets/client/DatabaseService.java
DatabaseService.writeDataWithResult
@SuppressWarnings("unchecked") protected Result<JsonNode> writeDataWithResult(final ObjectNode message, final ObjectMapper objectMapper) { """ Sends a write message to a Neo4j cluster and returns the data server's answer. @param message service name, method name, language settingsa and method parameters in on...
java
@SuppressWarnings("unchecked") protected Result<JsonNode> writeDataWithResult(final ObjectNode message, final ObjectMapper objectMapper) { Result<JsonNode> result; byte[] binaryResultMessage = null; String textResultMessage = null; // convert json into map try { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "Result", "<", "JsonNode", ">", "writeDataWithResult", "(", "final", "ObjectNode", "message", ",", "final", "ObjectMapper", "objectMapper", ")", "{", "Result", "<", "JsonNode", ">", "result", ";", ...
Sends a write message to a Neo4j cluster and returns the data server's answer. @param message service name, method name, language settingsa and method parameters in one json node @param objectMapper json object mapper used for serialization @return data server's answer
[ "Sends", "a", "write", "message", "to", "a", "Neo4j", "cluster", "and", "returns", "the", "data", "server", "s", "answer", "." ]
train
https://github.com/owetterau/neo4j-websockets/blob/ca3481066819d01169873aeb145ab3bf5c736afe/client/src/main/java/de/oliverwetterau/neo4j/websockets/client/DatabaseService.java#L221-L260
hibernate/hibernate-ogm
neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java
EmbeddedNeo4jEntityQueries.insertEntity
public Node insertEntity(GraphDatabaseService executionEngine, Object[] columnValues) { """ Creates the node corresponding to an entity. @param executionEngine the {@link GraphDatabaseService} used to run the query @param columnValues the values in {@link org.hibernate.ogm.model.key.spi.EntityKey#getColumnValu...
java
public Node insertEntity(GraphDatabaseService executionEngine, Object[] columnValues) { Map<String, Object> params = params( columnValues ); Result result = executionEngine.execute( getCreateEntityQuery(), params ); return singleResult( result ); }
[ "public", "Node", "insertEntity", "(", "GraphDatabaseService", "executionEngine", ",", "Object", "[", "]", "columnValues", ")", "{", "Map", "<", "String", ",", "Object", ">", "params", "=", "params", "(", "columnValues", ")", ";", "Result", "result", "=", "e...
Creates the node corresponding to an entity. @param executionEngine the {@link GraphDatabaseService} used to run the query @param columnValues the values in {@link org.hibernate.ogm.model.key.spi.EntityKey#getColumnValues()} @return the corresponding node
[ "Creates", "the", "node", "corresponding", "to", "an", "entity", "." ]
train
https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L131-L135
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/auth/BoxAuthentication.java
BoxAuthentication.onLoggedOut
public void onLoggedOut(BoxAuthenticationInfo infoOriginal, Exception ex) { """ Callback method to be called on logout. @param infoOriginal the authentication information associated with the user that was logged out. @param ex the exception if appliable that caused the logout. """ BoxAuthenticationIn...
java
public void onLoggedOut(BoxAuthenticationInfo infoOriginal, Exception ex) { BoxAuthenticationInfo info = BoxAuthenticationInfo.unmodifiableObject(infoOriginal); Set<AuthListener> listeners = getListeners(); for (AuthListener listener : listeners) { listener.onLoggedOut(info, ex); ...
[ "public", "void", "onLoggedOut", "(", "BoxAuthenticationInfo", "infoOriginal", ",", "Exception", "ex", ")", "{", "BoxAuthenticationInfo", "info", "=", "BoxAuthenticationInfo", ".", "unmodifiableObject", "(", "infoOriginal", ")", ";", "Set", "<", "AuthListener", ">", ...
Callback method to be called on logout. @param infoOriginal the authentication information associated with the user that was logged out. @param ex the exception if appliable that caused the logout.
[ "Callback", "method", "to", "be", "called", "on", "logout", "." ]
train
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/auth/BoxAuthentication.java#L202-L208
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/json/JsonObject.java
JsonObject.getFloat
public float getFloat(String name, float defaultValue) { """ Returns the <code>float</code> value of the member with the specified name in this object. If this object does not contain a member with this name, the given default value is returned. If this object contains multiple members with the given name, the l...
java
public float getFloat(String name, float defaultValue) { JsonValue value = get(name); return value != null ? value.asFloat() : defaultValue; }
[ "public", "float", "getFloat", "(", "String", "name", ",", "float", "defaultValue", ")", "{", "JsonValue", "value", "=", "get", "(", "name", ")", ";", "return", "value", "!=", "null", "?", "value", ".", "asFloat", "(", ")", ":", "defaultValue", ";", "}...
Returns the <code>float</code> value of the member with the specified name in this object. If this object does not contain a member with this name, the given default value is returned. If this object contains multiple members with the given name, the last one will be picked. If this member's value does not represent a ...
[ "Returns", "the", "<code", ">", "float<", "/", "code", ">", "value", "of", "the", "member", "with", "the", "specified", "name", "in", "this", "object", ".", "If", "this", "object", "does", "not", "contain", "a", "member", "with", "this", "name", "the", ...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/JsonObject.java#L619-L622
virgo47/javasimon
javaee/src/main/java/org/javasimon/javaee/SimonServletFilterUtils.java
SimonServletFilterUtils.initRequestReporter
public static RequestReporter initRequestReporter(FilterConfig filterConfig) { """ Returns RequestReporter for the class specified for context parameter {@link SimonServletFilter#INIT_PARAM_REQUEST_REPORTER_CLASS}. """ String className = filterConfig.getInitParameter(SimonServletFilter.INIT_PARAM_REQUEST_RE...
java
public static RequestReporter initRequestReporter(FilterConfig filterConfig) { String className = filterConfig.getInitParameter(SimonServletFilter.INIT_PARAM_REQUEST_REPORTER_CLASS); if (className == null) { return new DefaultRequestReporter(); } else { try { return (RequestReporter) Class.forNa...
[ "public", "static", "RequestReporter", "initRequestReporter", "(", "FilterConfig", "filterConfig", ")", "{", "String", "className", "=", "filterConfig", ".", "getInitParameter", "(", "SimonServletFilter", ".", "INIT_PARAM_REQUEST_REPORTER_CLASS", ")", ";", "if", "(", "c...
Returns RequestReporter for the class specified for context parameter {@link SimonServletFilter#INIT_PARAM_REQUEST_REPORTER_CLASS}.
[ "Returns", "RequestReporter", "for", "the", "class", "specified", "for", "context", "parameter", "{" ]
train
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/javaee/src/main/java/org/javasimon/javaee/SimonServletFilterUtils.java#L134-L146
aol/cyclops
cyclops-futurestream/src/main/java/com/oath/cyclops/react/StageWithResults.java
StageWithResults.submit
public <R> R submit(final Function<RS, R> fn) { """ This method allows the SimpleReact Executor to be reused by JDK parallel streams. It is best used when collectResults and block are called explicitly for finer grained control over the blocking conditions. @param fn Function that contains parallelStream code ...
java
public <R> R submit(final Function<RS, R> fn) { return submit(() -> fn.apply(this.results)); }
[ "public", "<", "R", ">", "R", "submit", "(", "final", "Function", "<", "RS", ",", "R", ">", "fn", ")", "{", "return", "submit", "(", "(", ")", "->", "fn", ".", "apply", "(", "this", ".", "results", ")", ")", ";", "}" ]
This method allows the SimpleReact Executor to be reused by JDK parallel streams. It is best used when collectResults and block are called explicitly for finer grained control over the blocking conditions. @param fn Function that contains parallelStream code to be executed by the SimpleReact ForkJoinPool (if configure...
[ "This", "method", "allows", "the", "SimpleReact", "Executor", "to", "be", "reused", "by", "JDK", "parallel", "streams", ".", "It", "is", "best", "used", "when", "collectResults", "and", "block", "are", "called", "explicitly", "for", "finer", "grained", "contro...
train
https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-futurestream/src/main/java/com/oath/cyclops/react/StageWithResults.java#L38-L40
HanSolo/SteelSeries-Swing
src/main/java/eu/hansolo/steelseries/tools/ConicalGradientPaint.java
ConicalGradientPaint.getColorFromFraction
public static Color getColorFromFraction(final Color START_COLOR, final Color DESTINATION_COLOR, final int RANGE, final int VALUE) { """ With the START_COLOR at the beginning and the DESTINATION_COLOR at the end of the given RANGE the method will calculate and return the color that equals the given VALUE. e.g. a...
java
public static Color getColorFromFraction(final Color START_COLOR, final Color DESTINATION_COLOR, final int RANGE, final int VALUE) { final float SOURCE_RED = START_COLOR.getRed() * INT_TO_FLOAT_CONST; final float SOURCE_GREEN = START_COLOR.getGreen() * INT_TO_FLOAT_CONST; final float SOURCE_BLUE...
[ "public", "static", "Color", "getColorFromFraction", "(", "final", "Color", "START_COLOR", ",", "final", "Color", "DESTINATION_COLOR", ",", "final", "int", "RANGE", ",", "final", "int", "VALUE", ")", "{", "final", "float", "SOURCE_RED", "=", "START_COLOR", ".", ...
With the START_COLOR at the beginning and the DESTINATION_COLOR at the end of the given RANGE the method will calculate and return the color that equals the given VALUE. e.g. a START_COLOR of BLACK (R:0, G:0, B:0, A:255) and a DESTINATION_COLOR of WHITE(R:255, G:255, B:255, A:255) with a given RANGE of 100 and a given ...
[ "With", "the", "START_COLOR", "at", "the", "beginning", "and", "the", "DESTINATION_COLOR", "at", "the", "end", "of", "the", "given", "RANGE", "the", "method", "will", "calculate", "and", "return", "the", "color", "that", "equals", "the", "given", "VALUE", "....
train
https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/tools/ConicalGradientPaint.java#L277-L309
OpenLiberty/open-liberty
dev/com.ibm.ws.microprofile.metrics_fat/fat/src/com/ibm/ws/microprofile/metrics/fat/utils/MetricsConnection.java
MetricsConnection.connection_viewerRole
public static MetricsConnection connection_viewerRole(LibertyServer server) { """ Creates a connection for private (authorized) docs endpoint using HTTPS and the Viewer role @param server - server to connect to @return """ return new MetricsConnection(server, METRICS_ENDPOINT).secure(true) ...
java
public static MetricsConnection connection_viewerRole(LibertyServer server) { return new MetricsConnection(server, METRICS_ENDPOINT).secure(true) .header("Authorization", "Basic " + Base64Coder.base64Encode(VIEWER_USERNAME + ":" + VIEWER_PASSWORD)); }
[ "public", "static", "MetricsConnection", "connection_viewerRole", "(", "LibertyServer", "server", ")", "{", "return", "new", "MetricsConnection", "(", "server", ",", "METRICS_ENDPOINT", ")", ".", "secure", "(", "true", ")", ".", "header", "(", "\"Authorization\"", ...
Creates a connection for private (authorized) docs endpoint using HTTPS and the Viewer role @param server - server to connect to @return
[ "Creates", "a", "connection", "for", "private", "(", "authorized", ")", "docs", "endpoint", "using", "HTTPS", "and", "the", "Viewer", "role" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.metrics_fat/fat/src/com/ibm/ws/microprofile/metrics/fat/utils/MetricsConnection.java#L214-L218
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigServerFactory.java
XMLConfigServerFactory.reloadInstance
public static void reloadInstance(CFMLEngine engine, ConfigServerImpl configServer) throws SAXException, ClassException, PageException, IOException, TagLibException, FunctionLibException, BundleException { """ reloads the Config Object @param configServer @throws SAXException @throws ClassNotFoundExcepti...
java
public static void reloadInstance(CFMLEngine engine, ConfigServerImpl configServer) throws SAXException, ClassException, PageException, IOException, TagLibException, FunctionLibException, BundleException { Resource configFile = configServer.getConfigFile(); if (configFile == null) return; if (second(configServ...
[ "public", "static", "void", "reloadInstance", "(", "CFMLEngine", "engine", ",", "ConfigServerImpl", "configServer", ")", "throws", "SAXException", ",", "ClassException", ",", "PageException", ",", "IOException", ",", "TagLibException", ",", "FunctionLibException", ",", ...
reloads the Config Object @param configServer @throws SAXException @throws ClassNotFoundException @throws PageException @throws IOException @throws TagLibException @throws FunctionLibException @throws BundleException
[ "reloads", "the", "Config", "Object" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigServerFactory.java#L135-L147
otto-de/edison-microservice
edison-core/src/main/java/de/otto/edison/status/domain/ClusterInfo.java
ClusterInfo.clusterInfo
public static ClusterInfo clusterInfo(final Supplier<String> colorSupplier, final Supplier<String> colorStateSupplier) { """ Creates a ClusterInfo instance with {@link Supplier suppliers} for color and colorState information. @param colorSupplier the Supplier for the color of the cluster in Blue/Green deploymen...
java
public static ClusterInfo clusterInfo(final Supplier<String> colorSupplier, final Supplier<String> colorStateSupplier) { return new ClusterInfo(colorSupplier, colorStateSupplier); }
[ "public", "static", "ClusterInfo", "clusterInfo", "(", "final", "Supplier", "<", "String", ">", "colorSupplier", ",", "final", "Supplier", "<", "String", ">", "colorStateSupplier", ")", "{", "return", "new", "ClusterInfo", "(", "colorSupplier", ",", "colorStateSup...
Creates a ClusterInfo instance with {@link Supplier suppliers} for color and colorState information. @param colorSupplier the Supplier for the color of the cluster in Blue/Green deployment scenarios. @param colorStateSupplier the Supplier for the state of the cluster, for example "staged" or "live", to determine if th...
[ "Creates", "a", "ClusterInfo", "instance", "with", "{", "@link", "Supplier", "suppliers", "}", "for", "color", "and", "colorState", "information", "." ]
train
https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-core/src/main/java/de/otto/edison/status/domain/ClusterInfo.java#L65-L67
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java
TiledMap.getMapProperty
public String getMapProperty(String propertyName, String def) { """ Get a property given to the map. Note that this method will not perform well and should not be used as part of the default code path in the game loop. @param propertyName The name of the property of the map to retrieve @param def The defau...
java
public String getMapProperty(String propertyName, String def) { if (props == null) return def; return props.getProperty(propertyName, def); }
[ "public", "String", "getMapProperty", "(", "String", "propertyName", ",", "String", "def", ")", "{", "if", "(", "props", "==", "null", ")", "return", "def", ";", "return", "props", ".", "getProperty", "(", "propertyName", ",", "def", ")", ";", "}" ]
Get a property given to the map. Note that this method will not perform well and should not be used as part of the default code path in the game loop. @param propertyName The name of the property of the map to retrieve @param def The default value to return @return The value assigned to the property on the map (or the...
[ "Get", "a", "property", "given", "to", "the", "map", ".", "Note", "that", "this", "method", "will", "not", "perform", "well", "and", "should", "not", "be", "used", "as", "part", "of", "the", "default", "code", "path", "in", "the", "game", "loop", "." ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java#L293-L297
santhosh-tekuri/jlibs
xml/src/main/java/jlibs/xml/DefaultNamespaceContext.java
DefaultNamespaceContext.toQName
public QName toQName(String qname) { """ Constructs {@link javax.xml.namespace.QName} for the specified {@code qname}. @param qname the qualified name @return {@link javax.xml.namespace.QName} object constructed. @throws IllegalArgumentException if the prefix in {@code qname} is undeclared. """ ...
java
public QName toQName(String qname){ String prefix = ""; String localName = qname; int colon = qname.indexOf(':'); if(colon!=-1){ prefix = qname.substring(0, colon); localName = qname.substring(colon+1); } String ns = getNamespaceURI(prefix); ...
[ "public", "QName", "toQName", "(", "String", "qname", ")", "{", "String", "prefix", "=", "\"\"", ";", "String", "localName", "=", "qname", ";", "int", "colon", "=", "qname", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "colon", "!=", "-", "1...
Constructs {@link javax.xml.namespace.QName} for the specified {@code qname}. @param qname the qualified name @return {@link javax.xml.namespace.QName} object constructed. @throws IllegalArgumentException if the prefix in {@code qname} is undeclared.
[ "Constructs", "{", "@link", "javax", ".", "xml", ".", "namespace", ".", "QName", "}", "for", "the", "specified", "{", "@code", "qname", "}", "." ]
train
https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/DefaultNamespaceContext.java#L177-L191
qiujuer/Genius-Android
caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/ActionSyncTask.java
ActionSyncTask.waitRun
void waitRun(long waitMillis, int waitNanos, boolean cancelOnTimeOut) { """ Wait for a period of time to run end @param waitMillis wait milliseconds time @param waitNanos wait nanoseconds time @param cancelOnTimeOut when wait end cancel the runner """ if (!mDone) { synchroni...
java
void waitRun(long waitMillis, int waitNanos, boolean cancelOnTimeOut) { if (!mDone) { synchronized (this) { if (!mDone) { try { this.wait(waitMillis, waitNanos); } catch (InterruptedException ignored) { ...
[ "void", "waitRun", "(", "long", "waitMillis", ",", "int", "waitNanos", ",", "boolean", "cancelOnTimeOut", ")", "{", "if", "(", "!", "mDone", ")", "{", "synchronized", "(", "this", ")", "{", "if", "(", "!", "mDone", ")", "{", "try", "{", "this", ".", ...
Wait for a period of time to run end @param waitMillis wait milliseconds time @param waitNanos wait nanoseconds time @param cancelOnTimeOut when wait end cancel the runner
[ "Wait", "for", "a", "period", "of", "time", "to", "run", "end" ]
train
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/ActionSyncTask.java#L93-L107
Alluxio/alluxio
core/common/src/main/java/alluxio/cli/CommandUtils.java
CommandUtils.checkNumOfArgsNoMoreThan
public static void checkNumOfArgsNoMoreThan(Command cmd, CommandLine cl, int n) throws InvalidArgumentException { """ Checks the number of non-option arguments is no more than n for command. @param cmd command instance @param cl parsed commandline arguments @param n an integer @throws InvalidArgumentEx...
java
public static void checkNumOfArgsNoMoreThan(Command cmd, CommandLine cl, int n) throws InvalidArgumentException { if (cl.getArgs().length > n) { throw new InvalidArgumentException(ExceptionMessage.INVALID_ARGS_NUM_TOO_MANY .getMessage(cmd.getCommandName(), n, cl.getArgs().length)); } }
[ "public", "static", "void", "checkNumOfArgsNoMoreThan", "(", "Command", "cmd", ",", "CommandLine", "cl", ",", "int", "n", ")", "throws", "InvalidArgumentException", "{", "if", "(", "cl", ".", "getArgs", "(", ")", ".", "length", ">", "n", ")", "{", "throw",...
Checks the number of non-option arguments is no more than n for command. @param cmd command instance @param cl parsed commandline arguments @param n an integer @throws InvalidArgumentException if the number is greater than n
[ "Checks", "the", "number", "of", "non", "-", "option", "arguments", "is", "no", "more", "than", "n", "for", "command", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/cli/CommandUtils.java#L100-L106
pip-services3-java/pip-services3-commons-java
src/org/pipservices3/commons/data/StringValueMap.java
StringValueMap.setAsObject
public void setAsObject(String key, Object value) { """ Sets a new value to map element specified by its index. When the index is not defined, it resets the entire map value. This method has double purpose because method overrides are not supported in JavaScript. @param key (optional) a key of the element t...
java
public void setAsObject(String key, Object value) { put(key, StringConverter.toNullableString(value)); }
[ "public", "void", "setAsObject", "(", "String", "key", ",", "Object", "value", ")", "{", "put", "(", "key", ",", "StringConverter", ".", "toNullableString", "(", "value", ")", ")", ";", "}" ]
Sets a new value to map element specified by its index. When the index is not defined, it resets the entire map value. This method has double purpose because method overrides are not supported in JavaScript. @param key (optional) a key of the element to set @param value a new element or map value.
[ "Sets", "a", "new", "value", "to", "map", "element", "specified", "by", "its", "index", ".", "When", "the", "index", "is", "not", "defined", "it", "resets", "the", "entire", "map", "value", ".", "This", "method", "has", "double", "purpose", "because", "m...
train
https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/data/StringValueMap.java#L123-L125
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java
Error.xmlGlobalInexistent
public static void xmlGlobalInexistent(Class<?> aClass) { """ Thrown when global mapping is absent from XML configuration file. @param aClass class """ throw new XmlMappingGlobalDoesNotExistException(MSG.INSTANCE.message(xmlMappingGlobalDoesNotExistException, aClass.getSimpleName())); }
java
public static void xmlGlobalInexistent(Class<?> aClass) { throw new XmlMappingGlobalDoesNotExistException(MSG.INSTANCE.message(xmlMappingGlobalDoesNotExistException, aClass.getSimpleName())); }
[ "public", "static", "void", "xmlGlobalInexistent", "(", "Class", "<", "?", ">", "aClass", ")", "{", "throw", "new", "XmlMappingGlobalDoesNotExistException", "(", "MSG", ".", "INSTANCE", ".", "message", "(", "xmlMappingGlobalDoesNotExistException", ",", "aClass", "."...
Thrown when global mapping is absent from XML configuration file. @param aClass class
[ "Thrown", "when", "global", "mapping", "is", "absent", "from", "XML", "configuration", "file", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L263-L265
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/stereo/ExampleFundamentalMatrix.java
ExampleFundamentalMatrix.robustFundamental
public static DMatrixRMaj robustFundamental( List<AssociatedPair> matches , List<AssociatedPair> inliers , double inlierThreshold ) { """ Given a set of noisy observations, compute the Fundamental matrix while removing the noise. @param matches List of associated features between the two images @...
java
public static DMatrixRMaj robustFundamental( List<AssociatedPair> matches , List<AssociatedPair> inliers , double inlierThreshold ) { ConfigRansac configRansac = new ConfigRansac(); configRansac.inlierThreshold = inlierThreshold; configRansac.maxIterations = 1000; ConfigFundamental configFundament...
[ "public", "static", "DMatrixRMaj", "robustFundamental", "(", "List", "<", "AssociatedPair", ">", "matches", ",", "List", "<", "AssociatedPair", ">", "inliers", ",", "double", "inlierThreshold", ")", "{", "ConfigRansac", "configRansac", "=", "new", "ConfigRansac", ...
Given a set of noisy observations, compute the Fundamental matrix while removing the noise. @param matches List of associated features between the two images @param inliers List of feature pairs that were determined to not be noise. @return The found fundamental matrix.
[ "Given", "a", "set", "of", "noisy", "observations", "compute", "the", "Fundamental", "matrix", "while", "removing", "the", "noise", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleFundamentalMatrix.java#L74-L107
spring-projects/spring-loaded
springloaded/src/main/java/org/springsource/loaded/ri/ReflectiveInterceptor.java
ReflectiveInterceptor.typeCheckFieldSet
private static void typeCheckFieldSet(Field field, Class<?> valueType, Object value) throws IllegalAccessException { """ Perform a dynamic type check needed when setting a field value onto a field. Raises the appropriate exception when the check fails and returns normally otherwise. @throws IllegalAccessExcept...
java
private static void typeCheckFieldSet(Field field, Class<?> valueType, Object value) throws IllegalAccessException { if (!isPrimitive(valueType)) { //Call the version of this method that considers autoboxing typeCheckFieldSet(field, value); } else { //Value type is primitive. // Note: In this case va...
[ "private", "static", "void", "typeCheckFieldSet", "(", "Field", "field", ",", "Class", "<", "?", ">", "valueType", ",", "Object", "value", ")", "throws", "IllegalAccessException", "{", "if", "(", "!", "isPrimitive", "(", "valueType", ")", ")", "{", "//Call t...
Perform a dynamic type check needed when setting a field value onto a field. Raises the appropriate exception when the check fails and returns normally otherwise. @throws IllegalAccessException
[ "Perform", "a", "dynamic", "type", "check", "needed", "when", "setting", "a", "field", "value", "onto", "a", "field", ".", "Raises", "the", "appropriate", "exception", "when", "the", "check", "fails", "and", "returns", "normally", "otherwise", "." ]
train
https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/ri/ReflectiveInterceptor.java#L786-L799
greenmail-mail-test/greenmail
greenmail-core/src/main/java/com/icegreen/greenmail/util/InternetPrintWriter.java
InternetPrintWriter.createForEncoding
public static InternetPrintWriter createForEncoding(OutputStream outputStream, boolean autoFlush, Charset charset) { """ Creates a new InternetPrintWriter for given charset encoding. @param outputStream the wrapped output stream. @param charset the charset. @return a new InternetPrintWriter. """ ...
java
public static InternetPrintWriter createForEncoding(OutputStream outputStream, boolean autoFlush, Charset charset) { return new InternetPrintWriter(new OutputStreamWriter(outputStream, charset), autoFlush); }
[ "public", "static", "InternetPrintWriter", "createForEncoding", "(", "OutputStream", "outputStream", ",", "boolean", "autoFlush", ",", "Charset", "charset", ")", "{", "return", "new", "InternetPrintWriter", "(", "new", "OutputStreamWriter", "(", "outputStream", ",", "...
Creates a new InternetPrintWriter for given charset encoding. @param outputStream the wrapped output stream. @param charset the charset. @return a new InternetPrintWriter.
[ "Creates", "a", "new", "InternetPrintWriter", "for", "given", "charset", "encoding", "." ]
train
https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/InternetPrintWriter.java#L79-L81
elki-project/elki
elki-core/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseUtil.java
DatabaseUtil.getObjectsByLabelMatch
public static ArrayModifiableDBIDs getObjectsByLabelMatch(Database database, Pattern name_pattern) { """ Find object by matching their labels. @param database Database to search in @param name_pattern Name to match against class or object label @return found cluster or it throws an exception. """ Rela...
java
public static ArrayModifiableDBIDs getObjectsByLabelMatch(Database database, Pattern name_pattern) { Relation<String> relation = guessLabelRepresentation(database); if(name_pattern == null) { return DBIDUtil.newArray(); } ArrayModifiableDBIDs ret = DBIDUtil.newArray(); for(DBIDIter iditer = re...
[ "public", "static", "ArrayModifiableDBIDs", "getObjectsByLabelMatch", "(", "Database", "database", ",", "Pattern", "name_pattern", ")", "{", "Relation", "<", "String", ">", "relation", "=", "guessLabelRepresentation", "(", "database", ")", ";", "if", "(", "name_patt...
Find object by matching their labels. @param database Database to search in @param name_pattern Name to match against class or object label @return found cluster or it throws an exception.
[ "Find", "object", "by", "matching", "their", "labels", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseUtil.java#L166-L178
centic9/commons-dost
src/main/java/org/dstadler/commons/http/Utils.java
Utils.getURL
public static boolean getURL(final String sUrl, final AtomicInteger gCount, long start) { """ Test URL and report if it can be read. @param sUrl The URL to test @param gCount A counter which is incremented for each call and is used for reporting rate of calls @param start Start-timestamp for reporting rate of...
java
public static boolean getURL(final String sUrl, final AtomicInteger gCount, long start) { int count = gCount.incrementAndGet(); if(count % 100 == 0) { long diff = (System.currentTimeMillis() - start)/1000; logger.info("Count: " + count + " IPS: " + count/diff); } final URL url; try { url = new URL(s...
[ "public", "static", "boolean", "getURL", "(", "final", "String", "sUrl", ",", "final", "AtomicInteger", "gCount", ",", "long", "start", ")", "{", "int", "count", "=", "gCount", ".", "incrementAndGet", "(", ")", ";", "if", "(", "count", "%", "100", "==", ...
Test URL and report if it can be read. @param sUrl The URL to test @param gCount A counter which is incremented for each call and is used for reporting rate of calls @param start Start-timestamp for reporting rate of calls. @return true if the URL is valid and can be read, false if an error occurs when reading from i...
[ "Test", "URL", "and", "report", "if", "it", "can", "be", "read", "." ]
train
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/http/Utils.java#L159-L202
Azure/azure-sdk-for-java
appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java
AppServicePlansInner.listMetricsAsync
public Observable<Page<ResourceMetricInner>> listMetricsAsync(final String resourceGroupName, final String name) { """ Get metrics for an App Serice plan. Get metrics for an App Serice plan. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service ...
java
public Observable<Page<ResourceMetricInner>> listMetricsAsync(final String resourceGroupName, final String name) { return listMetricsWithServiceResponseAsync(resourceGroupName, name) .map(new Func1<ServiceResponse<Page<ResourceMetricInner>>, Page<ResourceMetricInner>>() { @Override ...
[ "public", "Observable", "<", "Page", "<", "ResourceMetricInner", ">", ">", "listMetricsAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "name", ")", "{", "return", "listMetricsWithServiceResponseAsync", "(", "resourceGroupName", ",", "name"...
Get metrics for an App Serice plan. Get metrics for an App Serice plan. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service plan. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;Resou...
[ "Get", "metrics", "for", "an", "App", "Serice", "plan", ".", "Get", "metrics", "for", "an", "App", "Serice", "plan", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L1976-L1984
Activiti/Activiti
activiti-engine/src/main/java/org/activiti/engine/impl/util/ReflectUtil.java
ReflectUtil.getField
public static Field getField(String fieldName, Class<?> clazz) { """ Returns the field of the given class or null if it doesn't exist. """ Field field = null; try { field = clazz.getDeclaredField(fieldName); } catch (SecurityException e) { throw new ActivitiException("not allowed to acc...
java
public static Field getField(String fieldName, Class<?> clazz) { Field field = null; try { field = clazz.getDeclaredField(fieldName); } catch (SecurityException e) { throw new ActivitiException("not allowed to access field " + field + " on class " + clazz.getCanonicalName()); } catch (NoSuch...
[ "public", "static", "Field", "getField", "(", "String", "fieldName", ",", "Class", "<", "?", ">", "clazz", ")", "{", "Field", "field", "=", "null", ";", "try", "{", "field", "=", "clazz", ".", "getDeclaredField", "(", "fieldName", ")", ";", "}", "catch...
Returns the field of the given class or null if it doesn't exist.
[ "Returns", "the", "field", "of", "the", "given", "class", "or", "null", "if", "it", "doesn", "t", "exist", "." ]
train
https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/util/ReflectUtil.java#L162-L177
virgo47/javasimon
console-embed/src/main/java/org/javasimon/console/SimonConsoleRequestProcessor.java
SimonConsoleRequestProcessor.addResourceActionBinding
public void addResourceActionBinding(final String actionPath, final String resourcePath) { """ Add a resource action binding to the {@link #actionBindings} list. @param actionPath Path of the action @param resourcePath Path of a resource located under """ this.addActionBinding(new ActionBinding() { ...
java
public void addResourceActionBinding(final String actionPath, final String resourcePath) { this.addActionBinding(new ActionBinding() { public boolean supports(ActionContext actionContext) { return actionContext.getPath().equals(actionPath); } public Action create(ActionContext actionContext) { ...
[ "public", "void", "addResourceActionBinding", "(", "final", "String", "actionPath", ",", "final", "String", "resourcePath", ")", "{", "this", ".", "addActionBinding", "(", "new", "ActionBinding", "(", ")", "{", "public", "boolean", "supports", "(", "ActionContext"...
Add a resource action binding to the {@link #actionBindings} list. @param actionPath Path of the action @param resourcePath Path of a resource located under
[ "Add", "a", "resource", "action", "binding", "to", "the", "{", "@link", "#actionBindings", "}", "list", "." ]
train
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/SimonConsoleRequestProcessor.java#L108-L118
grails/gorm-hibernate5
grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java
AbstractHibernateCriteriaBuilder.sqlProjection
protected void sqlProjection(String sql, String columnAlias, Type type) { """ Adds a sql projection to the criteria @param sql SQL projecting a single value @param columnAlias column alias for the projected value @param type the type of the projected value """ sqlProjection(sql, Collections.single...
java
protected void sqlProjection(String sql, String columnAlias, Type type) { sqlProjection(sql, Collections.singletonList(columnAlias), Collections.singletonList(type)); }
[ "protected", "void", "sqlProjection", "(", "String", "sql", ",", "String", "columnAlias", ",", "Type", "type", ")", "{", "sqlProjection", "(", "sql", ",", "Collections", ".", "singletonList", "(", "columnAlias", ")", ",", "Collections", ".", "singletonList", "...
Adds a sql projection to the criteria @param sql SQL projecting a single value @param columnAlias column alias for the projected value @param type the type of the projected value
[ "Adds", "a", "sql", "projection", "to", "the", "criteria" ]
train
https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L163-L165
aNNiMON/Lightweight-Stream-API
stream/src/main/java/com/annimon/stream/ComparatorCompat.java
ComparatorCompat.comparingInt
@NotNull public static <T> ComparatorCompat<T> comparingInt( @NotNull final ToIntFunction<? super T> keyExtractor) { """ Returns a comparator that uses a function that extracts an {@code int} sort key to be compared. @param <T> the type of the objects compared by the comparator @param keyExtra...
java
@NotNull public static <T> ComparatorCompat<T> comparingInt( @NotNull final ToIntFunction<? super T> keyExtractor) { Objects.requireNonNull(keyExtractor); return new ComparatorCompat<T>(new Comparator<T>() { @Override public int compare(T t1, T t2) { ...
[ "@", "NotNull", "public", "static", "<", "T", ">", "ComparatorCompat", "<", "T", ">", "comparingInt", "(", "@", "NotNull", "final", "ToIntFunction", "<", "?", "super", "T", ">", "keyExtractor", ")", "{", "Objects", ".", "requireNonNull", "(", "keyExtractor",...
Returns a comparator that uses a function that extracts an {@code int} sort key to be compared. @param <T> the type of the objects compared by the comparator @param keyExtractor the function that extracts the sort key @return a comparator @throws NullPointerException if {@code keyExtractor} is null
[ "Returns", "a", "comparator", "that", "uses", "a", "function", "that", "extracts", "an", "{", "@code", "int", "}", "sort", "key", "to", "be", "compared", "." ]
train
https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/ComparatorCompat.java#L162-L175
comapi/comapi-sdk-android
COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java
InternalService.getProfile
public Observable<ComapiResult<Map<String, Object>>> getProfile(@NonNull final String profileId) { """ Get profile details from the service. @param profileId Profile Id of the user. @return Profile details from the service. """ final String token = getToken(); if (sessionController.isCrea...
java
public Observable<ComapiResult<Map<String, Object>>> getProfile(@NonNull final String profileId) { final String token = getToken(); if (sessionController.isCreatingSession()) { return getTaskQueue().queueGetProfile(profileId); } else if (TextUtils.isEmpty(token)) { retu...
[ "public", "Observable", "<", "ComapiResult", "<", "Map", "<", "String", ",", "Object", ">", ">", ">", "getProfile", "(", "@", "NonNull", "final", "String", "profileId", ")", "{", "final", "String", "token", "=", "getToken", "(", ")", ";", "if", "(", "s...
Get profile details from the service. @param profileId Profile Id of the user. @return Profile details from the service.
[ "Get", "profile", "details", "from", "the", "service", "." ]
train
https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L260-L271
google/error-prone-javac
src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java
ElementFilter.usesIn
public static List<UsesDirective> usesIn(Iterable<? extends Directive> directives) { """ Returns a list of {@code uses} directives in {@code directives}. @return a list of {@code uses} directives in {@code directives} @param directives the directives to filter @since 9 @spec JPMS """ re...
java
public static List<UsesDirective> usesIn(Iterable<? extends Directive> directives) { return listFilter(directives, DirectiveKind.USES, UsesDirective.class); }
[ "public", "static", "List", "<", "UsesDirective", ">", "usesIn", "(", "Iterable", "<", "?", "extends", "Directive", ">", "directives", ")", "{", "return", "listFilter", "(", "directives", ",", "DirectiveKind", ".", "USES", ",", "UsesDirective", ".", "class", ...
Returns a list of {@code uses} directives in {@code directives}. @return a list of {@code uses} directives in {@code directives} @param directives the directives to filter @since 9 @spec JPMS
[ "Returns", "a", "list", "of", "{" ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java#L290-L293
alkacon/opencms-core
src/org/opencms/i18n/CmsMessages.java
CmsMessages.getDate
public String getDate(Date date, int format) { """ Returns a formated date String from a Date value, the formatting based on the provided option and the locale based on this instance.<p> @param date the Date object to format as String @param format the format to use, see {@link CmsMessages} for possible valu...
java
public String getDate(Date date, int format) { return CmsDateUtil.getDate(date, format, m_locale); }
[ "public", "String", "getDate", "(", "Date", "date", ",", "int", "format", ")", "{", "return", "CmsDateUtil", ".", "getDate", "(", "date", ",", "format", ",", "m_locale", ")", ";", "}" ]
Returns a formated date String from a Date value, the formatting based on the provided option and the locale based on this instance.<p> @param date the Date object to format as String @param format the format to use, see {@link CmsMessages} for possible values @return the formatted date
[ "Returns", "a", "formated", "date", "String", "from", "a", "Date", "value", "the", "formatting", "based", "on", "the", "provided", "option", "and", "the", "locale", "based", "on", "this", "instance", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsMessages.java#L232-L235
minio/minio-java
api/src/main/java/io/minio/MinioClient.java
MinioClient.executeGet
private HttpResponse executeGet(String bucketName, String objectName, Map<String,String> headerMap, Map<String,String> queryParamMap) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseExcep...
java
private HttpResponse executeGet(String bucketName, String objectName, Map<String,String> headerMap, Map<String,String> queryParamMap) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseExcep...
[ "private", "HttpResponse", "executeGet", "(", "String", "bucketName", ",", "String", "objectName", ",", "Map", "<", "String", ",", "String", ">", "headerMap", ",", "Map", "<", "String", ",", "String", ">", "queryParamMap", ")", "throws", "InvalidBucketNameExcept...
Executes GET method for given request parameters. @param bucketName Bucket name. @param objectName Object name in the bucket. @param headerMap Map of HTTP headers for the request. @param queryParamMap Map of HTTP query parameters of the request.
[ "Executes", "GET", "method", "for", "given", "request", "parameters", "." ]
train
https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L1293-L1299
ironjacamar/ironjacamar
codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java
AbstractCodeGen.writeDefaultConstructor
void writeDefaultConstructor(Definition def, Writer out, int indent) throws IOException { """ Output Default Constructor @param def definition @param out Writer @param indent space number @throws IOException ioException """ writeWithIndent(out, indent, "/**\n"); writeWithIndent(out, ind...
java
void writeDefaultConstructor(Definition def, Writer out, int indent) throws IOException { writeWithIndent(out, indent, "/**\n"); writeWithIndent(out, indent, " * Default constructor\n"); writeWithIndent(out, indent, " */\n"); //constructor writeWithIndent(out, indent, "public " + getCl...
[ "void", "writeDefaultConstructor", "(", "Definition", "def", ",", "Writer", "out", ",", "int", "indent", ")", "throws", "IOException", "{", "writeWithIndent", "(", "out", ",", "indent", ",", "\"/**\\n\"", ")", ";", "writeWithIndent", "(", "out", ",", "indent",...
Output Default Constructor @param def definition @param out Writer @param indent space number @throws IOException ioException
[ "Output", "Default", "Constructor" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java#L216-L227
CenturyLinkCloud/mdw
mdw-services/src/com/centurylink/mdw/listener/ProcessStartEventHandler.java
ProcessStartEventHandler.getMasterRequestId
protected String getMasterRequestId(XmlObject msgdoc, Map<String,String> metaInfo) { """ This method is invoked by handleEventMessage() to obtain master request ID. The default implementation does the following: - If "mdw-request-id" is defined in metaInfo, then takes its value performs place holder translation...
java
protected String getMasterRequestId(XmlObject msgdoc, Map<String,String> metaInfo) { String masterRequestId = metaInfo.get(Listener.METAINFO_MDW_REQUEST_ID); if (masterRequestId == null) masterRequestId = metaInfo.get(Listener.METAINFO_DOCUMENT_ID); else masterRequestId = this.placeH...
[ "protected", "String", "getMasterRequestId", "(", "XmlObject", "msgdoc", ",", "Map", "<", "String", ",", "String", ">", "metaInfo", ")", "{", "String", "masterRequestId", "=", "metaInfo", ".", "get", "(", "Listener", ".", "METAINFO_MDW_REQUEST_ID", ")", ";", "...
This method is invoked by handleEventMessage() to obtain master request ID. The default implementation does the following: - If "mdw-request-id" is defined in metaInfo, then takes its value performs place holder translation ({@link #placeHolderTranslation(String, Map, XmlObject)}), and returns it - otherwise, return th...
[ "This", "method", "is", "invoked", "by", "handleEventMessage", "()", "to", "obtain", "master", "request", "ID", ".", "The", "default", "implementation", "does", "the", "following", ":", "-", "If", "mdw", "-", "request", "-", "id", "is", "defined", "in", "m...
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/listener/ProcessStartEventHandler.java#L123-L129
lessthanoptimal/ejml
main/ejml-experimental/benchmarks/src/org/ejml/dense/row/mult/BenchmarkMatrixMultAccessors.java
BenchmarkMatrixMultAccessors.wrapped
public static long wrapped(DMatrixRMaj a , DMatrixRMaj b , DMatrixRMaj c ) { """ Wrapper functions with no bounds checking are used to access matrix internals """ long timeBefore = System.currentTimeMillis(); double valA; int indexCbase= 0; int endOfKLoop = b.numRows*b.numCols; ...
java
public static long wrapped(DMatrixRMaj a , DMatrixRMaj b , DMatrixRMaj c ) { long timeBefore = System.currentTimeMillis(); double valA; int indexCbase= 0; int endOfKLoop = b.numRows*b.numCols; for( int i = 0; i < a.numRows; i++ ) { int indexA = i*a.numCols; ...
[ "public", "static", "long", "wrapped", "(", "DMatrixRMaj", "a", ",", "DMatrixRMaj", "b", ",", "DMatrixRMaj", "c", ")", "{", "long", "timeBefore", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "double", "valA", ";", "int", "indexCbase", "=", "0", ...
Wrapper functions with no bounds checking are used to access matrix internals
[ "Wrapper", "functions", "with", "no", "bounds", "checking", "are", "used", "to", "access", "matrix", "internals" ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-experimental/benchmarks/src/org/ejml/dense/row/mult/BenchmarkMatrixMultAccessors.java#L83-L119
OpenBEL/openbel-framework
org.openbel.framework.common/src/main/java/org/openbel/framework/common/util/BELPathFilters.java
BELPathFilters.accept
private static boolean accept(final String extension, final File pathname) { """ Returns {@code true} if {@code pathname} ends with {@code extension}, ignoring case, {@code false} otherwise. @param extension File extension @param pathname Path name @return boolean """ if (nulls(extension, pathnam...
java
private static boolean accept(final String extension, final File pathname) { if (nulls(extension, pathname)) return false; String absPath = pathname.getAbsolutePath(); final int extLength = extension.length(); int start = absPath.length() - extLength, end = absPath.length(); Stri...
[ "private", "static", "boolean", "accept", "(", "final", "String", "extension", ",", "final", "File", "pathname", ")", "{", "if", "(", "nulls", "(", "extension", ",", "pathname", ")", ")", "return", "false", ";", "String", "absPath", "=", "pathname", ".", ...
Returns {@code true} if {@code pathname} ends with {@code extension}, ignoring case, {@code false} otherwise. @param extension File extension @param pathname Path name @return boolean
[ "Returns", "{", "@code", "true", "}", "if", "{", "@code", "pathname", "}", "ends", "with", "{", "@code", "extension", "}", "ignoring", "case", "{", "@code", "false", "}", "otherwise", "." ]
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/util/BELPathFilters.java#L62-L70
mapbox/mapbox-java
services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java
FeatureCollection.fromFeatures
public static FeatureCollection fromFeatures(@NonNull Feature[] features) { """ Create a new instance of this class by giving the feature collection an array of {@link Feature}s. The array of features itself isn't null but it can be empty and have a length of 0. @param features an array of features @return a...
java
public static FeatureCollection fromFeatures(@NonNull Feature[] features) { return new FeatureCollection(TYPE, null, Arrays.asList(features)); }
[ "public", "static", "FeatureCollection", "fromFeatures", "(", "@", "NonNull", "Feature", "[", "]", "features", ")", "{", "return", "new", "FeatureCollection", "(", "TYPE", ",", "null", ",", "Arrays", ".", "asList", "(", "features", ")", ")", ";", "}" ]
Create a new instance of this class by giving the feature collection an array of {@link Feature}s. The array of features itself isn't null but it can be empty and have a length of 0. @param features an array of features @return a new instance of this class defined by the values passed inside this static factory method...
[ "Create", "a", "new", "instance", "of", "this", "class", "by", "giving", "the", "feature", "collection", "an", "array", "of", "{", "@link", "Feature", "}", "s", ".", "The", "array", "of", "features", "itself", "isn", "t", "null", "but", "it", "can", "b...
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java#L81-L83
grails/gorm-hibernate5
grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/HibernateMappingContextConfiguration.java
HibernateMappingContextConfiguration.matchesFilter
protected boolean matchesFilter(MetadataReader reader, MetadataReaderFactory readerFactory) throws IOException { """ Check whether any of the configured entity type filters matches the current class descriptor contained in the metadata reader. """ for (TypeFilter filter : ENTITY_TYPE_FILTERS) { ...
java
protected boolean matchesFilter(MetadataReader reader, MetadataReaderFactory readerFactory) throws IOException { for (TypeFilter filter : ENTITY_TYPE_FILTERS) { if (filter.match(reader, readerFactory)) { return true; } } return false; }
[ "protected", "boolean", "matchesFilter", "(", "MetadataReader", "reader", ",", "MetadataReaderFactory", "readerFactory", ")", "throws", "IOException", "{", "for", "(", "TypeFilter", "filter", ":", "ENTITY_TYPE_FILTERS", ")", "{", "if", "(", "filter", ".", "match", ...
Check whether any of the configured entity type filters matches the current class descriptor contained in the metadata reader.
[ "Check", "whether", "any", "of", "the", "configured", "entity", "type", "filters", "matches", "the", "current", "class", "descriptor", "contained", "in", "the", "metadata", "reader", "." ]
train
https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/HibernateMappingContextConfiguration.java#L181-L188
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java
CPDefinitionSpecificationOptionValuePersistenceImpl.findByGroupId
@Override public List<CPDefinitionSpecificationOptionValue> findByGroupId( long groupId, int start, int end) { """ Returns a range of all the cp definition specification option values where groupId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>st...
java
@Override public List<CPDefinitionSpecificationOptionValue> findByGroupId( long groupId, int start, int end) { return findByGroupId(groupId, start, end, null); }
[ "@", "Override", "public", "List", "<", "CPDefinitionSpecificationOptionValue", ">", "findByGroupId", "(", "long", "groupId", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByGroupId", "(", "groupId", ",", "start", ",", "end", ",", "null", ...
Returns a range of all the cp definition specification option values where groupId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the f...
[ "Returns", "a", "range", "of", "all", "the", "cp", "definition", "specification", "option", "values", "where", "groupId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java#L1569-L1573
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/implementation/TextAnalyticsImpl.java
TextAnalyticsImpl.sentimentAsync
public ServiceFuture<SentimentBatchResult> sentimentAsync(SentimentOptionalParameter sentimentOptionalParameter, final ServiceCallback<SentimentBatchResult> serviceCallback) { """ The API returns a numeric score between 0 and 1. Scores close to 1 indicate positive sentiment, while scores close to 0 indicate negat...
java
public ServiceFuture<SentimentBatchResult> sentimentAsync(SentimentOptionalParameter sentimentOptionalParameter, final ServiceCallback<SentimentBatchResult> serviceCallback) { return ServiceFuture.fromResponse(sentimentWithServiceResponseAsync(sentimentOptionalParameter), serviceCallback); }
[ "public", "ServiceFuture", "<", "SentimentBatchResult", ">", "sentimentAsync", "(", "SentimentOptionalParameter", "sentimentOptionalParameter", ",", "final", "ServiceCallback", "<", "SentimentBatchResult", ">", "serviceCallback", ")", "{", "return", "ServiceFuture", ".", "f...
The API returns a numeric score between 0 and 1. Scores close to 1 indicate positive sentiment, while scores close to 0 indicate negative sentiment. A score of 0.5 indicates the lack of sentiment (e.g. a factoid statement). See the &lt;a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/ove...
[ "The", "API", "returns", "a", "numeric", "score", "between", "0", "and", "1", ".", "Scores", "close", "to", "1", "indicate", "positive", "sentiment", "while", "scores", "close", "to", "0", "indicate", "negative", "sentiment", ".", "A", "score", "of", "0", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/implementation/TextAnalyticsImpl.java#L252-L254
threerings/nenya
core/src/main/java/com/threerings/media/image/ImageManager.java
ImageManager.createImage
public BufferedImage createImage (int width, int height, int transparency) { """ Creates a buffered image, optimized for display on our graphics device. """ return _icreator.createImage(width, height, transparency); }
java
public BufferedImage createImage (int width, int height, int transparency) { return _icreator.createImage(width, height, transparency); }
[ "public", "BufferedImage", "createImage", "(", "int", "width", ",", "int", "height", ",", "int", "transparency", ")", "{", "return", "_icreator", ".", "createImage", "(", "width", ",", "height", ",", "transparency", ")", ";", "}" ]
Creates a buffered image, optimized for display on our graphics device.
[ "Creates", "a", "buffered", "image", "optimized", "for", "display", "on", "our", "graphics", "device", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageManager.java#L164-L167
blackdoor/blackdoor
src/main/java/black/door/struct/SortedArrayList.java
SortedArrayList.addSorted
public boolean addSorted(E element, boolean allowDuplicates) { """ adds an element to the list in its place based on natural order. @param element element to be appended to this list @param allowDuplicates if true will allow multiple of the same item to be added, else returns false. @return true if this coll...
java
public boolean addSorted(E element, boolean allowDuplicates) { boolean added = false; if(!allowDuplicates){ if(this.contains(element)){ System.err.println("item is a duplicate"); return added; }} added = super.add(element); Comparable<E> cmp = (Comparable<E>) element; for (int i = size() - 1; i ...
[ "public", "boolean", "addSorted", "(", "E", "element", ",", "boolean", "allowDuplicates", ")", "{", "boolean", "added", "=", "false", ";", "if", "(", "!", "allowDuplicates", ")", "{", "if", "(", "this", ".", "contains", "(", "element", ")", ")", "{", "...
adds an element to the list in its place based on natural order. @param element element to be appended to this list @param allowDuplicates if true will allow multiple of the same item to be added, else returns false. @return true if this collection changed as a result of the call
[ "adds", "an", "element", "to", "the", "list", "in", "its", "place", "based", "on", "natural", "order", "." ]
train
https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/struct/SortedArrayList.java#L43-L55
facebook/fresco
imagepipeline-base/src/main/java/com/facebook/imageformat/DefaultImageFormatChecker.java
DefaultImageFormatChecker.isPngHeader
private static boolean isPngHeader(final byte[] imageHeaderBytes, final int headerSize) { """ Checks if array consisting of first headerSize bytes of imageHeaderBytes starts with png signature. More information on PNG can be found there: <a href="http://en.wikipedia.org/wiki/Portable_Network_Graphics"> http://e...
java
private static boolean isPngHeader(final byte[] imageHeaderBytes, final int headerSize) { return headerSize >= PNG_HEADER.length && ImageFormatCheckerUtils.startsWithPattern(imageHeaderBytes, PNG_HEADER); }
[ "private", "static", "boolean", "isPngHeader", "(", "final", "byte", "[", "]", "imageHeaderBytes", ",", "final", "int", "headerSize", ")", "{", "return", "headerSize", ">=", "PNG_HEADER", ".", "length", "&&", "ImageFormatCheckerUtils", ".", "startsWithPattern", "(...
Checks if array consisting of first headerSize bytes of imageHeaderBytes starts with png signature. More information on PNG can be found there: <a href="http://en.wikipedia.org/wiki/Portable_Network_Graphics"> http://en.wikipedia.org/wiki/Portable_Network_Graphics</a> @param imageHeaderBytes @param headerSize @return t...
[ "Checks", "if", "array", "consisting", "of", "first", "headerSize", "bytes", "of", "imageHeaderBytes", "starts", "with", "png", "signature", ".", "More", "information", "on", "PNG", "can", "be", "found", "there", ":", "<a", "href", "=", "http", ":", "//", ...
train
https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imageformat/DefaultImageFormatChecker.java#L169-L172
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java
BigtableInstanceAdminClient.deleteAppProfile
@SuppressWarnings("WeakerAccess") public void deleteAppProfile(String instanceId, String appProfileId) { """ Deletes the specified app profile. <p>Sample code: <pre>{@code client.deleteAppProfile("my-instance", "my-app-profile"); }</pre> """ ApiExceptions.callAndTranslateApiException(deleteAppPro...
java
@SuppressWarnings("WeakerAccess") public void deleteAppProfile(String instanceId, String appProfileId) { ApiExceptions.callAndTranslateApiException(deleteAppProfileAsync(instanceId, appProfileId)); }
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "public", "void", "deleteAppProfile", "(", "String", "instanceId", ",", "String", "appProfileId", ")", "{", "ApiExceptions", ".", "callAndTranslateApiException", "(", "deleteAppProfileAsync", "(", "instanceId", ",",...
Deletes the specified app profile. <p>Sample code: <pre>{@code client.deleteAppProfile("my-instance", "my-app-profile"); }</pre>
[ "Deletes", "the", "specified", "app", "profile", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java#L1046-L1049
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.countUsers
public long countUsers(CmsRequestContext requestContext, CmsUserSearchParameters searchParams) throws CmsException { """ Counts the total number of users which match the given search criteria.<p> @param requestContext the request context @param searchParams the search criteria object @return the number of u...
java
public long countUsers(CmsRequestContext requestContext, CmsUserSearchParameters searchParams) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(requestContext); try { return m_driverManager.countUsers(dbc, searchParams); } catch (Exception e) { db...
[ "public", "long", "countUsers", "(", "CmsRequestContext", "requestContext", ",", "CmsUserSearchParameters", "searchParams", ")", "throws", "CmsException", "{", "CmsDbContext", "dbc", "=", "m_dbContextFactory", ".", "getDbContext", "(", "requestContext", ")", ";", "try",...
Counts the total number of users which match the given search criteria.<p> @param requestContext the request context @param searchParams the search criteria object @return the number of users which match the search criteria @throws CmsException if something goes wrong
[ "Counts", "the", "total", "number", "of", "users", "which", "match", "the", "given", "search", "criteria", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L888-L899
actorapp/actor-platform
actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java
Messenger.sendCustomJsonMessage
@ObjectiveCName("sendCustomJsonMessageWithPeer:withJson:") public void sendCustomJsonMessage(@NotNull Peer peer, @NotNull JsonContent content) { """ Send json message @param peer destination peer @param content json content """ modules.getMessagesModule().sendJson(peer, content); }
java
@ObjectiveCName("sendCustomJsonMessageWithPeer:withJson:") public void sendCustomJsonMessage(@NotNull Peer peer, @NotNull JsonContent content) { modules.getMessagesModule().sendJson(peer, content); }
[ "@", "ObjectiveCName", "(", "\"sendCustomJsonMessageWithPeer:withJson:\"", ")", "public", "void", "sendCustomJsonMessage", "(", "@", "NotNull", "Peer", "peer", ",", "@", "NotNull", "JsonContent", "content", ")", "{", "modules", ".", "getMessagesModule", "(", ")", "....
Send json message @param peer destination peer @param content json content
[ "Send", "json", "message" ]
train
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L930-L933
jenkinsci/artifactory-plugin
src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java
DockerUtils.pushImage
public static void pushImage(String imageTag, String username, String password, String host) throws IOException { """ Push docker image using the docker java client. @param imageTag @param username @param password @param host """ final AuthConfig authConfig = new AuthConfig(); authConfig....
java
public static void pushImage(String imageTag, String username, String password, String host) throws IOException { final AuthConfig authConfig = new AuthConfig(); authConfig.withUsername(username); authConfig.withPassword(password); DockerClient dockerClient = null; try { ...
[ "public", "static", "void", "pushImage", "(", "String", "imageTag", ",", "String", "username", ",", "String", "password", ",", "String", "host", ")", "throws", "IOException", "{", "final", "AuthConfig", "authConfig", "=", "new", "AuthConfig", "(", ")", ";", ...
Push docker image using the docker java client. @param imageTag @param username @param password @param host
[ "Push", "docker", "image", "using", "the", "docker", "java", "client", "." ]
train
https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L52-L64
alkacon/opencms-core
src/org/opencms/ui/util/table/CmsBeanTableBuilder.java
CmsBeanTableBuilder.matchView
private boolean matchView(String actualView, String declaredView) { """ Checks if the actual view matches a view declaration.<p> @param actualView the actual view @param declaredView the declared view string @return true if the view matches """ if (CmsStringUtil.isEmptyOrWhitespaceOnly(declared...
java
private boolean matchView(String actualView, String declaredView) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(declaredView) || CmsStringUtil.isEmptyOrWhitespaceOnly(actualView)) { return true; } return CmsStringUtil.splitAsList(declaredView, "|").contains(actualView); }
[ "private", "boolean", "matchView", "(", "String", "actualView", ",", "String", "declaredView", ")", "{", "if", "(", "CmsStringUtil", ".", "isEmptyOrWhitespaceOnly", "(", "declaredView", ")", "||", "CmsStringUtil", ".", "isEmptyOrWhitespaceOnly", "(", "actualView", "...
Checks if the actual view matches a view declaration.<p> @param actualView the actual view @param declaredView the declared view string @return true if the view matches
[ "Checks", "if", "the", "actual", "view", "matches", "a", "view", "declaration", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/util/table/CmsBeanTableBuilder.java#L359-L366
google/error-prone
check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java
ASTHelpers.getAnnotation
@Nullable @Deprecated public static <T extends Annotation> T getAnnotation(Tree tree, Class<T> annotationClass) { """ Retrieves an annotation, considering annotation inheritance. @deprecated If {@code annotationClass} contains a member that is a {@code Class} or an array of them, attempting to access that ...
java
@Nullable @Deprecated public static <T extends Annotation> T getAnnotation(Tree tree, Class<T> annotationClass) { Symbol sym = getSymbol(tree); return sym == null ? null : getAnnotation(sym, annotationClass); }
[ "@", "Nullable", "@", "Deprecated", "public", "static", "<", "T", "extends", "Annotation", ">", "T", "getAnnotation", "(", "Tree", "tree", ",", "Class", "<", "T", ">", "annotationClass", ")", "{", "Symbol", "sym", "=", "getSymbol", "(", "tree", ")", ";",...
Retrieves an annotation, considering annotation inheritance. @deprecated If {@code annotationClass} contains a member that is a {@code Class} or an array of them, attempting to access that member from the Error Prone checker code will result in a runtime exception. Instead, operate on {@code sym.getAnnotationMirrors()...
[ "Retrieves", "an", "annotation", "considering", "annotation", "inheritance", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java#L769-L774
beihaifeiwu/dolphin
dolphin-common/src/main/java/com/freetmp/common/type/ResolvableType.java
ResolvableType.forField
public static ResolvableType forField(Field field) { """ Return a {@link ResolvableType} for the specified {@link Field}. @param field the source field @return a {@link ResolvableType} for the specified field @see #forField(Field, Class) """ Assert.notNull(field, "Field must not be null"); return forTyp...
java
public static ResolvableType forField(Field field) { Assert.notNull(field, "Field must not be null"); return forType(null, new FieldTypeProvider(field), null); }
[ "public", "static", "ResolvableType", "forField", "(", "Field", "field", ")", "{", "Assert", ".", "notNull", "(", "field", ",", "\"Field must not be null\"", ")", ";", "return", "forType", "(", "null", ",", "new", "FieldTypeProvider", "(", "field", ")", ",", ...
Return a {@link ResolvableType} for the specified {@link Field}. @param field the source field @return a {@link ResolvableType} for the specified field @see #forField(Field, Class)
[ "Return", "a", "{" ]
train
https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/type/ResolvableType.java#L922-L925
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/Assert.java
Assert.notNull
public static void notNull(Object obj, String message, Object... arguments) { """ Asserts that the {@link Object} reference is not {@literal null}. The assertion holds if and only if the {@link Object} reference is not {@literal null}. @param obj {@link Object} reference to evaluate. @param message {@link S...
java
public static void notNull(Object obj, String message, Object... arguments) { notNull(obj, new IllegalArgumentException(format(message, arguments))); }
[ "public", "static", "void", "notNull", "(", "Object", "obj", ",", "String", "message", ",", "Object", "...", "arguments", ")", "{", "notNull", "(", "obj", ",", "new", "IllegalArgumentException", "(", "format", "(", "message", ",", "arguments", ")", ")", ")...
Asserts that the {@link Object} reference is not {@literal null}. The assertion holds if and only if the {@link Object} reference is not {@literal null}. @param obj {@link Object} reference to evaluate. @param message {@link String} containing the message using in the {@link NullPointerException} thrown if the assert...
[ "Asserts", "that", "the", "{", "@link", "Object", "}", "reference", "is", "not", "{", "@literal", "null", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L1192-L1194
VoltDB/voltdb
src/frontend/org/voltdb/jdbc/JDBC4Connection.java
JDBC4Connection.prepareCall
@Override public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { """ Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. """ checkClosed(); throw S...
java
@Override public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { checkClosed(); throw SQLError.noSupport(); }
[ "@", "Override", "public", "CallableStatement", "prepareCall", "(", "String", "sql", ",", "int", "resultSetType", ",", "int", "resultSetConcurrency", ",", "int", "resultSetHoldability", ")", "throws", "SQLException", "{", "checkClosed", "(", ")", ";", "throw", "SQ...
Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
[ "Creates", "a", "CallableStatement", "object", "that", "will", "generate", "ResultSet", "objects", "with", "the", "given", "type", "and", "concurrency", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Connection.java#L354-L359
Azure/azure-sdk-for-java
eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ConnectionStringBuilder.java
ConnectionStringBuilder.setEndpoint
public ConnectionStringBuilder setEndpoint(String namespaceName, String domainName) { """ Set an endpoint which can be used to connect to the EventHub instance. @param namespaceName the name of the namespace to connect to. @param domainName identifies the domain the namespace is located in. For non-public a...
java
public ConnectionStringBuilder setEndpoint(String namespaceName, String domainName) { try { this.endpoint = new URI(String.format(Locale.US, END_POINT_FORMAT, namespaceName, domainName)); } catch (URISyntaxException exception) { throw new IllegalConnectionStringFormatException( ...
[ "public", "ConnectionStringBuilder", "setEndpoint", "(", "String", "namespaceName", ",", "String", "domainName", ")", "{", "try", "{", "this", ".", "endpoint", "=", "new", "URI", "(", "String", ".", "format", "(", "Locale", ".", "US", ",", "END_POINT_FORMAT", ...
Set an endpoint which can be used to connect to the EventHub instance. @param namespaceName the name of the namespace to connect to. @param domainName identifies the domain the namespace is located in. For non-public and national clouds, the domain will not be "servicebus.windows.net". Available options include: - ...
[ "Set", "an", "endpoint", "which", "can", "be", "used", "to", "connect", "to", "the", "EventHub", "instance", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ConnectionStringBuilder.java#L138-L147
devcon5io/common
mixin/src/main/java/io/devcon5/mixin/Mixin.java
Mixin.invokeDefault
private static Object invokeDefault(final Object proxy, final Method method, final Object[] args) { """ Invokes a default method. Default methods are implemented in an interface which is overrided by applying the interface to the proxy. This method allows to invoke the default method on the proxy itselfs bypassin...
java
private static Object invokeDefault(final Object proxy, final Method method, final Object[] args) { final Class<?> declaringClass = method.getDeclaringClass(); try { return lookupIn(declaringClass).unreflectSpecial(method, declaringClass) .bindTo(proxy) ...
[ "private", "static", "Object", "invokeDefault", "(", "final", "Object", "proxy", ",", "final", "Method", "method", ",", "final", "Object", "[", "]", "args", ")", "{", "final", "Class", "<", "?", ">", "declaringClass", "=", "method", ".", "getDeclaringClass",...
Invokes a default method. Default methods are implemented in an interface which is overrided by applying the interface to the proxy. This method allows to invoke the default method on the proxy itselfs bypassing the overriden method. @param proxy the proxy object on which the method should be invoked @param method th...
[ "Invokes", "a", "default", "method", ".", "Default", "methods", "are", "implemented", "in", "an", "interface", "which", "is", "overrided", "by", "applying", "the", "interface", "to", "the", "proxy", ".", "This", "method", "allows", "to", "invoke", "the", "de...
train
https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/mixin/src/main/java/io/devcon5/mixin/Mixin.java#L89-L99
samskivert/samskivert
src/main/java/com/samskivert/swing/util/SwingUtil.java
SwingUtil.setEnabled
public static void setEnabled (Container comp, final boolean enabled) { """ Enables (or disables) the specified component, <em>and all of its children.</em> A simple call to {@link Container#setEnabled} does not propagate the enabled state to the children of a component, which is senseless in our opinion, but wa...
java
public static void setEnabled (Container comp, final boolean enabled) { applyToHierarchy(comp, new ComponentOp() { public void apply (Component comp) { comp.setEnabled(enabled); } }); }
[ "public", "static", "void", "setEnabled", "(", "Container", "comp", ",", "final", "boolean", "enabled", ")", "{", "applyToHierarchy", "(", "comp", ",", "new", "ComponentOp", "(", ")", "{", "public", "void", "apply", "(", "Component", "comp", ")", "{", "com...
Enables (or disables) the specified component, <em>and all of its children.</em> A simple call to {@link Container#setEnabled} does not propagate the enabled state to the children of a component, which is senseless in our opinion, but was surely done for some arguably good reason.
[ "Enables", "(", "or", "disables", ")", "the", "specified", "component", "<em", ">", "and", "all", "of", "its", "children", ".", "<", "/", "em", ">", "A", "simple", "call", "to", "{" ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L250-L257
dihedron/dihedron-commons
src/main/java/org/dihedron/core/streams/TeeOutputStream.java
TeeOutputStream.with
public TeeOutputStream with(OutputStream stream, boolean autoclose) { """ Adds an output stream; this method allows to specify whether the stream should be closed when the T stream is closed. If you want to use standard output as one of the streams in the T, this is the method to use, passing in {@code false} f...
java
public TeeOutputStream with(OutputStream stream, boolean autoclose) { if(stream != null) { this.streams.put(stream, autoclose); } return this; }
[ "public", "TeeOutputStream", "with", "(", "OutputStream", "stream", ",", "boolean", "autoclose", ")", "{", "if", "(", "stream", "!=", "null", ")", "{", "this", ".", "streams", ".", "put", "(", "stream", ",", "autoclose", ")", ";", "}", "return", "this", ...
Adds an output stream; this method allows to specify whether the stream should be closed when the T stream is closed. If you want to use standard output as one of the streams in the T, this is the method to use, passing in {@code false} for parameter {@code autoclose}. @param stream the stream to add to the T. @param ...
[ "Adds", "an", "output", "stream", ";", "this", "method", "allows", "to", "specify", "whether", "the", "stream", "should", "be", "closed", "when", "the", "T", "stream", "is", "closed", ".", "If", "you", "want", "to", "use", "standard", "output", "as", "on...
train
https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/streams/TeeOutputStream.java#L84-L89
facebookarchive/hadoop-20
src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerDispatcher.java
ServerDispatcher.handleSuccessfulDispatch
@Override public void handleSuccessfulDispatch(long clientId, long sentTime) { """ Called each time a handleNotification or heartbeat Thrift call is successful. @param clientId the id of the client on which the call was successful. @param sentTime the time at which the call was made. Nothing happens if this ...
java
@Override public void handleSuccessfulDispatch(long clientId, long sentTime) { ClientData clientData = core.getClientData(clientId); if (sentTime == -1 || clientData == null) return; clientData.markedAsFailedTime = -1; if (clientData.markedAsFailedTime != -1) { LOG.info("Unmarking " +...
[ "@", "Override", "public", "void", "handleSuccessfulDispatch", "(", "long", "clientId", ",", "long", "sentTime", ")", "{", "ClientData", "clientData", "=", "core", ".", "getClientData", "(", "clientId", ")", ";", "if", "(", "sentTime", "==", "-", "1", "||", ...
Called each time a handleNotification or heartbeat Thrift call is successful. @param clientId the id of the client on which the call was successful. @param sentTime the time at which the call was made. Nothing happens if this is -1.
[ "Called", "each", "time", "a", "handleNotification", "or", "heartbeat", "Thrift", "call", "is", "successful", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerDispatcher.java#L414-L426
stratosphere/stratosphere
stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java
GlobalConfiguration.filterFilesBySuffix
private static File[] filterFilesBySuffix(final File dirToFilter, final String suffix) { """ Filters files in directory which have the specified suffix (e.g. ".xml"). @param dirToFilter directory to filter @param suffix suffix to filter files by (e.g. ".xml") @return files with given ending in directory ...
java
private static File[] filterFilesBySuffix(final File dirToFilter, final String suffix) { return filterFilesBySuffix(dirToFilter, new String[] { suffix }); }
[ "private", "static", "File", "[", "]", "filterFilesBySuffix", "(", "final", "File", "dirToFilter", ",", "final", "String", "suffix", ")", "{", "return", "filterFilesBySuffix", "(", "dirToFilter", ",", "new", "String", "[", "]", "{", "suffix", "}", ")", ";", ...
Filters files in directory which have the specified suffix (e.g. ".xml"). @param dirToFilter directory to filter @param suffix suffix to filter files by (e.g. ".xml") @return files with given ending in directory
[ "Filters", "files", "in", "directory", "which", "have", "the", "specified", "suffix", "(", "e", ".", "g", ".", ".", "xml", ")", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java#L659-L661
nohana/Amalgam
amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java
DialogFragmentUtils.supportShowOnLoaderCallback
public static void supportShowOnLoaderCallback(Handler handler, final android.support.v4.app.FragmentManager manager, final android.support.v4.app.DialogFragment fragment, final String tag) { """ Show {@link android.support.v4.app.DialogFragment} with the specified tag on the loader callbacks. @param handler the ...
java
public static void supportShowOnLoaderCallback(Handler handler, final android.support.v4.app.FragmentManager manager, final android.support.v4.app.DialogFragment fragment, final String tag) { handler.post(new Runnable() { @Override public void run() { fragment.show(manage...
[ "public", "static", "void", "supportShowOnLoaderCallback", "(", "Handler", "handler", ",", "final", "android", ".", "support", ".", "v4", ".", "app", ".", "FragmentManager", "manager", ",", "final", "android", ".", "support", ".", "v4", ".", "app", ".", "Dia...
Show {@link android.support.v4.app.DialogFragment} with the specified tag on the loader callbacks. @param handler the handler, in most case, this handler is the main handler. @param manager the manager. @param fragment the fragment. @param tag the tag string that is related to the {@link android.support.v4.app.DialogFr...
[ "Show", "{" ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java#L161-L168
haraldk/TwelveMonkeys
common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java
IndexImage.getIndexColorModel
public static IndexColorModel getIndexColorModel(Image pImage, int pNumberOfColors, boolean pFast) { """ @param pImage the image to get {@code IndexColorModel} from @param pNumberOfColors the number of colors for the {@code IndexColorModel} @param pFast {@code true} if fast @return an {@code...
java
public static IndexColorModel getIndexColorModel(Image pImage, int pNumberOfColors, boolean pFast) { return getIndexColorModel(pImage, pNumberOfColors, pFast ? COLOR_SELECTION_FAST : COLOR_SELECTION_QUALITY); }
[ "public", "static", "IndexColorModel", "getIndexColorModel", "(", "Image", "pImage", ",", "int", "pNumberOfColors", ",", "boolean", "pFast", ")", "{", "return", "getIndexColorModel", "(", "pImage", ",", "pNumberOfColors", ",", "pFast", "?", "COLOR_SELECTION_FAST", "...
@param pImage the image to get {@code IndexColorModel} from @param pNumberOfColors the number of colors for the {@code IndexColorModel} @param pFast {@code true} if fast @return an {@code IndexColorModel} @see #getIndexColorModel(Image,int,int) @deprecated Use {@link #getIndexColorModel(Image,int,i...
[ "@param", "pImage", "the", "image", "to", "get", "{", "@code", "IndexColorModel", "}", "from", "@param", "pNumberOfColors", "the", "number", "of", "colors", "for", "the", "{", "@code", "IndexColorModel", "}", "@param", "pFast", "{", "@code", "true", "}", "if...
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java#L587-L589