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
pressgang-ccms/PressGangCCMSQuery
src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java
BaseFilterQueryBuilder.addEqualsIgnoreCaseCondition
protected void addEqualsIgnoreCaseCondition(final String propertyName, final String value) { """ Add a Field Search Condition that will search a field for a specified value using the following SQL logic: {@code lower(field) = 'value'} @param propertyName The name of the field as defined in the Entity mapping c...
java
protected void addEqualsIgnoreCaseCondition(final String propertyName, final String value) { final Expression<String> propertyNameField = getCriteriaBuilder().lower(getRootPath().get(propertyName).as(String.class)); fieldConditions.add(getCriteriaBuilder().equal(propertyNameField, value.toString())); ...
[ "protected", "void", "addEqualsIgnoreCaseCondition", "(", "final", "String", "propertyName", ",", "final", "String", "value", ")", "{", "final", "Expression", "<", "String", ">", "propertyNameField", "=", "getCriteriaBuilder", "(", ")", ".", "lower", "(", "getRoot...
Add a Field Search Condition that will search a field for a specified value using the following SQL logic: {@code lower(field) = 'value'} @param propertyName The name of the field as defined in the Entity mapping class. @param value The value to search against.
[ "Add", "a", "Field", "Search", "Condition", "that", "will", "search", "a", "field", "for", "a", "specified", "value", "using", "the", "following", "SQL", "logic", ":", "{", "@code", "lower", "(", "field", ")", "=", "value", "}" ]
train
https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java#L474-L477
b3dgs/lionengine
lionengine-core/src/main/java/com/b3dgs/lionengine/MediaDefault.java
MediaDefault.getTempDir
private static String getTempDir(Class<?> loader) { """ Create the temp directory relative to loader class name. @param loader The class loader. @return The temp directory absolute path. """ final File temp = new File(TEMP, loader.getSimpleName()); final String path = temp.getAbsolutePath...
java
private static String getTempDir(Class<?> loader) { final File temp = new File(TEMP, loader.getSimpleName()); final String path = temp.getAbsolutePath(); if (!temp.isDirectory() && !temp.mkdir()) { Verbose.warning(ERROR_CREATE_TEMP_DIR, path); } re...
[ "private", "static", "String", "getTempDir", "(", "Class", "<", "?", ">", "loader", ")", "{", "final", "File", "temp", "=", "new", "File", "(", "TEMP", ",", "loader", ".", "getSimpleName", "(", ")", ")", ";", "final", "String", "path", "=", "temp", "...
Create the temp directory relative to loader class name. @param loader The class loader. @return The temp directory absolute path.
[ "Create", "the", "temp", "directory", "relative", "to", "loader", "class", "name", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/MediaDefault.java#L61-L70
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java
PathOverrideService.AddGroupByNumber
public void AddGroupByNumber(int profileId, int pathId, int groupNum) { """ Called right now when we add an entry to the path_profile table Then we update the table to add a new string that contains the old groups and the new group (followed by a comma) @param profileId ID of profile @param pathId ID of path...
java
public void AddGroupByNumber(int profileId, int pathId, int groupNum) { logger.info("adding group_id={}, to pathId={}", groupNum, pathId); String oldGroups = getGroupIdsInPathProfile(profileId, pathId); // make sure the old groups does not contain the current group we want // to add ...
[ "public", "void", "AddGroupByNumber", "(", "int", "profileId", ",", "int", "pathId", ",", "int", "groupNum", ")", "{", "logger", ".", "info", "(", "\"adding group_id={}, to pathId={}\"", ",", "groupNum", ",", "pathId", ")", ";", "String", "oldGroups", "=", "ge...
Called right now when we add an entry to the path_profile table Then we update the table to add a new string that contains the old groups and the new group (followed by a comma) @param profileId ID of profile @param pathId ID of path @param groupNum Group to add
[ "Called", "right", "now", "when", "we", "add", "an", "entry", "to", "the", "path_profile", "table", "Then", "we", "update", "the", "table", "to", "add", "a", "new", "string", "that", "contains", "the", "old", "groups", "and", "the", "new", "group", "(", ...
train
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java#L273-L287
OpenLiberty/open-liberty
dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java
J2EEManagementObjectNameFactory.createObjectName
private static ObjectName createObjectName(String type, String name, Hashtable<String, String> props) { """ Common object name factory method. The properties table must be an {@link Hashtable} because the object name constructor {@link Object#ObjectName String, Hashtable)} takes a parameter of this type. @...
java
private static ObjectName createObjectName(String type, String name, Hashtable<String, String> props) { props.put(KEY_TYPE, type); props.put(KEY_NAME, name); try { return new ObjectName(DOMAIN_NAME, props); } catch (MalformedObjectNameException e) { throw new Ill...
[ "private", "static", "ObjectName", "createObjectName", "(", "String", "type", ",", "String", "name", ",", "Hashtable", "<", "String", ",", "String", ">", "props", ")", "{", "props", ".", "put", "(", "KEY_TYPE", ",", "type", ")", ";", "props", ".", "put",...
Common object name factory method. The properties table must be an {@link Hashtable} because the object name constructor {@link Object#ObjectName String, Hashtable)} takes a parameter of this type. @param type The type of the object name. See {@link #KEY_TYPE}. @param name The name of the object name. See {@link #KEY...
[ "Common", "object", "name", "factory", "method", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java#L105-L114
andrehertwig/admintool
admin-tools-core/src/main/java/de/chandre/admintool/core/utils/ReflectUtils.java
ReflectUtils.invokeSetter
public static void invokeSetter(Object object, Field field, Object value, boolean ignoreNonExisting) { """ invokes the setter on the filed @param object @param field @return """ if(null == field && ignoreNonExisting) { return; } ReflectionUtils.invokeMethod(ReflectionUtils.findMethod(object.getCl...
java
public static void invokeSetter(Object object, Field field, Object value, boolean ignoreNonExisting) { if(null == field && ignoreNonExisting) { return; } ReflectionUtils.invokeMethod(ReflectionUtils.findMethod(object.getClass(), ReflectUtils.toSetter(field.getName()), field.getType()), object, value); }
[ "public", "static", "void", "invokeSetter", "(", "Object", "object", ",", "Field", "field", ",", "Object", "value", ",", "boolean", "ignoreNonExisting", ")", "{", "if", "(", "null", "==", "field", "&&", "ignoreNonExisting", ")", "{", "return", ";", "}", "R...
invokes the setter on the filed @param object @param field @return
[ "invokes", "the", "setter", "on", "the", "filed" ]
train
https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-core/src/main/java/de/chandre/admintool/core/utils/ReflectUtils.java#L165-L171
the-fascinator/plugin-indexer-solr
src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java
SolrIndexer.cachePythonObject
private void cachePythonObject(String oid, PyObject pyObject) { """ Add a python object to the cache if caching if configured @param oid : The rules OID to use as an index @param pyObject : The compiled PyObject to cache """ if (useCache && pyObject != null) { scriptCache.put(oid, pyObject); } }
java
private void cachePythonObject(String oid, PyObject pyObject) { if (useCache && pyObject != null) { scriptCache.put(oid, pyObject); } }
[ "private", "void", "cachePythonObject", "(", "String", "oid", ",", "PyObject", "pyObject", ")", "{", "if", "(", "useCache", "&&", "pyObject", "!=", "null", ")", "{", "scriptCache", ".", "put", "(", "oid", ",", "pyObject", ")", ";", "}", "}" ]
Add a python object to the cache if caching if configured @param oid : The rules OID to use as an index @param pyObject : The compiled PyObject to cache
[ "Add", "a", "python", "object", "to", "the", "cache", "if", "caching", "if", "configured" ]
train
https://github.com/the-fascinator/plugin-indexer-solr/blob/001159b18b78a87daa5d8b2a17ced28694bae156/src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java#L1135-L1139
glookast/commons-timecode
src/main/java/com/glookast/commons/timecode/TimecodeDuration.java
TimecodeDuration.valueOf
public static TimecodeDuration valueOf(String timecode, int timecodeBase) throws IllegalArgumentException { """ Returns a TimecodeDuration instance for given timecode string and timecode base. Acceptable inputs are the normal representation HH:MM:SS:FF for non drop frame and HH:MM:SS:FF for drop frame @param t...
java
public static TimecodeDuration valueOf(String timecode, int timecodeBase) throws IllegalArgumentException { return valueOf(timecode, timecodeBase, StringType.NORMAL); }
[ "public", "static", "TimecodeDuration", "valueOf", "(", "String", "timecode", ",", "int", "timecodeBase", ")", "throws", "IllegalArgumentException", "{", "return", "valueOf", "(", "timecode", ",", "timecodeBase", ",", "StringType", ".", "NORMAL", ")", ";", "}" ]
Returns a TimecodeDuration instance for given timecode string and timecode base. Acceptable inputs are the normal representation HH:MM:SS:FF for non drop frame and HH:MM:SS:FF for drop frame @param timecode @param timecodeBase @return the TimecodeDuration @throws IllegalArgumentException
[ "Returns", "a", "TimecodeDuration", "instance", "for", "given", "timecode", "string", "and", "timecode", "base", ".", "Acceptable", "inputs", "are", "the", "normal", "representation", "HH", ":", "MM", ":", "SS", ":", "FF", "for", "non", "drop", "frame", "and...
train
https://github.com/glookast/commons-timecode/blob/ec2f682a51d1cc435d0b42d80de48ff15adb4ee8/src/main/java/com/glookast/commons/timecode/TimecodeDuration.java#L99-L102
Azure/azure-sdk-for-java
mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/MixedRealityClientImpl.java
MixedRealityClientImpl.checkNameAvailabilityLocalAsync
public Observable<CheckNameAvailabilityResponseInner> checkNameAvailabilityLocalAsync(String location, CheckNameAvailabilityRequest checkNameAvailability) { """ Check Name Availability for global uniqueness. @param location The location in which uniqueness will be verified. @param checkNameAvailability Check N...
java
public Observable<CheckNameAvailabilityResponseInner> checkNameAvailabilityLocalAsync(String location, CheckNameAvailabilityRequest checkNameAvailability) { return checkNameAvailabilityLocalWithServiceResponseAsync(location, checkNameAvailability).map(new Func1<ServiceResponse<CheckNameAvailabilityResponseInner...
[ "public", "Observable", "<", "CheckNameAvailabilityResponseInner", ">", "checkNameAvailabilityLocalAsync", "(", "String", "location", ",", "CheckNameAvailabilityRequest", "checkNameAvailability", ")", "{", "return", "checkNameAvailabilityLocalWithServiceResponseAsync", "(", "locati...
Check Name Availability for global uniqueness. @param location The location in which uniqueness will be verified. @param checkNameAvailability Check Name Availability Request. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the CheckNameAvailabilityResponseInner obje...
[ "Check", "Name", "Availability", "for", "global", "uniqueness", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/MixedRealityClientImpl.java#L282-L289
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java
AbstractJobLauncher.getParallelCombinedJobListener
private CloseableJobListener getParallelCombinedJobListener(JobState jobState, JobListener jobListener) { """ Combines the specified {@link JobListener} with the {@link #mandatoryJobListeners} for this job. Uses {@link JobListeners#parallelJobListener(List)} to create a {@link CloseableJobListener} that will exec...
java
private CloseableJobListener getParallelCombinedJobListener(JobState jobState, JobListener jobListener) { List<JobListener> jobListeners = Lists.newArrayList(this.mandatoryJobListeners); jobListeners.add(jobListener); Set<String> jobListenerClassNames = jobState.getPropAsSet(ConfigurationKeys.JOB_LISTENERS...
[ "private", "CloseableJobListener", "getParallelCombinedJobListener", "(", "JobState", "jobState", ",", "JobListener", "jobListener", ")", "{", "List", "<", "JobListener", ">", "jobListeners", "=", "Lists", ".", "newArrayList", "(", "this", ".", "mandatoryJobListeners", ...
Combines the specified {@link JobListener} with the {@link #mandatoryJobListeners} for this job. Uses {@link JobListeners#parallelJobListener(List)} to create a {@link CloseableJobListener} that will execute all the {@link JobListener}s in parallel.
[ "Combines", "the", "specified", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java#L785-L802
mozilla/rhino
src/org/mozilla/javascript/ScriptableObject.java
ScriptableObject.setAttributes
public void setAttributes(int index, int attributes) { """ Set the attributes of an indexed property. @param index the numeric index for the property @param attributes the bitset of attributes @exception EvaluatorException if the named property is not found @see org.mozilla.javascript.Scriptable#has(String, ...
java
public void setAttributes(int index, int attributes) { checkNotSealed(null, index); findAttributeSlot(null, index, SlotAccess.MODIFY).setAttributes(attributes); }
[ "public", "void", "setAttributes", "(", "int", "index", ",", "int", "attributes", ")", "{", "checkNotSealed", "(", "null", ",", "index", ")", ";", "findAttributeSlot", "(", "null", ",", "index", ",", "SlotAccess", ".", "MODIFY", ")", ".", "setAttributes", ...
Set the attributes of an indexed property. @param index the numeric index for the property @param attributes the bitset of attributes @exception EvaluatorException if the named property is not found @see org.mozilla.javascript.Scriptable#has(String, Scriptable) @see org.mozilla.javascript.ScriptableObject#READONLY @se...
[ "Set", "the", "attributes", "of", "an", "indexed", "property", "." ]
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L793-L797
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java
HylaFaxJob.getProperty
public String getProperty(String key,String defaultValue) { """ This function returns the fax job property for the given key. @param key The property key @param defaultValue The default value @return The property value """ String value=null; try { value=this.JOB...
java
public String getProperty(String key,String defaultValue) { String value=null; try { value=this.JOB.getProperty(key); } catch(Exception exception) { throw new FaxException("Error while extracting job property.",exception); } ...
[ "public", "String", "getProperty", "(", "String", "key", ",", "String", "defaultValue", ")", "{", "String", "value", "=", "null", ";", "try", "{", "value", "=", "this", ".", "JOB", ".", "getProperty", "(", "key", ")", ";", "}", "catch", "(", "Exception...
This function returns the fax job property for the given key. @param key The property key @param defaultValue The default value @return The property value
[ "This", "function", "returns", "the", "fax", "job", "property", "for", "the", "given", "key", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L330-L348
james-hu/jabb-core
src/main/java/net/sf/jabb/spring/service/AbstractSmartLifecycleService.java
AbstractSmartLifecycleService.setLifecycleConfigurations
protected void setLifecycleConfigurations(PropertyResolver configResolver, String configurationsCommonPrefix, Class<?> interfaceClass) { """ Configure isAutoStart and phase from properties. For example, if the class name of the service is a.b.Xyz, then the properties will be some thing like: <ul> <li>lifecycle....
java
protected void setLifecycleConfigurations(PropertyResolver configResolver, String configurationsCommonPrefix, Class<?> interfaceClass){ Integer phase = getConfigProperty(configResolver, configurationsCommonPrefix, ".phase", Integer.class, interfaceClass); if (phase == null){ logger.warn("No configuration found f...
[ "protected", "void", "setLifecycleConfigurations", "(", "PropertyResolver", "configResolver", ",", "String", "configurationsCommonPrefix", ",", "Class", "<", "?", ">", "interfaceClass", ")", "{", "Integer", "phase", "=", "getConfigProperty", "(", "configResolver", ",", ...
Configure isAutoStart and phase from properties. For example, if the class name of the service is a.b.Xyz, then the properties will be some thing like: <ul> <li>lifecycle.a.b.Xyz.phase=3</li> <li>lifecycle.a.b.Xyz.autoStart=true</li> </ul> This method is typically called from subclass after an instance of Environment i...
[ "Configure", "isAutoStart", "and", "phase", "from", "properties", ".", "For", "example", "if", "the", "class", "name", "of", "the", "service", "is", "a", ".", "b", ".", "Xyz", "then", "the", "properties", "will", "be", "some", "thing", "like", ":", "<ul"...
train
https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/spring/service/AbstractSmartLifecycleService.java#L99-L114
lucee/Lucee
loader/src/main/java/lucee/loader/engine/CFMLEngineWrapper.java
CFMLEngineWrapper.equalTo
public boolean equalTo(CFMLEngine other, final boolean checkReferenceEqualityOnly) { """ this interface is new to this class and not officially part of Lucee 3.x, do not use outside the loader @param other @param checkReferenceEqualityOnly @return is equal to given engine """ while (other instanceof CFM...
java
public boolean equalTo(CFMLEngine other, final boolean checkReferenceEqualityOnly) { while (other instanceof CFMLEngineWrapper) other = ((CFMLEngineWrapper) other).engine; if (checkReferenceEqualityOnly) return engine == other; return engine.equals(other); }
[ "public", "boolean", "equalTo", "(", "CFMLEngine", "other", ",", "final", "boolean", "checkReferenceEqualityOnly", ")", "{", "while", "(", "other", "instanceof", "CFMLEngineWrapper", ")", "other", "=", "(", "(", "CFMLEngineWrapper", ")", "other", ")", ".", "engi...
this interface is new to this class and not officially part of Lucee 3.x, do not use outside the loader @param other @param checkReferenceEqualityOnly @return is equal to given engine
[ "this", "interface", "is", "new", "to", "this", "class", "and", "not", "officially", "part", "of", "Lucee", "3", ".", "x", "do", "not", "use", "outside", "the", "loader" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/loader/src/main/java/lucee/loader/engine/CFMLEngineWrapper.java#L259-L264
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setBigDecimal
@Override public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { """ Method setBigDecimal. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setBigDecimal(int, BigDecimal) """ internalStmt.setBigDecimal(parameterIndex, x); }
java
@Override public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { internalStmt.setBigDecimal(parameterIndex, x); }
[ "@", "Override", "public", "void", "setBigDecimal", "(", "int", "parameterIndex", ",", "BigDecimal", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setBigDecimal", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setBigDecimal. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setBigDecimal(int, BigDecimal)
[ "Method", "setBigDecimal", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L497-L500
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java
SARLOperationHelper._hasSideEffects
protected Boolean _hasSideEffects(XBlockExpression expression, ISideEffectContext context) { """ Test if the given expression has side effects. @param expression the expression. @param context the list of context expressions. @return {@code true} if the expression has side effects. """ final List<XExpre...
java
protected Boolean _hasSideEffects(XBlockExpression expression, ISideEffectContext context) { final List<XExpression> exprs = expression.getExpressions(); if (exprs != null && !exprs.isEmpty()) { context.open(); for (final XExpression ex : exprs) { if (hasSideEffects(ex, context)) { return true; }...
[ "protected", "Boolean", "_hasSideEffects", "(", "XBlockExpression", "expression", ",", "ISideEffectContext", "context", ")", "{", "final", "List", "<", "XExpression", ">", "exprs", "=", "expression", ".", "getExpressions", "(", ")", ";", "if", "(", "exprs", "!="...
Test if the given expression has side effects. @param expression the expression. @param context the list of context expressions. @return {@code true} if the expression has side effects.
[ "Test", "if", "the", "given", "expression", "has", "side", "effects", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java#L588-L600
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java
BytecodeUtils.doEqualsString
private static Expression doEqualsString(SoyExpression stringExpr, SoyExpression other) { """ Compare a string valued expression to another expression using soy == semantics. @param stringExpr An expression that is known to be an unboxed string @param other An expression to compare it to. """ // This i...
java
private static Expression doEqualsString(SoyExpression stringExpr, SoyExpression other) { // This is compatible with SharedRuntime.compareString, which interestingly makes == break // transitivity. See b/21461181 SoyRuntimeType otherRuntimeType = other.soyRuntimeType(); if (otherRuntimeType.isKnownStri...
[ "private", "static", "Expression", "doEqualsString", "(", "SoyExpression", "stringExpr", ",", "SoyExpression", "other", ")", "{", "// This is compatible with SharedRuntime.compareString, which interestingly makes == break", "// transitivity. See b/21461181", "SoyRuntimeType", "otherRu...
Compare a string valued expression to another expression using soy == semantics. @param stringExpr An expression that is known to be an unboxed string @param other An expression to compare it to.
[ "Compare", "a", "string", "valued", "expression", "to", "another", "expression", "using", "soy", "==", "semantics", "." ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L611-L629
googleapis/google-cloud-java
google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java
ProductSearchClient.updateProduct
public final Product updateProduct(Product product, FieldMask updateMask) { """ Makes changes to a Product resource. Only the `display_name`, `description`, and `labels` fields can be updated right now. <p>If labels are updated, the change will not be reflected in queries until the next index time. <p>Poss...
java
public final Product updateProduct(Product product, FieldMask updateMask) { UpdateProductRequest request = UpdateProductRequest.newBuilder().setProduct(product).setUpdateMask(updateMask).build(); return updateProduct(request); }
[ "public", "final", "Product", "updateProduct", "(", "Product", "product", ",", "FieldMask", "updateMask", ")", "{", "UpdateProductRequest", "request", "=", "UpdateProductRequest", ".", "newBuilder", "(", ")", ".", "setProduct", "(", "product", ")", ".", "setUpdate...
Makes changes to a Product resource. Only the `display_name`, `description`, and `labels` fields can be updated right now. <p>If labels are updated, the change will not be reflected in queries until the next index time. <p>Possible errors: <p>&#42; Returns NOT_FOUND if the Product does not exist. &#42; Returns INVAL...
[ "Makes", "changes", "to", "a", "Product", "resource", ".", "Only", "the", "display_name", "description", "and", "labels", "fields", "can", "be", "updated", "right", "now", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java#L822-L827
grpc/grpc-java
api/src/main/java/io/grpc/ConnectivityStateInfo.java
ConnectivityStateInfo.forTransientFailure
public static ConnectivityStateInfo forTransientFailure(Status error) { """ Returns an instance for {@code TRANSIENT_FAILURE}, associated with an error status. """ Preconditions.checkArgument(!error.isOk(), "The error status must not be OK"); return new ConnectivityStateInfo(TRANSIENT_FAILURE, error); ...
java
public static ConnectivityStateInfo forTransientFailure(Status error) { Preconditions.checkArgument(!error.isOk(), "The error status must not be OK"); return new ConnectivityStateInfo(TRANSIENT_FAILURE, error); }
[ "public", "static", "ConnectivityStateInfo", "forTransientFailure", "(", "Status", "error", ")", "{", "Preconditions", ".", "checkArgument", "(", "!", "error", ".", "isOk", "(", ")", ",", "\"The error status must not be OK\"", ")", ";", "return", "new", "Connectivit...
Returns an instance for {@code TRANSIENT_FAILURE}, associated with an error status.
[ "Returns", "an", "instance", "for", "{" ]
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/api/src/main/java/io/grpc/ConnectivityStateInfo.java#L49-L52
b3dgs/lionengine
lionengine-network/src/main/java/com/b3dgs/lionengine/network/ServerImpl.java
ServerImpl.receiveRenamed
private void receiveRenamed(ClientSocket client, DataInputStream buffer, byte from, StateConnection expected) throws IOException { """ Update the receive renamed state. @param client The current client. @param buffer The data buffer. @param from The id from. @param expected The expected client st...
java
private void receiveRenamed(ClientSocket client, DataInputStream buffer, byte from, StateConnection expected) throws IOException { if (ServerImpl.checkValidity(client, from, expected)) { // Receive the name final byte[] name = new byte[buffer.readByte()]; ...
[ "private", "void", "receiveRenamed", "(", "ClientSocket", "client", ",", "DataInputStream", "buffer", ",", "byte", "from", ",", "StateConnection", "expected", ")", "throws", "IOException", "{", "if", "(", "ServerImpl", ".", "checkValidity", "(", "client", ",", "...
Update the receive renamed state. @param client The current client. @param buffer The data buffer. @param from The id from. @param expected The expected client state. @throws IOException If error.
[ "Update", "the", "receive", "renamed", "state", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-network/src/main/java/com/b3dgs/lionengine/network/ServerImpl.java#L321-L349
upwork/java-upwork
src/com/Upwork/api/UpworkRestClient.java
UpworkRestClient.genError
private static JSONObject genError(Integer code, String message) throws JSONException { """ Generate error as JSONObject @param code Error code @param message Error message @throws JSONException @return {@link JSONObject} """ // TODO: HTTP-Status (404, etc), for now return status line ...
java
private static JSONObject genError(Integer code, String message) throws JSONException { // TODO: HTTP-Status (404, etc), for now return status line return new JSONObject("{error: {code: \"" + code.toString() + "\", message: \"" + message + "\"}}"); }
[ "private", "static", "JSONObject", "genError", "(", "Integer", "code", ",", "String", "message", ")", "throws", "JSONException", "{", "// TODO: HTTP-Status (404, etc), for now return status line", "return", "new", "JSONObject", "(", "\"{error: {code: \\\"\"", "+", "code", ...
Generate error as JSONObject @param code Error code @param message Error message @throws JSONException @return {@link JSONObject}
[ "Generate", "error", "as", "JSONObject" ]
train
https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/UpworkRestClient.java#L241-L244
elki-project/elki
elki-timeseries/src/main/java/de/lmu/ifi/dbs/elki/algorithm/timeseries/OfflineChangePointDetectionAlgorithm.java
OfflineChangePointDetectionAlgorithm.cusum
public static void cusum(double[] data, double[] out, int begin, int end) { """ Compute the incremental sum of an array, i.e. the sum of all points up to the given index. @param data Input data @param out Output array (must be large enough). """ assert (out.length >= data.length); // Use Kahan sum...
java
public static void cusum(double[] data, double[] out, int begin, int end) { assert (out.length >= data.length); // Use Kahan summation for better precision! // FIXME: this should be unit tested. double m = 0., carry = 0.; for(int i = begin; i < end; i++) { double v = data[i] - carry; // Compen...
[ "public", "static", "void", "cusum", "(", "double", "[", "]", "data", ",", "double", "[", "]", "out", ",", "int", "begin", ",", "int", "end", ")", "{", "assert", "(", "out", ".", "length", ">=", "data", ".", "length", ")", ";", "// Use Kahan summatio...
Compute the incremental sum of an array, i.e. the sum of all points up to the given index. @param data Input data @param out Output array (must be large enough).
[ "Compute", "the", "incremental", "sum", "of", "an", "array", "i", ".", "e", ".", "the", "sum", "of", "all", "points", "up", "to", "the", "given", "index", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-timeseries/src/main/java/de/lmu/ifi/dbs/elki/algorithm/timeseries/OfflineChangePointDetectionAlgorithm.java#L274-L285
mijecu25/dsa
src/main/java/com/mijecu25/dsa/algorithms/search/linear/LinearSearch.java
LinearSearch.searchLast
public static int searchLast(short[] shortArray, short value, int occurrence) { """ Search for the value in the short array and return the index of the first occurrence from the end of the array. @param shortArray array that we are searching in. @param value value that is being searched in the array. @param ...
java
public static int searchLast(short[] shortArray, short value, int occurrence) { if(occurrence <= 0 || occurrence > shortArray.length) { throw new IllegalArgumentException("Occurrence must be greater or equal to 1 and less than " + "the array length: " + occurrence); } ...
[ "public", "static", "int", "searchLast", "(", "short", "[", "]", "shortArray", ",", "short", "value", ",", "int", "occurrence", ")", "{", "if", "(", "occurrence", "<=", "0", "||", "occurrence", ">", "shortArray", ".", "length", ")", "{", "throw", "new", ...
Search for the value in the short array and return the index of the first occurrence from the end of the array. @param shortArray array that we are searching in. @param value value that is being searched in the array. @param occurrence number of times we have seen the value before returning the index. @return the ind...
[ "Search", "for", "the", "value", "in", "the", "short", "array", "and", "return", "the", "index", "of", "the", "first", "occurrence", "from", "the", "end", "of", "the", "array", "." ]
train
https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/search/linear/LinearSearch.java#L1620-L1639
cloudant/sync-android
cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/query/UnindexedMatcher.java
UnindexedMatcher.matcherWithSelector
public static UnindexedMatcher matcherWithSelector(Map<String, Object> selector) { """ Return a new initialised matcher. Assumes selector is valid as we're calling this late in the query processing. """ ChildrenQueryNode root = buildExecutionTreeForSelector(selector); if (root == null) { ...
java
public static UnindexedMatcher matcherWithSelector(Map<String, Object> selector) { ChildrenQueryNode root = buildExecutionTreeForSelector(selector); if (root == null) { return null; } UnindexedMatcher matcher = new UnindexedMatcher(); matcher.root = root; r...
[ "public", "static", "UnindexedMatcher", "matcherWithSelector", "(", "Map", "<", "String", ",", "Object", ">", "selector", ")", "{", "ChildrenQueryNode", "root", "=", "buildExecutionTreeForSelector", "(", "selector", ")", ";", "if", "(", "root", "==", "null", ")"...
Return a new initialised matcher. Assumes selector is valid as we're calling this late in the query processing.
[ "Return", "a", "new", "initialised", "matcher", "." ]
train
https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/query/UnindexedMatcher.java#L99-L110
JavaMoney/jsr354-ri-bp
src/main/java/org/javamoney/moneta/internal/loader/DefaultLoaderService.java
DefaultLoaderService.initialize
@Deprecated protected void initialize() { """ This method reads initial loads from the javamoney.properties and installs the according timers. """ // Cancel any running tasks Timer oldTimer = timer; timer = new Timer(); if (oldTimer!=null) { oldTimer.cancel(); ...
java
@Deprecated protected void initialize() { // Cancel any running tasks Timer oldTimer = timer; timer = new Timer(); if (oldTimer!=null) { oldTimer.cancel(); } // (re)initialize LoaderConfigurator configurator = new LoaderConfigurator(this); ...
[ "@", "Deprecated", "protected", "void", "initialize", "(", ")", "{", "// Cancel any running tasks", "Timer", "oldTimer", "=", "timer", ";", "timer", "=", "new", "Timer", "(", ")", ";", "if", "(", "oldTimer", "!=", "null", ")", "{", "oldTimer", ".", "cancel...
This method reads initial loads from the javamoney.properties and installs the according timers.
[ "This", "method", "reads", "initial", "loads", "from", "the", "javamoney", ".", "properties", "and", "installs", "the", "according", "timers", "." ]
train
https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/internal/loader/DefaultLoaderService.java#L87-L99
ontop/ontop
engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/dialect/impl/PostgreSQLDialectAdapter.java
PostgreSQLDialectAdapter.sqlRegex
@Override public String sqlRegex(String columnname, String pattern, boolean caseinSensitive, boolean multiLine, boolean dotAllMode) { """ Based on documentation of postgres 9.1 at http://www.postgresql.org/docs/9.3/static/functions-matching.html """ if(quotes.matcher(pattern).matches() ) { ...
java
@Override public String sqlRegex(String columnname, String pattern, boolean caseinSensitive, boolean multiLine, boolean dotAllMode) { if(quotes.matcher(pattern).matches() ) { pattern = pattern.substring(1, pattern.length() - 1); // remove the // enclosing // quotes ...
[ "@", "Override", "public", "String", "sqlRegex", "(", "String", "columnname", ",", "String", "pattern", ",", "boolean", "caseinSensitive", ",", "boolean", "multiLine", ",", "boolean", "dotAllMode", ")", "{", "if", "(", "quotes", ".", "matcher", "(", "pattern",...
Based on documentation of postgres 9.1 at http://www.postgresql.org/docs/9.3/static/functions-matching.html
[ "Based", "on", "documentation", "of", "postgres", "9", ".", "1", "at", "http", ":", "//", "www", ".", "postgresql", ".", "org", "/", "docs", "/", "9", ".", "3", "/", "static", "/", "functions", "-", "matching", ".", "html" ]
train
https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/dialect/impl/PostgreSQLDialectAdapter.java#L129-L147
codelibs/fess
src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java
FessMessages.addErrorsPropertyTypeInteger
public FessMessages addErrorsPropertyTypeInteger(String property, String arg0) { """ Add the created action message for the key 'errors.property_type_integer' with parameters. <pre> message: {0} should be numeric. </pre> @param property The property name for the message. (NotNull) @param arg0 The parameter ar...
java
public FessMessages addErrorsPropertyTypeInteger(String property, String arg0) { assertPropertyNotNull(property); add(property, new UserMessage(ERRORS_property_type_integer, arg0)); return this; }
[ "public", "FessMessages", "addErrorsPropertyTypeInteger", "(", "String", "property", ",", "String", "arg0", ")", "{", "assertPropertyNotNull", "(", "property", ")", ";", "add", "(", "property", ",", "new", "UserMessage", "(", "ERRORS_property_type_integer", ",", "ar...
Add the created action message for the key 'errors.property_type_integer' with parameters. <pre> message: {0} should be numeric. </pre> @param property The property name for the message. (NotNull) @param arg0 The parameter arg0 for message. (NotNull) @return this. (NotNull)
[ "Add", "the", "created", "action", "message", "for", "the", "key", "errors", ".", "property_type_integer", "with", "parameters", ".", "<pre", ">", "message", ":", "{", "0", "}", "should", "be", "numeric", ".", "<", "/", "pre", ">" ]
train
https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L2200-L2204
sdl/odata
odata_processor/src/main/java/com/sdl/odata/processor/write/BatchMethodHandler.java
BatchMethodHandler.getRequestType
private Type getRequestType(ODataRequest oDataRequest, ODataUri oDataUri) throws ODataTargetTypeException { """ Returns request type for the given odata uri. @param oDataUri the odata uri @return the request type @throws ODataTargetTypeException if unable to determine request type """ TargetType tar...
java
private Type getRequestType(ODataRequest oDataRequest, ODataUri oDataUri) throws ODataTargetTypeException { TargetType targetType = WriteMethodUtil.getTargetType(oDataRequest, entityDataModel, oDataUri); return entityDataModel.getType(targetType.typeName()); }
[ "private", "Type", "getRequestType", "(", "ODataRequest", "oDataRequest", ",", "ODataUri", "oDataUri", ")", "throws", "ODataTargetTypeException", "{", "TargetType", "targetType", "=", "WriteMethodUtil", ".", "getTargetType", "(", "oDataRequest", ",", "entityDataModel", ...
Returns request type for the given odata uri. @param oDataUri the odata uri @return the request type @throws ODataTargetTypeException if unable to determine request type
[ "Returns", "request", "type", "for", "the", "given", "odata", "uri", "." ]
train
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_processor/src/main/java/com/sdl/odata/processor/write/BatchMethodHandler.java#L201-L204
Wikidata/Wikidata-Toolkit
wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/wmf/WmfDumpFileManager.java
WmfDumpFileManager.findAllDumps
public List<MwDumpFile> findAllDumps(DumpContentType dumpContentType) { """ Returns a list of all dump files of the given type available either online or locally. For dumps available both online and locally, the local version is included. The list is ordered with most recent dump date first. Online dumps found ...
java
public List<MwDumpFile> findAllDumps(DumpContentType dumpContentType) { List<MwDumpFile> localDumps = findDumpsLocally(dumpContentType); if (this.webResourceFetcher != null) { List<MwDumpFile> onlineDumps = findDumpsOnline(dumpContentType); return mergeDumpLists(localDumps, onlineDumps); } else { return ...
[ "public", "List", "<", "MwDumpFile", ">", "findAllDumps", "(", "DumpContentType", "dumpContentType", ")", "{", "List", "<", "MwDumpFile", ">", "localDumps", "=", "findDumpsLocally", "(", "dumpContentType", ")", ";", "if", "(", "this", ".", "webResourceFetcher", ...
Returns a list of all dump files of the given type available either online or locally. For dumps available both online and locally, the local version is included. The list is ordered with most recent dump date first. Online dumps found by this method might not be available yet (if their directory has been created onlin...
[ "Returns", "a", "list", "of", "all", "dump", "files", "of", "the", "given", "type", "available", "either", "online", "or", "locally", ".", "For", "dumps", "available", "both", "online", "and", "locally", "the", "local", "version", "is", "included", ".", "T...
train
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/wmf/WmfDumpFileManager.java#L198-L206
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/RandomFactory.java
RandomFactory.getNewRandomInstance
public Random getNewRandomInstance(long seed, long size) { """ This method returns new onject implementing Random interface, initialized with seed value, with size of elements in buffer @param seed rng seed @param size size of underlying buffer @return object implementing Random interface """ try ...
java
public Random getNewRandomInstance(long seed, long size) { try { Class<?> c = randomClass; Constructor<?> constructor = c.getConstructor(long.class, long.class); Random t = (Random) constructor.newInstance(seed, size); return t; } catch (Exception e) { ...
[ "public", "Random", "getNewRandomInstance", "(", "long", "seed", ",", "long", "size", ")", "{", "try", "{", "Class", "<", "?", ">", "c", "=", "randomClass", ";", "Constructor", "<", "?", ">", "constructor", "=", "c", ".", "getConstructor", "(", "long", ...
This method returns new onject implementing Random interface, initialized with seed value, with size of elements in buffer @param seed rng seed @param size size of underlying buffer @return object implementing Random interface
[ "This", "method", "returns", "new", "onject", "implementing", "Random", "interface", "initialized", "with", "seed", "value", "with", "size", "of", "elements", "in", "buffer" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/RandomFactory.java#L97-L106
statefulj/statefulj
statefulj-fsm/src/main/java/org/statefulj/persistence/memory/MemoryPersisterImpl.java
MemoryPersisterImpl.setCurrent
@Override public void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException { """ /* Serialize all update of state. Ensure that the current state is the same State that was evaluated. If not, throw an exception (non-Javadoc) @see org.fsm.Persister#setCurrent(org.fsm.model.State...
java
@Override public void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException { synchronized(stateful) { if (this.getCurrent(stateful).equals(current)) { this.setCurrent(stateful, next); } else { throw new StaleStateException(); } } }
[ "@", "Override", "public", "void", "setCurrent", "(", "T", "stateful", ",", "State", "<", "T", ">", "current", ",", "State", "<", "T", ">", "next", ")", "throws", "StaleStateException", "{", "synchronized", "(", "stateful", ")", "{", "if", "(", "this", ...
/* Serialize all update of state. Ensure that the current state is the same State that was evaluated. If not, throw an exception (non-Javadoc) @see org.fsm.Persister#setCurrent(org.fsm.model.State, org.fsm.model.State)
[ "/", "*", "Serialize", "all", "update", "of", "state", ".", "Ensure", "that", "the", "current", "state", "is", "the", "same", "State", "that", "was", "evaluated", ".", "If", "not", "throw", "an", "exception" ]
train
https://github.com/statefulj/statefulj/blob/d3459b3cb12bd508643027743401484a231e5fa1/statefulj-fsm/src/main/java/org/statefulj/persistence/memory/MemoryPersisterImpl.java#L137-L146
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java
PublicIPAddressesInner.beginUpdateTags
public PublicIPAddressInner beginUpdateTags(String resourceGroupName, String publicIpAddressName, Map<String, String> tags) { """ Updates public IP address tags. @param resourceGroupName The name of the resource group. @param publicIpAddressName The name of the public IP address. @param tags Resource tags. @...
java
public PublicIPAddressInner beginUpdateTags(String resourceGroupName, String publicIpAddressName, Map<String, String> tags) { return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).toBlocking().single().body(); }
[ "public", "PublicIPAddressInner", "beginUpdateTags", "(", "String", "resourceGroupName", ",", "String", "publicIpAddressName", ",", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "return", "beginUpdateTagsWithServiceResponseAsync", "(", "resourceGroupName", ...
Updates public IP address tags. @param resourceGroupName The name of the resource group. @param publicIpAddressName The name of the public IP address. @param tags Resource tags. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server ...
[ "Updates", "public", "IP", "address", "tags", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java#L855-L857
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAvailabilityEstimatePersistenceImpl.java
CommerceAvailabilityEstimatePersistenceImpl.removeByUuid_C
@Override public void removeByUuid_C(String uuid, long companyId) { """ Removes all the commerce availability estimates where uuid = &#63; and companyId = &#63; from the database. @param uuid the uuid @param companyId the company ID """ for (CommerceAvailabilityEstimate commerceAvailabilityEstimate : fi...
java
@Override public void removeByUuid_C(String uuid, long companyId) { for (CommerceAvailabilityEstimate commerceAvailabilityEstimate : findByUuid_C( uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceAvailabilityEstimate); } }
[ "@", "Override", "public", "void", "removeByUuid_C", "(", "String", "uuid", ",", "long", "companyId", ")", "{", "for", "(", "CommerceAvailabilityEstimate", "commerceAvailabilityEstimate", ":", "findByUuid_C", "(", "uuid", ",", "companyId", ",", "QueryUtil", ".", "...
Removes all the commerce availability estimates where uuid = &#63; and companyId = &#63; from the database. @param uuid the uuid @param companyId the company ID
[ "Removes", "all", "the", "commerce", "availability", "estimates", "where", "uuid", "=", "&#63", ";", "and", "companyId", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAvailabilityEstimatePersistenceImpl.java#L1428-L1434
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.scale
public static void scale(File srcImageFile, File destImageFile, int width, int height, Color fixedColor) throws IORuntimeException { """ 缩放图像(按高度和宽度缩放)<br> 缩放后默认为jpeg格式 @param srcImageFile 源图像文件地址 @param destImageFile 缩放后的图像地址 @param width 缩放后的宽度 @param height 缩放后的高度 @param fixedColor 比例不对时补充的颜色,不补充为<code>...
java
public static void scale(File srcImageFile, File destImageFile, int width, int height, Color fixedColor) throws IORuntimeException { write(scale(read(srcImageFile), width, height, fixedColor), destImageFile); }
[ "public", "static", "void", "scale", "(", "File", "srcImageFile", ",", "File", "destImageFile", ",", "int", "width", ",", "int", "height", ",", "Color", "fixedColor", ")", "throws", "IORuntimeException", "{", "write", "(", "scale", "(", "read", "(", "srcImag...
缩放图像(按高度和宽度缩放)<br> 缩放后默认为jpeg格式 @param srcImageFile 源图像文件地址 @param destImageFile 缩放后的图像地址 @param width 缩放后的宽度 @param height 缩放后的高度 @param fixedColor 比例不对时补充的颜色,不补充为<code>null</code> @throws IORuntimeException IO异常
[ "缩放图像(按高度和宽度缩放)<br", ">", "缩放后默认为jpeg格式" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L184-L186
geomajas/geomajas-project-client-gwt
common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java
HtmlBuilder.tableStyleHtmlContent
public static String tableStyleHtmlContent(String style, String... content) { """ Build a HTML Table with given CSS style for a string. Use this method if given content contains HTML snippets, prepared with {@link HtmlBuilder#htmlEncode(String)}. @param style style for table element @param content content str...
java
public static String tableStyleHtmlContent(String style, String... content) { return tagStyleHtmlContent(Html.Tag.TABLE, style, content); }
[ "public", "static", "String", "tableStyleHtmlContent", "(", "String", "style", ",", "String", "...", "content", ")", "{", "return", "tagStyleHtmlContent", "(", "Html", ".", "Tag", ".", "TABLE", ",", "style", ",", "content", ")", ";", "}" ]
Build a HTML Table with given CSS style for a string. Use this method if given content contains HTML snippets, prepared with {@link HtmlBuilder#htmlEncode(String)}. @param style style for table element @param content content string @return HTML table element as string
[ "Build", "a", "HTML", "Table", "with", "given", "CSS", "style", "for", "a", "string", ".", "Use", "this", "method", "if", "given", "content", "contains", "HTML", "snippets", "prepared", "with", "{", "@link", "HtmlBuilder#htmlEncode", "(", "String", ")", "}",...
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L54-L56
jiaqi/caff
src/main/java/org/cyclopsgroup/caff/util/ByteUtils.java
ByteUtils.readLong
public static long readLong(byte[] src, int offset) throws IllegalArgumentException { """ Read long value from given source byte array @param src Source byte array value is read from @param offset The starting point where value is read from @return The long value @throws IllegalArgumentException When the len...
java
public static long readLong(byte[] src, int offset) throws IllegalArgumentException { if (src.length < offset) { throw new IllegalArgumentException("There's nothing to read in src from offset " + offset); } long r = 0; for (int i = offset, j = 0; i < src.length && j < 64; i++, j += 8) { r +...
[ "public", "static", "long", "readLong", "(", "byte", "[", "]", "src", ",", "int", "offset", ")", "throws", "IllegalArgumentException", "{", "if", "(", "src", ".", "length", "<", "offset", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"There's ...
Read long value from given source byte array @param src Source byte array value is read from @param offset The starting point where value is read from @return The long value @throws IllegalArgumentException When the length of input byte array conflicts offset
[ "Read", "long", "value", "from", "given", "source", "byte", "array" ]
train
https://github.com/jiaqi/caff/blob/dba4b937a0afc844eb37ccf74dd04dd78f0c1314/src/main/java/org/cyclopsgroup/caff/util/ByteUtils.java#L41-L51
neo4j-contrib/neo4j-apoc-procedures
src/main/java/apoc/couchbase/CouchbaseManager.java
CouchbaseManager.getConnectionObjectsFromConfigurationKey
protected static Pair<PasswordAuthenticator, List<String>> getConnectionObjectsFromConfigurationKey(String configurationKey) { """ Creates a {@link Pair} containing a {@link PasswordAuthenticator} and a {@link List} of (cluster) nodes from configuration properties @param configurationKey the configuration key i...
java
protected static Pair<PasswordAuthenticator, List<String>> getConnectionObjectsFromConfigurationKey(String configurationKey) { Map<String, Object> couchbaseConfig = getKeyMap(configurationKey); Object username, password; if ((username = couchbaseConfig.get(USERNAME_CONFIG_KEY)) == null || (pass...
[ "protected", "static", "Pair", "<", "PasswordAuthenticator", ",", "List", "<", "String", ">", ">", "getConnectionObjectsFromConfigurationKey", "(", "String", "configurationKey", ")", "{", "Map", "<", "String", ",", "Object", ">", "couchbaseConfig", "=", "getKeyMap",...
Creates a {@link Pair} containing a {@link PasswordAuthenticator} and a {@link List} of (cluster) nodes from configuration properties @param configurationKey the configuration key in neo4j.conf that should be defined as apoc.couchbase.[configurationKey] @return a tuple2, the connections objects that we need to establi...
[ "Creates", "a", "{", "@link", "Pair", "}", "containing", "a", "{", "@link", "PasswordAuthenticator", "}", "and", "a", "{", "@link", "List", "}", "of", "(", "cluster", ")", "nodes", "from", "configuration", "properties" ]
train
https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/e8386975d1c512c0e4388a1a61f5496121c04f86/src/main/java/apoc/couchbase/CouchbaseManager.java#L74-L91
Wadpam/guja
guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java
GeneratedDConnectionDaoImpl.queryByDisplayName
public Iterable<DConnection> queryByDisplayName(java.lang.String displayName) { """ query-by method for field displayName @param displayName the specified attribute @return an Iterable of DConnections for the specified displayName """ return queryByField(null, DConnectionMapper.Field.DISPLAYNAME.getField...
java
public Iterable<DConnection> queryByDisplayName(java.lang.String displayName) { return queryByField(null, DConnectionMapper.Field.DISPLAYNAME.getFieldName(), displayName); }
[ "public", "Iterable", "<", "DConnection", ">", "queryByDisplayName", "(", "java", ".", "lang", ".", "String", "displayName", ")", "{", "return", "queryByField", "(", "null", ",", "DConnectionMapper", ".", "Field", ".", "DISPLAYNAME", ".", "getFieldName", "(", ...
query-by method for field displayName @param displayName the specified attribute @return an Iterable of DConnections for the specified displayName
[ "query", "-", "by", "method", "for", "field", "displayName" ]
train
https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L79-L81
foundation-runtime/service-directory
2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/ServiceDirectoryCache.java
ServiceDirectoryCache.putService
public void putService(K serviceName, V service) { """ Put a service into cache. @param serviceName the service name. @param service the service. """ if(cache.containsKey(serviceName)){ cache.remove(serviceName); } cache.put(serviceName, service); }
java
public void putService(K serviceName, V service){ if(cache.containsKey(serviceName)){ cache.remove(serviceName); } cache.put(serviceName, service); }
[ "public", "void", "putService", "(", "K", "serviceName", ",", "V", "service", ")", "{", "if", "(", "cache", ".", "containsKey", "(", "serviceName", ")", ")", "{", "cache", ".", "remove", "(", "serviceName", ")", ";", "}", "cache", ".", "put", "(", "s...
Put a service into cache. @param serviceName the service name. @param service the service.
[ "Put", "a", "service", "into", "cache", "." ]
train
https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/ServiceDirectoryCache.java#L76-L81
jhalterman/typetools
src/main/java/net/jodah/typetools/TypeResolver.java
TypeResolver.resolveRawArguments
public static <T, S extends T> Class<?>[] resolveRawArguments(Class<T> type, Class<S> subType) { """ Returns an array of raw classes representing arguments for the {@code type} using type variable information from the {@code subType}. Arguments for {@code type} that cannot be resolved are returned as {@code Unkno...
java
public static <T, S extends T> Class<?>[] resolveRawArguments(Class<T> type, Class<S> subType) { return resolveRawArguments(resolveGenericType(type, subType), subType); }
[ "public", "static", "<", "T", ",", "S", "extends", "T", ">", "Class", "<", "?", ">", "[", "]", "resolveRawArguments", "(", "Class", "<", "T", ">", "type", ",", "Class", "<", "S", ">", "subType", ")", "{", "return", "resolveRawArguments", "(", "resolv...
Returns an array of raw classes representing arguments for the {@code type} using type variable information from the {@code subType}. Arguments for {@code type} that cannot be resolved are returned as {@code Unknown.class}. If no arguments can be resolved then {@code null} is returned. @param type to resolve arguments...
[ "Returns", "an", "array", "of", "raw", "classes", "representing", "arguments", "for", "the", "{", "@code", "type", "}", "using", "type", "variable", "information", "from", "the", "{", "@code", "subType", "}", ".", "Arguments", "for", "{", "@code", "type", ...
train
https://github.com/jhalterman/typetools/blob/0bd6f1f6d146a69e1e497b688a8522fa09adae87/src/main/java/net/jodah/typetools/TypeResolver.java#L182-L184
alkacon/opencms-core
src-gwt/org/opencms/ade/containerpage/client/ui/CmsMenuListItem.java
CmsMenuListItem.disableEdit
public void disableEdit(String reason, boolean locked) { """ Disables the edit button with the given reason.<p> @param reason the disable reason @param locked <code>true</code> if the resource is locked """ m_editButton.disable(reason); if (locked) { m_editButton.setImageClass(...
java
public void disableEdit(String reason, boolean locked) { m_editButton.disable(reason); if (locked) { m_editButton.setImageClass("opencms-icon-lock-20"); } }
[ "public", "void", "disableEdit", "(", "String", "reason", ",", "boolean", "locked", ")", "{", "m_editButton", ".", "disable", "(", "reason", ")", ";", "if", "(", "locked", ")", "{", "m_editButton", ".", "setImageClass", "(", "\"opencms-icon-lock-20\"", ")", ...
Disables the edit button with the given reason.<p> @param reason the disable reason @param locked <code>true</code> if the resource is locked
[ "Disables", "the", "edit", "button", "with", "the", "given", "reason", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/ui/CmsMenuListItem.java#L115-L121
buschmais/jqa-core-framework
analysis/src/main/java/com/buschmais/jqassistant/core/analysis/impl/AbstractCypherRuleInterpreterPlugin.java
AbstractCypherRuleInterpreterPlugin.isSuppressedRow
private boolean isSuppressedRow(String ruleId, Map<String, Object> row, String primaryColumn) { """ Verifies if the given row shall be suppressed. The primary column is checked if it contains a suppression that matches the current rule id. @param ruleId The rule id. @param row The row. @param primaryCol...
java
private boolean isSuppressedRow(String ruleId, Map<String, Object> row, String primaryColumn) { Object primaryValue = row.get(primaryColumn); if (primaryValue != null && Suppress.class.isAssignableFrom(primaryValue.getClass())) { Suppress suppress = (Suppress) primaryValue; for (...
[ "private", "boolean", "isSuppressedRow", "(", "String", "ruleId", ",", "Map", "<", "String", ",", "Object", ">", "row", ",", "String", "primaryColumn", ")", "{", "Object", "primaryValue", "=", "row", ".", "get", "(", "primaryColumn", ")", ";", "if", "(", ...
Verifies if the given row shall be suppressed. The primary column is checked if it contains a suppression that matches the current rule id. @param ruleId The rule id. @param row The row. @param primaryColumn The name of the primary column. @return <code>true</code> if the row shall be suppressed.
[ "Verifies", "if", "the", "given", "row", "shall", "be", "suppressed", "." ]
train
https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/analysis/src/main/java/com/buschmais/jqassistant/core/analysis/impl/AbstractCypherRuleInterpreterPlugin.java#L73-L84
line/armeria
grpc-protocol/src/main/java/com/linecorp/armeria/common/grpc/protocol/StatusMessageEscaper.java
StatusMessageEscaper.doEscape
private static String doEscape(byte[] valueBytes, int ri) { """ Escapes the given byte array. @param valueBytes the UTF-8 bytes @param ri The reader index, pointed at the first byte that needs escaping. """ final byte[] escapedBytes = new byte[ri + (valueBytes.length - ri) * 3]; // copy ove...
java
private static String doEscape(byte[] valueBytes, int ri) { final byte[] escapedBytes = new byte[ri + (valueBytes.length - ri) * 3]; // copy over the good bytes if (ri != 0) { System.arraycopy(valueBytes, 0, escapedBytes, 0, ri); } int wi = ri; for (; ri < val...
[ "private", "static", "String", "doEscape", "(", "byte", "[", "]", "valueBytes", ",", "int", "ri", ")", "{", "final", "byte", "[", "]", "escapedBytes", "=", "new", "byte", "[", "ri", "+", "(", "valueBytes", ".", "length", "-", "ri", ")", "*", "3", "...
Escapes the given byte array. @param valueBytes the UTF-8 bytes @param ri The reader index, pointed at the first byte that needs escaping.
[ "Escapes", "the", "given", "byte", "array", "." ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/grpc-protocol/src/main/java/com/linecorp/armeria/common/grpc/protocol/StatusMessageEscaper.java#L86-L109
Alluxio/alluxio
job/server/src/main/java/alluxio/master/job/command/CommandManager.java
CommandManager.submitCancelTaskCommand
public synchronized void submitCancelTaskCommand(long jobId, int taskId, long workerId) { """ Submits a cancel-task command to a specified worker. @param jobId the job id @param taskId the task id @param workerId the worker id """ CancelTaskCommand.Builder cancelTaskCommand = CancelTaskCommand.newBuil...
java
public synchronized void submitCancelTaskCommand(long jobId, int taskId, long workerId) { CancelTaskCommand.Builder cancelTaskCommand = CancelTaskCommand.newBuilder(); cancelTaskCommand.setJobId(jobId); cancelTaskCommand.setTaskId(taskId); JobCommand.Builder command = JobCommand.newBuilder(); comman...
[ "public", "synchronized", "void", "submitCancelTaskCommand", "(", "long", "jobId", ",", "int", "taskId", ",", "long", "workerId", ")", "{", "CancelTaskCommand", ".", "Builder", "cancelTaskCommand", "=", "CancelTaskCommand", ".", "newBuilder", "(", ")", ";", "cance...
Submits a cancel-task command to a specified worker. @param jobId the job id @param taskId the task id @param workerId the worker id
[ "Submits", "a", "cancel", "-", "task", "command", "to", "a", "specified", "worker", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/server/src/main/java/alluxio/master/job/command/CommandManager.java#L87-L97
jOOQ/jOOL
jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java
Unchecked.longPredicate
public static LongPredicate longPredicate(CheckedLongPredicate function, Consumer<Throwable> handler) { """ Wrap a {@link CheckedLongPredicate} in a {@link LongPredicate} with a custom handler for checked exceptions. <p> Example: <code><pre> LongStream.of(1L, 2L, 3L).filter(Unchecked.longPredicate( l -> { if...
java
public static LongPredicate longPredicate(CheckedLongPredicate function, Consumer<Throwable> handler) { return l -> { try { return function.test(l); } catch (Throwable e) { handler.accept(e); throw new IllegalStateException("Ex...
[ "public", "static", "LongPredicate", "longPredicate", "(", "CheckedLongPredicate", "function", ",", "Consumer", "<", "Throwable", ">", "handler", ")", "{", "return", "l", "->", "{", "try", "{", "return", "function", ".", "test", "(", "l", ")", ";", "}", "c...
Wrap a {@link CheckedLongPredicate} in a {@link LongPredicate} with a custom handler for checked exceptions. <p> Example: <code><pre> LongStream.of(1L, 2L, 3L).filter(Unchecked.longPredicate( l -> { if (l &lt; 0L) throw new Exception("Only positive numbers allowed"); return true; }, e -> { throw new IllegalStateExcept...
[ "Wrap", "a", "{", "@link", "CheckedLongPredicate", "}", "in", "a", "{", "@link", "LongPredicate", "}", "with", "a", "custom", "handler", "for", "checked", "exceptions", ".", "<p", ">", "Example", ":", "<code", ">", "<pre", ">", "LongStream", ".", "of", "...
train
https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1599-L1610
mpetazzoni/ttorrent
ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java
CommunicationManager.handleAnnounceResponse
@Override public void handleAnnounceResponse(int interval, int complete, int incomplete, String hexInfoHash) { """ Handle an announce response event. @param interval The announce interval requested by the tracker. @param complete The number of seeders on this torrent. @param incomplete The number of lee...
java
@Override public void handleAnnounceResponse(int interval, int complete, int incomplete, String hexInfoHash) { final SharedTorrent sharedTorrent = this.torrentsStorage.getTorrent(hexInfoHash); if (sharedTorrent != null) { sharedTorrent.setSeedersCount(complete); sharedTorrent.setLastAnnounceTime(S...
[ "@", "Override", "public", "void", "handleAnnounceResponse", "(", "int", "interval", ",", "int", "complete", ",", "int", "incomplete", ",", "String", "hexInfoHash", ")", "{", "final", "SharedTorrent", "sharedTorrent", "=", "this", ".", "torrentsStorage", ".", "g...
Handle an announce response event. @param interval The announce interval requested by the tracker. @param complete The number of seeders on this torrent. @param incomplete The number of leechers on this torrent.
[ "Handle", "an", "announce", "response", "event", "." ]
train
https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java#L604-L612
groupon/monsoon
remote_history/src/main/java/com/groupon/monsoon/remote/history/Client.java
Client.getEnd
@Override public DateTime getEnd() { """ Return the highest timestamp in the stored metrics. @return The highest timestamp in the stored metrics. """ try { final rh_protoClient client = getRpcClient(OncRpcProtocols.ONCRPC_UDP); try { return decodeTimestamp...
java
@Override public DateTime getEnd() { try { final rh_protoClient client = getRpcClient(OncRpcProtocols.ONCRPC_UDP); try { return decodeTimestamp(BlockingWrapper.execute(() -> client.getEnd_1())); } finally { client.close(); } ...
[ "@", "Override", "public", "DateTime", "getEnd", "(", ")", "{", "try", "{", "final", "rh_protoClient", "client", "=", "getRpcClient", "(", "OncRpcProtocols", ".", "ONCRPC_UDP", ")", ";", "try", "{", "return", "decodeTimestamp", "(", "BlockingWrapper", ".", "ex...
Return the highest timestamp in the stored metrics. @return The highest timestamp in the stored metrics.
[ "Return", "the", "highest", "timestamp", "in", "the", "stored", "metrics", "." ]
train
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/remote_history/src/main/java/com/groupon/monsoon/remote/history/Client.java#L172-L185
wwadge/bonecp
bonecp/src/main/java/com/jolbox/bonecp/StatementCache.java
StatementCache.calculateCacheKey
public String calculateCacheKey(String sql, int autoGeneratedKeys) { """ Alternate version of autoGeneratedKeys. @param sql @param autoGeneratedKeys @return cache key to use. """ StringBuilder tmp = new StringBuilder(sql.length()+4); tmp.append(sql); tmp.append(autoGeneratedKeys); return tmp.toS...
java
public String calculateCacheKey(String sql, int autoGeneratedKeys) { StringBuilder tmp = new StringBuilder(sql.length()+4); tmp.append(sql); tmp.append(autoGeneratedKeys); return tmp.toString(); }
[ "public", "String", "calculateCacheKey", "(", "String", "sql", ",", "int", "autoGeneratedKeys", ")", "{", "StringBuilder", "tmp", "=", "new", "StringBuilder", "(", "sql", ".", "length", "(", ")", "+", "4", ")", ";", "tmp", ".", "append", "(", "sql", ")",...
Alternate version of autoGeneratedKeys. @param sql @param autoGeneratedKeys @return cache key to use.
[ "Alternate", "version", "of", "autoGeneratedKeys", "." ]
train
https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/StatementCache.java#L115-L120
avianey/facebook-api-android-maven
facebook/src/main/java/com/facebook/widget/FacebookDialog.java
FacebookDialog.canPresentOpenGraphMessageDialog
public static boolean canPresentOpenGraphMessageDialog(Context context, OpenGraphMessageDialogFeature... features) { """ Determines whether the version of the Facebook application installed on the user's device is recent enough to support specific features of the native Open Graph Message dialog, which in turn ma...
java
public static boolean canPresentOpenGraphMessageDialog(Context context, OpenGraphMessageDialogFeature... features) { return handleCanPresent(context, EnumSet.of(OpenGraphMessageDialogFeature.OG_MESSAGE_DIALOG, features)); }
[ "public", "static", "boolean", "canPresentOpenGraphMessageDialog", "(", "Context", "context", ",", "OpenGraphMessageDialogFeature", "...", "features", ")", "{", "return", "handleCanPresent", "(", "context", ",", "EnumSet", ".", "of", "(", "OpenGraphMessageDialogFeature", ...
Determines whether the version of the Facebook application installed on the user's device is recent enough to support specific features of the native Open Graph Message dialog, which in turn may be used to determine which UI, etc., to present to the user. @param context the calling Context @param features zero or mor...
[ "Determines", "whether", "the", "version", "of", "the", "Facebook", "application", "installed", "on", "the", "user", "s", "device", "is", "recent", "enough", "to", "support", "specific", "features", "of", "the", "native", "Open", "Graph", "Message", "dialog", ...
train
https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookDialog.java#L414-L416
UrielCh/ovh-java-sdk
ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java
ApiOvhDedicatedCloud.serviceName_federation_activeDirectory_activeDirectoryId_changeProperties_POST
public OvhTask serviceName_federation_activeDirectory_activeDirectoryId_changeProperties_POST(String serviceName, Long activeDirectoryId, String description, String password, String username) throws IOException { """ Change Active Directory properties REST: POST /dedicatedCloud/{serviceName}/federation/activeDi...
java
public OvhTask serviceName_federation_activeDirectory_activeDirectoryId_changeProperties_POST(String serviceName, Long activeDirectoryId, String description, String password, String username) throws IOException { String qPath = "/dedicatedCloud/{serviceName}/federation/activeDirectory/{activeDirectoryId}/changeProper...
[ "public", "OvhTask", "serviceName_federation_activeDirectory_activeDirectoryId_changeProperties_POST", "(", "String", "serviceName", ",", "Long", "activeDirectoryId", ",", "String", "description", ",", "String", "password", ",", "String", "username", ")", "throws", "IOExcepti...
Change Active Directory properties REST: POST /dedicatedCloud/{serviceName}/federation/activeDirectory/{activeDirectoryId}/changeProperties @param username [required] Active Directory username, e.g. jdoe@example.com @param password [required] Active Directory password @param description [required] Description of your ...
[ "Change", "Active", "Directory", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L1101-L1110
eduarddrenth/ConfigurableReports
src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java
DefaultElementProducer.loadImage
@Override public Image loadImage(URL image, float opacity) throws VectorPrintException { """ loads an image using {@link ImageIO } @param image @param opacity the value of opacity @throws VectorPrintException @return the com.itextpdf.text.Image """ try { if (log.isLoggable(Level.FINE)) ...
java
@Override public Image loadImage(URL image, float opacity) throws VectorPrintException { try { if (log.isLoggable(Level.FINE)) { log.fine(String.format("loading image from %s", String.valueOf(image))); } BufferedImage awtim = null; if ("file".equals(image.getProt...
[ "@", "Override", "public", "Image", "loadImage", "(", "URL", "image", ",", "float", "opacity", ")", "throws", "VectorPrintException", "{", "try", "{", "if", "(", "log", ".", "isLoggable", "(", "Level", ".", "FINE", ")", ")", "{", "log", ".", "fine", "(...
loads an image using {@link ImageIO } @param image @param opacity the value of opacity @throws VectorPrintException @return the com.itextpdf.text.Image
[ "loads", "an", "image", "using", "{", "@link", "ImageIO", "}" ]
train
https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java#L401-L417
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/extension/GeoPackageExtensions.java
GeoPackageExtensions.deleteMetadata
public static void deleteMetadata(GeoPackageCore geoPackage, String table) { """ Delete the Metadata extensions for the table @param geoPackage GeoPackage @param table table name @since 3.2.0 """ MetadataReferenceDao metadataReferenceDao = geoPackage .getMetadataReferenceDao(); try { if (met...
java
public static void deleteMetadata(GeoPackageCore geoPackage, String table) { MetadataReferenceDao metadataReferenceDao = geoPackage .getMetadataReferenceDao(); try { if (metadataReferenceDao.isTableExists()) { metadataReferenceDao.deleteByTableName(table); } } catch (SQLException e) { throw new ...
[ "public", "static", "void", "deleteMetadata", "(", "GeoPackageCore", "geoPackage", ",", "String", "table", ")", "{", "MetadataReferenceDao", "metadataReferenceDao", "=", "geoPackage", ".", "getMetadataReferenceDao", "(", ")", ";", "try", "{", "if", "(", "metadataRef...
Delete the Metadata extensions for the table @param geoPackage GeoPackage @param table table name @since 3.2.0
[ "Delete", "the", "Metadata", "extensions", "for", "the", "table" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/GeoPackageExtensions.java#L358-L372
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.enableServerMapping
public ServerRedirect enableServerMapping(int serverMappingId, Boolean enabled) { """ Enable/disable a server mapping @param serverMappingId ID of server mapping @param enabled true to enable, false to disable @return updated info for the ServerRedirect """ ServerRedirect redirect = new ServerRedi...
java
public ServerRedirect enableServerMapping(int serverMappingId, Boolean enabled) { ServerRedirect redirect = new ServerRedirect(); BasicNameValuePair[] params = { new BasicNameValuePair("enabled", enabled.toString()), new BasicNameValuePair("profileIdentifier", this._profileName) ...
[ "public", "ServerRedirect", "enableServerMapping", "(", "int", "serverMappingId", ",", "Boolean", "enabled", ")", "{", "ServerRedirect", "redirect", "=", "new", "ServerRedirect", "(", ")", ";", "BasicNameValuePair", "[", "]", "params", "=", "{", "new", "BasicNameV...
Enable/disable a server mapping @param serverMappingId ID of server mapping @param enabled true to enable, false to disable @return updated info for the ServerRedirect
[ "Enable", "/", "disable", "a", "server", "mapping" ]
train
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1090-L1104
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/FormLayoutFormBuilder.java
FormLayoutFormBuilder.addBinding
public JComponent addBinding(Binding binding, int column, int row, int widthSpan, int heightSpan) { """ Add a binder to a column and a row with width and height spanning. """ ((SwingBindingFactory) getBindingFactory()).interceptBinding(binding); JComponent component = binding.getControl(); ...
java
public JComponent addBinding(Binding binding, int column, int row, int widthSpan, int heightSpan) { ((SwingBindingFactory) getBindingFactory()).interceptBinding(binding); JComponent component = binding.getControl(); addComponent(component, column, row, widthSpan, heightSpan); return ...
[ "public", "JComponent", "addBinding", "(", "Binding", "binding", ",", "int", "column", ",", "int", "row", ",", "int", "widthSpan", ",", "int", "heightSpan", ")", "{", "(", "(", "SwingBindingFactory", ")", "getBindingFactory", "(", ")", ")", ".", "interceptBi...
Add a binder to a column and a row with width and height spanning.
[ "Add", "a", "binder", "to", "a", "column", "and", "a", "row", "with", "width", "and", "height", "spanning", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/FormLayoutFormBuilder.java#L271-L277
aws/aws-sdk-java
aws-java-sdk-iotjobsdataplane/src/main/java/com/amazonaws/services/iotjobsdataplane/model/StartNextPendingJobExecutionRequest.java
StartNextPendingJobExecutionRequest.withStatusDetails
public StartNextPendingJobExecutionRequest withStatusDetails(java.util.Map<String, String> statusDetails) { """ <p> A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged. </p> @param statusDetails A collection of name/value pairs th...
java
public StartNextPendingJobExecutionRequest withStatusDetails(java.util.Map<String, String> statusDetails) { setStatusDetails(statusDetails); return this; }
[ "public", "StartNextPendingJobExecutionRequest", "withStatusDetails", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "statusDetails", ")", "{", "setStatusDetails", "(", "statusDetails", ")", ";", "return", "this", ";", "}" ]
<p> A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged. </p> @param statusDetails A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged. @return Returns a reference...
[ "<p", ">", "A", "collection", "of", "name", "/", "value", "pairs", "that", "describe", "the", "status", "of", "the", "job", "execution", ".", "If", "not", "specified", "the", "statusDetails", "are", "unchanged", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iotjobsdataplane/src/main/java/com/amazonaws/services/iotjobsdataplane/model/StartNextPendingJobExecutionRequest.java#L134-L137
sporniket/core
sporniket-core-ui/src/main/java/com/sporniket/libre/ui/swing/ComponentFactory.java
ComponentFactory.createPanelWithVerticalLayout
public static JPanel createPanelWithVerticalLayout() { """ Create a panel that lays out components vertically. @return a panel with a vertical layout. @since 15.02.00 """ JPanel _panel = new JPanel(); _panel.setLayout(new BoxLayout(_panel, BoxLayout.Y_AXIS)); return _panel; }
java
public static JPanel createPanelWithVerticalLayout() { JPanel _panel = new JPanel(); _panel.setLayout(new BoxLayout(_panel, BoxLayout.Y_AXIS)); return _panel; }
[ "public", "static", "JPanel", "createPanelWithVerticalLayout", "(", ")", "{", "JPanel", "_panel", "=", "new", "JPanel", "(", ")", ";", "_panel", ".", "setLayout", "(", "new", "BoxLayout", "(", "_panel", ",", "BoxLayout", ".", "Y_AXIS", ")", ")", ";", "retu...
Create a panel that lays out components vertically. @return a panel with a vertical layout. @since 15.02.00
[ "Create", "a", "panel", "that", "lays", "out", "components", "vertically", "." ]
train
https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ui/src/main/java/com/sporniket/libre/ui/swing/ComponentFactory.java#L87-L92
jcuda/jcusolver
JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverDn.java
JCusolverDn.cusolverDnSsyevd_bufferSize
public static int cusolverDnSsyevd_bufferSize( cusolverDnHandle handle, int jobz, int uplo, int n, Pointer A, int lda, Pointer W, int[] lwork) { """ standard symmetric eigenvalue solver, A*x = lambda*x, by divide-and-conquer """ ...
java
public static int cusolverDnSsyevd_bufferSize( cusolverDnHandle handle, int jobz, int uplo, int n, Pointer A, int lda, Pointer W, int[] lwork) { return checkResult(cusolverDnSsyevd_bufferSizeNative(handle, jobz, uplo, n, A, lda...
[ "public", "static", "int", "cusolverDnSsyevd_bufferSize", "(", "cusolverDnHandle", "handle", ",", "int", "jobz", ",", "int", "uplo", ",", "int", "n", ",", "Pointer", "A", ",", "int", "lda", ",", "Pointer", "W", ",", "int", "[", "]", "lwork", ")", "{", ...
standard symmetric eigenvalue solver, A*x = lambda*x, by divide-and-conquer
[ "standard", "symmetric", "eigenvalue", "solver", "A", "*", "x", "=", "lambda", "*", "x", "by", "divide", "-", "and", "-", "conquer" ]
train
https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverDn.java#L3036-L3047
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/domain/BrowserPattern.java
BrowserPattern.compareInt
private static int compareInt(final int a, final int b) { """ Compares to integers. @param a first integer @param b second integer @return {@code -1} if {@code a} is less, {@code 0} if equal, or {@code 1} if greater than {@code b} """ int result = 0; if (a > b) { result = 1; } else if (a < b) {...
java
private static int compareInt(final int a, final int b) { int result = 0; if (a > b) { result = 1; } else if (a < b) { result = -1; } return result; }
[ "private", "static", "int", "compareInt", "(", "final", "int", "a", ",", "final", "int", "b", ")", "{", "int", "result", "=", "0", ";", "if", "(", "a", ">", "b", ")", "{", "result", "=", "1", ";", "}", "else", "if", "(", "a", "<", "b", ")", ...
Compares to integers. @param a first integer @param b second integer @return {@code -1} if {@code a} is less, {@code 0} if equal, or {@code 1} if greater than {@code b}
[ "Compares", "to", "integers", "." ]
train
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/domain/BrowserPattern.java#L198-L206
pedrovgs/DraggablePanel
sample/src/main/java/com/github/pedrovgs/sample/activity/PlacesSampleActivity.java
PlacesSampleActivity.initializeListView
private void initializeListView() { """ Initialize places ListView using placesAdapter and configure OnItemClickListener. """ placesListView.setAdapter(placesAdapter); placesListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView...
java
private void initializeListView() { placesListView.setAdapter(placesAdapter); placesListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { lastLoadedPlacePosition = position; ...
[ "private", "void", "initializeListView", "(", ")", "{", "placesListView", ".", "setAdapter", "(", "placesAdapter", ")", ";", "placesListView", ".", "setOnItemClickListener", "(", "new", "AdapterView", ".", "OnItemClickListener", "(", ")", "{", "@", "Override", "pu...
Initialize places ListView using placesAdapter and configure OnItemClickListener.
[ "Initialize", "places", "ListView", "using", "placesAdapter", "and", "configure", "OnItemClickListener", "." ]
train
https://github.com/pedrovgs/DraggablePanel/blob/6b6d1806fa4140113f31307a2571bf02435aa53a/sample/src/main/java/com/github/pedrovgs/sample/activity/PlacesSampleActivity.java#L235-L244
iipc/webarchive-commons
src/main/java/org/archive/util/LaxHttpParser.java
LaxHttpParser.readLine
public static String readLine(InputStream inputStream, String charset) throws IOException { """ Read up to <tt>"\n"</tt> from an (unchunked) input stream. If the stream ends before the line terminator is found, the last part of the string will still be returned. If no input data available, <code>null</code> is ...
java
public static String readLine(InputStream inputStream, String charset) throws IOException { LOG.trace("enter LaxHttpParser.readLine(InputStream, String)"); byte[] rawdata = readRawLine(inputStream); if (rawdata == null) { return null; } // strip CR and LF from the end...
[ "public", "static", "String", "readLine", "(", "InputStream", "inputStream", ",", "String", "charset", ")", "throws", "IOException", "{", "LOG", ".", "trace", "(", "\"enter LaxHttpParser.readLine(InputStream, String)\"", ")", ";", "byte", "[", "]", "rawdata", "=", ...
Read up to <tt>"\n"</tt> from an (unchunked) input stream. If the stream ends before the line terminator is found, the last part of the string will still be returned. If no input data available, <code>null</code> is returned. @param inputStream the stream to read from @param charset charset of HTTP protocol elements ...
[ "Read", "up", "to", "<tt", ">", "\\", "n", "<", "/", "tt", ">", "from", "an", "(", "unchunked", ")", "input", "stream", ".", "If", "the", "stream", "ends", "before", "the", "line", "terminator", "is", "found", "the", "last", "part", "of", "the", "s...
train
https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/LaxHttpParser.java#L110-L130
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/security/BESecurityConfig.java
BESecurityConfig.addEmptyConfigs
public void addEmptyConfigs(Map<String, List<String>> pidToMethodList) { """ Add empty sDep and method configurations given by the map if they are not already already defined. """ Iterator<String> pIter = pidToMethodList.keySet().iterator(); while (pIter.hasNext()) { String sDepPID...
java
public void addEmptyConfigs(Map<String, List<String>> pidToMethodList) { Iterator<String> pIter = pidToMethodList.keySet().iterator(); while (pIter.hasNext()) { String sDepPID = pIter.next(); // add the sDep indicated by the key if it doesn't exist ServiceDeploymentRo...
[ "public", "void", "addEmptyConfigs", "(", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "pidToMethodList", ")", "{", "Iterator", "<", "String", ">", "pIter", "=", "pidToMethodList", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", ...
Add empty sDep and method configurations given by the map if they are not already already defined.
[ "Add", "empty", "sDep", "and", "method", "configurations", "given", "by", "the", "map", "if", "they", "are", "not", "already", "already", "defined", "." ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/security/BESecurityConfig.java#L294-L319
zaproxy/zaproxy
src/org/zaproxy/zap/extension/script/ExtensionScript.java
ExtensionScript.hasSameScriptEngine
public static boolean hasSameScriptEngine(ScriptWrapper scriptWrapper, ScriptEngineWrapper engineWrapper) { """ Tells whether or not the given {@code scriptWrapper} has the given {@code engineWrapper}. <p> If the given {@code scriptWrapper} has an engine set it's checked by reference (operator {@code ==}), other...
java
public static boolean hasSameScriptEngine(ScriptWrapper scriptWrapper, ScriptEngineWrapper engineWrapper) { if (scriptWrapper.getEngine() != null) { return scriptWrapper.getEngine() == engineWrapper; } return isSameScriptEngine(scriptWrapper.getEngineName(), engineWrapper.getEngineName(), engineWrapper.g...
[ "public", "static", "boolean", "hasSameScriptEngine", "(", "ScriptWrapper", "scriptWrapper", ",", "ScriptEngineWrapper", "engineWrapper", ")", "{", "if", "(", "scriptWrapper", ".", "getEngine", "(", ")", "!=", "null", ")", "{", "return", "scriptWrapper", ".", "get...
Tells whether or not the given {@code scriptWrapper} has the given {@code engineWrapper}. <p> If the given {@code scriptWrapper} has an engine set it's checked by reference (operator {@code ==}), otherwise it's used the engine names. @param scriptWrapper the script wrapper that will be checked @param engineWrapper the...
[ "Tells", "whether", "or", "not", "the", "given", "{", "@code", "scriptWrapper", "}", "has", "the", "given", "{", "@code", "engineWrapper", "}", ".", "<p", ">", "If", "the", "given", "{", "@code", "scriptWrapper", "}", "has", "an", "engine", "set", "it", ...
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L347-L353
ZuInnoTe/hadoopoffice
fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/parser/msexcel/internal/EncryptedCachedDiskStringsTable.java
EncryptedCachedDiskStringsTable.accessTempFile
private void accessTempFile(long position) throws IOException { """ * Simulates random access to the tempfile even if not supported due to encryption and/or compression @param position @throws IOException """ if ((position == 0L) || (position < this.currentPos)) { // in those cases we have to read from...
java
private void accessTempFile(long position) throws IOException { if ((position == 0L) || (position < this.currentPos)) { // in those cases we have to read from scratch this.in = new FileInputStream(this.tempFile); if (this.ca != null) { // decrypt this.in = new CipherInputStream(this.in, this.ciDecrypt);...
[ "private", "void", "accessTempFile", "(", "long", "position", ")", "throws", "IOException", "{", "if", "(", "(", "position", "==", "0L", ")", "||", "(", "position", "<", "this", ".", "currentPos", ")", ")", "{", "// in those cases we have to read from scratch", ...
* Simulates random access to the tempfile even if not supported due to encryption and/or compression @param position @throws IOException
[ "*", "Simulates", "random", "access", "to", "the", "tempfile", "even", "if", "not", "supported", "due", "to", "encryption", "and", "/", "or", "compression" ]
train
https://github.com/ZuInnoTe/hadoopoffice/blob/58fc9223ee290bcb14847aaaff3fadf39c465e46/fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/parser/msexcel/internal/EncryptedCachedDiskStringsTable.java#L413-L431
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java
ShapeGenerator.createRoundRectangle
public Shape createRoundRectangle(final int x, final int y, final int w, final int h, final CornerSize size) { """ Return a path for a rectangle with rounded corners. @param x the X coordinate of the upper-left corner of the rectangle @param y the Y coordinate of the upper-left corner of the rectangle ...
java
public Shape createRoundRectangle(final int x, final int y, final int w, final int h, final CornerSize size) { return createRoundRectangle(x, y, w, h, size, CornerStyle.ROUNDED, CornerStyle.ROUNDED, CornerStyle.ROUNDED, CornerStyle.ROUNDED); }
[ "public", "Shape", "createRoundRectangle", "(", "final", "int", "x", ",", "final", "int", "y", ",", "final", "int", "w", ",", "final", "int", "h", ",", "final", "CornerSize", "size", ")", "{", "return", "createRoundRectangle", "(", "x", ",", "y", ",", ...
Return a path for a rectangle with rounded corners. @param x the X coordinate of the upper-left corner of the rectangle @param y the Y coordinate of the upper-left corner of the rectangle @param w the width of the rectangle @param h the height of the rectangle @param size the CornerSize value represen...
[ "Return", "a", "path", "for", "a", "rectangle", "with", "rounded", "corners", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L209-L211
lestard/advanced-bindings
src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java
MathBindings.multiplyExact
public static IntegerBinding multiplyExact(final ObservableIntegerValue x, final ObservableIntegerValue y) { """ Binding for {@link java.lang.Math#multiplyExact(int, int)} @param x the first value @param y the second value @return the result @throws ArithmeticException if the result overflows an int """ ...
java
public static IntegerBinding multiplyExact(final ObservableIntegerValue x, final ObservableIntegerValue y) { return createIntegerBinding(() -> Math.multiplyExact(x.get(), y.get()), x, y); }
[ "public", "static", "IntegerBinding", "multiplyExact", "(", "final", "ObservableIntegerValue", "x", ",", "final", "ObservableIntegerValue", "y", ")", "{", "return", "createIntegerBinding", "(", "(", ")", "->", "Math", ".", "multiplyExact", "(", "x", ".", "get", ...
Binding for {@link java.lang.Math#multiplyExact(int, int)} @param x the first value @param y the second value @return the result @throws ArithmeticException if the result overflows an int
[ "Binding", "for", "{", "@link", "java", ".", "lang", ".", "Math#multiplyExact", "(", "int", "int", ")", "}" ]
train
https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L986-L988
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/transform/TransformerRegistry.java
TransformerRegistry.resolveHost
public OperationTransformerRegistry resolveHost(final ModelVersion mgmtVersion, final ModelNode subsystems) { """ Resolve the host registry. @param mgmtVersion the mgmt version @param subsystems the subsystems @return the transformer registry """ return resolveHost(mgmtVersion, resolveVersions(sub...
java
public OperationTransformerRegistry resolveHost(final ModelVersion mgmtVersion, final ModelNode subsystems) { return resolveHost(mgmtVersion, resolveVersions(subsystems)); }
[ "public", "OperationTransformerRegistry", "resolveHost", "(", "final", "ModelVersion", "mgmtVersion", ",", "final", "ModelNode", "subsystems", ")", "{", "return", "resolveHost", "(", "mgmtVersion", ",", "resolveVersions", "(", "subsystems", ")", ")", ";", "}" ]
Resolve the host registry. @param mgmtVersion the mgmt version @param subsystems the subsystems @return the transformer registry
[ "Resolve", "the", "host", "registry", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/TransformerRegistry.java#L197-L200
paypal/SeLion
client/src/main/java/com/paypal/selion/configuration/ConfigManager.java
ConfigManager.addConfig
public static synchronized void addConfig(String name, LocalConfig config) { """ Adds the local configuration {@link LocalConfig} associated with name. Over-rides any config with the same name. @param config The LocalConfig. @param name The name to associate with local config. """ SeLionLogger.ge...
java
public static synchronized void addConfig(String name, LocalConfig config) { SeLionLogger.getLogger().entering(new Object[] { name, config }); checkArgument(StringUtils.isNotBlank(name), "A testname for which configuration is being added cannot be null (or) empty."); checkArgumen...
[ "public", "static", "synchronized", "void", "addConfig", "(", "String", "name", ",", "LocalConfig", "config", ")", "{", "SeLionLogger", ".", "getLogger", "(", ")", ".", "entering", "(", "new", "Object", "[", "]", "{", "name", ",", "config", "}", ")", ";"...
Adds the local configuration {@link LocalConfig} associated with name. Over-rides any config with the same name. @param config The LocalConfig. @param name The name to associate with local config.
[ "Adds", "the", "local", "configuration", "{", "@link", "LocalConfig", "}", "associated", "with", "name", ".", "Over", "-", "rides", "any", "config", "with", "the", "same", "name", "." ]
train
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/configuration/ConfigManager.java#L71-L82
datastax/java-driver
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/QueryBuilder.java
QueryBuilder.subtract
@NonNull public static Term subtract(@NonNull Term left, @NonNull Term right) { """ The difference of two terms, as in {@code WHERE k = left - right}. """ return new BinaryArithmeticTerm(ArithmeticOperator.DIFFERENCE, left, right); }
java
@NonNull public static Term subtract(@NonNull Term left, @NonNull Term right) { return new BinaryArithmeticTerm(ArithmeticOperator.DIFFERENCE, left, right); }
[ "@", "NonNull", "public", "static", "Term", "subtract", "(", "@", "NonNull", "Term", "left", ",", "@", "NonNull", "Term", "right", ")", "{", "return", "new", "BinaryArithmeticTerm", "(", "ArithmeticOperator", ".", "DIFFERENCE", ",", "left", ",", "right", ")"...
The difference of two terms, as in {@code WHERE k = left - right}.
[ "The", "difference", "of", "two", "terms", "as", "in", "{" ]
train
https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/QueryBuilder.java#L195-L198
ManfredTremmel/gwt-commons-lang3
src/main/resources/org/apache/commons/jre/java/util/BitSet.java
BitSet.maskOutWord
private static void maskOutWord(int[] array, int index, int from, int to) { """ Sets all bits to false in a word within the given bit range. @param array The array. @param index The word index. @param from The lower bit index. @param to The upper bit index. """ if (from == to) { return; } ...
java
private static void maskOutWord(int[] array, int index, int from, int to) { if (from == to) { return; } int word = wordAt(array, index); if (word == 0) { return; } int mask; if (from != 0) { mask = 0xffffffff >>> (32 - from); } else { mask = 0; } // Shif...
[ "private", "static", "void", "maskOutWord", "(", "int", "[", "]", "array", ",", "int", "index", ",", "int", "from", ",", "int", "to", ")", "{", "if", "(", "from", "==", "to", ")", "{", "return", ";", "}", "int", "word", "=", "wordAt", "(", "array...
Sets all bits to false in a word within the given bit range. @param array The array. @param index The word index. @param from The lower bit index. @param to The upper bit index.
[ "Sets", "all", "bits", "to", "false", "in", "a", "word", "within", "the", "given", "bit", "range", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/BitSet.java#L193-L216
baratine/baratine
framework/src/main/java/com/caucho/v5/config/expr/ExprCfgParserImpl.java
ExprCfgParserImpl.parseTerm
private ExprCfg parseTerm() { """ term ::= simple-term ::= term '[' expr ']' ::= term . identifier """ ExprCfg term = parseSimpleTerm(); while (true) { ExprToken token = scanToken(); switch (token) { /* case LBRACE: { ExprCfg expr = parseExpr(); token =...
java
private ExprCfg parseTerm() { ExprCfg term = parseSimpleTerm(); while (true) { ExprToken token = scanToken(); switch (token) { /* case LBRACE: { ExprCfg expr = parseExpr(); token = scanToken(); if (token != ExprToken.RBRACE) { throw error(L.l("...
[ "private", "ExprCfg", "parseTerm", "(", ")", "{", "ExprCfg", "term", "=", "parseSimpleTerm", "(", ")", ";", "while", "(", "true", ")", "{", "ExprToken", "token", "=", "scanToken", "(", ")", ";", "switch", "(", "token", ")", "{", "/*\n case LBRACE:\n ...
term ::= simple-term ::= term '[' expr ']' ::= term . identifier
[ "term", "::", "=", "simple", "-", "term", "::", "=", "term", "[", "expr", "]", "::", "=", "term", ".", "identifier" ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/config/expr/ExprCfgParserImpl.java#L668-L732
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ns_timeout.java
ns_ns_timeout.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ ns_ns_timeout_responses result = (ns_ns_timeout_responses) service.get_...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { ns_ns_timeout_responses result = (ns_ns_timeout_responses) service.get_payload_formatter().string_to_resource(ns_ns_timeout_responses.class, response); if(result.errorcode != 0) { if (result.error...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "ns_ns_timeout_responses", "result", "=", "(", "ns_ns_timeout_responses", ")", "service", ".", "get_payload_fo...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ns_timeout.java#L230-L247
JodaOrg/joda-time
src/main/java/org/joda/time/Period.java
Period.withField
public Period withField(DurationFieldType field, int value) { """ Creates a new Period instance with the specified field set to a new value. <p> This period instance is immutable and unaffected by this method call. @param field the field to set, not null @param value the value to set to @return the new pe...
java
public Period withField(DurationFieldType field, int value) { if (field == null) { throw new IllegalArgumentException("Field must not be null"); } int[] newValues = getValues(); // cloned super.setFieldInto(newValues, field, value); return new Period(newValues, getPe...
[ "public", "Period", "withField", "(", "DurationFieldType", "field", ",", "int", "value", ")", "{", "if", "(", "field", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Field must not be null\"", ")", ";", "}", "int", "[", "]", "new...
Creates a new Period instance with the specified field set to a new value. <p> This period instance is immutable and unaffected by this method call. @param field the field to set, not null @param value the value to set to @return the new period instance @throws IllegalArgumentException if the field type is null or u...
[ "Creates", "a", "new", "Period", "instance", "with", "the", "specified", "field", "set", "to", "a", "new", "value", ".", "<p", ">", "This", "period", "instance", "is", "immutable", "and", "unaffected", "by", "this", "method", "call", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L873-L880
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.invokeOnNodes
public int invokeOnNodes (Function<Tuple<Client,NodeObject>,Boolean> func) { """ Invokes the supplied function on <em>all</em> node objects (except the local node). A caller that needs to call an invocation service method on a remote node should use this mechanism to locate the appropriate node (or nodes) and ca...
java
public int invokeOnNodes (Function<Tuple<Client,NodeObject>,Boolean> func) { int invoked = 0; for (PeerNode peer : _peers.values()) { if (peer.nodeobj != null) { if (func.apply(Tuple.newTuple(peer.getClient(), peer.nodeobj))) { invoked++; ...
[ "public", "int", "invokeOnNodes", "(", "Function", "<", "Tuple", "<", "Client", ",", "NodeObject", ">", ",", "Boolean", ">", "func", ")", "{", "int", "invoked", "=", "0", ";", "for", "(", "PeerNode", "peer", ":", "_peers", ".", "values", "(", ")", ")...
Invokes the supplied function on <em>all</em> node objects (except the local node). A caller that needs to call an invocation service method on a remote node should use this mechanism to locate the appropriate node (or nodes) and call the desired method. @return the number of times the invoked function returned true.
[ "Invokes", "the", "supplied", "function", "on", "<em", ">", "all<", "/", "em", ">", "node", "objects", "(", "except", "the", "local", "node", ")", ".", "A", "caller", "that", "needs", "to", "call", "an", "invocation", "service", "method", "on", "a", "r...
train
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L446-L457
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java
JobHistoryService.createFlowScan
private Scan createFlowScan(byte[] rowPrefix, int limit, String version) { """ creates a scan for flow data @param rowPrefix - start row prefix @param limit - limit on scanned results @param version - version to match @return Scan """ Scan scan = new Scan(); scan.setStartRow(rowPrefix); // usi...
java
private Scan createFlowScan(byte[] rowPrefix, int limit, String version) { Scan scan = new Scan(); scan.setStartRow(rowPrefix); // using a large scanner caching value with a small limit can mean we scan a // lot more data than necessary, so lower the caching for low limits scan.setCaching(Math.min(...
[ "private", "Scan", "createFlowScan", "(", "byte", "[", "]", "rowPrefix", ",", "int", "limit", ",", "String", "version", ")", "{", "Scan", "scan", "=", "new", "Scan", "(", ")", ";", "scan", ".", "setStartRow", "(", "rowPrefix", ")", ";", "// using a large...
creates a scan for flow data @param rowPrefix - start row prefix @param limit - limit on scanned results @param version - version to match @return Scan
[ "creates", "a", "scan", "for", "flow", "data" ]
train
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L225-L246
knowm/Yank
src/main/java/org/knowm/yank/Yank.java
Yank.executeSQLKey
public static int executeSQLKey(String poolName, String sqlKey, Object[] params) throws SQLStatementNotFoundException, YankSQLException { """ Executes the given INSERT, UPDATE, DELETE, REPLACE or UPSERT SQL statement matching the sqlKey String in a properties file loaded via Yank.addSQLStatements(...). Retu...
java
public static int executeSQLKey(String poolName, String sqlKey, Object[] params) throws SQLStatementNotFoundException, YankSQLException { String sql = YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey); if (sql == null || sql.equalsIgnoreCase("")) { throw new SQLStatementNotFoundExcepti...
[ "public", "static", "int", "executeSQLKey", "(", "String", "poolName", ",", "String", "sqlKey", ",", "Object", "[", "]", "params", ")", "throws", "SQLStatementNotFoundException", ",", "YankSQLException", "{", "String", "sql", "=", "YANK_POOL_MANAGER", ".", "getMer...
Executes the given INSERT, UPDATE, DELETE, REPLACE or UPSERT SQL statement matching the sqlKey String in a properties file loaded via Yank.addSQLStatements(...). Returns the number of rows affected. @param poolName The name of the connection pool to query against @param sqlKey The SQL Key found in a properties file co...
[ "Executes", "the", "given", "INSERT", "UPDATE", "DELETE", "REPLACE", "or", "UPSERT", "SQL", "statement", "matching", "the", "sqlKey", "String", "in", "a", "properties", "file", "loaded", "via", "Yank", ".", "addSQLStatements", "(", "...", ")", ".", "Returns", ...
train
https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/Yank.java#L168-L177
inversoft/restify
src/main/java/com/inversoft/rest/RESTClient.java
RESTClient.urlSegment
public RESTClient<RS, ERS> urlSegment(Object value) { """ Append a url path segment. <p> For Example: <pre> .url("http://www.foo.com") .urlSegment("bar") </pre> This will result in a url of <code>http://www.foo.com/bar</code> @param value The url path segment. A null value will be ignored. @return This. ...
java
public RESTClient<RS, ERS> urlSegment(Object value) { if (value != null) { if (url.charAt(url.length() - 1) != '/') { url.append('/'); } url.append(value.toString()); } return this; }
[ "public", "RESTClient", "<", "RS", ",", "ERS", ">", "urlSegment", "(", "Object", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "if", "(", "url", ".", "charAt", "(", "url", ".", "length", "(", ")", "-", "1", ")", "!=", "'", "'",...
Append a url path segment. <p> For Example: <pre> .url("http://www.foo.com") .urlSegment("bar") </pre> This will result in a url of <code>http://www.foo.com/bar</code> @param value The url path segment. A null value will be ignored. @return This.
[ "Append", "a", "url", "path", "segment", ".", "<p", ">", "For", "Example", ":", "<pre", ">", ".", "url", "(", "http", ":", "//", "www", ".", "foo", ".", "com", ")", ".", "urlSegment", "(", "bar", ")", "<", "/", "pre", ">", "This", "will", "resu...
train
https://github.com/inversoft/restify/blob/f2426d9082e00a9d958af28f78ccda61802c6700/src/main/java/com/inversoft/rest/RESTClient.java#L352-L360
bThink-BGU/BPjs
src/main/java/il/ac/bgu/cs/bp/bpjs/execution/jsproxy/BProgramJsProxy.java
BProgramJsProxy.synchronizationPoint
@Override void synchronizationPoint( NativeObject jsRWB, Boolean hot, Object data ) { """ Where the actual Behavioral Programming synchronization point is done. @param jsRWB The JavaScript object {@code {request:... waitFor:...}} @param hot {@code True} if this should be a "hot" synchronization point. @...
java
@Override void synchronizationPoint( NativeObject jsRWB, Boolean hot, Object data ) { Map<String, Object> jRWB = (Map)Context.jsToJava(jsRWB, Map.class); SyncStatement stmt = SyncStatement.make(); if ( hot != null ) { stmt = stmt.hot(hot); } Object req = ...
[ "@", "Override", "void", "synchronizationPoint", "(", "NativeObject", "jsRWB", ",", "Boolean", "hot", ",", "Object", "data", ")", "{", "Map", "<", "String", ",", "Object", ">", "jRWB", "=", "(", "Map", ")", "Context", ".", "jsToJava", "(", "jsRWB", ",", ...
Where the actual Behavioral Programming synchronization point is done. @param jsRWB The JavaScript object {@code {request:... waitFor:...}} @param hot {@code True} if this should be a "hot" synchronization point. @param data Optional extra data the synchronizing b-thread may want to add.
[ "Where", "the", "actual", "Behavioral", "Programming", "synchronization", "point", "is", "done", "." ]
train
https://github.com/bThink-BGU/BPjs/blob/2d388365a27ad79ded108eaf98a35a7ef292ae1f/src/main/java/il/ac/bgu/cs/bp/bpjs/execution/jsproxy/BProgramJsProxy.java#L191-L225
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/internal/ResettableInputStream.java
ResettableInputStream.newResettableInputStream
public static ResettableInputStream newResettableInputStream( FileInputStream fis, String errmsg) { """ Convenient factory method to construct a new resettable input stream for the given file input stream, converting any IOException into SdkClientException with the given error message. <p> Note the...
java
public static ResettableInputStream newResettableInputStream( FileInputStream fis, String errmsg) { try { return new ResettableInputStream(fis); } catch (IOException e) { throw new SdkClientException(errmsg, e); } }
[ "public", "static", "ResettableInputStream", "newResettableInputStream", "(", "FileInputStream", "fis", ",", "String", "errmsg", ")", "{", "try", "{", "return", "new", "ResettableInputStream", "(", "fis", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{"...
Convenient factory method to construct a new resettable input stream for the given file input stream, converting any IOException into SdkClientException with the given error message. <p> Note the creation of a {@link ResettableInputStream} would entail physically opening a file. If the opened file is meant to be closed...
[ "Convenient", "factory", "method", "to", "construct", "a", "new", "resettable", "input", "stream", "for", "the", "given", "file", "input", "stream", "converting", "any", "IOException", "into", "SdkClientException", "with", "the", "given", "error", "message", ".", ...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/internal/ResettableInputStream.java#L297-L304
jtablesaw/tablesaw
core/src/main/java/tech/tablesaw/table/TableSliceGroup.java
TableSliceGroup.aggregateColumnName
public static String aggregateColumnName(String columnName, String functionName) { """ Returns a column name for aggregated data based on the given source column name and function """ return String.format("%s [%s]", functionName, columnName); }
java
public static String aggregateColumnName(String columnName, String functionName) { return String.format("%s [%s]", functionName, columnName); }
[ "public", "static", "String", "aggregateColumnName", "(", "String", "columnName", ",", "String", "functionName", ")", "{", "return", "String", ".", "format", "(", "\"%s [%s]\"", ",", "functionName", ",", "columnName", ")", ";", "}" ]
Returns a column name for aggregated data based on the given source column name and function
[ "Returns", "a", "column", "name", "for", "aggregated", "data", "based", "on", "the", "given", "source", "column", "name", "and", "function" ]
train
https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/table/TableSliceGroup.java#L199-L201
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/ClassUtils.java
ClassUtils.getCanonicalName
public static String getCanonicalName(final Object object, final String valueIfNull) { """ <p>Gets the canonical name for an {@code Object}.</p> @param object the object for which to get the canonical class name; may be null @param valueIfNull the return value if null @return the canonical name of the object...
java
public static String getCanonicalName(final Object object, final String valueIfNull) { if (object == null) { return valueIfNull; } final String canonicalName = object.getClass().getCanonicalName(); return canonicalName == null ? valueIfNull : canonicalName; }
[ "public", "static", "String", "getCanonicalName", "(", "final", "Object", "object", ",", "final", "String", "valueIfNull", ")", "{", "if", "(", "object", "==", "null", ")", "{", "return", "valueIfNull", ";", "}", "final", "String", "canonicalName", "=", "obj...
<p>Gets the canonical name for an {@code Object}.</p> @param object the object for which to get the canonical class name; may be null @param valueIfNull the return value if null @return the canonical name of the object or {@code valueIfNull} @since 3.7 @see Class#getCanonicalName()
[ "<p", ">", "Gets", "the", "canonical", "name", "for", "an", "{", "@code", "Object", "}", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L1249-L1255
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/CmsAttributeHandler.java
CmsAttributeHandler.insertValueAfterReference
private void insertValueAfterReference(CmsEntity value, CmsAttributeValueView reference) { """ Inserts an entity value after the given reference.<p> @param value the entity value @param reference the reference """ int valueIndex = -1; if (reference.getElement().getNextSiblingElement() =...
java
private void insertValueAfterReference(CmsEntity value, CmsAttributeValueView reference) { int valueIndex = -1; if (reference.getElement().getNextSiblingElement() == null) { m_entity.addAttributeValue(m_attributeName, value); } else { valueIndex = reference.getValu...
[ "private", "void", "insertValueAfterReference", "(", "CmsEntity", "value", ",", "CmsAttributeValueView", "reference", ")", "{", "int", "valueIndex", "=", "-", "1", ";", "if", "(", "reference", ".", "getElement", "(", ")", ".", "getNextSiblingElement", "(", ")", ...
Inserts an entity value after the given reference.<p> @param value the entity value @param reference the reference
[ "Inserts", "an", "entity", "value", "after", "the", "given", "reference", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsAttributeHandler.java#L1264-L1296
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java
RegistriesInner.regenerateCredentialAsync
public Observable<RegistryListCredentialsResultInner> regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { """ Regenerates one of the login credentials for the specified container registry. @param resourceGroupName The name of the resource group to which the container re...
java
public Observable<RegistryListCredentialsResultInner> regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).map(new Func1<ServiceResponse<RegistryListCredentialsResultInner>, Regist...
[ "public", "Observable", "<", "RegistryListCredentialsResultInner", ">", "regenerateCredentialAsync", "(", "String", "resourceGroupName", ",", "String", "registryName", ",", "PasswordName", "name", ")", "{", "return", "regenerateCredentialWithServiceResponseAsync", "(", "resou...
Regenerates one of the login credentials for the specified container registry. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @param name Specifies name of the password which should be regenerated -- password or p...
[ "Regenerates", "one", "of", "the", "login", "credentials", "for", "the", "specified", "container", "registry", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java#L989-L996
jenkinsci/pipeline-maven-plugin
jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/MavenLinkerPublisher2.java
MavenLinkerPublisher2.process
@Override public synchronized void process(StepContext context, Element mavenSpyLogsElt) throws IOException, InterruptedException { """ Synchronize because {@link Run#addOrReplaceAction(hudson.model.Action)} is not thread safe """ Run<?, ?> run = context.get(Run.class); // we replace instea...
java
@Override public synchronized void process(StepContext context, Element mavenSpyLogsElt) throws IOException, InterruptedException { Run<?, ?> run = context.get(Run.class); // we replace instead of because we want to refresh the cache org.jenkinsci.plugins.pipeline.maven.publishers.MavenReport.getGen...
[ "@", "Override", "public", "synchronized", "void", "process", "(", "StepContext", "context", ",", "Element", "mavenSpyLogsElt", ")", "throws", "IOException", ",", "InterruptedException", "{", "Run", "<", "?", ",", "?", ">", "run", "=", "context", ".", "get", ...
Synchronize because {@link Run#addOrReplaceAction(hudson.model.Action)} is not thread safe
[ "Synchronize", "because", "{" ]
train
https://github.com/jenkinsci/pipeline-maven-plugin/blob/685d7dbb894fb4c976dbfa922e3caba8e8d5bed8/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/MavenLinkerPublisher2.java#L42-L47
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java
Configuration.getInt
public int getInt(String name, int defaultValue) { """ Get the value of the <code>name</code> property as an <code>int</code>. If no such property exists, or if the specified value is not a valid <code>int</code>, then <code>defaultValue</code> is returned. @param name property name. @param defaultValue de...
java
public int getInt(String name, int defaultValue) { String valueString = get(name); if (valueString == null) return defaultValue; try { String hexString = getHexDigits(valueString); if (hexString != null) { return Integer.parseInt(hexString, 16)...
[ "public", "int", "getInt", "(", "String", "name", ",", "int", "defaultValue", ")", "{", "String", "valueString", "=", "get", "(", "name", ")", ";", "if", "(", "valueString", "==", "null", ")", "return", "defaultValue", ";", "try", "{", "String", "hexStri...
Get the value of the <code>name</code> property as an <code>int</code>. If no such property exists, or if the specified value is not a valid <code>int</code>, then <code>defaultValue</code> is returned. @param name property name. @param defaultValue default value. @return property value as an <code>int</code>, or <co...
[ "Get", "the", "value", "of", "the", "<code", ">", "name<", "/", "code", ">", "property", "as", "an", "<code", ">", "int<", "/", "code", ">", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java#L474-L487
cybazeitalia/emaze-dysfunctional
src/main/java/net/emaze/dysfunctional/Consumers.java
Consumers.pipe
public static <E> void pipe(E[] array, OutputIterator<E> outputIterator) { """ Consumes the array into the output iterator. @param <E> the iterator element type @param array the array that will be consumed @param outputIterator the iterator that will be filled """ new ConsumeIntoOutputIterator<>(o...
java
public static <E> void pipe(E[] array, OutputIterator<E> outputIterator) { new ConsumeIntoOutputIterator<>(outputIterator).apply(new ArrayIterator<>(array)); }
[ "public", "static", "<", "E", ">", "void", "pipe", "(", "E", "[", "]", "array", ",", "OutputIterator", "<", "E", ">", "outputIterator", ")", "{", "new", "ConsumeIntoOutputIterator", "<>", "(", "outputIterator", ")", ".", "apply", "(", "new", "ArrayIterator...
Consumes the array into the output iterator. @param <E> the iterator element type @param array the array that will be consumed @param outputIterator the iterator that will be filled
[ "Consumes", "the", "array", "into", "the", "output", "iterator", "." ]
train
https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Consumers.java#L334-L336
jroyalty/jglm
src/main/java/com/hackoeur/jglm/support/FastMathCalc.java
FastMathCalc.splitReciprocal
static void splitReciprocal(final double in[], final double result[]) { """ Compute the reciprocal of in. Use the following algorithm. in = c + d. want to find x + y such that x+y = 1/(c+d) and x is much larger than y and x has several zero bits on the right. Set b = 1/(2^22), a = 1 - b. Thus (a+b) = 1. ...
java
static void splitReciprocal(final double in[], final double result[]) { final double b = 1.0/4194304.0; final double a = 1.0 - b; if (in[0] == 0.0) { in[0] = in[1]; in[1] = 0.0; } result[0] = a / in[0]; result[1] = (b*in[0]-a*in[1]) / (in[0]*in[0...
[ "static", "void", "splitReciprocal", "(", "final", "double", "in", "[", "]", ",", "final", "double", "result", "[", "]", ")", "{", "final", "double", "b", "=", "1.0", "/", "4194304.0", ";", "final", "double", "a", "=", "1.0", "-", "b", ";", "if", "...
Compute the reciprocal of in. Use the following algorithm. in = c + d. want to find x + y such that x+y = 1/(c+d) and x is much larger than y and x has several zero bits on the right. Set b = 1/(2^22), a = 1 - b. Thus (a+b) = 1. Use following identity to compute (a+b)/(c+d) (a+b)/(c+d) = a/c + (bc - ad) / ...
[ "Compute", "the", "reciprocal", "of", "in", ".", "Use", "the", "following", "algorithm", ".", "in", "=", "c", "+", "d", ".", "want", "to", "find", "x", "+", "y", "such", "that", "x", "+", "y", "=", "1", "/", "(", "c", "+", "d", ")", "and", "x...
train
https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMathCalc.java#L401-L429
lucee/Lucee
core/src/main/java/lucee/commons/io/ini/IniFile.java
IniFile.getKeyValue
public String getKeyValue(String strSection, String key) throws IOException { """ Gets the KeyValue attribute of the IniFile object @param strSection section to get @param key key to get @return matching alue @throws IOException """ Object o = getSection(strSection).get(key.toLowerCase()); if (o == nul...
java
public String getKeyValue(String strSection, String key) throws IOException { Object o = getSection(strSection).get(key.toLowerCase()); if (o == null) throw new IOException("key " + key + " doesn't exist in section " + strSection); return (String) o; }
[ "public", "String", "getKeyValue", "(", "String", "strSection", ",", "String", "key", ")", "throws", "IOException", "{", "Object", "o", "=", "getSection", "(", "strSection", ")", ".", "get", "(", "key", ".", "toLowerCase", "(", ")", ")", ";", "if", "(", ...
Gets the KeyValue attribute of the IniFile object @param strSection section to get @param key key to get @return matching alue @throws IOException
[ "Gets", "the", "KeyValue", "attribute", "of", "the", "IniFile", "object" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L143-L148
gocd/gocd
base/src/main/java/com/thoughtworks/go/util/DirectoryScanner.java
DirectoryScanner.accountForIncludedDir
private void accountForIncludedDir(String name, File file, boolean fast) { """ Process included directory. @param name path of the directory relative to the directory of the FileSet. @param file directory as File. @param fast whether to perform fast scans. """ processIncluded(name, file, dirsInclud...
java
private void accountForIncludedDir(String name, File file, boolean fast) { processIncluded(name, file, dirsIncluded, dirsExcluded, dirsDeselected); if (fast && couldHoldIncluded(name) && !contentsExcluded(name)) { scandir(file, name + File.separator, fast); } }
[ "private", "void", "accountForIncludedDir", "(", "String", "name", ",", "File", "file", ",", "boolean", "fast", ")", "{", "processIncluded", "(", "name", ",", "file", ",", "dirsIncluded", ",", "dirsExcluded", ",", "dirsDeselected", ")", ";", "if", "(", "fast...
Process included directory. @param name path of the directory relative to the directory of the FileSet. @param file directory as File. @param fast whether to perform fast scans.
[ "Process", "included", "directory", "." ]
train
https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/base/src/main/java/com/thoughtworks/go/util/DirectoryScanner.java#L1139-L1144
UrielCh/ovh-java-sdk
ovh-java-sdk-support/src/main/java/net/minidev/ovh/api/ApiOvhSupport.java
ApiOvhSupport.tickets_create_POST
public OvhNewMessageInfo tickets_create_POST(String body, OvhTicketCategoryEnum category, OvhTicketProductEnum product, String serviceName, OvhTicketSubCategoryEnum subcategory, String subject, OvhTicketTypeEnum type) throws IOException { """ Create a new ticket REST: POST /support/tickets/create @param produc...
java
public OvhNewMessageInfo tickets_create_POST(String body, OvhTicketCategoryEnum category, OvhTicketProductEnum product, String serviceName, OvhTicketSubCategoryEnum subcategory, String subject, OvhTicketTypeEnum type) throws IOException { String qPath = "/support/tickets/create"; StringBuilder sb = path(qPath); H...
[ "public", "OvhNewMessageInfo", "tickets_create_POST", "(", "String", "body", ",", "OvhTicketCategoryEnum", "category", ",", "OvhTicketProductEnum", "product", ",", "String", "serviceName", ",", "OvhTicketSubCategoryEnum", "subcategory", ",", "String", "subject", ",", "Ovh...
Create a new ticket REST: POST /support/tickets/create @param product [required] Ticket message product @param category [required] Ticket message category @param type [required] Ticket type (criticalIntervention requires VIP support level) @param body [required] Ticket message body @param serviceName [required] Ticket...
[ "Create", "a", "new", "ticket" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-support/src/main/java/net/minidev/ovh/api/ApiOvhSupport.java#L171-L184
Azure/azure-sdk-for-java
datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsInner.java
AccountsInner.listByResourceGroupWithServiceResponseAsync
public Observable<ServiceResponse<Page<DataLakeAnalyticsAccountBasicInner>>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { """ Gets the first page of Data Lake...
java
public Observable<ServiceResponse<Page<DataLakeAnalyticsAccountBasicInner>>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { return listByResourceGroupSingleP...
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "DataLakeAnalyticsAccountBasicInner", ">", ">", ">", "listByResourceGroupWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "filter", ",", "final", "Integer", ...
Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. @param resourceGroupName The name of the Azure resource group. @param filter OData filter. Optional. @param top The number of items to return. Optional. @param skip The number o...
[ "Gets", "the", "first", "page", "of", "Data", "Lake", "Analytics", "accounts", "if", "any", "within", "a", "specific", "resource", "group", ".", "This", "includes", "a", "link", "to", "the", "next", "page", "if", "any", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsInner.java#L566-L578
jhalterman/failsafe
src/main/java/net/jodah/failsafe/FailsafeExecutor.java
FailsafeExecutor.get
public <T extends R> T get(ContextualSupplier<T> supplier) { """ Executes the {@code supplier} until a successful result is returned or the configured policies are exceeded. @throws NullPointerException if the {@code supplier} is null @throws FailsafeException if the {@code supplier} fails with a checked Excep...
java
public <T extends R> T get(ContextualSupplier<T> supplier) { return call(execution -> Functions.supplierOf(supplier, execution)); }
[ "public", "<", "T", "extends", "R", ">", "T", "get", "(", "ContextualSupplier", "<", "T", ">", "supplier", ")", "{", "return", "call", "(", "execution", "->", "Functions", ".", "supplierOf", "(", "supplier", ",", "execution", ")", ")", ";", "}" ]
Executes the {@code supplier} until a successful result is returned or the configured policies are exceeded. @throws NullPointerException if the {@code supplier} is null @throws FailsafeException if the {@code supplier} fails with a checked Exception or if interrupted while waiting to perform a retry. @throws CircuitB...
[ "Executes", "the", "{", "@code", "supplier", "}", "until", "a", "successful", "result", "is", "returned", "or", "the", "configured", "policies", "are", "exceeded", "." ]
train
https://github.com/jhalterman/failsafe/blob/65fcd3a82f7b232d2ff59bc525a59d693dd8e223/src/main/java/net/jodah/failsafe/FailsafeExecutor.java#L80-L82
UrielCh/ovh-java-sdk
ovh-java-sdk-support/src/main/java/net/minidev/ovh/api/ApiOvhSupport.java
ApiOvhSupport.tickets_ticketId_reply_POST
public void tickets_ticketId_reply_POST(Long ticketId, String body) throws IOException { """ Reply to ticket REST: POST /support/tickets/{ticketId}/reply @param ticketId [required] internal ticket identifier @param body [required] text body of ticket response """ String qPath = "/support/tickets/{ticket...
java
public void tickets_ticketId_reply_POST(Long ticketId, String body) throws IOException { String qPath = "/support/tickets/{ticketId}/reply"; StringBuilder sb = path(qPath, ticketId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "body", body); exec(qPath, "POST", sb.toString(), o); }
[ "public", "void", "tickets_ticketId_reply_POST", "(", "Long", "ticketId", ",", "String", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/support/tickets/{ticketId}/reply\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",", "ticketId...
Reply to ticket REST: POST /support/tickets/{ticketId}/reply @param ticketId [required] internal ticket identifier @param body [required] text body of ticket response
[ "Reply", "to", "ticket" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-support/src/main/java/net/minidev/ovh/api/ApiOvhSupport.java#L36-L42
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/extractor/AbstractCodeElementExtractor.java
AbstractCodeElementExtractor.getContainerInRule
protected EObject getContainerInRule(EObject root, EObject content) { """ Replies the container in the grammar rule for the given content element. @param root the biggest enclosing element to consider in the grammar. @param content the grammar element to search for the container. @return the container of the ...
java
protected EObject getContainerInRule(EObject root, EObject content) { EObject container = content; do { final EClassifier classifier = getGeneratedTypeFor(container); if (classifier != null) { return container; } container = container.eContainer(); } while (container != root); final EClassifier ...
[ "protected", "EObject", "getContainerInRule", "(", "EObject", "root", ",", "EObject", "content", ")", "{", "EObject", "container", "=", "content", ";", "do", "{", "final", "EClassifier", "classifier", "=", "getGeneratedTypeFor", "(", "container", ")", ";", "if",...
Replies the container in the grammar rule for the given content element. @param root the biggest enclosing element to consider in the grammar. @param content the grammar element to search for the container. @return the container of the content.
[ "Replies", "the", "container", "in", "the", "grammar", "rule", "for", "the", "given", "content", "element", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/extractor/AbstractCodeElementExtractor.java#L157-L171
dmak/jaxb-xew-plugin
src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java
CommonUtils.setPrivateField
public static void setPrivateField(Object obj, String fieldName, Object newValue) { """ Set the {@code newValue} to private field {@code fieldName} of given object {@code obj}. @throws IllegalArgumentException if given field was not found """ try { FieldUtils.writeField(obj, fieldName, newValue, true)...
java
public static void setPrivateField(Object obj, String fieldName, Object newValue) { try { FieldUtils.writeField(obj, fieldName, newValue, true); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
[ "public", "static", "void", "setPrivateField", "(", "Object", "obj", ",", "String", "fieldName", ",", "Object", "newValue", ")", "{", "try", "{", "FieldUtils", ".", "writeField", "(", "obj", ",", "fieldName", ",", "newValue", ",", "true", ")", ";", "}", ...
Set the {@code newValue} to private field {@code fieldName} of given object {@code obj}. @throws IllegalArgumentException if given field was not found
[ "Set", "the", "{", "@code", "newValue", "}", "to", "private", "field", "{", "@code", "fieldName", "}", "of", "given", "object", "{", "@code", "obj", "}", "." ]
train
https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java#L180-L187
kite-sdk/kite
kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/PartitionKey.java
PartitionKey.partitionKeyForEntity
public static <E> PartitionKey partitionKeyForEntity(PartitionStrategy strategy, E entity, EntityAccessor<E> accessor) { """ <p> Construct a partition key for the given entity. </p> <p> This is a convenient way to find the partition that a given entity is written to, or to find a partition using objects...
java
public static <E> PartitionKey partitionKeyForEntity(PartitionStrategy strategy, E entity, EntityAccessor<E> accessor) { return partitionKeyForEntity(strategy, entity, accessor, null); }
[ "public", "static", "<", "E", ">", "PartitionKey", "partitionKeyForEntity", "(", "PartitionStrategy", "strategy", ",", "E", "entity", ",", "EntityAccessor", "<", "E", ">", "accessor", ")", "{", "return", "partitionKeyForEntity", "(", "strategy", ",", "entity", "...
<p> Construct a partition key for the given entity. </p> <p> This is a convenient way to find the partition that a given entity is written to, or to find a partition using objects from the entity domain. </p>
[ "<p", ">", "Construct", "a", "partition", "key", "for", "the", "given", "entity", ".", "<", "/", "p", ">", "<p", ">", "This", "is", "a", "convenient", "way", "to", "find", "the", "partition", "that", "a", "given", "entity", "is", "written", "to", "or...
train
https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/PartitionKey.java#L83-L86
box/box-java-sdk
src/main/java/com/box/sdk/BoxLegalHoldPolicy.java
BoxLegalHoldPolicy.getAll
public static Iterable<BoxLegalHoldPolicy.Info> getAll(final BoxAPIConnection api) { """ Retrieves a list of Legal Hold Policies that belong to your Enterprise as an Iterable. @param api api the API connection to be used by the resource. @return the Iterable of Legal Hold Policies in your Enterprise. """ ...
java
public static Iterable<BoxLegalHoldPolicy.Info> getAll(final BoxAPIConnection api) { return getAll(api, null, DEFAULT_LIMIT); }
[ "public", "static", "Iterable", "<", "BoxLegalHoldPolicy", ".", "Info", ">", "getAll", "(", "final", "BoxAPIConnection", "api", ")", "{", "return", "getAll", "(", "api", ",", "null", ",", "DEFAULT_LIMIT", ")", ";", "}" ]
Retrieves a list of Legal Hold Policies that belong to your Enterprise as an Iterable. @param api api the API connection to be used by the resource. @return the Iterable of Legal Hold Policies in your Enterprise.
[ "Retrieves", "a", "list", "of", "Legal", "Hold", "Policies", "that", "belong", "to", "your", "Enterprise", "as", "an", "Iterable", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxLegalHoldPolicy.java#L161-L163
Azure/azure-sdk-for-java
storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java
StorageAccountsInner.getManagementPoliciesAsync
public Observable<StorageAccountManagementPoliciesInner> getManagementPoliciesAsync(String resourceGroupName, String accountName) { """ Gets the data policy rules associated with the specified storage account. @param resourceGroupName The name of the resource group within the user's subscription. The name is ca...
java
public Observable<StorageAccountManagementPoliciesInner> getManagementPoliciesAsync(String resourceGroupName, String accountName) { return getManagementPoliciesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<StorageAccountManagementPoliciesInner>, StorageAccountManagementP...
[ "public", "Observable", "<", "StorageAccountManagementPoliciesInner", ">", "getManagementPoliciesAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ")", "{", "return", "getManagementPoliciesWithServiceResponseAsync", "(", "resourceGroupName", ",", "accoun...
Gets the data policy rules associated with the specified storage account. @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3...
[ "Gets", "the", "data", "policy", "rules", "associated", "with", "the", "specified", "storage", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java#L1227-L1234
OpenLiberty/open-liberty
dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/JSONAssetConverter.java
JSONAssetConverter.writeValue
public static void writeValue(OutputStream stream, Object pojo) throws IOException { """ Write a JSON representation of the asset to a stream @param stream The stream to write to @param pojo The asset to write @throws IOException """ DataModelSerializer.serializeAsStream(pojo, stream); }
java
public static void writeValue(OutputStream stream, Object pojo) throws IOException { DataModelSerializer.serializeAsStream(pojo, stream); }
[ "public", "static", "void", "writeValue", "(", "OutputStream", "stream", ",", "Object", "pojo", ")", "throws", "IOException", "{", "DataModelSerializer", ".", "serializeAsStream", "(", "pojo", ",", "stream", ")", ";", "}" ]
Write a JSON representation of the asset to a stream @param stream The stream to write to @param pojo The asset to write @throws IOException
[ "Write", "a", "JSON", "representation", "of", "the", "asset", "to", "a", "stream" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/JSONAssetConverter.java#L36-L38
dustin/java-memcached-client
src/main/java/net/spy/memcached/tapmessage/Util.java
Util.fieldToValue
public static long fieldToValue(byte[] buffer, int offset, int length) { """ Converts a field in a byte array into a value. @param buffer The byte array that contains the value @param offset The offset of where the value begins in the byte array @param length The length of the field to be converted @return A...
java
public static long fieldToValue(byte[] buffer, int offset, int length) { long total = 0; long val = 0; for (int i = 0; i < length; i++) { val = buffer[offset + i]; if (val < 0) { val = val + 256; } total += (long) Math.pow(256.0, (double) (length - 1 - i)) * val; } re...
[ "public", "static", "long", "fieldToValue", "(", "byte", "[", "]", "buffer", ",", "int", "offset", ",", "int", "length", ")", "{", "long", "total", "=", "0", ";", "long", "val", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "l...
Converts a field in a byte array into a value. @param buffer The byte array that contains the value @param offset The offset of where the value begins in the byte array @param length The length of the field to be converted @return A long that represent the value of the field
[ "Converts", "a", "field", "in", "a", "byte", "array", "into", "a", "value", "." ]
train
https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/tapmessage/Util.java#L43-L54
CodeNarc/CodeNarc
src/main/java/org/codenarc/rule/AbstractRule.java
AbstractRule.createViolationForImport
protected Violation createViolationForImport(SourceCode sourceCode, String className, String alias, String violationMessage) { """ Create and return a new Violation for this rule and the specified import className and alias @param sourceCode - the SourceCode @param className - the class name (as specified within...
java
protected Violation createViolationForImport(SourceCode sourceCode, String className, String alias, String violationMessage) { Map importInfo = ImportUtil.sourceLineAndNumberForImport(sourceCode, className, alias); Violation violation = new Violation(); violation.setRule(this); violation...
[ "protected", "Violation", "createViolationForImport", "(", "SourceCode", "sourceCode", ",", "String", "className", ",", "String", "alias", ",", "String", "violationMessage", ")", "{", "Map", "importInfo", "=", "ImportUtil", ".", "sourceLineAndNumberForImport", "(", "s...
Create and return a new Violation for this rule and the specified import className and alias @param sourceCode - the SourceCode @param className - the class name (as specified within the import statement) @param alias - the alias for the import statement @param violationMessage - the violation message; may be null @ret...
[ "Create", "and", "return", "a", "new", "Violation", "for", "this", "rule", "and", "the", "specified", "import", "className", "and", "alias" ]
train
https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/rule/AbstractRule.java#L239-L247
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/classify/LinearClassifier.java
LinearClassifier.getFeatureCount
public int getFeatureCount(Set<L> labels, double threshold, boolean useMagnitude) { """ Returns number of features with weight above a certain threshold @param labels Set of labels we care about when counting features Use null to get counts across all labels @param threshold Threshold above which we will count...
java
public int getFeatureCount(Set<L> labels, double threshold, boolean useMagnitude) { if (labels != null) { Set<Integer> iLabels = getLabelIndices(labels); return getFeatureCountLabelIndices(iLabels, threshold, useMagnitude); } else { return getFeatureCount(threshold, useMagnitude); ...
[ "public", "int", "getFeatureCount", "(", "Set", "<", "L", ">", "labels", ",", "double", "threshold", ",", "boolean", "useMagnitude", ")", "{", "if", "(", "labels", "!=", "null", ")", "{", "Set", "<", "Integer", ">", "iLabels", "=", "getLabelIndices", "("...
Returns number of features with weight above a certain threshold @param labels Set of labels we care about when counting features Use null to get counts 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 fea...
[ "Returns", "number", "of", "features", "with", "weight", "above", "a", "certain", "threshold" ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/LinearClassifier.java#L393-L401